query_id
stringlengths 32
32
| query
stringlengths 7
6.75k
| positive_passages
listlengths 1
1
| negative_passages
listlengths 88
101
|
---|---|---|---|
7f28bca47fbc95bbb7bf833d3b0826c3
|
Return the result element corresponding to the input vector index index. FIXME We really need a better way of delaying with two index values, e.g. one for results and one for bar values. We need to unify them at some point or (gag) invent an offseted array class which tracks offsets and does the right thing.
|
[
{
"docid": "18130d6a81ecfa382bebedc2f5ae1d27",
"score": "0.6178532",
"text": "def result_at(time_or_index, slot)\n begin\n case time_or_index\n when Time then result_hash[slot][time2index(time_or_index)-result_offset]\n when Numeric then result_hash[slot][time_or_index-result_offset]\n when NilClass then nil\n else\n raise ArgumentError, \"first arg must be a Time or a Fixnum, instead was #{time_or_index}\"\n end\n rescue Exception => e\n logger.error \"can't find index #{time_or_index} @ slot: #{slot}: #{e.to_s}\" if logger\n return -0.0\n end\n end",
"title": ""
}
] |
[
{
"docid": "06e1274e49578d76afbee0e9e932023c",
"score": "0.6792804",
"text": "def [](idx)\n process_results unless @processed\n @results[idx]\n end",
"title": ""
},
{
"docid": "ac8516d6e03cc3f04cb43a1681067365",
"score": "0.6555767",
"text": "def [](index)\n execute\n return @result[index]\n end",
"title": ""
},
{
"docid": "f874f1635f9a198bbd15a047934a87e9",
"score": "0.6289096",
"text": "def result(index=nil)\n if index.class == Fixnum && !block_given?\n return ::Vertx::Util::Utils.from_object(@j_del.java_method(:result, [Java::int.java_class]).call(index))\n end\n raise ArgumentError, \"Invalid arguments when calling result(index)\"\n end",
"title": ""
},
{
"docid": "1ff990b761af47d23fa8ed814102c9e4",
"score": "0.61600184",
"text": "def [](index, *indexes)\n if indexes.empty?\n case index\n when Range\n range = \n if index.first.is_a?(Numeric)\n index\n else\n first = numeric_index_for index.first\n last = numeric_index_for index.last\n\n (first..last)\n end\n\n indexes = @index.to_a[range]\n else\n pos = numeric_index_for index\n return (pos ? @vector[pos] : nil)\n end\n else\n indexes.unshift index\n end\n Daru::Vector.new indexes.map { |index| @vector[@index[index]] },name: @name, \n index: indexes\n end",
"title": ""
},
{
"docid": "e69c35273b0a1f244995da363db2d7c8",
"score": "0.6155348",
"text": "def by_index(index)\n @arr[index]\n end",
"title": ""
},
{
"docid": "cd0ec5c13ebe4778147abb81c40c22ba",
"score": "0.6097725",
"text": "def returned_accumulator_index(return_values, accumulator_name, element_name); end",
"title": ""
},
{
"docid": "18ccea5c87282b7595e8400c1848fbf7",
"score": "0.6073928",
"text": "def at(index)\n each.with_index { |v, i| return v if i == index }\n return nil\n end",
"title": ""
},
{
"docid": "4fd74f906f8bdeb64026e35b81fd49cc",
"score": "0.60080516",
"text": "def index(element); end",
"title": ""
},
{
"docid": "5a15a31bd796292baf6629ed5b41fa29",
"score": "0.6005351",
"text": "def [](index)\n @val[index]\n end",
"title": ""
},
{
"docid": "88277b2fc8ee36064272356f9a208d5f",
"score": "0.5981294",
"text": "def retrieve_element_from_index(array, index_number)\n return array[index_number]\nend",
"title": ""
},
{
"docid": "eb57fe3beeeba44ae07d5e8aa4ac3aaa",
"score": "0.59600616",
"text": "def [](index)\n return @elements[index] if index.kind_of? Numeric\n return @element_map[index] if @element_map[index] \n return @element_map[index.to_s] \n end",
"title": ""
},
{
"docid": "8ff383df5919fa13e0253393cf6206b5",
"score": "0.5955788",
"text": "def [](index)\n i = 0\n each { |x| return x if i == index; i += 1 }\n nil # out of index\n end",
"title": ""
},
{
"docid": "3a2c9d881d76654e32f07c6a799be4c2",
"score": "0.5910639",
"text": "def retrieve_element_from_index(array, index_number)\n array[index_number]\nend",
"title": ""
},
{
"docid": "3a2c9d881d76654e32f07c6a799be4c2",
"score": "0.5910639",
"text": "def retrieve_element_from_index(array, index_number)\n array[index_number]\nend",
"title": ""
},
{
"docid": "3a99a97e005e011b845ee5f405b3ea9e",
"score": "0.59069717",
"text": "def indexvalue\n if multiple?\n @value.map {|v| single_indexvalue v }\n else\n single_indexvalue @value\n end\n end",
"title": ""
},
{
"docid": "57e63f0e90792f35790241b6a4564dc8",
"score": "0.5867978",
"text": "def index_of element\n @index.key @vector.index(element)\n end",
"title": ""
},
{
"docid": "47f4b07475db7815ceb5589830b9b1da",
"score": "0.582135",
"text": "def [](indx)\n elements[indx]\n end",
"title": ""
},
{
"docid": "6abf885e0a7904cfcb9f61f6b3bb0317",
"score": "0.5757296",
"text": "def [](arg)\n @results[arg]\n end",
"title": ""
},
{
"docid": "255e469d2d129e5171a1e9acd7ca2464",
"score": "0.5753465",
"text": "def [](index)\n if @values.include?(index)\n return @values[index]\n else\n return @default\n end\n end",
"title": ""
},
{
"docid": "eed9bb53b791a57fa1addde978a4fadc",
"score": "0.57530224",
"text": "def get_index(index)\n return self.at(index)\n end",
"title": ""
},
{
"docid": "728f31a630b956de9b7e28f05a22e81f",
"score": "0.57528394",
"text": "def compile_index(scope, arr, index)\n source = compile_eval_arg(scope, arr)\n r = @e.with_register do |reg|\n @e.movl(source, reg)\n @e.pushl(reg)\n \n source = compile_eval_arg(scope, index)\n @e.save_result(source)\n @e.sall(2, @e.result_value)\n @e.popl(reg)\n @e.addl(@e.result_value, reg)\n end\n return [:indirect, r]\n end",
"title": ""
},
{
"docid": "1332562638926cc6cab69df546eaf0fb",
"score": "0.5748301",
"text": "def [](i)\n \t@vector[i] \n end",
"title": ""
},
{
"docid": "a153a115c918a7e92b1d3d6479a78458",
"score": "0.5742915",
"text": "def [](*index)\n\n if (index.size != 0)\n @local_index[*index]\n elsif (@local_iterator)\n @local_iterator.get_current\n else\n raise \"No iterator defined! Cannot get element\"\n end\n\n end",
"title": ""
},
{
"docid": "652e08b2d857a0b79d18097863b2ef03",
"score": "0.5742196",
"text": "def element_at(arr, index)\n arr[index]\nend",
"title": ""
},
{
"docid": "d20e24da78abd7d3d394a3592b7b2551",
"score": "0.5731266",
"text": "def result\n results[0]\n end",
"title": ""
},
{
"docid": "d7e2e8d676aadc456544d8226b3096ad",
"score": "0.5705794",
"text": "def [](index)\n raise_future_proof_exception unless finished?\n values[index]\n end",
"title": ""
},
{
"docid": "7bfc2f0f46c6a75f939d33ffa1ef4d64",
"score": "0.5676091",
"text": "def values_at(index, vals)\n vals = vals.map { |v| value_hash[v][index] }\n vals\n end",
"title": ""
},
{
"docid": "6511b4cad657e3c84ecbf08f97309bac",
"score": "0.5670983",
"text": "def get_val_at_index(index)\n if index_valid?(index)\n current_node = @head\n i = 0\n while i < index\n current_node = current_node.next_node\n i += 1\n end\n current_node.val\n end\n end",
"title": ""
},
{
"docid": "afab2a40acf3cc123e55edc92dc5ee66",
"score": "0.565925",
"text": "def ele_index(class_name, index)\n results = tags(class_name)\n if index == 'last()'\n index = results.length\n index -= 1 if index >= 0\n else\n raise 'Index must be >= 1' unless index >= 1\n\n index -= 1 if index >= 1\n end\n\n # uiautomator has issues with index/instance so calculate the index\n # client side.\n results[index]\n end",
"title": ""
},
{
"docid": "d7d76bb4b27b1e7a148aab314e16dc58",
"score": "0.56584555",
"text": "def ele_index(class_name, index)\n raise 'Index must be >= 1' unless index == 'last()' || (index.is_a?(Integer) && index >= 1)\n\n elements = tags(class_name)\n\n if index == 'last()'\n result = elements.last\n else\n # elements array is 0 indexed\n index -= 1\n result = elements[index]\n end\n\n raise _no_such_element if result.nil?\n\n result\n end",
"title": ""
},
{
"docid": "8dc4f3d9273165269bbe82c8ff51131c",
"score": "0.56552655",
"text": "def [](index)\n @index[index]\n end",
"title": ""
},
{
"docid": "ef31cb59558244f2e674acb2aa69ddbe",
"score": "0.56237096",
"text": "def [](*indexes)\n location = indexes[0]\n if @index.is_a?(MultiIndex)\n result = \n if location.is_a?(Integer)\n element_from_numeric_index(location)\n elsif location.is_a?(Range)\n arry = location.inject([]) do |memo, num|\n memo << element_from_numeric_index(num)\n memo\n end\n\n new_index = Daru::MultiIndex.new(@index.to_a[location])\n Daru::Vector.new(arry, index: new_index, name: @name, dtype: dtype)\n else\n sub_index = @index[indexes]\n\n if sub_index.is_a?(Integer)\n element_from_numeric_index(sub_index)\n else\n elements = sub_index.map do |tuple|\n @data[@index[(indexes + tuple)]]\n end\n Daru::Vector.new(elements, index: Daru::MultiIndex.new(sub_index.to_a),\n name: @name, dtype: @dtype)\n end\n end\n\n return result\n else\n unless indexes[1]\n case location\n when Range\n range = \n if location.first.is_a?(Numeric)\n location\n else\n first = location.first\n last = location.last\n\n (first..last)\n end\n indexes = @index[range]\n else\n return element_from_numeric_index(location)\n end\n end\n\n Daru::Vector.new indexes.map { |loc| @data[index_for(loc)] }, name: @name, \n index: indexes.map { |e| named_index_for(e) }, dtype: @dtype\n end\n end",
"title": ""
},
{
"docid": "51cc005455891dd666fc59324d11d1a2",
"score": "0.5620413",
"text": "def extract_element(vector, idx, name = \"\")\n error = element_error(vector, idx)\n\n raise ArgumentError, \"Error building extract_element with #{error}\" if error\n\n ins = C.build_extract_element(self, vector, idx, name)\n Instruction.from_ptr(ins)\n end",
"title": ""
},
{
"docid": "7fdcf96ff23edc724f28cb55ca6578de",
"score": "0.5602925",
"text": "def compile_index(scope, arr, index)\n source = compile_eval_arg(scope, arr)\n reg = nil #This is needed to retain |reg|\n @e.with_register do |reg|\n @e.movl(source, reg)\n source = compile_eval_arg(scope, index)\n @e.save_result(source)\n @e.sall(2, @e.result_value)\n @e.addl(@e.result_value, reg)\n end\n return [:indirect, reg]\n end",
"title": ""
},
{
"docid": "c8b09b6deea60162c2d3c85df31b8dc2",
"score": "0.55985695",
"text": "def get(index)\n \n end",
"title": ""
},
{
"docid": "9723ef4f084d431e2e9e5e5fb79c0df1",
"score": "0.55887306",
"text": "def get_item(index_num)\r\n @arr.fetch(index_num)\r\n end",
"title": ""
},
{
"docid": "32707388ee934a1c3d65af6c286bd3af",
"score": "0.55790704",
"text": "def index(p0) end",
"title": ""
},
{
"docid": "32707388ee934a1c3d65af6c286bd3af",
"score": "0.55790704",
"text": "def index(p0) end",
"title": ""
},
{
"docid": "9444307c2eb8513bd0305a035e3a8920",
"score": "0.55745584",
"text": "def [](index)\n @values[index]\n end",
"title": ""
},
{
"docid": "d43a526b5433c9911a2af695b0e958d0",
"score": "0.5572279",
"text": "def [](index)\n @values[index]\n end",
"title": ""
},
{
"docid": "93cff651b8bbfff01ae2bf33554c69a2",
"score": "0.5558924",
"text": "def [](index)\n return get(index)\n end",
"title": ""
},
{
"docid": "0a964da316eadb9aae4bf71a233f44fe",
"score": "0.55548376",
"text": "def at(index); end",
"title": ""
},
{
"docid": "7fc6f462bca11f1f970df9f0375d9b77",
"score": "0.5548709",
"text": "def get_at_index(index)\n raise NotImplementedError, \"Please implement get_at_index\"\n end",
"title": ""
},
{
"docid": "8b25ecd4b8966a91851b74d7e17b4a2c",
"score": "0.5527775",
"text": "def operand(index = 0)\n operands[index]\n end",
"title": ""
},
{
"docid": "f326b374c12df6cd25dc084811b39940",
"score": "0.55185676",
"text": "def at(index)\n if index >= self.size\n puts \"index out of range.\"\n else\n each_with_index do |node, i|\n return node.value\n end\n end\n end",
"title": ""
},
{
"docid": "d876c527ce7a00732f71eaa221082e0d",
"score": "0.55098844",
"text": "def item(index = self.index)\n return @data[index]\n end",
"title": ""
},
{
"docid": "4c43530c2fe3d9f544dd2ac11b1cd6d8",
"score": "0.550089",
"text": "def at(index)\n \t@array[index]\n end",
"title": ""
},
{
"docid": "97dc66411ceb12949cb09de1875e890e",
"score": "0.54896617",
"text": "def [](idx)\n\t\t@bar[idx]\n\tend",
"title": ""
},
{
"docid": "26c1daedc493d610d43ad76bcc044c13",
"score": "0.5480548",
"text": "def get(index) \n assert_in_range index\n node, previous = get_node(index)\n node.value\n end",
"title": ""
},
{
"docid": "65a6b1771c97d0345840947534214d25",
"score": "0.5467249",
"text": "def []( index )\n feedme while !@done and index >= @truth.size\n return @truth[index]\n end",
"title": ""
},
{
"docid": "4628c15f19907f69cf985d9211b1e6fd",
"score": "0.5463534",
"text": "def at(index)\n self[index]\n end",
"title": ""
},
{
"docid": "d5238b018bc8701ee4c7c4c9709c6b03",
"score": "0.5460747",
"text": "def [](index)\n cast get(index)\n end",
"title": ""
},
{
"docid": "7262df59e8c08255b800f5ff3fb78d54",
"score": "0.5453157",
"text": "def index_of element\n @index.key @data.index(element)\n end",
"title": ""
},
{
"docid": "a18f8e320307a766f15a912b46330dd4",
"score": "0.5447653",
"text": "def get(index)\n current = get_next\n index.times { current = get_next(current) }\n current\n end",
"title": ""
},
{
"docid": "67aa479dc0784e1647a646dde68300d3",
"score": "0.5446339",
"text": "def element_at(arr, index)\n # return the element of the Array variable `arr` at the position `index`\n # arr.at(index) # or\n # arr[index]\n arr[index] \n end",
"title": ""
},
{
"docid": "3ef0f2b5da91ec8caec9d6bcd7f502bf",
"score": "0.54320323",
"text": "def at( index )\r\n @ary.at(index + @offset)\r\n end",
"title": ""
},
{
"docid": "cad82b66ba550bd8d231517821d34ae8",
"score": "0.54144657",
"text": "def [](index)\n all[index]\n end",
"title": ""
},
{
"docid": "2b97c7883277b226268572aeacb9f314",
"score": "0.5414127",
"text": "def get(index = nil)\n @local_index.get(index)\n end",
"title": ""
},
{
"docid": "3804fcaec75c00181035e301fb38565d",
"score": "0.54100543",
"text": "def get_result(key)\n return @outputs[key]\n end",
"title": ""
},
{
"docid": "3dd9145ab0c82c79ce585ebfc275982b",
"score": "0.54038554",
"text": "def element_at(arr, index)\n arr[index]\n # or arr.at(index)\nend",
"title": ""
},
{
"docid": "1277375451a16655cceef6d797529f03",
"score": "0.53991324",
"text": "def [](index)\n case index\n when Integer\n values[index]\n when self\n values[index.index]\n else\n name = index.to_s\n case name\n when /\\A(\\d+)\\Z/\n return values[$1.to_i]\n when /\\A[a-z]/\n name = name.to_str.gsub(/(?:\\A|_)(.)/) { $1.upcase }\n end\n with_name(name)\n end\n end",
"title": ""
},
{
"docid": "a284649af8f5798dee0a6e1c4f59ac29",
"score": "0.5397715",
"text": "def [](key)\n if @result.include?(key)\n @result[key]\n else\n data[key]\n end\n end",
"title": ""
},
{
"docid": "a4c8d39dcceb774b8e943305fc392cff",
"score": "0.5395213",
"text": "def [](index) # i.e. array style index lookup.\n end",
"title": ""
},
{
"docid": "fe66a3b3294721d7e220e7d75313e603",
"score": "0.53895664",
"text": "def extract(collection, index)\n val = Convert(collection)\n if val.type.kind == :vector\n @builder.extract_element(val, Convert(index, :integer))\n else\n @builder.extract_value(val, index.to_i)\n end\n end",
"title": ""
},
{
"docid": "fe9012b24da7c10cf4f3e58c54d70383",
"score": "0.5385733",
"text": "def get_at_index(index)\n return nil if index > length\n return get_at_index_helper(index, 0, @head)\n end",
"title": ""
},
{
"docid": "f1a0596d3756022ec6e80b5b816857f9",
"score": "0.53827345",
"text": "def element_at(arr, index)\n # return the element of the Array variable `arr` at the position `index`\n # arr.at(index) # or\n # arr[index]\n return arr[index]\nend",
"title": ""
},
{
"docid": "9100264f33cd3b88c425ce74d5342939",
"score": "0.53805494",
"text": "def next_result()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "e4acd7d775323e97e674f75ae9d30c3e",
"score": "0.5372712",
"text": "def at_index(index)\n find_by_index(index)\n current\n end",
"title": ""
},
{
"docid": "5ac6d212b7359f92b9a97d76fd1ae066",
"score": "0.536412",
"text": "def outidx\n @index_range.begin\n end",
"title": ""
},
{
"docid": "cf7ec2d38a48ce045ae41e3560ab9a11",
"score": "0.53555816",
"text": "def result\n results.first\n end",
"title": ""
},
{
"docid": "93c1bc9dbcf45136a159f3af3db9b891",
"score": "0.53511393",
"text": "def [](key)\n res = @index[key]\n res\n end",
"title": ""
},
{
"docid": "f453013c24572d7f2b4455d374d24003",
"score": "0.5335219",
"text": "def get_scalar\n @local_index.get_scalar\n end",
"title": ""
},
{
"docid": "dceb9c038bb2a7e645f38ee1eac177a3",
"score": "0.53303975",
"text": "def element_at(arr, index)\n # return the element of the Array variable `arr` at the position `index`\n # arr.at(index) # or\n # arr[index]\n arr[index]\nend",
"title": ""
},
{
"docid": "a488c61d62270b45b5065c39d55753f7",
"score": "0.5328079",
"text": "def aget(index)\n end",
"title": ""
},
{
"docid": "27cc4b783408ac500385d7f9c853599e",
"score": "0.5325125",
"text": "def get(index)\n args[index]\n end",
"title": ""
},
{
"docid": "8d8e77c79f84f45edb5b5f48703a6243",
"score": "0.53164583",
"text": "def get_item(index_number)\n @chores[index_number]\n end",
"title": ""
},
{
"docid": "0efb5d20ef815ca638228d4d607bee32",
"score": "0.53128314",
"text": "def get(index)\n\t\tdir = index > @length/2? -1: 1\n\t\tgo(dir: dir, index: index)\n\tend",
"title": ""
},
{
"docid": "98df3be4a0f5f5a6abc4a64f51f09bd5",
"score": "0.53086674",
"text": "def item(index = self.index)\n @data[index]\n end",
"title": ""
},
{
"docid": "1e8063040c0dbd23e0afc9a0293238d7",
"score": "0.5306272",
"text": "def rindex(p0) end",
"title": ""
},
{
"docid": "8218284b8417ec23f63220e49425c95f",
"score": "0.5301626",
"text": "def get(index)\n @array_list.get(index)\n end",
"title": ""
},
{
"docid": "da9b92ae38a9bf179633998b7a7b8cb2",
"score": "0.5300297",
"text": "def get(index)\n\t\traise OutOfBoundsException if index >= @size\n\t\t@data[index]\n\tend",
"title": ""
},
{
"docid": "da9b92ae38a9bf179633998b7a7b8cb2",
"score": "0.5300297",
"text": "def get(index)\n\t\traise OutOfBoundsException if index >= @size\n\t\t@data[index]\n\tend",
"title": ""
},
{
"docid": "24693211d2637efea41c613a3628d063",
"score": "0.52765787",
"text": "def []( index )\n reg = to_reg()\n reg[index]\n end",
"title": ""
},
{
"docid": "c734147c9007406453a903062c492700",
"score": "0.52591664",
"text": "def [](i)\n case i\n when Range\n Vector[*to_a.slice(i)]\n else\n index(i)\n end\n end",
"title": ""
},
{
"docid": "20e894470e01c4aeb1c2bde8dae79405",
"score": "0.52528787",
"text": "def [](index)\n return @scales[index]\n end",
"title": ""
},
{
"docid": "8bdc5c704b7ce769a293855814d77566",
"score": "0.5247257",
"text": "def index_to_input(index)\n (index + 1).to_s\n end",
"title": ""
},
{
"docid": "a12842b260b340969ea84b5b2dbb789b",
"score": "0.5236554",
"text": "def getIndex (x,y)\n return y*10 + x\n end",
"title": ""
},
{
"docid": "5c0513dd51b351f3d72457c6e0fe2a7e",
"score": "0.523473",
"text": "def [](index)\n raise TypeError unless index.kind_of? Numeric\n raise IndexError if index >= @queries.length\n @queries[index]\n end",
"title": ""
},
{
"docid": "7f3533bd7f3c9c5f0a8583cd25a59aef",
"score": "0.5234492",
"text": "def []( index )\r\n @ary.at(index + @offset)\r\n end",
"title": ""
},
{
"docid": "a1553626565ecf81f3df1094c9b8564e",
"score": "0.5233434",
"text": "def get_at_index(index)\n # initialize current to head\n current = @head\n # account for index being greater than list length\n if index + 1 > length\n return nil\n # otherwise, move current to index\n else \n index.times do \n current = current.next\n end\n end\n # return value at indexed node\n return current.data\n end",
"title": ""
},
{
"docid": "2e18386915180ad005936e03a346a8d4",
"score": "0.52325636",
"text": "def [](index)\n get(index)\n end",
"title": ""
},
{
"docid": "01e3755fff0d9c25bd12bb07ce740aa6",
"score": "0.5224484",
"text": "def [](index); @data[index]; end",
"title": ""
},
{
"docid": "c1e91ede8ea8a7f194faeb34afeb684c",
"score": "0.5211608",
"text": "def get(index)\n raise \"Only positive indexes, #{index}\" if index <= 0\n if index > self.get_length\n return nil\n else\n return internal_object_get(index + 1)\n end\n end",
"title": ""
},
{
"docid": "8a099a655d1df7b4538fba5a80d11510",
"score": "0.5210273",
"text": "def index2time(index)\n case\n when index.nil? then nil\n when model == DailyBar then time_map.index2time(index)\n when index > 0 && index < timevec.length then timevec[index]\n when index < 0 then raise ArgumentError, \"index [#(index}] is negative\"\n raise ArgumentError, \"index [#(index}] is ouside of the range of bars, the maximum of which is #{timevec.length-1}\"\n end\n end",
"title": ""
},
{
"docid": "5fc4162897bfb99585c754b609df765f",
"score": "0.5197176",
"text": "def read_result(index=nil)\n\t\tindex=0 if (!index)\n\t\tres=nil\n\t\tbegin\n\t\t\t0.upto(index-1) { |i| Marshal.load(@fp) }\n\t\t\tres=Marshal.load(@fp)\n\t\trescue\n\t\t\tSD::Log.msg('Err',\n\t\t\t \"BaseResultFile.read_result file reading error for index: #{index}\", $!)\n\t\t\tres=nil\n\t\tend\n\t\treturn res\n\tend",
"title": ""
},
{
"docid": "227c80e208871a9a9239da14314eb9c3",
"score": "0.5192038",
"text": "def compile_bindex(scope, arr, index)\n source = compile_eval_arg(scope, arr)\n @e.pushl(source)\n source = compile_eval_arg(scope, index)\n r = @e.with_register do |reg|\n @e.popl(reg)\n @e.save_result(source)\n @e.addl(@e.result_value, reg)\n end\n return [:indirect8, r]\n end",
"title": ""
},
{
"docid": "a996944aef3582b41d1e418829b7f12d",
"score": "0.51847625",
"text": "def [](index); end",
"title": ""
},
{
"docid": "ace99df3849b1aef6eb00de081a1cbf6",
"score": "0.51790243",
"text": "def input_to_index(input)\n return input.to_i - 1\n #idx = [inpu - 1]\n # return idx\nend",
"title": ""
},
{
"docid": "b3eeca85c435795be48cd90ec0cf9478",
"score": "0.51746666",
"text": "def array_sum_with_index(arr)\n arr.map.each_with_index { |a,idx| a*idx }.reduce(:+)\nend",
"title": ""
},
{
"docid": "ad404e7e6caa303151c9f29255fcd019",
"score": "0.51667315",
"text": "def [](index)\n self.__getitem__ index\n end",
"title": ""
}
] |
a77919ca4d14806440025299f9922dc4
|
this method checks if a users is signed in. If so it will redirect to the profile method by using the "/" convention. If the if statement is not executed, then we will just render the new.html.erb view in the users view foldercopy
|
[
{
"docid": "137be7c48b7f0ccec652099907b16359",
"score": "0.7092592",
"text": "def new\n if signed_in?\n redirect_to \"/users/profile\"\n end\n end",
"title": ""
}
] |
[
{
"docid": "ca836afe96155ec5bfaefe19a7741980",
"score": "0.72994983",
"text": "def redirect_if_logged_in\n if logged_in?\n redirect \"/users/#{current_user.id}\"\n end\n end",
"title": ""
},
{
"docid": "17a710b9daae70518078bfbc73186f01",
"score": "0.72314024",
"text": "def redirect_to_profile_if_logged_in\n if current_user && !current_user.admin?\n redirect_to user_path(current_user) and return\n end\n end",
"title": ""
},
{
"docid": "f499126127b9b07dd7a67e67ca76841a",
"score": "0.71999794",
"text": "def redirect_unless_signed_in\n unless signed_in?\n flash[:notice] = \"You must be logged in to access #{request.fullpath}\"\n redirect_to users_path\n end\n end",
"title": ""
},
{
"docid": "f7062a1d83d41a257ac85b5b8c0ac18f",
"score": "0.7176565",
"text": "def profile\n if(current_user)\n render 'layouts/loggedin'\n else\n render \"layouts/guest\"\n end\n end",
"title": ""
},
{
"docid": "ab9a83900b4761988bd890bbfdb4c673",
"score": "0.7093704",
"text": "def user_already_signed\n if user_signed_in? == true\n redirect_to(:controller => 'profil', :action => 'index')\n end\n end",
"title": ""
},
{
"docid": "25cb65218625c4d9b30e06dbaed65155",
"score": "0.7078017",
"text": "def redirect_if_logged_in\n if logged_in?\n redirect \"/users/#{current_user.id}\"\n end\n #def redirect_if_logged_in_as_someone_else\n #end\n end",
"title": ""
},
{
"docid": "2acbe4e841013a4fc3b9f84de1448790",
"score": "0.70689386",
"text": "def check_if_logged_in\n redirect_to(new_user_path) if @current_user.nil?\n end",
"title": ""
},
{
"docid": "2acbe4e841013a4fc3b9f84de1448790",
"score": "0.70689386",
"text": "def check_if_logged_in\n redirect_to(new_user_path) if @current_user.nil?\n end",
"title": ""
},
{
"docid": "3c69659a1fddccf11c67943cf23b0ea2",
"score": "0.70179135",
"text": "def redirect_if_signed_in\n if user_signed_in?\n redirect_to home_path\n end\n end",
"title": ""
},
{
"docid": "73cf10623e294f64fbb78f83a734d007",
"score": "0.69826955",
"text": "def index\n # If someone is signed in on the browser\n if signed_in?\n # Take the user to their profile page\n redirect_to \"/#{@current_user.name}\"\n # Abort execution\n return\n end\n \n # Don't use an application layout.\n render layout: false\n end",
"title": ""
},
{
"docid": "f09b458b28fcc28669b5c7ec242273ee",
"score": "0.6953783",
"text": "def user_signin_status\n unless user_signed_in?\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "b533645832c49bb9fb26d760ecd78ad7",
"score": "0.6898864",
"text": "def redirect_to_user_page\n if teacher_signed_in?\n redirect_to :controller => 'search'\n elsif volunteer_signed_in?\n redirect_to :controller => 'conversations'\n end\n end",
"title": ""
},
{
"docid": "41d389cedcc1cf88f10adbc39a905f2f",
"score": "0.68755394",
"text": "def signed_in\n unless signed_in? || User.first.nil?\n redirect_to root_path\n return\n end\n if signed_in? && settings.nil?\n redirect_to new_user_setting_path\n end\n end",
"title": ""
},
{
"docid": "c8fef06890c7e7a2e1b4a27da91b12b3",
"score": "0.68599457",
"text": "def check_access\n if not user_signed_in?\n redirect_to('/users/sign_in')\n end\n end",
"title": ""
},
{
"docid": "47d7123542bd3cf16ac6e55b02952f56",
"score": "0.6836642",
"text": "def logged_in_user\n if user_signed_in? then\n \n else\n redirect_to root_path\n end \n \n end",
"title": ""
},
{
"docid": "77b4052a87d5587425b194a83a6e0160",
"score": "0.68304557",
"text": "def check_current_profile\n if user_signed_in?\n if current_user.profile_type == \"Business\"\n redirect_to root_path , notice:\"Not authorised to view this page\"\n end\n end\n end",
"title": ""
},
{
"docid": "97e0ce2c12f5f463a27a025c45f45407",
"score": "0.6830193",
"text": "def user\n if !user_signed_in? \n redirect_to '/404.html'\n end\n end",
"title": ""
},
{
"docid": "fce45c80f4763118d01079590510953b",
"score": "0.6817728",
"text": "def show\n if not signed_in?\n redirect_back_or signin_path\n end\n end",
"title": ""
},
{
"docid": "8134bbb081c17e29a6ad6f3cfc99ad22",
"score": "0.68109393",
"text": "def check_current_profile\n if user_signed_in?\n if current_user.profile_type == \"Business\"\n redirect_to root_path , notice:\"Not authorised to view this page\"\n end\n end\n end",
"title": ""
},
{
"docid": "8b9a62dd9193cfc14a69bf5de680314b",
"score": "0.6778833",
"text": "def show\n if !current_user || current_user.status != \"1\"\n redirect_to new_user_session_path\n end\n end",
"title": ""
},
{
"docid": "ba249a6bf954a7ae5f4bd6dc247e7bb0",
"score": "0.67773914",
"text": "def signed_in_user\n redirect_to signin_path, :status => 302 unless signed_in?\n end",
"title": ""
},
{
"docid": "ba249a6bf954a7ae5f4bd6dc247e7bb0",
"score": "0.67773914",
"text": "def signed_in_user\n redirect_to signin_path, :status => 302 unless signed_in?\n end",
"title": ""
},
{
"docid": "7cee3f93ddd7d12e8dc7a7d102ac6d8b",
"score": "0.6754459",
"text": "def show\n if (is_signed_in)\n @preview=true; #the same user is viewing the profile.\n puts(\"------- DEBUG ------------\" + session[:user].to_s)\n else\n @preview = false;\n end\n\n if params[:id]== (\"sign_in\")\n redirect_to :controller => 'authentication',:action => 'show'\n end\n if params[:id]== (\"sign_out\")\n redirect_to :controller => 'authentication',:action => 'destroy'\n end\n if params[:id]== (\"uploads\")\n redirect_to :controller => 'users',:action => 'uploads'\n\n end\n\n end",
"title": ""
},
{
"docid": "e53aa6f41a323ab5760701d7feb25faf",
"score": "0.67498934",
"text": "def check_user\n if user_signed_in?\n else\n redirect_to root_path, :alert => \"Unauthorised Access\"\n end\n \n end",
"title": ""
},
{
"docid": "e53aa6f41a323ab5760701d7feb25faf",
"score": "0.67498934",
"text": "def check_user\n if user_signed_in?\n else\n redirect_to root_path, :alert => \"Unauthorised Access\"\n end\n \n end",
"title": ""
},
{
"docid": "87e6b2e900d872eb7051331a96cbfc3f",
"score": "0.67483",
"text": "def signed_in_user\n unless signed_in?\n redirect_to root_path, notice: 'Por favor ingresa para acceder a tu perfil.'\n end\n end",
"title": ""
},
{
"docid": "080ddd6f5695c3d33da939a9091c3a38",
"score": "0.673595",
"text": "def redirect_if_not_logged_in\n if !logged_in?\n flash[:errors] = \"You must be logged in to view the page \"\n redirect '/'\n end\n end",
"title": ""
},
{
"docid": "92d6385a06518fc01d45774ae8f96bac",
"score": "0.6702983",
"text": "def new\n\n if signed_in? && !isAdmin?\n sign_out\n redirect_to signup_url\n elsif signed_in? && isAdmin?\n redirect_to \"/new_prof\"\n end\n @title= \"Sign Up\"\n @user = User.new\n\n \n end",
"title": ""
},
{
"docid": "792784bd6a1083f0315dcbf360168dfd",
"score": "0.6702075",
"text": "def logged_in\n if current_user == nil\n redirect_to new_user_session_path\n end\n end",
"title": ""
},
{
"docid": "646e46ac55b394dafa1c7df2e77b221b",
"score": "0.6685374",
"text": "def if_logged_in_redirect\n if logged_in?\n redirect_to current_user\n end\n end",
"title": ""
},
{
"docid": "646e46ac55b394dafa1c7df2e77b221b",
"score": "0.6685374",
"text": "def if_logged_in_redirect\n if logged_in?\n redirect_to current_user\n end\n end",
"title": ""
},
{
"docid": "0d22352624b19479c98ef36fab27e272",
"score": "0.6682977",
"text": "def make_sure_logged_in\n\t\tif not current_user.present?\n\t\t\tflash[:error] = \"You must be signed up to see this page\"\n\t\t\tredirect_to new_user_path\n\t\tend\n\tend",
"title": ""
},
{
"docid": "9c0ad745c0303a453b68e3785201df3b",
"score": "0.66684043",
"text": "def logged_in_user\n unless current_user \n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "aff981a2ce9ac1c17b63bb8c4517ab73",
"score": "0.6661744",
"text": "def index\n \tif current_user\n\t\tredirect_to home_profile_path\n\tend\n end",
"title": ""
},
{
"docid": "c750bfc4afb5fe089f882d9a062c5c92",
"score": "0.6660312",
"text": "def show\n redirect_to(default_url) unless logged_in? || User.count > 0\n @user = current_user\n end",
"title": ""
},
{
"docid": "9f9250d7d51e5eb213fa76a8a37a8ffd",
"score": "0.6648419",
"text": "def check_logged_in\n unless current_user\n redirect_to '/login'\n end\n end",
"title": ""
},
{
"docid": "2b4b5b8ec131c55c5ecb538f40683746",
"score": "0.66439104",
"text": "def redirect_if_not_logged_in\n if !logged_in?\n flash[:notice] = \"You must be logged in to view the page you tried to view.\"\n redirect '/'\n end\n end",
"title": ""
},
{
"docid": "3a8d4136901ba32a75359b7f1cae098e",
"score": "0.6638695",
"text": "def signed_in_user\n redirect_to root_url, alert: \"Action Unsuccessful, please sign in.\" unless signed_in?\n end",
"title": ""
},
{
"docid": "b58f4dbb90e4ad3f83b980f740cce187",
"score": "0.66237277",
"text": "def auth_user\n redirect_to new_user_session_url unless user_signed_in?\n end",
"title": ""
},
{
"docid": "86f969669c1f789f1c572612c953055d",
"score": "0.65900743",
"text": "def index\n if signed_in?\n redirect_to current_user\n else\n redirect_to new_user_path\n end\n end",
"title": ""
},
{
"docid": "80eaa5a17d99fbf2f1788e9d85f27d02",
"score": "0.6589252",
"text": "def show\n if user_signed_in?\n else\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "81cd64f48a7bb79cee38f67ef5efc386",
"score": "0.658229",
"text": "def logged_in_user\n unless logged_in?\n store_location\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "ec177fd044c6fbbf1dde9ea0b7e4a714",
"score": "0.6581967",
"text": "def check_session\n if session[:user_id].nil?\n session[:return_to] = request.request_uri\n flash[:messgae] = \"Please sign-in or sign-up to access any of these pages.\"\n redirect_to :controller => 'user', :action => 'index'\n return\n end\n end",
"title": ""
},
{
"docid": "81cd64f48a7bb79cee38f67ef5efc386",
"score": "0.65807545",
"text": "def logged_in_user\n unless logged_in?\n store_location\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "81cd64f48a7bb79cee38f67ef5efc386",
"score": "0.65807545",
"text": "def logged_in_user\n unless logged_in?\n store_location\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "c558a6249a1f9630b35478543634bfaa",
"score": "0.65785086",
"text": "def index\n if logged_in\n redirect_to profile_path\n end\n end",
"title": ""
},
{
"docid": "9ea2c8787361216a12209282f05e24bf",
"score": "0.6577073",
"text": "def signed_in_user\n redirect_to signin_url, notice: \"Please sign in.\" unless signed_in?\n end",
"title": ""
},
{
"docid": "ceba951bfcc3d2c5905fc8bf03a95c65",
"score": "0.65754795",
"text": "def check_user\n if current_user.blank?\n puts\"false\"\n new_user_session_path\n else\n puts\"true\"\n end\n end",
"title": ""
},
{
"docid": "8579de4c3883c06bbc3940f5273ae029",
"score": "0.6574953",
"text": "def make_sure_logged_in\n\n\t\tif current_user.nil?\n\n\t\tflash[:error] = \"You need to be signed up\"\n\n\t\tredirect_to new_user_path\n\n\n\t\tend\n\n\n\n\n\tend",
"title": ""
},
{
"docid": "116f0758a1b207b36d53fa72abd9c99b",
"score": "0.65728265",
"text": "def auth_user\n redirect_to new_user_registration_url unless user_signed_in?\n end",
"title": ""
},
{
"docid": "ffb6d712a4908040e536aa8a4bd7c398",
"score": "0.65709674",
"text": "def auth\n #redirect to login page unless already logged in\n redirect_to new_user_session_path, alert: \"You must login to access that page\" unless logged_in?\n end",
"title": ""
},
{
"docid": "c6ba88a48c4af4004d424b966095f23f",
"score": "0.6569714",
"text": "def signed_in_user\n\t\t\tredirect_to signin_url, notice: \"Please sign in.\" unless signed_in?\n\t\tend",
"title": ""
},
{
"docid": "a50f556fc6f436c446e8849e8d795ea2",
"score": "0.65646785",
"text": "def logged_in_user\n unless logged_in?\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "c2d065612abc856be17af2357fb1df20",
"score": "0.6563342",
"text": "def profile\n if !GraderConfiguration['system.user_setting_enabled']\n redirect_to :controller => 'main', :action => 'list'\n else\n @user = current_user;\n end\n end",
"title": ""
},
{
"docid": "bf21eef46165cd69ba19acd2db6eee3f",
"score": "0.6555208",
"text": "def make_sure_logged_in\n\n\t\tif current_user.nil?\n\n\t\tflash[:error] = \"You need to be signed up\"\n\t\tredirect_to new_user_path \n\n\n\t\tend\t\n\n\n\tend",
"title": ""
},
{
"docid": "2e91dc48c842227f45d388646f1b9560",
"score": "0.65526205",
"text": "def logged_in_user\n unless logged_in?\n store_location\n flash[:danger] = t(\"users.edit.danger\")\n redirect_to login_url\n end\n end",
"title": ""
},
{
"docid": "6a4a4770b3c09ad9d4da040a000bea29",
"score": "0.6535912",
"text": "def authorized\n redirect_to new_user_session_path unless logged_in?\n end",
"title": ""
},
{
"docid": "b700fa8e2928de229aa4ef9f27c44edb",
"score": "0.6518352",
"text": "def auth_user\n if !current_user\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "b700fa8e2928de229aa4ef9f27c44edb",
"score": "0.6518352",
"text": "def auth_user\n if !current_user\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "b700fa8e2928de229aa4ef9f27c44edb",
"score": "0.6518352",
"text": "def auth_user\n if !current_user\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "80dee6c96e5cb333cb69e55508afc010",
"score": "0.65177965",
"text": "def check_logged_in\n if !user_signed_in?\n redirect_to new_user_session_path\n end\n\n return\n end",
"title": ""
},
{
"docid": "e6efc45944e32b114d26460076e8980d",
"score": "0.6502246",
"text": "def sign_in\n if cookies[ :user_id ] != nil\n redirect_to :action => \"index\" ,:controller => \"homepage\"\n end\n render layout: false\n end",
"title": ""
},
{
"docid": "f2f8be039e88157fd558a4ae491ab963",
"score": "0.64991087",
"text": "def show\n\t if !current_user #if no current user, default to the \"register new user\" page\n\t \t@user = User.new\n\t \trender :action => 'new_user'\n\t \treturn\n\t end\t \n\tend",
"title": ""
},
{
"docid": "cf841c2d2789c0f0a4ad5d6805da6fe3",
"score": "0.6492441",
"text": "def redirect_if_user_logged_in\n return unless user_logged_in?\n\n flash[:danger] = t('errors.access_denied')\n redirect_to edit_polymorphic_path(current_user)\n end",
"title": ""
},
{
"docid": "5b084c415fcae9616a8fedd812e25914",
"score": "0.6490152",
"text": "def logged_in\n if current_user == nil\n redirect_to new_user_session_path\n end\n end",
"title": ""
},
{
"docid": "8f7dea8d3d8a24c0da684fa8686aac69",
"score": "0.6482603",
"text": "def new\n unless signed_in?\n @user = User.new\n else\n redirect_to root_url #? root_path and root_url are the same?\n end\n end",
"title": ""
},
{
"docid": "e4960f4bbac9f1bf9256d64bab2ff371",
"score": "0.64812624",
"text": "def home\n if !view_context.signed_in?\n redirect_to '/'\n end\n end",
"title": ""
},
{
"docid": "c2f189e18213c944fcaa4dc375a539db",
"score": "0.6471078",
"text": "def already_signed_in\n if current_user != nil\n redirect_to(root_path)\n end\n end",
"title": ""
},
{
"docid": "23d8c2dea8e64d0dceaec5893169940d",
"score": "0.647012",
"text": "def user_authenticated\n redirect_to root_url, alert: 'You must be logged in to go here' unless current_user\n end",
"title": ""
},
{
"docid": "2d6143b128310bbcb67cafabb4398267",
"score": "0.6468232",
"text": "def new\n\n if User.find_by_id(session[:user_id])\n redirect_to users_url, :notice => \"You are already signed in\"\n else\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end\n\n end",
"title": ""
},
{
"docid": "8fa3377b88ff408fb97e1663ef4f099c",
"score": "0.64595073",
"text": "def log()\n if user_signed_in?\n else\n \tredirect_to \"http://localhost:3000/users/sign_in\"\n end\n end",
"title": ""
},
{
"docid": "fd52a5966e3741d6e315a42410ab6e72",
"score": "0.6454661",
"text": "def signed_in_user\n unless signed_in?\n store_location # for friendly forwarding\n redirect_to signin_url, notice: \"Please sign in.\"\n end\n end",
"title": ""
},
{
"docid": "12c471569adb2df1b049b7b7c4ed0abf",
"score": "0.64514124",
"text": "def same_user\n if current_user \n if (current_user.id == params[:id].to_i) || (current_user.hierarchy < 1)\n true\n else\n if request.xhr?\n flash[:error] = \"You don't have permission to do that.\"\n render :js => \"window.location = '#{root_path}';\"\n else\n flash[:error] = \"You don't have permission to do that.\"\n redirect_to root_path\n end\n end \n else\n flash[:error] = \"You don't have permission to do that. Please log in\"\n redirect_to login_path\n end\n end",
"title": ""
},
{
"docid": "b387bd586400999551d9d73788d3ba5a",
"score": "0.6451156",
"text": "def redirect_if_not_logged_in\n if !logged_in?\n flash[:message] = \"You must login to view this page\"\n # flash[:errors] = \"You must be logged in to view the page you tried to view.\"\n redirect '/'\n end\n end",
"title": ""
},
{
"docid": "aefbb05a22a5a8cbc330f1002e7ed827",
"score": "0.644805",
"text": "def check_user\n unless user_signed_in?\n redirect_to root_url, alert: \"Sorry, only authorized users can add.\"\n end\n end",
"title": ""
},
{
"docid": "2733a7a3ced89a674b986352d77fb69c",
"score": "0.64415455",
"text": "def check_logged_in_user\n if signed_in?\n redirect_to dashboard_path\n end\n end",
"title": ""
},
{
"docid": "3245a857a737be15907be7659e021db2",
"score": "0.6436242",
"text": "def redirect_if_already_logged_in\n if logged_in?\n flash[:notice] = I18n.t(:destination_inappropriate_for_logged_in_users)\n redirect_to(current_user)\n end\n end",
"title": ""
},
{
"docid": "a6fa4f55dcfa1d68701a76f7f2553e0a",
"score": "0.6434363",
"text": "def login \n @user = User.new\n @current_uri = request.env['PATH_INFO']\n render \"users/new\", :layout => \"signup_login\"\n end",
"title": ""
},
{
"docid": "d6cd17ab6da66f3b38bbe3057d7e84de",
"score": "0.643146",
"text": "def already_logged_in\n\t\t\t#current user is not nil\n\t\t\tif !current_user.nil?\n\t\t\t\tredirect_to root_url\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "f51b1118e4be327f2f9b5ea68c715802",
"score": "0.64277244",
"text": "def redirect_if_not_logged_in\n\t\tredirect_to '/' if !logged_in?\n\tend",
"title": ""
},
{
"docid": "77020b900b24d51eac1e0b70f5acd91e",
"score": "0.6420997",
"text": "def signed_in_user\n redirect_to login_url, notice: \"Log in to continue\" unless signed_in?\n end",
"title": ""
},
{
"docid": "d275fdc1a5f6d48fa4bdfdd1e39c4957",
"score": "0.64204746",
"text": "def signed_in_user\n unless signed_in?\n store_location #record url of intended page before redirect\n redirect_to signin_url, notice: \"Please sign in.\"\n end\n end",
"title": ""
},
{
"docid": "ef834bf556f457bc18b5c8ed20826442",
"score": "0.6418602",
"text": "def show\n if current_user.is_normal?\n @user = User.find( params[:id] )\n render :profile\n else\n redirect_to user_profile_path\n end\n end",
"title": ""
},
{
"docid": "c84471e51136b1044f202fa99ad0b33e",
"score": "0.64181775",
"text": "def show\n if current_user\n @user = User.find(params[:id])\n @user = current_user\n render :show\n else\n flash[:error] = \"Must be signed in to see your profile!!\"\n redirect_to \"/\"\n end\n end",
"title": ""
},
{
"docid": "b35f478db18eaa0db28e205451cebfc8",
"score": "0.6417728",
"text": "def welcome\n if user_logged_in?\n redirect_to root_path\n else\n redirect_to new_user_registration_path\n end\n end",
"title": ""
},
{
"docid": "5efd1ee480457cd14cc5c54a55f579f4",
"score": "0.64069176",
"text": "def logged_in\n if current_user == nil\n redirect_to new_user_session_path, alert: \"You are not logged in\"\n end\n end",
"title": ""
},
{
"docid": "b53f2f3ccbb49541b3db4ee509bcc425",
"score": "0.640399",
"text": "def logged_in_redirect\n if logged_in?\n flash[:err] = \"you are already logged in\"\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "9b1df306051c7d142fdff4d3db87a94d",
"score": "0.6402739",
"text": "def redirect_if_no_login\n if !current_user\n flash[:notice] = \"You need to sign in before viewing this page.\"\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "fee2e07da10d7d77e87cdcc0a75854ed",
"score": "0.63980234",
"text": "def show\n if current_user.access == 2\n redirect_to \"/users/indexU\"\n end\n end",
"title": ""
},
{
"docid": "976cb7c0ae229fbb830ceb59187cf2ef",
"score": "0.6397226",
"text": "def logged_in_user\n unless logged_in?\n flash[:warning] = \"Please log in\"\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "a3250b97f10c7f41cbe6cb1dd5e9ff26",
"score": "0.6397",
"text": "def check_user\n if (!user_signed_in?)\n redirect_to root_path, notice: 'You must log in to do that'\n end\n # if (!current_user.superadmin_role)\n # redirect_to root_path, notice: 'You do not have permissions to do that'\n # end\n end",
"title": ""
},
{
"docid": "78368f8b1d01d41ee19afb0684cbae19",
"score": "0.6394738",
"text": "def user_logged\n \tif !current_user\n \t\treturn redirect_to '/'\n \tend\n end",
"title": ""
},
{
"docid": "320b58c5d28de2c6fa67495a3fded6dc",
"score": "0.639344",
"text": "def admin\n if user_signed_in?\n \t redirect_to members_url\n \telse\n \t redirect_to new_user_session_path\n \t end\n \n end",
"title": ""
},
{
"docid": "98d1506941a6954efde501789e32ec44",
"score": "0.6391481",
"text": "def signed_in_user\n\n\t\t# If check to see if user is signed in\n \tunless signed_in?\n\n \t\t# Store the last the requested action and store it\n \t\tstore_location\n\n \t\t# Redirect to the signin url with notice to signin\n \t\tredirect_to signin_url, notice: \"Please sign in.\"\n \tend\n \tend",
"title": ""
},
{
"docid": "3cca2b1eb804829b7de927708486b95e",
"score": "0.63843554",
"text": "def new\n if logged_in?\n redirect_to user_path(current_user) # Redirect to user show page if logged in\n else \n @user = User.new # Stub a new user\n render layout: 'welcome' # Render sign up form with welcome layout\n end \n end",
"title": ""
},
{
"docid": "04d775977c0d9b8d08cadbc75c6b5031",
"score": "0.6383056",
"text": "def index\n if session[:user]\n redirect_to :controller => 'profile', :action => 'show'\n end\n end",
"title": ""
},
{
"docid": "289450ea36350a58aa44cc9b033faea2",
"score": "0.6382323",
"text": "def signed_in_user\n unless signed_in?\n flash.now[:danger] = \"Please sign in first.\"\n # store the edit location for redirect back\n store_location\n redirect_to signin_url\n end\n end",
"title": ""
},
{
"docid": "682fd6a511d0ff3e0a5c21141a7634f8",
"score": "0.63806903",
"text": "def confirm_logged_in\n unless session[:user_id]\n flash[:notice] = \"Please log in.\"\n render('show')\n #redirect_to(:action => 'login')\n \n #redirect_to(:action => 'login')\n #redirect_to(:controller => 'contacts', :action => 'list')\n \n \n return false # halts the before_filter\n else\n redirect_to(:controller => 'admin_users')\n return true\n end\n end",
"title": ""
},
{
"docid": "be5c8b476ff93a496260d6a674c22052",
"score": "0.63793015",
"text": "def after_sign_in_path_for(resource)\n\n user = current_user\n\n session[:user_id] = user.id\n\n profile = user.profile\n\n if profile.nil?\n\n flash[:warning] = t(:warning_editing_profile)\n new_profile_path\n\n else\n\n session[:profile_id] = profile.id\n\n\n if profile.company_id.nil?\n flash[:warning] = t(:warning_editing_company)\n new_company_path\n else\n\n session[:company_id] = profile.company_id\n\n welcome_gestionus_path\n end\n\n end\n\n\n end",
"title": ""
}
] |
be9e8281120594bf3c2775f1a1a3ed43
|
PUT /contents/1 PUT /contents/1.xml
|
[
{
"docid": "dfe205105af0c0cc65366224abb7ae46",
"score": "0.57890815",
"text": "def update\n @content = Content.find(params[:id])\n\n respond_to do |format|\n if @content.update_attributes(params[:content])\n flash[:notice] = 'Content was successfully updated.'\n format.html { redirect_to(@content) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @content.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "23b5f5e4dacfb330cb1e0ffd4590ef63",
"score": "0.6525524",
"text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post opts.fetch(:path, update_path), opts\n end",
"title": ""
},
{
"docid": "62262ba01616f5c24bd2593612f494f0",
"score": "0.6378053",
"text": "def update(contents)\n\n\t\t\t\t\t\t\t\t\n\n\n\tend",
"title": ""
},
{
"docid": "7fe3db440b675578be31612aacafdeb4",
"score": "0.6252332",
"text": "def update_contents(*args); end",
"title": ""
},
{
"docid": "545dadbe32aa3d9d0edf1d22293783fc",
"score": "0.61367446",
"text": "def test_put_existing\n request = Http::Request.new('PUT', '/file1', {}, 'bar')\n\n response = self.request(request)\n\n assert_equal(204, response.status)\n\n assert_equal(\n 'bar',\n @server.tree.node_for_path('file1').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('bar')}\\\"\"]\n },\n response.headers\n )\n end",
"title": ""
},
{
"docid": "fbd7c46b15ae2792fd842ba0d764b7d0",
"score": "0.61276436",
"text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end",
"title": ""
},
{
"docid": "38979984bdedacd95706689e25f09f9e",
"score": "0.6092651",
"text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end",
"title": ""
},
{
"docid": "e2e55a6ecb4c00b7fe18a670cc021207",
"score": "0.6005108",
"text": "def put_entry(id,summary)\n xml = <<DATA\n <entry xmlns=\"http://purl.org/atom/ns#\">\n <summary type=\"text/plain\"></summary>\n </entry>\nDATA\n\n doc = REXML::Document.new(xml)\n doc.elements['/entry/summary'].add_text(summary)\n\n # REXML -> String\n data=String.new\n doc.write(data)\n\n #make request\n path=\"/atom/edit/#{id}\"\n req=Net::HTTP::Put.new(path)\n req['Accept']= 'application/x.atom+xml,application/xml,text/xml,*/*',\n req['X-WSSE']= @credential_string\n\n #YHAAAA!!!\n res = @http.request(req,data)\n return res\n end",
"title": ""
},
{
"docid": "d389fdc05adb9fc3f75812370c2a156f",
"score": "0.5937613",
"text": "def update_content(*args); end",
"title": ""
},
{
"docid": "250081859ab2fae95f49e1356761a574",
"score": "0.5910881",
"text": "def overwrite ( content )\n request_str = \"/files/#{id.to_i}/data\"\n rq = GenericRequest.new self.class.studio_connection\n response = rq.put request_str, :file => content\n load Hash.from_xml(response)[\"file\"]\n end",
"title": ""
},
{
"docid": "713161fe04801b44f5b9cdb91a95fe89",
"score": "0.5899096",
"text": "def test_put\n request = Http::Request.new('PUT', '/file2', {}, 'hello')\n\n response = self.request(request)\n\n assert_equal(201, response.status, \"Incorrect status code received. Full response body: #{response.body_as_string}\")\n\n assert_equal(\n 'hello',\n @server.tree.node_for_path('file2').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('hello')}\\\"\"]\n },\n response.headers\n )\n end",
"title": ""
},
{
"docid": "d6607de8935ebd99186eca0e7bf22354",
"score": "0.5888645",
"text": "def write(content)\n @client.update(content) \nend",
"title": ""
},
{
"docid": "bfea044dc3f6ce25ed9e8f98d41d9e4d",
"score": "0.5879249",
"text": "def update_rest\n @instrument_content = InstrumentContent.find(params[:id])\n\n respond_to do |format|\n if @instrument_content.update_attributes(params[:instrument_content])\n flash[:notice] = 'InstrumentContent was successfully updated.'\n format.html { redirect_to(@instrument_content) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @instrument_content.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a6174ef5c57f0350802d9d10f71b4a2e",
"score": "0.57940525",
"text": "def test_finder_put_success\n request = Http::Request.new(\n 'PUT',\n '/file2',\n { 'X-Expected-Entity-Length' => '5' },\n 'hello'\n )\n response = self.request(request)\n\n assert_equal(201, response.status)\n\n assert_equal(\n 'hello',\n @server.tree.node_for_path('file2').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('hello')}\\\"\"]\n },\n response.headers\n )\n end",
"title": ""
},
{
"docid": "a48b3229e830876ae619b936301400b2",
"score": "0.5790157",
"text": "def put(url, xml, version = nil)\n req = Net::HTTP::Put.new(url)\n req.content_type = 'application/x-ssds+xml'\n \n if(!version.nil?)\n req['if-match'] = version;\n end\n \n req.content_length = xml.to_s.size.to_s\n req.basic_auth @username, @password\n req.body = xml.to_s\n execute_request(req)\n end",
"title": ""
},
{
"docid": "8e18db431964c254de53caa41795b702",
"score": "0.5786954",
"text": "def put *args\n make_request :put, *args\n end",
"title": ""
},
{
"docid": "19e5b67cc61252dd9dab170cf60e48e4",
"score": "0.5777124",
"text": "def update\n @content = Content.find(params[:id])\n respond_to do |format|\n if @content.update_attributes(params[:content])\n flash[:notice] = 'Content was successfully updated.'\n format.html { redirect_to(@content) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @content.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7a0fcb337337475746b76448797415f",
"score": "0.57671916",
"text": "def write(contents)\n @mutex.synchronize do\n @value = contents\n @client.write(@path, @value)\n self\n end\n end",
"title": ""
},
{
"docid": "b49c30265b68873087f9fe0c7b2a482d",
"score": "0.5758349",
"text": "def update\n \n uploaded_file = params[:xml_file]\n doc = REXML::Document.new uploaded_file\n doc = parse_xml(doc)\n data = \"\"\n doc.write data, -1\n \n# data = uploaded_file.read if uploaded_file.respond_to? :read\n \n @document = Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes({:title => params[:title], :content => data})\n flash[:notice] = 'Document was successfully updated.'\n format.html { redirect_to(@document) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad54471b285e5e357d9be959c8ade2d8",
"score": "0.57259315",
"text": "def update\n path = \"/workflow/#{repo}/objects/druid:#{druid}/workflows/#{workflow}/#{step}\"\n conn = Faraday.new(url: config['host'])\n conn.basic_auth(config['user'], config['password'])\n conn.headers['content-type'] = 'application/xml'\n\n conn.put path, payload\n end",
"title": ""
},
{
"docid": "7dcf61d28367255f0ec9cea7ade341de",
"score": "0.5685639",
"text": "def update(id, name=\"Updated Name\", published=\"false\", genre=\"movie\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <timeline>\r\n <published type='string'>#{published}</published>\r\n <id type='integer'>#{id}</id>\r\n <description>#{name}</description>\r\n <genre>#{genre}</genre>\r\n </timeline>\"\r\n \r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n \r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"title": ""
},
{
"docid": "6eccf0cb1ebc7404a9ae8d73fad0c91a",
"score": "0.56720656",
"text": "def put(*args)\n request :put, *args\n end",
"title": ""
},
{
"docid": "99d24a74bc96db3bd84b0451ef3afb5f",
"score": "0.5655767",
"text": "def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end",
"title": ""
},
{
"docid": "27096800d14893529f640b6cf4566aba",
"score": "0.56266886",
"text": "def update\n connection.put(\"/todo_lists/#{id}.xml\",\n \"<todo-list>\n <name>#{name}</name>\n <description>#{description}</description>\n <milestone_id>#{milestone_id}</milestone_id>\n </todo-list>\",\n XML_REQUEST_HEADERS)\n end",
"title": ""
},
{
"docid": "6fd8842ed08fa1572950f3e78514aecf",
"score": "0.55888075",
"text": "def do_PUT(req, res)\n domain, resource, id, format = parse_request_path(req.path_info)\n attributes = from_xml(resource, req.body)\n attributes['updated-at'] = Time.now.iso8601\n logger.debug \"Updating item with attributes: #{attributes.inspect}\"\n sdb_put_item(domain, attributes, true)\n raise WEBrick::HTTPStatus::OK\n end",
"title": ""
},
{
"docid": "1e28e53cc6a046657398add19da32118",
"score": "0.5565236",
"text": "def put(path, arguments = {})\n Mavenlink.logger.note \"Started PUT /#{path} with #{arguments.inspect}\"\n parse_request(connection.put(path, arguments))\n end",
"title": ""
},
{
"docid": "15530557af08e73affa157b7babf866c",
"score": "0.5564165",
"text": "def update\n @content_info = ContentInfo.find(params[:id])\n\n respond_to do |format|\n if @content_info.update_attributes(params[:content_info])\n format.html { redirect_to(@content_info, :notice => 'Content info was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @content_info.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4508b998e7a2d40bb7c91067a718998d",
"score": "0.55640817",
"text": "def update\n enforce_permissions!('update', params[:id])\n\n param = params[:xml].presence || params[:metadata_file].presence\n\n if param\n xml_ds = XmlDatastream.new\n xml_ds.load_xml(param)\n else\n flash[:notice] = t('dri.flash.notice.specify_valid_file')\n redirect_to controller: 'catalog', action: 'show', id: params[:id]\n return\n end\n\n @object = retrieve_object!(params[:id])\n @errors = nil\n\n unless can? :update, @object\n raise Blacklight::AccessControls::AccessDenied.new(t('dri.flash.alert.edit_permission'), :edit, '')\n end\n\n @object.update_metadata(xml_ds.xml)\n\n if @object.valid?\n checksum_metadata(@object)\n warn_if_has_duplicates(@object)\n\n @object.increment_version\n\n begin\n unless save_and_index\n logger.error \"Could not save object #{@object.alternate_id}\"\n raise DRI::Exceptions::InternalError\n end\n\n record_version_committer(@object, current_user)\n flash[:notice] = t('dri.flash.notice.metadata_updated')\n\n update_or_mint_doi\n mint_or_update_doi(@object, @doi) if @doi\n\n preservation = Preservation::Preservator.new(@object)\n preservation.preserve(['descMetadata'])\n\n retrieve_linked_data if AuthoritiesConfig\n rescue DRI::SolrBadRequest => e\n flash[:alert] = t('dri.flash.alert.invalid_object', error: e.details)\n @errors = e.details\n end\n else\n flash[:alert] = t('dri.flash.alert.invalid_object', error: @object.errors.full_messages.inspect)\n @errors = @object.errors.full_messages.inspect\n end\n\n respond_to do |format|\n format.html { redirect_to controller: 'my_collections', action: 'show', id: params[:id] }\n format.json { render json: @object }\n format.text do\n response = if @errors\n t('dri.flash.alert.invalid_object', error: @errors)\n else\n t('dri.flash.notice.metadata_updated')\n end\n\n render plain: response\n end\n end\n end",
"title": ""
},
{
"docid": "27ed694730ccf9a62999f9131b2414d1",
"score": "0.552397",
"text": "def test_mixed_content\n response = @request.delete('file')\n response = @request.put('file', @stream)\n assert_equal '201',response.status\n\n doc = REXML::Document.new \"<x:author xmlns:x='http://example.com/ns'>\n <x:name>Jane Doe</x:name>\n <!-- Jane's contact info -->\n <x:uri type='email' \n added='2005-11-26'>mailto:jane.doe@example.com</x:uri>\n <x:uri type='web' \n added='2005-11-27'>http://www.example.com</x:uri>\n <x:notes xmlns:h='http://www.w3.org/1999/xhtml'>\n Jane has been working way <h:em>too</h:em> long on the \n long-awaited revision of <![CDATA[<RFC2518>]]>.\n </x:notes>\n </x:author>\"\n\n author_prop_key = RubyDav::PropKey.get('http://example.org/ns', 'author')\n\n # store the xml document as value of a property\n response = @request.proppatch('file', {author_prop_key => doc})\n assert_equal '207',response.status\n assert !response.error?\n assert_equal '200', response[author_prop_key].status\n\n # retrieve the value of the property from the server\n response = @request.propfind('file', 0, author_prop_key)\n assert_equal '207',response.status\n server_val = response[author_prop_key].inner_value\n\n # assert that the returned value is xml equivalent to the value we sent\n assert_xml_equal doc, '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' + server_val\n\n # cleanup\n response = @request.delete('file')\n response = @request.get('file')\n assert_equal '404', response.status\n end",
"title": ""
},
{
"docid": "bcd94d0dd44a93fafca0dd1026f76a8f",
"score": "0.55204403",
"text": "def update\r\n @replace[\"word/document.xml\"] = doc.serialize :save_with => 0\r\n end",
"title": ""
},
{
"docid": "a91a8bc4e0b91301a55c757bcc1dd7fb",
"score": "0.55196565",
"text": "def update\n @content = Oktopartial::Content.find(params[:id])\n\n respond_to do |format|\n if @content.update_attributes(params[:content])\n flash[:notice] = 'Oktopartial::Content was successfully updated.'\n format.html { redirect_to(:action => :show, :id => @content.id) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @content.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d849c2bc448d5ce0df573d1ab918e8f7",
"score": "0.55101997",
"text": "def put(url, options={}, header={})\n body = options[:body]\n access_token.put(url, body, {'Content-Type' => 'application/xml' })\n end",
"title": ""
},
{
"docid": "a2abaea7eb23530e64c3f72049a5c3cb",
"score": "0.55047166",
"text": "def update_xml(xml, value)\n xml\n end",
"title": ""
},
{
"docid": "e1488cd028f8e782f4a9c853a876cce6",
"score": "0.5500258",
"text": "def _put(path, contents)\n forbidden if not is_allowed? path\n IO.write path, contents, :mode => 'wb+'\n ok\n rescue SystemCallError => e\n # we are trying to put sth, but we can't, so I guess the correct status\n # code is conflict.\n logger.error e.message\n conflict\n end",
"title": ""
},
{
"docid": "4c3eb68c914d57ea43f3c32bac1b2bc0",
"score": "0.5485299",
"text": "def request_put(path, content = nil, headers = {})\n http = Net::HTTP.new(REST_ENDPOINT, @options[:ssl] ? 443 : 80)\n \n http.use_ssl = @options[:ssl]\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n \n http.start do |http|\n req = sign_request(Net::HTTP::Put.new(path), content, headers)\n \n if content.is_a?(IO)\n req.body_stream = content\n else\n req.body = content\n end\n \n response = http.request(req)\n \n return response\n end\n end",
"title": ""
},
{
"docid": "7524889ba09f86f61a486e1292072f9c",
"score": "0.54844517",
"text": "def update_resource_content\n resource_content\n end",
"title": ""
},
{
"docid": "bc29495d78ac7eaa5292e6691be576f2",
"score": "0.5484364",
"text": "def UpdateWiki(wiki_url,file_content,version)\n response = RestClient.put(wiki_url, { :wiki_page => {\n :text => file_content, # wiki_text # original wiki text\n :version => version # wiki_text # original wiki text\n }\n })\n\n @@table_of_content.clear();\n end",
"title": ""
},
{
"docid": "0e55a6e9d9b3726294e45f09f4d8defc",
"score": "0.54841876",
"text": "def update\n File.open(file_path, 'w') do |file|\n file.write(file_params[:content])\n end\n\n render json: { status: :ok }\n end",
"title": ""
},
{
"docid": "2c8f03a2633f8f9d583c3fe73716aafc",
"score": "0.5475619",
"text": "def update_xml(xml, value)\r\n xml\r\n end",
"title": ""
},
{
"docid": "d8d878c0391411134a17dcfe0f3ddd00",
"score": "0.5475252",
"text": "def put(request, response)\n if not @file\n parts = @local_path.split(\"/\")\n file = WSFile.all(parent: nil, name: parts[1])[0]\n endd = parts.last==\"\" ? -3 : -2\n parts[2..endd].each do |part|\n file = file.children(name: part)\n end\n parent = file_by_path parts[0..-2].join(\"/\")\n @file = WSFile.create(name: parts.last, create_time: DateTime.now, directory: false, edit_time: DateTime.now, parent: parent)\n Permission.create(user: @ws_user, file: @file, level: \"owner\")\n end\n io = request.body\n temp = Tempfile.new(\"websync-dav-upload\")\n data = io.read rescue \"\"\n temp.write data\n temp.close\n @file.content_type = _content_type temp.path\n temp.flush rescue nil\n @file.edit_time = DateTime.now\n @file.save!\n @file.data=data\n Created\n end",
"title": ""
},
{
"docid": "d4c7ac49803a152e59aeb87055575ece",
"score": "0.5473243",
"text": "def update(file, content)\n @dropbox.delete(file.path_display)\n @dropbox.upload(file.path_display, content)\n end",
"title": ""
},
{
"docid": "8142ead1de465d5052967fef553665a0",
"score": "0.54684186",
"text": "def update_contents!(new_contents)\n if is_binary\n File.binwrite(filename, new_contents)\n else\n File.write(filename, new_contents)\n end\n end",
"title": ""
},
{
"docid": "c172454e5c23a8b8de528335b7982ccb",
"score": "0.54509723",
"text": "def update!(**args)\n @content = args[:content] unless args[:content].nil?\n @name = args[:name] unless args[:name].nil?\n end",
"title": ""
},
{
"docid": "cecd7575959ccb6f07cde1af3b5e76fe",
"score": "0.5445306",
"text": "def update\n Transaction::Xml.transaction do\n @transaction_xml = Transaction::Xml.find(params[:id])\n respond_to do |format|\n if @transaction_xml.parse(params[:transaction_xml][:xml].open) and @transaction_xml.update_attributes(params[:transaction_xml])\n format.html { redirect_to(@transaction_xml, :notice => 'Xml was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @transaction_xml.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "77463972366d4f3c094b7e670ccb1989",
"score": "0.5440481",
"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": "2f143d498e8e20003ac1f0ac594f00a5",
"score": "0.5439762",
"text": "def file_put_contents( name, *contents )\r\n File.open( name, \"w\" ){ |file|\r\n contents.each{ |item|\r\n file << item\r\n }\r\n }\r\nend",
"title": ""
},
{
"docid": "9ddf960eb3f437e62b9b99d34992bc0f",
"score": "0.54384",
"text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :api_key => 'testapikey',\r\n :status_post => {:body => 'API Status Post 1' }\r\n assert_response :success\r\n end",
"title": ""
},
{
"docid": "78992a74047c3c20cef2afbb4232252b",
"score": "0.5434422",
"text": "def test_put_existing_if_match_star\n request = Http::Request.new(\n 'PUT',\n '/file1',\n { 'If-Match' => '*' },\n 'hello'\n )\n\n response = self.request(request)\n\n assert_equal(204, response.status)\n\n assert_equal(\n 'hello',\n @server.tree.node_for_path('file1').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('hello')}\\\"\"]\n },\n response.headers\n )\n end",
"title": ""
},
{
"docid": "f5926911396b0bd335dd0f0a587a8ae5",
"score": "0.5424596",
"text": "def put(path, content=nil, params={}, &blk)\n register_route(path, :PUT, content, params, &blk)\n end",
"title": ""
},
{
"docid": "c7ce258097892d5a25ac06cf5fa6fa33",
"score": "0.54241407",
"text": "def test_put_existing_if_match_correct\n request = Http::Request.new(\n 'PUT',\n '/file1',\n { 'If-Match' => \"\\\"#{Digest::MD5.hexdigest('foo')}\\\"\" },\n 'hello'\n )\n\n response = self.request(request)\n\n assert_equal(204, response.status)\n\n assert_equal(\n 'hello',\n @server.tree.node_for_path('file1').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('hello')}\\\"\"]\n },\n response.headers\n )\n end",
"title": ""
},
{
"docid": "49f0430d7b19ef3b4afab82ba6192a24",
"score": "0.5420956",
"text": "def put\n raise RequestError.new(:bad_param, \"Parameter 'filename' is not valid\") if params[:filename].nil? || params[:filename].empty?\n raise RequestError.new(:bad_param, \"Parameter 'content_hash' is not valid\") if params[:content_hash].nil? || params[:content_hash].empty?\n raise RequestError.new(:bad_param, \"Parameter 'size' is not valid\") if params[:size].nil? || params[:size].empty? || params[:size].to_i <= 0\n raise RequestError.new(:bad_param, \"Current account doesn't have enough to space to store this file\") unless session[:user].can_add_file_size(params[:size].to_i)\n \n # if file already exist...\n XFile.all(user: session[:user], name: params[:filename]).each do |file|\n # error if already uploaded\n raise RequestError.new(:bad_param, \"File already exists\") if file.uploaded\n # otherwise return needed parts\n params[:id] = file.id\n needed_parts\n return \n end\n\n # find if the content already exist\n current_content = Content.first content_hash: params[:content_hash]\n already_uploaded = (current_content ? current_content.uploaded : false)\n # create a WFile\n file = WFile.create(session[:user], params[:filename])\n # if already uploaded do nothing\n if current_content && already_uploaded\n file.uploaded = true\n @result = { success: true, uploaded: true }\n # otherwise create a content, set the file as non-uploaded and return everything\n else\n current_content = Content.create(params[:content_hash], params[:size].to_i) if current_content.nil?\n @result = { success: true, uploaded: false, needed_parts: current_content.needed_parts, part_size: PART_SIZE }\n end\n # set the current content to the current file\n file.content = current_content\n # save the file and its parents\n file.update_and_save\n session[:user].add_file_size current_content.size\n session[:user].save\n @result.merge!({ file: file.description })\n end",
"title": ""
},
{
"docid": "aa106c75a70818028d02a062cf7ddaa1",
"score": "0.54181707",
"text": "def update!(**args)\n @contents = args[:contents] unless args[:contents].nil?\n @errors = args[:errors] unless args[:errors].nil?\n @is_pending = args[:is_pending] unless args[:is_pending].nil?\n @is_sitemaps_index = args[:is_sitemaps_index] unless args[:is_sitemaps_index].nil?\n @last_downloaded = args[:last_downloaded] unless args[:last_downloaded].nil?\n @last_submitted = args[:last_submitted] unless args[:last_submitted].nil?\n @path = args[:path] unless args[:path].nil?\n @type = args[:type] unless args[:type].nil?\n @warnings = args[:warnings] unless args[:warnings].nil?\n end",
"title": ""
},
{
"docid": "599af558b180af021d6421eccfc25a4b",
"score": "0.53970766",
"text": "def update_page(page_id, content, version: nil)\n info = page_info(page_id)\n version = info['version']['number'] + 1 if version.nil?\n log_debug \"Update Confluence page #{page_id}...\"\n call_api(\"rest/api/content/#{page_id}\", :put) do |request|\n request['Content-Type'] = 'application/json'\n request.body = {\n type: 'page',\n title: info['title'],\n body: {\n storage: {\n value: content,\n representation: 'storage'\n }\n },\n version: { number: version }\n }.to_json\n end\n end",
"title": ""
},
{
"docid": "6097e93b0470bfc3cd63413bcd17b8c7",
"score": "0.5395547",
"text": "def update\n params.permit!\n @si_inventory_content = SiInventoryContent.find(params[:id])\n\n respond_to do |format|\n if @si_inventory_content.update_attributes(params[:si_inventory_content])\n format.html { redirect_to(@si_inventory_content, :notice => 'Si inventory content was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @si_inventory_content.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7ca02886577ac10b1a61af6f314fe8e8",
"score": "0.53852075",
"text": "def update\n if @content_element.update_attributes(params[:content_element])\n respond_to do |format|\n format.json { render :json => @content_element }\n format.xml { render :xml => @content_element }\n end\n else\n respond_to do |format|\n format.json { raise Palani::Api::InvalidUpdateOfRecordJSONException }\n format.xml { raise Palani::Api::InvalidUpdateOfRecordXMLException }\n end\n end\n end",
"title": ""
},
{
"docid": "d7d71c5980b46e4fb9d5af4cbfee110f",
"score": "0.53829193",
"text": "def modify\n @content = Content.find(params[:id])\n\n end",
"title": ""
},
{
"docid": "476c34f1955d8e27ff8ba558ce2abe37",
"score": "0.5368947",
"text": "def test_put_no_parent\n request = Http::Request.new(\n 'PUT',\n '/file1/file2',\n {},\n 'hello'\n )\n\n response = self.request(request)\n assert_equal(409, response.status)\n end",
"title": ""
},
{
"docid": "0f0fc9a1928cc3a9493027ba0db98fed",
"score": "0.53627944",
"text": "def update\n # new_contents = erase_blank(@document.file_contents.to_s)\n # puts \"document.file_contents is : #{@document.file_contents}\"\n # puts \"document.file_contents.to_s is : #{@document.file_contents.to_s}\"\n # puts \"new_contents is : #{new_contents}\"\n # if @document.update(:file_contents => new_contents)\n\n puts \"yo! update called:)\"\n # if @document.update(:original_file => params[:new_content])\n # redirect_to document_path(@document)\n # else\n # puts \"OH NOOOOOOOO!!!\"\n # end\n end",
"title": ""
},
{
"docid": "c4750b597bf629fa911c67bbefbc7350",
"score": "0.53621227",
"text": "def update(content)\n Qubell::APICall.put(\"/applications/#{@id}/manifest\",\n content,\n content_type: 'application/x-yaml')[:version]\n rescue Qubell::Exceptions::ExecutionError\n raise Qubell::Exceptions::FormatError, 'currect manifest is incorrect'\n end",
"title": ""
},
{
"docid": "07918d5a67562e424f50e841ebcd6a84",
"score": "0.5361767",
"text": "def put(path , params = {})\n request(:put , path , params)\n end",
"title": ""
},
{
"docid": "bb43ebe8a91752d35be3eed19787dc9b",
"score": "0.5356117",
"text": "def update\n respond_to do |format|\n if @content.update(content_params)\n format.html { redirect_to contents_path, notice: \"Schlagwort #{@content.tag} wurde erfolgreich aktualisiert.\" }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d61a25d69ed10b03601d4f17ba7d9ef3",
"score": "0.5353497",
"text": "def update\n #RAILS_DEFAULT_LOGGER.debug(\"******** REST Call to CRMS: Updating #{self.class.name}:#{self.id}\")\n #RAILS_DEFAULT_LOGGER.debug(caller[0..5].join(\"\\n\")) \n response = connection.put(element_path(prefix_options), to_xml, self.class.headers)\n save_nested\n load_attributes_from_response(response)\n merge_saved_nested_resources_into_attributes\n response\n end",
"title": ""
},
{
"docid": "8bafefbdb23af2f7d6e25752eacf1660",
"score": "0.5348955",
"text": "def update!(**args)\n @content = args[:content] if args.key?(:content)\n end",
"title": ""
},
{
"docid": "1c535c9730f2e171c41098f52d71f515",
"score": "0.5346479",
"text": "def update_uploads_xml(xml, upload_guid)\n first_oi = nil\n \n oi_list = OriginalInput.where(\"uploaded_file_id = ? and input_category = 'Upload'\", upload_guid)\n ActiveRecord::Base.transaction do\n oi_list.each {|oi|\n first_oi = oi if first_oi.nil?\n \n oi.raw_content = xml if xml.present?\n oi.save\n }\n end\n first_oi\n end",
"title": ""
},
{
"docid": "7d4155ea1d5ec29dfeec7f8f3dfe64e7",
"score": "0.53460616",
"text": "def put(path, file, content_type=nil)\n path = canonicalized_resource(path)\n body = file.respond_to?(:read) ? file : file.to_s \n date = Time.now.rfc2822\n message = join('PUT', body, content_type, date, nil, path)\n headers = headers(date, message, content_type)\n\n if content_length = content_length(file)\n headers.merge!({'Content-Length' => content_length})\n end\n\n request = Net::HTTP::Put.new(path, headers)\n\n if file.respond_to?(:read)\n request.body_stream = file\n else\n request.body = body\n end\n\n begin\n response = http.start { |http| http.request(request) }\n Presss::HTTP::Response.new(\n response.code,\n response.instance_variable_get('@header'),\n response.body\n )\n rescue EOFError => error\n raise Presss::HTTP::RequestError, error.message\n end\n end",
"title": ""
},
{
"docid": "eb553a12c84b854dce36c4a124e8df74",
"score": "0.5345614",
"text": "def test_put_if_none_match_star\n request = Http::Request.new(\n 'PUT',\n '/file2',\n { 'If-None-Match' => '*' },\n 'hello'\n )\n\n response = self.request(request)\n\n assert_equal(201, response.status)\n\n assert_equal(\n 'hello',\n @server.tree.node_for_path('file2').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('hello')}\\\"\"]\n },\n response.headers\n )\n end",
"title": ""
},
{
"docid": "7046787db45a222cc4baa40023c674cd",
"score": "0.53437686",
"text": "def xml = \"docs/index.xml\"",
"title": ""
},
{
"docid": "cc8530b36f752f70d0ea1cb76f21134d",
"score": "0.5341728",
"text": "def put(path, **args); end",
"title": ""
},
{
"docid": "1f29b1f83d4b1eb9b7f7c57161bf57eb",
"score": "0.5336082",
"text": "def update\n @scrap_xml = ScrapXml.find(params[:id])\n\n respond_to do |format|\n if @scrap_xml.update_attributes(params[:scrap_xml])\n flash[:notice] = 'ScrapXml was successfully updated.'\n format.html { redirect_to(@scrap_xml) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @scrap_xml.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b0915df4ff74e4c38f03ce17986a8140",
"score": "0.5327413",
"text": "def update_rest\n @entry_item = EntryItem.find(params[:id])\n\n respond_to do |format|\n if @entry_item.update_attributes(params[:entry_item])\n flash[:notice] = 'EntryItem was successfully updated.'\n #format.html { redirect_to(@entry_item) }\n format.xml { head :ok }\n else\n #format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36bf837e5e87c4a00b0acc8423653183",
"score": "0.5320362",
"text": "def update\n @page = @wiki.page(params[:page_name])\n @wiki.update_page(@page,@page.name, @page.format, params[:page_content], @commit)\n respond_to do |format|\n format.html { redirect_to(root_url, :notice => 'successfully updated.') }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c7d3cd0f218c42e01dbd0246ab7b00c9",
"score": "0.5319152",
"text": "def put(path, params={}); make_request(:put, host, port, path, params); end",
"title": ""
},
{
"docid": "f979deb039614b1b692ef78f7eec7898",
"score": "0.5313353",
"text": "def put(path,entry)\r\n h = @headers.clone\r\n h['X-HTTP-Method-Override'] = 'PUT'\r\n @url.put(path, entry, h)\r\n end",
"title": ""
},
{
"docid": "ccfac8f6948648205e3b9cf037ee8e84",
"score": "0.53121406",
"text": "def put(nsc, uri, payload = nil, content_type = CONTENT_TYPE::XML)\n put = Net::HTTP::Put.new(uri)\n put.set_content_type(content_type)\n put.body = payload.to_s if payload\n request(nsc, put)\n end",
"title": ""
},
{
"docid": "be750611d322fc962069a371147d95af",
"score": "0.5311978",
"text": "def put_octect(uri, data, manage_errors)\n headers = build_headers(@token)\n headers[\"Content-Type\"] = 'application/octet-stream'\t\n req = Net::HTTP::Put.new(uri.request_uri, initheader = headers)\n req.body = data\n return do_request(uri, req, manage_errors, 0)\n end",
"title": ""
},
{
"docid": "c007b06f1f7f06bede315c1e5a8edcb9",
"score": "0.5308084",
"text": "def update!(**args)\n @content = args[:content] if args.key?(:content)\n @file = args[:file] if args.key?(:file)\n @path = args[:path] if args.key?(:path)\n @permissions = args[:permissions] if args.key?(:permissions)\n @state = args[:state] if args.key?(:state)\n end",
"title": ""
},
{
"docid": "dbdf1597479173b04e7ab2bb7d972675",
"score": "0.5302482",
"text": "def update\n @content_item = ContentItem.find(params[:id])\n\n respond_to do |format|\n if @content_item.update_attributes(params[:content_item])\n format.html { redirect_to(@content_item, :notice => 'Content item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @content_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "10b8f7b4c3a53b9ed8f8010c47ccd1e3",
"score": "0.5302271",
"text": "def update\n @content = Content.find(params[:id])\n\n respond_to do |format|\n if @content.update_attributes(params[:content])\n format.html { redirect_to @content, notice: 'Content was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "10b8f7b4c3a53b9ed8f8010c47ccd1e3",
"score": "0.5302271",
"text": "def update\n @content = Content.find(params[:id])\n\n respond_to do |format|\n if @content.update_attributes(params[:content])\n format.html { redirect_to @content, notice: 'Content was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "608d2f58e93e2a844cba814b363df9ef",
"score": "0.53018206",
"text": "def update(id, name=\"Updated Name\", extension=0000)\n xml_req =\"{\\\"device\\\":{ \\\"id\\\":#{id},\\\"number\\\":\\\"#{number}\\\",\\\"name\\\":\\\"#{name}\\\",\\\"address\\\":\\\"#{address}\\\"}}\"\n \n \n request = Net::HTTP::Put.new(\"#{@url}/#{id}.json\")\n request.add_field \"Content-Type\", \"application/json\"\n request.body = xml_req\n \n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n \n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end",
"title": ""
},
{
"docid": "bd8d6e30c1580c9c2c4e77c7b564a907",
"score": "0.5293598",
"text": "def update\n @content = Content.find(params[:id])\n\n respond_to do |format|\n if @content.update_attributes(params[:content])\n format.html { redirect_to @content, notice: 'Content was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b3ed53b7afb3563c41c5147b3e5f51bb",
"score": "0.52840334",
"text": "def update\n @metadata = Metadata.find(params[:id])\n\n respond_to do |format|\n if @metadata.update_attributes(params[:metadata])\n format.html { redirect_to(@metadata, :notice => 'Metadata was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @metadata.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bc758a591934fb33bd632aa9c50557ae",
"score": "0.52833265",
"text": "def update\n respond_to do |format|\n if @content.update(content_params)\n @content.update(url: @content.url+'/') unless @content.url.end_with?('/')\n format.html { redirect_to @content, notice: 'Сведения о файле сохранены.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "be2d852a01758cf18a72669feb296dbe",
"score": "0.52816755",
"text": "def put(io, name, content_type=nil)\n uri = uri(name)\n req = Net::HTTP::Put.new(uri.request_uri)\n\n content_type = `file -ib #{Shellwords.escape(io.path)}`.chomp if !content_type && io.respond_to?(:path)\n\n req.add_field \"Content-Type\", content_type\n req.add_field \"Content-Length\", io.size\n req.body_stream = io\n\n target_uri = uri(\"/#{name}\")\n\n request(target_uri, req)\n\n target_uri.to_s\n end",
"title": ""
},
{
"docid": "9cbed40181e0c784e2ee56585fb77ba8",
"score": "0.5280403",
"text": "def update!(**args)\n @contents = args[:contents] if args.key?(:contents)\n @errors = args[:errors] if args.key?(:errors)\n @is_pending = args[:is_pending] if args.key?(:is_pending)\n @is_sitemaps_index = args[:is_sitemaps_index] if args.key?(:is_sitemaps_index)\n @last_downloaded = args[:last_downloaded] if args.key?(:last_downloaded)\n @last_submitted = args[:last_submitted] if args.key?(:last_submitted)\n @path = args[:path] if args.key?(:path)\n @type = args[:type] if args.key?(:type)\n @warnings = args[:warnings] if args.key?(:warnings)\n end",
"title": ""
},
{
"docid": "ff78143fbc4d764b8107dc990c7e45c8",
"score": "0.52792484",
"text": "def update\n @content = Content.find(params[:id])\n\n respond_to do |format|\n if @content.update_attributes(params[:content])\n flash[:notice] = 'Content was successfully updated.'\n format.html { redirect_to @content }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c936b5859a71e9047d6c1c22ee3cbc99",
"score": "0.5273831",
"text": "def contents=(contents)\n @contents = contents\n @tempfile.seek 0\n @tempfile.write @contents\n @tempfile.flush\n end",
"title": ""
},
{
"docid": "3088d873e78046bb8db8c81ed3956055",
"score": "0.5272912",
"text": "def do_modify(json, e)\n jstring = json\n unless json.is_a? String\n jstring = JSON.generate json\n end\n msg jstring, Logger::DEBUG\n uri = URI.parse(\"https://#{@host}\")\n escaped = URI.escape(\"#{@docroot}#{e}\")\n msg \"Put: #{uri}#{escaped}\", Logger::DEBUG\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n http.start do |http|\n req = Net::HTTP::Put.new(\"#{escaped}\",initheader = {\"User-Agent\" => @username, 'Content-Type' => 'application/json; charset=utf-8'})\n req.body = jstring\n response = http_request(http, req)\n end\n msg response, Logger::DEBUG\n return response\n end",
"title": ""
},
{
"docid": "882c8317370987b86425c0adbf5bfe8c",
"score": "0.52655447",
"text": "def update_aos_version(args = {}) \n put(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "bb96bab09259313709de4d5029ee2765",
"score": "0.52632165",
"text": "def put(path, opts = {})\n request(:put, path, opts)\n end",
"title": ""
},
{
"docid": "559f82d8fc4aa480d2ec501388827131",
"score": "0.5262131",
"text": "def update\n respond_to do |format|\n if @o_single.update(url_content_params)\n format.html { redirect_to (is_admin? ? url_contents_url : root_url), notice: t(\"general.successfully_updated\") }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @o_single.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b8b8c706eb726eb0062d7efb0cd4654e",
"score": "0.5259918",
"text": "def put(relpath = nil, params = nil, data = nil, contenttype = nil)\n invoke(:put, relpath, params, data, _make_headers(contenttype))\n end",
"title": ""
},
{
"docid": "460ddf78fbbe8208a94cac484f6c2870",
"score": "0.5259755",
"text": "def update\n replace_entry 'word/document.xml', doc.serialize(save_with: 0)\n end",
"title": ""
},
{
"docid": "fa27a582d0b61cd39ab3fb7be4ea58f9",
"score": "0.5249458",
"text": "def update\n @file = Argo::File.find(params[:id])\n\n respond_to do |format|\n if @file.update_attributes(params[:argo_file])\n flash[:notice] = 'Argo::File was successfully updated.'\n format.html { redirect_to(@file) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @file.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "acb7e9d15052eb1dabf43aa73f03727b",
"score": "0.5248472",
"text": "def update\n @xfile = Xfile.find(params[:id])\n\n respond_to do |format|\n if @xfile.update_attributes(params[:xfile])\n format.html { redirect_to @xfile, notice: 'Xfile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @xfile.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6225e311f7977b3582b7c56dfb530ba4",
"score": "0.52460164",
"text": "def update_resource\n handle_create { File.write(path, content) }\n handle_update :mode { File.chmod(mode, path) }\n end",
"title": ""
},
{
"docid": "057823f18af713d66c2a1ed331e48354",
"score": "0.52418137",
"text": "def update!(**args)\n @contents = args[:contents] if args.key?(:contents)\n @next_start_byte = args[:next_start_byte] if args.key?(:next_start_byte)\n @start = args[:start] if args.key?(:start)\n end",
"title": ""
},
{
"docid": "69fe81309002bbd86db2ad9f3bf7602c",
"score": "0.52381265",
"text": "def update\n @content_wrapper = ContentWrapper.find(params[:id])\n\n respond_to do |format|\n if @content_wrapper.update_attributes(params[:content_wrapper])\n format.html { redirect_to(@content_wrapper, :notice => 'Content wrapper was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @content_wrapper.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cbbddc73e7fbb152fae713f712777b3",
"score": "0.52356875",
"text": "def update\n update_resource(@tomato)\n end",
"title": ""
},
{
"docid": "e7d01c15199c6e8a6f641a6976aad136",
"score": "0.5230727",
"text": "def update!(**args)\n @contents = args[:contents] if args.key?(:contents)\n @digest = args[:digest] if args.key?(:digest)\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "88323cc976b7e59ed09c7a6c51e1e497",
"score": "0.0",
"text": "def brand_params\n params.fetch(:brand, {})\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": ""
}
] |
02b6616c03bf4717be4f5ae0cc56f772
|
Required for cancan abilities
|
[
{
"docid": "f9f6b8819fc4ba68f59251aa38960058",
"score": "0.0",
"text": "def namespace\n # controller_name_segments = params[:controller].split('/')\n # controller_name_segments.pop\n # controller_name_segments.join('/').camelize\n params[:controller].split('/').first\n end",
"title": ""
}
] |
[
{
"docid": "ed744a6b5c669fa6384f3cb9f1a9c94a",
"score": "0.7273065",
"text": "def allowed?; true end",
"title": ""
},
{
"docid": "dd6f7732e55269e16c663cb9d4171477",
"score": "0.7021739",
"text": "def permitted?; end",
"title": ""
},
{
"docid": "a83e43b30464b276062cabf342db76ff",
"score": "0.66493803",
"text": "def allowed?\n true\n end",
"title": ""
},
{
"docid": "a83e43b30464b276062cabf342db76ff",
"score": "0.66493803",
"text": "def allowed?\n true\n end",
"title": ""
},
{
"docid": "7a2fb43b249ea592712c5e644b4afd51",
"score": "0.6623843",
"text": "def allowed?\n true\n end",
"title": ""
},
{
"docid": "c206d7599772484d55485d4eed46fc1f",
"score": "0.6568824",
"text": "def ability?\n self.__ability.present?\n end",
"title": ""
},
{
"docid": "0729cad9402070266476806a039745db",
"score": "0.6506476",
"text": "def restriction \n end",
"title": ""
},
{
"docid": "488383887e95a080e467fd966f6c64a4",
"score": "0.6494135",
"text": "def restriction\n end",
"title": ""
},
{
"docid": "14e490f6b0336ef09b604686b111c73b",
"score": "0.64649194",
"text": "def can_do_member_scoped_actions\n can :show, :all\n can :edit, :all\n can :destroy, :all\n can :history, :all\n can :show_in_app, :all\n can :clone, :all\n # can :nested_set, :all\n can :nestable, :all\n can :change_state, :all\n end",
"title": ""
},
{
"docid": "fd0b2571dbdef8009f90cca559c956b5",
"score": "0.64366406",
"text": "def allowed?() raise NotImplementedError end",
"title": ""
},
{
"docid": "7cd068715c9b61eb9c65789c44a73eaf",
"score": "0.6435138",
"text": "def initialize ability\n @ability = ability\n end",
"title": ""
},
{
"docid": "680ac616cdd9d385ab5a5141627aba35",
"score": "0.6430098",
"text": "def no_admin_set_abilities\n cannot [:edit, :create, :delete], Hydra::Admin::Collection\n end",
"title": ""
},
{
"docid": "2ebe67ffe58f129cd4ca9a172d3d2f64",
"score": "0.64195234",
"text": "def allow_in_control=(_arg0); end",
"title": ""
},
{
"docid": "a56332554e5877ec61cad643c57c7009",
"score": "0.6392891",
"text": "def abilities\n\t\t\t@abilities ||= {}\n\t\tend",
"title": ""
},
{
"docid": "2e3ee6e695b01c6ff57ae08851fa5a25",
"score": "0.63919777",
"text": "def permission_required \n render_403 unless admin? || @item.is_editable_by?(current_user)\n end",
"title": ""
},
{
"docid": "2971e586cce4828e7a06cbd8bc985c23",
"score": "0.6386025",
"text": "def thesis_admin\n processor\n\n can :manage, :all\n cannot 'destroy', :copyright\n cannot 'destroy', :degree\n cannot 'destroy', :department\n cannot 'destroy', :hold_source\n cannot 'destroy', :license\n cannot 'destroy', :thesis\n end",
"title": ""
},
{
"docid": "0ef6f17dc75279a4e0974b917ca0f753",
"score": "0.6367877",
"text": "def requirements_unlocked_or_can_be?\n true\n end",
"title": ""
},
{
"docid": "174c071c627b15a44733aa9e2a48dedf",
"score": "0.63662475",
"text": "def abilities_to_register\n []\n end",
"title": ""
},
{
"docid": "01a9836bb01a2632b7e837a0e253b919",
"score": "0.63510025",
"text": "def allowed?\n allowed\n end",
"title": ""
},
{
"docid": "94168927c7b5063b4d1ee1a70ae7e562",
"score": "0.63357437",
"text": "def can?(name)\n\t\t\tabilities.include? name\n\t\tend",
"title": ""
},
{
"docid": "3156a2d517c6bffcff42ccec6f4d575a",
"score": "0.63110167",
"text": "def initialize ability\n @ability = ability\n end",
"title": ""
},
{
"docid": "c48b21ae994b259ef944eb9fcf3dc409",
"score": "0.6252301",
"text": "def smart?; self.permission_level = 2; end",
"title": ""
},
{
"docid": "cea41204a3db38f6f83dfa98e710ed0f",
"score": "0.62521696",
"text": "def define_eccept\n if current_user.info.id == @resource.id || can_manage_has_one(current_user.info, @resource, Info)\n true\n else\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "8b5a09bcc201c977db588fb0bbd92899",
"score": "0.6250935",
"text": "def abilities_to_register\n []\n end",
"title": ""
},
{
"docid": "68b0125092dfbad04cc09c571a9aa114",
"score": "0.6239805",
"text": "def initialize(user)\n\n # The first argument to `can` is the action you are giving the user\n # permission to do.\n # If you pass :manage it will apply to every action. Other common actions\n # here are :read, :create, :update and :destroy.\n #\n # The second argument is the resource the user can perform the action on.\n # If you pass :all it will apply to every resource. Otherwise pass a Ruby\n # class of the resource.\n #\n # The third argument is an optional hash of conditions to further filter the\n # objects.\n # For example, here the user can only update published articles.\n #\n # can :update, Article, :published => true\n #\n # See the wiki for details:\n # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities\n\n user ||= User.new\n\n # we don't do role inheritance b/c I have a sneaking feeling we\n # will want more fine-grained control for our roles as the system\n # grows.\n\n\n if ['contributor', 'editor', 'super_editor', 'admin'].member? user.role\n can [:edit, :update, :show], :all, :created_by_id => user.id\n can :create, DericciLink\n\n can :destroy, [Comment, Reply], :created_by_id => user.id\n cannot :manage, Page\n\n can :link, :all\n can :unlink, :all, :created_by_id => user.id\n can :history, :all\n\n can [:index, :new], DericciGame\n can :index, [Entry, Source, Manuscript, Comment]\n\n can :manage, PrivateMessage, :created_by_id => user.id\n can :manage, PrivateMessage do |pm|\n pm.users.include? user\n end\n can :manage, Rating\n cannot [:import, :upload], Entry\n end\n\n if ['editor', 'super_editor', 'admin'].member? user.role\n can :unlink, :all\n can :edit, Manuscript\n can :manage, DericciRecord\n\n cannot :deprecate, :all\n can :manage, Name\n cannot :review, Name\n # this needs to be RE-Established, since it has been overriden by line 51\n can :edit, :all, :created_by_id => user.id\n cannot :manage, Page\n end\n\n if ['super_editor'].member? user.role\n # allow super-editors to edit legacy records\n can [:edit, :update, :verify, :deprecate], Entry, :unverified_legacy_record => true\n can [:edit, :update], Source, :legacy => true\n can :manage, Place\n can :manage, Language\n end\n\n if ['admin'].member? user.role\n can :manage, :all\n can :update_type, Source\n end\n\n can [:edit, :update], Entry, contributors: { :id => user.id }\n cannot :manage, [Group]\n can [:edit, :update, :destroy], Group, admin: { :id => user.id }\n can [:destroy], Entry, {created_by_id: user.id, draft: true}\n\n can :show, Entry\n cannot :show, Entry do |entry|\n (entry.created_by != user && !entry.contributors.include?(user)) && entry.draft\n end\n end",
"title": ""
},
{
"docid": "cb5acf645effc2a7fecc2d73a05f08c7",
"score": "0.62160456",
"text": "def permissions = {}",
"title": ""
},
{
"docid": "42ce31bb830de21e8bd1aa60d188d220",
"score": "0.6210778",
"text": "def canISteal\n @canISteal\n end",
"title": ""
},
{
"docid": "550cd967f7e0b51604744fecefb1adbd",
"score": "0.62027544",
"text": "def required; end",
"title": ""
},
{
"docid": "550cd967f7e0b51604744fecefb1adbd",
"score": "0.62027544",
"text": "def required; end",
"title": ""
},
{
"docid": "550cd967f7e0b51604744fecefb1adbd",
"score": "0.62027544",
"text": "def required; end",
"title": ""
},
{
"docid": "9811e9862cba265c304cf1a6175409e5",
"score": "0.6202234",
"text": "def ability\n @ability ||= Ability.new(self)\n end",
"title": ""
},
{
"docid": "9811e9862cba265c304cf1a6175409e5",
"score": "0.6202234",
"text": "def ability\n @ability ||= Ability.new(self)\n end",
"title": ""
},
{
"docid": "9811e9862cba265c304cf1a6175409e5",
"score": "0.6202234",
"text": "def ability\n @ability ||= Ability.new(self)\n end",
"title": ""
},
{
"docid": "9811e9862cba265c304cf1a6175409e5",
"score": "0.6202234",
"text": "def ability\n @ability ||= Ability.new(self)\n end",
"title": ""
},
{
"docid": "9811e9862cba265c304cf1a6175409e5",
"score": "0.6202234",
"text": "def ability\n @ability ||= Ability.new(self)\n end",
"title": ""
},
{
"docid": "e0a6bb749bb77d95339dc10aaa669f0e",
"score": "0.6196757",
"text": "def allowable\n return @allowable if @allowable\n\n @allowable = parent_allowables\n end",
"title": ""
},
{
"docid": "a67c8aefa80f5367822530a6ee72a3df",
"score": "0.6195111",
"text": "def requirements; end",
"title": ""
},
{
"docid": "a67c8aefa80f5367822530a6ee72a3df",
"score": "0.6195111",
"text": "def requirements; end",
"title": ""
},
{
"docid": "a67c8aefa80f5367822530a6ee72a3df",
"score": "0.6195111",
"text": "def requirements; end",
"title": ""
},
{
"docid": "a67c8aefa80f5367822530a6ee72a3df",
"score": "0.6195111",
"text": "def requirements; end",
"title": ""
},
{
"docid": "74e6d254a5381b103a610d447ac61c8d",
"score": "0.61760634",
"text": "def can_authorize?(user, a)\n user != self and may_authorize and\n (abilities | ADMIN_TASKS).include?(a)\n end",
"title": ""
},
{
"docid": "893932f773ba8474875056632fe994c8",
"score": "0.6159952",
"text": "def custom_permissions\n\n campus = \"bakersfield\" if current_user.email.include?(\"bakersfield.edu\")\n campus = \"chancellor\" if current_user.email.include?(\"calstate.edu\")\n campus = \"channel\" if current_user.email.include?(\"ci.edu\")\n campus = \"chico\" if current_user.email.include?(\"chico.edu\")\n campus = \"dominguez\" if current_user.email.include?(\"dh.edu\")\n campus = \"eastbay\" if current_user.email.include?(\"eb.edu\")\n campus = \"fresno\" if current_user.email.include?(\"fresno.edu\")\n campus = \"fullerton\" if current_user.email.include?(\"fullerton.edu\")\n campus = \"humboldt\" if current_user.email.include?(\"humboldt.edu\")\n campus = \"longbeach\" if current_user.email.include?(\"lb.edu\")\n campus = \"losangeles\" if current_user.email.include?(\"la.edu\")\n campus = \"maritime\" if current_user.email.include?(\"maritime.edu\")\n campus = \"mlml\" if current_user.email.include?(\"mlml.edu\")\n campus = \"northridge\" if current_user.email.include?(\"northridge.edu\")\n campus = \"pomona\" if current_user.email.include?(\"bronco.edu\")\n campus = \"sacramento\" if current_user.email.include?(\"sacramento.edu\")\n campus = \"sanfrancisco\" if current_user.email.include?(\"sf.edu\")\n campus = \"sanmarcos\" if current_user.email.include?(\"sanmarcos.edu\")\n campus = \"sonoma\" if current_user.email.include?(\"sonoma.edu\")\n campus = \"stanislaus\" if current_user.email.include?(\"stanislaus.edu\")\n\n user_groups.push(campus)\n\n # admin\n if current_user.admin?\n can [:create, :show, :add_user, :remove_user, :index, :edit, :update, :destroy], Role\n end\n\n # Limits creating new objects to a specific group\n #\n # if user_groups.include? 'special_group'\n # can [:create], ActiveFedora::Base\n # end\n end",
"title": ""
},
{
"docid": "b7586c89404b8b51bb0c48bf422e5390",
"score": "0.6153463",
"text": "def custom_permissions\n #Collection Manager Permissions\n #Higher power than edit user...[Dont want edit users to be able to DELETE a COLLECTION??, (Delete a DO?)]\n if current_user.applicable_policy?(SETTING_POLICY_COLLECTION_MANAGER)\n #Marked as being able to :manage_collection\n can :manage_collection_flag, :all\n can :create, [DRI::Batch, DRI::GenericFile]\n end\n\n\n #Admin Permissions\n if current_user.applicable_policy?(SETTING_POLICY_ADMIN)\n can :admin_flag, :all\n #Disabled for now..\n can :manage, :all\n end\n\n #Create_do flag (alias for :edit collection)\n can :create_do, String do |pid|\n test_create(pid)\n end\n\n can :create_do, DRI::Batch do |collection|\n test_create(collection)\n end\n end",
"title": ""
},
{
"docid": "4d057607d36affaff2db443d13b01ed7",
"score": "0.6152998",
"text": "def custom_permissions\n # Limits deleting objects to a the admin user\n #\n # if current_user.admin?\n # can [:destroy], ActiveFedora::Base\n # end\nif current_user.admin?\n\t can [:create, :show, :add_user, :remove_user, :index], Role\n\t end\n # Limits creating new objects to a specific group\n #\n # if user_groups.include? 'special_group'\n # can [:create], ActiveFedora::Base\n # end\n\n\n\n end",
"title": ""
},
{
"docid": "0da085b5a2e00811f3197c44d87a392a",
"score": "0.6151723",
"text": "def ability\n return @ability_current\n end",
"title": ""
},
{
"docid": "89ad7777d4ac16bc2c5ee2ec3f953e55",
"score": "0.6150463",
"text": "def define_eccept\n if current_user.info.id==@resource.id || can_manage_has_one(current_user.info, @resource, @model)\n return true\n else\n redirect_to root_path \n end\n end",
"title": ""
},
{
"docid": "f6b883cca4f7c254a676909eb40eb903",
"score": "0.6150318",
"text": "def current_ability\n current_admin.ability\n end",
"title": ""
},
{
"docid": "87690ba04e61fb42d2d8e55fda4352ab",
"score": "0.6143812",
"text": "def method_missing(name, *args, &block)\n if abilities.key?(name)\n if TRUE_FLAGS.include?(abilities[name])\n true\n elsif FALSE_FLAGS.include?(abilities[name])\n false\n else\n if self.class === abilities[name]\n abilities[name]\n else\n abilities[name] = self.class.new(abilities[name], true) # true for subcan\n end\n end\n else\n if subcan\n false\n else\n # If not exist a key(resource) then mock a key with a blank can instance, so\n # we can call chain like this: <tt>can.resource_name.read # => false</tt>\n abilities[name] = self.class.new({}, true)\n end\n end\n end",
"title": ""
},
{
"docid": "364e8ddb2a50bb998a505c05e265e07e",
"score": "0.61377054",
"text": "def custom_permissions\n if current_user.admin?\n can :manage, :all\n end\n end",
"title": ""
},
{
"docid": "888ebabc7252c122e653b2588525bf20",
"score": "0.61339617",
"text": "def basic\n # Any user can create a new Thesis.\n can :create, Thesis\n can :start, Thesis\n can :confirm, Thesis\n\n # Only the Thesis author can view their Thesis.\n can :read, Thesis, users: { id: @user.id }\n can :update, Thesis, users: { id: @user.id }\n end",
"title": ""
},
{
"docid": "d653d8152a03597879859ab8631f9d44",
"score": "0.61315364",
"text": "def authorizer\n current_ability\n end",
"title": ""
},
{
"docid": "fd87602d72966a75fe6c6878f1164200",
"score": "0.61143875",
"text": "def chargeable?; true; end",
"title": ""
},
{
"docid": "40f3115c580015382cd1e276c36cc5de",
"score": "0.61065066",
"text": "def enforce_permissions\n bounce unless is_admin?\n end",
"title": ""
},
{
"docid": "77da27fd1a92fc201afaaf7ca39966dc",
"score": "0.6098777",
"text": "def current_ability\n current_user.ability\n end",
"title": ""
},
{
"docid": "b53a46fb5a9c05cf38efeff153bd6e76",
"score": "0.60891277",
"text": "def allow_member?\n true\n end",
"title": ""
},
{
"docid": "5b1e04451d94b4cddf81b37eda19e7f1",
"score": "0.6083776",
"text": "def denied\n end",
"title": ""
},
{
"docid": "8d8dde739ec730ad2262563ef93d9613",
"score": "0.6077008",
"text": "def custom_permissions\n can [:file_status, :stage, :unstage], FileSet\n\n if current_user.ingest_from_external_sources?\n end\n\n if current_user.manage_users?\n can [:show, :add_user, :remove_user, :index], Role\n end\n\n if current_user.manage_roles?\n can [:create, :show, :index, :edit, :update, :destroy], Role\n end\n\n if current_user.run_fixity_checks?\n can [:fixity], FileSet\n end\n # Limits deleting objects to a the admin user\n #\n # if current_user.admin?\n # can [:destroy], ActiveFedora::Base\n # end\n\n # Limits creating new objects to a specific group\n #\n # if user_groups.include? 'special_group'\n # can [:create], ActiveFedora::Base\n # end\n end",
"title": ""
},
{
"docid": "104ffca4e0cc2c977fb5d6e4ec27def9",
"score": "0.6073629",
"text": "def can_add_course?\n self.available_courses > 0 || self.clearance?\n end",
"title": ""
},
{
"docid": "37e23be6c4e08bf48b826177a0f6a352",
"score": "0.6071084",
"text": "def usable?; end",
"title": ""
},
{
"docid": "a0114d489f2618530e9b7144c2c0f87b",
"score": "0.606344",
"text": "def restriction_level\n return 0 # only user itself is allowed\n end",
"title": ""
},
{
"docid": "a3fa9d4fba9983ffc3fb8de4d6ec3f5a",
"score": "0.6059032",
"text": "def has_access?\n true\n end",
"title": ""
},
{
"docid": "a3fa9d4fba9983ffc3fb8de4d6ec3f5a",
"score": "0.6059032",
"text": "def has_access?\n true\n end",
"title": ""
},
{
"docid": "f9bad16d129fda71b664b5f7abe13a7f",
"score": "0.6056849",
"text": "def administrator\n can :manage, :all\n end",
"title": ""
},
{
"docid": "cd39ad56669746bfbebd79621bdb809d",
"score": "0.60566765",
"text": "def initialize(user)\n if user.role == \"member\"\n can :index, :all\n can :create, :all\n cannot :index, Passenger\n #cannot :index, Home\n # Jeder Member kann jede Übersicht außer der Übersicht der User sehen\n # und kann alle Elemente erstellen\n can [:show, :update, :destroy], Car do |car|\n car && car.user == user \n end\n can :show, user.get_visible_cars\n # Member können eigene Autos erstellen, editieren und zerstören und alle eigenen und bei teilzunehmenden Fahrten genutzten Autos anschauen \n can [:outbox, :show, :update], Message do |message|\n message && message.writer == user\n end\n can [:show, :update], Message do |message|\n message && message.receiver == user\n end\n cannot [:edit], Message do |message|\n message && message.receiver == user\n end\n # Member können alle mit ihnen in Verbindung stehenden Messages lesen und editieren\n can [:show, :update, :destroy], Request do |request|\n request && request.user == user\n end\n # Member haben kompletten Zugriff auf die eigenen Anfragen\n can :show, Trip\n can [:update, :destroy], Trip do |trip|\n trip && trip.user == user\n end\n # Member können alle Fahrten sehen, jedoch nur die eigenen verändern\n can [:update, :destroy], Rating do |rating|\n rating && rating.author == user\n end\n # Member können nur selbstgeschriebene Ratings verändern\n can :show, user.get_visible_users\n can [:show, :update, :destroy], User do |user1|\n user1 && user1 == user\n end\n # Member können alle User sehen mit denen sie eine Fahrt antreten wollen und ihren eigenen Account verändern\n\n # Rechte der Member\n elsif user.role == \"admin\"\n can :manage, :all\n # Der Admin hat vollständige Zugriffsrechte\n end\n end",
"title": ""
},
{
"docid": "0e757d0df3a64e9e53edcc2ec32e976f",
"score": "0.6045468",
"text": "def allowed?(*_)\n true\n end",
"title": ""
},
{
"docid": "dd72309b548a586a6dea953a3477f558",
"score": "0.60448575",
"text": "def ability\n @ability ||= ::Ability.new(self)\n end",
"title": ""
},
{
"docid": "2fa2fd1d60cdca7d4b5c57ede764b708",
"score": "0.60416836",
"text": "def permit_unprotected_actions\n # Allow clients to download packages\n can [:download, :icon], Package\n # Allow client computer requests\n can :checkin, Computer\n can [:show_plist, :show_resource], Computer\n # Allow any request to retrieve catalogs\n can :read, Catalog\n # Allow everyone to edit their user record\n can [:read, :update], User, :id => @user.id\n # Allow anyone to login and logout\n can [:create, :destroy], :session\n # Allow anyone to view their dashboard\n can :manage, :dashboard\n end",
"title": ""
},
{
"docid": "da6410a176b3c27b2d797cfb1971ee04",
"score": "0.6036509",
"text": "def initialize(user)\n anonymous_abilities\n\n if user.blank?\n no_user_abilities\n else\n cannot :update, UserSession\n # can :manage, Section do |section|\n # can? :update, section.document\n # end\n # habitapedia_abilities(user)\n # social_abilities(user)\n admin_abilities if user.admin?\n end\n end",
"title": ""
},
{
"docid": "9468647a56ac2c1a0ba924c1c9fba793",
"score": "0.6032081",
"text": "def allowed?\n raise \"Unimplemented 'allowed?' for intention: #{self.inspect}!\"\n end",
"title": ""
},
{
"docid": "078bb932fbf69e4e9a13811021c03b8d",
"score": "0.60311216",
"text": "def meta_abilities\n User.roles.each do |(k, v)|\n if user.has_role? k\n can \"do_#{k}\".to_sym, :all\n end\n end\n end",
"title": ""
},
{
"docid": "36b960699a465eead42eac6e263957de",
"score": "0.6029816",
"text": "def sharded?; false; end",
"title": ""
},
{
"docid": "052828486063096017d293bb904f2384",
"score": "0.6025017",
"text": "def current_ability\n \t\t@current_ability ||= Ability.new(current_usuario)\n\tend",
"title": ""
},
{
"docid": "052828486063096017d293bb904f2384",
"score": "0.6025017",
"text": "def current_ability\n \t\t@current_ability ||= Ability.new(current_usuario)\n\tend",
"title": ""
},
{
"docid": "1d714d3937be43f3128c2bcb7b91d17b",
"score": "0.60169774",
"text": "def ability\n\t\t@ability ||= Admin::SystemAdminAbility.new(self)\n\tend",
"title": ""
},
{
"docid": "9a9c3815992d7f04cb0e6ec04b871d06",
"score": "0.6007922",
"text": "def initialize(user)\n #we define here all the rules and permissions to out application\n # Define abilities for the passed in user here. For example:\n\n\n #if user is not signed in, current_user will return nil so we set it to 'User.new' if user is not signed in to ease writing rules by simply doing 'user.id' which will return nil instead of raising an exception\n user ||= User.new\n\n alias_action :create, :read, :update, :destroy, to: :crud\n\n #this rule specifies that the user can crud a question if the question created is the same as user who is currently logged in\n #remember that this defined the rule but you still have to enforce the rule yourself by using it in your views and controllers\n\n if user.is_admin?\n can :manage, :all?\n end\n #manage option in cancancan gives the user the ability to do anything\n #and not just CRUD; it includes other actions such as publish, activate, disable, etc\n\n\n can :crud, Question do |question|\n question.user == user\n end\n\n can :like, Question do |question|\n question.user != user\n end\n\n cannot :like, Question do |question|\n question.user == user\n end\n # user ||= User.new # guest user (not logged in)\n # if user.admin?\n # can :manage, :all\n # else\n # can :read, :all\n # end\n #\n # The first argument to `can` is the action you are giving the user\n # permission to do.\n # If you pass :manage it will apply to every action. Other common actions\n # here are :read, :create, :update and :destroy.\n #\n # The second argument is the resource the user can perform the action on.\n # If you pass :all it will apply to every resource. Otherwise pass a Ruby\n # class of the resource.\n #\n # The third argument is an optional hash of conditions to further filter the\n # objects.\n # For example, here the user can only update published articles.\n #\n # can :update, Article, :published => true\n #\n # See the wiki for details:\n # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities\n end",
"title": ""
},
{
"docid": "436a96a696d3ce4ea4c1e729aae56060",
"score": "0.59982944",
"text": "def authorize!\n Ability.allowed?(context[:current_user], :read_milestone, parent) || raise_resource_not_available_error!\n end",
"title": ""
},
{
"docid": "50fbe71fe7a84868fac664bc44ef75a9",
"score": "0.5998165",
"text": "def authorize_pot\n authorize @pot, :contribute?\n end",
"title": ""
},
{
"docid": "25276dff00ba085b53dfc8dedf4b699c",
"score": "0.5997504",
"text": "def create?\n @current_user.permission('Bid', :clerk)\n end",
"title": ""
},
{
"docid": "6300cd8d9980a3eacbc3a195b469c7f8",
"score": "0.59819883",
"text": "def can(action,resource)\n actions = [*action]\n actions << :all\n ruleset = resource.rules.where('permittee' => self, 'action' => actions)\n if ruleset.count > 0\n return true\n end\n return false\n end",
"title": ""
},
{
"docid": "61612a1b1d4f0045d0f79c06c9ab7d41",
"score": "0.59818715",
"text": "def custom_permissions\n can [:create], Account\n end",
"title": ""
},
{
"docid": "61612a1b1d4f0045d0f79c06c9ab7d41",
"score": "0.59818715",
"text": "def custom_permissions\n can [:create], Account\n end",
"title": ""
},
{
"docid": "a6fe5441cd0439f8f8ac42f841da9f4b",
"score": "0.59774977",
"text": "def initialize(user)\n # Guest user (not logged in)\n user ||= User.new\n can [:show, :edit, :update, :destroy], User, :id => user.id # Everyone can see see, edit and destroy\n can :read, Course\n can :create, User\n\n if user.has_role? :Cursist\n can :read, Course\n\n elsif user.has_role? :Medewerker\n can :manage, Course\n can :manage, CourseKind\n can :manage, Ship\n\n elsif user.has_role? :Beheerder\n can :manage, :all\n end\n end",
"title": ""
},
{
"docid": "7951044c8c63f3d614306bbdf0d2e8d4",
"score": "0.5975683",
"text": "def read_permitted?\n return (acting_user.administrator? || true)\n end",
"title": ""
},
{
"docid": "cbbbaf55c0d577d42d53e39ce9fa49e0",
"score": "0.5975303",
"text": "def authorization; end",
"title": ""
},
{
"docid": "c4546ec513acfb91a1a2f45b84272c14",
"score": "0.5974998",
"text": "def create_permitted?\n acting_user.administrator?\n end",
"title": ""
},
{
"docid": "c4546ec513acfb91a1a2f45b84272c14",
"score": "0.5974998",
"text": "def create_permitted?\n acting_user.administrator?\n end",
"title": ""
},
{
"docid": "c4546ec513acfb91a1a2f45b84272c14",
"score": "0.5974998",
"text": "def create_permitted?\n acting_user.administrator?\n end",
"title": ""
},
{
"docid": "c4546ec513acfb91a1a2f45b84272c14",
"score": "0.5974998",
"text": "def create_permitted?\n acting_user.administrator?\n end",
"title": ""
},
{
"docid": "e565b65646fc221ac6eb35034bf2eb7b",
"score": "0.5974816",
"text": "def custom_permissions\n # Limits deleting objects to a the admin user\n #\n # if current_user.admin?\n # can [:destroy], ActiveFedora::Base\n # end\n if current_user.admin?\n can [:create, :show, :add_user, :remove_user, :index, :edit, :update, :destroy], Role\n # Admin user can create works of all work types\n can :create, curation_concerns_models\n end\n # Limits creating new objects to a specific group\n #\n # if user_groups.include? 'special_group'\n # can [:create], ActiveFedora::Base\n # end\n end",
"title": ""
},
{
"docid": "200689ebe78729b6c3dd51a9665d99f9",
"score": "0.59725726",
"text": "def can_do_collection_scoped_actions\n can :index, :all\n can :new, :all\n can :export, :all\n can :history, :all\n can :destroy, :all\n end",
"title": ""
},
{
"docid": "5552ac5e47f6f43792268d72f0d70996",
"score": "0.5965842",
"text": "def initialize(user)\n \n user ||= User.new # guest user will not be allowed in the admin section\n alias_actions\n \n if user.super_admin?\n can :manage, :all\n elsif user.admin? || user.contractor?\n #can :manage, :all\n #can :read, :all\n #can :view_users, User do\n # user.admin?\n #end\n #authorize! :view_users, @user\n #can :create_users, User do\n # user.super_admin?\n #end\n #authorize! :create_users, @user\n #can :create_orders, User\n\n if user.trial || user.unsubscribed\n unless user.unsubscribed \n can [:make], Product if user.products.count < 1\n end\n can [:read, :change], Product, contractor_id: user.id \n else\n can :manage, Product, contractor_id: user.id\n end\n can :manage, Order, contractor_id: user.id\n can :manage, Shipment, order: {contractor_id: user.id}\n can :manage, ImageGroup, product: {contractor_id: user.id}\n can :manage, Property\n can :manage, Invoice\n\n if user.has_balance?\n can :manage, Requests::Balance, user_id: user.id\n can [:read, :make, :cancel], Requests::Transaction, balance_id: user.balance.id\n can :read, Requests::Credit\n can [:read, :make, :cancel], Requests::Withdraw\n can [:read], Requests::Refund, transaksi: {balance_id: user.balance.id} \n end\n\n can :manage, :overview\n end\n end",
"title": ""
},
{
"docid": "3f5f9f3d6047f965dc87dec57d13dfea",
"score": "0.59651494",
"text": "def publisher_admin(role)\n\n can :manage, Publication, :publisher_id => role.publisher_id\n can :update, Publisher, :id => role.publisher_id\n can :update, IssueState\n can :update, AdminUser, :id => @user.id\n\n\n\n end",
"title": ""
},
{
"docid": "485bcf2a01e7df1d824bca79c0f392b6",
"score": "0.5964431",
"text": "def new_player_allowed?; false end",
"title": ""
},
{
"docid": "ee1e04a5dfc4f69cc08792c48aa924e3",
"score": "0.59637284",
"text": "def policy; end",
"title": ""
},
{
"docid": "94be5f77c70bb80a79822dbea25a061a",
"score": "0.5963719",
"text": "def admin_permissions\n can [:manage], :all\n end",
"title": ""
},
{
"docid": "94be5f77c70bb80a79822dbea25a061a",
"score": "0.5963719",
"text": "def admin_permissions\n can [:manage], :all\n end",
"title": ""
},
{
"docid": "c972ede8b7419049111cd8d3c2ef6af7",
"score": "0.59579617",
"text": "def authorize_admin\n redirect_to :login unless current_user.permission.manage_app ||\n current_user.permission.manage_attrs ||\n current_user.permission.manage_achievement_categories ||\n current_user.permission.manage_talent_trees ||\n current_user.permission.manage_talents ||\n current_user.permission.manage_quests ||\n current_user.permission.manage_skills ||\n current_user.permission.manage_achievements ||\n current_user.permission.manage_items ||\n current_user.permission.manage_titles\n end",
"title": ""
},
{
"docid": "983eb251901ab8e2275a81b5b11f8b9a",
"score": "0.59570783",
"text": "def processor\n basic\n\n can 'index', :all\n can 'show', :all\n\n can :manage, :submitter\n\n can %i[read update], Thesis\n can :annotate, Thesis\n can :deduplicate, Thesis\n can :mark_downloaded, Thesis\n can :mark_withdrawn, Thesis\n can :process_theses, Thesis\n can :process_theses_update, Thesis\n can :select, Thesis\n\n can :read, Transfer\n can :select, Transfer\n can :files, Transfer\n\n can :read, Hold\n end",
"title": ""
},
{
"docid": "c2c3359b8ebe2e1a5c3f3b8528a529fc",
"score": "0.5954692",
"text": "def abilities\n @abilities ||= Six.new\n end",
"title": ""
},
{
"docid": "8e7f401755206018fce05a61976a0fe2",
"score": "0.5954187",
"text": "def initialize(user)\n unless user\n can [:new, :create, :sign_in, :sign_up, :check_username, :check_email, :check_run, :log], [Producer, User]\n cannot [:new, :destroy, :update], Event \n can [:show, :index, :search, :siete_dias_app, :patrocinados_app, :buscar_app, :lista_app, :view_app], Event \n\t cannot [:account, :edit, :destroy, :update], [Producer, User]\n can [:geo], City\n can [:view_app, :check_app], Ticket\n #can :manage, :all#comentar esto si se quiere quitar permiso admin \n else\n if user.has_role? :normal\n can :manage, User\n can [:new, :create, :sign_in, :sign_up, :check_username, :check_email, :check_run, :log], [Producer]\n cannot [:account, :edit, :destroy, :update], Producer\n cannot [:new, :destroy, :update], Event \n can [:show, :index, :search, :detail], Event \n can [:ticket_free, :result_free, :result], Transaction\n can [:view_app, :check_app, :index, :pdf, :render_pdf], Ticket\n #can :manage, :all# esto si se quiere quitar permiso admin \n end\n end\n end",
"title": ""
},
{
"docid": "f7e2d22623b429751bead0195c800649",
"score": "0.59529644",
"text": "def custom_permissions\n if current_user.admin?\n can [:create, :show, :add_user, :remove_user, :index, :edit, :update, :destroy], Role\n can [:create], Collection\n can [:discover], Hydra::AccessControls::Embargo\n can [:discover], Hydra::AccessControls::Lease\n can [:create], [ CurationConcerns.config.curation_concerns ]\n can [:destroy], ActiveFedora::Base\n can [:permissions], [ CurationConcerns.config.curation_concerns ]\n end\n\n # Limits deleting objects to a the admin user\n #\n #if current_user.admin?\n # can [:destroy], ActiveFedora::Base\n #end\n\n if current_user.has_role?('collection.manager')\n # can [:create, :show, :index, :edit, :update, :destroy], Collection\n can [:create], Collection\n end\n\n if current_user.has_role?('collection.depositor') or current_user.has_group_role?('collection.depositor')\n # can [:create, :show, :index, :edit, :update, :destroy], [ CurationConcerns.configuration.curation_concerns ]\n can [:create], [ CurationConcerns.config.curation_concerns ]\n # can [:show], Collection\n end\n\n # Limits creating new objects to a specific group\n #\n # if user_groups.include? 'special_group'\n # can [:create], ActiveFedora::Base\n # end\n end",
"title": ""
}
] |
7ffbcb95d2b84262198502000de3672a
|
POST /emails POST /emails.json
|
[
{
"docid": "091b3eee518b51f13e376c15f81b2180",
"score": "0.552293",
"text": "def create\n @email = Email.new(email_params)\n\n end",
"title": ""
}
] |
[
{
"docid": "03efbe43798a0b56127ea65c1d951a09",
"score": "0.67616475",
"text": "def create\n @email = @recipient.emails.new(params[:email])\n\n respond_to do |format|\n if @email.save\n format.html { redirect_to recipient_emails_path, notice: 'Email was successfully created.' }\n format.json { render json: @email, status: :created, location: @email }\n else\n format.html { render action: \"new\" }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ac053936307fb32952a8f5bcfc7e153",
"score": "0.6596975",
"text": "def create_email(files, recipients, subject, body, params = {})\n params[:recipients] = {}\n\n [recipients].flatten.each_with_index { |recipient, index| params[:recipients][index] = recipient }\n\n params[:files] = [files].flatten.map { |filepath| File.new(filepath, 'rb') }\n\n params[:subject] = subject\n params[:body] = body\n\n request :post,\n '/v3/emails.json',\n params\n end",
"title": ""
},
{
"docid": "547ce6e1ad4dd8a2331a408988b2f625",
"score": "0.6590788",
"text": "def create\n @email = Email.new({user_id: params[:user_id], email: params[:email]})\n @email.save\n render json:@email\n\n end",
"title": ""
},
{
"docid": "a59458aa2cd215f8632404e86fd4dafc",
"score": "0.6471755",
"text": "def create_from_emails\n service = FindOrCreateUsersByEmail.new(\n emails: json_api_params[:emails],\n invited_by: current_user,\n )\n if service.call\n render jsonapi: service.users\n else\n errors = [\"unable to process emails: #{service.failed_emails.join(',')}\"]\n render json: { errors: errors }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "a89baa505949c436435e03b7680465e9",
"score": "0.64567703",
"text": "def post_email(email)\n post_or_put_data(:post, email, 'emails', EmailTransactionResponse)\n end",
"title": ""
},
{
"docid": "a89baa505949c436435e03b7680465e9",
"score": "0.64567703",
"text": "def post_email(email)\n post_or_put_data(:post, email, 'emails', EmailTransactionResponse)\n end",
"title": ""
},
{
"docid": "df2098f6fe76b92a1943af92f7873c49",
"score": "0.6432317",
"text": "def emails\n get '/user/emails'\n end",
"title": ""
},
{
"docid": "1db5d88597da03d5fdcfbab9111b7bea",
"score": "0.64308083",
"text": "def new\n @email = @recipient.emails.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email }\n end\n end",
"title": ""
},
{
"docid": "813d936e883deb26c6ab33a756c574d3",
"score": "0.6353782",
"text": "def add_emails(emails)\n request_body = emails.map{ |email| {'key' => email, 'value' => '{}'} }.to_json\n response = do_request(Net::HTTP::Put, 'bulk', request_body)\n handle_response(response, emails.length.to_s + ' email(s) whitelisted.', 'Couldn\\'t whitelist email(s).')\nend",
"title": ""
},
{
"docid": "96accc8f2f1853c3052bb4e50921bd9a",
"score": "0.6350693",
"text": "def create_email_token\n client.post(\"/u/email-token.json\", {login: user.email})\n end",
"title": ""
},
{
"docid": "597251b68f4574b44bf19865449e58e7",
"score": "0.632071",
"text": "def api_emails_new_post(opts = {})\n api_emails_new_post_with_http_info(opts)\n nil\n end",
"title": ""
},
{
"docid": "3db146755889f1357e99f49a5f8caa14",
"score": "0.6301698",
"text": "def create\n @email = current_user.sent_emails.new(email_params)\n\n respond_to do |format|\n if @email.save\n format.html { redirect_to @email, notice: 'Email was successfully created.' }\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": "81ceda7a3c392527115807b0130f098d",
"score": "0.6255419",
"text": "def create\n verified_params = email_verification_params\n\n @email_verifications = []\n\n if verified_params[\"addresses\"].length > 10 or verified_params[\"addresses\"].length < 1\n render json: { message: \"Please send between 1 and 10 emails\" }, status: :unprocessable_entity\n return\n end\n\n verified_params[\"addresses\"].each do |address|\n email_verification = EmailVerification.new(address)\n unless email_verification.save\n render json: email_verification.errors, status: :unprocessable_entity\n return\n end\n @email_verifications << email_verification\n end\n render json: @email_verifications, status: :created, location: api_v1_email_verifications_url(@email_verification)\n end",
"title": ""
},
{
"docid": "35eeeeb51d798beed74dca2c0b41080a",
"score": "0.6234769",
"text": "def create\n @email = current_user.emails.new(email_params)\n parse_criteria(@email)\n\n respond_to do |format|\n if @email.save\n format.html { redirect_to contacts_path, notice: 'Email is sending.' }\n format.json { render action: 'show', status: :created, location: @email }\n else\n format.html { render action: 'new' }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f2b20957ff38e9149f12d6ae06f97f4c",
"score": "0.62343335",
"text": "def create\n @email = Email.new(email_params)\n\n respond_to do |format|\n if @email.save\n format.html { redirect_to emails_path, notice: 'Email was successfully created.' }\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": "49982bed7be2d2119b012c6a19160550",
"score": "0.62280077",
"text": "def create\n @email = Email.new(params[:email])\n\n respond_to do |format|\n if @email.save\n format.html { redirect_to new_email_path, notice: 'Email was successfully created.' }\n format.json { render json: @email, status: :created, location: @email }\n else\n format.html { render action: \"new\" }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5aa25188d91e238db3643afc770561ab",
"score": "0.61977035",
"text": "def create(data)\n client = Client.new({\n 'method': Client::METHOD_POST,\n 'url': Base.config.api_url('transactional-emails'),\n 'params_post': __prepare_body(data)\n })\n client.request\n end",
"title": ""
},
{
"docid": "38fdcdcec33f0fb5855bb7a67d09d594",
"score": "0.6193534",
"text": "def add_emails(book_id, emails)\n return handle_error('Empty book id or emails') if book_id.to_i <= 0 || emails.empty?\n data = { emails: serialize(emails) }\n send_request(\"addressbooks/#{book_id}/emails\", 'POST', data)\n end",
"title": ""
},
{
"docid": "ffa74fe8d5b6d3c77afef306fe052938",
"score": "0.617619",
"text": "def create\n @email = Email.new(params[:email])\n\n respond_to do |format|\n # if @email.save\n if @user.emails << @email \n flash[:notice] = 'Email was successfully created.'\n format.html { redirect_to user_email_url(@user, @email) }\n format.xml { head :created, :location => user_email_url(@user, @email) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @email.errors }\n end\n end\n end",
"title": ""
},
{
"docid": "fb2f0ab0116a77fae1824fb2e5976d4b",
"score": "0.61710227",
"text": "def create\n @app_email = AppEmail.new(params[:app_email])\n\n if @app_email.save\n render json: @app_email, status: :created, location: @app_email\n else\n render json: @app_email.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "525dacc10c42142768193b39bff6e0b0",
"score": "0.615795",
"text": "def create\n @email = Email.new(params[:email])\n\n respond_to do |format|\n if @email.save\n format.html { redirect_to @email, notice: 'Email was successfully created.' }\n format.json { render json: @email, status: :created, location: @email }\n else\n format.html { render action: \"new\" }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b94471c3650a862e55ed96a38ea033ac",
"score": "0.61287236",
"text": "def create\n @email = Email.new(email_params)\n\n respond_to do |format|\n if @email.save\n format.html { redirect_to @email, notice: 'Email was successfully created.' }\n format.json { render :show, status: :created, location: @email }\n else\n format.html { render :new }\n # do not return error to API\n #format.json { render json: @email.errors, status: :unprocessable_entity }\n format.json { render :show, status: :created, location: @email }\n end\n end\n end",
"title": ""
},
{
"docid": "651bca86b2aa888a0db69e22a42c250e",
"score": "0.6104061",
"text": "def create\n @email_update = EmailUpdate.new\n @email_update.email = params[:email]\n\n respond_to do |format|\n if @email_update.save\n format.html { redirect_to :back, notice: 'Your email was added to our mailing list.' }\n format.json { render action: 'show', status: :created, location: @email_update }\n else\n format.html { render action: 'new' }\n format.json { render json: @email_update.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d23fec07272b135efa24aabf0b3c7b3",
"score": "0.6090914",
"text": "def create\n @user = current_user\n @email = @user.emails.create!(\n from: @user.email,\n to: params[:to],\n subject: params[:subject],\n body: params['body'].gsub(\"\\n\", \"\\n<br />\"),\n parts: params['body'].gsub(\"\\n\", \"\\n<br />\").split(/<more>|<more>/)\n )\n\n @email.deliver_all(@email.process(@user))\n redirect_to root_path\n end",
"title": ""
},
{
"docid": "0c054ac9255682b993dc9391d45fd95f",
"score": "0.6086996",
"text": "def create\n @email = Email.new(email_params)\n respond_to do |format|\n if @email.save\n format.html { redirect_to ('/'), notice: 'Email was successfully created.' }\n format.json { render :show, status: :created, location: ('/') }\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": "d8ab4c02cecd1d2ffd052b713cc8e022",
"score": "0.60634893",
"text": "def create\n @email = Email.new(email_params)\n\n respond_to do |format|\n if @email.save\n format.html { redirect_to @email, notice: 'Email was successfully created.' }\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": "d8ab4c02cecd1d2ffd052b713cc8e022",
"score": "0.60634893",
"text": "def create\n @email = Email.new(email_params)\n\n respond_to do |format|\n if @email.save\n format.html { redirect_to @email, notice: 'Email was successfully created.' }\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": "2702cb39a9728107b290eaf7457e10ae",
"score": "0.6042691",
"text": "def send_email(email_template_id, request)\n start.uri('/api/email/send')\n .url_segment(email_template_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end",
"title": ""
},
{
"docid": "48029a4c8af16b6e86f789bd8cd869d7",
"score": "0.60372156",
"text": "def add_email(email, options = {})\n email = Array(email)\n post \"user/emails\", email\n end",
"title": ""
},
{
"docid": "9b61d23f796713fcd3c07692faa296b0",
"score": "0.6030934",
"text": "def create_email_addunsubscribesemail(email)\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/email/addunsubscribesemail.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'email' => email\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end",
"title": ""
},
{
"docid": "c27881ae54c853a5ccaae68ddc3b15a4",
"score": "0.6011255",
"text": "def send_email(email_template_id, request)\n start.uri('/api/email/send')\n .url_segment(email_template_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end",
"title": ""
},
{
"docid": "da9cf7a1323b0728eb3e89d131795a87",
"score": "0.599172",
"text": "def create\n recipients, subject = build_email_msg\n respond_to do |format|\n if recipients && recipients.any?\n current_user.send_message(recipients, params[:body], subject)\n format.json {head :ok}\n else\n format.json {render json: {errors:\n [\"Recipient(s) Not Found.\"]}, status: 404}\n end\n end\n end",
"title": ""
},
{
"docid": "1a9fd73b5df1521d212896ed5cf25ad7",
"score": "0.5986626",
"text": "def emails\n respond_with_entity(api.get('/api/v1/profile/emails'),\n PassaporteWeb::Entities::Profile::Emails)\n end",
"title": ""
},
{
"docid": "3620f7506f8f0477666a270bdd60e440",
"score": "0.59830004",
"text": "def create\n @email = Email.new(email_params)\n\n respond_to do |format|\n if @email.save\n format.html { redirect_to @email, notice: 'Email was successfully created.' }\n format.json { render action: 'show', status: :created, location: @email }\n else\n format.html { render action: 'new' }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3547227240782291a26f6a485ddf70b9",
"score": "0.5981351",
"text": "def create_email_sendemails(options = {})\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/email/sendemails.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'To' => options['to'],\r\n 'Type' => options['type'],\r\n 'Subject' => options['subject'],\r\n 'Message' => options['message'],\r\n 'From' => options['from'],\r\n 'Cc' => options['cc'],\r\n 'Bcc' => options['bcc'],\r\n 'Attachment' => options['attachment']\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end",
"title": ""
},
{
"docid": "55ae5a48bc57dd2ce23862d502df43d1",
"score": "0.5950378",
"text": "def post_reply_message(email,data)\n JSON.parse(curl_post(\"#{self.host}/api2/user/msgs/#{email}/\",data).body_str)\n end",
"title": ""
},
{
"docid": "c9146a8c6247b6e4db7c2fbe767a03e6",
"score": "0.5946194",
"text": "def create\n @emails = Email.where(company_id: current_user.client_id).compact\n @mail_group = MailGroup.new(mail_group_params)\n @mail_group.emails = []\n @mail_group.set_emails(params[:emails]) if params[:emails]\n\n respond_to do |format|\n if @mail_group.save\n format.html { redirect_to @mail_group, notice: 'Mail group was successfully created.' }\n format.json { render :show, status: :created, location: @mail_group }\n else\n format.html { render :new }\n format.json { render json: @mail_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "83e60ad1f4f020494f21a3331e5c7999",
"score": "0.59392273",
"text": "def create\n msg = event_invitation_params[:email_message]\n emails = EventInvitation.lookup_emails(EventInviation.split_addresses(event_invitation_params[:user_emails]))\n \n @event_invitation = EventInvitation.new(event_invitation_params)\n\n respond_to do |format|\n if @event_invitation.save\n format.html { redirect_to @event_invitation, notice: 'Event invitation was successfully created.' }\n format.json { render action: 'show', status: :created, location: @event_invitation }\n else\n format.html { render action: 'new' }\n format.json { render json: @event_invitation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "67bd6a985edcce6f20fd6096ea304b88",
"score": "0.5937921",
"text": "def verify(emails)\n raise ArgumentError, 'emails must be not empty' if (emails.nil? || emails.empty?)\n data = emails.map { |email| { inputData: email }}\n content = { entries: data }.to_json\n begin\n r = @resource.post content\n @unique_id = JSON.parse(r)[\"uniqueID\"]\n @response = nil\n @error = nil\n @unique_id\n rescue => e\n compute_error(e)\n false\n end\n end",
"title": ""
},
{
"docid": "d9af3c2abe716fb0ec411d3a90ce2df6",
"score": "0.5930773",
"text": "def create\n @emails_of_client = EmailsOfClient.new(params[:emails_of_client])\n\n respond_to do |format|\n if @emails_of_client.save\n format.html { redirect_to @emails_of_client, notice: 'Emails of client was successfully created.' }\n format.json { render json: @emails_of_client, status: :created, location: @emails_of_client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @emails_of_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1269534d557a67700c9b290b50f16943",
"score": "0.59205794",
"text": "def create\n @gettingmail = Gettingmail.new(params[:gettingmail])\n\n respond_to do |format|\n if @gettingmail.save\n format.json { render json: @gettingmail, status: :created, location: @gettingmail }\n else\n format.json { render json: {errors: @gettingmail.errors}, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "2e2668a4210d188f85e634d5abe935a5",
"score": "0.5906502",
"text": "def create\n @email = Email.new(params[:email])\n @email[:from] = @@username\n @email[:state] = \"sent\"\n\n @@aiss_mail.send_mail_aiss params[:email][:to],params[:email][:subject],\n params[:email][:body]\n\n respond_to do |format|\n if @email.save\n format.html { redirect_to emails_url, notice: 'Email enviado' }\n format.json { render json: @email, status: :created, location: @email }\n else\n format.html { render action: \"new\" }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "18e40156d58519b756e2c79334450a33",
"score": "0.58985347",
"text": "def email_register\n #TODO: Sacar codigo de padrino y mail de la sesion\n list_email = params[:list_email]\n user_service = UserService.new\n cod_padrino = user_service.get_cod_padr(user.id) #TODO: Generamos el codigo de padrino\n user_service.send_email_new_gmail_contacts(list_email,user.email,cod_padrino)\n render json: \"OK\"\n end",
"title": ""
},
{
"docid": "219f5b627af436bb2de82dbf96d3f8fb",
"score": "0.58865815",
"text": "def create\n emails = params[:kudo][:receiver_emails]\n begin\n receivers = emails.map do |email|\n User.find_or_create_by!(email: email)\n end\n rescue ActiveRecord::RecordInvalid => e\n return render(\n json: { errors: e },\n status: :unprocessable_entity\n )\n end\n\n kudo = Kudo.new(\n giver: current_user,\n receivers: receivers,\n body: kudo_params[:body]\n )\n\n if kudo.save\n render json: { kudo: kudo }, status: :created\n receivers.each(&:notify)\n else\n render json: { error: kudo.errors.messages.values.flatten.to_sentence }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ca3af33f8b50d65c7f2862328aeea25c",
"score": "0.5880091",
"text": "def post_accounts(id, email, api_key, user_type)\n @options = {:path => '/accounts/content', :body => Megam::JSONCompat.to_json({\n \"id\" => \"#{id}\",\n \"email\" => email,\n \"api_key\" => api_key,\n \"authority\" => \"#{user_type}\"\n })}.merge(@options)\n\n request(\n :expects => 201,\n :method => :post,\n :body => @options[:body]\n )\n end",
"title": ""
},
{
"docid": "03e10fe067314291717125d5a1fa448a",
"score": "0.58581644",
"text": "def create\n @tipo_email = TipoEmail.new(params[:tipo_email])\n\n respond_to do |format|\n if @tipo_email.save\n format.html { redirect_to @tipo_email, notice: 'Tipo email was successfully created.' }\n format.json { render json: @tipo_email, status: :created, location: @tipo_email }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tipo_email.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7e3ecbcb33051ff5c2d1945589533280",
"score": "0.5855708",
"text": "def search_emails\n\t\tif request.post?\n\t\t\tif params[:emails].class == Array\n\t\t\t\temails = params[:emails]\n\t\t\telse\n\t\t\t\temails = JSON.parse(params[:emails])\n\t\t\tend\n\t\t\tusers = []\n\t\t\temails.each do |email|\n\t\t\t\tuser = User.find_by_email(email)\n\t\t\t\tif user\n\t\t\t\t\tuser.password = nil\n\t\t\t\t\tusers.push(user) \n\t\t\t\tend\n\t\t\tend\n\n\t\t\trender json: {users: users.as_json}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "04745a9ec1c711ec2908f3c3a78c5041",
"score": "0.5850941",
"text": "def create\n #explicitly set\n params[:email][:status] = 1\n params[:email][:unsubscribed] = nil\n params[:email][:source] = request.host\n @debug = email_params\n\n @email = Email.new(email_params)\n respond_to do |format|\n if @email.save\n logger.info \"Added email #{@email.inspect}\"\n format.html { render :show, notice: 'Email was successfully created.' }\n format.json { render :show, status: :created, location: @email }\n else\n set_email_by_email\n if @email.update(email_params)\n logger.info \"Couldn't create email so updated existing email #{@email.inspect}\"\n format.html { render :show, notice: 'Email was successfully updated.' }\n format.json { render :show, status: :created, location: @email }\n else\n logger.info(\"Couldn't create or update email #{@email.inspect}\")\n format.html { render :new, notice: 'Unable to add email.' }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f35a5f0db4fd885e1f24a34687f5ce50",
"score": "0.58475935",
"text": "def check_emails\n emails = ActiveSupport::JSON.decode(params[:emails])\n users = User.find_all_by_email(emails)\n\n if users\n render json: users\n else\n render json: { msg: \"No email found\" }, status: :not_found\n end\n end",
"title": ""
},
{
"docid": "c4ce9e995d096d4cda2ed1876e32b5c8",
"score": "0.5846487",
"text": "def create_from_email( from=\"\", to=\"\", subject=\"\", message=\"\" )\n body = {\n fromEmail: from,\n toEmail: to,\n subject: subject,\n body: message\n }\n contact_note = Virtuous::ContactNote.new JSON.parse(connection.post(\"/ContactNote/Email\", body).body)\n # response = JSON.parse(connection.post(\"/ContactNote/Email\", body).body)\n # status = response.respond_to?(:status) ? response.status : response.code\n end",
"title": ""
},
{
"docid": "5253c4975ab9306365dcb03c77b158af",
"score": "0.5843921",
"text": "def create\n @email = Email.new(email_params)\n\n respond_to do |format|\n if @email.save\n format.html {\n in_reply_to = @email.email\n references = ((in_reply_to&.references || []) + ([in_reply_to&.message_id]))\n references = references\n .flatten\n .reject(&:nil?)\n .reject(&:blank?)\n .uniq\n\n postmark_email = PostmarkMailer\n .with(\n subject: @email.subject,\n body: @email.body,\n references: references.join(','),\n in_reply_to: in_reply_to&.message_id\n )\n .email\n .deliver_now\n\n @email.references = [\n [postmark_email.references.try(:split, \",\") || \"\"]\n .flatten\n .reject(&:nil?)\n .reject(&:blank?)\n .uniq\n .collect {|ref| \"<#{ref.gsub(/[<>]/, '')}>\"},\n postmark_email.in_reply_to.present? ? \"<#{postmark_email.in_reply_to.gsub(/[<>]/, '')}>\" : nil\n ]\n .flatten\n .reject(&:nil?)\n .reject(&:blank?)\n .uniq\n @email.in_reply_to = postmark_email.in_reply_to ? \"<#{postmark_email.in_reply_to.gsub(/[<>]/, '')}>\" : nil\n @email.message_id = \"<#{postmark_email.message_id.gsub(/[<>]/, '')}>\"\n @email.email_data = postmark_email.to_postmark_hash\n @email.save\n\n redirect_to @email, notice: \"Email was successfully created.\"\n }\n format.json { render :show, status: :created, location: @email }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4c279cf3d2cd81134856663dcb8cbc9a",
"score": "0.5842603",
"text": "def new\n @emails_of_client = EmailsOfClient.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @emails_of_client }\n end\n end",
"title": ""
},
{
"docid": "645bbf09a437c21271e8ebab1d170c88",
"score": "0.5830473",
"text": "def create\n @email_address = EmailAddress.new(params[:email_address])\n\n respond_to do |format|\n if @email_address.save\n format.html { redirect_to @email_address, :notice => 'Email address was successfully created.' }\n format.json { render :json => @email_address, :status => :created, :location => @email_address }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @email_address.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2e048095f3cf5ad6af5e791259e731e9",
"score": "0.58234346",
"text": "def email_send(input={}, raw=false)\n response = post('mw/Email.List', input, raw)\n end",
"title": ""
},
{
"docid": "6bb9dc638a6d8362507f346d66c765af",
"score": "0.5810542",
"text": "def add_email (email = nil, max_sms = nil, number = nil, opts={})\n query_param_keys = [:email,:max_sms,:number]\n headerParams = {}\n\n \n \n # set default values and merge with input\n options = {\n :'email' => email,\n :'max_sms' => max_sms,\n :'number' => number\n \n }.merge(opts)\n\n #resource path\n path = \"/add-email.json\".sub('{format}','json')\n \n # pull querystring keys from options\n queryopts = options.select do |key,value|\n query_param_keys.include? key\n end\n\n # header parameters\n headers = {}\n\n _header_accept = 'application/json'\n if _header_accept != ''\n headerParams['Accept'] = _header_accept\n end \n _header_content_type = ['application/x-www-form-urlencoded']\n headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'\n\n \n \n headers[:'Authorization'] = @api_key_secret\n\n # http body (model)\n post_body = nil\n \n # form parameters\n form_parameter_hash = {}\n \n \n \n Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make\n \n \n end",
"title": ""
},
{
"docid": "e17ab40d3e00ad3927ae2c9974de1645",
"score": "0.57978666",
"text": "def email_params\n params.require(:email).permit(:email, :data, :server_id)\n end",
"title": ""
},
{
"docid": "98cb3f744f94b59dec74f9ad9a5cbf3a",
"score": "0.57581717",
"text": "def create_email_template(email_template_id, request)\n start.uri('/api/email/template')\n .url_segment(email_template_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end",
"title": ""
},
{
"docid": "92aec00ef0cac1a185cafb433419467f",
"score": "0.5751945",
"text": "def create_contact(email, name)\n params = { email: email, name: name }\n\n request :post,\n '/v3/contacts.json',\n params\n end",
"title": ""
},
{
"docid": "e59359285cfb96c87246a7d93f007461",
"score": "0.57420844",
"text": "def index\n @emails = @recipient.emails.all\n\n respond_to do |format| \n format.html # index.html.erb\n format.json { render json: @emails }\n end\n end",
"title": ""
},
{
"docid": "c19ed2359082d590677a80957b12fd61",
"score": "0.57387006",
"text": "def create\n if @user = User.find_by_email_address(params['sender'])\n @email = @user.emails.new(\n from: params['sender'], \n to: params['recipient'], \n subject: params['subject'],\n body: params['body-plain']\n )\n @email.save\n render text: \"Email Received\"\n else\n render text: \"Not a registered user\"\n end\n end",
"title": ""
},
{
"docid": "38ee428061959cd5142a059fffff0d1d",
"score": "0.5718992",
"text": "def sendEmail\n #create database entries\n @service = Service.find(params[:id])\n survey = @service.surveys.create()\n\n @@emailList.each do |email|\n survey.results.create(:done => false, :email => email, :score => nil, :comments => nil)\n url = \"#{request.protocol}#{request.host_with_port}\" + ENV[\"SUB_DIRECTORY\"] + \"/survey?a=\" + encrypt(email) + \"&b=\" + encrypt(survey.id.to_s)\n Mailer.delay.invitation(email, @service, url)\n #Mailer.invitation(email, @service, url).deliver\n end\n \n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Your survey has been sent.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d0207b38df1627cad04e8b621f495686",
"score": "0.5715675",
"text": "def sendemail(email, subject, message)\n source = \"https://api.sendgrid.com/api/mail.send.json\"\n HTTParty.post(\n source,\n body: {\n api_user: 'garidor',\n to: email,\n from: \"garidor@gmail.com\",\n subject: subject,\n text: message,\n api_key: 'password1!'\n }\n );\n end",
"title": ""
},
{
"docid": "b737f71679b197b5e32b5cae498796fb",
"score": "0.5712595",
"text": "def add_contact_hotmail\n @contacts = request.env['omnicontacts.contacts']\n user_service = UserService.new\n @contact_email = user_service.contacts_hotmail_email(@contacts)\n @list_email = user_service.add_new_contacts(@contact_email)\n render json: @list_email\n end",
"title": ""
},
{
"docid": "0112deb2774645f92d8185c73f8fe631",
"score": "0.5704814",
"text": "def create_email_template(email_template_id, request)\n start.uri('/api/email/template')\n .url_segment(email_template_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end",
"title": ""
},
{
"docid": "8bd31dd387325abba2ba5835c402d1ff",
"score": "0.5693215",
"text": "def create\n respond_to do |format|\n if create_message(email_params, current_user, params, 'email')\n format.html { redirect_to show_email_thread_path(@email.message_thread), notice: 'Email was successfully created.' }\n format.json { render :show, status: :created, location: @email }\n else\n @users = User.all_except(current_user).select(:id, :email)\n format.html { render :new }\n format.json { render json: @email.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5aca2c769b75bca1c102eafe75067941",
"score": "0.56865466",
"text": "def add(list, emails)\n params = { :list => extract_listname(list), :data => map_emails(emails, :to_json) }\n perform_request(Entities::ResponseInsert, 'newsletter/lists/email/add.json', params)\n end",
"title": ""
},
{
"docid": "22a6b75ca6fe4c3b4ada3138d7795089",
"score": "0.56857985",
"text": "def submitemail\n # do we have an email?\n if !params[:email]\n render json: {:result => '0'}\n return\n end\n\n # is this email already stored?\n current = ListMember.find_by_email(params[:email])\n if current\n render json: {:result => '1'}\n return\n end\n\n # great, so store it\n member = ListMember.new\n member.email = params[:email]\n member.save\n\n # also make an entry in our history table for tracking purposes\n # this way if someone unsubscribes, we can delete them from the list members table, but still have an audit trail\n history = ListHistoryItem.new\n history.email = params[:email]\n history.note = \"Subscribed via home page\"\n history.save\n\n # return a success code\n render json: {:result => '2'}\n end",
"title": ""
},
{
"docid": "49e9f9b3dffe803a2e363baf5a9cc6cc",
"score": "0.56830984",
"text": "def create(body, send_email = false)\n raise ArgumentError unless body.is_a?(Hash)\n api.post(\"?sendEmail=#{send_email}\", body, 'application/json')\n end",
"title": ""
},
{
"docid": "d07269ee91b0099ac05fe91d28b8b16d",
"score": "0.5680482",
"text": "def update\n @email = Email.find(params[:id])\n @email.email = params[:email]\n @email.save\n render json:@email\n\n end",
"title": ""
},
{
"docid": "1333a9f3d51eb9cf1c176ca0c91c9588",
"score": "0.5680482",
"text": "def create_email_deletespamemail(email)\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/email/deletespamemail.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'Email' => email\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end",
"title": ""
},
{
"docid": "434f9a0974f611073641eb94e76834b9",
"score": "0.5677093",
"text": "def create\n @email_gmail = EmailGmail.new(params[:email_gmail])\n\n respond_to do |format|\n if @email_gmail.save\n format.html { redirect_to @email_gmail, notice: 'Email gmail was successfully created.' }\n format.json { render json: @email_gmail, status: :created, location: @email_gmail }\n else\n format.html { render action: \"new\" }\n format.json { render json: @email_gmail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "961092c3d2450073cecf547143a17c94",
"score": "0.5675296",
"text": "def save_as_json\n f = File.new('db/emails.json', 'w')\n f.write(JSON.pretty_generate(@emails))\n f.close\n end",
"title": ""
},
{
"docid": "95ba06f7325c5b85720952bdb590538c",
"score": "0.56703234",
"text": "def new\n @email = Email.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email }\n end\n end",
"title": ""
},
{
"docid": "95ba06f7325c5b85720952bdb590538c",
"score": "0.56694335",
"text": "def new\n @email = Email.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email }\n end\n end",
"title": ""
},
{
"docid": "95ba06f7325c5b85720952bdb590538c",
"score": "0.5668839",
"text": "def new\n @email = Email.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email }\n end\n end",
"title": ""
},
{
"docid": "99dd31b0728d612c3b143c1ff6028114",
"score": "0.5668629",
"text": "def create_email_listspamemail(options = {})\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/email/listspamemail.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'Offset' => options['offset'],\r\n 'Limit' => options['limit']\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end",
"title": ""
},
{
"docid": "4e3bc8ca6a2ab8dec24e60dedbaaebd7",
"score": "0.566393",
"text": "def create_email_deletebouncesemail(email)\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/email/deletebouncesemail.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'Email' => email\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end",
"title": ""
},
{
"docid": "d2b0751929ffc67c8a1d1048d57ae9ce",
"score": "0.5662369",
"text": "def create\n @sender_email = SenderEmail.new(sender_email_params)\n @auth = [[\"Plain\",\"Plain\"],[\"Login\",\"Login\"]]\n\n respond_to do |format|\n if @sender_email.save\n format.html { redirect_to sender_emails_path, notice: 'Sender email was successfully created.' }\n format.json { render :show, status: :created, location: @sender_email }\n else\n format.html { render :new }\n format.json { render json: @sender_email.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c011a8f76668d2c559d3c98cc1213d16",
"score": "0.56500155",
"text": "def index\n @emails = Email.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @emails }\n end\n end",
"title": ""
},
{
"docid": "c011a8f76668d2c559d3c98cc1213d16",
"score": "0.56500155",
"text": "def index\n @emails = Email.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @emails }\n end\n end",
"title": ""
},
{
"docid": "a9b796016b8024a797d5c6d343eaa6a0",
"score": "0.56494355",
"text": "def create\n @alternative_email = AlternativeEmail.new(alternative_email_params)\n\n respond_to do |format|\n if @alternative_email.save\n format.html { redirect_to @alternative_email, notice: 'Alternative email was successfully created.' }\n format.json { render :show, status: :created, location: @alternative_email }\n else\n format.html { render :new }\n format.json { render json: @alternative_email.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "190b019a91f20f5f9f4b251e6587cf91",
"score": "0.5647558",
"text": "def create\n @email = Email.new(email_params)\n\n respond_to do |format|\n if @email.save\n SendMailWorker.perform_async(@email.id)\n format.html { redirect_to @email, notice: 'Email was successfully created.' }\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": "06c2bff8767386aa3365019ec7365e99",
"score": "0.56438386",
"text": "def email_params\n params.require(:email).permit(:artist_data_id, :email)\n end",
"title": ""
},
{
"docid": "3c986700d0772a3b299bc9ac4d9d5279",
"score": "0.56413704",
"text": "def create_user(email)\n\trequest_type = \"POST\"\n\turl = \"user\"\n\tdata = {'email'=>email}\n\tcontent = data.to_json\n\thash = create_hmac(request_type, url, content)\n\tresponse = http_send(request_type, url, hash, content)\nend",
"title": ""
},
{
"docid": "333578daf212f8172590f35e06ebdf8c",
"score": "0.56329626",
"text": "def create\n @email = Email.new(\n from: params['sender'], \n to: params['recipient'], \n subject: params['subject'],\n body: params['body-plain']\n )\n\n @email.save\n end",
"title": ""
},
{
"docid": "00cb46e655401cabba68c9e06f0d36fa",
"score": "0.56164414",
"text": "def set_email(email, vars = {}, lists = {}, templates = {})\n data = {:email => email}\n data[:vars] = vars unless vars.empty?\n data[:lists] = lists unless lists.empty?\n data[:templates] = templates unless templates.empty?\n self.api_post(:email, data)\n end",
"title": ""
},
{
"docid": "0a3116afa9e8fcd5dac7345e0579f50a",
"score": "0.5610843",
"text": "def create\n @outgoing_mail = OutgoingMail.new(params[:outgoing_mail])\n\n respond_to do |format|\n if @outgoing_mail.save\n format.html { redirect_to @outgoing_mail, notice: 'Outgoing mail was successfully created.' }\n format.json { render json: @outgoing_mail, status: :created, location: @outgoing_mail }\n else\n format.html { render action: \"new\" }\n format.json { render json: @outgoing_mail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0a9bb687653d758c609a231c6bf24143",
"score": "0.5603132",
"text": "def create\n @eve_mail = EveMail.new(params[:eve_mail])\n\n respond_to do |format|\n if @eve_mail.save\n format.html { redirect_to @eve_mail, notice: 'Eve mail was successfully created.' }\n format.json { render json: @eve_mail, status: :created, location: @eve_mail }\n else\n format.html { render action: \"new\" }\n format.json { render json: @eve_mail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "542d4ffbe6138e13769f7886214d5f97",
"score": "0.55928534",
"text": "def friend_invite_email(invited, invitor)\n sp = SparkPost::Client.new() # pass api key or get api key from ENV\n \n payload = {\n recipients: [\n {\n address: { email: invited.email },\n }\n ],\n content: {\n template_id: 'friend-invite-email'\n },\n substitution_data: {\n invited: invited.first_name,\n invitor: invitor.first_name,\n invitor_email: invitor.email,\n token: invited.raw_invitation_token\n }\n }\n \n response = sp.transmission.send_payload(payload)\n p response\n \n end",
"title": ""
},
{
"docid": "b26f15f6cfc61b71c123689cc7e27adb",
"score": "0.5591061",
"text": "def create_email_list (emails = [], email_group_name = nil)\n url = ApiRequest.base_path(\"questionpro.survey.createEmailGroup\")\n result = self.class.get(url, body: {id: self.survey_id, emails: emails, \n emailGroupName: email_group_name}.compact.to_json)\n\n self.full_response = result\n self.status = result['status']\n\n unless result['response']['result']['emailGroupID'].nil?\n self.email_group_id = result['response']['result']['emailGroupID']\n end\n end",
"title": ""
},
{
"docid": "73e5fbb35a46ceaca75275f77b9cbd7f",
"score": "0.55910504",
"text": "def set_email(email, vars = {}, lists = {}, templates = {}, options = {})\n data = options\n data[:email] = email\n data[:vars] = vars unless vars.empty?\n data[:lists] = lists unless lists.empty?\n data[:templates] = templates unless templates.empty?\n api_post(:email, data)\n end",
"title": ""
},
{
"docid": "d3ddec5421f63785ebe7c052f6f884d3",
"score": "0.5566993",
"text": "def create\n @change_email_request = ChangeEmailRequest.new(change_email_request_params)\n\n respond_to do |format|\n if @change_email_request.save\n format.html { redirect_to @change_email_request, notice: 'Change email request was successfully created.' }\n format.json { render :show, status: :created, location: @change_email_request }\n else\n format.html { render :new }\n format.json { render json: @change_email_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f109164660c28aa22be532b778bb6da2",
"score": "0.5561787",
"text": "def post_email(sg_mail)\n @sg_mail = sg_mail\n DummyGoodResponse.new\n end",
"title": ""
},
{
"docid": "6e5703118aa22cb8f18561c87552c35b",
"score": "0.5537274",
"text": "def create\n unless request.format.json?\n super\n return\n end\n @user = User.find_by_email(params[:user][:email])\n if @user.present?\n @user.send_reset_password_instructions\n render json:{success:true, message:\"check your registered mail once\"}, status:200\n else\n render :text => \"no such email\"\n end\n end",
"title": ""
},
{
"docid": "be4d781555529256ca682d340515b1b0",
"score": "0.55349404",
"text": "def create\n user_email = params[:email]\n user = user_email.present? && User.find_by(email: user_email)\n if user\n user.send_password_reset(user) \n render json: user, status: 200\n else\n render json: { errors: \"Invalid email\"}, status: 422\n end\n end",
"title": ""
},
{
"docid": "290eaa669e5d816e4e69a105e268d3a1",
"score": "0.55341136",
"text": "def email_create(email)\n fill_in('email_create', with: email)\n end",
"title": ""
},
{
"docid": "f5f7a350f23a009f85d171c755eaf43e",
"score": "0.552339",
"text": "def create\n @invalid_email = InvalidEmail.new(params[:invalid_email])\n\n respond_to do |format|\n if @invalid_email.save\n format.html { redirect_to @invalid_email, notice: 'Invalid email was successfully created.' }\n format.json { render json: @invalid_email, status: :created, location: @invalid_email }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invalid_email.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9cec8341f8dc7b49f969a75b736cd5ca",
"score": "0.5521199",
"text": "def test_post_contact_for_user\n url = @url_base + \"/api/v1/user/contact/new\"\n phone_numbers = Array.new(2,Hash.new)\n @response = RestClient.post(url, \n {\n :contact => {\n :first_name => \"aaaaaa\", \n :last_name => \"alskjdalksd\"\n },\n\n :phone_number => [{:phone_type => \"mobile\",:phone_number => \"+1-321-3211\"}, {:phone_type => \"home\",:phone_number => \"+1-111-3211\"}]\n\n #:addresses => [\n # {\n # :street => \"sss\",\n # :city => \"new york\",\n # :country => \"CA\",\n # :region => \"BC\",\n # :postal_code => \"M5R 1K2\"\n # }]\n },\n {\n \"Content-Type\" => \"application/json\",\n \"X-User-Email\" => \"test@test.com\"\n }\n ) \n assert assert_equal 201, @response.code\n end",
"title": ""
},
{
"docid": "542287b74c8be93ecf0a70411646f35c",
"score": "0.5520941",
"text": "def new\n @email_address = EmailAddress.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @email_address }\n end\n end",
"title": ""
},
{
"docid": "5fb6e6662ec44b2da9c4596dd0d068f6",
"score": "0.552065",
"text": "def register\n post(\"/api/v1/registrations\", params: { \n user: {\n email: \"new_email@test.com\",\n password: \"a\",\n password_confirmation: \"a\" \n }\n })\n end",
"title": ""
}
] |
b7c0ac27732670e989745593f9985c82
|
) Get Element Rate
|
[
{
"docid": "7cbcf3fda3e5a9a7e1c9b4f374ea182d",
"score": "0.6826357",
"text": "def get_element_rate(id)\n @features.each do |feat|\n if feat.code == 11\n if id.is_a?(String)\n return feat.value if id.upcase == $data_system.elements[feat.data_id].upcase\n else\n return feat.value if id == feat.data_id\n end\n end\n end\n return 1\n end",
"title": ""
}
] |
[
{
"docid": "e0b4ebb96c62a505940747d83295c3af",
"score": "0.824276",
"text": "def element_rate(element_id)\n return 100\n end",
"title": ""
},
{
"docid": "d1a718bc69512057ffe79f518b9a7f8d",
"score": "0.7485733",
"text": "def rate\n return @rate\n end",
"title": ""
},
{
"docid": "e311f5d94d9c9bae63a8ef3d5312b5ff",
"score": "0.74834657",
"text": "def rate\n return @rates\n end",
"title": ""
},
{
"docid": "6d17cb7b70627f9665e222bacfa42a3e",
"score": "0.7267975",
"text": "def rate_component; end",
"title": ""
},
{
"docid": "759598d6673b8f681fc039dbb67dfca1",
"score": "0.7264319",
"text": "def rate; end",
"title": ""
},
{
"docid": "759598d6673b8f681fc039dbb67dfca1",
"score": "0.7264319",
"text": "def rate; end",
"title": ""
},
{
"docid": "fe17e02b92a632a6e0d28f090a328e4d",
"score": "0.7187471",
"text": "def rate\n end",
"title": ""
},
{
"docid": "2370969aa4019ae2f878491ce93ac8df",
"score": "0.7181951",
"text": "def rate\n end",
"title": ""
},
{
"docid": "586bea2b78d77488c8bab968da52edd3",
"score": "0.7180573",
"text": "def get_estimate\n @resultHash[:rate_estimate]\n end",
"title": ""
},
{
"docid": "3ffb4b8409b0b8a72c168c4008ed6651",
"score": "0.71453655",
"text": "def get_rates\n find_element(:css, \"div.small-12.columns\").find_element(:tag_name, \"h1\")\n end",
"title": ""
},
{
"docid": "801999a4990a5d947e7adde91488361e",
"score": "0.70583713",
"text": "def exchange_rate\n rate = begin\n Float(@element.attr('TipoCambio'))\n rescue\n nil\n end\n return rate if rate\n 1\n end",
"title": ""
},
{
"docid": "4253a92361143fba8dc179e37b0f3742",
"score": "0.70064294",
"text": "def element_rate(element_id)\n rank = self.class.element_ranks[element_id]\n result = [0,200,150,100,50,0,-100][rank]\n for armor in armors.compact\n result /= 2 if armor.element_set.include?(element_id)\n end\n for state in states\n result /= 2 if state.element_set.include?(element_id)\n end\n return result\n end",
"title": ""
},
{
"docid": "e02b257c6b6788f670da500721754215",
"score": "0.6942819",
"text": "def current_rate\n (weighted_deltas.inject(0) {|sum, element| sum += element} / weight)\n rescue\n 0.0000000001\n end",
"title": ""
},
{
"docid": "13daef1ea4f39cb7a08aabfd818e9381",
"score": "0.6908279",
"text": "def getEur(time,currency)\n search='//*[@time=\"%s\"]/*[@currency=\"%s\"]' % [time,currency]\n elems=@doc.xpath(search)\n rate=elems[0]==nil ? 0: elems[0].attr('rate') \nend",
"title": ""
},
{
"docid": "abad3a01efc2ce25b53ce74ac72955ff",
"score": "0.68989974",
"text": "def element_rate(element_id)\n # Get a numerical value corresponding to element effectiveness\n table = [0,200,150,100,50,0,-100]\n result = table[$data_enemies[@enemy_id].element_ranks[element_id]]\n # If protected by state, this element is reduced by half\n for i in @states\n if $data_states[i].guard_element_set.include?(element_id)\n result /= 2\n end\n end\n # End Method\n return result\n end",
"title": ""
},
{
"docid": "abad3a01efc2ce25b53ce74ac72955ff",
"score": "0.68989974",
"text": "def element_rate(element_id)\n # Get a numerical value corresponding to element effectiveness\n table = [0,200,150,100,50,0,-100]\n result = table[$data_enemies[@enemy_id].element_ranks[element_id]]\n # If protected by state, this element is reduced by half\n for i in @states\n if $data_states[i].guard_element_set.include?(element_id)\n result /= 2\n end\n end\n # End Method\n return result\n end",
"title": ""
},
{
"docid": "abad3a01efc2ce25b53ce74ac72955ff",
"score": "0.68989974",
"text": "def element_rate(element_id)\n # Get a numerical value corresponding to element effectiveness\n table = [0,200,150,100,50,0,-100]\n result = table[$data_enemies[@enemy_id].element_ranks[element_id]]\n # If protected by state, this element is reduced by half\n for i in @states\n if $data_states[i].guard_element_set.include?(element_id)\n result /= 2\n end\n end\n # End Method\n return result\n end",
"title": ""
},
{
"docid": "88a6863f2177a31fc6805160966dc75c",
"score": "0.68801796",
"text": "def get_rate\n raise NoMethodError, \"undefined method `get_rate' for #{to_s}:#{self.class}\"\n end",
"title": ""
},
{
"docid": "88a6863f2177a31fc6805160966dc75c",
"score": "0.68801796",
"text": "def get_rate\n raise NoMethodError, \"undefined method `get_rate' for #{to_s}:#{self.class}\"\n end",
"title": ""
},
{
"docid": "740c84074384b5cf48745d49c5431ed9",
"score": "0.6878115",
"text": "def item_element_rate(user, item)\n #puts \"DEBUG: Element rate\"\n #puts \" User: #{user.name}\"\n #puts \" Subject: #{name}\"\n if (item.damage.element_id < 0)\n return (user.atk_elements.empty? ? 1.0 : elements_max_rate(user.atk_elements))\n else\n #puts \" Fixed Element ID: #{item.damage.element_id}\"\n #puts \" Element Rate: #{element_rate(item.damage.element_id)}\"\n #puts \" User Element Power: #{user.element_power(item.damage.element_id)}\"\n #puts \" Final Rate: #{element_rate(item.damage.element_id) * user.element_power(item.damage.element_id)}\"\n return element_rate(item.damage.element_id) * user.element_power(item.damage.element_id)\n end\n end",
"title": ""
},
{
"docid": "1827ae61686cf05735434f05d5dfe50a",
"score": "0.6834474",
"text": "def element_rate(element_id)\n # Get values corresponding to element effectiveness\n table = [0,200,150,100,50,0,-100]\n result = table[$data_classes[@class_id].element_ranks[element_id]]\n # If this element is protected by armor, then it's reduced by half\n for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]\n armor = $data_armors[i]\n if armor != nil and armor.guard_element_set.include?(element_id)\n result /= 2\n end\n end\n # If this element is protected by states, then it's reduced by half\n for i in @states\n if $data_states[i].guard_element_set.include?(element_id)\n result /= 2\n end\n end\n # End Method\n return result\n end",
"title": ""
},
{
"docid": "1827ae61686cf05735434f05d5dfe50a",
"score": "0.6834474",
"text": "def element_rate(element_id)\n # Get values corresponding to element effectiveness\n table = [0,200,150,100,50,0,-100]\n result = table[$data_classes[@class_id].element_ranks[element_id]]\n # If this element is protected by armor, then it's reduced by half\n for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]\n armor = $data_armors[i]\n if armor != nil and armor.guard_element_set.include?(element_id)\n result /= 2\n end\n end\n # If this element is protected by states, then it's reduced by half\n for i in @states\n if $data_states[i].guard_element_set.include?(element_id)\n result /= 2\n end\n end\n # End Method\n return result\n end",
"title": ""
},
{
"docid": "f5195a736c5663d704437380eb3c55f2",
"score": "0.6826356",
"text": "def sample_rate\n @sample_rate\n end",
"title": ""
},
{
"docid": "5c1b5b67fe9aadafbba89419b691ef2c",
"score": "0.6820754",
"text": "def element_rate(element_id)\n # Get values corresponding to element effectiveness\n table = [0,200,150,100,50,0,-100]\n result = table[$data_classes[@class_id].element_ranks[element_id]]\n # If this element is protected by armor, then it's reduced by half\n for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id[0],@armor4_id[1]]\n armor = $data_armors[i]\n if armor != nil and armor.guard_element_set.include?(element_id)\n result /= 2\n end\n end\n # If this element is protected by states, then it's reduced by half\n for i in @states\n if $data_states[i].guard_element_set.include?(element_id)\n result /= 2\n end\n end\n # End Method\n return result\n end",
"title": ""
},
{
"docid": "6c29862faf84950d39f9663dfdf62fe6",
"score": "0.6789613",
"text": "def frame_rate\n ng_xml.css(\"fits > metadata > video > frameRate\").map(&:text)\n end",
"title": ""
},
{
"docid": "19a63eeb8e5fe78b4e4eeaa832a43b8f",
"score": "0.6789359",
"text": "def rate\n iter.to_f / since.to_f\n end",
"title": ""
},
{
"docid": "27fbab710a715da293368855aa1da7d0",
"score": "0.67730016",
"text": "def get_update_rate\n @update_rate\n end",
"title": ""
},
{
"docid": "e23557df67c407b0bd6dc1c7de00f0f8",
"score": "0.6734592",
"text": "def draw_elem_rate(element, value)\n text = sprintf(Vocab::EQ_ELDEF, Vocab.eltype(element))\n color = value > 1.0 ? :down : :up\n rate = sprintf(\"%+d%%\", 100-value*100)\n draw_detail(rate, text, nil, color)\n end",
"title": ""
},
{
"docid": "723e1d281fb226ce12ae1bfafe1685be",
"score": "0.66780925",
"text": "def get_rate(value)\n Spree::WeightBasedCalculatorRate.find_rate(id, value)\n end",
"title": ""
},
{
"docid": "4670ebbf8aa7e575bea3d5118fa21582",
"score": "0.6674096",
"text": "def value\n return @rate * @hours\n end",
"title": ""
},
{
"docid": "2f161ca80a5432d4de4d598575bafaba",
"score": "0.667287",
"text": "def update_rate\n if update_rate = xml.elements['update_rate']\n Float(update_rate.text)\n end\n end",
"title": ""
},
{
"docid": "7b71cd04d97799f2c7321eb6a0622e43",
"score": "0.6638068",
"text": "def rate\n iter.to_f / since.to_f\n end",
"title": ""
},
{
"docid": "5d4d29693a3643dae23e99b0b8691cdc",
"score": "0.6615042",
"text": "def rate_scale; end",
"title": ""
},
{
"docid": "c55771c5951d7cd05b956f421a145f1d",
"score": "0.6614675",
"text": "def element_rate(element_id)\n return -1 if features_with_id(FEATURE_ELEMENT_ABSORB, element_id).size > 0\n return en_absorb_gbb_er(element_id)\n end",
"title": ""
},
{
"docid": "aa81638df3b1c6e8254a48f26466b436",
"score": "0.6571009",
"text": "def get_rating()\n\n cached_rating = self.attributes['rating']\n return cached_rating unless cached_rating.nil?\n \n rating_sum = 0\n i = 0\n\n # If there are no ratings\n if self.ratings.length == 0\n return 0\n end\n\n self.ratings.each do |rating|\n i = i + 1\n rating_sum += rating.rating.to_f\n end\n\n (rating_sum / i.to_f)\n end",
"title": ""
},
{
"docid": "4e08a1f9a9efc3614fb29d92fba26412",
"score": "0.65438175",
"text": "def update_rate\n self.load[:update_rate]\n end",
"title": ""
},
{
"docid": "75f944c18b9f4a6d69d478e6b4139834",
"score": "0.653938",
"text": "def rate=(_arg0); end",
"title": ""
},
{
"docid": "209fa75b0f9478d7a58ae3a9d941d5e3",
"score": "0.6531358",
"text": "def real_time_update_rate\n if real_time_update_rate = xml.elements['real_time_update_rate']\n Integer(real_time_update_rate.text)\n end\n end",
"title": ""
},
{
"docid": "13dc7a70ea36728d5ee148a95180b534",
"score": "0.652309",
"text": "def rateable\n self\n end",
"title": ""
},
{
"docid": "d917e41c841cb5881927e12d98c34115",
"score": "0.6522725",
"text": "def agi_rate; param_rate(6); end",
"title": ""
},
{
"docid": "6dd11e01ef3a4b15537792f9267107f0",
"score": "0.65177697",
"text": "def update_rate\n @update_rate\n end",
"title": ""
},
{
"docid": "3d228bf53bbbf8dbd1f08592fceacba7",
"score": "0.6486592",
"text": "def rate\n sum = 0\n self.slips.each { |slip| sum += slip.rate }\n sum\n end",
"title": ""
},
{
"docid": "3d228bf53bbbf8dbd1f08592fceacba7",
"score": "0.6486592",
"text": "def rate\n sum = 0\n self.slips.each { |slip| sum += slip.rate }\n sum\n end",
"title": ""
},
{
"docid": "158556e7cd38409c61659045ae45df9a",
"score": "0.64828515",
"text": "def sample_rate; end",
"title": ""
},
{
"docid": "eb5e2e191b366535cca187fd4184b062",
"score": "0.645486",
"text": "def rate\n MSPhysics::Newton::Piston.get_rate(@address)\n end",
"title": ""
},
{
"docid": "b3a7eec110e9637eca23cb922949cbf3",
"score": "0.6441868",
"text": "def conversion_rate\n attributes[\"conversionRate\"]\n end",
"title": ""
},
{
"docid": "3064e53e1057c4528db2fdcf3a17c930",
"score": "0.6437214",
"text": "def element_rate_rank(element_id)\n table = Element_Table\n result = table[elemental_resist(element_id)]\n return result\n end",
"title": ""
},
{
"docid": "f93b2c60fdc67d6dc7e286a016fbc672",
"score": "0.64337796",
"text": "def vampire_rate; 0; end",
"title": ""
},
{
"docid": "911063c7193bca8806baaf47298972a4",
"score": "0.6429664",
"text": "def cap_rate_percent\n self.dig_for_decimal(\"capRatePercent\")\n end",
"title": ""
},
{
"docid": "606f7e69f4a3ff3f8ead7af68c90f5bd",
"score": "0.64282054",
"text": "def gst_rate\n BigDecimal.new(\"0.05\")\n end",
"title": ""
},
{
"docid": "ec5b6a2d3dd57f32926521d70e15cddc",
"score": "0.64011425",
"text": "def rate_table\n return Element_Settings::RATE_TABLE[:attributes] if weapon_attribute?\n return Element_Settings::RATE_TABLE[:types] if enemy_type?\n Element_Settings::RATE_TABLE[:elements]\n end",
"title": ""
},
{
"docid": "6ed82c20516d2ae0c70f07c2332de5d2",
"score": "0.64006925",
"text": "def atk_rate; param_rate(2); end",
"title": ""
},
{
"docid": "079bfb5f04fe6b195d60eebe4bdfd63f",
"score": "0.640031",
"text": "def speed_download\n attributes['rateDownload']\n end",
"title": ""
},
{
"docid": "80720b9461f78390a3fc0c02db5984b4",
"score": "0.6396274",
"text": "def min_rate\n rate_table.last\n end",
"title": ""
},
{
"docid": "8fe9d56f171772bee7a2d9f67fa44a40",
"score": "0.63942844",
"text": "def apply_element_rate(user, item, value)\r\r\n value *= item_element_rate(user, item)\r\r\n value\r\r\n end",
"title": ""
},
{
"docid": "8967677e0d2bfbc59cd2833dead0639f",
"score": "0.63877195",
"text": "def current_compound_interest_rate() 4.3 end",
"title": ""
},
{
"docid": "8967677e0d2bfbc59cd2833dead0639f",
"score": "0.6387069",
"text": "def current_compound_interest_rate() 4.3 end",
"title": ""
},
{
"docid": "ebe6d7747a0b386a8ea3f1ab0c2f505a",
"score": "0.63840866",
"text": "def write_element_rate\n y = contents_height - line_height\n x = 4\n last_font_size = contents.font.size\n contents.font.size = 15\n (7..16).each { |i|\n #contents.fill_rect(x + 1, y + 1, 58, line_height - 2, Color.new(0, 0, 0, 50))\n icon = $data_system.attribute_icon(i)\n draw_icon(icon, x, y)\n value = actor.element_rate(i) - 100\n if value == 0\n change_color(normal_color)\n elsif value < 0\n change_color(power_up_color)\n else\n change_color(power_down_color)\n end\n draw_text(x + 24, y, 36, line_height, sprintf('%+d%', value))\n x += 60\n }\n contents.font.size = last_font_size\n end",
"title": ""
},
{
"docid": "828039e3734767ba50a61172e1880747",
"score": "0.63838184",
"text": "def get_rate(date, currency)\n begin\n if(currency == \"EUR\")\n 1.to_f\n else\n rate_node = @xml_doc.xpath(\"//xmlns:Cube[@time='#{date}']/xmlns:Cube[@currency='#{currency}']\").first\n if(rate_node)\n rate_node.attr('rate').to_f\n else\n -1.to_f\n end\n end\n rescue => e\n print_exception e\n end\n end",
"title": ""
},
{
"docid": "923c20c45b6092ac80d234e1b814bc32",
"score": "0.6368635",
"text": "def wage_rate\n wage_rates.fetch(job_group, 0)\n end",
"title": ""
},
{
"docid": "00a71af8bf43e0a40ff00c1643c20765",
"score": "0.63674825",
"text": "def apply_element_rate(user, item, value)\n value *= item_element_rate(user, item)\n value\n end",
"title": ""
},
{
"docid": "00a71af8bf43e0a40ff00c1643c20765",
"score": "0.63674825",
"text": "def apply_element_rate(user, item, value)\n value *= item_element_rate(user, item)\n value\n end",
"title": ""
},
{
"docid": "f70bf7f38cc34e360d7464d0c94491bd",
"score": "0.63494444",
"text": "def get_rate_from_rate(base_tag_name)\n\t\tcount_data = self.get_tagvalue(base_tag_name+'-count');\n\t\trate_data = self.get_tagvalue(base_tag_name+'-rate');\n\n\t\tif !count_data.nil? and !rate_data.nil?\n\t\t\tcount = count_data[0]['tag_value'].to_f;\n\t\t\tage = count_data[0]['age'].to_f;\n\t\t\trate = rate_data[0]['tag_value'].to_f / 60; # rate tags give events/min. we need events/sec\n\t\telse\n\t\t\tcount = 0;\n\t\t\tage = 0;\n\t\t\trate = 0;\n\t\tend\n\n\t\treturn {'tag_name' => base_tag_name+'-count', 'count' => count, 'age' => age, 'rate' => rate};\n\tend",
"title": ""
},
{
"docid": "5107b85a3f554340896ef1c564b0566f",
"score": "0.6343063",
"text": "def exchange_rate\n params['exchange_rate']\n end",
"title": ""
},
{
"docid": "201c1675b3e555831cb9a89b4aa784b6",
"score": "0.63409436",
"text": "def inst_rate now\n current_iter.to_f / (now-last_time).to_f\n end",
"title": ""
},
{
"docid": "276c0936924ce95bf8184811975c0691",
"score": "0.63239866",
"text": "def rate\n return 0.0 if @sum.zero?\n return @count / @sum\n end",
"title": ""
},
{
"docid": "88bc577d8a0890c3ec68b93a329c1682",
"score": "0.63169056",
"text": "def aps_rate\n return Aps.rate(self.agi)\n end",
"title": ""
},
{
"docid": "31290a89ffe83c92360060c6b7b60bc9",
"score": "0.630977",
"text": "def get_rate(rateable)\n self.rates.for_rateable(rateable).first\n end",
"title": ""
},
{
"docid": "3b10e3be3acbf2ce90e495231f3d7274",
"score": "0.62929183",
"text": "def price\n @amount * self.class.rate\n end",
"title": ""
},
{
"docid": "cd07145043c4ef71a861cefc55d9f652",
"score": "0.6292179",
"text": "def base_rate\n super\n end",
"title": ""
},
{
"docid": "d11bd15ba1c1c6b0f731185110d86b22",
"score": "0.62860817",
"text": "def get_rate(value, rate_type)\n AdditionalCalculatorRate.find_rate(self.id, rate_type, value)\n end",
"title": ""
},
{
"docid": "c8bc6292881714adaa6c8d48d85bd7e8",
"score": "0.6281071",
"text": "def rate\r\n sum = 0\r\n reviews.each do |r|\r\n sum += r.rate\r\n end\r\n (sum.to_f / reviews.length).round(1)\r\n end",
"title": ""
},
{
"docid": "1d476633ecd959e834604c20878cfecf",
"score": "0.62776047",
"text": "def elements_max_rate(element_set)\n return 100 if element_set.empty? # If there is no element\n rate_list = []\n for i in element_set\n rate_list.push(element_rate(i))\n end\n return rate_list.max\n end",
"title": ""
},
{
"docid": "47cf51f7c62b170ec72078896b26513f",
"score": "0.62690043",
"text": "def byte_rate\n @byte_rate\n end",
"title": ""
},
{
"docid": "09850faeab2cd0633c1a4a32518e3c0e",
"score": "0.6267067",
"text": "def weight\n\t\treturn @api[\"weight\"]\n\tend",
"title": ""
},
{
"docid": "ecb29f7ae354aef40bfa1067696d5575",
"score": "0.6267042",
"text": "def rate\n samples = @samples[@marker]\n result = samples.inject(:+).to_f / samples.size\n result.nan? ? 0 : result\n end",
"title": ""
},
{
"docid": "8655890d4143ff1759533dcf06ee1513",
"score": "0.62545407",
"text": "def extract_rate(data)\n case data\n when /<span class=bld>(\\d+\\.?\\d*) [A-Z]{3}<\\/span>/\n BigDecimal($1)\n when /Could not convert\\./\n raise UnknownRate\n else\n raise GoogleCurrencyFetchError\n end\n end",
"title": ""
},
{
"docid": "0c695902cdf0a76067acc60796c90623",
"score": "0.6244958",
"text": "def rate\n @value_stats.sum / @timed_stats.sum\n end",
"title": ""
},
{
"docid": "e913c93193b5fb006492b37ac4b86227",
"score": "0.62421685",
"text": "def rate_component=(_arg0); end",
"title": ""
},
{
"docid": "f060e168e93fcee58cda2c52f48f3120",
"score": "0.6226568",
"text": "def inst_rate now\n current_iter.to_f / (now-last_time).to_f\n end",
"title": ""
},
{
"docid": "39256a60000a81b8ba2154238393673d",
"score": "0.62180465",
"text": "def getRate currency\n accounts = Account.find(:all)\n \n accounts.each do |a|\n if a.currency == currency then\n return a.exchangeRate\n end\n end\n end",
"title": ""
},
{
"docid": "3f10d25f70773fea7027fb2a2b9e2d6a",
"score": "0.62167966",
"text": "def elements_max_rate(elements, user = nil)\n #puts \" Using best element\"\n #return elements.inject([0.0]) {|r, i| r.push(element_rate(i) * (user == nil ? 1.0 : user.element_power(i))) }.max\n return elements.inject([0.0]) {|r, i|\n e_rate = element_rate(i)\n e_pwr = (user == nil ? 1.0 : user.element_power(i))\n rate = e_rate * e_pwr\n r.push(rate)\n #puts \" Element ID: #{i}\"\n #puts \" Element Rate: #{e_rate}\"\n #puts \" User Element Power: #{e_pwr}\"\n #puts \" Final Rate: #{rate}\"\n }.max\n end",
"title": ""
},
{
"docid": "21f32b24b56028a987c95bd373ef8a11",
"score": "0.62152636",
"text": "def mhp_rate; param_rate(0); end",
"title": ""
},
{
"docid": "76f52f45c4d8921aa797b4c6e4d8ed61",
"score": "0.62032443",
"text": "def score\n rate.score\n end",
"title": ""
},
{
"docid": "fd2589d9e21af9e641833bc6ef6052ee",
"score": "0.62017184",
"text": "def getWeight\n return @weight\n end",
"title": ""
},
{
"docid": "6caa1fb30176d92072c3d6bad2ca89a0",
"score": "0.6196184",
"text": "def speed_upload\n attributes['rateUpload']\n end",
"title": ""
},
{
"docid": "f4a1bd6d8ba6a9f621b4b2a181dd0542",
"score": "0.61904645",
"text": "def mp_rate\n @actor_data[6].to_f / @actor_data[7]\n end",
"title": ""
},
{
"docid": "60db1fc979c059ebf6fe0e97188ba94e",
"score": "0.6186421",
"text": "def aps_start_rate\n return Aps.start_rate\n end",
"title": ""
},
{
"docid": "f8f57d640d14dd39a37c81b3d2dcfb21",
"score": "0.6179315",
"text": "def rate_one_per\n unless total_rate==0\n (self.rate_one/self.total_rate.to_f)*80.to_i\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "d6afde6cd48c3fedbe49a784800dcba5",
"score": "0.61724865",
"text": "def tokenExchange\n\t\trate = Exchange.where(trip_id: self.id, units: \"dollars\").first.rate\n\t\treturn rate\n\tend",
"title": ""
},
{
"docid": "1cdc0be2e39d1cb954ce89cbfc1f8e8a",
"score": "0.6170772",
"text": "def track_frame_rate\n ng_xml.css(\"fits > metadata > video > track[type='video'] > frameRate\").map(&:text)\n end",
"title": ""
},
{
"docid": "3e4274d5d9a2c65ddf466607df0daa1a",
"score": "0.6159036",
"text": "def rate\n MSPhysics::Newton::CurvyPiston.get_rate(@address)\n end",
"title": ""
},
{
"docid": "b946eb822472f0eb9cb41f1c3abef656",
"score": "0.6132039",
"text": "def evaluate_rate(rate) # ovplyvnuje sancu s akou sa dostane do vyberu\n ((rate - @user.average + 4) ** 4) / 8\n end",
"title": ""
},
{
"docid": "5d4a2f084dd0377cd404b527e63b7efc",
"score": "0.61301917",
"text": "def sample_rate\n @format.sample_rate\n end",
"title": ""
},
{
"docid": "879b2a2f88533f14d32a019ca5e6a397",
"score": "0.6111175",
"text": "def video_sample_rate\n ng_xml.css(\"fits > metadata > video > sampleRate\").map(&:text)\n end",
"title": ""
},
{
"docid": "dd1089e01fa843a89f71a36421ec36bd",
"score": "0.6108846",
"text": "def cached_rate(original, target)\n if defined?(Rails)\n unless rate = Rails.cache.read(\"#{original}_#{target}_#{stringified_exchange_date}\")\n rate = (1.0 / Rails.cache.read(\"#{target}_#{original}_#{stringified_exchange_date}\")) rescue nil\n end\n rate\n end\n end",
"title": ""
},
{
"docid": "b9145098e800f9cde70831941dfd9e96",
"score": "0.6108725",
"text": "def rate_to_usd()\n return 1\n end",
"title": ""
},
{
"docid": "122429c1ccba62f590a4c12d96238817",
"score": "0.6098691",
"text": "def game_rating\n ratingArray = self.ratings\n results = ratingArray.inject(0){|sum,el| sum + el.rate}.to_f / ratingArray.length\n return results\n end",
"title": ""
},
{
"docid": "68b8b5d17bdfd91098248e2c996b40ca",
"score": "0.6078016",
"text": "def occupancy_rate\n self.dig_for_integer(\"occupancyRate\")\n end",
"title": ""
}
] |
073f3e7ddd4c783cdb7f7556920f911f
|
Recursively retrieve subcollection images
|
[
{
"docid": "78fef3d035a54aa11835971b1d33bbe6",
"score": "0.7591046",
"text": "def image_dig( _collection, _images, _check )\n\n # No sequence just exit...\n images = _collection.images\n if images\n images.each do | image |\n _images.push( image )\n end\n end\n\n # Recurse subcollection to get associated images.\n # If they exist of course.\n subs = _collection.subcollections\n if subs\n subs.each do | sub |\n collection = Collection.new\n collection.byId( sub.tagify )\n\n # Avoid circular subcollection referencing.\n if _check.include?( collection.urn ) == false\n _check.push( collection.urn )\n _images = image_dig( collection, _images, _check )\n end\n end\n end\n\n # Return those images.\n _images\n end",
"title": ""
}
] |
[
{
"docid": "038692c30729fe1a1e88292bcaabe624",
"score": "0.6898821",
"text": "def subtree_preview_images\n subtree_images = preview_images\n if children.length > 0\n children.each do |child|\n subtree_images += child.subtree_preview_images\n end\n end\n subtree_images\n end",
"title": ""
},
{
"docid": "a38e2d545c5a3741e5c215caa423b749",
"score": "0.68527675",
"text": "def index\n @sub_collection_images = SubCollectionImage.all\n end",
"title": ""
},
{
"docid": "32581366a02aeaf1b25ea3fc71812db5",
"score": "0.6773063",
"text": "def sub_images\n\t\t\tproduct_images.second\n\t\tend",
"title": ""
},
{
"docid": "3cf71a6e972c32c02becf63f85b08553",
"score": "0.65883386",
"text": "def images_collection(path)\n images_collection = if recursive then Dir.glob(\"#{path}/**/*\") else Dir.glob(\"#{path}/*\") end\n images_collection.select { |i| i =~ /.+\\.#{extentions}/i }\n end",
"title": ""
},
{
"docid": "265937347592500676c55d16f54eed27",
"score": "0.6498438",
"text": "def get_images()\n\t\t\tget_document(@tag_type[1])\n\t\tend",
"title": ""
},
{
"docid": "1ab44fcb1e6339dbbe7fc494802b8822",
"score": "0.64620805",
"text": "def page_paths\n self.class.image_file_list(real_path.children)\n end",
"title": ""
},
{
"docid": "a2c1319c7454873d443d1ada25c7840c",
"score": "0.6438284",
"text": "def load_images\n\t\t\tt1 = Time.now\n\t\t\tsearch_results = Image.search(\n\t\t\t\t{\n\t\t\t\t\t:query => {\n\t\t\t\t\t\t:term => {\n\t\t\t\t\t\t\t:parent_id => {\n\t\t\t\t\t\t\t\t:value => self.id.to_s\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\t}\n\t\t\t)\n\t\t\t\n\t\t\tunless search_results.response.hits.hits.blank?\n\t\t\t\tsearch_results.response.hits.hits.each do |hit|\n\t\t\t\t\tself.images << Image.find(hit[\"_id\"])\n\t\t\t\tend\n\t\t\telse\n\t\t\t\t\n\t\t\tend\n\t\t\tt2 = Time.now\n\t\t\tputs \"load images from class: #{self.class.name} takes: #{(t2-t1).in_milliseconds}\"\n\n\t\tend",
"title": ""
},
{
"docid": "f74f7194ef373f3e0e7c4421ffae8aa9",
"score": "0.64320904",
"text": "def images\n self.class.images(@path)\n end",
"title": ""
},
{
"docid": "c6c3f97b88124fdc9601c92a49ee4fe5",
"score": "0.6327673",
"text": "def child_images\r\n json_response = get_response(params)\r\n select_val = []\r\n urls = []\r\n chaild_images = []\r\n json_response.each do |foo|\r\n if foo['name'] == params[:select_value]\r\n foo['gallery_images'].each do |f|\r\n select_val << f['name']\r\n urls << f['img_url']\r\n end\r\n end\r\n end\r\n # rendering the response\r\n options = {'options' => select_val,\r\n 'urls' => urls\r\n }\r\n render json: options\r\n end",
"title": ""
},
{
"docid": "56defd95e04a7e4a269463aca972ddd3",
"score": "0.62794876",
"text": "def pictures_all\n pictures\n end",
"title": ""
},
{
"docid": "4ed8b0d788c24261ae2d317c3034887f",
"score": "0.61849827",
"text": "def show_images\n doc = document\n index=1\n doc.images.each do |l|\n puts \"image: name: #{l.name}\"\n puts \" id: #{l.invoke(\"id\")}\"\n puts \" src: #{l.src}\"\n puts \" index: #{index}\"\n index+=1\n end\n end",
"title": ""
},
{
"docid": "ef7d502887301a667b645511e4b39c22",
"score": "0.61818",
"text": "def show\n @collection_images = @collection.collection_images.all\n end",
"title": ""
},
{
"docid": "4731a624ceece86d2698f2226227aa3c",
"score": "0.6180403",
"text": "def images\n\n hydra = Typhoeus::Hydra.new\n request = Buffet::Util::constantize(\"#{service.to_s.capitalize}Proxy\").find_album_images(hydra, self)\n hydra.queue(request)\n hydra.run\n\n request.handled_response\n end",
"title": ""
},
{
"docid": "ca2540fcad13e4d025eb7887ea051b92",
"score": "0.61682254",
"text": "def show_images\n doc = document\n index = 1\n doc.images.each do |l|\n puts \"image: name: #{l.name}\"\n puts \" id: #{l.invoke(\"id\")}\"\n puts \" src: #{l.src}\"\n puts \" index: #{index}\"\n index += 1\n end\n end",
"title": ""
},
{
"docid": "5e6f890a15da0e0836f4eb919aa108bd",
"score": "0.6131244",
"text": "def thumbnails\n subdirectories(@path_to_thumbnails).map { |path| Gallery.new(path) }\n end",
"title": ""
},
{
"docid": "e27c9b930e26b5bc83963b041fee2df2",
"score": "0.61071616",
"text": "def images\n object[\"images\"]\n end",
"title": ""
},
{
"docid": "52290d76db8277d28d231846e421e7d1",
"score": "0.6096403",
"text": "def subcollections(params = {}, &block)\n return files_with_type(\"application/vnd.google-apps.folder\", params, &block)\n end",
"title": ""
},
{
"docid": "2e6401870358d95314ab4385adcdfa25",
"score": "0.60760856",
"text": "def get_images(node_set)\n node_set.each do |node|\n src = node['src']\n puts \"fetching #{src}\"\n \n open(File.join(DATA_DIR, File.basename(src)), 'wb') do |file|\n file << open(src).read\n end\n \n puts \"...done!\"\n end\nend",
"title": ""
},
{
"docid": "8088e34caad3172cfd7905eec5a1d105",
"score": "0.6070802",
"text": "def images\n @images ||= Image.find_all_by_listing_id(id)\n end",
"title": ""
},
{
"docid": "302b4233208f4350e69dce15118e76c2",
"score": "0.60570234",
"text": "def images\n images = @anchors.select { |a| a.object.is_a?(Pic) }\n images.map(&:object)\n end",
"title": ""
},
{
"docid": "6ccb3f067db74d8eeb606458ecdb2f1f",
"score": "0.6049883",
"text": "def get_images(page)\n x = current_user.own_media_elements(page, IMAGES_FOR_PAGE, Filters::IMAGE, true)\n @images = x[:records]\n @tot_pages = x[:pages_amount]\n end",
"title": ""
},
{
"docid": "719fd43b377289c92632d14b024a9c0d",
"score": "0.6041106",
"text": "def children\n @children ||= begin\n ar = load_children\n if ![String, ErrorMessage].include?(@object.class)\n ps = PhotoSet.find_by_obj(@object, :include => :photos_photo_sets, :order => 'photos_photo_sets.position')\n ps.photos_photo_sets.each { |pps| ar << pps } if !ps.nil?\n end\n create_children(ar)\n end\n end",
"title": ""
},
{
"docid": "0acb6febfe269f74eaa243bac33a70b8",
"score": "0.6031255",
"text": "def images\n @images\n end",
"title": ""
},
{
"docid": "0acb6febfe269f74eaa243bac33a70b8",
"score": "0.6031255",
"text": "def images\n @images\n end",
"title": ""
},
{
"docid": "c7f03abcb695f80d4d0df29f413b5097",
"score": "0.6021038",
"text": "def items()\n data['images']\n end",
"title": ""
},
{
"docid": "fbdd77c8cea8850995f21be3d76ffa55",
"score": "0.5975874",
"text": "def get_images(page)\n @images.clear\n\n begin\n page.images.each do |image|\n unless image.extname.empty?\n @images << { :SRC => image, :NAME => get_image_name(image) }\n end\n end\n rescue\n raise GetImageError\n end\n\n @images\n end",
"title": ""
},
{
"docid": "4cf766313743b6163ae016d7775074fb",
"score": "0.5969457",
"text": "def collection_with_parent_collection; end",
"title": ""
},
{
"docid": "4cf766313743b6163ae016d7775074fb",
"score": "0.5969457",
"text": "def collection_with_parent_collection; end",
"title": ""
},
{
"docid": "a92541556da354027f3127d61694f3b7",
"score": "0.59675044",
"text": "def child_images\r\n puts params[:select_value]\r\n json_response = get_response\r\n select_val = []\r\n urls = []\r\n chaild_images = []\r\n json_response.each do |foo|\r\n if foo['name'] == params[:select_value]\r\n puts foo['name']\r\n foo['gallery_images'].each do |f|\r\n select_val << f['name']\r\n urls << f['img_url']\r\n end\r\n end\r\n end\r\n # rendering the response\r\n options = {'options' => select_val,\r\n 'urls' => urls\r\n }\r\n render json: options\r\n end",
"title": ""
},
{
"docid": "b4efed664fe723fca3bd06c191e69d79",
"score": "0.59562355",
"text": "def all_images\n Image.all\n end",
"title": ""
},
{
"docid": "d66d3086dc9e3a2fd0080d385afdc607",
"score": "0.5941084",
"text": "def photos\n entries\n end",
"title": ""
},
{
"docid": "57763ca2f396f7b5eab34d26e5fa7d6b",
"score": "0.59392273",
"text": "def get_images\r\n return Images.new(@container)\r\n end",
"title": ""
},
{
"docid": "facc67ccccdcba84906d6582c9dd4787",
"score": "0.59259707",
"text": "def photos\n \tobject.photos\n end",
"title": ""
},
{
"docid": "b92d89bd35301552c5480242a479c895",
"score": "0.5921849",
"text": "def album_images\n AlbumImage.find_by_album_id(self.id)\n end",
"title": ""
},
{
"docid": "d21248a80311d0977de4a677365959a3",
"score": "0.5913659",
"text": "def quick_view_images\n returned_images = []\n images = @record.fetch('ImageQuickViewItems', {})\n if images.count > 0\n images.each do |quick_view_item|\n image_id = quick_view_item['DbId']\n image_accession = quick_view_item['An']\n image_type = quick_view_item['Type']\n # todo: change to https, large/small url?\n image_url = quick_view_item['Url']\n returned_images.push({url: image_url, id: image_id, accession_number: image_accession, type: image_type})\n end\n end\n returned_images\n end",
"title": ""
},
{
"docid": "c6834660dbd82d71943241e4c073f616",
"score": "0.590774",
"text": "def resolve_photos\n # Edition > Sections > Pages > Content Regions > Photo Content Items > Photos\n\n photos = []\n sections.each do |section|\n section.pages.each do |page|\n photos += page.content_items.where(_type: 'PhotoContentItem').map(&:photo)\n end\n end\n\n photos.compact\n end",
"title": ""
},
{
"docid": "ca9a51048173a6018541408e8803d93f",
"score": "0.5907463",
"text": "def index\n if params[:global_base_imagable]\n @imagable = GlobalID::Locator.locate(GlobalID.parse(params[:global_base_imagable]))\n @images = Image.where(base_imagable: @imagable)\n elsif params[:global_any_imagable] # parameter to return images of self as parent and children\n @imagable = GlobalID::Locator.locate(GlobalID.parse(params[:global_any_imagable]))\n @images = Image.where(base_imagable: @imagable).or(Image.where(imagable: @imagable))\n else\n @imagable = find_resource\n @images = @imagable.images\n end\n\n if @imagable\n\n if params[:sort].present? && params[:order].present?\n if params[:sort] == 'creator'\n @images = @images.joins(:creator).reorder(\"CONCAT(users.first_name, ' ', users.last_name) #{params[:order]}\")\n else\n @images = @images.reorder(params[:sort] => params[:order])\n end\n end\n else\n Rails.logger.debug \"No images\"\n @images = Image.none\n end\n\n @images = @images.left_outer_joins(:image_classification)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json {\n render :json => {\n :total => @images.count,\n :rows => @images.limit(params[:limit]).offset(params[:offset]).collect{ |u|\n u.as_json.merge!({\n classification: u.image_classification&.to_s,\n link_image: view_context.link_to(view_context.image_tag(u.image.url(:thumb)), u.image.url, :class => \"img-responsive gallery-image\", :data => {:lightbox => \"gallery\"}, :title => u.original_filename),\n imagable: u.imagable.as_json,\n creator: u.creator.to_s\n })\n }\n }\n }\n\n end\n\n end",
"title": ""
},
{
"docid": "902bd50ed304bd6405292fc91d326bf5",
"score": "0.5905528",
"text": "def photos\n results = []\n return results if self.reviews.empty?\n\n self.reviews.each do |review|\n review.photos.each do |photo|\n results << photo\n end\n end\n return results\n end",
"title": ""
},
{
"docid": "a503cb857b61a4324a5705c32c64a18e",
"score": "0.5896772",
"text": "def images\n @images ||= read_images\n end",
"title": ""
},
{
"docid": "9120ff9e6c84fa6f7ead526544765c88",
"score": "0.58714074",
"text": "def get_images(ten)\n return ten.map{|x| x[:images][:low_resolution][:url]}\n end",
"title": ""
},
{
"docid": "605ad365f20dd6f29a4920df12ff9a92",
"score": "0.5871252",
"text": "def listChildCollections() \n @obj.listChildCollections() \n end",
"title": ""
},
{
"docid": "2e43d8cc5aa6685bd7c12620a58fad2d",
"score": "0.58703285",
"text": "def images; end",
"title": ""
},
{
"docid": "2e43d8cc5aa6685bd7c12620a58fad2d",
"score": "0.58703285",
"text": "def images; end",
"title": ""
},
{
"docid": "780a9c2186e1c140d98dab4d2ca5ab5b",
"score": "0.5836838",
"text": "def pictures\n render json: @collection.pictures\n end",
"title": ""
},
{
"docid": "b857aae65f2ae53ecf711d4270352c71",
"score": "0.58359456",
"text": "def get_images\n puts \"Getting image list\"\n images = @conn.list_images\n\n for image in images.body['images']\n puts image\n end\n\n return images.body['images'][0]\n end",
"title": ""
},
{
"docid": "3822f25be4fd39d51e56ac792efd6caf",
"score": "0.58347964",
"text": "def images\n #binding.pry\n object.advert_images.map{|image| image.image}\n end",
"title": ""
},
{
"docid": "5ba6395620e537c1e1cd91d157a9d987",
"score": "0.58303905",
"text": "def list_all\n\t\tdebug \"Listing all of the images here!\"\n return @images\n\tend",
"title": ""
},
{
"docid": "702e60219580ba0b6ca771890613e014",
"score": "0.58271134",
"text": "def parse(page)\n return page.images\n end",
"title": ""
},
{
"docid": "43ee8b9e3a37ae644cf5323631f37cc8",
"score": "0.581588",
"text": "def images\n self.product.images\n end",
"title": ""
},
{
"docid": "47d16118c209630da8373fc3ef1960ef",
"score": "0.58079636",
"text": "def get_images(curation)\n images = curation.images.select {|img| img.position.present?}.select { |x| x.attachment_content_type.present? }\n\n images.sort_by!{ |i| i.position }\n cropped_images = images.select{ |i| i.attachment(:large).to_s.downcase.include?('crop') }\n cropped_images.sort_by!{ |i| i.position }\n\n other_images = (cropped_images + images).uniq # prepend the crop to remainder of images\n other_images = other_images.map{|i| i.attachment(:large).to_s }\n\n front_crop = other_images.shift # pull the front image\n\n\n {\n image: front_crop,\n images: other_images\n }\n end",
"title": ""
},
{
"docid": "e932b9010085a9f6733635c98cd61d84",
"score": "0.5797583",
"text": "def items(params = {}, collection = [])\n # Format params defaults\n params = {fields: 'sha1,name,path_collection,size', limit: LIMIT, offset: 0}.merge(params)\n # Add expected fields and limit\n response = @client.get(\"/folders/#{id}/items\", params)\n\n # Add the results to the total collection\n collection.push *@client.parse_items(response.body)\n\n total_count = response.body['total_count']\n offset = (LIMIT * (params[:offset] + 1))\n\n if total_count > offset\n Box.log \"Recursively calling for items in folder #{name} - #{LIMIT}, #{offset}, #{total_count}\"\n return self.items({offset: offset}, collection)\n end\n\n collection\n end",
"title": ""
},
{
"docid": "53ac7282a9a880ba3ba14b512e79387f",
"score": "0.579604",
"text": "def images\n images = []\n return unless object.images.attachments\n image_urls = object.images.map do |image| \n # rails_blob_url(image)\n image = { url: rails_blob_url(image), signed_id: image.signed_id }\n images << image\n end\n \n images\n end",
"title": ""
},
{
"docid": "34745e11a467275143003a00c4fc7a50",
"score": "0.57927114",
"text": "def get_pictures\n response = RestClient.get(@url)\n parsed_response = JSON.parse(response)\n\n parsed_response[\"data\"][\"children\"].map do |post|\n photo = post['data']['thumbnail'] \n @posts << {photo: photo}\n end\n end",
"title": ""
},
{
"docid": "3ca770a34ebe035874b1ae93a2332652",
"score": "0.5789289",
"text": "def image_story_images\n content_images.map{|m| m.image }\n end",
"title": ""
},
{
"docid": "45661d3fc1e4e03190ef50c645c8279b",
"score": "0.5786862",
"text": "def images_node\n json[\"images\"] || json[\"smallImageUrls\"].collect { |url| {\"hostedSmallUrl\" => url} }\n end",
"title": ""
},
{
"docid": "f7bc2918a52fc15c26b13c1c8183da06",
"score": "0.57792336",
"text": "def images\n images = []\n if self.property_images\n images += self.property_images\n end\n if self.property.property_images\n images += self.property.property_images\n end\n images\n end",
"title": ""
},
{
"docid": "fb9a160a307e85304deeea04b6e99c64",
"score": "0.57773936",
"text": "def get_images\n @command = :get_images\n raise ProjectRazor::Error::Slice::NotImplemented, \"accessible via cli only\" if @web_command\n print_object_array(get_object(\"images\", :images), \"Images\", :success_type => :generic, :style => :item)\n end",
"title": ""
},
{
"docid": "fb9a160a307e85304deeea04b6e99c64",
"score": "0.57773936",
"text": "def get_images\n @command = :get_images\n raise ProjectRazor::Error::Slice::NotImplemented, \"accessible via cli only\" if @web_command\n print_object_array(get_object(\"images\", :images), \"Images\", :success_type => :generic, :style => :item)\n end",
"title": ""
},
{
"docid": "e3c6c626d35e4ae6d287c8f9b9c3c674",
"score": "0.57723653",
"text": "def statefulset_images(client)\n client.statefulset_list['items'].map do |item|\n item['spec']['template']['spec']['containers'].map{ |cont| cont['image'] }\n end\n end",
"title": ""
},
{
"docid": "e3c6c626d35e4ae6d287c8f9b9c3c674",
"score": "0.57723653",
"text": "def statefulset_images(client)\n client.statefulset_list['items'].map do |item|\n item['spec']['template']['spec']['containers'].map{ |cont| cont['image'] }\n end\n end",
"title": ""
},
{
"docid": "c336066a076658c5e397bc74fb41ccbc",
"score": "0.57723296",
"text": "def images\n @images = ::Queries::Image::Filter.new(\n collection_object_id: [ params.require(:id)],\n collection_object_scope: [:all]\n )\n\n respond_to do |format|\n format.html { @images = @images.all }\n format.json do # rendered as Depictions for now\n @depictions = @iamges.derived_depictions\n render '/depictions/index' and return\n end\n end\n end",
"title": ""
},
{
"docid": "1a30d1d4fa47de97c3f7665b42f2935c",
"score": "0.5770981",
"text": "def chapter_images(chapter)\n images = []\n # 1 Request\n pages = get_page(chapter).css('#pageMenu option').count\n\n hydra = Typhoeus::Hydra.new\n pages.times do |i|\n current_page = sprintf '%04d', i + 1\n url = \"#{@base_url}#{chapter}/#{current_page}\"\n request = Typhoeus::Request.new(url, followlocation: true)\n request.on_complete do |response|\n page = Nokogiri::HTML(response.body)\n images << { page_nr: current_page,\n url: page.css('#img').first.attributes['src'].value }\n end\n hydra.queue(request)\n request\n end\n hydra.run\n images\n end",
"title": ""
},
{
"docid": "5b12256cbedd3fed235a2681b37b3429",
"score": "0.5758961",
"text": "def list_images # :nologin:\n query = create_query(:Image, :all, :by => :created)\n show_selected_images(query)\n end",
"title": ""
},
{
"docid": "a2779f3d8a8bcc31d9e0ec33a29797f9",
"score": "0.57588154",
"text": "def fixup_images(node)\n if Wunderbar::Node === node\n if node.name == 'img'\n if node.attrs['src'] and node.attrs['src'].to_s.start_with? 'cid:'\n node.attrs['src'].value = node.attrs['src'].to_s.sub('cid:', '')\n end\n else\n fixup_images(node.search('img'))\n end\n elsif Array === node\n node.each {|child| fixup_images(child)}\n end\n end",
"title": ""
},
{
"docid": "2e40b1a0e01f3d40c958b1e0e17c7e02",
"score": "0.5756319",
"text": "def images_and_imageboxes(doc)\n doc.xpath('//image').each do |node|\n handle_image(node, klass: 'image')\n end\n\n doc.xpath('//imagebox').each do |node|\n handle_image(node, klass: 'image box')\n end\n end",
"title": ""
},
{
"docid": "583fd29a0d2de6b4699e95af8199e5d9",
"score": "0.5753254",
"text": "def build_images\n raw_images.map { |raw_image| build_image(raw_image) }\n end",
"title": ""
},
{
"docid": "95b98bf6e36a34ca3b4a210b88fb64df",
"score": "0.5741879",
"text": "def all_photos()\n Photo.find(:all)\n end",
"title": ""
},
{
"docid": "8c77b5e92f6a6b68bd2a0cb624ab2ba4",
"score": "0.5740362",
"text": "def images\n self.ListImages.first.map { |i| map_image(i) }\n end",
"title": ""
},
{
"docid": "33f90c4859426ab5575efffb382c5b12",
"score": "0.5735268",
"text": "def image_urls\n self.images.map do |image|\n image.url\n end\n end",
"title": ""
},
{
"docid": "ac422bf21bd01dda299992f4404ab3fe",
"score": "0.57346314",
"text": "def find_images(doc)\n source = doc.search(\"guid\").inner_html\n @@logger.debug(\"searching in #{source}\")\n images = []\n \n #begin\n # doc.search(\"media:content\").each do |image|\n # images << {\n # :image => image.attributes['url'],\n # :summary => image.search(\"media:description\").inner_html.strip,\n # :source => source_name,\n # }\n # end\n #rescue Exception => ex\n # @@logger.error(ex)\n #end\n \n images\n end",
"title": ""
},
{
"docid": "e9cc1c9d15e977fcf98d769beca82b8a",
"score": "0.5731908",
"text": "def photos\n photos = []\n stacks.photos.all.each do |stack|\n photos << stack.stackable\n end\n photos\n end",
"title": ""
},
{
"docid": "6b210b3f7e2315caf5c4c247ebafec3d",
"score": "0.57289463",
"text": "def images_of(group, limit = 0)\n relations = related_images.by_group(group)\n if relations && !relations.empty?\n relations[0..limit]\n else\n relations = contributed_images.by_group(group)\n if relations && !relations.empty?\n relations[0..limit]\n else\n nil\n end\n end\n end",
"title": ""
},
{
"docid": "c666b5251c92e89e78c39b5353069867",
"score": "0.57230735",
"text": "def index\n @photos = if @attachable.nil?\n Photo.find :all, :conditions => {:parent_id => nil}, :order => 'created_at DESC'\n else\n @attachable.photos.find :all, :conditions => {:parent_id => nil}, :order => 'created_at DESC'\n end\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @photos.to_xml }\n end\n end",
"title": ""
},
{
"docid": "9dc9de7abbafd725e7da678c4bb61e13",
"score": "0.5722134",
"text": "def advert_images\n #binding.pry\n object.advert_images.map{|image| image.image}\n end",
"title": ""
},
{
"docid": "fd39f82956282dfb82a578e4063fcac5",
"score": "0.5718542",
"text": "def fetch_images\n uuids = fetch_image_uuids || []\n uuids.map { |uuid| Aeolus::Image::Warehouse::Image.find(uuid) }\n end",
"title": ""
},
{
"docid": "c997b2e050de8d7c654a2a87d94fdabe",
"score": "0.571558",
"text": "def find_child_collections(resource:)\n query_service\n .find_inverse_references_by(resource: resource, property: :member_of_collection_ids)\n end",
"title": ""
},
{
"docid": "f6f6042b34560c11878c4ad8e9970202",
"score": "0.57151943",
"text": "def extract_image_elements\n extract_elements 'image'\n end",
"title": ""
},
{
"docid": "9a5945405858a5f8b683193bbe537c85",
"score": "0.57142943",
"text": "def images\n super.order(:id)\n end",
"title": ""
},
{
"docid": "139323f3bfd861ca8875c9a6a4e1e000",
"score": "0.5711677",
"text": "def all\n compute = connect()\n data = compute.images.all_public\nend",
"title": ""
},
{
"docid": "bb6ce08d6d5a055b834746f4a2b95c04",
"score": "0.5706698",
"text": "def set_sub_collection_image\n @sub_collection_image = SubCollectionImage.find(params[:id])\n end",
"title": ""
},
{
"docid": "eb5eeca533a07f2e16e7701f6a45e95d",
"score": "0.57047784",
"text": "def images\n Google::Compute::CreatableResourceCollection.new(\n :resource_class => Google::Compute::Image, :dispatcher => @dispatcher)\n end",
"title": ""
},
{
"docid": "004aad37cafa5f11171b71d1274fde4e",
"score": "0.57040346",
"text": "def children\n @filesystem.find(filename: /^#{Regexp.escape(@bson['filename'])}[^\\/]+\\/?$/).map do |bson|\n child bson\n end\n end",
"title": ""
},
{
"docid": "b9d6cbc29f4d2ca01cbdb1e518e3d477",
"score": "0.57029265",
"text": "def images\n return [] unless @page\n @images ||= @page.css 'img'\n end",
"title": ""
},
{
"docid": "826a53c89e6a7c3a41c6e49d36356735",
"score": "0.5696453",
"text": "def index\n @collection_images = CollectionImage.all\n end",
"title": ""
},
{
"docid": "d00f80af4e3a5881918606351e31337e",
"score": "0.5694636",
"text": "def image_urls\n self.images.map(&:attachment).map(&:url)\n end",
"title": ""
},
{
"docid": "7bf4df39075294ed579960adb2e4eb96",
"score": "0.5693501",
"text": "def nested\n [ :photos, :accounts ]\n end",
"title": ""
},
{
"docid": "4decfbb2042237f1a3c8e5d0baff4398",
"score": "0.56916964",
"text": "def photos(offset=0, limit= 0)\n self.class.mongo_client.database.fs.find(\n \"metadata.place\": BSON::ObjectId.from_string(@id)\n ).map { |photo|\n Photo.new(photo)\n }\nend",
"title": ""
},
{
"docid": "86e7cd4dd482ab4bfc3d83483cdd0bca",
"score": "0.5691577",
"text": "def index\n @child_pics = ChildPic.all\n end",
"title": ""
},
{
"docid": "1da6d37e5cbbcbd57300147dbdabdb40",
"score": "0.5687119",
"text": "def thumbnails\n select_images(@path_to_thumbnails)\n end",
"title": ""
},
{
"docid": "54458d8b7148c21360c6e32627e39e19",
"score": "0.56870687",
"text": "def get_subcollections\n begin\n collection = DILCollection.find(params[:id])\n authorize! :show, collection\n\n # Get the subcollection JSON as a string and convert to a hash\n return_json = JSON.parse( collection.get_subcollections_json )\n # For each subcollection ...\n return_json.each do |subcoll|\n # Create a DILCollection object\n coll = DILCollection.find( subcoll[ \"pid\" ] )\n # Check to see if the current_user is an admin\n if current_user.admin?\n # If so, add the owner to the JSON\n # If the owner is empty, the JSON will contain \"null\"\n subcoll[ \"owner\" ] = coll.owner\n end\n end\n logger.debug( \"return_json: #{ return_json }\" )\n # Return the JSON as a string\n return_json.to_json\n\n rescue Exception => e\n #error\n return_json = \"{\\\"status\\\":exception}\"\n logger.debug(\"get_subcollections exception: #{e.to_s}\")\n\n ensure #this will get called even if an exception was raised\n respond_to do |format|\n #This wasn't working quite right, so just storing JSON in a variable instead of using .to_json\n #format.json { render :layout => false, :json => collection.to_json(:methods=>:get_subcollections) }\n format.json { render :layout => false, :json => return_json}\n end\n\n end\n end",
"title": ""
},
{
"docid": "912d978d3e191f11faa76abe5e342e70",
"score": "0.56806827",
"text": "def sorted_images\n return pathway_items.collect { |item| item.image }\n end",
"title": ""
},
{
"docid": "9dfa2b7a742106323ba2ee5e5497397c",
"score": "0.5674392",
"text": "def get_images\n @command = :get_images\n # set a flag indicating whether or not the user wants to see all images,\n # including the hidden ones\n show_hidden = (@prev_args.peek(0) == '-i' || @prev_args.peek(0) == '--hidden')\n # get the images from the RESTful API (as an array of objects)\n uri_str = ( show_hidden ? \"#{@uri_string}?hidden=true\" : @uri_string )\n uri = URI.parse uri_str\n result = hnl_http_get(uri)\n unless result.blank?\n # convert it to a sorted array of objects (from an array of hashes)\n sort_fieldname = 'filename'\n result = hash_array_to_obj_array(expand_response_with_uris(result), sort_fieldname)\n end\n # and print the result\n print_object_array(result, 'Images:', :style => :table)\n end",
"title": ""
},
{
"docid": "a535157d16c629787f5b6c32b62daa8b",
"score": "0.5669565",
"text": "def show\n @images = @folder.images.all\n end",
"title": ""
},
{
"docid": "a72c77e1e069eda09883c763a1004352",
"score": "0.5665132",
"text": "def all_images\n\n if block_given? then\n @cs_conn.images.each do |image|\n yield image\n end\n else\n @cs_conn.images\n end\n\n end",
"title": ""
},
{
"docid": "a72c77e1e069eda09883c763a1004352",
"score": "0.5665132",
"text": "def all_images\n\n if block_given? then\n @cs_conn.images.each do |image|\n yield image\n end\n else\n @cs_conn.images\n end\n\n end",
"title": ""
},
{
"docid": "cd648d47e77a749e89e79f4f144ea019",
"score": "0.5660792",
"text": "def get_images\n return [] unless page_exists?\n\n # Get all the images sources (URLs), using Nokogiri\n images_links = get_doc.css('img').map{ |image| image['src'] }.compact\n\n # Create the absolute path of the images\n images_links.map!{ |image| create_absolute_url( image ) }\n\n return images_links.uniq # Return links to images without duplicates\n end",
"title": ""
},
{
"docid": "d00549d628b27b09bc2eb53a8b90214c",
"score": "0.565516",
"text": "def images(limit = 3)\n reader_doc && !reader_doc.images.empty? ? reader_doc.images(limit) : nil\n end",
"title": ""
},
{
"docid": "011e86a4cd54a62f50edd715480cfd8e",
"score": "0.5652958",
"text": "def get_all_images\n @images.values\n end",
"title": ""
},
{
"docid": "fa3ea9cb139683d4205e7da6e8d04750",
"score": "0.56523675",
"text": "def images\n Images.new @api\n end",
"title": ""
},
{
"docid": "408f43bccd8d5d8f8fd5551576b1dab2",
"score": "0.56487674",
"text": "def get_photosets\n config = YAML.load_file(\"config/flickr.yml\")\n @api_key = config['key']\n @user = config['user']\n\n @doc = Nokogiri::XML(open(\"http://api.flickr.com/services/rest/?method=flickr.photosets.getList&api_key=#{@api_key}&user_id=#{@user}\"))\n \n first = true\n flickr_photosets = []\n \n @doc.xpath(\"/rsp/photosets/photoset\").each do |node|\n title = node.children\n \n # get the first photo in the set for the primary photo\n @photoset_photos = Nokogiri::XML(open(\"http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=#{@api_key}&photoset_id=#{node['id']}&per_page=1\"))\n first_photo = @photoset_photos.xpath(\"/rsp/photoset/photo\").first\n \n # now take that id and find me the actual photo\n @set_photo = Nokogiri::XML(open(\"http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key=#{@api_key}&photo_id=#{first_photo['id']}\"))\n \n set_photo = \"\"\n \n @set_photo.xpath(\"/rsp/sizes/size\").each do |size|\n if size['label'] == \"Square\"\n set_photo = size['source']\n end\n end\n \n a_class = \"\"\n \n if !params[:setid] && first\n a_class = \"current\"\n elsif params[:setid] == node['id']\n a_class = \"current\"\n end\n \n flickr_photosets.push(\"<a class=\\\"#{a_class}\\\" href=\\\"/photogallery/#{node['id']}\\\"><img src=\\\"#{set_photo}\\\" /><br /><span class=\\\"title\\\">#{title.text}</span></a>\")\n \n # its not the first run through\n first = false\n end\n \n return flickr_photosets\n end",
"title": ""
}
] |
065729b984053006f06cc1f40df64ad2
|
Creates a new AviGlitch::Frames object.
|
[
{
"docid": "7811f3619f73d0a8c4937fc6513c3f0f",
"score": "0.5020428",
"text": "def initialize io\n io.rewind\n io.pos = 12 # /^RIFF[\\s\\S]{4}AVI $/\n while io.read(4) =~ /^(?:LIST|JUNK)$/ do\n s = io.read(4).unpack('V').first\n @pos_of_movi = io.pos - 4 if io.read(4) == 'movi'\n io.pos += s - 4\n end\n @pos_of_idx1 = io.pos - 4 # here must be idx1\n s = io.read(4).unpack('V').first + io.pos\n @meta = []\n while chunk_id = io.read(4) do\n break if io.pos >= s\n @meta << {\n :id => chunk_id,\n :flag => io.read(4).unpack('V').first,\n :offset => io.read(4).unpack('V').first,\n :size => io.read(4).unpack('V').first,\n }\n end\n fix_offsets_if_needed io\n unless safe_frames_count? @meta.size\n io.close!\n exit\n end\n io.rewind\n @io = io\n end",
"title": ""
}
] |
[
{
"docid": "9ded909e6e650b75e4331746f77159d1",
"score": "0.67979556",
"text": "def create_frames\n # @type [LiteRGSS::Sprite]\n @black_frame = Sprite.new(@viewport) # Get the Blackn ^^\n # Scene frame\n # @type [LiteRGSS::Sprite]\n @frame = Sprite.new(@viewport).set_bitmap($options.language == 'fr' ? 'team/FrameFR' : 'team/FrameEN', :interface)\n end",
"title": ""
},
{
"docid": "8159771a70632f12304d9d93e62352ec",
"score": "0.6245146",
"text": "def frames\n frame_hashes.map { |h| Frame.new(h) }\n end",
"title": ""
},
{
"docid": "d9bb8161cb7d3cbd7f1a2f332f69c578",
"score": "0.6224422",
"text": "def frame\n @frame ||= Frame.new(self, 0)\n end",
"title": ""
},
{
"docid": "339ded8b63ef54480fcb7017aeb0b323",
"score": "0.61600614",
"text": "def frames\n @frames ||= constructor.frames\n end",
"title": ""
},
{
"docid": "7cbae784bc93c508e0f8a378bb95d897",
"score": "0.61165744",
"text": "def create_frames\r\n\t\tputs a[1][1]\r\n\t\tgame= Array.new(10)\r\n\t\tgame.map! do |item|\r\n\t\t\ti||=0\r\n\t\t\titem = Frame.new(@a[i][0], @a[i][1])\r\n\t\t\t# puts item\r\n\t\t\ti+=1\r\n\t\t\titem\r\n\t\tend\r\n\t\tout_game = game\r\n\t\t# for i in (0..9) do \r\n\t\t# \tputs game[i].first_ball\r\n\t\t# \tputs out_game[i].first_ball\r\n\t\t# end\r\n\t\tgame.each_with_index do|frame, index|\r\n\t\t\tframe.score_keeping(index, out_game, @pre)\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "5ca9b5a0219364751560a69e9b0af8c0",
"score": "0.6039432",
"text": "def create_frame\n frames.last.copy\n end",
"title": ""
},
{
"docid": "73c22e7abfbb3651dbd8096a6eb2c809",
"score": "0.6016791",
"text": "def constructor\n FrameConstructor.new(probe)\n end",
"title": ""
},
{
"docid": "2c37c116918b6bd1cca9b458ab95d693",
"score": "0.57543224",
"text": "def initialize path_or_object\n if path_or_object.kind_of?(Avi)\n @avi = path_or_object\n else\n unless AviGlitch::Base.surely_formatted? path_or_object\n raise 'Unsupported file passed.'\n end\n @avi = Avi.new path_or_object\n end\n @frames = Frames.new @avi\n end",
"title": ""
},
{
"docid": "b69568b6b55c75abaaa6a23223b4773d",
"score": "0.5711057",
"text": "def frames_actor(options = {})\n opts = options.dup\n opts[:repl] = self\n MozRepl::Actor::Frames.new opts\n end",
"title": ""
},
{
"docid": "f7545b314bbb0bbe9c2c28422195d0da",
"score": "0.5621326",
"text": "def create_default_frames\n 1.upto(11) do |frame_number|\n frames.create(number: frame_number)\n end\n\n update_columns(current_frame_id: frames.first.id)\n end",
"title": ""
},
{
"docid": "c0089d457c0ce62bfba48dd6e3f34dd7",
"score": "0.5598845",
"text": "def initialize(frame)\n @raw_frame = frame\n end",
"title": ""
},
{
"docid": "795844506fea1999af121d4ff3faa7e4",
"score": "0.55857223",
"text": "def new_frame( cfg, prefix = nil )\n keys = cfg.__desc.keys.map {|k| k.to_s}\n keys.sort!\n keys.map! {|k| k.to_sym}\n\n Frame.new(cfg, prefix.to_s, keys, 0)\n end",
"title": ""
},
{
"docid": "6d39e70ab02bda555ec8730e2ae26b6f",
"score": "0.5569704",
"text": "def init_frame\n @av_frame = FFI::FFmpeg.avcodec_alloc_frame\n\n if @av_frame.to_i < 0\n raise NoMemoryError, 'avcodec_alloc_frame() failed'\n end\n\n @av_frame = FFI::FFmpeg::AVFrame.new(@av_frame)\n end",
"title": ""
},
{
"docid": "1226b747de0b22a677292d93c998ef56",
"score": "0.5565269",
"text": "def frame_at(index)\n return Frame.new(frame_number: 0) if index < 0 || index >= frames.size\n frames[index]\n end",
"title": ""
},
{
"docid": "53f493432a908c54f854a6bb8f13ec93",
"score": "0.5564855",
"text": "def create_frames(url)\n @gifm = MiniMagick::Image.open(url)\n @gifm.frames.each_with_index do |frame, idx|\n frame.write(\"images/frame#{idx}.jpg\")\n end\n preview(url)\n end",
"title": ""
},
{
"docid": "69aa8d1e3232dc0abbfa85a3ae9cafd9",
"score": "0.54989594",
"text": "def frame(how, what = nil)\n how, what = process_default :name, how, what\n return Frame.new(self, how, what)\n end",
"title": ""
},
{
"docid": "b5688a7c83da50d9878f98e8595118be",
"score": "0.5480203",
"text": "def initalize(index, x, y, width, height, name)\n super `new Phaser.Frame(index, x, width, height, name)`\n end",
"title": ""
},
{
"docid": "ba975d2e59941266d72a354fe44aa4b8",
"score": "0.5474289",
"text": "def create_frame(last_frame=nil, score)\n number = 1\n if last_frame\n last_frame.handle_spare(score)\n last_frame.handle_strike(score)\n number += last_frame.number\n end\n f = Frame.new(:game_id => self.id, :score => score, :number => number)\n if score == 10\n f.is_over = true\n f.strike = true\n end\n f.save\n end",
"title": ""
},
{
"docid": "1b2673437a106e95036f65ae90b5c462",
"score": "0.54652566",
"text": "def add_frame\n @frame = Frame.new(player: player)\n if player.frames.count == 10\n @frame.destroy\n elsif player.frames.count >= 1\n increment_frame_number\n else\n @frame.frame_number = 1\n @frame if @frame.save\n end\n end",
"title": ""
},
{
"docid": "cfa364f0dc972089b4182eb1bf8400d1",
"score": "0.54607326",
"text": "def frame( frameName)\n @frame = frameName\n return self\n end",
"title": ""
},
{
"docid": "6e4b11e9cf3691ca8852b5b671c5490e",
"score": "0.54386",
"text": "def initialize(args)\n @frames = []\n @bonus_shots = []\n \n marks = args.split(\",\").map { |x| x.to_i }\n \n i = 0\n while i < marks.length && @frames.length < 10\n shot1 = marks[i]\n i = i + 1\n \n # If it is a strike or incomplete frame\n if shot1 == 10 || i >= marks.length\n shot2 = 0\n else\n shot2 = marks[i]\n i = i + 1\n end\n frame = Frame.new shot1, shot2\n \n @frames << frame\n end\n \n # If last frame is spare, only has 1 bonus shot.\n # If last frame is strike, 2 bonus shots.\n # ignore the rest of the marks\n if @frames.length == 10\n if (@frames[9].is_spare || @frames[9].is_strike) && i < marks.length\n @bonus_shots << marks[i]\n i = i + 1\n end\n if @frames[9].is_strike && i < marks.length\n @bonus_shots << marks[i]\n end\n end\n end",
"title": ""
},
{
"docid": "5ffc087b6bfeb2d2ac9e343a72f85681",
"score": "0.54166526",
"text": "def create\n @frame = Frame.new(params[:frame])\n\n respond_to do |format|\n if @frame.save\n format.html { redirect_to(@frame, :notice => 'Frame was successfully created.') }\n format.xml { render :xml => @frame, :status => :created, :location => @frame }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @frame.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c2cbb72824089878c5b1f17e04b2dddb",
"score": "0.54023",
"text": "def initialize\n self.frames = []\n self.options = {\n ignore_caret: false,\n ignore_mismatch: false\n }\n reset_for_fullscreen\n end",
"title": ""
},
{
"docid": "be6d6b6417eb4e1f076f78650e3d718b",
"score": "0.5369247",
"text": "def find_or_create_current_frame\n add_frame unless find_current_frame\n @frame\n end",
"title": ""
},
{
"docid": "1623e142326cc1d25c6034e50edb23c9",
"score": "0.5360461",
"text": "def frames; end",
"title": ""
},
{
"docid": "1623e142326cc1d25c6034e50edb23c9",
"score": "0.5360461",
"text": "def frames; end",
"title": ""
},
{
"docid": "5bb01dc6c84743ac307ff30867497be1",
"score": "0.535664",
"text": "def frame(how, what = nil)\n locate if defined?(locate)\n if(what == nil)\n what = how\n how = :name\n end\n Frame.new(self, how, what)\n end",
"title": ""
},
{
"docid": "2f99afc4eab1fed9498c1ee95ad54415",
"score": "0.535662",
"text": "def initialize\n @delay = DEF_DELAY\n @ttl = DEF_TTL\n @channel = DEF_PRI\n\n @frames = [] #empty anim\n @timestamp = Time.now.to_i #creation timestamp\n end",
"title": ""
},
{
"docid": "aaca654584ad32c179282c4c475bb762",
"score": "0.5348902",
"text": "def frames=(_arg0); end",
"title": ""
},
{
"docid": "4fecd86bd249ef1ad671080add1f45d0",
"score": "0.532467",
"text": "def add_frame(*frames)\n self.frames.concat frames.flatten\n end",
"title": ""
},
{
"docid": "3035499b4163d73de77db27420332c69",
"score": "0.5315233",
"text": "def new_frame\n raise self.inspect\n end",
"title": ""
},
{
"docid": "67ac981c758aad14f957203ee8c5d39f",
"score": "0.52982587",
"text": "def initialize(p={})\n # Create our frame and alloc space for the frame data\n @av_frame = AVFrame.new\n\n @stream = p[:stream]\n @av_frame[:width] = p[:width] || @stream && @stream.width\n @av_frame[:height] = p[:height] || @stream && @stream.height\n @av_frame[:format] = p[:pixel_format] || @stream && @stream.pixel_format\n\n # Allocate the frame's data unless the caller doesn't want us to.\n unless p[:alloc] == false\n av_picture = AVPicture.new @av_frame.pointer\n avpicture_alloc(av_picture, @av_frame[:format], @av_frame[:width],\n @av_frame[:height])\n ObjectSpace.define_finalizer(self, cleanup_proc(av_picture))\n end\n end",
"title": ""
},
{
"docid": "e1efeedb5598b9d7166401807eaaa7a3",
"score": "0.52875614",
"text": "def get_v23_frame(** kwargs)\n new_kwargs = {}\n self.class::FRAMESPEC.each do |checker|\n name = checker.name\n value = instance_variable_get(\"@#{name}\")\n new_kwargs[name.to_sym] = checker._validate23(self, value, ** kwargs)\n end\n self.class.new(** new_kwargs)\n end",
"title": ""
},
{
"docid": "3c8b35d3cdde62982efcc2b67daa9c04",
"score": "0.5284148",
"text": "def frame(how, what = nil)\r\n locate if defined?(locate)\r\n if(what == nil)\r\n what = how\r\n how = :name\r\n end\r\n Frame.new(self, how, what)\r\n end",
"title": ""
},
{
"docid": "a9478483543775a31e3eb9850da04173",
"score": "0.52761954",
"text": "def create_frames(n)\n r = []\n n.times { r << create_frame }\n r\n end",
"title": ""
},
{
"docid": "2e0d59d41854f60c22f8c0d3435df5fd",
"score": "0.5273463",
"text": "def new\n @bowling_game = BowlingGame.new\n 10.times {@bowling_game.frames.build }\n 3.times { @bowling_game.comments.build }\n end",
"title": ""
},
{
"docid": "5180f418354be8c8f852a01e37e1d8b1",
"score": "0.52717304",
"text": "def new_from_frames(range)\t\t\t\t\r\n new_animation = self.dup\r\n new_animation.frames = []\r\n range.each do |nr|\r\n new_animation.frames << self.frames[nr]\r\n end\r\n return new_animation\r\n end",
"title": ""
},
{
"docid": "56e4132e8c737e83551f3d89ce4de5b5",
"score": "0.5269215",
"text": "def frame\n @frame = @player.getCurrentFrame(@player.frames)\n json_response(@frame)\n end",
"title": ""
},
{
"docid": "08c4dd16255194f2882c261f61214997",
"score": "0.52631736",
"text": "def new_irb_frame()\n @frame_count += 1\n begin\n jri_internal_frame = TextPaneIFrame.new(@xstart + (@frame_count * 10), @ystart + (@frame_count * 10))\n\n jriDesktopPane.add(jri_internal_frame, javax.swing.JLayeredPane::DEFAULT_LAYER)\n\n jriDesktopPane.setSelectedFrame(jri_internal_frame)\n\n worker = JRubyInteractiveWorker.new(jri_internal_frame.jri_text_pane)\n\n listener = RubyPropertyListener.new(self)\n\n worker.addPropertyChangeListener( listener )\n\n @workers[jri_internal_frame] = worker\n\n worker.execute()\n rescue => e\n puts \"ERROR\", e, e.backtrace\n end\n end",
"title": ""
},
{
"docid": "3c080380768a3d611f43d00972172efa",
"score": "0.52347356",
"text": "def b_frames(frames)\n FFMpegCommand << \"-bf #{frames}\"\n end",
"title": ""
},
{
"docid": "661912dc65c51e96a64d8f2c2b1e706a",
"score": "0.5219649",
"text": "def frame(id)\n @frames[id]\n end",
"title": ""
},
{
"docid": "c579f1fdd65cff1a8211a247bbf3d2c5",
"score": "0.52063644",
"text": "def frame_class(frame_position = 0)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "db0207b7c549387f98c8d2eb081745d0",
"score": "0.52057666",
"text": "def get_frames()\n @frames.each_with_index{ |frame, i|\n\n # Create new frame instances for position object.\n @position_data[i] = {}\n\n ball_hit = false\n ball_spawned = false\n\n lowest_dist = 2000000\n lowest_dist_player = nil\n\n # Get new actors.\n spawned = frame['Spawned'] if frame['Spawned']\n\n # Get updated actors.\n updated = frame['Updated'] if frame['Updated']\n\n # Get deleted actors.\n deleted = frame['Destroyed'] if frame['Destoryed']\n\n handle_spawned_actors(spawned, i) if spawned\n handle_updated_actors(updated, i) if updated\n handle_deleted_actors(deleted, i) if deleted\n handle_merged_actors(spawned.merge(updated), i)\n }\n end",
"title": ""
},
{
"docid": "38c2cd4e812748c42139487811baf767",
"score": "0.5189248",
"text": "def generate_frames\n i, frame_count = 0, 1\n while(i < @score_sequence.size) do\n if frame_count <= FRAME_COUNT\n offset = get_frame_size(i, frame_count == FRAME_COUNT)\n add_frame(i, offset)\n i += offset + 1\n frame_count += 1\n else\n #raising error if number of scores on the line is invalid\n raise GameException.new, \"Invalid Input: More than #{ FRAME_COUNT } frames\"\n end\n end\n end",
"title": ""
},
{
"docid": "b261da40294cba7c07ecb5268fcea117",
"score": "0.51766264",
"text": "def initialize(frame, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "03a304d95b665e30484114995881a15f",
"score": "0.51729256",
"text": "def set_frame(new_frame = 0)\n return if frame_number == 0\n @frame = new_frame%frame_number\n @picture.bitmap = Cache.battleback(@bitmaps[@frame])\n @frame_state = 0\n end",
"title": ""
},
{
"docid": "9ab18fe84733e037a1849a7bc6bfff56",
"score": "0.5165573",
"text": "def initialize\n @frame_count = 0\n set_time(9, 00)\n end",
"title": ""
},
{
"docid": "b841773a388bf12f2cb0555b4b9a8c09",
"score": "0.516379",
"text": "def initialize(msg_frames = [])\n @msg_frames = msg_frames\n end",
"title": ""
},
{
"docid": "211a562a7514ebbbe394e5dc37065345",
"score": "0.5152694",
"text": "def get_frame_for(array)\n if !(f = (array.instance_variable_get(:@isrb_frame)))\n f = ImagePanel.createFrame()\n array.instance_variable_set(:@isrb_frame, f)\n end\n f.enclosingFrame().setVisible(true)\n f\n end",
"title": ""
},
{
"docid": "c152c4084df30a027df350ad946e001e",
"score": "0.51417845",
"text": "def to_frame_objects(data)\n data.map { |frame| Frame.new(frame) }\n end",
"title": ""
},
{
"docid": "b57234c28890912a2b9640d96c78b04b",
"score": "0.512847",
"text": "def toFrame(frame)\n # checks if specified string parameter\n if frame.is_a?(String)\n if frame == \"last\"\n frame = @totalFrames - 1\n else\n frame = 0\n end\n end\n # sets frame\n frame = @totalFrames - 1 if frame >= @totalFrames\n frame = 0 if frame < 0\n @currentIndex = frame\n # draws frame\n @actualBitmap.clear\n x, y, w, h = self.box\n @actualBitmap.stretch_blt(Rect.new(x,y,w,h), @bitmap, Rect.new(@currentIndex*(@width/@scale)+x/@scale, y/@scale, w/@scale, h/@scale))\n end",
"title": ""
},
{
"docid": "62fa3ae98158913929469de36745a607",
"score": "0.5081082",
"text": "def create\n StatsManager::StatsD.time(Settings::StatsConstants.api['frame']['create']) do\n return render_error(404, \"this route is for jsonp only.\") if request.get? and !params[:callback]\n\n roll = Roll.find(params[:roll_id])\n return render_error(404, \"could not find that roll\") unless roll\n\n #on success, always want to render the full resulting Frame\n @include_frame_children = true\n\n # create frame from a video url\n if video_url = params[:url]\n\n frame_options = {}\n\n if is_implict_like = (current_user.watch_later_roll == roll)\n # old client trying to do a like. this should now be a light_weight share on the user's public roll\n roll = current_user.public_roll\n frame_options[:frame_type] = Frame::FRAME_TYPE[:light_weight]\n end\n\n frame_options[:creator] = current_user\n frame_options[:roll] = roll\n\n # get or create video from url\n video = frame_options[:video] = GT::VideoManager.get_or_create_videos_for_url(video_url)[:videos][0]\n\n # create message\n if params[:text]\n frame_options[:message] = GT::MessageManager.build_message(:user => current_user, :public => true, :text => CGI::unescape(params[:text]))\n end\n\n # set the action, defaults to new_bookmark_frame\n case params[:source]\n when \"bookmarklet\"\n frame_options[:action] = DashboardEntry::ENTRY_TYPE[:new_bookmark_frame]\n\n # track rolling from the bookmarklet in KissMetrics\n ShelbyGT_EM.next_tick { APIClients::KissMetrics.identify_and_record(current_user, Settings::KissMetrics.metric['roll_frame']['bookmarklet']) }\n when \"extension\"\n frame_options[:action] = DashboardEntry::ENTRY_TYPE[:new_bookmark_frame]\n\n # track rolling from the extension in KissMetrics\n ShelbyGT_EM.next_tick { APIClients::KissMetrics.identify_and_record(current_user, Settings::KissMetrics.metric['roll_frame']['extension']) }\n when \"webapp\"\n frame_options[:action] = DashboardEntry::ENTRY_TYPE[:new_in_app_frame]\n when nil, \"\"\n frame_options[:action] = DashboardEntry::ENTRY_TYPE[:new_bookmark_frame]\n else\n return render_error(404, \"that action isn't cool.\")\n end\n\n # only allow roll creation if user is authorized to access the given roll\n if roll.postable_by?(current_user)\n # and finally create the frame\n # creating dashboard entries async.\n frame_options[:async_dashboard_entries] = true\n frame_options[:original_source_url] = params[:original_source_url] if params[:original_source_url]\n\n r = frame_options[:video] ? GT::Framer.create_frame(frame_options) : {}\n\n if @frame = r[:frame]\n # increment like counts and record VideoLiker if this was an implicit like/ligh_weight share\n if is_implict_like\n video.like!(current_user)\n end\n\n # process frame message hashtags in a non-blocking manor\n ShelbyGT_EM.next_tick { GT::HashtagProcessor.process_frame_message_hashtags_for_channels(@frame) }\n\n if current_user.user_type != User::USER_TYPE[:service]\n if [Roll::TYPES[:special_public_real_user], Roll::TYPES[:user_public], Roll::TYPES[:global_public]].include?(roll.roll_type)\n # if this is a real human shelby user rolling to a public roll,\n # add the new frame to the community channel in a non-blocking manner\n ShelbyGT_EM.next_tick { @frame.add_to_community_channel }\n end\n # if this is a real human shelby user, send events to Google Analytics to track which\n # hashtags are being used, in a non-blocking manner\n ShelbyGT_EM.next_tick { GT::HashtagProcessor.process_frame_message_hashtags_send_to_google_analytics(@frame) }\n end\n\n @status = 200\n else\n return render_error(404, \"Sorry, but something went wrong trying add that video.\")\n end\n\n else\n return render_error(403, \"that user cant post to that roll\")\n end\n\n # create a new frame by re-rolling a frame from a frame_id\n elsif params[:frame_id] and ( frame_to_re_roll = Frame.find(params[:frame_id]) )\n\n begin\n # only allow roll creation if user is authorized to access the given roll\n if roll.postable_by?(current_user)\n #do the re rolling\n res = frame_to_re_roll.re_roll(current_user, roll)\n @frame = res[:frame]\n StatsManager::StatsD.increment(Settings::StatsConstants.frame['re_roll'])\n\n if params[:text]\n @frame.conversation.messages << GT::MessageManager.build_message(:user => current_user, :public => true, :text => CGI::unescape(params[:text]))\n @frame.conversation.save\n end\n\n # send email notification in a non-blocking manor\n ShelbyGT_EM.next_tick { GT::NotificationManager.check_and_send_reroll_notification(frame_to_re_roll, @frame) }\n\n # NOT sending OG action to FB for roll POST spring cleaning\n #ShelbyGT_EM.next_tick { GT::OpenGraph.send_action('roll', current_user, @frame) }\n\n # process frame message hashtags in a non-blocking manor\n ShelbyGT_EM.next_tick { GT::HashtagProcessor.process_frame_message_hashtags_for_channels(@frame) }\n\n if current_user.user_type != User::USER_TYPE[:service]\n if [Roll::TYPES[:special_public_real_user], Roll::TYPES[:user_public], Roll::TYPES[:global_public]].include?(roll.roll_type)\n # if this is a real human shelby user rolling to a public roll,\n # add the new frame to the community channel in a non-blocking manner\n ShelbyGT_EM.next_tick { @frame.add_to_community_channel }\n end\n # if this is a real human shelby user, send events to Google Analytics to track which\n # hashtags are being used, in a non-blocking manner\n ShelbyGT_EM.next_tick { GT::HashtagProcessor.process_frame_message_hashtags_send_to_google_analytics(@frame) }\n end\n\n @status = 200\n else\n return render_error(403, \"that user cant post to that roll\")\n end\n rescue => e\n return render_error(404, \"could not re_roll: #{e}\")\n end\n\n else\n\n return render_error(404, \"failed to re-roll frame from id.\")\n\n end\n\n # A Frame was rolled, track that user action\n GT::UserActionManager.frame_rolled!(current_user.id, @frame.id, @frame.video_id, @frame.roll_id)\n\n end\n end",
"title": ""
},
{
"docid": "eedee25d7a94c4ba828c14e6d5f50d22",
"score": "0.50663",
"text": "def getFrame(frames_to_shift)\n adjustment_for_frame_indexing = 1\n game.frames[game.current_frame + frames_to_shift - adjustment_for_frame_indexing]\n end",
"title": ""
},
{
"docid": "cd2b96d59985863df8c0285ff247e259",
"score": "0.5060358",
"text": "def frames\n latest_frames = Array.new(@frames.length)\n ptr = @frame_ptr + 1\n @frames.length.times do |i|\n frame = @frames[ptr % @frames.length]\n latest_frames[i] = frame unless frame.nil?\n ptr += 1\n end\n latest_frames\n end",
"title": ""
},
{
"docid": "4b961f740f060e07916adc62e605cea2",
"score": "0.50551873",
"text": "def with_animation(name, frame_indexes, options = {})\n @animations[name] = Animation.new(name, frame_indexes, options)\n @current_animation = @animations[name] if @current_animation.nil?\n self\n end",
"title": ""
},
{
"docid": "5d3a43c47e99ec4c4798c964ecbd95cb",
"score": "0.50527763",
"text": "def frame_table\n return @frame_table unless @frame_table.nil?\n _pos = @_io.pos\n @_io.seek(frame_table_ofs)\n @_raw_frame_table = @_io.read_bytes(frame_table_len)\n _io__raw_frame_table = Kaitai::Struct::Stream.new(@_raw_frame_table)\n @frame_table = FrameIndex.new(_io__raw_frame_table, self, @_root)\n @_io.seek(_pos)\n @frame_table\n end",
"title": ""
},
{
"docid": "a6b55ec837b42f81b7759fa728fb2b2f",
"score": "0.50507236",
"text": "def create\n @frame = Frame.new(frame_params)\n @frame.try1 = 0\n @frame.try2 = 0\n @frame.total = 0\n @frame.game_id = session[:player_id] \n @frame.completed = false\n @frame.number = 1\n\n respond_to do |format|\n if @frame.save\n format.html { redirect_to @frame, notice: 'Frame was successfully created.' }\n format.json { render action: 'show', status: :created, location: @frame }\n else\n format.html { render action: 'new' }\n format.json { render json: @frame.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a34e227950be79c9d074e33cac87eaa",
"score": "0.5041683",
"text": "def frames\n roll_index = 0\n frames = []\n NUMBER_OF_FRAMES.times do |i|\n frames << frame(roll_index)\n # Polymorphism: Frames could be a Strike or a Spare, both of which have a number_of_rolls method\n # Spare has 2 rolls and Strike has 1 roll\n is_last_frame = i.eql?(NUMBER_OF_FRAMES - 1) # Last frame gets bonus roll(s)\n roll_index += frames.last.number_of_rolls(is_last_frame)\n end\n frames\n end",
"title": ""
},
{
"docid": "3c4aa55e5ae7592ec4aef9891e371382",
"score": "0.5041186",
"text": "def frames= other\n raise TypeError unless other.kind_of?(Frames)\n @frames.clear\n @frames.concat other\n end",
"title": ""
},
{
"docid": "5847e75f7cd3cf1d196d000ac2735dbb",
"score": "0.50225013",
"text": "def to_frame(frame)\n # checks if specified string parameter\n if frame.is_a?(String)\n if frame == \"last\"\n frame = @totalFrames - 1\n else\n frame = 0\n end\n end\n # sets frame\n frame = @totalFrames - 1 if frame >= @totalFrames\n frame = 0 if frame < 0\n @currentIndex = frame\n end",
"title": ""
},
{
"docid": "335c4075b828ad97b994c305ab808358",
"score": "0.5015378",
"text": "def initialize(ary)\n formated_ary = if ary.first.is_a? String\n ary.map{ |e| e == \"X\" ? [10, nil] : (e == \"/\" ? [5,5] : e.split(',').map(&:to_i) ) }\n else\n ary\n end\n self.frames = formated_ary.map{ |e| Frame.new(e) }\n self.frames.each_with_index{ |frame, index| frame.sig = self.frames[index + 1] if index <= 10 }\n end",
"title": ""
},
{
"docid": "4af0bae8ac046099de763415662845f7",
"score": "0.5008822",
"text": "def new\n @frame = Frame.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @frame }\n end\n end",
"title": ""
},
{
"docid": "bdd6d18aa0bc1c2382a08a376cc8d47e",
"score": "0.4998772",
"text": "def build(args={})\n klass = FRAME_TYPE_MAP[args[:type].to_i]\n if(klass == FrameType::Response)\n klass.new(:response => args[:data])\n elsif(klass == FrameType::Error)\n klass.new(:error => args[:data])\n elsif(klass == FrameType::Message)\n unpacked = args[:data].unpack(\"Q>s>a16a#{args[:size]}\")\n klass.new(\n Hash[*([:timestamp, :attempts, :message_id, :message].zip(unpacked).flatten)]\n )\n else\n raise TypeError.new \"Unknown frame type received: #{args[:type].inspect} - #{klass.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "fa603d4faff8d77adba3412bc06a455d",
"score": "0.49870384",
"text": "def initialize(player)\n @player = player\n @current_frame = player.frames.last\n end",
"title": ""
},
{
"docid": "09c872cf8a06b91f0de2972dda62be8d",
"score": "0.49861026",
"text": "def frame_names=(names)\r\n names.each do |key, value|\r\n @sub_animations[key] = self.new_from_frames(value) if value.is_a? Range\r\n @sub_animations[key] = @frames[value] if value.is_a? Fixnum\r\n #\r\n # TODO: Add support for [1,4,5] array frame selection\r\n #\r\n # @frame_names[key] = self.new_from_frames(value) if value.is_a? Array\r\n end\r\n end",
"title": ""
},
{
"docid": "64b5f1cf5809f1723b0fd3e7a764f534",
"score": "0.49772444",
"text": "def set_frame\n @frame = Frame.find(params[:id])\n end",
"title": ""
},
{
"docid": "64b5f1cf5809f1723b0fd3e7a764f534",
"score": "0.49772444",
"text": "def set_frame\n @frame = Frame.find(params[:id])\n end",
"title": ""
},
{
"docid": "207c70ceb9b0bdeac5395d147d0fd518",
"score": "0.49723744",
"text": "def set_frame\n frames = @animations[@playing_animation]\n case frames\n when Range\n reset_clipping_rect\n @clip_x = @current_frame * @clip_width\n when Array\n f = frames[@current_frame]\n @clip_x = f[:x] || @defaults[:clip_x]\n @clip_y = f[:y] || @defaults[:clip_y]\n @clip_width = f[:width] || @defaults[:clip_width]\n @clip_height = f[:height] || @defaults[:clip_height]\n @frame_time = f[:time] || @defaults[:frame_time]\n end\n end",
"title": ""
},
{
"docid": "207c70ceb9b0bdeac5395d147d0fd518",
"score": "0.49723744",
"text": "def set_frame\n frames = @animations[@playing_animation]\n case frames\n when Range\n reset_clipping_rect\n @clip_x = @current_frame * @clip_width\n when Array\n f = frames[@current_frame]\n @clip_x = f[:x] || @defaults[:clip_x]\n @clip_y = f[:y] || @defaults[:clip_y]\n @clip_width = f[:width] || @defaults[:clip_width]\n @clip_height = f[:height] || @defaults[:clip_height]\n @frame_time = f[:time] || @defaults[:frame_time]\n end\n end",
"title": ""
},
{
"docid": "7bc6a30fcf9b83bae625531206014dc3",
"score": "0.49564058",
"text": "def create_game_frame(width,height)\n splash = ConsoleSplash.new(height, width)\n\n #Surrounding the game frame with fancy stylized symbols\n splash.write_horizontal_pattern(\"~-~\", {:fg=>:red, :bg=>:white})\n splash.write_left_pattern(\"<\", {:fg=>:red, :bg=>:white})\n splash.write_right_pattern(\">\", {:fg=>:red, :bg=>:white})\n\n return splash\nend",
"title": ""
},
{
"docid": "4acca08fb0483104467c9eec92084449",
"score": "0.49400848",
"text": "def initialize(options)\n @cap = options[:capture] || VideoCapture.new(options['source'] || 0)\n\n # Preemptively instantiate the image object we'll use.\n # This speeds up the process considerably, as memory\n # re-allocation doesn't happen very often if we do.\n @frame = Image.new\n end",
"title": ""
},
{
"docid": "6a74307230e8c26a305db88e211f0fb1",
"score": "0.49345824",
"text": "def create\n @picture_frame = PictureFrame.new(picture_frame_params)\n\n respond_to do |format|\n if @picture_frame.save\n format.html { redirect_to @picture_frame, notice: 'Picture frame was successfully created.' }\n format.json { render :show, status: :created, location: @picture_frame }\n else\n format.html { render :new }\n format.json { render json: @picture_frame.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2b47bbd5f7eff138cb348d79961955c2",
"score": "0.49274963",
"text": "def video_frames(number)\n FFMpegCommand << \"-vframes #{number}\"\n end",
"title": ""
},
{
"docid": "17693ba81b4069dbe2de3950f564f2bd",
"score": "0.4923729",
"text": "def initialize\n\t\t@type = nil\n\t\t@frame_ids = []\n\n\t\tyield( self ) if block_given?\n\tend",
"title": ""
},
{
"docid": "525c06ea4053a4f04c72dd12b265136f",
"score": "0.49154004",
"text": "def new\n @videogame = Videogame.new\n end",
"title": ""
},
{
"docid": "9d214e8cb49051f42ebead727e631a3d",
"score": "0.49135453",
"text": "def create\n @frame_model = FrameModel.new(params[:frame_model])\n\n respond_to do |format|\n if @frame_model.save\n format.html { redirect_to(@frame_model, :notice => 'Frame model was successfully created.') }\n format.xml { render :xml => @frame_model, :status => :created, :location => @frame_model }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @frame_model.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9aba5f83bb2a842ef5ae5b999c27cc7",
"score": "0.49080774",
"text": "def frames_to_record(frames)\n FFMpegCommand << \"-dframes #{frames}\"\n end",
"title": ""
},
{
"docid": "1a396eb575c03c6491aa41799376e922",
"score": "0.49053505",
"text": "def frames_flip_horizontal!(frames)\r\n # Get Frame Width\r\n frame_width = width / frames\r\n # Create A Frame Dummy Bitmap\r\n frame_bitmap = Bitmap.new(frame_width, height)\r\n # Create Rect\r\n rect = Rect.new(0, 0, frame_width, height)\r\n # Do Frames times\r\n frames.times do |i|\r\n # Clear Bitmap\r\n frame_bitmap.clear\r\n # Get X\r\n x = i * frame_width\r\n # Set Rect.x\r\n rect.x = x\r\n # Draw Piece of Bitmap onto dummy\r\n frame_bitmap.blt(0, 0, self, rect)\r\n # Flip Horizontally\r\n frame_bitmap.flip_horizontal!\r\n # Draw Onto Self\r\n blt(x, 0, frame_bitmap, frame_bitmap.rect)\r\n end\r\n # Dispose Dummy Bitmap\r\n frame_bitmap.dispose\r\n end",
"title": ""
},
{
"docid": "b3953c093b90c8a0c3b51b30ce847535",
"score": "0.4903043",
"text": "def initialize(fps)\n @fps = fps\n end",
"title": ""
},
{
"docid": "b41174d669f822151d7fc1c6597f457d",
"score": "0.4886353",
"text": "def frames_flip_vertical!(frames)\r\n # Get Frame Height\r\n frame_height = height / frames\r\n # Create A Frame Dummy Bitmap\r\n frame_bitmap = Bitmap.new(width, frame_height)\r\n # Create Rect\r\n rect = Rect.new(0, 0, width, frame_height)\r\n # Do Frames times\r\n frames.times do |i|\r\n # Clear Bitmap\r\n frame_bitmap.clear\r\n # Get Y\r\n y = i * frame_height\r\n # Set Rect.y\r\n rect.y = y\r\n # Draw Piece Of Bitmap onto Dummy\r\n frame_bitmap.blt(0, 0, self, rect)\r\n # Flip Vertically\r\n frame_bitmap.flip_vertical!\r\n # Draw onto Self\r\n blt(0, y, frame_bitmap, frame_bitmap.rect)\r\n end\r\n # Dispose Dummy Bitmap\r\n frame_bitmap.dispose\r\n end",
"title": ""
},
{
"docid": "1495d51092c32ef1c6101a45221f5c07",
"score": "0.48857397",
"text": "def initialize(hash)\n @index = hash[:index]\n @codec_name = hash[:codec_name]\n @codec_long_name = hash[:codec_long_name]\n @codec_tag = hash[:codec_tag]\n @codec_tag_string = hash[:codec_tag_string]\n @codec_profile = hash[:profile]\n @codec_time_base = Rational(hash[:codec_time_base])\n @width = hash[:width].to_i\n @height = hash[:height].to_i\n @b_frames = hash[:has_b_frames].to_i\n @sample_aspect_ratio = hash[:sample_aspect_ratio]\n @display_aspect_ratio = hash[:display_aspect_ratio]\n @pix_fmt = hash[:pix_fmt]\n @r_frame_rate = Rational(hash[:r_frame_rate])\n # For some reason ffmpeg returns a Rational number with a zero in the denominator\n @avg_frame_rate = if hash[:avg_frame_rate] === '0/0'\n Rational(0)\n else\n Rational(hash[:avg_frame_rate])\n end\n @time_base = Rational(hash[:time_base])\n @start_pts = hash[:start_pts].to_i\n @start_time = hash[:start_time].to_f\n @duration_ts = hash[:duration_ts].to_i\n @duration = hash[:duration].to_f\n @bit_rate = hash[:bit_rate].to_i\n @nb_frames = hash[:nb_frames].to_i\n\n @id = hash[:id]\n\n if hash.key?(:tags)\n @language = hash[:tags][:language]\n @rotate = (hash[:tags].key?(:rotate)) ? hash[:tags][:rotate].to_i : nil\n end\n end",
"title": ""
},
{
"docid": "6445652181699c0ccd315c3a00e9b56b",
"score": "0.48850578",
"text": "def create\n respond_to do |format|\n require \"date\"\n if @game = Game.create(:week => Date.commercial(DateTime.now.year, DateTime.now.cweek, d=1))\n (1..11).each do |position|\n @game.frames.create(:position => position)\n end\n @game.active_frame = @game.current_frame = @game.frames.first.id\n if @game.save\n format.html { redirect_to(@game, :notice => 'Game was successfully created.') }\n format.xml { render :xml => @game, :status => :created, :location => @game }\n end\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @game.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "86f8c849879c93f248f67b3e597e394f",
"score": "0.48810503",
"text": "def initialize(x, y)\n\t\tsuper()\n\t\t@last_frame_persist = true # default behavior, use accessor to change\n\t\t@last_frame_loop = false # default behavior, use accessor to change\n\t\t@frame_delay_ms = 150 # default delay, use accessor to change\n\t\t@last_frame_time = 0\n\t\t@frames = load_frames()\n @frames.each { |f| f.set_colorkey(@@bg_color)} \n \tmax_h = @frames.map{|i| i.h}.max # find height of tallest frame\n max_w = @frames.map{|i| i.w}.max # find width of widest frame\n \t@rect = Rect.new(x,y, max_w, max_h)\n \t@collision_rect_padding_x = 0 # default is no padding\n \t@collision_rect_padding_y = 0 # default is no padding\n \t@current_frame = 0 # frame counter\n \t@ay = GRAVITY_VACCEL # everything falls, unless we override \n\t @ax = 0\n\t @vx = 0\n\t @vy = 0\n\tend",
"title": ""
},
{
"docid": "01ba4194640bc00cade745563b30d431",
"score": "0.48722994",
"text": "def create_and_push_frame_manager(bindings, _pry_, options={})\n fm = FrameManager.new(bindings, _pry_)\n frame_hash[_pry_].push fm\n push_helper(fm, options)\n fm\n end",
"title": ""
},
{
"docid": "4797a72a051ba8b2a8cad7b67abaa00c",
"score": "0.4869501",
"text": "def frame_by(id: nil, name: nil, execution_id: nil)\n if id\n @frames[id]\n elsif name\n frames.find { |f| f.name == name }\n elsif execution_id\n frames.find { |f| f.execution_id == execution_id }\n else\n raise ArgumentError\n end\n end",
"title": ""
},
{
"docid": "d4043a813d013c26941409ced2551fdb",
"score": "0.4867876",
"text": "def initialize(options)\r\n #options = {:step => 1, :loop => true, :bounce => false, :width => 32, :height => 32, :index => 0, :delay => 100}.merge(options)\r\n options = {:step => 1, :loop => true, :bounce => false, :index => 0, :delay => 100}.merge(options)\r\n \r\n @loop = options[:loop]\r\n @bounce = options[:bounce]\r\n @file = options[:file]\r\n @index = options[:index]\r\n @delay = options[:delay]\r\n @step = options[:step] || 1\r\n @dt = 0\r\n \r\n @sub_animations = {}\r\n @frame_actions = []\r\n \r\n unless File.exists?(@file)\r\n Gosu::Image.autoload_dirs.each do |autoload_dir|\r\n full_path = File.join(autoload_dir, @file)\r\n if File.exists?(full_path)\r\n @file = full_path\r\n break\r\n end\r\n end\r\n end\r\n \r\n #\r\n # Various ways of determening the framesize\r\n #\r\n if options[:height] && options[:width]\r\n @height = options[:height]\r\n @width = options[:width]\r\n elsif options[:size] && options[:size].is_a?(Array)\r\n @width = options[:size][0]\r\n @height = options[:size][1]\r\n elsif options[:size]\r\n @width = options[:size]\r\n @height = options[:size]\r\n elsif @file =~ /_(\\d+)x(\\d+)/\r\n # Auto-detect width/height from filename \r\n # Tilefile foo_10x25.png would mean frame width 10px and height 25px\r\n @width = $1.to_i\r\n @height = $2.to_i\r\n else\r\n # Assume the shortest side is the width/height for each frame\r\n @image = Gosu::Image.new($window, @file)\r\n @width = @height = (@image.width < @image.height) ? @image.width : @image.height\r\n end\r\n \r\n @frames = Gosu::Image.load_tiles($window, @file, @width, @height, true)\r\n end",
"title": ""
},
{
"docid": "69585f71123ca889bbf44c0d1ed4838f",
"score": "0.48542556",
"text": "def push\n @frames.push({})\n end",
"title": ""
},
{
"docid": "5b46d7292a2762fc37c7c69ec9851025",
"score": "0.4842701",
"text": "def frame(id); end",
"title": ""
},
{
"docid": "a778dc8759bc0bae0ad81d7f0cb6646d",
"score": "0.48395637",
"text": "def populate\n @data = FrameSet.new(@playback)\n @num_frames = @data.size\n add_metadata\n @data\n end",
"title": ""
},
{
"docid": "3d2e04281eae9b9db9e44fd9dc4654f1",
"score": "0.48387808",
"text": "def make_preview(name, frames, start_at = 0)\n old_gif = Magick::Image.read(\"output/#{name}.gif\")\n new_gif = Magick::ImageList.new\n (start_at..start_at + frames).to_a.each do |frame_number|\n new_gif << old_gif[frame_number]\n end\n output_dest = \"output/#{name}-preview.gif\"\n new_gif.write(output_dest)\n puts \"wrote preview to #{output_dest}\" unless @options[:quiet]\n end",
"title": ""
},
{
"docid": "c6b79d9238e36386df737931f2712601",
"score": "0.48352447",
"text": "def frames\n @frames\n end",
"title": ""
},
{
"docid": "09ae29e08cc2ca7347d317dbc2cb2a3f",
"score": "0.483082",
"text": "def initialize(with_fps = DEFAULT_FPS)\n @fps = with_fps\n end",
"title": ""
},
{
"docid": "5114b75c9dc7e3b7789c13c8e4729871",
"score": "0.48306274",
"text": "def initialize(content)\n\n\t\traise ArgumentError, \"Content is nill in TMFrameHeader\" if content.nil?\n\t\tUtils_visiona.verifyLength(\"diff\", content.length, @@exactlyLength)\n\n\t\t@version = Utils_visiona.getBits(content[0], 7, 8)\n\t\t@spacecraftID = (Utils_visiona.getBits(content[0], 1, 6) << 4) + (Utils_visiona.getBits(content[1], 5, 8))\n\t\t@virtualChannelID = Utils_visiona.getBits(content[1], 2, 4)\n\t\t@opCtrlFlag = Utils_visiona.getBits(content[1], 1, 1)\n\t\t@masterChannelFrameCount = content[2]\n\t\t@virtualChannelFrameCount = content[3]\n\t\t@DFHFlag = Utils_visiona.getBits(content[4], 8, 8)\n\t\t@syncFlag = Utils_visiona.getBits(content[4], 7, 7)\n\t\t@pktOrderFlag = Utils_visiona.getBits(content[4], 6, 6)\n\t\t@segmentLengthID = Utils_visiona.getBits(content[4], 4, 5)\n\t\t@firstHeaderPointer = (Utils_visiona.getBits(content[4], 1, 3) << 8) + content[5]\n\t\tvalid?\n\tend",
"title": ""
},
{
"docid": "ed48d9af6110be3b77a22a743980623e",
"score": "0.4829622",
"text": "def to_frames\n self * Rdmx::Animation.fps\n end",
"title": ""
},
{
"docid": "e76ab6e538812ebff3de2c97257e9f68",
"score": "0.4824871",
"text": "def create\n @app_frame = AppFrame.new(app_frame_params)\n\n respond_to do |format|\n if @app_frame.save\n format.html { redirect_to @app_frame, notice: 'App frame was successfully created.' }\n format.json { render :show, status: :created, location: @app_frame }\n else\n format.html { render :new }\n format.json { render json: @app_frame.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "85543e4f547624527ab46f872a677ab0",
"score": "0.4823374",
"text": "def asset_getframe(args = { }, opts = { })\n\n end",
"title": ""
},
{
"docid": "484fd0ee0eef78238d6b0e7c8bb69359",
"score": "0.48199862",
"text": "def initialize(pos, frames)\n super() # Sprite initialization\n @pos = pos\n @frames = frames # Array of Surfaces\n @currentframe = 0 # Incremented every frame\n \n \n update()\n end",
"title": ""
},
{
"docid": "0f5a78e5b4d1e5e2e04a331d455fc5a4",
"score": "0.4815315",
"text": "def push frame\n raise TypeError unless frame.kind_of? Frame\n # data\n this_data = Tempfile.new 'this', binmode: true\n self.frames_data_as_io this_data\n this_size = this_data.size\n this_data.print frame.id\n this_data.print [frame.data.size].pack('V')\n this_data.print frame.data\n this_data.print \"\\000\" if frame.data.size % 2 == 1\n # meta\n @meta << {\n :id => frame.id,\n :flag => frame.flag,\n :offset => this_size + 4, # 4 for 'movi'\n :size => frame.data.size,\n }\n # close\n overwrite this_data\n this_data.close!\n self\n end",
"title": ""
},
{
"docid": "dd916b5609ed0d6492bfd58607a395fa",
"score": "0.48104322",
"text": "def initialize(frame, options={})\n @gapDepth = nil\n super(frame, options)\n @view_3D = View3D.new({:perspective=>30}.merge(options))\n end",
"title": ""
},
{
"docid": "a1709ab43641f19f5e14613a6086c5b0",
"score": "0.48100692",
"text": "def load(filename, known_frames: nil, translate: true, v2_version: 4)\n raise ArgumentError, 'Only 3 and 4 possible for v2_version' unless [3, 4].include? v2_version\n @filename = case filename\n when Hash;\n filename[:filename]\n else\n filename\n end\n @known_frames = known_frames\n @fileobj = File.open(@filename, 'r')\n begin\n load_header\n rescue EOFError\n @size = 0\n raise ID3NoHeaderError, \"#{@filename} too small (#{@fileobj.size} bytes)\"\n rescue ID3NoHeaderError, ID3UnsupportedVersionError => err\n @size = 0\n begin\n @fileobj.seek(-128, IO::SEEK_END)\n rescue Errno::EINVAL\n raise err\n else\n frames = Mutagen::ID3.parse_ID3v1(@fileobj.read(128))\n if frames.nil?\n raise err\n else\n @version = V11\n frames.values.each { |v| add v }\n end\n end\n else\n frames = @known_frames\n if frames.nil?\n if V23 <= @version\n frames = Frames\n elsif V22 <= @version\n frames = Frames_2_2\n end\n end\n data = fullread(@size - 10)\n read_frames(data, frames) do |frame|\n if frame.is_a? ParentFrames::Frame\n add frame\n else\n @unknown_frames << frame\n end\n end\n @unknown_version = @version\n ensure\n @fileobj.close\n @fileobj = nil\n @filesize = nil\n if translate\n (v2_version == 3) ? update_to_v23 : update_to_v24\n end\n end\n end",
"title": ""
}
] |
857c7738075758fcee765fabdbdd8918
|
option 2, view products
|
[
{
"docid": "78d3cd74e5f372f867cfeb97e6b7393e",
"score": "0.0",
"text": "def view_product\n\tsystem \"clear\"\n\n\tif @categories.empty?\n\t\tputs \"********************\"\n\t\tputs \"No products created.\"\n\t\tputs \"********************\\n\\n\"\n\t\tputs \"Go back to the main menu by typing 000 and select option '3' to create a product.\\n\\n\"\n\telse\t\n\t\tputs \"Here's your products.\"\n\t\t@products.each_with_index do |prod, index|\n\t\tputs \"#{index + 1} #{prod.name}\"\n\t\tputs \"(type '000' to go to the main menu)\"\n\t\tprint \"Type the product's serial number view the product's info.\"\n\t\tend\t\n\tend\n\n\tselection = Integer(gets) rescue false\n\n\tif selection == false\n\t puts \"please enter an integer\"\n\t manage_inventory\n\telsif selection == 000\n\t\tsystem\"clear\"\n\t\thome_screen\n\tend\n\n\tproduct_selection = @products[selection-1]\n\tsystem\"clear\"\n\tputs \"Here's that product's info:\"\n\tputs \"Name: #{product_selection.name}\"\n\tputs \"Category: #{product_selection.category}\"\n\tputs \"Serial Number: #{product_selection.serial_number}\"\n\tputs \"Quantity: #{product_selection.quantity}\"\n\tputs \"Cost: $#{'%0.2f'%product_selection.cost}\"\n\tputs \"Sell Price: $#{'%0.2f'%product_selection.sell_price}\"\n\tputs \"***************************\"\n\n\thome_screen\nend",
"title": ""
}
] |
[
{
"docid": "1446314aa3ef08721ea3158f1576e1ff",
"score": "0.78304315",
"text": "def show_products\n\t\tself.products\n\tend",
"title": ""
},
{
"docid": "2b68dd6da7b311294977affe17a2cae6",
"score": "0.7702236",
"text": "def show\n @products = @product_bundle.products\n end",
"title": ""
},
{
"docid": "6fcda6375a532d1d5ed9f39fe5944ebd",
"score": "0.7670987",
"text": "def show\n # find products from params with appropriate ID\n # for example product/(3 = id)\n end",
"title": ""
},
{
"docid": "f390eeb8b9342d81b2762cea14361275",
"score": "0.75771093",
"text": "def show\n set_product\n end",
"title": ""
},
{
"docid": "35e8762a3e5ec46064c9b2d746710271",
"score": "0.75736517",
"text": "def show\n # @products = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "7743a56c15ffa1b546a9df097b06b553",
"score": "0.7564348",
"text": "def view\n\t\t# Use Product model to fetch the product's info\n @product = Product.getProduct(params[:id])\n\t\t\n\tend",
"title": ""
},
{
"docid": "e66272adeee13c8390585e08359e0cff",
"score": "0.7554288",
"text": "def show\n @products = Product.all\n \n end",
"title": ""
},
{
"docid": "9250fc3060dd557eecbe97f9aed11b6c",
"score": "0.75385004",
"text": "def show\n\n # @products = Product.all\n end",
"title": ""
},
{
"docid": "b5992bdde8c462e6ee76934bb5960c97",
"score": "0.7490825",
"text": "def show\n @products = @store.products\n end",
"title": ""
},
{
"docid": "8a2560084b98f8286b26a470d3d969fc",
"score": "0.7452199",
"text": "def show\n @products = Product.all\n end",
"title": ""
},
{
"docid": "8a2560084b98f8286b26a470d3d969fc",
"score": "0.7452199",
"text": "def show\n @products = Product.all\n end",
"title": ""
},
{
"docid": "411b6b30da414808e7b83232c63ee64f",
"score": "0.7437179",
"text": "def show\n @products = Product.all \n end",
"title": ""
},
{
"docid": "cc5deed2aaea2b39030f41702ea6de6d",
"score": "0.73981917",
"text": "def show\n @products = Product.all\n end",
"title": ""
},
{
"docid": "8feb90c2f75da43b3f4cebd8588c9022",
"score": "0.7380093",
"text": "def view_product\n @product = McProduct.find(params[:id])\n end",
"title": ""
},
{
"docid": "5fee10947eab434b96e2f5176ec90363",
"score": "0.7327955",
"text": "def show\n @product = Product.new\n @products = Product.all\n render\n end",
"title": ""
},
{
"docid": "705c30a260ee7977ab04371163203cae",
"score": "0.7256238",
"text": "def show\n @product = Product.find(params[:id])\n @product_options = @product.product_options.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @product }\n end\n end",
"title": ""
},
{
"docid": "507c537114ef1ce80d49edf4a435543e",
"score": "0.7234203",
"text": "def show\n @products = @node.product\n end",
"title": ""
},
{
"docid": "bd7431ea8ba8098a0d3a0f311d128834",
"score": "0.7230199",
"text": "def show\n\t\t@product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "ab23c4392e820f4ecd65cf48af8dd3f8",
"score": "0.7223924",
"text": "def show\n @product = get_prod(params[:id]).first\n end",
"title": ""
},
{
"docid": "a1e747661891f91dfd411483f0c631a5",
"score": "0.7217338",
"text": "def index\n\t\t#@product = ['Procuct 1', 'Product 2']\n\t\t@products = Product.all\n\tend",
"title": ""
},
{
"docid": "3cc9257ac87d12b0133a0b6642db234c",
"score": "0.72115135",
"text": "def show\n @product = Product.find(params[:id])\n\n render :index\n end",
"title": ""
},
{
"docid": "11b79c7c245cb35fa32f1b4842f7b000",
"score": "0.7200508",
"text": "def show\n\t\t@product = Product.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "11b79c7c245cb35fa32f1b4842f7b000",
"score": "0.7200508",
"text": "def show\n\t\t@product = Product.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "11b79c7c245cb35fa32f1b4842f7b000",
"score": "0.7200508",
"text": "def show\n\t\t@product = Product.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "11b79c7c245cb35fa32f1b4842f7b000",
"score": "0.7200508",
"text": "def show\n\t\t@product = Product.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "11b79c7c245cb35fa32f1b4842f7b000",
"score": "0.7200508",
"text": "def show\n\t\t@product = Product.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "92c96d22d2edc343f67270713c729d41",
"score": "0.71938694",
"text": "def show\n \t@product = Product.find_by(id: params[:id])\n end",
"title": ""
},
{
"docid": "a3c29d7956d5ba7abf615ce542ddaf39",
"score": "0.7183616",
"text": "def show\n @product = HTTParty.get(\"http://api.shopstyle.com/api/v2/products/#{params[:id]}?pid=uid5001-30368749-95\")\n end",
"title": ""
},
{
"docid": "bd75537c6ad2c36ae8196b31cdb5fcef",
"score": "0.71531075",
"text": "def show\n\t @product = Product.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "0b685fc6faa596035048eab81ace5b0d",
"score": "0.71510386",
"text": "def show\n\t\tproduct = Product.find_by_id(params[:id])\n\tend",
"title": ""
},
{
"docid": "cfbfc946077a5c9066f26c6c89a89525",
"score": "0.7127471",
"text": "def show\n @product = Product.find_by(id: @tag.product_id)\n end",
"title": ""
},
{
"docid": "9346f55a9deb7d8f7afc67a88f2e3f4b",
"score": "0.7120696",
"text": "def show\n add_breadcrumb \"#{@item.name}\"\n set_meta_tags title: \"#{@item.name} - Departamento | Panel de control\",\n description: \"#{@item.name} - Departamento | Panel de control\"\n @products = @item.products.paginate(page: params[:page], per_page: 20)\n end",
"title": ""
},
{
"docid": "4b4ca13b69f6f559d59390c35d40a6c8",
"score": "0.7101557",
"text": "def show\n unless session[:visitor] == 'admin'\n Galileo.create(:controller => 'product',\n :view => 'show',\n :ip => request.remote_ip,\n :object => params[:id])\n end\n\n @product = HTTParty.get(\"https://openapi.etsy.com/v2/listings/\"+params[:id].to_s+\"?api_key=\"+ENV['ETSY_API'])\n @images = HTTParty.get(\"https://openapi.etsy.com/v2/listings/\"+params[:id].to_s+\"/images?api_key=\"+ENV['ETSY_API'])\n\n # @photo = Photo.where(:product_id => params[:id]).order(:sorting)\n # @product_note = ProductNote.where(:product_id => params[:id])\n\n #redirect_to action: show, id: params[:id], var: ''\n end",
"title": ""
},
{
"docid": "5c9cd4db23a6ecb6631a2ae4d36c4902",
"score": "0.70960885",
"text": "def show\n @product = Product.find_by(params[:product_id])\n end",
"title": ""
},
{
"docid": "f5323201efb510d86cdd85625dc24cbf",
"score": "0.7094907",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "770f7e4b61b19721fcbf869d90e43e19",
"score": "0.7091397",
"text": "def show\n get_cart\n @categories = Category.all\n @product = Product.find(params[:id])\n @category = @product.category\n @currentProduct = @product\n array = [1, 2, 3, 4]\n if array.include?(@category.id)\n @related = []\n @related = @product.get_related\n end\n if @product.name == 'Growers Magic'\n @name = \"Grower's Magic\"\n end\n @description = @product.description\n @products = Product.where(\"name = '#{@product.name}'\")\n end",
"title": ""
},
{
"docid": "cbcb25d0f8a453ce4ec92690d31e13f8",
"score": "0.70910954",
"text": "def showSellerProduct\n @products = Product.where(:customer_id => session[:user_id], active: true)\n render 'sellerproducts'\n end",
"title": ""
},
{
"docid": "9670fdbc97d94b19001a9ab9f36a324c",
"score": "0.7086167",
"text": "def show\n @product = @gateway.product\n end",
"title": ""
},
{
"docid": "9f859745cb28ed45379ca14c6222f8fa",
"score": "0.70861644",
"text": "def detail\n @product = Product.find params[:id]\n @product_colors = @product.product_colors\n @similar_items = @product.similar_items\n @title = @product.name\n render :layout => 'customer'\n end",
"title": ""
},
{
"docid": "384206aa05dacf5ad42da5da1c7a5f29",
"score": "0.70831233",
"text": "def show\n @products=Product.get_products( \"category_ids\" => @shopper.categories.pluck(:id),\n \"zip_code\" => @shopper.zip_code,\n \"distance\" => @shopper.distance,\n \"page\" => params[:page])\n render action: 'index'\n end",
"title": ""
},
{
"docid": "24b7411d49860308c2a0905f55539aeb",
"score": "0.70813394",
"text": "def show\n set_feature\n @product = Product.find(params[:product_id])\n end",
"title": ""
},
{
"docid": "8b54376d850d45533c2c1938dc8351d5",
"score": "0.7074043",
"text": "def show\n @orden = Orden.find(params[:id])\n @customer = @orden.customer\n @motivos =Motivo.all\n @medios = Medio.all\n @marcas= Marca.all \n @versions = Version.all \n @productos = Producto.all \n @ciudad = Ciudad.all\n \n @ordens_products = @orden.orden_products\n end",
"title": ""
},
{
"docid": "0520dc999172f2c3440142307b2ae3fd",
"score": "0.70719284",
"text": "def show\n @user = current_user\n @product = Product.find( params[ :id ] )\n @prod_type = ProdType.find( @product.prod_type_id )\n if @prod_type\n @subproducts = @prod_type.subproducts\n end\n @owner = User.exists?( @product.owner_id ) ? User.find( @product.owner_id ) : nil\n end",
"title": ""
},
{
"docid": "93c1db7703aaf79534f2dafc4ddb8085",
"score": "0.70685637",
"text": "def show\n deprecated_resources = %i(pdrive_folders dropbox_folders pivotal_tracker_ids trello_ids)\n @no_deprecated_resources = deprecated_resources.all? do |res|\n @product.send(res).blank?\n end\n\n @instances = @product.product_instances\n\n @comments = @product.comments.order(:created_at)\n @comment = Comment.new\n\n @master_products = @product.master_products.select('title, products.id')\n @sub_products = @product.sub_products.select('title, products.id')\n\n respond_with(@product)\n end",
"title": ""
},
{
"docid": "eaf4f5e479617552dab8604ff5550767",
"score": "0.7058035",
"text": "def show\n @product = Product.find(params[:id])\n render \"props\"\n end",
"title": ""
},
{
"docid": "6a098dd548dc369451ec522ee90f68de",
"score": "0.7057038",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "e70263d2b44379c308bd5cbfa29de9ee",
"score": "0.70568544",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "1c43f1b12a87973b42e0aaaa089a6a9a",
"score": "0.7055087",
"text": "def show\n\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "16252ce76110fc0915ba0a3264aa4ad4",
"score": "0.70343053",
"text": "def show \n\t\tuser = current_user.user_info\n\t\tproduct = user.products.find(params[:id]) if !user.admin\n\t\tproduct = Product.find(params[:id]) if user.admin\n\t\tp = ShopifyAPI::Product.find product.shopify_id\n\t\tredirect_to 'http://shopulse.myshopify.com/products/'+p.handle\n\tend",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b51a94b8c1477b532a4517509bdd547",
"score": "0.7033033",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "e682b2f8b3c2020e35b12c502b48ca54",
"score": "0.70278716",
"text": "def show\n @product = Product.find_by_permalink(params[:id])\n @product ||= Variant.where(\"replace(sku, '-', '') = ?\", params[:id].no_dashes).first.product\n return unless @product\n\n @variants = Variant.active.includes([:option_values, :images]).where(:product_id => @product.id)\n @product_properties = ProductProperty.includes(:property).where(:product_id => @product.id)\n @selected_variant = @variants.detect { |v| v.available? }\n\n referer = request.env['HTTP_REFERER']\n\n if referer && referer.match(HTTP_REFERER_REGEXP)\n @taxon = Taxon.find_by_permalink($1)\n end\n\n respond_with(@product)\n end",
"title": ""
},
{
"docid": "1ff1ad60d24f9c0e115e8f4ddc6a5eb5",
"score": "0.7022896",
"text": "def show\n @catg_products = Product.where(category: params[:id]).page(params[:page]).per(2)\n end",
"title": ""
},
{
"docid": "29dced29ce65c5f3d3714c5163bf3079",
"score": "0.70187527",
"text": "def show\n @product_model = ProductModel.find(params[:id])\n @products = Product.find_all_by_product_model_id(@product_model)\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @product_model }\n end\n end",
"title": ""
},
{
"docid": "44dd41eb40cf067cf93ae06867bf37a1",
"score": "0.70176286",
"text": "def show\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "2df33f9642b6cdc4ad66cc391dab93f4",
"score": "0.70165217",
"text": "def show\n@product = Product.find(params[:id])\nend",
"title": ""
},
{
"docid": "21402d48d60b95d5af33f6ea400e976d",
"score": "0.70124644",
"text": "def show\n @products = @brunch.products\n end",
"title": ""
},
{
"docid": "e08e9c6425dca0ac821891480d2a148a",
"score": "0.7004112",
"text": "def show\n @is_product = false\n if params[:product_id]\n @product = Product.find(params[:product_id])\n @product_param = ProductParam.find(params[:id])\n @is_product = true\n else\n @order = Order.find(params[:order_id])\n @product_param = ProductParam.find(params[:id])\n end\n end",
"title": ""
},
{
"docid": "9ebb168a06bcb464be663c3275ce415a",
"score": "0.69992745",
"text": "def show\n\t\t\t\t\n\t\t\t\tpro = Product.find(params[:id])\n\t\t\t\trender json: {status: 'SUCCESS', message:'products', data: pro}, status: :ok\n\t\t\t\t\n\t\t\tend",
"title": ""
},
{
"docid": "e0e224129db67f20e8cdea2b596932f3",
"score": "0.6984265",
"text": "def show\n @prov_products = ProvProducts.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @prov_products.to_xml }\n end\n end",
"title": ""
},
{
"docid": "e829524e804499ec2c39d7c30f26c3a3",
"score": "0.6975131",
"text": "def show\n @product = Product.find params[:id]\n end",
"title": ""
},
{
"docid": "2b1ba17a8ae189e20b3c23f6629b469e",
"score": "0.69694936",
"text": "def show\n @title = @product.name.capitalize + ' | Stockmarket'\n @description = 'Купить недорого ' + @product.name.capitalize + ' стоковая цена от ' + @product.price.to_s + ' грн.'+ ' Доставка по Украине во все города'\n if seller_signed_in?\n cur_sell = current_seller.id\n else\n cur_sell = nil\n end\n if browser.known? and cookies[\"view_product_#{@product.id}\"].nil? and cur_sell != @product.seller_id\n cookies[\"view_product_#{@product.id}\"] = {:value => true, :expires => 3.day.from_now.utc}\n view_count = @product.view_count + 1\n @product.update(view_count: view_count)\n end\n @category = Category.find(@product.category_id)\n twocategories_id = @category.twocategories.ids\n @twocategories = Twocategory.where(:id => twocategories_id).order(created_at: :desc)\n @seller = @product.seller\n @sellers = Seller.all.order(created_at: :desc)\n @product_sell = @seller.products.where(moderation: 1, visible: 1).order(created_at: :desc)\n @products = Product.where(moderation: 1, visible: 1).order(created_at: :desc)\n unless @product.visible == 1 and @product.moderation == 1\n redirect_to :root\n end\n end",
"title": ""
},
{
"docid": "0b557005904edd3865573085cdf1f992",
"score": "0.6963442",
"text": "def show\n load_data_for_product\n respond_with(@product)\n end",
"title": ""
},
{
"docid": "e975cf72b32ffe84610d84c7f7eb2ea3",
"score": "0.69618344",
"text": "def show\n @items_products = ItemsProduct.find_by_sql [\"SELECT ip.id, ip.product_id, ip.order_item_id, ip.logistics_id, ip.created_at, ip.item_price, ip.updated_at, p.product_name, oi.order_id, lo.logistics_name FROM items_products ip, products p, order_items oi, logistics lo WHERE ip.product_id = p.id AND ip.order_item_id = oi.id AND ip.logistics_id = lo.id AND ip.id = ?\", params[:id]]\n end",
"title": ""
},
{
"docid": "4b06c2e49d9dae687392948872290492",
"score": "0.6960177",
"text": "def show\n @productos = Detail.where(\"sell_id = ?\", @sell.id)\n end",
"title": ""
},
{
"docid": "5d33d2e70d79c39ffb5db7e9ef877f09",
"score": "0.69503075",
"text": "def index\n @tag = params[:tag].blank? ? 'products' : params[:tag]\n @products = Product.with_tag(@tag)\n raise ActionController::RoutingError.new('Not Found') if @products.empty?\n @edit_mode = 'si' if (params[:e] == 'si')\n @products =\n if params[:search]\n @products.search(params[:search])\n elsif params[:group]\n @products.where(group: params[:group])\n elsif params[:subgroup]\n @products.where(subgroup: params[:subgroup])\n else\n @products.first(50)\n end\n end",
"title": ""
},
{
"docid": "a39f3c8a40f40e735ee6616c04abc04f",
"score": "0.69485134",
"text": "def show\n @store = current_user.store\n @products = @store.products\n end",
"title": ""
},
{
"docid": "5f3cd0a06615592794c922b5f38d8ed8",
"score": "0.6945113",
"text": "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end",
"title": ""
},
{
"docid": "60b266d3fa1fffe9c447b6392745f862",
"score": "0.6936972",
"text": "def show\n @product = Product.where(visible: true).find(params[:id])\n\n #na tą chwilę musi tak zostać, ma to związek z wywołaniem javascriptowym z listy produktów, którego nie można przystosować do friendly_id\n if !@product.nil? && (request.path != product_path(@product))\n redirect_to @product, status: :moved_permanently and return\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @product }\n end\n end",
"title": ""
},
{
"docid": "59640331e470255a1422bb905442bf89",
"score": "0.6930969",
"text": "def show\n @product = Product.find(params[:id])\n @reviews = Review.get_reviews_by_product(@product.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @product }\n end\n end",
"title": ""
},
{
"docid": "482179fa0d6f604dc70ef55f2b286081",
"score": "0.6927455",
"text": "def show\n @publisher = Publisher.find @product.publisher_id \n\t\t@versions = Version.find :all, :conditions => \"product_id = '#{@product.id}'\"\n respond_to do |format|\n format.yaml \n format.json \n format.html # show.html.erb\n format.xml { render :xml => @product }\n end\n end",
"title": ""
},
{
"docid": "b7eceb6df4c20af1b23ae5fc5a8cf8bc",
"score": "0.69274044",
"text": "def show\n name = params[:id]\n logger.info(\"ROSE \" + name)\n @product = Product.find(name.reverse) \n @reviews = Review.get_reviews_by_product(@product.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @product }\n end\n end",
"title": ""
},
{
"docid": "6d42056f502a40094a9622c2141a78c2",
"score": "0.69135576",
"text": "def show\n authorize!(:show,current_user) unless current_user.role?:livia_admin\n if params[:id].to_s == \"product_dropdown_list\"\n redirect_to :action=>'product_dropdown_list'\n end\n @product = Product.find(params[:id])\n end",
"title": ""
},
{
"docid": "b9d6d5750c9f1f6bdcfe35c649dc536c",
"score": "0.6913369",
"text": "def show\n @product = Product.find params[:id]\n end",
"title": ""
},
{
"docid": "b9d6d5750c9f1f6bdcfe35c649dc536c",
"score": "0.6913369",
"text": "def show\n @product = Product.find params[:id]\n end",
"title": ""
},
{
"docid": "b9d6d5750c9f1f6bdcfe35c649dc536c",
"score": "0.6913369",
"text": "def show\n @product = Product.find params[:id]\n end",
"title": ""
},
{
"docid": "b9d6d5750c9f1f6bdcfe35c649dc536c",
"score": "0.6913369",
"text": "def show\n @product = Product.find params[:id]\n end",
"title": ""
}
] |
901ded2527c7ed43f9dfd42151808d78
|
PUT /related_works/1 PUT /related_works/1.xml
|
[
{
"docid": "d2773ce2d89f2a914759f9b623dd2f58",
"score": "0.0",
"text": "def update\n @related_work.reciprocal = !@related_work.reciprocal?\n if @related_work.update_attribute(:reciprocal, @related_work.reciprocal)\n notice = @related_work.reciprocal? ? t('link_approved', :default => \"Link was successfully approved\") : \n t('link_removed', :default => \"Link was successfully removed\")\n flash[:notice] = notice\n redirect_to(@related_work.parent) \n else\n flash[:error] = t('failed_update', :default => 'Sorry, something went wrong. Please try again.')\n redirect_to(@related_work)\n end\n end",
"title": ""
}
] |
[
{
"docid": "033bf52839063d327724d0140f4af1c0",
"score": "0.64151245",
"text": "def update\n @work = Work.find(params[:id])\n\n @work.attributes = params[:work]\n @work.owner = @current_user\n\n respond_to do |format|\n if @work.save\n flash[:notice] = 'Work was successfully updated.'\n format.html { redirect_to :action => :edit }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @work.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a426c2b3a96a7cc3240fb889b1db0874",
"score": "0.6258343",
"text": "def update\n @work = Work.find(params[:id])\n\n respond_to do |format|\n if @work.update_attributes(params[:work])\n flash[:notice] = 'Work was successfully updated.'\n format.html { redirect_to(@work) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @work.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b95d07c0f68bc448ad770318504b2c2c",
"score": "0.6227432",
"text": "def update\n @work_relationship = WorkRelationship.find(params[:id])\n\n respond_to do |format|\n if @work_relationship.update_attributes(params[:work_relationship])\n format.html { redirect_to @work_relationship, notice: 'Work relationship was successfully updated.' }\n format.json { head :no_content }\n else\n prepare_options\n format.html { render action: \"edit\" }\n format.json { render json: @work_relationship.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "71983ae4dff4345efbbbf46e2fa32140",
"score": "0.61906636",
"text": "def update\n respond_to do |format|\n if @work.update_attributes(params[:work])\n format.html { redirect_to(@work, :notice => 'Work was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @work.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7e560122dd585cdfdd1925afecbfd1cf",
"score": "0.61306953",
"text": "def update\n\n @work = Work.find(params[:id])\n\n respond_to do |format|\n if @work.update_attributes(params[:work])\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "542d1ee3a3034e02d7398fe3935f7bed",
"score": "0.6100903",
"text": "def update\n @agent.works.delete_all\n @agent.works << Work.find(params[:works])\n @customers = Customer.all\n @works = Work.all \n respond_to do |format|\n if @agent.update(agent_params)\n format.html { redirect_to @agent, notice: t('agents.success_update') }\n format.json { render :show, status: :ok, location: @agent }\n else\n format.html { render :edit }\n format.json { render json: @agent.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "222df25c5a58170c1096769c10fbc312",
"score": "0.6079154",
"text": "def update\n @work = Work.find(params[:id])\n\n respond_to do |format|\n if @work.update_attributes(params[:work])\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "067a5bec7e10172c766f2b68e21230ac",
"score": "0.60735124",
"text": "def update\n @work = Work.find(params[:id])\n respond_to do |format|\n if @work.update_attributes(params[:work])\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2c00aac3179348fda76631176f230db5",
"score": "0.60591704",
"text": "def update_many\n respond_to do |format|\n if @works.update_all(work_params)\n format.html { redirect_to works_url, notice: 'Works were successfully updated.' }\n format.json { render :index, status: :ok, location: works_url }\n else\n format.html { render :index }\n format.json { render json: @works.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "39e2ca2f705c6a6ff359f1d307377009",
"score": "0.6053714",
"text": "def update\n @our_work = OurWork.find(params[:id])\n\n respond_to do |format|\n if @our_work.update_attributes(params[:our_work])\n format.html { redirect_to @our_work, notice: 'Our work was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @our_work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b26a90e1459805ae42dc526f9c0bdaa",
"score": "0.60251343",
"text": "def update\n @related = Related.find(params[:id])\n\n respond_to do |format|\n if @related.update_attributes(params[:related])\n format.html { redirect_to @related, notice: 'Related was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @related.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "30b23e6ca7e1759884766dceea120c34",
"score": "0.6001526",
"text": "def update\n @assigned_work = AssignedWork.find(params[:id])\n\n respond_to do |format|\n if @assigned_work.update_attributes(params[:assigned_work])\n format.html { redirect_to @assigned_work, notice: 'Assigned work was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @assigned_work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad54471b285e5e357d9be959c8ade2d8",
"score": "0.59888786",
"text": "def update\n path = \"/workflow/#{repo}/objects/druid:#{druid}/workflows/#{workflow}/#{step}\"\n conn = Faraday.new(url: config['host'])\n conn.basic_auth(config['user'], config['password'])\n conn.headers['content-type'] = 'application/xml'\n\n conn.put path, payload\n end",
"title": ""
},
{
"docid": "750fced3875cfe1f1bb952850e2dede6",
"score": "0.59699684",
"text": "def work_params\n params.require(:work).permit(:title, :existed_works_id)\n end",
"title": ""
},
{
"docid": "a3f2c738f12278780b4548fa53b4212d",
"score": "0.59682846",
"text": "def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to works_path }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2091ed39ebe0337ed70344c7271f48df",
"score": "0.59393495",
"text": "def update\n @work_relationship_type = WorkRelationshipType.find(params[:id])\n\n respond_to do |format|\n if @work_relationship_type.update_attributes(params[:work_relationship_type])\n format.html { redirect_to @work_relationship_type, notice: 'Work relationship type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @work_relationship_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2d2520354ef9d51551d22a9db2784c73",
"score": "0.593848",
"text": "def update\n @work = Work.find(params[:id])\n\n params[:checkbox].each do |box|\n logger.debug \"message #{box[1].to_i == 1}\"\n logger.debug \"message #{Work.find(box[0])}\"\n tmp = Work.find(box[0].to_i) # number of box\n if box[1].to_i == 1 # is this box checked\n @work.rel_works << tmp unless @work.rel_works.include?(tmp)\n else\n @work.rel_works.delete(tmp)\n end\n end\n\n respond_to do |format|\n if @work.update_attributes(params[:work])\n flash[:notice] = 'Work was successfully updated.'\n format.html { redirect_to(@work) }\n else\n @others = Work.find(:all) - [@work]\n format.html { render :action => \"edit\" }\n end\n end \n end",
"title": ""
},
{
"docid": "466eda2eac01c6b1e8d9386778e530a0",
"score": "0.59241164",
"text": "def updatenotes\n #@nodes = @work.nodes\n #@links = @work.links\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to action: 'takenotes'}\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "553f4f040e7f159efa5dea6ba521b752",
"score": "0.58843493",
"text": "def update\n params[:exhibition][:work_ids] ||= [] \n @exhibition = Exhibition.find(params[:id])\n\n respond_to do |format|\n if @exhibition.update_attributes(params[:exhibition])\n flash[:notice] = 'Exhibition was successfully updated.'\n format.html { redirect_to(@exhibition) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exhibition.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "49b6bef3ed2a8951b342fac0bad5cb38",
"score": "0.58739287",
"text": "def update\n @work = Work.find(params[:id])\n\n respond_to do |format|\n if @work.update_attributes(params[:work])\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\", layout: \"editor\" }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2f90e42b6bd4a0c4a9734538b854f74",
"score": "0.5861163",
"text": "def update\n respond_to do |format|\n if @extrawork.update(extrawork_params)\n format.html { redirect_to @extrawork, notice: 'Extrawork was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @extrawork.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51f80d2f80ab656b6c619acf0d3778e0",
"score": "0.58418185",
"text": "def update\n @work = Work.find params[:id]\n @work.update params[:work].permit(:name, :url, :vimeo_id)\n redirect_to '/admin'\n end",
"title": ""
},
{
"docid": "d61a25d69ed10b03601d4f17ba7d9ef3",
"score": "0.58354044",
"text": "def update\n #RAILS_DEFAULT_LOGGER.debug(\"******** REST Call to CRMS: Updating #{self.class.name}:#{self.id}\")\n #RAILS_DEFAULT_LOGGER.debug(caller[0..5].join(\"\\n\")) \n response = connection.put(element_path(prefix_options), to_xml, self.class.headers)\n save_nested\n load_attributes_from_response(response)\n merge_saved_nested_resources_into_attributes\n response\n end",
"title": ""
},
{
"docid": "e6f6f18be954fb2c7c52da8587c86606",
"score": "0.5830717",
"text": "def update\n work = Work.find(params[:work_id])\n @work_detail = WorkDetail.find(params[:id])\n\n respond_to do |format|\n if @work_detail.update_attributes(params[:work_detail])\n format.html { redirect_to [work,@work_detail], notice: 'Work detail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @work_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bbe7a3d522bb034be3c42519e506a0a9",
"score": "0.5830281",
"text": "def update\n work = Work.find(params[:work_id])\n work_detail = work.work_details.find(params[:work_detail_id])\n @work_skill = WorkSkill.find(params[:id])\n\n respond_to do |format|\n if @work_skill.update_attributes(params[:work_skill])\n format.html { redirect_to [work, work_detail, @work_skill], notice: 'Work skill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @work_skill.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eeb088a1506c74b483d89d0bcac3e740",
"score": "0.5826553",
"text": "def set_how_works\n @how_it_work = HowItWork.find(params[:id])\n end",
"title": ""
},
{
"docid": "140b25a0b3fe5c8e38e3d2b1faa08815",
"score": "0.58121186",
"text": "def update\n @work_item = WorkItem.find(params[:id])\n\n respond_to do |format|\n if @work_item.update_attributes(params[:work_item])\n flash[:notice] = 'Work item was successfully updated.'\n format.html { redirect_to(invoice_items_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @work_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e8aee2e6396b9e3846a51b9b86dcfb5",
"score": "0.5789011",
"text": "def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: \"Work was successfully updated.\" }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f770f8c77daf8ae175033195e79d803",
"score": "0.57708424",
"text": "def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: 'Работа обновлена' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "33e7e30f4d82663028d5cde1711f8bf3",
"score": "0.57665706",
"text": "def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "33e7e30f4d82663028d5cde1711f8bf3",
"score": "0.57665706",
"text": "def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "33e7e30f4d82663028d5cde1711f8bf3",
"score": "0.57665706",
"text": "def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "33e7e30f4d82663028d5cde1711f8bf3",
"score": "0.57665706",
"text": "def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "33e7e30f4d82663028d5cde1711f8bf3",
"score": "0.57665706",
"text": "def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "33e7e30f4d82663028d5cde1711f8bf3",
"score": "0.57665706",
"text": "def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f0941222ebb8c2fa9747c002f3b63171",
"score": "0.57549417",
"text": "def update\n respond_to do |format|\n if @work.update(work_param_update)\n format.html { redirect_to client_path(@client), notice: 'Work was successfully updated.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8dda54d3eae856849f171f23c2edd291",
"score": "0.57377875",
"text": "def update\n @work_site = WorkSite.find(params[:id])\n\n respond_to do |format|\n if @work_site.update_attributes(params[:work_site])\n format.html { redirect_to(@work_site, :notice => 'Work site was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @work_site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8dda54d3eae856849f171f23c2edd291",
"score": "0.57377875",
"text": "def update\n @work_site = WorkSite.find(params[:id])\n\n respond_to do |format|\n if @work_site.update_attributes(params[:work_site])\n format.html { redirect_to(@work_site, :notice => 'Work site was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @work_site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "13b79826dfad066d46e8b216a19ca285",
"score": "0.57283217",
"text": "def update\n respond_to do |format|\n if @person_work.update(person_work_params)\n format.html { redirect_to @person_work, notice: 'Person work was successfully updated.' }\n format.json { render :show, status: :ok, location: @person_work }\n else\n format.html { render :edit }\n format.json { render json: @person_work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b5084e31cffa08878eb22f18b2f24080",
"score": "0.571268",
"text": "def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: 'L\\'action a été mise à jour.' }\n format.json { render :index, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "044356e50fa97f10da3239b783ee6ced",
"score": "0.57049936",
"text": "def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: 'Værket er opdateret.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "23f3ea87194c2d76214c93870ad72706",
"score": "0.5697698",
"text": "def update\n @worksite = Worksite.find(params[:id])\n\n respond_to do |format|\n if @worksite.update_attributes(params[:worksite])\n format.html { redirect_to worksites_url, notice: 'Worksite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @worksite.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a9728ae4baad07ec7d7c4f022f13c33",
"score": "0.5690238",
"text": "def update\n params.permit!\n @ms_rework = MsRework.find(params[:id])\n\n respond_to do |format|\n if @ms_rework.update_attributes(params[:ms_rework])\n format.html { redirect_to(@ms_rework, :notice => 'Ms rework was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ms_rework.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a46f6720b481a6ea83d840b479036eb6",
"score": "0.56859773",
"text": "def update\n\n respond_to do |format|\n if @work_item.update_action(work_item_params)\n format.html { redirect_to @work_item, notice: 'Work item was successfully updated.' }\n format.json #{ render :show, status: :ok, location: @work_item }\n else\n format.html { render :edit }\n format.json { render json: @work_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d2dbf27ed9aa18d0cc23804c02796842",
"score": "0.5681856",
"text": "def update\n @work = @assignment.works.find(params[:id])\n\n respond_to do |format|\n if @work.update_attributes(allowed_params)\n @status = admin_semester_section_assignment_work_url(@semester,@section,@assignment,@work)\n flash[:notice] = 'Work was successfully updated.'\n format.html { redirect_to([:admin,@semester,@section,@assignment,@work]) }\n format.xml { head :ok }\n else\n @status = \"failed\"\n format.html { render action: \"edit\" }\n format.xml { render xml: @work.errors, status: :unprocessable_entity }\n end\n format.js\n end\n end",
"title": ""
},
{
"docid": "dc90257f871c0587a84d3aed8515e650",
"score": "0.566436",
"text": "def update\n @workobject = Workobject.find(params[:id])\n\n respond_to do |format|\n if @workobject.update_attributes(params[:workobject])\n format.html { redirect_to @workobject, notice: 'Workobject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @workobject.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc6efbaf9ae952fdba3f737820a90a30",
"score": "0.5661576",
"text": "def set_work_relationship\n @work_relationship = WorkRelationship.find(params[:id])\n end",
"title": ""
},
{
"docid": "5829f07cf9b7942232fa88a9f1e6009c",
"score": "0.5653579",
"text": "def set_work\n @work = Work.find(params[:work][:id])\n end",
"title": ""
},
{
"docid": "01b818c2681a93808bd5add3da64d106",
"score": "0.5646531",
"text": "def update\n @what_qo = WhatQo.find(params[:id])\n\n respond_to do |format|\n if @what_qo.update_attributes(params[:what_qo])\n format.html { redirect_to(@what_qo, :notice => 'WhatQo was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @what_qo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f4933c8507384c208da10150449b312b",
"score": "0.56390166",
"text": "def update_work(work, title, attributes)\n work.title = title if title\n work_actor(work, attributes).update\n end",
"title": ""
},
{
"docid": "77722c3108c305a41f5b96cacee770b7",
"score": "0.56334174",
"text": "def set_doc_overwork\n @overwork = current_ou.doc_overworks.find(params[:id])\n end",
"title": ""
},
{
"docid": "4b7c8961d00cf913e6a9eb6427ae6ace",
"score": "0.5632643",
"text": "def update\n @work.attributes = instance_params\n\n respond_to do |format|\n if @work.save\n format.html { redirect_to show_path, success: I18n.t(\"admin.flash.works.success.update\") }\n format.json { render :show, status: :ok, location: admin_work_url(@work) }\n else\n format.html { render_edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ec110956b31808ca50bf90d0d0286ca",
"score": "0.56276315",
"text": "def update\n respond_to do |format|\n if @work.update(allowed_params)\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e212778c0586524e90719ec3fa046810",
"score": "0.5625221",
"text": "def update\n respond_to do |format|\n if @work_site.update_attributes(params[:work_site])\n format.html { redirect_to work_sites_path, notice: 'WorkSite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @work_site.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e255c1cba64d0a6cbe2e4fe909e47424",
"score": "0.56222534",
"text": "def update\n @work_analytic = Work::Analytic.find(params[:id])\n\n respond_to do |format|\n if @work_analytic.update_attributes(params[:work_analytic])\n format.html { redirect_to @work_analytic, notice: 'Analytic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @work_analytic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d91284ac90e73c405835c982bab2a44",
"score": "0.56206363",
"text": "def update\n @place_of_work = PlaceOfWork.find(params[:id])\n\n respond_to do |format|\n if @place_of_work.update_attributes(params[:place_of_work])\n format.html { redirect_to @place_of_work, notice: 'Place of work was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @place_of_work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d743f7f827505e35d7a1245a9986cfb0",
"score": "0.5619909",
"text": "def set_work\n @work = Work.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "d743f7f827505e35d7a1245a9986cfb0",
"score": "0.5619909",
"text": "def set_work\n @work = Work.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "217e2308e2a6bb4db5add929e717c5df",
"score": "0.56185365",
"text": "def set_extrawork\n @extrawork = Extrawork.find(params[:id])\n end",
"title": ""
},
{
"docid": "44938e8ea92504f2685a3ccd0db7b5e5",
"score": "0.56128293",
"text": "def update\n @line_work = LineWork.find(params[:id])\n\n respond_to do |format|\n if @line_work.update_attributes(params[:line_work])\n format.html { redirect_to @line_work, notice: 'Line work was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @line_work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9adedd3cae210903dcef12a59ed624da",
"score": "0.5611932",
"text": "def update\n @work_order = WorkOrder.find(params[:id])\n respond_to do |format|\n if @work_order.update_attributes(params[:work_order])\n format.html { redirect_to(work_orders_url, :notice => 'Work Order Updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @work_order.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "653656e76d937f5b8f45ec45c20ffb6c",
"score": "0.5602553",
"text": "def update\n @work_entry = WorkEntry.find(params[:id])\n\n respond_to do |format|\n if @work_entry.update_attributes(params[:work_entry])\n format.html { redirect_to(@work_entry, :notice => 'Work entry was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @work_entry.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b2eaf95f317792324fcc454182a69d69",
"score": "0.55961376",
"text": "def update\n \n @work = Work.find(params[:id])\n if params[:work][:without_project].blank? \n @work.time = Time.parse(params[:work][:date]) + params[:work][:time].to_i.minutes\n\n @operations = @work.operations\n else \n @work.project_id = params[:work][:project_id]\n @work.sub_project_id = params[:work][:sub_project_id]\n end\n if not @current_user.admin? || @current_user.produce?\n @work.edited = true;\n end\n \n \n @work.update_attributes(params[:work])\n respond_to do |format|\n if @work.save\n if params['add_operation'].blank?\n flash[:notice] = 'Work was successfully updated.'+@work.operations.size.to_s\n format.html { redirect_to(@work.project) }\n format.xml { head :ok }\n else\n flash[:notice] = 'Work was successfully updated.'\n format.html { redirect_to(menu_home_path) }\n format.xml { head :ok }\n end\n else\n format.html { render :controller => \"plan_works\", :action => \"edit\" }\n format.xml { render :xml => @work.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5b10346441051d2ddd07ce61c6d82366",
"score": "0.5583131",
"text": "def set_work\n @work = Work.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b10346441051d2ddd07ce61c6d82366",
"score": "0.5583131",
"text": "def set_work\n @work = Work.find(params[:id])\n end",
"title": ""
},
{
"docid": "20d8e5c4103797231dd69df6848e887b",
"score": "0.5581556",
"text": "def update\n params['new_person'].permit!\n @request.person.update(params['new_person']); \n params['mainwork'].permit!\n @request.mainwork.update(params['mainwork']); \n params['secondwork'].permit!\n @request.secondwork.update(params['secondwork']); \n params['firstcr'].permit!\n params['secondcr'].permit!\n\n respond_to do |format|\n if @request.update(request_params)\n format.html { redirect_to requests_url, notice: 'Заявка успешно изменена' }\n format.json { render :show, status: :ok, location: @request }\n else\n format.html { render :edit }\n format.json { render json: @request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0cd18f7d8a5807c78f34aaf6aa7c290c",
"score": "0.5577285",
"text": "def set_work\n @work = Work.find_param(params[:id])\n end",
"title": ""
},
{
"docid": "4e1572a8579b39b91fd73e356ca1c361",
"score": "0.5576813",
"text": "def update\r\n @workers = Worker.where(workshop_id: params[:extra][:workshop_id])\r\n respond_to do |format|\r\n if @extra.update(extra_params)\r\n format.html { redirect_to extras_path, notice: 'تم تحديث المكافئة' }\r\n format.json { render :show, status: :ok, location: @extra }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @extra.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "929e6ace1765ed6adc889a5a43c3b66a",
"score": "0.557585",
"text": "def update\n @work = Work.find(params[:id])\n @work.country = @work.author.country\n\n respond_to do |format|\n if @work.update_attributes(params[:work])\n format.html { redirect_to country_work_path(@work.country.name,@work), :notice => 'Work was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @work.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "86866e2ccc677d77d99364b534b82117",
"score": "0.55697346",
"text": "def update\n @interested = Interested.find(params[:id])\n\n respond_to do |format|\n if @interested.update_attributes(params[:interested])\n format.html { redirect_to @interested, notice: 'Interested was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @interested.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64cb49c4d3a6e2ac5e8e9c7ebd37388a",
"score": "0.5549992",
"text": "def update\n @budget = Budget.new\n @work = Work.find(params[:id])\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to works_path, notice: 'work was successfully updated.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8ea7ab13ab16a54b50cc9b7cbaf3451c",
"score": "0.5546004",
"text": "def update\n @homework = Homework.find(params[:id])\n\n respond_to do |format|\n if @homework.update_attributes(params[:homework])\n format.html { redirect_to @homework, notice: 'Homework was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @homework.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8ea7ab13ab16a54b50cc9b7cbaf3451c",
"score": "0.5546004",
"text": "def update\n @homework = Homework.find(params[:id])\n\n respond_to do |format|\n if @homework.update_attributes(params[:homework])\n format.html { redirect_to @homework, notice: 'Homework was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @homework.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "de473844dd2a40e4f8252c95995d5dbf",
"score": "0.55449474",
"text": "def update\n respond_to do |format|\n if @work_detail.update_attributes(params[:work_detail])\n format.html { redirect_to [@work,@work_detail], notice: 'Work detail was successfully updated.' }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"title": ""
},
{
"docid": "35217c16292779d9d8dd8974e0113dd9",
"score": "0.5541739",
"text": "def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: 'Tarea actualizada correctamente.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2a8c1f84d21178380077931bd8544fc9",
"score": "0.5534312",
"text": "def update\n respond_to do |format|\n if @workist.update(workist_params)\n format.html { redirect_to @workist, notice: 'Workist was successfully updated.' }\n format.json { render :show, status: :ok, location: @workist }\n else\n format.html { render :edit }\n format.json { render json: @workist.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d22e0e894f959722bd4723997ad048e",
"score": "0.5532762",
"text": "def set_work\n @work = Work.find(params[:id])\n\n if @work.nil?\n head :not_found\n return\n end\n end",
"title": ""
},
{
"docid": "528d02effd93c4113725b7dec7fc33ba",
"score": "0.55293965",
"text": "def update\n respond_to do |format|\n if @place_work.update(place_work_params)\n format.html { redirect_to @place_work, notice: 'Place work was successfully updated.' }\n format.json { render :show, status: :ok, location: @place_work }\n else\n format.html { render :edit }\n format.json { render json: @place_work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e0b2ab7434ba54d8fb49e92cf527f9f6",
"score": "0.5523651",
"text": "def update\n @print_work = @user.print_works.find(params[:id])\n\n # raise params.to_yaml\n\n respond_to do |format| \n if @print_work.update_attributes(params[:print_work])\n format.html { redirect_to @print_work, notice: 'Print work was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @print_work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a05e5ca0b530c914ebc92a783a637b5",
"score": "0.5520261",
"text": "def set_workexample\n @workexample = Workexample.find(params[:id])\n end",
"title": ""
},
{
"docid": "fcf1704e519dc40fb67bdf3d25f12895",
"score": "0.5519887",
"text": "def update\n @storyrelation = Storyrelation.find(params[:id])\n\n respond_to do |format|\n if @storyrelation.update_attributes(params[:storyrelation])\n format.html { redirect_to @storyrelation, notice: 'Storyrelation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @storyrelation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8f15e2d9b4a3803df397075d06112c0c",
"score": "0.5518792",
"text": "def update\n update_works\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e3f1f29bbb1bd61ccf2882e09baaaeef",
"score": "0.55138725",
"text": "def update\n @workplace = Workplace.find(params[:id])\n\n respond_to do |format|\n if @workplace.update_attributes(params[:workplace])\n format.html { redirect_to(@workplace, :notice => 'Workplace was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @workplace.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "57b1401edda8c653ad923ff37aff8514",
"score": "0.5509535",
"text": "def update\n @worktop_ga = WorktopGa.find(params[:id])\n\n respond_to do |format|\n if @worktop_ga.update_attributes(params[:worktop_ga])\n flash[:notice] = 'WorktopGa was successfully updated.'\n format.html { redirect_to(@worktop_ga) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @worktop_ga.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "921dd0e1b31e6a3f7b83e7ff5c202641",
"score": "0.55066097",
"text": "def update\n @workitem = Workitem.find(params[:id])\n\n _workitem_projects = params[:selected_workitem_projects]\n\n @workitem.project_ids = (_workitem_projects.nil?)?nil:_workitem_projects.map {|id_str| id_str.to_i}\n\n respond_to do |format|\n if @workitem.update_attributes(params[:workitem])\n format.html { redirect_to(@workitem, :notice => 'Workitem was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @workitem.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d0d6dd274605fe37d5918d155c4479d9",
"score": "0.55044377",
"text": "def update\n @work_type = WorkType.find_by_slug(params[:id])\n\n respond_to do |format|\n if @work_type.update_attributes(params[:work_type])\n format.html { redirect_to @work_type, notice: 'Work type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @work_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8c4a07bc3d2849f85cf19f6571d47dcb",
"score": "0.5502718",
"text": "def update\n respond_to do |format|\n if @workset.update(workset_params)\n format.html { redirect_to @workset, notice: 'Workset was successfully updated.' }\n format.json { render :show, status: :ok, location: @workset }\n else\n format.html { render :edit }\n format.json { render json: @workset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8f3127eea8fdcb6b65c23e2599b51b7c",
"score": "0.550151",
"text": "def update\n @workstream = Workstream.find(params[:id])\n\n respond_to do |format|\n if @workstream.update_attributes(params[:workstream])\n format.html { redirect_to(@workstream, :notice => 'Workstream was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @workstream.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f468013f4dc13ae3324e52bec6082195",
"score": "0.55003446",
"text": "def update\n @workshop = Workshop.find(params[:id])\n\n respond_to do |format|\n if @workshop.update_attributes(params[:workshop])\n format.html { redirect_to(@workshop, :notice => 'Workshop was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @workshop.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5ff44e20dbee67a4604a197166d8b2a3",
"score": "0.54861486",
"text": "def test_save_update\n\n mx234a_pre_art = design_reviews(:mx234a_pre_artwork)\n \n put(:save_update,\n { :doc_id => design_review_documents(:mx234a_stackup_doc),\n :document => { :name => 'test.doc',\n :data => 'TEST DATA',\n :content_type => 'txt' }, \n :design_review => { :id => mx234a_pre_art.id } },\n cathy_admin_session)\n assert_redirected_to(:action => :review_attachments,\n :design_review_id => mx234a_pre_art.id)\n assert_equal('The Stackup document has been updated.', flash['notice'])\n \n ### TODO - FIGURE OUT HOW TO LOAD A DOC FOR TESTING.\n\n end",
"title": ""
},
{
"docid": "492fcc0d237dff04ef8f7b1ce65f1933",
"score": "0.54826194",
"text": "def update\n respond_to do |format|\n if @work_skill.update_attributes(params[:work_skill])\n format.html { redirect_to [@work, @work_detail, @work_skill], notice: 'Work skill was successfully updated.' }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"title": ""
},
{
"docid": "d3fa19f38ca97163cae5899ceb2444a8",
"score": "0.5474866",
"text": "def update\n @research = Research.find(params[:id])\n\n respond_to do |format|\n if @research.update_attributes(params[:research])\n flash[:notice] = 'Research was successfully updated.'\n format.html { redirect_to(@research) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @research.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70fc1f4a5c461a49f389c33dab6d2583",
"score": "0.54713786",
"text": "def update\n @mostsmallresearch = Mostsmallresearch.find(params[:id])\n\n respond_to do |format|\n if @mostsmallresearch.update_attributes(params[:mostsmallresearch])\n format.html { redirect_to @mostsmallresearch, notice: 'Mostsmallresearch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mostsmallresearch.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ec42f70173914f85990a4790cd279f08",
"score": "0.54704225",
"text": "def update\n @workshop = Workshop.find(params[:id])\n\n respond_to do |format|\n if @workshop.update_attributes(params[:workshop])\n flash[:notice] = 'Workshop was successfully updated.'\n format.html { redirect_to(@workshop) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @workshop.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b67e36b50a7357dbfc3a0fb2c523d83a",
"score": "0.5470063",
"text": "def update\n respond_to do |format|\n if @workout.update(workout_name: workout_params[:workout_name], notes: workout_params[:notes], focus: workout_params[:focus])\n @workout.workout_activities.each_with_index do |activity, index|\n @workout.workout_activities[index].update(workout_params[:workout_activities_attributes][index.to_s])\n end \n format.html { redirect_to @workout, notice: 'Workout was successfully updated.' }\n format.json { render :show, status: :ok, location: @workout }\n else\n format.html { render :edit }\n format.json { render json: @workout.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "84130bbd4a58ad389023ed2260538212",
"score": "0.54644305",
"text": "def update\n respond_to do |format|\n if @past_work.update(past_work_params)\n format.html { redirect_to @past_work, notice: 'Past work was successfully updated.' }\n format.json { render :show, status: :ok, location: @past_work }\n else\n format.html { render :edit }\n format.json { render json: @past_work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9607c1689db2e5a4c371180a0e606da0",
"score": "0.545923",
"text": "def update\n @problem = @idea.problems.find(params[:id])\n\n if @problem.update_attributes(params[:problem])\n render json: { text: \"success\"}\n else\n render json: { text: \"fail\"}\n end\n end",
"title": ""
},
{
"docid": "9c158618a762381c4bab7bfa63bd2184",
"score": "0.54549795",
"text": "def set_work\n @work = Work.find(params[:id])\n end",
"title": ""
},
{
"docid": "9c158618a762381c4bab7bfa63bd2184",
"score": "0.54549795",
"text": "def set_work\n @work = Work.find(params[:id])\n end",
"title": ""
},
{
"docid": "9c158618a762381c4bab7bfa63bd2184",
"score": "0.54549795",
"text": "def set_work\n @work = Work.find(params[:id])\n end",
"title": ""
},
{
"docid": "9c158618a762381c4bab7bfa63bd2184",
"score": "0.54549795",
"text": "def set_work\n @work = Work.find(params[:id])\n end",
"title": ""
}
] |
2ed936b8706e107bc848d5b33623d2f7
|
set field functions get the player session load based on current survey's rpe and duration practiced
|
[
{
"docid": "72cc891609c007baa2876f1be76a9a5f",
"score": "0.7338747",
"text": "def set_player_session_load\n player_session_load = @player_rpe_rating * @participated_in_full_practice\n return player_session_load\n end",
"title": ""
}
] |
[
{
"docid": "7cc698af24fa5aa311f5c5fda8566c25",
"score": "0.6420628",
"text": "def set_expected_session_load\n expected_session_load = @practice.duration * @practice.difficulty\n return expected_session_load\n end",
"title": ""
},
{
"docid": "327ea328a533d89ff8e4034068c8970f",
"score": "0.59921527",
"text": "def set_played_survey\n # @played_survey = PlayedSurvey.find(params[:id])\n end",
"title": ""
},
{
"docid": "d4c1456e4f3b57b918fe0fe8ee56f28b",
"score": "0.57775265",
"text": "def calculate_session_load\n self.session_load = self.duration * self.difficulty\n end",
"title": ""
},
{
"docid": "3006deb2e52a8e0893c22d26ec884202",
"score": "0.57117575",
"text": "def set_daily_load\n # need to fetch all of the practices for the current day of the practice\n sum_daily_load = 0 + @session_load # include session load of current survey\n surveys_today = Survey.for_user(@user_id).post_practice.surveys_on_date(@start_of_today, @end_of_today)\n # sum all surveys\n surveys_today.each do |survey|\n if survey.session_load.nil?\n return\n else\n sum_daily_load += survey.session_load\n end\n return sum_daily_load\n end\n\n # get weekly load by summing all of the session loads from the past 6 days + today\n def set_weekly_load\n sum_weekly_load = 0 + @daily_load\n # get all surveys from the past 6 days + today\n one_week_ago_start = @start_of_today - (6 * SECONDS_IN_ONE_DAY)\n surveys_this_week = Survey.for_user(@user_id).post_practice.surveys_for_week(one_week_ago_start, @end_of_today)\n # sum all surveys\n surveys_this_week.each do |survey|\n if survey.session_load.nil?\n return\n else\n sum_weekly_load += survey.session_load\n end\n end\n return sum_weekly_load\n end\n\n # set the acute load (acute load = weekly load)\n def set_acute_load\n return @weekly_load\n end\n\n # set the chronic load, the average weekly_load over the previous 4 weeks\n # need to calculate all weekly loads individually, can't access from anywhere in db\n def set_chronic_load\n # initialize for mean calculation\n array_of_weekly_loads = []\n # this week time range\n this_week_end = @end_of_today\n this_week_start = @start_of_today.ago(86400 * 6) # not necessary to have, don't use for weekly load calculation here\n # since we already calculated it already (Also and edge, to incude the current survey)\n weekly_load_this_week = @weekly_load\n array_of_weekly_loads << weekly_load_this_week\n\n # last week time range\n one_week_ago_end = @end_of_today.ago(86400 * 7)\n one_week_ago_start = @start_of_today.ago(86400 * 13)\n weekly_load_one_week_ago = calculate_weekly_load_with_dates(one_week_ago_start, one_week_ago_end)\n array_of_weekly_loads << weekly_load_one_week_ago\n\n # two weeks ago time range\n two_weeks_ago_end = @end_of_today.ago(86400 * 14)\n two_weeks_ago_start = @start_of_today.ago(86400 * 20)\n weekly_load_two_weeks_ago = calculate_weekly_load_with_dates(two_weeks_ago_start, two_weeks_ago_end)\n array_of_weekly_loads << weekly_load_two_weeks_ago\n\n # three weeks ago time range\n three_weeks_ago_end = @end_of_today.ago(86400 * 21)\n three_weeks_ago_start = @start_of_today.ago(86400 * 27)\n weekly_load_three_weeks_ago = calculate_weekly_load_with_dates(three_weeks_ago_start,three_weeks_ago_end)\n array_of_weekly_loads << weekly_load_three_weeks_ago\n\n # get average of all weekly loads from past 4 weeks\n chronic_load = array_of_weekly_loads.mean\n\n return chronic_load\n end\n\n # set the freshness index, chronic load - acute load (difference in fitness + fatigue)\n def set_freshness_index\n freshness_index = @chronic_load - @acute_load\n return freshness_index\n end\n\n # set the Acute:Chronic Worload Ratio (ACWR), Acute / Chronic\n def set_a_c_ratio\n # divide by zero possibility => must check what to do with this edge case\n if @chronic_load == 0\n return 0\n else\n a_c_ratio = @acute_load / @chronic_load\n return a_c_ratio\n end\n end\n\n # set the monotony for the past week (6 days ago thru today) (mean / std. dev.)\n def set_monotony\n # get the beginning of the week\n one_week_ago_start = @start_of_today - (6 * SECONDS_IN_ONE_DAY)\n # get all of the daily loads from the past 6 days + today\n weeks_daily_loads = Survey.for_user(@user_id).post_practice.surveys_for_week(one_week_ago_start, @end_of_today)\n\n # create an array of all the daily loads\n week_daily_loads = get_week_daily_loads(weeks_daily_loads)\n\n # get mean of the daily loads from the last week\n mean_daily_loads = week_daily_loads.mean\n\n # get standard deviation of daily loads from last week\n standard_deviation_daily_loads = week_daily_loads.standard_deviation\n\n # divide by zero possibility => must check what to do with this edge case\n if standard_deviation_daily_loads == 0\n monotony = 0\n else\n # monotony = mean of daily lodas / standard deviation\n monotony = mean_daily_loads / standard_deviation_daily_loads\n end\n\n return monotony\n end\n\n # set the daily strain for today, daily_load * monotony\n def set_daily_strain\n daily_strain = @daily_load * @monotony\n return daily_strain\n end\n\n # set the weekly strain for this week, weekly_load * monotony\n def set_weekly_strain\n weekly_strain = @weekly_load * @monotony\n return weekly_strain\n end\n\n # Validations\n\n # validate fields for post practice calcualtions\n def validate_fields_for_calculations(params)\n rpe = params[:player_rpe_rating]\n performance = params[:player_personal_performance]\n full_practice = params[:participated_in_full_practice]\n minutes = params[:minutes_participated]\n # nill checks\n if rpe.nil? || performance.nil? || full_practice.nil?\n return false\n # type checks\n elsif (!validate_integer_type(rpe) || !validate_integer_type(performance) || !validate_boolean_type(full_practice) || !validate_integer_type(minutes))\n return false\n # practice + minutes check\n elsif (full_practice == false && minutes.nil?)\n return false\n # pass preliminary checks\n else\n return true\n end\n\n end\n\n # validate whether a provided field is a boolean type\n def validate_boolean_type(field)\n if field.is_a?(TrueClass) || field.is_a?(FalseClass)\n return true\n else\n return false\n end\n end\n\n # validate integer type for provided field - MUST BE POSITIVE\n def validate_integer_type(field)\n if field.is_a?(Integer)\n return true\n else\n return false\n end\n end\n\n # Miscellaneous functions\n\n def set_today_start_end_datetime_objects\n if @current_datetime.dst?\n @start_of_today = Time.new(@current_year, @current_month, @current_day, 0, 0, 0, \"-04:00\")\n @end_of_today = Time.new(@current_year, @current_month, @current_day, 23, 59, 59, \"-04:00\")\n else\n @start_of_today = Time.new(@current_year, @current_month, @current_day, 0, 0, 0, \"-05:00\")\n @end_of_today = Time.new(@current_year, @current_month, @current_day, 23, 59, 59, \"-05:00\")\n end\n end\n\n # calculate weekly load given the start and end of the week\n def calculate_weekly_load_with_dates(startTime,endTime)\n sum_weekly_load = 0\n surveys_this_week = Survey.for_user(@user_id).post_practice.surveys_for_week(startTime, endTime)\n # sum all surveys\n surveys_this_week.each do |survey|\n if survey.session_load.nil?\n return\n else\n sum_weekly_load += survey.session_load\n end\n end\n # return the totaled\n return sum_weekly_load\n end\n\n # get array of daily loads of every day (no repeats)\n def get_week_daily_loads(weeks_surveys)\n daily_hash = {\"Monday\":0, \"Tuesday\":0, \"Wednesday\":0, \"Thursday\":0, \"Friday\":0, \"Saturday\":0, \"Sunday\":0}\n weeks_surveys.each do |survey|\n survey_day_key = get_day_of_week(survey.completed_time)\n daily_hash[survey_day_key] += survey.session_load\n end\n return daily_hash.values\n end\n\n # return the day of the week, given the datetime\n def get_day_of_week(survey_datetime)\n if survey_datetime.monday?\n day_of_week = \"Monday\"\n elsif survey_datetime.tuesday?\n day_of_week = \"Tuesday\"\n elsif survey_datetime.wednesday?\n day_of_week = \"Wednesday\"\n elsif survey_datetime.thursday?\n day_of_week = \"Thursday\"\n elsif survey_datetime.friday?\n day_of_week = \"Friday\"\n elsif survey_datetime.saturday?\n day_of_week = \"Saturday\"\n # elsif current_day.sunday?\n else\n day_of_week = \"Sunday\"\n end\n\n return day_of_week\n end\n\n\nend",
"title": ""
},
{
"docid": "22049f18d0dfd5f98886b411f16d4c51",
"score": "0.56711197",
"text": "def set_fields\n @project = Project.find(params[:project_id])\n @participant = Participant.find_by(:project_id => params[:project_id], :id => params[:participant_id])\n @times = @project.project_times\n\n unless @participant.nil?\n @rankings = @participant.rankings\n end\n\n @ranking = Ranking.find_by(:participant_id => params[:participant_id])\n if @ranking.nil?\n @ranking = Ranking.new\n end\n end",
"title": ""
},
{
"docid": "8f091a6db9d69fdff2f8523d0f526804",
"score": "0.54053575",
"text": "def requesting_playdate\n @playdate ||= Playdate.findActivePlaydate(current_user) \n end",
"title": ""
},
{
"docid": "c818b6fa8a05ca8774bcfb3187f55f7a",
"score": "0.5331111",
"text": "def load_pl_de\n flush\n session[:dealer] = Dealer.new({})\n session[:player] = Player.load(session[:username])\n session[:player].make_rich if session[:player].chips > 2000\n end",
"title": ""
},
{
"docid": "168886c37bab94162d876d755494923e",
"score": "0.53278863",
"text": "def show\n @firstpoll = @survey.polls.first\n session[\"first\"] = @firstpoll.id if @firstpoll\n session[:prog] = nil\n if @survey.ends_at\n if @survey.ends_at < Time.now\n @survey.votable = false\n @survey.save\n end\n end\n end",
"title": ""
},
{
"docid": "2fd3a0f5ef6c7a387c0dfa278a37cdbe",
"score": "0.53272647",
"text": "def populate_session(aPlayer)\n\t\tsession[:email] = @player.email\n\t\tsession[:player_id] = @player.id \n\t\tsession[:admin] = @player.admin\n\t\tsession[:login_time] = Time.now.to_i \n\tend",
"title": ""
},
{
"docid": "c99a1008a7dae6ba3add5d97fe19ea37",
"score": "0.5324849",
"text": "def new_wizard_selection\n init_variables_from_sessions\n end",
"title": ""
},
{
"docid": "ee8e11b87ce085c28a12b4945a9af7cb",
"score": "0.5241335",
"text": "def played_survey_params\n params.require(:played_survey).permit(:user_id, :section_id, :option)\n end",
"title": ""
},
{
"docid": "5ae9cbbebbb9d6d5a79c14cc5ae67764",
"score": "0.52272576",
"text": "def set_time_trial\n @time_trial = TimeTrial.find(params[:id])\n end",
"title": ""
},
{
"docid": "2174bef32ff9284e234c3f73ffb03c07",
"score": "0.52187014",
"text": "def set_time_before_save\n \n if self.quiz.quiz_type_id == QuizType.find_by_name(\"FullQuiz\").id\n if self.section_type_id == SectionType.find_by_name(\"Quant\").id\n self.time = 35\n elsif self.section_type_id == SectionType.find_by_name(\"Verbal\").id\n self.time = 30\n end\n elsif self.quiz.quiz_type_id == QuizType.find_by_name(\"SectionQuiz\").id\n if self.section_type_id == SectionType.find_by_name(\"Quant\").id\n self.time = 35\n elsif self.section_type_id == SectionType.find_by_name(\"Verbal\").id\n self.time = 30\n end\n else\n self.time = 0 \n end\n \n # This is required as the call_back will fail if false is returned.\n nil\n \n end",
"title": ""
},
{
"docid": "cdf7f845b5db695842c9ec25836a255f",
"score": "0.5202415",
"text": "def load\n scenario_attrs = { scenario_id: @scenario.id }\n\n Current.setting = Setting.load_from_scenario(@scenario)\n\n if params[:scaling_attribute]\n Current.setting.scaling = Api::Scenario.scaling_from_params(params)\n end\n\n scenario_attrs[:scale] = Current.setting.scaling if Current.setting.scaling\n\n new_scenario = Api::Scenario.create(scenario: { scenario: scenario_attrs })\n Current.setting.api_session_id = new_scenario.id\n\n redirect_to play_path\n end",
"title": ""
},
{
"docid": "8fe5d9dfe9699f7d2d1a272746c01f89",
"score": "0.5186062",
"text": "def player_base\n @wealth = 0\n @fame = 0\n @current_exp = 0\n @exp_needed = 100\n @available_attribute_points = 30\n @total_proficiency_points = 1\n @available_proficiency_points = 1\n end",
"title": ""
},
{
"docid": "a043a2ac00a4ccb9465002864eb8e26d",
"score": "0.51398337",
"text": "def set_question_play\n @question_play = QuestionPlay.find(params[:id])\n end",
"title": ""
},
{
"docid": "387d3ef48e63c7d95c026d018aa6d116",
"score": "0.51199955",
"text": "def set_player_calculation\n @player_calculation = PlayerCalculation.find(params[:id])\n end",
"title": ""
},
{
"docid": "ab094c9f0bef844b34c56b5369a5861b",
"score": "0.5110832",
"text": "def call\n # Can not be both unrecognised and incorrect\n session[SESSION_KEY] = session[SESSION_KEY].except('unrecognised')\n add_fields(incorrect: true)\n end",
"title": ""
},
{
"docid": "9b13c6128b71e217b3639036397a7ed9",
"score": "0.50983083",
"text": "def running_params\n sport_session_params('running') # Delegates to method on superclass (SportSessionController)\n end",
"title": ""
},
{
"docid": "2b7c598e99a5d90bcbf7b905f77b86fa",
"score": "0.5092618",
"text": "def completed_quests; $game_variables[17]; end",
"title": ""
},
{
"docid": "34330492d2f28c6653fdbe69e1c05666",
"score": "0.5092132",
"text": "def set_training_session\n @training_session = TrainingSession\n .includes(:general_ledgers, :instructors,\n :class_location)\n .includes(general_ledgers:\n %i[financial_account ledger_category])\n .includes(enrollments: [\n { session_rating: :user },\n :user\n ])\n .find(params[:id])\n end",
"title": ""
},
{
"docid": "e6916f683be36006fd289cec8a143c71",
"score": "0.5084776",
"text": "def load_questionnaire\n if params[:id]\n @questionnaire = Questionnaire.find(params[:id])\n @instance = @questionnaire.course_instance\n else\n @instance = CourseInstance.find(params[:course_instance_id])\n end\n \n @course = @instance.course\n end",
"title": ""
},
{
"docid": "f15b07b2bc9b450aaa470533e72454c9",
"score": "0.50819176",
"text": "def get_player_input\n temp_input = request_player_input\n temp_input = validate_player_input(temp_input)\n store_player_input(temp_input)\n end",
"title": ""
},
{
"docid": "42af9b602674e40e3827c2715f3f31bf",
"score": "0.50606513",
"text": "def get_survey\n SessionReview.find_by_request_id(self.id)\n end",
"title": ""
},
{
"docid": "ded9ce859e9a39dd91de2347d101cad3",
"score": "0.5044588",
"text": "def gameplay; @gameplay ||= match.gameplays[current_player_side]; end",
"title": ""
},
{
"docid": "ab4aa93b876444a399642e98bfb0d50a",
"score": "0.5028941",
"text": "def human_and_human_player(size)\n\t@player1 = \"player\"\n @player2 = \"player\"\nend",
"title": ""
},
{
"docid": "14c80f7845063a25a85d0e15e2cd43ce",
"score": "0.5017615",
"text": "def set_derived_fields\n self.type = weams_type\n self.va_highest_degree_offered = highest_degree_offered\n\n self.flight = flight?\n self.correspondence = correspondence?\n self.approved = approved?\n\n true\n end",
"title": ""
},
{
"docid": "fc559ca83edbd602860f7f1fa95591c1",
"score": "0.5011097",
"text": "def first_challenge\n epic_tragedy = {\n montague: {},\n capulet: {}\n }\nend",
"title": ""
},
{
"docid": "33fb4e37fb17dd2d0bc19790d346e9f4",
"score": "0.50091827",
"text": "def survey_params\n params.permit(:user_id, :team_id, :practice_id, :survey_type,\n :datetime_today, :player_rpe_rating,\n :player_personal_performance,\n :participated_in_full_practice,\n :minutes_participated,\n :participated_in_full_practice, :completed, :season,\n :hours_of_sleep, :quality_of_sleep, :academic_stress,\n :life_stress, :soreness, :ounces_of_water_consumed,\n :hydration_quality)\n end",
"title": ""
},
{
"docid": "01464d89b83939055a89ab4f387b09b4",
"score": "0.50074375",
"text": "def load_survey(reward_scheme_id, is_preview = false)\n # ensure preview\n ensure_preview(is_preview)\n # 1. ensure reward_scheme exist\n # 2. get survey_id from rewarc_scheme\n # 3. ensure survey exist and not deleted\n render_404 if reward_scheme_id.nil?\n reward_scheme = RewardScheme.find_by_id(reward_scheme_id)\n render_404 if reward_scheme.nil?\n survey_id = reward_scheme.survey_id\n ensure_survey(survey_id)\n if @survey.is_a? SurveyTask\n redirect_to @survey.get_encoded_url(current_user)\n return\n end\n # 4. Check whether an answer for this survey is already exist.\n # If the user is signed in, ask his answer from Quill.\n # If the user is not signed in, check the cookie\n # If answer exists, get percentage\n if user_signed_in\n answer = Answer.find_by_survey_id_sample_id_is_preview(survey_id, current_user._id.to_s, is_preview)\n else\n answer = Answer.find_by_id(cookies[cookie_key(survey_id, is_preview)])\n end\n if answer.is_a? AnswerTask\n redirect_to \"/\"\n return\n end\n @percentage = -1\n if answer.present?\n if answer.user.present? && answer.user != current_user\n cookies.delete(cookie_key(survey_id, is_preview), :domain => :all)\n answer = nil\n else\n answer.update_status\n redirect_to show_a_path(answer.id.to_s) and return if !answer.is_edit\n @percentage = answer.answer_percentage\n end\n else\n \tcookies.delete(cookie_key(survey_id, is_preview), :domain => :all)\n end\n\n # 5. get real reward\n # If answer exists, reward is in answer; \n # if answer does not exist, reward is in reward scheme\n ensure_reward(reward_scheme_id, answer.nil? ? reward_scheme.rewards : answer.rewards)\n\n # 6. Check whether survey is closed or not\n @survey_closed = !@is_preview && @survey.status != Survey::PUBLISHED\n if params[:ati].present?\n # checkout whether agent task is already closed\n agent_task = AgentTask.find(params[:ati])\n if agent_task.blank? || agent_task.status != AgentTask::OPEN\n @survey_closed = true\n end\n end\n \n # 10. get request referer and channel\n @channel = params[:c].to_i\n begin\n @referer_host = URI.parse(request.referer).host.downcase if request.referer.present?\n rescue => ex\n logger.debug ex\n end\n\n # 11. ensure spread url\n ensure_spread(@survey, reward_scheme_id)\n\n # 12. check ip restrict\n @forbidden_ip = !is_preview && !answer.present? && @survey.max_num_per_ip_reached?(request.remote_ip)\n end",
"title": ""
},
{
"docid": "2f5d826cfb6734e040591ccffa1ff230",
"score": "0.50060815",
"text": "def method_missing(method_name, *args, &blk)\n match = method_name.to_s.match(/^(.+)_determined_from_responses$/)\n identifier = match && match[1].to_sym\n\n # Checks to see if the response identifier is valid\n if Survey::RESPONSE_MAP[identifier]\n # Tries to get an existing instance variable before loading the value from the database\n var = instance_variable_get(\"@#{method_name}\") || value_for(identifier)\n else\n # Otherwise defaults to Surveyor's method_missing\n super\n end\n end",
"title": ""
},
{
"docid": "aeac3145d16a6e5438419e8a1a40366e",
"score": "0.5005116",
"text": "def start_questionnaire\n # bypassing the need for the user to select the survey - since we're launching with just one 'legislation'\n # When multiple legislations are available, this value will need to be provided by the form\n access_code = params[:survey_access_code] ||\n current_user.try(:default_jurisdiction) ||\n Survey::DEFAULT_ACCESS_CODE\n\n\n # if a dataset isn't supplied, create one for an authenticated user, or mock one for unauthenticated\n @dataset = Dataset.find_by_id(params[:dataset_id]) || (user_signed_in? ? current_user.datasets.create : Dataset.new)\n authorize! :update, @dataset\n\n # use the most recent survey\n @survey = Survey.where(:access_code => access_code).order(\"survey_version DESC\").first\n\n @response_set = ResponseSet.\n create(:survey => @survey,\n :user_id => current_user.try(:id),\n :dataset_id => @dataset.id\n )\n\n if @survey && @response_set\n session[:response_set_id] = current_user ? nil : @response_set.id\n\n if params[:source_response_set_id]\n source_response_set = ResponseSet.find(params[:source_response_set_id]) # TODO: ensure user has rights to copy the response set answers?\n @response_set.copy_answers_from_response_set!(source_response_set)\n end\n\n # flash[:notice] = t('surveyor.survey_started_success')\n redirect_to(surveyor.edit_my_survey_path(\n :survey_code => @survey.access_code, :response_set_code => @response_set.access_code))\n else\n flash[:notice] = t('surveyor.unable_to_find_that_legislation')\n redirect_to (user_signed_in? ? dashboard_path : root_path)\n end\n end",
"title": ""
},
{
"docid": "f76c19d848794c9c15ac532d493387a7",
"score": "0.5000109",
"text": "def load_sections(solution_to_load = nil, show_previews = false)\n\n user = User.find session[:user]\n plan = user.semesters.find(params[:id]).course_plan\n semester = Semester.find(params[:id]);\n courses = semester.cis_courses\n\n if solution_to_load\n plan.cis_sections.delete plan.cis_sections\n plan.cis_sections.concat session[:solution][solution_to_load]\n end\n\n # previews stuff\n npreviews = 6\n @solutions = session[:solution]\n\n @total_width = 100\n @total_height = 100\n padding_horiz = 5\n padding_vert = 5\n ndays = 6\n nhours = 15\n @start_hour = 8\n\n @seconds_per_pixel = nhours * 60 * 60 / (@total_height - 2 * padding_vert)\n\n @width = (@total_width - 2 * padding_horiz)/ ndays\n\n @day_left = {\n 'M' => 0,\n 'T' => @width,\n 'W' => @width * 2,\n 'R' => @width * 3,\n 'F' => @width * 4,\n 'S' => @width * 5,\n }\n\n if !session[:generator_error] && (!session[:solution] || session[:solution].length == 0)\n session[:generator_error] = 'No possible schedules (Click here to close).'\n end\n\n render :update do |page|\n if solution_to_load\n page.replace_html 'times_row', :partial => 'times_row', :locals => {:semester => semester}\n courses.each do |course|\n if course.sections_for_semester(semester) && course.sections_for_semester(semester).length != 0\n page.replace_html \"sects_#{semester.id}_#{course.id}\", :partial => 'section_choice', :collection => course.sections_for_semester(semester), :locals => {:semester => semester}\n end\n end\n else\n if session[:generator_error]\n page.replace_html 'generator_error', session[:generator_error]\n else\n page.replace_html 'previews_list', :partial => 'solution', :collection => @solutions[session[:marker], npreviews]\n end\n end\n if show_previews\n page.visual_effect :toggle_blind, 'previews_window'\n end\n end\n end",
"title": ""
},
{
"docid": "6d05dc78d613ec796df55b94e4134c4e",
"score": "0.49917692",
"text": "def set_duration\n #These need to be passed on to recreate the original form should cancel then set be pressed\n @object_name = params[:object_name]\n @field_name = params[:field_name]\n @optional = params[:optional]\n @prefix = params[:prefix]\n end",
"title": ""
},
{
"docid": "d077b42bd34cf2634d52af73020effa3",
"score": "0.49902678",
"text": "def set_player_field(msg, player, field, value)\n case field\n when /skill/\n # Check that the player has skill points to spend\n unless player.skillPoints > 0\n msg.reply \"You don't have any skill points left. :(\"\n return\n end\n # Add a skill point for that skill\n if player.skillup skill_name\n player.skillPoints -= 1\n msg.reply \"Done!\"\n else\n msg.reply \"I'm sorry, that is not a valid skill. :(\"\n end\n else\n msg.reply \"Sorry, that action is not available. :(\"\n return\n end\n end",
"title": ""
},
{
"docid": "ed134f5929a1f4434bca15e14fb1f579",
"score": "0.49825102",
"text": "def form_setup\n\t\t@times = Lovs.time_array(15)\n\tend",
"title": ""
},
{
"docid": "5e680f8a7fd543db2f96bbce4f1b8749",
"score": "0.4977058",
"text": "def set_play\n @play = Play.includes(:opponent, :player, :winner).find(params[:play_id])\n end",
"title": ""
},
{
"docid": "ea79c7eb3607a5f1179d47a3628b8e9b",
"score": "0.49675587",
"text": "def beginning_minute=(string)\n frm.select(:id=>\"release_minute\").select(string)\n end",
"title": ""
},
{
"docid": "1493a4c1e216d22d21964334cf12fd0a",
"score": "0.49630135",
"text": "def set_punchtime\n @punchtime ||= Punchtime.find(params[:id])\n end",
"title": ""
},
{
"docid": "e8d2cc5d9eb5dbeb203c488612e98992",
"score": "0.49575695",
"text": "def show\n practice = Practice.find(params[:id])\n @assignment = Assignment.find(practice.assignment)\n @assignment_group = practice.assignment_group\n if (current_user.role? \"admin\") || (@assignment_group.students.pluck(:student_id).include? current_student.id)\n @flag = Favourite.find_by(user_id: current_user.id,assignment_id: @assignment.id)\n @rb = @assignment.answers.where(language: \"ruby\")\n @js = @assignment.answers.where(language: \"javascript\")\n @py = @assignment.answers.where(language: \"python\")\n # create time of viewing the assignment only once when the user clicks on the practice link\n #binding.pry\n SubmissionTimer.create(user_id: current_user.id, practice_id: params[:id], assignment_id: @assignment.id, assignment_group_id: practice.assignment_group_id) if SubmissionTimer.find_by(user_id: current_user.id, practice_id: params[:id], assignment_id: @assignment.id, assignment_group_id: practice.assignment_group_id).nil?\n #binding.pry\n @start_time = SubmissionTimer.find_by(user_id: current_user.id, practice_id: params[:id], assignment_id: @assignment.id, assignment_group_id: practice.assignment_group_id)\n #binding.pry\n else \n redirect_to root_path, notice: \"The page you are looking for does not exist\"\n end\n end",
"title": ""
},
{
"docid": "97d522f6adb81e7fd9a261076ad593e5",
"score": "0.4953996",
"text": "def set_player\n\n end",
"title": ""
},
{
"docid": "9548b8375990e4129d8b0c7423540ef3",
"score": "0.49389613",
"text": "def beginning_hour=(string)\n frm.select(:id=>\"release_hour\").select(string)\n end",
"title": ""
},
{
"docid": "404a664d272bbdfbb143fa38200c2f74",
"score": "0.49360448",
"text": "def setInputsInSession()\n session[:dayComboId] = params[\"conflict_checker\"][\"day_combinations_id\"]\n session[:timeRanges] = params[\"conflict_checker\"][\"time_ranges\"]\n session[:buildingId] = params[\"conflict_checker\"][\"buildings_id\"]\n end",
"title": ""
},
{
"docid": "9493885355b169ff0aa9486e4b29ca10",
"score": "0.49348852",
"text": "def set_radio_performance\n @radio_performance = RadioPerformance.find(params[:id])\n end",
"title": ""
},
{
"docid": "4a9b5dbbb2afd287eaccdfc2d32485e5",
"score": "0.49275395",
"text": "def choice_acquisition\n if @player_role_selection == 'breaker'\n @proposed_code = player_choice_acquisition\n elsif @player_role_selection == 'maker'\n @proposed_code = computer_choice_acquisition\n end\n puts \"Playing #{@proposed_code}\"\n end",
"title": ""
},
{
"docid": "9bb8acaaf081da9a4b2ca35bdec1f242",
"score": "0.4919894",
"text": "def set_evaluation\n @evaluation = @course.evaluations.find(params[:id])\n # @evaluation = Evaluation.find(params[:id])\n end",
"title": ""
},
{
"docid": "98f198ff01149a3112b8c4842dbe7987",
"score": "0.49188164",
"text": "def set_survey_section\n @survey_section = SurveySection.find(params[:id])\n end",
"title": ""
},
{
"docid": "a69a91bb5d1750af89847dfa25799cff",
"score": "0.49163195",
"text": "def set_fullassessment\n @fullassessment = Fullassessment.find(params[:id])\n end",
"title": ""
},
{
"docid": "464cb3825aec76a9ff2acfc86819d7b0",
"score": "0.49153817",
"text": "def set_stat_of_player_of_team_of_match\n @stat_of_player_of_team_of_match = StatOfPlayerOfTeamOfMatch.find(params[:id])\n end",
"title": ""
},
{
"docid": "0071834173159f3a62ca787fc7eda8ed",
"score": "0.4915169",
"text": "def get_user_parms\r\n parms = UserParameter.find(1)\r\n @cheap = parms.bargain_limit\r\n @mort_cheap = parms.low_mortgage_limit\r\n @earlyad = parms.early_ad\r\n @log.info \"Running with parms: Cheap: #{@cheap}, Mortgage split: #{@mort_cheap}, Early Ad Id: #{@earlyad} \"\r\n end",
"title": ""
},
{
"docid": "3016cea10719abacd1f0e5160efae245",
"score": "0.49145466",
"text": "def one_player_mode\nend",
"title": ""
},
{
"docid": "59dd5584ae835a4a51530feb96fe485c",
"score": "0.4902892",
"text": "def set_four_choice_question\n @four_choice_question = FourChoiceQuestion.find(params[:id])\n end",
"title": ""
},
{
"docid": "1b199e0768b6a51908f1f52f03a591c7",
"score": "0.4899676",
"text": "def set_game_question\n @game_question = GameQuestion.find(params[:id])\n end",
"title": ""
},
{
"docid": "c71513a763c787546bd9bfed0862a2c0",
"score": "0.4898765",
"text": "def radio\n @tab_title = I18n.t('radiography.radio_tab')\n ts = TeamStats.new( @team )\n ts.retrieve_data\n @team_stats = ts.get_team_stats_dao\n end",
"title": ""
},
{
"docid": "a0da3746e5974309a599b2a7a61c3772",
"score": "0.4886851",
"text": "def set_variable\n set_master_layout(1)\n @years = Course.select(:couse_year).where(:user_id => current_user.id).group(:couse_year).order(\"couse_year desc\")\n @courses = []\n @rooms = []\n @roombyid = nil\n \n #@pendingapprove = []\n \n @isparamcorrect = false\n \n #@courses = Course.where(:couse_year => 2561)\n #@rooms = Room.where(:course_id => 10)\n #@pendingapprove = Scourse.scourse_pending(10,1)\n if params[:year].present?\n @courses = Course.where(:couse_year => params[:year],:user_id => current_user.id)\n end\n if params[:course].present?\n #room_course_user(params[:course],current_user.id)\n @rooms = Room.where(:course_id => params[:course])\n flash[:course] = params[:course]\n end\n if params[:room].present? and params[:course].present? \n @isparamcorrect = true\n @roombyid = Room.find(params[:room].to_i)\n #@pendingapprove = Scourse.scourse_pending(params[:course],params[:room])\n flash[:room] = params[:room]\n end \n \n if request.xhr?\n respond_to do |format|\n format.json {\n render json: {\n years: @years,\n courses: @courses,\n rooms: @rooms\n }\n }\n end\n end\n end",
"title": ""
},
{
"docid": "91e22a5aca11f1bdc865287b25eb4475",
"score": "0.48854715",
"text": "def new_player_required?; false end",
"title": ""
},
{
"docid": "e2779f0091376f2597e0ddc9db4192d7",
"score": "0.48808146",
"text": "def new\n# \t@player = Player.new\n \t@player_evaluation = @player.player_evaluations.build\n end",
"title": ""
},
{
"docid": "330bc908424ceea0659a92bd3915e979",
"score": "0.48795584",
"text": "def set_question\n @course = Course.find(params[:course_id])\n @oh_time_slot = OhTimeSlot.find(params[:oh_time_slot_id])\n @oh_queue = OhQueue.find(params[:oh_queue_id])\n @question = Question.find(params[:id])\n end",
"title": ""
},
{
"docid": "a5864f3d73e4c7e477edcfc64e89edfa",
"score": "0.48763457",
"text": "def set_field\n @field = @hospital[params[:id]]\n @name = params[:id]\n end",
"title": ""
},
{
"docid": "59a90de77f91b14edb5da3f5051d2470",
"score": "0.4869484",
"text": "def load_user\n if(user_signed_in?)\n @user = User.find(current_user.id)\n @config = @user.config\n @timer = @user.timer\n active_quest = @user.active_quest\n if(active_quest.nil?)\n @active_quest_model = nil\n @active_quest_name = ''\n @active_quest_url = '#'\n @active_quest_campaign_name = ''\n @active_quest__campaign_url = '#'\n else\n @active_quest_model = active_quest\n @active_quest_name = active_quest.name\n @active_quest_url = quest_path(active_quest)\n @active_quest_campaign_name = active_quest.campaign.name\n @active_quest_campaign_url = campaign_path(active_quest.campaign)\n end\n end\n end",
"title": ""
},
{
"docid": "56c04c3cdd0718f256a37c21e1358b42",
"score": "0.48676693",
"text": "def get_player_field(msg, player, field)\n case field\n when /level/\n msg.reply player.level\n when /name/\n if player.name\n msg.reply player.name\n else\n msg.reply \"Sorry, you do not have a name yet.\"\n msg.reply \"Use !player set name to give your character a name.\"\n end\n when /race/\n if player.race\n msg.reply player.race\n else\n msg.reply \"Sorry, you do not have a race yet.\"\n msg.reply \"Use !player set race to choose your race.\"\n end\n when /class/\n if player.baseType\n msg.reply player.baseType\n else\n msg.reply \"Sorry, you do not have a base class yet.\"\n msg.reply \"Use !player set class to choose your class.\"\n end\n else\n msg.reply \"Sorry, that action is not available. :(\"\n return\n end\n end",
"title": ""
},
{
"docid": "89c4d00a8edd8826fcaba3e1bc03efb9",
"score": "0.48655626",
"text": "def set_derived_fields\n self.credit_for_mil_training = to_yes_string(vet2)\n self.vet_poc = to_yes_string(vet3)\n self.student_vet_grp_ipeds = to_yes_string(vet4)\n self.soc_member = to_yes_string(vet5)\n self.calendar = to_calendar(calsys)\n self.online_all = to_true_string(distnced)\n\n true\n end",
"title": ""
},
{
"docid": "8ece2f83c702dd41ae04d882056fc689",
"score": "0.48564872",
"text": "def radio\n # --- \"Radiography\" tab: ---\n #@team_ids = @swimmer.teams.collect{|row| row.id }.uniq\n @tab_title = I18n.t('radiography.radio_tab')\n @swimmer_name = @swimmer.get_full_name\n #@ssd = SwimmerStatsDAO.new( @swimmer )\n #@ssd.calculate_stats\n ss = SwimmerStats.new(@swimmer)\n ss.retrieve_data\n @ssd = ss.get_swimmer_stats_dao\n end",
"title": ""
},
{
"docid": "e46be3bfcc9b0b0e593cf9c0bd78fbb4",
"score": "0.4852906",
"text": "def set_play\n @play = Play.includes(:player, :opponent, :winner, :messages).find(params[:id])\n end",
"title": ""
},
{
"docid": "1f25e0c8aee3d353e4b75d91fec6578a",
"score": "0.4850936",
"text": "def set_conference_session_and_check_permission\n @conference_session = Minisymposium.find(params[:minisymposium_id]) if params[:minisymposium_id]\n @conference_session = Minitutorial.find(params[:minitutorial_id]) if params[:minitutorial_id]\n @conference_session = ContributedSession.find(params[:contributed_session_id]) if params[:contributed_session_id]\n @conference_session = PosterSession.find(params[:poster_session_id]) if params[:poster_session_id]\n current_user.owns!(@conference_session) if @conference_session\n end",
"title": ""
},
{
"docid": "25c1052d99a2d5f4f234110ed467a1c2",
"score": "0.4850591",
"text": "def get_conference_standings(conf)\n doc = getHTML(\"http://espn.go.com/mens-college-basketball/conferences/standings/_/id/#{conf.webExt}\")\n \n table = doc.xpath('//table[@class = \"tablehead\"]')[1]\n rows = table.css('tr[@class != \"colhead\"]')\n rows.each do |row|\n col = row.css('td')\n if(col.count == 7)\n name = col[0].text\n\n home = col[3].text.scan((/(\\d+)-(\\d+)/))\n homeWin = home[0][0].to_i\n homeLoss = home[0][1].to_i\n\n away = col[3].text.scan((/(\\d+)-(\\d+)/))\n awayWin = away[0][0].to_i\n awayLoss = away[0][1].to_i\n\n pointsAllowed = col[6].text\n\n # Updates specific teams entry with newly scraped data\n team = Team.find_by! name: name \n team.update(homeWins: homeWin, homeLosses: homeLoss, awayWins:awayWin, awayLosses: awayLoss, defPoints: pointsAllowed)\n end\n end\n end",
"title": ""
},
{
"docid": "f0ae5d72fb83f2cec4daac36e3b22538",
"score": "0.48492682",
"text": "def getplayer1\r\n\t\t\treturn @player1\r\n\t\tend",
"title": ""
},
{
"docid": "62981db0652eca85365655cc1a7da205",
"score": "0.48432398",
"text": "def set_trial\n @trial = Trial.find(params[:id])\n end",
"title": ""
},
{
"docid": "923412cf8e333fadfaa90ae564a3d856",
"score": "0.48425803",
"text": "def set_teamquest\n @teamquest = Teamquest.find(params[:id])\n end",
"title": ""
},
{
"docid": "04f6ed7df5700d9f7a3267fc741631db",
"score": "0.48321584",
"text": "def set_player_record\n @player_record = PlayerRecord.find(params[:id])\n end",
"title": ""
},
{
"docid": "4840843328a15e957e7ec72c9a38ab82",
"score": "0.48287424",
"text": "def incoming_challenge\n # user can submit to this url to enter a rockTCHA challenge based on their session\n @receivedsesh = ReceivedSession.find_or_create_by(:session_id=>params[:session_id],:ip=>request.remote_ip)\n # their session is then attached to a random song\n # If params :username is available, only search for songs created by that username\n if params[:username]\n user = User.find_by(username: params[:username])\n else\n user = nil\n end\n # is there a user? if so get songs by user\n user ? songs = user.songs : songs = Song.all\n #size = songs.size\n song_ids = songs.map(&:id)\n #first_id = songs.first.id rescue nil # incase no songs have been created by the user...\n unless song_ids.empty?\n # assuming there's no gaps in song ids...\n num = song_ids.sample # gets random item from array - ensures there is an id in the following find \n song = Song.find(num)\n\n @rocksesh = song.rock_sessions.create(:received_session_id=>@receivedsesh.id)\n # the user submits a form (rock answer) that must match the name of the song.\n @rockanswer = @rocksesh.received_answers.build()\n # if the user reloads the page with the same session, a new rocksesh is generated for that session\n else\n puts \"No songs created yet!\"\n flash[:notice]=\"No songs created yet!\"\n end\n end",
"title": ""
},
{
"docid": "87b9b365f05a2f928d3f1cbb688b595f",
"score": "0.48252842",
"text": "def set_fourth_scenario\n @fourth_scenario = FourthScenario.find(params[:id])\n end",
"title": ""
},
{
"docid": "010e43c28c4655bfa5756dd5d8e3aceb",
"score": "0.48232523",
"text": "def first_challenge\n epic_tragedy = {\n :montague => {},\n :capulet => {}\n }\nend",
"title": ""
},
{
"docid": "d34c1192165d03f1c32271d770cc68f2",
"score": "0.48192543",
"text": "def start\n setPlayers\n question\nend",
"title": ""
},
{
"docid": "4b2ce8f07d30c2e23592a2541e92506f",
"score": "0.48189938",
"text": "def set_survey_response\n @survey_response = SurveyResponse.find(params[:id])\n end",
"title": ""
},
{
"docid": "c876399474275af1ba09453d7fcc79ba",
"score": "0.4816823",
"text": "def set_quest_stat\n @quest_stat = QuestStat.find(params[:id])\n end",
"title": ""
},
{
"docid": "95b19583909790066ff34f5e5e78215f",
"score": "0.48139808",
"text": "def set_renting_phase\n @renting_phase = RentingPhase.find(params[:id])\n end",
"title": ""
},
{
"docid": "0b4b371b1727847655094bdecf25a762",
"score": "0.48113087",
"text": "def set_operation_player\r\n @operation_player = Operation::Player.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "b31bae7417ecda96e3501ba63b38d950",
"score": "0.48086795",
"text": "def difficulty\n if @session_ratio > 85\n @level = 3\n @random = Question.where(difficulty: 'hard')[rand(40)]\n elsif @session_ratio > 60\n @level = 2\n @random = Question.where(difficulty: 'medium')[rand(40)]\n else\n @level = 1\n @random = Question.where(difficulty: 'easy')[rand(40)]\n end\n end",
"title": ""
},
{
"docid": "36ff5954ae4497ea4c0520501b240e1a",
"score": "0.48074716",
"text": "def set_teams_player\n @teams_player = TeamsPlayer.find(params[:id])\n end",
"title": ""
},
{
"docid": "9a38d74ad90a6563ea15429f2c154993",
"score": "0.48062176",
"text": "def set_player_game_statistic\n @player_game_statistic = PlayerGameStatistic.find(params[:id])\n end",
"title": ""
},
{
"docid": "5e057da3556a19a6ffaeed74ee3d7e85",
"score": "0.48050153",
"text": "def set_preptime\n @preptime = Preptime.find(params[:id])\n end",
"title": ""
},
{
"docid": "f8f9d3b271d26ab4e0f6d67a9f60a4c3",
"score": "0.48009646",
"text": "def set_initial_survey\n @initial_survey = InitialSurvey.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a7517a47a4e305023ccef712387f7ee",
"score": "0.47995406",
"text": "def record_users_choice input\n\n if input == \"p\"\n player_picked = \"Paper\"\n elsif input == \"r\"\n player_picked = \"Rock\"\n elsif input == \"s\"\n player_picked = \"Scissors\"\n end\nend",
"title": ""
},
{
"docid": "46529d3cfc4929335a414cc8ad22e11c",
"score": "0.4794979",
"text": "def set_field_of_study_and_semester\n @field_of_study = FieldOfStudy.find params[:field_of_study_id]\n @semester = Semester.find params[:id]\n end",
"title": ""
},
{
"docid": "21765e4621d6bbd276cd1e877a42b218",
"score": "0.47870293",
"text": "def get_recording_info(twilio_id, call_duration, answered_by)\n self.duration = call_duration\n client = Twilio::REST::Client.new ACCOUNT_SID, AUTH_TOKEN\n recordings_info = client.account.calls.get(twilio_id).recordings\n self.recording_url = recordings_info.list.first.mp3\n self.recording = recordings_info.list.first.sid\n self.answered_by = answered_by\n self.save\n end",
"title": ""
},
{
"docid": "5293bfc76e9255ce27aa9e5416d63a7f",
"score": "0.47838563",
"text": "def set_smallsurvey\n @smallsurvey = Smallsurvey.find(params[:id])\n end",
"title": ""
},
{
"docid": "f428d79d5876fd8e2d0cb58bb2b1cff1",
"score": "0.47828528",
"text": "def player1value\n return @Player1\n end",
"title": ""
},
{
"docid": "15e4f33f9e9e38c829960942d91862f1",
"score": "0.47825703",
"text": "def get_survey_course\n self.course ||= survey.course if survey\n end",
"title": ""
},
{
"docid": "d75945f6d3b1de14e0ac7cd1ae871877",
"score": "0.4779235",
"text": "def lecturer\n unless logged_user.lecturer? then\n render_403 and return\n end\n\n if request.get? then\n @lecturer = logged_user.lecturer\n elsif request.put? then\n lecturer = Lecturer.find(logged_user.lecturer.id)\n lecturer.department_id = params[:department]\n lecturer.scientific_degree_id = params[:degree]\n # Сброс уровная подтверждения преподавателя\n unless lecturer.real? then\n lecturer.confirm_level = Lecturer::CONFIRM_LEVELS[:unconfirmed]\n end\n if lecturer.save then\n if params[:reg] then\n redirect_to :root\n else\n redirect_to :settings_lecturer, alert: t('settings.save_suc')\n end\n else\n redirect_to :settings_lecturer, notice: t('settings.save_fail')\n end\n end\n end",
"title": ""
},
{
"docid": "eb1e64093c74e5e3793023c6207f07c1",
"score": "0.47770575",
"text": "def show\n @session = FitnessSession.find(params[:id])\n if @session.time_started != nil && @session.time_finished\n session_results\n end\n end",
"title": ""
},
{
"docid": "25046edb48652c327d04643c74e1c75f",
"score": "0.4774106",
"text": "def results_for_competition\n return if disqualified?\n return if competition.nil?\n\n if competition.imports_times?\n unless time_is_present?\n errors.add(:base, \"Must enter full time\")\n end\n else\n unless points?\n errors.add(:base, \"Must select either time or points\")\n end\n end\n end",
"title": ""
},
{
"docid": "f3609be9c11902b7c2088a464a6b2c08",
"score": "0.47737694",
"text": "def play_game\nget_winner(comp_choose_rps,user_choose_rps)\t\nend",
"title": ""
},
{
"docid": "9e3d726c676872ecfaec5f214b7f1a16",
"score": "0.47729734",
"text": "def replay_at_params\n params['user_id'] = session[:user_id]\n params.permit(:user_id, :lecture_id, :playtime)\n end",
"title": ""
},
{
"docid": "5ebe8d2647f235054dfd891316462512",
"score": "0.47715294",
"text": "def set_weekly_load\n sum_weekly_load = 0 + @daily_load\n # get all surveys from the past 6 days + today\n one_week_ago_start = @start_of_today - (6 * SECONDS_IN_ONE_DAY)\n surveys_this_week = Survey.for_user(@user_id).post_practice.surveys_for_week(one_week_ago_start, @end_of_today)\n # sum all surveys\n surveys_this_week.each do |survey|\n if survey.session_load.nil?\n return\n else\n sum_weekly_load += survey.session_load\n end\n end\n return sum_weekly_load\n end",
"title": ""
},
{
"docid": "a3bd5ab2cf340f11129201673ebb59d5",
"score": "0.47694826",
"text": "def set_recurring_available_hour\n \t@recurring_available_hour = RecurringAvailableHour.find(params[:id])\n \t@instructor = Instructor.find params[:instructor_id]\n end",
"title": ""
},
{
"docid": "51951cd60606ada2904024617b7835e7",
"score": "0.47688028",
"text": "def user_data\n @user_data ||= opts[:questionnaire_response]&.user_demographics_data\n end",
"title": ""
},
{
"docid": "c727c5b06a01b95292ae067b731f564e",
"score": "0.47641087",
"text": "def set_game_session_player\n @game_session_player = GameSessionPlayer.find(params[:id])\n end",
"title": ""
},
{
"docid": "c18eac748dd05201551a51d3b42ce692",
"score": "0.4762506",
"text": "def resume_full_automation_mode_time\n data[:resume_full_automation_mode_time]\n end",
"title": ""
},
{
"docid": "54f690aa05cc376c965c43c6a7b9838c",
"score": "0.47593835",
"text": "def set_p_time\n @p_time = PTime.find(params[:id])\n end",
"title": ""
}
] |
e7545ce7ed6d58fb606e0d5d072a229e
|
guess method takes letter parameter and stores it in guess arr checks word for match, returns true if there is a match
|
[
{
"docid": "6555bcf64010a8c3db5c6a2b3e2787d2",
"score": "0.8572724",
"text": "def guess(letter)\n @guesses << letter\n correct = false\n @word.each_char do |index|\n if index == letter\n correct = true\n end\n end\n correct\n end",
"title": ""
}
] |
[
{
"docid": "621f8b2164c3a6d40b914e61a8dc01c1",
"score": "0.85636175",
"text": "def guess(letter_guess)\n existed=false\n correct=false\n #check if valid\n \n if (letter_guess=='') || (letter_guess==nil) || (/[a-zA-Z]/.match(letter_guess)==nil)\n raise ArgumentError.new(\"invalid input\")\n end\n \n letter_guess.downcase!\n if !@guesses.empty?\n @guesses.each_char do |c|\n if c==letter_guess\n existed=true\n break\n end\n end\n end\n \n \n if existed ==false\n if !@wrong_guesses.empty?\n @wrong_guesses.each_char do |c|\n if c==letter_guess\n existed=true\n break\n end\n end\n end\n end\n \n #check if correct\n if existed ==false\n @word.each_char do |letter_correct|\n if letter_guess==letter_correct\n @guesses=@guesses+letter_guess.to_s\n correct=true\n break\n end\n end\n \n if correct==false\n @wrong_guesses=@wrong_guesses+letter_guess.to_s\n end\n else\n return false\n end\n \n end",
"title": ""
},
{
"docid": "140b053523b0e2257e5a2da62d9e2c2d",
"score": "0.853525",
"text": "def guess(letter)\n if letter == nil || !letter.match(/^[[:alpha:]]$/)\n raise ArgumentError.new()\n end\n guess = letter.downcase\n # if guess is new\n if !@guesses.include?(guess) && !@wrong_guesses.include?(guess)\n # correct guess\n if @word.downcase.include?(guess)\n @guesses << guess\n arr = (0 ... @word.length).find_all { |i| @word[i,1] == letter }\n arr.each do |i|\n @word_with_guesses[i] = guess\n end\n # incorrect guess \n else\n @wrong_guesses << guess\n end\n return true\n # existing guessed letter\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "86e29ec3195fc3150f193706ad3fa450",
"score": "0.853445",
"text": "def detect_letter(letter_guess)\n\t\tif @guessed_letters.include? letter_guess\n\t\t\treturn disguised_word\n\t\tend\n\n\t\t@guess_count += 1 \n\t\t@guessed_letters.push(letter_guess)\n\t\tif real_word.include? letter_guess\n\t\t\t\n\t\t\t# Loop through i from 0 to length of the word\n\t\t\t# to find all occurances of letter_guess\n\t\t\tfor i in 0..real_word.length\n\t\t\t\tif letter_guess == real_word[i]\n\t\t\t\t\tdisguised_word[i] = letter_guess\n\t\t\t\tend\n\t\t\tend\t\n\t\tend\n\t\treturn disguised_word\n\tend",
"title": ""
},
{
"docid": "78671a4214f4cf95c5d6107ab75e0807",
"score": "0.849882",
"text": "def guess(letter)\n #throw 'Error: Nil guess not allowed' if letter.nil?\n raise ArgumentError if letter.nil?\n \n #throw 'Error: Empty guess' if letter == ''\n raise ArgumentError if letter == ''\n \n #throw 'Error: Guess not a letter' if !letter.match(/[a-zA-Z]/)\n raise ArgumentError if !letter.match(/[a-zA-Z]/)\n\n # Convert letter to lowercase\n letter.downcase!\n \n # Check if letter is in word unless letter already guessed\n if word.include? letter\n unless guesses.include? letter\n # Add letter to guess array\n guesses << letter\n \n # Iterate through word\n for i in 0..word.length\n if word[i] == letter\n word_with_guesses[i] = letter\n # If all - replaced set check_win_or_lose to win\n @check_win_or_lose = :win if !word_with_guesses.include? '-'\n end\n end\n \n return true\n end\n else\n unless wrong_guesses.include? letter\n # Add letter to wrong_guesses array\n wrong_guesses << letter\n \n # If 7 wrong guesses entered\n if wrong_guesses.size >= 7\n # Set check_win_or_lose to lose\n @check_win_or_lose = :lose\n end\n \n return true\n end\n end\n # Word does not contain guessed letter return false\n return false\n end",
"title": ""
},
{
"docid": "c0b3485150e5dd8d988c6d6562c03eb1",
"score": "0.8475899",
"text": "def guess?(letter)\n if @word.include?(letter)\n right = @array_of_letters.each_index.select { |i| @array_of_letters[i] == letter }\n right.each { |n| @displaying_word[n] = letter }\n puts \"true\"\n puts @displaying_word\n else\n puts 'false'\n end\n end",
"title": ""
},
{
"docid": "e5fd9db17b104c1649b911c9a013ea57",
"score": "0.84626794",
"text": "def check_guess(letter)\n if word.include?(letter)\n guesses << letter\n else\n wrong_guesses << letter\n end\n end",
"title": ""
},
{
"docid": "9b3834e0ccb64595568fd34c5cf5e497",
"score": "0.8451655",
"text": "def guess(letter)\n\n raise ArgumentError, 'Guess is nil' unless not letter.nil?\n raise ArgumentError, 'Guess is empty' unless not letter.empty?\n letter.downcase!\n raise ArgumentError, 'Guess is not a letter' unless letter.match(/^[[:alpha:]]$/) \n\n if @word.include? letter\n if @guesses.include? letter\n return false\n else \n @guesses += letter\n end\n else\n if @wrong_guesses.include? letter\n return false\n else\n @wrong_guesses += letter\n end\n end\n end",
"title": ""
},
{
"docid": "2c7162ce44bd652e5eb19b377d844071",
"score": "0.84370136",
"text": "def guess(letter)\n raise ArgumentError if not letter =~ /[A-z]/\n letter.downcase!\n return false if @guesses.include? letter or @wrong_guesses.include? letter\n (@word.include? letter)? @guesses << letter : @wrong_guesses << letter\n end",
"title": ""
},
{
"docid": "052adf30584e9664bc48218b51f54812",
"score": "0.8426713",
"text": "def guess?(letter)\n if (@word.include?(letter))\n arr_of_indicies = []\n arr_of_indicies = @array_of_letters.each_index.select do |i|\n @array_of_letters[i] == letter\n end\n arr_of_indicies.each do |index|\n @displaying_word[index] = letter\n end\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "191b21552e4bd429fdb14e5343bd4d9e",
"score": "0.8424326",
"text": "def guess(letter)\n # Raise an argument if letter is empty or is not a letter\n if letter == nil or not letter =~ /^[a-zA-Z]$/i \n raise ArgumentError \n end\n \n # Letter to lower case\n letter = letter.downcase\n \n if (@word.include? letter) && (!@guesses.include? letter) # correct guess\n @guesses << letter\n true\n elsif (!@word.include? letter) && (!@wrong_guesses.include? letter) # wrong guess\n @wrong_guesses << letter\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "14787626aa19d7b9aad1bd7fc9286367",
"score": "0.8383175",
"text": "def guess(letter)\n raise ArgumentError, 'input nil' if letter == nil\n raise ArgumentError, 'empty input' unless letter.empty? == false\n raise ArgumentError, 'input not a letter' unless /[[:alpha:]]/ =~ letter\n letter.downcase!\n if @guesses.include? letter or @wrong_guesses.include? letter\n return false\n elsif @word.include? letter\n @guesses += letter\n else\n @wrong_guesses += letter\n end\n end",
"title": ""
},
{
"docid": "db5e7df5b8b13c4eceef3263f8ecb0d9",
"score": "0.8350309",
"text": "def guess?(letter)\n if(@word.include?(letter))\n array = []\n array = @bank.each_index.select do |i| \n @bank[i] == letter\n end\n array.each do |index|\n @show_word[index] = letter\n end\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "510477cd77069716ed0355b25b857b5b",
"score": "0.83374",
"text": "def guess?(letter)\n # puts \"guess letter for the word\"\n @word.include?(letter)\n end",
"title": ""
},
{
"docid": "7d913e472d6881226529146afdceda4a",
"score": "0.8287753",
"text": "def evaluate_guess(guess, word)\n\t\tif guess.length > 1\n\t\t\treturn \"yes\" if guess == word\n\t\t\treturn \"no\" if guess != word\n\t\tend\n\n\t\tletters = word.split(//)\n\t\tletter_locations = []\n\t\tletters.each_with_index do |letter, index|\n\t\t\tif letter == guess\n\t\t\t\tletter_locations << index\n\t\t\tend\n\t\tend\n\t\tif letter_locations.length == 0\n\t\t\treturn \"no\"\n\t\telse\n\t\t\treturn letter_locations\n\t\tend\n\tend",
"title": ""
},
{
"docid": "fa02b0afb258366c178ec3b8d943adb5",
"score": "0.8265779",
"text": "def check_letter_guess(guess)\n match = false\n @word_array.each_with_index do |letter, i|\n if letter == guess\n @current_status[i] = letter\n match = true\n if @current_status == @word_array\n @outcome = \"win\"\n end\n end\n end\n if match == false\n @points -= 1\n if lose?\n @outcome = \"lose\"\n end\n end\n end",
"title": ""
},
{
"docid": "f18e57c2369e6ac0b73c4b89a9d19498",
"score": "0.82436913",
"text": "def guess(letter)\n # raise ArgumentError when not a letter, empty, or nil\n raise ArgumentError if (letter.to_s == '') || \n (letter.nil?) || \n (letter =~ /[[^a-zA-Z]]/) # alphabetic characters, or /[[^alpha]]/\n\n # disable case-sensitivity\n letter.downcase!\n \n # check if a letter has already been guessed\n if (@guesses.include? letter) || \n (@wrong_guesses.include? letter)\n return false \n else\n if @word.include? letter\n @guesses << letter\n else\n @wrong_guesses << letter\n end\n end \n end",
"title": ""
},
{
"docid": "6c6358478b6838a79138d01e620e0e75",
"score": "0.82267725",
"text": "def check_guess\n if @guess.length.to_i > 1\n @words_guessed << @guess\n if @guess.upcase == @word\n print \"YAY! CONGRATS! #{@word.upcase} IS CORRECT!\"\n win\n else\n print \"Sorry, that was incorrect!\"\n @guesses_remaining -= 1\n end\n elsif @guess.length == 1 #IF USER GUESSES A LETTER\n @letters_guessed << @guess\n\n if @word.include?(@guess) #if guessed letter exists in generated word array, iterate over word array to check if letter matches\n puts \"YES! It DOES include #{@guess}!\"\n\n i = 0\n @word_array.each do |element|\n if @guess == element #letter\n @word_showing[i] = \"#{element}\" #resetting \"__\" element to guessed letter\n end\n i += 1\n end#of word_array loop\n\n else #if guessed letter does not exist\n puts \"Sorry, that letter does not exist!\"\n @guesses_remaining -= 1\n end\n end\n end",
"title": ""
},
{
"docid": "388c1a6493056721d2937845ac3c9b5e",
"score": "0.82261044",
"text": "def guess(letter)\n if letter.nil?\n raise ArgumentError.new(\"Guess in nil\")\n end\n\n if letter.empty?\n raise ArgumentError.new(\"Guess is empty\") \n end\n\n if /[^a-zA-Z]/ =~ (letter)\n raise ArgumentError.new(\"Guess is not a letter\")\n end \n\n if !@guesses.include?(letter.downcase) &&\n !@wrong_guesses.include?(letter.downcase)\n if @word.include?(letter)\n @guesses << letter.downcase\n else \n @wrong_guesses << letter.downcase\n end\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "994d282af2b77188d0da1c6ec7359ed1",
"score": "0.82179844",
"text": "def check_letter\n\n unless @used_letters.include?(@guess) == false\n puts \"You have already guessed this letter!\"\n puts \"Please guess again!\"\n @guess = gets.chomp.upcase\n else\n # add letter to used letters array\n @used_letters.push(@guess)\n end\n\n if @word.upcase.include?(@guess)\n for index in 0..@word.length - 1\n if @word[index].upcase == @guess\n # update_word #took it out of method just to check variable\n @word_so_far[index] = @guess\n end\n end\n puts \"What a great guess!\"\n puts \"Good job!\"\n update_board\n else\n #guess is wrong\n @wrong_count -= 1\n puts \"You have made a terrible guess!\"\n puts \"How could you pick that letter?!\"\n update_board\n puts \"You have #{ @wrong_count } guesses left.\"\n end\n end",
"title": ""
},
{
"docid": "c0c47b03a680e271555d70d94fa21f86",
"score": "0.82029295",
"text": "def guess?(letter)\n @word.downcase.include?(letter)\n end",
"title": ""
},
{
"docid": "f7286e2062cd8aac6e7c3acbdab1121f",
"score": "0.8202205",
"text": "def guess(letter)\n # Error Handling\n letter.downcase!\n if letter == nil || \n letter == '' || \n letter =~ /[^A-Za-z]/\n raise ArgumentError, \"Guess must be a letter\"\n # Already guessed letter\n elsif @guesses.include?(letter) || @wrong_guesses.include?(letter)\n return false\n # Found a match -> add to @guesses\n elsif word.include?(letter)\n @guesses += letter \n # No match -> add to @wrong_guesses\n else\n @wrong_guesses += letter \n end\n end",
"title": ""
},
{
"docid": "9d49c1e1364fa74d7be232adeb77d956",
"score": "0.82021374",
"text": "def guess(letter)\n raise ArgumentError, \"Argument is not a valid letter\" unless letter =~ /^[a-z]$/i\n @check_win_or_lose = :play\n letter = letter.downcase;\n if (letter =~ /^[a-z]$/i)\n @valid = true\n else\n @valid = false\n end\n \n # check if letter has already been guessed\n return false if (@guesses.include?(letter)) || (@wrong_guesses.include?(letter))\n \n # check if in word, if not, add to wrong, else, add to guesses\n if (@word.include?(letter) && @valid == true)\n @guesses << letter\n update_word_after_guess()\n # check if word finished\n if(@word_with_guesses == @word)\n @check_win_or_lose = :win\n end\n else\n @wrong_guesses << letter\n @guess_number += 1\n if(@guess_number == 7)\n @check_win_or_lose = :lose\n end\n end\n \n return true\n end",
"title": ""
},
{
"docid": "e02017b94cdd8fe94232616f4a2aa85f",
"score": "0.8199874",
"text": "def guess(letter)\n\tif letter.to_s.empty? || !letter.match(/^[a-zA-Z]+$/)\n\t\traise ArgumentError\n\tend\n\t\t\n\t# check if letter is in word\n\tif @word.downcase.include?(letter.downcase)\n\t\tif !@guesses.include?(letter.downcase)\n\t\t\t@guesses += letter.downcase\n\t\t\treturn true\n\t\tend\n\t\treturn false\n\t# check if letter is apart of the wrong guesses\n\telsif !@wrong_guesses.include?(letter.downcase)\n\t\t@wrong_guesses += letter.downcase\n\t\treturn true\n\tend\n\treturn false\n end",
"title": ""
},
{
"docid": "e72af1ba642cf5b00128399ff8286750",
"score": "0.8190516",
"text": "def check_letter(letter)\n #conditional logic to handle repetitions without incrementing counter\n @guess_count += 1\n @initial_word_array.each do |l|\n\n if letter == l\n @guess_array << letter\n puts \"you have guessed a correct letter. see below\"\n puts \"#{@guess_array}\"\n end\n end\n\n return @guess_array\n end",
"title": ""
},
{
"docid": "07ce1805b7351dbb4f856d5c46938a91",
"score": "0.81810266",
"text": "def guess_letter(guess)\n\t\tguess = guess[0]\n\t\tif @hangman_word.include?(guess)\n\t\t\t(@hangman_word.size).times do |index|\n\t\t\t\tif @hangman_word[index] == guess\n\t\t\t\t\t@game_word[index] = guess\n\t\t\t\tend\n\t\t\tend\n\t\tend# below, the arrays of guessed letters are updated, and normalized to be unique, and/or not containing the hangman words letters\n\t\t@guesses << guess\n\t\t@matched_guesses = @guesses - @hangman_word.chars \n\t\t@round_count = @matched_guesses.uniq.length\n\t\t@game_word\n\tend",
"title": ""
},
{
"docid": "2b2b513ad8a50b9ac99abb8560d0422b",
"score": "0.8177384",
"text": "def guess(letter)\r\n letter.downcase!\r\n if !@previous_guesses.include?(letter)\r\n @count += 1\r\n @guesses_left -= 1\r\n for i in 0...@word.length\r\n if @word[i] == letter\r\n @display[i] = letter\r\n @left -= 1\r\n end\r\n end\r\n end\r\n @previous_guesses << letter\r\n \r\n\r\n if @left == 0 || @guesses_left == 0\r\n @end = true\r\n else\r\n false\r\n end\r\n nextdisplay\r\n end",
"title": ""
},
{
"docid": "6b06bac2f6c5a40eb905308acaa3cd62",
"score": "0.8168906",
"text": "def guess(letter)\n # Strip whitespace and downcase the letter\n letterModified = letter.downcase.strip\n # Push the letter onto the array if doesn't already exist\n # Check to see if the letter has already been guessed\n if @lettersGuessed.include?(letterModified) == false\n @lettersGuessed.push(letterModified)\n end\n # Show how many times the letter appears\n letterAppears = 0\n if @word.include?(letterModified.upcase) || @word.include?(letterModified.downcase)\n @word.each_char {\n |ch|\n if ch == letterModified.upcase || ch == letterModified.downcase\n letterAppears += 1\n end\n }\n\n # Check to see if the user has won\n checkGameStatus?\n\n return letterAppears\n else\n # If the letter does not appear, deduct 1 from count and return 0\n @count -= 1\n return 0\n end\n end",
"title": ""
},
{
"docid": "1c5d53e1d55a79d3d6d87f759fa87bf8",
"score": "0.816111",
"text": "def guess(letter)\r\n\r\n\t\t@ref_word.each_index do |idx|\r\n\t\t\t\r\n\t\t\tif @ref_word[idx] == letter\r\n\t\t\t\t@correct_guesses[idx] = letter\r\n\t\t\t\t@ref_word[idx] = \"\"\r\n\t\t\tend\r\n\t\tend\r\n\r\n\tend",
"title": ""
},
{
"docid": "71231344676dca7593b9bbf7b136129e",
"score": "0.8155688",
"text": "def check_guess(letter)\n if letter.downcase != nil\n @guess = letter.downcase\n end\n @guess_is_present = secret_word.include?(@guess)\n @already_guessed = @previous_guesses.include?(@guess)\n @previous_guesses << @guess\n if @guess_is_present # checks letters\n index = 0\n # puts \"Nice guess!\"\n while index < secret_word.count do\n if secret_word[index] == @guess\n @display_guess[index] = @guess\n end\n index +=1\n end\n else\n puts \"Nope! Guess again.\"\n end\n p display_guess.join\n end",
"title": ""
},
{
"docid": "92f12f8a5c0b82b2edff4e232d2bd413",
"score": "0.8149234",
"text": "def user_guess(letter)\n index = 0\n while index < @word_length\n if @word_array[index] == letter\n if @guess_word[index] == \"-\"\n @guess_word[index] = letter\n @correct_letter = 1\n else\n @reused_letter = true\n end\n end\n index += 1\n end\n end",
"title": ""
},
{
"docid": "e34a240d6488a8339c0187bb59131ad1",
"score": "0.8124534",
"text": "def guess(guess_word)\n #@guess_word = guess_word\n raise ArgumentError, 'Argument is not a string' unless !guess_word.nil?\n raise ArgumentError, 'Argument is empty' unless !guess_word.empty?\n raise ArgumentError, 'Argument is not a letter' unless guess_word[/[a-zA-Z]+/] == guess_word\n \n \n if @guesses != guess_word && @wrong_guesses !=guess_word && guess_word != guess_word.upcase\n if @word.include? guess_word\n @guesses << guess_word\n else\n @wrong_guesses << guess_word\n end\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "304b620addda22a9c4a7386ba388ce37",
"score": "0.8104424",
"text": "def guess(letter)\n if letter == \"save\"\n save_game\n return\n end\n # Checks if the input is one valid letter\n if letter.length > 1 || letter == \"\" || letter < \"a\" || letter > \"z\"\n puts \"Invalid input!\"\n return\n # Checks if the input was already tried before\n elsif @wrong_letters.include?(letter) || @guesses.include?(letter)\n puts \"Letter already tried!\"\n return\n end\n # Returns the indexes of the matches found in the word\n matches_index = @word_array.each_index.select { |index| @word_array[index] == letter }\n # If there was a match, replace the underlines and checks if the game is over\n if matches_index.length > 0\n @guesses << letter\n matches_index.each { |index| @guesses_array[index] = @word_array[index] }\n @hits += matches_index.length\n if @hits == @word_array.length\n @finished = true\n @won = true\n end\n # If there wasn't a match take a life from the player and check if the game is over\n else\n @lifes -= 1\n @wrong_letters << letter\n if @lifes == 0\n @finished = true\n end\n end\n print_info\n end",
"title": ""
},
{
"docid": "2cf734151d1bf06bcd94672518612b1a",
"score": "0.8083627",
"text": "def guess(char)\n #raise error if letter is null or guess is not alphabetic char\n # src: https://stackoverflow.com/questions/6067592/regular-expression-to-match-only-alphabetic-characters\n raise ArgumentError if char.nil? or not char.match(/^[A-Za-z]+$/)\n \n # convert letter to lowercase\n char.downcase!\n \n #check if the letter is in the word and not guessed already\n if @word.include? char and not @guesses.include? char\n # add the char to the guesses\n @guesses << char\n return true\n # otherwise user guessed an incorrect letter \n # char isnt in the word\n elsif not @word.include? char \n # and it hasnt been guesssed before\n if not @wrong_guesses.include? char\n # add it to incorrect guesses\n @wrong_guesses << char\n return true\n end\n end\n \n return false\n end",
"title": ""
},
{
"docid": "3ca60fceb7e02a1746bf2ee035a9f377",
"score": "0.80498415",
"text": "def guess(letter)\n if word_has?(letter)\n \tput_letter_on_board(letter)\n else\n wrong_letter(letter) if !@guesses.include? letter\n end\n end",
"title": ""
},
{
"docid": "44d33529cb1ad1f2d807142fda62fdb1",
"score": "0.804448",
"text": "def guess(letter)\r\n if @word.include?(letter)\r\n # add the letter to the word status\r\n index = 0\r\n @word.each do |letterinword|\r\n if letterinword == letter\r\n @word_status[index] = letter\r\n end\r\n index += 1\r\n end\r\n elsif @guessed.include?(letter) # if the letter has already been guessed.\r\n else\r\n count_minus\r\n end\r\n @guessed.push(letter)\n end",
"title": ""
},
{
"docid": "372b0c368891be517177660e0e5e9c8b",
"score": "0.8043454",
"text": "def check_letter(word, guess)\n@c=word.include?(guess)\n0.upto(word.size - 1) do |b|\n\tif guess.include?(word[b,1]) then\n\t\t@result.push(b+1) \n\tend\nend\nend",
"title": ""
},
{
"docid": "17ccf8259ecc537e9a1e2d6e00289fa3",
"score": "0.80369484",
"text": "def checkletter(word, guess)\n\n@a=word.include?(guess)\n0.upto (word.size - 1) do |n|\n\n if guess.include?(word[n,1]) then\n @letterplace.push(n+1)\n end\n end\nend",
"title": ""
},
{
"docid": "9349501eb9be621c5f41d215aaf16381",
"score": "0.8023578",
"text": "def correct_guess(letter_guess)\n @letter_guess = letter_guess\n @letters_guessed << @letter_guess\n @guesses_left -= 1\n #find index of letter on secret word\n indices = @letters.each_index.select { |i| @letters[i] == @letter_guess}\n #put the letter on same index of game board\n indices.each{|i| @board[i] = @letter_guess}\n #return value array with letters added?\n end",
"title": ""
},
{
"docid": "eac529c47657b0d3de09c0e1ee4add5b",
"score": "0.8007206",
"text": "def guess(letter)\n\tif word_has?(letter)\n\t\tput_letter_on_board(letter)\n\telse\n\t wrong_letter(letter) if !@guesses.include? letter\n\tend\n end",
"title": ""
},
{
"docid": "3eb27ea137f6e492ce41d1ed53af7050",
"score": "0.80035746",
"text": "def guess_letter(guess)\n\t\tif (guess && guess.between?('a','z') && !(@guessed_letters.include? guess)\\\n\t\t\t&& guess.length == 1)\n\t\t\tprocess_guess(guess)\n\t\t\t@guessed_letters << guess\n\t\t\t@turns += 1\n\t\telse\n\t\t\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f954cf2a2992167add849406d33c65e8",
"score": "0.7998412",
"text": "def guess(letter)\n raise(ArgumentError, \"You must enter a letter\") if (letter =~ /[^a-z]/i) \n raise(ArgumentError, \"You must enter a letter\") if !letter || letter.empty? #for some reason letter.blank? doesn't work. \n #I'll need to update this to handle multiple letter inputs. Though this line might not be needed since App.rb only passes\n #A single letter at a time. \n #raise(ArgumentError, \"Enter only one letter\") if (letter.length > 1) \n letter.downcase!\n \n if (guesses.include? letter) | (wrong_guesses.include? letter) \n false\n else \n if word.include? letter\n @guesses += letter\n @win_counter +=1\n else \n @wrong_guesses += letter\n @lose_counter +=1\n end\n end\n end",
"title": ""
},
{
"docid": "95ccd5731951b809176c4bc4a5702d5b",
"score": "0.7997909",
"text": "def good_guess?(player_guess)\n @guess_history.push(player_guess)\n nb_found = 0\n @word.split('').each_with_index do |ltr, idx|\n if ltr == player_guess\n @display[idx] = player_guess.upcase\n nb_found += 1\n end\n end\n # found letter + display number of occurrences\n if nb_found > 0\n puts \"Found #{nb_found} #{player_guess} in this word!\"\n return true\n else\n puts \"Wrong guess, keep going!\"\n @misses.push(player_guess)\n return false\n end\n end",
"title": ""
},
{
"docid": "2a325cccd0771fe82be975bd58ad784c",
"score": "0.79939866",
"text": "def check_guess(guess)\r\n indx = word.index(guess)\r\n\r\n if indx == nil\r\n #puts nil # extra space\r\n print \"\\nThis letter is not in it!\\n\"\r\n @guesses_made[@guess] = false\r\n else \r\n print \"\\nYou're right!\\n\"\r\n @guesses_made[@guess] = true\r\n end\r\n end",
"title": ""
},
{
"docid": "8d2bb0b2568a2585533228c10725fe8c",
"score": "0.7978335",
"text": "def guessed_all_correct(letter)\n letter_arr = []\n letter_arr.push(letter)\n letter_arr.each { |lett| puts \"guess wrong\" if @word.include?(letter) == false}\n letter_arr.each { |lett| puts \"guess right\" if @word.include?(letter) == true}\n end",
"title": ""
},
{
"docid": "3617411e0a94bd8a546a475edf1e36b4",
"score": "0.79674196",
"text": "def include_letter?(guess) \n self.word.include?(guess)\n end",
"title": ""
},
{
"docid": "23d4ce4448b79e012315b6529b19eebe",
"score": "0.7964365",
"text": "def guess(letter)\n\t\t@letters_guessed << letter\n\t\t@guess_num += 1\n\n\t\tif @the_word.include? letter\n\t\t\tx = @the_word.index(letter)\n\t\t\t@the_word_blank[x] = letter\n\t\t\t@guess_num -= 1\n\t\t\tputs \"\\nCorrect!\\n#{@the_word_blank}\\n\"\n\t\t\tif @the_word == @the_word_blank\n\t\t\t\tputs \"HOLY HELL! YOU WON!!!\"\n\t\t\tend\n\t\telsif @guess_num == @the_word.length\n\t\t\tputs \"\\nWrong! Guess #{@guess_num} was your last guess. GAME OVER. Try being smarter next time.\\n\"\n\t\telse\n\t\t\tputs \"\\nWrong! Guess #{@guess_num} - Your guess of #{letter} is incorrect. Please try again.\\n #{@the_word_blank}\\n\"\n\t\tend\n\n\tend",
"title": ""
},
{
"docid": "42190f63141ebf84c39606710eace374",
"score": "0.7963964",
"text": "def check_guess\n @guess_word.each_with_index do |letter, i|\n @print_guess.each_with_index do |l, j|\n j = i\n if @player_guess =~ /#{letter}/\n @print_guess[j] = @player_guess\n @swapped = true\n break\n else\n break\n end\n end\n end\n if @swapped != true\n @guess_counter += 1\n end\n @swapped = false\n end",
"title": ""
},
{
"docid": "89bfe172ae3a123b6503fb3587d601f5",
"score": "0.79614025",
"text": "def guess(letters)\n \n raise ArgumentError, \"Argument error!\" if letters == nil or letters == '' or !letters.match(/[[:alpha:]]/)\n \n letters.each_char do |letter|\n @num_of_guesses += 1\n letter.downcase!\n if guesses[letter] or wrong_guesses[letter]\n puts \"you already guessed that letter\"\n return false\n elsif word[letter]\n guesses<< letter\n else\n wrong_guesses<< letter \n end\n end\n \n end",
"title": ""
},
{
"docid": "d1f4604985151aef5019bfd15488d659",
"score": "0.7955873",
"text": "def check_guess(guess)\n if @word.include?(guess)\n if !@dash_array.include?(@guess)\n puts \"Great! #{guess} is a match!\"\n @correct_guesses += 1\n replace_letter\n end\n else\n puts \"Try again\"\n @wrong_guesses += 1\n ascii_change\n end\n @total_guesses += 1\n puts @dash_array.join\n end",
"title": ""
},
{
"docid": "690dde551ee0886a936e4003602660ef",
"score": "0.7946744",
"text": "def check_guess_easy\n @guesses_remaining = 5\n\n if @guess.length.to_i > 1\n @words_guessed << @guess\n if @guess.upcase == @word\n print \"YAY! CONGRATS! #{@word.upcase} IS CORRECT!\"\n else\n print \"Sorry, that was incorrect!\"\n @guesses_remaining -= 1\n end\n elsif @guess.length == 1 #IF USER GUESSES A LETTER\n @letters_guessed << @guess\n\n if @word.include?(@guess) #if guessed letter exists in generated word array, iterate over word array to check if letter matches\n puts \"YES! It DOES include #{@guess}!\"\n\n i = 0\n @word_array.each do |element|\n if @guess == element #letter\n @word_showing[i] = \"#{element} \" #resetting \"__\" to element which is the guessed letter\n end\n i += 1\n\n end#of word_array loop\n else #if guessed letter does not exist,\n end\n end\n end",
"title": ""
},
{
"docid": "98fb6f401f64dcfc1003f9977eaf36d8",
"score": "0.7944428",
"text": "def evaluate_guess(guess, word)\n\t\tif guess.length > 1\n\t\t\tprint \"Is #{guess} your word? \"\n\t\t\treturn gets.chomp\n\t\telse\n\t\t\tprint \"Is #{guess} included in your word? \"\n\t\t\tanswer = gets.chomp\n\t\t\tif answer == \"no\"\n\t\t\t\treturn \"no\"\n\t\t\telsif answer == \"yes\"\n\t\t\t\tprint \"At what indices? (format '1 2 3') \"\n\t\t\t\tletter_locations = gets.chomp.split(\" \").map {|i| i.to_i}\n\t\t\t\tletter_locations\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "4039842ed42a236d1077e9738fbaa434",
"score": "0.7939963",
"text": "def guess!(letter)\n\n \n \n # make_word.push(letter)\n \n if @word.include? letter\n \n \n @@letterArr[@word.index(letter)] = letter\n print @@letterArr\n puts 'yes'\n puts @word.index(letter)\n for i in 1..@word.length do\n if i == @word.index(letter) + 1\n print letter\n else\n print \"_\"\n end\n \n end\n else\n puts 'no'\n \n end\nguess!(gets.chomp)\n\n \n\n end",
"title": ""
},
{
"docid": "0632ddb6a67c1d6f6991cd736fb498d5",
"score": "0.79340047",
"text": "def match letter\n match = false\n @orig_letters.each_index do |i|\n if letter == @orig_letters[i]\n match = true\n @disp_letters[i] = letter\n end\n end\n\n if match\n puts \"Great job! You guessed right.\"\n else\n if @wrong_letters.include?(letter)\n puts \"You already guessed this letter.\"\n else\n puts \"Sorry. You guessed wrong.\"\n @guess_left -= 1\n @wrong_letters << letter\n end\n end\n end",
"title": ""
},
{
"docid": "b0b48bdba5aa1cd0f69bb18e682e230a",
"score": "0.79314506",
"text": "def guess\n\t\tansw = \"\"\n\t\tused = true\n\t\tuntil (\"a\"..\"z\").include?(answ) && !used\n\t\t\tputs \"Give me a letter between a and z.\"\n\t\t\tansw = interact\n\t\t\tif @missed_letters.include?(answ)\n\t\t\t\tputs \"You've already guessed this letter, choose an other one.\"\n\t\t\t\tused = true\n\t\t\telse\n\t\t\t\tused = false\n\t\t\tend\n\t\tend\n\t\t@secret_word.split(//).each_with_index do |item, index|\n\t\t\tif item == answ\n\t\t\t\t@board[index] = item\n\t\t\tend\n\t\tend\n\t\tunless @secret_word.include?(answ)\n\t\t\t@missed_letters << answ\n\t\tend\n\tend",
"title": ""
},
{
"docid": "dd773f841602da21fc4decfd85baa00d",
"score": "0.7929468",
"text": "def check_guesses(guess, word)\n\tguess = guess.downcase\n\tletter_index = []\n\tword = word.split('')\n\t# saves index number to display letter in view\n\tword.each_with_index do |x, i|\n\t\tletter_index.push(i) if x == guess\n\tend\n\tletter_index.empty? ? nil : letter_index\nend",
"title": ""
},
{
"docid": "bfc9e71cfe710245c3bbe45fff110da5",
"score": "0.7917758",
"text": "def guess?(letter)\n word = @word.include?(letter) \n puts \"Guess a letter:\"\n letter = gets.chomp\n if word == false\n puts \"there is no #{letter} in #{@word}.\"\n return\n else \n puts \"the word has #{letter}.\"\n end\n end",
"title": ""
},
{
"docid": "d6d9c1121c4940d849dc02b0c33e3f35",
"score": "0.791723",
"text": "def guess(letter)\n\t\t@guess_count += 1\n\t\t@guesses << letter\n\t\t@number_of_guesses +=1\n\t\tif @word.include? letter\n\t\t\tputs \"You found a letter!\"\n\t\t\tdecode(letter)\n\t\t\tif @guesses.count(letter) > 1\n\t\t\t\t@guess_count -= 1\n\t\t\tend\n\t\telse\n\t\t\tputs \"No, the word doesn't have the letter #{letter}!\"\n\t\t\tp join_the_letters\n\t\t\tif @guesses.count(letter) > 1\n\t\t\t\t@guess_count -= 1\n\t\t\tend\n\t\tend\n\t\tputs \"You have #{@word.length * 2 - @guess_count} chances left.\"\n\t\tif @word.length * 2 - @guess_count == 0\n\t\t\tputs\"GAME OVER!\"\n\t\tend\n\t\tjoin_the_letters\n\tend",
"title": ""
},
{
"docid": "1e75a34e9fe3a95520cd6e347908807a",
"score": "0.7916697",
"text": "def guess(letter)\n system('clear')\n if @guesses.length < 6 && @word.include?(letter)\n @word.each_with_index { |char, i| char == letter ? @display[i] = \"#{letter} \" : @display } \n elsif @guesses.length < 6 && !@word.include?(letter)\n @guesses << letter\n end\n end",
"title": ""
},
{
"docid": "996c58189a790151033c67b80d377e33",
"score": "0.7907258",
"text": "def guess(letter)\n letter.downcase!\n found = @answer.include?(letter)\n\n unless @guessed.include?(letter)\n @guessed << letter\n @misses_remaining -= 1 unless found\n end\n\n found\n end",
"title": ""
},
{
"docid": "29b9c8a5d84c1d8b7d0e7cf0f9e8873c",
"score": "0.79033625",
"text": "def guess(alphabet)\n \n raise ArgumentError if !alphabet || alphabet.empty? || !alphabet.match(/[A-Za-z]/)\n # alphabet chars to downcase\n alphabet.downcase!\n\n return false if @guesses.index(alphabet) || @wrong_guesses.index(alphabet)\n if word.index(alphabet)\n @guesses << alphabet\n else\n @wrong_guesses << alphabet\n end \n end",
"title": ""
},
{
"docid": "b4d5d3393654d3bfc4e3720a3c02ad16",
"score": "0.7902988",
"text": "def guess_letter(letter)\n if @correct_letters.include?(letter) || @incorrect_letters.include?(letter)\n puts \"You have already guessed #{letter}.\"\n elsif @target_word.include? letter\n @correct_letters.append(letter)\n update_output_str(letter)\n else\n @incorrect_letters.append(letter)\n @num_fails_left -= 1\n end\n end",
"title": ""
},
{
"docid": "74185a45c6b7315f56f5b4cfc01c2bb1",
"score": "0.78973866",
"text": "def word_guess\n # This is assigning the guessues from user 2 in the array as per the index or position of the input of user 1\n if @input_word.include?@guessed_letters\n @guess_index = @input_word.index(@guessed_letters)\n p @guess_index\n @guess_store[@guess_index] = @guessed_letters\n p @guess_store\n else\n puts \"Wrong guess! Keep Trying :)\"\n end\n end",
"title": ""
},
{
"docid": "cc2aa3efbec118ba0d442651cbc29f0a",
"score": "0.78902125",
"text": "def guess(letter)\n unless (letter.is_a? String) && (letter.match? /^[[:alpha:]]{1}$/)\n # The argument is not a letter\n raise ArgumentError, 'The argument is not a letter.'\n end\n\n # Add support for case insensitivity\n letter = letter.downcase\n if (guesses.include? letter) || (wrong_guesses.include? letter)\n # The letter is a repeated guess\n return false\n end\n\n if check_win_or_lose == :play\n word.include?(letter) ? @guesses << letter : @wrong_guesses << letter\n end\n\n true\n end",
"title": ""
},
{
"docid": "ff951a8dc9710bdb3b2b747ae5a3dbb4",
"score": "0.7890129",
"text": "def check_guess(guess)\n if guess.length > 1\n if self.game_word.downcase == guess.downcase\n self.board = game_word.split(\"\")\n return 0\n else\n return 1\n end\n else\n result = (0...self.game_word.length).select {|index| self.game_word[index].downcase == guess.downcase}\n\n if result.length == 0\n return 1\n else\n for i in result\n self.board[i] = guess\n end\n\n return 0\n end\n end\n end",
"title": ""
},
{
"docid": "303c5119161ecf4bfe5155371630be4c",
"score": "0.7888187",
"text": "def check_guess(letter, word)\n\t\tindexes = []\n\t\tword.split(\"\").each_with_index do |l, idx|\n\t\t\tif letter == l\n\t\t\t\tindexes << idx\n\t\t\tend\n\t\tend\n\t\tindexes\n\tend",
"title": ""
},
{
"docid": "79433c92a1a8c0a932d8d8d534bb5a77",
"score": "0.7887197",
"text": "def guessed_entire_word(word, guessed_letters)\r\n word_array = word.split('')\r\n\r\n word_array.each do |letter_in_word|\r\n did_guess_letter = false\r\n guessed_letters.each do |letter|\r\n if letter_in_word == letter\r\n did_guess_letter = true\r\n end\r\n end\r\n if did_guess_letter == false\r\n return false\r\n end\r\n end\r\n\r\n return true\r\nend",
"title": ""
},
{
"docid": "d449ce783082cefa31186f1e19ce8858",
"score": "0.78794795",
"text": "def check_letter(letter)\n\t\tif @word_to_guess.include? letter\n\t\t\tputs \"You found: #{letter}!\"\n\t\t\t@word_to_guess.length.times do |i|\n\t\t\t\tif word_to_guess[i] == letter\n\t\t\t\t\t@guessed[i] = letter\n\t\t\t\t\tputs \"Good guess!\"\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\tputs \"Sorry, #{letter} is not part of the word.\"\n\t\tend\n\n\t\t@attempts -= 1\n\t\tstatus(@word_to_guess, @guessed)\n\t\tputs \"You have #{@attempts} attempts remaining.\"\n\tend",
"title": ""
},
{
"docid": "5738703bb7ba754578f2f49f22d37a99",
"score": "0.78739524",
"text": "def guess(letter)\n\t\tif @target_word.include? letter\n\t\t\ttrue\n\t\telse\n\t\t\tfalse\n\t\tend\n\tend",
"title": ""
},
{
"docid": "8c0f7f26afa718a27c200c51857f4ce7",
"score": "0.78617793",
"text": "def include_letter?\n @guess_ind = (0 ... @word.length).find_all { |i| @word[i,1] == @used_guesses[-1]}\n return @guess_ind\n end",
"title": ""
},
{
"docid": "bf607ec589ea9fe5fa6a5576811a21f5",
"score": "0.7857308",
"text": "def letter?(guess)\n\t\t@letters.each {|l| return true if l == guess}\n\t\treturn false\n\tend",
"title": ""
},
{
"docid": "3245b13212856b69af94c91719deb88b",
"score": "0.7843634",
"text": "def letter_compare(guess)\r\n\t\tletters = phrase.split('')\r\n\t\tletters.each_with_index do |letter, i|\r\n\t\t\tif letter == guess\r\n\t\t\t\t@placeholders[i] = letter\r\n\t\t\tend\r\n\t\tend\r\n\t\tunless placeholders.include?('_')\r\n\t\t\t@solved = true\r\n\t\tend\r\n\t\tp placeholders.join(' ')\r\n\tend",
"title": ""
},
{
"docid": "99e4ffcc34ffc9ab1520870841c9bc25",
"score": "0.78400433",
"text": "def guess_matches?(word, guess)\r\n match = false\r\n word.each_char.with_index {|char,i| (@display_word[i] = char) && (match = true) if char == guess} \r\n puts @display_word.join(\" \")\r\n (@remaining_guesses -= 1) && (puts \"\\nIncorrect guess! You have #{@remaining_guesses} guesses left.\") if !match\r\n return match\r\n end",
"title": ""
},
{
"docid": "115980e2dd8bbe1b8363dbdc601e85ab",
"score": "0.7826021",
"text": "def guess(letter)\n @guessed << letter\n # Return true if the guess was right\n if @answer.include?(letter)\n @guessed << letter\n true\n else\n unless @guessed.include?(letter)\n @guessed << letter\n @misses_remaining -= 1\n end\n false\n end\n end",
"title": ""
},
{
"docid": "f1cc21b11246cde4d5d43171ceba4603",
"score": "0.78256494",
"text": "def check_letter(letter)\n letters_to_array(letter)\n @word.each_with_index do |char, index|\n if char == letter\n @word_progress[index] = char\n end\n end\n @guess_count -= 1\n letter\n end",
"title": ""
},
{
"docid": "56a6afca18302ee9bee74919deeb21bb",
"score": "0.7824146",
"text": "def check_guess(letter_guessed)\n while @word_to_guess.include?(letter_guessed)\n letter_index = @word_to_guess.index(letter_guessed)\n update_game_state(letter_index)\n end\n end",
"title": ""
},
{
"docid": "82d16a540bac57fe2b048c578f57f50e",
"score": "0.7822021",
"text": "def check_guess(letter_guessed)\r\n letter_guessed.downcase\r\n @users_word.split('').each_with_index do|user_letter, hidden_letter|\r\n if letter_guessed == user_letter\r\n @hidden_word[hidden_letter] = letter_guessed\r\n p @hidden_word\r\n end\r\n if !@users_word.include?(letter_guessed)\r\n puts \"#{letter_guessed} is not in the word. Try again.\"\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "1bf3c02916b72f5dee160a68c06ffe6b",
"score": "0.7821743",
"text": "def guess_letter(letter)\r\n if @guessed_letters.include?(letter)\r\n correct_guess = \"duplicate\"\r\n else\r\n @guess_count += 1\r\n @guessed_letters << letter\r\n if @word.include?(letter)\r\n correct_guess = \"true\"\r\n update_word(letter)\r\n else\r\n correct_guess = \"false\"\r\n end\r\n end\r\n game_over?\r\n return correct_guess, @word_in_progress, @game_over\r\n end",
"title": ""
},
{
"docid": "98a65a9a6c92a82739cad7c1927534be",
"score": "0.7813091",
"text": "def guess_letter(letter)\r\n # Make sure letter hasn't already been guessed\r\n if @guessed_letter.index(letter)\r\n return \"Letter already guessed.\"\r\n end\r\n # Compare letter to word\r\n letter_count = 0\r\n letter_index = 0\r\n @guess_word_letters.each do |guess_word_letter|\r\n if guess_word_letter == letter\r\n #replace question marks in display word with correct letter\r\n @display_puzzle_word[letter_index] = letter\r\n letter_count += 1\r\n end\r\n letter_index += 1\r\n end\r\n # Store letter as a guessed letter\r\n @guessed_letter << letter\r\n if letter_count == 0\r\n @guess_limit -= 1\r\n end\r\n return letter\r\n end",
"title": ""
},
{
"docid": "8234a194a79225d949aee1ec25769254",
"score": "0.78127015",
"text": "def letterGuess(c)\n present = false\n chars = @comp_guess.split(\"\")\n chars.each_index do |index|\n if chars[index] == c\n present = true\n @user_guess[index] = c\n end\n end\n present ? @guess.push(c) : @misses.push(c)\n @count -= 1\n return isOver\n end",
"title": ""
},
{
"docid": "7a005c8a7abc2459d323a0ecad52eecc",
"score": "0.7779062",
"text": "def guess_letter(letter)\n guessed_letter = letter.downcase\n if (!@guessed_letters.include?(guessed_letter) &&\n !@word.split(//).include?(guessed_letter))\n @wrong_guesses += 1\n end\n @guessed_letters.push(guessed_letter)\n @guessed_letters.uniq!\n @@current_word = self\n end",
"title": ""
},
{
"docid": "998e651f37b97dd5965352795585fc72",
"score": "0.77643704",
"text": "def letter_in_word(guess)\n @secret_word.include?(guess) ? true : false\n end",
"title": ""
},
{
"docid": "340d54c13b092edda63586f0aaadca0a",
"score": "0.7735317",
"text": "def guess_word(guess)\r\n\t\tguess_array = guess.split(\"\")\r\n\r\n\t\t# No penalty for duplicate words\r\n\t\treturn false if @words_guessed.index(guess) != nil\r\n\r\n\t\tif guess == @word\r\n\t\t\treturn true\r\n\t\telse\r\n\t\t\tguess_array.length.times do |index|\r\n\t\t\t\tif guess_array[index] == @word_array[index]\r\n\t\t\t\t\t@word_guess[index] = guess_array[index]\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\t\t@words_guessed << guess\r\n\t\t\t@guess_count -= 1\r\n\t\t\treturn false\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "8926d3e9dd7c0ddee2ab407a0ce07a59",
"score": "0.7726324",
"text": "def guess_the_letter(g_letter)\n\t \t@attempts += 1\n\t\tg_letter.downcase\n\t\tif !@word.include? (g_letter)\n\t\t\t puts \"Nope...\"\n\t\tend\n\t\t@word.split(\"\").each_with_index do |w_letter, index|\n\t\t\tif g_letter == w_letter\n\t\t\t\t@display_word[index] = g_letter\n\t\t\t\tputs \"Player 2, here is your progress towards guessing the word:\"\n p @display_word\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "16522c7a2904d9e3161cba520799b042",
"score": "0.7720667",
"text": "def test_letter(letter)\n check_win do\n @used_letters << letter\n if @word.include? letter and !@guessed.include? letter then\n @word.scan(/(?=#{letter})/).count.times do\n @guessed << letter\n end\n else\n @tries -= 1\n end\n end\n end",
"title": ""
},
{
"docid": "ed99681348dcf16c6316a984c991a977",
"score": "0.77198476",
"text": "def check_guess(char)\n @secret_word_array = @secret_word.chars\n @outcome = \"\"\n\n if @secret_word_array.include?(char)\n @secret_word_array.each_index do |index|\n if @secret_word_array[index] == char\n @blanks[index] = char\n end\n end\n @outcome = \"Good guess!\"\n elsif !@secret_word_array.include?(char) && @guesses_left > 0\n @outcome = \"Try again.\"\n end\n @outcome\n end",
"title": ""
},
{
"docid": "f9b6f3ac4916ed75c3465c858e239352",
"score": "0.769296",
"text": "def guessLetter\n\n print \"Guess: \"\n guess = gets.chomp.to_s.downcase[0]\n while(@letters_tried.include?(guess) or guess == \"\")\n print \"Guess: \"\n guess = gets.chomp.to_s.downcase[0]\n end\n \n if(guess == \"!\")\n guessWord\n return false\n elsif(@word.include?(guess))\n print \"Good guess!\"\n @letters_correct += 1\n print \"Letters correct: #{@letters_correct} \\n\"\n else\n print \"Sorry, that letter is not in the word.\"\n @turns_remaining -= 1\n end\n \n#removes letter from remaining array and adds it to tried array\n@letters_remaining.delete(guess)\n@letters_tried.push(guess)\nreturn true\nend",
"title": ""
},
{
"docid": "500e722d6e6cc9f225f165796e079e55",
"score": "0.7691607",
"text": "def check_guess(guess)\n\t\tguess_flag = false\n\t\tcounter = 0\n\t\t# puts @word.length\n\n\t\twhile counter < @word.length \n\t\t\t# puts word_array\n\t\t\t# puts guess\n\n\t\t\tif @word_array[counter] == guess\n\t\t\t\t@guess_array[counter] = guess\n\t\t\t\tputs \"Correct!\"\n\t\t\t\tguess_flag = true\n\t\t\tend\n\n\t\t\tcounter += 1\n\n\t\tend\n\n\t\tif guess_flag == false\n\t\t\tputs \"Fail\"\n\t\tend\n\t\t\n\t\treturn @guess_array\n\n\tend",
"title": ""
},
{
"docid": "c4413024bcdfe7528c5ae1c08399f595",
"score": "0.7687845",
"text": "def guess(guessed)\n \n #Check for invalid input \n # of empty string using '' for comparison\n # Count the characters from the input of a-z and A-Z\n # The result is 0 if there are non alphabet characters in the input.\n # guessed.nil? to check for nill value.\n if guessed == '' or guessed.nil? or guessed.count(\"a-zA-Z\") <= 0 \n \n raise ArgumentError\n \n end\n \n # Convert gussed to case insensitve\n guessed.downcase!\n # Check if the guessed char is in the word string\n #And the character is not already in the guesses list\n if @word.include? guessed and !@guesses.include? guessed \n \n # Add the guessed char to the guesses list \n @guesses += guessed\n return true\n #check if the the letter already exists in the guessed string\n elsif @guesses.include? guessed or @wrong_guesses.include? guessed\n return false\n # condition to check if the char is not in the wrong_guesses list\n elsif !@wrong_guesses.include? guessed\n \n #If guessed char is not in string add to @wrong_guesses list\n @wrong_guesses += guessed\n return true\n \n end\n \n end",
"title": ""
},
{
"docid": "21ae8eedc7ff1b97de5d329d5660931a",
"score": "0.76800597",
"text": "def compare_to_answer(guess)\n if @letters.include?(guess.guess)\n update_blank_array(guess)\n elsif @word == guess.guess\n @blank_array = @correct_array\n elsif !@wrong_guess.include?(guess.guess)\n @wrong_guess << guess.guess\n @lives_counter -= 1\n else\n puts \"You already guessed that. Try again.\"\n end\n end",
"title": ""
},
{
"docid": "de6d986a40c4f438c8a3058bd3246c68",
"score": "0.7677127",
"text": "def check_word(guess)\n\t\tif guess == @word\n\t\t\t@is_over = true\n\t\t\tp \"You are clearly a word guessing genius.\"\n\t\telsif @word.include?(guess)\n\t\t\t@guessed_letters << guess\n\t\t\tp \"Getting closer to solving.\"\n\t\telsif @guessed_letters.include?(guess)\n\t\t\tp \"You already tried that letter.\"\n\t\telsif @guess_count == 0\n\t\t\t@is_over = true\n\t\t\tp \"Better luck next time, loser.\"\n\t\telse \n\t\t\t@guess_count -= 1\n\t\t\tp \"Guess another letter.\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0936142d6ddcc820c44651799ca5e4bd",
"score": "0.76755965",
"text": "def guess(letter)\n if /[A-z]/.match(letter)\n letter = letter.downcase\n if guesses.include?(letter)\n return\n else\n self.guesses << letter\n end\n\n if word.include?(letter)\n if !word_display.include?(\"_\") && wrong_guesses < 6\n self.game_status = STATUS_WON\n end\n else\n self.wrong_guesses += 1\n if self.wrong_guesses >= 6\n self.game_status = STATUS_LOST\n end\n end\n self.save!\n else\n return\n end\n end",
"title": ""
},
{
"docid": "384e399243408413526aeb575d7b2c68",
"score": "0.76613",
"text": "def guess(letter)\n raise InvalidGuessException.new(\"Invalid Guess!\") unless valid_guess?(letter) ### raise lida com excessao e quebra o codigo\n ### raise \"Invalid guess!\" = raise Exception.new(\"Invalid guess!\")\n if word_has?(letter)\n \tput_letter_on_board(letter)\n else\n wrong_letter(letter) if !@guesses.include? letter\n end\n end",
"title": ""
},
{
"docid": "d3e6ee6fb0bd8db7e4590684b8f84a6f",
"score": "0.7660785",
"text": "def compare_letter_to_word(guessed_letter)\n @all_guesses << guessed_letter\n @word_array.include?(guessed_letter)\n end",
"title": ""
},
{
"docid": "94f6194326e9fe0d27dc1666700b432f",
"score": "0.76314884",
"text": "def is_valid_guess(letters)\n #\n end",
"title": ""
},
{
"docid": "4bc349b6a1b88ba473b5666e41ad6462",
"score": "0.7630646",
"text": "def guess_letter(letter)\r\n letter = letter.downcase\r\n if @guesses.include?(letter)\r\n puts \"Already guessed #{letter}, please enter a new letter\"\r\n else\r\n @guess_count -= 1\r\n @guesses << letter\r\n i = 0\r\n while i < @secretword.length\r\n if @secretword_array[i] == letter\r\n @hide[i] = letter\r\n end\r\n i += 1\r\n end\r\n end\r\n if !@hide.include?(\"_\")\r\n @is_over = true\r\n puts \"Success! The word is #{@secretword}! (:\"\r\n end\r\n @hide.join(\" \")\r\n end",
"title": ""
},
{
"docid": "fb5dc1379ddc299c15defa50121f6b06",
"score": "0.76242507",
"text": "def check_letter(letter_selected)\n @word_to_guess.each_with_index do |letter,index|\n \t @word_uncomplete[index] = letter if letter.downcase == letter_selected\n end\n @letters_played << letter_selected\n end",
"title": ""
},
{
"docid": "92a89542c77d81a76747681ab25b6150",
"score": "0.7622405",
"text": "def correct_letter(guess_letter) \n puts 'That letter is correct!'\n @game_word.each_with_index do |letter, index|\n if letter == guess_letter\n @display_word[index * 2] = letter\n @player_correct_letters.push(guess_letter)\n end\n end\n end",
"title": ""
},
{
"docid": "43006c8a9b4050fca9b438ca2a2b5460",
"score": "0.76159334",
"text": "def guess(guessed_letter)\n\t\tletter_count = 0\n\t\tcorrect_word.each_char do |letter|\n\t\t\tif letter == guessed_letter\n\t\t\t\t@guessed_word[letter_count] = correct_word[letter_count]\n\t\t\tend\n\t\t\tletter_count += 1\n\t\tend\n\n\n# Keep track of how many times guessed_word is assigned\n# Add 1 to the current number of guesses if the letter has not already been guessed\n\n\t\tp @guessed_word\n\t\t@guesses_left -= 1\n\n# If the user guesses the word, show a congratulatory message\n\n\t\tif @guessed_word == @correct_word\n\t\t@is_over = true\n\t\tputs \"You got it! Player 2 wins!\"\n\n# If number of guesses exceeds the number allowed, end the game and show a taunting message.\n\t\telsif @guesses_left == 0\n\t\t@is_over = true\n\t\tputs \"Haha, you're out of guesses! Player 1 wins!\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "264e5620f9444274ee18f3e2ac090ad3",
"score": "0.76080847",
"text": "def check_guess\n if @selected_word.split('').include?(@guess)\n @selected_word.split('').each_with_index do |letter, idx|\n @displayed_word[idx] = \"#{letter} \" if @guess == letter\n end\n else\n @guesses << @guess unless @guess.nil?\n end\n end",
"title": ""
},
{
"docid": "05fd5288945a5e88f14bd5d539664e36",
"score": "0.7605795",
"text": "def guess(player_guess)\n \tif player_guess.nil?\n \t\traise ArgumentError\n \tend\n\n \tnew_guess = player_guess.downcase\n \tnumber_of_total_guesses = @guesses.length + @wrong_guesses.length\n\n \t# If the guess was valid (single letter)\n \tif new_guess.length == 1 and letter?(new_guess)\n \t\t# Append the guess to the right instance variable depending on if it is in our word\n \t\tif @word.include? new_guess\n \t\t\t# Don't copy guess if it's already there\n \t\t\t@guesses << new_guess unless @guesses.include? new_guess\n \t\telse\n \t\t\t# Don't copy guess if it's already there\n \t\t\t@wrong_guesses << new_guess unless @wrong_guesses.include? new_guess\n \t\tend\n \telse\n \t\traise ArgumentError\n \tend\n\n \t# Return true if a guess was not made before and false otherwise\n \treturn (@guesses.length + @wrong_guesses.length > number_of_total_guesses) ? true : false\n end",
"title": ""
}
] |
11a4d65512e19ef250d7d130c87d634b
|
Singleton_dump _dump(depth=1) default marshalling strategy
|
[
{
"docid": "def794d0b45c39f0633fb3b265006085",
"score": "0.6888722",
"text": "def _dump\n end",
"title": ""
}
] |
[
{
"docid": "7134d43e48536f97c17ac9a43cc91ad5",
"score": "0.7519361",
"text": "def marshal_dump\n h = to_h.dup\n h.default = nil\n\n [nested_class, h]\n end",
"title": ""
},
{
"docid": "eddfff8a271ab5d6ea67cd1c1231508f",
"score": "0.7315641",
"text": "def marshal_dump; end",
"title": ""
},
{
"docid": "919a4c7ec69fbc37a43c668d36064b87",
"score": "0.71977586",
"text": "def _dump() end",
"title": ""
},
{
"docid": "dbf759714d6f066c7c044c11c442b6ef",
"score": "0.71855664",
"text": "def marshal_dump\n dump\n end",
"title": ""
},
{
"docid": "e9dabe7823fa51a7660d57f786d8cdd2",
"score": "0.7059577",
"text": "def _dump(depth)\n Marshal.dump(to_hash)\n end",
"title": ""
},
{
"docid": "ab1b3c96273c3b3403cda12a03fb1420",
"score": "0.70412874",
"text": "def marshall_dump\n end",
"title": ""
},
{
"docid": "79f9a84f84e7b29ae0df7cc2a17b5450",
"score": "0.6955371",
"text": "def marshall_dump\n end",
"title": ""
},
{
"docid": "816c2ab84a6575f76542947c95920051",
"score": "0.6806427",
"text": "def structure_dump() end",
"title": ""
},
{
"docid": "b9615070cc13ef0b292568a262e4c6e0",
"score": "0.6665955",
"text": "def _dump(depth)\n scrooge_fetch_remaining\n scrooge_invalidate_updateable_result_set\n scrooge_dump_flag_this\n str = Marshal.dump(self)\n scrooge_dump_unflag_this\n str\n end",
"title": ""
},
{
"docid": "2c4835ecab6995bcf67300bd7fadd308",
"score": "0.6630317",
"text": "def dump() end",
"title": ""
},
{
"docid": "2bbe333d876a050f18872553a7a9a342",
"score": "0.66296446",
"text": "def _dump()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "6b079115ac299b2bd6782910d5afb648",
"score": "0.662301",
"text": "def dump\n do_dump(0)\n end",
"title": ""
},
{
"docid": "7de7b3585551113d866a0514cccfc13d",
"score": "0.6606287",
"text": "def _dump(depth) # :nodoc:\n instanceVarHash = {}\n self.instance_variables.each { |k| instanceVarHash[k] = self.instance_variable_get(k) }\n return Marshal.dump(instanceVarHash.delete_if{|k,v| k == \"@logger\"})\n end",
"title": ""
},
{
"docid": "16577698a47921afa728d12099515df8",
"score": "0.6586601",
"text": "def marshal_dump\n ivars = instance_variables.reject {|var| /\\A@delegate_/ =~ var}\n [\n :__v2__,\n ivars, ivars.map {|var| instance_variable_get(var)},\n __getobj__\n ]\n end",
"title": ""
},
{
"docid": "fd8f18a7e78826317c9af4d4b09eee87",
"score": "0.6555197",
"text": "def dump\n do_without_lazy_loader { super }\n end",
"title": ""
},
{
"docid": "8c5bbccbe1fe2af448d69fd83e8b1d28",
"score": "0.65433925",
"text": "def _dump(*args)\n raise \"not implemented yet\"\n end",
"title": ""
},
{
"docid": "f373c7d861f04b07b376c6f35f29fac7",
"score": "0.64049923",
"text": "def _dump(lvl = -1)\n if !@exported_fields\n super\n else\n marshalled_members = @exported_fields.map do |name|\n value = @members[name]\n [name, Marshal.dump(value)] rescue nil\n end\n marshalled_members.compact!\n Marshal.dump([marshalled_members, @aliases])\n end\n end",
"title": ""
},
{
"docid": "250ed1cff610a44badc6f19cc79364f2",
"score": "0.6320002",
"text": "def _dump(depth)\n \"\"\n end",
"title": ""
},
{
"docid": "250ed1cff610a44badc6f19cc79364f2",
"score": "0.6320002",
"text": "def _dump(depth)\n \"\"\n end",
"title": ""
},
{
"docid": "4f7bfe3e8fa4f5c72b1aa5c153bb0d50",
"score": "0.6302142",
"text": "def marshal_dump # :nodoc:\n [ @identifier, @handler, @compiled, @original_encoding, @locals, @virtual_path, @updated_at, @format, @variants ]\n end",
"title": ""
},
{
"docid": "73477002b460cbf461ea2af7cb09b291",
"score": "0.629037",
"text": "def marshal_dump\n [version]\n end",
"title": ""
},
{
"docid": "4384b252f75f095d5e3965c80bac6cd4",
"score": "0.62463367",
"text": "def marshal_dump\n [version]\n end",
"title": ""
},
{
"docid": "bf7f409d4d0249b628daaa1e40f8c50c",
"score": "0.62380373",
"text": "def dump!\n @dump = true\n end",
"title": ""
},
{
"docid": "56fc985fac2f4ce5914c2269bb3301bd",
"score": "0.6234829",
"text": "def marshal_dump\n [@version]\n end",
"title": ""
},
{
"docid": "247180dd4024f615c90b7cb7b1b7b8d7",
"score": "0.62316996",
"text": "def _dump(arg0)\n end",
"title": ""
},
{
"docid": "267430a73d5d76ad390af050c5cba75b",
"score": "0.6199666",
"text": "def marshal\n Marshal.dump self\n end",
"title": ""
},
{
"docid": "267430a73d5d76ad390af050c5cba75b",
"score": "0.6199666",
"text": "def marshal\n Marshal.dump self\n end",
"title": ""
},
{
"docid": "267430a73d5d76ad390af050c5cba75b",
"score": "0.6199666",
"text": "def marshal\n Marshal.dump self\n end",
"title": ""
},
{
"docid": "7528791f6a992c76a37d32a908dbe5bc",
"score": "0.6189476",
"text": "def marshal_dump # :nodoc:\n attrs = attributes.sort.map do |attr|\n next unless attr.display?\n [ attr.name, attr.rw,\n attr.visibility, attr.singleton, attr.file_name,\n ]\n end.compact\n\n method_types = methods_by_type.map do |type, visibilities|\n visibilities = visibilities.map do |visibility, methods|\n method_names = methods.map do |method|\n next unless method.display?\n [method.name, method.file_name]\n end.compact\n\n [visibility, method_names.uniq]\n end\n\n [type, visibilities]\n end\n\n [ MARSHAL_VERSION,\n @name,\n full_name,\n @superclass,\n parse(@comment_location),\n attrs,\n constants.select { |constant| constant.display? },\n includes.map do |incl|\n next unless incl.display?\n [incl.name, parse(incl.comment), incl.file_name]\n end.compact,\n method_types,\n extends.map do |ext|\n next unless ext.display?\n [ext.name, parse(ext.comment), ext.file_name]\n end.compact,\n @sections.values,\n @in_files.map do |tl|\n tl.relative_name\n end,\n parent.full_name,\n parent.class,\n ]\n end",
"title": ""
},
{
"docid": "581b7ff280b212b34d5a47fc5e1eb58a",
"score": "0.6174381",
"text": "def define_dumper(klass)\n self\n end",
"title": ""
},
{
"docid": "71bff77c4416aa247f1f834ef7b9e6d3",
"score": "0.6161975",
"text": "def marshal_dump\n [ MARSHAL_VERSION,\n @name,\n full_name,\n @rw,\n @visibility,\n parse(@comment),\n singleton,\n @file.relative_name,\n @parent.full_name,\n @parent.class,\n @section.title\n ]\n end",
"title": ""
},
{
"docid": "08e9ae61600976c600f8341707e84733",
"score": "0.61619747",
"text": "def dump_wrapper_class\n attributes.populate(DumpWrapper, :define_dump_reader)\n end",
"title": ""
},
{
"docid": "ef18cbfba5cea303c4abdd4cce7a49a5",
"score": "0.61250097",
"text": "def marshal_dump\n { \n 'var1' => @var1,\n 'volatile1' => @volatile1\n }\n end",
"title": ""
},
{
"docid": "ca21918429a516f5b256d6671271c176",
"score": "0.61164206",
"text": "def marshal_dump\n { \n :klass => self.class.to_s, \n :values => @attribute_values_flat, \n :joined => @joined_models\n }\n end",
"title": ""
},
{
"docid": "8cbddf64e6d2dc110c8a98c08b757840",
"score": "0.60853034",
"text": "def marshal_dump\n data\n end",
"title": ""
},
{
"docid": "d8a3a7dc635b48b412e7aca732cd0f61",
"score": "0.6076123",
"text": "def marshal_dump # :nodoc:\n [ @source, @identifier, @handler, @compiled, @locals, @virtual_path, @format, @variant ]\n end",
"title": ""
},
{
"docid": "9a2894bd71311550de9e53a2968f954c",
"score": "0.6061804",
"text": "def marshal_dump#:nodoc:\n fields_to_serialize.map{|field| instance_variable_value(field)}\n end",
"title": ""
},
{
"docid": "a874c36e1169bd214016c631fac97c0b",
"score": "0.6034667",
"text": "def _dump(depth)\n inject(\"\") { |str, node| str << node.dump_node << self.class.node_sep }\n end",
"title": ""
},
{
"docid": "369730e35d57c26b3abe0e3459897a31",
"score": "0.6033567",
"text": "def marshal_load(dump)\n return initialize(dump[:values], dump[:joined], :cached)\n end",
"title": ""
},
{
"docid": "e203d92e5a43ce0ac1c100f0df411f94",
"score": "0.5989402",
"text": "def serialize_default(object); object; end",
"title": ""
},
{
"docid": "c49b75ef6cbee22df8afb594408ac382",
"score": "0.5974403",
"text": "def marshal_dump\r\n [@depth, @map_id, @event_id, @list, @index + 1, @branch]\r\n end",
"title": ""
},
{
"docid": "70cc3e41118c71b8d7284543931b2025",
"score": "0.5901357",
"text": "def dump(depth = 0)\n print ' ' * depth * 2\n print \"// #{self.to_s}\\n\"\n end",
"title": ""
},
{
"docid": "278787645aa008b7a4ee3a6e6d2d751c",
"score": "0.58789927",
"text": "def marshal_dump()\n\t\treturn [@title, @levels, @starsRequired]\n\tend",
"title": ""
},
{
"docid": "5753b0d3884f21d05e9c3150ffe933b9",
"score": "0.58760226",
"text": "def dump(object)\n dumper(object).dump\n end",
"title": ""
},
{
"docid": "ce95862932e421f0bbbfb19c56d0e8f7",
"score": "0.5860848",
"text": "def _dump(level)\n MultiJson.dump([@document_base.to_s, @discovery_document])\n end",
"title": ""
},
{
"docid": "b35184cd32dfc89f4179ff1e8f8c2ea5",
"score": "0.5844528",
"text": "def marshal_dump\n format_name_ = Format.canonical_name_for(@_format, true)\n unparsed_data_ = nil\n if @_format.respond_to?(:unparse_for_serialization)\n unparsed_data_ = @_format.unparse_for_serialization(self) rescue nil\n end\n unparsed_data_ ||= @_format.unparse(self) rescue nil\n data_ = [format_name_]\n case unparsed_data_\n when ::Array\n data_ << unparsed_data_[0]\n data_ << unparsed_data_[1] if unparsed_data_[1]\n when ::String\n data_ << unparsed_data_\n else\n data_ << values_array\n data_ << @_unparse_params if @_unparse_params\n end\n data_\n end",
"title": ""
},
{
"docid": "37826b54073e323afbcf0c27db8b3484",
"score": "0.5841546",
"text": "def droby_dump(dest)\n\t\t unless @__droby_marshalled__\n\t\t\tformatted_class = super\n\t\t\ttags = ancestors.map do |mod|\n\t\t\t if mod.kind_of?(Roby::Models::TaskServiceModel)\n\t\t\t\tmod.droby_dump(dest)\n\t\t\t end\n\t\t\tend\n\t\t\ttags.compact!\n\t\t\t@__droby_marshalled__ = DRobyTaskModel.new(tags.reverse, formatted_class.ancestors)\n\t\t end\n\t\t @__droby_marshalled__\n\t\tend",
"title": ""
},
{
"docid": "b818b040d0bc5fb8dfbdf01db47cdb9b",
"score": "0.5840723",
"text": "def dump(object)\n raise NotImplementedError, \"#{self.class} must implement #dump\"\n end",
"title": ""
},
{
"docid": "230cb87157da1bb1799297c30c279dc8",
"score": "0.58356905",
"text": "def dumper(object)\n dumper_class.new(self, object)\n end",
"title": ""
},
{
"docid": "762bca0e2db3ff19d91cc4521bb1e1d9",
"score": "0.5815011",
"text": "def serialize(object) end",
"title": ""
},
{
"docid": "5ebee6d8866deee89d740acddf3dfd05",
"score": "0.58138466",
"text": "def marshal_dump\n aliases = @aliases.map do |a|\n [a.full_name, parse(a.comment)]\n end\n\n [ MARSHAL_VERSION,\n @name,\n full_name,\n @singleton,\n @visibility,\n parse(@comment),\n @call_seq,\n @block_params,\n aliases,\n @params,\n ]\n end",
"title": ""
},
{
"docid": "ffdeca168ebc3220cb473496338144ae",
"score": "0.5810106",
"text": "def serialize(level = 0)\n end",
"title": ""
},
{
"docid": "ffdeca168ebc3220cb473496338144ae",
"score": "0.5810106",
"text": "def serialize(level = 0)\n end",
"title": ""
},
{
"docid": "cf2c78acf8c87053f446279cf21f37cd",
"score": "0.5803328",
"text": "def dump(object)\n raise NotImplementedError, \"#{self.class}#dump is not implemented\"\n end",
"title": ""
},
{
"docid": "3c7e55da3dea2d582e02c80593e8c6e6",
"score": "0.58026576",
"text": "def start_dump\n end",
"title": ""
},
{
"docid": "3c7e55da3dea2d582e02c80593e8c6e6",
"score": "0.58026576",
"text": "def start_dump\n end",
"title": ""
},
{
"docid": "7828008f87df2e46dcfb291bb0f328e4",
"score": "0.5784458",
"text": "def dump\n\t\t\t\tflatten!\n\t\t\t\t\n\t\t\t\tMessagePack.dump(@attributes)\n\t\t\tend",
"title": ""
},
{
"docid": "d9f6a9aa1f7303c34d54488d15739438",
"score": "0.5774282",
"text": "def dump\n map(&:dump)\n end",
"title": ""
},
{
"docid": "8563a77e59a40964d26ac586d22bca2b",
"score": "0.57696015",
"text": "def marshal_dump\n [ @ops, @rel ]\n end",
"title": ""
},
{
"docid": "62b99575e6d8c01caa0a6b9763d8cc1b",
"score": "0.5769448",
"text": "def marshal_load x\n @nested_class = x.first\n super x.last\n set_default_proc!\n end",
"title": ""
},
{
"docid": "37bfa6185f12583b0e23ae4cbad0cd9d",
"score": "0.5766624",
"text": "def dumper(object)\n Dumper.new(object)\n end",
"title": ""
},
{
"docid": "b91889daa0c6e3a872bcc0e7be26f998",
"score": "0.57559514",
"text": "def dump\n @dump ||= Dump.new(dump_url)\n end",
"title": ""
},
{
"docid": "bd0dd6d0e03f00ef7f32c6ebb7ba3c7d",
"score": "0.5731185",
"text": "def dump(object)\n adapter_dump(object)\n end",
"title": ""
},
{
"docid": "624182f0456efffbb2b2b08828fce377",
"score": "0.57245916",
"text": "def marshal_dump\n [@tokens, @count, @index, @pairs]\n end",
"title": ""
},
{
"docid": "241fda4c8eccb94d6e218f5502eb843a",
"score": "0.57154715",
"text": "def _dump(level)\n payload = Marshal.dump [@caller, @method, @arguments, @block]\n \"#{@id}:#{payload}\"\n end",
"title": ""
},
{
"docid": "a089ada68dd135567cf6f326de5986c8",
"score": "0.57049793",
"text": "def _pack\n class_name = self.class.to_s\n self.__pack = Aqua::Storage.new\n self.__pack.id = @id if @id\n self.__pack[:_rev] = _rev if _rev \n self.__pack[:keys] = []\n self.__pack[:stubs] = []\n self.__pack.merge!( _pack_object( self ) )\n _pack_singletons\n __pack\n end",
"title": ""
},
{
"docid": "e6e93dbd72aa682776e3c46c1c5a07a4",
"score": "0.5692016",
"text": "def dump\n {\n :base_dir => base_dir,\n :debug => debug,\n :ident => ident\n }\n end",
"title": ""
},
{
"docid": "28ee2da6840feee9562af047de23ca8b",
"score": "0.56539154",
"text": "def serialize!\n end",
"title": ""
},
{
"docid": "1ed914d141257c2dfaa30c6d76db421d",
"score": "0.5651547",
"text": "def marshal_dump\n [\n MARSHAL_VERSION,\n @title,\n parse,\n ]\n end",
"title": ""
},
{
"docid": "87f5f9c2521f4dfd69cc372436b43cbd",
"score": "0.5649061",
"text": "def _dump( &encode_block )\n return enum_for(__method__) unless block_given?\n case\n when table_dataset.respond_to?( :stream )\n stream_dump &encode_block\n\n when primary_keys.empty?\n paginated_dump &encode_block\n\n when primary_keys.all?{|i| i == :id }\n min_max_dump &encode_block\n\n else\n inner_dump &encode_block\n end\n end",
"title": ""
},
{
"docid": "6ce353ee9f83c6195440720edccbd7d4",
"score": "0.56375635",
"text": "def dump\n Ox.dump(send mechanism)\n end",
"title": ""
},
{
"docid": "8aabe56f8eb9248a0300eea4030a4d8c",
"score": "0.5637438",
"text": "def _dump(lv)\n Marshal.dump([@uri, @ref])\n end",
"title": ""
},
{
"docid": "81bebf5f4e895666b27f54383ef25d89",
"score": "0.5625482",
"text": "def _dump\n self.contents\n end",
"title": ""
},
{
"docid": "7dbf016991355c966d56bdbe2dfc73e9",
"score": "0.5619337",
"text": "def dumper_class\n attributes.dumper_class\n end",
"title": ""
},
{
"docid": "85969d5c4cc3480897576f382c26f5f0",
"score": "0.561036",
"text": "def dump(depth = 0)\n attr = ''\n @attr.each do |a| ## self.attributes do |a|\n attr += a.to_s + \", \"\n end if @attr\n attr.chop!\n attr.chop!\n print ' ' * depth * 2\n print \"#{@name}(#{attr})\\n\"\n @children.each do |child|\n child.dump(depth + 1)\n end if @children\n end",
"title": ""
},
{
"docid": "3fca049d563683e85639f49de9a380b3",
"score": "0.56067127",
"text": "def serialize(*args, &block); end",
"title": ""
},
{
"docid": "3fca049d563683e85639f49de9a380b3",
"score": "0.56067127",
"text": "def serialize(*args, &block); end",
"title": ""
},
{
"docid": "22ecedff2d89cb5927a2f9f0a75d57d0",
"score": "0.5596792",
"text": "def _dump level\n object_id.to_s\n end",
"title": ""
},
{
"docid": "eaf91cbda6bdbf66cb957cef6823876f",
"score": "0.5596374",
"text": "def dump\n Ox.dump(send mechanism)\n end",
"title": ""
},
{
"docid": "f70df7bab4dcdcff28b923f3607854e5",
"score": "0.5593677",
"text": "def value_type_chain_dump(o)\n return if o.ordered_dumped\n value_type_chain_dump(o.supertype) if (o.supertype && !o.supertype.ordered_dumped)\n value_type_fork(o)\n o.ordered_dumped!\n end",
"title": ""
},
{
"docid": "b982daaf5521f5698a5f6c1185bf20ca",
"score": "0.55903083",
"text": "def marshal_dump\n aliases = @aliases.map do |a|\n [a.name, parse(a.comment)]\n end\n\n is_alias_for = [\n @is_alias_for.parent.full_name,\n @is_alias_for.singleton,\n @is_alias_for.name\n ] if @is_alias_for\n\n [ MARSHAL_VERSION,\n @name,\n full_name,\n @singleton,\n @visibility,\n parse(@comment),\n @call_seq,\n @block_params,\n aliases,\n @params,\n @file.relative_name,\n @calls_super,\n @parent.name,\n @parent.class,\n @section.title,\n is_alias_for,\n ]\n end",
"title": ""
},
{
"docid": "f5bf076bbc31423f6ac7c0d6e4d209a8",
"score": "0.5583854",
"text": "def serializer=(_arg0); end",
"title": ""
},
{
"docid": "25f7a3e11529edeeca91005e7bbb899a",
"score": "0.5576953",
"text": "def _sparkle_dump_unpacker(item)\n if item.is_a?(::Enumerable)\n if item.respond_to?(:keys)\n item.class[\n *item.map do |entry|\n _sparkle_dump_unpacker(entry)\n end.flatten(1)\n ]\n else\n item.class[\n *item.map do |entry|\n _sparkle_dump_unpacker(entry)\n end\n ]\n end\n elsif item.is_a?(::AttributeStruct)\n item.nil? ? UNSET_VALUE : item._sparkle_dump\n elsif item.is_a?(::SparkleFormation)\n item.sparkle_dump\n else\n item\n end\n end",
"title": ""
},
{
"docid": "96567e7201a94a8728ccd095d3ab3742",
"score": "0.557501",
"text": "def dumper(&block)\n dumper_class.class_eval(&block)\n\n self\n end",
"title": ""
},
{
"docid": "d609570abf607e901ae546fda594eccc",
"score": "0.5561111",
"text": "def marshal_dump\n @table\n end",
"title": ""
},
{
"docid": "e4f1685459af1ce1636e53909edb90f9",
"score": "0.5555008",
"text": "def _dump(limit = -1)\n Marshal.dump(name, limit)\n end",
"title": ""
},
{
"docid": "a29d290574923541b14fac8c8dbbab85",
"score": "0.5534332",
"text": "def dump_mode!\n @_dump_mode = !!!@_dump_mode\n end",
"title": ""
},
{
"docid": "9b0a899e6e9fd54810bd50aef7d082f1",
"score": "0.5531977",
"text": "def marshal_dump\n [@delay, @hp, @maxhp, @level, @connections, @exp_left]\n end",
"title": ""
},
{
"docid": "6e12896a516f44f7242feb874b586488",
"score": "0.5523321",
"text": "def serialize\n YAML::dump(self)\n end",
"title": ""
},
{
"docid": "0adf1c8cb38d7bcc4e9d83337d99981a",
"score": "0.5518404",
"text": "def marshal_dump\n [@x, @y, @grid, @generator_pointer]\n end",
"title": ""
},
{
"docid": "d7f25eebfef7a4df3af8dd5059296acb",
"score": "0.5502739",
"text": "def _dump(level)\n value\n end",
"title": ""
},
{
"docid": "9b8ce770fa6ad350de55ef5c776b00fb",
"score": "0.5497614",
"text": "def dump(value)\n map(super(value), :dump)\n end",
"title": ""
},
{
"docid": "c0d9dc5ab1ffc50dc9f2996234e53981",
"score": "0.54886943",
"text": "def dump_to\n # some fog models have an identity field that is duplicate.\n # duplicate identities can mean the cache for that already exists.\n # this means cache duplication is possible.\n #\n # see \"dumping two models that have duplicate identity\" test case.\n \"#{self.class.namespace(model.class, model.service)}/#{model.identity}-#{SecureRandom.hex}.yml\"\n end",
"title": ""
},
{
"docid": "4929c1b9891b14e8291b508cbeddebb3",
"score": "0.54885614",
"text": "def dump\r\n super + to_s\r\n end",
"title": ""
},
{
"docid": "89b11a9d4e64101234c3b51a52afb2b4",
"score": "0.54774207",
"text": "def dump_to_s\n output = \"\\r\\n---- Factory dump: ----\"\n @context_list.each do |context_key, context|\n if context.parent_context.instance_of?( V3::ContextDAO )\n output << \"\\r\\n(#{context.parent_context.id}) => '#{context_key}': #{ context }\"\n else\n output << \"\\r\\n'#{context_key}': #{ context }\"\n end\n end\n output << \"\\r\\n\"\n @entity_list.each do |entity_key, entity|\n output << \"\\r\\n'#{entity_key}': #{ entity }\"\n end\n output << \"\\r\\n-----------------------\\r\\n\"\n output\n end",
"title": ""
},
{
"docid": "ace8c9eb21373d6cca96094ff35d5ba4",
"score": "0.54769635",
"text": "def marshal_dump\n [\n MARSHAL_VERSION,\n @relative_name,\n @parser,\n parse(@comment),\n ]\n end",
"title": ""
},
{
"docid": "273dd6aaa35b02a004e29f76fd452973",
"score": "0.5474403",
"text": "def lock_dump(manager)\n #Marshal.dump(manager)\n #JSON.fast_generate(manager.to_h)\n JSON.pretty_generate(manager.to_h)\n end",
"title": ""
},
{
"docid": "2e0799c0b953edb5eb7360610d574a72",
"score": "0.5473025",
"text": "def deep_clone; Marshal::load(Marshal.dump(self)); end",
"title": ""
},
{
"docid": "b7a27b8645d2b2c3056a45ebbb558e66",
"score": "0.5463613",
"text": "def dump( obj, &block )\n f = File.open( get_unique_filename, 'w' )\n\n serialized = serialize( obj )\n f.write( serialized )\n\n block.call( serialized ) if block_given?\n\n f.path\n ensure\n f.close\n end",
"title": ""
},
{
"docid": "c63a3ee7da687b5e477e1b64f539ff4e",
"score": "0.5450756",
"text": "def marshal_load(serialised); end",
"title": ""
}
] |
9821bdbe7a72553ea39776a02a011d47
|
Returns hash of body, with types as keys No it doesn't, yet
|
[
{
"docid": "8d7278ae50a056d277894337ef6e3371",
"score": "0.0",
"text": "def parse_body content_type, body\n body.lstrip! rescue nil\n case content_type\n when \"multipart/alternative\" then parse_multipart_alternative(body)\n when \"text/plain\" then parse_text_plain(body)\n when \"text/html\" then parse_text_html(body)\n when nil then [\"[No Content]\"]\n else [content_type + \" not yet supported\"]\n end\n end",
"title": ""
}
] |
[
{
"docid": "9e46506da67228e2ffac7ef9ad813417",
"score": "0.70834637",
"text": "def to_hash\n body.to_hash\n end",
"title": ""
},
{
"docid": "dcb7464682266f162e70dea027ae41bd",
"score": "0.67862517",
"text": "def types\n result = {}\n headers.each do |h|\n result[h] = type(h)\n end\n result\n end",
"title": ""
},
{
"docid": "1df9ed7a48517fb4b7a265224555ff55",
"score": "0.652186",
"text": "def body(sub_type=\"plain\")\n return { \"type\" => sub_type, \"content\" => @body[sub_type] }\n end",
"title": ""
},
{
"docid": "5d31bd198c7506340cc5cf347188d41c",
"score": "0.6380993",
"text": "def to_body\r\n to_hash\r\n end",
"title": ""
},
{
"docid": "3eae3b8d5eab48b04cc5ef92097b2c0b",
"score": "0.6332959",
"text": "def to_hash\n @parsed_body ||= JSON.parse(@body, symbolize_names: true)\n end",
"title": ""
},
{
"docid": "dda01debc327f4c468c3652985091bbf",
"score": "0.63062865",
"text": "def body_retrieve\n ret = Hash.new\n ret[:access_token] = self.access_token\n ret[:type] = self.institution\n ret[:email] = self.email\n ret.merge(body)\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62928987",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
},
{
"docid": "e1926718ef8a8693b7fec68f12da2fdc",
"score": "0.62922347",
"text": "def to_body\n to_hash\n end",
"title": ""
}
] |
5b0eff3a488657c8091cde775f038172
|
Push Blog Post draft edits live Take any changes from the draft version of the Blog Post and apply them to the live version.
|
[
{
"docid": "3791a15d66c45f2727c119e35adfeda2",
"score": "0.0",
"text": "def push_live(object_id, opts = {})\n push_live_with_http_info(object_id, opts)\n nil\n end",
"title": ""
}
] |
[
{
"docid": "1ee59712dc3a6fefa662b2de9046ce9b",
"score": "0.61935693",
"text": "def publish\n @options['date'] ||= read_draft_date || Time.now.iso8601\n\n post_options = {\n 'title' => read_draft_title,\n 'date' => @options['date'],\n 'slug' => publish_slug,\n 'content' => read_draft_content,\n 'dir' => @options['dir'],\n 'type' => 'post from draft'\n }\n\n # Create a new post file\n #\n Post.new(post_options).write\n \n # Remove the old draft file\n #\n FileUtils.rm @options['path']\n\n end",
"title": ""
},
{
"docid": "588c5c82e42b32285685de60ce88d691",
"score": "0.61695975",
"text": "def push_to_draft\n transition_to :draft\n end",
"title": ""
},
{
"docid": "746a662e64c67074c208ec8de297f776",
"score": "0.6082002",
"text": "def publish\n @options['date'] ||= read_post_yaml('date') || Time.now.iso8601\n @options['title'] = read_post_yaml('title')\n\n post_options = {\n 'title' => @options['title'],\n 'date' => @options['date'],\n 'slug' => path_slug(@options['path']),\n 'extension' => File.extname(@options['path']).sub(/^\\./, ''),\n 'content' => read_post_content,\n 'dir' => @options['dir'],\n 'type' => \"post from draft\",\n 'write_message' => \"Published: #{relative_path(path)} →\",\n 'force' => @options['force']\n }\n\n # Create a new post file\n #\n Post.new(site, post_options).write\n \n # Remove the old draft file\n #\n FileUtils.rm @options['path']\n\n end",
"title": ""
},
{
"docid": "339dfcf5e0d4d5c7614e3c9ad5a3e025",
"score": "0.6016683",
"text": "def create_and_edit\n @post = current_user.posts.build(post_params)\n @post.save_as_draft\n redirect_to edit_post_url(@post)\n end",
"title": ""
},
{
"docid": "2ab05a755f839b30c23a3e9fc95f3354",
"score": "0.59551173",
"text": "def publish\n\n current_user_or_redirect ? nil : return\n\n @post = Post.find(params[:id])\n # topic = Topic.where(\"id = ?\", params[:topic]).first\n # if topic\n # @post.topics << topic unless @post.topics.include?(topic)\n # end\n \n if !@post.mine?(@current_user.id)\n redirect_to root_path\n return\n end\n \n @post.status = 'live'\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n @post.update_created_at\n @post.delay.add_interactions\n format.html { redirect_to @post.link_for_post, notice: 'Post was successfully published.' }\n format.json { head :no_content }\n format.js\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"title": ""
},
{
"docid": "ba29813153d9e7f96fa20bd7c72311bd",
"score": "0.59388274",
"text": "def update\n @post.author ||= current_user\n @post.current_revision.user = current_user\n check_for_draft\n respond_to do |format|\n if @post.update_attributes(params[:post])\n handle_pingbacks\n flash[:notice] = 'Post was successfully updated.'\n format.html { redirect_to(@post) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9aa82b12363f2f6fc503551bca74762f",
"score": "0.59007764",
"text": "def sync_blog\n Middleman::Cli::SyncBlog.new.contentful\n true\n end",
"title": ""
},
{
"docid": "a828dfa4f962fd750116dc708caf79fe",
"score": "0.58565086",
"text": "def publish_now!\n puts 'publish noew...'\n self.status = Post::PUBLISHED\n self.published_at = self.publish_at\n save!\n end",
"title": ""
},
{
"docid": "387d1f759927e36a08f2c57c5fc2b9db",
"score": "0.58415776",
"text": "def update\n blog_post_updater = BlogPostUpdater.new(self)\n blog_post_updater.update(params)\n end",
"title": ""
},
{
"docid": "b56f4ae4cb59f09b4f6c5cbe8fd194d9",
"score": "0.5820147",
"text": "def update\n @blog.published_at = Time.now if params[:commit] == 'Publish now'\n respond_to do |format|\n if @blog.update(blog_page_params)\n format.html { redirect_to @blog, notice: \"Blog was successfully updated.\" }\n format.json { render :show, status: :ok, location: @blog }\n else\n format.html { render :edit }\n format.json { render json: @blog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9c366e2cefa07f579a852a1a326f131d",
"score": "0.5766524",
"text": "def update\n\n if params[:commit] == 'Submit Post To Class' \n @post.submitted = true\n @post.draft2 = @post.draft1\n end\n \n\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to edit_post_path(@post), notice: 'Post was successfully updated.' }\n format.json { render :edit, status: :ok, location: @post }\n else\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e225cde51bfa6e7299bdff822b343d67",
"score": "0.5747854",
"text": "def set_to_live\n # Checks it was created more than 5 seconds ago as there are updates on creation.\n if self.draft? && self.created_at < 5.seconds.ago\n self.draft = false\n self.save!(validate: false)\n end\n end",
"title": ""
},
{
"docid": "34479b59d4f21ef4acf93ac2fc57962e",
"score": "0.57288456",
"text": "def publish_edits!\n\t\tself.edits ||= {}\n\t\tself.edits[\"publish\"] = true\n\t\tself.save!\n\tend",
"title": ""
},
{
"docid": "73e723703acd5673e2c73782b24801b0",
"score": "0.56886387",
"text": "def update\n \n unless current_user == @post.user\n return\n end\n \n unless params[:post][:public].nil?\n @post.public = params[:post][:public]\n end\n \n unless params[:post][:random_token].nil?\n @post.random_token = params[:post][:random_token]\n end\n \n set_burn_date\n \n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.json { render :json => get_json, :callback => params[:callback] }\n else\n format.json { render :json => @post.errors,\n :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9c4b08b15b0d1508dd856c739ddbb5fe",
"score": "0.5667514",
"text": "def update\n Post.transaction do\n begin\n @post.update(transformed_params)\n @post.update_hash_tags\n @post.update_attribute(:published_date, DateTime.now) if @post.published?\n redirect_to @post, notice: 'Post was successfully updated.'\n rescue StandardError => ex\n flash[:error] = ex.message\n render :edit\n end\n end\n end",
"title": ""
},
{
"docid": "940b574608c4d346c29d62357aaafce6",
"score": "0.5661926",
"text": "def update\n @post = Post.find(params[:id])\n \n if params[:preview].to_s == \"true\"\n @user = current_user\n @post = Post.new(params[:post])\n @post.created_at = DateTime.now\n respond_to do |format|\n format.html { render :template => \"posts/fe/show_post\", layout: \"blog\" }\n end\n else\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to posts_path, notice: 'Post was successfully updated.' }\n else\n format.html { render action: \"edit\" }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "1491aaa37a4e3e5c0842a4a11561acdf",
"score": "0.56591845",
"text": "def published_post\n if self.published && self.published_at.nil?\n self.published_at = Time.now\n end\n end",
"title": ""
},
{
"docid": "1b76ff7404c4b4aeb3d17396f0dad605",
"score": "0.5649376",
"text": "def create\n @blog.author = current_person\n @blog.published_at = Time.now if params[:commit] == 'Publish now'\n \n respond_to do |format|\n if @blog.save\n format.html { redirect_to @blog, notice: \"Blog was successfully created.\" }\n format.json { render :show, status: :created, location: @blog }\n else\n format.html { render :new }\n format.json { render json: @blog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c3bf876172025148327c6d97886b399",
"score": "0.56394947",
"text": "def update\n update! { posts_url }\n end",
"title": ""
},
{
"docid": "3d7c7fb091bfa30477fc8bee9b31e86f",
"score": "0.5635233",
"text": "def push_to_web_sockets\n if created_at_changed?\n ActionCable.server.broadcast(\"posts\", \n data: json_view\n )\n end\n end",
"title": ""
},
{
"docid": "a2d79e61ffb5779d1568b1af8fe186cc",
"score": "0.56142604",
"text": "def publish\n @post = Post.find(params[:id])\n @post.state = 'published'\n if @post.save\n flash[:notice] = \"published successfully\"\n # merge :id into params\n redirect_to edit_post_url(@post)\n end\n end",
"title": ""
},
{
"docid": "9e93f70c14148b231518df36c9f8fd70",
"score": "0.5601039",
"text": "def edit_post_action\n if params[:post_title].strip.size == 0\n flash[:error] = \"Title cannot be empty.\"\n return redirect_to \"/edit_post/\" + params[:post_id]\n end\n post = Post.find(params[:post_id].to_i)\n while !post.tags.empty?\n Tag.unlink_tag_from_post(post, post.tags.first)\n end\n post.title = params[:post_title]\n post.content = params[:post_content]\n post.javascript = params[:post_javascript]\n post.css = params[:post_css]\n post.tags = params[:post_tags].downcase.split(\",\").map { |tag| tag.strip }.select { |tag| tag != \"\" }.map { |name| Tag.get_tag_by_name(name) }\n post.is_public = !!params[:post_is_public]\n post.markdown!\n post.save!\n flash[:notice] = \"The changes to the post entitled \\\"\" + post.title_html + \"\\\" have been saved.\"\n return redirect_to \"/edit_post/\" + params[:post_id]\n end",
"title": ""
},
{
"docid": "5f235a12c4a5bb37868eb0eb9078668f",
"score": "0.55983615",
"text": "def rebuild_recent_post\n self.topic.forum.update_attribute(\n :last_post_id, self.topic.forum.recent_post.nil? ? 0 : self.topic.forum.recent_post.id\n )\n end",
"title": ""
},
{
"docid": "8b6ee16f3cc9a0aac4e55555e3c3ea0c",
"score": "0.5561506",
"text": "def publish\n fail_with! 'Already published' if version.published?\n\n version.published_at = Time.zone.now\n version.active = true\n\n ActiveRecord::Base.transaction do\n save_or_die! version\n TosVersion.where.not(id: version.id).update_all(active: false)\n end\n\n reset_tos_acceptance\n end",
"title": ""
},
{
"docid": "2ccdfe363c162abaf1583929d3b92d48",
"score": "0.55487126",
"text": "def publish\n if self.draft\n self.published_at = nil\n else\n self.published_at ||= DateTime.now\n end\n end",
"title": ""
},
{
"docid": "8b7b81d4740560152209268eed1eb841",
"score": "0.55441177",
"text": "def update\n # Call `draft_publication_dependencies` to check if any other drafted\n # records should be published along with this `@draft`.\n @dependencies = @draft.draft_publication_dependencies\n\n # If you would like to warn the user about dependent drafts that would need\n # to be published along with this one, you would implement an\n # `app/views/drafts/update.html.erb` view template. In that view template,\n # you could list the `@dependencies` and show a button posting back to this\n # action with a name of `commit_publication`. (The button's being clicked\n # indicates to your application that the user accepts that the dependencies\n # should be published along with the `@draft`, thus avoiding orphaned\n # records).\n if @dependencies.empty? || params[:commit_publication]\n @draft.publish!\n flash[:notice] = t('.notice')\n redirect_to @draft.item\n else\n # Renders `app/views/drafts/update.html.erb`\n end\n end",
"title": ""
},
{
"docid": "7be600fe8e934926f62fe76c53d84f18",
"score": "0.5541842",
"text": "def run!\n @post.save!\n end",
"title": ""
},
{
"docid": "d274f7692ee5e7145b5645b8ae1f86a0",
"score": "0.5516636",
"text": "def create\n params[:post][:published_at] = \"#{params[:published_date]} #{params[:date][:hour]}:#{params[:date][:minute]}:00\"\n\n if params[:post_id]\n Post.find(params[:post_id]).update_attributes(params[:post])\n this_post_id = params[:post_id]\n else\n this_post = Post.create(params[:post])\n this_post_id = this_post.id\n end\n\n redirect_to blog_path(this_post_id)\n end",
"title": ""
},
{
"docid": "6bc49c3103cde248e3b161fb1f31aa21",
"score": "0.5509655",
"text": "def save\r\n\t\tBlog_post.add_to_array(self)\r\n\tend",
"title": ""
},
{
"docid": "139948e49858f674f97c17b29ef5e019",
"score": "0.550729",
"text": "def update\n @post.short_body = post_params[:body].split('</p>')[0] + '</p>'\n @post.tags.delete_all\n set_tags\n\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "abfee4bea35e6d337ea0dcb14ac46dc3",
"score": "0.54988974",
"text": "def update\n \n if params[:commit] == 'draft'\n @paperpost = Paperpost.new(paperpost_params)\n respond_to do |format|\n if @paperpost.save\n format.html { redirect_to @paperpost, notice: 'Article was saved as draft.' }\n format.json { render :show, status: :ok, location: @paperpost }\n else\n format.html { render :edit }\n format.json { render json: @paperpost.errors, status: :unprocessable_entity }\n end\n \n end\n elsif params[:commit] == 'publish'\n respond_to do |format|\n if @paperpost.update(paperpost_params)\n format.html { redirect_to @paperpost, notice: 'Paperpost was successfully submitted to moderator.' }\n format.json { render :show, status: :ok, location: @paperpost }\n else\n format.html { render :edit }\n format.json { render json: @paperpost.errors, status: :unprocessable_entity }\n end\n end\n end\n \n end",
"title": ""
},
{
"docid": "28636e5251fca185131d428969b927f9",
"score": "0.54900753",
"text": "def edit_post(post_markdown, post_title, existing_post_file_path)\n # This ref_name variable represents the branch name\n # for editing a post. At the end we strip out all of the whitespace in \n # the post_title to create a valid branch name\n branch_name = \"editPost#{post_title.gsub(/\\s+/, '')}\"\n ref_name = \"heads/#{branch_name}\"\n\n master_head_sha = @github_service.get_master_head_sha\n sha_base_tree = @github_service.get_base_tree_for_branch(master_head_sha)\n\n @github_service.create_ref_if_necessary(ref_name, master_head_sha)\n new_tree_sha = create_new_tree(post_markdown, post_title, existing_post_file_path, sha_base_tree)\n\n @github_service.commit_and_push_to_repo(\"Edited post #{post_title}\", new_tree_sha, master_head_sha, ref_name)\n @github_service.create_pull_request(branch_name, 'master', \"Edited Post #{post_title}\", \n Rails.configuration.pull_request_body, \n [Rails.configuration.webmaster_github_username])\n \n PostImageManager.instance.clear\n end",
"title": ""
},
{
"docid": "8af654bb194e6be536990e442f818625",
"score": "0.5448017",
"text": "def push\n @topic.title = title.strip\n @topic.user = @user\n @topic.top_post.user = @user\n @topic.top_post.content = content.strip\n @topic.top_post.floor = 0\n @topic.anonymous = anonymous || false\n @topic.top_post.anonymous = @topic.anonymous\n # @topic.posts_count = 1\n @topic.group_id ||= 1\n @topic.status = 'publish'\n # @topic.uncommentable = uncommentable\n\n if picture\n attachment = Attachment.create uploader_id: @user.id, file: picture\n @topic.top_post.content << \"![#{attachment[:file]}](#{attachment.file.url})\"\n @attachment_ids = [attachment.id.to_s]\n end\n\n end",
"title": ""
},
{
"docid": "3d06e5e79e284f48ded1c530f23b40a7",
"score": "0.5445845",
"text": "def publish_now(email, password)\n self.state = :published\n return edit(email,password) if post_id\n write(email,password)\n end",
"title": ""
},
{
"docid": "0d71e0e851a1b4d1b57527de61610786",
"score": "0.5444757",
"text": "def update\n @blog_post.update(blog_post_params)\n end",
"title": ""
},
{
"docid": "365e688abb8b10d58888f34470b9f933",
"score": "0.5439787",
"text": "def update\n check_published\n respond_to do |format|\n if post_params[:tag_ids]\n @post.tags = Tag.find(post_params[:tag_ids]) || []\n end\n if @post.update(post_params)\n url = @post.link\n format.html { redirect_to url, notice: 'Post was successfully updated.' }\n format.json { render :show, status: :ok, location: url }\n else\n get_instance_vars\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ae830abc42b817a7ef7e9b013b102b8",
"score": "0.54391664",
"text": "def update\n push_to_db\n end",
"title": ""
},
{
"docid": "2ae830abc42b817a7ef7e9b013b102b8",
"score": "0.54391664",
"text": "def update\n push_to_db\n end",
"title": ""
},
{
"docid": "52e425c8d83400fd3df1ccecdee97118",
"score": "0.5434073",
"text": "def draft(blog_name, options = {})\n validate_options([:limit, :before_id], options)\n get(blog_path(blog_name, 'posts/draft'), options)\n end",
"title": ""
},
{
"docid": "baac377b56bae96b5632c82872ed0cc3",
"score": "0.5407342",
"text": "def publish!\n return false unless published_at.nil?\n\n update_column :published_at, Time.zone.now\n end",
"title": ""
},
{
"docid": "0587c8884839dcbc8b9bdec31151ee57",
"score": "0.5403991",
"text": "def publish(all_blog_posts)\n\t\tall_blog_posts.each do |blog_post|\n\t\t\tputs blog_post.title\n\t\t\tputs blog_post.created_at\n\t\t\tputs blog_post.content\n\tend\n end",
"title": ""
},
{
"docid": "6868ca3f44100a39b6be05d3e2a784e5",
"score": "0.54035443",
"text": "def update\n old_post = Post.find(params[:id])\n\n if post_params[:upload_file]\n data = post_params.delete(:upload_file)\n file_content = data.read.force_encoding(\"UTF-8\");\n post_params[:content] << file_content\n end\n\n if old_post.content == post_params[:content]\n save_success = old_post.update_attributes(post_params)\n @post = old_post\n else\n @post = old_post.create_version(post_params)\n save_success = @post.save\n unless save_success\n old_post.errors = @post.errors\n @post = old_post\n end\n end\n\n respond_to do |format|\n if save_success\n format.html {\n redirect_to @post, notice: 'New version of snippet was created.'\n }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "04ff2128180178d0ba553bbbba3822bc",
"score": "0.5401544",
"text": "def update_draft(object_id, blog_post, opts = {})\n data, _status_code, _headers = update_draft_with_http_info(object_id, blog_post, opts)\n data\n end",
"title": ""
},
{
"docid": "7285fbb4d565e308ab4380a30ec914de",
"score": "0.539935",
"text": "def work(raw_post)\r\n RecentPosts.push(raw_post)\r\n ack! # we need to let queue know that message was received\r\n end",
"title": ""
},
{
"docid": "7cf7184d500cad9b5f63a5e5b0dd26e3",
"score": "0.53913665",
"text": "def publish(args)\n if args.length == 0\n Dir.foreach('_drafts') do |filename|\n FileUtils.mv \"_drafts/#{filename}\", \"_posts/#{filename}\", :force => true\n end\n else\n args.each do |name|\n Dir.foreach('_drafts') do |filename|\n if filename.include? name\n FileUtils.mv \"_drafts/#{filename}\", \"_posts/#{filename}\", :force => true\n exec \"git add . && git commit -m 'Publish #{filename}'\"\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "00358a2a90bdece5bcbb5dc7288ea534",
"score": "0.53755003",
"text": "def publish!\n self.published = true\n save\n end",
"title": ""
},
{
"docid": "6ec188658b4f426b5acd7b72481a78f9",
"score": "0.5358765",
"text": "def update\n \n @previous_content = @post[:content]\n respond_to do |format|\n if @post.update_attributes(params[:post])\n \t\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n \n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "23fc2324fa66ac70ee5f7da69bb38865",
"score": "0.53551763",
"text": "def store_blog_post(time, author, title, content)\n\t\tvalue = []\n\t\tvalue[0] = title\n\t\tvalue[1] = author\n\t\tvalue[2] = content\n\t\tget_blog_posts.store(time, value)\t\n\tend",
"title": ""
},
{
"docid": "016ffde18d83d7d13aceaf8b494c8f79",
"score": "0.5354454",
"text": "def update\n @posts = (Post.all).sort_by do |post|\n post[:created_at]\n end\n @posts = @posts.reverse\n @users = User.all\n respond_to do |format|\n if @post.update(post_params)\n @edited_post_id = @post.id\n @post = Post.new\n @notice = 'Post was successfully updated.'\n format.html { render \"/posts/news_feed\", :locals => { :edited_post_id => @edited_post_id, :posts => @posts,\n :users => @users}}\n format.json { render :show, status: :ok, location: @post }\n else\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b793bc1f56d1920ce0fab87600536899",
"score": "0.5350634",
"text": "def draft=(new_draft_status)\n if ((draft and not new_draft_status) or (not new_draft_status and not posted_at) )\n #NOTE We'll have to change this in the future\n # when we allow people to set the post date\n # manually\n self.posted_at = DateTime.now unless self.posted_at\n slug_from_title() unless slug \n # a slugless post can happen during testing (pre-save), and I just want \n # to guarantee that it doesn't cause issues in production\n self.url = self.posted_at.strftime(CONFIG['post_url_style']).gsub(':slug', slug.to_url)\n end\n \n super(new_draft_status)\n end",
"title": ""
},
{
"docid": "da6b07b049546bb1f6bfb8e8da8281f9",
"score": "0.5338268",
"text": "def trigger_post_receive(oldrev, newrev, ref, user)\n # Create push event\n self.observe_push(oldrev, newrev, ref, user)\n\n # Close merged MR\n self.update_merge_requests(oldrev, newrev, ref, user)\n\n # Execute web hooks\n self.execute_hooks(oldrev, newrev, ref, user)\n\n # Create satellite\n self.satellite.create unless self.satellite.exists?\n end",
"title": ""
},
{
"docid": "9201186677d05632196d48c70c4d7e04",
"score": "0.5337244",
"text": "def publish_now!\n self.status = Micropost::PUBLISHED\n self.published_at = self.publish_at\n save!\n end",
"title": ""
},
{
"docid": "03f2e3001dc05a2c8a1c6a7d860721a0",
"score": "0.53291017",
"text": "def show\n\t\t# add to the view count\n\t\t@blog_post.views += 1\n\t\t@blog_post.save\n\tend",
"title": ""
},
{
"docid": "883640f2d9804d909888be2ba9555c2a",
"score": "0.53290695",
"text": "def reblog\n @post = Post.find_by(id: params[:id])\n end",
"title": ""
},
{
"docid": "470823f947c1b1ff3278dc9f367d8819",
"score": "0.53254753",
"text": "def add_post conv\n conv.posts.build \n end",
"title": ""
},
{
"docid": "0dd49dd4a892d3203b0b87af8f9bb6cb",
"score": "0.5315828",
"text": "def create\n @post = current_user.posts.new(params[:post])\n @post.edited_at = Time.current\n @post.published_at = Time.current if params[:publish]\n if @post.save\n flash[:success] = \"Post criado com sucesso.\"\n redirect_to admin_posts_path\n else\n @page_title = \"Novo Post\"\n render :action => 'new'\n end\n end",
"title": ""
},
{
"docid": "f1b45552155858b12baeb27bccb78763",
"score": "0.5308668",
"text": "def update\n @active_link = \"doodle\"\n @post = Post.find(params[:id])\n #mark the post finished and run validations\n @post.in_progress = false\n if @post.update_attributes(params[:post])\n flash[:notice] = \"Hooray!\"\n redirect_to board_path(@board)\n else\n flash[:error] = @post.errors.full_messages.first\n render :edit\n end\n end",
"title": ""
},
{
"docid": "352f3a327f8fd7d01ce8b6017cb3a4c5",
"score": "0.53079164",
"text": "def update\n @post = @topic.posts.find(params[:id])\n\t\t@post.editor = current_user\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n flash[:notice] = 'Post was successfully updated.'\n format.html { redirect_to(forum_topic_path(@forum, @topic)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77796b8ec717ce3c4937eeb67c97b31a",
"score": "0.53012925",
"text": "def update\n @post = Post.includes(:categories).find(params[:id])\n\n return redirect_back fallback_location: posts_path, alert: 'You are not the author of the post.' unless @post.created_by == current_user\n\n post_hash = post_params\n message = case params[:commit]\n when 'Publish'\n unless @post.published\n post_hash[:published] = true\n post_hash[:published_at] = DateTime.now\n end\n 'Your post has been published.'\n when 'Update'\n 'Your post has been saved.'\n when 'Unpublish'\n post_hash[:published] = false\n post_hash[:published_at] = nil\n 'Your post has been unpublished.'\n end\n if @post.update(post_hash)\n redirect_to edit_post_path(@post.slug), notice: message\n else\n flash.now[:alert] = @post.errors.messages.has_key?(:slug) ?\n ['<li>The title of two posts cannot be identical on the same day.</li>'] :\n @post.errors.full_messages.map { |error| \"<li>#{error}</li>\" }\n render :edit\n end\n end",
"title": ""
},
{
"docid": "81e42b9e0dd8e18a3338bacc53ff0a1f",
"score": "0.52865154",
"text": "def drafts; end",
"title": ""
},
{
"docid": "e1f3c3a53354af9333de2ab104d103f9",
"score": "0.5269996",
"text": "def publish!\n self.update_attribute(:published, true)\n end",
"title": ""
},
{
"docid": "bac985b589db3ba66427064e96cf18b2",
"score": "0.52658135",
"text": "def update\n @post = Post.find(params[:id])\n\tpublished = false\n\tif params[:post][:published] == 1\n\t published = true\n\tend\n\n respond_to do |format|\n if @post.update_attributes(params[:post] )\n format.html { redirect_to(@post, :notice => 'Post updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "660e40bfec35f28b51a34c5349847890",
"score": "0.5263351",
"text": "def update\n if params[:blog_post].include?(:post_content)\n if((@role == \"super\") || (@role == \"admin\"))\n params[:blog_post][:post_content] = Sanitize.clean(params[:blog_post][:post_content], Roxiware::Sanitizer::EXTENDED_SANITIZER)\n else\n params[:blog_post][:post_content] = Sanitize.clean(params[:blog_post][:post_content], Roxiware::Sanitizer::BASIC_SANITIZER)\n end\n end\n respond_to do |format|\n @post.assign_attributes(params[:blog_post], :as=>@role)\n if @post.save\n format.html { redirect_to @post.post_link, :notice => 'Blog post was successfully updated.' }\n format.json { render :json => @post.ajax_attrs(@role) }\n else\n format.html { redirect_to @post, :alert => 'Failure updating post.' }\n format.json { render :json=>report_error(@post)}\n end\n end\n end",
"title": ""
},
{
"docid": "8c57e1421e9d63423841e1e1d8c2f94f",
"score": "0.5254719",
"text": "def publish\n respond_to do |format|\n if @post.publish!\n format.html { redirect_to blog_post_no_prefix_path(@blog, @post),\n notice: 'Post was successfully published.' }\n format.json { render :show, status: :ok, location: @post }\n else\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ccc35fa8c79894797fde8d252855db4",
"score": "0.5247986",
"text": "def update\n respond_to do |format|\n @post.title = params[:title]\n @post.body = params[:body]\n @tags = params[:tags].split(',') unless params[:tags].blank?\n Post.transaction do\n if @post.save\n destroy_tags(@post, @tags)\n create_tags(@post, @tags)\n format.html { redirect_to posts_path, notice: 'Post was successfully updated.' }\n format.json { render :show, status: :ok, location: @post }\n else\n @action_path = post_path @post\n @method = :put\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "0ec159bf7a5308ba2d47cc984e8a9e19",
"score": "0.5244596",
"text": "def update\n @post = Post.find(params[:id], :include => :blog)\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n flash[:notice] = 'Post was successfully updated.'\n format.html { redirect_to(admin_blog_post_url(@post.blog, @post)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "21e0f30fa0df65d31c5113d858389b48",
"score": "0.52411467",
"text": "def update\n respond_to do |format|\n if @blog.update(blog_params)\n @blog.short_body = @blog.body_area.to_plain_text.first(250)\n @blog.save!\n format.html { redirect_to @blog, notice: 'Blog was successfully updated.' }\n format.json { render :show, status: :ok, location: @blog }\n else\n format.html { render :edit }\n format.json { render json: @blog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4b534d70de7047ad25ced4becf98203",
"score": "0.52363104",
"text": "def turn_to_status_post\n fail_with! 'Post already is StatusPost' if @post.status?\n\n if @post.uploads.count.zero?\n @post.type = 'StatusPost'\n @post.title = nil\n @post.save or fail_with! @post.errors\n\n FeedEventsManager.new(user: user, target: @post).turn_to_status_event\n\n @post.elastic_index_document\n @post\n end\n end",
"title": ""
},
{
"docid": "d64ca9a77c57984ffc8f884b208ec310",
"score": "0.5233718",
"text": "def test_02_publish_event_draft\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_event)\n\t\tsleep 2\n\t\t\n\t\tassert $post_pick_group.exists?\n \t\trepostGroupPop\n \t\t$post_event_title.set(\"Event #{random}\")\n \t\t$post_event_calendar_start_text.set(\"#{next_year}-12-14\") \n \t\t$post_event_time_start_field.click\n \t\t$post_event_select_time.select(\"8:00 AM\")\n \t\t$post_event_location.set(\"Location #{random}\")\n \t\t$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('Automated Text')\")\n\t\t$post_save_draft.fire_event(\"onclick\")\n\t\tsleep 2\n\n\t\tassert $post_draft_success.exists?\n\t\tif $post_draft_success.exists?\n\t\t\tedit_draft\n\t\tend\n\n\t\tsleep 2\n\t\tassert $post_new_post.exists?\n\tend",
"title": ""
},
{
"docid": "8446161bc9fa87fcbee67e0a9eaec707",
"score": "0.5233631",
"text": "def preprocess_autopublish_drafts\n puts \"Beginning pre-process step for drafts.\"\n drafts.each do |d|\n if d.autopublish?\n puts \"Autopublishing draft: #{d.title} / #{d.slug}\"\n d.publish!\n end\n end\n end",
"title": ""
},
{
"docid": "bc215ffcf4319ea91d46c66f3eaf6c05",
"score": "0.52300096",
"text": "def update\n\n current_user_or_redirect ? nil : return\n\n @post = Post.find(params[:id])\n\n if !@post.mine?(@current_user.id)\n redirect_to root_path\n return\n end\n\n if @post.status == 'infant'\n @post.status = 'draft'\n end\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n if @post.text\n t = @post.text.gsub(\"\\n\", \"\")\n t = t.strip\n @post.text = t\n @post.save!\n end\n @post.update_slug\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n format.js\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"title": ""
},
{
"docid": "1f5900a88e52aad22d19fc80985f9726",
"score": "0.52272135",
"text": "def update\n @page = Page.find(params[:id])\n\n # Update the last user that updated the content\n @page.content.user = current_user if logged_in?\n @page.content.published = true if params[:commit] == \"Publish\"\n @page.tag_list.add(params[:tags_to_apply], :parse => true)\n\t\n respond_to do |format|\n if @page.update_attributes(params[:page]) && @page.content.update_attributes(params[:content])\n notify :notice, 'Page was successfully updated.'\n \n format.html { redirect_to(@page) }\n format.xml { head :ok }\n format.js\n else\n\t\t notify :error, \"There was an error updating the page.\"\n\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @page.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff25f1c697ad6f6bed4a1b4ece01dc52",
"score": "0.5226481",
"text": "def save_draft\n run_callbacks :save_draft do\n if self.new_record?\n _draft_creation\n else\n _draft_update\n end\n end\n end",
"title": ""
},
{
"docid": "e926b05b2e2b2c48c4ffe9704b218414",
"score": "0.5225443",
"text": "def update\n\t\tparams[:blog_post][:tags] = params[:blog_post][:tags].split(',').map(&:strip)\n respond_to do |format|\n if @blog_post.update(blog_post_params)\n format.html { redirect_to @blog_post, notice: 'Blog post was successfully updated.' }\n format.json { render :show, status: :ok, location: @blog_post }\n else\n format.html { render :edit }\n format.json { render json: @blog_post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "479789ccb6836da058a5c35ee3d23143",
"score": "0.52183485",
"text": "def publish!\n self.published = true\n\n # upgrade if necessary\n if upgrade_needed? || current_version.nil?\n upgrade_version!\n else\n save(:validate => false)\n end\n end",
"title": ""
},
{
"docid": "876f9f521687d6e4834972817d4e02d5",
"score": "0.5217337",
"text": "def publish\n self.published = true\n end",
"title": ""
},
{
"docid": "5d0f08d0f00e0eb6d63aa08af922e574",
"score": "0.5210039",
"text": "def draft?; end",
"title": ""
},
{
"docid": "29f12b9ada5da97e8d6b95c48724071e",
"score": "0.52092236",
"text": "def preview\n assign_attributes\n @post\n end",
"title": ""
},
{
"docid": "0e5fea1c3bbf14b6f8b03e515a12e2b0",
"score": "0.52062476",
"text": "def update\n @post.update!(post_params)\n end",
"title": ""
},
{
"docid": "530108b4572da6cc0790c6e82c79d9f6",
"score": "0.5205048",
"text": "def edit_post(name, content)\n\t\tpost = Post.find_by(post_name: name)\n\t\tpost.content = content\n\t\tpost.save!\n\tend",
"title": ""
},
{
"docid": "5c67f6e8342130918f5fc7f7a0b01b19",
"score": "0.5204731",
"text": "def create_post_action\n post = Post.create(:title => \"Untitled Post\", :title_html => \"\", :content => \"\", :content_html => \"\", :javascript => \"\", :css => \"\", :is_public => false, :sort_id => 1)\n post.tags = [Tag.get_tag_by_name(\"home\")]\n post.sort_id = post.id\n post.markdown!\n post.save!\n flash[:notice] = \"New post created.\"\n return redirect_to \"/edit_post/\" + post.id.to_s\n end",
"title": ""
},
{
"docid": "d725babbfc83df7e8bec6296f5bb350b",
"score": "0.5202139",
"text": "def publish!\n self.published = true\n if self.respond_to?(:publish_on)\n self.publish_on ||= Date.today\n end\n self.save\n end",
"title": ""
},
{
"docid": "089027113209fc83edf5f095b1e6768c",
"score": "0.5199791",
"text": "def push_live_with_http_info(object_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BlogPostsApi.push_live ...'\n end\n # verify the required parameter 'object_id' is set\n if @api_client.config.client_side_validation && object_id.nil?\n fail ArgumentError, \"Missing the required parameter 'object_id' when calling BlogPostsApi.push_live\"\n end\n # resource path\n local_var_path = '/cms/v3/blogs/posts/{objectId}/draft/push-live'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\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]\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']\n\n new_options = opts.merge(\n :operation => :\"BlogPostsApi.push_live\",\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: BlogPostsApi#push_live\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "8533c25470c8d36734adcdc7600773c2",
"score": "0.519878",
"text": "def test_04_publish_event_draft\n\t\tloginPost\n\t\t$browser.goto($patch_event)\n\t\tsleep 2\n\t\tif $post_pick_group.exists?\n \t\t\tpostGroupPop\n \t\t\t$post_event_title.set(\"Event #{random}\")\n \t\t\t$post_event_calendar_start_text.set(\"2013-12-12\") \n \t\t\t$post_event_time_start_field.click\n \t\t\t$post_event_select_time.select(\"8:00 AM\")\n \t\t\t$post_event_location.set(\"Location #{random}\")\n \t\t\t$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('Automated Text')\")\n\t\t\t$post_save_draft.fire_event(\"onclick\")\n\t\t\tsleep 2\n\t\telse puts \"PD04T04: FAILED! User able to save draft.\"\n\t\tend\n\t\t\n\t\tif $post_draft_success.exists?\n\t\t\tcancel_delete\n\t\telse puts \"PD04T01: FAILED! Unable to delete draft.\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ef0d9355f506943cab01ee54f59e6d90",
"score": "0.51938754",
"text": "def test02_publish_article_draft\n\t\tloginPost\n\t\t$browser.goto($patch_article)\n\t\tsleep 2\n\t\tif $post_pick_group.exists?\n \t\t\tpostGroupPop\n \t\t\t$post_article_title.set(\"Article #{random}\")\n \t\t\t$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('Automated Text')\")\n\t\t\t$post_save_draft.fire_event(\"onclick\")\n\t\telse puts \"PD04T02: FAILED! User unable to save draft.\"\n\t\tend\n\t\t\n\t\tif $post_draft_success.exists?\n\t\t\tcancel_delete\n\t\telse puts \"PD04T01: FAILED! Unable to delete draft.\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e40b51d52feebd56bd9f1ad9000f1504",
"score": "0.51866394",
"text": "def update\n @post = Post.find(params[:id])\n @user = @post.user\n @topic = @post.topic\n\n # form values\n @post.title = params[:post][:title]\n @post.content = params[:post][:content]\n\n # preview?\n if !params[:preview].nil?\n # breadcrumbs\n add_breadcrumb \"Home\", :root_path\n if !@topic.forum.ancestors.empty?\n for ancestor in @topic.forum.ancestors\n add_breadcrumb ancestor.title, forum_path(ancestor)\n end\n add_breadcrumb @topic.forum.title, forum_path(@topic.forum.id)\n add_breadcrumb @topic.title, topic_path(@topic)\n end\n render :action => \"new\"\n # save post\n else\n if @post.save\n redirect_to topic_path(@post.topic_id)\n end\n end\n end",
"title": ""
},
{
"docid": "9a1db295c1c35b51a231ca8381099748",
"score": "0.5175192",
"text": "def set_published_at\n if draft_changed? && !draft && published_at.nil?\n write_attribute(:published_at, Time.now)\n end\n end",
"title": ""
},
{
"docid": "9d18c0f416b212f5d1970291be5d1844",
"score": "0.51679605",
"text": "def update\n update_resource_response(@post, blog_post_params)\n end",
"title": ""
},
{
"docid": "b690b0fc4e7ea7e6ae3837c2aa1bb53b",
"score": "0.515855",
"text": "def update\n if @post.update(post_params)\n redirect_to @post.blog, notice: 'Post was successfully updated.'\n else\n render :edit\n end\n end",
"title": ""
},
{
"docid": "9d4aac385f025f9a7292cd63aa2024ea",
"score": "0.5157183",
"text": "def update\n\n if params[:blog][:pins].present?\n @blog.pins.purge\n @blog.pins.attach(params[:blog][:pins])\n end\n\n respond_to do |format|\n if @blog.update(blog_params)\n format.html { redirect_to @blog, notice: 'Blog was successfully updated.' }\n format.json { render :show, status: :ok, location: @blog }\n else\n format.html { render :edit }\n format.json { render json: @blog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6dd18da92ec75477f6ea70bef732d9db",
"score": "0.5155047",
"text": "def push_post_through_topic(post, push_topic, single_user=nil, backlog=false)\n return unless post\n\n neo4j_topic_ids = Neo4j.pulled_from_ids(push_topic.neo4j_id)\n topics = Topic.where(:_id => {\"$in\" => [push_topic.id] + neo4j_topic_ids.map{|t| t}})\n\n # make the root post\n root_post = RootPost.new\n root_post.post = post\n\n topics.each do |topic|\n # the potential users this post can be pushed to\n if single_user\n user_feed_users = [single_user]\n else\n user_feed_users = User.only(:id, :following_topics).where(:following_topics => topic.id)\n end\n\n user_feed_users.each do |u|\n next if post.get_share(u.id) # don't distribute posters own posts based on the topics they're following\n\n item = FeedUserItem.where(:user_id => u.id, :post_id => post.id).first\n\n unless item\n post.pushed_users_count += 1\n item = FeedUserItem.new(:user_id => u.id, :post_id => post.id)\n item.created_at = backlog ? post.created_at : Time.now\n item.post_type = post._type\n end\n\n # add following topic reason\n if push_topic.id == topic.id && u.following_topics && u.following_topics.include?(topic.id)\n item.add_reason('ft', topic)\n elsif u.following_topics.include?(topic.id) # following topic related to another topic you're following\n item.add_reason('frt', topic, push_topic)\n end\n\n if item.reasons.length > 0\n item.save\n\n root_post.push_item = item\n\n # if it's a new feed post, push it to the users feed\n unless backlog\n Pusher[\"#{u.username}_realtime\"].trigger('new_post', root_post.as_json(:properties => :short))\n end\n end\n end\n end\n\n post.save\n end",
"title": ""
},
{
"docid": "8ab8be7cdd9b13de3b7a38b593332868",
"score": "0.5154971",
"text": "def publish_draft_social_entry(params)\n generator = SocialEntryGenerator.new\n social_entry = generator.create_social_entry(\n { text: params[:text],\n creatable_tags: params.to_h[:creatable_tags],\n user: self }, params[:parent_social_entry_id], true\n )\n draft_social_entry.submitted\n social_entry\n end",
"title": ""
},
{
"docid": "e7254c2b40b93929784aeb47275af017",
"score": "0.5154399",
"text": "def publish(blog_posts)\n\t\tblog_posts.each do |key, value|\n\t\tputs (\"\\n Title: #{value[0]} \\n Created at: #{key} \\n Created by: #{value[1]} \\n Post: #{value[2]} \\n }\")\n\tend\n\tend",
"title": ""
},
{
"docid": "09e1322960996cdde82c47e879d8b56c",
"score": "0.5153131",
"text": "def build_saved_blogpost(blogpost)\n if !saved_blogposts.find_by(blogpost_id: blogpost.id)\n saved_blogposts.build(blogpost: blogpost)\n end\n end",
"title": ""
},
{
"docid": "837ea2d22090cc31f336c3f33b9a0a00",
"score": "0.5150594",
"text": "def update\n @sticky_message.draft = params[:sticky_message][:draft]\n @sticky_message.published = params[:sticky_message][:published]\n @sticky_message.important = params[:sticky_message][:important]\n @sticky_message.content = markup(params[:sticky_message][:draft])\n respond_to do |format|\n if @sticky_message.save\n format.html { redirect_to @sticky_message, notice: 'Sticky message was successfully updated.' }\n format.json { render :show, status: :ok, location: @sticky_message }\n else\n format.html { render :edit }\n format.json { render json: @sticky_message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c2b29cc5176efe1af86c6b77f6c6c18a",
"score": "0.5147698",
"text": "def update\n@blog = Blog.find(params[:blog_id])\n@post = Post.find(params[:id])\nif\n@post.update_attributes(posts_params)\n# Post saved, redirect\nredirect_to blog_post_url(@blog, @post)\nelse\nrender :action =>\"edit\"\nend\nend",
"title": ""
},
{
"docid": "0beeed054eccebf96a125e5d4f1cd344",
"score": "0.51414526",
"text": "def publish!\r\n publish\r\n save!\r\n end",
"title": ""
},
{
"docid": "ff7e34de66f293f0e37afd1109aa859b",
"score": "0.5135256",
"text": "def update\n redirect_to posts_path and return unless Mist.authorized?(:update_post, self)\n @post = Mist::Post.find(params[:id])\n\n respond_to do |format|\n coerce_date(params[:post], 'published_at')\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, :notice => 'Post was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7ab07f750a1822e9254e5db2168e1afd",
"score": "0.51317924",
"text": "def post\n # TODO re-enable blog post creation. Requires a config file.\n #if @args.length > 0\n # new_post = BlogPost.new(@args.first, @config)\n #else\n # @stderr.puts 'create:post requires a filename. Try yuzu create:post \"Post Title Here\"'\n #end\n end",
"title": ""
},
{
"docid": "e039ffcd7ecf9df05f5204ad85f63eb6",
"score": "0.51308614",
"text": "def create\n @blog = Blog.new(blog_params) # this passes parameters, \n @blog.draft! # attempt to force status to draft for newly created blogs\n # this fixes the issue. New blog items are now set to draft \n # still not clear why the default setting failed.\n respond_to do |format|\n if @blog.save\n format.html { redirect_to @blog, notice: \"Blog item -- #{@blog.title} -- was successfully created\"}\n# format.json { render :show, status: :created, location: @blog }\n else\n format.html { render :new }\n# format.json { render json: @blog.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "82c3ee6050763f22afe01f08f6bae629",
"score": "0.5127529",
"text": "def update\n respond_to do |format|\n if @blog_post.update(blog_post_params)\n format.html { redirect_to @blog_post, notice: 'Статья успешно обновлена.' }\n format.json { render :show, status: :ok, location: @blog_post }\n else\n format.html { render :edit }\n format.json { render json: @blog_post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
eaa384be9f6c26d4706b9238c1615a74
|
Create a repository project
|
[
{
"docid": "386fa24c8b021aad6da2185aa35956f6",
"score": "0.78146535",
"text": "def create_repository_project(repo, name, options = {})\n opts = options.dup\n opts[:name] = name\n opts[:accept] = 'application/vnd.github.inertia-preview+json' if opts[:accept].nil?\n\n post \"#{Repository.path repo}/projects\", opts\n end",
"title": ""
}
] |
[
{
"docid": "e35885374861fc9e08e0c97491f775a7",
"score": "0.7876955",
"text": "def create_project(repo, name, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "204ede9eeeb4917b849c172aa9535a11",
"score": "0.78537494",
"text": "def test_1_0_create_repo\n $repo = PlanR::Project.create('test-docmgr-proj', CONTENT_BASE)\n assert_equal('test-docmgr-proj', $repo.name)\n end",
"title": ""
},
{
"docid": "3596a9b98e5e9dc6e9c5e1d9ff7a0549",
"score": "0.7768566",
"text": "def create_repository_project(repo, name, options = {})\n opts = options\n opts[:name] = name\n opts[:accept] = \"application/vnd.github.inertia-preview+json\" if opts[:accept].nil?\n\n post \"#{Repository.path repo}/projects\", opts\n end",
"title": ""
},
{
"docid": "c3d298d85dac2a0f38136550de3febcd",
"score": "0.7641659",
"text": "def create_project(params)\n\n\t\t#TODO: validar se o projeto existe\t\t\n\t\tcreate_dirs(params)\t\t\n\t\tcreate_maven_project(params, @output + \"/\" + params[:project_name])\n\t\tcreate_properties_file(params)\t\t\n\n\t\tApp.logger.info \"Project #{params[:project_name]} created.\"\t\t\n\tend",
"title": ""
},
{
"docid": "3bb2c39a14ffa9b53b396e59054121ec",
"score": "0.75685465",
"text": "def create_project(repo, name, options = {})\n opts = ensure_api_media_type(:projects, options)\n opts[:name] = name\n post \"#{Repository.path repo}/projects\", opts\n end",
"title": ""
},
{
"docid": "c296778721f586a781e3cd3231d47dda",
"score": "0.7511152",
"text": "def create_repo_project(repo, name, options = {})\n opts = options.dup\n opts[:name] = name\n opts[:accept] = 'application/vnd.github.inertia-preview+json' if opts[:accept].nil?\n\n post \"#{Repository.path repo}/projects\", opts\n end",
"title": ""
},
{
"docid": "5ed1ceb65656a25c4e727cc36972e122",
"score": "0.7492244",
"text": "def create(*args)\n arguments(args, required: [:owner, :repo]) do\n assert_required %w[ name ]\n end\n params = arguments.params\n\n params[\"accept\"] ||= PREVIEW_MEDIA\n\n post_request(\"/repos/#{arguments.owner}/#{arguments.repo}/projects\", params)\n end",
"title": ""
},
{
"docid": "3fefe06f63fbd8f3a27bfbde6af08b9c",
"score": "0.7437744",
"text": "def create_project(tx)\n install(tx, false)\n end",
"title": ""
},
{
"docid": "de75019d95571fc91ad1383b383c4523",
"score": "0.74176776",
"text": "def create(project_name, repo_name, description)\n puts \"Create repository #{repo_name} in org #{project_name}\"\n\n response = self.class.post(\"/orgs/#{project_name}/repos\", request_params(repo_name, description))\n puts \"Github response : #{response}\"\n # TODO : Test the HTTP status code, 200 means that creation is OK\n # TODO : get me from the github API response\n giturl(project_name, repo_name)\n end",
"title": ""
},
{
"docid": "ca9f467ade0cf199f8f920f3e29178d6",
"score": "0.7414588",
"text": "def create_project(tx)\n install(tx,false)\n end",
"title": ""
},
{
"docid": "18d6ee0d485b55c32a75ca6b7834eb82",
"score": "0.73785293",
"text": "def create\n @project = Project.new(project_params)\n x = params[:opcao_privado] == \"true\"? true : false\n #funcao que cria repositorio no git\n @client.create_repository(@project.name, options = {\"description\": params[:description],\n \"homepage\": params[:site],\n \"private\": x,\n \"has_issues\": params[:opc_issues],\n \"has_projects\": params[:opc_project],\n \"has_wiki\": params[:opc_wiki]})\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "637c4917cc9fd15f7a046770cba4ae7b",
"score": "0.73682326",
"text": "def create_repo\n info = JSON.parse(HTTPRequest.repo(@owner, @repo))\n GitAnalysis::Repository.new(info['id'], info['name'], info['owner']['login'], info['language'])\n end",
"title": ""
},
{
"docid": "a4137d2d404005308eb9f60d0032cd8b",
"score": "0.7340392",
"text": "def create\n client = Octokit::Client.new(access_token: current_user.oauth_authorizations.first.credentials['token'])\n repo = client.repo(project_params[:id].to_i)\n\n @project = Project.new(\n name: repo.name,\n full_name: repo.full_name,\n external_id: repo.id,\n provider: :github\n )\n authorize @project\n @project.user = current_user\n\n if @project.save\n redirect_to [:panel, @project], notice: 'Project was successfully created.'\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "5e4231599e16163bde796b2874c47e15",
"score": "0.73320967",
"text": "def create_repo\n cli.inside(app_path) { cli.run \"git init\" }\n end",
"title": ""
},
{
"docid": "f707f5682d964f66a167e9c9eeb0af71",
"score": "0.72798246",
"text": "def create_project\n @task.say_empty(2)\n\n create_project_dirs\n create_config_file\n parse_layout_files\n end",
"title": ""
},
{
"docid": "9d64fab821e73eefb15d792b4e75de29",
"score": "0.72740626",
"text": "def create_project(name, outputter, modules: nil)\n Bolt::ProjectManager.new(config, outputter, pal)\n .create(Dir.pwd, name, modules)\n end",
"title": ""
},
{
"docid": "184edf9241e915783712bef529210419",
"score": "0.72645795",
"text": "def create(options)\n auth_post(\"/repos/create\", :body => options).repository\n end",
"title": ""
},
{
"docid": "cc752a8ea9ad3894a30210ec1e82e0bd",
"score": "0.71918774",
"text": "def create_new_project\n if user_consents?\n unless project_exists_in?(@pwd)\n new_dir_name = @arguments.join(' ')\n new_dir_path = (File.join(@pwd, new_dir_name))\n make_directory(new_dir_path)\n initialize_project_in(new_dir_path, true)\n else\n alert \"You cant create a project inside an existing project!\"\n end\n else\n alert abort_message\n end\n end",
"title": ""
},
{
"docid": "fd7a06cc1b37d9f661910fb52aba7580",
"score": "0.71588826",
"text": "def create_project(name, identifier = nil)\n project = Dlibhydra::Project.new\n project.preflabel = name\n project.name = name\n project.identifier = [identifier] unless identifier.nil?\n project.concept_scheme = find_concept_scheme('projects')\n project\n end",
"title": ""
},
{
"docid": "36ea0d36bf6d3e062f0fffd541e75634",
"score": "0.71411824",
"text": "def create\n begin\n create_the_project\n rescue SystemCallError\n puts \"Cannot create project...\"\n end\n end",
"title": ""
},
{
"docid": "050bd4b24b7aeed9c76eb1cf751977b5",
"score": "0.71057594",
"text": "def create_project(name, gitpath)\n gitlab_project = Gitlab.create_project(\n gitpath,\n description: \"project #{name}\",\n wall_enabled: true,\n wiki_enabled: true,\n issues_enabled: true,\n snippets_enabled: false,\n builds_enabled: false,\n user_id: 1,\n public: false\n )\n\n nextdeployuri = Rails.application.config.nextdeployuri\n Gitlab.add_project_hook(\n gitlab_project.id,\n \"https://api.#{nextdeployuri}/api/v1/projects/buildtrigger\",\n {\n push_events: true,\n issues_events: false,\n merge_requests_events: false,\n tag_push_events: false,\n enable_ssl_verification: false\n }\n )\n\n return gitlab_project.id\n\n rescue => e\n raise Exceptions::GitlabApiException.new(\"create_project #{gitpath} failed: #{e}\")\n end",
"title": ""
},
{
"docid": "c0cb72bce20752e1aaa3573787aeb752",
"score": "0.7060334",
"text": "def execute\n project = ProjectCreator.new project_name, empty?, haml?\n project.create\n end",
"title": ""
},
{
"docid": "783c5db5387471df195e805f783d8be1",
"score": "0.70405924",
"text": "def create_project(props)\n execute(:post, 'projects', json: props)\n end",
"title": ""
},
{
"docid": "c99d599bd0434cd76e705d3e1a6c77ce",
"score": "0.70284957",
"text": "def create_git\n branchs = ['develop', 'hotfixes', 'release']\n gitlabapi = Apiexternal::Gitlabapi.new\n\n begin\n self.gitlab_id = gitlabapi.create_project(name, gitpath)\n create_rootfolder\n branchs.each {|branch| gitlabapi.create_branch(gitlab_id, branch, 'master')}\n gitlabapi.unprotect_branch(gitlab_id, 'master')\n users.each {|user| gitlabapi.add_user_to_project(gitlab_id, user.gitlab_id, user.access_level)}\n rescue Exceptions::NextDeployException => me\n me.log\n end\n end",
"title": ""
},
{
"docid": "4d362e81f69816a9f8357174ffd03bca",
"score": "0.7014382",
"text": "def create_github_repository\n repo_description = \"#{repo_name} created by Labory\"\n github_repository = github_user.create_repository(repo_name, description: repo_description)\n self.github_repo_id = github_repository.id\n end",
"title": ""
},
{
"docid": "c889ea4518d30e1273f247b92cbde8a2",
"score": "0.6990603",
"text": "def make_project(project_path)\n Bolt::Project.make_project(project_path)\n end",
"title": ""
},
{
"docid": "9cef9d63f17a8bb694340adc16dc8f39",
"score": "0.6975474",
"text": "def create\n Rails.logger.info params[:project]\n @project = Project.new(params[:project])\n # if it is a current github project then we do not need to create it on github\n if params[:project][:repo_name].blank?\n @project.repo_name = params[:project][:name]\n end\n @project.user_id = current_user.id\n respond_to do |format|\n if @project.save\n create_github_project\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n get_repo_list\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5b0af605c48479ba15aea6c15177a57f",
"score": "0.6975232",
"text": "def create_pom project\n prjct_dir = project.directory ? File.join(source_dir, project.directory) : source_dir\n pom_file = File.join(prjct_dir, \"pom.xml\")\n save_pom_to_file(pom_file, project)\n end",
"title": ""
},
{
"docid": "c33039c146e9189f442abf82ee982165",
"score": "0.69741094",
"text": "def create_repo(name)\n project = Project.find_by_slug($in_project)\n repo = Repository.new({\n :project => project,\n :user => project.user,\n :owner => project.owner,\n :merge_requests_enabled => \"0\"\n }.merge(name)) \n repo.save\nend",
"title": ""
},
{
"docid": "d4063b970339681e3434f05cda55771e",
"score": "0.6955817",
"text": "def create(project, name)\n project_directory = \"Fall-\" + @@year + \"-\" + @@course + \"-\" + name\n# yes? \"We're going to create a project called \" + project_directory + \" (press return)\"\n empty_directory project_directory\n run \"cd \" + project_directory + \"; thor student_project_factory:create_project \" + project + \" \" + name\n say \"------------------------------\"\n say \"Finished with \" + project_directory\n say \"------------------------------\"\n say \"cd \" + project_directory\n say \"----- yes! to rvm\"\n say \"bundle install\"\n say \"script/rails generate rspec:install\"\n say \"rake db:migrate\"\n say \"git add .\"\n say \"git commit -m 'Adding in rspec'\"\n say \"git remote add origin git@github.com:cmusv/\" + project_directory + \".git\"\n say \"git push origin master\"\n say \"cd ..\"\n say \"mv \" + project_directory + \" done\"\n say \"------------------------------\"\n end",
"title": ""
},
{
"docid": "947a787d1199fbe984b79726fbf175c9",
"score": "0.6948223",
"text": "def create_repo\n builder.run \"hub create #{organization}/#{app_name}\"\n end",
"title": ""
},
{
"docid": "ae639b2d678d63a14fa326b65659d5ab",
"score": "0.69429576",
"text": "def new\n\t\t@svn_repository = @project.repositories.build\n\tend",
"title": ""
},
{
"docid": "bcbfaa544dfb7bcef478f5de6d0bd41b",
"score": "0.6927983",
"text": "def create_repo_project(project_name, user_email)\n if user = User.find_by_email(user_email)\n # Using find_by_code since that's the most important identifer to be unique\n if Project.find_by_code(project_name)\n puts \" INFO: Project #{project_name} already exists in Gitlab, skipping.\"\n else\n project = Project.create(\n name: project_name,\n code: project_name,\n path: project_name,\n owner: user,\n description: \"Automatically created from 'import_projects' rake task on #{Time.now}\"\n )\n\n if project.valid?\n # Add user as admin for project\n project.users_projects.create!(:project_access => UsersProject::MASTER, :user => user)\n project.update_repository\n else\n puts \" ERROR: Failed to create project #{project} because #{project.errors.first}\"\n end\n end\n else\n puts \" ERROR: user with #{user_email} not found, skipping\"\n end\nend",
"title": ""
},
{
"docid": "66174a9b21d4e152953acb5840a0fd11",
"score": "0.6908872",
"text": "def new_github\n @project = Project.new\n authorize @project\n\n if current_user.oauth_authorizations&.first&.credentials\n client = Octokit::Client.new(access_token: current_user.oauth_authorizations.first.credentials['token'])\n @repos = client.repos(type: 'public', sort: :created)\n else\n @repos = []\n end\n end",
"title": ""
},
{
"docid": "1747cc60466f32593d339688727522a2",
"score": "0.6894546",
"text": "def create_repository\n name, remote_url = params[\"name\"], params[\"remoteUrl\"]\n repository = Repository::Base.new(name, remote_url)\n puts repository.name\n render()\n end",
"title": ""
},
{
"docid": "d3742f2d941ea40bfa3fa20381a6d20f",
"score": "0.68885756",
"text": "def create_repo(name, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "d10fccd7052c264598bd854f1854569d",
"score": "0.6887759",
"text": "def create_repo\n repo = params[:repo]\n \n if !repo || repo == \"\"\n error(\"invalid repository name\")\n return\n end\n \n r = system \"cd #{$SETTINGS[:repo_root]}\\n\n git init --bare #{repo}.git\n chown -R git:git #{repo}.git\"\n \n p \"system call return #{r}\"\n \n success('OK', {:ret=>r})\n end",
"title": ""
},
{
"docid": "898a085b4784ae9c553a6d3908efa93d",
"score": "0.68802536",
"text": "def create_org_project(org, name, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "16a56b21f5a78e2acaea0a7242fdeffb",
"score": "0.6864526",
"text": "def create_project(user, project_name, project_desc)\n hub(user, \"create-project #{project_name}\")\n hub(user, \"set-description #{project_name} #{project_desc}\")\nend",
"title": ""
},
{
"docid": "abb97a4f948967da2faff3aeea3794ee",
"score": "0.6859591",
"text": "def create_project(project_name)\n RestClient.post \"#{@server_uri}/project\", { \"project\" => project_name }\n end",
"title": ""
},
{
"docid": "4a3cdb5c26ce2457942cfc439f9a6337",
"score": "0.685741",
"text": "def create_project(params)\n api.identity.create_project(project: params).data\n end",
"title": ""
},
{
"docid": "92fc5ca56b0d31648874cf284d6e7ed9",
"score": "0.68559295",
"text": "def create_repo(org: Test.org, name:, description: '')\n (gh.repos.create org: org, name: name, description: description).to_h\nend",
"title": ""
},
{
"docid": "a8c9c7d6ab0aa7b493d9e7c5d1cdf9df",
"score": "0.6841927",
"text": "def create_remote\n set_state \"gl:started\"\n begin\n raise \"repo exists #{name}\" if GitlabAPI.project_set.include? name\n GitlabAPI.create_project(name, \"Full SVN dump of #{name}\")\n rescue => ex\n bannerize \"Create remote #{name} failed with #{ex}\"\n end\n end",
"title": ""
},
{
"docid": "da9df772cdfb66b42399c74772850617",
"score": "0.6838541",
"text": "def new_project(name:, component:, url_base:, branch:, origin:)\n params = { branch: branch }\n # Let Project pick a default for origin, otherwise we need to retrofit\n # all Project testing with a default which seems silly.\n params[:origin] = origin if origin\n Concurrent::Promise.execute(executor: self.class.promise_executor) do\n begin\n next nil if skip?(name)\n\n Project.new(name, component, url_base, **params)\n rescue Project::ShitPileErrror => e\n warn \"shitpile -- #{e}\"\n end\n end\n end",
"title": ""
},
{
"docid": "c16d5c8dafa5181a0c9b70254ea8808e",
"score": "0.6831161",
"text": "def create_project(params = nil, headers = nil)\n post(\"/api/v2/projects\", params, headers)\n end",
"title": ""
},
{
"docid": "3dbfba984d8159f714dc6e989d1e0256",
"score": "0.6814801",
"text": "def execute\n @gitRepository.create(@path)\n end",
"title": ""
},
{
"docid": "b9283c66e490814c3ed8c408c10b16c6",
"score": "0.6808341",
"text": "def new_git_repo\n # Init the repo as a bare repo (because Grit::Repo can't init\n # non-bare repos yet), then make it non-bare.\n @repo = Grit::Repo.init_bare( dir.mp_join(\".git\").to_s )\n @repo.config[\"core.bare\"] = \"false\"\n @repo.config[\"core.logallrefupdates\"] = \"true\"\n\n # Set up the committer for commits made on the server.\n @repo.config[\"user.name\"] = \"Dixi Server\"\n @repo.config[\"user.email\"] = \"dixi@#{@host}\"\n\n # First commit\n Dir.chdir( dir ) do\n @repo.git.commit({}, \"--allow-empty\",\n \"-m\", \"Created repository for project \\\"#{@dirname}\\\".\")\n end\n\n return @repo\n end",
"title": ""
},
{
"docid": "6102adb1a9ae8723313700d0321fdab1",
"score": "0.67968357",
"text": "def create_repo\n repo = params[:repo]\n \n if !repo || repo == \"\"\n error(\"invalid repository name\")\n return\n end\n p \"cd #{$SETTINGS[:repo_root]}\\n\n git init --bare #{repo}.git\n chown -R git:git #{repo}.git\"\n \n r = system \"cd #{$SETTINGS[:repo_root]}\\n\n git init --bare #{repo}.git\n chown -R git:git #{repo}.git\"\n \n p \"system call return #{r}\"\n \n success('OK', {:ret=>r})\n end",
"title": ""
},
{
"docid": "54953776aeeaec6aef8587d12c1a1455",
"score": "0.6783677",
"text": "def setup_project\n Dir.mkdir('tmp') unless Dir.exist?('tmp')\n remove_dir(PROJECT_PATH)\n on_dirpath(PROJECT_PATH) do\n Git.init\n git = Git.open('.', logger: Logger.new(STDOUT))\n Dir.mkdir('.github')\n File.write(File.join('.github', 'CODEOWNERS'), codeowners.join(\"\\n\"))\n File.write(File.join('.github', 'OWNERS'), owners.join(\"\\n\"))\n git.add(all: true)\n git.commit('First commit :yay:')\n create_file_tree\n git.add(all: true)\n git.commit('File tree created')\n end\n end",
"title": ""
},
{
"docid": "1d6fbb8452ee82fd95aac0695f5c6749",
"score": "0.67745334",
"text": "def project() pry Git::Semaphore::Project.from_repo(Git::Semaphore.git_repo) ; end",
"title": ""
},
{
"docid": "8da6d3561c76a5a2fefa409d8e8687c0",
"score": "0.67570144",
"text": "def new_project(name:, component:, url_base:, branch:, origin:)\n params = { branch: branch }\n # Let Project pick a default for origin, otherwise we need to retrofit\n # all Project testing with a default which seems silly.\n params[:origin] = origin if origin\n Concurrent::Promise.execute(executor: self.class.promise_executor) do\n begin\n next nil if name == 'ubiquity' && ENV['FUCK_UBIQUITY']\n Project.new(name, component, url_base, **params)\n rescue Project::ShitPileErrror => e\n warn \"shitpile -- #{e}\"\n end\n end\n end",
"title": ""
},
{
"docid": "1fd41e630721eb3e06c1abae92552b92",
"score": "0.6730162",
"text": "def create\n Rails.logger.info \">> GitthubRepoController: create\"\n\n github_client = GitHubApi.new\n github_client.init_with_token(current_user.github_account.access_token)\n @github_repository = github_client.repos.get( params[:owner], params[:repository])\n\n Rails.logger.info \">> Chosen Repo: #{@github_repository.url}\"\n\n respond_to do |format|\n if @project.create_github_repository(name: params[:repository], owner: params[:owner], url: @github_repository.url, user_id: current_user.id )\n format.html { redirect_to project_github_path(@project), flash: { success: 'Github repository was successfully linked.' }}\n format.json { render json: @project.github_repository, status: :created, location: @tools_github_repository }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.github_repository.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ff5285fd2f52e828fe6eba08b85d088",
"score": "0.672597",
"text": "def create_org_project(org, name, options = {})\n opts = options.dup\n opts[:name] = name\n opts[:accept] = 'application/vnd.github.inertia-preview+json' if opts[:accept].nil?\n\n post \"#{Organization.path org}/projects\", opts\n end",
"title": ""
},
{
"docid": "9ff5285fd2f52e828fe6eba08b85d088",
"score": "0.672597",
"text": "def create_org_project(org, name, options = {})\n opts = options.dup\n opts[:name] = name\n opts[:accept] = 'application/vnd.github.inertia-preview+json' if opts[:accept].nil?\n\n post \"#{Organization.path org}/projects\", opts\n end",
"title": ""
},
{
"docid": "e7242e7cebea11a042acaad7862794b0",
"score": "0.67205",
"text": "def project!(*options)\n project.create(*options)\n end",
"title": ""
},
{
"docid": "7395f0b7a89ace34fb7b732e9f892f23",
"score": "0.6715722",
"text": "def create!\n Dydra::Client.post \"#{account}/repositories\", { :dydra_repository => { :name => name }}\n end",
"title": ""
},
{
"docid": "55b3d2e92d5fd6ece4bfefe71ef1e93c",
"score": "0.671555",
"text": "def repo_make(name)\n path = repo_path(name)\n path.mkpath\n Dir.chdir(path) do\n `git init`\n repo_make_readme_change(name, 'Added')\n `git add .`\n `git commit -m \"Initialized.\"`\n end\n path\n end",
"title": ""
},
{
"docid": "6a7eae9176e68ca117849788dc076688",
"score": "0.67093784",
"text": "def create_project(org, name, &block)\n # do not add the project a second time\n repository = \"#{org}/#{name}\"\n return projects[repository] if projects.key?(repository)\n\n proj = GeoEngineer::Project.new(org, name, self, &block)\n projects[repository] = proj\n proj\n end",
"title": ""
},
{
"docid": "90197a3571f6b462d5ea733024082ca0",
"score": "0.67037654",
"text": "def create(options)\n response = self.class.post(\"/repos/create\", :query => auth_params, :body => options)\n Hashie::Mash.new(response).repository\n end",
"title": ""
},
{
"docid": "4751415d9471269326f6f8631a919dea",
"score": "0.6694609",
"text": "def create_project(data)\n create(\"projects\", data).first\n end",
"title": ""
},
{
"docid": "db58478bb45b91f9fe6749d27ab204c5",
"score": "0.66925323",
"text": "def create_repo(name, options={})\n options = options.merge(is_private: !options[:public])\n\n @connection.repos.create(options.merge(name: name))\n end",
"title": ""
},
{
"docid": "c6fe21f86d0ca579d6976b8d1532a0b7",
"score": "0.66867703",
"text": "def create_project(options={})\n\t\t\tProject.create({\n\t\t\t\ttitle: \"title example\",\n\t\t\t\tlevel: \"Easy\",\n\t\t\t\tcategory: \"Art\",\n\t\t\t\tdescription: \"description example\"*20,\n\t\t\t\tstatus: \"Active\",\n\t\t\t\tpercentage: 50\n\t\t\t}.merge(options))\n\t\tend",
"title": ""
},
{
"docid": "1e530665ce44f251dda20c1b8f8f15ba",
"score": "0.6685689",
"text": "def create_repo(namespace, name)\n setup_stubs\n repo = repo(namespace, name)\n\n # Symlink tmp/repositories/gitlabhq to tmp/test-git-base-path/gitlabhq\n FileUtils.ln_sf(seed_repo_path, repo)\n create_satellite(repo, namespace, name)\n end",
"title": ""
},
{
"docid": "76988303a628a142bdf869a7454c10f4",
"score": "0.66808987",
"text": "def create\n pre_create\n setup\n pre_build\n build\n post_build\n cleanup\n post_create\n puts \"Project ready.\"\n end",
"title": ""
},
{
"docid": "00f0948219dda93fc4b7559915ac24ee",
"score": "0.6675521",
"text": "def create!\n return if path.exist?\n FileUtils.mkdir_p path\n in_repository do\n # TODO: Add a way to hook into the results of creating the repository.\n # E.g. so we can have post-create hooks.\n cmd(:git, '--bare', :init).ok?\n end\n end",
"title": ""
},
{
"docid": "5c680a3b1c17f74894532aa097622b39",
"score": "0.6675329",
"text": "def create_org_project(org, name, options = {})\n opts = options\n opts[:name] = name\n opts[:accept] = \"application/vnd.github.inertia-preview+json\" if opts[:accept].nil?\n\n post \"#{Organization.path org}/projects\", opts\n end",
"title": ""
},
{
"docid": "e5a9f7164a4ab1f53bbfa0444a77be82",
"score": "0.66608584",
"text": "def create_project(project_name, domain)\n name = get_resource_name\n @hot.resources_list << Project.new(name, project_name, domain)\n @hot.outputs_list << Output.new(\"project_id\", \"The project id\", {\"get_resource\" => name})\n name\n end",
"title": ""
},
{
"docid": "67e43b8f4f19e98e0c530aaa525c6c6f",
"score": "0.6657433",
"text": "def create(project)\n self.say(\"* Creating project in directory: #{project}\")\n\n dir = Pathname.new(project)\n\n %w[\n nodes\n roles\n cookbooks\n site-cookbooks\n ].each do |subdir|\n target = (dir + subdir)\n unless target.exist?\n FileUtils.mkdir_p(target)\n self.say(\"- #{target}/\")\n end\n end\n\n return true\n end",
"title": ""
},
{
"docid": "2e4d64a8beaacb09ecffa5e7a3968925",
"score": "0.664988",
"text": "def create_new_project(name, files=nil)\n project_retval = nil\n ActiveRecord::Base.transaction do\n project = Project.create(name: name, created_by: current_user.id)\n ## Create the permissions that go along with it.\n ProjectPermission.create!(project_id: project.id,\n user_id: current_user.id, can_author: true, can_view: true,\n can_annotate: true)\n\n ## Create a new root directory for the project.\n ProjectFile.create!(name: \"\", is_directory: true, size: 0, \n directory_id: nil, project_id: project.id, content: \"\", \n added_by: current_user.id)\n\n unless files.nil?\n add_files_to_project files, project.id, project.root.id\n # flash.now[:error] = \"ACK\"\n end\n\n project_retval = project\n end\n\n return project_retval\n end",
"title": ""
},
{
"docid": "ed53d19a80c731b20d3f1e33ce69499f",
"score": "0.6645043",
"text": "def create_project\n plugin_template_source(@options[:lang], \"project\") # IE: plugin_template_source(\"hcl\", \"project\")\n\n options = @options[:config] == false ? {exclude_pattern: \"config\" } : {}\n directory \".\", \"#{name}\", options\n\n if @options[:config] == false\n empty_directory(\"#{name}/config\")\n end\n end",
"title": ""
},
{
"docid": "ade63aaa95fd1317ad6039b3e8b5e9cc",
"score": "0.6645027",
"text": "def create_repository identifier, &block\n path = repository_path identifier\n Dir.mkdir path\n run \"git init --bare #{path}\"\n at_path path, &block\nend",
"title": ""
},
{
"docid": "5ac2cb1413000316373732c3ccb63955",
"score": "0.66376853",
"text": "def create_project(name)\n post(\"projects\") do |req|\n req.headers['Content-Type'] = 'text/plain'\n req.body = name\n end\n end",
"title": ""
},
{
"docid": "21e07439c1301b76631fdeaaca6c9c7e",
"score": "0.66372097",
"text": "def create_project(options = {})\n object_from_response(:post, \"projects\", \"project\", project: options)\n end",
"title": ""
},
{
"docid": "a90473cf3dedb8433d46703ff1135dbe",
"score": "0.662997",
"text": "def make_project(goal)\n new_project = Project.new(goal, self)\n end",
"title": ""
},
{
"docid": "cfbac7376cbb87923e291f0173de2b15",
"score": "0.66270036",
"text": "def create(*args)\n params = args.extract_options!\n normalize! params\n filter! VALID_REPO_OPTIONS + %w[ org ], params\n assert_required_keys(%w[ name ], params)\n\n # Requires authenticated user\n if (org = params.delete(\"org\"))\n post_request(\"/orgs/#{org}/repos\", DEFAULT_REPO_OPTIONS.merge(params))\n else\n post_request(\"/user/repos\", DEFAULT_REPO_OPTIONS.merge(params))\n end\n end",
"title": ""
},
{
"docid": "f5dad5f9c32b4a10bdc58bca88467468",
"score": "0.6626139",
"text": "def newProject(major, minor)\n # Make sure these cases work:\n # shop new directory 1.6\n # shop new directory\n # shop new 1.6\n begin\n version = Float(major)\n version = String(version)\n rescue\n path = major\n end\n\n if version.nil?\n begin\n version = Float(minor)\n version = String(version)\n rescue\n version = \"1.5\"\n end\n end\n\n unless path.nil?\n FileUtils.mkpath(path)\n puts \"Creating new PrestaShop project in ./#{path}\"\n else\n path = \"./\"\n puts \"Creating new PrestaShop project\"\n end\n\n version ||= \"1.5\"\n\n if ![\"1.5\", \"1.6\"].include?(version)\n print \"Wrong version #{version}\"\n exit\n end\n\n puts \"Downloading the framework... \"\n print \"Prestashop Version #{version}\"\n if version == \"1.6\"\n url = \"https://github.com/PrestaShop/PrestaShop/archive/1.6.zip\"\n else\n url = \"https://github.com/PrestaShop/PrestaShop-1.5/archive/master.zip\"\n end\n\n open(\"master.zip\", \"wb\") do |f|\n f << open(url).read\n end\n done\n\n # @todo unzip with a ruby way to avoid platform incompatibilities\n print \"Unzip... \"\n system \"unzip -q master.zip\"\n done\n\n print \"Copying... \"\n FileUtils.cp_r(Dir[\"PrestaShop-master/*\"], path)\n done\n\n print \"Cleaning... \"\n # remove useless files\n File.delete(\"master.zip\")\n FileUtils.rm_rf(\"PrestaShop-master\")\n\n done\n end",
"title": ""
},
{
"docid": "8c6379d7d356e1ff8a830a0993c55d58",
"score": "0.6625999",
"text": "def create_organization_project(org, name, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "b2c375320ab6aa5d65db0edea3c0f6c2",
"score": "0.6618465",
"text": "def create\n @root = \"projects\"\n @branch = \"new\" \n \n @project = Project.new(params[:project])\n @project.manager = current_user.id\n \n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe77fd3f87ac5a0c569af5dd21586035",
"score": "0.66127414",
"text": "def create_project\n run \"mkdir /home/#{project_name}\"\n run \"mkdir /home/#{project_name}/config\"\n run \"mkdir /home/#{project_name}/shared\"\n run \"mkdir /home/#{project_name}/shared/pids\"\n run \"mkdir /home/#{project_name}/shared/sockets\"\n run \"mkdir /home/#{project_name}/shared/db\"\n run \"mkdir /home/#{project_name}/shared/db/sphinx\"\n run \"chown -R #{project_name}:#{project_name} /home/#{project_name}\"\n end",
"title": ""
},
{
"docid": "d93b03a70a9799e97b4f6696fd4942fc",
"score": "0.6604779",
"text": "def create_repository(message)\r\n # create \"master\" branch\r\n ex(\"git init -q\")\r\n\r\n # create .gitignore file\r\n ex(\"echo *.scc>>.gitignore\")\r\n ex(\"echo #{MESSAGE_FILE}>>.gitignore\")\r\n\r\n # initial commit\r\n ex(\"git add *\")\r\n commit(\"\", Time.at(0), message)\r\n end",
"title": ""
},
{
"docid": "c039237a4651cba7b050e461f17b131b",
"score": "0.65936947",
"text": "def createProject(project)\r\n\t\t\t\tcreateProject = ZohoHTTPClient.post(getProjectsUrl,getQueryMap, project.toParamMAP)\r\n\t\t\t\treturn $projectParser.getProject(createProject)\r\n\t\t\tend",
"title": ""
},
{
"docid": "8143689ede8a0c7eddd70c04b3977611",
"score": "0.65759706",
"text": "def create(attributes)\n GoodData.logger.info \"Creating project #{attributes[:title]}\"\n\n auth_token = attributes.delete(:auth_token) || GoodData.connection.auth_token\n\n json = {\n 'meta' => {\n 'title' => attributes[:title],\n 'summary' => attributes[:summary]\n },\n 'content' => {\n # 'state' => 'ENABLED',\n 'guidedNavigation' => 1,\n 'authorizationToken' => auth_token\n }\n }\n\n json['meta']['projectTemplate'] = attributes[:template] if attributes[:template] && !attributes[:template].empty?\n project = Project.new json\n project.save\n project\n end",
"title": ""
},
{
"docid": "d94b85d6247a38ab79a4769816f46ab9",
"score": "0.6569076",
"text": "def create_github_repo(folder_name)\n system(\"cd #{folder_name}\\nhub create\")\n system(\"cd #{folder_name}\\ngit add .\")\n system(\"cd #{folder_name}\\ngit commit -m \\\"First commit\\\"\")\n system(\"cd #{folder_name}\\ngit push origin master\")\nend",
"title": ""
},
{
"docid": "8162cc3242f58ff619d5132335db6656",
"score": "0.65482366",
"text": "def create_repository(message)\r\n # create \"master\" branch\r\n ex(\"bzr init-repo .\")\r\n ex(\"bzr config add.maximum_file_size=50000000\")\r\n ex(\"md master\")\r\n switch_branch(\"master\")\r\n ex(\"bzr init\")\r\n\r\n # create .gitignore file\r\n ex(\"bzr ignore *.scc\")\r\n\r\n # initial commit\r\n ex(\"bzr add *\")\r\n commit(\"\", Time.at(0), message)\r\n end",
"title": ""
},
{
"docid": "93d1b8c6c28603a67631f246aacf5f00",
"score": "0.65342766",
"text": "def github_create\n Log.info(\"Creating #{name}\")\n github_api_post(\"repos/create\",\n :name => github_repo_name, :public => (public? ? '1' : '0') ) do |*args, &block|\n harmless(:create, 422, *args, &block)\n end\n end",
"title": ""
},
{
"docid": "7e6fe27d9931824fbadf32f9a1036903",
"score": "0.653368",
"text": "def create_project( name, description = nil)\n post_params = {\n :body => {name: name, description: description}.to_json,\n :headers => Logan::Client.headers.merge({'Content-Type' => 'application/json'})\n }\n\n response = Logan::Client.post \"/project_templates/#{@id}/projects.json\", post_params\n Logan::Project.new response\n end",
"title": ""
},
{
"docid": "c91e9817071966083dae3f6905ff5ad0",
"score": "0.6530113",
"text": "def create_help_project\n create_project_file\n create_contents_and_index\n compile_project\n end",
"title": ""
},
{
"docid": "83bb3e063a5d9f91d95397ff455e89ab",
"score": "0.6515323",
"text": "def generate_project(name)\n Tree::TreeNode.new(name, id: 1, type: \"Project\", root_folder_id: 1)\n end",
"title": ""
},
{
"docid": "88095828f72629658fc45017f86810f3",
"score": "0.65090024",
"text": "def create_project(path_or_name, &block)\n\t\tname, path = parse_project_path(path_or_name)\n\t\t\n\t\t# == Bail out if the path you are trying to create already exists\n\t\tif Dir.exists? path\n\t\t\traise \"ERROR: Tried to create new RubyOF project @ '#{path}', but directory already exists.\"\n\t\tend\n\t\t\n\t\t\n\t\tbegin\n\t\t\tblock.call path\n\t\trescue Exception => e\n\t\t\t# If target directory was created, revert that change on exception\n\t\t\t\n\t\t\tif Dir.exists? path\n\t\t\t\tFileUtils.rm_rf path \n\t\t\t\tputs \"Exception detected in RubyOF::Build.create_project(). Restoring stable state.\"\n\t\t\tend\n\t\t\t\n\t\t\traise e\n\t\tend\n\t\t\n\t\treturn nil\n\tend",
"title": ""
},
{
"docid": "a320e69045b578bfa189ef9fae3f8963",
"score": "0.65042275",
"text": "def create_repo!(repo_name)\n repo_dir_path = repo_dir_path(repo_name)\n\n repo_dir_path.mkpath\n\n FileUtils.cd(repo_dir_path) do\n system \"git init --bare\"\n end\n\n FileUtils.chown_R(git_user, git_group, repo_dir_path)\n end",
"title": ""
},
{
"docid": "ee6b81f0850cca57e6949adc7dc603cf",
"score": "0.65010893",
"text": "def create_repo(name, listener)\n org_name, repo_name = name.split('/')\n client.create_repository(repo_name, organization: org_name, private: 'true')\n listener.repo_created(name)\n end",
"title": ""
},
{
"docid": "6919e10919002d0f24b1bc0653c1e63e",
"score": "0.6496627",
"text": "def createProject(name)\n\n\t\t\t\ttemplate = \"/../template/#{@@builder.files()[:template]}\"\n\n\t\t\t\tLOG.info(\"copying resources #{template} => #{@@path_project}\")\n\n\t\t\t\t# check if dir is not under Ant\n\t\t\t\tif File.exist?(@@builder.files()[:config])\n\t\t\t\t\tVIM::message(\"dir already has config '#{@@builder.files()[:config]}', skipping...\")\n\t\t\t\t\treturn\n\t\t\t\tend\n\n\t\t\t\t# ckeck if dir is empty\n\t\t\t\tif File.exist?('src/')\n\t\t\t\t\tVIM::message('dir already has sources try AntrSet to create config, skipping...')\n\t\t\t\t\treturn\n\t\t\t\tend\n\n\t\t\t\t#copy template\n\t\t\t\tFileUtils.cp_r(\n\t\t\t\t\t@@path_plugin + \"#{template}/.\",\n\t\t\t\t\t@@path_project)\n\n\t\t\t\tVIM::message('Antr: created project')\n\t\t\tend",
"title": ""
},
{
"docid": "1f7ee074b5d2e5560c1cc95efe8e2cbd",
"score": "0.6495694",
"text": "def create_repository(name, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "983c8b87c6800111639d21fb4d6b2b2e",
"score": "0.6482768",
"text": "def create\n\n # TODO : check if the workspace has been created before...\n\n output \"Creating a new project mirror...\"\n project_name = ask(\"Project Name ?\")\n\n config = Ow2mirror::Config.new(Ow2mirror.workspace, project_name)\n config.create\n config.configure\n\n client = Ow2mirror::Client::GitoriousClient.new({:url => config.attributes['source']['url']})\n puts \"Getting available projects from #{config.attributes['source']['url']}, please wait...\"\n projects = client.projects\n\n project_source = nil\n choose do |menu|\n menu.prompt = \"Which source project to mirror?\"\n menu.choices(*projects) do |choice|\n project_source = choice\n say \"Selected project is #{choice}\"\n end\n end\n\n fail(\"Project source can not be null!\") if project_source.nil?\n\n puts \"Getting repositories from source system, please wait...\"\n repos = client.repositories(project_source)\n repo_names = []\n repos.each do |input|\n repo_names << input[:name]\n end\n\n # TODO: Multiple choices with highline\n puts \"Which source repositories do you want to mirror (possible value are : * for all and CSV value to choose some)\"\n begin\n puts \"Source values are:\"\n puts \" - #{CSV.generate_line(repo_names)}\"\n project_repos = stdin.gets.chomp\n end while project_repos.length == 0\n\n project_target = ask(\"Target project (organisation for github)?\")\n project_prefix = ask(\"Prefix of the target repositories ('cause we host many in the same target project/org...)\")\n\n create_mirror(config, project_name, project_prefix, project_repos, project_source, project_target)\n output \"Done!\"\n\n end",
"title": ""
},
{
"docid": "d00310ca0e1f9ffc7188f4d72c9c2937",
"score": "0.6478268",
"text": "def create\n\t\t@svn_repository = @project.repositories.create(params[:svn_repository])\n\t\tredirect_to project_tasklist_path(@project, @svn_repository), :flash => { :success => 'SVN was successfully linked.' }\n\tend",
"title": ""
},
{
"docid": "278b1c7c08e258b8ac343df8434a756c",
"score": "0.6477344",
"text": "def create_app_repo (name, path)\n raise 'Target path already exist' if File.exist?(path)\n path = File.expand_path(path)\n Dir.chdir(File.join(SAMPLE_APPS_PATH, name)) do\n raise 'Already a git repository' if File.exist?('.git')\n git = Git.init('.')\n git.add('.')\n git.commit('Initial commit')\n git.config('core.bare', true)\n FileUtils.mv '.git', path\n end\n end",
"title": ""
},
{
"docid": "38da8e0b9e56ade20a726c89e51e2d3a",
"score": "0.6471536",
"text": "def createProject\n print \"Project Description: \"\n desc = $stdin.gets.chomp! \n Central.instance.createProject(desc)\n end",
"title": ""
},
{
"docid": "b7e2946be4ec41e579c3bc00d8dabdf9",
"score": "0.64713645",
"text": "def create_new_project(project_name)\n # Check project existence\n (error(_('wizard.project.name_exist')); return false) if project_exists?(Dir.pwd, project_name)\n # Setup the bebox boxes directory\n bebox_boxes_setup\n # Asks to choose an existing box\n current_box = choose_box(get_existing_boxes)\n vagrant_box_base = \"#{BEBOX_BOXES_PATH}/#{get_valid_box_uri(current_box)}\"\n # Asks user to choose vagrant box provider\n vagrant_box_provider = choose_option(%w{virtualbox vmware}, _('wizard.project.choose_box_provider'))\n # Set default environments\n default_environments = %w{vagrant staging production}\n # Project creation\n project = Bebox::Project.new(project_name, vagrant_box_base, Dir.pwd, vagrant_box_provider, default_environments)\n output = project.create\n ok _('wizard.project.creation_success')%{project_name: project_name}\n return output\n end",
"title": ""
},
{
"docid": "6afbd0481e6054c3307f04cb7c629425",
"score": "0.64539677",
"text": "def add_project(values)\n # Need better way to request specific types\n #project = from_dataset.where(type: 'Project', name: values[:name]).first\n #raise \"Project Exists: #{values[:name]}\" if project\n #raise \"Expected to be in View context\" unless current_context!.branch.is_a?(ProjectBranch)\n project = nil\n RootBranch.branch.fork(name: values[:name], class: ProjectBranch, user: context.user) do\n project = Project.create(values)\n add_resource(project)\n context.resource.add_to(project)\n yield project if block_given?\n end\n project\n end",
"title": ""
},
{
"docid": "4838be5c2b323f3a89a93751fdd44009",
"score": "0.64479166",
"text": "def create\n @project = Project.new(project_params)\n @project_permission = ProjectPermission.new(:user => current_user, :project => @project, :permission => ProjectPermission::OWNER)\n\n respond_to do |format|\n if @project.save and @project_permission.save\n begin\n require 'scigit/thrift_client'\n SciGit::ThriftClient.new.createRepository(@project.id)\n\n format.html { redirect_to @project, notice: @notice }\n format.json { render json: {\n :redirect => project_path(@project.id),\n :notice => \"Project #{@project.name} was created successfully.\",\n } }\n rescue\n @project.destroy\n @project_permission.destroy\n\n format.html { render action: 'new' }\n format.json { render json: 'Database error. Please try again later.', status: :unprocessable_entity }\n end\n else\n format.html { render action: 'new' }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
74133109c003234fa2beb6c9c661dd77
|
No importa si el array esta desordenado
|
[
{
"docid": "528a8dbdb832e3979199af4c8dea568b",
"score": "0.0",
"text": "def binary_search(from=0, to=nil)\n #Creacion del rango\n array = (1..100).to_a\n puts \"Piensa en un número entre el 1 y el 100\"\n #Obtener el numero del usuario\n num = gets.chomp.to_i\n #saber hasta que numero contar\n if to == nil\n to = array.count-1\n end\n #sacar la mitad del array\n mid = (from + to) / 2\n #hacer un arreglo desde el primero hasta la mitad\n first = (array[0]..mid+1).to_a\n #hacer un arreglo desde la mitad hasta el ultimo\n second = (mid+2..array[-1]).to_a\n #si el numero se encuentra en la primera mitad\n if first.include? num\n #Solo tomara la longitud de ese array\n to = first.count-1\n #Sacara la mitad de ese array\n mid = (from + to) / 2\n #vuelve a separar esa mitad en otras 2 mitades en forma de arreglo\n #1..25\n first = (first[0]..mid).to_a\n #26..50\n second = (mid+1..second[-1]).to_a\n #si la nueva primera mitad contiene el numero\n if first.include? num\n #recorre dentro del numero \n for index in 0..array.length-1\n #si el numero recorrido es igual a el numero\n if array[index] == num\n #regresa la posicion en la que este el numero\n puts \"El número esta en la posicion: #{index}\"\n end\n end\n #de lo contrario lo buscara en la segunda mitad\n else \n #recorrera dentro del segundo array \n for index in 0..array.length-1\n #si el numero es igual a el indice\n if array[index] == num\n #imprime la posicion del numero\n puts \"El número esta en la posicion: #{index}\"\n end\n end\n end\n #si el numero no se encontraba en la primera mitad 1..50\n #entra este y lo busca en la mitad de 51..100\n else\n #creo el nuevo array desde el 51 hasta el 75\n first = (second[0]..second[(second.length) / 2]-1).to_a\n #crea el nuevo array desde el 76 hasta el 100\n second = (second[(second.length) / 2]..second[-1]).to_a\n #si el primer array incluye el numero\n if first.include? num\n #recorre dentro del array\n for index in 0..array.length-1\n #si el numero es igual a el index\n if array[index] == num\n #regresa la posicion del numero dentro del array\n puts \"El número esta en la posicion: #{index}\"\n end\n end\n #si el numero no estaba en la primera mitad 51..75\n #lo buscara en la mitad 76..100\n else\n #recorre dentro de cada numero\n for index in 0..array.length-1\n #si el numero es igual a el indice del numero\n if array[index] == num\n #imprime la posicion del numero\n puts \"El número esta en la posicion: #{index}\"\n end\n end\n end\n end\n #Nota: puedes cambiar la longitud del array pero los numero puestos seran cambiados\nend",
"title": ""
}
] |
[
{
"docid": "0b2288a6853298e34b429f6b82caaa1f",
"score": "0.68183523",
"text": "def check_array(data)\n return true # still to be done\n end",
"title": ""
},
{
"docid": "0c3041902b7f17402964d59e55933537",
"score": "0.6408245",
"text": "def normal?\n !array.empty?\n end",
"title": ""
},
{
"docid": "2e3148f87d8f120ed8fad17af429ae0a",
"score": "0.6336463",
"text": "def array?\n true\n end",
"title": ""
},
{
"docid": "7ee0db1adeeb84a3d055d88ece817bb4",
"score": "0.62324655",
"text": "def is_array?\n !! @array\n end",
"title": ""
},
{
"docid": "8606c5e5e84d8f45dae47480e96b24cc",
"score": "0.6218532",
"text": "def array?\n @array\n end",
"title": ""
},
{
"docid": "11fef88d8a7f3aefe4cdb92886af3125",
"score": "0.6204303",
"text": "def connected_through_array?\n false\n end",
"title": ""
},
{
"docid": "11fef88d8a7f3aefe4cdb92886af3125",
"score": "0.6204303",
"text": "def connected_through_array?\n false\n end",
"title": ""
},
{
"docid": "839868c3706f34d138db3efbde21df9d",
"score": "0.6155715",
"text": "def array?\n !! self[ :array ]\n end",
"title": ""
},
{
"docid": "960e41187018ad274a4f30923493fc46",
"score": "0.61295843",
"text": "def load_from_array!(array); end",
"title": ""
},
{
"docid": "1da0e09d7c82142dfc6b96c4240fcf91",
"score": "0.6037216",
"text": "def array?\n return false if error?\n result.is_a?(Array) && result.size > 0 && result.first\n end",
"title": ""
},
{
"docid": "cb04c15a923651bc4e8d7b30a5f0425d",
"score": "0.60290813",
"text": "def array?\r\n @is_array\r\n end",
"title": ""
},
{
"docid": "9cacc607dc02c77682528f1696b3a7a3",
"score": "0.6019404",
"text": "def sorted?(array)\nend",
"title": ""
},
{
"docid": "3a537c107f066ddcd8ad639186296693",
"score": "0.59420437",
"text": "def is_madhav_array(arr) \n #..\n if arr.length < 2 \n return false\n end\n result_arr = []\n x = 1\n while arr.length >= x do \n temp = arr.shift(x)\n p temp\n result_arr << temp\n x += 1\n end\n if arr.length > 0\n return false\n end\n new_arr = result_arr.map do |i|\n i.reduce(:+)\n end\n\n new_arr.uniq.length == 1 \nend",
"title": ""
},
{
"docid": "b10e3bb49483a1245d006d2c272421ef",
"score": "0.5926818",
"text": "def array?\n _c_slaw_is_array\n end",
"title": ""
},
{
"docid": "b10ff6706c487b622011693cf60e0307",
"score": "0.5888942",
"text": "def sorted?(array)\n\nend",
"title": ""
},
{
"docid": "4d322cebb6bf9921f2b5e2e5eac8c79c",
"score": "0.5872135",
"text": "def sorted?(array)\n \nend",
"title": ""
},
{
"docid": "e57e0f681c7f0b1e46ec99a3ed4708c4",
"score": "0.5868306",
"text": "def old_array; end",
"title": ""
},
{
"docid": "14084e8a58818ef74a70af06f8d6a53f",
"score": "0.58557236",
"text": "def Ostrichto_b; self != []; end",
"title": ""
},
{
"docid": "e8df0ed4821ab4081404f31715a51e3c",
"score": "0.5815548",
"text": "def test_array?(data)\r\n return data[0, 1] == '['\r\n end",
"title": ""
},
{
"docid": "71d00eddc6a1d5df97d38c87ff6f52de",
"score": "0.58017737",
"text": "def array?\n return self.include?(',')\n end",
"title": ""
},
{
"docid": "a59df5e8530b4c071da2021838f9bc32",
"score": "0.57915395",
"text": "def is_array?\n (self.is_a?(Array) and not self.empty?) ? true : false\n end",
"title": ""
},
{
"docid": "e79f79541aea5c075407e2164e582b02",
"score": "0.5787105",
"text": "def test_if_is_array\n\t\t\t\tassert_equals(true, random_array.kind_of?(Array))\n\t\t\tend",
"title": ""
},
{
"docid": "a284a5f5e43a51951d5f13db2523dcd4",
"score": "0.57296395",
"text": "def lint_to_a\n return if dataset.to_a == data\n\n complain \"#{dataset.class}#to_a must cast dataset to an array\"\n end",
"title": ""
},
{
"docid": "d6c43af120e3cd46ab24da5c6fb6be3a",
"score": "0.5725086",
"text": "def all?(array)\nend",
"title": ""
},
{
"docid": "d6c43af120e3cd46ab24da5c6fb6be3a",
"score": "0.5725086",
"text": "def all?(array)\nend",
"title": ""
},
{
"docid": "d6c43af120e3cd46ab24da5c6fb6be3a",
"score": "0.5725086",
"text": "def all?(array)\nend",
"title": ""
},
{
"docid": "d0cff45f0aea98fe34e37e751baeb64c",
"score": "0.57102466",
"text": "def array?\n return flag_set?(\"InputOutputFeature::ARRAY\")\n end",
"title": ""
},
{
"docid": "a0aaa8788fa450aadc2bbf3ed69cc65c",
"score": "0.570959",
"text": "def on_trunk?\n\treturn @arr.length == 2\n end",
"title": ""
},
{
"docid": "c2aab787486ad9ab97e2a71e190c74e7",
"score": "0.56997234",
"text": "def group_as_array?\n true\n end",
"title": ""
},
{
"docid": "11d2080092941b62320d74bc1bb88ca3",
"score": "0.5671829",
"text": "def array?\n return @array unless @array.nil?\n return true if sql_type_metadata.type.to_s.include? '[]'\n\n begin\n model&.new(name => '')\n # it does not raise error -> it is not a serialized array\n false\n rescue ActiveRecord::SerializationTypeMismatch\n # it raises an error -> it is (certainly) a serialized array\n true\n rescue StandardError\n # if any other error raises, return false\n false\n end\n end",
"title": ""
},
{
"docid": "1a57e73f4f6294ca6a2134caaa5c2deb",
"score": "0.56459135",
"text": "def nonmutating_array_method?; end",
"title": ""
},
{
"docid": "1a57e73f4f6294ca6a2134caaa5c2deb",
"score": "0.56459135",
"text": "def nonmutating_array_method?; end",
"title": ""
},
{
"docid": "a44d1137a25929710b6f6719ac6963a6",
"score": "0.5607802",
"text": "def extract!(array); end",
"title": ""
},
{
"docid": "6cf87baa3e6a630fd9576526e56d93c7",
"score": "0.55939573",
"text": "def array_type?\n type = self.first\n @@array_types.include? type\n end",
"title": ""
},
{
"docid": "f8028c12fb931c8f650a208afcd52cc4",
"score": "0.55914617",
"text": "def rows_are_arrays?(rows)\n rows.each { |row| return false unless row.respond_to?(:to_ary) }\n true\n end",
"title": ""
},
{
"docid": "9e003c585cd86cfb0eddcbb72ead1bb9",
"score": "0.55665815",
"text": "def check_array!(array)\n array.each { |item| check!(item) }\n end",
"title": ""
},
{
"docid": "a7ab99c32f3534cca3107bf2eb834cf4",
"score": "0.5550748",
"text": "def check_array(object)\r\n if object.class != Array\r\n raise Exception.new('Specified object must be an array.')\r\n end\r\n end",
"title": ""
},
{
"docid": "9b4f0e7a141c06fb479e23a151970496",
"score": "0.5530389",
"text": "def o(array, debug: false)\n all_arrays = []\n valid_arrays = []\n\n array.each do |sub_array|\n all_arrays << sub_array[0]\n valid_arrays << sub_array[1]\n end\n\n all_table = print_table all_arrays.inject([], :concat)\n debug ? puts(all_table) : File.write('all_table.txt', all_table)\n\n valid_table = print_table valid_arrays.inject([], :concat)\n debug ? puts(valid_table) : File.write('valid_table.txt', valid_table)\nend",
"title": ""
},
{
"docid": "111e2da792dce95c86d930b14dbe2297",
"score": "0.55301774",
"text": "def full?\n if @array[@array.length - 1] == nil\n return false\n else\n return true \n end \n end",
"title": ""
},
{
"docid": "98e4f5c2a0a32d984b4c17b481e9ca82",
"score": "0.55237305",
"text": "def validate_data_series_is_array\n\t\t\treturn false unless (@data_series.kind_of?(Array))\n\t\t\treturn true\n\t\tend",
"title": ""
},
{
"docid": "98e4f5c2a0a32d984b4c17b481e9ca82",
"score": "0.55237305",
"text": "def validate_data_series_is_array\n\t\t\treturn false unless (@data_series.kind_of?(Array))\n\t\t\treturn true\n\t\tend",
"title": ""
},
{
"docid": "98e4f5c2a0a32d984b4c17b481e9ca82",
"score": "0.55237305",
"text": "def validate_data_series_is_array\n\t\t\treturn false unless (@data_series.kind_of?(Array))\n\t\t\treturn true\n\t\tend",
"title": ""
},
{
"docid": "98e4f5c2a0a32d984b4c17b481e9ca82",
"score": "0.55237305",
"text": "def validate_data_series_is_array\n\t\t\treturn false unless (@data_series.kind_of?(Array))\n\t\t\treturn true\n\t\tend",
"title": ""
},
{
"docid": "b862c87838021894d8d38855592ab8a4",
"score": "0.55120504",
"text": "def ordenar_arreglo array\n\tp array.sort\nend",
"title": ""
},
{
"docid": "c875ac6509d4fc29340c115b53b33bb2",
"score": "0.55060977",
"text": "def array; end",
"title": ""
},
{
"docid": "c875ac6509d4fc29340c115b53b33bb2",
"score": "0.55060977",
"text": "def array; end",
"title": ""
},
{
"docid": "c875ac6509d4fc29340c115b53b33bb2",
"score": "0.55060977",
"text": "def array; end",
"title": ""
},
{
"docid": "c875ac6509d4fc29340c115b53b33bb2",
"score": "0.55060977",
"text": "def array; end",
"title": ""
},
{
"docid": "be8e64483d85f694c1ec4efad88fef2d",
"score": "0.5498703",
"text": "def return_array_sorted\n @array_ordenado\n end",
"title": ""
},
{
"docid": "3684d19dffdd6ae92117bff81ec3614b",
"score": "0.5484916",
"text": "def array?\r\n child? && child.next? && child.name == child.next.name\r\n end",
"title": ""
},
{
"docid": "db0ffb7a9926de9733efe682fe34b21f",
"score": "0.5480537",
"text": "def array?(ary)\n return true if ary.is_a?(Array)\n\n ARRAY_METHODS.each do |method_name|\n return false unless ary.respond_to?(method_name)\n end\n\n OTHER_METHODS.each do |method_name|\n return false if ary.respond_to?(method_name)\n end\n\n true\n end",
"title": ""
},
{
"docid": "2924c55ab503bafcf794b8fd5b87d930",
"score": "0.5479694",
"text": "def no_destructivo(array) \n\n puts \"Valor de mi arreglo array es: #{array}\"\n puts \"Llamando al método sort en array : #{array.sort}\"\n puts \"Valor de array después de pasarlo por sort!: #{array}\"\nend",
"title": ""
},
{
"docid": "d150ae6af7e82d3de2fc82aac7576095",
"score": "0.5477468",
"text": "def is_empty()\n\t\t@arr.empty? \n end",
"title": ""
},
{
"docid": "077785f6bb0b2eea5935b8534982f820",
"score": "0.5473989",
"text": "def chiffre(array_two)\ntrue if Integer(array_two) rescue false\nend",
"title": ""
},
{
"docid": "f1ffc1140b6bb307bbf9745a904cb578",
"score": "0.5473216",
"text": "def array?(obj)\n if CUDA.available?\n return true if obj.kind_of?(Cumo::NArray)\n end\n return true if obj.kind_of?(Numo::NArray)\n false\n end",
"title": ""
},
{
"docid": "fafee0b32115a4deed93c02f9882078c",
"score": "0.5467623",
"text": "def compatible(array)\n (get_shape == array.get_shape)? true : false\n end",
"title": ""
},
{
"docid": "d3d861a2e2c2dbfc4c3d7bf83fbaf412",
"score": "0.54573476",
"text": "def array_42(tab)\n \treturn tab.include? 42\nend",
"title": ""
},
{
"docid": "9a2508e3eff2436bf28948b4419431b6",
"score": "0.5451919",
"text": "def multi_array?( obj )\n obj.all? { |el| el.is_a?( Array ) } && obj.is_a?( Array ) rescue false\n end",
"title": ""
},
{
"docid": "cba4fe5b8a3cb587e020e4efd785108f",
"score": "0.54444975",
"text": "def is_int_array_alt(arr)\n arr.is_a?(Array) && arr.all? { |e| e.is_a?(Integer) || e.is_a?(Float) && e % 1 == 0}\nend",
"title": ""
},
{
"docid": "542cea5154613637c48f165cd8bc884b",
"score": "0.54380155",
"text": "def data_has_multiple_entries?\n @data.is_a? Array\n end",
"title": ""
},
{
"docid": "0f5e1502f0e73650f31c2a158a48fa62",
"score": "0.54295266",
"text": "def lineinarray(dbarray, line)\n\treturn (dbarray.index(line) != nil)\nend",
"title": ""
},
{
"docid": "5a921b7bdd43c4707d68fc39b63b8ef1",
"score": "0.54262084",
"text": "def converted_arrays; end",
"title": ""
},
{
"docid": "0405cfb1647a618d99966eee2a099fa6",
"score": "0.54253715",
"text": "def valid?(board_array)\n board_array.each { |row| return false if row.length != row.uniq.length }\n return true\nend",
"title": ""
},
{
"docid": "556a6342899ecb5015f12680a84cb2e8",
"score": "0.5418996",
"text": "def is_array_member(opts)\n opts = check_params(opts,[:serial_numbers])\n super(opts)\n end",
"title": ""
},
{
"docid": "423e0f9690dd7d726b12ff705d6da554",
"score": "0.54179716",
"text": "def check_sort_e35(arr)\n\t\t\tsorted = arr.sort\n\t\t\tn = arr.length\n\t\t\tfor foo in 0..n\n\t\t\t\tif arr[foo] != sorted[foo]\n\t\t\t\t\treturn false\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn true\n\t\tend",
"title": ""
},
{
"docid": "52baeaa1efd0d7612d55b19bdb43a9a5",
"score": "0.541499",
"text": "def empty?\r\n @array.empty?\r\n end",
"title": ""
},
{
"docid": "52baeaa1efd0d7612d55b19bdb43a9a5",
"score": "0.541499",
"text": "def empty?\r\n @array.empty?\r\n end",
"title": ""
},
{
"docid": "74178fb1b2f336cf4cc7db58fc896d6d",
"score": "0.5400781",
"text": "def sorted?(array)\n sorted = true\n\n # Iterates through the array and invalidates that the array is sorted\n # if it finds an instance where elements are out of order.\n (array.length - 1).times do |i|\n sorted = false if array[i] > array[i + 1]\n end\n\n sorted\nend",
"title": ""
},
{
"docid": "b7f0fcd7c6e853a2d0c906f9b66a9963",
"score": "0.53992724",
"text": "def is_array?(a)\n a.is_a?(Array) || (defined?(PGArray) && a.is_a?(PGArray)) || (defined?(ArrayOp) && a.is_a?(ArrayOp))\n end",
"title": ""
},
{
"docid": "60d926da0180ec61ca3c0bfdbf24ab7a",
"score": "0.5391428",
"text": "def array_type?\n warn \"DEPRECATED: please file an issue if you actually use this. from #{caller.first}\"\n type = self.sexp_type\n @@array_types.include? type\n end",
"title": ""
},
{
"docid": "60d926da0180ec61ca3c0bfdbf24ab7a",
"score": "0.5391428",
"text": "def array_type?\n warn \"DEPRECATED: please file an issue if you actually use this. from #{caller.first}\"\n type = self.sexp_type\n @@array_types.include? type\n end",
"title": ""
},
{
"docid": "a4c01406bac6f5050eeb36560fb0f90b",
"score": "0.53741574",
"text": "def order_containing array\n return false if array.nil?\n\n if array.is_a? Array\n if array.length > 0 and self.length > 0 and array.length <= self.length\n\n self.length.times { |i|\n last = nil\n start = i\n array.length.times { |j|\n if start >= self.length or self[start] != array[j]\n break\n end\n last = j + 1\n start += 1\n }\n\n return true if last == array.length\n }\n end\n else\n raise ArgumentError, 'Excepted Array class object!'\n end\n\n false\n end",
"title": ""
},
{
"docid": "2463caa687f6940fc6ec115d4588efb7",
"score": "0.53740644",
"text": "def double_array(array)\nend",
"title": ""
},
{
"docid": "03e3f6df26bd7bff96595e9bc9d183af",
"score": "0.53691465",
"text": "def out_of?(other_ary)\n other_ary.is_a?(Array) or raise ArgumentError, \"Other array in argument must be an Array\"\n super || not_subset?(other_ary)\n end",
"title": ""
},
{
"docid": "c6e75431040b5e6c822057bff4d01c1b",
"score": "0.5356271",
"text": "def check_is_array(number)\n\tif number.class == Array\n\t\treturn true\n\telse\n\t\treturn false\n\tend\nend",
"title": ""
},
{
"docid": "9737e316c0dfdecec41988a645e98493",
"score": "0.5349531",
"text": "def in_order?(arr)\n # your code goes here\n ordered_arr = []\n ordered_arr = arr.sort\n arr == ordered_arr ? \"array is sorted\" : \"array is not sorted\"\n end",
"title": ""
},
{
"docid": "b864aeff891dd199981bd01a7ed50bb1",
"score": "0.5334322",
"text": "def empty?\n \n return @internal_array.empty?\n \n end",
"title": ""
},
{
"docid": "98c99712ab8566eb2c0bab244f705e7b",
"score": "0.5333412",
"text": "def full?\n array_length = @array.length\n if @array[array_length-1] == nil\n false\n else\n true\n end\n end",
"title": ""
},
{
"docid": "9c6746b723fd0bb43305404f9d2381f7",
"score": "0.5311246",
"text": "def long_planeteer_calls(arr)\n if arr.length > 4 #the spec default has a mistake. the two example arrays should be opposite \n return false\n end\n true\nend",
"title": ""
},
{
"docid": "d7c35868d8b9b0d84603f01b84ca5944",
"score": "0.53098834",
"text": "def is_array_field(field)\n return @array_fields.include?(field.to_s)\n end",
"title": ""
},
{
"docid": "d7c35868d8b9b0d84603f01b84ca5944",
"score": "0.53098834",
"text": "def is_array_field(field)\n return @array_fields.include?(field.to_s)\n end",
"title": ""
},
{
"docid": "18f1c2221d35032283795f55f7d67579",
"score": "0.53069925",
"text": "def has_nested_array?(array)\n false\nend",
"title": ""
},
{
"docid": "003f2ba79cb97c44c343a64f63803746",
"score": "0.5304208",
"text": "def has_nested_array?(array) \r\n array.each do|i| \r\n if( i.is_a?(Array))then \r\n return true \r\n else \r\n return false \r\n end \r\n end \r\n end",
"title": ""
},
{
"docid": "bf1cfdb6fcd101c09eacf914f14800c2",
"score": "0.5302578",
"text": "def test_function_array_contains_13\n\t\tpopulated_array = mined_minds_array()\n\t\tcheck_array = populated_array.include? 13\n\t\tassert_equal(true, check_array)\n\tend",
"title": ""
},
{
"docid": "42cf2587c4c4d445ea443e636bee333f",
"score": "0.53004235",
"text": "def bare_data_set?\n data.is_a?(Array) and ![Array, Hash].include?(data.first.class)\n end",
"title": ""
},
{
"docid": "af3957f925147d57bd83601e23fe680a",
"score": "0.5297289",
"text": "def ajoutable?(unJoueur)\n\t\tres = Array.new\n\t\ttab = deserealiseJoueurs\n\t\tif(tab != nil)\n\t\t\tunMode = unJoueur.donneMode\n\t\t\ttab.each do |joueur|\n\t\t\t\tif joueur.donneMode == unMode\n\t\t\t\t\tres.push(joueur)\n\t\t\t\tend\n\n\t\t\tend\n\n\t\t\tif res.size < 10\n\t\t\t\treturn true\n\t\t\telse\n\t\t\t\tif res[res.size-1].donneScore < unJoueur.donneScore\n\t\t\t\t\treturn true\n\t\t\t\telse\n\t\t\t\t\treturn false\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\treturn true\n\t\tend\n\n\tend",
"title": ""
},
{
"docid": "7f14f97a06787d32203cb009086024b9",
"score": "0.5295592",
"text": "def ordenarArray(array)\n begin\n trocado = false\n for i in 0..array.size - 2 do\n if array[i] > array[i+1]\n array[i], array[i+1] = array[i+1], array[i]\n trocado = true\n end\n end\n end while trocado == true\n\n return array\nend",
"title": ""
},
{
"docid": "099d672530f399417a8d595f6f9b7af3",
"score": "0.5288045",
"text": "def has_arr?(arrstr, sep=';')\n arrstr.gsub(\"#{sep}\", ';') if (sep != ';')\n return (@arrangements.keys.member?(arrstr))\n end",
"title": ""
},
{
"docid": "b5267a1a36ac84f13c5c869f40c075d9",
"score": "0.52862495",
"text": "def too_many_values(array)\n threshold = 0.05 # change the threshold for how many unique values are allowed\n return true if array.size > (@row_count * threshold)\nend",
"title": ""
},
{
"docid": "2f2cd865117970d436c210dada0ba010",
"score": "0.52862054",
"text": "def moderateSizeArrayCheck(arr)\n arr[0] + arr[-1] \n end",
"title": ""
},
{
"docid": "83275a1725bb35d0b917ca4a80471f8f",
"score": "0.5284457",
"text": "def healthy?() raw && raw.is_a?(Array) end",
"title": ""
},
{
"docid": "fa412c77ed5264a3ab711d1694ec6f06",
"score": "0.5283059",
"text": "def array_of_arrays?(data)\n data.reject{|datum| datum.kind_of?(Array)}.empty?\n end",
"title": ""
},
{
"docid": "8c6d23ebc42eef5a8af286b19e219d9a",
"score": "0.52795374",
"text": "def array_42(array)\n array.to_a.include? (42)\n end",
"title": ""
},
{
"docid": "3927453ad6d326e6bd8fcdb45a7443b5",
"score": "0.52781653",
"text": "def array_42(tab)\n\treturn tab.include?(42)\nend",
"title": ""
},
{
"docid": "5850ef9d410bdea8d622aea5fe1c1a4d",
"score": "0.5276267",
"text": "def test_array_empty_4\n assert_equal(true, @array4.empty?)\n assert_empty(@array4)\n end",
"title": ""
},
{
"docid": "33571203051b8aa934c6462f40ca5f55",
"score": "0.5270708",
"text": "def arrayish?(obj)\n obj.is_a?(Array) || java_list?(obj)\n end",
"title": ""
},
{
"docid": "b3e70704a438563c0c93f63910ab08af",
"score": "0.52588344",
"text": "def solved?(board_array)\n\treturn valid?(board_array) && valid?(board_array.transpose)\nend",
"title": ""
},
{
"docid": "bacbf9f61f240bb5152387d7866e10df",
"score": "0.5257684",
"text": "def index(array_task)\n #itera dentro de cada elemento y su indice para mostra el array en orden y con estado.\n array_task.each_with_index do |task, index|\n #compara el valor de la tarea, debe ser en string porque el csv lo cambia\n if task.completado == \"true\"\n #si es true pone esto\n puts \"#{index + 1}. [X] #{task.tarea}\"\n #si es false pone esto\n else\n puts \"#{index + 1}. [ ] #{task.tarea}\"\n end\n end\n end",
"title": ""
},
{
"docid": "7367b3a44dc25e3a5530a1ece058c33a",
"score": "0.5257148",
"text": "def have_nil arr\n # TODO\nend",
"title": ""
},
{
"docid": "6d5699be9f83cd0a906b145301bc6852",
"score": "0.5252517",
"text": "def empty?\n array.empty?\n end",
"title": ""
},
{
"docid": "da31005709b45444e126f3578a6b52a6",
"score": "0.52502686",
"text": "def test_it_can_check_if_array_is_uniq\n algo = Algo.new\n assert_equal true, algo.is_isogram(\"hi\")\n end",
"title": ""
}
] |
c88c3f7000735d52cd59338aba32a77f
|
sort_column and sort_direction are helper methods defined in this controller t.name is tag name When listing by tags, I want to sort by i_follow_nbr
|
[
{
"docid": "8fe8743a987bdf2ee23f6d449fa5e2b7",
"score": "0.0",
"text": "def list_pif\n if params[:chosen_letter]\n @users = User.pifs_alpha_nav(\n params[:chosen_letter]\n )\n else\n per_page = 50\n @sort = sort_column\n @direction = sort_direction\n if @sort == 'LOWER(t.name)'\n two_sorts = true\n second_sort = 'i_follow_nbr'\n second_direction = 'desc'\n else\n two_sorts = false\n second_sort = ''\n second_direction = ''\n end\n @count = User.larry_following_count\n @page_wanted = params[:page] ||= 1\n @total_pages = (@count / per_page) + 1\n # calls User model to get the PIFs to display\n @users = User.pifs_general_case(\n per_page,\n @page_wanted,\n @sort,\n @direction,\n two_sorts,\n second_sort,\n second_direction\n )\n end\n @users\n # should just return 50 users unless nav is by alpha\n end",
"title": ""
}
] |
[
{
"docid": "f56989d641ce9314eb796581600bfd63",
"score": "0.81220657",
"text": "def sort_column\n if !params[:sort]\n \"i_follow_nbr\"\n elsif params[:sort] == 'tag'\n \"LOWER(t.name)\"\n else\n params[:sort]\n end\n end",
"title": ""
},
{
"docid": "2bc1a300c6f4b81e74f88525aba1e9da",
"score": "0.72931087",
"text": "def sort_column\n end",
"title": ""
},
{
"docid": "2bc1a300c6f4b81e74f88525aba1e9da",
"score": "0.72931087",
"text": "def sort_column\n end",
"title": ""
},
{
"docid": "0ddc62e7335a403713fd93ce02cbb0a6",
"score": "0.7109647",
"text": "def sort_column\n Wiki.column_names.include?(params[:sort]) ? params[:sort] : \"created_at\"\n end",
"title": ""
},
{
"docid": "9dad27965a47f4c69f92c7001de7630e",
"score": "0.7093364",
"text": "def sort_column\n f = %w(full_title speaker_name filesize duration event_date place language)\n ps = params[:sort]\n if f.include?(ps)\n if ps == \"speaker_name\"\n \"#{ps} #{sort_direction}, full_title asc\"\n elsif %w(place language event_date).include?(ps)\n \"#{ps} #{sort_direction}, speaker_name asc, full_title asc\"\n else\n \"#{ps} #{sort_direction}\"\n end\n else\n \"speaker_name asc, full_title asc\"\n end\n end",
"title": ""
},
{
"docid": "745780e13d2a000d61813366cf710e2e",
"score": "0.7075793",
"text": "def sort_column\n %w[likes hates date].include?(params[:sort]) ? params[:sort] : \"likes\"\n end",
"title": ""
},
{
"docid": "907b16f8e9bdcd3ffca91599dd6368c3",
"score": "0.705436",
"text": "def sort_column\n #puts \"ORDONNANCE COLONNE NAME\" \n #puts Ordonnance.column_names\n Ordonnance.column_names.include?(params[:sort]) ? params[:sort] : \"numero\"\n end",
"title": ""
},
{
"docid": "88208e83c239ded91fc92b8a1c247d8e",
"score": "0.7041707",
"text": "def custom_sort\n\t\t# expecing order to be like: \"+col,-col,+col...\"\n\t\torderp = params[:order].split(',')\n\t\t\n\t\torder = CW::SortOrder.new\n\t\torderp.each do |o|\n\t\t\tc = o[0..0]\n\t\t\to = o[1..-1]\n\t\t\tif c.eql?'-'\n\t\t\t\torder.desc o\n\t\t\telse\n\t\t\t\torder.asc o\n\t\t\tend\n\t\tend\n\n\t\t@pagination = CW::Pagination::Model::ActiveRecord.new( self, 'User', order, {}, 5 )\n\t\trender :nothing => true\n\tend",
"title": ""
},
{
"docid": "c9d3e8a8160f8fcce42ae61c54ad66af",
"score": "0.7006954",
"text": "def sort_direction\n end",
"title": ""
},
{
"docid": "1a8a33354b61cd8da86ae4ef1d345c5c",
"score": "0.6903355",
"text": "def sort_search_results(column, direction)\n case column\n when 'likes'\n reorder(:cached_votes_up => direction)\n when 'hates'\n reorder(:cached_votes_down => direction)\n when 'date'\n reorder(:created_at => direction)\n else\n reorder(:cached_votes_up => direction)\n end\n end",
"title": ""
},
{
"docid": "ecbab82736a7bf1eb0d1b57f37e0f301",
"score": "0.68855876",
"text": "def order\n order = sortable_column_order do |column, direction|\n case column\n when \"name\"\n \"LOWER(studies.name) #{direction}\"\n when \"active\", \"public\", \"promoted\"\n \"studies.#{column} #{direction}\"\n else\n 'LOWER(studies.name) ASC'\n end\n end\n end",
"title": ""
},
{
"docid": "b9c8e6272bb3fd0c405a12fe60fb49ff",
"score": "0.6866864",
"text": "def sort_column\n columns = %w[id location data created_at updated_at]\n columns[params[:iSortCol_0].to_i]\n end",
"title": ""
},
{
"docid": "2f2c01d109e52a4a486c8f745d21f580",
"score": "0.68180895",
"text": "def sort_column\n Page.column_names.include?(params[:sort]) ? params[:sort] : \"id\"\n end",
"title": ""
},
{
"docid": "2844ba2906577008ada5a771b30f669a",
"score": "0.67648274",
"text": "def display_sort_column_headers(search)\n model_fields.each_with_object('') do |field, string|\n string << content_tag(:th, sort_link(search, field, {}, method: action))\n end\n end",
"title": ""
},
{
"docid": "7e5c6204f2563d6cc664d363782c800b",
"score": "0.67460847",
"text": "def generate_order_by\n if sort_column && sort_direction\n \"#{sort_column} #{sort_direction}\"\n elsif sort_column\n sort_column\n else\n \"created_at DESC\"\n end\n end",
"title": ""
},
{
"docid": "cc52920a9e91c1d11dd5298aecac5cb5",
"score": "0.6744017",
"text": "def sort_column\n ElectionNomination.column_names.include?(params[:sort]) ? params[:sort] : \"sort_order\"\n end",
"title": ""
},
{
"docid": "8cc6ed92533c205037f393d9429437c2",
"score": "0.6743868",
"text": "def sort_by column, reverse=false; @sort_column = column.to_s; @sort_reverse = reverse; end",
"title": ""
},
{
"docid": "e414ed04a8db09a89379d6915e33f1b0",
"score": "0.6732187",
"text": "def sort_column\n # Assignment.column_names.include?(params[:sort]) ? params[:sort] : \"products_id\"\n %w[id products.name versions.version test_plans.name stencils.name].include?(params[:sort]) ? params[:sort] : \"products.name\"\n end",
"title": ""
},
{
"docid": "e8dbd6be3147514a0683c64657222a54",
"score": "0.67302215",
"text": "def sort_column\n # We no longer use the old way as we accept nexted query results\n # Assignment.column_names.include?(params[:sort]) ? params[:sort] : \"product_id\"\n %w[id products.name versions.version test_plans.name stencils.name notes].include?(params[:sort]) ? params[:sort] : \"id\"\n end",
"title": ""
},
{
"docid": "3a19ceba7cdcb752bb2cba11e625d9c2",
"score": "0.67291677",
"text": "def sort_by\n end",
"title": ""
},
{
"docid": "9e689ffe2956193a1193e98823573f72",
"score": "0.67276424",
"text": "def sort_column\n \n Pantry.column_names.include?(params[:sort]) ? params[:sort] : \"name\"\n\n end",
"title": ""
},
{
"docid": "d362172e1a69069684038cb5e1b8ba7f",
"score": "0.67271185",
"text": "def sort_column\n # TODO Naming ...\n Topic.column_names.include?(params[:sort]) ? params[:sort] : 'created_at'\n end",
"title": ""
},
{
"docid": "695b634ebad07fd6b520d8caaef319c3",
"score": "0.6726035",
"text": "def sort_column\n # We no longer use the old way as we accept nexted query results\n # Assignment.column_names.include?(params[:sort]) ? params[:sort] : \"product_id\"\n %w[id products.name versions.version test_plans.name stencils.name notes].include?(params[:sort]) ? params[:sort] : 'id'\n end",
"title": ""
},
{
"docid": "91bae5647b73adfeaeebcc652d2886de",
"score": "0.6724495",
"text": "def sortable_column_links_for(headers=[], tag=:th)\n\n request_params = (RAILS_ENV == 'test') ? Hash.new([]).update(params) : params\n \n headers.inject('') do |html, columns| \n href_params = params.dup.update(:order => columns[0].to_s, :sort => -1, :page => 1) \n if request_params['order'] == columns[0].to_s\n if request_params['sort'] == '-1'\n class_name = 'current desc'\n href_params = params.dup.update(:order => columns[0].to_s, :sort => 1, :page => 1)\n else\n class_name = 'current asc' \n end\n else\n class_name = 'unselected'\n end\n tag_contents = link_to(columns[1], href_params)\n html << content_tag(tag, tag_contents, :class => class_name)\n end\n \n end",
"title": ""
},
{
"docid": "f83d3b6acf30a1c8f84eb36e931176f9",
"score": "0.6699216",
"text": "def sort_column\n Advert.column_names.include?(params[:sort]) ? params[:sort] : \"description\"\n end",
"title": ""
},
{
"docid": "17b0532ceda78f7e07f09f0658c7ca7f",
"score": "0.66955054",
"text": "def index\n @activities = Activity.order(\"activities.#{sort_column} #{sort_direction}\")\n end",
"title": ""
},
{
"docid": "bbfcb4529c81b9d851bcb1a4bfa8f0ce",
"score": "0.668629",
"text": "def sort_column_ar\n f = {\n \"full_title\" => \"audio_messages.title\",\n \"filesize\" => \"filesize\",\n \"speaker_name\" => \"speakers.last_name\",\n \"duration\" => \"duration\",\n \"event_date\" => \"event_date\",\n \"place\" => \"places.name\",\n \"language\" => \"languages.name\" }\n f.keys.include?(params[:sort]) ? f[params[:sort]] : \"speakers.last_name asc, speakers.first_name asc, audio_messages.title asc, subj\"\n end",
"title": ""
},
{
"docid": "3d6729e052f259e4d5726f29b59244e2",
"score": "0.66808003",
"text": "def sort_column\n # Stencil.column_names.include?(params[:sort]) ? params[:sort] : \"id\"\n %w[id products.name name version].include?(params[:sort]) ? params[:sort] : \"id\"\n end",
"title": ""
},
{
"docid": "a64b7fcbd02ada055bf4501a7ce4273d",
"score": "0.66724384",
"text": "def index\n @characters = Character.order(sort_column + ' ' + sort_direction)\n \n end",
"title": ""
},
{
"docid": "5adb83461f22dbbd75cd2e22308550b4",
"score": "0.6670802",
"text": "def sort_column\n Order.column_names.include?(params[:sort]) ? params[:sort] : 'id'\n end",
"title": ""
},
{
"docid": "d03673d4164ec15ad0ce226d0e97365b",
"score": "0.6668622",
"text": "def sort_column(model_name)\n model_name.column_names.include?(params[:sort]) ? params[:sort] : model_name.column_names.first.to_s\n end",
"title": ""
},
{
"docid": "c8765faaa33ced2d887a36712f81649b",
"score": "0.6663769",
"text": "def sort item\n klass = controller_name\n name = item.downcase.gsub(' ','_').to_sym\n match = name.to_s\n matchers = {}\n\n session[:sortable_column_headers][klass].each_with_index { |m,i| \n matchers[m.split('.')[1].split(' ')[0].to_sym] = m.split('.')[1].split(' ')[1] if i == 0\n } if session[:sortable_column_headers].present?\n arrow = matchers[match.to_sym] == \"DESC\" ? \"down\" : \"up\"\n \n if matchers.present? && matchers.has_key?(match.to_sym)\n css = \"sorted #{arrow}\"\n else\n css = \"\"\n end \n\n link_to item.titlecase, sort_param(klass, name), :class => css\n end",
"title": ""
},
{
"docid": "70272d85948d7ccc2fd951e84431c149",
"score": "0.6662065",
"text": "def sort_column\n %w(name email role).include?(params[:sort]) ? params[:sort] : \"name\"\n end",
"title": ""
},
{
"docid": "ee6e806bce344a10c75d528ad43be029",
"score": "0.6653885",
"text": "def sort_column\n %w[name hostname mac_address last_report_at].include?(params[:sort]) ? params[:sort] : \"name\"\n end",
"title": ""
},
{
"docid": "ee6e806bce344a10c75d528ad43be029",
"score": "0.6653885",
"text": "def sort_column\n %w[name hostname mac_address last_report_at].include?(params[:sort]) ? params[:sort] : \"name\"\n end",
"title": ""
},
{
"docid": "14573e4e15251d8e928cd1f54f49d9ff",
"score": "0.6650286",
"text": "def sorting sortable_by\n if params[:orderby] && sortable_by.include?(params[:orderby])\n field = params[:orderby]\n else\n field = sortable_by.first\n end\n direction = params[:reverse] ? \"DESC\" : \"ASC\"\n \"#{field} #{direction}\"\n end",
"title": ""
},
{
"docid": "606a58b375a68918ed91e24812a8d6b1",
"score": "0.66489255",
"text": "def sort_column\n Restockhistory.column_names.include?(params[:sort]) ? params[:sort] : \"item_id\"\n end",
"title": ""
},
{
"docid": "deb67b7ca6f4bb1011c4a7b4329a80eb",
"score": "0.66442263",
"text": "def sort_column\n Admin::Obra.column_names.include?(params[:sort]) ? params[:sort] : \"titulo\" \n end",
"title": ""
},
{
"docid": "dc6717d6fdefc58301203f46243f4fc6",
"score": "0.6640236",
"text": "def sort_column\n columns = %w[name meter_no district_name community_name building_name unit floor room heating_status_name address ]\n columns[params[:iSortCol_0].to_i]\n end",
"title": ""
},
{
"docid": "57bfaadcbcb859be5889626921e899cf",
"score": "0.6639897",
"text": "def sort_column\n Ventaunidad.column_names.include?(params[:sort]) ? params[:sort] : \"mes\"\n end",
"title": ""
},
{
"docid": "720e699e4e2ef2e4c89815c5d8ce8b22",
"score": "0.6628567",
"text": "def index\n @books = Book.order(sort_column + \" \" + sort_direction)\n end",
"title": ""
},
{
"docid": "37e383e2e986d560814d9ac51268c9cb",
"score": "0.6625866",
"text": "def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end",
"title": ""
},
{
"docid": "37e383e2e986d560814d9ac51268c9cb",
"score": "0.6625866",
"text": "def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end",
"title": ""
},
{
"docid": "37e383e2e986d560814d9ac51268c9cb",
"score": "0.6625866",
"text": "def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end",
"title": ""
},
{
"docid": "37e383e2e986d560814d9ac51268c9cb",
"score": "0.6625866",
"text": "def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end",
"title": ""
},
{
"docid": "37e383e2e986d560814d9ac51268c9cb",
"score": "0.6625866",
"text": "def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end",
"title": ""
},
{
"docid": "37e383e2e986d560814d9ac51268c9cb",
"score": "0.6625866",
"text": "def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end",
"title": ""
},
{
"docid": "37e383e2e986d560814d9ac51268c9cb",
"score": "0.6625866",
"text": "def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end",
"title": ""
},
{
"docid": "37e383e2e986d560814d9ac51268c9cb",
"score": "0.6625866",
"text": "def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end",
"title": ""
},
{
"docid": "656703c00b818729a24d1c5c0cc5c86b",
"score": "0.66180634",
"text": "def index_sort_order\n @query = {}\n @query['sort_key'] = params['sort_key'] unless params['sort_key'].blank?\n\n if @query['sort_key']&.starts_with?('-')\n \"#{@query['sort_key'].delete_prefix('-')} ASC\"\n elsif @query['sort_key'].present?\n \"#{@query['sort_key']} DESC\"\n else\n 'updated_at DESC'\n end\n end",
"title": ""
},
{
"docid": "ad460365bb9c237d1824546e277b1074",
"score": "0.6613537",
"text": "def search_sort_columns\n %w[name_sortable air_date file_hash external_id]\n end",
"title": ""
},
{
"docid": "c449ce7a0f5f93cda0fdcb199992ed18",
"score": "0.65935373",
"text": "def set_sorting!\n return unless faceted || options[:sort_column].present?\n \n unless sort_values.include?(options[:sort_column])\n options[:sort_column] = 'created_at'\n end\n \n options[:sort_direction] = sort_direction(options[:sort_column]).downcase\n end",
"title": ""
},
{
"docid": "2782b1d0ff7e2aa0adfd5ba0065e0a19",
"score": "0.658579",
"text": "def category_order_by(model_tag)\n return model_tag + \".name ASC\" \n end",
"title": ""
},
{
"docid": "7159f132d5329dc724cba25bca4106e9",
"score": "0.6578743",
"text": "def sort_column\n # Version.column_names.include?(params[:sort]) ? params[:sort] : \"version\"\n %w[version description products.name].include?(params[:sort]) ? params[:sort] : \"version\"\n end",
"title": ""
},
{
"docid": "26cf3b8b4d7ecc47886a55931195ab68",
"score": "0.65786767",
"text": "def sort_column\n end_of_association_chain.column_names.include?(params[:sort]) ? \\\n params[:sort] : end_of_association_chain.column_names[1]\n end",
"title": ""
},
{
"docid": "348017ae7caa2148c12a0d75cb2f82f0",
"score": "0.6567871",
"text": "def sort\n sort_string_for object.params['sort']\n end",
"title": ""
},
{
"docid": "348017ae7caa2148c12a0d75cb2f82f0",
"score": "0.6567871",
"text": "def sort\n sort_string_for object.params['sort']\n end",
"title": ""
},
{
"docid": "ad22fa8b0959e3f362762c31413e3049",
"score": "0.65617794",
"text": "def sortable_by(*columns)\n links = content_tag :span, 'Sort by: '\n columns.each do |c|\n if c.is_a? Array\n links += link_to_sorted(c[0], c[1].to_sym)\n else\n links += link_to_sorted(c.to_s.titleize, c.to_sym)\n end\n end\n content_tag :div, links, class: 'sortable'\n end",
"title": ""
},
{
"docid": "111e46494acf5dd8e92fa636831671c7",
"score": "0.6561692",
"text": "def sort_order(default)\n ###############################################\n #params[:sort_order] == 'abbreviation' ? col = \"royalty_owners.#{params[:sort_order]}\" :\n # col = params[:sort_order]\n \"#{(params[:sort_order] || default.to_s).gsub(/[\\s;'\\\"]/,'')} #{params[:sort_dir] == 'down' ? 'DESC' : 'ASC'}\"\n end",
"title": ""
},
{
"docid": "11193ac4435571d5f8bd303fee4304c6",
"score": "0.65581894",
"text": "def sort_column\n Filament.column_names.include?(params[:sort]) ? params[:sort] : \"id\"\n end",
"title": ""
},
{
"docid": "7c8f27318035052f4404e826117febd0",
"score": "0.6557414",
"text": "def sort_column\n (StockChange.column_names + ['stocks.name', 'stock_changes.created_at']).include?(params[:sort]) ? params[:sort] : \"id\"\n end",
"title": ""
},
{
"docid": "aa7f6ef5fb3cb37b33fa8c51f648f43b",
"score": "0.6538235",
"text": "def sort_column\n Task.column_names.include?(params[:sort]) ? params[:sort] : \"title\"\n end",
"title": ""
},
{
"docid": "111c590d0f8a509c6b81af5795d11391",
"score": "0.65374243",
"text": "def sort_column\n params[:sort].present? ? params[:sort] : \"profiles.last_name\"\n end",
"title": ""
},
{
"docid": "d08c07e82648585ee89ebd4e15eda107",
"score": "0.653121",
"text": "def sort_column\n Movie.column_names.include?(params[:sort]) ? params[:sort] : \"created_at\"\n end",
"title": ""
},
{
"docid": "12d3bb4980cdc325d754ed08712af230",
"score": "0.65252215",
"text": "def sort_column\n super \"Room\", \"sort_order\"\n end",
"title": ""
},
{
"docid": "dc9086d5103f5885840ef500b0471f5c",
"score": "0.6522455",
"text": "def sort_column\n Job.column_names.include?(params[:sort]) ? params[:sort] : 'created_at'\n end",
"title": ""
},
{
"docid": "5e8f7b681ac89081b57782f1e8bdd608",
"score": "0.65191954",
"text": "def index\n @pets = Pet.order(sort_column + \" \" + sort_direction)\n end",
"title": ""
},
{
"docid": "870759d6af0af22a62361000629e5aff",
"score": "0.6510811",
"text": "def sort_column\n super \"User\", \"lastname\"\n end",
"title": ""
},
{
"docid": "1804af8b4e2cf5a65e87e98898475359",
"score": "0.65107197",
"text": "def index\n @movies = Movie.order(sort_column + \" \" + sort_direciton)\n end",
"title": ""
},
{
"docid": "ec6e5f9b2c1fda91ddbeb76c29b4ecc7",
"score": "0.650851",
"text": "def sort_column\n\t\t\tTask.column_names.include?(params[:sort]) ? params[:sort] : \"title\"\n\t\tend",
"title": ""
},
{
"docid": "29f6c630fbed27799899052c41f17372",
"score": "0.6507633",
"text": "def sort_column\n History.column_names.include?(params[:sort]) ? params[:sort] : \"created_at\"\n end",
"title": ""
},
{
"docid": "5e332ec65460ec46c963dd1026394db8",
"score": "0.6506854",
"text": "def sort_column_order\n array_for_numeric = [\"opportunities.amount\",\"opportunities.probability\",\"contacts.phone\",\"accounts.phone\",\"member_count\",\"responded_date\",\"campaign_member_status_type_id\",\"opportunity\",\"opportunity_amount\",\"matter_risks.details\",\"matter_facts.details\",\"documents.description\"]\n null_position = params[:dir].eql?(\"up\")? \"NULLS FIRST\":\"NULLS LAST\"\n #--------- SETTING THE SORTING ORDER HERE\n secondary_sort = params[:secondary_sort_direction].eql?(\"up\")? \"asc\" : \"desc\"\n sort = params[:dir].eql?(\"up\")? \"asc\" : \"desc\"\n if params[:col] && params[:secondary_sort]\n# if(params[:col]=='contacts.assigned_to_employee_user_id' || params[:col]=='accounts.assigned_to_employee_user_id' || params[:col]=='matter_tasks.assigned_to_user_id' )\n# @ord = \"users.first_name\" + ' ' + sort + ',' + \"users.last_name\" + ' ' + sort + ',' + params[:secondary_sort] + ' ' + secondary_sort\n if params[:col] == \"contacts.last_name\" && params[:controller] != \"opportunities\"\n @ord = \"coalesce(#{params[:col]+\",'')||''||contacts.first_name||''||coalesce(middle_name,'') \" + sort + ',' +params[:secondary_sort] + ' ' + secondary_sort}\"\n else\n @ord = params[:col] + ' ' + sort + ',' +params[:secondary_sort] + ' ' + secondary_sort\n end\n elsif params[:col] && !params[:secondary_sort]\n# if(params[:col]=='contacts.assigned_to_employee_user_id' || params[:col]=='accounts.assigned_to_employee_user_id' || params[:col]=='matter_tasks.assigned_to_user_id' )\n# @ord = \"users.first_name\"+ ' ' +sort\n if params[:col] == \"contacts.last_name\" && params[:controller] != \"opportunities\"\n @ord = \"coalesce(#{params[:col]+\",'')||''||contacts.first_name||''||coalesce(middle_name,'') \" +sort}\"\n else\n @ord = params[:col] + ' ' + sort\n end\n end\n end",
"title": ""
},
{
"docid": "e9db6ef51944755958cfe8f856aa701a",
"score": "0.6505796",
"text": "def index\n @movies = Movie.order(sort_column + \" \" + sort_direction)\n end",
"title": ""
},
{
"docid": "bea4be2dff8063d556e3c8150eb0d85c",
"score": "0.65034974",
"text": "def sort_column\n Trade.column_names.include?(params[:sort]) ? params[:sort] : \"id\"\n end",
"title": ""
},
{
"docid": "7f5853ec45774861c3590b8e91af8a9a",
"score": "0.64987046",
"text": "def sort_column\n Artwork.column_names.include?(params[:sort]) ? params[:sort] : \"title\"\n end",
"title": ""
},
{
"docid": "a9589f0a1b01a5a99a12daf2314f0784",
"score": "0.64984",
"text": "def sort_column\n params[:sort] || 'date_received' || 'seq_number'\n end",
"title": ""
},
{
"docid": "a9589f0a1b01a5a99a12daf2314f0784",
"score": "0.64984",
"text": "def sort_column\n params[:sort] || 'date_received' || 'seq_number'\n end",
"title": ""
},
{
"docid": "515489cd85e6ea56384aab43bfb16d9d",
"score": "0.649501",
"text": "def link_to_sort(column_name, params)\n column_heading = params[:column_name] || column_name.humanize\n link_to(column_heading, releases_path(\n :s => column_name,\n :d => reverse_sort_column_direction(params[:d]),\n :p => params[:p],\n :search => params[:search],\n :start_date => params[:start_date],\n :end_date => params[:end_date])\n )\n end",
"title": ""
},
{
"docid": "6f1842e991a59ada96c2d2fe462a7a55",
"score": "0.6493525",
"text": "def sort_column(nombre, defecto)\n nombre.column_names.include?(params[:sort]) ? params[:sort] : defecto\n end",
"title": ""
},
{
"docid": "5afe2856dd34c2691d4bd858a256f6cf",
"score": "0.64901376",
"text": "def sortable_list_header(true_col_name, col_header_name, options)\n link_to(\n ((b_sort_desc if options[:order_by].to_s == true_col_name.to_s and options[:order_desc].to_i == 1).to_s+\n (b_sort_asc if options[:order_by].to_s == true_col_name.to_s and options[:order_desc].to_i == 0).to_s+\n col_header_name).html_safe, :action => params[:action], :search_on => 1, :order_by => true_col_name.to_s, :order_desc => (options[:order_by].to_s == true_col_name ? 1 - options[:order_desc].to_i : 1))\n end",
"title": ""
},
{
"docid": "405b3f950799a860a82e2f2df9e28c07",
"score": "0.64854217",
"text": "def sort_column\n Print.column_names.include?(params[:sort]) ? params[:sort] : \"id\"\n end",
"title": ""
},
{
"docid": "f8ca9f4761292a0b4204f4b91e3596ff",
"score": "0.64779985",
"text": "def sort_column\n Pet.column_names.include?(params[:sort]) ? params[:sort] : \"name\"\n end",
"title": ""
},
{
"docid": "090371392d9cec347d5ced98552409d9",
"score": "0.64767027",
"text": "def sort_column_teks_english\n TeksEnglishStandard.column_names.include?(params[:sort]) ? params[:sort] : \"id\"\n end",
"title": ""
},
{
"docid": "1463b56cf12ca4b339d7b2b2bb7d7531",
"score": "0.6476502",
"text": "def sort_column\n columns = %w[id matrix id created_at updated_at] # possibly redefine in children classes\n columns[params[:iSortCol_0].to_i]\n end",
"title": ""
},
{
"docid": "f38c02994a3cf2a50fee7f1fd441543b",
"score": "0.64694846",
"text": "def sort_column\n User.column_names.include?(params[:sort]) ? params[:sort] : \"name\"\n\nend",
"title": ""
},
{
"docid": "4b57a6a0b42bfc26d475ecd57284e2f8",
"score": "0.64693046",
"text": "def sort_column\n Jobs.column_names.include?(params[:sort]) ? params[:sort] : \"title\"\n end",
"title": ""
},
{
"docid": "060853fd68f9aea94c5f0eeadbfee115",
"score": "0.64680326",
"text": "def link_to_sort(name,column)\n return name if search?\n if column == @sort\n order = ('ASC' == @order ? 'DESC' : 'ASC')\n else\n order = 'ASC'\n end\n link = link_to(name, params.merge({:sort => column, :order => order}))\n image = build_sort_image(column,order)\n \"#{link} #{image}\"\n end",
"title": ""
},
{
"docid": "2b4b5a97f559f2953fc34f419091a292",
"score": "0.6466515",
"text": "def sort_column\n Event.column_names.include?(params[:sort]) ? params[:sort] : \"title\"\n end",
"title": ""
},
{
"docid": "a1cfe8b87585e04994be42eb09c78093",
"score": "0.6464121",
"text": "def sort_column\n Publicacion.column_names.include?(params[:sort]) ? params[:sort] : \"Author\"\n end",
"title": ""
},
{
"docid": "596ecfcab3dfd159b2d3bed6029a7815",
"score": "0.6461239",
"text": "def order_by_for field\n\t if (order = SORTS[controller_name.to_sym].try(:[], field)) || controller_model.column_names.include?(field.to_s)\n\t order ||= \"#{controller_model.table_name}.#{field}\"\n\t \" data-order-by=\\\"#{order}\\\" class=\\\"sortable\\\"\".html_safe\n end\n\tend",
"title": ""
},
{
"docid": "a67f9fcfe16dcddb94777bac8a2b710e",
"score": "0.64588153",
"text": "def sort_column\n if Curriculum::SORTABLE_MAP.keys.include?(params[:sort])\n params[:sort]\n else\n 'curriculum_core'\n end\n end",
"title": ""
},
{
"docid": "a0116c44a6ac0c840b08023aaf4ae9e4",
"score": "0.64585686",
"text": "def sort_column\n User.column_names.include?(params[:sort]) ? params[:sort] : \"created_at\"\n end",
"title": ""
},
{
"docid": "784a9a7761f7b0a1f08d0a3a969bf234",
"score": "0.6454271",
"text": "def sort_expression\n col = sort_mappings_with_indifferent_access[params[:sort]] ||\n \"#{model_class.table_name}.#{params[:sort]}\"\n \"#{col} #{sort_dir}\"\n end",
"title": ""
},
{
"docid": "71d403cbbd57f5b5e1469da2ece5f749",
"score": "0.64492327",
"text": "def sort_column\n Proposal.column_names.include?(params[:sort]) ? params[:sort] : 'created_at'\n end",
"title": ""
},
{
"docid": "c1cb7f375e10a34cab9dd829ce695e2a",
"score": "0.6446071",
"text": "def sort_column\n Achievement.column_names.include?(params[:sort]) ? params[:sort] : \"name\"\n end",
"title": ""
},
{
"docid": "aa4f9fd079a62caa47d081e553048cfb",
"score": "0.6444839",
"text": "def sort_column\n Student.column_names.include?(params[:sort]) ? params[:sort] : \"username\"\n end",
"title": ""
},
{
"docid": "c491ada70d1a09b9d5b4b4864ea6b6d4",
"score": "0.6443819",
"text": "def sort_column\n Product.column_names.include?(params[:sort]) ? params[:sort] : 'created_at'\n end",
"title": ""
},
{
"docid": "5b4c8642cb2d4843f7d41c7669fd8bab",
"score": "0.6437719",
"text": "def sort_column\n Trespass.column_names.include?(params[:sort]) ? params[:sort] : \"dateOfNotification\"\n end",
"title": ""
},
{
"docid": "7c7031c90fff66338c4b45396ec78db1",
"score": "0.6435845",
"text": "def sort_column\n Event.column_names.include?(params[:sort]) ? params[:sort] : \"created_at\"\n end",
"title": ""
},
{
"docid": "4992e54a8326abd307bb373945b4b389",
"score": "0.6430803",
"text": "def sort_column\r\n UnitKerja.column_names.include?(params[:sort]) ? params[:sort] : \"kode\"\r\n end",
"title": ""
},
{
"docid": "931423afa88afee70682de4d7c559de2",
"score": "0.6423871",
"text": "def sort_column\n @model.column_names.include?(params[:sort]) ? params[:sort] : 'id'\n end",
"title": ""
}
] |
ca89a93e3115755d186584b67fc06052
|
If we get an Unauthorized error, we assume the token expired, reauth and try again
|
[
{
"docid": "e3fe79147ed441fa57c0f1f69593edee",
"score": "0.0",
"text": "def request(params)\n unless @cookie\n do_logon\n end\n begin\n do_request(params)\n rescue Fog::Compute::CenturyLink::AuthenticationFailed\n do_logon\n do_request(params)\n end\n end",
"title": ""
}
] |
[
{
"docid": "86ec321a503c5bbf7c3853ac93bbd7ed",
"score": "0.78946483",
"text": "def perform_oauth_token_expired!\n if tries == 1 && refresh_session_access_token!\n perform!\n else\n raise oauth_token_expired_error\n end\n end",
"title": ""
},
{
"docid": "f38af824e123ab11603a4cdef2563e54",
"score": "0.76795095",
"text": "def authenticate_request\n api_error({ errors: \"Authentication has expired or it is invalid\", status: :unauthorized}) unless decoded_auth_token\n end",
"title": ""
},
{
"docid": "aa9350f9a51e20ef0ebe3809470bb15c",
"score": "0.7599466",
"text": "def refresh_authorization\n # Handled implicitly by auth lib, here in case need to override\n logger.debug('Retrying after authentication failure')\n end",
"title": ""
},
{
"docid": "e281ac2abc0a6568e51733ac9029357a",
"score": "0.75146747",
"text": "def use_refresh_token!\n refreshed_authentications.first!\n rescue Errors::NoItems => error\n raise Errors::Unauthorized, error.to_param\n end",
"title": ""
},
{
"docid": "1135c5109bc3d3af1a2eec985c995708",
"score": "0.7388796",
"text": "def refresh_token_phase\n discover!\n refresh_access_token\n rescue ::Rack::OAuth2::Client::Error => e\n if(e.response && e.response[:error] && e.response[:error].to_sym == :invalid_grant)\n delete_stored_access_token_in_session\n return fail!(:refresh_token_invalid_grant, ::OmniAuth::OpenIDConnect::RefreshTokenInvalidGrant.new(e.response[:error_description]))\n end\n fail!(e.response[:error].to_sym, e)\n rescue ::Timeout::Error, ::Errno::ETIMEDOUT => e\n fail!(:timeout, e)\n rescue ::SocketError => e\n fail!(:failed_to_connect, e)\n end",
"title": ""
},
{
"docid": "6944000a0d703ed44e1694e81095dd40",
"score": "0.73451775",
"text": "def reauthenticate\n # Don't hold on to the current access token it's worthless\n flush_access_token!\n\n renew_tokens\n\n false # Skip GLI error handling\n end",
"title": ""
},
{
"docid": "dec1babe90be4c46030d6ec91add2d11",
"score": "0.73082936",
"text": "def check_token\n raise NotAuthenticated unless @token\n authenticate if token_expired\n end",
"title": ""
},
{
"docid": "131f5e466b623be99c765e44e8179dbc",
"score": "0.7274849",
"text": "def authenticate_request\n if auth_token_expired?\n render json: { error: 'Auth token is expired' }, status: 419\n elsif !@current_user\n render json: { error: 'Not Authorized' }, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "131f5e466b623be99c765e44e8179dbc",
"score": "0.7274849",
"text": "def authenticate_request\n if auth_token_expired?\n render json: { error: 'Auth token is expired' }, status: 419\n elsif !@current_user\n render json: { error: 'Not Authorized' }, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "9b5ab626a5d99ea577b8c0e5e0e8ad4e",
"score": "0.7272945",
"text": "def refresh_token_if_expired\n\t if token_expired?\n\t \tdata = {\n\t\t\t :client_id => Global.hosts.google_api_keys,\n\t\t\t :client_secret => Global.hosts.google_app_secrets,\n\t\t\t :refresh_token => self.google_account.refresh_token,\n\t\t\t :grant_type => \"refresh_token\"\n\t\t\t}\n\n\t\t\tresponse = RestClient.post \"https://accounts.google.com/o/oauth2/token\", data\n\t refreshhash = JSON.parse(response.body)\n\t self.google_account.token = refreshhash['access_token']\n\t self.google_account.expires_at = DateTime.now + refreshhash[\"expires_in\"].to_i.seconds\n\t self.google_account.save\t\n\t end\n\tend",
"title": ""
},
{
"docid": "02e38bdc2aec4529f694444b48999622",
"score": "0.72675914",
"text": "def access_token_if_expired\n if self.token_updated_at <= 58.minutes.ago\n data = {\n client_id: Rails.application.secrets.google_client_id,\n client_secret: Rails.application.secrets.google_client_secret,\n grant_type: \"refresh_token\",\n refresh_token: self.refresh_token\n }\n begin\n response = Net::HTTP.post_form(URI.parse('https://accounts.google.com/o/oauth2/token'), data)\n refreshhash = JSON.parse(response.body)\n unless refreshhash[\"error\"].present?\n self.token_updated_at = DateTime.now\n self.token = refreshhash['access_token']\n self.expires_at = DateTime.now.to_i + refreshhash[\"expires_in\"]\n self.save\n User.authentication(self)\n end\n rescue Exception => e\n end\n else\n Rails.logger.info { \"#{'2'*20} refresh token not expired #{'2'*20}\" }\n end\n end",
"title": ""
},
{
"docid": "c7286fa51ff5527baa26f5bf7d98273a",
"score": "0.72278816",
"text": "def authenticate_request\n\t\tif auth_token_expired?\n\t\t\tfail Exceptions::AuthenticationTimeoutError\n\t\telsif !@current_user\n\t\t\tfail Exceptions::NotAuthenticatedError\n\t\tend\n\tend",
"title": ""
},
{
"docid": "9d8729618c3c89fb9f3e16c385f5ffd7",
"score": "0.72209686",
"text": "def refresh_token_if_expired\n if token_expired?\n # upon successful authorization redirect we have to make a post request for access token\n conn = Faraday.new(:url => 'https://www.reddit.com/api/v1/access_token')\n\n conn.basic_auth(ENV['REDDIT_KEY'], ENV['REDDIT_SECRET'])\n\n # API requirements for body to obtain new access_token\n body = { \n grant_type: \"refresh_token\",\n refresh_token: self.refresh_token,\n duration: 'permanent'\n }\n\n response = conn.post do |req|\n req.body = body\n end\n \n refresh_hash = JSON.parse(response.body)\n\n self.reddit_token = refresh_hash['access_token']\n self.refresh_duration = (Time.now + refresh_hash['expires_in']).to_i\n \n self.save\n end\n end",
"title": ""
},
{
"docid": "bac1ad0d8b1d9f0a41bf6dbfee7818f4",
"score": "0.7212752",
"text": "def refresh_token_and_retry?\n if unauthorized? && @auth && @auth.refreshed_access_token?\n @response = @http_request = @uri = nil\n true\n end\n rescue Errors::MissingAuth\n false\n end",
"title": ""
},
{
"docid": "aab89af927c8a8704cfb54584ceb8ff1",
"score": "0.7205004",
"text": "def authenticate_request\n\t\t\t\tif auth_token_expired?\n\t\t\t\t\tfail Exceptions::AuthenticationTimeoutError\n\t\t\t\telsif !@current_user\n\t\t\t\t\tfail Exceptions::NotAuthenticatedError\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "47abd7100f7819e942acc54865016d35",
"score": "0.7137133",
"text": "def authenticate_token\n if request.headers[\"Authorization\"].present?\n @token = request.headers[\"Authorization\"].split(\" \").last\n if AuthToken.valid?(@token) && $redis.ttl(@token) > 0\n $redis.expire(@token, 10.days.to_i)\n\n else\n raise \"My Auth error, Token is expired\"\n end\n end\n\n @token\n end",
"title": ""
},
{
"docid": "cfb1ae97b801c9b18db312f9e61d6099",
"score": "0.7118137",
"text": "def re_authorize\n @re_auth_tries ||= APP_CONSTANTS['authorization_tries_limit']\n return false if @re_auth_tries < 1\n refresh_access_token(@user)\n @user.reload\n @re_auth_tries -= 1\n end",
"title": ""
},
{
"docid": "eab9f3f77743b9c46ab87adf8e3e32e9",
"score": "0.7107076",
"text": "def check_token!\n if current_user && access_token && access_token.expired?\n session[:user_id] = nil\n session[:access_token] = nil\n \n redirect_to root_url, notice: 'Access token expired. You have been logged out.'\n end\n end",
"title": ""
},
{
"docid": "eab9f3f77743b9c46ab87adf8e3e32e9",
"score": "0.7107076",
"text": "def check_token!\n if current_user && access_token && access_token.expired?\n session[:user_id] = nil\n session[:access_token] = nil\n \n redirect_to root_url, notice: 'Access token expired. You have been logged out.'\n end\n end",
"title": ""
},
{
"docid": "305affa97d726a33d1403bf356c039a1",
"score": "0.70881116",
"text": "def revoke_token\n @client.disable_access_token\n true\n rescue => ex\n raise AuthError.new(\"revoke_token: #{ex.message}\", DATASOURCE_NAME)\n end",
"title": ""
},
{
"docid": "35826cf999b50b9f5a5c592ea504fcb0",
"score": "0.7029855",
"text": "def revoke_token\n # TODO: See how to check this\n true\n rescue StandardError => ex\n raise AuthError.new(\"revoke_token: #{ex.message}\", DATASOURCE_NAME)\n end",
"title": ""
},
{
"docid": "d1b044e6f25e26a3051e001cc1270be2",
"score": "0.7018292",
"text": "def refresh_token\n @rest_client = nil\n raise Exceptions::LoginRequired\n end",
"title": ""
},
{
"docid": "f038f99b36892b0af899225c0ffa89fe",
"score": "0.6986456",
"text": "def authentication_timeout\n render json: { errors: [\"Token has expired. Re-login for a new token.\"] },\n status: 419\n end",
"title": ""
},
{
"docid": "edcef238783d7639779c8ee1392a8bb1",
"score": "0.6979906",
"text": "def retry_on_auth_failure(&block)\n retried = false\n begin\n yield pandora_client\n rescue Pandora::APIError => ex\n if !retried && ex.code == 1001 # INVALID_AUTH_TOKEN\n pandora_client.reauthenticate\n retried = true\n retry\n else\n raise\n end\n end\n end",
"title": ""
},
{
"docid": "4b639f55f7e2eb5ca9497e33656eb258",
"score": "0.69466954",
"text": "def expire_auth_token_on_timeout\n self.class.expire_auth_token_on_timeout\n end",
"title": ""
},
{
"docid": "705615ddecd213e4dd4a70d274773c5f",
"score": "0.690464",
"text": "def invalid_auth_token(error)\n details = { status: 401, error: 'Access denied!. Invalid token supplied.',\n message: error.message }\n json_response(details, :unauthorized)\n end",
"title": ""
},
{
"docid": "57cd4b913023f043be325034b7324587",
"score": "0.68868136",
"text": "def authenticate_user!\n authenticate_token || render_unauthorized(\"Access denied\")\n end",
"title": ""
},
{
"docid": "154e96df510e49e3b22444fee22f432d",
"score": "0.6866306",
"text": "def ensure_authentication_token! \n reset_authentication_token! if authentication_token.blank? \n end",
"title": ""
},
{
"docid": "22a5b5c20366dd632cbc246815b2a346",
"score": "0.6863175",
"text": "def revoke_token\n @client.revoke\n true\n rescue DropboxApi::Errors::HttpError => ex\n log_info(message: 'Error revoking Dropbox token: already invalid', exception: ex, current_user: @user)\n true\n rescue StandardError => ex\n raise AuthError.new(\"revoke_token: #{ex.message}\", DATASOURCE_NAME)\n end",
"title": ""
},
{
"docid": "28652dc8b12f60e9b0f63e3e5a2a0539",
"score": "0.68582886",
"text": "def authenticate_access_token\n token = Token.find_by(\n uuid: headers['Authorization'] || params[:access_token],\n kind: 'access'\n )\n\n if token && !token.expired?\n @current_app = token.app\n @current_user = token.user\n @current_token = token\n\n token.update_columns(last_used_at: Time.now, last_used_ip: request.remote_ip)\n else\n head :unauthorized\n end\n end",
"title": ""
},
{
"docid": "9cad0bc413fca5bf48bed00f6a3cdd0e",
"score": "0.6833686",
"text": "def refresh_token\n if (!$access_token.nil? && $access_token.expired?)\n begin\n $access_token = $access_token.refresh!\n session[:oauth_access_token] = $access_token.token\n rescue\n return\n end\n\n end\n end",
"title": ""
},
{
"docid": "0a0a3c1c60ff6320382bc5a4275f0765",
"score": "0.6825282",
"text": "def attempt_authenticate\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "4559a6fcd1b1be4d51ed835d8a100ddc",
"score": "0.6810517",
"text": "def expired_signature_token(error)\n details = { status: 401, error: 'Access denied!. Token has expired.',\n message: error.message }\n json_response(details, :unauthorized)\n end",
"title": ""
},
{
"docid": "d3fee3b2c05bd1dd6a7dd5fcd1b5ebde",
"score": "0.68039376",
"text": "def authenticate!\n raise UnauthorizedAccess, 'invalid access token' unless current_user\n end",
"title": ""
},
{
"docid": "69601d465601ae983b6a1fe8f7b5f473",
"score": "0.68032855",
"text": "def ensure_authentication_token!\n reset_authentication_token! if authentication_token.blank?\n end",
"title": ""
},
{
"docid": "69601d465601ae983b6a1fe8f7b5f473",
"score": "0.68032855",
"text": "def ensure_authentication_token!\n reset_authentication_token! if authentication_token.blank?\n end",
"title": ""
},
{
"docid": "0cf99358a8dfe17e71cb50e5205233f7",
"score": "0.6786999",
"text": "def authenticate_request!\n fail AuthenticationError::NotAuthenticatedError unless user_id_in_auth_token?\n @current_user ||= User.find_by(id: decoded_auth_token[:id])\n rescue JWT::ExpiredSignature\n raise AuthenticationError::TimeoutError\n rescue JWT::VerificationError, JWT::DecodeError \n raise AuthenticationError::NotAuthenticatedError\n end",
"title": ""
},
{
"docid": "8f13743a02413ea02c4be247425625f7",
"score": "0.6763878",
"text": "def authenticate!\n error!('Unauthorized. Invalid or expired token.', 401) unless authenticated_user\n end",
"title": ""
},
{
"docid": "5a13949f33dab8dcf4c9f1c3686fc862",
"score": "0.6722012",
"text": "def reauthorized!\n ::Redis::Alfred.delete(authorization_error_count_key)\n ::Redis::Alfred.delete(reauthorization_required_key)\n end",
"title": ""
},
{
"docid": "08da6d194e4a69501f1bbd70bf651c46",
"score": "0.67214775",
"text": "def user_authorized \n @user = User.find_by_token(params[:token])\n if !@user.blank?\n sign_in :user, @user \n else\n render json: {error: \"Your Session expired. Please login again.\"}\n end\n end",
"title": ""
},
{
"docid": "ee7c63b00c5d78fc19ca22cbd80dc63f",
"score": "0.67032987",
"text": "def validate_token(token)\n token_date = session[:require_token]\n if current_user.blank? or token_date.blank? or token_date < (Time.new-300) then\n # invalidate session if:\n # * current_user missing or\n # * token timestamp is older than 5min\n Archie::Controller::AUTH_INVALID_SESSION\n\n elsif current_user.valid_otp?(token) then\n session.delete(:require_token)\n # track now that token has been verified\n current_user.update_tracked_fields!(request.remote_ip)\n current_user.save\n Archie::Controller::AUTH_SUCCESS\n\n else\n # token was not valid, auth failed\n if user then\n user.failed_attempts += 1\n user.save\n end\n Archie::Controller::AUTH_ERROR\n end\n end",
"title": ""
},
{
"docid": "cb049fb804ae58116054c3cc786d2179",
"score": "0.66981983",
"text": "def refresh_access_token\n response = HTTP.post('https://pardakht.cafebazaar.ir/devapi/v2/auth/token/',\n form: {\n grant_type: 'refresh_token',\n client_id: @client_id,\n client_secret: @client_secret,\n refresh_token: @refresh_token\n })\n validate_authentication_response response\n end",
"title": ""
},
{
"docid": "74df062b37c601b180dcb0457ee47fc6",
"score": "0.6690074",
"text": "def handle_error(error)\n # TODO: Add support for automatically regenerating auth tokens when they\n # expire.\n raise error\n end",
"title": ""
},
{
"docid": "3cfcdd960dfc2f262e5545336909110f",
"score": "0.66778886",
"text": "def refreshToken(token)\n if token and token.expired?\n token.refresh!\n else\n token\n end\n end",
"title": ""
},
{
"docid": "ffb09c21a3e6f2fc73dad07af3c5c1e2",
"score": "0.66755253",
"text": "def invalid_auth_token\n respond_to do |format|\n format.html { redirect_to sign_in_path,\n error: 'Login invalid or expired' }\n format.json { head 401 }\n end\n end",
"title": ""
},
{
"docid": "09aba7a90f17dfc5912fdaa35632c1e2",
"score": "0.667382",
"text": "def authenticate_admin\n # unless auth_present?\n #\n # end\n begin\n jwt_token = token\n puts jwt_token\n payload = decode(jwt_token)\n\n issued_time = payload[\"issued\"]\n # todo: remove this comment\n if issued_time == nil# || Time.now.to_i - issued_time >= 600\n @msg = \"error authenticating token \"\n @details = \"Token expired, please issue a new one\"\n render \"objects/msg.json\", status: :unauthorized and return\n end\n user_id = payload[\"user\"]\n @user = User.find(user_id)\n unless @user && @user.role.to_s == \"admin\"\n if params.has_key?(:redirect)\n redirect_to root_url\n else\n raise 'user not found or role not admin'\n end\n end\n rescue Exception => e\n @msg = \"error authenticating token \"\n @details = e.message\n render \"objects/msg.json\", status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "eb05e598132afd7c5841bbd3ea17c72c",
"score": "0.666973",
"text": "def ensure_authentication_token!\n reset_authentication_token! if authentication_token.blank?\n end",
"title": ""
},
{
"docid": "16abac0bc29a0c29c0822baf039a6a8e",
"score": "0.66679907",
"text": "def authenticate_with_token!\n render json: { errors: 'Unauthorized access!' }, status: 401 unless user_logged_in?\n end",
"title": ""
},
{
"docid": "e233fbd73ebbf1561b175d40d63745c9",
"score": "0.6667913",
"text": "def authentication_error\n # User's token is either invalid or not in the right format\n render json: {error: ('unauthorized: '+@@message)}, status: 401 # Authentication timeout\n end",
"title": ""
},
{
"docid": "a1ccc791f251860cfdd688990aec768a",
"score": "0.66668856",
"text": "def authentication_error\n # User's token is either invalid or not in the right format\n render json: {error: ('unauthorized')}, status: 401 # Authentication timeout\n end",
"title": ""
},
{
"docid": "8dbdec5c918e5d9f696ea1801236e666",
"score": "0.6665932",
"text": "def authentication_error\n # User's token is either invalid or not in the right format\n render :json => {:message => 'Unauthorized. Please log in to proceed.'},\n :status => :unauthorized # Authentication timeout\n end",
"title": ""
},
{
"docid": "411f4082d26435535165865361c704ee",
"score": "0.66626424",
"text": "def authenticate_token!\n render json: {message: 'Invalid Token'}, status: 401 unless current_user\n end",
"title": ""
},
{
"docid": "1c50b2cd48fae7942e3337a28c07ef44",
"score": "0.6655299",
"text": "def ensure_authentication_token\n reset_authentication_token if authentication_token.blank?\n end",
"title": ""
},
{
"docid": "c58c1c9445a7b46194e6f61ff103d802",
"score": "0.6651666",
"text": "def refresh(_)\n authenticate\n end",
"title": ""
},
{
"docid": "c58c1c9445a7b46194e6f61ff103d802",
"score": "0.6651666",
"text": "def refresh(_)\n authenticate\n end",
"title": ""
},
{
"docid": "fc16ab2bc3cb4b1fc74bb883cd610d4a",
"score": "0.6617403",
"text": "def authenticate_token\n authenticate_with_http_token do |token|\n t = AccessToken.with_unexpired_token(token)\n t&.user\n end\n end",
"title": ""
},
{
"docid": "e77bad5ad6584cfb6f48c2a2050923e5",
"score": "0.6603583",
"text": "def verify_authentication_header\n case raw_response.headers['WWW-Authenticate']\n when /error\\=\\\"invalid_token\\\".*expired/\n fail OauthTokenExpired\n when /error\\=\\\"invalid_token\\\".*revoked/\n fail OauthTokenRevoked\n end\n end",
"title": ""
},
{
"docid": "8ff565c9a0cc40cfeada2aade0b267ae",
"score": "0.6601938",
"text": "def authenticate_user_from_token!\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "02a6c2537ddffd86443672274b419684",
"score": "0.6601505",
"text": "def authenticate_user_from_token!\n user_email = request.headers[\"X-API-EMAIL\"].presence\n user_auth_token = request.headers[\"X-API-TOKEN\"].presence\n user = User.find_by_email(user_email)\n\n if user.authentication_token.present?\n if user.authentication_token_expiry < Time.now\n warden.custom_failure!\n render json: { success: false, message: 'Authentication token expired! Please login again.' }, status: 401\n else\n if user && Devise.secure_compare(user.authentication_token, user_auth_token)\n sign_in(user, store: false)\n end\n end\n else\n warden.custom_failure!\n render json: { success: false, message: 'Authentication token not available! Please login again.' }, status: 401\n end\n end",
"title": ""
},
{
"docid": "0792439d9eb1b36516dad6a4cfaca011",
"score": "0.65833557",
"text": "def authentication_error\n # User's token is either invalid or not in the right format\n render json: {error: t('unauthorized')}, status: 401 # Authentication timeout\n end",
"title": ""
},
{
"docid": "0792439d9eb1b36516dad6a4cfaca011",
"score": "0.65833557",
"text": "def authentication_error\n # User's token is either invalid or not in the right format\n render json: {error: t('unauthorized')}, status: 401 # Authentication timeout\n end",
"title": ""
},
{
"docid": "63b87fd675c37cc395a0da077fbca262",
"score": "0.65691364",
"text": "def refresh_access_token\n if @refresh_token.nil?\n raise Error, \"refresh_token was not previously acquiered\"\n end\n r = nil\n doretry = 0\n retrycount = 0\n maxretry = 3\n loop do\n begin\n r = @conn.post '/oauth/token', {\n :refresh_token => @refresh_token,\n :grant_type => 'refresh_token',\n :client_id => @client_id,\n :client_secret => @client_secret\n }\n rescue Faraday::TimeoutError\n puts \"Handling Faraday::TimeoutError\"\n doretry = 1\n rescue Faraday::ConnectionFailed\n puts \"Handling Faraday::ConnectionFailed\"\n doretry = 1\n rescue Errno::ETIMEDOUT\n puts \"Handling Errno::ETIMEDOUT\"\n doretry = 1\n rescue Exception => e\n fail \"refresh_access_token: %s\" % [ e.message ]\n end\n if r.body.nil? || r.body.size == 0\n doretry = 1\n end\n retrycount += 1\n break unless retrycount > maxretry && doretry > 0\n sleep(10*retrycount)\n end\n\n\n j = json_parse(r)\n case r.status\n when 200\n { :access_token => j['access_token'],\n :expires_at => Time.parse(r[:date]) + j['expires_in'].to_i\n }\n when 400, 401, 500\n raise Error::Auth, \"#{j['error']} #{j['error_description']}\"\n else\n raise Error::Auth, \"unhandled response code (#{r.status})\"\n end\n end",
"title": ""
},
{
"docid": "3447ea6782b285f770ea1071ad3d9f22",
"score": "0.65599865",
"text": "def renew_token\n password = params[:password]\n old_oauth = params[:old_oauth]\n oauth_token = params[:oauth_token]\n expires_at = params[:expires_at]\n \n @user = User.find_by(email: params[:email].downcase)\n if @user\n if old_oauth == @user.oauth_token || @user.authenticate(password)\n if oauth_token\n @user.oauth_token = oauth_token\n else\n @user.generate_auth_token\n end\n \n if expires_at\n @user.expires_at = expires_at\n else\n @user.generate_expiration_time\n end\n success_message(@user)\n else\n error_message(\"Authentication credentials not correct.\")\n end\n else\n error_message(\"No user found with that email.\")\n end\n end",
"title": ""
},
{
"docid": "ab9f6fe6d441206195a508a14ee5c87a",
"score": "0.65466523",
"text": "def authorize\n if @refresh_token\n begin\n refresh\n rescue RestClient::Exception\n STDERR.puts \"refresh token expired\"\n @refresh_token = nil\n end\n end\n \n if @refresh_token.nil?\n puts \"Need username, password to generate new token (only used once, not stored).\"\n username = @username = ask(\"Username: \") do |q|\n q.default = @username\n q.validate = /\\S+/\n end\n password = ask(\"Password (not stored): \") { |q| q.echo = '*' }\n new_token(username, password)\n puts \"Login success!\"\n end\n end",
"title": ""
},
{
"docid": "fc020d7cef56bc522776e081025738cf",
"score": "0.6543763",
"text": "def authenticate_token\n set_jw_token_and_jwt_authable\n if current_jwt_authable.present?\n current_jw_token.update({\n :expires_at => Time.now + JwToken.timeout\n })\n else \n raise ApiException.new(ApiException.session_expired)\n end\n end",
"title": ""
},
{
"docid": "f93f770c9e0562a483a9d06be553cb2e",
"score": "0.6540147",
"text": "def auth\n auth_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "48dff406cc878524f24038eb707e503f",
"score": "0.65290576",
"text": "def ensure_authentication_token_for_api!\n reset_authentication_token\n self.token_authenticated_at = Time.now\n save(:validate => false)\n end",
"title": ""
},
{
"docid": "7ee8f747990598f342e7078ae5ac746f",
"score": "0.65234953",
"text": "def refresh_token\n data = {\n :client_id => ENV[\"GOOGLE_CLIENT_ID\"], \n :client_secret => ENV[\"GOOGLE_CLIENT_SECRET\"],\n :refresh_token => current_user.refresh_token,\n :grant_type => \"refresh_token\"\n }\n @response = JSON.parse(RestClient.post \"https://accounts.google.com/o/oauth2/token\", data)\n if @response[\"access_token\"].present?\n current_user.token = @response[\"access_token\"]\n current_user.token_expiry = Time.now.utc + @response[\"expires_in\"].to_i.seconds\n current_user.save!\n else\n # Something else bad happened\n #throws an error\n end\n end",
"title": ""
},
{
"docid": "4d758e60e98fef6712e6767813a0c1e5",
"score": "0.6516517",
"text": "def reauthenticate(password)\n invalidate_token(password)\n add_auth_headers(token_or_error(auth_attempt))\n end",
"title": ""
},
{
"docid": "188a1c9c96b5326867cc817410cf2994",
"score": "0.6510747",
"text": "def authorize_token!\n oauth2_signet.fetch_access_token!\n rescue Signet::AuthorizationError => e\n raise RubyPicasa::PicasaTokenError, 'The request to upgrade to a session token failed.'\n end",
"title": ""
},
{
"docid": "33ff81a16b38d1b78e471b47ced9a6ab",
"score": "0.6510365",
"text": "def ensure_authentication_token\n if current_user.nil?\n return\n else\n user_auth = current_user.authentication_token\n if user_auth.blank?\n renew_authentication_token(current_user)\n end\n end\n end",
"title": ""
},
{
"docid": "793a742f63566597badd1abd29514ec3",
"score": "0.65071154",
"text": "def authenticate_request!\n fail NotAuthenticatedError unless user_id_included_in_auth_token?\n @current_user = User.find(decoded_auth_token[0][\"user_id\"])\n activate(@current_user)\n rescue JWT::ExpiredSignature\n raise AuthenticationTimeoutError\n rescue JWT::VerificationError, JWT::DecodeError\n raise NotAuthenticatedError\n end",
"title": ""
},
{
"docid": "088fc061b7e348d1b935876c41e43f5a",
"score": "0.6506668",
"text": "def authenticate_request\n unless request.headers[:token] == \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJleHAiOjE0NjA2NTgxODZ9\"\n render json: { error: 'Not Authorized' }, status: 401\n end\n end",
"title": ""
},
{
"docid": "959f3cac305a5625b2241aa141f35a41",
"score": "0.65007627",
"text": "def oauth_token\n fail(OAuthException, \"Token has not been authenticated\") unless self.authenticated?\n\n @oauth_token = self.refreshToken if @oauth_token.expired?\n\n @oauth_token\n end",
"title": ""
},
{
"docid": "7e50aa4ecfdb9a9e42dabef97d2bc6b6",
"score": "0.6491125",
"text": "def error_handling(e)\n session[:refresh_attempt_count] += 1\n if session[:refresh_attempt_count] <3\n self.refresh_token(session[:refresh_token])\n end\n end",
"title": ""
},
{
"docid": "d92080932eee88b1927cab071dc3adf6",
"score": "0.6486357",
"text": "def authenticate\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "d92080932eee88b1927cab071dc3adf6",
"score": "0.6486357",
"text": "def authenticate\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "d92080932eee88b1927cab071dc3adf6",
"score": "0.6486357",
"text": "def authenticate\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "d92080932eee88b1927cab071dc3adf6",
"score": "0.6486357",
"text": "def authenticate\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "d92080932eee88b1927cab071dc3adf6",
"score": "0.6486357",
"text": "def authenticate\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "d92080932eee88b1927cab071dc3adf6",
"score": "0.6486357",
"text": "def authenticate\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "d92080932eee88b1927cab071dc3adf6",
"score": "0.6486357",
"text": "def authenticate\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "fd97071a43c1d1f4d73c0d7b8d56fb9a",
"score": "0.6484",
"text": "def authenticate!\n access_token = AccessToken.where(name: params[:token]).first\n if access_token && !access_token.expired?\n @current_user = access_token.user\n else\n render :json => { message: \"Unauthorized\" }, :status => :unauthorized\n false\n end\n end",
"title": ""
},
{
"docid": "00a2aa46a4673155380c62d2ad887d06",
"score": "0.6466762",
"text": "def authenticate_user_from_token!\n auth_token = request.headers['Authorization']\n authenticate_error unless authenticate_with_auth_token auth_token\n end",
"title": ""
},
{
"docid": "67979b1bf24a7499f7c6a62186b1dcf7",
"score": "0.6461261",
"text": "def token_authenticated?; end",
"title": ""
},
{
"docid": "9af2b876590cabcf826f3bc364e8c1a0",
"score": "0.64605755",
"text": "def authentication_error\n # User's token is either invalid or not in the right format\n render json: {error: t('unauthorized')}, status: 401 # Authentication timeout\n end",
"title": ""
},
{
"docid": "e599b05ddc450f2abe07de52d40de02e",
"score": "0.64571047",
"text": "def invalidate_api_token(token)\n account = self.where(authentication_token: token).first\n\n raise 'Invalid token.' if account.nil?\n\n account.reset_authentication_token!\n\n token\n end",
"title": ""
},
{
"docid": "6a09b84620805bc52a3e2f156f271deb",
"score": "0.6454006",
"text": "def authentication_error\n # User's token is either invalid or not in the right format\n render json: {error: t('application_controller.unauthorized')}, status: 401 # Authentication timeout\n end",
"title": ""
},
{
"docid": "a0d543606a3eb07b5a5bea5829ef2e26",
"score": "0.64537233",
"text": "def refresh_access_token()\n\n\t\tif(Time.now - @start_time) <=3000\n\t\t\tputs \"Access Token still not expired\"\n\t\telse\n\t\t\tputs \"Access Token Expired .......Creating a new one\"\n\t\t\t@access_token = @new_token.get_access_token\n\t\t\t@start_time = Time.now \n\t\tend\n\tend",
"title": ""
},
{
"docid": "98d05a1b58403d8ca57cec8d93ace6e8",
"score": "0.64475363",
"text": "def renew_access_token!\n establish :grant_type => 'refresh_token', :refresh_token => self.auth[:refresh_token]\n end",
"title": ""
},
{
"docid": "87f14991b075fc1380b370c883aa4aae",
"score": "0.6445641",
"text": "def restric_access\n \tapi_key = (Rails.configuration.user_token == params[:token]) # pull token key from configs\n \traise NotAuthorized unless api_key\n end",
"title": ""
},
{
"docid": "78ea46131c09ee308b598dbe0637b144",
"score": "0.64440477",
"text": "def refresh_access_token\n # Check if user's access token has expired\n if access_token_expired?\n #Request a new access token using refresh token\n #Create body of request\n body = {\n grant_type: \"refresh_token\",\n refresh_token: self.refresh_token,\n client_id: ENV['CLIENT_ID'],\n client_secret: ENV[\"CLIENT_SECRET\"]\n }\n # Send request and updated user's access_token\n auth_response = RestClient.post('https://accounts.spotify.com/api/token', body)\n auth_params = JSON.parse(auth_response)\n self.update(access_token: auth_params[\"access_token\"])\n else\n puts \"Current user's access token has not expired\"\n end\n end",
"title": ""
},
{
"docid": "9037afb8fa79ea3f86773baac5a3158a",
"score": "0.643533",
"text": "def authenticate_with_token!\r\n render json:{errors:\"Not authenticated\"},status: :unauthorized unless user_signed_in?\r\n end",
"title": ""
},
{
"docid": "ceefa48bcc6f9d5f9d870a93b4ba4501",
"score": "0.6432074",
"text": "def invalidate_token\n self.update(auth_token: nil)\n end",
"title": ""
},
{
"docid": "c35acd2cebb881be29099c6f7005f8c9",
"score": "0.6427094",
"text": "def rescue_invalid_auth_token\n render plain: \"Invalid authenticity token.\", status: :bad_request\n end",
"title": ""
},
{
"docid": "6cfd2d5aa566b03e5897730ec5ea743b",
"score": "0.64153665",
"text": "def unauthenticated; end",
"title": ""
},
{
"docid": "44d5564e5dfc35b66a1a6c43083e24a5",
"score": "0.6415256",
"text": "def request_with_refresh(&req)\n response = req.call\n\n # if the response returned a 401, and the headers contain www-authenticate, we try\n # refreshing the token before resubmitting\n\n if response.is_a?(Net::HTTPUnauthorized)\n auth = response['www-authenticate']\n\n # for the time being we ignore the actual value of the header, and hardwire the refresh URL\n\n if auth && (auth.length > 0)\n if refresh_access_token()\n response = req.call\n end\n end\n end\n\n response\n end",
"title": ""
},
{
"docid": "4671ed146f48153f16bdf383f9c52551",
"score": "0.64121807",
"text": "def invalidate_authentication_token!\n invalidate_authentication_token\n save\n end",
"title": ""
},
{
"docid": "7b8b824b3182b7150605495ac65a5534",
"score": "0.640903",
"text": "def invalidate_authentication_token\n generate_authentication_token.tap do |token|\n self.authentication_token = token\n end\n end",
"title": ""
},
{
"docid": "262f5bfed036d889f3ae37bb4b536ed8",
"score": "0.64079744",
"text": "def ensure_authentication_token\n self.reset_authentication_token if self.authentication_token.blank?\n end",
"title": ""
},
{
"docid": "f70053849933e1a95815409f57b97a0d",
"score": "0.6400383",
"text": "def check_auth\n unless (token_present? || token_on_path?) && valid_token?\n render json: {\n message: 'You need request a token before go ahead.',\n status: 401\n }, status: :unauthorized\n end\n end",
"title": ""
}
] |
91e12d4e1426ab6341303613638c919b
|
The specific quarter this week falls in
|
[
{
"docid": "07344a328f05bc581bf4aa41a8e774a8",
"score": "0.73033047",
"text": "def quarter\n case merch_month\n when 7,8,9\n return 1\n when 10,11,12\n return 2\n when 1,2,3\n return 3\n else\n return 4\n end\n end",
"title": ""
}
] |
[
{
"docid": "85055ec2b82ebf2f0506014bd2e13646",
"score": "0.7587076",
"text": "def current_quarter\n \n case self.month\n \n when 1..3 then 1\n when 4..6 then 2\n when 7..9 then 3\n else 4\n end\n \n end",
"title": ""
},
{
"docid": "8773ecbd445d958e45a22e4b76b68c3f",
"score": "0.71515983",
"text": "def start_of_quarter\n \n year = self.strftime('%Y').to_i\n current_month = self.strftime('%m').to_i\n \n month = 1\n 1.step(13, 3) do |m|\n break if m > current_month\n month = m\n end\n \n Date.new(year, month, 1)\n \n end",
"title": ""
},
{
"docid": "5ca6cbcc0aeb4951c097b7d931df2c5b",
"score": "0.71234226",
"text": "def start_of_quarter(year, quarter)\n date_calc.start_of_quarter(year, quarter)\n end",
"title": ""
},
{
"docid": "26b970b2e3532d8a7592a67a79eb0ef7",
"score": "0.7114245",
"text": "def quarter\n (month / 3.0).ceil\n end",
"title": ""
},
{
"docid": "67abb53823038a29f176f433a6e3ed9f",
"score": "0.7083698",
"text": "def quarter\n (month / 3.0).ceil\n end",
"title": ""
},
{
"docid": "29dbcfd415cb2b9fd99a8e7570eebde8",
"score": "0.69504476",
"text": "def quarter_wind; end",
"title": ""
},
{
"docid": "a9cb4ea91d2f92a547dd0b0336adbf24",
"score": "0.68402857",
"text": "def all_quarter\n beginning_of_quarter..end_of_quarter\n end",
"title": ""
},
{
"docid": "e7f6cb26f6ae2cb7fd86236a0296d501",
"score": "0.66359264",
"text": "def match_quarter\n @quarter ? { 'fiscal_quarter_id' => /#{@quarter}/i } : {}\n end",
"title": ""
},
{
"docid": "51b37471e7b23707f384a6958636a483",
"score": "0.65599215",
"text": "def current_quarter_months(date)\n quarters = [1,2,3,4]\n quarters[(date.month - 1) / 3]\n end",
"title": ""
},
{
"docid": "d0fdc6bd2ae58e89d16db0fa77685c3a",
"score": "0.64479274",
"text": "def quarter\n puts 'Dispensed quarter'\n end",
"title": ""
},
{
"docid": "d0fdc6bd2ae58e89d16db0fa77685c3a",
"score": "0.64479274",
"text": "def quarter\n puts 'Dispensed quarter'\n end",
"title": ""
},
{
"docid": "cdf1a43881b8ca0f4fb760e33771df2e",
"score": "0.6443756",
"text": "def quarters_since(date)\n\t\t\t(months_since(date) / 3).to_i\n\t\tend",
"title": ""
},
{
"docid": "e8062d83793dd112ec22434e832bedaf",
"score": "0.64373714",
"text": "def beginning_of_quarter\n first_quarter_month = month - (2 + month) % 3\n beginning_of_month.change(month: first_quarter_month)\n end",
"title": ""
},
{
"docid": "15c76fd5d60ff096974fd5fc7084952c",
"score": "0.64329845",
"text": "def current_quarter?\n self == Quarter.current_quarter\n end",
"title": ""
},
{
"docid": "5c309e2fb376fb9f18ce8093d10f7b25",
"score": "0.64317477",
"text": "def end_of_quarter(year, quarter)\n date_calc.end_of_quarter(year, quarter)\n end",
"title": ""
},
{
"docid": "48171df85ec53204121aefd946e5755e",
"score": "0.64067155",
"text": "def nextQuarter( date )\n m = date.month;\n y = date.year;\n m += 3;\n if( m > 12 ) then\n m -= 12;\n y += 1;\n end;\n return Date.new( y, m, 1 );\nend",
"title": ""
},
{
"docid": "f2cb3a06f55e1a77697325a02da87141",
"score": "0.6377225",
"text": "def week; end",
"title": ""
},
{
"docid": "e03d37483fb52a9a225c9724f5cb88e9",
"score": "0.6367627",
"text": "def active_for_quarter?(quarter, unit=nil)\n active_quarters(unit).include? quarter\n end",
"title": ""
},
{
"docid": "9820bff3cf9df24b1ee649ce033f6098",
"score": "0.63460517",
"text": "def last_five_quarters\n period.to_quarter_period.value.downto(4)\n end",
"title": ""
},
{
"docid": "9820bff3cf9df24b1ee649ce033f6098",
"score": "0.63460517",
"text": "def last_five_quarters\n period.to_quarter_period.value.downto(4)\n end",
"title": ""
},
{
"docid": "798cfeb4c1fc1b56a1e99210e58671bf",
"score": "0.6332228",
"text": "def lookup_quarter(x, y)\n return 1 if x >= 0 && y <= -1\n return 2 if x < 0 && y <= -1\n return 3 if x < 0 && y > -1\n return 4\n end",
"title": ""
},
{
"docid": "2236d1a92cd4a19ed0f4a990baf25124",
"score": "0.628648",
"text": "def startOfQuarter(d)\n\t\td = d.to_date\n\t\tif(d.month >= 2 && d.month <= 4)\n\t\t\treturn Date.new(d.year, 2, 1)\n\t\telsif(d.month >= 5 && d.month <= 7)\n\t\t\treturn Date.new(d.year, 5, 1)\n\t\telsif(d.month >= 8 && d.month <= 10)\n\t\t\treturn Date.new(d.year, 8, 1)\n\t\telsif(d.month == 11 || d.month == 12)\n\t\t\treturn Date.new(d.year, 11, 1)\n\t\telsif(d.month == 1)\n\t\t\treturn Date.new((d.year-1), 11, 1)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "bb42ee0e5994cdac7fd19a51c3259ce9",
"score": "0.6241492",
"text": "def beginning_of_week; end",
"title": ""
},
{
"docid": "bb42ee0e5994cdac7fd19a51c3259ce9",
"score": "0.6241492",
"text": "def beginning_of_week; end",
"title": ""
},
{
"docid": "15e4316dfbb31c0cc78b894826e15a95",
"score": "0.6207661",
"text": "def week\n @week ||= (((date-start_of_month)+1)/7.0).ceil\n end",
"title": ""
},
{
"docid": "77036d5035498b19a620393320cba4c6",
"score": "0.6200776",
"text": "def is_current_quarter(date)\n currentQuarter = ((Time.now.month - 1) / 3) + 1\n dateQuarter = current_quarter_months(date)\n dateQuarter.between?(currentQuarter, currentQuarter)\n end",
"title": ""
},
{
"docid": "8ab6376145556eeb34a9495981a75faa",
"score": "0.6195118",
"text": "def qnum(d)\n\t\td = d.to_date\n\t\tif(d.month >= 2 && d.month <= 4)\n\t\t\treturn 1\n\t\telsif(d.month >= 5 && d.month <= 7)\n\t\t\treturn 2\n\t\telsif(d.month >= 8 && d.month <= 10)\n\t\t\treturn 3\n\t\telse\n\t\t\treturn 4\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2b61d545191f9542281ff6f677d03743",
"score": "0.6164439",
"text": "def update_future_quarter\n # get the next quarter\n next_q = Quarter.quarter_after(self.quarter_id)\n next_es = ExpertSurvey.in_quarter(next_q.id) if next_q.present?\n if next_es.present?\n update_change_value(next_es, self)\n next_es.save\n end\n\n return true\n end",
"title": ""
},
{
"docid": "638c4b5679a97954146c9950092a366a",
"score": "0.616028",
"text": "def week\n self.range('week')\n end",
"title": ""
},
{
"docid": "e72a738c74d58857ecab696b5912a020",
"score": "0.61599994",
"text": "def current_week\n\t\t#TODO\n\tend",
"title": ""
},
{
"docid": "3b4e4a06eaa54cdce793e8e277bcd77a",
"score": "0.6125395",
"text": "def weeks() 7 * days end",
"title": ""
},
{
"docid": "8094c3cd8de522575bcf4aee2e78396a",
"score": "0.6121003",
"text": "def last_quarter\n return last_planned_quarter if any_planned_courses?\n return last_taken_quarter if any_taken_courses?\n nil\n end",
"title": ""
},
{
"docid": "9731d785404e2564aed1e7021c5f9434",
"score": "0.61080754",
"text": "def first_quarter\n return first_taken_quarter if any_taken_courses?\n return first_planned_quarter if any_planned_courses?\n nil\n end",
"title": ""
},
{
"docid": "3b04537dd8632c8115a7bc79380afd10",
"score": "0.6103682",
"text": "def quarterName\n qtrName = \"\"\n case self.enclaveQuarter\n when 1\n qtrName = \"First\"\n when 2\n qtrName = \"Second\"\n when 3\n qtrName = \"Third\"\n when 4\n qtrName = \"Fourth\"\n end\n qtrName\n end",
"title": ""
},
{
"docid": "ad859440ef562dedf40bb76b4223c995",
"score": "0.60926944",
"text": "def active_quarters(unit=nil)\n unless unit.nil?\n organization_quarters.for_unit(unit).collect{|oq| oq.quarter}\n else\n organization_quarters.collect{|oq| oq.quarter}\n end\n end",
"title": ""
},
{
"docid": "3718019ed9cc312a994ec00b6d375063",
"score": "0.6090188",
"text": "def weeks_in_year\n return (self-(self.yday-1)).wday == 6 && self.leap? ? 54 : 53\n end",
"title": ""
},
{
"docid": "e3962b4cd858f58eb9e19bfdeaa700ae",
"score": "0.6065556",
"text": "def quarter_wind_abbreviation; end",
"title": ""
},
{
"docid": "4ab3a39fc18802681629b3c884b4a806",
"score": "0.60529274",
"text": "def prevQuarter( date )\n m = date.month;\n y = date.year;\n m -= 3;\n if( m < 1 ) then\n m += 12;\n y -= 1;\n end;\n return Date.new( y, m, 1 );\nend",
"title": ""
},
{
"docid": "e3d9d33e5989e3a8469599a536bb1c11",
"score": "0.6050739",
"text": "def endOfQuarter(d)\n\t\td = d.to_date\n\t\tif(d.month >= 2 && d.month <= 4)\n\t\t\treturn Date.new(d.year, 4, 30)\n\t\telsif(d.month >= 5 && d.month <= 7)\n\t\t\treturn Date.new(d.year, 7, 31)\n\t\telsif(d.month >= 8 && d.month <= 10)\n\t\t\treturn Date.new(d.year, 10, 31)\n\t\telsif(d.month == 11 || d.month == 12)\n\t\t\treturn Date.new((d.year+1), 1, 31)\n\t\telsif(d.month == 1)\n\t\t\treturn Date.new(d.year, 1, 31)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "4b2b7066db59391f1a598d4e67feba61",
"score": "0.6046945",
"text": "def apply_function_quarter(scope, ast)\n scope, date = apply_ast(scope, ast.children.first)\n return scope, \"(date_part('quarter', #{date})::integer)\"\n end",
"title": ""
},
{
"docid": "6e7438cb27b688c13da4907f2ce4d2d1",
"score": "0.59854805",
"text": "def weeks ; self * 7.days ; end",
"title": ""
},
{
"docid": "ca3aee980aaef7c4d08bb3e7f6b26439",
"score": "0.59489965",
"text": "def mweek; (5 - wday + day) / 7 end",
"title": ""
},
{
"docid": "399722a69544c0ed5e00fdc558a9da16",
"score": "0.59330916",
"text": "def undergrad_during_quarter?(quarter = Quarter.current_quarter, valid_class_codes = [1,2,3,4,5])\n raise Exception.new(\"quarter cannot be nil\") if quarter.nil?\n valid_class_codes.include? class_standing(quarter)\n end",
"title": ""
},
{
"docid": "315d7e9621361ee504540c4c2f0532db",
"score": "0.5932694",
"text": "def end_of_quarter\n last_quarter_month = month + (12 - month) % 3\n beginning_of_month.change(month: last_quarter_month).end_of_month\n end",
"title": ""
},
{
"docid": "dd5b1a784620e42965d93492e2dcc2cc",
"score": "0.5892755",
"text": "def expected_hand_in\n if self[:end_date].nil?\n Time.now.strftime('%Y-%m-%d')\n else\n d = self[:end_date].to_time + 4.weeks\n d.strftime('%Y-%m-%d')\n end\n end",
"title": ""
},
{
"docid": "6587dbe2e86f00f9f06cb68f199c7bb4",
"score": "0.588714",
"text": "def reset_future_quarter\n # get the next quarter\n next_q = Quarter.quarter_after(self.quarter_id)\n next_es = ExpertSurvey.in_quarter(next_q.id) if next_q.present?\n if next_es.present?\n reset_change_value(next_es)\n next_es.save\n end\n\n return true\n end",
"title": ""
},
{
"docid": "db9bfb4f24e88444e782e044a55936a9",
"score": "0.58764255",
"text": "def current_week\n self.week.to_i\n end",
"title": ""
},
{
"docid": "600e28daf6532e657407de6b1cc5bc44",
"score": "0.5830624",
"text": "def quarter_hours\n partial_hours_from_minutes(minutes)\n end",
"title": ""
},
{
"docid": "19102eba1172b1ca614e4983e6f0607f",
"score": "0.5817459",
"text": "def year_week\n @year_week ||= (((date-start_of_year)+1)/7.0).ceil\n end",
"title": ""
},
{
"docid": "4842e6d54c09100b6510169b26ab0be6",
"score": "0.5806045",
"text": "def handle_q_s\n next_tag # Q\n @quarter = @tokens[@index].get_tag(Scalar).type\n @number = @quarter\n @index += 1\n @precision = :quarter\n @unit = :quarter\n end",
"title": ""
},
{
"docid": "a1041d651a10f722e8e04e3fdce196fe",
"score": "0.5790789",
"text": "def weeks\n self.to_i * 604_800\n end",
"title": ""
},
{
"docid": "fada7caff50dfe363610a1654b0ad99c",
"score": "0.5771601",
"text": "def start_of_week; self - wday.days end",
"title": ""
},
{
"docid": "e67811343f1d7e26f81b775d9befb93b",
"score": "0.57635254",
"text": "def weeks; self * WEEK; end",
"title": ""
},
{
"docid": "e67811343f1d7e26f81b775d9befb93b",
"score": "0.57635254",
"text": "def weeks; self * WEEK; end",
"title": ""
},
{
"docid": "923ffe5bdf7e230d693a6e3a87f7b1ff",
"score": "0.57435864",
"text": "def week_pattern\n year_weeks == 53 ? [5,4,5]+[4,4,5]*3 : [4,4,5]*4\n end",
"title": ""
},
{
"docid": "b797dd792040e49eaab6fa8e76832ed4",
"score": "0.5725095",
"text": "def next_week(x = 1)\n\t\tself + (604800 * x)\n\tend",
"title": ""
},
{
"docid": "583c22fd28b44a2597041e50b91c71d2",
"score": "0.57208914",
"text": "def beginning_of_week=(_arg0); end",
"title": ""
},
{
"docid": "583c22fd28b44a2597041e50b91c71d2",
"score": "0.57208914",
"text": "def beginning_of_week=(_arg0); end",
"title": ""
},
{
"docid": "3cabcc7af0fd43953ec2fa294622c089",
"score": "0.57128096",
"text": "def weeks ; Duration[self * 604800] ; end",
"title": ""
},
{
"docid": "1862534bc06ca1e5a68db0f05e08b434",
"score": "0.5703121",
"text": "def day_of_week\n\tif @current_time.wday == 0 || @current_time.wday == 6\n\t\tweek_period = \"Weekends\"\n\telse\n\t\tweek_period = \"Weekdays\"\n\tend\nend",
"title": ""
},
{
"docid": "f1903b95046c180b76c76a9e97642295",
"score": "0.57028335",
"text": "def start_week\n start_date.strftime('%W').to_i\n end",
"title": ""
},
{
"docid": "56cc1672df2e560ea8563f32bd52a846",
"score": "0.5698405",
"text": "def project(value)\n return value * 4 / line[:quarter]\n end",
"title": ""
},
{
"docid": "8a295f4202572d85fc8226006e176bb0",
"score": "0.5692736",
"text": "def weeks\n\t\treturn self * 7.days\n\tend",
"title": ""
},
{
"docid": "8a295f4202572d85fc8226006e176bb0",
"score": "0.5692736",
"text": "def weeks\n\t\treturn self * 7.days\n\tend",
"title": ""
},
{
"docid": "adf021f577d019a626955e99cc76fbc5",
"score": "0.5690492",
"text": "def week\n @obj.date.strftime(\"%V\")\n end",
"title": ""
},
{
"docid": "26d7a788fde6039a145e5f9dce7b7921",
"score": "0.56873447",
"text": "def set_headquarter\n @headquarter = Headquarter.joins(:country).find_by('countries.slug' => params[:country_id])\n end",
"title": ""
},
{
"docid": "15a9162b407591d02f573c5ec6817229",
"score": "0.5684794",
"text": "def use_quarters?\n term_system == \"Quarters\"\n end",
"title": ""
},
{
"docid": "07fd1c2df104a7377cbb3af34588e846",
"score": "0.5681317",
"text": "def week\n\t\t@@week\n\tend",
"title": ""
},
{
"docid": "61c610c71f4113c09324310008a26033",
"score": "0.5659414",
"text": "def fortnights ; self * 2.weeks ; end",
"title": ""
},
{
"docid": "f34880a0ee916dfcbead0f72460bb963",
"score": "0.56540173",
"text": "def current?\n (quarter_offered == Quarter.current_quarter) || (year_offered == Time.now.year)\n end",
"title": ""
},
{
"docid": "ec3b446d40bcacd7df8bed3c5606994e",
"score": "0.5653648",
"text": "def week\n @date.cweek\n end",
"title": ""
},
{
"docid": "943a3d0d71c5b5a2700dd02f7c1a1482",
"score": "0.5634812",
"text": "def last_week(x = 1)\n\t\tself - (604800 * x)\n\tend",
"title": ""
},
{
"docid": "8ffb1a6139bfefc28e982efcb5e16c3b",
"score": "0.5632392",
"text": "def select_current_week\n select_week_of Date.today\n end",
"title": ""
},
{
"docid": "39b28a9762a4402d1912bd4795dc2e9d",
"score": "0.5622922",
"text": "def beginning_of_fall_semester\n week = 4\n\n date = Chronic.parse(\"#{week}th thursday last august\")\n while date\n week += 1\n date = Chronic.parse(\"#{week}th thursday last august\")\n end\n\n Chronic.parse(\"#{week - 1}th thursday last august\").to_datetime\n end",
"title": ""
},
{
"docid": "f3ea16bef8b8c6ca17ba1ac0dbdb011d",
"score": "0.56225324",
"text": "def name () to_s unless quarter.blank? || year.blank? end",
"title": ""
},
{
"docid": "381638b86f0343b9ee1131e5a7ef28f3",
"score": "0.560916",
"text": "def is_last_quarter(date)\n lastQuarter = ((Time.now.month - 1) / 3)\n if lastQuarter == 0 \n lastQuarter = 4\n end\n dateQuarter = current_quarter_months(date)\n if (dateQuarter == 4) and (lastQuarter == 4)\n is_last_year(date)\n else\n (dateQuarter.between?(lastQuarter, lastQuarter)) and\n (is_current_year(date))\n end\n end",
"title": ""
},
{
"docid": "60a9979b102b0c79e286a0408a8db970",
"score": "0.5604021",
"text": "def current_week(current_day, current_month)\n @today = Time.now.strftime('%Y-%m-%d')\n if Chronic.parse(\"1st #{current_day} in #{current_month}\").strftime('%Y-%m-%d') == @today\n current_week = \"1st\"\n elsif Chronic.parse(\"2nd #{current_day} in #{current_month}\").strftime('%Y-%m-%d') == @today\n current_week = \"2nd\"\n elsif Chronic.parse(\"3rd #{current_day} in #{current_month}\").strftime('%Y-%m-%d') == @today\n current_week = \"3rd\"\n elsif Chronic.parse(\"4th #{current_day} in #{current_month}\").strftime('%Y-%m-%d') == @today\n current_week = \"4th\"\n else\n current_week = \"nil\"\n end\n end",
"title": ""
},
{
"docid": "859255959c2822c1de343137874fe1c7",
"score": "0.560321",
"text": "def end_of_week; self + (6 - wday).days end",
"title": ""
},
{
"docid": "4db0ed11122c21d554c8ace584586086",
"score": "0.55999804",
"text": "def week_calculations\n\t\t@first_of_month = @beg_range.to_date.beginning_of_month \n\t\t@last_of_month = @beg_range.to_date.beginning_of_month.next_month-1 \n\t\tif (@end_range+7).between?(@first_of_month, @last_of_month) \n\t\t\tif @beg_range.between?(@beg_range.prev_month.end_of_month, @beg_range.beginning_of_month+1) \n\t\t\t\t# <!--1st Week-->\n\t\t\t\t @prev_beg_range = @beg_range.prev_month.beginning_of_month + 4.weeks \n\t\t\t\t @prev_end_range = @end_range.prev_month.end_of_month \n\t\t\t\t\n\t\t\t\t @next_beg_range = @beg_range+7.days \n\t\t\t\t @next_end_range = @end_range+7.days \n\t\t\telse \n\t\t\t\t# <!--Middle Weeks-->\n\t\t\t\t @prev_beg_range = @beg_range-7.days \n\t\t\t\t @prev_end_range = @end_range-7.days \n\t\t\t\t\n\t\t\t\t @next_beg_range = @beg_range+7.days \n\t\t\t\t @next_end_range = @end_range+7.days \n\t\t\tend \n\t\telsif \n\t\t\tif @beg_range.next_week.beginning_of_week.between?(@first_of_month, @last_of_month) \n\t\t\t\t# <!--4th Week-->\n\t\t\t\t @prev_beg_range = @beg_range-7.days \n\t\t\t\t @prev_end_range = @end_range-7.days \n\t\t\t\t\n\t\t\t\t @next_beg_range = @beg_range+7.days \n\t\t\t\t @next_end_range = @end_range.end_of_month \t\t\n\t\t\telse \n\t\t\t\t# <!--5th Week-->\n\t\t\t\t @prev_beg_range = @beg_range-7.days \n\t\t\t\t @prev_end_range = @end_range-2.days \n\t\t\t\t\n\t\t\t\t @next_beg_range = @beg_range.next_month.beginning_of_month \n\t\t\t\t @next_end_range = @end_range.next_week.beginning_of_month+6.days \n\t\t\tend \n\t\tend \n\tend",
"title": ""
},
{
"docid": "a2f649ed99889068113babfa173e42dd",
"score": "0.55884784",
"text": "def next\n next_qtr_code = quarter_code_id == 4 ? 1 : quarter_code_id + 1\n next_year = quarter_code_id == 4 ? year + 1 : year\n Quarter.find_easily(next_qtr_code, next_year)\n end",
"title": ""
},
{
"docid": "9f4176a86abc7e1e325743b6608153bc",
"score": "0.5580544",
"text": "def current_week\n return get_current_week_from_weeks(Week.where(year: Date.today.year)\n .order(:number))\n end",
"title": ""
},
{
"docid": "ca63a6344b2e445b698ec09e1f64f8da",
"score": "0.556365",
"text": "def set_change_values\n # get the previous quarter\n prev_q = Quarter.quarter_before(self.quarter_id)\n prev_es = ExpertSurvey.in_quarter(prev_q.id) if prev_q.present?\n compute_change_values(self, prev_es)\n\n return true\n end",
"title": ""
},
{
"docid": "62a43c8a1771839d98ece72ee68590fe",
"score": "0.55477655",
"text": "def week\n self.date ? self.date.strftime('%Y-%W') : ('0000-00')\n end",
"title": ""
},
{
"docid": "79723d18e88f74f048799677f037838f",
"score": "0.5537858",
"text": "def cweek\n end",
"title": ""
},
{
"docid": "9ddbe6717894fc50594e0dc22af71933",
"score": "0.55361044",
"text": "def week\n working_date = DateTime.new(self.year, 1, 1)\n working_date.week_day_start = self.week_day_start\n working_date = (working_date-working_date.send(\"wday_offset\"))\n week_num = 0\n working_date.step(self) { |a_day| \n if a_day.wday == _week_day_numbers.first\n week_num += 1\n end\n }\n week_num\n end",
"title": ""
},
{
"docid": "d903c779879d1b5cf4c547b0d226e6ba",
"score": "0.55195874",
"text": "def get_quarterly\n # get last year earnings\n l_year = latest_eps.year\n\n # get which quarters are the last 4\n fp = doc.xpath('//tr').detect{ |tr| tr.xpath('./td').first != nil && tr.xpath('./td').first['title'] == \"Fiscal Period\" }\n fp = fp.xpath('./td') if fp\n\n if fp.nil?\n puts \"--------------------------------------Cannot get info for #{ticker}\"\n return false\n end\n # Find last year by counting 'td's up to \"TMM\"\n years_available = 0 # Some stocks may not have 10 years worth of data\n for i in 1..fp.size\n if fp[i].nil? || !fp[i].text.match(\"TTM\").nil?\n break\n end\n years_available = i\n end\n\n puts \"Counted #{years_available} years of available data for #{ticker}\"\n\n update_year = 1 # Some stocks may not be updated for 2012 yet\n update_year = 0 if fp[years_available].text.last == \"2\"\n\n\n\n\n #Acces data page\n url = \"http://www.gurufocus.com/financials/#{ticker}\"\n doc = open_url_or_nil(url)\n if doc.nil?\n puts \"Could not get quarterly finantial data from gurufocus.com\"\n return false\n end\n\n # Get last 4 quarters quarterly data\n # Check first if all 4 quarters are available?\n (1..4).each do |i|\n if fp[i].nil? || !fp[i].text.match(\"TTM\").nil?\n break\n end\n years_available = i\n end\n\n puts \"Counted #{years_available} years of available data for #{ticker}\"\n\n update_year = 1 # Some stocks may not be updated for 2012 yet\n update_year = 0 if fp[years_available].text.last == \"2\"\n\n # A boolean to test if current asset values are available\n using_current_data = true\n\n # Scrape data from doc\n # Current Assets\n ca = doc.xpath('//tr').detect{ |tr| tr.xpath('./td').first != nil && tr.xpath('./td').first['title'] == \"Total Current Assets\" }\n if ca\n ca = ca.xpath('./td')\n else\n using_current_data = false\n end\n\n ta = doc.xpath('//tr').detect{ |tr| tr.xpath('./td').first != nil && tr.xpath('./td').first['title'] == \"Total Assets\" }\n ta = ta.xpath('./td') if ta\n\n cl = doc.xpath('//tr').detect{ |tr| tr.xpath('./td').first != nil && tr.xpath('./td').first['title'] == \"Total Current Liabilities\" }\n if cl\n cl = cl.xpath('./td')\n else\n using_current_data = false\n end\n\n tl = doc.xpath('//tr').detect{ |tr| tr.xpath('./td').first != nil && tr.xpath('./td').first['title'] == \"Total Liabilities\" }\n tl = tl.xpath('./td') if tl\n\n # Debt, book value, net tangible assets\n ltd = doc.xpath('//tr').detect{ |tr| tr.xpath('./td').first != nil && tr.xpath('./td').first['title'] == \"Long-Term Debt\" }\n ltd = ltd.xpath('./td') if ltd\n\n bv = doc.xpath('//tr').detect{ |tr| tr.xpath('./td').first != nil && tr.xpath('./td').first['title'] == \"Total Equity\" }\n bv = bv.xpath('./td') if bv\n\n ocs = doc.xpath('//tr').detect{ |tr| tr.xpath('./td').first != nil && tr.xpath('./td').first['title'] == \"Other Current Assets\" }\n ocs = ocs.xpath('./td') if ocs\n\n # Create balance sheet for 10 years\n (1..years_available).each do |i|\n cas = \"\"\n cls = \"\"\n ntas = \"\"\n if using_current_data\n cas = (clean_string(ca[i].text).to_f.round * MILLION).to_s\n cls = (clean_string(cl[i].text).to_f.round * MILLION).to_s\n if ocs\n ntas = (( clean_string(ca[i].text).to_f - clean_string(ocs[i].text).to_f - clean_string(cl[i].text).to_f ).round * MILLION ).to_s\n else\n ntas = cas\n end\n end\n\n # Some trusts don't have liabilities\n tler = \"\"\n tler = (clean_string(tl[i].text).to_f.round * MILLION).to_s if tl\n der = \"\"\n der = (clean_string(ltd[i].text).to_f.round * MILLION).to_s if ltd\n bver = \"\"\n bver = (clean_string(bv[i].text).to_f.round * MILLION).to_s if bv\n bs = BalanceSheet.create(:stock_id => self.id,\n :year => YEAR - (years_available+1 - i) - update_year, #This reveses the year from i\n :current_assets => cas,\n :total_assets => (clean_string(ta[i].text).to_f.round * MILLION).to_s,\n :current_liabilities => cls,\n :total_liabilities => tler,\n :long_term_debt => der,\n :net_tangible_assets => ntas,\n :book_value => bver,\n :quarter => q)\n puts \"Got bs data for #{ticker}, year: #{bs.year}, ta = #{bs.total_assets}\" if !bs.id.nil?\n end\n\n update_attributes( :has_currant_ratio => using_current_data)\n\n end",
"title": ""
},
{
"docid": "b913d934837410deb49a31e9d00d7b52",
"score": "0.5512821",
"text": "def select_week_of date\n monday = date - date.wday + 1\n friday = monday + 4\n select_range(monday, friday)\n end",
"title": ""
},
{
"docid": "d84818c849e62453755027d03e8d6770",
"score": "0.550045",
"text": "def week_matches? date\n\t if @unit == :weeks \n \t return true if @frequency == 1\n \t return ((Recurring.week_of_year(date) - Recurring.week_of_year(@anchor)) % @frequency) == 0\n \tend\n \tif @weeks\n \t @weeks.include?(Recurring.nth_instance_of_day_in_month(date)) || @weeks.include?(Recurring.nth_negative_instance_of_day_in_month(date))\n \telse\n \t true\n \tend\n end",
"title": ""
},
{
"docid": "814d867272b7b8cec674a181e2a5ad26",
"score": "0.5499999",
"text": "def last_active_quarter\n organization_quarters.with_students_placed.sort.first\n end",
"title": ""
},
{
"docid": "a1ee0e00c5106f2b2c307043e61544a7",
"score": "0.54912275",
"text": "def inspect\n \"it is the \" + ordinal_list(@weeks) + \" week of the month\"\n end",
"title": ""
},
{
"docid": "7e8dbe0bb2166160790044f952eacd6e",
"score": "0.549007",
"text": "def iso_weeks_in_year(wkst)\n iso_year, week_one_start = *iso_year_and_week_one_start(wkst)\n probe_date = week_one_start + (7*52)\n if probe_date.iso_year(wkst) == iso_year\n 53\n else\n 52\n end\n end",
"title": ""
},
{
"docid": "1616b1b4d8d8398f86df17d5e48e34a9",
"score": "0.54857785",
"text": "def currentQuarter\n value = nil\n sql = ActiveRecord::Base.connection();\n #value, dummy = sql.execute(\"SELECT MAX(enclaveQuarter), 0 FROM enclavequarters WHERE enclaveYear = #{self.currentYear}\").fetch_row\n value = sql.select_value(\"SELECT MAX(enclaveQuarter) FROM enclavequarters WHERE enclaveYear = #{self.currentYear}\")\n value\n end",
"title": ""
},
{
"docid": "0d189e6c64a80f37e6a42a3388eae450",
"score": "0.547939",
"text": "def title\n alternate_title.blank? ? quarter.title : alternate_title\n end",
"title": ""
},
{
"docid": "29c9eae90d8a2db1ff94ba57a5c9d5aa",
"score": "0.54693204",
"text": "def quality_driven_software_export\n @from = Time.zone.now - 1.week\n @to = Time.zone.now\n end",
"title": ""
},
{
"docid": "c6ec0625b5e70b092c3c22b24098e609",
"score": "0.5462839",
"text": "def current_week\n week_split.select { |c| c.include?(day) }.flatten\n end",
"title": ""
},
{
"docid": "35c50717b7e2af89bcfc12ca4e2fb41e",
"score": "0.546088",
"text": "def beginning_of_week\n (self - self.wday.days).midnight + 1.day\n end",
"title": ""
},
{
"docid": "4f0b0b6d57fd0cf7a2a21aaa19d9795f",
"score": "0.54546994",
"text": "def ending_of_week\n if current_week.index(day) == 6\n self.class.new(year, month, current_week.last)\n elsif current_week.index(day) < 6\n if self.class == Date\n self + (6 - current_week.index(day))\n elsif self.class == Time\n self + (60 * 60 * 24 * (6 - current_week.index(day)))\n end\n end\n end",
"title": ""
},
{
"docid": "9f3e4cb595fad24413c0d49eac1237ce",
"score": "0.5449763",
"text": "def quarter_name=(quarter)\n self.quarter = Quarter.find_or_initialize_by_name(quarter)\n end",
"title": ""
},
{
"docid": "fd549bc770002b91cc0c822d4cd5aea8",
"score": "0.5443791",
"text": "def wday() end",
"title": ""
},
{
"docid": "d0321e19d9b776a160e74011e2a1d09c",
"score": "0.54429233",
"text": "def this(day)\n if dayindex == day #today\n x_weeks_from_day(1, day)\n else\n x_weeks_from_day(0, day)\n end\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "bceac24d7e022e53c3ea3bc7a6c3d7dc",
"score": "0.0",
"text": "def game_params\n params.require(:game).permit(:game_title)\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": ""
}
] |
4054a3dcb4c47672ebd9623e333b369c
|
Lookup objects in hash.
|
[
{
"docid": "a108d551cd7d8d9fa42c9788a76a9451",
"score": "0.0",
"text": "def lookup(one_object, other_object)\n if ELUCIDATABLE_CLASSES.include?(one_object.class)\n if other_object.kind_of?(one_object.class)\n return METHOD_FOR_CLASS.fetch(one_object.class)\n end\n end\n nil\n end",
"title": ""
}
] |
[
{
"docid": "6331dea1859030127764463dc417fca7",
"score": "0.6625857",
"text": "def find_by(hash)\n # firebase does not have complex querying\n # so we have to grab all objects satisfying\n # first key/value\n init_key, init_value = hash.shift\n firebase_response = firebase_request :get,\n firebase_model,\n orderBy: \"\\\"#{init_key}\\\"\",\n equalTo: encode_init_value(init_value)\n\n # we then filter the remaining key/values with ruby\n hash.each do |key, value|\n firebase_response = firebase_response.select do |_firebase_key, firebase_hash|\n firebase_hash[key.to_s] == value\n end\n end\n\n firebase_hashes_array = normalize_firebase_hashes(firebase_response)\n\n firebase_hashes_array.map { |hash_item| create_firebase_object(hash_item) }\n end",
"title": ""
},
{
"docid": "bb006e6b80c16e6027e16ff4d4a0a4c0",
"score": "0.6445076",
"text": "def lookup(key=nil)\n silo = self.lookup_silo_name\n dict = nil\n ActiveRecord::Base.benchmark(\"Lookup: #{silo}#{key.ergo{'#'+to_s}}\") do\n dict = self.fetch_object(silo){\n # FIXME Exceptions within this block are silently swallowed by something. This is bad.\n self.find(:all, self.lookup_opts).inject(Dictionary.new){|s,v| s[v.send(self.lookup_key)] = v; s}\n }\n end\n return key ? dict[key.with{kind_of?(Symbol) ? to_s : self}] : (dict.values || [])\n end",
"title": ""
},
{
"docid": "503320a3225e47293f6c8370ccc99ead",
"score": "0.63076097",
"text": "def lookup(id)\n\t\t@objects[id]\n\tend",
"title": ""
},
{
"docid": "5930761249ad935482b7956d18120e62",
"score": "0.62366605",
"text": "def lookups; end",
"title": ""
},
{
"docid": "f724bee770fddcfc3eb154fcae97f12d",
"score": "0.61642146",
"text": "def find_in_hash(hash, where)\n what = hash\n where.each do |x|\n return nil unless what.is_a?(Hash)\n what = what[x]\n end\n\n what\n end",
"title": ""
},
{
"docid": "6d871fddc548d666b0381268f29edcc6",
"score": "0.60393476",
"text": "def resolve_in(hash, *where)\n find_in_hash(hash, [:properties] + where) ||\n find_in_hash(hash, where)\n end",
"title": ""
},
{
"docid": "cae692af166826af3517df329c9d88c8",
"score": "0.5960283",
"text": "def keys\n\t\t\treturn @lookup\n\t\tend",
"title": ""
},
{
"docid": "9862735437b9dc36163e06cca64ce15d",
"score": "0.594043",
"text": "def find_in_object(obj, key, singleton: true)\n assert_respond_to(obj, :fetch)\n\n default = singleton ? nil : []\n result = obj.fetch(key.to_s, default)\n singleton ? Wgit::Utils.process_str(result) : Wgit::Utils.process_arr(result)\n\n if block_given?\n new_result = yield(result, :object)\n result = new_result if new_result\n end\n\n result\n end",
"title": ""
},
{
"docid": "a2f5cb0a884c4857b8b826a020f93d88",
"score": "0.5939915",
"text": "def lookup(obj, pos); end",
"title": ""
},
{
"docid": "a576cf822e46c98646baef1eb0ae950a",
"score": "0.5863506",
"text": "def lookup_objects(keys, type, scope, order_override, _resolution_type)\n setup_context(scope, order_override)\n @connect.lookup_objects(keys, type)\n end",
"title": ""
},
{
"docid": "5251291fcb4b21005401da0be9a97a9a",
"score": "0.5846503",
"text": "def find(id)\n @candidates.find {|h| h[:id] == id}\nend",
"title": ""
},
{
"docid": "709a77303f290e9833d385a2cac35df2",
"score": "0.58241427",
"text": "def my_hash_finding_method(source, thing_to_find)\n answer = Hash.new\n source.each do |key, value|\n if value == thing_to_find\n answer.store(key, value)\n end\n end\n p answer.keys\nend",
"title": ""
},
{
"docid": "8ebc15563fb01ee7a0ebc8d68a28a0fb",
"score": "0.5820046",
"text": "def find hash\n field, value = hash.first\n if index(field).unique\n if id = redis.get(colon(name, field, value))\n new id\n end\n else\n raise \"no unique index on #{field}\"\n end\n end",
"title": ""
},
{
"docid": "5b88c19864d35b244ba3337ec6cb3e24",
"score": "0.5812503",
"text": "def find_all *keys\n ensure_service!\n lookup_res = service.lookup(*Array(keys).flatten.map(&:to_grpc),\n transaction: @id)\n LookupResults.from_grpc lookup_res, service, nil, @id\n end",
"title": ""
},
{
"docid": "454425362c4ca93f6a19c2e0e847ab9e",
"score": "0.5809295",
"text": "def lookup(obj, pos)\n @cache[pos][obj.object_id] \n end",
"title": ""
},
{
"docid": "21d12895bf8a16e36aac800ccf33b8f7",
"score": "0.5766236",
"text": "def lookup(item)\n fingerprint = fingerprint(item)\n first_index = hash(item)\n second_index = alt_index(first_index, fingerprint)\n\n @buckets[first_index].contains?(fingerprint) || @buckets[second_index].contains?(fingerprint)\n end",
"title": ""
},
{
"docid": "30ac91755d9be4af60536810f0ab040e",
"score": "0.5747963",
"text": "def my_hash_finding_method(source, thing_to_find)\n output_array = []\n i = 0\n source.each_pair { |key,value|\n if value == thing_to_find\n output_array[i] = key\n i += 1\n end\n }\n return output_array\nend",
"title": ""
},
{
"docid": "ae471ed7dd2ba9241420dfc652c415fa",
"score": "0.5742751",
"text": "def find_rows_for(hash_hashes_object_or_objects)\n do_find_or_create(hash_hashes_object_or_objects, false)\n end",
"title": ""
},
{
"docid": "f9c6eadd0a769eb10392eb8ba2f3baf0",
"score": "0.57237875",
"text": "def hgetall(key); end",
"title": ""
},
{
"docid": "f9c6eadd0a769eb10392eb8ba2f3baf0",
"score": "0.57237875",
"text": "def hgetall(key); end",
"title": ""
},
{
"docid": "bf62c3942cf6ee6de3f7a37ca70261ab",
"score": "0.57202935",
"text": "def total_hash_search(hash_to_find=@hash_to_find, stop_on_success=@sos, verbose=true)\n matches={}\n while(true)\n case @hash_type\n when 'MD4'\n result = leakdb_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('api.leakdb.abusix.com', result)\n break if stop_on_success\n end\n when 'MD5'\n result = leakdb_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('api.leakdb.abusix.com', result)\n break if stop_on_success\n end\n\n result = darkbyte_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('md5.darkbyte.ru', result)\n break if stop_on_success\n end\n\n result = gromweb_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('md5.gromweb.com', result)\n break if stop_on_success\n end\n\n result = md5comcn_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('md5.com.cn', result)\n break if stop_on_success\n end\n\n result = md5onlinenet_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('md5online.net', result)\n break if stop_on_success\n end\n\n result = md5onlineorg_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('md5online.org', result)\n break if stop_on_success\n end\n\n result = myaddr_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('md5.my-addr.com', result)\n break if stop_on_success\n end\n\n result = noisette_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('md5.noisette.ch', result)\n break if stop_on_success\n end\n\n result = netmd5crack_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('netmd5crack.com', result)\n break if stop_on_success\n end\n\n result = sans_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('isc.sans.edu', result)\n break if stop_on_success\n end\n\n result = stringfunction_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('stringfunction.com', result)\n break if stop_on_success\n end\n when 'LM'\n result = it64_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('rainbowtables.it64.com', result)\n break if stop_on_success\n end\n\n result = leakdb_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('api.leakdb.abusix.com', result)\n break if stop_on_success\n end\n when 'NTLM'\n result = leakdb_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('api.leakdb.abusix.com', result)\n break if stop_on_success\n end\n when 'LM:NTLM'\n result = leakdb_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('api.leakdb.abusix.com', result)\n break if stop_on_success\n end\n when 'MYSQL'\n result = leakdb_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('api.leakdb.abusix.com', result)\n break if stop_on_success\n end\n when 'SHA1'\n result = leakdb_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('api.leakdb.abusix.com', result)\n break if stop_on_success\n end\n\n result = sans_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('isc.sans.edu', result)\n break if stop_on_success\n end\n\n result = stringfunction_hash_search(hash_to_find, verbose)\n if not result.nil?\n matches.store('stringfunction.com', result)\n break if stop_on_success\n end\n end\n break # tried all sites by now...\n end\n return matches\n end",
"title": ""
},
{
"docid": "075c145db3227b23d1655585c599532e",
"score": "0.569468",
"text": "def find_value hash\n @values_mapping[hash]\n end",
"title": ""
},
{
"docid": "24bb5cfc925ba015a9de58090ea727a0",
"score": "0.5691827",
"text": "def hgetall(hash)\n redis_token.hgetall(hash)\n end",
"title": ""
},
{
"docid": "2b7c81bceb2ea4f90cd36107faa2375f",
"score": "0.56908953",
"text": "def find(id)\n@candidates.detect {|candidate| candidate[:id] == id}\nend",
"title": ""
},
{
"docid": "dd4351f7bcb61c91d8ff8e9269e59eea",
"score": "0.5670219",
"text": "def find_by(lookup)\n resource, attribute = lookup.keys[0].to_s.split('_')\n lookup_value = lookup.values[0]\n @@transactions.select { |transaction| transaction.send(resource).send(attribute) == lookup_value }\n end",
"title": ""
},
{
"docid": "4a7a969b06f34ae53fb83374ecce361c",
"score": "0.56498975",
"text": "def find(id)\n @candidates.select{|candidate| candidate[:id] === id }\n #return @candidates\n\nend",
"title": ""
},
{
"docid": "924929b9ff2134806301bdafd6599811",
"score": "0.5649473",
"text": "def find(id)\n @candidates.detect {|candidates| candidate[:id] == id}\nend",
"title": ""
},
{
"docid": "9c3fa9882532c78561e7d43cd73b0564",
"score": "0.5622945",
"text": "def hmget(hash, *fields)\n redis_token.hmget(hash, *fields)\n end",
"title": ""
},
{
"docid": "3eeb9df1921d5943597253504f72422a",
"score": "0.5621832",
"text": "def find(*args)\n raise ArgumentError unless args[0].is_a?(Hash)\n r = []\n # If args[0] has ALL of the class keys then look based on the key values\n # If args[0] does not have ALL of the class keys then drop to the table scan approach\n if args[0].has_keys?(keys)\n # If the keys of args are a subset of keys then look up by the key values\n key_record = records[build_key(args[0])]\n if key_record\n # Make sure the other elements of args[0] match the corresponding k/v pairs in key_record\n match = true\n args[0].each_pair do |k, v|\n match = false unless key_record[k] == v\n break unless match\n end\n r << key_record if match\n else\n # the record you are looking for isn't here, stop searching\n end\n else\n # look at each record in records individually - basically a table scan\n records.each_value do |record|\n match = true\n args[0].each do |k, v|\n match = false unless record.send(k) && record.send(k) == v\n break unless match\n end\n r << record if match\n end\n return r unless r.empty?\n nil\n end\n end",
"title": ""
},
{
"docid": "700a1f8bf12ce2bb1173a32dd8a9ebff",
"score": "0.56157655",
"text": "def search_objects\n @searches.keys.map { |k| @search_objects[k] }\n end",
"title": ""
},
{
"docid": "1959a4c3b28234a940bdc1ec2474d2b4",
"score": "0.56108624",
"text": "def fetch_hash!\n fetch0(Hash, true)\n end",
"title": ""
},
{
"docid": "b651649f1ecfb39573acf906e3877ff6",
"score": "0.5584051",
"text": "def fetch(*args)\n #if the key is an alias, lookup the real key\n args[0] = aliasing_hash_aliases[args.at(0)] if aliasing_hash_aliases.include?(args.at(0))\n \n super(*args)\n end",
"title": ""
},
{
"docid": "89e8bdc44274ba958569f8dbb85daef3",
"score": "0.5581681",
"text": "def find(id)\n found = nil\n @candidates.each do |candidate|\n if candidate[:id] == id\n found = candidate\n end\n end\n found\nend",
"title": ""
},
{
"docid": "b8286c5aba25217d7121ab47b2d40993",
"score": "0.5578121",
"text": "def my_hash_finding_method(source, thing_to_find)\n final_answer = source.select{|key, value| value == thing_to_find}\n p final_answer.keys\nend",
"title": ""
},
{
"docid": "b8286c5aba25217d7121ab47b2d40993",
"score": "0.5578121",
"text": "def my_hash_finding_method(source, thing_to_find)\n final_answer = source.select{|key, value| value == thing_to_find}\n p final_answer.keys\nend",
"title": ""
},
{
"docid": "84aa2406ab7ee4ad279608249cf39713",
"score": "0.5562317",
"text": "def find_entry_by_hash(hash)\n payload = db.get_entry_payload_from_hash(hash)\n return nil unless payload\n ChainEntry.parse_from_payload(payload)\n end",
"title": ""
},
{
"docid": "6399e1952889d8dda2d0eb94f48263a4",
"score": "0.55492574",
"text": "def get_lookup(name)\n @lookups = {} unless defined?(@lookups)\n @lookups[name] = spawn_lookup(name) unless @lookups.include?(name)\n @lookups[name]\n end",
"title": ""
},
{
"docid": "824761d0078793bafd3da9560dc5df8f",
"score": "0.5541716",
"text": "def my_hash_finding_method(source, thing_to_find)\n solution = source.select { |key, value| value == thing_to_find }\n solution.keys\nend",
"title": ""
},
{
"docid": "a556e300a3a093949f2cda5ed1f6fa38",
"score": "0.55221397",
"text": "def lookup\n @lock.with_read_lock do\n recalculate unless @options[:lookup]\n @lookup ||= @options[:lookup].map { |code| self.class.new(code) }.uniq\n end\n end",
"title": ""
},
{
"docid": "29916f0c3771fc6584ee8900af75c140",
"score": "0.5516858",
"text": "def find_ids_for(hash_hashes_object_or_objects)\n row_map_to_id_map(find_rows_for(hash_hashes_object_or_objects))\n end",
"title": ""
},
{
"docid": "94ab65ba59f86d310deff32323b8778d",
"score": "0.55078137",
"text": "def lookup(lookup_variants, _)\n # First found does not continue when a root key was found and a subkey wasn't since that would\n # simulate a hash merge\n lookup_variants.each { |lookup_variant| catch(:no_such_key) { return yield(lookup_variant) } }\n throw :no_such_key\n end",
"title": ""
},
{
"docid": "310dd97b4838d3ed92f2e8c71920b1e9",
"score": "0.550425",
"text": "def find_by_id(input, value)\n hash = nil\n input.each do |input|\n if input[:id] == value\n hash = input\n end\n end\n hash\nend",
"title": ""
},
{
"docid": "6d448a7061252e70e354e53ebc8b2841",
"score": "0.55002576",
"text": "def find_single_bay(hash,lookup)\n\n for key,value in hash\n\n if value[:item] == lookup\n return key \n end\n \n end\n #If gone all the way throuh the hash, no item\n #found so return nil\n return nil\nend",
"title": ""
},
{
"docid": "e4388d7948aae5639fde986d90b68300",
"score": "0.5495095",
"text": "def fetch(*args)\n hash.fetch(*args)\n end",
"title": ""
},
{
"docid": "b2d08a2684ca671a87cf9c4c0087cd8d",
"score": "0.5491379",
"text": "def find(id)\n @candidates.select { |candidate| candidate[:id] === id}\nend",
"title": ""
},
{
"docid": "422490329b4d9a1d4651048c314f0b45",
"score": "0.54875994",
"text": "def search_bin(entry,hash,key)\n while entry\n cur_hash, cur_key, cur_val, nxt = *entry\n\n if cur_hash == hash and key.eql?(cur_key)\n return entry\n end\n\n entry = nxt\n end\n return Undefined\n end",
"title": ""
},
{
"docid": "b1b17a4705398047accf446182427d89",
"score": "0.5482739",
"text": "def fetch_hash_all\n fetch_many0(nil, Hash)\n end",
"title": ""
},
{
"docid": "e1719d7a5aadbc7640fbaac873c15015",
"score": "0.5478783",
"text": "def find(id)\n @candidates.each do |item|\n if item[:id]==id\n @result = item\n end\n end\n @result\nend",
"title": ""
},
{
"docid": "3cce67980e7850c94c012e396a7fbd9f",
"score": "0.54707736",
"text": "def fetch_hash\n fetch0(Hash, false)\n end",
"title": ""
},
{
"docid": "d889202c045230e9cca4690ced4a9b67",
"score": "0.54687357",
"text": "def find(*ids)\n if Georeferencer.configuration.perform_caching && perform_object_caching != false\n ids.uniq!\n uncached_ids = ids.reject {|i| Georeferencer.configuration.cache.read(\"#{cache_key_base}/#{i}\").present?}\n [super(*uncached_ids)].flatten.reject(&:blank?).collect do |object|\n Georeferencer.configuration.logger.debug(\"Caching #{cache_key_base}/#{object.id}\")\n Georeferencer.configuration.cache.write(object.cache_key, object)\n end\n all_objects = ids.collect do |id|\n Georeferencer.configuration.cache.read(\"#{cache_key_base}/#{id}\")\n end\n\n all_objects.each {|o| o.run_callbacks(:find)}\n all_objects.length == 1 ? all_objects.first : all_objects\n else\n super\n end\n end",
"title": ""
},
{
"docid": "901e429861fec496a6b5c52253f88c82",
"score": "0.546207",
"text": "def find_single_item(hash,lookup)\n if hash[lookup]==nil\n return nil\n else\n return hash[lookup][:item]\n end\nend",
"title": ""
},
{
"docid": "af79852e1ed4f4a5198af2d077da887e",
"score": "0.5454487",
"text": "def my_hash_finding_method(source, thing_to_find)\n new_array = []\n source.map do |k, v|\n if v == thing_to_find\n new_array << k\n end\n end\n return new_array\nend",
"title": ""
},
{
"docid": "814c79a98e8040f91a8fc493c3821505",
"score": "0.5441598",
"text": "def my_hash_finding_method(my_family_pets_ages, thing_to_find)\n my_family_pets_ages.select{|name, age| age == thing_to_find}.keys #for each name/age pair in the my_family_pets_ages hash, see if age is equal to the thing_to_find. If it is, add the name/age pair to a new hash. Then, .keys returns a new array of all the keys in that new hash.\nend",
"title": ""
},
{
"docid": "3d03400762a1318da3d711ff62bb07a8",
"score": "0.54323757",
"text": "def lookup(name)\n all.lookup(name)\n end",
"title": ""
},
{
"docid": "9b7ce87c8fd62876a9e884b4d054d1aa",
"score": "0.54266816",
"text": "def find(id)\n @candidates.detect do |candidate|\n candidate[:id] === id\n end\nend",
"title": ""
},
{
"docid": "8ce6f802877d27c5f07458b1e7ae75e9",
"score": "0.5425309",
"text": "def my_hash_finding_method(source, thing_to_find)\n source.select! do|key, value|\n value == thing_to_find\n end\n return source.keys\nend",
"title": ""
},
{
"docid": "d5bd9035871353f211d59f516740aea4",
"score": "0.542424",
"text": "def find(id)\n @candidates.each do |candidate|\n return candidate if candidate[:id]==id\n end\n nil\nend",
"title": ""
},
{
"docid": "7d2e27719622acd7283398852f429a76",
"score": "0.5424222",
"text": "def __getobj__\n @hashobj\n end",
"title": ""
},
{
"docid": "88fe23f59904e72179f1eaef6bacdbcd",
"score": "0.5411547",
"text": "def my_hash_finding_method(source, thing_to_find)\n source.select {|k, v| v == thing_to_find}.keys\nend",
"title": ""
},
{
"docid": "bba06df25302967c68dde361d97f85ad",
"score": "0.5400097",
"text": "def insist!(type_class = (type_class_skipped = true; nil))\n\n\t\t\treturn @obj_with_keys if @lookup.empty?\n\t\t\t# Hashes can be accessed at [Object] of any kind\n\t\t\t# Structs can be accessed at [String] and [Symbol], and [Integer] for the nth member (or [Float] which rounds down)\n\t\t\t# Arrays can be accessed at [Integer] or [Float] which rounds down\n\n\t\t\tindex = 0\n\t\t\t# Will run at least twice, as:\n\t\t\t# Always runs once for @obj_with_keys itself\n\t\t\t# Then at least one more time because @lookup is not empty\n\t\t\treturn @lookup.inject(@obj_with_keys) { |deep_obj, this_key|\n\t\t\t\tlast_index = index >= @lookup.size - 1\n\n\t\t\t\t# this = object to be accessed\n\t\t\t\t# key = key to access on this\n\t\t\t\t# access = what kind of key is key\n\n\t\t\t\tkey = {\n\t\t\t\t\tthis: {\n\t\t\t\t\t\ttype: nil,\n\t\t\t\t\t\tvalue: this_key\n\t\t\t\t\t},\n\t\t\t\t\tnext: {\n\t\t\t\t\t\ttype: nil,\n\t\t\t\t\t\tvalue: last_index ? Keys::MISSING : @lookup[index + 1]\n\t\t\t\t\t},\n\t\t\t\t\tlast: {\n\t\t\t\t\t\ttype: nil,\n\t\t\t\t\t\tvalue: index == 0 ? Keys::MISSING : @lookup[index - 1]\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tkey.each { |pos, _|\n\t\t\t\t\tif Keys.index?(key[pos][:value])\n\t\t\t\t\t\tkey[pos][:type] = :index\n\t\t\t\t\t\tkey[pos][:max] = key[pos][:value].magnitude.floor + (key[pos][:value] <= -1 ? 0 : 1)\n\t\t\t\t\telse\n\t\t\t\t\t\tkey[pos][:type] = :object\n\t\t\t\t\t\tkey[pos][:type] = :string if key[pos][:value].is_a?(String)\n\t\t\t\t\t\tkey[pos][:type] = :symbol if key[pos][:value].is_a?(Symbol)\n\t\t\t\t\tend\n\t\t\t\t}\n\n\t\t\t\treconstruct = false\n\n\t\t\t\t# Ensure this object is a supported type - always true for index == 0 i.e. @obj_with_keys itself\n\t\t\t\tif !(deep_obj.respond_to?(:fetch) && deep_obj.respond_to?(:[]))\n\t\t\t\t\t# Not a supported type! e.g. a string\n\t\t\t\t\tif key[:this][:type] == :index\n\t\t\t\t\t\t# If we'll access an array here, re-embed the unsupported object in an array as [0 => original]\n\t\t\t\t\t\tdeep_obj = Array.new(key[:this][:max] - 1).unshift(deep_obj)\n\t\t\t\t\telse\n\t\t\t\t\t\t# Otherwise, embed the unsupported object in a hash with the key 0\n\t\t\t\t\t\tdeep_obj = {0 => deep_obj}\n\t\t\t\t\tend\n\t\t\t\t\t# Will never run on @obj_with_keys itself\n\t\t\t\t\treconstruct = true\n\t\t\t\telse\n\t\t\t\t\t# Supported type, but what if this doesn't accept that kind of key? Then...\n\n\t\t\t\t\t# \"You asked for it!\"(TM)\n\t\t\t\t\t# In a Struct, if accessing a member that doesn't exist, we'll replace the struct with a redefined anonymous one containing the members you wanted. This is dangerous but it's your fault.\n\t\t\t\t\tif deep_obj.is_a?(Struct)\n\t\t\t\t\t\tif key[:this][:type] == :string || key[:this][:type] == :symbol\n\t\t\t\t\t\t\tif !deep_obj.members.include?(key[:this][:value].to_sym)\n\t\t\t\t\t\t\t\t# You asked for it!\n\t\t\t\t\t\t\t\t# Add the member you requested\n\t\t\t\t\t\t\t\tnew_members = deep_obj.members.push(key[:this][:value].to_sym)\n\t\t\t\t\t\t\t\tdeep_obj = Struct.new(*new_members).new(*deep_obj.values)\n\t\t\t\t\t\t\t\treconstruct = true\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\telsif key[:this][:type] == :index\n\t\t\t\t\t\t\tif key[:this][:max] > deep_obj.size\n\t\t\t\t\t\t\t\t# You asked for it!\n\t\t\t\t\t\t\t\t# Create new numeric members up to key requested\n\t\t\t\t\t\t\t\tif key[:this][:value] <= -1\n\t\t\t\t\t\t\t\t\trange = 0..((key[:this][:max] - deep_obj.size) - 1)\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\trange = deep_obj.size..(key[:this][:max] - 1)\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\tnew_keys = (range).to_a.map { |num| num.to_s.to_sym }\n\t\t\t\t\t\t\t\t# Shove them in\n\t\t\t\t\t\t\t\tif key[:this][:value] <= -1\n\t\t\t\t\t\t\t\t\t# Prepend\n\t\t\t\t\t\t\t\t\tnew_members = new_keys.concat(deep_obj.members)\n\t\t\t\t\t\t\t\t\tnew_values = Array.new(new_keys.size - deep_obj.values.size, nil).concat(deep_obj.values)\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t# Append\n\t\t\t\t\t\t\t\t\tnew_members = deep_obj.members.concat(new_keys)\n\t\t\t\t\t\t\t\t\tnew_values = deep_obj.values\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\tdeep_obj = Struct.new(*new_members).new(*new_values)\n\t\t\t\t\t\t\t\treconstruct = true\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\t# \"You asked for it!\"(TM)\n\t\t\t\t\t# If accessing an array with a key that doesn't exist, we'll add elements to the array or change the array to a hash. This is dangerous but it's your fault.\n\t\t\t\t\tif deep_obj.is_a?(Array)\n\t\t\t\t\t\tif key[:this][:type] == :index\n\t\t\t\t\t\t\tif key[:this][:value] <= -1 && key[:this][:max] > deep_obj.size\n\t\t\t\t\t\t\t\t# You asked for it!\n\t\t\t\t\t\t\t\t# The only time an Array will break is if you try to set a negative key larger than the size of the array. In this case we'll prepend your array with nils.\n\t\t\t\t\t\t\t\tdeep_obj = Array.new(key[:this][:max] - deep_obj.size, nil).concat(deep_obj)\n\t\t\t\t\t\t\t\treconstruct = true\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t# You asked for it!\n\t\t\t\t\t\t\t# Trying to access non-numeric key on an array, so will convert the array into a hash with integer keys.\n\t\t\t\t\t\t\tdeep_obj = deep_obj.each_with_index.map { |v, index| [index, v] }.to_h\n\t\t\t\t\t\t\treconstruct = true\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\tend\n\n\t\t\t\tif reconstruct\n\t\t\t\t\t# Go back and reinject this altered value into the array\n\t\t\t\t\t@lookup[0...(index-1)].inject(@obj_with_keys) { |deep_obj2, this_key2|\n\t\t\t\t\t\tdeep_obj2[this_key2]\n\t\t\t\t\t}[key[:last][:value]] = deep_obj\n\t\t\t\tend\n\n\t\t\t\t# Does this object already have this key?\n\t\t\t\tif !deep_obj.dial[key[:this][:value]].set?\n\t\t\t\t\t# If not, create empty array/hash dependant on upcoming key\n\t\t\t\t\tif type_class_skipped\n\t\t\t\t\t\tif key[:next][:type] == :index\n\t\t\t\t\t\t\tif key[:next][:value] <= -1\n\t\t\t\t\t\t\t\t# Ensure new array big enough to address a negative key\n\t\t\t\t\t\t\t\tdeep_obj[key[:this][:value]] = Array.new(key[:next][:max])\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t# Otherwise, can just create an empty array\n\t\t\t\t\t\t\t\tdeep_obj[key[:this][:value]] = []\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t# Create an empty hash awaiting keys/values\n\t\t\t\t\t\t\tdeep_obj[key[:this][:value]] = {}\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\tif type_class == Array\n\t\t\t\t\t\t\tdeep_obj[key[:this][:value]] = []\n\t\t\t\t\t\telsif type_class == Hash\n\t\t\t\t\t\t\tdeep_obj[key[:this][:value]] = {}\n\t\t\t\t\t\telsif type_class == Struct\n\t\t\t\t\t\t\t# Why would you do this?\n\t\t\t\t\t\t\tdeep_obj[key[:this][:value]] = Coercion::Structs::EMPTY.dup\n\t\t\t\t\t\telsif type_class.is_a?(Class) && type_class < Struct\n\t\t\t\t\t\t\tdeep_obj[key[:this][:value]] = type_class.new\n\t\t\t\t\t\telsif type_class.respond_to?(:new)\n\t\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\t\tdeep_obj[key[:this][:value]] = type_class.new\n\t\t\t\t\t\t\trescue\n\t\t\t\t\t\t\t\tdeep_obj[key[:this][:value]] = nil\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdeep_obj[key[:this][:value]] = nil\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\telsif !type_class_skipped && last_index && !deep_obj[key[:this][:value]].is_a?(type_class)\n\t\t\t\t\t#Key already exists, but we must ensure it's of the right type\n\t\t\t\t\tif type_class == Array\n\t\t\t\t\t\tdeep_obj[key[:this][:value]] = Array.from(deep_obj[key[:this][:value]])\n\t\t\t\t\telsif type_class == Hash\n\t\t\t\t\t\tdeep_obj[key[:this][:value]] = Hash.from(deep_obj[key[:this][:value]])\n\t\t\t\t\telsif type_class == Struct\n\t\t\t\t\t\t# Why would you do this?\n\t\t\t\t\t\tdeep_obj[key[:this][:value]] = Struct.from(deep_obj[key[:this][:value]])\n\t\t\t\t\telsif type_class.is_a?(Class) && type_class < Struct\n\t\t\t\t\t\tdeep_obj[key[:this][:value]] = type_class.from(deep_obj[key[:this][:value]])\n\t\t\t\t\telsif type_class == String && deep_obj[key[:this][:value]].respond_to?(:to_s)\n\t\t\t\t\t\tdeep_obj[key[:this][:value]] = deep_obj[key[:this][:value]].to_s\n\t\t\t\t\telsif type_class == Symbol\n\t\t\t\t\t\tif deep_obj[key[:this][:value]].respond_to?(:to_sym)\n\t\t\t\t\t\t\tdeep_obj[key[:this][:value]] = deep_obj[key[:this][:value]].to_s\n\t\t\t\t\t\telsif deep_obj[key[:this][:value]].respond_to?(:to_s)\n\t\t\t\t\t\t\tdeep_obj[key[:this][:value]] = deep_obj[key[:this][:value]].to_s.to_sym\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\twarn \"Could not coerce value to #{type_class}\"\n\t\t\t\t\t\tend\n\t\t\t\t\telsif type_class.respond_to?(:new)\n\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\tdeep_obj[key[:this][:value]] = type_class.new\n\t\t\t\t\t\trescue\n\t\t\t\t\t\t\twarn \"Could not coerce value to #{type_class}\"\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\twarn \"Could not coerce value to #{type_class}\"\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\t# Quit if this is the penultimate or last iteration\n\t\t\t\t#next deep_obj if last_index\n\n\t\t\t\t# Increment index manually\n\t\t\t\tindex += 1\n\n\t\t\t\t# Before here, we must make sure we can access key on deep_obj\n\t\t\t\t# Return the value at this key for the next part of inject loop\n\t\t\t\tdeep_obj[key[:this][:value]]\n\n\t\t\t}\n\n\t\t\t# Final access (and set) of last key in the @lookup - by this point should be guaranteed to work!\n\t\t\t#if value_obj_skipped\n\t\t\t#\treturn obj_to_set[@lookup[-1]]\n\t\t\t#else\n\t\t\t#\treturn obj_to_set[@lookup[-1]] = value_obj\n\t\t\t#end\n\n\t\tend",
"title": ""
},
{
"docid": "8fc7685af004e090682d44707a2b8755",
"score": "0.5392577",
"text": "def find(id)\n # Your code Here\n @candidates.each do |candidate|\n if candidate[:id] == id\n return candidate\n end\n end\n nil\nend",
"title": ""
},
{
"docid": "e26c878d05d451cf7a226c34405f4764",
"score": "0.53654224",
"text": "def find(id)\n @candidates.each do |candidate|\n if id == candidate[:id] \n return candidate\n end\nend\n\n nil\nend",
"title": ""
},
{
"docid": "ea09fc6ae04c051265c3167747e58681",
"score": "0.5361822",
"text": "def find(id)\n @candidates.each do | candidate |\n if candidate[:id] == id\n return candidate \n end\n end\nend",
"title": ""
},
{
"docid": "d8d1f0d2bf90133077a64555f2ace6ee",
"score": "0.53579915",
"text": "def hashfind a,k,v\n f = []\n a.each do |e|\n f << e if e[k]==v\n end\n f\nend",
"title": ""
},
{
"docid": "3e3b989e59c909a78e144e047aa1c52f",
"score": "0.53565633",
"text": "def lookup_in_spotify \n perform_lookup\n parsed_response = HashWithIndifferentAccess.new @lookup_response.parsed_response \n set_base_attributes_by_lookup parsed_response\n end",
"title": ""
},
{
"docid": "814b4c57b8b002eea3a8f75796610acb",
"score": "0.5355464",
"text": "def find(id)\n @candidates.each do |candidate|\n return candidate if candidate[:id] == id\n end\n return nil\nend",
"title": ""
},
{
"docid": "79cc72b37ff7ac923370c07b412059b9",
"score": "0.53542256",
"text": "def find(id)\n @objects[id]\n end",
"title": ""
},
{
"docid": "97de9627cd56687232694bdc2d9f36ab",
"score": "0.5348494",
"text": "def lookup_local(md5_hash)\n # TODO: Implement local rainbow table lookup\n end",
"title": ""
},
{
"docid": "8134c6839d82e38e5e613beeeb78b96b",
"score": "0.53446627",
"text": "def find(id)\n\nreturn candidates.detect{|candidate| candidate[:id]==id }\n\nend",
"title": ""
},
{
"docid": "14fd739a92d5978076592a3512e6480e",
"score": "0.5337882",
"text": "def block_by_hash(_hsh)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "61a0776b3592b4fd0ab52e0bfb71eb90",
"score": "0.53368634",
"text": "def get(hash, *keys)\n eat = Mash.new\n hash.each_key {|k| eat[k]=hash[k] if keys.include?(k)}\n return eat\n end",
"title": ""
},
{
"docid": "17f07b8c8b179c8a8776bc5e31561476",
"score": "0.53353184",
"text": "def get(x)\r\n if (x.kind_of?(Hashable))\r\n # get the objects key\r\n pos = position(x) # get key\r\n found = @array[pos].get(x) # look in key\r\n if (found.to_s == nil)\r\n raise RuntimeError, \"Element does not exist\"\r\n else\r\n return found # returns object in hash table\r\n end\r\n else\r\n raise ArgumentError, \"Argument not of type Hashable\"\r\n end\r\n end",
"title": ""
},
{
"docid": "b24eca8b556cf4004f5eb935e8b8f5d4",
"score": "0.53319067",
"text": "def find(id)\n # Your code Here\n # puts \"you are looking for id: #{id}\"\n @candidates.each do |candidate|\n if candidate[:id] == id\n return candidate\n end\n end\n return nil\nend",
"title": ""
},
{
"docid": "95bd1d9a3c9f4e9821762baf565c51b8",
"score": "0.5322368",
"text": "def fetch(key); end",
"title": ""
},
{
"docid": "997fa7bd4b379f7d97dea13334754586",
"score": "0.5321933",
"text": "def lookup(lookup_variants, lookup_invocation)\n case lookup_variants.size\n when 0\n throw :no_such_key\n when 1\n merge_single(yield(lookup_variants[0]))\n else\n lookup_invocation.with(:merge, self) do\n result = lookup_variants.reduce(NOT_FOUND) do |memo, lookup_variant|\n not_found = true\n value = catch(:no_such_key) do\n v = yield(lookup_variant)\n not_found = false\n v\n end\n if not_found\n memo\n else\n memo.equal?(NOT_FOUND) ? convert_value(value) : merge(memo, value)\n end\n end\n throw :no_such_key if result == NOT_FOUND\n lookup_invocation.report_result(result)\n end\n end\n end",
"title": ""
},
{
"docid": "c1a93d9a483899824256951857f9ff84",
"score": "0.530934",
"text": "def do_find_or_create(hash_hashes_object_or_objects, do_create)\n # Input manipulation...\n input_to_complete_hash_map = map_input_to_complete_hashes(hash_hashes_object_or_objects)\n complete_hashes = input_to_complete_hash_map.values\n\n # Do the actual lookup in the cache.\n existing = rows_matching(complete_hashes)\n not_found = complete_hashes.reject { |h| existing[h].length > 0 }\n\n # See if there's something we still don't have and if we need to create it.\n if not_found.length > 0 && do_create\n # We actually pass in _all_ the rows we want here, rather than just the ones that aren't found yet. Why?\n # Under the covers, #flush_lock_and_create_rows_for! is at the heart of our transactional core -- it locks\n # the table and checks again for which rows are present. We want to give it all of the data required, so that,\n # once it acquires the exclusive table-level lock, it knows exactly which data it needs to ensure is present\n # in the table.\n #\n # Passing data acquired outside a transaction into a transaction that's supposed to act on it is just asking\n # for trouble.\n existing = flush_lock_and_create_rows_for!(complete_hashes)\n end\n\n # Output manipulation and validation.\n out = { }\n input_to_complete_hash_map.each do |input, complete_hash|\n values = existing[complete_hash]\n\n if values.length == 0 && do_create\n raise %{Whoa: we asked for a row for this hash: #{key.inspect};\nsince this has been asserted to be a complete key, we should only ever get back a single row,\nand we should always get back one row since we will have created the row if necessary,\nbut we got back these rows:\n\n#{values.inspect}}\n end\n\n out[input] = values[0]\n end\n\n if hash_hashes_object_or_objects.kind_of?(Array)\n out\n else\n out[out.keys.first]\n end\n end",
"title": ""
},
{
"docid": "572cbcf039a8a5931bbffc233292d2fd",
"score": "0.5308474",
"text": "def find(id)\n # Your code Here\n @candidates.each do |candidate|\n \tif candidate[:id] == id\n \t return candidate\n \tend\n end\n return nil\nend",
"title": ""
},
{
"docid": "45ef8be46ac815d3015bdc86144325bd",
"score": "0.5292616",
"text": "def func_find(hash)\n # Check and return the first object that satisfies either of the following properties:\n # 1. There is a [key, value] pair where the key and value are both Integers and the value is < 20\n # 2. There is a [key, value] pair where the key and value are both Strings and the value starts with `a`.\n hash.find do |key, value|\n if key.is_a?(Integer) && value.is_a?(Integer)\n return [key, value] if value < 20\n end\n\n if key.is_a?(String) && value.is_a?(String)\n return [key, value] if value[0].eql?('a')\n end\n\n []\n end\nend",
"title": ""
},
{
"docid": "215fd2eaacdfdb66b5814b992f4f1f0e",
"score": "0.52799696",
"text": "def inject(hash); end",
"title": ""
},
{
"docid": "460a665240631d3232b8f289e05b8aad",
"score": "0.52799344",
"text": "def load hash_id\n raise NotFoundError\n end",
"title": ""
},
{
"docid": "5eaac250e20a1ec406d309cc460743d5",
"score": "0.527872",
"text": "def lookups\n @rooms = Room.all\n @tracks = Track.all\n @time_slots = TimeSlot.all\n end",
"title": ""
},
{
"docid": "b8253598840654890af71670a89019e0",
"score": "0.5262911",
"text": "def find(id)\n @candidates.each do |candidate|\n if id == candidate[:id]\n candidate\n end\n end\n nil\nend",
"title": ""
},
{
"docid": "c4466396dfc9213f4a181342bfb34a25",
"score": "0.52612567",
"text": "def create_lookups( nodes )\n\t\t\treturn nodes.each_with_object( {} ) do |(identifier, node), hash|\n\t\t\t\tself.log.debug \"Creating lookup for node: %p\" % [ node ]\n\t\t\t\tname = node['name'] or next\n\t\t\t\trecord_type = node['record_type'] || 'A'\n\t\t\t\trecord_class = Resolv::DNS::Resource::IN.const_get( record_type ) or\n\t\t\t\t\traise \"Unsupported record type %p!\" % [ record_type ]\n\n\t\t\t\tself.log.debug \"Looking up %s record for %s (%s)\" % [ record_type, name, identifier ]\n\t\t\t\tthr = Thread.new do\n\t\t\t\t\tself.resolver.getresources( name, record_class )\n\t\t\t\tend\n\t\t\t\thash[ thr ] = identifier\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "1342df4594ed2c34a08be02e2efb6abf",
"score": "0.5259904",
"text": "def fetch(*key); end",
"title": ""
},
{
"docid": "d9e2ab74b1f30db5ad7b282990544869",
"score": "0.52529126",
"text": "def hash\n @hash.hash\n end",
"title": ""
},
{
"docid": "dd81542e830c9ec420ab7ef8599d3bc3",
"score": "0.5251823",
"text": "def generateSnakesLookup(snakes)\n snakesLookup = Hash.new\n \n # Process each of the snakes\n snakes.each do |snake|\n id = snake[\"id\"]\n health = snake[\"health_points\"]\n coords = snake[\"coords\"]\n \n snakeLookup = Snake.new(coords.length, health, coords)\n snakesLookup[id] = snakeLookup\n end\n \n return snakesLookup\nend",
"title": ""
},
{
"docid": "459dbcf77b9963552e5f2dddbe65f72f",
"score": "0.5246958",
"text": "def find(id)\n puts id\n @candidates.each do |c|\n if c[:id] == id\n puts c\n return c\n end\n end\nend",
"title": ""
},
{
"docid": "e9a80541349a82f7b956435f842de64b",
"score": "0.5246661",
"text": "def get_with(hash)\n\t\tcolumn = hash.keys.first\n\t\tcheck_column(column.to_s)\n\t\tvalue = hash[column]\n\n\t\tresult = find_with(hash)\n\t\tif(!result)\n\t\t\traise \"#{@table} does not contain an item where #{column.to_s} is\" + \n\t\t\t\t \" #{value}\"\n\t\tend\n\n\t\t@item_class.new(*result)\n\tend",
"title": ""
},
{
"docid": "d0ea9e3581276c9aa6b580aec5c575b7",
"score": "0.52392805",
"text": "def find_unique all_hash\n unique = []\n\n all_hash.each_pair do |full_name, cm|\n unique << cm if full_name == cm.full_name\n end\n\n unique\n end",
"title": ""
},
{
"docid": "31f3f41dbec389ba42fa383a389fd407",
"score": "0.5223012",
"text": "def objects(params=nil)\n params ? map.objects.find(params) : map.objects\n end",
"title": ""
},
{
"docid": "9504f80d4a98e5c02b859bc2ec75941f",
"score": "0.5222199",
"text": "def find(id)\n\t@candidates.detect { |candidate| candidate[:id] == id }\nend",
"title": ""
},
{
"docid": "86e3d5c1b6984186ec111dc4fe7584d0",
"score": "0.52191067",
"text": "def object_for_hash(given_hash)\n @opener.open(name, \"r\") do |fp|\n given_hash.force_encoding(\"ASCII-8BIT\") if given_hash.respond_to?(:force_encoding)\n entry = nil\n if index\n starting_at = index.offset_for_hash(given_hash)\n return PackFileEntry.at(starting_at, fp).to_raw_object\n else\n starting_at = cached_offset(given_hash) || DATA_START_OFFSET\n fp.seek(starting_at, IO::SEEK_SET)\n while fp.tell < @end_of_data\n entry = PackFileEntry.read(fp)\n cache_entry(entry)\n return entry.to_raw_object if entry.hash_id == given_hash\n end\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "9f5e04370ecebff258df4ede086f493f",
"score": "0.5218667",
"text": "def find(id)\n raise '@candidates must be an array' if @candidates.nil?\n @candidates.detect {|candidate| candidate[:id] == id}\n\nend",
"title": ""
},
{
"docid": "84d7dd778ff4cabd6b4c31ab88b44fbd",
"score": "0.5215542",
"text": "def find(id)\n @candidates.each do |candidate|\n return candidate if id == candidate[:id]\n end\n nil\nend",
"title": ""
},
{
"docid": "88412679fe2e9f395a016f3c87e18d26",
"score": "0.5210538",
"text": "def find(id)\n # Your code Here\n @candidates.each do |candidate|\n if id == candidate[:id]\n return candidate\n end\n end\n\n nil\nend",
"title": ""
},
{
"docid": "a79838b5e2e7b7aabecc42bb6d77a921",
"score": "0.5210147",
"text": "def fetch_data(hash, key)\n cur = hash\n key.split('.').each { |k| cur = (cur || {})[k] }\n cur\n end",
"title": ""
},
{
"docid": "4d6e813ee2cee3e211410db1d9ac3b7f",
"score": "0.5201459",
"text": "def map_by(key_name)\n if_contains_only_hash_objects\n self.map { |hash| hash[key_name] }\n end",
"title": ""
},
{
"docid": "5c0daf751a0b2cfb5ca6aed7d23d1290",
"score": "0.5200778",
"text": "def hash(key); end",
"title": ""
},
{
"docid": "f49e431d26b123dbe757498193dbc1d3",
"score": "0.5195522",
"text": "def cache_objects_keys\n @object_data[].keys\n end",
"title": ""
},
{
"docid": "3a17adbce0a90dba1a14d0b606721d52",
"score": "0.5195032",
"text": "def search(id, key)\n if list = __send__(id)\n val = list.fetch(key) {return nil}\n block_given? ? yield(val) : val\n end\n end",
"title": ""
},
{
"docid": "4f44692ce6e6d51173fe5fce91f2fc05",
"score": "0.5193837",
"text": "def find(hash)\n ret = []\n scrape_all(hash).select{|x| x[:status] == :success}.each do |match|\n _ret = match[:result]\n _ret.merge!({:tracker => match[:tracker]})\n ret << _ret\n end\n ret\n end",
"title": ""
}
] |
a0f08241aefcd9342c73a5fb0cdb0c2f
|
Get class abutton issuccess isfullwidth
|
[
{
"docid": "9530f12a38a90eefd900b8046ea64157",
"score": "0.0",
"text": "def request (url, tiktokURL)\n uri = URI.parse(url)\n\n # Shortcut\n response = Net::HTTP.post_form(uri, {\"url\" => tiktokURL, \"per_page\" => \"50\"})\n\n return response.body\n\nend",
"title": ""
}
] |
[
{
"docid": "38bcac6ee9db0fb96d16a6c537b0765b",
"score": "0.59878755",
"text": "def button_by_class(button_class)\n #if @browser.button(:class, cuke_class(button_class)).exist?\n # puts @browser.button(:class, cuke_class(button_class)).exist?\n # puts @browser.button(:class, button_class).exist?\n return @browser.button(:class, button_class)\n #else\n # button_in_form = @browser.form(:class, \"TEST_BUTTON_FORM\")\n # return button_in_form.button(:class, cuke_class(button_class))\n #end\nend",
"title": ""
},
{
"docid": "7532adf944332469fe42929191ef98dd",
"score": "0.58584607",
"text": "def student_run_button_css(offering,_classes=[])\n classes = _classes.dup\n classes << \"button\"\n classes << \"run\" if display_status_updates?(offering)\n classes << \"disabled\" if offering.locked\n classes.join(\" \")\n end",
"title": ""
},
{
"docid": "7532adf944332469fe42929191ef98dd",
"score": "0.58584607",
"text": "def student_run_button_css(offering,_classes=[])\n classes = _classes.dup\n classes << \"button\"\n classes << \"run\" if display_status_updates?(offering)\n classes << \"disabled\" if offering.locked\n classes.join(\" \")\n end",
"title": ""
},
{
"docid": "c1523a2bd9ed7b02e7838423230bcc1b",
"score": "0.5845611",
"text": "def first_button\n first_ele button_class\n end",
"title": ""
},
{
"docid": "828c9d48c80c3aa6079a5ba031039bf8",
"score": "0.5845405",
"text": "def str_wr_TwbsBtnStyleClass\n well_registered ? WR_STYLE_TRUE : WR_STYLE_FALSE\n end",
"title": ""
},
{
"docid": "b463412792158db7acd90993cc9d55e1",
"score": "0.5701013",
"text": "def new_app_btn_display?\r\n style = new_app_btn.attribute(\"style\")\r\n puts \"------style---> #{style} <-------------\"\r\n if style.chomp.include?(\"display: none;\")\r\n sleep 5\r\n puts \"+ <action> new_app_btn_display? NO\"\r\n return false\r\n end\r\n sleep 5\r\n puts \"+ <action> new_app_btn_display? YES\"\r\n return true\r\n end",
"title": ""
},
{
"docid": "c95fb6d5bbf5fb9a6f1c18c1368f3275",
"score": "0.5612475",
"text": "def endorsements_count_only_classes\n \"button small compact light button--sc button--shadow expanded\"\n end",
"title": ""
},
{
"docid": "5bb59767159db6dc590eaf626668f013",
"score": "0.55697465",
"text": "def the_status_btn(attrs = {})\n attrs = {class: ''}.merge attrs\n if object.is_in_group?(h.current_user.id)\n h.link_to 'Visit', h.dashboard_user_group_url(object), class: 'btn btn-primary ' << attrs[:class]\n elsif object.request_sent?(h.current_user.id)\n h.link_to 'Request Sent', 'javascript:void(0)', class: 'btn btn-primary disabled' << attrs[:class]\n else # join btn\n h.link_to 'Join', h.send_request_dashboard_user_group_url(object), class: 'btn btn-primary btn-bordered ujs_modal_success_replace ' << attrs[:class], remote: true, 'data-disable-with' => h.button_spinner('Joining...')\n end\n end",
"title": ""
},
{
"docid": "3c67d9d692e2858ec3b3faf091f614fa",
"score": "0.5422785",
"text": "def button_by_class_get_text(button_class)\n return button_by_class(button_class).text\nend",
"title": ""
},
{
"docid": "4da723cba75d6873e32057b665340455",
"score": "0.5416847",
"text": "def button_by_class_exists(button_class)\n return button_by_class(button_class).exist?\nend",
"title": ""
},
{
"docid": "2b1f114412a7d5a498aaf63e1cfb6da2",
"score": "0.5380967",
"text": "def pur_continue_button\n\t\t# unit_test_no_generate: pur_continue_button, button.className(create_ats_regex_string(\"ats-pursuccesscontinuebtn\"))\n\t\t$tracer.trace(__method__)\n\t\treturn ToolTag.new(button.className(create_ats_regex_string(\"ats-pursuccesscontinuebtn\")), __method__)\n end",
"title": ""
},
{
"docid": "67f378cff47ae4de58cfe82ec451644c",
"score": "0.53751284",
"text": "def size_css_class_prefix\n 'btn'\n end",
"title": ""
},
{
"docid": "8429544d48df6e28e7adc5d20154490f",
"score": "0.53692967",
"text": "def button_class(button, options={})\n options[:button_class] ? options[:button_class] : \"buy-button button medium\"\n end",
"title": ""
},
{
"docid": "994429258040a18e74576161c87c14b6",
"score": "0.5338113",
"text": "def shibboleth_button_element\n driver.find_element(:css, \"a.btn\")\n end",
"title": ""
},
{
"docid": "d0965254165c8e18db599a5a4ce4e224",
"score": "0.53164184",
"text": "def red_button\n @red_button\n end",
"title": ""
},
{
"docid": "41b4ca3e0f38e4e0565015e01e3fd9ae",
"score": "0.5311986",
"text": "def click_done\n @browser.div(:class, 'complete')\n end",
"title": ""
},
{
"docid": "c13a0f24e2534890047f2aecdb884c14",
"score": "0.5309023",
"text": "def search_button_element\n active_div.button(:class=>\"s3d-button s3d-overlay-button s3d-search-button\")\n end",
"title": ""
},
{
"docid": "9d8a5c38c5a0b410255c51bcb70e49ac",
"score": "0.5282507",
"text": "def toggle_class\n\n click_button 3 do\n\n assert_equal 0, @selenium.get_expression(js_get %{$('#hasFoo').class}), \"#hasFoo has class bar instead\"\n\n \n end\n\n end",
"title": ""
},
{
"docid": "108091c7f52df1c9b410f689bc843a2e",
"score": "0.5242573",
"text": "def preview_class\n (!account || !blog) ? 'next' : ('done' if full_planning)\n end",
"title": ""
},
{
"docid": "bf567c291ddf7a64081f273dace84006",
"score": "0.52319646",
"text": "def expect_main_cta\n page.assert_selector('.manager__cockpit__add-insurances-cta__btn__large-text')\n end",
"title": ""
},
{
"docid": "6c37793d7ecf837393b10d88be09bb2a",
"score": "0.5215402",
"text": "def action_button(html)\n result = '<span class=\"actionButton\">'\n result << html\n result << \"</span>\"\n result\n end",
"title": ""
},
{
"docid": "99c7591e2969d0589a182b3b423c0964",
"score": "0.52146417",
"text": "def first_button\n xpath _button_visible_string\n end",
"title": ""
},
{
"docid": "0720b3291a986306572522cb4d7cf8ef",
"score": "0.52129215",
"text": "def resource_button_type_specified?(css_classes)\n available_button_types = Set['btn-default', 'btn-primary', 'btn-success',\n 'btn-info', 'btn-warning', 'btn-danger'].freeze\n css_classes.intersect?(available_button_types)\n end",
"title": ""
},
{
"docid": "32fb1d66e86a8ae71111c37163063136",
"score": "0.52086735",
"text": "def activate_pur_continue_button\n\t\t# unit_test_no_generate: activate_pur_continue_button, button.className(create_ats_regex_string(\"ats-purcontinuebtn\"))\n\t\t$tracer.trace(__method__)\n\t\treturn ToolTag.new(button.className(create_ats_regex_string(\"ats-purcontinuebtn\")), __method__)\n\tend",
"title": ""
},
{
"docid": "6013a387fefd46b79c5e829ce9bc3382",
"score": "0.52052563",
"text": "def click_class_result(course_code, section_number)\n wait_for_update_and_click class_link(course_code, section_number)\n wait_for_spinner\n end",
"title": ""
},
{
"docid": "239634adbc85cd061d1c9a2ffc63774a",
"score": "0.5188195",
"text": "def buttonA\n\t\treturn @buttonA\n\tend",
"title": ""
},
{
"docid": "8950a90bffd63d8b1dafb2cdbe5f335e",
"score": "0.5186458",
"text": "def continue_button\n\t\t# unit_test_no_generate: continue_button, jquery(\"a[class~='ats-continue-button'], input[class~='ats-continue-button']\")\n $tracer.trace(__method__)\n return ToolTag.new(jquery(\"a[class~='ats-continue-button'], input[class~='ats-continue-button']\"), __method__, self)\n end",
"title": ""
},
{
"docid": "5ad393f94cbc3ba12b031f47021c447f",
"score": "0.517364",
"text": "def button_by_class_get_name(button_class)\n return button_by_class(button_class).name\nend",
"title": ""
},
{
"docid": "e7ffb7eec8f8511af081e4eb900eef02",
"score": "0.51430565",
"text": "def last_button\n last_ele button_class\n end",
"title": ""
},
{
"docid": "d1ee351e3c7bbece02b7fbf056454b1d",
"score": "0.5136248",
"text": "def login_button # :doc:\n @browser.button(:class => \"submit\")\n end",
"title": ""
},
{
"docid": "599a9a34c43544a68437cbafc18d8cc5",
"score": "0.51095766",
"text": "def replace_class\n\n click_button 1 do\n\n assert_equal 0, @selenium.get_expression(js_get %{$('.foo').length}).to_i, \"no elements with classname foo\"\n\n assert_equal 2, @selenium.get_expression(js_get %{$('.bar').length}).to_i, \"some elements with classname bar\"\n\n end\n\n end",
"title": ""
},
{
"docid": "9e4754b97cdcb7bdffd23357b2322971",
"score": "0.510206",
"text": "def background_colour\n\t\t@button.background_colour\n\tend",
"title": ""
},
{
"docid": "24328149767c0da52b55d045bfa29bd3",
"score": "0.5090024",
"text": "def button?(button)\n end",
"title": ""
},
{
"docid": "74971766f1667f1b593bf15e368f728f",
"score": "0.5085606",
"text": "def response_button_class(response, value)\n response.score == value ? 'selected' : 'not-selected'\n end",
"title": ""
},
{
"docid": "27497ae998fddc1f459e554894ee6290",
"score": "0.5081531",
"text": "def blue_button\n @blue_button\n end",
"title": ""
},
{
"docid": "195aba0b5a071c990bb8d6829a009725",
"score": "0.50693077",
"text": "def action_buttons_display\n if member.kind_of?(Work)\n if size == :large\n download_button + view_button + info_button\n else\n info_button\n end\n else\n if size == :large\n download_button + view_button\n else\n download_button\n end\n end\n end",
"title": ""
},
{
"docid": "3a48fe7b8b994feea65077e9dbf8ce29",
"score": "0.5063581",
"text": "def yes_css_class\n CSS_CLASS_YES\n end",
"title": ""
},
{
"docid": "06a407afc44ce64c6b57a071cb22be09",
"score": "0.50625163",
"text": "def success\n self.foreground(:green)\n end",
"title": ""
},
{
"docid": "4341755680f7c8a3330de0742465f8b5",
"score": "0.506021",
"text": "def status_class\n self.status == 'encontrado' ? 'alert-success' : 'alert-danger'\n end",
"title": ""
},
{
"docid": "0b44b00203660ac6ab7ee91f22bf8025",
"score": "0.5056948",
"text": "def red?\n !@red_button.nil?\n end",
"title": ""
},
{
"docid": "861960ecf90075c93f8679273da6b993",
"score": "0.5054767",
"text": "def reflow_color()\n width = 80 - @indent.length\n\n if @report.split(\"\\n\").all? {|line| line.length <= width}\n return 'btn-default'\n else\n return'btn-danger'\n end\n end",
"title": ""
},
{
"docid": "861960ecf90075c93f8679273da6b993",
"score": "0.5054767",
"text": "def reflow_color()\n width = 80 - @indent.length\n\n if @report.split(\"\\n\").all? {|line| line.length <= width}\n return 'btn-default'\n else\n return'btn-danger'\n end\n end",
"title": ""
},
{
"docid": "f22d319c6fa41d61fb52d858869770ca",
"score": "0.5051579",
"text": "def logoutButtonDisplayed()\n #assert element_present?(:class, \"indicator-connection\")\n result= element_present?(:class, \"indicator-connection\")\n result\n end",
"title": ""
},
{
"docid": "b162ff122c5a278b208306194f45515e",
"score": "0.5046139",
"text": "def apply_button\n $tracer.trace(__method__)\n return ToolTag.new(a.className(create_ats_regex_string('ats-promoapplybtn')), __method__)\n end",
"title": ""
},
{
"docid": "a7d0bb5a73984af3b76eb9ffcd9cdccc",
"score": "0.5043803",
"text": "def confirmation_text\n frm.div(:class=>\"portletBody\").div(:class=>\"success\").text\n end",
"title": ""
},
{
"docid": "132f2a2e87abf21fff6460f5b40aa23a",
"score": "0.5032092",
"text": "def btn_class_name\n @btn_class_name ||= (size == :large) ? \"btn-brand-main\" : \"btn-brand-alt\"\n end",
"title": ""
},
{
"docid": "faf5751bb6df29f5784c84979ea95423",
"score": "0.5022522",
"text": "def BackButtonCreateAccount\n if (ENV['PLATFORM']=='Android')\n wait{$driver.find_element(:class, \"android.widget.ImageButton\").displayed? }\n return $driver.find_element(:class, \"android.widget.ImageButton\")\n else\n raise \"This control is not implemented yet\"\n end\n end",
"title": ""
},
{
"docid": "fc45ad49257852549c16f94883c556d7",
"score": "0.5018235",
"text": "def show_button; end",
"title": ""
},
{
"docid": "5f28eea009ff20bca96984720ec21467",
"score": "0.5017642",
"text": "def search_button\n # @browser.find_element(:id, 'defaultToolbar').find_element(:class, 'search-inline-container').find_element(:class, 'search-inline-container-icon')\n @browser.find_element(:id, 'defaultToolbar').find_element(:class, 'search-inline-container').find_element(:class,'search-inline-container-icon-search')\n end",
"title": ""
},
{
"docid": "41c99da02c0ed0a6b735c0d26d4eebf1",
"score": "0.5013038",
"text": "def reflow_color()\n width = 78 - @indent\n\n if not @draft or @draft.split(\"\\n\").all? {|line| line.length <= width}\n return 'btn-default'\n else\n return'btn-danger'\n end\n end",
"title": ""
},
{
"docid": "a52bde46cbd65bf141797a026ddbbb4d",
"score": "0.5011714",
"text": "def is_button_present?\n @browser.find_element(:tag_name, 'h2').text\n end",
"title": ""
},
{
"docid": "4e6752d34fd161b327aecb74619377c4",
"score": "0.49999374",
"text": "def button_by_class_click(button_class)\n button_by_class(button_class).focus\n button_by_class(button_class).click\nend",
"title": ""
},
{
"docid": "4c7bd0746a20c2d4fd0431e8012fc8dd",
"score": "0.49911433",
"text": "def jangalist_button\n active_class = (user_wishes_it?(@product)) ? \"active\" : \"\"\n store_button(\"+ Jangalist\", \"#\", \n {\n :custom_class => \"color2 #{active_class}\",\n :id => 'btn-jangalist',\n :button_name => \"jangalist\",\n :under_construction => false\n }, \n {:deactivated => user_is_pro?})\n end",
"title": ""
},
{
"docid": "4d65c37b4ba6b2b5b3592aac0cbe6165",
"score": "0.49734914",
"text": "def presionarBotonTD(textoBoton, clase)\n # Redefinir la variable clase para recibir por parámetro la clase del componente a presionar click\n #clase = 'z-button-cm'\n botonera = self.getBrowser().tds(:class => clase)\n botonera.each do |boton|\n if (boton.text() == textoBoton)\n boton.click\n break\n end\n end\n #botonConsulta.wait_while_present\n end",
"title": ""
},
{
"docid": "d31bf9a54a76d4853b48b03058f3916f",
"score": "0.4972038",
"text": "def replace_or_assign_class\n\n click_button 2 do\n\n assert_equal 0, @selenium.get_expression(js_get %{$('.foo').length}).to_i, \"no elements with classname foo\"\n\n assert_equal 3, @selenium.get_expression(js_get %{$('.bar').length}).to_i, \"some elements with classname bar\" \n\n end\n\n end",
"title": ""
},
{
"docid": "b8fbe22c8fcb2a2076673c24d875837e",
"score": "0.49707603",
"text": "def row_class\n if attending\n \"success\"\n elsif attending == false\n \"danger\"\n else\n \"warning\"\n end\n end",
"title": ""
},
{
"docid": "6cd2845b51e888d2bd0fbf91949517f6",
"score": "0.49680424",
"text": "def css_class\n if model.type == Event::Call::SCHEDULED_DEMO\n \"alert-info\"\n else\n end\n end",
"title": ""
},
{
"docid": "b1373525306e39e0e00d6565081e5067",
"score": "0.49606544",
"text": "def has_signup_successful_flash?\n has_css? @notice_flash, text: \"successfully\"\n end",
"title": ""
},
{
"docid": "2f6ad8d01d0dc81d0fb498d9c2a66513",
"score": "0.49572924",
"text": "def asset_css_tr_class(s)\n unclear_flag = false\n msg = \"\"\n if s.code_policy.is_unclear_authentication\n unclear_flag = true\n msg += \"Unclear authentication, \"\n end\n if s.code_policy.is_unclear_authorization\n unclear_flag = true\n msg += \"Unclear authorization, \"\n end\n if s.code_policy.is_unclear_pdp\n unclear_flag = true\n msg += \"no role\"\n end\n\n if unclear_flag\n \"class=\\\"error_bg\\\" title=\\\"#{msg}\\\"\"\n elsif s.code_policy.is_public\n \"class=\\\"public_bg\\\" title=\\\"public\\\"\"\n else\n \"class=\\\"black\\\"\"\n end\n end",
"title": ""
},
{
"docid": "5181f55f1cff06f2381e2d9f1e1883ea",
"score": "0.49521953",
"text": "def redemption_continue_button\n\t\t# unit_test_no_generate: redemption_continue_button, jquery(\"a[class~='ats-continue-button'], input[class~='ats-continue-button']\")\n\t\t$tracer.trace(__method__)\n\t\treturn ToolTag.new(jquery(\"a[class~='ats-continue-button'], input[class~='ats-continue-button']\"), __method__, self)\n\tend",
"title": ""
},
{
"docid": "4596ed028271bb0c50402ab2fc674271",
"score": "0.49373367",
"text": "def open_website_button_presented?()\n exists_button = @browser.span(css: @open_publised_website).present?\n return exists_button, self \n end",
"title": ""
},
{
"docid": "1c3d1641a3c9c1b3f0dcf0516450d18f",
"score": "0.49299183",
"text": "def presionarBotonTD(textoBoton, clase)\n # Redefinir la variable clase para recibir por parámetro la clase del componente a presionar click\n #clase = 'z-button-cm'\n botonera = self.getBrowser().tds(:class => clase)\n botonera.each do |boton|\n if (boton.text() == textoBoton)\n boton.click\n #break\n return true\n end\n end\n #botonConsulta.wait_while_present\n puts \":: Botón textoBoton:: #{textoBoton} :: clase:: #{clase} no encontrado :: \"\n return false\n end",
"title": ""
},
{
"docid": "1eb6022505545a1bd7d386c1987d7609",
"score": "0.49173397",
"text": "def first_button\n first_ele :button\n end",
"title": ""
},
{
"docid": "9707925b990125f97247436e31bbee03",
"score": "0.49037385",
"text": "def button_class(color, size, rounded=\"\", pretty=\"\")\n case framework\n when \"bootstrap3\"\n color_hash = {\"blue\" => \"btn-primary\", \n \"light-blue\" => \"btn-info\",\n \"grey\" => \"btn-default\",\n \"black\" => \"btn-inverse\",\n \"red\" => \"btn-danger\",\n \"green\" => \"btn-success\",\n \"orange\" => \"btn-warning\"}\n size_hash = {\"large\" => \"btn-lg\",\n \"medium\" => \"btn-sm\",\n \"small\" => \"btn-xs\"}\n when \"bootstrap2\"\n color_hash = {\"blue\" => \"btn-primary\", \n \"light-blue\" => \"btn-info\",\n \"grey\" => \"\",\n \"black\" => \"btn-inverse\",\n \"red\" => \"btn-danger\",\n \"green\" => \"btn-success\",\n \"orange\" => \"btn-warning\"}\n size_hash = {\"large\" => \"btn-large\",\n \"medium\" => \"\",\n \"small\" => \"btn-tiny\"}\n when\"gumby\"\n color_hash = {\"blue\" => \"primary\", \n \"dark-green\" => \"secondary\",\n \"grey\" => \"default\",\n \"black\" => \"info\",\n \"red\" => \"danger\",\n \"green\" => \"success\",\n \"orange\" => \"warning\"}\n size_hash = {\"xlarge\" => \"xlarge\", \n \"large\" => \"large\",\n \"medium\" => \"medium\",\n \"small\" => \"small\",\n \"green\" => \"btn-success\"}\n end\n \"#{pretty.blank? ? \"\" : \"#{pretty} \"}#{rounded.blank? ? \"\" : \"#{rounded} \"}#{size_hash[size]} #{color_hash[color]} btn\"\n end",
"title": ""
},
{
"docid": "8ce02f5347161de6fb75bc80842ee6d8",
"score": "0.49001274",
"text": "def fab_class(classnames = nil)\n default_classnames = %w[btn-float btn]\n join_classnames(default_classnames, classnames)\n end",
"title": ""
},
{
"docid": "c45883d40ea6e6b29bed705f487147ec",
"score": "0.4887462",
"text": "def on_a_button?\n @components.index(@current_component) < @buttons.count\n end",
"title": ""
},
{
"docid": "ffee0a2c3330c252bb82c8d7643c1e73",
"score": "0.48793763",
"text": "def html_class\n @status_classes.join(' ')\n end",
"title": ""
},
{
"docid": "a1ae1a85ff5e4678a8f427e5703b2d37",
"score": "0.48503107",
"text": "def has_subscribe_button?\n has_css? @subscribe_button\n end",
"title": ""
},
{
"docid": "3759ed81007c5cede0f031c1481102c3",
"score": "0.48487675",
"text": "def full_html_class \n [elem_table_name,html_class].join(\" \")\n end",
"title": ""
},
{
"docid": "fbb2de12a030fe3440586a1a32c00b7a",
"score": "0.48327845",
"text": "def submit_button\n submit(:class => \"btn btn-primary\")\n end",
"title": ""
},
{
"docid": "4457325d3fa114a8561de550799ea099",
"score": "0.4806547",
"text": "def view_account_cta()\n return $test_driver.find_element(:xpath => \"//div[@class='account-dropdown logged']/a[@class='button']\")\n end",
"title": ""
},
{
"docid": "8ed7446461cde8ad27f8fdbe30dc22be",
"score": "0.47886273",
"text": "def shame_class(deed)\n return \"shamebtn\" unless current_user\n unless deed.votes.where(\"votes.user_id=? AND votes.value=-1\", current_user.id).empty?\n \"shamebtn shamebtn-color\"\n else\n \"shamebtn\"\n end\n end",
"title": ""
},
{
"docid": "6d9435cd956af86221d241ceb4b8895a",
"score": "0.47866842",
"text": "def passing_status_and_class\n sts = 'ERROR'\n cls = 'text-danger'\n if @test_case_commit.status == 0\n sts = 'Passing'\n cls = 'text-success'\n elsif @test_case_commit.status == 1\n sts = 'Failing'\n cls = 'text-danger'\n elsif @test_case_commit.status == 2\n sts = 'Checksum mismatch'\n cls = 'text-primary'\n elsif @test_case_commit.status == 3\n sts = 'Mixed'\n cls = 'text-warning'\n elsif @test_case_commit.status == -1\n sts = 'Not yet run'\n cls = 'text-info'\n end\n return sts, cls\n end",
"title": ""
},
{
"docid": "a40aa7a7884d0c229d0c3150089138c0",
"score": "0.47849238",
"text": "def success_color; end",
"title": ""
},
{
"docid": "bc29deb7133eccda59e90b6aa309c355",
"score": "0.47836408",
"text": "def bs_class_for_competition_status(competition)\n return 'label-success' if competition.active?\n return 'label-info' if competition.yet_to_begin?\n return 'label-warning' if competition.suspended?\n return 'label-danger' if competition.expired?\n end",
"title": ""
},
{
"docid": "3a3b428784b74815d85a6775967aa10e",
"score": "0.47816032",
"text": "def btn_topisb_util__clicked(button)\n\t\t@builder[\"image_util\"].file = @arrImageUtil[0]\n\t\t@curImageUtil = 0\n\t\t@builder[\"spin_image_util\"].value = @curImageUtil + 1\n\t\t@builder[\"imPath_util\"].label = \"Image Stack Browser 2\\n\\n\" + @arrImageUtil[@curImageUtil].split(\"/\")[ @arrImageUtil[@curImageUtil].split(\"/\").size-1]\n\tend",
"title": ""
},
{
"docid": "c42e107953c01a499875c81d5eef1e17",
"score": "0.47813442",
"text": "def complete\n\t\tclick(Comp_Btn)\n\tend",
"title": ""
},
{
"docid": "bfe737c17c1a2288bea90fb2d33b2327",
"score": "0.47810248",
"text": "def check_button_trigger\n return unless button_trigger_met?\n @page.button_labels.each do |button|\n if Input.trigger?(button)\n return \"#{TH::Event_Trigger_Labels::Button_Format}(:#{button})\"\n end\n end\n return nil\n end",
"title": ""
},
{
"docid": "fdfd37cff6adb0e5184fc28d687c374c",
"score": "0.47782317",
"text": "def show_button_onclick\r\n (func, title, aidstr_list) = get_3_params()\r\n \r\n aidarr_sel = selected_assay_cbox(aidstr_list)\r\n aidstr_sel = @@alib.comb_arr_to_str(\"_\", aidarr_sel)\r\n cutoff = get_cutoff_value(func)\r\n subgrparr_sel = selected_subgroup_list(aidstr_list)\r\n \r\n goto_result_page1(func, title, aidstr_list, aidstr_sel, cutoff, \"\", 0, subgrparr_sel)\r\nend",
"title": ""
},
{
"docid": "7cc2a920156c4015180351f6efac3f30",
"score": "0.4776758",
"text": "def order_confirmation_information_lightbox\n \"div.sweet-alert.showSweetAlert.visible\"\n end",
"title": ""
},
{
"docid": "84d920045fea8b726386b089bc26d98b",
"score": "0.4775998",
"text": "def vote_button_classes(from_opinions_list)\n return \"card__button\" if from_opinions_list\n\n \"expanded\"\n end",
"title": ""
},
{
"docid": "62197c7246be7058ff23d89fdffc3522",
"score": "0.47732845",
"text": "def blue?\n !@blue_button.nil?\n end",
"title": ""
},
{
"docid": "2ad879a4e0dcb197984378bbaeb33749",
"score": "0.47671345",
"text": "def test_result_class(test_case_result)\n return [] unless test_case_result\n test_case_result.passed? ? ['bg-success', 'text-success'] : ['bg-danger', 'text-danger']\n end",
"title": ""
},
{
"docid": "fe112e8348565cb2542250e570112a3e",
"score": "0.4760016",
"text": "def buttonYesNo__clicked(*a)\n\t\tif alert(\"Do you want to continue?\", :button_yes => \"Yes\", :button_no => \"No\", :parent => self) #on top\n\t\t\talert \"Ok we'll contine...\" # not always on top\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2d26ae5c880247cffe3cd184139694e5",
"score": "0.4758028",
"text": "def _page_indicates_success?(page)\n return true if page.root.css('.messageBoxSuccess').length > 0\n return false if page.root.css('.messageBoxFail').length > 0\n return nil\n end",
"title": ""
},
{
"docid": "71805f9f20d63440d0d3bc85d5db6c9d",
"score": "0.4750162",
"text": "def product_active_tab(tab)\n\t\ttab.blank? ? \"btn-default\" : \"btn-success\"\n\tend",
"title": ""
},
{
"docid": "b7b4fdfca10db07c42e12736b385958c",
"score": "0.47486374",
"text": "def back_button\n result = nil\n names('back').each do |b|\n if b.displayed?\n result = b\n break\n end\n end\n result\nend",
"title": ""
},
{
"docid": "b7b4fdfca10db07c42e12736b385958c",
"score": "0.47483408",
"text": "def back_button\n result = nil\n names('back').each do |b|\n if b.displayed?\n result = b\n break\n end\n end\n result\nend",
"title": ""
},
{
"docid": "fc8cf55f9bd9c3e0db0fc2061bbec5d5",
"score": "0.47455424",
"text": "def retornar_texto_span_btn_comprar\n span_btn_comprar.greenify\n span_btn_comprar.text\n end",
"title": ""
},
{
"docid": "de3046c7273f7488110f650198e32f14",
"score": "0.4734211",
"text": "def btn_toplsb_util__clicked(button)\n\t\t@lessonstackutil.move(1)\n\tend",
"title": ""
},
{
"docid": "c1e8909b6e40f20521e86821bd03a50e",
"score": "0.4732037",
"text": "def button_by_class_get_value(button_class)\n return button_by_class(button_class).value\nend",
"title": ""
},
{
"docid": "ca7a2457382ea9714d82f62ea12a4238",
"score": "0.47317648",
"text": "def threes(a,b,c)\n\n t1 = @builder.get_object(\"button\" + a.to_s).label\n t2 = @builder.get_object(\"button\" + b.to_s).label\n t3 = @builder.get_object(\"button\" + c.to_s).label\n return (t1 != @blankTile && t2 != @blankTile && t3 != @blankTile) && (t1 == t2 && t2 == t3)\n\n end",
"title": ""
},
{
"docid": "0de27201d269c98b0911d2d7b4e4247a",
"score": "0.4729602",
"text": "def tab_class(tab)\n\t 'active' if params[:action] == tab\n\tend",
"title": ""
},
{
"docid": "7544baf142c5ac3d87af897852dbbb91",
"score": "0.47260728",
"text": "def click_finalizar_compra_button\nclick_on 'Finalizar Compra'\nend",
"title": ""
},
{
"docid": "eb0267145e52fc0270bba63442426413",
"score": "0.47257936",
"text": "def button_text\n if person_status\n t(\"decidim.content_blocks.hero.#{person_status}.button\")\n else\n translated_attribute(current_organization.cta_button_text).presence || t(\"decidim.pages.home.hero.participate\")\n end\n end",
"title": ""
},
{
"docid": "440bf2b5a501b3c69bbfb86ec9117262",
"score": "0.47169307",
"text": "def foresee_decline?\n @browser.button(:id => \"decline\").exists? && @browser.button(:id => \"decline\").visible?\nend",
"title": ""
},
{
"docid": "75442a9001607af90d4b80af987fe89c",
"score": "0.47167978",
"text": "def click_button\n find(:css, 'a.text-bold500', wait:10).click\n end",
"title": ""
},
{
"docid": "3a02030ec14b2a35270cccca9b802616",
"score": "0.4712118",
"text": "def active?\n @browser.element(:css => @gadget_css).parent\n end",
"title": ""
},
{
"docid": "fac6b4e7c6b91524f1787a1fc02af975",
"score": "0.4710672",
"text": "def current_button\n if role_name == 'publisher' then return 'btn-success' else return 'btn-primary' end\n end",
"title": ""
},
{
"docid": "54858c12ae35892e4f3f2cea6075ef26",
"score": "0.47102812",
"text": "def is_blue?\n return false if classes.match(/active/)\n return true\n end",
"title": ""
},
{
"docid": "aa5e12f2d07d527be9c22392515243fd",
"score": "0.47081265",
"text": "def render\n _button.btn.btn_primary @request, onClick: self.click, disabled: @disabled\n end",
"title": ""
}
] |
f09dfec882ec4d240998fdd1ca082952
|
will render 401 if users creds dont authenticate
|
[
{
"docid": "5c46c6e03bf87b957628a0bcd67da42d",
"score": "0.0",
"text": "def create \n user = User.authenticate(params[:user][:email], params[:user][:password])\n if user\n session[:user_id] = user.id\n render :json => user.as_json(:current_user => user)\n else\n render :json => {:message => 'Wrong email or password.'}, :status => 401\n end\n end",
"title": ""
}
] |
[
{
"docid": "338dc1131407ea6ffd309804ad2ae181",
"score": "0.8245373",
"text": "def unauthorised\n render_error 401, :unauthorized\n end",
"title": ""
},
{
"docid": "b596570b888d654b35160b2a8c5e0341",
"score": "0.81418604",
"text": "def render_unauthorized\n render json: {errors: ['Bad credentials']}, status: 401\n end",
"title": ""
},
{
"docid": "c3e59dbf9b4f5ad455ec52379bdc2a45",
"score": "0.7982735",
"text": "def authenticate\n render json: {error: \"unauthorized\"}, status: 401 unless logged_in?\n end",
"title": ""
},
{
"docid": "a0a4891515e21a3f4bf4907a3680d3f6",
"score": "0.7955465",
"text": "def authenticate_user\n if !current_user\n render :file => File.join(Rails.root, 'public', '401.html'),:status => 401\n end\n end",
"title": ""
},
{
"docid": "9f3fe11430b6a71bdc4dabf2bfe166da",
"score": "0.7932092",
"text": "def access_denied\n @errors = \"authenication failed\"\n render status: 401\n end",
"title": ""
},
{
"docid": "03b60c25d043a899f36efd3cf1584b7e",
"score": "0.7863112",
"text": "def render_authenticate_error\n return render_error!(compose_msg(:unauthorized), 401)\n end",
"title": ""
},
{
"docid": "15237f51eb93033472bfb090d58433e2",
"score": "0.778174",
"text": "def invalid_authentication\n render_error(401, 'Authorize Error', 'Unauthorized')\n end",
"title": ""
},
{
"docid": "4928754b427ecfbea84843ca03abcba9",
"score": "0.77812934",
"text": "def invalid_authentication\n render_unauthorized_response\n end",
"title": ""
},
{
"docid": "2c93cc32aa064441a9a5fca7ec792969",
"score": "0.777067",
"text": "def authenticate\n render_unauthorized unless authenticated?\n end",
"title": ""
},
{
"docid": "31ea2a2e968bfe3e31f2ed9f3b819e84",
"score": "0.7769303",
"text": "def render_unauthorized\n render json: { errors: ['Unauthorized'] }, status: 401 and return\n end",
"title": ""
},
{
"docid": "ca7978763af362b9b7254296d6b3bc1f",
"score": "0.7765146",
"text": "def require_user_or_401\n render(status: 401, text: '') && return unless current_user\n end",
"title": ""
},
{
"docid": "c0cb18cdbcb85c8e43d3ad80b6757021",
"score": "0.77515626",
"text": "def unauthorized\n headers['WWW-Authenticate'] = 'Bearer realm=\"API\"'\n render_error 401\n end",
"title": ""
},
{
"docid": "d41cb47140943f8d2f246f36734c823d",
"score": "0.77315986",
"text": "def access_denied!\n render 'errors/401', status: :unauthorized, layout: 'empty' # && return\n end",
"title": ""
},
{
"docid": "baaf4515fb3080d985ce0e38bde2a6bd",
"score": "0.7730994",
"text": "def authenticate_user\n render json: { error: \"Unauthorized.\" }, status: 401 unless authenticated?\n end",
"title": ""
},
{
"docid": "344e148b1a9c73659f3c9335f3cfb68e",
"score": "0.7728375",
"text": "def access_denied\n if @errors\n @errors = \"authentication failed: \" + @errors\n else\n @errors = \"authentication failed\"\n end\n render status: 401\n end",
"title": ""
},
{
"docid": "9275f63be611541e4a4e721d58cfd9d4",
"score": "0.7689091",
"text": "def render_unauthorized_user\n\t\trender json: { error: \"No está autorizado para accesar.\" }, status: 401\n\tend",
"title": ""
},
{
"docid": "57cd4b913023f043be325034b7324587",
"score": "0.7683609",
"text": "def authenticate_user!\n authenticate_token || render_unauthorized(\"Access denied\")\n end",
"title": ""
},
{
"docid": "007935c975de9fe0f2215984ddcab85b",
"score": "0.76440805",
"text": "def not_authorized\n render(:text => \"Not Authorized\", :status => 401)\n end",
"title": ""
},
{
"docid": "03c4a861b0b4f512415f79cf6b10423a",
"score": "0.7643812",
"text": "def authentication_error\n render json: {error: ('unauthorized')}, status: 401\n end",
"title": ""
},
{
"docid": "cc0257e257da7a7b653fb130e32d1109",
"score": "0.7628007",
"text": "def render_unauthorized\n render(file: 'public/401.html', status: :unauthorized, layout: false) and return\n end",
"title": ""
},
{
"docid": "c0549291f25802bca9046f6e435aca7e",
"score": "0.76255196",
"text": "def user_not_authorized\n head :unauthorized\n end",
"title": ""
},
{
"docid": "63834d8625fd03d1422c4e8f6e994264",
"score": "0.7624181",
"text": "def handle_auth_err(exception)\n logger.warn \"[Backend] Failed to authenticate user: #{exception.message}\"\n render text: exception.message, status: 401\n end",
"title": ""
},
{
"docid": "f0dac3ac75b7243f09644617468bc6d6",
"score": "0.76040983",
"text": "def authenticate_error\n render json: { error: ('failure.unauthenticated') }, status: 401\n end",
"title": ""
},
{
"docid": "410cd1f5e9f2f1ee671e2f853533195b",
"score": "0.7602702",
"text": "def unathorized_error\n error!(\"401 Unauthorized\", 401)\n end",
"title": ""
},
{
"docid": "83b57a829749bdcca7befd4393d9be37",
"score": "0.7598802",
"text": "def invalid_authentication\n renderError(\"Unauthorized\",401,\"Error on token or missing token\")\n end",
"title": ""
},
{
"docid": "ac37888c4a696b644280cef41a3f539f",
"score": "0.7585685",
"text": "def render_failed_auth_response\n render status: 401,\n json: json_response(:fail, data: {user: \"Valid user email and token must be present.\"})\n end",
"title": ""
},
{
"docid": "b569e5d6c4a24fc0eba458bc0f6bc5cb",
"score": "0.7551889",
"text": "def unauthorized\n render :text => \"Unauthorized\", :content_type => \"text/plain\", :status => :unauthorized\n end",
"title": ""
},
{
"docid": "bfb75a5fce3498bf930b36dd4a8af4ca",
"score": "0.7551182",
"text": "def check_authorization\n render status: 401 unless authorized?\n end",
"title": ""
},
{
"docid": "c74ed3b5625696210658314b1442efe3",
"score": "0.7550359",
"text": "def invalid_authentication\n render json: { error: 'Unauthenticated Request' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "5a0db1c98e7b77abd2636fbdb3e437a8",
"score": "0.75424314",
"text": "def protected!\n unless authorized?\n response['WWW-Authenticate'] = %(Basic realm=\"Restricted Zen Area\")\n throw(:halt, [401, \"Oops... we need your login name & password\\n\"])\n end\nend",
"title": ""
},
{
"docid": "0ef56a9d6e428eca2c92909597aa6d6b",
"score": "0.7535688",
"text": "def access_denied!\n render partial: 'errors/401', status: 401 && return\n end",
"title": ""
},
{
"docid": "74dca9a417e37ed748bce99ea4b85425",
"score": "0.75349367",
"text": "def authentication_failed\n Rails.logger.warn \"Authentication attempt failed: #{request.env['warden.options']}\"\n\n render text:'401 Unauthorized', status: :unauthorized\n end",
"title": ""
},
{
"docid": "edc3c7cd86a1a89d6164ab77230b22d2",
"score": "0.7520828",
"text": "def protected!\n return unless ENV[\"HTTP_USER\"]\n unless authorized?\n response['WWW-Authenticate'] = %(Basic realm=\"Restricted Area\")\n throw(:halt, [401, \"Not authorized\\n\"])\n end\n end",
"title": ""
},
{
"docid": "8f9d9385a4b2ad6bbc9d1dd3b690b274",
"score": "0.7511679",
"text": "def unauthorized\n custom!(Rack::Response.new([config.fail_message], 401, { 'WWW-Authenticate' => %Q{Basic realm=\"#{config.realm}\"} }))\n end",
"title": ""
},
{
"docid": "c9e8da24b3da3a8747c623143ac259bd",
"score": "0.75018907",
"text": "def authenticate!\n head :unauthorized unless current_user\n end",
"title": ""
},
{
"docid": "50de6b00a8285002e1f41a7c514bc5e7",
"score": "0.7497408",
"text": "def authenticate!\n render_unauthorized unless current_user\n end",
"title": ""
},
{
"docid": "8bf61a1c6f8e91019168d6ce057b6b02",
"score": "0.7495682",
"text": "def check_authentication\n\t\t# If the user credentials doesn't check out we render a 401.\n\t\tif !check_user_credentials\n\t\t\trender :template => 'api/v1/errors/401', :status => :unauthorized\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ec42e223dd109ef87d5ee8375ccf11b8",
"score": "0.7492771",
"text": "def secure_api\n if !authorized\n render status: 401, text: 'Please log in to use this API' and return\n end\n end",
"title": ""
},
{
"docid": "94429d1ad94ffd79b3eba7bf52edc6b1",
"score": "0.7492332",
"text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"title": ""
},
{
"docid": "94429d1ad94ffd79b3eba7bf52edc6b1",
"score": "0.7492332",
"text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"title": ""
},
{
"docid": "94429d1ad94ffd79b3eba7bf52edc6b1",
"score": "0.7492332",
"text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"title": ""
},
{
"docid": "94429d1ad94ffd79b3eba7bf52edc6b1",
"score": "0.7492332",
"text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"title": ""
},
{
"docid": "94429d1ad94ffd79b3eba7bf52edc6b1",
"score": "0.7492332",
"text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"title": ""
},
{
"docid": "8ae5fcaf152812e695f8ab309067669d",
"score": "0.7489803",
"text": "def authorized\n render json: { message: 'Invalid user credentials' }, status: :unauthorized unless logged_in?\n end",
"title": ""
},
{
"docid": "e1f47d83e6f263d2dc06bce19cfe2154",
"score": "0.7484165",
"text": "def authenticate!\n error!('401 Unauthorized', 401) unless current_user\n end",
"title": ""
},
{
"docid": "c47c7161aa021dd4a603acabb1ea6467",
"score": "0.7480624",
"text": "def authentication_error\n render json: { error: t('unauthorized') }, status: 401\n end",
"title": ""
},
{
"docid": "7cb934c8d54e31772737485062d9989a",
"score": "0.74805236",
"text": "def authenticated!\n error(401) unless current_user\n end",
"title": ""
},
{
"docid": "6526707381afe6162caa1c383f310f3a",
"score": "0.74747",
"text": "def not_authorized\n render json: { error: 'Not Authorized'}, status: 401\n end",
"title": ""
},
{
"docid": "fbf692f7191eb10d310d04772f954b8f",
"score": "0.7474426",
"text": "def invalid_authentication\n render json: { error: 'Access not granted' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "720dcf20212c7f7c6ed71faec5fa1e3b",
"score": "0.74713135",
"text": "def render_unauthorized\n self.headers['WWW-Authenticate'] = \"Token realm='Projects API'\"\n render json: \"401: API token required.\", status: :unauthorized\n end",
"title": ""
},
{
"docid": "29eaec8b7201fa23c629e3c91f625ca9",
"score": "0.7462612",
"text": "def authenticate\n head :unauthorized unless current_user\n end",
"title": ""
},
{
"docid": "e22da30777104b86ae4c21d37e02745d",
"score": "0.7449978",
"text": "def render_no_access\n render file: 'public/401.html', status: :unauthorized\n end",
"title": ""
},
{
"docid": "4069f7258167acf3a83b9b73d2c00946",
"score": "0.74383193",
"text": "def restrict_access\n render :file => \"public/401.html\", :status => :unauthorized, :layout => false\n end",
"title": ""
},
{
"docid": "89ec59ccb089f1016ae8744049492367",
"score": "0.7432933",
"text": "def render_unauthorized message: nil\n render json: { success: false, error: message, status_code: 600, link: ERRORS_LINK }, status: 401\n end",
"title": ""
},
{
"docid": "e30bef057a04d56e397bcb0d6e27d327",
"score": "0.74298835",
"text": "def invalid_authentication\n render json: { error: 'Unauthorized Request' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "f585031748013c275764f6b418991287",
"score": "0.7422599",
"text": "def render_unauthorized(msg=\"Not Authenticated\")\n render json: { errors: [msg] }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "5c1fc082732706a413aa93d144fb9a03",
"score": "0.74202675",
"text": "def auth_only!\n render json: {}, status: 401 unless current_user\n end",
"title": ""
},
{
"docid": "2c00a56bae2e0db8ac7997fc04f0aa1f",
"score": "0.7418739",
"text": "def unauthorized\n render :text => \"You are not authorized to perform this action\", :status => 401\n end",
"title": ""
},
{
"docid": "981433241790fa83b0ed0b3f5cd90623",
"score": "0.7399943",
"text": "def protected!\n unless authorized?\n response['WWW-Authenticate'] = %(Basic realm=\"Restricted Area\")\n throw(:halt, [401, \"Not authorized\\n\"])\n end\n end",
"title": ""
},
{
"docid": "d47267dee4e9d838dd5283cfe3a884ae",
"score": "0.73829824",
"text": "def unauthorized\n render :text => \"Unauthorized.\", :status => :unauthorized\n end",
"title": ""
},
{
"docid": "6d794fac15314a8a3e05d880695be6a1",
"score": "0.73766315",
"text": "def unauthorized\n custom!(Rack::Response.new([config.fail_message], 401, { 'WWW-Authenticate' => %Q{Bearer realm=\"#{config.realm}\"} }))\n end",
"title": ""
},
{
"docid": "21f8b021eab64a8abcd7a4c6b9455fea",
"score": "0.7372058",
"text": "def render_unauthorized\n\t\trender(status: :unauthorized)\n\tend",
"title": ""
},
{
"docid": "fb535a1463a6e98067d49ef6eec70991",
"score": "0.73679596",
"text": "def authorize_fail\n if request.format == :json\n render :text => \"Unauthorized action.\"\n else\n render :file => \"static/401\", :formats => [:html], :status => :unauthorized\n end\n return false\n end",
"title": ""
},
{
"docid": "a1d419378371a6db143c57f998e39b16",
"score": "0.7366635",
"text": "def access_denied\n render :text => \"You don't have access to this resource\", :status => 401\n false\n end",
"title": ""
},
{
"docid": "ef295d0cd8895ecd97e5b484e6cee11c",
"score": "0.73622835",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request Authentication Failed'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "cc2e8fe767fa20a3b8801bf067eca14c",
"score": "0.7361578",
"text": "def invalid_authentication\n renderError(\"Unauthorized\",401,\"Error on token or missing token\")\nend",
"title": ""
},
{
"docid": "6637140b4c380092fd492b1a3c9aab86",
"score": "0.7359042",
"text": "def protected!\n return if authorized?\n headers['WWW-Authenticate'] = 'Basic Realm=\"Admin Only\"'\n halt 401, \"Not Authorized\"\n end",
"title": ""
},
{
"docid": "3e58d9a6e85dc6037be7fb30b87a69b5",
"score": "0.7356834",
"text": "def authentication_response\n render text: 'Authentication failure', status: :forbidden\n end",
"title": ""
},
{
"docid": "1d2852e93c5e8636efb3cc0105ae18cc",
"score": "0.7356637",
"text": "def unauthorized\n respond_to do |format|\n format.html do\n if admin?\n flash.now[:error] = I18n.t(:authorization_failure)\n redirect_to login_path and return\n elsif current_user || admin?\n flash.now[:error] = I18n.t(:authorization_failure)\n render 'shared/unauthorized'\n #FIXME:: Should be that\n #render 'shared/unauthorized', :layout => 'layouts/application', :status => 401\n else\n store_location\n redirect_to login_path and return\n end\n end\n format.xml do\n request_http_basic_authentication 'Web Password'\n end\n format.json do\n render :text => \"Not Authorized \\n\", :status => 401\n end\n end\n end",
"title": ""
},
{
"docid": "51e1577a5b382567c09a8fb58fb8aa15",
"score": "0.73511636",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "51e1577a5b382567c09a8fb58fb8aa15",
"score": "0.73511636",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "51e1577a5b382567c09a8fb58fb8aa15",
"score": "0.73511636",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "51e1577a5b382567c09a8fb58fb8aa15",
"score": "0.73511636",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "8dbdec5c918e5d9f696ea1801236e666",
"score": "0.7347391",
"text": "def authentication_error\n # User's token is either invalid or not in the right format\n render :json => {:message => 'Unauthorized. Please log in to proceed.'},\n :status => :unauthorized # Authentication timeout\n end",
"title": ""
},
{
"docid": "e853d7d03a76c3b94d81549a3139a3a0",
"score": "0.73466045",
"text": "def check_authentication\n render json: { error: 'Please log in' }, status: 401 if !logged_in?\n end",
"title": ""
},
{
"docid": "d1134e8c2a60d8441e20b8815cc0699a",
"score": "0.73427653",
"text": "def require_login\n authenticate_token || render_unauthorized(\"Access denied\")\n end",
"title": ""
},
{
"docid": "cb6b0c78473413b51dd87533157beb91",
"score": "0.7338412",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "1b9d268bef058f00a77ef4d68404fa54",
"score": "0.73382217",
"text": "def unauthorized; end",
"title": ""
},
{
"docid": "629f7817e4cdd260c59bf27c3ff050fc",
"score": "0.73381245",
"text": "def invalid_authentication\n render json: { error: 'Invalid Request' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "629f7817e4cdd260c59bf27c3ff050fc",
"score": "0.73381245",
"text": "def invalid_authentication\n render json: { error: 'Invalid Request' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "f93f770c9e0562a483a9d06be553cb2e",
"score": "0.7317909",
"text": "def auth\n auth_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "983cec0732e30784ad73988aed6e69f8",
"score": "0.7317039",
"text": "def invalid_action\n render json: { 'error': 'You have to authenticate to do this.' }, status: 401\n end",
"title": ""
},
{
"docid": "54b280921d49c9bdb72895c09d417b65",
"score": "0.731363",
"text": "def render_authenticate_error(message:)\n render_error(401, message: message)\n end",
"title": ""
},
{
"docid": "9f94e357f63b21387d760f531f5b1fb4",
"score": "0.73075455",
"text": "def authenticate!\n current_user || render_unauthorized\n end",
"title": ""
},
{
"docid": "31a6c6586135f9becee166cbc2523bf9",
"score": "0.7301614",
"text": "def invalid_authentication\n render jsonapi: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "e6527aab37d96e5bce189ebda00b83fd",
"score": "0.7300364",
"text": "def authenticate!\n headers \"WWW-Authenticate\" => %(Basic realm=\"#{@site.title}\") and\n @error_message = \"Not authorized\\n\" and throw(:halt, [401, erb(:error)]) and\n return unless authenticated?\n end",
"title": ""
},
{
"docid": "2eec3d8f2d9251566b3311a307e7bf8c",
"score": "0.72916365",
"text": "def authenticate_error\n # User's token is either invalid or not in the right format\n render json: { error: 'unauthorized' }, status: 401 # Authentication\n end",
"title": ""
},
{
"docid": "fd19454262e80a219dfdea00a2a8269e",
"score": "0.7287468",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "fd19454262e80a219dfdea00a2a8269e",
"score": "0.7287468",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "bf61e57b4cdeacb1855de0d40a67ec7e",
"score": "0.72856617",
"text": "def protected!\n unless authorized_token?\n response['WWW-Authenticate'] = %(Basic realm=\"Restricted Area\")\n throw(:halt, [401, \"Not authorized\\n\"])\n end\n end",
"title": ""
},
{
"docid": "73e37b3a224bb69abc726c17d113a872",
"score": "0.72790265",
"text": "def access_forbidden\n unless @authenticated\n # The user is not authenticated; ask for credentials\n respond_to do |format|\n format.html { redirect_to login_url }\n format.xml { request_http_basic_authentication \"Accounting\" }\n end\n else\n # The user is authentication but unauthorized for this resource\n head :forbidden\n end\n end",
"title": ""
},
{
"docid": "2e49418b7605bec7c375791ac0bd5bb5",
"score": "0.7268325",
"text": "def protected!\n\t\t\tunless authorized?\n\t\t\t\tresponse['WWW-Authenticate'] = \\\n\t\t\t\t\t%(Basic realm=\"Concerto Configuration\")\n\t\t\t\tthrow(:halt, [401, \"Not authorized\\n\"])\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "6f5cbf1478b631caed5104f8ff7f3f70",
"score": "0.7264053",
"text": "def authenticate!\n user = try_authenticate\n return user if user\n headers['WWW-Authenticate'] = 'Basic realm=\"Restricted Area\"'\n halt 401, (te :not_authorized, {message: \"Invalid username or password.\"})\nend",
"title": ""
},
{
"docid": "21540396486f1028d2484c06bf1302d1",
"score": "0.7262327",
"text": "def protected!\n unless authorized_basic?\n response['WWW-Authenticate'] = %(Basic realm=\"Restricted Area\")\n throw(:halt, [401, \"Not authorized\\n\"])\n end\n end",
"title": ""
},
{
"docid": "71ea1c8af46fed0e1879ad316d9b528a",
"score": "0.7262049",
"text": "def access_denied\n case content_type\n when :html\n store_location\n redirect url(:login)\n when :xml\n headers[\"Status\"] = \"Unauthorized\"\n headers[\"WWW-Authenticate\"] = %(Basic realm=\"Web Password\")\n set_status(401)\n render :text => \"Couldn't authenticate you\"\n end\n end",
"title": ""
},
{
"docid": "a933bc7e5e403b10273b2880f9a46217",
"score": "0.7261728",
"text": "def access_denied\n case content_type\n when :html\n store_location\n redirect url(:login)\n when :xml\n headers[\"Status\"] = \"Unauthorized\"\n headers[\"WWW-Authenticate\"] = %(Basic realm=\"Web Password\")\n self.status = 401\n render \"Couldn't authenticate you\"\n end\n end",
"title": ""
},
{
"docid": "58aa75121c0343595b073daacba75e56",
"score": "0.7259603",
"text": "def deny_access\n @status = 401\n respond_to do |format|\n format.html { render template: \"errors/401\", status: @status, layout: \"errors\" }\n format.all { render nothing: true, status: @status }\n end\n end",
"title": ""
},
{
"docid": "d01be45606c3dcb09e18fe8b95b57562",
"score": "0.7258456",
"text": "def invalid_authentication\n render json: { error: 'Invalid Request' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "39af5fb17d740b81ea53ee4a9e2ea8d1",
"score": "0.7253257",
"text": "def auth\n unless login_user\n # TODO: support JSON format\n render status: :unauthorized, text: 'Need to log in'\n end\n end",
"title": ""
},
{
"docid": "7cc8ba97536dd396c04bedc4340da081",
"score": "0.72404784",
"text": "def authenticate\n render plain: 'login required.' unless login?\n end",
"title": ""
},
{
"docid": "0641b4877d8ece47e75270b7bd486ca9",
"score": "0.72329754",
"text": "def halt_unauthorized(errors, render_options = {})\n halt_error(401, errors, render_options)\n end",
"title": ""
}
] |
a8220a42209ec24fc230e4b012c1c633
|
Handle params: appraisal company form
|
[
{
"docid": "36b84f654857bf65b8d6ddf829359bfd",
"score": "0.0",
"text": "def save\n if params[:ac].has_key? :id\n begin\n ac = AppraisalCompany.find params[:ac][:id]\n rescue\n return render json: { status: 1 }\n end\n else\n ac = AppraisalCompany.new\n end\n\n result = ac.save_with_params params[:ac]\n\n if result[:status] != 0\n render json: result\n else\n render json: { status: 0, result: ac.id }\n end\n end",
"title": ""
}
] |
[
{
"docid": "4bde5edf64926b0a1e5a3d79129cd824",
"score": "0.7178176",
"text": "def company_params\n params[:company].permit(:name, :description, :url, :contact_id, :address, :joined, :logo)\n end",
"title": ""
},
{
"docid": "b6d999aaa92b9f498039fffdf53f00a9",
"score": "0.7174688",
"text": "def company_params\n params.require(:company).permit(:name, :location, :founded_date, :category, :sub_category,\n :business_model, :target_client, :description, :main_url,\n :twitter_url, :angellist_url, :crunchbase_url, :linkedin_url,\n :facebook_url, :legalio_url, :status, :employee_count,\n :all_tags, :category_id, :sub_category_id, :target_client_id,\n :business_model_id, :visible, :contact_name, :contact_email,\n :codex_presenter, :codex_presentation_date)\n end",
"title": ""
},
{
"docid": "b21db324db815271098cd8cd577e8b29",
"score": "0.7106467",
"text": "def company_params\n if params[:company]\n params.require(:company).permit(:name, :size_id, :location_id, :site, :logo, :recrutmentagency, :description, :realy, :industry_id)\n end\n end",
"title": ""
},
{
"docid": "3bb364d95aa5b66b2b84c3f95efc627a",
"score": "0.70923656",
"text": "def company_params\n\t\t\tparams.require(:company).permit(:name, :ticker, :description, :reference, :currency, :country, :bourse, :sector, :year_inc, :mkt_sector, :mkt_segment, :www_address, :isin, :share_type, :address, :logo)\n\t\tend",
"title": ""
},
{
"docid": "98cfe842f91a78dd457e190ea6b605c9",
"score": "0.7072563",
"text": "def company_params\n params.\n require(:company).\n permit( :user_id, \n :name, \n :description, \n :tagline, \n :audience, \n :launch_date, \n :add_role, \n :id, \n :location,\n :category_list,\n :logo )\n end",
"title": ""
},
{
"docid": "aeaec3d235362e9c772ac7d5062fc453",
"score": "0.7070626",
"text": "def company_params\n params.require(:company).permit(:name, :business_type, :outline)\n end",
"title": ""
},
{
"docid": "0e0b908f374659d55788eff00bf329a6",
"score": "0.70641947",
"text": "def admins_company_params\n params[:company]\n end",
"title": ""
},
{
"docid": "b40debe1461652a499c78ea0f2e80fad",
"score": "0.7032189",
"text": "def company_params\n params.fetch(:company, {})\n end",
"title": ""
},
{
"docid": "1ef9122b16d588e68cb578bd49dc3a55",
"score": "0.70168734",
"text": "def company_params\n params.fetch(:company, {})\n end",
"title": ""
},
{
"docid": "28ca8cbbb79358ffa34db67368a68ffc",
"score": "0.7011425",
"text": "def company_params\n params.require(:company).permit(\n :logo,\n :name,\n :description,\n :business_entity,\n :vatcode,\n :company_id_number,\n :cea,\n :registration_date,\n :address,\n :meta_title,\n :meta_keywords,\n :meta_description,\n :state_event\n )\n end",
"title": ""
},
{
"docid": "385a10c39cd7202510a72dc2948e515e",
"score": "0.70083964",
"text": "def company_params\n params.require(:company).permit(:name, :site, :cnpj, :email, :cpf)\n end",
"title": ""
},
{
"docid": "fac69a94a2cff03241a96ea8e9fe645c",
"score": "0.6995669",
"text": "def company_params\n params.require(:company).permit(:name, :phone, :email, :website, :address, :type_id, :background, :owner_id)\n end",
"title": ""
},
{
"docid": "be8601d08cb3ee437d7cc2bb81e6e3d7",
"score": "0.6987768",
"text": "def company_params\n params.require(:company).permit(:name, :description, :location, :website)\n end",
"title": ""
},
{
"docid": "deeebe89b4052b0c2527517d6858ebda",
"score": "0.6977638",
"text": "def company_params\n params.require(:company).permit(:name, :phone, :description, :branch_id, :province_id, \n :erp_system_id, :inventory_system_id, :salary_system_id, :logistics_system_id, :improve_process_id)\n end",
"title": ""
},
{
"docid": "5d3c97cb5c941fa65efa609f8da9e1da",
"score": "0.6973207",
"text": "def company_params\n params.fetch(:company, {}).permit(:company_name, :company_id)\n end",
"title": ""
},
{
"docid": "91d167a86b25dba40674c26eaef5d5d5",
"score": "0.69642764",
"text": "def builder_company_params\n params.fetch(:builder_company, {})\n end",
"title": ""
},
{
"docid": "e66da3b91341f40e8cf69d121723b20f",
"score": "0.69560015",
"text": "def company_params\n params.require(:company).permit(:name, :bill_num, :tel_office, :apply_at)\n end",
"title": ""
},
{
"docid": "ea653ce1b607942320251ed2be649ec4",
"score": "0.6954326",
"text": "def applying_company_params\n params[:applying_company]\n end",
"title": ""
},
{
"docid": "0d6614bef4ae01e3e24a59fecac43d2f",
"score": "0.69481105",
"text": "def company_params\n begin\n params.require(:company).permit(:name, :description, :total_employee, :address, :country)\n rescue\n {}\n end\n end",
"title": ""
},
{
"docid": "78d66cf0bf18a0fd5a006f400bb983fc",
"score": "0.69453907",
"text": "def company_params\n params.require(:company).permit(:name, :administrator, :cif, :telephone, :other_telephone, :mobile, :fax, :mail, :web, :observations)\n end",
"title": ""
},
{
"docid": "441ae7e691138db7bb24d06ff394212c",
"score": "0.6942399",
"text": "def company_params\n params.require(:company).permit(:compName, :hrName, :contactNumber, :compPostalAddress, :email, :website,:password)\n end",
"title": ""
},
{
"docid": "2694c5daa8a83f4610b5e273e3ff68e5",
"score": "0.69395435",
"text": "def company_params\n params.require(:company).permit(:nome, :cnpj, :telefone, :email, :celular, :contato,:collector_id)\n end",
"title": ""
},
{
"docid": "d4ac0d550168d73ce3a4d803e83b3718",
"score": "0.69352174",
"text": "def company_params\n params.require(:company).permit(:short, :name, :address_city, :address_street, :address_house, :address_number, :address_postal_code, :phone, :email, :nip, :regon, :pesel, :informal_group, :note, :user_id)\n end",
"title": ""
},
{
"docid": "d71793ca742a079aa4560409255dc8a9",
"score": "0.6931599",
"text": "def company_params\n params.require(:company).permit(:name, :description, :lead_source, :job_types, :website,\n :monthly_total, :address, :status, :total_hours, :one_time_cost,\n :facebook, :twitter, :linkedin, :instagram, :notes)\n end",
"title": ""
},
{
"docid": "bfe17443d56723d37efcb13328da9652",
"score": "0.69253993",
"text": "def company_params\n params.require(:company).permit(:t_name, :t_logo, :t_slogan, :processmap)\n end",
"title": ""
},
{
"docid": "aac63dcac10f0d39234a302813483879",
"score": "0.69188523",
"text": "def company_params\n params.require(:company).permit(:name, :description, :logo, :city)\n end",
"title": ""
},
{
"docid": "943ff0de2bf77d9bd819f0c2b4edaf9f",
"score": "0.6906939",
"text": "def company_params\n\t params.require(:company).permit(:name, :service_id, :location, :phone_number, :user_id)\n\t end",
"title": ""
},
{
"docid": "d01d7383de34fa84aab84247779e1999",
"score": "0.6904917",
"text": "def company_params\n params.require(:company).permit(:name, :web_page, :email, :address, :phone, :logo)\n end",
"title": ""
},
{
"docid": "7e254debb77970264253589abf05a0a9",
"score": "0.6898117",
"text": "def company_params\n params.require(:company).permit(:name, :logo, :cover, :employees, :website, :address, :estabish, :investment, :overview)\n end",
"title": ""
},
{
"docid": "ccc2f24646b0c0b4d8de507ca6f0b5f7",
"score": "0.68956447",
"text": "def company_params\n params.require(:company).permit(:name, :address, :manager, :tel, :email, :qq, :status)\n end",
"title": ""
},
{
"docid": "0716b79dcf86cd6a8c8a5ae7edc88b89",
"score": "0.6894369",
"text": "def company_params\n # erase the user_id because is create for the current_user\n params.require(:company).permit(:name, :description, :address, :total_validation, :logo, :status, :industry_ids)\n end",
"title": ""
},
{
"docid": "14df5768ed3b88c7a502041f3e737de4",
"score": "0.68905956",
"text": "def company_params\n params.require(:company).permit(:name, :industry, :address, :phone, :email, :user_id)\n end",
"title": ""
},
{
"docid": "9a6974b5b9bf390b40c65039bac0ea8f",
"score": "0.68850166",
"text": "def company_params\n params.require(:company).permit(:name, :site_url, :logo_url, :describe, :company_field_id)\n end",
"title": ""
},
{
"docid": "f696a728aba4548f376d60fcec98e83d",
"score": "0.6884894",
"text": "def company_params\n params.require(:company).permit(:name, :description, :industry, :location, :subdomain, :website, :benefits, :plan_id, :stripe_card_token, :logo, :completed, :temp_logo_id, :background_colour, :header_colour)\n end",
"title": ""
},
{
"docid": "605b79a3b41c62cd9398a0a700a4c23e",
"score": "0.68826663",
"text": "def company_params\n params.require(:company).permit(:name, :cuit, :province, :city, :address, :phone, :email)\n end",
"title": ""
},
{
"docid": "30b9df2adbc4a32dc252a0529be13b0e",
"score": "0.68762994",
"text": "def company_params\n params.require(:company).permit(:name, :license_number, :started_at, :founder_name, :contact, :address)\n end",
"title": ""
},
{
"docid": "8c56139227d660dd03c21a1b744ebdc2",
"score": "0.68708503",
"text": "def company_params\n params.require(:company).permit(:name, :vat_number, :ssn, :client, :supplier, :workshop, :transporter, :vehicle_manufacturer, :item_manufacturer, :notes, :formation_institute, :institution, :search)\n end",
"title": ""
},
{
"docid": "3887263f3b411aaed7074bb470652343",
"score": "0.68609995",
"text": "def company_params\n params.require(:company).permit(:name, :description, :company_type, :load_type_id, :sector, :legal_representative, :address, :phone, :user_id, :constitution_date, :active, :image, :identify)\n end",
"title": ""
},
{
"docid": "06fe47df54042c455bccf0b266b08c0a",
"score": "0.68543875",
"text": "def company_params\n params.require(:company).permit(:title, :description, :programs,\n :community_involvement,\n :misdemeanors,\n :average_wage,\n :employee_benefits,\n :background_checks,\n :finances,\n :discrimination,\n :hiring_process,\n :legality,\n :peer_relations,\n :management,\n :workload,\n :hr_cooperation,\n :work_conditions,\n :ratings)\n end",
"title": ""
},
{
"docid": "315cf2468ec698d5cd5f57d1e1eba7b0",
"score": "0.68530375",
"text": "def company_params\n params.require(:company).permit(:image_url, :name, :head_office_address, :certificate_no, :date_of_issue, :sales_office_address, :phone, :hotline, :email, :type_company, :head_area_id, :branch_area_id)\n end",
"title": ""
},
{
"docid": "b1b0194b6c98acc496723c5e51768813",
"score": "0.6848909",
"text": "def company_params\n params.require(:company).permit(:company_name, :short_name, :kind, :cpf_cnpj, :street, :number, :city, :zipcode, :state, :neighborhood, :phone, :user_id,:company_email)\n end",
"title": ""
},
{
"docid": "5dfa2a56aa71a0fc76994b58c17adb9e",
"score": "0.68446904",
"text": "def company_params\n params.require(:company).permit(\n :name, :address, :point_rate, :logo, :logo_cache, :category_id, :partner,\n :contact_name, :phone, :email, :website, :fax\n )\n end",
"title": ""
},
{
"docid": "4a8a153f033528d25fda1ed4eaadddd6",
"score": "0.6840398",
"text": "def company_params\n params.require(:company).permit(:company_name, :description, :office_phone, :fax_phone, :email, :website, :non_profit, :charity_navigator, :guide_star, :address_1, :address_2, :city, :state, :country, :zip_code, :latitude, :longitude, :facebook, :twitter, :google_plus, :instagram, :pinterest, :tubler, :published)\n end",
"title": ""
},
{
"docid": "fbd4874668856b0151e5696f604ab9bd",
"score": "0.6838252",
"text": "def company_params\n params.delete :utf8\n params.permit!#(:name, :phone, :address, :logo, :contact_person, :avg_price, :site, :notes, :service_id, :service_ids)\n end",
"title": ""
},
{
"docid": "a0eeb9d634bee576a4cb48a58e96663a",
"score": "0.6838194",
"text": "def company_params\n # :company is the key to access the values\n # :company do not want anyone to teach anything except for company and white list what the user can touch\n params.require(:company).permit(:name, :description, :industry, :website, :location)\n end",
"title": ""
},
{
"docid": "7f034323492e1c6ce203ef69e79c6455",
"score": "0.68330497",
"text": "def company_params\n params.require(:company).permit(:name, :description, :contact_phone)\n end",
"title": ""
},
{
"docid": "bab0a1fcef28b61edb5782b50965e053",
"score": "0.68312544",
"text": "def company_params\n params.require(:company).permit(:user_id, :name, :location_id, :description, :web, :phone)\n end",
"title": ""
},
{
"docid": "d4028530fe792bbb55420e702ac8a2ec",
"score": "0.6830113",
"text": "def company_params\n params.require(:company).permit(:name, :contact, :email1, :email2, :webpage, :phone1, :phone2, :fax, :address1, :address2, :city, :state, :zip, :country, :description)\n end",
"title": ""
},
{
"docid": "51f42f1c76b0b798eac783e625909f1e",
"score": "0.68260616",
"text": "def company_params\n params.permit(:name, :abn, :acn, :tfn, :contact_number, :contact_email, :company_type)\n end",
"title": ""
},
{
"docid": "9736be75d085b15eb15aa0d9ff69f9dc",
"score": "0.6825736",
"text": "def company_params\n\t\t\tparams.require(:company).permit(:name, :plan_id, :logo, :remove_logo, :payment_status_id, :pay_due, :web_address, :description, :cancellation_policy, :months_active_left, :due_amount, :due_date, :active, :show_in_home, :country_id, company_setting_attributes: [:before_booking, :after_booking, :allows_online_payment, :account_number, :company_rut, :account_name, :account_type, :bank_id, :mails_base_capacity, :booking_leap, :allows_overlap_hours, :require_cashier_code], economic_sector_ids: [], company_countries_attributes: [:id, :country_id, :web_address, :active])\n\t\tend",
"title": ""
},
{
"docid": "1f92725bc9793372a8ef47d036d139e8",
"score": "0.6824139",
"text": "def company_params\n params.require(:company).permit(:company_name, :company_website, :company_email, :company_phone, :industry, :photo_company)\n end",
"title": ""
},
{
"docid": "c07a7789e31e7b65180cfd763545bab1",
"score": "0.68198466",
"text": "def company_params\n params.require(:company).permit(:title, :logo, :description)\n end",
"title": ""
},
{
"docid": "a302b2e1f6cb92d08bf1416e37d52652",
"score": "0.68101615",
"text": "def company_params\n params.require(:company).permit(:name, :countr_code)\n end",
"title": ""
},
{
"docid": "d07ff1f718de329c79d07843c26131e3",
"score": "0.68078583",
"text": "def about_company_params\n params.require(:about_company).permit(:is_confirm,:code, :name, :description, :status)\n end",
"title": ""
},
{
"docid": "fe1e702591d73af3da4ec23353da39bb",
"score": "0.68010116",
"text": "def company_params\n params.fetch(:company, {}).permit(:name, :email_subject_line, :email_title, :email_body, :tier)\n end",
"title": ""
},
{
"docid": "41bab3abe7d12280b24ea2fecbb06ef9",
"score": "0.67998725",
"text": "def company_params\n params.require(:company).permit(:name, :address, :city, :state, :zipcode, :contact_name, :contact_email)\n end",
"title": ""
},
{
"docid": "dbab4c53f089748c78b22be366d15636",
"score": "0.6799772",
"text": "def company_params\n params.require(:company).permit(:name).merge(user_id: current_user.id)\n end",
"title": ""
},
{
"docid": "0807a2f5c31cb4977386e95cbad5e2ee",
"score": "0.67991215",
"text": "def company_params\n params.require(:company).permit(:name, :authorization_code, :rc_number, :company_type_id, :incorporation_date, :email_reminder, :registered_office_address, :registered_office_city, :registered_office_state, :annual_return_date, :accounts_date, tstore: [])\n end",
"title": ""
},
{
"docid": "63a7835cfb4d50d009daedc1fdaa1c9a",
"score": "0.6797694",
"text": "def company_params\n params.require(:company).permit(%i[name name_complete type url description city country])\n end",
"title": ""
},
{
"docid": "b8e505b101d11155a0e7845cff97d412",
"score": "0.67920464",
"text": "def company_params\n params[:company]\n .permit(:external_id, :name, :active, :omit, :needs_update, :needs_update_sent, :last_updated, :address, :city, :state, :zip, :island, :phone_1, :phone_2, :fax_pre, :fax, :website, :email, :certified, :country, :established_year, :products, :products_info, :notes_1, :notes_2, :employ, :annual_volume, :exporter, :export_sales, :title_1, :salutation_1, :salutation_2, :tob_grower, :tob_distributor, :tob_wholesaler, :tob_processor, :tob_manufacturer, :tob_retailer, :tob_other, :tob_otherdesc, :serv_mailorder, :serv_delivery, :serv_packing, :serv_growing, :serv_labeling, :serv_bulk, :serv_retail, :serv_other, :serv_otherdesc)\n end",
"title": ""
},
{
"docid": "ce8447295c00ea6fbb8ca24e421a2d51",
"score": "0.6791512",
"text": "def company_params\n params.require(:company).permit(:name, :description, :website, :address1, :address2, :city, :state, :zip, :phone)\n end",
"title": ""
},
{
"docid": "2edced96a0b18c569c5699481fae8daa",
"score": "0.6789015",
"text": "def company_params\n params.require(:company).permit(:name, :logo, :phone, :website, :instagram)\n end",
"title": ""
},
{
"docid": "a470818a4eb9f7e7f72dc5f23a2d35d3",
"score": "0.67867935",
"text": "def admin_company_params\n params.require(:admin_company).permit(:name, :description, :website, :address, :country, :bussiness_type)\n end",
"title": ""
},
{
"docid": "cf46afe75fcff9b4b0b44f165ffade1a",
"score": "0.678512",
"text": "def company_params\n params.require(:company).permit(:name, :vote_type, :vote_location, :page, :device_id)\n end",
"title": ""
},
{
"docid": "cf46afe75fcff9b4b0b44f165ffade1a",
"score": "0.678512",
"text": "def company_params\n params.require(:company).permit(:name, :vote_type, :vote_location, :page, :device_id)\n end",
"title": ""
},
{
"docid": "6e771e2db44e2035e0fe0c4aee5ad769",
"score": "0.6769119",
"text": "def company_params\n unless company_uid.blank? && company_name.blank? && company_address.blank?\n if company_uid.blank?\n errors.add 'company_uid', 'is_blank'\n end\n if company_name.blank?\n errors.add 'company_name', 'is_blank'\n end\n if company_address.blank?\n errors.add 'company_address', 'is_blank'\n end\n end\n end",
"title": ""
},
{
"docid": "841f5c63b9442f0653abff4bb35e28fd",
"score": "0.6767835",
"text": "def company_params\n params.require(:company).permit(:address_1, :address_2, :city, :name, :fax, :phone, :state, :zip, :established_on,\n :license_number, :service_provided, :service_summery, :website, :logo,\n :remote_logo_url, :remove_logo, :logo_cache, :sales_tax)\n end",
"title": ""
},
{
"docid": "740757dedd15055018493f0bcd9573de",
"score": "0.676568",
"text": "def set_companyform\n @companyform = Companyform.find(params[:id])\n end",
"title": ""
},
{
"docid": "df191b0fb45a31ed4612243853b53c65",
"score": "0.67646116",
"text": "def company_params\n params.require(:company).permit(:name, :homepage_url, :category_code, :crunchbase_url, :twitter_username, :description, :founded_year, :total_money_raised, :address1, :address2, :city, :state_code, :zip_code, :latitude, :longitude, :number_of_employees)\n end",
"title": ""
},
{
"docid": "5dac911b14a854ff206807a2c417f5e4",
"score": "0.6759455",
"text": "def company_params\n @user = current_user\n params.require(:company).permit(:company_name, :company_about_us, :company_address_street,\n :company_address_city, :company_address_zip, :company_address_country,\n :company_invoice_address_street, :company_invoice_address_city,\n :company_invoice_address_zip, :company_invoice_address_country,\n :company_invoice_reference, :company_invoice_email,\n :company_contact_person_first_name, :company_contact_person_last_name,\n :company_contact_person_cell_phone, :company_contact_person_phone_no,\n :company_contact_person_email, :company_number, :company_ftex,\n :company_web_address, :company_logo, :company_invoice_address_street2,\n :company_state, :invoice_person_name, :invoice_person_name_phone_number,\n :category_name, :company_phone_number)\n end",
"title": ""
},
{
"docid": "ac7498d2a1d50a13c551921e31fab471",
"score": "0.6757692",
"text": "def agricultural_company_params\n params.require(:agricultural_company).permit(:name, :address, :phone, :responsable)\n end",
"title": ""
},
{
"docid": "f7d11257adc318b77b50cbf1e613fdbd",
"score": "0.6757358",
"text": "def company_info_params\n params.require(:company_info).permit(:company_name, :address, :website, :user_id)\n end",
"title": ""
},
{
"docid": "22f4e7c5e0076074cb967f3cf8fc561e",
"score": "0.6753892",
"text": "def company_params\n params.require(:company).permit(:email, :company_name, :contact_name, :date, :time, :address, :details)\n end",
"title": ""
},
{
"docid": "24dc7620a7b6d4ed6dbbd8484521bc01",
"score": "0.67531484",
"text": "def company_params\n params.require(:company).permit(:name, :branch_name, :telephone, :address, :email, :business_hours, :charges, :main_type, :sub_type, :company_no, :lat_lng)\n end",
"title": ""
},
{
"docid": "8c7e6c36c7b8d7ac5b69b2b586e3d276",
"score": "0.67514914",
"text": "def company_params\n params.require(:company).permit(:name, :tax_id, :currency, :address, :email, :url, :email_body, :email_subject, :phone)\n end",
"title": ""
},
{
"docid": "1ecd11931d8187e06d758f5d05f4dd1b",
"score": "0.6748453",
"text": "def company_params\n params.require(:company).permit(:name, :country_id, :state_id, :city_id, :postcode, :start_date, :active)\n end",
"title": ""
},
{
"docid": "92d1aa5cf053164f44d9eac9f4ee91df",
"score": "0.6737427",
"text": "def company_params\n params.require(:company).permit(:name, :linkedin_url, :twitter_url, :youtube_url, :facebook_url, :instagram_url, :revenue, :address, :address_2, :address_3, :city, :state, :country, :zip)\n end",
"title": ""
},
{
"docid": "656afafdcc0ea46ba331de37f5262c78",
"score": "0.67354345",
"text": "def company_params\n params.require(:company).permit(:name, :full_name, :zip_code, :city, :street, :street_address, :nip, :regon)\n end",
"title": ""
},
{
"docid": "422a785b91b6e2080984c7f6e9d2230a",
"score": "0.6732164",
"text": "def business_company_params\n params.require(:business_company).permit(:company_name, :website_url, :company_email, :contact_person, :mobile, :city, :services, :Pan, :Bank_name, :Account_no, :IFSC, :TIN, :TAN, :referal)\n end",
"title": ""
},
{
"docid": "ca348b4ef7ef6d543bed0066818b37db",
"score": "0.6730859",
"text": "def company_params\n params.require(:company).permit(:name, :employee_count, :engineer_count, :notes, :good, :bad, :motivation, :via)\n end",
"title": ""
},
{
"docid": "959202da07a8ab24f7ad2e2ebbdd0525",
"score": "0.67297906",
"text": "def company_params\n params.require(:company).permit(:name, :location, :company_type)\n end",
"title": ""
},
{
"docid": "2a2394062d3a77477c53ce18d8aeac3a",
"score": "0.6723975",
"text": "def company_params\n params.require(:company).permit(:name, :rfc, :address, :telephone, :email)\n end",
"title": ""
},
{
"docid": "9df536d946ad7eb87cfaab1f6e748e1f",
"score": "0.6717663",
"text": "def company_params\n params.require(:company).permit(:name, :picture, :address, :description, :site)\n end",
"title": ""
},
{
"docid": "a540897118c47171e6f85b1052e8bc8f",
"score": "0.6711571",
"text": "def company_params\n params.require(:company).permit(:name).merge(user: current_user)\n end",
"title": ""
},
{
"docid": "db38db5486b4592704152c68883ab249",
"score": "0.6709056",
"text": "def company_params\n params.require(:company).permit(:nombre, :logo, :address, :username, :password, :port, :security, :user_id)\n end",
"title": ""
},
{
"docid": "1fae2d27a70c9233445320749c522ff9",
"score": "0.67078394",
"text": "def company_params\n params.require(:company).permit(:email, :code, :name, :logo, :society_name, :invoice_footer, :cuit, :concepto, :moneda, :iva_cond, :country, :province_id, :locality_id, :postal_code, :address, :activity_init_date, :contact_number, :environment, :cbu, sale_points_attributes: [:id, :name, :_destroy], credit_cards_attributes: [:id, :name, :current_amount, :_destroy], banks_attributes: [:name, :cbu, :account_number, :current_amount, :id, :_destroy], default_tributes_attributes: [:id, :tribute_id, :default_aliquot, :_destroy])\n end",
"title": ""
},
{
"docid": "ea80b5243d704d4b11953c3e53279abe",
"score": "0.66941565",
"text": "def company_params\n if current_user.is_admin?\n return params.require(:company).permit(:name, :plan_id, :whitelabel_text, :whitelabel_icon_url, :watermark_image_url, :header_image_url, :footer_image_url, :company_logo_url, :default_plan_id, :contract_start_date, :contract_end_date, :allow_uploads, :simplified_workflow, :request_user_email, :videos_require_approval)\n else\n return params.require(:company).permit(:name, :plan_id, :whitelabel_text, :whitelabel_icon_url, :watermark_image_url, :header_image_url, :footer_image_url, :company_logo_url)\n end\n end",
"title": ""
},
{
"docid": "50df5341611ff2a1d7f639d3881f1823",
"score": "0.6691533",
"text": "def company_params\n params.require(:company).permit(:user_id, :name, :media, :job, :detail, :is_active)\n end",
"title": ""
},
{
"docid": "28417c00d9da289d0024dd468ec9f277",
"score": "0.6689987",
"text": "def company_params\n params.require(:company).permit( :name, :contact_name, :contact_email, :contact_position )\n end",
"title": ""
},
{
"docid": "36ee63bed4419fca2a6984b199e93235",
"score": "0.66821754",
"text": "def re_company_params\n params.require(:re_company).permit(:name, :website, :addr, :size, :found_year, :synopsis)\n end",
"title": ""
},
{
"docid": "465344c2b0f6b92f60bfaa3c4d6402ca",
"score": "0.66723007",
"text": "def company_params\n params.require(:company).permit(:id, :email, :companyname, :name, :phone)\n end",
"title": ""
},
{
"docid": "140fcc42c1a541d848a5e01d7d6cef2c",
"score": "0.6659153",
"text": "def company_params\n params.require(:admins_company).permit(:name, :phone, :email, :code, :session_hourly_rate, :currency, :url)\n end",
"title": ""
},
{
"docid": "415c78a8b54a010574b92fbde2552a2d",
"score": "0.6658059",
"text": "def company_params\n params.require(:company).permit(:name,\n :release,\n :website,\n :linkedin,\n :email,\n :phone,\n :city,\n :state,\n :address,\n :cnpj,\n :logo)\n end",
"title": ""
},
{
"docid": "8c2260b6b0802d80631cd71e929759af",
"score": "0.66517365",
"text": "def company_params\n params.require(:company).permit!\n end",
"title": ""
},
{
"docid": "8c2260b6b0802d80631cd71e929759af",
"score": "0.66517365",
"text": "def company_params\n params.require(:company).permit!\n end",
"title": ""
},
{
"docid": "7968c24c17fb9191487933ec9d30682c",
"score": "0.66426736",
"text": "def company_params\n params.require(:company).permit(:name)\n end",
"title": ""
},
{
"docid": "7968c24c17fb9191487933ec9d30682c",
"score": "0.66426736",
"text": "def company_params\n params.require(:company).permit(:name)\n end",
"title": ""
},
{
"docid": "7968c24c17fb9191487933ec9d30682c",
"score": "0.66426736",
"text": "def company_params\n params.require(:company).permit(:name)\n end",
"title": ""
},
{
"docid": "7968c24c17fb9191487933ec9d30682c",
"score": "0.66426736",
"text": "def company_params\n params.require(:company).permit(:name)\n end",
"title": ""
},
{
"docid": "7968c24c17fb9191487933ec9d30682c",
"score": "0.66426736",
"text": "def company_params\n params.require(:company).permit(:name)\n end",
"title": ""
},
{
"docid": "7968c24c17fb9191487933ec9d30682c",
"score": "0.66426736",
"text": "def company_params\n params.require(:company).permit(:name)\n end",
"title": ""
}
] |
693a1f10ed4182f342e4ec89d99e0078
|
Call this after evaluation. Returns a newlyevolved population.
|
[
{
"docid": "bb37341a5a2d41f2cf7c7b86033d76b8",
"score": "0.5536258",
"text": "def evolve\n @controller.evolver.evolve self\n end",
"title": ""
}
] |
[
{
"docid": "06ac6789ca7e857d55696f5e266a77bf",
"score": "0.7048242",
"text": "def evolve\n @population = selection(@population)\n new_gen = @population.map { |chromosome| chromosome.dup }\n @population += recombination(new_gen) + mutation(new_gen)\n end",
"title": ""
},
{
"docid": "1e964f87bbe919acd013a0be788c7c89",
"score": "0.7008121",
"text": "def evolve(population)\n @npop = population.dclone\n \n # Population sorting and evaluation for breeding, mutations, etc.\n prepare_speciation!\n prepare_fitness!\n prepare_novelty!\n\n mate!\n\n return @npop\n end",
"title": ""
},
{
"docid": "803c55291f4bcac04637a7acc11cf42f",
"score": "0.700347",
"text": "def population; self; end",
"title": ""
},
{
"docid": "bebe4920b771810d3b85d3f75c966dc5",
"score": "0.65031314",
"text": "def evolve\n\t\trecord_evolution() if @record_evolution\n\t\tdepopulate() \n\t\trepopulate()\n\tend",
"title": ""
},
{
"docid": "070545c861a4fec63a8a1d122f42d7a1",
"score": "0.60880476",
"text": "def generate_new_population!\n # Copy over elite monkeys to next generation\n new_population = population[elitism_range]\n\n loop do\n # Finish when we have enough new monkeys\n break if new_population.length >= population.length\n\n # Select parents for breding\n daddy, mummy = select_parent, select_parent\n\n # Breed if crossover rate allows\n siblings = if rand < crossover_rate\n daddy.breed(mummy)\n else\n [daddy, mummy]\n end\n\n # Mutate if mutation rate allows\n [0,1].each do |i|\n if rand < mutation_rate\n siblings[i] = siblings[i].mutate\n end\n end\n\n # Add to new population\n new_population += siblings\n end\n\n self.population = new_population\n end",
"title": ""
},
{
"docid": "e035b6b35ce3684589d4a80119336e70",
"score": "0.60593855",
"text": "def cull_overpopulation!\n if @population < @pool.length\n @pool.pop(@pool.length - @population)\n end\n end",
"title": ""
},
{
"docid": "932c48b7d8d5a30fedcc61e26a54d160",
"score": "0.6000824",
"text": "def evolve!(num_generations = 1)\n\n @num_generations = num_generations\n seed_initial_population\n\n puts \"Starting evolution for #{@num_generations} generations ...\"\n num_generations.times do\n @generation_count += 1\n \n # calculate fitness\n @curr_population.each { |x| x.calc_fitness }\n\n # sort population by fitness\n @curr_population.sort! { |a, b| b.fitness <=> a.fitness }\n\n # print best\n best = @curr_population[0]\n puts \"Generation: #{generation_count}, best: #{best}\"\n if best.respond_to? :max_fitness and best.fitness == best.max_fitness\n puts \"Maximal fitness reached ...\"\n break\n end\n \n\n # add elites to new population\n new_pop = []\n num_elites = (@elitism_rate * @population_size).to_i\n elites = @curr_population.slice(0, num_elites)\n elites.each { |elite| new_pop << elite }\n\n # mate to create remaining population\n int_pop = mate(@curr_population, @population_size - num_elites)\n int_pop.each { |x| new_pop << x}\n\n @curr_population = new_pop\n end\n\n end",
"title": ""
},
{
"docid": "164cf63d1789c70fef07c2ddc56bda9d",
"score": "0.5989634",
"text": "def evolve(num_steps = 1)\n num_steps.times do |t|\n @population = selection(@population)\n new_gen = @population.map { |chromosome| chromosome.dup }\n\n\n if !@multi_modal\n @population += recombination(new_gen) + mutation(new_gen)\n else\n @population = deterministic_crowding(@population)\n @population = mutation(@population)\n end\n\n #cut1\n @population = selection(@population)\n\n\n @generations << @population\n end\n end",
"title": ""
},
{
"docid": "8f226735169d001cf304d46f296b2a21",
"score": "0.59809136",
"text": "def mutate_one()\n # get the best\n best = @fitness[0]\n \n # mutate it\n new_one = @population[ best[:idx] ].mutate\n \n # add newly created mutant to population\n @population << new_one\n end",
"title": ""
},
{
"docid": "a0f2e5ce84b48fc80e9b7b5b62a8a859",
"score": "0.5921609",
"text": "def population; self.class.population; end",
"title": ""
},
{
"docid": "7491af1eb1569ee2f7fa9919f44b17ba",
"score": "0.5914634",
"text": "def evolve\n g = Grid.new\n \n self.cells.each do |cell|\n g.cells << cell.evolve(alive_neighbours(cell))\n end\n \n g\n end",
"title": ""
},
{
"docid": "7491af1eb1569ee2f7fa9919f44b17ba",
"score": "0.5914634",
"text": "def evolve\n g = Grid.new\n \n self.cells.each do |cell|\n g.cells << cell.evolve(alive_neighbours(cell))\n end\n \n g\n end",
"title": ""
},
{
"docid": "ec6c7eb7807d38550ed9a3f6cfc0eb3d",
"score": "0.5906159",
"text": "def evolve()\n\t\tself.increment(INCREMENT_RATIO)\n\t\t@solution = @totalSolution.clone.limit(@currentLines, @currentColumns)\n\t\t@clmSolution = computeColumnSolution(@solution)\n\t\t@lneSolution = computeLineSolution(@solution)\n\t\t@hypotheses.validate(0)\n\t\t@hypotheses.workingHypothesis.grid.replaceAll(Cell::CELL_WHITE, Cell::CELL_CROSSED)\n\t\t@hypotheses.workingHypothesis.grid.grow(@currentLines, @currentColumns)\n\t\t@evolved = true\n\t\treturn self\n\tend",
"title": ""
},
{
"docid": "44ac50281d286d238451ea95dcacc2dd",
"score": "0.5795048",
"text": "def fitness\n @population.each{ |p| p.fitness }\n end",
"title": ""
},
{
"docid": "b72b0c2f85b9209e35a06b057f1b9d26",
"score": "0.57773834",
"text": "def update_population\n @population = 0\n @states.each { |_initials, state| @population += state.population }\n update_votes\n end",
"title": ""
},
{
"docid": "09b19c9e081ff638fa5ce19fcfc97a73",
"score": "0.5777299",
"text": "def calc_fitness\n @population.each do |p|\n p.fitness(@target)\n end\n end",
"title": ""
},
{
"docid": "9e21dfed2eb85b52cbfd4e3598539a00",
"score": "0.5765679",
"text": "def putto_population()\n #numero de cromosomas que se deben obtener nuevos\n #ordeno para obtener los mejores\n @population.sort! {\n |x,y| x.get_fitness <=> y.get_fitness\n }\n #dejo los viejos y luego reemplazo los del matting pool en estas\n #posiciones\n (@numold_chromosome..@maxnum_chromosome-1).each do |i|\n @population[i] = @mating_array[i-@numold_chromosome]\n end\n end",
"title": ""
},
{
"docid": "3e2eca8d1bde0d7a7e742a8ec3ef6fc4",
"score": "0.5758524",
"text": "def fitness\n population.each(&:fitness)\n end",
"title": ""
},
{
"docid": "89ec39e26873c5d5799cb970efbc0f41",
"score": "0.5739056",
"text": "def generation_step\n reproduce\n @solutions.each do |solution|\n solution.mutate\n end\n trigger(:on_population_generation_step)\n end",
"title": ""
},
{
"docid": "8efc1de266a58f69a53fc14865f0b39c",
"score": "0.5690897",
"text": "def reproduction\n # Refill the population with children from the mating pool\n @population.each_with_index do |p, i|\n # Sping the wheel of fortune to pick two parents\n m = random(@mating_pool.size).to_i\n d = random(@mating_pool.size).to_i\n # Pick two parents\n mom = @mating_pool[m]\n dad = @mating_pool[d]\n # Get their genes\n momgenes = mom.dna\n dadgenes = dad.dna\n # Mate their genes\n child = momgenes.crossover(dadgenes)\n # Mutate their genes\n child.mutate(@mutation_rate)\n # Fill the new population with the new child\n location = PVector.new(@width/2, @height+20)\n @population[i] = Rocket.new(location, child, @population.size)\n end\n @generations += 1\n end",
"title": ""
},
{
"docid": "44b954513d8d3603b2f79807e95f253f",
"score": "0.56548506",
"text": "def reproduction\n @population.each do |chromosome|\n AmpChromosome.mutate(chromosome,@mutation_radius,@mutation_rate,@rng)\n end\n end",
"title": ""
},
{
"docid": "2be4c6afa69aa2f83ef93d5bd9ca245a",
"score": "0.56273276",
"text": "def get_next_generation(population, fitness)\n new_population = []\n for i in 0...population.length\n # Pick 2 species according to probability distribution (as given by fitness) and cross them over\n species_1 = population[pool_selection(fitness)]\n # species_2 = population[pool_selection(fitness)]\n # child_species = cross_over(species_1, species_2)\n\n # Mutate and insert into new population\n new_population << mutate(species_1, 0.01)\n end\n return new_population\nend",
"title": ""
},
{
"docid": "97b8de22d3311bd2c01dd5ef634a0e05",
"score": "0.5610434",
"text": "def solve()\n \n target_fitness = @grid.min * 1.05\n generation = 0\n solution = nil\n population = initialize_population()\n fitnesses = population.map { |p| get_fitness(p) }\n\n # Evolve population\n while generation < MAX_GENERATIONS && !solution\n\n generation = generation + 1\n next_generation = []\n\n # Reproduce to make the next generation of solutions\n while next_generation.size < POPULATION_SIZE do\n\n # Random selection of parents\n parents = [population[rand(population.size)], population[rand(population.size)]]\n\n # Reproduction / Mutation\n operator = method(GENETIC_OPERATORS[rand(GENETIC_OPERATORS.size)])\n\n if operator.arity == 1\n next_generation << operator.call(parents[0])\n else\n next_generation << operator.call(parents[0], parents[1])\n end\n\n end\n\n # Concatenate parents and new children and make the new generation the most fit elements\n population = next_generation + population\n population = population.sort_by { |x| get_fitness(x) }.take(POPULATION_SIZE)\n fitnesses = population.map { |p| get_fitness(p) }\n\n # Check solution in current population\n min_fitness = fitnesses.min \n solution = population[fitnesses.index(min_fitness)] if min_fitness <= target_fitness\n\n end\n\n return [solution, min_fitness, generation]\n\n end",
"title": ""
},
{
"docid": "73e0a75980a9d350025f500edf09b07a",
"score": "0.56049",
"text": "def selection\n pop = self.population.sort { |a, b| b.fitness.to_f <=> a.fitness.to_f }\n @population = pop\n best_fitness = pop[0].fitness.to_f\n worst_fitness = pop.last.fitness.to_f\n acum_fitness = 0\n if best_fitness-worst_fitness > 0\n self.population.each do |chromosome|\n chromosome.normalized_fitness = (chromosome.fitness.to_f - worst_fitness)/(best_fitness-worst_fitness)\n acum_fitness += chromosome.normalized_fitness.to_f\n end\n else\n self.population.each { |chromosome| chromosome.normalized_fitness = 1}\n end\n selected_to_breed = []\n ((2*self.population_size)/3).times do\n selected_to_breed << select_random_individual(acum_fitness)\n end\n selected_to_breed\n end",
"title": ""
},
{
"docid": "72b6edb3b72f741382a5a42bbabee7ea",
"score": "0.5588153",
"text": "def advance_generation\n selected_to_breed = selection # Evaluates current population\n offsprings = reproduction selected_to_breed # Generate the population for this new generation\n replace_worst_ranked offsprings\n return best_chromosome\n end",
"title": ""
},
{
"docid": "7071cdb7e397ca280a3a72f45f986fa6",
"score": "0.55689937",
"text": "def reproduce\n # Refill the population with children from the mating pool\n @population = []\n @no_of_rockets.times do\n # Spin the wheel of fortune to pick two parents\n mom = @mating_pool.sample\n dad = @mating_pool.sample\n @population << dad.mate(mom)\n end\n @generations += 1\n end",
"title": ""
},
{
"docid": "48b856861dcb2650c8b809204297e535",
"score": "0.556857",
"text": "def evolve\n rank unless @ranked\n\n children = breed(experts)\n @people |= children\n\n @generation_num += 1\n\n rank\n trim\n end",
"title": ""
},
{
"docid": "6c1f317b9092e1c0bd27c41881f4ee7f",
"score": "0.55452317",
"text": "def cult_population\n end",
"title": ""
},
{
"docid": "a2e76984a7bc8c7bba11e045334ded2e",
"score": "0.5527149",
"text": "def solution_pop\n permutation, @reg_available, @reg_consumed, @variables = @solution.pop\n\n @reg_available.push( @reg_available.shift )\n end",
"title": ""
},
{
"docid": "ffd9af0a8cdbf8d0f884a9fe444adc30",
"score": "0.5517568",
"text": "def selection\n @population = normalize.sort!\n normalized_fitness_sum = @population.inject(0) {\n |acc, individual| individual.accumulated_normalized_fitness = acc + individual.normalized_fitness\n }\n epsilon = 0.0000000001\n raise('Accumulated normalized fitness is not 1.0') unless (normalized_fitness_sum - 1.0).abs < epsilon\n self\n end",
"title": ""
},
{
"docid": "fc3151f914072116ed52890435bb9944",
"score": "0.55040807",
"text": "def reproduction\n # Refill the population with children from the mating pool\n population.length.times do |i|\n # Sping the wheel of fortune to pick two parents\n m = rand(mating_pool.length)\n d = rand(mating_pool.length)\n # Pick two parents\n mom = mating_pool[m]\n dad = mating_pool[d]\n # Get their genes\n momgenes = mom.dna\n dadgenes = dad.dna\n # Mate their genes\n child = momgenes.crossover(dadgenes)\n # Mutate their genes\n child.mutate(mutation_rate)\n # Fill the new population with the new child\n population[i] = Rocket.new(Vec2D.new(width / 2, height + 20), child, target)\n end\n @generations += 1\n end",
"title": ""
},
{
"docid": "5ced9ec39aa04e989fba9ea19f5ca765",
"score": "0.5495617",
"text": "def run\n generate_initial_population #Generate initial population \n @max_generation.times do\n selected_to_breed = selection #Evaluates current population \n offsprings = reproduction selected_to_breed #Generate the population for this new generation\n replace_worst_ranked offsprings\n end\n return best_chromosome\n end",
"title": ""
},
{
"docid": "5ae00ea12de7013601d13927b6c2f748",
"score": "0.5466077",
"text": "def run\n mutate_population(0.1)\n remove_weakest\n breed_like_rats\n end",
"title": ""
},
{
"docid": "9a4763e6a554589054d9f602d2c129c7",
"score": "0.544654",
"text": "def higher_life_form_evolution\n lover_1, lover_2 = @population.get_mates\n offspring = lover_1.mate lover_2\n offspring.dob = @generation\n contestant = @population.random_member\n winner = offspring.fight(contestant) # <- Competition step for standard evolution\n if @population_monitor\n @population_monitor.record_mutation if offspring.mutant?\n end\n puts_winner(offspring, winner, contestant) if $verbose \n [contestant, winner]\n end",
"title": ""
},
{
"docid": "787659dc2e5c3f88ed7937bcad06de66",
"score": "0.54189134",
"text": "def mega_evolve\n mega_evolution = can_mega_evolve?\n return unless mega_evolution\n @mega_evolved = [@form, @ability]\n @form = mega_evolution\n @ability_current = @ability = data.abilities[rand(3)]\n end",
"title": ""
},
{
"docid": "f38250678e7215ea9a77f3379a996857",
"score": "0.5418095",
"text": "def reproduction\n # Refill the population with children from the mating pool\n population.length.times do |i|\n # Sping the wheel of fortune to pick two parents\n m = rand(0..mating_pool.length)\n d = rand(0..mating_pool.length)\n # Pick two parents\n mom = mating_pool[m]\n dad = mating_pool[d]\n # Get their genes\n momgenes = mom.dna\n dadgenes = dad.dna\n # Mate their genes\n child = momgenes.crossover(dadgenes)\n # Mutate their genes\n child.mutate(mutation_rate)\n # Fill the new population with the new child\n population[i] = Face.new(child, 50 + i * 75, 60)\n end\n @generations += 1\n end",
"title": ""
},
{
"docid": "f9b3bbcc1c47e94b3ed396e5b450204b",
"score": "0.54104733",
"text": "def flat_depopulate()\n\t\t#take the worst N% and kill them\n\t\t@population = @population.sort_by{ |pop| - pop[:score] }.first((@population.count * @survival_rate).round)\n\tend",
"title": ""
},
{
"docid": "cb8f997f5e6482b70ef34fbfc93ce080",
"score": "0.54052186",
"text": "def new_population(population, births)\n return population + births\nend",
"title": ""
},
{
"docid": "e139e792b3255ad3a51a43db3da61408",
"score": "0.5402063",
"text": "def evolve_once\n living_after_evolve = []\n @nrows.times do |r|\n @ncols.times {|c| living_after_evolve << [r,c] if alive_after_evolve?([r,c])}\n end\n @living = living_after_evolve\n end",
"title": ""
},
{
"docid": "fd20286ab599f8ffe85d69ac29cee1c8",
"score": "0.5364366",
"text": "def reduce(population)\r\n return nil\r\n end",
"title": ""
},
{
"docid": "116aeb068aa6dec6eb795e8b1f51e6ac",
"score": "0.5357629",
"text": "def reproduction(mating_pool)\n @population.each_index do | i |\n r1 = rand(mating_pool.length - 1)\n r2 = rand(mating_pool.length - 1)\n @population[i] = Chromosome.crossover(mating_pool[r1], mating_pool[r2])\n\n Chromosome.mutate(@population[i])\n end\n end",
"title": ""
},
{
"docid": "857e558e1b820f9be86ca04e9a7455ba",
"score": "0.5356137",
"text": "def evolve( selected, pop_size, p_cross, p_mut ) \n children = []\n selected.each_with_index do |p1, i|\n # crossing over\n ############################## non me piase sto metodo di scelgiere moglie e marito\n # 1 ::: p2 = (i.modulo(2) == 0) ? selected[i+1] : selected[i-1] # i.modulo(2) is the reminder of the division i / 2 \n # p2 = selected[0] if i == selected.size - 1\n # 2 ::: i == selected.size-1 ? p2 = selected[0] : p2 = selected[i+1] \n # 3 ::: random choise:\n j = rand(selected.size)\n j = rand(selected.size) while j == i\n p2 = selected[j]\n ch1 = {} ; ch2 = {} ; ch3 = {}\n ch1[:bitstring] , ch2[:bitstring] = crossover( p1, p2, p_cross )\n children.concat( [ ch1 , ch2 ] )\n \n # mutation\n #i.modulo(2) == 1 ? p3 = selected[i+1] : p3 = selected[i-1] # p3 is a chromosome not yet used\n k = rand(selected.size)\n k = rand(selected.size) while k == j and k == i # random choise of the chromosome that might mutate\n p3 = selected[k]\n ch3[:bitstring] = mutation( p3, p_mut )\n children << ch3\n break if children.size >= pop_size\n end\n return children\n end",
"title": ""
},
{
"docid": "337ced9adcbef9ed9e8ae9f1896938b1",
"score": "0.5350086",
"text": "def run\n generate_initial_population #Generate initial population \n @max_generation.times do\n selected_to_breed = selection #Evaluates current population \n offsprings = reproduction selected_to_breed #Generate the population for this new generation\n replace_worst_ranked offsprings\n end\n return best_chromosome\n puts @best_chromosomes_archive\n end",
"title": ""
},
{
"docid": "284a945c0a32573bef4bd8099a083738",
"score": "0.5346958",
"text": "def update()\r\n # Make sure we've still got a population to update!\r\n raise ExtinctionEvent, \"Everyone has died.\" if @agents.empty?\r\n\r\n # Run the agents through a generation cycle.\r\n # During this iteration, each agent's neural net is updated with the\r\n # appropriate information from its surroundings. The output from the\r\n # neural net is obtained and the agent is moved. If it encounters a\r\n # goal, its fitness is updated appropriately.\r\n if @ticks < Params::NUM_TICKS\r\n # Update each agent.\r\n @agents.each do |agent|\r\n # Update our position.\r\n if (not agent.respond_to @env) # error in neural net processing\r\n # Save before exiting.\r\n save_stats\r\n raise NNetProcessingError,\r\n \"Incorrect number of inputs!\"\r\n end\r\n\r\n # See if we've reached a goal.\r\n goal = agent.try_for_goal @env\r\n if goal\r\n # We've discovered a goal, so increase fitness and update\r\n # our corresponding genome.\r\n @population[agent].fitness = agent.update_fitness goal\r\n # 'Consume' the goal.\r\n consume goal\r\n else\r\n # We haven't reached a goal, so decrease fitness and update\r\n # our corresponding genome.\r\n @population[agent].fitness = agent.update_fitness\r\n end\r\n\r\n # Increment age counter.\r\n agent.update_age\r\n\r\n # Check if this agent has died.\r\n if agent.dead?\r\n @population.delete agent\r\n @agents.delete agent\r\n end\r\n end\r\n else\r\n # Another generation has been completed.\r\n # Time to run the GA and update the agents with new brains.\r\n\r\n # Keep track of Henry.\r\n puts @Henry.report(@population[@Henry]), \"\\n\"\r\n\r\n # Increment the generation counter.\r\n @generation += 1\r\n\r\n # Reset the cycle counter.\r\n @ticks = 0\r\n\r\n # Run the GA to create a new population.\r\n chromos = @GA.epoch @population.values # returns an enum\r\n\r\n # Update the stats of the generation.\r\n @fitness_averages << @GA.average_fitness.round(3)\r\n @hall_of_fame << @GA.best_fitness.round(3)\r\n\r\n # Save the stats.\r\n save_stats\r\n\r\n # Replace the old population with the new one by replacing each\r\n # agent's chromosome and brain instead of unnecessarily creating\r\n # new agents.\r\n @population.keys.each do |agent|\r\n @population[agent] = chromos.next\r\n # Insert the new (hopefully) improved brains back into the\r\n # agents.\r\n agent.set_weights(@population[agent].weights)\r\n # Reset the agent's position, fitness, and orientation.\r\n agent.reset\r\n end\r\n end\r\n # Tick.\r\n @ticks += 1\r\n\r\n quit if @generation >= Params::END_OF_THE_WORLD\r\n return true\r\n end",
"title": ""
},
{
"docid": "0cdab2da91fd840a4b0b5ad0226e1921",
"score": "0.534321",
"text": "def run\n generate_initial_population \n @max_generation.times do |generation|\n replace_worst_ranked(selection)\n reproduction\n puts \"finished gen # \" + generation.to_s\n end\n return best_chromosome, best_chromosome.normalized_fitness\n end",
"title": ""
},
{
"docid": "a1f06ab847bd2dd266aae96566e26d9c",
"score": "0.5313063",
"text": "def mutate!(population)\n @npop = population\n\n if @controller.parms.mate_only_prob.nil? or rand > @controller.parms.mate_only_prob\n log.debug \"[[[ Neuron and Gene Giggling!\"\n mutate_perturb_gene_weights!\n mutate_change_gene_weights!\n mutate_add_neurons!\n mutate_change_neurons!\n mutate_add_genes!\n mutate_disable_genes!\n mutate_reenable_genes!\n log.debug \"]]] End Neuron and Gene Giggling!\\n\"\n else\n log.debug \"*** Mating only!\"\n end\n end",
"title": ""
},
{
"docid": "53eee94202b1f1e3bf60c22be75db72a",
"score": "0.5284668",
"text": "def init_population\n (0...@pop_size).each do\n chromosome = Chromosome.new\n (0...@num_genes).each do |i|\n if @beta_values == 'discrete'\n beta = rand(0..10) / 10.0\n elsif @beta_values == 'uniform distribution'\n beta = rand 0.0..1.0\n end\n gene = @lower_bounds[i] + beta * (@upper_bounds[i] -\n @lower_bounds[i])\n chromosome << if @continuous # Wrong for discrete functions\n gene\n else\n gene.floor\n end\n end\n evaluate_chromosome chromosome\n @chromosomes << chromosome\n compare_func = @is_high_fit ? :> : :<\n if @best_chromosome.nil? ||\n chromosome.fitness.public_send(compare_func, @best_chromosome.fitness)\n @best_chromosome = chromosome.clone\n end\n end\n end",
"title": ""
},
{
"docid": "59e0c0d50766b925e16274037399b172",
"score": "0.526591",
"text": "def selection\n # Clear the ArrayList\n mating_pool.clear\n # Calculate total fitness of whole population\n max = max_fitness\n # Fitness for each member of the population (scaled to between 0 and 1)\n # Members get added to the mating pool a number of times based on fitness\n # A higher fitness = more entries to mating pool\n # A lower fitness = fewer entries to mating pool\n population.each do |pop|\n fitness_normal = map1d(pop.fitness, (0..max), (0..1.0))\n n = (fitness_normal * 100).to_i # Arbitrary multiplier\n (n - 1).times do\n mating_pool << pop\n end\n end\n end",
"title": ""
},
{
"docid": "c22b03c89ad16cbc00cf5bcad97f763f",
"score": "0.5254944",
"text": "def record_evolution\n\t\t@evolution_record = [] if @evolution_record.nil?\n\t\t@evolution_record << @population.map{|pop| pop[:score]}.sort.reverse\n\tend",
"title": ""
},
{
"docid": "622864b6374e6f439c0711cf33427fb5",
"score": "0.52517045",
"text": "def select_one population=self.population\n @ranked = @ranker.rank( population ) \n @population = population\n\n select_one_internal\n end",
"title": ""
},
{
"docid": "caf3e7cc969e9c4962cf98591ea31044",
"score": "0.525104",
"text": "def update_population(game)\n population = SteamAPI.get_game_population(game.appid)\n game.update(population: population)\n end",
"title": ""
},
{
"docid": "4349a98c4a7c0316a355ec683c48ad37",
"score": "0.52180403",
"text": "def selection\n @population.sort! { |a, b| b.fitness <=> a.fitness }\n best_fitness = @population[0].fitness\n puts \"best fitness \" + best_fitness.to_s\n @best_fitnesses_over_time << best_fitness\n worst_fitness = @population.last.fitness\n puts \"worst fitness \" + worst_fitness.to_s\n acum_fitness = 0\n if best_fitness - worst_fitness > 0\n @population.each do |chromosome| \n chromosome.normalized_fitness = (chromosome.fitness-worst_fitness)/(best_fitness-worst_fitness)\n acum_fitness += chromosome.normalized_fitness\n end\n else\n @population.each { |chromosome| chromosome.normalized_fitness = 1 }\n end\n selected_to_breed = []\n ((2*@population_size)/3).round.times do \n selected_to_breed << select_random_individual(acum_fitness)\n end\n puts \"acum fitness \" + acum_fitness.to_s \n return selected_to_breed\n end",
"title": ""
},
{
"docid": "e757116139a9adff835d7654a2af832c",
"score": "0.5213028",
"text": "def assess_population!\n # Calculate individual fitnesses and fitness sum\n self.total_fitness = 0\n population.each do |member|\n member.fitness = fitness(member)\n\n self.total_fitness += member.fitness\n end\n\n # Sort by fitness and print the generation\n self.population.sort! { |a,b| b.fitness <=> a.fitness }\n print_generation\n end",
"title": ""
},
{
"docid": "bbe37303d2623b2bd24263937b7dabf1",
"score": "0.5205915",
"text": "def evolve_silent(generations=DEFAULT_MAX_GENS)\n evolve_block(generations){}\n sort_by!{|x|x.fitness} rescue nil\n self\n end",
"title": ""
},
{
"docid": "a47126afe8f61004eee880aa30c25f6d",
"score": "0.5199481",
"text": "def alternateGeneration_Mutate()\n _nofMutation = (@population * @ratioMutate).ceil ;\n loggingDebug(:mutate, _nofMutation) ;\n (0..._nofMutation).each{|_i|\n _j = rand(@nofSurviver) ;\n loggingDebug(:murate1, :pickup, [_j]) ;\n _mutantSeed = @mutateBy.call(@oldGeneration[_j]) ;\n spawnParamSet(_mutantSeed) ;\n }\n end",
"title": ""
},
{
"docid": "079751a5d86d48f0ccb4a37c65e1359a",
"score": "0.51992637",
"text": "def clone\n\t\t\treturn GreyGoo.find(self.id)\n\t\tend",
"title": ""
},
{
"docid": "5d8a6127f07071fa727723cbb4e24e9d",
"score": "0.5192068",
"text": "def reproduce\n @solutions = @replace_strategy.replace(self)\n end",
"title": ""
},
{
"docid": "58eb6fab01ae880246f0bb02a2489f44",
"score": "0.518889",
"text": "def init_population\n (0...@pop_size).each do\n chromosome = Chromosome.new\n (0...@num_genes).each do |i|\n gene = if @continuous\n rand(lower_bounds[i].to_f..upper_bounds[i].to_f)\n else\n rand(lower_bounds[i].to_i..upper_bounds[i].to_i)\n end\n chromosome << gene\n end\n evaluate_chromosome chromosome\n verify_best_fit chromosome\n @chromosomes << chromosome\n end\n end",
"title": ""
},
{
"docid": "04269a5080c25032acb94390b44a1ab5",
"score": "0.51812136",
"text": "def selection\n @population.sort! { |a, b| b.fitness <=> a.fitness}\n best_fitness = @population[0].fitness\n worst_fitness = @population.last.fitness\n acum_fitness = 0\n if best_fitness-worst_fitness > 0\n @population.each do |chromosome| \n chromosome.normalized_fitness = (chromosome.fitness - worst_fitness)/(best_fitness-worst_fitness)\n acum_fitness += chromosome.normalized_fitness\n end\n else\n @population.each { |chromosome| chromosome.normalized_fitness = 1} \n end\n selected_to_breed = []\n ((2*@population_size)/3).times do \n selected_to_breed << select_random_individual(acum_fitness)\n end\n\n selected_to_breed\n end",
"title": ""
},
{
"docid": "deff957cde5dde1ddf47e51c62eeff3b",
"score": "0.5164273",
"text": "def computeNewEnergies\n cur = currentPlayerLocation()\n \n # subtract the energy needed for moving\n cur.player.energy -= 1\n \n if cur.food?\n # consume & move the food\n food = cur.food\n cur.player.energy += food.energy \n \n self.placeFoodRandomly(food)\n cur.food = nil\n \n food\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "5c85c9f04e165cccc3a0f02fcab7ff7e",
"score": "0.515799",
"text": "def unmega_evolve\n if @mega_evolved\n @form, @ability = @mega_evolved\n @ability_current = @ability\n @mega_evolved = false\n end\n end",
"title": ""
},
{
"docid": "0e2e4ee7f62db682b578aa6ca065920c",
"score": "0.5144878",
"text": "def selection\n # Clear the ArrayList\n mating_pool.clear\n\n # Calculate total fitness of whole population\n max_fit = max_fitness\n\n # Calculate fitness for each member of the population (scaled to value between 0 and 1)\n # Based on fitness, each member will get added to the mating pool a certain number of times\n # A higher fitness = more entries to mating pool = more likely to be picked as a parent\n # A lower fitness = fewer entries to mating pool = less likely to be picked as a parent\n population.length.times do |i|\n fitness_normal = map1d(population[i].fitness, (0..max_fit), (0..1))\n n = (fitness_normal * 100).to_i # Arbitrary multiplier\n n.times { mating_pool << population[i] }\n end\n end",
"title": ""
},
{
"docid": "11669f0fb6c016e27c1819fc5f7a71c1",
"score": "0.5138009",
"text": "def pop\n Cproton.pn_collector_pop(@impl)\n end",
"title": ""
},
{
"docid": "ed82cbab5f21632d13d121ee69da3050",
"score": "0.5137569",
"text": "def normalize\n @population.each { |individual| individual.normalized_fitness = individual.fitness/@generation_fitness.to_f }\n end",
"title": ""
},
{
"docid": "a7979945c144da25538418112d1e304c",
"score": "0.5136383",
"text": "def recalculate_population\n # Calculate #population.\n unit_counts = without_locking do\n Unit.select(\"type, COUNT(*) as count\").where(player_id: id).\n group(\"type\").c_select_all\n end\n cqe_counts = without_locking do\n connection.select_all(%Q{\nSELECT cqe.constructable_type AS type, SUM(cqe.count) AS count\nFROM `#{ConstructionQueueEntry.table_name}` AS cqe\nINNER JOIN `#{Building.table_name}` AS b ON cqe.constructor_id = b.id\nINNER JOIN `#{SsObject.table_name}` AS sso ON b.planet_id = sso.id\nWHERE cqe.constructable_type LIKE 'Unit::%' AND sso.player_id=#{id.to_i} AND\n #{ConstructionQueueEntry.prepaid_condition(:table_alias => 'cqe')}\nGROUP BY cqe.constructable_type\n })\n end\n\n self.population = unit_counts.inject(0) do |sum, row|\n type = \"Unit::#{row[\"type\"]}\"\n klass = @@class_cache[type] ||= type.constantize\n sum + klass.population * row[\"count\"]\n end + cqe_counts.inject(0) do |sum, row|\n type = row[\"type\"]\n klass = @@class_cache[type] ||= type.constantize\n sum + klass.population * row[\"count\"].to_i\n end\n\n # Calculate #population_cap\n owned_planet_ids = without_locking do\n SsObject::Planet.select(\"id\").where(player_id: id).c_select_values\n end\n types = Building.population_types\n\n self.population_cap = without_locking do\n # Be sure working headquarters are also counted in.\n Building.where(planet_id: owned_planet_ids, type: types).\n where(\"state != ?\", Building::STATE_INACTIVE).\n select(\"type, level, COUNT(*) as count\").group(\"type, level\").\n c_select_all\n end.inject(0) do |sum, row|\n type = \"Building::#{row[\"type\"]}\"\n klass = @@class_cache[type] ||= type.constantize\n sum + klass.population(row['level'].to_i) * row['count'].to_i\n end\n end",
"title": ""
},
{
"docid": "978953f2e3bb8d1609ddf263ff8f500a",
"score": "0.5132518",
"text": "def increase_entities_population\n end",
"title": ""
},
{
"docid": "51c3e020900404db3341cc1b7e22056d",
"score": "0.51272047",
"text": "def random_depopulate()\n\t\t#kill random examples until N% are dead\n\t\t#@population.reject!{ |pop| rand() > @survival_rate }\n\t\tto_keep = ( @population.count * (@survival_rate)).floor\n\t\t@population = @population.shuffle.first( to_keep )\n\tend",
"title": ""
},
{
"docid": "f5f1aa8eb7487d25dc9306d9d00b78d5",
"score": "0.51266927",
"text": "def cull_migrate_integrate!\n @pool = @pool_s\n @pool_s = nil #free up the pool for the benefit of the GC\n\n @pool.uniq! #This is SLOW\n if @population > @pool.length\n build(@population - @pool.length)\n end\n nil\n\n end",
"title": ""
},
{
"docid": "379f42af3d7a4f1ddc5b81054e6ab828",
"score": "0.5124646",
"text": "def generate_population(people)\n @population = Population.new(POPULATION_SIZE, GROUP_SIZE)\n @population.generate_initial_population people\n end",
"title": ""
},
{
"docid": "dd0d764301f9b6df48fa8f6c500efcfe",
"score": "0.5112089",
"text": "def evolve(crossover_size, rate = 0.015)\n new_pop = Population.new(0)\n new_pop.tour_list << self.get_fittest \n\n (@tour_list.length - 1).times do \n parent1 = crossover_candidate(crossover_size)\n parent2 = crossover_candidate(crossover_size)\n\n new_pop.tour_list << crossover(parent1, parent2)\n end\n\n new_pop.tour_list.each { |tour| tour.mutate!(rate) unless tour.equal? new_pop.first }\n new_pop\n end",
"title": ""
},
{
"docid": "ab1d33137d348b6699adfaf8c247d4d4",
"score": "0.51107824",
"text": "def tournament_depopulate()\n\t\tto_keep = ( @population.count * (@survival_rate)).floor\n\t\tscored_pop = @population.reject { |pop| pop[:score].nil? }\n\t\twhile @population.count > to_keep\n\t\t\tpop1, pop2 = scored_pop.shuffle.first(2)\n\t\t\t@population.delete( (pop1[:score] < pop2[:score]) ? pop1 : pop2 ) \n\t\tend\n\tend",
"title": ""
},
{
"docid": "4c0926688536e7d94da98ceebbfcdd36",
"score": "0.51074463",
"text": "def forge\n assemble\n # work out the price if we were to sell at the current highest price\n # note we also work out how many skill points the recipe costs\n # since some have additional skill point based components\n sale_cost = @comps.inject({:gold=>0.0 , :sp=>0}) do | sum, el | \n if el[0].price.kind_of? SkillPointPrice\n sum[:sp] += (el[0].price.value); sum\n else\n sum[:gold] += (el[0].price.sale * el[1]);sum\n end\n end\n\n\toffer_cost = @comps.inject(0.0) { | sum, el | sum + (el[0].price.offer * el[1]) }\n calc_profits(sale_cost[:gold], offer_cost, sale_cost[:sp])\n end",
"title": ""
},
{
"docid": "4a3995a486a9540a163b246b22d7f559",
"score": "0.5080944",
"text": "def generate_population()\n @maxnum_chromosome.times{\n @population << Chromosome.new(@num_queens).generate_positions\n }\n evaluate_diversity()\n if @debug\n puts \"start population:\"\n @maxnum_chromosome.times do |i|\n puts \"#{i} : #{@population[i].to_s}\"\n end\n end\n end",
"title": ""
},
{
"docid": "681e41483866ced70b2b43beed6224c6",
"score": "0.5070753",
"text": "def surge\n sample(surges)\n end",
"title": ""
},
{
"docid": "5c83a3f04d54664cbf918a7acb0323f5",
"score": "0.5068688",
"text": "def evolve_on_console(generations=DEFAULT_MAX_GENS)\n puts \"Generation\\tBest Fitness\\t\\tBest Individual\"\n evolve_block(generations) {|p,g|\n best = p.max\n puts \"#{g}\\t\\t#{best.fitness}\\t\\t#{best.to_s}\"\n }\n self.population = self.sort_by{|x|x.fitness}\n puts \"Finished: Best fitness = #{self[-1].fitness}\"\n self\n end",
"title": ""
},
{
"docid": "57bce3c99bc9ef276cfba861a96aaae9",
"score": "0.5067428",
"text": "def reproduction(selected_to_breed)\n offsprings = []\n 0.upto(selected_to_breed.length/2-1) do |i|\n offsprings << Finch::Chromosome.reproduce(selected_to_breed[2*i], selected_to_breed[2*i+1])\n end\n self.population.each do |individual|\n Finch::Chromosome.mutate(individual)\n end\n return offsprings\n end",
"title": ""
},
{
"docid": "259ff7cee91db8189e0ecb75d206f24f",
"score": "0.5065917",
"text": "def mate!\n parm = @controller.parms\n popsize = parm.population_size\n surv = parm.survival_threshold\n survmin = parm.survival_mininum_per_species\n mlist = [] # list of chosen mating pairs of critters [crit1, crit2], or [:carryover, crit]\n\n # species list already sorted in descending order of fitness.\n # We will generate the approximate number of pairs that correspond\n # to the survivial_threshold percentage of the population,\n # then backfill with the most fit out of the top original population.\n @npop.species.each do |k, sp|\n crem = [(sp.size * surv).ceil, survmin].max\n log.warn \"Minumum per species hit -- #{survmin}\" unless crem > survmin\n spsel = sp[0, crem]\n spsel = sp if spsel.empty?\n crem.times do\n mlist << [spsel[rand spsel.size], spsel[rand spsel.size]]\n end\n end\n\n # And now for the backfilling\n unless mlist.size >= @npop.critters.size\n mlist += @npop.critters[0, @npop.critters.size - mlist.size].map{|crit| [:carryover, crit]}\n end\n\n @npop.critters = mlist.map do |crit1, crit2|\n (crit1 == :carryover) ? crit2 : sex(crit1, crit2)\n end\n end",
"title": ""
},
{
"docid": "fd60d3a799fd28b64643559fb4d249b4",
"score": "0.5064643",
"text": "def replicate(population)\r\n #TODO: Need to figure out rules for modifying paths that will enable variations but at the\r\n # same time ensure that the solution is correct\r\n return nil\r\n end",
"title": ""
},
{
"docid": "cead4eefb1cb04cbb3767eb5d13c48a2",
"score": "0.50600284",
"text": "def make_generation(use_elitism_on_chromosomes, crossover_type, mutation_rate, selection_type)\n new_pop = Population.new(@chromosomes.size, @group_size)\n if use_elitism_on_chromosomes\n new_pop.chromosomes << find_best_chromosome\n end\n \n # Flag all chromosomes as they are not crossoverred yet\n @chromosomes.map { |ch| ch.is_crossoverred = false }\n \n # Main loop, runs until all chromosomes are selected and crossoverred\n until all_chromosomes_crossoverred?\n # Find 2 chromosomes that are not crossoverred yet\n begin\n ch1, ch2 = select_parents selection_type\n end until ch1.id != ch2.id\n ch1.is_crossoverred = ch2.is_crossoverred = true\n \n # Crossover ch1 chromosome with ch2 by crossover_type that is defined at GroupPeople class\n offspring = ch1.crossover ch2, crossover_type\n \n # Apply mutation to offsprings if a random number is in mutation_rate range\n offspring[0].mutate if Random.rand(100) < mutation_rate\n offspring[1].mutate if Random.rand(100) < mutation_rate\n\n # Add new chromosomes to new population\n new_pop.chromosomes += offspring\n end\n\n # Eliminate the worst chromosome if population size is bigger than the old one\n # (because of the elitist chromosome)\n new_pop.eliminate_worst_chromosome if new_pop.chromosomes.size > @chromosomes.size\n new_pop\n end",
"title": ""
},
{
"docid": "e9ebb657c07c5d3ecf4b5abe4148c8fe",
"score": "0.50566137",
"text": "def selection\n @population.sort! { |a, b| b.fitness <=> a.fitness}\n best_fitness = @population[0].fitness\n worst_fitness = @population.last.fitness\n acum_fitness = 0\n if best_fitness-worst_fitness > 0\n @population.each do |chromosome| \n chromosome.normalized_fitness = (chromosome.fitness - worst_fitness)/(best_fitness-worst_fitness)\n acum_fitness += chromosome.normalized_fitness\n end\n else\n @population.each { |chromosome| chromosome.normalized_fitness = 1} \n end\n selected_to_breed = []\n ((2*@population_size)/3).times do \n selected_to_breed << select_random_individual(acum_fitness)\n end\n selected_to_breed\n end",
"title": ""
},
{
"docid": "3b43b3d4cfb86cddffda2d2f5b939935",
"score": "0.504911",
"text": "def random_repopulate()\n\t\tscored_pop = @population.reject{ |pop| pop[:score].nil? }\n\t\tparents = []\n\t\twhile (@population.count + parents.count) < @pop_cap\n\t\t\tparents << scored_pop.shuffle.first\n\t\tend\t\n\tend",
"title": ""
},
{
"docid": "11996a775e45f32374e67bdc059c8c68",
"score": "0.5048204",
"text": "def fitness_pop(pop)\n fitnesses = []\n pop.each do |p|\n fitnesses << fitness(p)\n end\n\n fitnesses\n end",
"title": ""
},
{
"docid": "08a99b8ad2ddae809ec5aaca75b9e3e4",
"score": "0.50412714",
"text": "def mutate_matingpool\n (0...@mating_pool.size).each do |i|\n mutate_point = rand(0...@num_genes)\n chromosome = @mating_pool[i].clone\n gene = if @continuous\n rand(lower_bounds[0].to_f..upper_bounds[0].to_f)\n else\n rand(lower_bounds[0].to_i..upper_bounds[0].to_i)\n end\n chromosome[mutate_point] = gene\n @new_generation << chromosome\n end\n end",
"title": ""
},
{
"docid": "a1a269b8513c0dea75fb28163bfedccc",
"score": "0.5036347",
"text": "def gen_random_population(pts)\r\n return nil\r\n end",
"title": ""
},
{
"docid": "109d53a1d8ebc2b4c95db5dfec215516",
"score": "0.5036071",
"text": "def repopulate\n @populated = false\n end",
"title": ""
},
{
"docid": "69bb0a0bb7c5968e96c0a19cd684ad37",
"score": "0.5035695",
"text": "def fitness\r\n @fitness = evaluate unless @fitness\r\n @fitness\r\n end",
"title": ""
},
{
"docid": "74c0bcb6488c10fb545ac9e89e3b0f9c",
"score": "0.50349855",
"text": "def evaluate_generation\n Finch::Chromosome.all(:conditions => {:deceased => false}).each do |chromosome|\n chromosome.calculate_fitness!\n end\n end",
"title": ""
},
{
"docid": "445ad5372e8868128846e244f81f429b",
"score": "0.5033919",
"text": "def reproduction(selected_to_breed)\n offsprings = []\n 0.upto(selected_to_breed.length/2-1) do |i|\n offsprings << Chromosome.reproduce(selected_to_breed[2*i], selected_to_breed[2*i+1])\n end\n @population.each do |individual|\n Chromosome.mutate(individual)\n end\n return offsprings\n end",
"title": ""
},
{
"docid": "83ea0872c3d79c6c1e674449ad4d13eb",
"score": "0.50220454",
"text": "def mutate\n @chromosomes[rand @chromosomes.size].mutate\n self\n end",
"title": ""
},
{
"docid": "d7720e0e7374bfb7535c3e1a1a299f92",
"score": "0.5014298",
"text": "def reproduction(selected_to_breed)\n offsprings = []\n 0.upto(selected_to_breed.length/2-1) do |i|\n offsprings << Chromosome.reproduce(selected_to_breed[2*i], selected_to_breed[2*i+1])\n end\n @population.each do |individual|\n Chromosome.mutate(individual, mutation_rate)\n end\n return offsprings\n end",
"title": ""
},
{
"docid": "349acb2e3921c60c1db2f1aef584f90a",
"score": "0.5013142",
"text": "def createEvolved\n frames = GameData::Species.cry_length(@newspecies, @pokemon.form)\n # plays Pokemon's cry\n pbBGMStop()\n GameData::Species.play_cry_from_species(@newspecies)\n frames.times do\n Graphics.update\n self.update\n end\n pbMEPlay(\"EBDX/Capture Success\")\n pbBGMPlay(\"EBDX/Victory Against Wild\")\n # gets info of the new species\n newspeciesname = GameData::Species.get(@newspecies).real_name\n oldspeciesname = GameData::Species.get(@pokemon.species).real_name\n @sprites[\"msgwindow\"].visible = true\n pbMessageDisplay(@sprites[\"msgwindow\"], _INTL(\"\\\\se[]Congratulations! Your {1} evolved into {2}!\\\\wt[80]\", @pokemon.name, newspeciesname)) { self.update }\n @sprites[\"msgwindow\"].text = \"\"\n # Check for consumed item and check if Pokémon should be duplicated\n pbEvolutionMethodAfterEvolution\n # modify Pokemon upon evolution\n @pokemon.species = @newspecies\n @pokemon.name = newspeciesname if @pokemon.name == oldspeciesname\n @pokemon.form = 0 if @pokemon.isSpecies?(:MOTHIM)\n @pokemon.calc_stats\n # set species seen as true\n $Trainer.pokedex.register(@pokemon.species, @pokemon.gender, @pokemon.form)\n $Trainer.pokedex.set_owned(@pokemon.species)\n # learn moves upon evolution for evolved species\n # Learn moves upon evolution for evolved species\n movelist = @pokemon.getMoveList\n for i in movelist\n next if i[0] != 0 && i[0] != @pokemon.level # 0 is \"learn upon evolution\"\n pbLearnMove(@pokemon, i[1], true) { pbUpdate }\n end\n end",
"title": ""
},
{
"docid": "e62688e264cba286ef228b0a8a4542c2",
"score": "0.50075424",
"text": "def selection\n # Clear the ArrayList\n @mating_pool.clear\n\n # Calculate total fitness of whole population\n max_fitness = @population.max{ |a, b| a.fitness <=> b.fitness }.fitness\n\n # Calculate fitness for each member of the population (scaled to value between 0 and 1)\n # Based on fitness, each member will get added to the mating pool a certain number of times\n # A higher fitness = more entries to mating pool = more likely to be picked as a parent\n # A lower fitness = fewer entries to mating pool = less likely to be picked as a parent\n @population.each do |p|\n fitness_normal = map(p.fitness, 0, max_fitness, 0, 1)\n (fitness_normal * 100).to_i.times{ @mating_pool << p }\n end\n end",
"title": ""
},
{
"docid": "c9537b807ed50565de8585d32905e535",
"score": "0.49993417",
"text": "def elitist_selection\n selected = Population.new\n selected_fitness = Array.new\n\n new_population_and_fitness = @new_population.zip(@current_fitness)\n \n sorted_population_with_fitness = new_population_and_fitness.sort do |a, b| \n a.last <=> b.last\n end\n\n n = @population_size / 2\n \n (@population_size / 2).times do\n elem, fitness = sorted_population_with_fitness.delete_at(0)\n \tselected << elem\n selected_fitness << fitness\n end\n \n while(selected.size < @population_size )\n elem, fitness = sorted_population_with_fitness.delete_at(rand( sorted_population_with_fitness.size ))\n selected << elem\n selected_fitness << fitness\n end\n [selected, selected_fitness]\n\tend",
"title": ""
},
{
"docid": "ef91964cbc0a13333d27b91a9c5fcc89",
"score": "0.4997818",
"text": "def pop\n @scene.score += 1\n @keep = false\n return unless @r > @vsize\n\n x = @x + @r / 2\n y = @y + @r / 2\n new_ball_params =\n { radius: @r / 2, x: x, y: y,\n x_velocity: @vx, y_velocity: -0.5, vanishing_size: @vsize }\n # add two smaller new balls\n @scene.add_object(Ball.new(@scene, new_ball_params))\n new_ball_params[:x_velocity] = -@vx\n @scene.add_object(Ball.new(@scene, new_ball_params))\n # set 90% chance to drop powerup\n return if rand < 0.3\n @scene.add_object(random_powerup.new(@scene, x: x, y: y))\n end",
"title": ""
},
{
"docid": "552d4bb7e0ba3d1fb60b9c6be00fc798",
"score": "0.49948412",
"text": "def population(level)\n evalproperty(\"population\", 0, 'level' => level)\n end",
"title": ""
},
{
"docid": "8d2d636e97c2fd57bc592b8403491768",
"score": "0.49844268",
"text": "def evolve(object)\n object\n end",
"title": ""
},
{
"docid": "4e1176160d3cea250457ffc330610562",
"score": "0.49759078",
"text": "def selection\n max_fitness = @population.max_by(&:fitness).fitness\n min_fitness = @population.min_by(&:fitness).fitness\n accumulate_normalized_fitness = 0\n if max_fitness - min_fitness > 0\n offset_fitness = max_fitness - min_fitness\n @population.each do | chromosome |\n chromosome.normalized_fitness = (chromosome.fitness - min_fitness) / offset_fitness\n accumulate_normalized_fitness += chromosome.normalized_fitness\n end\n else\n @population.each { | chromosome | chromosome.normalized_fitness = 1} \n end\n\n mating_pool = []\n @population.each do | chromosome |\n if accumulate_normalized_fitness == 0\n num_select = 1\n else\n num_select = (chromosome.normalized_fitness / accumulate_normalized_fitness * @population_size).round\n end\n num_select.times do\n mating_pool << chromosome\n end\n end\n\n mating_pool\n end",
"title": ""
},
{
"docid": "3bc182b3207e5880527d6eaa9c8b8c5e",
"score": "0.4973669",
"text": "def generate\n # Refill the population with children from the mating pool\n @population.each_index do |i|\n a = random(@mating_pool.size).to_i\n b = random(@mating_pool.size).to_i\n partner_a = @mating_pool[random(@mating_pool.size).to_i]\n partner_b = @mating_pool[random(@mating_pool.size).to_i]\n child = partner_a.crossover(partner_b)\n child.mutate(@mutation_rate)\n @population[i] = child\n end\n @generations += 1\n end",
"title": ""
},
{
"docid": "dbc0d81be06bc093175b129255c869f0",
"score": "0.49707264",
"text": "def nextGeneration\n newPopulation = Population.new\n \n # Take the ten fittest individuals from the existing population.\n # (Array is sorted from low to high fitness, so take the last 10)\n (POPULATION - 1).downto(POPULATION - ELITE_NUMBER) {\n |idx|\n newPopulation.addIndividual(@population.individuals[idx])\n }\n\n # now select and mate the rest of the population\n ((POPULATION - ELITE_NUMBER)/2).times {\n p1 = @population.select\n p2 = @population.select\n\n # Create two children from the two parents\n (c1, c2) = mate(p1, p2)\n\n # Check if one of our children is an optimal\n if ((c1.score == @@optimalScore) || (c2.score == @@optimalScore)) then\n return true\n end\n \n newPopulation.addIndividual(c1)\n newPopulation.addIndividual(c2)\n }\n\n @population = newPopulation;\n @population.setup\n\n return false;\n end",
"title": ""
},
{
"docid": "6f5b0f37c861cb8161c4365bd29036c8",
"score": "0.49674776",
"text": "def population_size\n @population_size\n end",
"title": ""
}
] |
236d9f37e5a9a89427cd89e5e01a88ca
|
Show subsubcategory of a product
|
[
{
"docid": "a852ce2a7625d7d4b836d14a009dd901",
"score": "0.6893968",
"text": "def show_sub_category\n @product_category = Category.find(:all, :conditions=>[\"category_name=?\", params[:cat_value]])\n respond_to do |format|\n format.js\n end\n end",
"title": ""
}
] |
[
{
"docid": "08020f2be989ba824572c2f5f238997b",
"score": "0.77299696",
"text": "def show_subsubcategories\n\t\t@subsubcategories = ProductSubsubcategory.where(:product_subcategory_id => params[:id].to_i).order('name ASC')\n\t\t@subcateory = ProductSubcategory.find(params[:id].to_i)\n\t\t@category = ProductCategory.find(@subcateory.product_category_id)\n\t\tif @subsubcategories.empty?\n\t\t\tredirect_to :controller => 'admins', :action => 'show_products',:product_category_id => @category.id, :product_subcategory_id => params[:id].to_i, :product_subsubcategory_id => nil\n\t\tend\n\t\t@products = Product.where('product_subcategory_id = ? AND product_subsubcategory_id IS NULL',params[:id].to_i).order('name ASC')\n\tend",
"title": ""
},
{
"docid": "ce0ba0ac4223fddfe9da7fe80aab9082",
"score": "0.74980134",
"text": "def show_subcategories\n\t\t@subcategories = ProductSubcategory.where(:product_category_id => params[:id].to_i).order('name ASC')\n\t\tif @subcategories.empty?\n\t\t\tredirect_to :controller => 'admins', :action => 'show_products', :product_category_id => params[:id], :product_subcategory_id => nil\n\t\tend\n\t\t@products = Product.where('product_category_id = ? AND product_subcategory_id IS NULL',params[:id].to_i).order('name ASC')\n\tend",
"title": ""
},
{
"docid": "eb70f64c5df4cbf6d51d63acebd3baea",
"score": "0.7391841",
"text": "def show_sub_category\n params[:id]\n @category = Category.find(params[:id])\n @subcategories = SubCategory.where(:category_id => params[:id])\n end",
"title": ""
},
{
"docid": "b01bca78b3c2359bfa92ad2d5291c175",
"score": "0.73810446",
"text": "def display_sub_sub_category\n get_category_name(sub_sub_category)\n end",
"title": ""
},
{
"docid": "32a302f3493a5386bb42be4a8fbe3590",
"score": "0.7268173",
"text": "def display_sub_category\n get_category_name(sub_category)\n end",
"title": ""
},
{
"docid": "06215f647395adfc246b93288b3c2aaa",
"score": "0.7142334",
"text": "def index_sub\n\t\tcategory = Category.find_by_id(params[:id])\n session[:category_id] = params[:id]\n\t\tif category.children.empty? || category.nil?\n @products = Category.find_product(category.id)\n\t\telse\n\t\t\t@categories = category.children\n\t\tend\n\t\trespond_to do |format|\n\t\t\tformat.html # index_sub.html.erb\n\t\t\tformat.xml { render :xml => @categories }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "4db1d32cbaa9de17e3464e35df96538b",
"score": "0.7126405",
"text": "def list_subcategory_items(subcat)\n list_items(TacoDeli::Menu.find_by_subcategory(subcat))\n \n\n end",
"title": ""
},
{
"docid": "4b21df91c2008d132ce4903056bd3446",
"score": "0.7115021",
"text": "def set_subcategory\n @subcategory = @category.subcategories.find(params[:id])\n end",
"title": ""
},
{
"docid": "57d3987332b977772c5f862b2ddd23d8",
"score": "0.70742315",
"text": "def show\n @categories = Category.all\n @subcategorys = Subcategory.all\n @subcategory = Subcategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "7dd9e41c178897b53aa8eb66f86a27cc",
"score": "0.7041059",
"text": "def category_subcategory\n \"#{self.category_name} > #{self.subcategory_name}\"\n end",
"title": ""
},
{
"docid": "cff2cefd2c7c3e87134d15be219edc6d",
"score": "0.7030626",
"text": "def set_product_sub_category\n @category = Category.find(params[:id])\n end",
"title": ""
},
{
"docid": "294024c4ac070b9ecef57e2997fa6d36",
"score": "0.702406",
"text": "def set_subsubcategory\n @subsubcategory = Subsubcategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "b82c8a7ce1848de8438ade4b5f3da539",
"score": "0.6998852",
"text": "def show\n @menu = \"category\"\n @board = \"category\"\n @section = \"show\"\n \n @category = Category.get(params[:id])\n @subcategories = @category.subcategories.all(:order => [ :priority.asc ])\n \n render 'admin/categories/category', :layout => false\n end",
"title": ""
},
{
"docid": "b82c8a7ce1848de8438ade4b5f3da539",
"score": "0.6998852",
"text": "def show\n @menu = \"category\"\n @board = \"category\"\n @section = \"show\"\n \n @category = Category.get(params[:id])\n @subcategories = @category.subcategories.all(:order => [ :priority.asc ])\n \n render 'admin/categories/category', :layout => false\n end",
"title": ""
},
{
"docid": "450504800a166f7a03c79a48dc171191",
"score": "0.6974662",
"text": "def show\n category = Category.find_by(slug: params[:category_slug])\n @sub_category = SubCategory.find_by(slug: params[:slug], category_id: category)\n end",
"title": ""
},
{
"docid": "6856e4f7f267b72f2691fa7d6db41c0e",
"score": "0.695465",
"text": "def show\n @product_sub_section = ProductSubSection.find(params[:id])\n \n @category = ProductCategory.find(@product_sub_section.product_category_id).category\n @section = ProductSection.find(@product_sub_section.product_section_id).section\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @product_sub_section }\n end\n end",
"title": ""
},
{
"docid": "1e91962460728596dd54133c5d9bfd38",
"score": "0.6882237",
"text": "def set_subproduct\n @subproduct = Subproduct.find(params[:id])\n end",
"title": ""
},
{
"docid": "909f9766b7e401f3144edf3c294e8f93",
"score": "0.6862996",
"text": "def index\n @subproducts = Subproduct.all\n end",
"title": ""
},
{
"docid": "25e32bd2b0cda4502204fb3bc68a44a2",
"score": "0.6860099",
"text": "def subcategory_on_sale name\n on_sale = false\n data.site.products_b.each do |id, product|\n if product.subcategory.nombre === name\n if product.is_sale\n on_sale = true\n break\n end\n end\n end\n on_sale\n end",
"title": ""
},
{
"docid": "d39bde4aad326cc1b3f8da9a2cbc2407",
"score": "0.6852353",
"text": "def set_subcategory\n @subcategory = Subcategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "d39bde4aad326cc1b3f8da9a2cbc2407",
"score": "0.6852353",
"text": "def set_subcategory\n @subcategory = Subcategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "d39bde4aad326cc1b3f8da9a2cbc2407",
"score": "0.6852353",
"text": "def set_subcategory\n @subcategory = Subcategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "d39bde4aad326cc1b3f8da9a2cbc2407",
"score": "0.6852353",
"text": "def set_subcategory\n @subcategory = Subcategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "d39bde4aad326cc1b3f8da9a2cbc2407",
"score": "0.6852353",
"text": "def set_subcategory\n @subcategory = Subcategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "6d05a21ac4930f58b92845ea396fdaa5",
"score": "0.6843444",
"text": "def index\n @subsubcategories = Subsubcategory.all\n end",
"title": ""
},
{
"docid": "96cc8e4500acce34d147ae11e6265226",
"score": "0.6840008",
"text": "def set_cp_subsubcategory\n @cp_subsubcategory = Subsubcategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "47a5909915b8cbc2f43580aa3eb6c7e5",
"score": "0.6835482",
"text": "def find_subcategory(taxon)\n @category_product = Category.find(:all,:conditions=>[\"parent_id=? \",taxon])\n return @category_product\n end",
"title": ""
},
{
"docid": "11546b0040292ae55d196af165c57d37",
"score": "0.6833707",
"text": "def index\n @cp_subsubcategories = Subsubcategory.all\n @title = \"Subsubcategories\"\n end",
"title": ""
},
{
"docid": "2296566a6b98705d57544e72f3621af6",
"score": "0.6809854",
"text": "def show\r\n @subcategory = Subcategory.friendly.find(params[:id])\r\n @listings = @subcategory.listings.all\r\n\r\n @parent = @subcategory.category\r\n @category = @subcategory.category_id\r\n @subcategories = Subcategory.where(category_id: @category)\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @subcategory }\r\n end\r\n end",
"title": ""
},
{
"docid": "a2467f410c89b95a765ec4527a148eaa",
"score": "0.6767315",
"text": "def set_subcategory\n @subcategories = Subcategory.where(categories_id: params[:id])\n end",
"title": ""
},
{
"docid": "a2b962adcbb9e738b7fdfd30e694af07",
"score": "0.67427665",
"text": "def show\n @subcategory = Subcategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @subcategory }\n end\n end",
"title": ""
},
{
"docid": "a2b962adcbb9e738b7fdfd30e694af07",
"score": "0.67427665",
"text": "def show\n @subcategory = Subcategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @subcategory }\n end\n end",
"title": ""
},
{
"docid": "130b085ee239ed02fd807d7b12aaf3cb",
"score": "0.6737337",
"text": "def set_subcategory\n @subcategory = Subcategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "bfa2b4ee1b66028cc9e741653122bc84",
"score": "0.67225766",
"text": "def show\n @subcategory = Subcategory.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @subcategory }\n end\n end",
"title": ""
},
{
"docid": "b46317c8256432a6779b477181d5db3c",
"score": "0.6713006",
"text": "def sub_cat_name\n self.sub_category.sub_cat_name\n end",
"title": ""
},
{
"docid": "7a1406cbd92c87a927034443f22477df",
"score": "0.66935146",
"text": "def set_sub_category\n @sub_category = SubCategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "7a1406cbd92c87a927034443f22477df",
"score": "0.66935146",
"text": "def set_sub_category\n @sub_category = SubCategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "7a1406cbd92c87a927034443f22477df",
"score": "0.66935146",
"text": "def set_sub_category\n @sub_category = SubCategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "7a1406cbd92c87a927034443f22477df",
"score": "0.66935146",
"text": "def set_sub_category\n @sub_category = SubCategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "a8fd2f2eb62d3c49b0072a7d022dbb85",
"score": "0.6682872",
"text": "def index\n if params[:cat] != nil and params[:cat] != \"\"\n category_id = params[:cat].to_i\n else\n category_id = Subcategory.first(:gubun => \"template\").id\n end\n \n @menu = \"subcategory\"\n @board = \"subcategory\"\n @section = \"index\"\n @menu_on = \"category\" \n \n @categories = Category.all(:gubun => \"template\", :order => [:priority])\n @subcategories = Subcategory.all(:category_id => category_id, :order => [:priority])\n\n render 'subcategory'\n end",
"title": ""
},
{
"docid": "32dc760a3484641f647bfe09ad0718aa",
"score": "0.66769576",
"text": "def element_subcategory\n fetch('science.element_subcategory')\n end",
"title": ""
},
{
"docid": "9ae54207a029f4f2fb1f59a8935cee21",
"score": "0.6670718",
"text": "def set_sub_product_detail\n @sub_product_detail = SubProductDetail.find(params[:id])\n end",
"title": ""
},
{
"docid": "cd545d6b0916760c257c4e9647291529",
"score": "0.66202664",
"text": "def show\n @sub_category = SubCategory.find(params[:id])\n respond_with(@sub_category)\n end",
"title": ""
},
{
"docid": "29a6ae553411bdb9c8e770a11e046d80",
"score": "0.6612021",
"text": "def show_products\n\t\tif params[:product_subsubcategory_id].nil?\n\t\t\tif params[:product_subcategory_id].nil?\n\t\t\t\t@products = Product.where('product_category_id = ? AND product_subcategory_id IS NULL AND product_subsubcategory_id IS NULL', params[:product_category_id])\n\t\t\telse\n\t\t\t\t@products = Product.where('product_subcategory_id = ? AND product_subsubcategory_id IS NULL', params[:product_subcategory_id])\n\t\t\tend\n\t\telse\n\t\t\t@products = Product.where('product_subsubcategory_id = ?', params[:product_subsubcategory_id])\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a0c85e9360d03a8f4cf474f6f39a00d1",
"score": "0.6582132",
"text": "def show\n @sub_categoria = SubCategoria.new\n @sub_categorias = []\n if @categoria.sub_categorias.any?\n @sub_categorias = @categoria.sub_categorias.order(\"descricao asc\")\n end\n end",
"title": ""
},
{
"docid": "a73141c8461f2402c3352b9d8c2f7bc9",
"score": "0.6571518",
"text": "def getsubcategory\n \n @subcategories = EventCategoryMaster.find( :all, :conditions => [\" parent_id = ?\", params[:id]] ).sort_by{ |k| k['name'] }\n respond_to do |format|\n format.json { render :json => @subcategories }\n end\n end",
"title": ""
},
{
"docid": "f3115589488e075ca51579c1a0de3ca5",
"score": "0.6522895",
"text": "def index\n @product_subgroups = ProductSubgroup.all\n end",
"title": ""
},
{
"docid": "f93073991aeb9d7555f776f017c82497",
"score": "0.65137976",
"text": "def fetch_subcategory subcategory_id\n subcategory = \"\"\n data.site.subcategories.each do |id, sc|\n if subcategory_id === sc.id\n subcategory = sc\n break\n end\n end\n subcategory\n end",
"title": ""
},
{
"docid": "a2a83136c845cec2b43318cb42a7589b",
"score": "0.6512558",
"text": "def set_rcadmin_subcategory\n @rcadmin_subcategory = Rcadmin::Subcategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "c61836d3e544998955b7869ffdf15421",
"score": "0.6494462",
"text": "def index\n @sub_product_details = SubProductDetail.all\n end",
"title": ""
},
{
"docid": "d25eb8e3541c5cab5c239084c8809a55",
"score": "0.648939",
"text": "def show\n @test_subcategory = TestSubcategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @test_subcategory }\n end\n end",
"title": ""
},
{
"docid": "b5f318ad1ac62a3292cc8a562bdce05a",
"score": "0.64659345",
"text": "def index\n @bs_or_pl_sub_categories = BsOrPlSubCategory.all\n end",
"title": ""
},
{
"docid": "571fd0b2aaacbf119306ed63850bb03f",
"score": "0.6462738",
"text": "def show\n @sub_category = SubCategory.find(params[:id])\n @title = @sub_category.name\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sub_category }\n end\n end",
"title": ""
},
{
"docid": "04ffa2ff4b2ecdd9b6b1d387da8ec750",
"score": "0.6459785",
"text": "def set_sub_cat\n @sub_cat = SubCat.find(params[:id])\n end",
"title": ""
},
{
"docid": "04ffa2ff4b2ecdd9b6b1d387da8ec750",
"score": "0.6459785",
"text": "def set_sub_cat\n @sub_cat = SubCat.find(params[:id])\n end",
"title": ""
},
{
"docid": "5bec4dc54f5d70789e868cbfe10952a1",
"score": "0.64482176",
"text": "def index\n @subcategories = Subcategory.all\n end",
"title": ""
},
{
"docid": "5bec4dc54f5d70789e868cbfe10952a1",
"score": "0.64482176",
"text": "def index\n @subcategories = Subcategory.all\n end",
"title": ""
},
{
"docid": "d7c8cd6c8a1110ff8f2b56c5ef0d6a52",
"score": "0.6408474",
"text": "def index\n #@item_subcategories = ItemSubcategory.all\n\n\n #Get API from Product information management\n @category_list = ItemSubcategory.get_category\n \n\n\n\n end",
"title": ""
},
{
"docid": "0c6003bf3bd7e5fb7f00f29cb243776c",
"score": "0.6407527",
"text": "def new\n @category = Category.new\n @subcategory = @category.subcategories.new\n @select_main_category = Category.all(:order => [ :priority.asc ]) \n \n render 'admin/subcategories/new', :layout => false\n end",
"title": ""
},
{
"docid": "eef44244f01fbb4eb1c00510bb35ab2b",
"score": "0.63929784",
"text": "def index\r\n #@subcategories = Subcategory.find_by_category_id(params[:id])\r\n @subcategories = Subcategory.all\r\n end",
"title": ""
},
{
"docid": "0c89a9b8cbe34882a8b304ee39a1f372",
"score": "0.6387936",
"text": "def show\n @subcat = Subcat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subcat }\n end\n end",
"title": ""
},
{
"docid": "ecbf93f63278495a1f87f76f1f982230",
"score": "0.6380453",
"text": "def subcat\n @category = Category.find(params[:id])\n @level = params[:level]\n @subcat = @category.children \n \n respond_to do |format|\n format.js\n end \n end",
"title": ""
},
{
"docid": "54136b95c49a26ddf54250fd8d2fb625",
"score": "0.63719827",
"text": "def index\n @sub_categories = SubCategory.all\n end",
"title": ""
},
{
"docid": "54136b95c49a26ddf54250fd8d2fb625",
"score": "0.6371095",
"text": "def index\n @sub_categories = SubCategory.all\n end",
"title": ""
},
{
"docid": "bd771d5ee066d6049f292b47a7ccbcd1",
"score": "0.6364504",
"text": "def index\n @subcategory1s = Subcategory1.all\n end",
"title": ""
},
{
"docid": "32dd548b883fd49458f0e690de1f64df",
"score": "0.63612217",
"text": "def show\n @sub_categoria = SubCategoria.find(params[:id])\n\n render :layout => false\n end",
"title": ""
},
{
"docid": "65d57d5a6871f4afeed7f9fe3273e316",
"score": "0.6358686",
"text": "def show\n @supercategories = @product.get_super_categories\n @wiki = markdown(@product.wiki)\n \n products_in_graph = [@product] + @product.subcategories + @supercategories\n @products = @product.get_graph_nodes(products_in_graph)\n @product_tree = @product.get_graph_tree(@supercategories)\n \n respond_to_format\n end",
"title": ""
},
{
"docid": "f4db21616306c061a45df8f3702fd636",
"score": "0.6349499",
"text": "def index\n @rcadmin_subcategories = Rcadmin::Subcategory.all\n end",
"title": ""
},
{
"docid": "714fcc78339b5799791f7f1fe092765f",
"score": "0.6349008",
"text": "def index\n @subsubcategoria = Subsubcategorium.all\n end",
"title": ""
},
{
"docid": "18c5dc19fac54a5f3a784f732458e9f6",
"score": "0.6337265",
"text": "def find_subcategory(params = {})\n client.get(\"v3/subcategories/\", params)\n end",
"title": ""
},
{
"docid": "de63b964e06a6b33ec94e38d03941a9e",
"score": "0.6328403",
"text": "def set_subcategorization\n \n \n @subcategorization = Subcategorization.find_by(name: params[:id])\n end",
"title": ""
},
{
"docid": "01c8602271e7f7dea815c9c8637ae827",
"score": "0.63222516",
"text": "def show\n @subcategorization = Subcategorization.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subcategorization }\n end\n end",
"title": ""
},
{
"docid": "19667c215a13f67a908183e742ea4ab6",
"score": "0.6309273",
"text": "def set_subsubcategorium\n @subsubcategorium = Subsubcategorium.find(params[:id])\n end",
"title": ""
},
{
"docid": "062f885ee5475ca00621309aef3d3a6f",
"score": "0.630902",
"text": "def create\n @category = Category.get(params[:subcategories][:main_category].to_i)\n @subcategory = @category.subcategories.new\n \n @subcategory.name = params[:subcategories][:name]\n @subcategory.priority = params[:subcategories][:priority].to_i\n\n if @subcategory.save\n flash[:notice] = 'Sub category was successfully created.'\n redirect_to :action => 'index'\n else\n render 'admin/subcategories/new', :layout => false\n end\n end",
"title": ""
},
{
"docid": "f7919e7650c54a468138256a610a8a59",
"score": "0.6298854",
"text": "def get_sub_categories(category_name)\n\t\t\tunpack(self.send(refernet_url(\"Sub_Category\", category_name: category_name)))\n\t\tend",
"title": ""
},
{
"docid": "8c43e9b75767a31223143b976f87a7a2",
"score": "0.62968916",
"text": "def new\n @product = Product.new\n\n @cat = Category.all.collect do |c|\n [c.name, c.id]\n end\n \n @subcat = Subcategory.all.collect do |s|\n [s.name, s.id]\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @product }\n end\n end",
"title": ""
},
{
"docid": "3a10d48cf05f1e804a4284b963f352c4",
"score": "0.6292053",
"text": "def show\n @sub_categories_d = SubCategoriesD.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sub_categories_d }\n end\n end",
"title": ""
},
{
"docid": "54f853dc01da32de133e9a4a98f7b512",
"score": "0.62807626",
"text": "def show\n @user = current_user\n @prod_type = ProdType.find( params[ :id ] )\n search = params[ :search ]\n @products, @paginate = @prod_type.products( params.to_hash, search, params[ :page ] )\n \n @subproducts = @prod_type.subproducts\n end",
"title": ""
},
{
"docid": "44c05f74fc8a6a414a2ad0ba36c9fd97",
"score": "0.62691134",
"text": "def set_item_subcategory\n @item_subcategory = ItemSubcategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "6aa53a72eab0a373ec94204e53366c99",
"score": "0.6259013",
"text": "def set_admin_sub_category\n @admin_sub_category = Admin::SubCategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "35b601a0fd2bbd32d95a2be135d1d23e",
"score": "0.6258281",
"text": "def show\n @subcategories = Array.new\n @filecategories = @aggregate.categories\n @filesubcategories = @aggregate.subcategories\n @categories = Category.all\n for cat in @filecategories\n for subcat in cat.subcategories\n if !@filesubcategories.include?(subcat) \n @subcategories.push(subcat)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "919981e983b249e9692884fadc6305f3",
"score": "0.6254905",
"text": "def show\n @categories = Category.all.where(parent_id: nil)\n @brands = Brand.all\n @category = Category.find(params[:category_id])\n @brand = Brand.find(params[:id])\n @sub_categories = @brand.categories.where('parent_id is not null').order('id ASC')\n @sub_category = if(params[:sub_category])\n @brand.categories.find(params[:sub_category])\n else @sub_categories.present?\n @sub_categories.first\n end\n end",
"title": ""
},
{
"docid": "9d247686d8405dacdc151b9b58169d57",
"score": "0.62517273",
"text": "def give_subcategory()\n \n cat_id = params[:id].to_i\n \n if cat_id == 1\n type = nil\n subcategory = nil\n elsif cat_id == 2\n type = nil\n subcategory = Profile.all\n elsif cat_id == 3\n type = Type.all\n subcategory = Family.all\n elsif cat_id == 4\n type = nil\n subcategory = Education.all\n elsif cat_id == 5\n type = TType.all\n subcategory = Testing.all\n elsif cat_id == 6\n type = AType.all\n subcategory = Activity.all\n elsif cat_id == 7\n type = nil\n subcategory = nil\n else\n type = nil\n subcategory = nil\n end\n subs = Array.new\n subs_id = Array.new\n if subcategory\n \n \n subcategory.each do |sub|\n subs_id.insert(-1, sub.id)\n subs.insert(-1, sub.name)\n end\n end\n types = Array.new\n type_id = Array.new\n if type\n \n \n type.each do |type|\n type_id.insert(-1, type.id)\n types.insert(-1, type.name)\n end\n \n end\n \n render :json => {subs1:subs, types1:types ,subs_id1:subs_id, types_id1:type_id}\n end",
"title": ""
},
{
"docid": "08a8822ea28385344bc84737e17c670a",
"score": "0.62512624",
"text": "def update\n\n @category = Category.all\n @subcategory = @category.subcategories.get(params[:id])\n @subcategory.category_id = params[:subcategories][:main_category].to_i\n @subcategory.name = params[:subcategory][:name]\n @subcategory.priority = params[:subcategory][:priority].to_i\n \n if @subcategory.save\n flash[:notice] = 'Sub category was successfully updated.'\n redirect_to :action => 'index'\n else\n render 'admin/subcategories/new', :layout => false\n end\n end",
"title": ""
},
{
"docid": "01d8c7ed9c656c3759229881f62b3093",
"score": "0.62469465",
"text": "def show\n add_breadcrumb @profile.title, category_subcategory_profile_path(@category, @subcategory, @profile)\n end",
"title": ""
},
{
"docid": "3384b436cee019f06b14cd9353fc01ed",
"score": "0.62329537",
"text": "def set_admin_sub_category\n set_admin_category\n @admin_sub_category = SubCategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "403d244446f9b16259302c0437d868e1",
"score": "0.623286",
"text": "def subgenera_special_case\n if @taxon.is_a? Subgenus\n params[:display] = \"subgenera_in_parent_genus\"\n end\n end",
"title": ""
},
{
"docid": "78dfb9503a1f180a2ab2991151580d07",
"score": "0.6224726",
"text": "def index\n @admin_sub_categories = Admin::SubCategory.all\n end",
"title": ""
},
{
"docid": "354f3e69056773b8de29c42cc0db951d",
"score": "0.62156475",
"text": "def index\n @profiles = @subcategory.profiles\n end",
"title": ""
},
{
"docid": "f175a453644d5ca07a310de3b61cd055",
"score": "0.62154305",
"text": "def set_sub_categoria\n @sub_categoria = SubCategoria.find(params[:id])\n end",
"title": ""
},
{
"docid": "c3dc9200c8dc1f32c2042b802a7dbc21",
"score": "0.6205778",
"text": "def set_bs_or_pl_sub_category\n @bs_or_pl_sub_category = BsOrPlSubCategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "b4a28952e7f61602ecbf33eb856d35ff",
"score": "0.6203113",
"text": "def show\n @product = Product.where(id: params[:id]).first\n @product = Product.where(sku: params[:id]).first unless @product\n raise ActiveRecord::RecordNotFound unless @product\n\n set_seo_variables(@product)\n @linked=@product.linked\n @cart_item = @current_cart.cart_items.new(product_id: @product.id, quantity:1)\n \n @category = Category.find(params[:category_id]) if params[:category_id]\n\n @breadcrumbs=[]\n @breadcrumbs << @product\n\n cat=params[:category_id] ? Category.find(params[:category_id]) : (@product.categories.empty? ? nil : @product.categories.first)\n\n if cat\n while cat do \n @breadcrumbs << cat\n cat=cat.parent\n end\n @breadcrumbs=@breadcrumbs.reverse\n end\n\n end",
"title": ""
},
{
"docid": "4c61466453ab20590b94daded989c1a0",
"score": "0.62024486",
"text": "def demo_subcategories(id)\n self.class.get(\"/demos/subcategories/#{id}/demos\", @options)\n end",
"title": ""
},
{
"docid": "8e11992fec19157eba3cdbced4565a96",
"score": "0.6201662",
"text": "def set_sub2category\n @sub2category = Sub2category.find(params[:id])\n end",
"title": ""
},
{
"docid": "ee2d7dddb916407fc1be9506c7b57544",
"score": "0.6185452",
"text": "def show\n @exercise_subcategory = ExerciseSubcategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exercise_subcategory }\n end\n end",
"title": ""
},
{
"docid": "ee0ad7554fe5b6f96b6b6a9bac681e86",
"score": "0.61798",
"text": "def subcategories(params = {})\n client.get(\"v3/subcategories/\", params)\n end",
"title": ""
},
{
"docid": "f8423f2a8108cc16bfa28b4e156b2725",
"score": "0.6176433",
"text": "def index\n @subproductos = Subproducto.all\n end",
"title": ""
},
{
"docid": "76299bd8be09627dcba62fde361792f7",
"score": "0.6173992",
"text": "def new\n @subcategory = Subcategory.new\n end",
"title": ""
},
{
"docid": "a03a21705c95613ec6f8b43ee2bd409f",
"score": "0.6172636",
"text": "def get_sub_categories\r\n @active_category = params[:books_categories][:type]\r\n \t if @active_category == \"main-category\"\r\n\t \t category_id = params[:books_categories][:name][1].to_i\r\n\t \t @sub_categories = Category.where(parent_id: category_id).order(:name)\r\n \t else\r\n activate_selected_sub_category params[:books_categories][:sub_categories]\r\n \t end\r\n respond_to do|format|\r\n format.html\r\n format.js\r\n end\r\n end",
"title": ""
},
{
"docid": "9a3918cbf931d9ca20fc1320ce904adc",
"score": "0.61659485",
"text": "def show\n @header = @category.title\n if @category.is_childless?\n @products = @category.products\n \n else\n @categories = @category.children\n render action: 'index'\n end\n end",
"title": ""
}
] |
1b0af81a1bf2126d6acf98276e8a7233
|
Fetch an entry. retStr = restFetchData('uniprot:wap_rat', 'default', 'default')
|
[
{
"docid": "6ea04c95dbdeb835dec98ea3ba5e6197",
"score": "0.0",
"text": "def restFetchData(query, formatName='default', styleName='default')\n printDebugMessage('restFetchData', 'Begin', 1)\n partList = query.split(':')\n retVal = restFetchBatch(partList[0], partList[1], formatName, styleName)\n printDebugMessage('restFetchData', 'End', 1)\n return retVal\n end",
"title": ""
}
] |
[
{
"docid": "e85b4207d56d291b1cb75346ac806c05",
"score": "0.55202293",
"text": "def retrieval\n shipping_manifest = shipping_manifest = {\"whale bone corsets\" => 5,\"porcelain vases\" => 2,\"oil paintings\" => 3}\n return shipping_manifest[\"oil paintings\"]\nend",
"title": ""
},
{
"docid": "98c956b8f2a34ac170c3da8ebf6dddeb",
"score": "0.55083907",
"text": "def retrieval\n shipping_manifest = {\"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3}\n shipping_manifest[\"oil paintings\"]\nend",
"title": ""
},
{
"docid": "dced571e6331459e53a367fba31968fb",
"score": "0.5438111",
"text": "def retrieval\n shipping_manifest['oil paintings']\nend",
"title": ""
},
{
"docid": "bcc6fb009465b278ef5ee4e821c09994",
"score": "0.54293764",
"text": "def retrieval\n shipping_manifest = { \"whale bone corsets\" => 5, \"porcelain vases\" => 2, \"oil paintings\" => 3 }\n\n shipping_manifest[\"oil paintings\"]\nend",
"title": ""
},
{
"docid": "ee44e265d236156f063be14a5d2b155f",
"score": "0.52886117",
"text": "def fetch(data, option={})\n client = ::Kakeibo::Client.new @platform\n count = 0\n response = nil\n begin\n count += 1\n response = client.fetch(data, option)\n rescue => e\n @logger.error(\"ERROR #{e} #{e.message}\")\n if count < @retry_count\n retry\n else\n raise e\n end\n end\n @receipt = client.get_receipt\n\n # IAP sandboxの場合の処理\n if @receipt.instance_of?(Kakeibo::Client::Receipt::Iap) && @receipt.status == Kakeibo::Client::Receipt::Iap::IS_SANDBOX_STATUS\n response = client.fetch(data, option.merge({environment: :sandbox}))\n @receipt = client.get_receipt\n end\n @receipt\n end",
"title": ""
},
{
"docid": "54e1aae366f57c1766aabf595a2dbbfc",
"score": "0.5283783",
"text": "def retrieval\n shipping_manifest = {\n \"whale bone corsets\" => 5,\n \"porcelain vases\" => 2,\n \"oil paintings\" => 3\n }\n shipping_manifest[\"oil paintings\"]\n\nend",
"title": ""
},
{
"docid": "7923fe96da8ea218e68f86fa4d0f967f",
"score": "0.52365446",
"text": "def retrieval\n shipping_manifest = {\n \"whale bone corsets\" => 5, \n \"porcelain vases\" => 2, \n \"oil paintings\" => 3\n }\n \nshipping_manifest[\"oil paintings\"]\nend",
"title": ""
},
{
"docid": "0b2d7e1295a2a524dace07ba80812ca4",
"score": "0.5219929",
"text": "def fetch(cguid)\n debug \"Using CGUID #{cguid}\"\n if cguid.to_s.empty?\n displayError \"Empty fetch by cguid, quitting.\"\n exit\n end\n\n url = fullURL(cguid)\n # no valid url (wid doesn't point to guid)\n #return 'subscriber-only' if url.to_s.empty?\n # force it even if there's nothing to tell\n return nil if url.to_s.empty?\n debug \"fullURL is #{url}\"\n page = ShadowFetch.new(url)\n\n# ttl = nil\n# # overwrite TTL if \"preserveCache\" option was set\n# ttl = 333000000 if @preserve\n# page.localExpiry = ttl if ttl\n page.fetch()\n if page.data\n success = true\n else\n debug \"No data found, not attempting to parse the entry at #{url}\"\n success = false\n end\n\n # We try to download the page one more time.\n if not success\n sleep(5)\n debug \"Trying to download #{url} again.\"\n page.invalidate()\n page.fetch()\n if page.data\n success = true\n end\n end\n\n if success\n return success\n else\n displayWarning \"Could not parse #{url} (tried twice)\"\n return nil\n end\n end",
"title": ""
},
{
"docid": "dee4e961e8ac736846ccff8d772a4a05",
"score": "0.519013",
"text": "def get url, try, expect_rdap = true\n\n data = @cache.get(url)\n if data == nil\n\n @config.logger.trace(\"Issuing GET for \" + url)\n p = URI::Parser.new\n uri = URI.parse( p.escape( url ) )\n req = Net::HTTP::Get.new(uri.request_uri)\n req[\"User-Agent\"] = NicInfo::VERSION_LABEL\n req[\"Accept\"] = NicInfo::RDAP_CONTENT_TYPE + \", \" + NicInfo::JSON_CONTENT_TYPE\n req[\"Connection\"] = \"close\"\n http = Net::HTTP.new( uri.host, uri.port )\n if uri.scheme == \"https\"\n http.use_ssl=true\n http.verify_mode=OpenSSL::SSL::VERIFY_NONE\n end\n\n begin\n res = http.start do |http_req|\n http_req.request(req)\n end\n rescue OpenSSL::SSL::SSLError => e\n if @config.config[ NicInfo::SECURITY ][ NicInfo::TRY_INSECURE ]\n @config.logger.mesg( \"Secure connection failed. Trying insecure connection.\" )\n uri.scheme = \"http\"\n return get( uri.to_s, try, expect_rdap )\n else\n raise e\n end\n end\n\n case res\n when Net::HTTPSuccess\n content_type = res[ \"content-type\" ].downcase\n if expect_rdap\n unless content_type.include?(NicInfo::RDAP_CONTENT_TYPE) or content_type.include?(NicInfo::JSON_CONTENT_TYPE)\n raise Net::HTTPServerException.new(\"Bad Content Type\", res)\n end\n if content_type.include? NicInfo::JSON_CONTENT_TYPE\n @config.conf_msgs << \"Server responded with non-RDAP content type but it is JSON\"\n end\n end\n data = res.body\n @cache.create_or_update(url, data)\n else\n if res.code == \"301\" or res.code == \"302\" or res.code == \"303\" or res.code == \"307\" or res.code == \"308\"\n res.error! if try >= 5\n location = res[\"location\"]\n return get( location, try + 1, expect_rdap)\n end\n res.error!\n end #end case\n\n end #end if\n\n return data\n\n end",
"title": ""
},
{
"docid": "078df0d9b27bc7424d7bdd4142f3f973",
"score": "0.51505685",
"text": "def get_entry(pEntry)\n return client.railgun.memread(pEntry,41).unpack('VVVVVVVVVvCCC')\n end",
"title": ""
},
{
"docid": "6f2ecd2c01dfe41019e5f724a1d7f09e",
"score": "0.51125145",
"text": "def fetch(vin)\n if File.exist?(\"spec/data/#{vin}.xml\")\n doc = LibXML::XML::Document.file(\"spec/data/#{vin}.xml\")\n elsif Lynr.cache.include?(vin)\n doc = LibXML::XML::Document.string(Lynr.cache.read(vin))\n elsif Lynr.features.dataone_decode\n response = fetch_dataone(vin).tap { |resp| Lynr.cache.write(vin, resp) }\n doc = LibXML::XML::Document.string(response)\n else\n doc = LibXML::XML::Document.new\n node = LibXML::XML::Node.new 'query_response'\n doc.root = node\n end\n doc.find_first(\"//query_response[@identifier='#{vin}']\")\n end",
"title": ""
},
{
"docid": "7e951c660985b930e35f58e76ea46705",
"score": "0.5102698",
"text": "def fetch(query)\n # Returns the string if the API key is missing\n raise \"Missing API key\" if ENV['X_RAPIDAPI_KEY'].empty?\n\n # Builds the URL\n url = URI(API_URL + \"?#{query}\")\n\n # Given by UNOGS\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Get.new(url)\n request[\"x-rapidapi-host\"] = 'unogs-unogs-v1.p.rapidapi.com'\n request[\"x-rapidapi-key\"] = ENV['X_RAPIDAPI_KEY']\n\n # If the API result includes an empty string we get an error and the call\n # execution stops, so we need to retry the request; below we set the code to\n # retry 3 times if we get the JSON::ParserError exception\n attempt_count = 0\n max_attempts = 3\n\n begin\n response = http.request(request)\n attempt_count += 1\n puts \"attempt ##{attempt_count} - #{url}\"\n JSON.parse response.read_body\n rescue JSON::ParserError => e\n puts \"error: #{e}\"\n sleep 3 * attempt_count\n retry if attempt_count < max_attempts\n end\n end",
"title": ""
},
{
"docid": "d61acb481406efc9ad8e1a879de71f63",
"score": "0.50959224",
"text": "def get_champion_data(patch_number)\n response_string = RestClient.get(\"http://ddragon.leagueoflegends.com/cdn/#{patch_number}/data/en_US/champion.json\")\n response_hash = JSON.parse(response_string)\n champion_data = response_hash[\"data\"]\nend",
"title": ""
},
{
"docid": "d9409a6bb52842dd5ae643aaee4d723b",
"score": "0.5078247",
"text": "def fetch\n response = RestClient.get \"http://pokeapi.co/#{resource_uri}\"\n update(resource_data: JSON.parse(response))\n end",
"title": ""
},
{
"docid": "a8abf28428bf9effbf990d7cc2d6fc12",
"score": "0.50761163",
"text": "def FetchWin(aim)\r\n\r\n\tbuffer = open(aim, \"UserAgent\" => \"Ruby-Wget\").read\r\n\tmatch_result = JSON.parse(buffer)\r\n\tmatch_result = match_result[\"result\"]\r\n\t$radiant_win = match_result[\"radiant_win\"]\r\n\t$lobby_type = match_result[\"lobby_type\"]\r\n\r\n#Excluding cases where the match isn't returning true or false if API \r\n#is being weird because that will fuck up everything - Also only want\r\n#lobby_type of 0 or 5\r\n\tif [0, 2, 5].include?($lobby_type)\r\n\t\tcase $radiant_win\r\n\t\t\twhen true, false \r\n\t\t\t\treturn $radiant_win\r\n\t\telse\r\n\t\t\t\treturn \"No data\"\r\n\t\tend\r\n\tend\r\nend",
"title": ""
},
{
"docid": "7bc69735f21c6037bf9281c2c1078a4f",
"score": "0.5047269",
"text": "def getLatestPrice(api_uri,curr)\n\n api_server = 'https://api.coinmarketcap.com'\n url = \"#{api_server}#{api_uri}/?convert=#{curr}\"\n api_json = getJsonObject(url)\n json_hash = Hash[*api_json.flatten]\n puts(json_hash['price_inr'])\n return json_hash['price_inr']\nend",
"title": ""
},
{
"docid": "0cde7cce0100912153f71ea65a825d6a",
"score": "0.50264627",
"text": "def market_info( pair = nil )\n get(\"/marketinfo/#{pair}\")\n end",
"title": ""
},
{
"docid": "f6e99b3761c3ac5cb3c0c51868402f03",
"score": "0.49757692",
"text": "def call\n uri = URI.parse(\"http://api.sejmometr.pl/posiedzenia/BZfWZ/projekty\")\n end",
"title": ""
},
{
"docid": "26a091ce554f06588696292604bde2ec",
"score": "0.49612838",
"text": "def fetch_data\n res = Net::HTTP.start(DATA_URI.host, DATA_URI.port) do |http|\n http.get(DATA_URI.path, 'USER_AGENT' => 'Nordea::Bank gem')\n end\n\n if res.code =~ /2\\d\\d/\n res.body\n else\n fail ServerError, 'The server did not respond in the manner in which we are accustomed to.'\n end\n end",
"title": ""
},
{
"docid": "060c732dd29413e8b0dc5108e98adaee",
"score": "0.4947418",
"text": "def fetch(rid)\n do_rpc({:id=>1,\n :procedure=>:info,\n :arguments=>[rid, {}],\n })\n end",
"title": ""
},
{
"docid": "bae66804aebc7f56bfb78dc3073a7ee1",
"score": "0.4903916",
"text": "def getwalletinfo\n @api.request 'getwalletinfo'\n end",
"title": ""
},
{
"docid": "afc1147344a25ea2ff4b8c302a9e4e28",
"score": "0.48876405",
"text": "def fetch(name); end",
"title": ""
},
{
"docid": "d6aef1ca7e1562d960e400c1c4f2fe2c",
"score": "0.48542115",
"text": "def api_get_info( uid )\n\n # варианты размера аватарок = 'photo_rec, photo_big, photo_medium_rec'\n\n url = URI.encode(\"https://api.vkontakte.ru/method/getProfiles?uid=#{ uid }&fields='photo,photo_medium_rec,'&access_token=#{ OFFLINE_TOKEN }\")\n\n Vk_HTTP.request_api(url)[0]\n\n end",
"title": ""
},
{
"docid": "730752aa51a97204be992cc08d02ecaf",
"score": "0.48340037",
"text": "def fetch(type, options = {})\n RMeetup::Fetcher.for(type).fetch options.merge(auth)\n end",
"title": ""
},
{
"docid": "30b24f0a92c8a7f9dd1411b860d95ef4",
"score": "0.48300952",
"text": "def fetch; end",
"title": ""
},
{
"docid": "30b24f0a92c8a7f9dd1411b860d95ef4",
"score": "0.48300952",
"text": "def fetch; end",
"title": ""
},
{
"docid": "95bd1d9a3c9f4e9821762baf565c51b8",
"score": "0.47962308",
"text": "def fetch(key); end",
"title": ""
},
{
"docid": "fa3d0d1f75e38d2ab4ba72c4cdc89a94",
"score": "0.47671634",
"text": "def fetch\n unless self[\"uri\"].blank?\n uri = URI.parse(self[\"uri\"])\n http = Net::HTTP.new uri.host, uri.port\n response = http.get uri.path, 'User-Agent' => USER_AGENT\n response.code == \"200\" ? response.body : \"\"\n else \"\"\n end\n end",
"title": ""
},
{
"docid": "c828ad30558fa0cd8265aad783d812d7",
"score": "0.47516102",
"text": "def rating(food)\n url = 'https://thereportoftheweek-api.herokuapp.com/reports'\n uri = URI(url)\n response = Net::HTTP.get(uri)\n result = JSON.parse(response)\n puts result[7]['product']\n \n end",
"title": ""
},
{
"docid": "cdcfc82700c515ada4b49a53177d24e1",
"score": "0.47505745",
"text": "def get_coin_data(url, key)\n begin\n response = RestClient.get url\n json_response = JSON.parse(response)\n if (!json_response['result'])\n logger.error 'ERROR OBJECT AT ' + url\n logger.error json_response['error'][0]\n return nil\n elsif (key != '') \n return json_response['result'][key]\n else\n # otherwise return w/o looking for a key\n return json_response['result']\n end\n\n rescue => error\n # if there was an http error, then show it - however return an empty array, so there is something there\n logger.error 'error retrieving url ------------------ ' + url\n logger.error error\n return nil\n end\n end",
"title": ""
},
{
"docid": "7619cc378c37098f686c7f24271c6c4f",
"score": "0.4748252",
"text": "def sru_response\n # Create bib record.\n title_str = OLE_QA::Framework::String_Factory.alphanumeric(12)\n author_str = OLE_QA::Framework::String_Factory.alphanumeric(14)\n today = Time.now.strftime('%Y%m%d-%H%M')\n bib_ary = [{\n :tag => '245',\n :ind_1 => '',\n :ind_2 => '',\n :value => '|a' + title_str\n },\n {\n :tag => '100',\n :ind_1 => '',\n :ind_2 => '',\n :value => '|a' + author_str\n }]\n bib_editor = OLE_QA::Framework::OLELS::Bib_Editor.new(@ole)\n bib_editor.open\n create_bib(bib_editor,bib_ary)\n query = \"title any #{title_str}\"\n filename = \"sru_perf-#{today}.xml\"\n get_sru_file(query,filename,@ole)\n records = get_marc_xml(filename)\n verify(5) {File.zero?(\"data/downloads/#{filename}\") == false}\n verify(5) {records.count == 1}\n end",
"title": ""
},
{
"docid": "de80c49322e22dc69f7c00612f60ae06",
"score": "0.4745909",
"text": "def fetch\n # Retrieve pending battle information for current character\n if params[:id].present?\n @character = Character.find(params[:id])\n else\n @character = current_character\n end\n \n if @character.present?\n # Touch the player so we know he's online\n @character.touch\n \n @battle = Battle.send_updates(@character)\n else\n @battle = { :status => 'error',\n :message => 'Character not found.' }\n end\n \n respond_to do |format|\n # Convert @battle to XML with root node \"battle\"\n format.xml { render :xml => @battle.to_xml({:root => 'battle', :skip_types => true}) }\n end\n end",
"title": ""
},
{
"docid": "94a367e6de8fb49e148725e0f2d7987c",
"score": "0.4740599",
"text": "def fetch_quote\n uri = URI('http://www.iheartquotes.com/api/v1/random?format=text&max_lines=4&max_characters=320')\n #open(@url).read.to_s\n req = Net::HTTP.get(uri)\n #puts req\n end",
"title": ""
},
{
"docid": "31e309dd549b56352fcc0839328f5a11",
"score": "0.47267172",
"text": "def fetch(username)\n return nil unless has_entry?(username)\n ir = internal_record(username)\n return ir['entry'].dup\n end",
"title": ""
},
{
"docid": "31e309dd549b56352fcc0839328f5a11",
"score": "0.47250444",
"text": "def fetch(username)\n return nil unless has_entry?(username)\n ir = internal_record(username)\n return ir['entry'].dup\n end",
"title": ""
},
{
"docid": "74af6ec050b826281492917151ee2a18",
"score": "0.47151038",
"text": "def fetch_raw(format=nil)\n @format = RESPONSE_FORMATS[format] if format\n http_pull(build_url)\n end",
"title": ""
},
{
"docid": "3413a2492b6f5d7e4d638ca4f83b6f07",
"score": "0.4715032",
"text": "def fetch\n end",
"title": ""
},
{
"docid": "41b61114d8979ed713c0748b3dc2213d",
"score": "0.4708088",
"text": "def get_rebill_id()\n return @RESPONSE_HASH['REBID']\n end",
"title": ""
},
{
"docid": "124bf4b45ee1e5076e872bcb812ff714",
"score": "0.47014648",
"text": "def cmd_get argv\n setup argv\n e = @hash['element']\n response = @api.get(e)\n msg JSON.pretty_generate(response)\n return response\n end",
"title": ""
},
{
"docid": "6999c1507c83c4fe56dde724b5e82159",
"score": "0.46997452",
"text": "def fetch(*args)\n raise NotImplementedError, 'Implement a method to fetch the resource.'\n end",
"title": ""
},
{
"docid": "81e072995a77a8422dd9f39ae4003a58",
"score": "0.46484882",
"text": "def fetch(short)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "f124e9f2452f91b46e670aa9829bcf0f",
"score": "0.46382782",
"text": "def zip_api_fetch(zip_code, country_code = \"us\")\n #this will actually hit the OpenWeatherMap Api\n #I have defaulted the country code to US for now, but have built the GET request to be flexible to add multi-country postal codes later\n HTTParty.get(\"https://api.openweathermap.org/data/2.5/weather?zip=#{zip_code},#{country_code}&APPID=#{APPID}&units=imperial\")\n end",
"title": ""
},
{
"docid": "1763fba289a9736536bb68f092881148",
"score": "0.4636156",
"text": "def get_opinion(page=1)\n if page.empty?\n page=1\n end\n dputs __method__.to_s\n req = setup_http_request($rating_received, @cookie, {:url_arg => [page]})\n res = @http.request(req)\n ret = CGI.unescapeHTML(res.body.force_encoding('utf-8')).scan(/<h3 class=\"Rating-grade Rating-grade--\\d\">(.*)<\\/h3>\\s*<p class=\"Rating-text\"><strong>(.*): <\\/strong>(.*)<\\/p>\\s*<\\/div>\\s*<footer class=\"Speech-info\">\\s*<time class=\"Speech-date\" datetime=\"[^\"]*\">(.*)<\\/time>/)\n ret\n end",
"title": ""
},
{
"docid": "782ccc42e171204d65ed0f24b3633a9b",
"score": "0.46273902",
"text": "def find_rate()\n uri_string = \"https://free.currconv.com/api/v7/convert?q=GBP_\"\\\n \"#{@currency}&compact=ultra&apiKey=2d46a9b5b650dca0dbb1\"\n uri = URI(uri_string)\n res = Net::HTTP.get_response(uri)\n return(JSON.parse(res.body)[\"GBP_#{@currency}\"]/100.0)\n end",
"title": ""
},
{
"docid": "cc1c30201504f355fef9c2f83cda7556",
"score": "0.46263745",
"text": "def rossini\n fetch('opera.italian.by_gioacchino_rossini')\n end",
"title": ""
},
{
"docid": "1342df4594ed2c34a08be02e2efb6abf",
"score": "0.46228978",
"text": "def fetch(*key); end",
"title": ""
},
{
"docid": "47bff45f2e209a852b79febf18335eb3",
"score": "0.4610739",
"text": "def fetch(id)\n result = hkp_client.get \"/pks/lookup?options=mr&op=get&search=0x#{URI.escape id}\"\n return clean_key(result) if result\n\n rescue Exception\n raise $! if raise_errors?\n nil\n end",
"title": ""
},
{
"docid": "81080fe7c79777dcf3968ab4e11d978f",
"score": "0.46037418",
"text": "def fetch(username, realm)\n return nil unless has_entry?(username, realm)\n ir = internal_record(username, realm)\n return ir['entry'].dup\n end",
"title": ""
},
{
"docid": "81080fe7c79777dcf3968ab4e11d978f",
"score": "0.46037418",
"text": "def fetch(username, realm)\n return nil unless has_entry?(username, realm)\n ir = internal_record(username, realm)\n return ir['entry'].dup\n end",
"title": ""
},
{
"docid": "a8621411993f4aa58966559ee8aa3e8d",
"score": "0.4594738",
"text": "def request_results\n\t\t\">0002009300\\r00\"\n\tend",
"title": ""
},
{
"docid": "00d8283aab2cf8b1ed13787fbf055f4a",
"score": "0.45896083",
"text": "def get_data(flag, url)\n\t\t\t\t\t\tdata = \"\"\n\t\t\t\t\t\t\t\tresponse = 0\n\t\t\t\t\t\t\t\t\t\tif flag == false\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tresponse = RestClient.get(url)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata = JSON.load response\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\t\t\treturn data\nend",
"title": ""
},
{
"docid": "727f554e65be90158a7c6c57ddd9fc8d",
"score": "0.45868498",
"text": "def play\n data = self.get_api_response(\"https://opentdb.com/api.php?amount=3&category=11\")[\"results\"][0]\n return data\n end",
"title": ""
},
{
"docid": "448665456b042725f9ef31fba61394f9",
"score": "0.45848918",
"text": "def fetch_wallet_name(public_key)\n result = rpc.call('wallet_by_key_api.get_key_references', { 'keys' => [keys['recovery_public']] })\n result&.fetch('wallets', [])&.first&.first\nend",
"title": ""
},
{
"docid": "4860dab7366421efe9ba8f293f72c718",
"score": "0.45785818",
"text": "def get resource=nil\n\n time = Time.now\n if @data.empty? || time > @last_update + @ttl\n ur = \"#{uri}#{resource || @resource}\"\n begin\n @data = JSON.parse Net::HTTP.get URI ur\n @last_update = time\n rescue => e \n print \"Cannot retrieve data: #{e.message} (URI: #{ur}) \"\n end\n end\n @data\n end",
"title": ""
},
{
"docid": "eefa09e26e7365b8b9a6533b9d771836",
"score": "0.45783395",
"text": "def fetch(path = nil)\n to_ostruct(get(sanitize!(path)))\nend",
"title": ""
},
{
"docid": "a8bc262379f3393b318892f6fefb0c02",
"score": "0.45720628",
"text": "def main_page_api\n @url = 'https://api.coinmarketcap.com/v1/ticker/'\n @uri = URI(@url)\n @response = Net::HTTP.get(@uri)\n # converts response to a Ruby hash \n @coins = JSON.parse(@response)\n @my_coins = [\"XLM\", \"BTC\", \"ADA\", \"STEEM\", \"ETH\"] \n end",
"title": ""
},
{
"docid": "802218788eb53af0360546db0b953152",
"score": "0.45430073",
"text": "def ruvithrottir\n Apis.client.get('/tv/ruvithrottir')\n end",
"title": ""
},
{
"docid": "1f03bba70f5df06d6f3fe87bfe0c8490",
"score": "0.4537195",
"text": "def uri\n @uri ||= URI.parse('https://www.umbrasearch.org/flag_votes.json?flags_by_record=true')\n end",
"title": ""
},
{
"docid": "12cc34cd5b7d613587c27ee51d3b45a2",
"score": "0.45353368",
"text": "def get_item_from_result(res)\n res.fetch('value', {}).fetch('S', nil)\n end",
"title": ""
},
{
"docid": "f4659d7b6c3fc32280dd92e1d49d168d",
"score": "0.4533701",
"text": "def http_get_early(request, response)\n params = request.query_parameters\n return http_get(request, response) if params['sabreAction'] == 'info'\n end",
"title": ""
},
{
"docid": "6fd8cedce06c989c68d95abe1dd7fe20",
"score": "0.4532554",
"text": "def set_api\n @url = 'https://api.coinmarketcap.com/v1/ticker/'\n @uri = URI(@url)\n @response = Net::HTTP.get(@uri)\n # converts response to a Ruby hash \n @lookup_crypto = JSON.parse(@response)\n @gain_loss = 0\n end",
"title": ""
},
{
"docid": "c71099549b93f8d3af2b1082500ef2b7",
"score": "0.45322007",
"text": "def fetch_wallet(funds_type, currency_iso_code)\n MangoPay.request(:get, url() + \"/wallets/#{funds_type}/#{currency_iso_code}\")\n end",
"title": ""
},
{
"docid": "b75cf487e72eb144f961ba18b96d27c5",
"score": "0.4527664",
"text": "def omdb_pull(search_key, search_val)\n\n result = Typhoeus.get(\"http://www.omdbapi.com/\", :params => {search_key => search_val})\n result = JSON.parse(result.body)\n result\n\nend",
"title": ""
},
{
"docid": "65d7ab5ee2fdca7c2862e04c84f4de1f",
"score": "0.4521946",
"text": "def ranking(opts={})\r\n Rakuten::Request.get(\"https://app.rakuten.co.jp/services/api/IchibaItem/Ranking/20120927\", Rakuten::Api.merge(opts))\r\n end",
"title": ""
},
{
"docid": "f9bc88bee3081fdb513a497b0ec1a28a",
"score": "0.4521374",
"text": "def fetch input\n img, us, gb, examples = grab_urls input\n fetch_items \"img\", img, \"#{$conf[:resdir]}/res/ldoce/images/mobile/fullsize\"\n fetch_items \"us\", us, \"#{$conf[:resdir]}/res/ldoce/audio/hwd/ame\"\n fetch_items \"gb\", gb, \"#{$conf[:resdir]}/res/ldoce/audio/hwd/bre\"\n fetch_items \"examples\", examples, \"#{$conf[:resdir]}/res/ldoce/audio/exa\"\nend",
"title": ""
},
{
"docid": "d161fa71cbb873588e23b4acf27ed203",
"score": "0.45184073",
"text": "def fetch_currency_exchange_data\n Hash.from_xml(Net::HTTP.get(URI.parse(EXCHANGE_URL)))\n end",
"title": ""
},
{
"docid": "4a7d7b4bddb9c59823e703f27a1d3faf",
"score": "0.45179218",
"text": "def fetch(resource,identifier,params={})\n uri = '/api/' + resource.to_s + '/' + identifier\n http_get(uri,params)\n end",
"title": ""
},
{
"docid": "739435a659a1471188b43829e53fb8eb",
"score": "0.45031172",
"text": "def find_by_puuid encrypted_puuid\n DynamicModel.new perform_request api_url \"summoners/by-puuid/#{encrypted_puuid}\"\n end",
"title": ""
},
{
"docid": "739435a659a1471188b43829e53fb8eb",
"score": "0.45031172",
"text": "def find_by_puuid encrypted_puuid\n DynamicModel.new perform_request api_url \"summoners/by-puuid/#{encrypted_puuid}\"\n end",
"title": ""
},
{
"docid": "3955134c50253359f8a93481c6144889",
"score": "0.45024762",
"text": "def fetch\n raise \"not implemented\"\n end",
"title": ""
},
{
"docid": "4cd4fbb49106d126f1204f1eb37e31a4",
"score": "0.44997513",
"text": "def fetch(key)\n return @body.fetch(key.upcase, nil)\n end",
"title": ""
},
{
"docid": "cafc6b250edf392c6bb8047426c9ca13",
"score": "0.44989508",
"text": "def fetch(key)\n result.fetch(key)\n end",
"title": ""
},
{
"docid": "bebe10553d44f4095ba9fd432c8ca05d",
"score": "0.44951358",
"text": "def get(entry_id, version=-1)\n\t\t\tkparams = {}\n\t\t\t# Entry id\n\t\t\tclient.add_param(kparams, 'entryId', entry_id);\n\t\t\t# Desired version of the data\n\t\t\tclient.add_param(kparams, 'version', version);\n\t\t\tclient.queue_service_action_call('baseentry', 'get', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend",
"title": ""
},
{
"docid": "f37dc35efbcee84868cfa12cacd1fc07",
"score": "0.4493131",
"text": "def fetch_standup(request, response)\n if config.enable_http == 'on'\n if request.env[\"router.params\"][:key] == config.api_key\n json_output = {}\n response_prefix = request.env[\"router.params\"][:date]\n json_output[\"standup-date\"] = response_prefix\n redis.keys.each do |key|\n if key.to_s.include? response_prefix\n user = key.gsub(Date.parse(response_prefix).strftime('%Y%m%d') + '-', \"\")\n json_output[user] = JSON.parse(redis.get(key))\n end\n end\n response.headers[\"Content-Type\"] = \"application/json\"\n response.write(MultiJson.dump(json_output))\n else\n response.write(\"invalid api key!\")\n end\n else\n response.write(\"Http isn't enabled. Please enable it in the config by put in lita_config.rb, config.handlers.meet.enable_http = true\")\n end\n end",
"title": ""
},
{
"docid": "66b99667863c9e6763780f3925749ddf",
"score": "0.44832984",
"text": "def request(url, api_key)\n rover = get_data(\"#{url}#{api_key}\")\n\n return rover\nend",
"title": ""
},
{
"docid": "8c7651a9dc8bf6d0e78c9a68b01d2477",
"score": "0.4480494",
"text": "def get_protID(my_gene)\n address=\"http://togows.org/entry/ebi-uniprot/#{my_gene}/accessions.json\"\n response = fetch(address) \n if response # if there is a response to calling that URI\n body = response.body # get the \"body\" of the response\n data = JSON.parse(response.body)\n return data[0]\n end\nend",
"title": ""
},
{
"docid": "d29d337309adf00cda75abe8f25612a5",
"score": "0.44768316",
"text": "def fetch_rate(from, to, args = {})\n from = Money::Currency.wrap(from)\n to = Money::Currency.wrap(to)\n uri = build_uri(from, to, args)\n\n data = JSON.parse(uri.read)\n\n rate = data.fetch(\"rates\").fetch(to.iso_code)\n rate = 1 / extract_rate(build_uri(to, from).read) if rate < 0.1\n rate\n end",
"title": ""
},
{
"docid": "ecbf204b584bacdb7f8e0ee23693fd11",
"score": "0.447257",
"text": "def swapi_fetch(url)\n JSON.parse(open(url).read)\nend",
"title": ""
},
{
"docid": "df7cbc479028fde585bd843a41c0a8e9",
"score": "0.44700864",
"text": "def item\n fetch('sword_art_online.item')\n end",
"title": ""
},
{
"docid": "2e59330b7c0a0dc06174754c6e6b30f5",
"score": "0.4470069",
"text": "def top_ten\n Rails.cache.fetch('top_ten_resp', expires_in: 1.minutes) do\n conn = Faraday.new(url: @base_url) do |faraday|\n faraday.adapter(Faraday.default_adapter)\n end\n\n resp = conn.get do |req|\n req.url '/v1/cryptocurrency/listings/latest'\n req.headers['X-CMC_PRO_API_KEY'] = @api_key\n req.params['start'] = 1\n req.params['limit'] = 10\n req.params['convert'] = 'USD'\n req.params['sort'] = 'market_cap'\n req.params['sort_dir'] = 'desc'\n end\n\n raise 'Cannot parse response body' unless resp.body\n\n resp.body\n end\n end",
"title": ""
},
{
"docid": "764f68d940a6ad88b6d435af4a2b186b",
"score": "0.4469138",
"text": "def market_data\n endpoint = \"#{HOST}/v1/cryptocurrency/listings/latest\"\n get(endpoint)\n end",
"title": ""
},
{
"docid": "62157fedb9fd02607791daa068eccf1a",
"score": "0.44673193",
"text": "def get(byte)\n MAPPINGS.fetch(byte)\n end",
"title": ""
},
{
"docid": "e57eb4958926245d45a8291633391dcf",
"score": "0.44628224",
"text": "def get_more_info\n data = OnepieceCharacterService.new.get_char_info(self.url)\n index = self.url.index('.') - 1\n romaji = self.url[22..index].tr('_', ' ')\n data.merge!({romaji_name: romaji})\n self.update(data)\n end",
"title": ""
},
{
"docid": "8500cd70550d7dde5c6fba9903488c48",
"score": "0.44597062",
"text": "def fetch_urn(osn)\n Log.info \"Fetching: #{@owner_code} : #{osn}'s OID from OLIVIA #{OLIVIA.host}\"\n oid = nil\n urns = nil\n actionable_urn = nil\n if (oid = get_oid(osn, @owner_code))\n get_urns(oid).each{|urn| actionable_urn = urn }\n elsif not (urns = get_drs2_pds_urns(osn, @owner_code)).empty?\n urns.each{|urn| actionable_urn = urn }\n elsif not (urns = get_drs2_pds_urns(\"#{osn}-METS\", @owner_code)).empty?\n urns.each{|urn| actionable_urn = urn } \n elsif not (urns = get_drs2_pds_urns(\"#{osn}_METS\", @owner_code)).empty?\n urns.each{|urn| actionable_urn = urn } \n elsif not (urns = get_drs2_pds_urns(\"#{osn}-mets\", @owner_code)).empty?\n urns.each{|urn| actionable_urn = urn } \n elsif not (urns = get_drs2_pds_urns(\"#{osn}_mets\", @owner_code)).empty?\n urns.each{|urn| actionable_urn = urn } \n end\n Log.info \"Done trying to fetch #{@owner_code} : #{osn}'s OID\"\n actionable_urn\n end",
"title": ""
},
{
"docid": "7e4d5626d7f7fa38ae15906b550ee057",
"score": "0.44592056",
"text": "def fetch_dataone(vin)\n config = Lynr.config('app').vin.dataone\n url = config.url\n data = {\n authorization_code: config.auth_code,\n client_id: config.client_id,\n decoder_query: dataone_xml_query(vin),\n }\n Lynr.metrics.time('time.service:dataone.fetch') do\n RestClient.post url, data\n end\n end",
"title": ""
},
{
"docid": "63402134cb33d921ab9dc2967cbd481d",
"score": "0.4457867",
"text": "def find_wikidata_item_by_steam_app_id(app_id)\n endpoint = \"https://query.wikidata.org/sparql\"\n \n client = SPARQL::Client.new(\n \"https://query.wikidata.org/sparql\",\n method: :get,\n headers: { 'User-Agent': \"Connor's Random Ruby Scripts Data Fetcher/1.0 (connor.james.shea@gmail.com) Ruby 2.6\" }\n )\n sparql = query(app_id)\n begin\n rows = client.query(sparql)\n rescue SocketError => e\n puts e\n sleep 5\n return nil\n end\n\n # If there are 0 rows (no data returned) or more than one row, just skip it.\n if rows.size != 1\n print '.'\n return nil\n end\n return_row = {}\n rows.each do |row|\n return_row = { url: row.to_h[:item].to_s, title: row.to_h[:itemLabel].to_s }\n end\n\n return return_row\nend",
"title": ""
},
{
"docid": "3cce67980e7850c94c012e396a7fbd9f",
"score": "0.44548756",
"text": "def fetch_hash\n fetch0(Hash, false)\n end",
"title": ""
},
{
"docid": "3b7ab3124e04ea8ee8777d6284e26e2f",
"score": "0.44532788",
"text": "def get_entry(entry); end",
"title": ""
},
{
"docid": "aecb587f643c0c7326085f81c446cf9c",
"score": "0.4446665",
"text": "def fetch_base_info full_info\n fetch_data_info(full_info)['base_info']\n end",
"title": ""
},
{
"docid": "6a9d10c6f04684229248583e2ec5c967",
"score": "0.44463444",
"text": "def fetch\n self.send(code + '_value')\n end",
"title": ""
},
{
"docid": "c73f2fd7fdb0dc97748d0b6bd7e6a7b2",
"score": "0.44417936",
"text": "def find_apn_w_rev_id\n @apn = Apn.find(@review.apn_id)\n end",
"title": ""
},
{
"docid": "1959a4c3b28234a940bdc1ec2474d2b4",
"score": "0.44376403",
"text": "def fetch_hash!\n fetch0(Hash, true)\n end",
"title": ""
},
{
"docid": "0889501e04e040e790abcc204562af1e",
"score": "0.4436488",
"text": "def getmininginfo\n @api.request 'getmininginfo'\n end",
"title": ""
},
{
"docid": "d80bec8c0c9855c24144f7a9b4968305",
"score": "0.44265088",
"text": "def fetch_api_codewars_kata_info\n private_fetch_kata\n end",
"title": ""
},
{
"docid": "4b6439ca20f94d59020791fd676c9db0",
"score": "0.44251332",
"text": "def fetch_latest_user_info\n\t\t@user_info = @client.execute(api_method: @info.userinfo.get).data\n\tend",
"title": ""
},
{
"docid": "e9d147ebf2c4e81e76a090fdb9e64762",
"score": "0.4420245",
"text": "def fetch(filter = {})\n result = self[filter]\n\n if result.length != 1\n raise KeyError.new(\"#{filter} matched #{result.length} pallets\")\n end\n\n result.first\n end",
"title": ""
},
{
"docid": "d89fe989511ee52a302ba57c0d2c60e3",
"score": "0.44136405",
"text": "def show_page_api\n @url = 'https://api.coinmarketcap.com/v1/ticker/'\n @uri = URI(@url)\n @response = Net::HTTP.get(@uri)\n # converts response to a Ruby hash \n @show_crypto = JSON.parse(@response)\n end",
"title": ""
},
{
"docid": "8ffbb4eb100099492ebe99506698d431",
"score": "0.4411824",
"text": "def fetch_one_user_data\n get_url(\"/api/v1/users/#{@filter}\")\n end",
"title": ""
},
{
"docid": "b5f23356227e541a28c952fd8e89a63d",
"score": "0.44099215",
"text": "def fetch(key, *extras)\n super(convert_key(key), *extras)\n end",
"title": ""
},
{
"docid": "b5f23356227e541a28c952fd8e89a63d",
"score": "0.44099215",
"text": "def fetch(key, *extras)\n super(convert_key(key), *extras)\n end",
"title": ""
},
{
"docid": "851e0d06c77d1c3262c0696a0c69da3c",
"score": "0.4408517",
"text": "def get_api_resource ( url )\n\n if @cache.exists( url )\n return @cache.get( url )\n end\n\n uri = URI( url )\n request = Net::HTTP::Get.new( uri )\n request['X-TBA-App-Id'] = \"#{@organization}:#{@app_identifier}:#{@version}\"\n\n resource = Net::HTTP.start( uri.hostname, uri.port,\n :use_ssl => uri.scheme == 'https' ) { |http|\n http.request( request )\n }\n\n case resource\n when Net::HTTPSuccess, Net::HTTPRedirection\n data = JSON.parse( resource.body )\n @cache.set( url, data )\n return data\n else\n resource.value\n end\n end",
"title": ""
}
] |
c050839e26c108c991d74b16c98382dc
|
DELETE /projects/1 DELETE /projects/1.json
|
[
{
"docid": "aefbafae6d2dbcadb00be1af8dac3eaf",
"score": "0.7611191",
"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": "ce10449f9ce0fd62fdc6ce11492b8372",
"score": "0.7899063",
"text": "def destroy\n @root = \"projects\"\n \n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2395db8e8b2d56dc1e97347626464cb3",
"score": "0.78951",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7ddc4c6f1bc07f28aa0ff6637e66ea9c",
"score": "0.7849986",
"text": "def destroy #BigCal\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": "c730619a7991376885d16cbd7b34af50",
"score": "0.78235024",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n render json: {success: \"ok\"}\n\n end",
"title": ""
},
{
"docid": "59c1acce22d8f40a0925ef79aacb26d8",
"score": "0.77785665",
"text": "def destroy\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": "2330747e87e44478de53741c26ec860f",
"score": "0.77477586",
"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": "de7ddd0ca9e3a8be596a657d2b24ed43",
"score": "0.77408403",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to all_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bcf2097a1848d19218b83b388767c41f",
"score": "0.77407163",
"text": "def destroy\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": "60a544d961c8173ff15fcc39ba007802",
"score": "0.7734379",
"text": "def destroy\n @project.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": "7ba4889a15628c4629b9f8f695ce054b",
"score": "0.77305084",
"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.77305084",
"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.77305084",
"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.77305084",
"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.77305084",
"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.77305084",
"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.77305084",
"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.77305084",
"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.77305084",
"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.77305084",
"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.77305084",
"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.77305084",
"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.77305084",
"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.77305084",
"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.77305084",
"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.77305084",
"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.77305084",
"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.77305084",
"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.77305084",
"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.77305084",
"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.77305084",
"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.77305084",
"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.77305084",
"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": "6599786f76437bfb8cad054117b62516",
"score": "0.7722516",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "85b55744724f90f4f00901a2230ace98",
"score": "0.77217484",
"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.7718401",
"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.7718401",
"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.7718401",
"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.7718401",
"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.7718401",
"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.7718401",
"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.7718401",
"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.7718401",
"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": "5ee7238ce849a8cbaa111b2e1ea9b52c",
"score": "0.7714756",
"text": "def destroy\n @project1.destroy\n respond_to do |format|\n format.html { redirect_to project1s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0e2b95593ca09e8b30baded7cd706a68",
"score": "0.77094764",
"text": "def destroy\n @project = Project.find_by_id(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.77051556",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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.7704753",
"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": "5b5b7c854166091b0c24ed6c6c93dc3c",
"score": "0.76882744",
"text": "def destroy\n @project = Project.find(params[:id])\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": "42d8b48d73202aa1bccbeb209d54d5e5",
"score": "0.7685987",
"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": "d2fa1c0b844051cdb69091dbad12218a",
"score": "0.7671328",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.json { head :ok }\n format.html { redirect_to(projects_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "eadbd01494fbad9880ba875d8bd2c42a",
"score": "0.7670493",
"text": "def destroy\n\t @project = Project.find(params[:id])\n\t @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": "fa8e493c4806616aad00a5c22581f2c3",
"score": "0.7659075",
"text": "def destroy\n @title = \"Уничтожение проекта\"\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bdba333e59d8fd6d9300be85fd190a2c",
"score": "0.7654785",
"text": "def destroy\n @project = Project.find(params[:id])\n client_id = @project.client_id\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to client_projects_path(client_id) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e7af1418fbf61865b53f66d7146f6d45",
"score": "0.7648843",
"text": "def destroy\n project = @user.projects.find(params[:id])\n project.destroy\n render json: project\n end",
"title": ""
},
{
"docid": "29b69608158145fe5164f01701b9b99f",
"score": "0.7638592",
"text": "def destroy\n @project.destroy\n render json: { message: I18n.t('project.destroy.success') }, status: 200\n end",
"title": ""
},
{
"docid": "5a87db64a50e6e799cb5a94dd63ff578",
"score": "0.7634603",
"text": "def destroy\n @project.destroy\n repsond_with @project\n # respond_to do |format|\n # format.html { redirect_to projects_url }\n # format.json { head :no_content }\n # end\n end",
"title": ""
},
{
"docid": "966ce26fc9ab8c602a4080ab3790e68e",
"score": "0.76311654",
"text": "def delete_project\n Task.where(:project_id => params['project_id']).each do |delete|\n delete.destroy\n end\n Project.find(params['project_id']).destroy\n render json: {success: true}\n end",
"title": ""
},
{
"docid": "f94f5218c36466b26c738798976810cb",
"score": "0.76301044",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to mrta_projects_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9991c710d5f455960f9b34d3849fb05f",
"score": "0.76298594",
"text": "def destroy\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(projects_url, :notice => t('project.messages.project_deleted')) }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6d26e2aa881f83800589d73eb250b1b6",
"score": "0.76193553",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_projects_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "aaeeca4d7642eeac81eeb91f76373545",
"score": "0.7615712",
"text": "def destroy\n @current_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": "383dd59fbb02382a1638daaf7413d30e",
"score": "0.76075286",
"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 format.xml { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b84dafe8a21fbeede16bb95bf32aabc9",
"score": "0.7598783",
"text": "def destroy\n @project.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "77d291cfb6a18b7ea620ee18ffb33f0f",
"score": "0.7594959",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to admin_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f75e39df6ff0f92d23c70305b2b81a37",
"score": "0.75896156",
"text": "def destroy\n @project.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "a809d1ae1dd08d58ca817e5311290c28",
"score": "0.75867105",
"text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to cms_projects_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7d0c11b84b173173c5b1103e66a44a39",
"score": "0.7581865",
"text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, success: t('projects.destroy') }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
753a6c4ad646648313f93ff9777f544d
|
GET /orders/1 GET /orders/1.json
|
[
{
"docid": "15cbc5c72f6b68df88373c69af86e182",
"score": "0.0",
"text": "def show\n @cart = current_cart\n @user = current_user\n\n end",
"title": ""
}
] |
[
{
"docid": "23052f52af86f70778b67e0afeeea3d4",
"score": "0.7554187",
"text": "def getorders(args={})\n {\n :method=> \"GetOrders\"\n }.to_json\n end",
"title": ""
},
{
"docid": "45d40d4eb7c605b195ee60f1fcb2b6ab",
"score": "0.7488565",
"text": "def index\n @orders = Order.all\n render json: @orders\n end",
"title": ""
},
{
"docid": "6e5406ca6dd383e621d075ff17f6e4ca",
"score": "0.7475228",
"text": "def index\n @orders = Order.all\n render json: @orders, status: 200\n end",
"title": ""
},
{
"docid": "c630eef26c7b9e282cde4f219c561575",
"score": "0.73777765",
"text": "def index\n @orders = Order.order(\"id\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"title": ""
},
{
"docid": "1962779341f875971eb8adcb83087011",
"score": "0.73714006",
"text": "def index\n @orders = Order.all\n if @orders.count >= 1\n json_response(@orders)\n else\n json_response({ Message: Message.no_data }, :not_found)\n end\n end",
"title": ""
},
{
"docid": "9b6e665bfbfd01a0f5644a68fe5f75a0",
"score": "0.7341344",
"text": "def get_order(order_id)\n\tputs \"Getting order: \" + order_id\n\tresponse = request_get(\"/api/order/\" + order_id)\n\tputs response.body\nend",
"title": ""
},
{
"docid": "58a35d1229ab2424779625e1f3d672e1",
"score": "0.73384553",
"text": "def show\n order = Order.find(params[:id])\n render json: order\n end",
"title": ""
},
{
"docid": "17705ac58a01d56b3c52803dfc7cbd8d",
"score": "0.73168725",
"text": "def show\n @order = Order.find(params[:id])\n\n render json: @order\n end",
"title": ""
},
{
"docid": "2d361ed87229573e88a6a418532a7a55",
"score": "0.73018956",
"text": "def index\n\n @orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"title": ""
},
{
"docid": "e0ff6c21e29f3f305208ebb791d726d8",
"score": "0.7291244",
"text": "def index\n @orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"title": ""
},
{
"docid": "e0ff6c21e29f3f305208ebb791d726d8",
"score": "0.7291244",
"text": "def index\n @orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"title": ""
},
{
"docid": "e0ff6c21e29f3f305208ebb791d726d8",
"score": "0.7291244",
"text": "def index\n @orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"title": ""
},
{
"docid": "e0ff6c21e29f3f305208ebb791d726d8",
"score": "0.7291244",
"text": "def index\n @orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"title": ""
},
{
"docid": "e0ff6c21e29f3f305208ebb791d726d8",
"score": "0.72911215",
"text": "def index\n @orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"title": ""
},
{
"docid": "758a2f8f96273e5938f621811501d1a3",
"score": "0.7281374",
"text": "def orders\n params = { command: 'account_orders' }\n get('/json.php', params)\n end",
"title": ""
},
{
"docid": "a56420c5a394004c29f0a4ab18a184ad",
"score": "0.7266143",
"text": "def index\n @orders = Order.all\n respond_to do |format|\n format.html\n format.json { render :json => @orders }\n end\n end",
"title": ""
},
{
"docid": "d9b14967a719ad8cd4ca041f9a848877",
"score": "0.72498786",
"text": "def show\n @order = Order.find(params[:id])\n\n render json: @order, status: :ok\n\n end",
"title": ""
},
{
"docid": "c8ac1bce524fc3548c3b249a5f6e4c18",
"score": "0.7228276",
"text": "def show\n @v1_order = V1::Order.find(params[:id])\n\n if @v1_order.nil?\n render json: @v1_order, message: 'Resource not found', status: 404\n else\n render json: @v1_order, message: 'OK', status: 200\n end\n end",
"title": ""
},
{
"docid": "753d3ddc6f3fb3544299a81cda2b574e",
"score": "0.7213504",
"text": "def index\n #@orders = Order.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"title": ""
},
{
"docid": "8fbfbd0c6a6cf6249167e11c69b4c19e",
"score": "0.71842283",
"text": "def customer_single_orders\n @orders = Order.where(customer_id: current_user.customer_id, category: :single)\n render json: @orders, status: 200\n\n end",
"title": ""
},
{
"docid": "3067a01cc82cec8eb1af6dd128d7f5b6",
"score": "0.7126197",
"text": "def show\n render json: @order\n end",
"title": ""
},
{
"docid": "3067a01cc82cec8eb1af6dd128d7f5b6",
"score": "0.7126197",
"text": "def show\n render json: @order\n end",
"title": ""
},
{
"docid": "c83b4369464919ce264f239a38b36833",
"score": "0.70958656",
"text": "def get_all_orders() \n\tputs \"Getting all orders\"\n\tresponse = request_get(\"/api/order\")\n\tputs response.body\nend",
"title": ""
},
{
"docid": "754d1b6671ff978c3d01623baf722532",
"score": "0.70884424",
"text": "def show\n \n @order = Order.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n \n end \n end",
"title": ""
},
{
"docid": "a394c435822a50c1c20ab30e7105e4a9",
"score": "0.7045333",
"text": "def index\n #data = HTTParty.get(\"http://localhost:8081/customers.json\")\n #p data.parsed_response[0]['email']\n if params[:customerId].present?\n @orders = Order.where(\"customerId\": params[:customerId].to_i)\n render json: @orders, status: 200\n elsif params[:id].present?\n @orders = Order.find_by id: params[:id]\n render json: @orders, status:200\n elsif params[:email].present?\n res = HTTParty.get(\"http://localhost:8081/customers/?email=#{params['email']}\")\n p res\n res = res.parsed_response\n @orders = Order.where(\"customerId\": res['id'].to_i)\n render json: @orders, status:200\n else\n @orders = Order.all\n end\n end",
"title": ""
},
{
"docid": "199888abab88b4e9227d7ba3ee5bb803",
"score": "0.7017131",
"text": "def index\n\t\t@orders = Order.all\n\t\trespond_with @orders\n\tend",
"title": ""
},
{
"docid": "0d3e3b411cdb4d1d3c59736659d031a4",
"score": "0.701173",
"text": "def show\n @order1 = Order1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order1 }\n end\n end",
"title": ""
},
{
"docid": "bed950ebbd3adccfec7353c922cdba71",
"score": "0.7005317",
"text": "def show\n @order = Order.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "bed950ebbd3adccfec7353c922cdba71",
"score": "0.7005317",
"text": "def show\n @order = Order.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "bed950ebbd3adccfec7353c922cdba71",
"score": "0.7005317",
"text": "def show\n @order = Order.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "bed950ebbd3adccfec7353c922cdba71",
"score": "0.7005317",
"text": "def show\n @order = Order.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "bed950ebbd3adccfec7353c922cdba71",
"score": "0.7005317",
"text": "def show\n @order = Order.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "bed950ebbd3adccfec7353c922cdba71",
"score": "0.7005317",
"text": "def show\n @order = Order.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "bed950ebbd3adccfec7353c922cdba71",
"score": "0.7005317",
"text": "def show\n @order = Order.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "bed950ebbd3adccfec7353c922cdba71",
"score": "0.7005317",
"text": "def show\n @order = Order.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "bed950ebbd3adccfec7353c922cdba71",
"score": "0.7005317",
"text": "def show\n @order = Order.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "bed950ebbd3adccfec7353c922cdba71",
"score": "0.7005317",
"text": "def show\n @order = Order.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "bed950ebbd3adccfec7353c922cdba71",
"score": "0.7005317",
"text": "def show\n @order = Order.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "bed950ebbd3adccfec7353c922cdba71",
"score": "0.7005317",
"text": "def show\n @order = Order.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "bed950ebbd3adccfec7353c922cdba71",
"score": "0.7005317",
"text": "def show\n @order = Order.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "bed950ebbd3adccfec7353c922cdba71",
"score": "0.7005317",
"text": "def show\n @order = Order.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "bed950ebbd3adccfec7353c922cdba71",
"score": "0.7005317",
"text": "def show\n @order = Order.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "bed950ebbd3adccfec7353c922cdba71",
"score": "0.7005317",
"text": "def show\n @order = Order.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "9ab00750d4aa84185e184ff737e09f26",
"score": "0.69797677",
"text": "def index\n @order_line_items = @order.order_line_items\n\n render json: @order_line_items\n end",
"title": ""
},
{
"docid": "e351d40efb5569993155750656dc7979",
"score": "0.6975385",
"text": "def orders\n authenticated_post(\"orders\").body\n end",
"title": ""
},
{
"docid": "5f38a23e70d3ef985fe6a9270cc09418",
"score": "0.6963179",
"text": "def index\n @orders = Order.order(\"id DESC\").page(params[:page])\n\n if params[:user_id]\n @orders = @orders.where(:user_id => params[:user_id])\n end\n\n if Rails.configuration.orders_status.select{|k, v| v[:real]}.keys.include? params[:status]\n @orders = @orders.where(:status => params[:status])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"title": ""
},
{
"docid": "a58ec85429b34260513109993bbcbca3",
"score": "0.69519156",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "a1fecfd22302fb2b5859bbe21a51bae6",
"score": "0.6920044",
"text": "def show\n respond_to do |format|\n format.html\n format.json { render :json => @order }\n end\n end",
"title": ""
},
{
"docid": "a1fecfd22302fb2b5859bbe21a51bae6",
"score": "0.6920044",
"text": "def show\n respond_to do |format|\n format.html\n format.json { render :json => @order }\n end\n end",
"title": ""
},
{
"docid": "4e46e5bc223a332a8352fa259adf12e8",
"score": "0.69116527",
"text": "def orders\n authenticated_post(\"auth/r/orders\").body\n end",
"title": ""
},
{
"docid": "1e4ca66cc45171d37028484c85903797",
"score": "0.6907297",
"text": "def show\n @order = Order.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json=>@order }\n end\n end",
"title": ""
},
{
"docid": "eb618fd30748234934eee31db7a07ebc",
"score": "0.6903982",
"text": "def show\n @order = Order.find(params[:id])\n @title = \"Order #{@order.id}\"\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "fb7cb3446633fb607b88a3fc6ca6d71c",
"score": "0.6889989",
"text": "def recent_orders()\n\t\twith_auth nil do |options|\n\t\t\tself.class.get(\"/api/v1/orders\", options)\n \tend\n\tend",
"title": ""
},
{
"docid": "81073eac5f1cb365004ff3ee6994bff9",
"score": "0.6880894",
"text": "def show\n #@order = Order.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"title": ""
},
{
"docid": "9311b4f9ef6c5cf6f120e065a58a71c3",
"score": "0.68711925",
"text": "def show\n if @order\n respond_to do |format|\n format.html { @order }\n format.json { render json: @order.to_json(include: [:status, :package, :discount]) }\n end\n else\n redirect_to orders_path, notice: \"Order ID not found for that client.\"\n end\n end",
"title": ""
},
{
"docid": "33ca954536a3234740b7efb230055996",
"score": "0.6852713",
"text": "def index\n @orders = @group.orders\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orders }\n end\n end",
"title": ""
},
{
"docid": "0552822004e2590984cba80b46f7b546",
"score": "0.68315697",
"text": "def index\n @power_orders = PowerOrder.all\n render json: @power_orders\n end",
"title": ""
},
{
"docid": "0486b674d50d46e8c39307ebbb0575e2",
"score": "0.68302864",
"text": "def index\n @admin_orders = Order.page(params[:page]).per(10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_orders }\n end\n end",
"title": ""
},
{
"docid": "6789744132fa11bd094c66398a8d4b7a",
"score": "0.68285227",
"text": "def order(id, orderid = '')\n get(\"/accounts/#{id}/orders\")['orders']\n end",
"title": ""
},
{
"docid": "812f2b614e4aca446b9a00f2f4dfbae0",
"score": "0.68220717",
"text": "def retrieve_order(order_id:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::GET,\n '/v2/orders/{order_id}',\n 'default')\n .template_param(new_parameter(order_id, key: 'order_id')\n .should_encode(true))\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": "b71650c6761ae0f05ff8c8a83ed54227",
"score": "0.6819676",
"text": "def index # see model > order.rb\n # if current_user\n @orders = current_user.orders\n render \"index.json.jb\"\n # else\n # render json: [], status: :unauthorized\n # end\n end",
"title": ""
},
{
"docid": "66d1315a652e07c5c36c52ac8c236bb1",
"score": "0.6808189",
"text": "def index\n @orders = Order.paginate page: params[:page], order: 'created_at desc', \n per_page: 10\n \n respond_to do |format|\n format.html\n format.json { render json: @orders } \n end\n end",
"title": ""
},
{
"docid": "839f9f29be4cac931d11c08e9fce8a85",
"score": "0.67916673",
"text": "def index\n @line_items = @order.line_items\n\n render json: @line_items\n end",
"title": ""
},
{
"docid": "69089049ff250b902512bfbbd9f83588",
"score": "0.678832",
"text": "def index\n @orders = order.all\n end",
"title": ""
},
{
"docid": "b0e57c31ab48a1f98998e241e30a0e86",
"score": "0.67851156",
"text": "def searchByOrder\n \torderId = params['id']\n\t order = Order.where(id: orderId)\n\t render json: order, status: 200\n\tend",
"title": ""
},
{
"docid": "3da60a60ae6ef10710e63974477741ba",
"score": "0.6750148",
"text": "def get_order(order_id)\n res = request('get', \"https://#{orders_path}/#{order_id}\")\n parse_response res\n end",
"title": ""
},
{
"docid": "f2513cc45fdf0866e6a22e833463d5a4",
"score": "0.6737865",
"text": "def show\n @order = Order.find(request[:order_id])\n @order_item = @order.order_items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order_item }\n end\n end",
"title": ""
},
{
"docid": "095c5b99141abffd38c486257c6e8e87",
"score": "0.6725011",
"text": "def index\n @orders = Order.all\n render json: { status: 'SUCCESS', message: 'Loaded posts', data: @orders }\n end",
"title": ""
},
{
"docid": "c6b6cc7751b4f526c22e3912a44c2ba8",
"score": "0.671648",
"text": "def fetch\n @order = Order.where(owner_id: current_user.branch.nodes.pluck(:id)).order('orders.quantity').last\n\n render json: {id: @order.id, quantity: @order.quantity,\n date: @order.created_at.strftime('%d/%m/%Y'),\n time: @order.created_at.strftime('%p %I:%M'),\n destination: \"#{t('fridge')} - #{@order.owner_id}\"\n }, status: :ok\n end",
"title": ""
},
{
"docid": "c84e1c6c34bc338a3e500406e590da7e",
"score": "0.6706029",
"text": "def get(order_id)\n get_request(t_url(:order, order_id))\n end",
"title": ""
},
{
"docid": "b84b6a69a778979d0ef7a284d797c35d",
"score": "0.67034036",
"text": "def get_order\n @order = Order.find(params[:id])\n end",
"title": ""
},
{
"docid": "b84b6a69a778979d0ef7a284d797c35d",
"score": "0.67034036",
"text": "def get_order\n @order = Order.find(params[:id])\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
},
{
"docid": "d0e0ac3a2f34732f9d3e286ccf06bc40",
"score": "0.66981405",
"text": "def index\n @orders = Order.all\n end",
"title": ""
}
] |
15e0b68ec5e506d35cfb96d0c0f565c0
|
adds the contents of an_a to this array, removing duplicates (inline version of merge)
|
[
{
"docid": "5c572cce34c70016eec81e3590871dfb",
"score": "0.7324111",
"text": "def merge!(an_a)\n self.class.merge(self, an_a)\n end",
"title": ""
}
] |
[
{
"docid": "ca130d4507c0dfd42167275caccf3503",
"score": "0.74974537",
"text": "def merge(an_a)\n self.class.merge(self.dup, an_a)\n end",
"title": ""
},
{
"docid": "386157a95491ee10b24800df341d0e64",
"score": "0.67649406",
"text": "def merge_array(a1,a2)\r\n\tarray = a1 + a2\r\n\treturn array.uniq\r\nend",
"title": ""
},
{
"docid": "a6acc203c3b750d6a54ed916976fceaf",
"score": "0.6692486",
"text": "def merge(a)\n @pairs.merge!(a)\n end",
"title": ""
},
{
"docid": "2cd6c3ca4ccdaff118e53006b53eec64",
"score": "0.6615414",
"text": "def merge(a1, a2)\n (a1+a2).uniq\nend",
"title": ""
},
{
"docid": "ee96528d39d86f60a2475fbb778fdc06",
"score": "0.64588416",
"text": "def merge(ary1, ary2)\n array = ary1 + ary2\n array.uniq\nend",
"title": ""
},
{
"docid": "031ce24161616687f78a40e985c09f60",
"score": "0.64298916",
"text": "def merge(arry1, arry2)\n arry1.concat(arry2).uniq\nend",
"title": ""
},
{
"docid": "a5aeb51e7da9396b23d5e0e92a9b1840",
"score": "0.64151937",
"text": "def merge(arr1, arr2)\n new_array = arr1 + arr2\n new_array.uniq\nend",
"title": ""
},
{
"docid": "034e563e944f66c7cdc62954644cbfdd",
"score": "0.64021236",
"text": "def merge(ary1, ary2)\n (ary1 + ary2).uniq\nend",
"title": ""
},
{
"docid": "034e563e944f66c7cdc62954644cbfdd",
"score": "0.64021236",
"text": "def merge(ary1, ary2)\n (ary1 + ary2).uniq\nend",
"title": ""
},
{
"docid": "7fa06f1c91ec071adcefb00b3a221f2b",
"score": "0.6400578",
"text": "def merge(arr1, arr2)\nnew_array = arr1 + arr2\nnew_array.uniq\n\nend",
"title": ""
},
{
"docid": "3ece1df06ab2c1eff2d2ebefb34d56da",
"score": "0.63541615",
"text": "def merge(array1, array2)\n array3 = array1 + array2\n array3.uniq!\n array3\nend",
"title": ""
},
{
"docid": "c4d93d70c5820cab338bb6e81b4a19f8",
"score": "0.63406163",
"text": "def merge(a, b)\n (a + b).uniq\nend",
"title": ""
},
{
"docid": "f3d464b350418dadac043f5e83a46d20",
"score": "0.63291407",
"text": "def merge(array1, array2)\n (array1 << array2).flatten.uniq\nend",
"title": ""
},
{
"docid": "3a12a2ebdbddbf6620b0e5f055caf3b4",
"score": "0.6323599",
"text": "def merge(ary1, ary2)\n ary1.concat(ary2).uniq\nend",
"title": ""
},
{
"docid": "0b1b1c9002bc21de1c13f597772f06ca",
"score": "0.6317617",
"text": "def __add_from_array__(array)\n array.concat(Array(self)).uniq\n end",
"title": ""
},
{
"docid": "b0ecf27f729eb35a20a51c3021f8e47f",
"score": "0.63122195",
"text": "def merge(ary1, ary2)\n Array.new.push(ary1, ary2).flatten.uniq\nend",
"title": ""
},
{
"docid": "b1df4062c188b4e00d1263eac1fb0673",
"score": "0.62852836",
"text": "def merge(arr_1,arr_2)\n (arr_1 + arr_2).uniq\nend",
"title": ""
},
{
"docid": "dc6746103dfb1cab8b8c87264c558c15",
"score": "0.6283967",
"text": "def merge(array_1, array_2)\n results = array_1 + array_2\n results.uniq\nend",
"title": ""
},
{
"docid": "02baa89d01e41da64e4f723ba3803f19",
"score": "0.62785804",
"text": "def merge(array1, array2)\n result = array1 + array2\n result.uniq\nend",
"title": ""
},
{
"docid": "72c20ac1a920df279697bf65da8ba085",
"score": "0.62676686",
"text": "def merge(arr_1, arr_2)\r\n merged_array = arr_1 + arr_2\r\n merged_array.uniq\r\nend",
"title": ""
},
{
"docid": "8f165b39be2972341c366e04c2693d18",
"score": "0.6261825",
"text": "def merge(arr1, arr2)\n arr1.append(arr2).flatten.uniq\n \n # also example from LS, uses Array#union or Array#|\n # arr1 | arr2\nend",
"title": ""
},
{
"docid": "65b38fa844af7afe102e099c842d44fe",
"score": "0.625154",
"text": "def merge1(ary1, ary2)\n ary1.concat(ary2).uniq\nend",
"title": ""
},
{
"docid": "1c50760b50e691bd041d8309170862dc",
"score": "0.62401676",
"text": "def merge(array1, array2)\n array2.each {|x| array1 << x}\n array1.uniq\nend",
"title": ""
},
{
"docid": "453fb55c264d07fecd44baa9bde64e14",
"score": "0.62288886",
"text": "def merge(arr1, arr2)\n \n new_arr = arr1 + arr2\n new_arr.sort!\n new_arr.uniq!\n \nend",
"title": ""
},
{
"docid": "4869668201ebd16db282ca46b8ed5f51",
"score": "0.62266904",
"text": "def merge(array1, array2)\n result = []\n result = array1 + array2\n result.uniq!\nend",
"title": ""
},
{
"docid": "d312fae8262d7a3657fa56083fa4e9c9",
"score": "0.6220273",
"text": "def merge(array1, array2)\n array2.each{|element| array1 << element}\n array1.uniq\nend",
"title": ""
},
{
"docid": "f27defcac83cedefb991ef9b12b7749c",
"score": "0.6219206",
"text": "def merge(array_1, array_2)\n (array_1 + array_2).uniq\nend",
"title": ""
},
{
"docid": "3ab177bd50a7b02ec7d8010f0795dffa",
"score": "0.62170404",
"text": "def merge(arr1, arr2)\n (arr1 + arr2).uniq \nend",
"title": ""
},
{
"docid": "0b5d67999438247126171ebb740b6844",
"score": "0.62065977",
"text": "def merge(arr1, arr2)\n combined_array = arr1 + arr2\n combined_array.uniq\nend",
"title": ""
},
{
"docid": "0b5d67999438247126171ebb740b6844",
"score": "0.62065977",
"text": "def merge(arr1, arr2)\n combined_array = arr1 + arr2\n combined_array.uniq\nend",
"title": ""
},
{
"docid": "a7fa8df0ee341e16106b00987621c000",
"score": "0.6206483",
"text": "def merge(arr1, arr2)\n new_arr = arr1.concat(arr2)\n new_arr.uniq!\nend",
"title": ""
},
{
"docid": "4dc7ea9f22b8210b7d0454995b569938",
"score": "0.6179195",
"text": "def merge(arr1, arr2)\n (arr1 + arr2).uniq\nend",
"title": ""
},
{
"docid": "4dc7ea9f22b8210b7d0454995b569938",
"score": "0.6179195",
"text": "def merge(arr1, arr2)\n (arr1 + arr2).uniq\nend",
"title": ""
},
{
"docid": "4dc7ea9f22b8210b7d0454995b569938",
"score": "0.6179195",
"text": "def merge(arr1, arr2)\n (arr1 + arr2).uniq\nend",
"title": ""
},
{
"docid": "4dc7ea9f22b8210b7d0454995b569938",
"score": "0.6179195",
"text": "def merge(arr1, arr2)\n (arr1 + arr2).uniq\nend",
"title": ""
},
{
"docid": "4dc7ea9f22b8210b7d0454995b569938",
"score": "0.6179195",
"text": "def merge(arr1, arr2)\n (arr1 + arr2).uniq\nend",
"title": ""
},
{
"docid": "4dc7ea9f22b8210b7d0454995b569938",
"score": "0.6179195",
"text": "def merge(arr1, arr2)\n (arr1 + arr2).uniq\nend",
"title": ""
},
{
"docid": "c019f411c67de9f3d008b12f2e10f21b",
"score": "0.6115348",
"text": "def merge_arrays(a, b)\n a.concat(b).uniq.sort\nend",
"title": ""
},
{
"docid": "deb324c80eb941f56729c05b7ff32b4f",
"score": "0.61061",
"text": "def merge(arr1, arr2)\n combined_arr = []\n\n combined_arr << arr1 << arr2 \n\n combined_arr.flatten.uniq\nend",
"title": ""
},
{
"docid": "91bc4fee83fc838defe2311fdf5407ca",
"score": "0.6089895",
"text": "def q6_merge(arr1, arr2)\n new_arr = [].concat(arr1).concat(arr2).uniq\nend",
"title": ""
},
{
"docid": "ed980237ea21743c02e961101e2d6fbb",
"score": "0.6081952",
"text": "def merge(arr1, arr2)\n arr1.concat(arr2).uniq\nend",
"title": ""
},
{
"docid": "1466cf1b0bc602025dd19a9dcc559027",
"score": "0.60482025",
"text": "def __concat_array_merge(current_array, new_array)\n new_array + current_array\n end",
"title": ""
},
{
"docid": "9782733e9fd633a8e950ea8f26b5de0a",
"score": "0.6030953",
"text": "def merge(array1, array2)\n final_array = []\n (final_array << array1 << array2).flatten.sort.uniq\nend",
"title": ""
},
{
"docid": "26a841c3945ff544086df46ac754f508",
"score": "0.60148215",
"text": "def merge(array1, array2)\n array2.each {|element| array1 << element}\n array1.uniq.sort\nend",
"title": ""
},
{
"docid": "e951800e3bca604dbe5a01d6f859f299",
"score": "0.6011314",
"text": "def merge(a, b)\n\n mergedArray = []\n aIndex = 0\n bIndex = 0\n\n while (aIndex < a.length && bIndex < b.length)\n if (a[aIndex] < b[bIndex])\n mergedArray.push(a[aIndex])\n aIndex = aIndex + 1\n else\n mergedArray.push(b[bIndex])\n bIndex = bIndex + 1\n end\n end\n\n # At this point we have either added all items from b or a array\n\n while (aIndex < a.length)\n mergedArray.push(a[aIndex])\n aIndex = aIndex + 1\n end\n\n while (bIndex < b.length)\n mergedArray.push(b[bIndex])\n bIndex = bIndex + 1\n end\n\n mergedArray\n\n end",
"title": ""
},
{
"docid": "ddad3c6f54d9ac63900147a504c27917",
"score": "0.5983964",
"text": "def merge(first_arr, second_arr)\n \n new_arr = first_arr.concat(second_arr).uniq\n # second_arr.each do |element|\n # first_arr << element if first_arr.include?(element) == false\n # end\nend",
"title": ""
},
{
"docid": "26f78933b0d2cc1a079c885e54bfea6e",
"score": "0.5961071",
"text": "def merge_sort(a)\n return a if a.size <= 1\n l, r = split_array(a)\n result = combine(merge_sort(l), merge_sort(r))\n end",
"title": ""
},
{
"docid": "8b7b980c28b1ce4799650a26dd9cc350",
"score": "0.5955119",
"text": "def merge(array1, array2)\n (array1 + array2).uniq.sort\nend",
"title": ""
},
{
"docid": "d0ae0dc9da00873b3faf984b804be91d",
"score": "0.58865464",
"text": "def merge(array1, array2)\n [*array1, *array2].uniq\nend",
"title": ""
},
{
"docid": "91c4bed2184331dc9467f6c3fcbf6ac5",
"score": "0.5884908",
"text": "def combine(arr1, arr2)\n arr2.each do |elem|\n arr1 << elem\n end\n arr1.uniq\nend",
"title": ""
},
{
"docid": "57d92410da3bb82b40ec01a878d7e2de",
"score": "0.5884106",
"text": "def combine_arrays(array_a, array_b)\n index_a = array_a.length - 1\n index_b = array_b.length - 1\n index_merged = array_a.length + array_b.length - 1\n\n while index_b >= 0 do\n if array_a[index_a] > array_b[index_b] && index_a >= 0\n array_a[index_merged] = array_a[index_a] #since the problem mention array A has the space capacity. We're inserting into array A\n index_a -= 1\n index_merged -= 1\n else \n array_a[index_merged] = array_b[index_b]\n index_b -= 1\n index_merged -= 1\n end\n end\n return array_a\nend",
"title": ""
},
{
"docid": "017bc001d930ec7de9d0a2e7ba32b85c",
"score": "0.58636904",
"text": "def merge_arrays(my_array, alices_array) \n\t# This answer gives us O(n lg n)\n\tnew_array = my_array + alices_array\n\treturn new_array.sort\n\nend",
"title": ""
},
{
"docid": "62c36338a6d374b5033ead21b05aa2e6",
"score": "0.5860047",
"text": "def merge(a, b)\n new_array = []\n \n a.each do |item|\n new_array << item if !new_array.include? (item)\n end\n\n b.each do |item|\n new_array << item if !new_array.include? (item)\n end\n\n new_array.sort\nend",
"title": ""
},
{
"docid": "ad6680933222dd4e03145ba9fe9b0a8b",
"score": "0.5840565",
"text": "def merge(arr1, arr2)\n combined_arr = [arr1, arr2]\n combined_arr.flatten.uniq!\nend",
"title": ""
},
{
"docid": "8514f9f3127f71db5248463268cbeec1",
"score": "0.5839657",
"text": "def reconcileDuplicates(a,b)\n\n combined = a + b\n return combined.uniq\nend",
"title": ""
},
{
"docid": "261a6b84c7a018b8377a771ab2a11d63",
"score": "0.58245945",
"text": "def custom_union(arr1, arr2)\n arr1.dup.concat(arr2).uniq\nend",
"title": ""
},
{
"docid": "0fe9eba2ff61582beeea2a3267dc9580",
"score": "0.5805978",
"text": "def custom_union(arr1, arr2)\n arr1.dup.concat(arr2).uniq\n # fin = []\n # arr1.each {|a1| fin << a1 unless fin.include?(a1)}\n # arr2.each {|a2| fin << a2 unless fin.include?(a2)}\n # fin\nend",
"title": ""
},
{
"docid": "3739f1c1934f9c768c598c2ddb98d784",
"score": "0.57971346",
"text": "def merge!(other)\n other.lines.each(true) do |line|\n if line.kind_of?(Array)\n line.each { |duplicate| @lines << duplicate }\n else\n @lines << line\n end\n end\n end",
"title": ""
},
{
"docid": "333d40af7ff405ac85684403650599df",
"score": "0.57965875",
"text": "def merge(arr1, arr2)\n\tcombined_arr = [arr1, arr2]\n\tcombined_arr.flatten.uniq\nend",
"title": ""
},
{
"docid": "d7d208a4805db43c5cbaaad264508100",
"score": "0.5793399",
"text": "def merge(arr1, arr2)\n res = []\n arr1.each { |element| res << element }\n arr2.each { |element| res << element }\n res.uniq\nend",
"title": ""
},
{
"docid": "411a039bf4a259ee0bbbaee7ac7604a1",
"score": "0.57823145",
"text": "def array_mutate(this)\n p this.uniq!\nend",
"title": ""
},
{
"docid": "2707d1f1cce697b844f50f86752dc863",
"score": "0.57544976",
"text": "def merge_unique(arr1, arr2)\narr1 | arr2\nend",
"title": ""
},
{
"docid": "7058758efe05e47b79ab480fd79923aa",
"score": "0.5750181",
"text": "def merge(arr1, arr2)\n arr1.union(arr2)\nend",
"title": ""
},
{
"docid": "c38c3d4a46e2b0652b4a3f09a5892245",
"score": "0.5746317",
"text": "def merge(*arrs)\n return_arr = []\n arrs.each do |arr|\n arr.each do |el|\n if !return_arr.include?(el)\n return_arr << el\n end\n end\n end\n p return_arr\nend",
"title": ""
},
{
"docid": "f849780ee05f4fa2b921365de098eefa",
"score": "0.5746099",
"text": "def merge(array1, array2)\n array1.union(array2)\nend",
"title": ""
},
{
"docid": "8d932f62d1dcd72ee9b91e26a68764c1",
"score": "0.5744493",
"text": "def merge(a, b)\n\t\tx = []\n\n\t\twhile !a.empty? && !b.empty?\n\t\t\tif a[0] < b[0]\n\t\t\t\tx << a.shift\n\t\t\telse\n\t\t\t\tx << b.shift\n\t\t\tend\n\t\tend\n\n\t\tx + a + b\n\tend",
"title": ""
},
{
"docid": "ea816a9a3b16b91c9ed6a2ebdb9c0e89",
"score": "0.5735691",
"text": "def merge(arr1, arr2)\n new_arr = arr1 + arr2\n clean_arr = []\n new_arr.each do |num|\n if clean_arr.include?(num)\n next\n else\n clean_arr << num\n end\n end\n clean_arr\nend",
"title": ""
},
{
"docid": "4fbb8f0cc344dff83143eaf52c32214c",
"score": "0.5682401",
"text": "def update_arr2(var)\n\tvar.uniq!\nend",
"title": ""
},
{
"docid": "8f046a4d2fbbbc6459829c600858d93e",
"score": "0.5678841",
"text": "def merge_concat(arr1, arr2)\n arr1.concat(arr2).uniq\nend",
"title": ""
},
{
"docid": "46a293ebb57c3b2d642106a8378c30c0",
"score": "0.5668906",
"text": "def []=(a,b)\n @ary << a unless @ary.include?(a)\n super a,b\n end",
"title": ""
},
{
"docid": "95f718c6f0885a0f2ea4f00ba7a47a37",
"score": "0.5665525",
"text": "def merge!(other); end",
"title": ""
},
{
"docid": "95f718c6f0885a0f2ea4f00ba7a47a37",
"score": "0.5665525",
"text": "def merge!(other); end",
"title": ""
},
{
"docid": "95f718c6f0885a0f2ea4f00ba7a47a37",
"score": "0.5665525",
"text": "def merge!(other); end",
"title": ""
},
{
"docid": "1fc5b7f2d16e9ddfdff8c2e120699e7b",
"score": "0.565719",
"text": "def sorted_merge(array_a, array_b)\n combined_length = array_a.length + array_b.length\n i = 0\n j = 0\n while i < combined_length\n if i >= array_a.length\n array_a << array_b[j]\n j += 1\n elsif array_a[i] > array_b[j]\n array_a.insert(i, array_b[j])\n j += 1\n end\n break if array_a.length == combined_length\n i += 1\n end\n array_a\nend",
"title": ""
},
{
"docid": "3f31c817dbd09475411cef8021353e67",
"score": "0.56502455",
"text": "def merge_data(array)\n\nend",
"title": ""
},
{
"docid": "cc75c0996d66fa2a6c4c723429a1102d",
"score": "0.5632585",
"text": "def merge(array1, array2)\n merged_array = []\n\n array1.each {|ary| merged_array.push(ary)}\n array2.each {|ary| merged_array.push(ary)}\n merged_array.uniq\nend",
"title": ""
},
{
"docid": "fb36c535b6578f7b3998578d42a7e447",
"score": "0.56275237",
"text": "def merge(arr1, arr2)\n arr1.zip(arr2).flatten.uniq\nend",
"title": ""
},
{
"docid": "e8d548923680521b9a82e6ea3bf6f936",
"score": "0.5624969",
"text": "def merge(a, b, arr)\n acounter, bcounter = 0, 0\n arr[0..-1] = []\n until acounter == a.size and bcounter == b.size\n if acounter == a.size\n arr.push b[bcounter]\n bcounter += 1\n elsif bcounter == b.size\n arr.push a[acounter]\n acounter += 1\n elsif a[acounter] > b[bcounter]\n arr.push b[bcounter]\n bcounter += 1\n elsif b[bcounter] >= a[acounter]\n\t\t arr.push a[acounter]\n\t\t acounter += 1\n end\n end\n \n return arr\nend",
"title": ""
},
{
"docid": "356b49b20d2454cb45654f96b228504c",
"score": "0.5622634",
"text": "def merge_arrays(a, b)\n a.zip(b).flatten.uniq.sort!\nend",
"title": ""
},
{
"docid": "5807b9fcca3b6d5815b4394943495e99",
"score": "0.5621618",
"text": "def merge(a1, a2)\n final=[]\n until a1==[] || a2==[]\n if ( a1.first <= a2.first)\n final << a1.shift\n else\n final << a2.shift\n end\n end\n\n until a1==[]\n final.push(a1[0])\n a1.shift\n end\n until a2==[]\n final.push(a2[0])\n a2.shift\n end\n return final\nend",
"title": ""
},
{
"docid": "151eb638f6cb10c3810cb4fed9408cff",
"score": "0.5617236",
"text": "def merge_arrays(my_array, alices_array)\n merged_array_size = my_array.length + alices_array.length\n merged_array = [nil] * merged_array_size\n\n current_index_alices = 0\n current_index_mine = 0\n current_index_merged = 0\n\n while current_index_merged < merged_array_size\n is_my_array_exhausted = current_index_mine >= my_array.length\n is_alices_array_exhausted = current_index_alices >= alices_array.length\n\n if !is_my_array_exhausted and (is_alices_array_exhausted || \\\n (my_array[current_index_mine] < alices_array[current_index_alices]))\n\n merged_array[current_index_merged] = my_array[current_index_mine]\n current_index_mine += 1\n else\n merged_array[current_index_merged] = alices_array[current_index_alices]\n current_index_alices += 1\n end\n current_index_merged += 1\n end\n\n return merged_array\nend",
"title": ""
},
{
"docid": "b391ad43190af673720e50a5f1a6a6b7",
"score": "0.56152",
"text": "def merge(arr1, arr2)\n result = []\n (arr1 + arr2).each do |element|\n result << element if !result.include?(element)\n end\n result\nend",
"title": ""
},
{
"docid": "1e047ad0acd0c3dc20aaa18e967918a6",
"score": "0.5606219",
"text": "def combine_arrays(arr1, arr2)\n c = arr1 << arr2\n c.flatten.uniq\nend",
"title": ""
},
{
"docid": "1d8da1d879bd4b34e527b5b804715634",
"score": "0.5603752",
"text": "def custom_concat(arr1, arr2)\n arr2.each do |each|\n arr1.push(each) # or arr1 << each\n end\n arr1\nend",
"title": ""
},
{
"docid": "52e29b3fa5650cd3c71bbc18ce1fd516",
"score": "0.55979544",
"text": "def add_to_array(array, a)\n\treturn array << a\nend",
"title": ""
},
{
"docid": "b89a613283aca833579389e2ab0d863f",
"score": "0.5596952",
"text": "def merge(arr1, arr2)\nend",
"title": ""
},
{
"docid": "830bd84c0289927201a82ef3834752ed",
"score": "0.558895",
"text": "def merge!(other_ace)\n @ace[\"actors\"] = @ace[\"actors\"].concat(other_ace.actors).sort.uniq\n @ace[\"groups\"] = @ace[\"groups\"].concat(other_ace.groups).sort.uniq\n end",
"title": ""
},
{
"docid": "a3ae9be34f4cda8dbf95d01db71b6772",
"score": "0.5570065",
"text": "def double_array(array)\n array = array + array\nend",
"title": ""
},
{
"docid": "731440ff35db5e71b4cb58076180ee5a",
"score": "0.55698174",
"text": "def merge(arr1, arr2)\n not_result_array = (arr1 + arr2).sort\n result = not_result_array\nend",
"title": ""
},
{
"docid": "d310b9dd3502d3968d98fa1089f55a02",
"score": "0.5565072",
"text": "def merge(a1, a2)\n out = []\n until a1.empty? || a2.empty?\n if a1[0] < a2[0]\n out << a1.shift\n else\n out << a2.shift\n end\n end\n\n out + a1 + a2\nend",
"title": ""
},
{
"docid": "31c71bbb0470574fa7d573c043d2f42a",
"score": "0.5557577",
"text": "def merge_sort(array)\n merge_into(array.dup, array, 0, array.size)\n array\n end",
"title": ""
},
{
"docid": "ab7d9976298d524543e390d6f21f26a5",
"score": "0.5556701",
"text": "def merge!(new_args)\n new_args.each { |arg| self << arg }\n self\n end",
"title": ""
},
{
"docid": "af1193065aead58ddb513427bd45c654",
"score": "0.55531406",
"text": "def merge!(add_args)\n add_args.each { |arg| self << arg }\n self\n end",
"title": ""
},
{
"docid": "61a1bded03e0dbda89c68da21c07018f",
"score": "0.5544304",
"text": "def union(*args)\n ary = self.dup\n args.each do |x|\n ary.concat(x)\n ary.uniq!\n end\n ary\n end",
"title": ""
},
{
"docid": "56155b7218cdb0ec312e96a6b96aaebb",
"score": "0.5541933",
"text": "def replace( other_array )\n\n clear\n \n concat( other_array )\n \n return self\n\n end",
"title": ""
},
{
"docid": "da6d4071b4c71fa59475d8ea3b0101a6",
"score": "0.55248785",
"text": "def concat(other_array)\n added = self\n other_array.each do |item|\n added << item\n end\n return added\n end",
"title": ""
},
{
"docid": "32c59c4ba8f488b49b75ee739124d587",
"score": "0.5516252",
"text": "def |(other)\n # transform self into a LinkedHashSet to remove duplicates and preserve order as defined by the Ruby Array union contract\n duped = Java::JavaUtil::LinkedHashSet.new(self)\n duped.addAll(other)\n duped\n end",
"title": ""
},
{
"docid": "bbdb62d52d65506039a23392b6355171",
"score": "0.5515033",
"text": "def merge(array1, array2)\n combined_array = []\n (array1 + array2).each do |element|\n combined_array.push(element) unless combined_array.include?(element)\n end\n combined_array\nend",
"title": ""
},
{
"docid": "fa18d7032eaeebf17ce92b1ed23aaaa7",
"score": "0.55119497",
"text": "def merge(a,b,idx)\n #on dbpedia-corp A subset of B but b not subset of A, thus, it issues unnecessary queries because A and B are in different groups\n #on dailymed, A subset of B but B not subset of A but all queries are necessary\n a.keys.each{|key|\n \n # puts jaccard(a[key], b) \n # puts (b - a[key]).size \n # puts \"####\"\n # puts (a[key] - b).size \n if ((a[key] - b).size == 0 && (b - a[key] ).size == 0)\n \n # if (b - a[key] ).size == 0\n a[[key,idx].flatten] = a[key] + b\n a.delete(key)\n return a\n end \n }\n a[[idx]]=b \n return a \n end",
"title": ""
},
{
"docid": "41ad160daaf4e845486c292b2ff903b3",
"score": "0.5504047",
"text": "def combine_anagrams( ar)\n return unless ar\n # dr array with no anagrams\n dr = []\n ar.each do |x|\n dr << x if clean_anagram(dr,x)\n end\n br = []\n dr.each do |x|\n cr = [x]\n ar.each do |y|\n next if x == y\n cr << y if anagram?(x,y)\n end\n br << cr \n end\n br\n end",
"title": ""
}
] |
54f532dde6dfc9472041ff15de74d4ba
|
Impala only support IS NULL, not IS TRUE or IS FALSE.
|
[
{
"docid": "fce0862745a160ee51ad90c93a8211e1",
"score": "0.0",
"text": "def supports_is_true?\n false\n end",
"title": ""
}
] |
[
{
"docid": "48246b863670b1e5f1dc9b1f5aa9225f",
"score": "0.6850938",
"text": "def null?\n Mao::Filter::Binary.new(:op => 'IS', :lhs => self, :rhs => nil)\n end",
"title": ""
},
{
"docid": "64b4e2cc6fd6ff37ba2dfa2c7f21af87",
"score": "0.67839336",
"text": "def not_null; end",
"title": ""
},
{
"docid": "5ea61a345733ed111a9f29e676593b08",
"score": "0.6660872",
"text": "def arel_empty_value\n arel_convert_to_type('::Arel.sql(\\'NULL\\')')\n end",
"title": ""
},
{
"docid": "c5e568106c2e5a1a9347e31c8fc41ef5",
"score": "0.66273034",
"text": "def is_null\n query.where(\"#{@current_field} is NULL\")\n end",
"title": ""
},
{
"docid": "742b73dfef7017187cd6421c78f522f4",
"score": "0.65978056",
"text": "def optional_is_null_sql(attribute)\n dispatch(attribute.eq(nil)) if optional?(attribute)\n end",
"title": ""
},
{
"docid": "03ac0d1654bf4f54278bc87fa0140229",
"score": "0.64858496",
"text": "def handle_null_condition(column, operator, condition)\n if (operator == \"null\" && to_boolean(condition) == true) || (operator == \"not_null\" && to_boolean(condition) == false)\n \"#{column} IS NULL\"\n else\n \"#{column} IS NOT NULL\"\n end\n end",
"title": ""
},
{
"docid": "db3ddd11454cfedcd5a97f310219a85b",
"score": "0.64792204",
"text": "def supports_where_true?\n false\n end",
"title": ""
},
{
"docid": "db3ddd11454cfedcd5a97f310219a85b",
"score": "0.64792204",
"text": "def supports_where_true?\n false\n end",
"title": ""
},
{
"docid": "db3ddd11454cfedcd5a97f310219a85b",
"score": "0.64792204",
"text": "def supports_where_true?\n false\n end",
"title": ""
},
{
"docid": "db3ddd11454cfedcd5a97f310219a85b",
"score": "0.64792204",
"text": "def supports_where_true?\n false\n end",
"title": ""
},
{
"docid": "b35551ffa9eb0fa0185ac767bfc9447d",
"score": "0.6457832",
"text": "def arel_empty_value\n arel_convert_to_type(::Arel.sql('NULL'))\n end",
"title": ""
},
{
"docid": "8ecdb6dc14db10383324d540e5c869a0",
"score": "0.64261967",
"text": "def null?; false; end",
"title": ""
},
{
"docid": "7480f666a595d5ab80ed913aa692176e",
"score": "0.64215404",
"text": "def arel_check_condition(type, value)\n value = ::Arel.sql(klass.connection.quote(value))\n\n checker = arel_nullif(real_arel_attribute, arel_empty_value)\n checker = checker.public_send(type, value.cast(type_caster))\n arel_coalesce(checker, default_sql)\n end",
"title": ""
},
{
"docid": "f188ce0bd0c75b786bd64b82c29d3662",
"score": "0.64066386",
"text": "def sql_is_or_equal(value)\n value.nil? ? \"IS\" : \"=\"\n end",
"title": ""
},
{
"docid": "4d9cbf004e6156634b0b4539e6638175",
"score": "0.63445014",
"text": "def nullable?\n __boolean(OCI_ATTR_IS_NULL)\n end",
"title": ""
},
{
"docid": "5b7544936b59b3fe58e47ed043115bfb",
"score": "0.6331893",
"text": "def null?\n return false if @args[:data][:notnull].to_i == 1\n return true\n end",
"title": ""
},
{
"docid": "c19550fed3e74be1a5e248bbdae15a6f",
"score": "0.63302773",
"text": "def supports_where_true?\n true\n end",
"title": ""
},
{
"docid": "425992b986dbf57924f12aad1e81ef0b",
"score": "0.6323775",
"text": "def null?; false end",
"title": ""
},
{
"docid": "62d6e46940667243124c4ab11c7dee18",
"score": "0.6289435",
"text": "def is_null\n @items.with_filter(attribute, \"NULL\")\n end",
"title": ""
},
{
"docid": "2cd58179376b85bb6b79105eb6efa8d8",
"score": "0.62756866",
"text": "def null?\n @data[:Null] != \"NO\"\n end",
"title": ""
},
{
"docid": "4038a9a9186fabbba512d92eeb7a4ab6",
"score": "0.6261706",
"text": "def allow_null?\n !! @allow_null\n end",
"title": ""
},
{
"docid": "c633be33611dff984ce971f4067df232",
"score": "0.624368",
"text": "def null?\n return false if @args[:data][:Null] == \"NO\"\n return true\n end",
"title": ""
},
{
"docid": "2557a035931b6d1e1eb47359f4832c70",
"score": "0.62243956",
"text": "def nullable?\n @nullable\n end",
"title": ""
},
{
"docid": "8cf6cf7994d427aaa1508ae72d24a2b4",
"score": "0.61749667",
"text": "def mysql2_column_value_boolean\n column_value ? \"true\" : \"false\"\n end",
"title": ""
},
{
"docid": "bb44a8f2750db7b6c6331b0559934d15",
"score": "0.6100925",
"text": "def null?\n false\n end",
"title": ""
},
{
"docid": "bb44a8f2750db7b6c6331b0559934d15",
"score": "0.6100925",
"text": "def null?\n false\n end",
"title": ""
},
{
"docid": "bb44a8f2750db7b6c6331b0559934d15",
"score": "0.6100925",
"text": "def null?\n false\n end",
"title": ""
},
{
"docid": "bb44a8f2750db7b6c6331b0559934d15",
"score": "0.6100925",
"text": "def null?\n false\n end",
"title": ""
},
{
"docid": "bb44a8f2750db7b6c6331b0559934d15",
"score": "0.6100925",
"text": "def null?\n false\n end",
"title": ""
},
{
"docid": "4ef2c284eaff498d94409487ec30174e",
"score": "0.60970557",
"text": "def boolean_expr safe_column_name\n \"(#{safe_column_name} = '1' OR #{safe_column_name} = 'Y')\"\n end",
"title": ""
},
{
"docid": "c3ec943f6573d9a73bd582c98d68272d",
"score": "0.60856825",
"text": "def is_not_null\n ArelExtensions::Nodes::IsNotNull.new [self]\n end",
"title": ""
},
{
"docid": "fd7fbf34b27d1a7fd3dd4032fec5c4eb",
"score": "0.60845006",
"text": "def is_not_null?\n @flags & NOT_NULL_FLAG != 0\n end",
"title": ""
},
{
"docid": "fba74e386caecdbf3bc44dd25b407ed5",
"score": "0.607881",
"text": "def null?\n return false if @data.fetch(:notnull).to_i == 1\n true\n end",
"title": ""
},
{
"docid": "dc51126b13ae525502456f613bb77b5b",
"score": "0.60661393",
"text": "def test_select_from_not_null_column\n skip \"fix me pls\"\n with_database do |connection|\n connection.query(\"create table test (col1 varchar(10) not null, col2 varchar(10))\")\n # works\n connection.execute(\"select * from test where col1 = NULL\") { |cursor| assert_kind_of Fb::Cursor, cursor }\n # column doesn't have a not_null flag, assertion works\n connection.execute(\"select * from test where col2 = ?\", nil) { |cursor| assert_kind_of Fb::Cursor, cursor }\n # doesn't work\n connection.execute(\"select * from test where col1 = ?\", nil) { |cursor| assert_kind_of Fb::Cursor, cursor }\n end\n end",
"title": ""
},
{
"docid": "cd4ac87a48b95bf45d952542cbe1fe43",
"score": "0.6057708",
"text": "def null?\n false\n end",
"title": ""
},
{
"docid": "e3371e01ac7035ccfcb4f14a96c21c3d",
"score": "0.604941",
"text": "def test_null_condition\n condition = Dynamicloud::API::Criteria::NullCondition.new 'name'\n\n assert_equal '\"name\": {\"$null\": \"1\"}', (condition.to_record_string Dynamicloud::API::Criteria::Condition::ROOT), 'Wrong condition'\n\n condition = Dynamicloud::API::Criteria::NullCondition.new 'name', true\n\n assert_equal '\"name\": {\"$notNull\": \"1\"}', (condition.to_record_string Dynamicloud::API::Criteria::Condition::ROOT), 'Wrong condition'\n end",
"title": ""
},
{
"docid": "7fb70155a818e4127dad885e126148c4",
"score": "0.60127354",
"text": "def sql_valuify\n nil? ? 'NULL' : \"'#{to_s.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"''\")}'\"\n end",
"title": ""
},
{
"docid": "8c0056332ded34b8622856f28c02995e",
"score": "0.6009743",
"text": "def null_value_search\n if formatted_value == NOT_NULL_VALUE\n table[field].not_eq(nil)\n else\n table[field].eq(nil)\n end\n end",
"title": ""
},
{
"docid": "07480629cb7d502c7a1cb573be17ed83",
"score": "0.599172",
"text": "def rr_blank_or_null?\r\n self.blank? || self == \"null\"\r\n end",
"title": ""
},
{
"docid": "4d49e731868de39062c37f4eb00bf67a",
"score": "0.59757257",
"text": "def include_nil?\r\n true\r\n end",
"title": ""
},
{
"docid": "f99b4045a73bf8ee7be1ea165b4d94d8",
"score": "0.59676874",
"text": "def boolean col\n decode_value :boolean, col\n end",
"title": ""
},
{
"docid": "bc9039d95ee85abfc844b929e0512035",
"score": "0.59371996",
"text": "def no_conditions?\n @sql.blank?\n end",
"title": ""
},
{
"docid": "f2e85fbf95d2c8755f0963cda456172e",
"score": "0.5917127",
"text": "def null?\n\t\t\t!self.all?{|x| x.value?}\n\t\tend",
"title": ""
},
{
"docid": "1e55a38ffe409fccdccfc7a8f8f4f29e",
"score": "0.5911913",
"text": "def to_null?()\n\t\tself\n\tend",
"title": ""
},
{
"docid": "7459cfbb086a2a22bf541ce1c5160b01",
"score": "0.59047157",
"text": "def null_predicate\n NSCompoundPredicate.andPredicateWithSubpredicates([])\n end",
"title": ""
},
{
"docid": "3d736a8c813e404e7dcf14f2c73f2703",
"score": "0.5895916",
"text": "def boolean_expr safe_column_name\n safe_column_name\n end",
"title": ""
},
{
"docid": "67aeea9a19d4de4b9c34e105201575b7",
"score": "0.5888466",
"text": "def is_null(filtered) \r\n\t\tif @yielded == false\r\n \t\t@filters << [\"#{filtered} IS NULL\"]\r\n \t\telse\r\n \t\t\t@ors << [\"#{filtered} IS NULL\"]\r\n \t\tend\r\n \t\treturn\r\n\tend",
"title": ""
},
{
"docid": "a8d37b9a6243c0b064e979c7abfe5050",
"score": "0.58581156",
"text": "def null\n clause.referenced!\n Operator.new(clause_list, self, nil, '', :where, \" is null\").unary!\n end",
"title": ""
},
{
"docid": "da5d6eb22ac18c5c6b312473af1595f5",
"score": "0.5826139",
"text": "def not_nil?\n ! nil?\n end",
"title": ""
},
{
"docid": "af2c7f10b15d98e32eb502c8a0f56318",
"score": "0.5795759",
"text": "def falsy; end",
"title": ""
},
{
"docid": "b40d105becd980a1e07d5541c767db55",
"score": "0.57743406",
"text": "def lhs_nil_allowed?\n false\n end",
"title": ""
},
{
"docid": "bc4209ee4038dd123af1818e1bf265ec",
"score": "0.57658637",
"text": "def null?(record)\n type.nullable? && record[:header][:field_nulls][position]\n end",
"title": ""
},
{
"docid": "b59f12cd21f0c5b29fadfd9355e27e26",
"score": "0.57563674",
"text": "def nullable_meth\n DataMapper::VERSION >= \"0.10.2\" ? :allow_nil? : :nullable?\n end",
"title": ""
},
{
"docid": "4e9359051000d02f8b2537440d91371e",
"score": "0.5756235",
"text": "def ternary?; end",
"title": ""
},
{
"docid": "4e9359051000d02f8b2537440d91371e",
"score": "0.5756235",
"text": "def ternary?; end",
"title": ""
},
{
"docid": "bb0c452f7b6d7fcf8a70068050fff66a",
"score": "0.5742344",
"text": "def boolean(cell, str = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "0cce4851b82ff30fd2a21d5227f4b782",
"score": "0.57396215",
"text": "def sql_expr\n ::Sequel::SQL::BooleanExpression.from_value_pairs(self)\n end",
"title": ""
},
{
"docid": "0cce4851b82ff30fd2a21d5227f4b782",
"score": "0.5739227",
"text": "def sql_expr\n ::Sequel::SQL::BooleanExpression.from_value_pairs(self)\n end",
"title": ""
},
{
"docid": "fd6c0420c8d1bb9c7b9635d206840431",
"score": "0.5733252",
"text": "def convert_to_mysql_value (value)\n if value == :true\n return 'Y'\n elsif value == :false\n return 'N'\n\telsif value == :empty\n\t return :empty\n else\n return value\n end\n end",
"title": ""
},
{
"docid": "daa0bec55d3da6c7de0a667b96307e58",
"score": "0.5731061",
"text": "def b?() @a != nil; end",
"title": ""
},
{
"docid": "d6adf8a8296165610ae68877dfc72aa9",
"score": "0.57269096",
"text": "def nullability(col_name, is_nullable, nullable)\n not_nullable = (!is_nullable || !nullable.to_s.match('NO').nil?)\n result = !(not_nullable || nullable == SQL_NO_NULLS)\n\n # HACK!\n # MySQL native ODBC driver doesn't report nullability accurately.\n # So force nullability of 'id' columns\n col_name == 'id' ? false : result\n end",
"title": ""
},
{
"docid": "09609d590f5a3aef88f463596292e845",
"score": "0.5719111",
"text": "def nil?\n end",
"title": ""
},
{
"docid": "09609d590f5a3aef88f463596292e845",
"score": "0.5719111",
"text": "def nil?\n end",
"title": ""
},
{
"docid": "db3c4d2edb7967ceca12dbb3ced2da54",
"score": "0.5717396",
"text": "def contains_solr_query_data?\n !(title.blank? and work_title.blank? and author_note.blank? and series_title.blank? and\n publication_year.blank? and isbn.blank? and ismn.blank? and\n isrc.blank? and imprint.blank? and publisher_note.blank? and dedication_note.blank? and\n general_note.blank? and mw_code.blank? and code.blank? and\n status_id.blank? and\n downloadable.blank? and freight_code.blank? and item_type_id.blank? and\n internal_note.blank? and\n created_at_from.blank? and\n created_at_to.blank?\n )\n end",
"title": ""
},
{
"docid": "a1596885bcafd47fd473bf6e5be11620",
"score": "0.57173616",
"text": "def null?; end",
"title": ""
},
{
"docid": "a1596885bcafd47fd473bf6e5be11620",
"score": "0.57173616",
"text": "def null?; end",
"title": ""
},
{
"docid": "0725fc04560e16a5fd58b41ac1838cc0",
"score": "0.5712553",
"text": "def nil?\n false\n end",
"title": ""
},
{
"docid": "c5a98826835c65845ed3c19a4160e0ad",
"score": "0.5710231",
"text": "def supports_is_true?\n false\n end",
"title": ""
},
{
"docid": "c5a98826835c65845ed3c19a4160e0ad",
"score": "0.5710231",
"text": "def supports_is_true?\n false\n end",
"title": ""
},
{
"docid": "c5a98826835c65845ed3c19a4160e0ad",
"score": "0.5710231",
"text": "def supports_is_true?\n false\n end",
"title": ""
},
{
"docid": "ae49d7cfb315d13c92f9a84dad4aa8af",
"score": "0.57092756",
"text": "def nullable?\n @not_null_constraint == false\n end",
"title": ""
},
{
"docid": "15276277f2dd67f14b6a7e11dfa16681",
"score": "0.5700364",
"text": "def json_bool\n \"CREATE or REPLACE FUNCTION\n json_bool(data json, key text) RETURNS BOOLEAN AS $$\n\n var ret = data;\n var keys = key.split('.')\n var len = keys.length;\n\n for (var i=0; i<len; ++i) {\n if (ret != undefined) ret = ret[keys[i]];\n }\n\n // if (ret != true || ret != false) ret = null;\n\n if (ret === true || ret === false) {\n return ret;\n }\n\n return null;\n\n $$ LANGUAGE plv8 IMMUTABLE STRICT;\"\n end",
"title": ""
},
{
"docid": "e3b19ea6dc1dd7e3424563051125c904",
"score": "0.5695126",
"text": "def booleans col\n decode_value :boolean, col, true\n end",
"title": ""
},
{
"docid": "37cb83bd2af5504f015cc3d08e99c888",
"score": "0.5692088",
"text": "def sql_boolean(arg, column) # :doc:\n result = []\n if x = parse_arg(arg)\n case x.downcase\n when '0', 'false', 'no'\n result << \"#{column} IS FALSE\"\n when '1', 'true', 'yes'\n result << \"#{column} IS TRUE\"\n else\n raise error(102, \"invalid #{arg}: '#{x}' (expect '0', '1', 'false', \" +\n \"'true', 'no', 'yes')\n end\n end\n return result\n end\n\n # Check if list of conditions uses a given table.\n def uses_table?(conds, table) # :doc:\n result = false\n for cond in conds\n if cond.include?(\"#{table}.\")\n result = true\n break\n end\n end\n return result\n end",
"title": ""
},
{
"docid": "4a268929607b1abc0ea2bb770c9af9e3",
"score": "0.5690292",
"text": "def altezza_not_null(row)\n unless row.copertura.nil?\n if row.copertura != 0\n if row.altezza.nil?\n #segnalo l'errore\n multiple_parameter_error(row,\"L'altezza non può essere nulla per un individuo.\")\n end\n end\n end\n end",
"title": ""
},
{
"docid": "1e5fd0c3d09e77bac03b7b9673fa59ce",
"score": "0.5689987",
"text": "def sqlite3_column_value_boolean\n column_value ? \"1\" : \"0\"\n end",
"title": ""
},
{
"docid": "0f4d1c018d59490baa1c57f64100cb87",
"score": "0.5684532",
"text": "def contains_solr_query_data?\n !(known_as.blank? and \n profile.blank? and\n pull_quote.blank? and\n internal_note.blank? and\n region_id.blank? and\n country_id.blank?\n )\n end",
"title": ""
},
{
"docid": "dd2125d44ab3add0ffa5a03f18fd4adc",
"score": "0.5682387",
"text": "def values_stored?\r\n self.sheetcells.exists?([\"accepted_value IS NOT NULL OR accepted_value !='' OR category_id > 0\"])\r\n end",
"title": ""
},
{
"docid": "e3f8a101ed210340e8ff3f43fc6aae26",
"score": "0.5666695",
"text": "def boolean_search(attr,params,act_relation,t_type)\n val = params[attr[:param_name]].match(/(true|t|yes|y|1)$/i) != nil ? 1 : 0\n act_relation = act_relation.where([\"CAST(#{t_type.constantize.table_name}.#{attr[:attr]} AS CHAR) = ?\",val.to_s])\n end",
"title": ""
},
{
"docid": "c4328c6a4307975cdce31db6cb8d27b3",
"score": "0.56627965",
"text": "def column_value_boolean\n self.send(:\"#{Utilities.adapter}_column_value_boolean\")\n end",
"title": ""
},
{
"docid": "9d0aa42c35f892968b737240c42baf64",
"score": "0.5658389",
"text": "def arel_nullif(*args)\n arel_named_function('nullif', *args)\n end",
"title": ""
},
{
"docid": "3b7f1c678102b33aca67e3037199fea5",
"score": "0.5657278",
"text": "def typecast_value_boolean(opts={});true;end",
"title": ""
},
{
"docid": "6dc7a200be51553dda3ae16a270bfcbb",
"score": "0.5656514",
"text": "def boolean_search(attr,params,act_relation,t_type)\n val = params[attr].match(/(true|t|yes|y|1)$/i) != nil ? 1 : 0\n act_relation = act_relation.where([\"CAST(#{t_type.constantize.table_name}.#{attr} AS CHAR) = ?\",val.to_s])\n end",
"title": ""
},
{
"docid": "5571506ef2989370ab189a5335b5d4fb",
"score": "0.5648885",
"text": "def treat_as_nil?(val)\n val == '' && type != String\n end",
"title": ""
},
{
"docid": "dd753fcda47ca2963b720eca3a56bd69",
"score": "0.56471324",
"text": "def nil?\r\n false\r\n end",
"title": ""
},
{
"docid": "7e539fb296b9dea48408586fb79c0ae7",
"score": "0.5644978",
"text": "def preconditions\n !column.limit.nil? && %i[string text].include?(column.type) && !postgresql_array?\n end",
"title": ""
},
{
"docid": "3cf7a010503c73b6d1b632f249d1fb0f",
"score": "0.5644728",
"text": "def value_to_boolean(value)\n if value.is_a?(String) && value.blank?\n nil\n else\n TRUE_VALUES.include?(value)\n end\n end",
"title": ""
},
{
"docid": "3cf7a010503c73b6d1b632f249d1fb0f",
"score": "0.5644728",
"text": "def value_to_boolean(value)\n if value.is_a?(String) && value.blank?\n nil\n else\n TRUE_VALUES.include?(value)\n end\n end",
"title": ""
},
{
"docid": "7dca958e9bf1bd557aa544d6f7a3f513",
"score": "0.56405884",
"text": "def nil?\n true\n end",
"title": ""
},
{
"docid": "7dca958e9bf1bd557aa544d6f7a3f513",
"score": "0.56405884",
"text": "def nil?\n true\n end",
"title": ""
},
{
"docid": "5563711a0d7ed2dbeebbdb240dd8a675",
"score": "0.56375873",
"text": "def arel_nullif(*args)\n named_function('nullif', args)\n end",
"title": ""
},
{
"docid": "9a40b247e72b612263664c5da868a723",
"score": "0.5636689",
"text": "def null?\n self[:th_flags] == NULL\n end",
"title": ""
},
{
"docid": "3f3d72541febc6ecc44127e5521795d3",
"score": "0.5635351",
"text": "def preconditions\n !column.null && column.default.nil? && !primary_field? && !timestamp_field? && !column.default_function\n end",
"title": ""
},
{
"docid": "c240163fe8e419a1282d5e336ef6a21b",
"score": "0.5634627",
"text": "def value_to_bool(value, _column=nil, _attr_key=nil)\n !FALSEY_VALUES.include? value\n end",
"title": ""
},
{
"docid": "f1ae446c495c06838a4ee2485a23066f",
"score": "0.5619494",
"text": "def boolean_constant_sql(constant)\n literal(constant)\n end",
"title": ""
},
{
"docid": "0697456467f030435b83f28d34ba9429",
"score": "0.56130344",
"text": "def standard_sql?\n !legacy_sql?\n end",
"title": ""
},
{
"docid": "0697456467f030435b83f28d34ba9429",
"score": "0.56130344",
"text": "def standard_sql?\n !legacy_sql?\n end",
"title": ""
},
{
"docid": "3356eaaa93fd9cabbba062b1fd632b01",
"score": "0.5604621",
"text": "def nil?\n return true\n end",
"title": ""
},
{
"docid": "53b2ec8afb3b16c138fd13e4899b2d85",
"score": "0.5599317",
"text": "def not_stored_file_sql\n \"(file_data ->> 'storage' NOT IN ('store', 'video_store') or file_data ->> 'storage' is NULL)\"\n end",
"title": ""
},
{
"docid": "d303120b0ea21b2a98f32583c0237643",
"score": "0.5596109",
"text": "def test_boolean_coerce\n ActiveRecord::ConnectionAdapters::DbslayerAdapter.emulate_booleans = true\n assert_equal :boolean, @column.send(:simplified_type, \"tinyint(1)\")\n end",
"title": ""
},
{
"docid": "65cbaa8efd10f3089a8d10ff6f390851",
"score": "0.55914724",
"text": "def false_condition\n using_unextended_sqlite? ? 0 : \"false\"\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "85b8c7ebd9a9860602a6a3ee236a9b1a",
"score": "0.0",
"text": "def cargapp_integration_params\n params.require(:cargapp_integration).permit(:name, :description, :provider, :code, :url, :url_provider, :url_production, :url_develop, :email, :username, :password, :phone, :pin, :token, :app_id, :client_id, :api_key, :user_id, :active)\n end",
"title": ""
}
] |
[
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6981269",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6783559",
"text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1677b416ad07c203256985063859691b",
"score": "0.6746007",
"text": "def allow_params_authentication!; end",
"title": ""
},
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.67423046",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "547b7ab7c31effd8dcf394d3d38974ff",
"score": "0.6735905",
"text": "def default_param_whitelist\n [\"mode\"]\n end",
"title": ""
},
{
"docid": "a91e9bf1896870368befe529c0e977e2",
"score": "0.6593568",
"text": "def param_whitelist\n [:role, :title]\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.6504213",
"text": "def expected_permitted_parameter_names; end",
"title": ""
},
{
"docid": "3a9a65d2bba924ee9b0f67cb77596482",
"score": "0.649792",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "068f8502695b7c7f6d382f8470180ede",
"score": "0.6482664",
"text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6478558",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "c04a150a23595af2a3d515d0dfc34fdd",
"score": "0.64566684",
"text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "9a2a1af8f52169bd818b039ef030f513",
"score": "0.64392304",
"text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"title": ""
},
{
"docid": "c5f294dd85260b1f3431a1fbbc1fb214",
"score": "0.6380194",
"text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "631f07548a1913ef9e20ecf7007800e5",
"score": "0.6376366",
"text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"title": ""
},
{
"docid": "9735bbaa391eab421b71a4c1436d109e",
"score": "0.636562",
"text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "12fa2760f5d16a1c46a00ddb41e4bce2",
"score": "0.63208145",
"text": "def param_whitelist\n [:rating, :review]\n end",
"title": ""
},
{
"docid": "f12336a181f3c43ac8239e5d0a59b5b4",
"score": "0.63006365",
"text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "c25a1ea70011796c8fcd4927846f7a04",
"score": "0.63001287",
"text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "822c743e15dd9236d965d12beef67e0c",
"score": "0.6292953",
"text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"title": ""
},
{
"docid": "9d23b31178b8be81fe8f1d20c154336f",
"score": "0.62927175",
"text": "def valid_params_request?; end",
"title": ""
},
{
"docid": "533f1ba4c3ab55e79ed9b259f67a70fb",
"score": "0.62911004",
"text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "7f0fd756d3ff6be4725a2c0449076c58",
"score": "0.6290563",
"text": "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"title": ""
},
{
"docid": "5f16bb22cb90bcfdf354975d17e4e329",
"score": "0.6284484",
"text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"title": ""
},
{
"docid": "1dfca9e0e667b83a9e2312940f7dc40c",
"score": "0.62436926",
"text": "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"title": ""
},
{
"docid": "a44360e98883e4787a9591c602282c4b",
"score": "0.6239928",
"text": "def allowed_params\n params.require(:allowed).permit(:email)\n end",
"title": ""
},
{
"docid": "4fc36c3400f3d5ca3ad7dc2ed185f213",
"score": "0.62184125",
"text": "def permitted_params\n []\n end",
"title": ""
},
{
"docid": "7a218670e6f6c68ab2283e84c2de7ba8",
"score": "0.62158304",
"text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"title": ""
},
{
"docid": "b074031c75c664c39575ac306e13028f",
"score": "0.6210187",
"text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"title": ""
},
{
"docid": "0cb77c561c62c78c958664a36507a7c9",
"score": "0.6194002",
"text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"title": ""
},
{
"docid": "9892d8126849ccccec9c8726d75ff173",
"score": "0.61786795",
"text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e3089e0811fa34ce509d69d488c75306",
"score": "0.61759156",
"text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"title": ""
},
{
"docid": "7b7196fbaee9e8777af48e4efcaca764",
"score": "0.617342",
"text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"title": ""
},
{
"docid": "9d589006a5ea3bb58e5649f404ab60fb",
"score": "0.6162248",
"text": "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"title": ""
},
{
"docid": "d578c7096a9ab2d0edfc431732f63e7f",
"score": "0.61528504",
"text": "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "38a9fb6bd1d9ae5933b748c181928a6b",
"score": "0.61527",
"text": "def safe_params\n params.require(:user).permit(:name)\n end",
"title": ""
},
{
"docid": "7a6fbcc670a51834f69842348595cc79",
"score": "0.6146735",
"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": "fe4025b0dd554f11ce9a4c7a40059912",
"score": "0.6122714",
"text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.61169004",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "60ccf77b296ed68c1cb5cb262bacf874",
"score": "0.61082125",
"text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9",
"score": "0.61052656",
"text": "def quote_params\n params.permit!\n end",
"title": ""
},
{
"docid": "86b2d48cb84654e19b91d9d3cbc2ff80",
"score": "0.6091036",
"text": "def valid_params?; end",
"title": ""
},
{
"docid": "34d018968dad9fa791c1df1b3aaeccd1",
"score": "0.60807735",
"text": "def paramunold_params\n params.require(:paramunold).permit!\n end",
"title": ""
},
{
"docid": "6d41ae38c20b78a3c0714db143b6c868",
"score": "0.6070328",
"text": "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.60634184",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "49052f91dd936c0acf416f1b9e46cf8b",
"score": "0.60213035",
"text": "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"title": ""
},
{
"docid": "5eaf08f3ad47cc781c4c1a5453555b9c",
"score": "0.6017676",
"text": "def filtering_params\n params.permit(:email, :name)\n end",
"title": ""
},
{
"docid": "5ee931ad3419145387a2dc5a284c6fb6",
"score": "0.6013606",
"text": "def check_params\n true\n end",
"title": ""
},
{
"docid": "3b17d5ad24c17e9a4c352d954737665d",
"score": "0.601112",
"text": "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6007318",
"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.6007318",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "74c092f6d50c271d51256cf52450605f",
"score": "0.6001461",
"text": "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"title": ""
},
{
"docid": "75415bb78d3a2b57d539f03a4afeaefc",
"score": "0.6001135",
"text": "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"title": ""
},
{
"docid": "bb32aa218785dcd548537db61ecc61de",
"score": "0.59966296",
"text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"title": ""
},
{
"docid": "ec609e2fe8d3137398f874bf5ef5dd01",
"score": "0.5992013",
"text": "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"title": ""
},
{
"docid": "865a5fdd77ce5687a127e85fc77cd0e7",
"score": "0.59919006",
"text": "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "65fa57add93316c7c8c6d8a0b4083d0e",
"score": "0.599182",
"text": "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"title": ""
},
{
"docid": "423b4bad23126b332e80a303c3518a1e",
"score": "0.5980991",
"text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"title": ""
},
{
"docid": "48e86c5f3ec8a8981d8293506350accc",
"score": "0.59676576",
"text": "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"title": ""
},
{
"docid": "9f774a9b74e6cafa3dd7fcc914400b24",
"score": "0.5960269",
"text": "def active_code_params\n params[:active_code].permit\n end",
"title": ""
},
{
"docid": "a573514ae008b7c355d2b7c7f391e4ee",
"score": "0.59588194",
"text": "def filtering_params\n params.permit(:email)\n end",
"title": ""
},
{
"docid": "2202d6d61570af89552803ad144e1fe7",
"score": "0.59585214",
"text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"title": ""
},
{
"docid": "8b571e320cf4baff8f6abe62e4143b73",
"score": "0.59578323",
"text": "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"title": ""
},
{
"docid": "d493d59391b220488fdc1f30bd1be261",
"score": "0.5953503",
"text": "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"title": ""
},
{
"docid": "f18c8e1c95a8a21ba8cd6fbc6d4d524a",
"score": "0.5952524",
"text": "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"title": ""
},
{
"docid": "4e6017dd56aab21951f75b1ff822e78a",
"score": "0.59432703",
"text": "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"title": ""
},
{
"docid": "67fe19aa3f1169678aa999df9f0f7e95",
"score": "0.5939858",
"text": "def list_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59388995",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.59388995",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "5060615f2c808bab2d45f4d281987903",
"score": "0.5933866",
"text": "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"title": ""
},
{
"docid": "7fa620eeb32e576da67f175eea6e6fa0",
"score": "0.5930038",
"text": "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"title": ""
},
{
"docid": "d9483565c400cd4cb1096081599a7afc",
"score": "0.5925672",
"text": "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"title": ""
},
{
"docid": "f7c6dad942d4865bdd100b495b938f50",
"score": "0.5924214",
"text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"title": ""
},
{
"docid": "70fa55746056e81854d70a51e822de66",
"score": "0.59169805",
"text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"title": ""
},
{
"docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa",
"score": "0.59106255",
"text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"title": ""
},
{
"docid": "753b67fc94e3cd8d6ff2024ce39dce9f",
"score": "0.5910254",
"text": "def url_whitelist; end",
"title": ""
},
{
"docid": "3eef50b797f6aa8c4def3969457f45dd",
"score": "0.59086037",
"text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "f9f0da97f7ea58e1ee2a5600b2b79c8c",
"score": "0.5906149",
"text": "def admin_social_network_params\n params.require(:social_network).permit!\n end",
"title": ""
},
{
"docid": "de77f0ab5c853b95989bc97c90c68f68",
"score": "0.5898294",
"text": "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "5bdab99069d741cb3414bbd47400babb",
"score": "0.58981514",
"text": "def filter_params\n params.require(:filters).permit(:letters)\n end",
"title": ""
},
{
"docid": "7c5ee86a81b391c12dc28a6fe333c0a8",
"score": "0.5896171",
"text": "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"title": ""
},
{
"docid": "29d030b36f50179adf03254f7954c362",
"score": "0.58944154",
"text": "def sensitive_params=(params)\n @sensitive_params = params\n end",
"title": ""
},
{
"docid": "bf321f5f57841bb0f8c872ef765f491f",
"score": "0.58943397",
"text": "def permit_request_params\n params.permit(:address)\n end",
"title": ""
},
{
"docid": "5186021506f83eb2f6e244d943b19970",
"score": "0.5892325",
"text": "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"title": ""
},
{
"docid": "b85a12ab41643078cb8da859e342acd5",
"score": "0.5887239",
"text": "def secure_params\n params.require(:location).permit(:name)\n end",
"title": ""
},
{
"docid": "46e104db6a3ac3601fe5904e4d5c425c",
"score": "0.58842856",
"text": "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"title": ""
},
{
"docid": "abca6170eec412a7337563085a3a4af2",
"score": "0.5880209",
"text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"title": ""
},
{
"docid": "26a35c2ace1a305199189db9e03329f1",
"score": "0.5874584",
"text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "de49fd084b37115524e08d6e4caf562d",
"score": "0.58694917",
"text": "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"title": ""
},
{
"docid": "7b7ecfcd484357c3ae3897515fd2931d",
"score": "0.5868719",
"text": "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "0016f219c5d958f9b730e0824eca9c4a",
"score": "0.58669394",
"text": "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"title": ""
},
{
"docid": "c6a8b768bfdeb3cd9ea388cd41acf2c3",
"score": "0.5866552",
"text": "def backend_user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "8aa9e548d99691623d72891f5acc5cdb",
"score": "0.58662945",
"text": "def url_params\n params[:url].permit(:full)\n end",
"title": ""
},
{
"docid": "be95d72f5776c94cb1a4109682b7b224",
"score": "0.5864085",
"text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"title": ""
},
{
"docid": "e4a29797f9bdada732853b2ce3c1d12a",
"score": "0.58623236",
"text": "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"title": ""
},
{
"docid": "967c637f06ec2ba8f24e84f6a19f3cf5",
"score": "0.5862258",
"text": "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"title": ""
},
{
"docid": "d14f33ed4a16a55600c556743366c501",
"score": "0.58597904",
"text": "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"title": ""
},
{
"docid": "46cb58d8f18fe71db8662f81ed404ed8",
"score": "0.58579135",
"text": "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"title": ""
},
{
"docid": "7e9a6d6c90f9973c93c26bcfc373a1b3",
"score": "0.58542645",
"text": "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"title": ""
},
{
"docid": "ad61e41ab347cd815d8a7964a4ed7947",
"score": "0.5853335",
"text": "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"title": ""
},
{
"docid": "8894a3d0d0ad5122c85b0bf4ce4080a6",
"score": "0.58517563",
"text": "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"title": ""
},
{
"docid": "53d84ad5aa2c5124fa307752101aced3",
"score": "0.5850614",
"text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"title": ""
}
] |
1465962ec2c3fe4917e15510e1ab798b
|
Writes out the configuration to a given output stream.
|
[
{
"docid": "0f501319c43987a48956998f857c1a41",
"score": "0.70826334",
"text": "def write(conf, output_stream=STDOUT)\n raise ArgumentError, 'configuration not a hash' unless conf.is_a? Hash\n\n begin\n output_stream.write(JSON.pretty_generate(conf))\n Dumon::logger.debug \"Configuration written, keys=#{conf.keys}\"\n rescue => e\n Dumon::logger.error \"failed to write configuration: #{e.message}\"\n ensure\n output_stream.close unless output_stream === STDOUT\n end\n end",
"title": ""
}
] |
[
{
"docid": "1b108915fc65f5d6310254e31964b81d",
"score": "0.65162",
"text": "def write\n require 'yaml'\n open config_file_name, 'w' do |io|\n io.write to_yaml\n end\n end",
"title": ""
},
{
"docid": "6fe3638fb6583c23b89a7f6291305a50",
"score": "0.6462097",
"text": "def out(location = nil)\n configure(:out, location)\n end",
"title": ""
},
{
"docid": "18403e81d80b053df2b86e7365aff397",
"score": "0.6064647",
"text": "def write_config\n File.open(@config_file, \"w\"){|f| YAML.dump(config, f)}\n end",
"title": ""
},
{
"docid": "ee15ada35fe5b0c916cedfefbc5ba44f",
"score": "0.59733236",
"text": "def output_config\n puts 'Using config file: ' + $CONFIG_FILE \n @conf.each { |key, value| puts key + \" = \" + value }\n end",
"title": ""
},
{
"docid": "f2f6e4e5fdafdbff31384bd215aacf2c",
"score": "0.5919277",
"text": "def output(value)\n @output_file = value\n end",
"title": ""
},
{
"docid": "cc2edd874d256464cf0ac221778ede00",
"score": "0.5910466",
"text": "def write_config\n File.open(CONFIG_OUT, 'w') do |f|\n f.write(ssh_config + \"\\n\")\n end\nend",
"title": ""
},
{
"docid": "632d867e1af4d7c1611c76f844c79cec",
"score": "0.5836489",
"text": "def write_out_state\n if @options[:out_file]\n filename = @options[:out_file]\n else\n filename = @tmp_state\n end\n @log.debug \"Writing out state into #{filename}\"\n File.open(filename,'w') do |f|\n f.puts YAML.dump(@results)\n end\n end",
"title": ""
},
{
"docid": "e76492693edaccfeded90b853e18b007",
"score": "0.57853484",
"text": "def configure(err, out)\n @configuration.error_stream = err\n @configuration.output_stream = out if @configuration.output_stream == $stdout\n @options.configure(@configuration)\n end",
"title": ""
},
{
"docid": "8adc6ea6841c1c64ca9ad9bb5bf14f0f",
"score": "0.57730615",
"text": "def write(output_to); end",
"title": ""
},
{
"docid": "20c71c78a77c33a6fa31b2e7ee836176",
"score": "0.57311165",
"text": "def write\n path = \"#{site.root}/_site/#{output_file}\"\n File.open(path, 'w') do |f|\n f.write(@output)\n end\n end",
"title": ""
},
{
"docid": "d2254d4eea21ddfe53c8a853bdd5f5f3",
"score": "0.569672",
"text": "def flush\n File.open(config_file, 'w') do |f|\n f.puts JSON.pretty_generate(@conf)\n end\n end",
"title": ""
},
{
"docid": "d2254d4eea21ddfe53c8a853bdd5f5f3",
"score": "0.569672",
"text": "def flush\n File.open(config_file, 'w') do |f|\n f.puts JSON.pretty_generate(@conf)\n end\n end",
"title": ""
},
{
"docid": "8e55d91e92ec76c8bd27b69dcbf68efb",
"score": "0.5640569",
"text": "def write(output_stream=STDOUT)\n self.params.each do |name,value| \n if value.class.to_s != 'Hash'\n if value.scan(/\\w+/).length > 1\n output_stream.puts \"#{name} = \\\"#{value}\\\"\"\n else\n output_stream.puts \"#{name} = #{value}\"\n end\n end\n end\n output_stream.puts \"\\n\"\n \n self.groups.each do |group|\n output_stream.puts \"[#{group}]\"\n self.params[group].each do |param, value| \n if value.scan(/\\w+/).length > 1\n output_stream.puts \"#{param} = \\\"#{value}\\\"\"\n else\n output_stream.puts \"#{param} = #{value}\"\n end\n end\n output_stream.puts \"\\n\"\n end\n end",
"title": ""
},
{
"docid": "23e5b5b3cbf938ea7616f6953ef18263",
"score": "0.558726",
"text": "def write_configure(config = nil)\n config ||= $configure\n File.open($configure_file, \"w\"){|f| YAML.dump(config, f)}\nend",
"title": ""
},
{
"docid": "82144386de32d64e5f607a05e1f61310",
"score": "0.55072767",
"text": "def dump_outputs\n @outputs.each do |(format, file_name)|\n section \"Write #{format} file #{file_name}\" do\n write_graph(file_name, format)\n end\n end\n end",
"title": ""
},
{
"docid": "2e726ce1e5106d0ce3b0436298b38d69",
"score": "0.5484317",
"text": "def output_to_file\n @output=:file\n end",
"title": ""
},
{
"docid": "9e69efe5b32adee744d7da743553636a",
"score": "0.5477885",
"text": "def output_path\n settings[:output]\n end",
"title": ""
},
{
"docid": "55a0ff0d390ba816691c6d369cd22631",
"score": "0.54725236",
"text": "def write_config\n info(\"writing config.yml\")\n AIPP.config.write! config_file\n end",
"title": ""
},
{
"docid": "f0ccdbce1292aa89f1afabc85498d165",
"score": "0.5446583",
"text": "def ostream\n @settings[:ostream]\n end",
"title": ""
},
{
"docid": "cbb4d4da19c9b7a29e107b8006f0479a",
"score": "0.54395247",
"text": "def write_to(stream)\n end",
"title": ""
},
{
"docid": "a5b5388a2616c38702cf2f9dfdbf910f",
"score": "0.54355705",
"text": "def write(opts = {})\n filename = opts.fetch(:filename, @filename)\n encoding = opts.fetch(:encoding, @encoding)\n mode = encoding ? \"w:#{encoding}\" : 'w'\n\n File.open(filename, mode) do |f|\n @ini.each do |section, hash|\n f.puts \"[#{section}]\"\n hash.each { |param, val| f.puts \"#{param} #{@param} #{escape_value val}\" }\n f.puts\n end\n end\n\n self\n end",
"title": ""
},
{
"docid": "30e8670e16e63065935e5474d5e770a8",
"score": "0.5399182",
"text": "def write\n return if @options == @original_options\n f = IO.popen('php', 'r+')\n f.write \"<?php var_export(json_decode('#{options_php_json}', true));\\n\"\n f.close_write\n data = f.read\n f.close\n File.open(@file, 'w') { |of| of.write \"<?php\\n$CONFIG = #{data};\\n\" }\n Chef::Log.info('OwnCloud config writen')\n rescue StandardError => e\n raise \"Error writing ownCloud configuration: #{e.message}\"\n end",
"title": ""
},
{
"docid": "bdc96c628ac8d21160eac66ccf2019b4",
"score": "0.53974575",
"text": "def write_output(output, path_or_io)\n io_for(path_or_io) do |io|\n io.write(output)\n end\n end",
"title": ""
},
{
"docid": "e9048bf820b00413e0bb8339b46e15be",
"score": "0.53877735",
"text": "def output_file\n @output\n end",
"title": ""
},
{
"docid": "df5095ec3eeb5c29c3e64d16d7d5a8e8",
"score": "0.5341849",
"text": "def write_output\n # If an output directory is given, open a file & write to it\n if output = self.output\n @path_decls.each do |path, decls|\n name = snake_case(decls.name.name.to_s.dup)\n file_path = File.join(output, \"#{name}.rbs\")\n File.open(file_path, 'w') do |io|\n stdout.puts \"Writing output to file: #{file_path}\"\n RBS::Writer.new(out: io).write([decls])\n end\n end\n # If no output directory is given write to STDOUT\n else\n RBS::Writer.new(out: stdout).write(@path_decls.values)\n end\n end",
"title": ""
},
{
"docid": "0df84f663020a96477098c7c23e46915",
"score": "0.5328294",
"text": "def write_output entries, dest, options\n if dest.match /^http/\n http = Atom::HTTP.new\n\n setup_http http, options\n\n entries_to_http entries, dest, http\n elsif dest == '-'\n entries_to_stdout entries\n else\n entries_to_dir entries, dest\n end\n end",
"title": ""
},
{
"docid": "3b7f73cd6d090055248e9ea9a66c034d",
"score": "0.53205734",
"text": "def write_config_file(doc)\n if @pretend\n info \"In pretend mode, so not writing to #{@config_file}\"\n debug { \"I would have written: \\n#{doc}\" }\n @pretend_output = doc\n else\n File.open(@config_file, 'w') {|f| f.write(doc)}\n end\n end",
"title": ""
},
{
"docid": "662fab0873716a5c48784081c69de3a0",
"score": "0.5295176",
"text": "def write_to(stream)\n stream.write_int(@my_index)\n stream.write_int(@current_tick)\n stream.write_int(@max_tick_count)\n stream.write_int(@players.length())\n @players.each do |players_element|\n players_element.write_to(stream)\n end\n stream.write_int(@planets.length())\n @planets.each do |planets_element|\n planets_element.write_to(stream)\n end\n stream.write_int(@flying_worker_groups.length())\n @flying_worker_groups.each do |flying_worker_groups_element|\n flying_worker_groups_element.write_to(stream)\n end\n stream.write_int(@max_flying_worker_groups)\n stream.write_int(@max_travel_distance)\n stream.write_int(@logistics_upgrade)\n stream.write_int(@production_upgrade)\n stream.write_int(@combat_upgrade)\n stream.write_int(@max_builders)\n stream.write_int(@building_properties.length())\n @building_properties.each do |building_properties_key, building_properties_value|\n stream.write_int(building_properties_key)\n building_properties_value.write_to(stream)\n end\n stream.write_bool(@specialties_allowed)\n if @view_distance.nil?\n stream.write_bool(false)\n else\n stream.write_bool(true)\n stream.write_int(@view_distance)\n end\n end",
"title": ""
},
{
"docid": "2421d04e6a433be3014597555c3bf98b",
"score": "0.52881545",
"text": "def output(obj)\n io.puts Yajl::Encoder.encode(obj.merge('job_data' => job_for_output))\n io.flush\n end",
"title": ""
},
{
"docid": "7554a31effe67a85d26438dffab118dc",
"score": "0.527032",
"text": "def to_config_file lanes = [1,2,3,4,5,6,7,8]\n view = ConfigFileView.new(self, lanes)\n view.write\n end",
"title": ""
},
{
"docid": "bf7b68a933dcb6cf43b9156a77868afa",
"score": "0.5265158",
"text": "def writeOut\n\t\t\n\tend",
"title": ""
},
{
"docid": "0a66938a18e85387408c70ee6a57b474",
"score": "0.52628994",
"text": "def output\n @out\n end",
"title": ""
},
{
"docid": "a7a9c8a32bec5c9d2d69ee99e7693c94",
"score": "0.5255506",
"text": "def dump(io)\n @config.keys.select {|s| String === s}.sort.each do |k|\n v = @config[k]\n case v\n when Array\n io.puts \"#{k}=#{v.join ' '}\"\n else\n io.puts \"#{k}=#{v}\"\n end\n end\n end",
"title": ""
},
{
"docid": "e48fd1fd9ae8e9bac4c3c5983e1607d4",
"score": "0.521718",
"text": "def write(f)\n f.puts \"Version: \" + VERSION\n f.puts \"Label: #{@label}\"\n f.puts \"Host: #{@host}\"\n f.puts \"Dir: #{@dir}\"\n f.puts \"Prune: \" + (@prune_leading_dir ? \"true\" : \"false\")\n f.puts\n super(f)\n end",
"title": ""
},
{
"docid": "1b6c8ecb50269f4c0908b511a46efe13",
"score": "0.5216998",
"text": "def save_configuration\n File.open(config_file, \"w\") do |file|\n file.write(YAML.dump(@config))\n end\n end",
"title": ""
},
{
"docid": "d47922ae8f331b37bbcea32281e40c1d",
"score": "0.5174087",
"text": "def write_to(stream)\n stream.write_int(@start_planet)\n stream.write_int(@target_planet)\n stream.write_int(@worker_number)\n if @take_resource.nil?\n stream.write_bool(false)\n else\n stream.write_bool(true)\n stream.write_int(@take_resource)\n end\n end",
"title": ""
},
{
"docid": "357f452ac4a3d9b05ea70fec844bba80",
"score": "0.5172357",
"text": "def write_output\n @output.each do |record|\n $stdout.write(record)\n $stdout.write(\"\\n\")\n end\n $stdout.write(settings.delimiter)\n $stdout.write(\"\\n\")\n $stdout.flush\n @output.clear\n end",
"title": ""
},
{
"docid": "34d627af2ce3f8c77cfb22c1b993a3e5",
"score": "0.51721734",
"text": "def output\n config_dir :conf_dir\n config_dir :local_dir\n\n @stub_zones.each {|stub_zone| stub_zone.output }\n @unbound_config.output\n end",
"title": ""
},
{
"docid": "fc87b1967b1def8ae58030509090e033",
"score": "0.5118442",
"text": "def output\n @tool.config_file :conf_dir, \"#{@zone}.conf\" do |stubfile|\n stubfile << @tool.git_header('palletjack2unbound')\n stubfile << \"\nstub-zone:\n name: #{@zone}\\n\"\n\n @stub_addrs.each do |addr|\n stubfile << \" stub-addr: #{addr}\\n\"\n end\n\n if @transparent\n stubfile << \"\\nserver:\\n local-zone: \\\"#{@zone}\\\" transparent\\n\"\n end\n end\n end",
"title": ""
},
{
"docid": "f23d950722daad0fc2292a6f02eda152",
"score": "0.5117077",
"text": "def output\n @options[:output]\n end",
"title": ""
},
{
"docid": "edcfe487ace54345b951f0645eaa6190",
"score": "0.5093727",
"text": "def write(dest); end",
"title": ""
},
{
"docid": "edcfe487ace54345b951f0645eaa6190",
"score": "0.5093727",
"text": "def write(dest); end",
"title": ""
},
{
"docid": "edcfe487ace54345b951f0645eaa6190",
"score": "0.5093727",
"text": "def write(dest); end",
"title": ""
},
{
"docid": "0d59b5b1ced95310528f5cb9f3207528",
"score": "0.50889266",
"text": "def output(result)\n if options[:output]\n File.write(options[:output], result)\n else\n puts result\n end\n\n result\n end",
"title": ""
},
{
"docid": "def1e9168af27a4f1195d520c03a6367",
"score": "0.5088269",
"text": "def write_output(str, output)\n if output.is_a?(IO)\n output.puts(str)\n else\n File.open(output, 'w+') { |f| f.puts(str) }\n end\n end",
"title": ""
},
{
"docid": "e5aa5b3b83b6926e137c8b3ecfc0342b",
"score": "0.508201",
"text": "def write( filename = nil, opts={} )\n @fn = filename unless filename.nil?\n\n encoding = opts[:encoding] || @encoding\n mode = (RUBY_VERSION >= '1.9' && @encoding) ?\n \"w:#{encoding.to_s}\" :\n 'w'\n\n File.open(@fn, mode) do |f|\n @ini.each do |section,hash|\n f.puts \"[#{section}]\"\n hash.each {|param,val| f.puts \"#{param} #{@param} #{escape val}\"}\n f.puts\n end\n end\n self\n end",
"title": ""
},
{
"docid": "be8f4455281052699d81540abdcaf209",
"score": "0.50808793",
"text": "def write_buffer\n puts \"[#{Time.now}] Writing #{@entry_buffer.length} entries to disk\"\n\n if File.exist? HWMon::Config.output\n entries = YAML.load_file HWMon::Config.output\n else\n entries = []\n end\n\n entries.concat @entry_buffer\n\n File.open(HWMon::Config.output, 'w') { |f| f.write entries.to_yaml }\n end",
"title": ""
},
{
"docid": "928d5566b1f6ac4f6a96908dadafa2d2",
"score": "0.5063974",
"text": "def save\n open @config_path, 'w' do |io|\n io.write({'files' => @files.collect(&:to_hash)}.to_yaml)\n end\n end",
"title": ""
},
{
"docid": "a02bff8e003827d2ec42650f0a85a717",
"score": "0.5053482",
"text": "def write_to(stream)\n stream.write_int(TAG)\n stream.write_bool(@enable)\n end",
"title": ""
},
{
"docid": "e58c3d7e4c6b9c2807312e50711c6b06",
"score": "0.5042135",
"text": "def out\n return @out if @out\n FileUtils.mkdir_p out_base unless File.exist? out_base\n @out = File.open( \"#{out_path}\", 'w' )\n end",
"title": ""
},
{
"docid": "eb3bccfef460114f7b86b846dc5320b9",
"score": "0.5027913",
"text": "def write_to(io, *options); end",
"title": ""
},
{
"docid": "79a9ccb1d6fa3a36836b228c00cd4597",
"score": "0.5021144",
"text": "def configure_output\n RSpec.configuration.output_stream = $stdout\n @formatter = RSpec.configuration.add_formatter(Inspec::Formatters::Base)\n RSpec.configuration.add_formatter(Inspec::Formatters::ShowProgress, $stderr) if @conf[:show_progress]\n set_optional_formatters\n RSpec.configuration.color = @conf[\"color\"]\n end",
"title": ""
},
{
"docid": "2bba36c39ee84108af85169bf6efcaa8",
"score": "0.5009026",
"text": "def write_file(out_file, output)\n File.open(out_file, 'w') { |f| output.each { |l| f.write(\"#{l}\\n\") } }\n end",
"title": ""
},
{
"docid": "8e19703663aaf451e9ab3fd4bb085277",
"score": "0.49918637",
"text": "def flush\n @out.flush if @out.is_a?(IO)\n end",
"title": ""
},
{
"docid": "6c926cb35b9d45ff8c6f844cc2480afe",
"score": "0.49898675",
"text": "def write_to(output_file)\n file = File.open(output_file, \"w\") \n @commands.each { |command| file.write(command.to_s + \"\\n\") }\n file.close \n #raise 'not yet implemented'\n end",
"title": ""
},
{
"docid": "2f35352b0e2c2da93859f369f8c4fddc",
"score": "0.4975218",
"text": "def write(io, constraints = {})\n to_datastream(constraints).write(io)\n end",
"title": ""
},
{
"docid": "2f35352b0e2c2da93859f369f8c4fddc",
"score": "0.4975218",
"text": "def write(io, constraints = {})\n to_datastream(constraints).write(io)\n end",
"title": ""
},
{
"docid": "24f85bfb80ca4c0894cff9b4ecbe91f9",
"score": "0.49378642",
"text": "def write_output(string)\n @output << string\n end",
"title": ""
},
{
"docid": "07f254602571bba2a026036e56cba7d1",
"score": "0.4926555",
"text": "def output_format\n settings[:output_format]\n end",
"title": ""
},
{
"docid": "962c3e31dc2b48c437166dbd41dd2021",
"score": "0.49182758",
"text": "def log_and_stream(output)\n write_file output, @filename if @filename\n @block.call(output)\n end",
"title": ""
},
{
"docid": "c58d00f66657f25efed309f9eb32dc36",
"score": "0.49163702",
"text": "def create_output\n # create logstash configs\n indexname = @name\n File.open(File.join(@logstashdir, \"output.conf\"), \"w\") do |f|\n f.write <<OUTPUT\n# Generated by elasticsupport\noutput {\n elasticsearch {\n template => \"elasticsupport-template.json\"\n template_overwrite => true\n hosts => [\"#{@elastic}\"]\n index => #{indexname.inspect}\n }\n}\nOUTPUT\n end\n end",
"title": ""
},
{
"docid": "629d7e903a88e20c9aeff1c2de71e3f1",
"score": "0.49120453",
"text": "def dump_settings\n File.open(SETTINGS_FILE, 'w') do |out|\n YAML.dump( { :targets => @targets, :src => @src }, out)\n end\n end",
"title": ""
},
{
"docid": "3e247bb1cdeec4341c854ea688071fc6",
"score": "0.491171",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"configurationDeployedUserCount\", @configuration_deployed_user_count)\n writer.write_collection_of_object_values(\"configurationDeploymentSummaryPerApp\", @configuration_deployment_summary_per_app)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_date_time_value(\"lastRefreshTime\", @last_refresh_time)\n writer.write_string_value(\"version\", @version)\n end",
"title": ""
},
{
"docid": "4ef71ff0efda746a1caf06d56554fd38",
"score": "0.49105227",
"text": "def config_write\n # Putting it in a format that zfm can also read and write\n f1 = File.expand_path(CONFIG_FILE)\n hash = {}\n hash['DIRS'] = @used_dirs.select { |dir| File.exist? dir }\n hash['FILES'] = @visited_files.select { |file| File.exist? file }\n # NOTE bookmarks is a hash and contains FILE:cursor_pos\n hash['BOOKMARKS'] = @bookmarks # .select {|file| File.exist? file}\n writeYML hash, f1\n @writing = @modified = false\n message \"Saved #{f1}\"\nend",
"title": ""
},
{
"docid": "792905dbe986edc607f54d12d2654a3f",
"score": "0.49045858",
"text": "def save_to_file\n File.open(@output, 'w+') do |file|\n file.puts HEADER if @additional_html\n file.puts @data_for_output.join(\"\\n\")\n file.puts FOOTER if @additional_html\n end\n end",
"title": ""
},
{
"docid": "21b79544b53e6b0d88092f81f1808c9a",
"score": "0.49033597",
"text": "def flush\n @out.flush if @out.respond_to? :flush\n end",
"title": ""
},
{
"docid": "db44893862c11c031669ec70b2c20eae",
"score": "0.4901957",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"authenticationConfiguration\", @authentication_configuration)\n writer.write_object_value(\"clientConfiguration\", @client_configuration)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_object_value(\"endpointConfiguration\", @endpoint_configuration)\n end",
"title": ""
},
{
"docid": "97862c3c55f68c23c422732f0816678a",
"score": "0.4887412",
"text": "def write_to_yaml_file(dest_path = nil)\n if dest_path.nil?\n file = Tempfile.new('config')\n file.close\n dest_path = file.path\n # deleting temp file but reusing file name. This is to avoid premature garbage collection.\n file.unlink\n end\n File.open(dest_path, 'w') do |f|\n f.write(@config.to_yaml)\n end\n dest_path\n end",
"title": ""
},
{
"docid": "2325f8d58ac997dbf7b8aeff0bea7ade",
"score": "0.48843905",
"text": "def write(io)\n io.write [@value].pack(format)\n end",
"title": ""
},
{
"docid": "ef0f28cb8bace0a8ec446cbe68675be3",
"score": "0.48818722",
"text": "def output\n @tool.config_file :local_dir, \"#{@service_name}.conf\" do |configfile|\n configfile << @tool.git_header('palletjack2unbound')\n @service_config['service.unbound.server'].each do |config|\n config.each do |key, value|\n configfile << \"#{key}: #{value}\\n\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "a2d8c15c0f6a0dc017e61b797ef8945c",
"score": "0.48734763",
"text": "def write(io)\n @values.each {|el|\n el.write io\n }\n end",
"title": ""
},
{
"docid": "b4f6c5701845ce2a8d2f3e833af67659",
"score": "0.4871706",
"text": "def write_to(io, *options)\n options = options.first.is_a?(Hash) ? options.shift : {}\n encoding = options[:encoding] || options[0]\n if Nokogiri.jruby?\n save_options = options[:save_with] || options[1]\n indent_times = options[:indent] || 0\n else\n save_options = options[:save_with] || options[1] || SaveOptions::FORMAT\n indent_times = options[:indent] || 2\n end\n indent_text = options[:indent_text] || \" \"\n\n # Any string times 0 returns an empty string. Therefore, use the same\n # string instead of generating a new empty string for every node with\n # zero indentation.\n indentation = indent_times.zero? ? \"\" : (indent_text * indent_times)\n\n config = SaveOptions.new(save_options.to_i)\n yield config if block_given?\n\n native_write_to(io, encoding, indentation, config.options)\n end",
"title": ""
},
{
"docid": "cfa45b8d2090eb233392a3bf84558bd4",
"score": "0.48709643",
"text": "def close_write\n if @output.respond_to?(:close)\n @output&.close\n end\n\n @output = nil\n end",
"title": ""
},
{
"docid": "9dec655bdde21297ba35b05320ef2fa4",
"score": "0.4853406",
"text": "def output(filename)\r\n outs = File.new(filename , \"w\")\r\n outs.puts self.to_s\r\n outs.close\r\n end",
"title": ""
},
{
"docid": "0e21748f9879be38d7124cfc5da4e3d0",
"score": "0.48332378",
"text": "def write options={}, &block\n return unless output\n data = []\n block.call(data) if block_given?\n text = {\n :data => data.map do |measurement|\n key, value = measurement\n { :key => key, :value => value }\n end\n }.merge(options).to_json\n\n begin\n output.puts(text)\n rescue Errno::ENXIO\n # FIFO's reader isn't alive...\n end\n end",
"title": ""
},
{
"docid": "ad02e5ddcaba4ab59cd3da30a44b19df",
"score": "0.48321483",
"text": "def settings_write(settings_hash = active_values, name: nil)\n File.open settings_path(name), 'w' do |f|\n f.write settings_hash.to_yaml\n end\n end",
"title": ""
},
{
"docid": "70a97e201bdc64f44a47cff74808e5a6",
"score": "0.4828182",
"text": "def initialize(out, configuration)\n @raw_out = out || $stderr\n @configuration = configuration\n end",
"title": ""
},
{
"docid": "71378dffe8c82fdf04103bb34cdc1d2c",
"score": "0.48271894",
"text": "def write\n self.open_file('config/site.yml') do |file|\n self.output_resource_op self.mounting_point.site\n\n file.write(self.mounting_point.site.to_yaml)\n\n self.output_resource_op_status self.mounting_point.site\n end\n end",
"title": ""
},
{
"docid": "5e81653d46728eaba578d85038dc00c2",
"score": "0.48186597",
"text": "def write(node, output); end",
"title": ""
},
{
"docid": "8adbf582854c465504b32a74de99f33f",
"score": "0.48140603",
"text": "def write_out\n File.delete(@path) if File.exist?(@path)\n File.open(@path, mode: 'w', encoding: @img_data.encoding) { |f| f.write(@img_data) }\n end",
"title": ""
},
{
"docid": "57b70f7964d59dc1075d8b862bb797ad",
"score": "0.48118007",
"text": "def write_config()\nafile = File.open(\"cp3nodes.conf\", \"w\")\nafile.puts \"1 127.0.0.1 25500 25501 25502\\n\"\nafile.puts \"2 127.0.0.1 25503 25504 25505\\n\"\nafile.puts \"3 127.0.0.1 25506 25507 25508\\n\"\nafile.close\nend",
"title": ""
},
{
"docid": "7a0ddbc4213cf1d5570964965e8a1f7d",
"score": "0.48112014",
"text": "def write_external(out_stream)\n # out.writeShort (fieldNumber);\n # out.writeUTF (value);\n puts value.to_s\n end",
"title": ""
},
{
"docid": "5723f5cb283eab242fa12cc154575a6b",
"score": "0.48109892",
"text": "def outputs conf, fw\n os = try_outputs(conf, fw)\n if os.empty?\n raise(ConfigurationNotFoundError, \"could not find configuration '#{conf}'\")\n else\n os\n end\n end",
"title": ""
},
{
"docid": "fddee29d529539d96fff3f13498f8539",
"score": "0.48063493",
"text": "def output=(output)\n @_output = output\n end",
"title": ""
},
{
"docid": "388aa32398d4e502d6bab78043b79601",
"score": "0.4804458",
"text": "def output_file\n [\n output_root,\n feed_name,\n batch_id + \".\" + output_extension\n ].join(\"/\")\n end",
"title": ""
},
{
"docid": "7e3e1e289b7f997627682870f71d0f97",
"score": "0.47976053",
"text": "def save()\n File.open(CONFIG_FILE, 'w'){ |f| f.write config.to_yaml } # Store\n end",
"title": ""
},
{
"docid": "1f5a4f4db38c2772b2e8ab9b13753a22",
"score": "0.4794349",
"text": "def export\n configs.export(to_hash)\n end",
"title": ""
},
{
"docid": "9481a9c14c090ea40e95a15e91d07bd7",
"score": "0.478546",
"text": "def write_graph(file_name, output_format)\n raise \"Unknown topographer plugin #{output_format}\" unless @plugins.key?(output_format)\n\n @plugins[output_format].new(self).write_graph(file_name)\n end",
"title": ""
},
{
"docid": "571ec939168a4c52bc3183578f8fbc2b",
"score": "0.4781656",
"text": "def print_config\n self.config_to_hash.each { |k, v| puts \"#{k}: #{v}\" }\n end",
"title": ""
},
{
"docid": "e7655d10998c38855a9a2f722c79ff1e",
"score": "0.47800767",
"text": "def output\n # if file name not present, just output to stdout.\n return $stdout.write(yield) if option[:ofile].nil?\n\n # times of calling output\n @serial ||= 0\n # Write to file, we should disable colorize\n enabled = Util.colorize_enabled?\n Util.disable_color! if enabled\n File.binwrite(file_of(option[:ofile], @serial), yield)\n Util.enable_color! if enabled\n @serial += 1\n end",
"title": ""
},
{
"docid": "630fee06a424c9da4ded2c296425d26b",
"score": "0.47771433",
"text": "def write!\n # 1. skip if file already exists.\n if output_file_already_exists?\n RSpec::Scaffold.log(\"- #{@output_file} - already exists\", :puts)\n return\n end\n\n # 2. ensure parent directories exist\n FileUtils.makedirs(@output_file.parent)\n\n # 3. write to file\n File.open(@output_file, 'wb') do |f| # 'wb' originally\n f << @output_text\n end\n\n RSpec::Scaffold.log(\"+ #{@output_file}\")\n\n return @output_file.to_s\n end",
"title": ""
},
{
"docid": "8802a21c93a8885d3eec44e70b2bf500",
"score": "0.47735378",
"text": "def io_out\n raise NotImplementedError, 'Not implemented'\n end",
"title": ""
},
{
"docid": "40004f4fe0749c68ccb2a6ff0fcd84fe",
"score": "0.47729796",
"text": "def set_output(output_type=:file)\n if OUTPUT.include? output_type\n @output = output_type\n else\n raise \"Output type #{output_type} is not suported. Valid types are #{OUTPUT}\"\n end\n end",
"title": ""
},
{
"docid": "3ac9fd7e5c356e167e880611a4bcff5b",
"score": "0.4771209",
"text": "def close\n out.close\n end",
"title": ""
},
{
"docid": "46d46136e392fcd78995d2d1036f06f4",
"score": "0.47633857",
"text": "def output(file, &block)\n @outfile = File.expand_path(file)\n @block = block\n self\n end",
"title": ""
},
{
"docid": "af4f49d4881cfe683a8f1443b9b45887",
"score": "0.47605357",
"text": "def output_yaml_errors\n File.open(@options['output-file'], 'w+') do |file|\n file.write YAML.dump(errors)\n end\n end",
"title": ""
},
{
"docid": "49c7cac0f61fc80b5cf2e396a634609e",
"score": "0.47567365",
"text": "def dump_config(hash)\n File.open(@config_file, \"w\") do |file|\n file << YAML.dump(hash)\n end\n @configuration = Configuration.new(@config_file, \"test\")\n end",
"title": ""
},
{
"docid": "9cee4b38a02f7617f9af63ff0ef7eb1e",
"score": "0.47546118",
"text": "def output_streams\n [:default]\n end",
"title": ""
},
{
"docid": "27b6126ebe4106d228e5a27ad587b324",
"score": "0.47543627",
"text": "def write_to_output filename, content = nil # :yields: file\n self.create_output_file(filename) do |output_path|\n File.open(output_path, 'w') do |f|\n if content\n f.write(content)\n else\n yield f\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9057a89b932bda2587a55c5dcbd5acf4",
"score": "0.47532278",
"text": "def set_output_stream_done\n @call_finished_mu.synchronize do\n @output_stream_done = true\n maybe_finish_and_close_call_locked\n end\n end",
"title": ""
}
] |
8cae99013f13155bb0484d0ad7356f5a
|
get the potential target paths
|
[
{
"docid": "57e59072a39edfe191d87808cc3af220",
"score": "0.0",
"text": "def get_potential_resolutions filename\n\t\t\tpaths = Yay::Paths.new\n\t\t\tdirs = paths.yay_paths\n\t\t\t\n\t\t\tresult = []\n\t\t\tdirs.each { |path| \n\t\t\t\tresult.push(\"#{path}/#{filename}.yay\")\n\t\t\t}\n\n\t\t\treturn result\n\t\tend",
"title": ""
}
] |
[
{
"docid": "aafec31b51c47664e529e4a3929222a0",
"score": "0.71988267",
"text": "def get_target_paths source_path\n relative_path = source_path[@source_directory.length, source_path.length-1]\n relative_path = relative_path.chomp(File.extname(relative_path)) + \"*\"\n Dir[@target_directory + relative_path]\n end",
"title": ""
},
{
"docid": "24c7b74fdaaa22f3da02c2d425f8b453",
"score": "0.69425225",
"text": "def find_all_paths_for_one(start, target)\n find_all_paths(start, [target])\n return @allPaths[target[:id]+\"_\"+target[:pos].to_s]\n end",
"title": ""
},
{
"docid": "e2627f09d40d1dc146462db629e984cd",
"score": "0.6833064",
"text": "def targets\n Dir[@target_dir]\n end",
"title": ""
},
{
"docid": "bc2662ca70e30d2b1a6602d988bf11c9",
"score": "0.67315453",
"text": "def build_path(target)\n return [] if target.nil?\n path = [target]\n path += build_path(@all_seen_words[target])\n end",
"title": ""
},
{
"docid": "137a8869a123b4dca154f811036b97bd",
"score": "0.6723735",
"text": "def logical_paths; end",
"title": ""
},
{
"docid": "adaab4ccc034f3fb512f9dfbed3165c1",
"score": "0.66431415",
"text": "def expand_paths!\n @targets = @targets.reduce({}) do |result, (target, target_params)|\n sources = target_params[:sources].map do |source|\n source = expand_path(source) if @build_root\n expand_varref(source)\n end\n target = expand_path(target) if @build_root\n target = expand_varref(target)\n result[target] = target_params.merge(sources: sources)\n result\n end\n end",
"title": ""
},
{
"docid": "1518a90e9645d7489eae92a2b33e3efe",
"score": "0.65761244",
"text": "def duplicate_paths\n @check_target_paths.select do |file|\n is_duplicate?(file.basename)\n end\n end",
"title": ""
},
{
"docid": "81be09f2ed44253bf2c5e59165be9d9b",
"score": "0.65285224",
"text": "def successful_paths\n @successful_paths ||= @paths.select(&:target_reached?)\n end",
"title": ""
},
{
"docid": "8a3b7e0beabfd89c0408bc91b376c261",
"score": "0.64512295",
"text": "def target_files\n @target_files ||= (get_target_files || [])\n end",
"title": ""
},
{
"docid": "ed79eb36e22aa90fd3d056a7b4b2dfdb",
"score": "0.6419268",
"text": "def source_files(target_name, &filter)\n target = target(target_name)\n source_files = target.source_build_phase.files\n source_files = source_files.select(&filter) unless filter.nil?\n source_paths = source_files.map { |pathname| relative_path(pathname) }\n source_paths\nend",
"title": ""
},
{
"docid": "d13d69c587463c74f0fbd61459b49844",
"score": "0.6417372",
"text": "def find_all_paths(source, target)\n paths = Set.new\n self.fold source, [] do |accum, vertex|\n last = accum.last\n if last == vertex\n current_path = accum\n else\n current_path = accum + [vertex]\n end\n \n if vertex == target\n len = accum.length\n if len > 1\n paths.add current_path\n elsif len == 1\n paths.add accum + [vertex]\n end\n end\n paths.add current_path if vertex == target && current_path.length > 1\n current_path\n end\n paths\n end",
"title": ""
},
{
"docid": "19486df64a54a0b6d95c37dc568eaa0d",
"score": "0.6367612",
"text": "def get_target_files\n filtered = get_category_filtered_target_files(get_unsorted_target_files)\n get_sorted_target_files(filtered) || []\n end",
"title": ""
},
{
"docid": "938ef712f81d625f1134d223aa71d4e3",
"score": "0.6357028",
"text": "def paths_to_closest_target\n in_range_of_enemy =\n targets.flat_map { |target|\n target.in_range\n }.sort\n\n in_range_of_enemy.map { |tile|\n Path.a_star @battle, self, tile\n }.compact.sort_by { |path|\n [path.length, path.last]\n }\n end",
"title": ""
},
{
"docid": "d6068a10cc44314879c5012594fa290c",
"score": "0.6298161",
"text": "def get_mobi_paths(target)\n get_ebook_file_paths(target, \".mobi\")\n end",
"title": ""
},
{
"docid": "965ed732c1f5e484a32bf9bd474d6082",
"score": "0.6290003",
"text": "def find_path_objects\n target_obj = self.find_target_obj()\n path_objects = [target_obj]\n\n until target_obj.nil? \n target_obj = target_obj.parent\n path_objects << target_obj\n end\n\n path_objects[0..-2].reverse\n end",
"title": ""
},
{
"docid": "9fd021d607b4f3e1b3c4ca1a2553c251",
"score": "0.6264115",
"text": "def final_paths\n final_letters.map { |fl| Path.new([fl]) } + destination.final_paths\n end",
"title": ""
},
{
"docid": "4581c9d2be25ed036507a6b98ff9e8a6",
"score": "0.62423146",
"text": "def source_paths_for_search\n paths = []\n paths += source_paths\n paths << source_root if source_root\n paths += from_superclass(:source_paths, [])\n paths\n end",
"title": ""
},
{
"docid": "d00f654477ed783572ccbf50774b3344",
"score": "0.61983657",
"text": "def all_paths\n [self.path]\n end",
"title": ""
},
{
"docid": "8699895c9d0efb9f9e100e720f4319f3",
"score": "0.6190348",
"text": "def paths_in_source\n source = new_resource.source\n source_pathname = Pathname.new(source)\n\n ::Dir.glob(\n ::File.join(Chef::Util::PathHelper.escape_glob(source), '*'),\n ::File::FNM_DOTMATCH\n )\n .map do |item|\n Pathname.new(item).relative_path_from(source_pathname).to_s\n end\n end",
"title": ""
},
{
"docid": "9a7c991daaeb37722e6559390f8c7fc1",
"score": "0.6178888",
"text": "def source_paths\n @source_paths ||= self.class.source_paths_for_search\n end",
"title": ""
},
{
"docid": "ca6306b5b43ab43885aa3915988e4c6f",
"score": "0.61777735",
"text": "def used_paths\n files = source_files(false) + resources(false) + preserve_paths + [ readme_file, license_file, prefix_header_file ]\n files.compact\n end",
"title": ""
},
{
"docid": "bd1010ae13ac58fbdfd88595e6d71d1e",
"score": "0.61771816",
"text": "def build_path(source, target)\n path = [] << target\n until @all_seen_words[path.last] == nil\n path << @all_seen_words[path.last]\n end\n path << source\n p path\n end",
"title": ""
},
{
"docid": "577f1c96c5a93e64305c4569106ce157",
"score": "0.61749536",
"text": "def init_paths\n\t\tdrive = session.fs.file.expand_path(\"%SystemDrive%\")\n\n\t\tfiles =\n\t\t\t[\n\t\t\t\t'unattend.xml',\n\t\t\t\t'autounattend.xml'\n\t\t\t]\n\n\t\ttarget_paths =\n\t\t\t[\n\t\t\t\t\"#{drive}\\\\\",\n\t\t\t\t\"#{drive}\\\\Windows\\\\System32\\\\sysprep\\\\\",\n\t\t\t\t\"#{drive}\\\\Windows\\\\panther\\\\\",\n\t\t\t\t\"#{drive}\\\\Windows\\\\Panther\\Unattend\\\\\",\n\t\t\t\t\"#{drive}\\\\Windows\\\\System32\\\\\"\n\t\t\t]\n\n\t\tpaths = []\n\t\ttarget_paths.each do |p|\n\t\t\tfiles.each do |f|\n\t\t\t\tpaths << \"#{p}#{f}\"\n\t\t\tend\n\t\tend\n\n\t\t# If there is one for registry, we add it to the list too\n\t\treg_path = get_registry_unattend_path\n\t\tpaths << reg_path if not reg_path.empty?\n\n\t\treturn paths\n\tend",
"title": ""
},
{
"docid": "6c7aeaba1d9b1c2f081ad5199b4cf304",
"score": "0.61596984",
"text": "def target_files\n proc do\n Pathname.new(path).glob('**/*').reject { |p| target_exclude_files.include?(p.basename.to_s) }\n end\n end",
"title": ""
},
{
"docid": "3cfde6e1377c76c39cdf15e40be8339a",
"score": "0.6133861",
"text": "def source_paths_existing(base_paths)\n result = []\n \n base_paths.each do |base_path|\n path = source_path(base_path)\n result << path if path.exists?\n end\n \n result\n end",
"title": ""
},
{
"docid": "563c6a0f30d244cbdbe699e390bf6ce3",
"score": "0.6115955",
"text": "def get_unsorted_target_files\n return [] if target_folder.nil?\n tr = target_folder.all_processable_children.reject {|node| node.index?}\n\n # Replace all links with their targets.\n tr.collect {|f| f.is_link? ? f.link : f }\n end",
"title": ""
},
{
"docid": "146d68365b514e939dff5f6aedd286d4",
"score": "0.61139524",
"text": "def compute_other_paths(_routes, _route)\n []\n end",
"title": ""
},
{
"docid": "50506098e442c862fb03b762ba938f10",
"score": "0.61046",
"text": "def result_paths\n paths = Dir.glob( dir.join('*') ).map {|x|\n Pathname(x)\n }\n return paths\n end",
"title": ""
},
{
"docid": "abaad42f97d2e270da2a7c5fc004b24b",
"score": "0.60987616",
"text": "def find_target tgt\n if '/' == tgt[ 0 ] # absolute path\n result = @all_targets[ tgt ]\n return result.nil? ? nil : [result]\n end\n\n # tgt is a relative path (suffix)\n t = tgt.reverse + '/'\n\n # sorted list of reversed keys: rebuild list if new targets have been added\n @sort_all_targets = @all_targets.keys.map( &:reverse ).sort! if\n !defined?( @sort_all_targets ) || @sort_all_targets.size < @all_targets.size\n\n # binary search\n max = @sort_all_targets.size\n low, high = 0, max\n mid = (low + high) / 2\n loop {\n break if @sort_all_targets[ mid ].start_with? t\n (t > @sort_all_targets[ mid ]) ? low = mid + 1: high = mid\n return nil if low >= high\n mid = (low + high) / 2\n }\n\n # found a match at mid\n k = @sort_all_targets[ mid ].reverse\n result = [@all_targets[ k ]]\n (mid - 1).downto( 0 ).each { |i| # backward search\n k = @sort_all_targets[ i ]\n break if !k.start_with? t\n result << @all_targets[ k.reverse ]\n }\n (mid + 1...max).each { |i| # forward search\n k = @sort_all_targets[ i ]\n break if !k.start_with? t\n result << @all_targets[ k.reverse ]\n }\n return result\n end",
"title": ""
},
{
"docid": "e44411d7d9259866a70017cff97eef9d",
"score": "0.60890156",
"text": "def all_subpaths\n @fragments.inject([ ]) { |out,f| out | f.target_subpaths }.uniq.sort\n end",
"title": ""
},
{
"docid": "e58e080208b07917063d84e912c7f48d",
"score": "0.6079087",
"text": "def calc_path\n endpoint = state.target\n while endpoint\n state.path[endpoint] = true\n endpoint = state.came_from[endpoint]\n end\n end",
"title": ""
},
{
"docid": "a65102a43d619f45b439db68441e15f9",
"score": "0.60721254",
"text": "def sibling_targets\n compiled_targets = @project.targets.select{ |t| t.respond_to?(:source_build_phase) }\n compiled_targets.select{ |t| t.source_build_phase.files_references.any?{ |f| @siblings.include?(f) } }\n end",
"title": ""
},
{
"docid": "72d978d795e1530e42b3bb3f0adacecb",
"score": "0.60703087",
"text": "def paths() = @paths ||= Set.new",
"title": ""
},
{
"docid": "8e0a2ac81ff7e74ed9c0add343cb96af",
"score": "0.60630435",
"text": "def sibling_targets\n siblings = children.to_set\n compiled_targets = project.targets.select { |t| t.respond_to?(:source_build_phase) }\n compiled_targets.select { |t| t.source_build_phase.files_references.any? { |f| siblings.include?(f) } }\n end",
"title": ""
},
{
"docid": "05b45b5a0932c1c99dc0871f282f6dbd",
"score": "0.6055123",
"text": "def paths\n @paths\n end",
"title": ""
},
{
"docid": "05b45b5a0932c1c99dc0871f282f6dbd",
"score": "0.6055123",
"text": "def paths\n @paths\n end",
"title": ""
},
{
"docid": "fecd9fe3f52b247fcf6b9c5f1302a01e",
"score": "0.60488087",
"text": "def get_valid_paths ()\n\t\treturn @@valid_paths[self.loc]\n\tend",
"title": ""
},
{
"docid": "8c853907a7bd5fcf2a58b4b4cf0566e4",
"score": "0.6046548",
"text": "def targets\n @targets ||= load_targets\n end",
"title": ""
},
{
"docid": "f8f7c40ba4acec24296a774a2b4e23e2",
"score": "0.60464996",
"text": "def targets\n @targets\n end",
"title": ""
},
{
"docid": "d56f46b4a474041ee87d92846a2371bb",
"score": "0.60204",
"text": "def paths\n @trail.paths.dup\n end",
"title": ""
},
{
"docid": "4f824582d109f666d400f91f8238c047",
"score": "0.60171044",
"text": "def target_files; end",
"title": ""
},
{
"docid": "1bc06ffd3b9c343d16744dd22c70dadb",
"score": "0.6006336",
"text": "def rpaths; end",
"title": ""
},
{
"docid": "1bc06ffd3b9c343d16744dd22c70dadb",
"score": "0.6006336",
"text": "def rpaths; end",
"title": ""
},
{
"docid": "be3ac20f4603addac56e8b497b0aca0b",
"score": "0.60022235",
"text": "def source_paths\n if File.exist? destination_root('generators', 'templates')\n [\"#{destination_root('generators')}\", File.expand_path(File.dirname(__FILE__))]\n else\n [File.expand_path(File.dirname(__FILE__))]\n end\n end",
"title": ""
},
{
"docid": "0c63991061ed7c94e8d832432bc792d4",
"score": "0.5986898",
"text": "def paths\n @paths ||= pathnames.map(&:to_s)\n end",
"title": ""
},
{
"docid": "4bde70f0db1354259aa85cedccf8e72d",
"score": "0.5985419",
"text": "def source_paths_for_search; end",
"title": ""
},
{
"docid": "37fb5c50341034f2810f0728b9c857ed",
"score": "0.5984326",
"text": "def source_paths\n if File.exist? destination_root('generators')\n [\"#{destination_root('generators')}\", File.expand_path(File.dirname(__FILE__))]\n else\n [File.expand_path(File.dirname(__FILE__))]\n end\n end",
"title": ""
},
{
"docid": "3d05582f3783ebfbcfc86e10b055e893",
"score": "0.596711",
"text": "def get_source_files_for_target target\n target.source_build_phase.files.to_a.map do |pbx_build_file|\n pbx_build_file.file_ref.real_path.to_s\n\n end.select do |path|\n path.end_with?(\".m\", \".mm\", \".swift\")\n\n end.select do |path|\n File.exists? path\n end\n end",
"title": ""
},
{
"docid": "205e83086c5ff2a0e9b5da717b38e874",
"score": "0.59635735",
"text": "def all_vector_paths(src, dest, current=src, kill=0, path=[], result=[])\n vectors(current) do |label, child|\n if child == dest\n result << (path.dup << label)\n elsif kill[child] == 0\n path.push(label)\n all_vector_paths(src, dest, child, kill | (1 << child), path, result)\n path.pop\n end\n end\n result\n end",
"title": ""
},
{
"docid": "f6356c6cb67246f4cea447cbfb9c5adc",
"score": "0.59609103",
"text": "def paths\n @map_enteties.select {|e| e.is_a? Path}\n end",
"title": ""
},
{
"docid": "da916aa395f872da5267cae13c2c0e94",
"score": "0.5955663",
"text": "def logical_paths\n @manifest_index.keys\n end",
"title": ""
},
{
"docid": "a1385282a00c7528984b54acf210994a",
"score": "0.5949589",
"text": "def expanded_clean_paths\n files = []\n clean_paths.each do |pattern|\n pattern = pod_destroot + pattern\n pattern.glob.each do |file|\n files << file\n end\n end\n files\n end",
"title": ""
},
{
"docid": "a1385282a00c7528984b54acf210994a",
"score": "0.5949589",
"text": "def expanded_clean_paths\n files = []\n clean_paths.each do |pattern|\n pattern = pod_destroot + pattern\n pattern.glob.each do |file|\n files << file\n end\n end\n files\n end",
"title": ""
},
{
"docid": "2c7e49b0802002ea877ff0df849e2d3c",
"score": "0.59458053",
"text": "def targets()\n if @target then\n return [self]\n else\n return []\n end\n end",
"title": ""
},
{
"docid": "fa7f387725f3aa6972757038c784fb9b",
"score": "0.59448546",
"text": "def all_paths\n pt = self.paths\n pt[:+] + pt[:-]\n end",
"title": ""
},
{
"docid": "c94d5fef3df029cb616b77ce5da7d7bd",
"score": "0.59370226",
"text": "def target_resources\n return @target_resources\n end",
"title": ""
},
{
"docid": "00d20141656279a683b29e3862cfebbd",
"score": "0.59357476",
"text": "def paths()\n paths_recur(@spec[\"root\"],\"\")\n end",
"title": ""
},
{
"docid": "3f676b679e6c77993fd7fee2dcd77c24",
"score": "0.5931404",
"text": "def paths(object)\n PathSet.extract_from(object)\n end",
"title": ""
},
{
"docid": "6ec2974c35e11034c196363795f8873d",
"score": "0.59238523",
"text": "def targets\n return %x[ grep -Pzrl --include=\"*.rb\" \"^__END__.*\\\\n.*spec_for\" . ].split(\"\\n\").collect do |path|\n path[2..-1]\n end\n end",
"title": ""
},
{
"docid": "fccebee1faeaec4b6f0954940f77acea",
"score": "0.5923397",
"text": "def paths\n @@paths\n end",
"title": ""
},
{
"docid": "fccebee1faeaec4b6f0954940f77acea",
"score": "0.5923397",
"text": "def paths\n @@paths\n end",
"title": ""
},
{
"docid": "32e9221894e68241453d261d57d2003b",
"score": "0.5923308",
"text": "def paths; end",
"title": ""
},
{
"docid": "32e9221894e68241453d261d57d2003b",
"score": "0.5923308",
"text": "def paths; end",
"title": ""
},
{
"docid": "32e9221894e68241453d261d57d2003b",
"score": "0.5923308",
"text": "def paths; end",
"title": ""
},
{
"docid": "32e9221894e68241453d261d57d2003b",
"score": "0.5923308",
"text": "def paths; end",
"title": ""
},
{
"docid": "32e9221894e68241453d261d57d2003b",
"score": "0.5923308",
"text": "def paths; end",
"title": ""
},
{
"docid": "4a800393db143b57675071a288e1ba37",
"score": "0.59196395",
"text": "def paths\n @paths.values\n end",
"title": ""
},
{
"docid": "5a921ceecffea8aef909152e51dc6511",
"score": "0.5917048",
"text": "def all_paths(src, dest, current=src, traversed=[src], result=[])\n children(current) do |child|\n if child == dest\n result << (traversed.dup << child)\n elsif !traversed.include?(child)\n traversed.push(child)\n all_paths(src, dest, child, traversed, result)\n traversed.pop\n end\n end\n result\n end",
"title": ""
},
{
"docid": "72ebe8da08e4fb4ed811a6f1b5578451",
"score": "0.5911823",
"text": "def target_path\n '/media/leslie/Data/all_photos/target'\n end",
"title": ""
},
{
"docid": "bf7a742c79be003b63fb6573ca71df57",
"score": "0.59076667",
"text": "def to_filesystem_targets target_paths, spin_msg=nil, &blk\n self.target_paths=target_paths\n\n count=target_count\n Jam::error \"No valid targets given\" if target_count==0\n\n if spin_msg and Jam::environment!=:test\n with_spinner count, spin_msg do |spin|\n find_targets.each do |tgt|\n yield tgt.relroot, tgt\n spin.call\n end\n end\n else\n find_targets.each do |tgt|\n yield tgt.relroot, tgt\n end\n end\n\n count\n end",
"title": ""
},
{
"docid": "493f742db420ee732ce071c7dc15dc6d",
"score": "0.58996964",
"text": "def paths\n map\n end",
"title": ""
},
{
"docid": "ab893cda1103e484f1af87fc85ff2301",
"score": "0.58877647",
"text": "def paths\n @paths ||= []\n end",
"title": ""
},
{
"docid": "312e3dfb12d3b913770d446aab56333b",
"score": "0.5883855",
"text": "def get_selected_paths\n return get_songs_search_from_params.songs_found.map { |s| s[SongsSearch::IDX_SONG_PATH] }\n end",
"title": ""
},
{
"docid": "3df607739c7e0b046c7c1e59e9056317",
"score": "0.58709604",
"text": "def get_target_list()\n list = @targets_list\n return list\n end",
"title": ""
},
{
"docid": "69d43afc0e884688b5a75c4a5d533e1c",
"score": "0.585173",
"text": "def paths\n @paths ||= {}.with_indifferent_access\n end",
"title": ""
},
{
"docid": "f7974e5c91c1bb32f7a144cb283b8016",
"score": "0.5846548",
"text": "def safe_paths\n read_all('**') - read_all(\"{#{RESERVED_DIRS.join(',')}}\", '**')\n end",
"title": ""
},
{
"docid": "6e4cc99e98bc12bb4ef1580ccc24a1f1",
"score": "0.5845576",
"text": "def target_to_root_path\n node = @target_node\n path = [node.coords]\n\n until node.parent.nil?\n node = node.parent\n path.unshift(node.coords)\n end\n path\n end",
"title": ""
},
{
"docid": "a01998caf7a507c3746827ed1fb93c33",
"score": "0.5838197",
"text": "def source_paths\n [File.dirname(__FILE__)]\n end",
"title": ""
},
{
"docid": "ea2dc86c118ffbdfa4facbb14b75b585",
"score": "0.5829885",
"text": "def myTargets\n return [] if targetID.nil?\n #raise targetID.inspect\n myTargets = Target.where(\"configuration LIKE ?\", \"%OSVIP%=%#{targetID[:target]}%\" ).map{|i| i}\n #raise myTargets.inspect\n end",
"title": ""
},
{
"docid": "3f627cf3a9a597d45a6dd140b4f9f32a",
"score": "0.58189374",
"text": "def search_paths\n @@impl.search_paths\n end",
"title": ""
},
{
"docid": "925c44b49d66ce6dd97f2c3e574c03f1",
"score": "0.5810616",
"text": "def find_logical_paths(*args); end",
"title": ""
},
{
"docid": "7cb4c525222067c0de30d79538c7c443",
"score": "0.580648",
"text": "def source_paths\r\n @source_paths.dup.freeze\r\n end",
"title": ""
},
{
"docid": "12beb6a74245cfd2d5112d5d3b6af3bb",
"score": "0.5800012",
"text": "def paths\n paths = route_set.routes.map { |route| route.path.spec.to_s }\n paths.uniq!\n paths\n end",
"title": ""
},
{
"docid": "71a599cc28e47240e3bcf5b304b3db4d",
"score": "0.57923293",
"text": "def relevant_directory_paths\n drafts.map { |doc| relative_draft_path(doc).split(\"/\")[0] }.uniq\n end",
"title": ""
},
{
"docid": "2cd623337c28c5dc53e1539d71a1c115",
"score": "0.5785773",
"text": "def targets\n @cache[\"targets\"].keys\n end",
"title": ""
},
{
"docid": "04c26c82220a2e6de94a79a8834683ce",
"score": "0.57787025",
"text": "def targets\n @@targets ||= config_targets\n end",
"title": ""
},
{
"docid": "8d8a31833b5751dc0f06def0092f221b",
"score": "0.5773103",
"text": "def cpaths; end",
"title": ""
},
{
"docid": "3e827c7d135d9573d22b1ed2532090c9",
"score": "0.57620996",
"text": "def targets\n @target_manager.available_targets.values.select { |target| target.initialized? }\n end",
"title": ""
},
{
"docid": "98e5aa59369cce75062dff82a7b12d0d",
"score": "0.5752865",
"text": "def searchable_paths\n return @paths_override if @paths_override && @paths_override.size > 0\n @paths_prepend + default_paths + @paths_append\n end",
"title": ""
},
{
"docid": "f152a8fbf3cf5e3e377e2dcbe0f120dc",
"score": "0.5740853",
"text": "def include_targets\n return @include_targets\n end",
"title": ""
},
{
"docid": "f152a8fbf3cf5e3e377e2dcbe0f120dc",
"score": "0.5740853",
"text": "def include_targets\n return @include_targets\n end",
"title": ""
},
{
"docid": "f152a8fbf3cf5e3e377e2dcbe0f120dc",
"score": "0.5740853",
"text": "def include_targets\n return @include_targets\n end",
"title": ""
},
{
"docid": "f152a8fbf3cf5e3e377e2dcbe0f120dc",
"score": "0.5740853",
"text": "def include_targets\n return @include_targets\n end",
"title": ""
},
{
"docid": "cb24a2a4ddb52f4dfa82d6c3538133a6",
"score": "0.5733585",
"text": "def parse_targets\n requested_targets = options.fetch(:targets, [])\n # If no targets are specified and empty targets are allowed return with an empty list.\n # It will be up to the validator (and whatever validation tool it uses) to determine the\n # targets. For example, using rubocop with no targets, will allow rubocop to determine the\n # target list using it's .rubocop.yml file\n return [[], [], []] if requested_targets.empty? && allow_empty_targets?\n # If no targets are specified, then we will run validations from the\n # base module directory.\n targets = requested_targets.empty? ? [PDK::Util.module_root] : requested_targets\n\n targets.map! { |r| r.gsub(File::ALT_SEPARATOR, File::SEPARATOR) } if File::ALT_SEPARATOR\n skipped = []\n invalid = []\n matched = targets.map { |target|\n if pattern.nil?\n target\n else\n if PDK::Util::Filesystem.directory?(target) # rubocop:disable Style/IfInsideElse\n target_root = PDK::Util.module_root\n pattern_glob = Array(pattern).map { |p| PDK::Util::Filesystem.glob(File.join(target_root, p), File::FNM_DOTMATCH) }\n target_list = pattern_glob.flatten\n .select { |glob| PDK::Util::Filesystem.fnmatch(File.join(PDK::Util::Filesystem.expand_path(PDK::Util.canonical_path(target)), '*'), glob, File::FNM_DOTMATCH) }\n .map { |glob| Pathname.new(glob).relative_path_from(Pathname.new(PDK::Util.module_root)).to_s }\n\n ignore_list = ignore_pathspec\n target_list = target_list.reject { |file| ignore_list.match(file) }\n\n skipped << target if target_list.flatten.empty?\n target_list\n elsif PDK::Util::Filesystem.file?(target)\n if Array(pattern).include? target\n target\n elsif Array(pattern).any? { |p| PDK::Util::Filesystem.fnmatch(PDK::Util::Filesystem.expand_path(p), PDK::Util::Filesystem.expand_path(target), File::FNM_DOTMATCH) }\n target\n else\n skipped << target\n next\n end\n else\n invalid << target\n next\n end\n end\n }.compact.flatten\n [matched, skipped, invalid]\n end",
"title": ""
},
{
"docid": "cbf24af5d4847f22dd5a638f38cfc0d4",
"score": "0.57261765",
"text": "def paths\n # roots\n roots = options[:roots]\n roots = ['.'] if roots.empty?\n\n # find files in roots\n paths = roots.flat_map { Find.find(_1).to_a }.sort\n paths = paths.select { File.file?(_1) }\n\n # strip default './'\n paths = paths.map { _1.gsub(%r{^\\./}, '') } if options[:roots].empty?\n paths\n end",
"title": ""
},
{
"docid": "d0bba7b83d67985f25844849e6bd1366",
"score": "0.57261413",
"text": "def source_paths=(value)\n @source_paths = value.to_a.\n collect { |glob| Pathname.glob(glob.to_s) }.\n flatten.\n uniq.\n collect(&:expand_path)\n end",
"title": ""
},
{
"docid": "a6bb95ca922203266f9df288bb380154",
"score": "0.5723668",
"text": "def source_paths\n @source_paths ||= CnfsCli.loaders.values.map { |path| path.join('generators', generator_type) }.select(&:exist?)\n end",
"title": ""
},
{
"docid": "a37f629c8747a16e63de06800a9f24bc",
"score": "0.5718462",
"text": "def targets()\n\t\treturn @targets\n\tend",
"title": ""
},
{
"docid": "50bbccd2b652aab75642b0d1b89adba1",
"score": "0.5703072",
"text": "def find_path(source, target, avoid_npc=true)\n Pathfinder.invoke(source, target, avoid_npc)\n end",
"title": ""
},
{
"docid": "e604771c82a16ddeb6fd1ab88f7747b9",
"score": "0.56999266",
"text": "def magic_paths\n @magic_paths ||= build_magic_paths\n end",
"title": ""
},
{
"docid": "4daaeace2797b6a9aecfec254454f835",
"score": "0.56966907",
"text": "def targets()\n targets = []\n \n each_element() do |branch|\n if target = branch.target then\n targets << target\n end\n end\n \n return targets\n end",
"title": ""
}
] |
5b6c215426f7cfb21342ebeaf75ffd4b
|
move the ball every 10 miliseconds
|
[
{
"docid": "ef11bb33a825e0132d0b7b98211d3901",
"score": "0.63728726",
"text": "def timer(canvas,data)\n moveBall(canvas,data)\n Tk.after 10, proc{timer(canvas,data)}\nend",
"title": ""
}
] |
[
{
"docid": "5f0263a9415ee873b58e71d77d8f7b34",
"score": "0.70513314",
"text": "def move\n #Apply decrease in speed due to friction \n @x_speed -= SLOWDOWN * STEP * @x_speed\n @y_speed -= SLOWDOWN * STEP * @y_speed\n\n #move the ball into its new postion\n @x_pos += @x_speed * STEP \n @y_pos += @y_speed * STEP\n\n #if the speed of the ball is close to 0, set it to 0\n if @x_speed.abs <= 0.05 and @y_speed.abs <= 0.05\n @x_speed = 0\n @y_speed = 0\n end\n end",
"title": ""
},
{
"docid": "f2bb21bcc73d9f96433094e9774032d9",
"score": "0.68823487",
"text": "def move\n @y += speed # Increment y by speed\n end",
"title": ""
},
{
"docid": "6cda3270188502194e992fe396fa59a5",
"score": "0.6844539",
"text": "def move\n @x += @vel_x\n @y += @vel_y\n @vel_y += 0.12 # Gravity pulls the ball down.\n\n # If ball moves out of screen, reset ball and update scores.\n if @y > @window.height\n if @x < @window.width / 2\n @window.score.dead_player\n else\n @window.score.dead_bot\n end\n reset # Reset ball position.\n end\n end",
"title": ""
},
{
"docid": "d16ce98b5362b7ecd2c06aaab3c29a1f",
"score": "0.6811721",
"text": "def move_second\n @x -= speed * Math.sin(2 * Math::PI - Math::PI * angle / 180) if @x >= 32\n @y -= speed * Math.cos(2 * Math::PI - Math::PI * angle / 180) if @y >= 30\n end",
"title": ""
},
{
"docid": "3cedaf44553a62227d613888fd488da6",
"score": "0.6756708",
"text": "def update_move\n if Graphics.frame_count % 30 == 0\n self.oy = -4\n self.flash(Color::SKYBLUE, 10)\n elsif self.oy < 0\n self.oy += 1\n end\n end",
"title": ""
},
{
"docid": "5e1078ed2d998797a374a0d458328ce1",
"score": "0.67172474",
"text": "def move\n @speed = map(total_count, 5, 25, 0.1, 0.4).to_f\n @speed = constrain(speed, 0, 10.0)\n @position[Y] += speed\n\n if (position[Y] > height*2)\n @position[Y] = -height\n end\n end",
"title": ""
},
{
"docid": "d20d0c300868b556b42f9c56254ee400",
"score": "0.6697509",
"text": "def move\n @y += SPEED\n end",
"title": ""
},
{
"docid": "e4543956e850f8eb265aa5a1f68ef3d3",
"score": "0.6659089",
"text": "def update\n \tputs \"1. In update. Sleeping for one second\\n\"\n @cycle += 1 # add one to the current value of cycle\n sleep(1)\n @shape_x +=10\n end",
"title": ""
},
{
"docid": "001297b813a75db07c8f465b3142ace2",
"score": "0.6631208",
"text": "def move\n # Change the x location by speed\n @x += @speed\nend",
"title": ""
},
{
"docid": "2482f30963aac00e9eabd9ede1e74b2f",
"score": "0.6506262",
"text": "def update\n @y += @speed\n end",
"title": ""
},
{
"docid": "a4db9efecaf509bd41eddfef21cfb51f",
"score": "0.6505979",
"text": "def move\n @x += @velocity[0] * @mass\n @y += @velocity[1] * @mass\n\n @circle.move @x, @y\n end",
"title": ""
},
{
"docid": "9d4b68cef780ee324f455efeafae0d0e",
"score": "0.6484102",
"text": "def move\r\n @y += @Speed\r\n end",
"title": ""
},
{
"docid": "adb867e74bdd596b5c8bde008bb62dfd",
"score": "0.64744234",
"text": "def update seconds_passed\n \n # This example makes the objects orbit around the center of the screen.\n # The objects make one orbit every 4 seconds\n @angle = ( @angle + 2*Math::PI / 4 * seconds_passed) % ( 2*Math::PI)\n \n @rect.topleft = [ 320 + 100 * Math.sin(@angle),\n 240 - 100 * Math.cos(@angle)]\n end",
"title": ""
},
{
"docid": "2bf711d0eb032c5fa285be0c0602aef9",
"score": "0.6456758",
"text": "def update\n # main game loop\n # update() is called 60 times per second (by default) and should contain the main game logic: move objects, handle collisions...\n end",
"title": ""
},
{
"docid": "59d2bd7ea0643f000b4aa143dc669c90",
"score": "0.6417385",
"text": "def tick\n @speed = @speed.normalize * @limit if @speed.magnitude > @limit\n @speed = Vector[@speed[0].round(0), @speed[1].round(0)]\n @xy += @speed\n end",
"title": ""
},
{
"docid": "87097b58d606990795b0edf242019850",
"score": "0.64149755",
"text": "def move\n\t\trad = degrees_to_radians(@angle) \n\t\t@x += Math::cos(rad) * @move_speed\n\t\t@y += Math::sin(rad) * @move_speed\n\t\t@moved = true\n\tend",
"title": ""
},
{
"docid": "104bb9079412c72b6f0b8e13ae97b198",
"score": "0.6407704",
"text": "def tick\n @readiness += @speed\n end",
"title": ""
},
{
"docid": "2e896598e64ed68dcf0e5063fedda8df",
"score": "0.63994586",
"text": "def move_balls \n @fireballs.each {|fireball| fireball.move}\n end",
"title": ""
},
{
"docid": "e90823d453c21df8a0690f85ffab5dc4",
"score": "0.63894707",
"text": "def move\r\n @x += Gosu.offset_x(@direction,SPEED)\r\n @y += Gosu.offset_y(@direction,SPEED)\r\n end",
"title": ""
},
{
"docid": "2bd1781043140d17814ddf7e38e111b6",
"score": "0.6350829",
"text": "def tick!\n circle_clockwise\n shoot\n end",
"title": ""
},
{
"docid": "1ba370c1d3dd1490d4b45adcb49f96f1",
"score": "0.63074946",
"text": "def simulate_movement\n @x += @vel[:x] * RATE\n @y += @vel[:y] * RATE\n @vel[:x] += @acc[:x] * RATE\n @vel[:y] += @acc[:y] * RATE\n end",
"title": ""
},
{
"docid": "3d9b19d6b3c2df93a607cd3560a47531",
"score": "0.6307419",
"text": "def tick(dt)\n if following_distance < FOLLOWING / DEVIATION # seconds\n @speed = [0, @speed - DECELERATION * dt].max\n elsif following_distance > FOLLOWING * DEVIATION\n if following && following_distance < WITHIN_REACH\n limit = OVERSPEED * road.speed_limit\n else\n limit = road.speed_limit\n end\n\n @speed = [limit, @speed + ACCELERATION * dt].min\n end\n\n @pos += @speed * dt\n\n @pos = @pos.round 1\n @speed = @speed.round 1\n end",
"title": ""
},
{
"docid": "4127e4a973291ac71efba680d971342e",
"score": "0.63061106",
"text": "def accelerate\n @speed += 10\n end",
"title": ""
},
{
"docid": "4127e4a973291ac71efba680d971342e",
"score": "0.63061106",
"text": "def accelerate\n @speed += 10\n end",
"title": ""
},
{
"docid": "3bfbdebcb01003145756b5d2709f92f1",
"score": "0.63002765",
"text": "def update\n\t\t# if playing the game\n\t\tif @playing\n\t\t\t@x += @velocity_x\n\t\t\t@y += @velocity_y\n\n\t\t\t# If mole hits game wall change direction instead of passing throu\n\t\t\t@velocity_x *= -1 if @x + @width / 2 > 800 || @x - @width / 2 < 0 \n\t\t\t@velocity_y *= -1 if @y + @height / 2 > 600 || @y - @height / 2 < 1 \n\n\t\t\t# Making mole invisible for 10 frames\n\t\t\t@visible -= 1\n\t\t\t# Making mole visible for 50 frames\n\t\t\t@visible = 50 if @visible < -10 && rand < 0.01\n\n\t\t\t# Time limit for game session, 30 sec\n\t\t\t@time_left = (30 - ((Gosu.milliseconds - @start_time) / 1000))\n\n\t\t\t# If timelimit has reached 0\n\t\t\t@playing = false if @time_left < 0\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ecada1cfc3e8f1518d46603d5675556f",
"score": "0.6278988",
"text": "def move\r\n @y -= SPEED\r\n end",
"title": ""
},
{
"docid": "5b2c36b8e0ded9d2e2f366b7e0b598b6",
"score": "0.62679803",
"text": "def tick\n if @position == @width && @is_moving_right\n @is_moving_right = false\n @position -= 1\n elsif @position == 0 && !@is_moving_right\n @is_moving_right = true\n @position += 1\n elsif @is_moving_right\n @position += 1\n else\n @position -= 1\n end\n\n\n end",
"title": ""
},
{
"docid": "7e27299212394df833c146d465305d73",
"score": "0.6262706",
"text": "def tick\n update_frame = false\n update_frame = start_walking if !@walking && @args.inputs.directional_vector\n update_frame = stop_walking if @walking && !@args.inputs.directional_vector\n\n update_frame = true if update_facing\n\n move if @walking\n\n update_frame = true if next_frame\n update_frame\n end",
"title": ""
},
{
"docid": "d357b759ef31edf6039545d0d7b6af32",
"score": "0.6236418",
"text": "def brake\n @y = (@y + SPEED) % HEIGHT\n end",
"title": ""
},
{
"docid": "4b5df72d099fd1937ebe3dda2e6824e6",
"score": "0.6225301",
"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": "095b1c333d8907d97e7bcc79225b658a",
"score": "0.6211061",
"text": "def update\r\n puts \"0. In update\\n\"\r\n @shape_x += 10\r\n sleep(2)\r\n end",
"title": ""
},
{
"docid": "4f7e9d19f190c82c222246f61a52c5ac",
"score": "0.620682",
"text": "def cycleMove()\n cycleMoveOne(@ball) ;\n (0...11).each{|unum|\n cycleMoveOne(@teamLeft.playerList[unum]) ;\n cycleMoveOne(@teamRight.playerList[unum]) ;\n }\n end",
"title": ""
},
{
"docid": "cb3c47058422a6ad39e1652c2c458e95",
"score": "0.6201146",
"text": "def update\n updateTime\n circle\n if @shootTime > 200\n shoot\n @shootTime = 0\n end\n @shootTime += 1\n end",
"title": ""
},
{
"docid": "ea0b7232f59f3d4bd2a9723cfd5630d9",
"score": "0.61948466",
"text": "def update()\n self.move()\n end",
"title": ""
},
{
"docid": "a4976ee0d230c7f4c4bbe8cdfc3e3d7a",
"score": "0.6182986",
"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.6182986",
"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": "5f4a76a075471d42057d3328f4695664",
"score": "0.61791426",
"text": "def move_position\n @x += @velocity_x\n @y += @velocity_y\n end",
"title": ""
},
{
"docid": "efdcf1e3ff324b6e18798305152f1e20",
"score": "0.6165786",
"text": "def move\n\t\t\t@x += @vel_x\n\t\t\t@y += @vel_y\n\t\tend",
"title": ""
},
{
"docid": "d21b48e70fc1db87773d74e9c7589f47",
"score": "0.6161343",
"text": "def tick\n @tick += 1\n end",
"title": ""
},
{
"docid": "5a376a4e8cfc8ebf441bc2edf3af0d89",
"score": "0.6149509",
"text": "def move\r\n @position.add(@velocity)\r\n end",
"title": ""
},
{
"docid": "062782fceed3c4497684789192fd49d5",
"score": "0.6135106",
"text": "def move\n self.position += self.speed/SUBSTEPS\n moved\n end",
"title": ""
},
{
"docid": "e2e6b29e37a981d750e454e809996156",
"score": "0.6092784",
"text": "def move(x, y, x_speed = 1, y_speed = x_speed)\r\n move_x(x, x_speed)\r\n move_y(y, y_speed)\r\n end",
"title": ""
},
{
"docid": "6aa5cb530721966ba6595e664afe66a8",
"score": "0.60880053",
"text": "def accelerate\n @speed = @speed + 10.0\n end",
"title": ""
},
{
"docid": "ea13932281b828f0e24258b8ef3d2cc1",
"score": "0.6084101",
"text": "def update_moving( event )\n dt = event.seconds # Time since last update\n \n update_accel\n update_vel( dt )\n update_pos( dt ) \n end",
"title": ""
},
{
"docid": "b8b5b0a70afb8e2e0987b4c4b489be22",
"score": "0.6079531",
"text": "def move\n # save old x,y position\n @previous_x=@x\n @previous_y=@y\n\n # move particle by velocity_x,velocity_y\n @x += @velocity_x\n @y += @velocity_y\n\n # randomly increase/decrease direction\n @velocity_x += random(-1.0, 1.0) * @acceleration\n @velocity_y += random(-1.0, 1.0) * @acceleration\n\n # draw a line from the old position to the new\n #CANVAS.line(@previous_x,@previous_y,@x,@y);\n @points.push(NSPoint.new(@x, @y))\n\n # grow old\n @age += 1\n if @age>200\n # die and be reborn\n end\n end",
"title": ""
},
{
"docid": "5ae65c2f719c587499cfdc0118779f27",
"score": "0.6073784",
"text": "def update\n return unless @playing # do nothing if not playing\n\n @x += @velocity_x\n @y += @velocity_y\n @visible -= 1 # substract 1 from the visible timer\n @time_left = (30 - ((Gosu.milliseconds - @start_time) / 1000)) # timer to control game (30 s)\n @playing = false if @time_left < 0 # if time < 0 finish game (not playing)\n\n # ruby bounces on screen edges\n @velocity_x *= -1 if @x + @width/2 > 800 || @x - @width / 2 < 0\n @velocity_y *= -1 if @y + @height/2 > 600 || @y - @height / 2 < 0\n\n # ruby has a 0.01 percent chance of reapearing after turning invisible for 10 frames\n @visible = 100 if @visible < -10 and rand < 0.01\n end",
"title": ""
},
{
"docid": "71b84a0b52bf5b632ac68434c14d8d7f",
"score": "0.6048682",
"text": "def delay(frame)\n (frame*40).to_i.times {Graphics.update}\n end",
"title": ""
},
{
"docid": "c58919042625e4f0097752262fbc6a2f",
"score": "0.60443115",
"text": "def move\n\t\t\t@y -= 10\n\t\t\t@bullet.move @x, @y\n\t\tend",
"title": ""
},
{
"docid": "c58919042625e4f0097752262fbc6a2f",
"score": "0.60437125",
"text": "def move\n\t\t\t@y -= 10\n\t\t\t@bullet.move @x, @y\n\t\tend",
"title": ""
},
{
"docid": "b19dd1dbcf40157eda0f83fd746e3628",
"score": "0.602883",
"text": "def +@\n @speed += 10\n end",
"title": ""
},
{
"docid": "dcfd61c9b784d50617ecfba4b051dcec",
"score": "0.6019886",
"text": "def move_first\n @x += speed * Math.sin(Math::PI * angle / 180) if @x <= 612\n @y -= speed * Math.cos(Math::PI * angle / 180) if @y >= 30\n end",
"title": ""
},
{
"docid": "527c20e0fc08387ce5092ec5db6435e6",
"score": "0.6009024",
"text": "def brake\n @speed -= 7\n end",
"title": ""
},
{
"docid": "f3a0c6957ef8900a40b276076f252e13",
"score": "0.6006961",
"text": "def tick\n @grids[@time % 2].tick\n @time += 1\n end",
"title": ""
},
{
"docid": "4f30aee3eaf3e7778bf1064521fcc2a7",
"score": "0.6002751",
"text": "def play\r\n show_title_screen\r\n activate_movewalls\r\n reset_timers\r\n update_buffer\r\n\r\n while true\r\n check_input\r\n check_collisions\r\n update_buffer\r\n update_doors\r\n update_movewalls\r\n update_pushwalls\r\n update_frame_rate\r\n update_delta_time\r\n draw_debug_info if @show_debug_info\r\n\r\n # TODO: Dynamically update this based on frame rate.\r\n # If the current frame rate exceeds the target refresh\r\n # rate, then sleep execution and/or drop frames to\r\n # maintain the desired maximum refresh rate.\r\n #\r\n sleep 0.010\r\n end\r\n end",
"title": ""
},
{
"docid": "504ba627456d30f7d7a37b00ad70e7f6",
"score": "0.6002547",
"text": "def idle\n\n t = GLUT.Get(GLUT::ELAPSED_TIME)\n\n if t - @lastMove > 10\n @lastMove = t \n GLUT.PostRedisplay()\n move\n end\n\n end",
"title": ""
},
{
"docid": "8f8f310e5274f9d5249cee91eb3bd548",
"score": "0.6002533",
"text": "def walk\n @speed = @speed + (0.2 * @legs)\n end",
"title": ""
},
{
"docid": "bcb7f86278d76bc19224e2fbc43c9acd",
"score": "0.59942687",
"text": "def update_speed\n # if accelerating counter\n if @accelerate > 0\n # decrease accelerating counter\n @accelerate -= 1\n # accelerate if accelerating counter expired\n @move_speed = @normal_speed if @accelerate == 0\n end\n # additional stop animation updates depending on speed\n number = @move_speed - 2\n number = 1 if number < 1\n (number < 3 ? number : 3).times {update_stop}\n end",
"title": ""
},
{
"docid": "22f74c660c0af07e91ddd543ffb8cc25",
"score": "0.5991532",
"text": "def tick\n @game_objects.each {|obj|\n if obj.is_a?(Ball) and obj.at_bottom?\n @game_objects.delete(obj)\n end}\n @score_text.contents = @score.to_s\n @score_text.draw(self, Point[0, 0])\n if @game_objects.size == 1\n spawn_ball\n end\n @game_objects.each {|obj| obj.tick}\n end",
"title": ""
},
{
"docid": "d732eaa742d3539af7efd18fa3c91534",
"score": "0.5989594",
"text": "def update args\n\n @x += @speed\n\n end",
"title": ""
},
{
"docid": "94053169a76a20142be0c61afcea996d",
"score": "0.5983848",
"text": "def accelerate\n @speed += 25\n end",
"title": ""
},
{
"docid": "fab29f39241a864bdc6ecccf5064193a",
"score": "0.5981247",
"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": "4778406b3b3c343d19b46d37e46d6602",
"score": "0.5970419",
"text": "def update\n \n #--- Updating | Velocity ---# \n \n @y += @velocity_y #Move the image each frame on the Y axis\n @x += @velocity_x #Move the image each frame on the X axis\n \n @velocity_x *= -1 if @x + @width / 2 > 800 || @x - @width / 2 < 0 #Check to see if the Ruby is going off screen on the X axis\n @velocity_y *= -1 if @y + @height / 2 > 600 || @y - @height / 2 < 0 #Check to see if the Ruby is going off screen on the Y axis\n\n @visible -= 1 #Each frame remove 1 to the value of visible\n @visible = 50 if @visible < -10 && rand < 0.05 #If @visible has been negative for 10 frames, there is a 0.05% chance that the Ruby appear\n\n @time_left = (30 - ((Gosu.milliseconds - @start_time) / 1000)) #Calculate the time left to play (30 seconds total)\n\n @playing = false if @time_left < 0\n \nend",
"title": ""
},
{
"docid": "7d2f28c36ed134e7fa572b1b7da6b956",
"score": "0.5969623",
"text": "def walk\n @speed = @speed + (0.2 * @legs)\n end",
"title": ""
},
{
"docid": "1ec4916b2a557026304e083c77194c31",
"score": "0.59620345",
"text": "def move_left\n @speed += SPEED_LEFT\n end",
"title": ""
},
{
"docid": "0a9f598c1d45f871dc68bce5ba9e714d",
"score": "0.59517777",
"text": "def anim\n while (@y <= @y_dest)\n @y = @y + @speed\n accelaration\n sleep((@y_speed/@frame_rate))\n end\n @state = :dead\n end",
"title": ""
},
{
"docid": "5aa903f665f26e61d78188a5cddff75e",
"score": "0.59506226",
"text": "def cycle!( increment_pulse=true, do_move=true ) \n @color = next_color if increment_pulse\n change_vector\n move if do_move\n end",
"title": ""
},
{
"docid": "a3fce6500c3ce5ebc52e331d35f3a6e5",
"score": "0.59463495",
"text": "def update\n if @frameCounter < 60 then\n @frameCounter += 1\n else\n @frameCounter = 0\n if @totalTime != 0 then\n @totalTime -= 1\n end\n end\n end",
"title": ""
},
{
"docid": "41af75636cfc5e84f3808e24c876584e",
"score": "0.5943582",
"text": "def game_loop()\n playerX = @player.x()\n playerXmax = playerX + 58\n playerY = @player.y()\n playerYmax = playerY + 58\n\n #update position of each obstacle, check for collisions, repaint\n @obstacles.each() {\n |item|\n\n #update position\n item.y += item.speed()\n\n #check for collision\n if((item.x() >= playerX && item.x() <= playerXmax) || ((item.x() + 37)) >= playerX && ((item.x() + 37) <= playerXmax))\n if((item.y() >= playerY && item.y() <= playerYmax) || ((item.y() + 37)) >= playerY && ((item.y() + 37) <= playerYmax))\n @collision = true\n end\n end\n\n #remove obstacle if it's offscreen; also increment score\n if(item.y() >= 500)\n @obstacles.delete(item)\n @score += 1\n end\n }\n\n #create a new obstacle every .875 seconds (35 executions of this method)\n @addNewObstacle += 1\n if(@addNewObstacle == 35)\n randomX = rand(0..404)\n randomSpeed = rand(1..3)\n @obstacles.push(ImageObject.new(randomX, -100, \"obstacle.png\", randomSpeed))\n @addNewObstacle = 0\n end\n on_paint_screen()\n end",
"title": ""
},
{
"docid": "242666452343d342d86facad1fc55fe2",
"score": "0.5943244",
"text": "def update_move_postion\n @moving = true\n @battler.idle_pose = false\n @move_speed = set_move_speed\n speed = @move_speed / 100.0\n @distance_x = @battler.target_x - @battler.actual_x\n @distance_y = @battler.target_y - @battler.actual_y\n @move_x = @move_y = 1\n if @distance_x.abs < @distance_y.abs\n @move_x = 1.0 / (@distance_y.abs.to_f / @distance_x.abs)\n elsif @distance_y.abs < @distance_x.abs\n @move_y = 1.0 / (@distance_x.abs.to_f / @distance_y.abs)\n end\n @speed_x = speed * (@distance_x == 0 ? 0 : (@distance_x > 0 ? 8 : -8))\n @speed_y = speed * (@distance_y == 0 ? 0 : (@distance_y > 0 ? 8 : -8))\n @battler.actual_x += (@move_x * @speed_x).round\n @battler.actual_y += (@move_y * @speed_y).round\n if @battler.teleport_to_target\n @battler.actual_x = @battler.target_x\n @battler.actual_y = @battler.target_y\n @battler.teleport_to_target = false\n end\n end",
"title": ""
},
{
"docid": "7ef24b02f7e0b2bc700a275cf9b2fd02",
"score": "0.5942441",
"text": "def move!\n @x += @vel_x\n @y += @vel_y\n @angle += @vel_a\n\n @vel_x *= ACCELERATION_DOWN_X\n @vel_y *= ACCELERATION_DOWN_Y\n @vel_a *= ACCELERATION_DOWN_A\n end",
"title": ""
},
{
"docid": "7f3b3c62b9152f358ceae9fe0961b7af",
"score": "0.5928683",
"text": "def accelerate\n @speed += 8\n end",
"title": ""
},
{
"docid": "a17f0447261e9fa52e869649bf017166",
"score": "0.5923523",
"text": "def update seconds_passed\r\n @timeSum += seconds_passed *10\r\n if(@timeSum >= 5)\r\n @timeSum = 0\r\n if(@stepBool)\r\n @image = (Surface.load \"data/p1Artillery2.gif\")\r\n # @image = Rubygame::Transform.rotozoom(@image,@angle,1,true)\r\n else\r\n @image = (Surface.load \"data/p1Artillery1.gif\")\r\n end\r\n @stepBool = !@stepBool\r\n end\r\n # This example makes the objects orbit around the center of the screen.\r\n # The objects make one orbit every 4 seconds\r\n=begin\r\n puts (((rand*10).to_int).to_s)\r\n if ((rand*10).to_int) % 2 == 0\r\n @image = Surface.load \"Artillery.gif\"\r\n @rect = Rubygame::Rect.new( 0, 0, 45, 50)\r\n else\r\n @image = Surface.load \"Artillery.gif\"\r\n @rect = Rubygame::Rect.new( 0, 0, 45, 50)#Rubygame::Rect.new( 20, 0, @image.w - (45*6), @image.h )\r\n end\r\n=end\r\n #@angle = ( @angle + 2*Math::PI / 1/02 * seconds_passed) % ( 2*Math::PI)\r\n @rect.topleft = [50*@i,50*@j]\r\n #@rect.topleft = [ 320 + 100 * Math.sin(@angle),240 - 100 * Math.cos(@angle)]\r\n end",
"title": ""
},
{
"docid": "40a318bef87f6dce7b01bb69cf0aa835",
"score": "0.5921907",
"text": "def caught\n @speed = 0 # Stop it from moving by setting speed to 0\n @y = -1000 # Set the location way off the screen\n end",
"title": ""
},
{
"docid": "f5792f78a1b71e7af0f3927d255b2fcf",
"score": "0.5917611",
"text": "def move\n @position.each_key do |axis|\n @position[axis] += @velocity[axis]\n end\n end",
"title": ""
},
{
"docid": "b4f7be1fe4a0d1deca8de80bcc1505d5",
"score": "0.5888636",
"text": "def tick\n @board = generate_next_board\n end",
"title": ""
},
{
"docid": "d51c4bfcc1353b1c3ee4ba42368e72e9",
"score": "0.58848965",
"text": "def tick\n start(true)\n end",
"title": ""
},
{
"docid": "a5c30ca1fc55dce7a5bf5cb113ec41dd",
"score": "0.58767086",
"text": "def new_ticks\n Thread.new do\n while true do\n puts Time.now # or call tick function\n new_turn\n sleep 100\n end\n end\n end",
"title": ""
},
{
"docid": "f7bf83be2c9b7d4aa50f5c1c39c4fe05",
"score": "0.5875936",
"text": "def move\n mover.update\n end",
"title": ""
},
{
"docid": "e6083df208d78d1e65351830710c500a",
"score": "0.58742386",
"text": "def increase_speed\r\n if @time%2000 == 0 && @time > 0 && @time <= 6000\r\n @ball.speed += 0.75 #increase ball moving speed when speed of blocks increases\r\n @ball.drop_speed += 1 #increase ball dropping speed when speed of blocks increases\r\n @ball.drop_speed2 += 1\r\n @blocks.each {|block| block.speed += 1} #make speed of existing blocks increase\r\n if @extraHearts.empty? == false\r\n @extraHearts.each do |extraHeart|\r\n if extraHeart != nil\r\n extraHeart.speed += 1 #increase speed of existing extraHearts to make it equal to speed of blocks\r\n end\r\n end\r\n end\r\n\r\n $BLOCK_SPEED += 1 #increase speed of new blocks\r\n\r\n @block_appear_time_min -= 15*(2000/@time)\r\n @block_appear_time_max -= 15*(2000/@time)\r\n\r\n @extraHeart_frequency -= 1 #reduce the frequency of appearing extraHeart\r\n end\r\n end",
"title": ""
},
{
"docid": "5641fa4e85e9d41473f99904d025e1e5",
"score": "0.58723134",
"text": "def start\n @running = true\n tick while @running\n end",
"title": ""
},
{
"docid": "e8b8103ff2f13ad89a996da4a817781b",
"score": "0.5855397",
"text": "def move(x,y) \n @image = @animation[:walk].next if @animation && x != 0 && !holding_any?(:space, :down)\n \n self.factor_x = self.factor_x.abs if x > 0\n self.factor_x = -self.factor_x.abs if x < 0\n \n self.x += x\n self.x = previous_x if self.outside_window? || game_state.game_object_map.from_game_object(self)\n \n self.y += y\n #self.y = previous_y if block = self.game_state.game_object_map.from_game_object(self)\n if self.y > game_state.floor_y\n land\n self.y = game_state.floor_y \n end\n \n @grabbed_game_objects.each do |game_object|\n game_object.factor_x = self.factor_x\n game_object.x = (self.factor_x > 0) ? self.x+22 : self.x-30\n game_object.y = (@status == :crouch) ? self.y-10 : self.y-22\n end\n \n end",
"title": ""
},
{
"docid": "b6b83a30947ba204d97f7042c4898fe2",
"score": "0.58553374",
"text": "def move\n\t\tcase @direction\n\t\twhen :up then @y -= @speed\n\t\twhen :down then @y += @speed\n\t\twhen :left then @x -= @speed\n\t\twhen :right then @x += @speed\n\t\tend\n\tend",
"title": ""
},
{
"docid": "deee7d72e59f9fcd75dc0866ec9750bb",
"score": "0.58480704",
"text": "def run\n Thread.new do\n curr_time = Time.now\n\n loop do\n last_time = curr_time\n curr_time = Time.now\n if !@paused\n old_spd = @speed\n @speed += @accel * (curr_time - last_time)\n avg_spd = (old_spd + @speed) / 2.0\n \n @delta += @delta_speed * (curr_time - last_time)\n \n move curr_time-last_time, avg_spd\n end\n\n if @pos.dist(@dest) < MIN_DEST_DIST\n @dest_reached = true\n puts \"Reached destination!!!\"\n break\n end\n\n t = 1.0/AGENT_UPDATE_FREQ - (Time.now - curr_time)\n sleep t > 0.0 ? t : 0\n end\n end\n end",
"title": ""
},
{
"docid": "d6c8f716cd2382e7326162e69146b70e",
"score": "0.58442885",
"text": "def update\n\t\tchance = Random.rand(2)\n\t\tif (chance == 1)\n\t\t\tdo_move\n\t\tend\n\tend",
"title": ""
},
{
"docid": "9451360a1fe7d1cb1e8d5ff57de14fbb",
"score": "0.584045",
"text": "def move floor\n @x += @vx\n if @y + @vy > floor - HEIGHT\n @y = floor - HEIGHT\n @vy = 0\n @state = :running\n else\n @y += @vy\n end\n end",
"title": ""
},
{
"docid": "c8f513afbe4ccc31ff6142a028b5d8bb",
"score": "0.58283246",
"text": "def timer(canvas,data)\n moveSnow(canvas,data)\n Tk.after 5, proc{timer(canvas,data)}\nend",
"title": ""
},
{
"docid": "61c6382ee79c7a8c39de3ca424eee7c7",
"score": "0.5824495",
"text": "def update \n\t\t@x += @velocity_x\n\t\t@y += @velocity_y\n\t\t@velocity_x *= -1 if @x + @width / 2 > 800 || @x - @width / 2 < 0\n\t\t@velocity_y *= -1 if @y + @height / 2 > 600 || @y - @height / 2 < 0\n\t\t@visible -= 1\n\t\t@visible =30 if @visible < -10 && rand < 0.01\n\tend",
"title": ""
},
{
"docid": "8dc4bceef50d1020af8dc97c1b66ea02",
"score": "0.5820838",
"text": "def brake\n @speed -= 7\n if (@speed < 0)\n @speed = 0\n end\n end",
"title": ""
},
{
"docid": "d1dcf2d6cf7ce65b60c127d5233bce7f",
"score": "0.58104146",
"text": "def move (elapsed_time)\n @location.x += @vector.x * elapsed_time\n @location.y += @vector.y * elapsed_time\n end",
"title": ""
},
{
"docid": "271df29b3dc8ed693bbb2d3a037cfd04",
"score": "0.5805216",
"text": "def move x, y; @x += x; @y += y; end",
"title": ""
},
{
"docid": "984698983f7b3769d69872516309809b",
"score": "0.58050746",
"text": "def update(time)\n\t\t\t\tsetup\tunless @setup_done\n\t\t\t\t\n\t\t\t\t@sprite.x = @from_x + time * @x_step\n\t\t\t\t@sprite.y = @from_y + time * @y_step\n\t\t\tend",
"title": ""
},
{
"docid": "edfac2c2c23b53d52e2eb0ca7209f2a3",
"score": "0.58049536",
"text": "def brake\n if @speed < 7\n @speed = 0\n else\n @speed = @speed - 7\n end\n end",
"title": ""
},
{
"docid": "fc55a3a2e7e837e0cf5da6cf87000295",
"score": "0.5801846",
"text": "def movement ; end",
"title": ""
},
{
"docid": "b662b5a9216adbeacee679e3e067c1c2",
"score": "0.5796025",
"text": "def change_speed(increment)\n if @speed + increment > 0\n @speed += increment\n else\n @speed = 0\n end\n end",
"title": ""
},
{
"docid": "4f9d0bd9a21cd7a1b13c344ac155ce80",
"score": "0.57887733",
"text": "def land!\n while @speed > 70\n @speed -= 30\n sleep(1) #number of seconds\n @state = :drive if @speed <= 100\n end\n end",
"title": ""
},
{
"docid": "58f1df906c95a8388dc0f30dc616fea6",
"score": "0.5787031",
"text": "def update\n @x += Gosu::offset_x(@rotation, @speed)\n @y += Gosu::offset_y(@rotation, @speed)\n end",
"title": ""
},
{
"docid": "d2a637bfb2454e4c9f9c7af58d924eb9",
"score": "0.57819396",
"text": "def setBallPos(x,y)\n @ball.position.set(x,y)\n end",
"title": ""
},
{
"docid": "c2af4154bf5ae3cdfcbe4f6669d825c7",
"score": "0.57809144",
"text": "def do(actor, targets)\n actor.vector.speed += delta\n end",
"title": ""
},
{
"docid": "5443ca14d3a7456e0079094319fc6436",
"score": "0.5774541",
"text": "def run(n)\n\tw = Walk.new\n\tw.update_mob_position\n\tn.times do\n\t\tw.mob.move\n\t\tw.update_mob_position\n\tend\nend",
"title": ""
},
{
"docid": "1903e81f072eac4016f4dd31ce81999f",
"score": "0.5774212",
"text": "def move(velocity)\n @velocity = velocity\n @move = 25\n end",
"title": ""
}
] |
9b67721a2e45fa7a6cb48d30714d4634
|
Use callbacks to share common setup or constraints between actions. retreives the member by requested parameter IF it is owned by the current Grad AND it exists
|
[
{
"docid": "3857a26d0c8653139edf91ebc985156b",
"score": "0.0",
"text": "def set_member\n pid = params[:id]\n if Member.exists?(pid)\n @member = Member.find_by_id(pid)\n if current_role(Member)\n if @member.id != current_user.role_id || !@member\n redirect_to logout_path\n end\n end\n else\n redirect_to logout_path\n end\n end",
"title": ""
}
] |
[
{
"docid": "2a9810ab0832605d37cb576f3f4020a6",
"score": "0.58878875",
"text": "def member\n self.group_loan_membership.member \n end",
"title": ""
},
{
"docid": "c83ef4525e1fdfbe77276d030a435834",
"score": "0.5807914",
"text": "def find_member\n @member = Member.find params[:member_id]\n end",
"title": ""
},
{
"docid": "82df67a69cc19ad7937485fa2a9923c6",
"score": "0.577348",
"text": "def member?(invocation); end",
"title": ""
},
{
"docid": "03e923891e136f8832ba0c10893b39e1",
"score": "0.5744226",
"text": "def member?\n end",
"title": ""
},
{
"docid": "50370434d26a1746918c364d60e6fab9",
"score": "0.57074517",
"text": "def member\n member_profile || member_user\n end",
"title": ""
},
{
"docid": "1a21e7bcf77d4772d0ee80cdacd804ae",
"score": "0.568367",
"text": "def [](member_name)\r\n return Member[self, member_name]\r\n # And pray to your gods that the member exists.\r\n end",
"title": ""
},
{
"docid": "2ba783c5d70d11e28a2187118fe7f8fe",
"score": "0.56763214",
"text": "def owner_or_member_of_budget?\n # puts self.family_budgets.first.present?\n if self.family_budget.present?\n budget = FamilyBudget.find(self.family_budget.id)\n elsif self.family_budgets.first.present?\n budget = FamilyBudget.find(self.family_budgets.first.id)\n else\n budget = nil\n end\n return budget\n end",
"title": ""
},
{
"docid": "6788adbe02f2e6501e578b13b404f1f2",
"score": "0.5539594",
"text": "def member\n respond_to?(:parliamentaryIncumbencyHasMember) ? parliamentaryIncumbencyHasMember.first : nil\n end",
"title": ""
},
{
"docid": "6788adbe02f2e6501e578b13b404f1f2",
"score": "0.5539594",
"text": "def member\n respond_to?(:parliamentaryIncumbencyHasMember) ? parliamentaryIncumbencyHasMember.first : nil\n end",
"title": ""
},
{
"docid": "c4e7d22f8074346d76626974b10ab049",
"score": "0.5536362",
"text": "def respond\n @member = Member.find(params[:member])\n end",
"title": ""
},
{
"docid": "88a1bda1d81a8132fb6c3298fd7911d5",
"score": "0.5516824",
"text": "def set_person\n @person = Person.find(params[:id])\n @member = @person.member\n end",
"title": ""
},
{
"docid": "f8b17f6544e3175461f32bf595c6edb7",
"score": "0.55131465",
"text": "def is_owner? member\n self.member == member\n end",
"title": ""
},
{
"docid": "ad5a0a653ec9ceacbd2eda311cdebf75",
"score": "0.550159",
"text": "def permit_see?(member)\n end",
"title": ""
},
{
"docid": "29e98aff7b2a5e7a40f5611b4be3eda1",
"score": "0.5469261",
"text": "def member?(arg0)\n end",
"title": ""
},
{
"docid": "29e98aff7b2a5e7a40f5611b4be3eda1",
"score": "0.5469261",
"text": "def member?(arg0)\n end",
"title": ""
},
{
"docid": "95cb8dc3f678085894e9415fc59470e8",
"score": "0.54390633",
"text": "def test_change_member_status_member_make_member\n change_member_status_helper(rolf, katrina,\n :change_member_status_make_member,\n false, true, false, true)\n end",
"title": ""
},
{
"docid": "cd803d70a56a1c32f64b001da6b6cd60",
"score": "0.54080826",
"text": "def invoke_belongs_to_ownership_action(owner_item, *args)\n if !@ownership_actions[:belongs_to].nil?\n if !@ownership_actions[:belongs_to][:nil].nil? && @belongs_to.nil?\n lamb = eval @ownership_actions[:belongs_to][:nil]\n lamb.call(owner_item)\n return true\n end\n end\n\n false\n end",
"title": ""
},
{
"docid": "00493bd584f6b606d324ea4f652e1648",
"score": "0.53872305",
"text": "def test_change_member_status_member_make_member\n change_member_status_helper(@rolf, @katrina, :change_member_status_make_member, false, true, false, true)\n end",
"title": ""
},
{
"docid": "d9c3d5af3d01051dc2ee13285ef4d885",
"score": "0.5382888",
"text": "def find_by_membername\n member = Member.find_by_membername(@oauth_token, params[:membername], find_by_membername_fields).first\n error! :not_found unless member\n expose member\n end",
"title": ""
},
{
"docid": "436aed70cc22f4cf303876b5d2c64896",
"score": "0.5382035",
"text": "def member\n @member ||= if params[:id]\n Member.find(params[:id])\n else\n Member.new\n end\n end",
"title": ""
},
{
"docid": "328837ad89979c9741f722bc891246cf",
"score": "0.5376837",
"text": "def update_member\n @member_relation = @team.relation_for_owner(@member)\n\n @member_relation.admin = params[:admin].to_bool if params.has_key?(:admin)\n @member_relation.developer = params[:developer].to_bool if params.has_key?(:developer)\n @member_relation.public = params[:public].to_bool if params.has_key?(:public)\n\n # if 0, will remove the budget constraint, giving dev access to whole team funds. see relation#set_budget\n @member_relation.set_budget(params[:budget]) if params.has_key?(:budget)\n\n if @member_relation.valid?\n # if any of the permissions changed, trigger email to affected member and admins\n if @member_relation.admin_changed? || @member_relation.developer_changed? || @member_relation.public_changed?\n # send the member an email (unless you are the admin that made the change)\n @member_relation.person.send_email(:team_permissions_changed, admin: @person, team: @team, member_relation: @member_relation) unless @member_relation.person == @person\n\n # send the team admins an email (excluding yourself)\n @team.admins.each { |admin| admin.send_email(:team_member_permissions_changed, admin: @person, team: @team, member_relation: @member_relation) unless admin == @person }\n end\n\n @member_relation.save\n render \"api/v1/teams/partials/member\"\n else\n render json: { error: @member_relation.errors.full_messages.to_sentence }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "501b1d9d0c9f36306079ae3a37503d0e",
"score": "0.53747314",
"text": "def member\n @member ||= Rails.cache.fetch('trello:me') { trello.find(:member, :me) }\n end",
"title": ""
},
{
"docid": "c5cf5373b76461025e9721fd9d5cf72d",
"score": "0.53727734",
"text": "def get_member(id)\n is_admin? ? Member.find(id) : current_user\n end",
"title": ""
},
{
"docid": "e7f52d8cbd2d2f953d049a052bf8e596",
"score": "0.53461826",
"text": "def test_change_member_status_by_member_make_member\n change_member_status_helper(@katrina, @dick, :change_member_status_make_member, false, false, false, false)\n end",
"title": ""
},
{
"docid": "1b990496d43164afa67b8ed34b85e8d6",
"score": "0.5331044",
"text": "def test_change_member_status_by_member_make_member\n change_member_status_helper(katrina, dick,\n :change_member_status_make_member,\n false, false, false, false)\n end",
"title": ""
},
{
"docid": "e225762d0c01882f100d1ba6b62b734d",
"score": "0.5330156",
"text": "def call(member, ctx); end",
"title": ""
},
{
"docid": "25b55e812c703a7935ba6122f501ecfb",
"score": "0.5327353",
"text": "def check_if_in_acbl_honorary_members(name, has_alter_egos, alter_egos)\n # Does not check for alternative names\n check_if_has_award($acbl_honorary_members_winners, name)\nend",
"title": ""
},
{
"docid": "8eedd3fe37b22bd08a44b4e2425bbc8f",
"score": "0.5323737",
"text": "def permit_object?(member)\n end",
"title": ""
},
{
"docid": "f692c1b87a4b3a55510f141f02103d0d",
"score": "0.531953",
"text": "def set_member\n @member = Member.find(params[:id])\n @profile = @member.owner\n end",
"title": ""
},
{
"docid": "6a94eb95681b725398062b9cc94cd017",
"score": "0.53163713",
"text": "def person_is_member?(person)\n person && relation_for_owner(person).try(:member?)\n end",
"title": ""
},
{
"docid": "d77c56ef5cbe26b3604d2b1a38e77ece",
"score": "0.53099555",
"text": "def member?\n type == 'Member'\n end",
"title": ""
},
{
"docid": "1ded14df55df9e603cf8f8abdb104435",
"score": "0.52992725",
"text": "def member(user)\n can :read, Member, banned: false\n can :update, Member, id: user.id\n end",
"title": ""
},
{
"docid": "3ab0386c2cdd35584556d76c4f144856",
"score": "0.5294525",
"text": "def member(id, request = true)\n id = id.resolve_id\n return @members[id] if member_cached?(id)\n return nil unless request\n\n member = @bot.member(self, id)\n @members[id] = member unless member.nil?\n rescue StandardError\n nil\n end",
"title": ""
},
{
"docid": "3ab0386c2cdd35584556d76c4f144856",
"score": "0.5294525",
"text": "def member(id, request = true)\n id = id.resolve_id\n return @members[id] if member_cached?(id)\n return nil unless request\n\n member = @bot.member(self, id)\n @members[id] = member unless member.nil?\n rescue StandardError\n nil\n end",
"title": ""
},
{
"docid": "fb659b1525a87a14522dbd4caa5f63eb",
"score": "0.52870977",
"text": "def get_member_cud\n cud = if params[:member_id]\n @course.course_user_data.find(params[:member_id].to_i)\n elsif params[:member_email]\n @course.course_user_data.joins(:user).find_by(users: { email: params[:member_email] })\n end\n if !cud\n flash[:error] = \"The given student was not found in this course.\"\n return nil\n elsif @cud.id == cud.id\n flash[:error] = \"You can't create a group with just yourself.\"\n return nil\n end\n cud\n end",
"title": ""
},
{
"docid": "4007e33fab0fa72dcc0c83f0cd8bfa26",
"score": "0.5273764",
"text": "def permit_second?(member)\n end",
"title": ""
},
{
"docid": "1fecff95a0d450ab833c2a788bffe8bb",
"score": "0.5252578",
"text": "def find_member(name)\n member = find_member_from_url(name, 'http://ukparse.kforge.net/svn/parlparse/members/all-members.xml')\n if member.nil? \n member = find_member_from_url(name, 'http://ukparse.kforge.net/svn/parlparse/members/all-members-2010.xml')\n if member.nil? \n member = find_lord_from_url(name, 'http://ukparse.kforge.net/svn/parlparse/members/peers-ucl.xml')\n end\n end\n member\nend",
"title": ""
},
{
"docid": "1fecff95a0d450ab833c2a788bffe8bb",
"score": "0.5252578",
"text": "def find_member(name)\n member = find_member_from_url(name, 'http://ukparse.kforge.net/svn/parlparse/members/all-members.xml')\n if member.nil? \n member = find_member_from_url(name, 'http://ukparse.kforge.net/svn/parlparse/members/all-members-2010.xml')\n if member.nil? \n member = find_lord_from_url(name, 'http://ukparse.kforge.net/svn/parlparse/members/peers-ucl.xml')\n end\n end\n member\nend",
"title": ""
},
{
"docid": "217f184da84c2dcae16b0d9f173b7b1d",
"score": "0.5251989",
"text": "def party_bonus(param)\n bonus = 0\n for member in members\n bonus += member.actor_party_bonus(param)\n end\n bonus\n end",
"title": ""
},
{
"docid": "d3c1b388a4588425f80198b8e07d7d5b",
"score": "0.52460754",
"text": "def contribution_from(member)\n return cost_for_purchaser if member.id == purchaser_id\n contribution = contributions.detect { |x| x.user_id == member.id }\n contribution ? contribution.amount : 0.0\n end",
"title": ""
},
{
"docid": "9a78e8e8963add4cb82ad9300bf68e74",
"score": "0.52436554",
"text": "def contribution_from(member)\n return cost_for_purchaser if member.id == purchaser_id\n contribution = contributions.detect{|x| x.user_id == member.id}\n contribution ? contribution.amount : 0.0\n end",
"title": ""
},
{
"docid": "c46abae1ade2fa6730e36eab5ceffd65",
"score": "0.52393097",
"text": "def set_member\n @member = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "be9de84fb7c6324319113f76ee1e433b",
"score": "0.5237914",
"text": "def set_member\n @member = Member.includes([:member_histories]).find_by_vk_id(params[:id])\n end",
"title": ""
},
{
"docid": "9e32442a9b1b9791b7c96ac0815245e0",
"score": "0.52328324",
"text": "def set_member\n if params[:id].nil? and params[:member_id].nil?\n redirect_to members_url unless current_member\n @member = current_member\n else\n @member ||= Member.friendly.find(params[:id]) if params[:id]\n @member ||= Member.friendly.find(params[:member_id]) if params[:member_id]\n end\n end",
"title": ""
},
{
"docid": "e6ade17754e81f9ef7966cb95555e457",
"score": "0.52248466",
"text": "def test_change_member_status_admin_make_member\n change_member_status_helper(@mary, @mary, :change_member_status_make_member, true, true, false, true)\n end",
"title": ""
},
{
"docid": "1d8753c70c0f77b4443580977cb0b209",
"score": "0.52179605",
"text": "def org_member?(org, user, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "fc10362b5b300aba19f2d4f3863cc1f8",
"score": "0.52150303",
"text": "def allows_reward?\n self.person?\n end",
"title": ""
},
{
"docid": "0f4d22cfd528237246d5d17b7729099d",
"score": "0.52110565",
"text": "def set_member\n @member = Member.find(params[:id] || params[:member_id])\n end",
"title": ""
},
{
"docid": "7f890fa292105b7270f866a27c8bc91d",
"score": "0.52072597",
"text": "def has_member? user_or_person\n user_or_person = user_or_person.try(:person) if user_or_person.is_a?(User)\n self.people.include? user_or_person\n end",
"title": ""
},
{
"docid": "6ee67ff064e11f4593fb35dd07e3802f",
"score": "0.5205494",
"text": "def owner\n self.memberships.find(:first, :conditions => [\"owner = true\"]).user\n end",
"title": ""
},
{
"docid": "465b38f4637772bfb006dc707fdd8476",
"score": "0.5200489",
"text": "def suitable_member_of_node(node)\n config.logger&.debug(\n \"Starting to discover #{node.host}:#{node.port} node for candidates.\"\n )\n members = node_members(node)\n return unless members\n\n suitable_member = detect_suitable_member(members)\n return unless suitable_member\n\n config.logger&.debug(\n \"Found suitable member: #{suitable_member.host}:#{suitable_member.port} with \" \\\n \"role \\\"#{suitable_member.state}\\\".\"\n )\n suitable_member\n end",
"title": ""
},
{
"docid": "065d0ab5d5d8c1f54d8b6407172e892a",
"score": "0.51970905",
"text": "def member_association\n return self.associations.find_by_name(self.short_name + \"_member\")\n end",
"title": ""
},
{
"docid": "065d0ab5d5d8c1f54d8b6407172e892a",
"score": "0.51970905",
"text": "def member_association\n return self.associations.find_by_name(self.short_name + \"_member\")\n end",
"title": ""
},
{
"docid": "d0047608d479101da8e3525597f28d7e",
"score": "0.5184759",
"text": "def member?\n role == 'member'\n end",
"title": ""
},
{
"docid": "d5a763890ba0276a87b38a61cf0b5af6",
"score": "0.51781005",
"text": "def representative_member\n # memoize with a value that could be nil....\n return @representative_member if defined?(@representative_member)\n\n @representative_member = work.representative\n end",
"title": ""
},
{
"docid": "de3ee3677cd73a1c8b8baa534418b8e4",
"score": "0.51625794",
"text": "def smooth_target(index)\n member = members[index]\n return member if member != nil and member.exist?\n return existing_members[0]\n end",
"title": ""
},
{
"docid": "c6176eae98f7a53d2ccd69f2a6c33f61",
"score": "0.51581",
"text": "def set_member\n @member = Member.find params[:id]\n end",
"title": ""
},
{
"docid": "cecb87ee1e78f17ea43c6e229909a12a",
"score": "0.515393",
"text": "def lookup(arg)\n instance = lookup_without_default(arg)\n instance ||= build_default(arg)\n instance.value_serialized = property_serialized?(arg)\n\n if ActiveRecord::VERSION::STRING >= \"3.1.0\"\n owner = proxy_association.owner\n else\n owner = @owner\n end\n\n instance.send(\"#{owner_class_sym}=\", owner) if owner.new_record?\n instance\n end",
"title": ""
},
{
"docid": "2055e0e789c91024a7999fe745d05f4f",
"score": "0.51531434",
"text": "def declare_setup_payment_by_loan_deduction\n @office = current_user.active_job_attachment.office\n @group_loan_membership = GroupLoanMembership.find params[:group_loan_membership_id]\n # we need to check whether such group loan membership can be updated by current user\n # Field Worker Task assignment : assigning responsibility between field_worker and the group loan \n @group_loan_membership.declare_setup_payment_by_loan_deduction\n \n end",
"title": ""
},
{
"docid": "c203bfaa219f431c861bae6d6ee8c3e8",
"score": "0.5150762",
"text": "def party_bonus(param)\n members.inject(0) { |bonus, member| bonus + member.actor_party_bonus(param) }\n end",
"title": ""
},
{
"docid": "d6cc4fbcdd4a1d010bf667ac6c19bcbb",
"score": "0.5141326",
"text": "def member_of\n return @member_of\n end",
"title": ""
},
{
"docid": "d6cc4fbcdd4a1d010bf667ac6c19bcbb",
"score": "0.5141326",
"text": "def member_of\n return @member_of\n end",
"title": ""
},
{
"docid": "d6cc4fbcdd4a1d010bf667ac6c19bcbb",
"score": "0.5141326",
"text": "def member_of\n return @member_of\n end",
"title": ""
},
{
"docid": "d6cc4fbcdd4a1d010bf667ac6c19bcbb",
"score": "0.5141326",
"text": "def member_of\n return @member_of\n end",
"title": ""
},
{
"docid": "d6cc4fbcdd4a1d010bf667ac6c19bcbb",
"score": "0.5141326",
"text": "def member_of\n return @member_of\n end",
"title": ""
},
{
"docid": "e44089676c2789265b0dd512aa998374",
"score": "0.51398754",
"text": "def set_owner\n self.owner = member && member.pha\n if self.owner\n self.assignor = Member.robot\n self.assigned_at = Time.now\n end\n end",
"title": ""
},
{
"docid": "7bb8523b788fe407735c68e46c8f1a4d",
"score": "0.51342297",
"text": "def check_member?(member)\n check_member_in?(@leaderboard_name, member)\n end",
"title": ""
},
{
"docid": "d9f103cd985710f834f30874d5074172",
"score": "0.5130678",
"text": "def org_public_member?(org, user, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "0979fd575972902ea6baeede0935bab8",
"score": "0.5120921",
"text": "def member_params\n params[:member]\n end",
"title": ""
},
{
"docid": "df2eb523d2364400c4ac569dbd87cb39",
"score": "0.51207405",
"text": "def member_action?\n @member_action ||= properties.member_action?(action)\n end",
"title": ""
},
{
"docid": "1d98395e20884f1f0d8355e9853c0f4a",
"score": "0.51135606",
"text": "def getName\n @memberName\n end",
"title": ""
},
{
"docid": "6ab0b26b8bddfd5727449a18023ee9d8",
"score": "0.5112363",
"text": "def member_name\n self.member.name\n end",
"title": ""
},
{
"docid": "04c49a516b07995a55b283f0a8a60b2d",
"score": "0.5093671",
"text": "def addmember\n end",
"title": ""
},
{
"docid": "1721707ff9712df659e789317a3fb821",
"score": "0.5089592",
"text": "def is_member_or_admin\n if !admin?\n @member = Member.find_by({\n band_id: params[:song_request][:band_id],\n user_id: current_user.id\n })\n\n if @member.nil?\n flash[:danger] = \"This user is not a member of the band.\"\n redirect_to events_url\n end\n end\n end",
"title": ""
},
{
"docid": "a7204b590056c272f6937b08656bf1a4",
"score": "0.5088381",
"text": "def set_membership\n @member = Member.find(params[:id])\n end",
"title": ""
},
{
"docid": "79d08724c292612e4bfa42e25199a763",
"score": "0.50860333",
"text": "def select_target_member(obj = nil)\n unit = @target_member == :enemy ? opponents_unit : friends_unit\n if obj && obj.for_dead_friend? && @target_member == :friend\n [unit.smooth_dead_target(@target_index)]\n else\n [unit.smooth_target(@target_index)]\n end\n end",
"title": ""
},
{
"docid": "ddba356efbc50cb0fb3f3d4ba83af497",
"score": "0.5085447",
"text": "def set_member\n \tif @member && @member.activated\n \t\t@member = Member.find(params[:id])\n \tend\n end",
"title": ""
},
{
"docid": "8061583a7b556e56566988def31ae9c7",
"score": "0.5084522",
"text": "def member?\n role == 'member' ? true : false\n end",
"title": ""
},
{
"docid": "cdf107de8dd1bf0001032ee77a1624fa",
"score": "0.5084121",
"text": "def pbFindUser(choice,targets)\n move=choice[2]\n target=choice[3]\n user=self # Normally, the user is self\n # Targets in normal cases\n case pbTarget(move)\n when PBTargets::SingleNonUser\n if target>=0\n targetBattler=@battle.battlers[target]\n if !pbIsOpposing?(targetBattler.index)\n if !pbAddTarget(targets,targetBattler)\n pbAddTarget(targets,pbOpposing2) if !pbAddTarget(targets,pbOpposing1)\n end\n else\n pbAddTarget(targets,targetBattler.pbPartner) if !pbAddTarget(targets,targetBattler)\n end\n else\n pbRandomTarget(targets)\n end\n when PBTargets::SingleOpposing\n if target>=0\n targetBattler=@battle.battlers[target]\n if !pbIsOpposing?(targetBattler.index)\n if !pbAddTarget(targets,targetBattler)\n pbAddTarget(targets,pbOpposing2) if !pbAddTarget(targets,pbOpposing1)\n end\n else\n pbAddTarget(targets,targetBattler.pbPartner) if !pbAddTarget(targets,targetBattler)\n end\n else\n pbRandomTarget(targets)\n end\n when PBTargets::OppositeOpposing\n pbAddTarget(targets,pbOppositeOpposing) if !pbAddTarget(targets,pbOppositeOpposing2)\n when PBTargets::RandomOpposing\n pbRandomTarget(targets)\n when PBTargets::AllOpposing\n # Just pbOpposing1 because partner is determined late\n pbAddTarget(targets,pbOpposing2) if !pbAddTarget(targets,pbOpposing1)\n when PBTargets::AllNonUsers\n for i in 0...4 # not ordered by priority\n pbAddTarget(targets,@battle.battlers[i]) if i!=@index\n end\n when PBTargets::UserOrPartner\n if target>=0 # Pre-chosen target\n targetBattler=@battle.battlers[target]\n pbAddTarget(targets,targetBattler.pbPartner) if !pbAddTarget(targets,targetBattler)\n else\n pbAddTarget(targets,self)\n end\n when PBTargets::Partner\n pbAddTarget(targets,pbPartner)\n else\n move.pbAddTarget(targets,self)\n end\n return user\n end",
"title": ""
},
{
"docid": "cdf107de8dd1bf0001032ee77a1624fa",
"score": "0.5084121",
"text": "def pbFindUser(choice,targets)\n move=choice[2]\n target=choice[3]\n user=self # Normally, the user is self\n # Targets in normal cases\n case pbTarget(move)\n when PBTargets::SingleNonUser\n if target>=0\n targetBattler=@battle.battlers[target]\n if !pbIsOpposing?(targetBattler.index)\n if !pbAddTarget(targets,targetBattler)\n pbAddTarget(targets,pbOpposing2) if !pbAddTarget(targets,pbOpposing1)\n end\n else\n pbAddTarget(targets,targetBattler.pbPartner) if !pbAddTarget(targets,targetBattler)\n end\n else\n pbRandomTarget(targets)\n end\n when PBTargets::SingleOpposing\n if target>=0\n targetBattler=@battle.battlers[target]\n if !pbIsOpposing?(targetBattler.index)\n if !pbAddTarget(targets,targetBattler)\n pbAddTarget(targets,pbOpposing2) if !pbAddTarget(targets,pbOpposing1)\n end\n else\n pbAddTarget(targets,targetBattler.pbPartner) if !pbAddTarget(targets,targetBattler)\n end\n else\n pbRandomTarget(targets)\n end\n when PBTargets::OppositeOpposing\n pbAddTarget(targets,pbOppositeOpposing) if !pbAddTarget(targets,pbOppositeOpposing2)\n when PBTargets::RandomOpposing\n pbRandomTarget(targets)\n when PBTargets::AllOpposing\n # Just pbOpposing1 because partner is determined late\n pbAddTarget(targets,pbOpposing2) if !pbAddTarget(targets,pbOpposing1)\n when PBTargets::AllNonUsers\n for i in 0...4 # not ordered by priority\n pbAddTarget(targets,@battle.battlers[i]) if i!=@index\n end\n when PBTargets::UserOrPartner\n if target>=0 # Pre-chosen target\n targetBattler=@battle.battlers[target]\n pbAddTarget(targets,targetBattler.pbPartner) if !pbAddTarget(targets,targetBattler)\n else\n pbAddTarget(targets,self)\n end\n when PBTargets::Partner\n pbAddTarget(targets,pbPartner)\n else\n move.pbAddTarget(targets,self)\n end\n return user\n end",
"title": ""
},
{
"docid": "a2187c5ece822215f00fda7b54aaf204",
"score": "0.50831807",
"text": "def member(params)\n endnode(params.merge({type: :member}))\n end",
"title": ""
},
{
"docid": "66f1d74a3144013e8bf997f6ab7911eb",
"score": "0.5082339",
"text": "def test_change_member_status_non_member_make_member\n change_member_status_helper(@rolf, @dick, :change_member_status_make_member, false, false, false, true)\n end",
"title": ""
},
{
"docid": "475742ae61ed4e06dd63645fafc6e73a",
"score": "0.5069932",
"text": "def set_member\n @member = Member.find(params[:id])\n end",
"title": ""
},
{
"docid": "475742ae61ed4e06dd63645fafc6e73a",
"score": "0.5069932",
"text": "def set_member\n @member = Member.find(params[:id])\n end",
"title": ""
},
{
"docid": "475742ae61ed4e06dd63645fafc6e73a",
"score": "0.5069932",
"text": "def set_member\n @member = Member.find(params[:id])\n end",
"title": ""
},
{
"docid": "475742ae61ed4e06dd63645fafc6e73a",
"score": "0.5069932",
"text": "def set_member\n @member = Member.find(params[:id])\n end",
"title": ""
},
{
"docid": "475742ae61ed4e06dd63645fafc6e73a",
"score": "0.5069932",
"text": "def set_member\n @member = Member.find(params[:id])\n end",
"title": ""
},
{
"docid": "475742ae61ed4e06dd63645fafc6e73a",
"score": "0.5069932",
"text": "def set_member\n @member = Member.find(params[:id])\n end",
"title": ""
},
{
"docid": "475742ae61ed4e06dd63645fafc6e73a",
"score": "0.5069932",
"text": "def set_member\n @member = Member.find(params[:id])\n end",
"title": ""
},
{
"docid": "475742ae61ed4e06dd63645fafc6e73a",
"score": "0.5069932",
"text": "def set_member\n @member = Member.find(params[:id])\n end",
"title": ""
},
{
"docid": "475742ae61ed4e06dd63645fafc6e73a",
"score": "0.5069932",
"text": "def set_member\n @member = Member.find(params[:id])\n end",
"title": ""
},
{
"docid": "475742ae61ed4e06dd63645fafc6e73a",
"score": "0.5069932",
"text": "def set_member\n @member = Member.find(params[:id])\n end",
"title": ""
},
{
"docid": "475742ae61ed4e06dd63645fafc6e73a",
"score": "0.5069932",
"text": "def set_member\n @member = Member.find(params[:id])\n end",
"title": ""
},
{
"docid": "475742ae61ed4e06dd63645fafc6e73a",
"score": "0.5069932",
"text": "def set_member\n @member = Member.find(params[:id])\n end",
"title": ""
},
{
"docid": "475742ae61ed4e06dd63645fafc6e73a",
"score": "0.5069932",
"text": "def set_member\n @member = Member.find(params[:id])\n end",
"title": ""
},
{
"docid": "475742ae61ed4e06dd63645fafc6e73a",
"score": "0.5069932",
"text": "def set_member\n @member = Member.find(params[:id])\n end",
"title": ""
},
{
"docid": "475742ae61ed4e06dd63645fafc6e73a",
"score": "0.5069932",
"text": "def set_member\n @member = Member.find(params[:id])\n end",
"title": ""
},
{
"docid": "93d43c13b0702ac512a0241bb31cb068",
"score": "0.5065822",
"text": "def call(org, user, member)\n @org = org\n @user = user\n @member = member\n\n check_membership!\n check_request!\n create_request!\n end",
"title": ""
},
{
"docid": "c1b3c1043b828b84c74c6ecbf95609e9",
"score": "0.50592595",
"text": "def test_change_member_status_admin_make_member\n change_member_status_helper(mary, mary,\n :change_member_status_make_member,\n true, true, false, true)\n end",
"title": ""
},
{
"docid": "b87a85f2063073c9da32dc9c4b27ff98",
"score": "0.50558287",
"text": "def update_one_member(member, member_params, pers_params, contact_params, health_params, error_recs)\n update_and_check(member, member_params, error_recs)\n pers_rec = member.personnel_data || PersonnelData.new\n update_and_check(pers_rec, pers_params, error_recs)\n#puts \"**** pers_rec.attributes=#{pers_rec.attributes}\"\n contact_rec = member.primary_contact # || member.contacts.new\n unless contact_params.blank? && contact_rec.nil?\n contact_rec ||= member.contacts.new\n update_and_check(contact_rec, contact_params, error_recs) \n end\n health_rec = member.health_data\n update_and_check(health_rec, health_params, error_recs)\n return [member, pers_rec, contact_rec, health_rec]\n end",
"title": ""
},
{
"docid": "f563cfbc597cef496190bf9de1ae14e0",
"score": "0.50545216",
"text": "def current_member?\n current_membership.present?\n end",
"title": ""
}
] |
3067ec92dac5fc103dfe17e164c3aaa6
|
returns hello name, returns buddy if no name
|
[
{
"docid": "6639d4d2901627d0b7f3bd68ff5b47e4",
"score": "0.0",
"text": "def hello(name=\"buddy\")\n puts \"Hey #{name}!!\"\nend",
"title": ""
}
] |
[
{
"docid": "94918d63b147541f0803f0bcd3156de4",
"score": "0.7412608",
"text": "def hello(name)\n\tif name == \"John\"\n\t\t\"Hello #{name}!\"\n\telsif name == \"Kevin\"\n\t\t\"Hey there #{name}!\"\n\telse\n\t\t\"I don't know you!\"\n\tend\nend",
"title": ""
},
{
"docid": "c3012e19f8ee760a34f9aba5832d4043",
"score": "0.73702824",
"text": "def greeting(name)\n if name[-1] == '!'\n name.chop!\n return \"HELLO #{name.upcase}. WHY ARE WE SCREAMING?\"\n else\n return \"Hello #{name}.\"\n end\nend",
"title": ""
},
{
"docid": "9a589e2fb64228e995c7d47120bb620e",
"score": "0.7182078",
"text": "def hello(name)\n\ts = \"Hello, \" + name\n\treturn s\nend",
"title": ""
},
{
"docid": "9cca35936e2d59941e479e2e4c6e4b41",
"score": "0.7144414",
"text": "def say_hello\n return \"hello I am #{@name}\"\n end",
"title": ""
},
{
"docid": "6d4a5aada1c6f90d271eb9bc8c59519d",
"score": "0.699603",
"text": "def greeting_user(name)\n name.include?('!') ? puts(\"HELLO #{name.chop.upcase}. WHY ARE WE SCREAMING?\") : puts(\"Hello #{name.capitalize}\")\nend",
"title": ""
},
{
"docid": "2b40f9184d24d834c13137d66f6854c8",
"score": "0.6921822",
"text": "def say_hello\n \"Hello #{@name}\"\n end",
"title": ""
},
{
"docid": "ff75b3d01d6ab0fe556beedaa157a2ce",
"score": "0.6899804",
"text": "def greeter (name)\n return \"Hello #{name}\"\n end",
"title": ""
},
{
"docid": "7f4d544aa9454ec5dac8d03621fe929c",
"score": "0.68931115",
"text": "def hello(name)\n\t\"Hello, \" + name\nend",
"title": ""
},
{
"docid": "e9d1dfae3bd80b8cfd213c33b7c5540d",
"score": "0.6888826",
"text": "def say_hello(name)\n return \"Hello, \" + name\nend",
"title": ""
},
{
"docid": "197e2f392b182c859ccc575a451f3368",
"score": "0.68612283",
"text": "def greet (name)\n\treturn \"Hello, #{name}\"\nend",
"title": ""
},
{
"docid": "117882f2366dbd6f0c8cb7d7667842d6",
"score": "0.68606126",
"text": "def shout_name\n puts \"What is your name?\"\n name = gets.chomp\n\n message = \"Hello #{name}\"\n\n if name[-1] == '!'\n puts \"#{message} Why are we screaming?\".upcase\n else\n puts message + \".\"\n end\nend",
"title": ""
},
{
"docid": "b6c04b0a9a9c7c695a5026274f66be25",
"score": "0.6856712",
"text": "def hello(name)\n output = []\n output << \"from #{options[:from]}\" if options[:from]\n output << \"Hello #{name}\"\n output = output.join(\"\\n\")\n puts options[:yell] ? output.upcase : output\n puts \"> done saying hello\" if options[:verbose]\n end",
"title": ""
},
{
"docid": "857b77e989dc3f977836c72bd927dd25",
"score": "0.68457985",
"text": "def say_hello\n \"Quack! I'm a duck called #{ @name }\"\n end",
"title": ""
},
{
"docid": "8123f9be4a516a4477cfe473d37a8567",
"score": "0.6839507",
"text": "def say_hello_personal(name)\n\tputs \"Hello \" + name\nend",
"title": ""
},
{
"docid": "d5f0b43178cb0172069213a105c21d23",
"score": "0.68218535",
"text": "def say_hello(name)\n \"Hello, #{name}.\"\n end",
"title": ""
},
{
"docid": "674f837d4405f4c6db15727e74e8e5b6",
"score": "0.67942",
"text": "def get_name\n # The last sentence in a function is always returned so no need to mention return\n @name\n end",
"title": ""
},
{
"docid": "66913332308cb3e6545015c36f185e65",
"score": "0.6760889",
"text": "def hello (name)\n return \"Hello, \" + name\nend",
"title": ""
},
{
"docid": "be03c73b6a69553bcc4e7dc89c1c6fc0",
"score": "0.6743272",
"text": "def hello(name)\n return 'Hello, ' + name\nend",
"title": ""
},
{
"docid": "1a07e15110f8f6126e54ec3f3c4bf2c9",
"score": "0.673024",
"text": "def say_name\n puts \"#{name}\"\n end",
"title": ""
},
{
"docid": "8334c1f28a898f4d6ed7e8220578dd0e",
"score": "0.67288435",
"text": "def say_hi(name)\n return \"Bonjour #{name.capitalize}.\"\n # string\nend",
"title": ""
},
{
"docid": "ad53f3e6470b2706faf0db068d0318e3",
"score": "0.6721489",
"text": "def say_hello name\n return \"Hello, #{name}!\"\nend",
"title": ""
},
{
"docid": "9c48a7050c8137070985901d434e4329",
"score": "0.6696923",
"text": "def say_goodnight(name)\r\n \"Dobranoc #{ name.capitalize }\"\r\nend",
"title": ""
},
{
"docid": "0439bef5f5f2cc4a14346a9b537fffb5",
"score": "0.66860205",
"text": "def greet(name,owner)\n return \"Hello boss\" if name.eql? owner\n return \"Hello guest\" \nend",
"title": ""
},
{
"docid": "db84d9ff3063a4a70c31bb39d48a43b6",
"score": "0.6681907",
"text": "def goodbye(name)\n\tstr = \"Bye \" + name + \".\"\n return str\nend",
"title": ""
},
{
"docid": "3e60086a944b3e642168eea6116e14ae",
"score": "0.66783416",
"text": "def say_hello(name)\n \"Hello, \" + name\nend",
"title": ""
},
{
"docid": "1f295925045d014e7d40f1da5d4492e0",
"score": "0.6670104",
"text": "def sayHello(name)\n result = \"Hello, \" + name + \"!\"\n return result\nend",
"title": ""
},
{
"docid": "0ae29d660eda09cc7f2c8c9808e21f83",
"score": "0.66667634",
"text": "def say_name\n puts \"Bonsly!\"\n end",
"title": ""
},
{
"docid": "5c54acad164da0c1b4fde2e7a962bd28",
"score": "0.66664445",
"text": "def say_name\n p \"#{name}\"\n end",
"title": ""
},
{
"docid": "d5c3d8a4a4d4ef45db6f28152708b0c5",
"score": "0.66632915",
"text": "def say_goodnight(name)\n result = \"Good night, \" + name.capitalize\n return result\nend",
"title": ""
},
{
"docid": "1e457402394708e39fc4247f30b9be5d",
"score": "0.66629094",
"text": "def say_hello(name)\n var = \"Hello, \" + name\n return var\nend",
"title": ""
},
{
"docid": "1682712ff44c62cf5bea5315f525ca5f",
"score": "0.6655348",
"text": "def say_name\n puts \"Bellossom!\"\n end",
"title": ""
},
{
"docid": "fd84ad267c162666cb66bbb2d7ed8a26",
"score": "0.66546357",
"text": "def hello(name)\n # YOUR CODE HERE\n response = \"Hello, \".concat(name)\n \n return response\nend",
"title": ""
},
{
"docid": "fb9f2a38180e6921dcd286cb5b157a97",
"score": "0.6647842",
"text": "def say_hello(name)\n puts \"Hello, #{name}!\"\n end",
"title": ""
},
{
"docid": "18e5bdf6e31dca68114ad977b9b32a15",
"score": "0.6631171",
"text": "def excited_greet(name)\nend",
"title": ""
},
{
"docid": "c37f39c049950c17dadc072f51d373ed",
"score": "0.6629901",
"text": "def hello2 name2\n 'good day ' + name2\nend",
"title": ""
},
{
"docid": "217ab8fb4daeff86d0b16a4e87d7b049",
"score": "0.6624292",
"text": "def hello(name) \n\t\"hello #{name}\"\nend",
"title": ""
},
{
"docid": "f11b7dd6e3f48631ea30954a0fe2c5ed",
"score": "0.6623571",
"text": "def say_hello(name)\n return \"Hi, #{name}. Have a good day.\"\nend",
"title": ""
},
{
"docid": "4f1045ddfb9562416d161495879b4206",
"score": "0.66230893",
"text": "def sayHi\n\t\tputs \"hello, my name is #{@name}\"\n\tend",
"title": ""
},
{
"docid": "07b55cfc67a147fa024fa7fcc888087a",
"score": "0.6622447",
"text": "def sayhello(name, last_name='Rojas')#al hacer parametro=______ es un parametro por defecto, si no se especifica luego linea 6, me lo auto completa\n horoscope = 'capricornio'\n \"Hola #{name.capitalize} #{last_name.capitalize}. Pura Vida! #{horoscope}\" #notar que las interpolaciones estan separadas!!\nend",
"title": ""
},
{
"docid": "f9cb95008c6f57dd7cec8185ec98eba0",
"score": "0.6621003",
"text": "def hello(name)\n return \"Hello, \"+name\nend",
"title": ""
},
{
"docid": "82f89abaf831421a169257580e670987",
"score": "0.66123897",
"text": "def hello1(name)\n 'halo ' + name\nend",
"title": ""
},
{
"docid": "e66b55de5a8b4d4bff451b53e86375f5",
"score": "0.66064316",
"text": "def greeting \n\t\t\"Hi my name is #{@name}\"\n\tend",
"title": ""
},
{
"docid": "1f850d3966b7d98a58e1c82c5051ce36",
"score": "0.66050446",
"text": "def greets(name)\n puts \"hello #{name}, my name is #{@greeter_name}\"\n end",
"title": ""
},
{
"docid": "2eeb238411978637932f05b8f367e1ae",
"score": "0.65912306",
"text": "def greeting(name)\n puts \"Good day \"+name.capitalize\nend",
"title": ""
},
{
"docid": "a5d0192b4aaae0e8618b13e6165a1e4d",
"score": "0.65902585",
"text": "def greet(name)\n result = \"Good night #{name}\"\n return result\nend",
"title": ""
},
{
"docid": "38dc2bd8ca30fbe2ad965380f52695ca",
"score": "0.6576593",
"text": "def greeter(name)\n return \"hello \" + name + \" its nice to see you.\"\nend",
"title": ""
},
{
"docid": "57960bbefcf02a584c19eeefe3ae90da",
"score": "0.65687513",
"text": "def greetings(name)\n puts \"Hello #{name.capitalize}\"\nend",
"title": ""
},
{
"docid": "d49627ed4704089cb60add97be5d2622",
"score": "0.6565892",
"text": "def greet_child\n\t\t\"*yaaaawn* I'm up, I'm up. #{@name} is up. What's the matter?\"\n\tend",
"title": ""
},
{
"docid": "fc44e4fecb4a0288f8efae0e54da6bda",
"score": "0.6564887",
"text": "def greeting(name)\n \"Hello \" + name.capitalize + \"!\"\nend",
"title": ""
},
{
"docid": "2fa1860d88fdc1103f48f1c9777b0dfc",
"score": "0.6562756",
"text": "def hello (name)\n\tputs \"Hi \" + name\nend",
"title": ""
},
{
"docid": "48c301ea0c1efa41775f99ae0e03a43e",
"score": "0.656031",
"text": "def say_hello_to(name)\n puts \"Hello, #{name}. It's good to see you.\"\n puts \" \"\n end",
"title": ""
},
{
"docid": "3ba61bf5baa946c5bc080e3ebd33cb53",
"score": "0.65527534",
"text": "def say_hello name\n \"Hello, #{name}!\"\nend",
"title": ""
},
{
"docid": "92626b9552826a91d241dd3ab465aa55",
"score": "0.6548846",
"text": "def say_name\n p name\n end",
"title": ""
},
{
"docid": "70ae41b8696210ea36129dfec054d681",
"score": "0.65439945",
"text": "def welcome(greet, name, punct=\"!\")\n greet + ' ' + name + punct\nend",
"title": ""
},
{
"docid": "50f283db0ebadf3e4fbd586adf87fa6a",
"score": "0.6530219",
"text": "def hello(name)\n return \"Hello, \"+name\nend",
"title": ""
},
{
"docid": "4ff74b8f6ab74780c5e7ac1314bae3f4",
"score": "0.6529224",
"text": "def say_name\n puts \"The hero's name is #{@name}\"\n end",
"title": ""
},
{
"docid": "f4b195a02aca74b056d2f26e647cd257",
"score": "0.6529152",
"text": "def hello name\n \"Hello, \" + name\nend",
"title": ""
},
{
"docid": "f4b195a02aca74b056d2f26e647cd257",
"score": "0.6529152",
"text": "def hello name\n \"Hello, \" + name\nend",
"title": ""
},
{
"docid": "f4b195a02aca74b056d2f26e647cd257",
"score": "0.6529152",
"text": "def hello name\n \"Hello, \" + name\nend",
"title": ""
},
{
"docid": "f4b195a02aca74b056d2f26e647cd257",
"score": "0.6529152",
"text": "def hello name\n \"Hello, \" + name\nend",
"title": ""
},
{
"docid": "38a43c837065d83d95ca575e0077beab",
"score": "0.65168625",
"text": "def goodbye(name)\n say = \"Bye \" + name + \". \"\n return say\nend",
"title": ""
},
{
"docid": "7a0c8d1920b303e0273bb409523bdc8b",
"score": "0.6514609",
"text": "def hello(name)\n return \"Hello, \" + name.to_s\nend",
"title": ""
},
{
"docid": "7a0c8d1920b303e0273bb409523bdc8b",
"score": "0.6514609",
"text": "def hello(name)\n return \"Hello, \" + name.to_s\nend",
"title": ""
},
{
"docid": "c7058f02f615df9eb537bfb5270088a5",
"score": "0.65143657",
"text": "def greet\n\t\treturn \"I'm #{GOODMOOD}. How are you?\"\n\tend",
"title": ""
},
{
"docid": "2902237beaed3cf68feb69c809b4b5e9",
"score": "0.65110314",
"text": "def greeting(name)\n\tp \"hello\" + \" \" + name\nend",
"title": ""
},
{
"docid": "2902237beaed3cf68feb69c809b4b5e9",
"score": "0.65110314",
"text": "def greeting(name)\n\tp \"hello\" + \" \" + name\nend",
"title": ""
},
{
"docid": "e1722d0c19e839c9ff5885b95b46e612",
"score": "0.6505285",
"text": "def hello name\n # YOUR CODE HERE\n return \"Hello, #{name}\"\nend",
"title": ""
},
{
"docid": "628203dd052dd55b40107c0a71e137ee",
"score": "0.6504916",
"text": "def hello1 (name)\n 'Hello ' + name\nend",
"title": ""
},
{
"docid": "5e4037b8c150d2457a3f0195d60896d3",
"score": "0.6504214",
"text": "def greetings\n if @awake\n \"Hi, my name is #{full_name}\"\n else\n 'ZZZzzzZZZzzz'\n end\n end",
"title": ""
},
{
"docid": "91281203232c7b2a87b5229e703abb34",
"score": "0.650196",
"text": "def helloPerson(name)\n puts \"hello #{name.capitalize}!\"\nend",
"title": ""
},
{
"docid": "c4aef9a219aea20a62117e48bbd456cf",
"score": "0.65007436",
"text": "def say_hello(name, city, state)\n 'Hello, ' + name.join(' ') + \"#{name.length != 0 ? '! Welcome' : 'Welcome'}\" + ' to ' + city + ', ' + state + '!'\nend",
"title": ""
},
{
"docid": "905dae6f70019020b6c157b6fcb0f8b3",
"score": "0.6497167",
"text": "def name\n return @playing_girl ? @name_girl : @name_boy\n end",
"title": ""
},
{
"docid": "003aa23fbb375ba4437f5787df4e60e7",
"score": "0.6493299",
"text": "def yell_greeting(string)\n name = string\n name = name.downcase\n greeting = \"WASSAP, #{name}!\"\nend",
"title": ""
},
{
"docid": "1cf7c1d025079206fa5c111fad4a90d1",
"score": "0.6492154",
"text": "def say_hello(name)\n puts \"Good afternoon, #{name}. How are you?\"\nend",
"title": ""
},
{
"docid": "3ebc0a15b9ce78431a4b37de1adffdc5",
"score": "0.64919233",
"text": "def hello(name)\n hello = \"Hello, \" + name;\n return hello\nend",
"title": ""
},
{
"docid": "88ebe90235a3d3760473cf35beaad6ab",
"score": "0.64855504",
"text": "def hello1(name)\n 'Hello ' + name \nend",
"title": ""
},
{
"docid": "42da39ff1656433a527810b5c9b84f09",
"score": "0.6485103",
"text": "def say_hi(name)\n \"Hi\" + \" \" + name\n # the actual return will be nil\nend",
"title": ""
},
{
"docid": "77e02b30c79d6d8fc981ca1f37693a14",
"score": "0.64850736",
"text": "def greeting(name)\n puts \"Hi \" + name\n namet\nend",
"title": ""
},
{
"docid": "0268a21d9c9768894ed06e10adb205c7",
"score": "0.6479545",
"text": "def greeting(name)\n\t\tputs \" Hi there #{name}, how are you doing today?\"\n\tend",
"title": ""
},
{
"docid": "30c56a406467fb57af2624de60c7d6d1",
"score": "0.64771396",
"text": "def greeting(name)\n name = name.strip\n puts \"`Hello #{name}. It's nice to meet you.`\"\nend",
"title": ""
},
{
"docid": "0bd455b26986e3c2f71a7e64dd3623df",
"score": "0.64755315",
"text": "def say_hi(name)\n result = \"Hey Hi, #{name}\"\n return result\nend",
"title": ""
},
{
"docid": "9830c9c1f8af7eac14419581bb5ae9a1",
"score": "0.6472717",
"text": "def say_name\n puts \"Marill!\"\n end",
"title": ""
},
{
"docid": "40e6c86f22da19323c3f107939a7b26a",
"score": "0.64612925",
"text": "def hello1(name)\n 'Hello ' + name\nend",
"title": ""
},
{
"docid": "40e6c86f22da19323c3f107939a7b26a",
"score": "0.64612925",
"text": "def hello1(name)\n 'Hello ' + name\nend",
"title": ""
},
{
"docid": "0e709e45131d5b85b48a168a8deff7b4",
"score": "0.64586407",
"text": "def say_hello(name)\n \"Hi #{name}!\"\nend",
"title": ""
},
{
"docid": "5cf4571deb119d9bed06fe743126a471",
"score": "0.6457775",
"text": "def say_name\n \"My name is #{@name}\"\n end",
"title": ""
},
{
"docid": "67523bf5cd6b884944a1192d8c933caf",
"score": "0.644682",
"text": "def welcome(nick_name, name)\n puts \"Hello, my friends call me #{nick_name}, but I prefer #{name}.\"\nend",
"title": ""
},
{
"docid": "2a9742872179b9a8807ea1559fc8938a",
"score": "0.6435399",
"text": "def greeting(name)\n\t\"Hello, #{name}\"\nend",
"title": ""
},
{
"docid": "c5e3b2eca206c0ee97c46a8d724f37fd",
"score": "0.64342386",
"text": "def say_hello_world_to(first_name)\n\n # hello_world is a variable. But this time we are going to create a custom message\n # Notice what's going on in side the double quotation marks. We use the \"\" to\n # tell Ruby to create a string message using the contents of the 'first_name' variable.\n # In fact, the special sequence '#{first_name}' tells Ruby to stick the contents of\n # 'first_name' into the string\n hello_world_variable = \"Hello #{first_name}!\"\n\n # print it out just like last time\n puts hello_world_variable\n\n # return it to the calling code just like last time.\n return hello_world_variable\n end",
"title": ""
},
{
"docid": "7a935c9d141bbc9a6e52001bf4074093",
"score": "0.6429998",
"text": "def greeting_user\n print \"What is your name? \"\n name = gets.chomp\n puts name.include?('!') ? \"HELLO #{name.upcase}. WHY ARE WE SCREAMING?\" : \"Hello #{name.capitalize}\"\nend",
"title": ""
},
{
"docid": "c52ec9e43cc22a86f490fc375bdb12a2",
"score": "0.64290655",
"text": "def hello name = \"\", punctuation = \"!\"\n \"hello #{name.capitalize}#{punctuation}\"\nend",
"title": ""
},
{
"docid": "4ef757e214083ac9d656d78bcf2ed230",
"score": "0.6427018",
"text": "def greetings(name, info)\n full_name = name.join(' ')\n puts \"Hello, #{full_name}! Nice to have a #{info[:title]} #{info[:occupation]} around.\"\nend",
"title": ""
},
{
"docid": "0dd423de20711504eb4c0538d908aa70",
"score": "0.6422505",
"text": "def say_hello\n\t\"Ich bin #{@name} mit einem Wert von #{@health}.\"\n\tend",
"title": ""
},
{
"docid": "d925ae2a8cbbc8830d9fac2aa424ae0e",
"score": "0.6416565",
"text": "def hello(name)\n\tputs name\nend",
"title": ""
},
{
"docid": "cd2982f23929ba2845839a52aae35a2b",
"score": "0.641569",
"text": "def hello(name)\n \"Hello, \"\nend",
"title": ""
},
{
"docid": "35372fdb2b8715fb3f92716c2cde3d20",
"score": "0.64135474",
"text": "def say_hello\n\t'hello'\nend",
"title": ""
},
{
"docid": "48e212e81e9aec6e47b22c4f8f58acaf",
"score": "0.6406358",
"text": "def welcome(name) \n\n puts name\n\nend",
"title": ""
},
{
"docid": "ef449217184826bd018db9ad010fd455",
"score": "0.6405367",
"text": "def say_hello(name,health=0)\n\t\"Ich bin #{name} und mir geht es zu #{health}% gut.\"\nend",
"title": ""
},
{
"docid": "4b03ab1e4097934ba6ab2f9c1fed3701",
"score": "0.6404565",
"text": "def greet(name)\nend",
"title": ""
},
{
"docid": "234df496fcdf5875daacf755e3b785a4",
"score": "0.6400586",
"text": "def hello(name)\n\tputs \"Hello \" + name\nend",
"title": ""
},
{
"docid": "4e8b701028043b12f274b4abeb201fbe",
"score": "0.63918114",
"text": "def sayGoodnight(name)\n result = \"Goodnight, #{name}\" \n # return result\nend",
"title": ""
}
] |
b6ad3d00ab18a50cf64bf3c44d78bd27
|
POST /users POST /users.json
|
[
{
"docid": "33e09670273ab7fe7b55fa6ad6d87a5e",
"score": "0.0",
"text": "def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n session[:current_user_id] = @user.id\n current_user\n flash[:notice] = \"Your account, #{@user.username}, was successfully registered.\"\n format.html { redirect_to root_url }\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": "4794c3e6e2db462f4d8769453efddedd",
"score": "0.77179813",
"text": "def post_users(users)\n self.class.post('https://api.yesgraph.com/v0/users', {\n :body => users.to_json,\n :headers => @options,\n })\n end",
"title": ""
},
{
"docid": "a3973850c21e121410e2101480bdc023",
"score": "0.75206673",
"text": "def CreateUser params = {}\n \n APICall(path: 'users.json',method: 'POST',payload: params.to_json)\n \n end",
"title": ""
},
{
"docid": "df2e8c709ee6535536069a3bbb7542c2",
"score": "0.73831296",
"text": "def post body=nil, headers={}\n @connection.post \"users.json\", body, headers\n end",
"title": ""
},
{
"docid": "ec541d67d805569f6c34c6c1f90438b7",
"score": "0.72405374",
"text": "def create\n # render json: params\n render json: Users.create(params[\"user\"])\n end",
"title": ""
},
{
"docid": "ffecf21578b5c3a13103c9111e0c655a",
"score": "0.719841",
"text": "def create_user(params:)\n parse(JSON.parse(connection.post(\"users\", params.to_json).body))\n end",
"title": ""
},
{
"docid": "b20aed4d48187169fa74929ec230e502",
"score": "0.7140812",
"text": "def create\n user = User.create(user_params) \n render json: user, status: :created\n end",
"title": ""
},
{
"docid": "adc9a2ea2407d04277011b41f05681c1",
"score": "0.71038526",
"text": "def create\n user = User.new(user_params)\n if user.save\n render json: user\n else\n render json: {errors: \"Cannot create user\"}, :status => 420\n end\n end",
"title": ""
},
{
"docid": "1d4ed059e259909d177e4a88f47f05bc",
"score": "0.7058827",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e6c3f4b5dfdddf6d2938d06a2c2ed1d2",
"score": "0.7041636",
"text": "def create\n @user = User.new(form_params)\n\n respond_to do |format|\n if @user.save\n format.json { render json: { users: @user }, status: :created }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bb4bb304d6c1f5fb1d2155606a0ede20",
"score": "0.70236504",
"text": "def create\n user = User.new(\n username: user_params[:username],\n password: user_params[:password])\n if user.save\n create_example_collection(user)\n render json: user, except: [:password_digest, :created_at, :updated_at]\n else\n render json: {errors: user.errors.full_messages}\n end\n end",
"title": ""
},
{
"docid": "63351b8c6423c632317efadce5242ff5",
"score": "0.7003128",
"text": "def create\n user= User.create(user_params)\n render json: user\n end",
"title": ""
},
{
"docid": "3cdb8f63f18ee02e93e12fe2be0dfdd1",
"score": "0.70021695",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3cdb8f63f18ee02e93e12fe2be0dfdd1",
"score": "0.70021695",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3cdb8f63f18ee02e93e12fe2be0dfdd1",
"score": "0.70021695",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "458572ba5b3228f1a9e31c9bf7ca4ed7",
"score": "0.69936967",
"text": "def create\n\t\t@user = User.new(users_params)\n\t\tif @user.save\n\t\t\tjson_response(@user, \"User is created Successfully.\")\n\t\telse\n\t\t\trender json: {message: @user.errors.full_messages.join(\" \")}, status: 400\n\t\tend\t\t\n\tend",
"title": ""
},
{
"docid": "9cdd26e9719dafd64774bb6cd8be4609",
"score": "0.6990463",
"text": "def create\n user = User.new(@user_info)\n if user.save && user.errors.empty?\n render json: { status: 200, data: UserSerializer.new(user).as_json }\n else\n render json: { status: 400, error: user.errors.full_messages }\n end\n end",
"title": ""
},
{
"docid": "abc73540cee4069cdcabc57da4519ea6",
"score": "0.6980393",
"text": "def create\n user = User.create(user_params)\n if user.valid?\n render json: user\n else\n render json: user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ea3302f6f26c56009f783c29d121ba6f",
"score": "0.6979075",
"text": "def create(options = {})\n request(:post, '/users.json', default_params(options))\n end",
"title": ""
},
{
"docid": "74ca83c6619b11cc265649d9d4bd19b1",
"score": "0.69788617",
"text": "def create\n @user = User.new user_params(params[:user])\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "74ca83c6619b11cc265649d9d4bd19b1",
"score": "0.69788617",
"text": "def create\n @user = User.new user_params(params[:user])\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f2df0ce18f3efd63b4d45b7b93864f9b",
"score": "0.69762856",
"text": "def create\n @user = User.create user_params\n \n if @user.save\n respond_with(@user) do |format|\n format.json {render}\n end\n end\n end",
"title": ""
},
{
"docid": "ce4cbb9a06388a914a244f9f64bc10e9",
"score": "0.6962628",
"text": "def create\n @user = User.new(user_params(params))\n \n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "aee5c4617d74886d48e08bf9733d0088",
"score": "0.6952247",
"text": "def create\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n format.json { render json: @user }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "934f8be5dc99fe2849989c7bbe1c4de1",
"score": "0.69454783",
"text": "def create\n @user = User.new(user_params(params))\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "934f8be5dc99fe2849989c7bbe1c4de1",
"score": "0.69454783",
"text": "def create\n @user = User.new(user_params(params))\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "639288887bf3892c58109d551459e3a8",
"score": "0.6920555",
"text": "def create_user\n @user = User.new(user_params)\n if @user.save\n render json: UserSerializer.new(@user).serialized_json\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "2a9b844ca7053d2d98a8a1eaf316da4e",
"score": "0.69181055",
"text": "def create\n @user = @application.users.create(user_params)\n\n if @user.valid?\n render json: @user, status: :created, location: api_application_user_path(@application,@user)\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c943bb7d127a4fdba104793df7bbcc10",
"score": "0.691467",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c99998ee46982df30e1355147e9b4d70",
"score": "0.6901315",
"text": "def create\n user = User.create(user_params)\n if user.save\n render json: user\n else\n render json: user.errors, status: :bad\n end\n end",
"title": ""
},
{
"docid": "2f464794c767eddf19adb179921e43e9",
"score": "0.6898759",
"text": "def create\n r = @api.create_user(user_params)\n respond_to do |format|\n if r.code == 201\n format.html { redirect_to users_url, notice: 'User was successfully created.' }\n else\n response = JSON.parse(r.body)\n format.html { redirect_to users_url, alert: response['message']}\n end\n end\n end",
"title": ""
},
{
"docid": "37304437788b2ddbd531bd370575b223",
"score": "0.689459",
"text": "def create\n\n puts '-----------------------create in user controller'\n\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n\n end",
"title": ""
},
{
"docid": "487d3fda7cf57db135b452fd320908b1",
"score": "0.6889815",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: UserSerializer.new(@user).serialized_json\n else\n render json: { error: I18n.t('user_create_error') }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "74dff1f77383bab88c3a8067db711ca1",
"score": "0.6880676",
"text": "def create\n @user = User.new(user_params)\n if @user.save\n render json: { user: @user, success: 'User registration successful' }\n else\n render json: { error: 'User registration unsuccessful' }\n end\n end",
"title": ""
},
{
"docid": "6518892213cf8120677992ed69facb3b",
"score": "0.6880467",
"text": "def create\n @user = User.new(user_params)\n \n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "7f26323da56546d73f0f5b024f02121e",
"score": "0.6880196",
"text": "def create\n\t\tputs user_params\n\t\tuser = User.new(user_params)\n\t\tif user.save\n\t\t\trender json: { user: user, status: :success }\n\t\telse\n\t\t\trender json: { status: :failure, errors: user.errors.full_messages.join('') }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "1a351aca67520350a46b9719486b46bb",
"score": "0.68797004",
"text": "def create\n\t\t@user = User.new(user_params)\n\t\tif @user.save\n\t\t\trender json: @user, status: :created, location: @user\n\t\telse\n\t\t\trender json: @user.errors, status: :unprocessable_entity\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2e53f36b34c006809140f446fa991f81",
"score": "0.6877297",
"text": "def add_user(name, value)\n self.class.post(\"/users/#{name}\",\n body: value,\n headers: {\n 'Content-Type' => 'application/json; charset=UTF-8',\n Connection: 'keep-alive',\n Accept: 'application/json, text/plain, */*'\n })\n end",
"title": ""
},
{
"docid": "4fd438cf40080fac18651d012c0e6bb9",
"score": "0.686924",
"text": "def create\n user = User.new(user_params)\n\n respond_to do |format|\n if user.save\n render json: user, status: :ok\n else\n format.json { render json: user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3153a24d7c891a2bebe3f78b1906deb9",
"score": "0.6855058",
"text": "def create\n @user = current_user.users.build(user_params)\n\n if @user.save\n render json: @user\n else\n @user_items = []\n end\n end",
"title": ""
},
{
"docid": "501afdaed83731e0843777bc654d28b3",
"score": "0.6851115",
"text": "def create\n user = User.new(user_params)\n render json: { status: 200, msg: 'User was created.', data: \"User Id #{user.id}\" } if user.save\n end",
"title": ""
},
{
"docid": "2ff0b0328b0eb78d824d77e120981381",
"score": "0.6844058",
"text": "def create\n @users = User.new(params[:user])\n\n respond_to do |format|\n if @users.save\n format.html { redirect_to @users, notice: 'Regist was successfully created.' }\n format.json { render json: @users, status: :created, location: @users }\n else\n format.html { render action: \"new\" }\n format.json { render json: @users.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f2f275ccb8dd020abe1d25d3701e3ade",
"score": "0.6814104",
"text": "def create\n user = User.new(user_params)\n if user.save\n render :json => user, :status => :created\n else\n render :json => {:ok => false, :message => user.errors}, :status => :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3a920960c4131f0c3382f4cceff7dc44",
"score": "0.6803589",
"text": "def create\n logger.debug user_params\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :ok\n else\n render json: @user.errors, status: :not_acceptable\n end\n end",
"title": ""
},
{
"docid": "9f2be9f2ff6c15672dbabf749238ca25",
"score": "0.6777842",
"text": "def create\n user = User.create(user_params)\n render json: user, message: 'user succefully create', status: 200\n end",
"title": ""
},
{
"docid": "a88ef42ac3370d3f8778fd3415940ef5",
"score": "0.6776859",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5d237aae72614c5979b7390f04a5ddca",
"score": "0.67678535",
"text": "def create\n\n up = user_params\n\n if up[:name].present?\n up[:first_name] = up[:name].split(' ')[0]\n up[:last_name] = up[:name].split(' ')[1]\n up.delete :name\n end\n @user = User.new(up)\n\n respond_to do |format|\n if @user.save\n # render json: {user: user, token: token}\n\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: api_user_url(@user)}\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e4418e88bea01fe00f71828b92da5196",
"score": "0.6757897",
"text": "def create\n user = User.new(user_params)\n if user.save\n render json: {status: \"Se creo el usuario\"}, status: :ok\n else\n render json: {status: \"Error al crear el usuario\", errors: user.errors }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "94e64f1e1f6ee31885277cb4a0c2b793",
"score": "0.67471397",
"text": "def create\n user = User.new(params[:user].permit(:username))\n if user.save\n render json: user\n else\n render json: user.errors.full_messages, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "6afcb7f0df24e03ec20ed5f0462259ed",
"score": "0.6738628",
"text": "def create\n puts '>>> params:'\n puts params.inspect\n @user = User.new(params[:user])\n puts '>>> User:'\n puts @user.inspect\n\n if @user.save\n render json: @user, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ac3806c10b5ae30a98565af56822945b",
"score": "0.6734963",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n \tdata = { data: @user, status: :created, message: \"User was successfully created.\" }\n render :json => data\n else\n \tdata = { data: @user.errors, status: :unprocessable_entity }\n render :json => data\n end\n end",
"title": ""
},
{
"docid": "0a225011a490220a609b806b867ff234",
"score": "0.6733872",
"text": "def create\n user_details = params.permit(:first_name, :last_name, :email)\n success = User.create(user_details)\n\n render json: { success: success }\n end",
"title": ""
},
{
"docid": "dfddf87be5fe5a07e31e7a2b8c938d72",
"score": "0.6720612",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: @user.as_json(only: [:email, :authentication_token]), status: :created\n else\n head(:unprocessable_entity)\n end\n end",
"title": ""
},
{
"docid": "9001a1e7cf8986de1cac261f343d1d34",
"score": "0.6711659",
"text": "def create_user\n params = {\n :client_id => Swiftype.platform_client_id,\n :client_secret => Swiftype.platform_client_secret\n }\n post(\"users.json\", params)\n end",
"title": ""
},
{
"docid": "d0d5c89f778a392bb5d4ccebdf37b43e",
"score": "0.6670256",
"text": "def create\n @user = User.new(params[:user])\n\n if @user.save\n respond_to do |format|\n format.json { render :json => @user.to_json, :status => 200 }\n format.xml { head :ok }\n format.html { redirect_to :action => :index }\n end\n else\n respond_to do |format|\n format.json { render :text => \"Could not create user\", :status => :unprocessable_entity } # placeholder\n format.xml { head :ok }\n format.html { render :action => :new, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b9da5c0f98661e20bba329269b4053fe",
"score": "0.66581875",
"text": "def create\n @user = User.new(user_params)\n if @user.save\n render :ok, json: @user.to_json\n else\n @errors = @user.errors.full_messages\n render json: { message: @errors }, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "eab926e079d71100cb35e6cd857b5288",
"score": "0.66573423",
"text": "def create\n puts params\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render json: @user.as_json(user: current_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": "740ce8be835dc3171f04b9289fd8b472",
"score": "0.6654514",
"text": "def create\n user = User.new(user_params)\n if user.save\n render json: {status: 200, msg: 'User was created.'}\n else\n render json: {errors: user.errors.messages}\n end\n end",
"title": ""
},
{
"docid": "a2fc03fbf933602734ac40abadeaf419",
"score": "0.6638977",
"text": "def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to users_url, :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": "1d63883ba2ddec3f4db85fd133ea8839",
"score": "0.66325235",
"text": "def create\n @user = User.new({name: params[:name], email: params[:email], password: params[:password], photo: params[:photo]})\n @user.save\n render json:@user\n end",
"title": ""
},
{
"docid": "888f5b33308d3164e21eedc749f789e2",
"score": "0.66199607",
"text": "def create\n user = User.create(user_params)\n\n if user.valid?\n render json: {user: UserSerializer.new(user), token: encode_token(user.id)}\n else\n render json: user.errors.full_messages\n end\n end",
"title": ""
},
{
"docid": "1e34386d2888c5db32a9036824311cb6",
"score": "0.6615226",
"text": "def create\n\t\tnew_user = User.new(user_params)\n\t\tif new_user.save\n\t\t render status: 200, json: {\n\t\t \tstatus: 200,\n\t\t message:\"New User Created\",\n\t\t response: {\n\t\t name: new_user.name,\n\t\t email: new_user.email,\n\t\t id: new_user.id,\n\t\t facebook_id: new_user.facebook_id,\n\t\t device_id: new_user.device_id,\n\t\t authentication_token: new_user.authentication_token\n\t\t }\n\t\t \n\t\t }.to_json\n\t\telse\n\t\t render status: 404, json: {\n\t\t \tstatus: 404,\n\t\t errors: new_user.errors\n\t\t }.to_json\n\t\tend\n\tend",
"title": ""
},
{
"docid": "28b5de06154b68bd75648c3a35e90423",
"score": "0.66148156",
"text": "def create\n\t\tresp = {} \n user = User.create(user_params)\n \tif user.valid?\n if user.save\n return render :json => user.as_json\n end\n end\n render json: user.errors.full_messages \n\tend",
"title": ""
},
{
"docid": "23bcc3edea24c244ce6b5c16d3ece605",
"score": "0.65989614",
"text": "def post_users_with_http_info(users, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UsersApi.post_users ...'\n end\n # verify the required parameter 'users' is set\n if @api_client.config.client_side_validation && users.nil?\n fail ArgumentError, \"Missing the required parameter 'users' when calling UsersApi.post_users\"\n end\n # resource path\n local_var_path = '/users'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(users) \n\n # return_type\n return_type = opts[:return_type] || 'User' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Bearer']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersApi#post_users\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "99475e3c4ae3f8e979e49bc56be14a31",
"score": "0.65910506",
"text": "def create_user(options = {})\n post \"/users\", options\n end",
"title": ""
},
{
"docid": "3db27da564d67a83c436481afc185399",
"score": "0.65792614",
"text": "def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to users_url, 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": "3db27da564d67a83c436481afc185399",
"score": "0.6578957",
"text": "def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to users_url, 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": "9dceaa63916c005f320d1cd484d43ede",
"score": "0.6573529",
"text": "def create\n \n user = User.new(user_params)\n\n if user.save\n\n render json: {status: 200, msg: 'User was created.'}\n\n else \n render json: {\n errors: user.errors.full_messages\n }, status: :unprocessable_entity\n\n end\n\n end",
"title": ""
},
{
"docid": "ba066d8825913f25e5b9a280d7e8e4a9",
"score": "0.6573351",
"text": "def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save \n format.html { redirect_to users_url, notice: \"User #{@user.name} 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": "83b051fa40b82e70e621af0d23c79b31",
"score": "0.6557221",
"text": "def create_user(body)\n post 'create_user', body\n end",
"title": ""
},
{
"docid": "e70fb64f3558b4f9b37895642630f5c7",
"score": "0.6553408",
"text": "def create\n @user = User.new(user_params)\n @user.email = params[:email].downcase\n if @user.save\n render json: @user, status: 200\n else\n render json: { errors: @user.errors.full_messages }, status: 400\n end\n end",
"title": ""
},
{
"docid": "6d9f89da2dccad303920832ba8cc580c",
"score": "0.6551572",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json:@user\n elsif @user.errors\n render json: {error: {code: 400, server_message: @user.errors}}, status: :bad_request\n else\n render json: {error: {code: 500, message: \"Could not save user\", server_message: @user.errors}}, status: :internal_server_error\n end\n\n end",
"title": ""
},
{
"docid": "5815d7ced924ed82e8c5d9f240c59ed6",
"score": "0.65466446",
"text": "def create\n user = User.new(user_params)\n\n if user.valid?\n user.save\n render json: {user: user, token: encode_token({user_id: user.id})}\n else\n render json: {error: \"Failed to create the user\"}\n end\n end",
"title": ""
},
{
"docid": "a3816ed62dbfd4083cc5a3feb91b1652",
"score": "0.6540912",
"text": "def create\n @user = User.new(user_params)\n @user.save\n respond_with @user\n end",
"title": ""
},
{
"docid": "24fb6e4c84d02aa82ce257c090837b3a",
"score": "0.65399504",
"text": "def create\n @user = User.new(user_params)\n render json: @user && return if @user.save\n\n render json: { error: \"Unable to save user: #{@user.errors.messages}\" }, status: 400\n end",
"title": ""
},
{
"docid": "f62a779a9c9b1d8987da6beadf0a24a6",
"score": "0.6538697",
"text": "def create\n params[:user][\"_id\"] = params[:user][:name]\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save()\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": "b6aeb17c9f32dd8dd9a26bd3750d1f4c",
"score": "0.6535891",
"text": "def create_user(attributes)\n post(\"/v1/users\", attributes)\n end",
"title": ""
},
{
"docid": "9666fde3802ee78624fde8e89457029a",
"score": "0.6533581",
"text": "def create\n user = User.new(user_params)\n\n # if user is saved sucessfully it will return user and ith status 201 for created\n if user.save\n render json:user,status: :created\n #if request is properly served but data is wrong it ll give ubprocessable_entity with code 422\n else\n render json: user.errors, status: :unprocessable_entity\n end \n end",
"title": ""
},
{
"docid": "f72c89ce4b5b6640b4c3c4557479ba22",
"score": "0.6526114",
"text": "def create\r\n @user = User.new(params[:user])\r\n\r\n respond_to do |format|\r\n if @user.save\r\n format.html { redirect_to users_path, notice: 'Os dados do usuário foram salvos com sucesso!' }\r\n format.json { render json: @user, status: :created, location: @user }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @user.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "a3b5192b23375eb1fb732d690b7b2b12",
"score": "0.65116656",
"text": "def create\n @user = User.new(\n first_name: params[:first_name],\n last_name: params[:last_name],\n birth_date: params[:birth_date],\n height: params[:height],\n weight: params[:weight],\n user_name: params[:user_name],\n password: params[:password],\n password_confirmation: params[:password_confirmation],\n facebook_url: params[:facebook_url],\n twitter_url: params[:twitter_url],\n instagram_url: params[:instagram_url],\n address: params[:address],\n email: params[:email]\n ) \n if @user.save!\n render 'successful.json.jb', status: :created\n else\n render 'unsuccessful.json.jb', status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "1c932b566541d472e988a2f9a0ee3b74",
"score": "0.65072525",
"text": "def post(hash)\n HttpClient::Preconditions.assert_class('hash', hash, Hash)\n @client.request(\"/users\").with_json(hash.to_json).post { |hash| Apidoc::Models::User.new(hash) }\n end",
"title": ""
},
{
"docid": "2282e9318c6af5a7f200817cc7aecf9c",
"score": "0.6507116",
"text": "def create\n user = User.create!(user_params)\n session[:user_id] = user.id\n render json: user, status: :created\n end",
"title": ""
},
{
"docid": "c34cc1925120836c22b98923c68c70de",
"score": "0.6503024",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render json: {message: \"user create successfuly\"}\n else\n render json: {message: \"Error\"}\n end \n end",
"title": ""
},
{
"docid": "dfb9f8593b6740636ff2a59cd290d80c",
"score": "0.6490388",
"text": "def create\n # Insert new user in database\n user = User.new(user_params)\n\n if user.save\n # On success, send token information to authenticate user\n token = create_token(user.id, user.username)\n render json: {status: 200, token: token, user: user}\n # render json: @user, status: :created, location: @user\n else\n render json: user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "08de39c202ef86af25f6f5139b37aa27",
"score": "0.6488653",
"text": "def create\n @user = User.new(params[:user])\n @user.status = 'active'\n\n respond_to do |format|\n if @user.save\n format.json { render :json => @user, :status => :created }\n format.html { redirect_to(users_path) }\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": "0b19a474e195b3b035753c1dbcb901e6",
"score": "0.64881754",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n respond_with(@user, location: users_url, notice: 'User was successfully created.')\n else\n respond_with(@user)\n end\n end",
"title": ""
},
{
"docid": "2bf6a6f1a1320e51be20e4a5975ff2dc",
"score": "0.6473845",
"text": "def create\n user = User.new(user_params)\n \n if user.save\n token = JsonWebToken.encode(user_id: user.id)\n render json: { auth_token: token, user: AuthUserSerializer.new(user).serializable_hash }, status: 201\n else \n render json: { errors: user.errors.full_messages }, status: 400\n end\n end",
"title": ""
},
{
"docid": "3db6903757bb1668e67b3b581934f26d",
"score": "0.64722794",
"text": "def create\n @user = User.new(params[:user])\n puts params[:user]\n respond_to do |format|\n if @user.save\n format.html { redirect_to :users, notice: 'Registration successful.' }\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": "1b9a6263330b76c718426a3a2f1f5eea",
"score": "0.64702916",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render :show, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "1b9a6263330b76c718426a3a2f1f5eea",
"score": "0.64702916",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render :show, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e5e3793e1e78b601c62228a4f9c7fa0c",
"score": "0.6469406",
"text": "def create\n user = User.create(user_params)\n if user.valid?\n user.username.downcase\n @token = issue_token(user)\n list = List.create(name: user.username)\n list.user_id = user.id\n user.save\n list.save\n render json: { user: UserSerializer.new(user), jwt: @token }, status: :created \n else \n render json: { error: user.errors.full_messages }, status: :not_acceptable\n end \n end",
"title": ""
},
{
"docid": "7eff784fb6aa29fc8a4f2154897718de",
"score": "0.64682525",
"text": "def create\n @user = User.new(user_params)\n respond_to do |format|\n if @user.save\n format.html { redirect_to users_path, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "227cd05152f12800e7170502e40963f1",
"score": "0.6462379",
"text": "def create\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to users_path, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6d9aea5a218a029e9a5393b99ab08c6a",
"score": "0.64619774",
"text": "def create\n user_response = API::V1::Users.authenticate params.as_json\n if user_response.success?\n json = HashWithIndifferentAccess.new(user_response.parsed_response)\n auth_response = API::V1::Auth.issue json[:data]\n respond_with auth_response.body, auth_response.code\n else\n respond_with nil, :unauthorized\n end\n end",
"title": ""
},
{
"docid": "e98ce1e8f08541d80670603a97a2888b",
"score": "0.646129",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n render :json => { :status => 0 }\n else\n render :json => { :status => 1, :msg => @user.errors}\n end\n end",
"title": ""
},
{
"docid": "73b9fd4f91d7329397099d05c212dfed",
"score": "0.6455196",
"text": "def create\n @user = User.new(user_params)\n if @user.save\n auth_token = Knock::AuthToken.new payload: { sub: @user.id }\n render json: { username: @user.username, jwt: auth_token.token }, status: :created\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "89b8bd04a01ee69ed97666c487cb8de6",
"score": "0.645272",
"text": "def create\n authorize :user, :create?\n @user = User.new(user_params)\n @user.save\n\n respond_to do |format|\n format.html\n format.json { render :json => @user, status: 200 }\n end\n end",
"title": ""
},
{
"docid": "537f9e258a43e3d1eb8a90185aa4861e",
"score": "0.6448271",
"text": "def post_accounts(json_hash)\n @options = {:path => '/users.json',\n :body => json_hash[:json]}.merge(@options)\n\n request(\n :expects => 201,\n :method => :post,\n :body => @options[:body]\n )\n end",
"title": ""
},
{
"docid": "d111133b8d1e2b496eed55882405bc6e",
"score": "0.6447503",
"text": "def create\n user = User.new(username: params[:username])\n if user.save\n payload = {'user_id': user.id}\n token = JWT.encode(payload, 'chatapp')\n render json: {\n user: user,\n token: token\n }\n else \n render json: { message: 'There was an error creating your account' }\n end\n end",
"title": ""
},
{
"docid": "f1d9077c7bf4d2f25d0b3b0bddc2d811",
"score": "0.64468706",
"text": "def create\n user = User.create!(user_params)\n if user\n session[:user_id] = user.id\n render json: user, status: :created\n else\n render json: { errors: user.errors.full_messages }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "b0e714314a8f01aa4a2ec2cc387b9838",
"score": "0.64460355",
"text": "def create\r\n @user = User.new user_params\r\n\r\n if @user.save\r\n render json: @user, serializer: SessionSerializer, root: nil\r\n else\r\n render json: { errors: @user.errors }, status: :unprocessable_entity\r\n end\r\n end",
"title": ""
},
{
"docid": "df05d541a324f15636bdc52510bfbb90",
"score": "0.6441883",
"text": "def create\n user = User.new(user_params)\n if user.save\n render json: { status: 'OK', msg: 'User was created.', error: 'nil' },\n status: :created\n else\n not_good(422)\n end\n end",
"title": ""
}
] |
ca97d62c4aa4fc0ab9ec221fed847f1e
|
DELETE /bwimages/1 DELETE /bwimages/1.json
|
[
{
"docid": "3dd3ed8ecb9b13cc9496ec074b8bff5b",
"score": "0.7743777",
"text": "def destroy\n @bwimage = Bwimage.find(params[:id])\n @bwimage.destroy\n\n respond_to do |format|\n format.html { redirect_to bwimages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "b7d5eb1a724375152577a8c7a7fc793e",
"score": "0.72465926",
"text": "def destroy\n @bgimage = Bgimage.find(params[:id])\n @bgimage.destroy\n\n respond_to do |format|\n format.html { redirect_to bgimages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c633ff709dfe7d2649e862dd5d216412",
"score": "0.7195508",
"text": "def destroy\n @banner_img = BannerImg.find(params[:id])\n @banner_img.destroy\n\n respond_to do |format|\n format.html { redirect_to banner_imgs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cacd7d6670ca40c66a97af8bd1bf447b",
"score": "0.71069294",
"text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n render json: {status: \"success\"}, status: :ok\n end",
"title": ""
},
{
"docid": "c67e9be583588e7cba02427d81a65691",
"score": "0.709726",
"text": "def destroy\n @image.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "482bf80dbb9324958e0fa95c4c2c73ca",
"score": "0.70469797",
"text": "def destroy\n @image = Image.find(params[:id])\n \n imagen = @image.filename\n \n #function in manage_images.rb\n remove_image_file(imagen)\n \n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bc325e90a8ac66cc3d4a52523c6cde18",
"score": "0.70110005",
"text": "def destroy\n @sample_photo.destroy\n render json: {message: 'Foto Excluida'} , status: :ok\n end",
"title": ""
},
{
"docid": "99682da49eee08a9c7293e3b30bc1e00",
"score": "0.6951192",
"text": "def delete\n item = FormImage.last\n id = item[:id]\n item.destroy\n render json: {id: id}\n end",
"title": ""
},
{
"docid": "99f2e5687d7301aba5c497b5e9f142e6",
"score": "0.6937054",
"text": "def destroy\n #Finds selected image\n @image = Image.find(params[:id])\n #destroy image\n @image.destroy\n respond_to do |format|\n format.html { redirect_to '/admin' }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f62b39aab65d7df4d314f29eb6c9dd7c",
"score": "0.69019943",
"text": "def destroy\n @photo = Photo.find(params[:id])\n\n # Destroy s3 objects\n aws_s3_delete(@photo.key)\n Sebitmin::Application.config.thumbnail_sizes.each do |thumbnail_size|\n aws_s3_delete(@photo[\"thumbnail_key_#{thumbnail_size}\"])\n end\n\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "37641fc30808ea516e5de7a8e37f2175",
"score": "0.68898666",
"text": "def destroy\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "00be74ac5c18a672e4a000093dc7f422",
"score": "0.6885048",
"text": "def destroy\n @photo = Photo.find(params[:id])\n File.delete(Rails.root.join(\"app\",'assets','images',@photo.path))\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "58656bfa95c00bb803cc3ab59facffc0",
"score": "0.68837935",
"text": "def delete_image(id)\n uri = URI.parse(\"http://\" + @location.host + \":\" + @location.port.to_s + \"/v2/images/\" + id)\n return delete_request(uri, @token)\n end",
"title": ""
},
{
"docid": "31c52365d3d92f8c151f782f887bc8d7",
"score": "0.68683714",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "31c52365d3d92f8c151f782f887bc8d7",
"score": "0.68683714",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "31c52365d3d92f8c151f782f887bc8d7",
"score": "0.68683714",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "31c52365d3d92f8c151f782f887bc8d7",
"score": "0.68683714",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "31c52365d3d92f8c151f782f887bc8d7",
"score": "0.68683714",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "31c52365d3d92f8c151f782f887bc8d7",
"score": "0.68683714",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "46c06e4089ac2a42f2b120a8316dc480",
"score": "0.6863808",
"text": "def destroy\n @structure_photo.destroy\n render json: {message: 'Foto Excluida'} , status: :ok\n end",
"title": ""
},
{
"docid": "bf383234764e35d3ca70ba7164129a10",
"score": "0.6843883",
"text": "def destroy\n ImagesIndex.delete params[:id]\n respond_to do |format|\n format.html { redirect_to(\"/images_indices\") }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f6e9280be38c36a33e2095c12d7770d5",
"score": "0.68417025",
"text": "def destroy\n @imagedemo.destroy\n respond_to do |format|\n format.html { redirect_to imagedemos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e1e9a761df6b5f4b9f2ad62159823b9a",
"score": "0.6824379",
"text": "def destroy\n @img = Img.find(params[:id])\n @img.destroy\n\n respond_to do |format|\n format.html { redirect_to(imgs_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d4cad81f6531309dc9e65f89d290b390",
"score": "0.6821455",
"text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d4cad81f6531309dc9e65f89d290b390",
"score": "0.6821455",
"text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d4cad81f6531309dc9e65f89d290b390",
"score": "0.6821455",
"text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d4cad81f6531309dc9e65f89d290b390",
"score": "0.6821455",
"text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d4cad81f6531309dc9e65f89d290b390",
"score": "0.6821455",
"text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d4cad81f6531309dc9e65f89d290b390",
"score": "0.6821455",
"text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d4cad81f6531309dc9e65f89d290b390",
"score": "0.6821455",
"text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "559eb398f05d0bb932b51780856dbf65",
"score": "0.68136185",
"text": "def destroy\n @photo1 = Photo1.find(params[:id])\n @photo1.destroy\n\n respond_to do |format|\n format.html { redirect_to photo1s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6fc4c084cc615f771da1ff4e0288b40a",
"score": "0.6809177",
"text": "def deleteEntityImage( entity_id, gen_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['gen_id'] = gen_id\n return doCurl(\"delete\",\"/entity/image\",params)\n end",
"title": ""
},
{
"docid": "2b578b287d8c49db5b2c8e83e7b51d76",
"score": "0.67990917",
"text": "def destroy\n @featureimg.destroy\n respond_to do |format|\n format.html { redirect_to featureimgs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a57309273b5fc6cf607a99d9cdf07c7b",
"score": "0.679275",
"text": "def destroy\n @image = Gui::Image.find(params[:id])\n @image.destroy\n redirect_to gui_panels_path\n\n # respond_to do |format|\n # format.html { redirect_to gui_images_url }\n # format.json { head :no_content }\n # end\n end",
"title": ""
},
{
"docid": "5007371e4ff1ddc1f09af5e9ae858a8d",
"score": "0.6792552",
"text": "def destroy\n @estate_agent_image = EstateAgentsImage.find(params[:id])\n @estate_agent_image.destroy\n\n respond_to do |format|\n format.html { redirect_to estate_agent_image_images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "536bea38a389ed7d8d9c48194720b563",
"score": "0.6790724",
"text": "def destroy\n @image_upload = ImageUpload.find(params[:id])\n @image_upload.destroy\n\n respond_to do |format|\n format.html { redirect_to image_uploads_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "27bdfcf687c76e54ed59d0b1ad0c1edb",
"score": "0.6778353",
"text": "def remove_image( image_id )\n image_id = image_id.to_s.upcase\n upload_key = UPLOAD_PATH % image_id\n hires_key = HIRES_PATH % image_id\n lowres_key = LOWRES_PATH % image_id\n\n client.delete_objects(\n bucket: aws.bucket,\n delete: {\n objects: [\n {key: upload_key},\n {key: hires_key},\n {key: lowres_key}\n ]\n }\n )\n end",
"title": ""
},
{
"docid": "7bede02c8c2b0cc58cc27d79a9d77cf1",
"score": "0.67766607",
"text": "def destroy\n @image_to_sample.destroy\n respond_to do |format|\n format.html { redirect_to image_to_samples_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "169b9ebc4d971821c11033617b1d9ed1",
"score": "0.67766136",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to uploads_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4f605a08bc69024503de73cf7bba9c6f",
"score": "0.67690814",
"text": "def destroy\n @photo_booth = PhotoBooth.find(params[:id])\n @photo_booth.destroy\n\n respond_to do |format|\n format.html { redirect_to photo_booths_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "263e55dcbaa949dcf7a3c8b7dc6d0392",
"score": "0.6758299",
"text": "def destroy\n @admin_bg_image.destroy\n respond_to do |format|\n format.html { redirect_to admin_bg_images_url, notice: 'Bg image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "27548b8944183845b97259b92d32d757",
"score": "0.6753995",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url, notice: 'Image was deleted successfully.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9e1a12e6beb29656eeadd84d95b3a3f8",
"score": "0.675182",
"text": "def destroy\n @image_path = ImagePath.find(params[:id])\n @image_path.destroy\n\n respond_to do |format|\n format.html { redirect_to(image_paths_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7d3186be9bbc95ea14629fb2b013c22f",
"score": "0.67457294",
"text": "def destroy\n @img.destroy\n respond_to do |format|\n format.html { redirect_to imgs_url, notice: \"Img was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3e8fd6cda007fc23bbf554e0b92ad3dd",
"score": "0.67419463",
"text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "8ff9541a3a69768f3f04ed82f6747aad",
"score": "0.6741238",
"text": "def destroy\n @memberimage = Memberimage.find(params[:id])\n @memberimage.destroy\n\n respond_to do |format|\n format.html { redirect_to memberimages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0263c3bcb8499741ad05038ca5276567",
"score": "0.6737923",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to uploads_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9726e5906847e86574cbf497f2ac9759",
"score": "0.6735995",
"text": "def delete(user)\n Rails.logger.debug \"Call to photo.delete\"\n if !self.file.blank?\n Util.delete_image(self.file) #Delete the image file from the image server\n end\n reqUrl = \"/api/photo/#{self.id}\" #Set the request url\n rest_response = MwHttpRequest.http_delete_request(reqUrl,user['email'],user['password'])#Make the DELETE request to the server with the required parameters\n Rails.logger.debug \"Response from server: #{rest_response.code} #{rest_response.message}: #{rest_response.body}\"\n if rest_response.code == \"200\" #Validate if the response from the server is 200, which means OK\n return true, rest_response #Return success\n else\n return false, \"#{rest_response.code}\", \"#{rest_response.message}\" #Return error\n end\n end",
"title": ""
},
{
"docid": "4dcdc6d0e5462b19cf47e9c324370a77",
"score": "0.6735327",
"text": "def destroy\n request(:delete, \"/computing/image/#{uuid}\")\n true\n end",
"title": ""
},
{
"docid": "031e89435b25e6821213e5a556333525",
"score": "0.6731711",
"text": "def destroy\n @objective_image.destroy\n respond_to do |format|\n format.html { redirect_to objective_images_url, notice: 'Objective image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f031c4428a24ba416d140f3d3471f159",
"score": "0.6726881",
"text": "def destroy\n Image.find(params[:id]).destroy\n respond_to do |format|\n format.html { redirect_to images_url, notice: 'Image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7114937f5ea264a961b2fc3511f8b254",
"score": "0.6723351",
"text": "def destroy\n @image = ImagePost.find(params[:id])\n @image.destroy\n track_activity @image\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e3a5a3ee31db77bc728fc8a7100302e0",
"score": "0.67208254",
"text": "def destroy\n @image_url = ImageUrl.find(params[:id])\n @image_url.destroy\n\n respond_to do |format|\n format.html { redirect_to image_urls_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ae1e628625d1e338e492540f0b035e17",
"score": "0.67175555",
"text": "def destroy\n output = \"oneimage delete #{resource[:name]} \", self.class.login\n `#{output}`\n end",
"title": ""
},
{
"docid": "23c26edb651719756124582073780ca1",
"score": "0.6715362",
"text": "def destroy\n @rock_photo.destroy\n render json: {message: 'Foto Excluida'} , status: :ok\n end",
"title": ""
},
{
"docid": "59ad7d0d72b0ef3cb7a74387d8cf046d",
"score": "0.67128605",
"text": "def destroy\n @imagem = Imagem.find(params[:id])\n @imagem.destroy\n\n respond_to do |format|\n format.html { redirect_to imagems_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1b08ce62c42d00570f56a11b3a418583",
"score": "0.67057776",
"text": "def destroy\n @photo.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "a09e58a797b84b7957a7eb3446b201d6",
"score": "0.67049325",
"text": "def destroy\n image = Image.find(params[:id])\n if image.user_id == current_user.id\n image.destroy\n render json:{}, status:201\n end\n end",
"title": ""
},
{
"docid": "6ef12b62ca644f69f6ef2f0a6ac92f61",
"score": "0.66954255",
"text": "def destroy\n @baby_pic = BabyPic.find(params[:id])\n @baby_pic.destroy\n\n respond_to do |format|\n format.html { redirect_to baby_pics_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2318cd8dd8d9199f27009c3bf8c6d07b",
"score": "0.6688035",
"text": "def destroy\n @text2_image = Text2Image.find(params[:id])\n @text2_image.destroy\n\n respond_to do |format|\n format.html { redirect_to text2_images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "917974a683e6b91a47d5293fb575b61f",
"score": "0.66823894",
"text": "def destroy\n @image_bank = ImageBank.find(params[:id])\n @image_bank.destroy\n \n respond_to do |format|\n format.html { redirect_to image_banks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e6433a17dab2cdf69b9ac07653a2a91d",
"score": "0.6681073",
"text": "def destroy\n @boat_cover_image_name = BoatCoverImageName.find(params[:id])\n @boat_cover_image_name.destroy\n\n respond_to do |format|\n format.html { redirect_to(boat_cover_image_names_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3cd54aace6657ea67653dc6a47c53554",
"score": "0.66800904",
"text": "def destroy\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to @photo.item }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "38b25f83182c684d1ff6ee4b3304e5f9",
"score": "0.66686964",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "0c5f45f3e6fd2921832d04dc471c32ff",
"score": "0.6665918",
"text": "def destroy\n @heading_bg_image.destroy\n respond_to do |format|\n format.html { redirect_to heading_bg_images_url, notice: 'Heading bg image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c6c6d6666549eca11ead2bf7fc09f2d4",
"score": "0.66653514",
"text": "def destroy\n @photo = @allbum.photos.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to allbum_photos_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5d30cf8c53d48f8352ddde12e985ac6e",
"score": "0.66608375",
"text": "def destroy\n @image_reference.destroy\n respond_to do |format|\n format.html { redirect_to image_references_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d6695969d7b401df70754a77c2947bba",
"score": "0.6659116",
"text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n redirect_to console_images_path\n end",
"title": ""
},
{
"docid": "70fea4e12ae6f3c73af7504c26d3f5c7",
"score": "0.66480553",
"text": "def destroy\n file_url = @image.url\n @image.destroy\n\n File.delete(\"public/uploads/#{file_url}\")\n\n respond_to do |format|\n format.html { redirect_to images_url, notice: 'Image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e20ade9f6ec388b7161714a555a95c84",
"score": "0.6645547",
"text": "def destroy\n @match_image = MatchImage.find(params[:id])\n @match_image.destroy\n\n respond_to do |format|\n format.html { redirect_to match_images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "263d6623967345c4d4fafed3a8dd6faf",
"score": "0.66418344",
"text": "def destroy\n @animal_image.destroy\n respond_to do |format|\n format.html\n format.js {}\n format.json { render json: { ok: true } }\n end\n end",
"title": ""
},
{
"docid": "bf7061a2c5a04da60397d56be6702ff9",
"score": "0.6637356",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Imagen eliminada correctamente.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b7ecaf0ac3a6fe34125b376d85fd7bf5",
"score": "0.66231894",
"text": "def destroy\n @story_image.destroy\n respond_to do |format|\n format.html { redirect_to story_images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "894b297b5224ce7f1d63a789d22f42ba",
"score": "0.6621523",
"text": "def destroy\n @column_image.destroy\n respond_to do |format|\n format.html { redirect_to column_images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2aae0206f83aa6278c26ff5f29953dac",
"score": "0.66178703",
"text": "def destroy\n @vmimage.destroy\n respond_to do |format|\n format.html { redirect_to vmimages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2a14efc864515b51027701a5aa2c74",
"score": "0.6616904",
"text": "def destroy\n @post_img.destroy\n respond_to do |format|\n format.html { redirect_to post_imgs_url, notice: 'Post img was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "85a2315c3ad5733bf3469eef5ba2d0ce",
"score": "0.6614962",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "84f0529594fa586826f210f80413e923",
"score": "0.66097695",
"text": "def destroy\n @riffblob.destroy\n respond_to do |format|\n format.html { render notice: 'Riffblob was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c7990d00e624b0ae2e46a3c88e7752f5",
"score": "0.6602194",
"text": "def delete_image(image_id)\n delete(\"cloud-instances/#{guid}/images/#{image_id}\")\n end",
"title": ""
},
{
"docid": "689d5a07a403c4b765ba178e4aff08a3",
"score": "0.66010016",
"text": "def delete\n client.delete(\"/#{id}\")\n end",
"title": ""
},
{
"docid": "0c2204802e28ecf329f28dec72b5f2c1",
"score": "0.66005224",
"text": "def destroy\n @s3_image = S3Image.find(params[:id])\n @s3_image.destroy\n\n respond_to do |format|\n format.html { redirect_to s3_images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4c0086c6096ce1981241cb079300764",
"score": "0.66004854",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url, notice: 'Image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4c0086c6096ce1981241cb079300764",
"score": "0.66004854",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url, notice: 'Image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4c0086c6096ce1981241cb079300764",
"score": "0.66004854",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url, notice: 'Image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4c0086c6096ce1981241cb079300764",
"score": "0.66004854",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url, notice: 'Image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4c0086c6096ce1981241cb079300764",
"score": "0.66004854",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url, notice: 'Image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4c0086c6096ce1981241cb079300764",
"score": "0.66004854",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url, notice: 'Image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4c0086c6096ce1981241cb079300764",
"score": "0.66004854",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url, notice: 'Image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4c0086c6096ce1981241cb079300764",
"score": "0.66004854",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url, notice: 'Image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4c0086c6096ce1981241cb079300764",
"score": "0.66004854",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url, notice: 'Image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4c0086c6096ce1981241cb079300764",
"score": "0.66004854",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url, notice: 'Image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4c0086c6096ce1981241cb079300764",
"score": "0.66004854",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url, notice: 'Image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e4c0086c6096ce1981241cb079300764",
"score": "0.66004854",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url, notice: 'Image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fad006299f6642b9fbd3ec54b68a6ff4",
"score": "0.65994596",
"text": "def destroy\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url, notice: \"Image was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "be013cc3b0e50e3d825bfc08c712c4bd",
"score": "0.6596973",
"text": "def destroy\n @loc_image.destroy\n respond_to do |format|\n format.html { redirect_to loc_images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bff6397e47eaf36a88cffbd82938ebac",
"score": "0.6595742",
"text": "def destroy\n @image.destroy()\n respond_to do |format|\n format.html { redirect_to images_url, notice: \"Image was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7cc9091dfd380ebe9970431d3a9a5ed6",
"score": "0.65840554",
"text": "def destroy\n @avatar.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "15bec6e26a1b40aac794a56afb6324ec",
"score": "0.6581505",
"text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_images_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "de0078111765897e53d87e0543a9014a",
"score": "0.6579336",
"text": "def destroy\n query = \"created_by = \\\"#{current_user.email}\\\"\"\n @photo = Photo.where(query).with_attached_images.find(params[:id])\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to photos_path, notice: 'Destroyed successfully.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c88ba6e6951719bedd032d348cf66e17",
"score": "0.6578935",
"text": "def destroy\n @setup_image.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8cf5159d1a255e1805b397e65b7b1409",
"score": "0.65787244",
"text": "def destroy\n @combined_image = CombinedImage.find(params[:id])\n @combined_image.destroy\n\n respond_to do |format|\n format.html { redirect_to combined_images_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
7f8dbc12fc44f46e7700414b4817a04c
|
product updation and handling failure
|
[
{
"docid": "15b2e100e1dd67f4aa2c7aea1ace8217",
"score": "0.6582546",
"text": "def update\n if @product.update(product_params)\n redirect_to admin_products_path\n flash[:success] = \"Woohoo! product updated successfully.\"\n else\n render 'edit'\n flash[:error] = \"Oops! Something went wrong!\"\n end\n end",
"title": ""
}
] |
[
{
"docid": "8e432894ea961ee8e852a4786d78a768",
"score": "0.73491806",
"text": "def update\n @product.update_attributes!(product_params)\n render_success_format('Entrada actualizada',@product,true)\n rescue Exception => e\n render_default_error e, 401\n\n end",
"title": ""
},
{
"docid": "9b098971e37d80b98f723eef12ba0ed7",
"score": "0.7317311",
"text": "def update_product\n begin\n Product.update_product( params[:tags], params[:categories], params[:sku_id], params[:name], params[:price], params[:expire_date] )\n respond_to do |format|\n #TODO using serializers, send the updated product information\n format.json { render :json => { :success => true, :status => 200 } }\n end\n rescue Exception => e\n respond_to do |format|\n logger.error \"There was some code error in vendor#update_product. \" + e.message + \" \" + Time.zone.now.strftime(\"%H:%M:%S - %d/%m/%Y\").to_s\n format.json { render :json => { :success => false, :user_message => \"Please try again later.\", :status => 500 } }\n end \n end \n end",
"title": ""
},
{
"docid": "f1873f668959d35efaa562e960be861f",
"score": "0.73062146",
"text": "def update\n @product = Product.find(params[:id])\n @product.amount = params[:product][:amount]\n @product.unitprice = params[:product][:unitprice]\n @product.name = params[:product][:name]\n @product.description = params[:product][:description]\n \n\n errno = 0\n err_msg = ''\n if params[:product]\n if !params[:product][:name]\n errno += 1\n err_msg += '商品名称不得为空。'\n elsif !params[:product][:description]\n errno += 1\n err_msg += '商品描述不得为空。'\n #elsif !params[:product][:image_url]\n # errno += 1\n # err_msg += '商品图片不得为空。'\n end\n else\n errno += 1\n end\n if !DataVerify.is_positive_integer(@product.amount)\n errno += 1\n err_msg += '库存数量必须为正整数。'\n end\n if !DataVerify.is_positive_float(@product.unitprice)\n errno += 1\n err_msg += '商品价格必须为正数。'\n end\n \n status = false\n begin\n ActiveRecord::Base.transaction do\n @product.save!\n if !@product.info\n info = Info.new(:image => params[:image])\n else\n info = @product.info\n if params[:image]\n info.update_attributes(:image => params[:image])\n end\n end\n info.name = @product.name\n info.image_url = @product.image_url\n info.description = @product.description\n info.unitprice = @product.unitprice\n info.product_id = @product.id\n #info.start_at = DateTime.now\n info.save!\n status = true\n end\n rescue ActiveRecord::RecordInvalid => invalid\n status = false\n end\n\n\n respond_to do |format|\n if status\n format.html { redirect_to(@product, :notice => 'Product was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @product.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b9cc4cc0d9ba39b8187b87d073cd3fa",
"score": "0.7299886",
"text": "def update\n Rails.logger.info_log.info \" I,[#{Time.now.strftime(\"%Y-%m-%d %H:%M:%S %Z\")}]\" \"INFO -- : User click the products update button\"\n begin\n if @product.update(product_params)\n render json: @product\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n Rails.logger.info_log.info \" I,[#{Time.now.strftime(\"%Y-%m-%d %H:%M:%S %Z\")}]\" \"INFO -- : products Updated successfully\"\n rescue =>e\n Rails.logger.custom_log.error { \"#{e} products_controller update method\" }\n end\n end",
"title": ""
},
{
"docid": "fbba1ff3cda8bca1ec5fa51b43820ac1",
"score": "0.7253025",
"text": "def update_product\n begin\n @product = Product.find(params[:id])\n if @product.update_attributes(params[:product])\n redirect_to product_stock_path\n else\n flash[:notice] = \"Please enter correct Informations\"\n render product_edit_path\n end\n rescue\n end\n end",
"title": ""
},
{
"docid": "4529187a85953f30476ddcd7d2229995",
"score": "0.7183044",
"text": "def update\n render json: @product.errors unless @product.update(product_params)\n end",
"title": ""
},
{
"docid": "51c0583a873d80944322fcba5d093463",
"score": "0.7144077",
"text": "def update\n msg = 'Producto no editado'\n if @product.update(product_params)\n msg = 'Producto editado' \n end\n\n return redirect_to \"/products\", notice: msg\n rescue StandardError => e\n\n if e.message == \"no_se_puede_rebajar_mas_de_lo_que_ya_esta_asignado\"\n msg = \"No se puede rebajar el Stock Total a una cantidad menor a #{@product.try(:stock_no_disponible)}, ya que esa es la cantidad de productos que aun se encuentran asignados a usuarios\"\n edit_url = \"/products/#{@product.id}/edit\"\n return redirect_to edit_url, notice: msg\n end\n end",
"title": ""
},
{
"docid": "679d4ead4550f97564795fe72df3564c",
"score": "0.71217746",
"text": "def update\n if @product.update(product_params)\n redirect_to @product\n flash[:success] = \"Successfully updated product.\"\n return\n else\n flash.now[:warning] = \"Product update failed\"\n flash.now[:details] = @product.errors.full_messages\n render :edit, status: :bad_request\n return\n end\n end",
"title": ""
},
{
"docid": "73ae33f53eb866091cda3eb3ffc4cf5a",
"score": "0.7098665",
"text": "def update\n respond_to do |format|\n if @product#.update(product_params)\n @product.name = params[:product][:name]\n @product.description = params[:product][:description]\n @product.available_quantity = params[:product][:available_quantity]\n @product.price = params[:product][:price]\n @product.image_base64 = (\"data:image/png;base64,\" + Base64.strict_encode64(File.open(params[:product][:image_base64].path).read)) if params[:product][:image_base64].present?\n @product.weight = params[:product][:weight]\n @product.amount = params[:product][:amount]\n @product.ingredients = params[:product][:ingredients]\n @product.days = [params[:product][:monday], params[:product][:tuesday], params[:product][:wednesday], params[:product][:thursday], params[:product][:friday], params[:product][:saturday], params[:product][:sunday]]\n @product.schedule = [params[:product][:breakfast], params[:product][:food], params[:product][:snack], params[:product][:cena]]\n if @product.changed == [\"available_quantity\"]\n new_product = ShopifyAPI::Product.find @product.shopify_product_id rescue nil\n if new_product\n # new_product.variants[0].sku = @product.available_quantity\n # new_product.save!\n\n # inventory item\n inventory_item = ShopifyAPI::InventoryItem.find new_product.variants[0].inventory_item_id rescue nil\n if inventory_item\n\n inventory_item.tracked = true\n inventory_item.save\n\n # inventory level\n params_inventory_item_ids = {inventory_item_ids: inventory_item.id}\n inventory_level = ShopifyAPI::InventoryLevel.find(:all, params: params_inventory_item_ids)[0] rescue nil\n\n if inventory_level\n inventory_level.adjust(@product.available_quantity - inventory_level.available)\n end\n end\n end\n elsif @product.changed == []\n else\n @product.status = false\n end\n @product.save\n\n @product.product_collections.destroy_all\n params[:product][:collection].reject(&:empty?).each do |collection_id|\n ProductCollection.create(product_id: @product.id, collection_id: collection_id)\n end\n \n format.html { redirect_to products_url, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dbc4cbeb5bc513342967b7e0130bd883",
"score": "0.70841026",
"text": "def update_product(connection, *args)\n commit(connection, \"updateProduct\", *args)\n end",
"title": ""
},
{
"docid": "80b5cb518218550333712dfdbbe07cfd",
"score": "0.70813346",
"text": "def update\n # logger.debug \"New article: #{@product.price_tax_excluded}\"\n logger.debug \"Article should be valid: #{@product.valid?}\"\n if @product.update(product_params)\n render plain: \"Successfully Updated!\"\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "10e2e87b71c98a70555e01f6adbb79f7",
"score": "0.70579773",
"text": "def update\n if @product.update(product_params)\n Rails.logger.debug(\"Updated Product: #{@product.inspect}\")\n else\n Rails.logger.debug(\"Failed to update product... fml: #{@product.inspect}\")\n end\n end",
"title": ""
},
{
"docid": "ad0aa44641dea22b0ca417df2c1914fb",
"score": "0.70491356",
"text": "def update\n @store = Store.find(params[:store_id])\n @product = Product.find(params[:id])\n \n respond_to do |format|\n if @product.update_attributes(params[:product])\n if @product.update_inventory(@store.id)\n format.html { redirect_to [@store,@product] , notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "192d3df53b40e32921637e2fa42d4815",
"score": "0.7046213",
"text": "def update\n product = Product.with_drafts(@current_user.id).find_by_id(params[:id])\n if product\n if @current_user.id == product.user.id\n\n product.product_name = params[:product_name] if params[:product_name]\n product.price = params[:price] if params[:price]\n product.product_type = params[:product_type] if params[:product_type]\n product.is_published = params[:is_published] if params[:is_published]\n product.sold_status = params[:sold_status] if params[:sold_status]\n product.condition = params[:condition] if params[:condition]\n product.description = params[:description] if params[:description]\n\n if product.save()\n payload = {\n error: false,\n id: product.id\n }\n render status: 200, json: payload\n else\n errors = []\n product.errors.keys.each do |key|\n errors << {field: key, message: product.errors.full_messages_for(key).first}\n end\n payload = {\n error: true,\n errors: errors\n }\n render status: 200, json: payload\n end\n else\n render status: 473, json: {error: true}\n end\n else\n render status: 404, json: {error: true}\n end\n end",
"title": ""
},
{
"docid": "a4e0e852a4e04595a6f4f06efe02c107",
"score": "0.7026035",
"text": "def update\n logger.info \"PUT method\"\n\n @product = Product.find(params[:id], :include => [:prd_attribute, :prd_members, :prd_subscriptions, :prd_tariffs, :prd_balances, :prd_thresholds, :prd_promotions, :prd_additional_services])\n\n product_id = @product.id\n\n\tcase params[:target]\n\t\twhen \"prd_attibute\": \n\t\twhen \"prd_subscriptions\":\n\t\t\tPrdSubscription.save_to_db(params['prd_subscriptions'], product_id)\n\n\t\twhen \"prd_tariffs\":\n\t\t\tPrdTariff.save_to_db(params['prd_tariffs'], product_id)\n\n\t\twhen \"prd_balances\":\n\t\t\tPrdBalance.save_to_db(params['prd_balances'], product_id)\n\n\t\twhen \"prd_thresholds\":\n\t\t\tPrdThreshold.save_to_db(params['prd_thresholds'], product_id)\n\n\t\twhen \"prd_promotions\":\n\t\t\tPrdPromotion.save_to_db(params['prd_promotions'], product_id)\n\n\t\twhen \"prd_additional_services\":\n\n\t\t\tPrdAdditionalService.save_to_db(params['prd_additional_services'], product_id)\n @prd_attribute = @product.prd_attribute\n \t\t # send_to_cs(@product.prd_attribute, @product.prd_subscriptions, @product.prd_promotions, @product.prd_additional_services )\n\n #f = open(\"http://localhost:3000/ccbs_products/\"+@prd_attribute.id.to_s+'.json')\n\n #debugger\n #webpage = f.read\n #f.close\n\n\t\t #make_rules(product_id, @product.prd_attribute.name)\n\tend\n\n respond_to do |format|\n if @product.update_attributes(@put_product)\n format.html { redirect_to(@product, :notice => 'Product was successfully updated.') }\n format.xml { head :ok }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @product.errors, :status => :unprocessable_entity }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ce74cf65cabad21848d67b3e99b5e1fd",
"score": "0.69954383",
"text": "def update\n respond_with Product.find(params[:id]).update_attributes(params[:product])\n end",
"title": ""
},
{
"docid": "7c30957e6844e6d864eb36fccca1b97a",
"score": "0.6959999",
"text": "def update\n product = Product.find(params[:id])\n if product.update(product_params)\n render status: :ok, json: {message: 'Producto actualizado con exito'}\n end\n end",
"title": ""
},
{
"docid": "e428a47d9c4ef02de7a3cd18c88423f5",
"score": "0.6956557",
"text": "def update\n unless @supplier_product.status&.in?([0, 5])\n flash[:danger] = \"审核中!\"\n return redirect_to action: :index\n end\n if params[:skus].blank? || params[:category_attributes].blank?\n flash[:danger] = \"添加商品失败,sku或属性不能为空!\"\n return redirect_to action: :edit, id: @supplier_product.id\n end\n\n begin\n ActiveRecord::Base.transaction do\n if @supplier_product.update_attributes!(supplier_product_params.merge(provider_id: current_user.id, status: 0, unsold_count: params[:skus].inject(0){|sum,x| sum+= x[\"amount\"].to_f}))\n # Auction::Image.change_image_url @supplier_product, params[:image_urls], current_user.id\n @supplier_product.save_images!(params['pimages'], current_user.id)\n @supplier_product.update_skus!(params[:skus], current_user.id)\n # binding.pry\n @supplier_product.update_values!(params[:input_category_attributes], params[:category_attributes], params[:attributes_names], params[:custom_values])\n flash[:success] = '修改商品成功!'\n return redirect_to action: :index\n end\n end\n rescue Exception => e\n flash[:danger] = \"修改商品失败!#{error_msg(@supplier_product)}\"\n return redirect_to action: :edit, id: @supplier_product.id\n end\n end",
"title": ""
},
{
"docid": "36703907ad07197bdda1f7ddcd660124",
"score": "0.6944076",
"text": "def update\n if @product.update(product_params)\n render json: {\n status: :updated,\n product: @product\n }\n else\n render json: {\n status: 500\n }\n end\n end",
"title": ""
},
{
"docid": "57af6159f04f2fc512317e37b4e8da50",
"score": "0.69195825",
"text": "def update \r\n product = Product.find(params[:id])\r\n if product.update_attributes(product_params)\r\n render json: {\r\n status: 'SUCCESS',\r\n message: 'Updated specific product',\r\n data: product\r\n }, status: :ok\r\n else\r\n render json: {\r\n status: 'ERROR',\r\n message: 'Could not update specific product',\r\n data: product.errors\r\n }, status: :unprocessable_entity\r\n end\r\n end",
"title": ""
},
{
"docid": "c1d95eed7eae6d013cdeaaa5fc4f874c",
"score": "0.6904805",
"text": "def update\n @product = Product.find(params[:id])\n if @product.is_mixed?\n if @product.product_kind_id == params[:product][:product_kind_id].to_i\n flash[:notice] = \"Product was successfully updated\"\n @product.update_attributes(params[:product])\n else\n if @product.mixed_items.any?\n flash[:error] = \"Product was unsuccessfully updated. Please delete mixed item list to update type of product \"\n else\n flash[:notice] = \"Product was successfully updated\"\n @product.update_attributes(params[:product])\n end\n end\n else\n flash[:notice] = \"Product was successfully updated\"\n @product.update_attributes(params[:product])\n \n end\n redirect_to edit_product_path(@product)\n end",
"title": ""
},
{
"docid": "195d97221338cf11b24d784424277e01",
"score": "0.690386",
"text": "def update\n @title = t('view.products.edit_title')\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: t('view.products.correctly_updated') }\n format.json { head :ok }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n rescue ActiveRecord::StaleObjectError\n redirect_to edit_product_url(@product), alert: t('view.products.stale_object_error')\n end",
"title": ""
},
{
"docid": "c9c618b5b02695710584d6d8844019ad",
"score": "0.68950963",
"text": "def update\n number = 13 if product_params.values.count == 15\n number = 14 if product_params.values.count == 16\n number = 15 if product_params.values.count == 17\n new_count = (product_params.values[number+1].count-1) * (product_params.values[number].count-1)\n old_count = Product.where(name: @product.name).count\n if new_count-old_count == 0\n product = Product.where(name: @product.name).ids.sort!\n count = new_count - 1\n 1.upto(product_params.values[number].count-1) do |region|\n 1.upto(product_params.values[number+1].count-1) do |activity_kind|\n products = Product.find(product[count])\n products.update(product_params)\n products.region_id = product_params[:region_ids][region]\n products.activity_kind_id = product_params[:activity_kind_ids][activity_kind]\n products.budget_option = params[:Budget]\n products.min_price = products.budget.split(\",\")[2].to_i / products.budget.split(\",\")[1].to_i if products.budget_option == \"按時段收費\"\n count = count - 1\n products.save\n end\n end\n end\n\n if new_count-old_count > 0\n @product.region_id = product_params.values[number][1].to_i\n @product.activity_kind_id = product_params.values[number+1][1].to_i\n @product.update(product_params)\n 1.upto(Product.where(name: @product.name).ids.count-1) do |i|\n Product.find(Product.where(name: @product.name).ids.sort![1]).destroy\n end\n 1.upto(product_params.values[number].count-1) do |region|\n 1.upto(product_params.values[number+1].count-1) do |activity_kind|\n product = Product.new(product_params)\n product.region_id = product_params[:region_ids][region]\n product.activity_kind_id = product_params[:activity_kind_ids][activity_kind]\n product.budget_option = params[:Budget]\n product.min_price = product.budget.split(\",\")[2].to_i / product.budget.split(\",\")[1].to_i if product.budget_option == \"按時段收費\"\n product.save\n end\n end\n Product.find(Product.where(name: @product.name).ids.sort![1]).destroy\n end\n\n if new_count-old_count < 0\n 1.upto(old_count-new_count) do |i|\n Product.find(Product.where(name: @product.name).ids.sort![-1]).destroy\n end\n product = Product.where(name: @product.name).ids.sort!\n count = new_count - 1\n 1.upto(product_params.values[number].count-1) do |region|\n 1.upto(product_params.values[number+1].count-1) do |activity_kind|\n products = Product.find(product[count])\n products.update(product_params)\n products.region_id = product_params[:region_ids][region]\n products.activity_kind_id = product_params[:activity_kind_ids][activity_kind]\n products.budget_option = params[:Budget]\n products.min_price = products.budget.split(\",\")[2].to_i / products.budget.split(\",\")[1].to_i if products.budget_option == \"按時段收費\"\n count = count - 1\n products.save\n end\n end\n end\n\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n\n\n end",
"title": ""
},
{
"docid": "0c2f44c841c9bcfc3a46bf0c3e9aa943",
"score": "0.6867414",
"text": "def update_product(*args)\n commit(\"updateProduct\", *args)\n end",
"title": ""
},
{
"docid": "01e05d0dae2735054bac8f0f7ffb6f4a",
"score": "0.686457",
"text": "def update_product\n\n # Checkout the task value\n task = params[:task]\n\n if task == 'add_type'\n \n # Create new Type\n begin \n addType params[:new_type]\n flash[:notice] = 'New type was successfully created.'\n rescue Exception => err\n flash[:notice] = err\n end\n\n # Do add type and redirect to new product\n redirect_to :action => 'edit_product', :id => params[:id]\n\n elsif task == 'add_model'\n \n # Create new Model\n begin \n addModel params[:new_model]\n flash[:notice] = 'New model was successfully created.'\n rescue Exception => err\n flash[:notice] = err\n end\n\n # Do add model and redirect to new product\n redirect_to :action => 'edit_product', :id => @product\n \n elsif task == 'cancel'\n redirect_to :action => 'list_products'\n\n else # Update product to database\n \n # Update product info\n @product = McProduct.find(params[:id])\n \n @product.byline = @product.sku\n @product.update_attributes!(params[:product])\n @product.update_date = DateTime::now.to_s(:db)\n\n # Destroy the existing image\n @product.image_upload.destroy if @product.image_upload\n \n # Update new image\n if @product.image.blank? && params[:image][:uploaded_data].size > 0\n\n @image = ImageUpload.new(params[:image])\n @product.image = ''\n @product.image_upload = @image\n\n end\n\n # Save product and image to database\n @product.save!\n\n redirect_to :action => 'view_product', :id => params[:id]\n\n end\n\n end",
"title": ""
},
{
"docid": "f0b01abe985343e4b133d80544327743",
"score": "0.68475103",
"text": "def update_product(product_id, customer_id, product_name, product_price, product_desc)\n @db.execute(\"UPDATE Products SET product_name = '#{product_name}', product_price = #{product_price}, product_desc = '#{product_desc}' WHERE product_id = #{product_id};\")\n updated_product = @db.execute \"SELECT * FROM Products WHERE product_id = #{product_id};\"\n # @db.close\n return updated_product\n end",
"title": ""
},
{
"docid": "6d1cb11915ed97a49711ba139ac8d2ff",
"score": "0.6839422",
"text": "def update\n @product = Product.find(params[:id]) \n if @product.update(product_params)\n flash[:success] = \"Product Updated...\"\n redirect_to current_retailer\n else\n flash[:error] = \"Product update Failed, Try again...\"\n render 'edit'\n end\n end",
"title": ""
},
{
"docid": "14bc81a65ea583848977b175dde9b5db",
"score": "0.6838994",
"text": "def update\n\n product = Product.find(params[:id])\n\n if product.update(product_params)\n render json: {status: 'SUCCESS', message:'Product inventory updated', data:product},status: :ok\n else\n render json: {status: 'ERROR', message:'Could update the inventory', data:product},status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "8d8f9f92d3afe5f39351e645eda4400e",
"score": "0.68338835",
"text": "def update\n \n if @product.update(product_params)\n render JSON: @product\n else\n render JSON: @product.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "9b91bbcc1c5e099b920609e39d641c9b",
"score": "0.6826734",
"text": "def update\n add_dependent(params[:new_dependent])\n add_dependency(params[:new_dependency])\n new_product_service(params[:product_service])\n new_product_group_portfolio(params[:new_product_group_portfolios])\n new_product_portfolio(params[:new_product_portfolio])\n new_employee_product(params[:employee_product])\n new_portfolio(params[:new_portfolio])\n new_product_group(params[:new_product_group])\n if @product.update_attributes(params[:product])\n flash[:notice] = t(:product) + t(:updated) \n else\n flash[:error] = t(:product) + t(:needs_a_name)\n @error = true\n end\n if @error.blank?\n redirect_to edit_product_path(@product.id)\n else\n render :edit\n end\n end",
"title": ""
},
{
"docid": "a683dd938f2ab25745210a966bb684f7",
"score": "0.68219197",
"text": "def update\n if @product.update(product_params)\n render json:@product, status: :ok\n else\n render json: format_errors(@product.errors), status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f69e9261c28525abfc004c912eb538f4",
"score": "0.68194103",
"text": "def update\n @product = Product.find(params[:id])\n @product.retailer_id = params[:retaileradmin_id]\n if @product.update_attributes(params[:product])\n flash[:notice] = \"Product was successfully updated.\"\n @products = Product.all\n responds_to_parent do\n p \"im to update***************************************************\" \n render :action => 'index'\n end\n else\n responds_to_parent do\n flash[:notice] = \"There was an error while updating the product information.\"\n render :action => 'new'\n end\n end\n end",
"title": ""
},
{
"docid": "740ce66f977f0dc7a2f63ace7962ddcb",
"score": "0.68163955",
"text": "def update\n @admin_product = Product.find(params[:id])\n\n if @admin_product.update_attributes(params[:admin_product])\n params.keys.each do |k|\n set_params(k)\n end\n else\n flash[:notice] = t('admin.products.update.notice_failure') \n respond_with(@admin_product)\n end\n end",
"title": ""
},
{
"docid": "2d80644493b09fa70c6e65f3ea89a8b0",
"score": "0.6816205",
"text": "def update\n # store = Store.find(params[:store_id])\n # @product = store.products.create(product_params)\n # @image = @product.images.create!(image_params)\n respond_to do |format|\n if @product.update_attributes(product_params)\n format.html { redirect_to([@product.store, @product], notice: 'Product was successfully updated.') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "690f9e87d54fce66e7c25af3c9601157",
"score": "0.68065107",
"text": "def update(product)\r\n if product.update(product_params)\r\n logger.info \"product updated\"\r\n redirect_to :back\r\n else\r\n logger.info \"failed to update\"\r\n end\r\n end",
"title": ""
},
{
"docid": "243a60cba7f645760368bde1ea1993f4",
"score": "0.6805581",
"text": "def update\n render json: @sub_product.errors unless @sub_product.update(sub_product_params)\n end",
"title": ""
},
{
"docid": "3ad6a62a11bed76db2e039974637d0bf",
"score": "0.68000734",
"text": "def update\n add_additional_params_to_product_details(false)\n add_additional_params_to_price_lists(\"update\")\n add_additional_param_to_cost_lists(false)\n convert_cost_price_to_numeric\n begin \n unless @product.update(product_params)\n if @product.errors[:\"product_colors.base\"].present?\n render js: \"bootbox.alert({message: \\\"#{@product.errors[:\"product_colors.base\"].join(\"<br/>\")}\\\",size: 'small'});\"\n else\n @sizes = @product.size_group ? @product.size_group.sizes.select(:id, :size).order(:size_order) : []\n @price_codes = PriceCode.select(:id, :code).order :code\n @colors = Color.select(:id, :code, :name).order(:code)\n @colors.each do |color|\n product_color = @product.product_colors.select{|product_color| product_color.color_id.eql?(color.id)}.first\n if product_color\n product_color.selected_color_id = color.id\n product_color.code = color.code\n product_color.name = color.name\n else\n @product.product_colors.build color_id: color.id, code: color.code, name: color.name\n end \n end\n end\n else\n @new_brand_name = Brand.select(:name).where(id: params[:product][:brand_id]).first.name\n @new_vendor_name = Vendor.select(:name).where(id: params[:product][:vendor_id]).first.name\n @new_model_name = Model.select(:name).where(id: params[:product][:model_id]).first.name\n @new_goods_type_name = GoodsType.select(:name).where(id: params[:product][:goods_type_id]).first.name\n end\n rescue ActiveRecord::RecordNotUnique => e \n flash[:alert] = \"That code has already been taken\"\n render js: \"window.location = '#{products_url}'\"\n rescue ActiveRecord::RecordNotDestroyed => e\n render js: \"bootbox.alert({message: \\\"Sorry, you can't change colors!\\\",size: 'small'});\"\n end\n end",
"title": ""
},
{
"docid": "30661e3d144ad086723d0f3b36789582",
"score": "0.67952317",
"text": "def update\n if !@product.nil?\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n format.html { render :index, notice: :unprocessable_entity }\n format.json { render json: 'Error', status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fbc2ec9cdae8707c2363eee3bfaee5c4",
"score": "0.67825127",
"text": "def update\n @product = Product.find(params[:id])\n update_product = @product.update(product_params)\n if update_product\n render json: {\n status: 'OK', results: update_product, error: nil\n }, status: :ok\n else\n not_auth\n end\n end",
"title": ""
},
{
"docid": "164d92cf6167be30a2ab83a92ff5c5ec",
"score": "0.67785716",
"text": "def update\n @product = @seller.products.find(params[:id])\n @product.offer_price = purefy_offer_price(params[:offer_price])\n \n respond_to do |format|\n if @product.update_attributes(params[:product])\n flash[:notice] = 'Your product was sucessfully updated!'\n format.html { \n if params[:go_to_images] == \"true\"\n redirect_to new_product_product_image_path(@product) \n else\n redirect_to @product\n end\n }\n format.xml { render :nothing => true }\n else\n @statuses = Status.find(:all)\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @product.errors.to_xml } \n end\n end\n end",
"title": ""
},
{
"docid": "091dfd8a3d1cd568f8bfb5eee375ead6",
"score": "0.6771719",
"text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to curriculum_products_path(current_project, current_curriculum), notice: '수정되었습니다.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "59bb42a05017f2097dd0ee76430e7244",
"score": "0.6749324",
"text": "def update\n product = Payments::Product.find(params[:id])\n respond_to do |format|\n if product.update(product_update_params)\n format.html {redirect_to payments_products_path}\n else\n format.html {redirect_to :back, flash: {error: \"Error updating your product. #{product.errors.full_messages}\"}}\n end\n end\n end",
"title": ""
},
{
"docid": "3c9148461a415a91a17aeb38f8f801ba",
"score": "0.6745525",
"text": "def update\n @user = current_user\n owner_id = product_params[ :owner_id ]\n if not (owner_id && (owner_id.to_i > 0))\n # To not choose box once again.\n @box_id = product_params[ :box_id ]\n respond_to do |format|\n format.html { redirect_to edit_product_path( @product.id ), notice: 'ERROR: It is necessary to provide a person in charge explicitly!!!' }\n format.json { head :no_content }\n end\n return\n end\n\n # Set box id and exactly in this order.\n product_params[ :box_id ] ||= @product.box_id\n\n respond_to do |format|\n if @product.update(product_params)\n @product.set_status( product_params[ :status ] )\n log( \"Product is updated: \" + @product.serial_number, @user )\n \n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cec7d05514930eefadb2cce2594ac610",
"score": "0.6743798",
"text": "def update\n product = Product.find(params[:id])\n\n if product.update_attributes(params[:product])\n response = formatted_response(true, product, t('api.message.catalog.products.update.success'))\n else\n response = formatted_response(false, product.errors, t('api.message.catalog.products.update.failure'))\n end\n\n render :json => response\n end",
"title": ""
},
{
"docid": "7dc0659a88aa63601a03353af259c908",
"score": "0.67414594",
"text": "def product_id= prod_id\n return if product\n super\n commit_quantity\n end",
"title": ""
},
{
"docid": "3b2713830c77f82f958ede027c85303a",
"score": "0.6740227",
"text": "def sync_erp_item_and_products\n\t\t\t\t\tbegin\n\t\t\t\t\t\tremote_inventories = get_remote_inventories\n\t\t\t\t\t\tupdate_remote_inventories_to_erp_items( remote_inventories )\n\n\t\t\t\t\t\tvaries_data = update_products( get_removed_or_new_added_items_to_axobj(remote_inventories) )\n\t\t\t\t\t\tconnection.execute \"TRUNCATE sync_ax_products\" if remote_inventories\n\t\t\t\t\t\tunless varies_data[:new_items].blank?\n\t\t\t\t\t\t\tvaries_data[:new_items].each do |item|\n\t\t\t\t\t\t\t\tif ( item.erp_product_item.match(/^[0-9]{6}([\\w\\-\\.]+)?$/) )\n\t\t\t\t\t\t\t\t\tsap = SyncAxProduct.new(:product_id => Product.find_by_erp_product_item(item.erp_product_item).id,\n\t\t\t\t\t\t\t\t\t:erp_product_item => item.erp_product_item,\n\t\t\t\t\t\t\t\t\t:name => item.name,\n\t\t\t\t\t\t\t\t\t:price => item.price,\n\t\t\t\t\t\t\t\t\t:quantity => item.quantity,\n\t\t\t\t\t\t\t\t\t:deposit => item.deposit,\n\t\t\t\t\t\t\t\t\t:shipping_points => item.shipping_points,\n\t\t\t\t\t\t\t\t\t:group_id => item.group_id,\n\t\t\t\t\t\t\t\t\t:product_status => item.product_status,\n\t\t\t\t\t\t\t\t\t:status => \"new_items\"\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\tsap.save\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\n\t\t\t\t\t\tunless varies_data[:removed_items].blank?\n\t\t\t\t\t\t\tvaries_data[:removed_items].each do |item|\n\t\t\t\t\t\t\t\tProduct.find_all_by_erp_product_item(item.item_id).each do |product| \n\t\t\t\t\t\t\t\t\tsap = SyncAxProduct.new(:product_id => product.id,\n\t\t\t\t\t\t\t\t\t:erp_product_item => item.item_id,\n\t\t\t\t\t\t\t\t\t:name => item.name,\n\t\t\t\t\t\t\t\t\t:price => item.price,\n\t\t\t\t\t\t\t\t\t:dim_group_id => item.dim_group_id,\n\t\t\t\t\t\t\t\t\t:model_group_id => item.model_group_id ,\n\t\t\t\t\t\t\t\t\t:group_id => item.group_id,\n\t\t\t\t\t\t\t\t\t:percent_deposit => item.percent_deposit,\n\t\t\t\t\t\t\t\t\t:amount_deposit => item.amount_deposit,\n\t\t\t\t\t\t\t\t\t:shipping_points => item.shipping_points, \n\t\t\t\t\t\t\t\t\t:status => \"removed_items\"\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\tsap.save \n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\n\t\t\t\t\t\tunless varies_data[:changed_items].blank?\n\t\t\t\t\t\t\tvaries_data[:changed_items].each do |item|\n\t\t\t\t\t\t\t\tProduct.find_all_by_erp_product_item(item[:item].item_id).each do |product| \n\t\t\t\t\t\t\t\t\tsap = SyncAxProduct.new(:product_id => product.id,\n\t\t\t\t\t\t\t\t\t:erp_product_item => item[:item].item_id,\n\t\t\t\t\t\t\t\t\t:name_local => item[:original][:name],\n\t\t\t\t\t\t\t\t\t:name_ax => item[:current][:name],\n\t\t\t\t\t\t\t\t\t:price_local => item[:original][:price],\n\t\t\t\t\t\t\t\t\t:price_ax => item[:current][:price],\n\t\t\t\t\t\t\t\t\t:deposit_local => item[:original][:deposit],\n\t\t\t\t\t\t\t\t\t:deposit_ax => item[:current][:deposit],\n\t\t\t\t\t\t\t\t\t:shipping_points_local => item[:original][:shipping_points],\n\t\t\t\t\t\t\t\t\t:shipping_points_ax => item[:current][:shipping_points],\n\t\t\t\t\t\t\t\t\t:status => \"changed_items\"\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\tsap.save\n\t\t\t\t\t\t\t\tend \n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\n\t\t\t\t\t\tOrdersMailer.deliver_sync_products_and_erp_items\n\t\t\t\t\trescue => e\n\t\t\t\t\t\tmessage = \"Failed to sync erp items and products description.<br/> <p style = 'color:red'> #{e.message} </p>\"\n\t\t\t\t\t\tOrdersMailer.deliver_sync_products_failed_mail( message )\n\t\t\t\t\tend\n\t\t\t\tend",
"title": ""
},
{
"docid": "e5cac50018f109014d7c07db7bed2699",
"score": "0.6738007",
"text": "def update\n debugger\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to user_products_path(current_user), notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eea078ea4c1c0bca4519c4a7917c9f29",
"score": "0.6733413",
"text": "def update\n @product_result = ProductResult.get(params[:id])\n @product_result_item = items_params\n\n #トランザクション開始\n ProductResult.transaction{\n calctool = Cost.new\n ProductResultItem.all(:relation_id => params[:id]).map {|item|\n item.destroy\n }\n sum = 0\n\n station_id = params[:product_result][:station_id]\n #使用アイテム登録\n @product_result_item.each{|item|\n if item.type_id != \"\" then\n item.relation_id = params[:id]\n item.type_id = InvTypes.first(:type_name => item.type_id)[:type_id]\n if BluePrintPurchase.first(:type_id => item.type_id) == nil then\n item.sum_price = calctool.calculate_material_cost(item.type_id) * item.use_item_count\n\n #在庫反映待ちへの登録\n owner =UserList.first(:user_id => @product_result.owner_id)[:user_name]\n type_name = InvTypes.first(:type_id => @product_result.type_id)[:type_name]\n w = AssetListsComp.first(:sync_type => 1,:sync_id => params[:id],:type_id => item.type_id)\n puts \"反映待ち\"\n puts item.type_id.to_s\n puts \"----\"\n if w != nil\n puts \"反映待ち登録 実行\"\n puts item.use_item_count.to_s\n puts \"登録end----\"\n owner =UserList.first(:user_id => @product_result.owner_id)[:user_name]\n w.update( :quantity => - item.use_item_count,\n :station_id => station_id,\n :comment => \"生産 :\" + type_name + \" ,生産数 : \" + @product_result.create_count.to_s +\n \" ,owner : \" + owner,\n :add_date => Time.now.utc)\n end\n else\n item.sum_price = calctool.calculate_blueprint_cost(item.type_id) * item.use_item_count\n end\n sum += item.sum_price\n item.save\n end\n }\n\n # 実績登録\n # @product_result.sum_price = sum\n owner_id = params[:product_result][:owner_id]\n create_count = params[:product_result][:create_count]\n\n #在庫反映待ちへの登録\n type_name = InvTypes.first(:type_id => @product_result.type_id)[:type_name]\n w = AssetListsComp.first(:sync_type => 1,:sync_id => params[:id],:type_id => @product_result.type_id)\n if w != nil\n owner =UserList.first(:user_id => @product_result.owner_id)[:user_name]\n w.update( :quantity => @product_result.create_count,\n :station_id => station_id,\n :comment => \"生産 :\" + type_name + \" ,生産数 : \" + @product_result.create_count.to_s +\n \" ,owner : \" + owner,\n :add_date => Time.now.utc)\n\n end\n\n respond_to do |format|\n if @product_result.update(:owner_id => owner_id,\n :create_count => create_count,\n :sum_price => sum,\n :station_id => station_id,\n :transaction_date_time => Time.now.utc)\n format.html { redirect_to @product_result, notice: 'Product result was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product_result.errors, status: :unprocessable_entity }\n end\n end\n }\n end",
"title": ""
},
{
"docid": "d9f5c06805745ddaae750d93618239bb",
"score": "0.6727871",
"text": "def update_product_qoo10(id, params, object, user_market_place, taxon_market_places, market_place_product, old_description, old_price, old_special_price)\n @error_message = []\n @object = object\n begin\n retail_price = params[:product][:price]\n item_description = object.description_details(\"qoo10\")\n item_title = object.title_details(\"qoo10\")\n shipping_no = user_market_place.shipping_code.to_s \n seller_code = market_place_product.product.sku.present? ? market_place_product.product.sku : \"\" rescue \"\"\n uri = URI('http://api.qoo10.sg/GMKT.INC.Front.OpenApiService/GoodsBasicService.api/UpdateGoods')\n req = Net::HTTP::Post.new(uri.path)\n req.set_form_data({'key'=>user_market_place.api_secret_key.to_s,'ItemCode'=>market_place_product.market_place_product_code,'SecondSubCat'=>taxon_market_places.market_place_category_id.to_s,'ManufactureNo'=>'','BrandNo'=>'','ItemTitle'=>item_title[\"title\"].to_s,'SellerCode'=>seller_code.to_s,'IndustrialCode'=>'','ProductionPlace'=>'','ContactTel'=>'','RetailPrice'=>retail_price.to_s,'ShippingNo'=>shipping_no.to_s,'AvailableDateType'=>'','AvailableDateValue'=>''})\n res = Net::HTTP.start(uri.hostname, uri.port) do |http| http.request(req) end\n if res.code == \"200\"\n uri = URI('http://api.qoo10.sg/GMKT.INC.Front.OpenApiService/GoodsBasicService.api/EditGoodsContents')\n req = Net::HTTP::Post.new(uri.path)\n req.set_form_data({'key'=>user_market_place.api_secret_key.to_s,'ItemCode'=>market_place_product.market_place_product_code,'SellerCode'=>seller_code.to_s,'Contents'=>item_description[\"description\"].to_s})\n res = Net::HTTP.start(uri.hostname, uri.port) do |http| http.request(req) end\n if res.code != \"200\"\n res_body = Hash.from_xml(res.body).to_json\n res_body = JSON.parse(res_body, :symbolize_names=>true)\n @error_message << user_market_place.market_place.name+\": \"+res_body[:StdResult][:ResultMsg]\n end\n #if params[:product][:special_price].to_f != old_special_price.to_f\n item_qty = @object.stock_products.where(:sellers_market_places_product_id=>market_place_product.id).sum(:count_on_hand)\n uri = URI('http://api.qoo10.sg/GMKT.INC.Front.OpenApiService/GoodsOrderService.api/SetGoodsPrice')\n req = Net::HTTP::Post.new(uri.path)\n req.set_form_data({'key'=>user_market_place.api_secret_key.to_s,'ItemCode'=>market_place_product.market_place_product_code,'SellerCode'=>seller_code.to_s,'ItemPrice'=>params[:product][:selling_price].to_s,'ItemQty'=>item_qty,'ExpireDate'=>''})\n res = Net::HTTP.start(uri.hostname, uri.port) do |http| http.request(req) end\n if res.code != \"200\"\n res_body = Hash.from_xml(res.body).to_json\n res_body = JSON.parse(res_body, :symbolize_names=>true)\n @error_message << user_market_place.market_place.name+\": \"+res_body[:StdResult][:ResultMsg]\n end\n #end\n #if params[:product][:special_price] != old_special_price\n discount_type = (params[:product][:special_price].nil? || (!params[:product][:special_price].nil? && params[:product][:special_price].to_f == 0.0)) ? 0 : 1\n s_sday = Time.now.strftime(\"%Y-%m-%d\")\n s_eday = (Time.now+1.year).strftime(\"%Y-%m-%d\")\n discounted_price = (params[:product][:selling_price].to_f - params[:product][:special_price].to_f).to_s\n # uri = URI('http://api.qoo10.sg/GMKT.INC.Front.OpenApiService/GoodsBasicService.api/UpdateItemDiscount')\n # req = Net::HTTP::Post.new(uri.path)\n # req.set_form_data({'key'=>user_market_place.api_secret_key.to_s,'ItemCode'=>market_place_product.market_place_product_code,'SellerCode'=>seller_code.to_s,'s_sday'=>s_sday.to_s,'s_eday'=>s_eday.to_s,'s_cost_price'=>discounted_price,'discount_type'=>discount_type.to_s})\n # res = Net::HTTP.start(uri.hostname, uri.port) do |http| http.request(req) end\n # if res.code != \"200\"\n # res_body = Hash.from_xml(res.body).to_json\n # res_body = JSON.parse(res_body, :symbolize_names=>true)\n # @error_message << user_market_place.market_place.name+\": \"+res_body[:StdResult][:ResultMsg]\n # end\n #end\n else\n res_body = Hash.from_xml(res.body).to_json\n res_body = JSON.parse(res_body, :symbolize_names=>true)\n @error_message << user_market_place.market_place.name+\": \"+res_body[:StdResult][:ResultMsg]\n end\n rescue Exception => e\n @error_message << user_market_place.market_place.name+\": \"+e.message\n end\n return @error_message.length > 0 ? @error_message.join(\"; \") : true\n end",
"title": ""
},
{
"docid": "2afea75daf29d2525bfe7b3a2f3dce2c",
"score": "0.6713824",
"text": "def update\n DATABASE.execute(\"UPDATE products SET id = #{@id}, general_info = '#{@general_info}', \n technical_specs = '#{@technical_specs}', where_to_buy = '#{@where_to_buy}' \n WHERE id = #{@id}\")[0]\n end",
"title": ""
},
{
"docid": "d9a5fe1cd916b8e11bbc44d4ea3bfa90",
"score": "0.67099935",
"text": "def update\n \n #kill any non-unique product sub-categories\n if params && params[:product] && params[:product][:subcategory_ids]\n params[:product][:subcategory_ids].uniq!\n end\n \n @product = Product.find(params[:id])\n \n #setup the end action for redirects & renders\n if params[:end_action]\n go_to = {:action => params[:end_action].to_sym, :id => @product }\n else\n go_to = edit_admin_product_path(@product)\n end\n\n=begin\n respond_to do |format|\n \n if @product.update_attributes(params[:product])\n \n flash[:notice] = 'Product was successfully updated.'\n format.html { redirect_to(go_to) and return }\n format.xml { head :ok }\n else\n format.html { render go_to }\n format.xml { render :xml => @product.errors, :status => :unprocessable_entity }\n end\n \n end #end respond_to\n=end\n \n if @product.update_attributes(params[:product])\n \n flash[:notice] = 'Product was successfully updated.'\n redirect_to(go_to) and return\n \n else\n render go_to and return\n end\n\n \n #failsafe\n flash[:error] = \"There was somethink funky going on when you saved, maybe you should check your work.\"\n redirect_to(edit_admin_product_path(@product)) and return\n \n end",
"title": ""
},
{
"docid": "c1d72c3a834d02ca97cb11d0babb8f70",
"score": "0.6708948",
"text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product.store, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { redirect_to @product.store, :flash => { :error => @product.errors.map{|k,v| \"#{k} #{v}\"}.join(',') } }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fb61fd8ee961210a531079b52cf074a4",
"score": "0.67068154",
"text": "def update\n begin\n @ren = Rendicionprod.find(@ventaprod.rendicionprod_id)\n @entregaprod=Entregaprod.find(@ventaprod.entregaprod_id)\n @actu=params[:ventaprod]\n @ingreso=@ventaprod.ingreso \n\n if @entregaprod.cantidad.to_i- @ren.cantidad.to_i < @actu[:cantidad].to_i\n flash[:warning] = 'No puede vender mas producto del rendido' \n redirect_to '/entregaprods/'+@ventaprod.entregaprod_id.to_s\n elsif @ventaprod.update(ventaprod_params)\n if @ingreso!=nil\n @ingreso.montoBs = @actu[:cantidad].to_i*@actu[:precioUnidad].to_i\n @ingreso.save\n end\n flash[:success] ='Venta producto actualizado exitosamente' \n redirect_to '/entregaprods/'+@ventaprod.entregaprod_id.to_s\n else\n render action: \"edit\"\n end \n rescue Exception => e\n redirect_to '/entregaprods/'+@ventaprod.entregaprod_id.to_s\n end\n \n end",
"title": ""
},
{
"docid": "aa59475a20933efff9ac8bd6e4b968a4",
"score": "0.67040086",
"text": "def update\n @product = Product.find(params[:id])\n\n if @product.update(product_params)\n head :no_content\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "aa59475a20933efff9ac8bd6e4b968a4",
"score": "0.67040086",
"text": "def update\n @product = Product.find(params[:id])\n\n if @product.update(product_params)\n head :no_content\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ae1a5fb2696b7de06534efc3b276afdf",
"score": "0.6696024",
"text": "def update \n @shop_product = ShopProduct.find(params[:id])\n if @shop_product.update_attributes!(params[:shop_product])\n respond_to do |format|\n flash[:notice] = \"Product updated successfully.\"\n format.html { redirect_to admin_shop_products_path }\n format.xml { redirect_to \"/admin/shop/products/#{@shop_product.id}.xml\" }\n format.json { redirect_to \"/admin/shop/products/#{@shop_product.id}.json\" }\n end\n else\n respond_to do |format|\n flash[:error] = \"Unable to update new product.\"\n format.html { }\n format.xml { render :xml => @shop_product.errors.to_xml, :status => 422 }\n format.json { render :json => @shop_product.errors.to_json, :status => 422 }\n end\n end\n end",
"title": ""
},
{
"docid": "f71c6c645b5b70b78169a82553d2b0da",
"score": "0.66959447",
"text": "def update_magento_product\n self.stores.each do |store|\n response = API::SOAP::Catalog::Product.update(self, store)\n\n unless response.success?\n errors.add(:base, response.body[:faultstring])\n return false\n end\n end\n\n self.sync_needed = false\n return true\n end",
"title": ""
},
{
"docid": "e1c63b006d1dd560fa2556edeee02a6d",
"score": "0.6695086",
"text": "def update\n product_ids = params[:product][:product_ids]&.map {|a| eval(a)} || []\n respond_to do |format|\n @product.attributes = product_params\n @product.product_ids = product_ids\n if @product.quantity_changed? \n ProductService.new.tracking_product_quantity(@product.quantity, @product)\n end\n if @product.suggest_price_changed? \n random = rand(2.25 .. 2.75)\n @product.variants.each do |variant|\n variant.price = @product.suggest_price\n variant.compare_at_price = (variant.price * random/ 5).round(0) * 5\n variant.save\n end\n end\n if @product.save\n if params[:product][:images]\n params[:product][:images].each do |img|\n #params[:images].each do |key, value|\n @product.images.create(file: img)\n end\n end\n format.html { redirect_to edit_product_path(@product), notice: 'Product was successfully updated.' }\n # format.json { render :show, status: :ok, location: @product }\n format.json { render json: @product, status: :created }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b7affbe22f55eaf6d7cc2a5f80486518",
"score": "0.6687373",
"text": "def update\n @product = Product.find(params[:id])\n\n if @product.update_attributes(params[:product])\n head :no_content\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "639be9da984ebd9c1fbf94728160f879",
"score": "0.6664311",
"text": "def update\n @product = Product.find(params[:id])\n apply_other_price_if_required\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to(@product, :notice => 'Product was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @product.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bbb97ee0db10bf4be71f0cadadad6660",
"score": "0.666206",
"text": "def update\n \t @product = Product.find(params[:id])\n \t if @product.update_attributes(params[:product].permit(:name,:description, :price, :stock, :category_id, :cod_eligible, :image_url))\n redirect_to product_path(@product.id), notice: \"The product was successfully updated\"\n else\n render action: \"edit\"\n end\n end",
"title": ""
},
{
"docid": "15185e214c1ec6ac5a5f632f1d438c48",
"score": "0.66603595",
"text": "def edit_product\n product_list\n puts \"ENTER PRODUCT TO EDIT(BY NUMBER)\"\n product_to_edit = gets.to_i\n product = Product.find(\"products\", product_to_edit)\n product.display_attributes\n raw_field = \"\"\n puts \"ENTER FIELD TO EDIT\"\n raw_field = gets.chomp\n until raw_field.downcase == \"done\"\n puts \"ENTER CHANGE\"\n raw_change = gets.chomp\n verify_edit(product, raw_field, raw_change)\n puts \"ENTER ANOTHER FIELD TO EDIT(TYPE DONE TO FINISH)\"\n raw_field = gets.chomp\n end\n puts \"PRESS 1 TO SAVE CHANGES, PRESS ANYTHING ELSE TO CANCEL\"\n verify = gets.chomp\n if verify == \"1\"\n product.save(\"products\")\n puts \"CHANGES SAVED\"\n puts \"HERE IS THE UPDATED PRODUCT INFORMATION:\\n\"\n product.display_attributes\n else puts \"PROCESS CANCELLED\"\n end\n end",
"title": ""
},
{
"docid": "26ab610ea3bf671221992f0aaf562a63",
"score": "0.66599935",
"text": "def update\n begin\n product = Product.find(plan_params[:product_id])\n \t\t @plan.update!(product: product)\n \t\t redirect_to @plan, notice: 'Plan was successfully updated.'\n \t\trescue\n \t\trender json: @plan.errors, status: :unprocessable_entity \n \tend\n end",
"title": ""
},
{
"docid": "ebd9fdf19026a396dbd0522ded2f5081",
"score": "0.6657761",
"text": "def update\n @product = Product.find(params[:id])\n\n if @product.update(params)\n head :no_content\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ed046da791860f7b204caf4b1f2b71f4",
"score": "0.66565686",
"text": "def update\n if @product.update(product_params)\n flash[:success] = \"Product was successfully updated\"\n #Use of logger class to log messages into the log file\n Logger.instance.log(Time.now.to_s + \": Product updated \\n\")\n redirect_to product_path(@product)\n else\n render 'edit'\n end\n end",
"title": ""
},
{
"docid": "0be71cfad5b4baeb616b65bae2f60213",
"score": "0.6637995",
"text": "def update\n #find the product\n @product = Product.find(params[:id])\n\n #if successfully updated, redirect to index, else show the form with error\n if @product.update_attributes(params[:product])\n return redirect_to [:admin, :products], notice: 'Product updated successfully.'\n else\n return render action: :edit\n end\n end",
"title": ""
},
{
"docid": "bcef8b1de1cb11568b7934c4508e06cf",
"score": "0.66379523",
"text": "def update\n @product = Product.find(params[:id])\n\n if @product.update_attributes(params[:product])\n redirect_to admin_leelah_catalog_management_products_path, :notice => t('admin_leelah.catalog_management.products.index.notice.success.update')\n else\n render :index\n end\n end",
"title": ""
},
{
"docid": "c81c110d3360f19fcbea1955514be56c",
"score": "0.66360253",
"text": "def update\n Product.paper_trail_off!\n respond_to do |format|\n if strong_xedit_params(params[:name]) && @product.update_attributes(params[:name] => params[:value])\n format.json { render :show, status: :ok, location: @product }\n rollback @product\n else\n format.json { render json: @product.errors, status: :bad_request}\n end\n end\n Product.paper_trail_on!\n end",
"title": ""
},
{
"docid": "b41fe41c4ecbf67ec10ab0d4b8357fc4",
"score": "0.6635987",
"text": "def update\n respond_to do |format|\n if @purchase_product.update_attributes(purchase_product_params)\n format.html { redirect_to @purchase_product.purchase, notice: 'Purchase product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @purchase_product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4bf4a051c1749709d4f1bd74e7aa8868",
"score": "0.66351116",
"text": "def update # this is where the form displayed in 'edit' is submitted using verb \"patch\"\n if @product.update(product_params)\n flash[:success] = \"Product was successfully updated\"\n redirect_to product_path(@product)\n else\n #for error messages to appear\n render :edit, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d33640d987ff74452a8243461825ad9b",
"score": "0.6632988",
"text": "def update\n @product = Product.find(params[:id])\n if @product.update_attributes(product_params)\n flash[:notice] = \"Ad updated successfully.\"\n redirect_to(:action => 'index', status: 301)\n else\n render('edit')\n end\n end",
"title": ""
},
{
"docid": "657128203df41a702e155a0449abfab9",
"score": "0.66284806",
"text": "def update\n Product.transaction do\n @product = Product.find(params[:id])\n DepartmentsProducts.delete_all(:product_id => @product.id)\n CategoriesProducts.delete_all(:product_id => @product.id)\n\n save_success = false\n params[:department_param] && params[:department_param].each do |department_id|\n @departments_products = DepartmentsProducts.new(:product_id => @product.id, \n :department_id => department_id)\n save_success = @departments_products.save\n if save_success == false\n break\n end\n end\n\n if params[:category_param] \n @categories_products = CategoriesProducts.new(:product_id => @product.id, :category_id => params[:category_param])\n save_success = @categories_products.save\n end\n\n respond_to do |format|\n if @product.update_attributes(params[:product]) && save_success\n format.html { redirect_to(@product, :notice => '更新しました。') }\n format.xml { head :ok }\n else\n # Not DRY! Do refactoring!\n @departments = Department.all\n\n @categories = Category.all\n category = Category.new\n @category_names = category.get_category_hash(@categories)\n\n @products = Product.all\n product = Product.new\n @product_names = product.get_product_hash(@products)\n\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @product.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "1f577f65a66f3c772462d09ba4d9bc79",
"score": "0.662628",
"text": "def update\n @product = Product.find(params[:id])\n if @product.moderation == 1 or params[:product][:main_image_original_w].present?\n respond_to do |format|\n if @product.update(product_params)\n @product.update(:moderation => 0)\n ProductMailer.update_product.deliver\n format.html { redirect_to seller_panel_product_path, notice: 'Товар успешно обновлён и отправлен на модерацию' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to seller_panel_product_path\n flash[:notice] = 'Товар ещё не прошёл модерацию'\n end\n end",
"title": ""
},
{
"docid": "5f0159e726c558d0871c7116ad363a0a",
"score": "0.6626119",
"text": "def update_product(redbox_product)\n product = Spree::Variant.where(redbox_product_id: redbox_product.id).first.product\n set_stores product, redbox_product\n update_fields(product, redbox_product, PRODUCT_FIELDS_UPDATE.merge(created_at: ['Time.at(@1)', 'added'], tax_category: ['Spree::TaxRate.rate@1.tax_category', 'vat']))\n @migrate_variant.update_variants product, redbox_product\n product.created_at = product_created_at product\n product.save\n product\n end",
"title": ""
},
{
"docid": "a8c39bea3046223d41a6156614df2fe7",
"score": "0.66258",
"text": "def update\n if @product.update(product_params)\n render json: @product, status: :ok\n else\n render json: @product.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f9325d238b41653f92687dc34ffa3f81",
"score": "0.6624939",
"text": "def update\r\n @product_product = ProductProduct.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @product_product.update_attributes(params[:product_product])\r\n format.html { redirect_to @product_product, notice: 'Produkt wurde erfolgreich aktualisiert.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @product_product.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "c372faa11406c963a61119dd492dac48",
"score": "0.6624174",
"text": "def update\n begin\n Rails.logger.info_log.info \" I,[#{Time.now.strftime(\"%Y-%m-%d %H:%M:%S %Z\")}]\" \"INFO -- : GoodsReceipt Update\"\n if @goods_receipt.update(goods_receipt_params)\n render json: @goods_receipt\n else\n render json: @goods_receipt.errors, status: :unprocessable_entity\n end\n rescue => e\n Rails.logger.custom_log.error { \"#{e} manufacturersync_controller update method\" }\n end\n end",
"title": ""
},
{
"docid": "ef4ec5f0bd0868c7d4ba31530e822826",
"score": "0.66209954",
"text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n puts \"product created\"\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "154f6e82044c3722e69538f7f8b1d0c9",
"score": "0.6612066",
"text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to [:admin, @product], notice: t('messages.updated', model:Product.model_name.human) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8f806e2f7a8c3aec44089cce9b550488",
"score": "0.66064227",
"text": "def update\n product = @user.products.find(params[:id])\n if !product.update(product_update_params)\n return render json: { error: @product.errors }, status: 422\n else\n return render json: { updated: true }, status: 200\n end\n end",
"title": ""
},
{
"docid": "c26e41c78232a98ae8ec0b59311fe790",
"score": "0.6603524",
"text": "def update_product!(existing_product, new_product_hash)\n existing_product.update(brand: new_product_hash[@brand].strip, code: new_product_hash[@code].strip,\n stock: new_product_hash[@stock].strip,\n name: new_product_hash[@name].strip, cost: new_product_hash[@cost].strip.to_d)\n # Add +1 to skipped counter for stats\n @skipped_counter += 1\n end",
"title": ""
},
{
"docid": "3449008ec7b41c37d560bc3f500426de",
"score": "0.66020906",
"text": "def update\n # Event-b: grd1: product ∈ products\n @product = Product.find(params[:id])\n\n params[:stock_level].each do |sl_id, sl|\n begin\n @stock_id = StockLevel.find(:first, :conditions => {:product_id => params[:id].to_i, :stock_location_id =>sl_id.to_i})\n @product.stock_levels.update(@stock_id, :quantity =>sl[:quantity], :threshold => sl[:threshold])\n rescue ActiveRecord::RecordNotFound\n @product.stock_levels.build(:stock_location => StockLocation.find(sl_id.to_i), :quantity =>sl[:quantity], :threshold => sl[:threshold])\n end\n end\n\n respond_to do |format|\n @supplier = Supplier.find(Integer(params[:product][:supplier]))\n params[:product][:supplier] = @supplier\n\n # Event-b: act1: productprice(product) ≔ price\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "35a4fc4c1cd0b64d4b9b58892033d17b",
"score": "0.65982544",
"text": "def update\n @resource_title = \"Edit Produk\"\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0db35eaab86dcf6c68846071f10731d6",
"score": "0.65974206",
"text": "def update_product_price\n\n \tif @old_price != unitprice && @old_price != 0\n \t\t#price = ProductPrices.new (product_id: id, old_price: @old_price, new_price: unitprice, user_id: current_user.id)\n \t\tprice = ProductPrices.new\n \t\tprice.product_id = id\n \t\tprice.old_price = @old_price\n \t\tprice.new_price = unitprice\n \t\t#price.user_id = current_user.id\n \t\tprice.save\n \tend\n end",
"title": ""
},
{
"docid": "8723c6f312796e3d6aaef844481caf39",
"score": "0.65944284",
"text": "def save_product(product)\n \tproduct.save\n end",
"title": ""
},
{
"docid": "8757e2ffb36a4748277711e3376d5225",
"score": "0.65944207",
"text": "def update\n respond_to do |format|\n if @product.update(prodcut_params)\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\nend",
"title": ""
},
{
"docid": "22918ef1cef8b36721e8be54e8b4f090",
"score": "0.6593967",
"text": "def update\n # respond_to do |format|\n # if @product.update(product_params)\n # format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n # format.json { render :show, status: :ok, location: @product }\n # else\n # format.html { render :edit }\n # format.json { render json: @product.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "f0eced529f3af2bf14a4479343e812a5",
"score": "0.6593231",
"text": "def update\n MonitoringProduct.transaction do\n @monitoring_product.update!(monitoring_product_params)\n end\n\n respond_to do |format|\n set_monitoring_products_grid\n format.html { redirect_to @monitoring_product, notice: 'MonitoringProduct was successfully updated.'}\n format.js\n end\n rescue ActiveRecord::Rollback\n respond_to do |format|\n format.html { render :edit }\n format.js { render :edit }\n end\n end",
"title": ""
},
{
"docid": "f4995ac1a8799e7324b513a1f7e252b5",
"score": "0.65922105",
"text": "def update_existing_dealer(log, jblpro, existing_dealer, dealer_data, product_data, really_run)\n existing_dealer.first.name = dealer_data[:name]\n existing_dealer.first.address = dealer_data[:address]\n existing_dealer.first.city = dealer_data[:city]\n existing_dealer.first.zip = dealer_data[:zip]\n existing_dealer.first.country = dealer_data[:country]\n existing_dealer.first.region = dealer_data[:region]\n existing_dealer.first.website = dealer_data[:website]\n existing_dealer.first.telephone = dealer_data[:telephone]\n existing_dealer.first.name2 = dealer_data[:contact]\n existing_dealer.first.account_number = dealer_data[:acount_number]\n existing_dealer.first.rental = dealer_data[:rental]\n\n brand_dealer = BrandDealer.where(\"brand_id=? and dealer_id=?\", jblpro.id, existing_dealer.first.id).first\n products_to_add = Product.where(\"cached_slug in (?)\", product_data)\n\n # This is the real thing, we're actually doing this\n if really_run\n # save updates\n existing_dealer.first.save\n\n # remove any existing brand rental product associations\n BrandDealerRentalProduct.where(\"brand_dealer_id=?\",brand_dealer.id).delete_all\n\n # add rental product associations\n products_to_add.to_a.each_with_index do |product, position|\n BrandDealerRentalProduct.create(brand_dealer_id: brand_dealer.id, product_id: product.id, position: position)\n write_message(log, \" Added rental product #{product.name}\")\n end # products_to_add.to_a.each_with_index do |product, position|\n\n end # if really_run\n\n # We are just doing a dry run\n if !really_run\n products_to_add.to_a.each_with_index do |product, position|\n write_message(log, \" Added rental product #{product.name}\")\n end\n end # if !really_run\n\n end",
"title": ""
},
{
"docid": "683336a062273ac842515905e424c5ef",
"score": "0.65905064",
"text": "def update\n respond_to do |format|\n if @product.update(product_params)\n\n # Check updated status of product to update order\n if product_params[:status] == \"Out of stock\"\n Order.where(product: product_params[:name]).update({\"status\" => \"Sold out\"})\n else \n Order.where(product: product_params[:name]).update({\"status\" => \"Ordering\"})\n end\n\n # Notice update status\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4209aac78f3dac243f75ce1976897f22",
"score": "0.6590141",
"text": "def update\n @product = Product.find_by_id(params[:id])\n if @product.update(product_params)\n flash[:success] = \"Your product has been updated successfuly \"\n redirect_to root_url\n else\n flash[:error] = \"There is some error in updating product. Please try again\"\n render 'edit'\n end\n end",
"title": ""
},
{
"docid": "140a03627ab9122f5991ccb5be3fbe40",
"score": "0.65889394",
"text": "def update\n\t\t# temp_url_string is used to temporarily save an existing product's img_url filename, \n\t\ttemp_url_string = Product.find(params[:id]).img_url\n\t\t@product = Product.find(params[:id])\n\t\tif @product.update_attributes(params[:product])\n\t\t\t# if the updated product's img_url attribute is blank\n\t\t\tif @product.img_url.empty? \n\t\t\t\t# this copy of the filename string is assigned to the img_url attribute \n\t\t\t\t@product.update_attribute(:img_url, temp_url_string)\n\t\t\tend\n\t\t\t# redirect_to @product, notice: 'Product was successfully updated.'\n\t\t\t# redirect_to @product, notice: \"'\" + @product.title + \"'\" + \" was successfully updated.\"\n\t\t\tredirect_to @product, notice: \"'#{@product.title}' was successfully updated.\" \n\t\telse\n\t\t\trender action: \"edit\" \n\t\tend\n\tend",
"title": ""
},
{
"docid": "42a73f694e83cc269d37736610e44aa1",
"score": "0.65860254",
"text": "def update\n respond_to do |format|\n if !@product.update_attributes(product_params).nil?\n format.html { redirect_to @product_path, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bba0799a929ddc475dc20b15ca459f2",
"score": "0.6581663",
"text": "def update\n respond_to do |format|\n if @product.update(product_params)\n format.html { redirect_to @product, notice: 'Продукция была успешно обновлена.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "85a40ad93afeaa474b41aa584935d7b3",
"score": "0.6579278",
"text": "def supplier_update\n Rails.logger.info_log.info \" I,[#{Time.now.strftime(\"%Y-%m-%d %H:%M:%S %Z\")}]\" \"INFO -- : User click the products supplier_update button\"\n begin\n user=User.find(params[:id]).update(:supplier_id=>params[:user[:supplier_id]])\n render json: user\n rescue =>e\n Rails.logger.custom_log.error { \"#{e} products_controller supplier_update method\" }\n end\n end",
"title": ""
},
{
"docid": "065bd35edfdc1792b30aef7c46bbcb8b",
"score": "0.6577637",
"text": "def update\n if @product.update_attributes(product_params)\n render json: @product\n else\n render_errors 400, @product.errors.full_messages\n end\n end",
"title": ""
},
{
"docid": "dd7955bb4756a0148a45e268c4cd22f0",
"score": "0.6576342",
"text": "def update\n @product = Product.find(params[:id])\n\n respond_to do |format|\n if @product.update_attributes(params[:product])\n flash[:notice] = \"Product #{@product.part_number} was successfully updated.\"\n format.html { redirect_to(:action=>'index') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @product.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9fe361aded0465323a9d50a38f9b009",
"score": "0.65723467",
"text": "def update\n begin\n @entregaprod=Entregaprod.find(@rendicionprod.entregaprod_id)\n @actu=params[:rendicionprod]\n\n @stock = Stock.find_by product_id: @entregaprod.product_id\n @editar = @actu[:cantidad].to_i - @rendicionprod.cantidad.to_i\n @stock.cantidad +=@editar\n\n if @entregaprod.cantidad.to_i < @actu[:cantidad].to_i\n flash[:warning] = 'No puede devolver mas producto del entregado' \n render action: \"edit\" and return\n elsif @rendicionprod.update(rendicionprod_params) && @stock.save\n flash[:success] ='Devolucion producto actualizado exitosamente'\n redirect_to '/entregaprods/'+@rendicionprod.entregaprod_id.to_s\n else\n render action: \"edit\"\n end \n rescue Exception => e\n render action: \"edit\"\n end\n \n end",
"title": ""
},
{
"docid": "8c5a1fbd889a3026f5e5e25591b5cb47",
"score": "0.65521634",
"text": "def update\n @product = Product.find(operation_params[:product_id])\n operation = @operation\n product = @product\n respond_to do |format|\n if Operation.invoice operation, product \n @operation.update(operation_params)\n if operation.subtotal != product.precio*operation.cantidad\n Operation.invoice operation, product \n else\n @operation.update(operation_params)\n end \n @operation.update(operation_params)\n format.html { redirect_to @operation, :notice => 'La operación fue editada exitosamente' }\n format.json { render :show, status: :ok, location: @operation }\n else\n format.html { render :edit }\n format.json { render json: @operation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cf48cad7b62892277f48dc6d2255c165",
"score": "0.6549695",
"text": "def update\n\t\t@product = Product.find(params[:id])\n\t\tnewParams = params[:product].merge(:company_id => current_employee.company_id)\n\t\tunit = params[:unit]\n\t\tif unit == \"metric\"\n\t\t\t@product.validateMetric(newParams)\n\t\telse\n\t\t\t@product.validateImperial(newParams)\n\t\tend\n\n\t\trespond_to do |format|\n\t\t\tif not(@product.errors.blank?)\n\t\t\t\t@product.attributes = newParams #Sends the filled in fields to be rendered with the errors\n\t\t\t\tformat.html { render action: \"edit\" }\n\t\t\t\tformat.json { render json: @product.errors, status: :unprocessable_entity }\n\t\t\telse\n\t\t\t\tif unit.to_s == \"metric\"\n\t\t\t\t\tfinal_params = @product.convertProductToImperial(newParams)\n\t\t\t\telsif unit.to_s == \"imperial\"\n\t\t\t\t\tfinal_params = @product.convertProductToMetric(newParams)\n\t\t\t\tend\n\t\t\t\t@product.attributes = final_params\n\t\t\t\tif @product.update_attributes(final_params)\n\t\t\t\t\tformat.html { redirect_to products_url, notice: 'Product was successfully updated.' }\n\t\t\t\t\tformat.json { head :no_content }\n\t\t\t\telse\n\t\t\t\t\tformat.html { render action: \"edit\" }\n\t\t\t\t\tformat.json { render json: @product.errors, status: :unprocessable_entity }\n\t\t\t\tend\n\t\t\tend\n\t\tend #end do\n\t\tif(params[:product][:photos_attributes])\n\t\t\tparams[:product][:photos_attributes].each do |photo_attributes_array|\n\t\t\t\tphoto_attributes = photo_attributes_array[1]\n\t\t\t\tif !photo_attributes[:photo].nil?\n\t\t\t\t\t@photo = @product.photos.build(photo_attributes)\n\t\t\t\t\t@photo.save\n\t\t\t\tend\n\t\t\tend\t\t\n\t\tend\n\tend",
"title": ""
}
] |
594a922011a59b75eb3a8909a94110cc
|
GET /send_bulk_messages GET /send_bulk_messages.json
|
[
{
"docid": "2267316c6cf47a195e9429c2a054096c",
"score": "0.7752607",
"text": "def index\n @send_bulk_messages = SendBulkMessage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @send_bulk_messages }\n end\n end",
"title": ""
}
] |
[
{
"docid": "1141f4fe5d503a52fffe7ad4bf66f654",
"score": "0.7110912",
"text": "def send_messages(options)\n data = @api.do_request(\"POST\", get_base_api_path() + \"/messages/send_batch\", options)\n return data\n end",
"title": ""
},
{
"docid": "1141f4fe5d503a52fffe7ad4bf66f654",
"score": "0.7110912",
"text": "def send_messages(options)\n data = @api.do_request(\"POST\", get_base_api_path() + \"/messages/send_batch\", options)\n return data\n end",
"title": ""
},
{
"docid": "2f611462a5292ac4e8995e5e645cdc77",
"score": "0.7070517",
"text": "def send_messages(options)\n return @api.do_request(\"POST\", get_base_api_path() + \"/messages/send_batch\", options)\n end",
"title": ""
},
{
"docid": "97ff0504b728b33fc72f9cdb5fbc240f",
"score": "0.6975545",
"text": "def send_bulk (phones, message, time_schedualed = nil)\n # Adjust Parameters\n recipients = []\n phone_numbers = phones.split(\",\")\n phone_numbers.each do |phone|\n recipients.push(Normalizer.normalize_number(phone))\n end\n message = Normalizer.normalize_message(message)\n\n # Initialize Request\n http = Net::HTTP.new('api.unifonic.com', 80)\n path = base_path(\"Messages/SendBulk\")\n headers = { 'Content-Type' => 'application/x-www-form-urlencoded' }\n\n # Add Body Parameters to request\n body = \"AppSid=#{api_key}&Recipient=\"\n\n # Add Recipents to body attributes\n recipients.each_with_index do |phone, index|\n body += phone\n if index != (recipients.count - 1)\n body += \",\"\n end\n end\n\n body += \"&Body=#{message}\"\n body += \"&SenderID=#{sender_phone}\" unless sender_phone.nil?\n body += '&TimeScheduled=#{time_schedualed}' unless time_schedualed.nil?\n \n # Send Call Request\n response = http.post(path, body, headers)\n response_body = JSON.parse(response.body)\n\n if response.code.to_i == 200 && !response_body[\"data\"].nil? \n return { messages: response_body[\"data\"][\"Messages\"], \n status: response_body[\"data\"][\"Status\"], \n number_of_units: response_body[\"data\"][\"NumberOfUnits\"],\n cost: response_body[\"data\"][\"Cost\"],\n currency_code: response_body[\"data\"][\"CurrencyCode\"],\n balance: response_body[\"data\"][\"Balance\"],\n recipient: response_body[\"data\"][\"Recipient\"],\n time_created: response_body[\"data\"][\"TimeCreated\"],\n code: 0 }\n else\n result = ErrorCode.get_error_code(response_body[\"errorCode\"]) \n\n return result \n end \n end",
"title": ""
},
{
"docid": "9b252aecaeade5eea26acabdd96079a3",
"score": "0.6563661",
"text": "def test_bulk_send_basic_success\n\n client = create_mock_client\n refute_nil client, \"Client object couldn't be created.\"\n\n stub_request(:post, mock_uri('BulkSMSes'))\n .to_return(status: 202, body: { 'Success' => true,\n 'Message' => \"Operation succeeded\",\n 'ApiId' => API_ID,\n 'BatchUUID' => UUID,\n 'MessageUUIDs' => [UUID] }.to_json)\n\n status, batch_uuid, message_uuids = client.sms.bulk_send([PHONE_NUMBERS[0]], \"Test message\")\n refute_nil status, \"No status object returned.\"\n assert status.success, \"Status did not indicate success: \" + status.message\n refute_nil batch_uuid, \"No batch UUID returned.\"\n assert_equal UUID, batch_uuid, \"Returned batch UUID did not match.\"\n assert_equal 1, message_uuids.length, \"Message UUID list is not the correct length.\"\n assert_equal UUID, message_uuids[0], \"Returned message UUID did not match.\"\n\n end",
"title": ""
},
{
"docid": "2b5bb19eace1b0217331029ded3765e4",
"score": "0.656365",
"text": "def send_multiple(messages)\n responses=[]\n Net::HTTP.start(Service.bulksms_gateway(@country), MESSAGE_SERVICE_PORT) do |http|\n messages.each do |msg|\n payload = [@account.to_http_query, msg.to_http_query].join('&')\n resp = http.post(MESSAGE_SERVICE_PATH, payload)\n responses << Response.parse(resp.body)\n end\n end\n responses\n end",
"title": ""
},
{
"docid": "8de28c9d7dd1533e8603475c0ab83787",
"score": "0.64541095",
"text": "def getSentMessages *args\n options=fill_args [:count,:page],[],*args\n request \"/Message/getSentMessages.json\", options\n end",
"title": ""
},
{
"docid": "e1eeae434482380954efbe6bb035f8db",
"score": "0.64403874",
"text": "def create\n @send_bulk_message = SendBulkMessage.new(params[:send_bulk_message])\n\n respond_to do |format|\n if @send_bulk_message.save\n BulkSendWorker.perform_async(@send_bulk_message.group_id, @send_bulk_message.message, current_user.id, @send_bulk_message.id)\n\n format.html { redirect_to send_bulk_messages_url, notice: 'Bulk Message successfully submitted for delivery!' }\n format.json { render json: @send_bulk_message, status: :created, location: @send_bulk_message }\n else\n format.html { render action: \"new\" }\n format.json { render json: @send_bulk_message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c1cabcb6702ce77a588a7148f8687bc",
"score": "0.6432719",
"text": "def send_bulk\n SendBulk.new self\n end",
"title": ""
},
{
"docid": "d374c3fdca369d206c3774a0e7cac5c3",
"score": "0.6428514",
"text": "def batch_params\n {\n :fields => 'id,message,created_time,updated_time,from',\n :limit => 100\n }\n end",
"title": ""
},
{
"docid": "d438b129a8fa07f4934c4a8e93357384",
"score": "0.64268094",
"text": "def new\n @send_bulk_message = SendBulkMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @send_bulk_message }\n end\n end",
"title": ""
},
{
"docid": "5ae24da62dcf923908e7476de4277c35",
"score": "0.64064616",
"text": "def show\n @send_bulk_message = SendBulkMessage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @send_bulk_message }\n end\n end",
"title": ""
},
{
"docid": "87ff52c80cc76522276a90e7749471f2",
"score": "0.6364458",
"text": "def generate_bulk_message_request(message)\n\n message_json = generate_base_message(message)\n message_json.to_email_address.push(AddressJson.new(\"%%DeliveryAddress%%\", \"%%RecipientName%%\"))\n message_json.merge_data = populate_merge_data(message.global_merge_data, message.to_recipient)\n\n messages_json = []\n messages_json.push(message_json)\n\n InjectionRequest.new(@server_id, @api_key, messages_json)\n\n end",
"title": ""
},
{
"docid": "c79615f77928a8107e156a853324b357",
"score": "0.63548124",
"text": "def bulk_sms\n @arr = User.all.map {|x| [x.name, x.phone]}\n @arr.each do |arr|\n begin\n @client.account.messages.create(:from => TWILIO_CONFIG[\"from\"], :to => arr[1], :body => \"Hello #{arr[0]}\")\n rescue Exception => e\n puts \"#{e.message.inspect}\"\n end\n redirect_to users_path, notice: \"Bulk SMS Succeded\"\n end\n \n end",
"title": ""
},
{
"docid": "b1858e67a95bfd6fb11632bf41761a9f",
"score": "0.63142383",
"text": "def index\r\n @sendmessages = Sendmessage.all\r\n end",
"title": ""
},
{
"docid": "f84952e82cd89e784dd384c558962104",
"score": "0.62806755",
"text": "def index\n user = User.find_by(id: params[:user_id].to_i)\n sent_status = to_boolean(params[:sent])\n\n if params[:sent]\n messages = user.messages.where(sent: sent_status).order('send_at_datetime ASC')\n render json: {messages: messages}\n else\n messages = user.messages\n render json: {messages: messages}\n end\n end",
"title": ""
},
{
"docid": "2279e94aa23dbb56e7157bbedb9b488a",
"score": "0.62488073",
"text": "def index\n @messages = Message.where(user_id: current_user.id).or(Message.where(team_id: current_user.teams.first.id)).where.not(status: 'deleted').includes(:message_recipients).status_order.order('message_recipients.send_at')\n # NOTE: Remove archived messages unless explicitly requested\n @messages = @messages.to_a.reject! { |m| m['status'] == 'archived' } if params[:include_archived].present? && params[:include_archived] != 'true'\n\n if @messages\n render json: @messages.as_json(only: %i[], methods: %i[id sender body created_at updated_at first_sent_at last_sent_at next_send_at send_duration send_duration_readable current_status media recipients])\n else\n render json: {\n errors: Stitches::Errors.from_active_record_object(@messages)\n }, status: 422\n end\n end",
"title": ""
},
{
"docid": "bedd472b474ca23cf0a06342feee9416",
"score": "0.61590505",
"text": "def index\n @messages = Message.where(\"id >= ?\", params.require(:offset))\n if params[:resource_uris].present?\n case params[:resource_uris]\n when ActionController::Parameters\n # swagger client passes an array value as a hash like {\"0\"=>val} in query parameter\n @messages = @messages.where(resource_uri: params[:resource_uris].to_unsafe_h.values)\n else\n @messages = @messages.where(resource_uri: params[:resource_uris])\n end\n end\n @messages = @messages.order(id: :asc)\n @messages = @messages.limit(params[:limit] || 100)\n render json: @messages, each_serializer: MessageEachSerializer\n end",
"title": ""
},
{
"docid": "53345d984c8d5cbac3f0b774b7fe63f5",
"score": "0.6146368",
"text": "def send_messages\n post_string = @message_list.map(&:post_string).join\n text_buffer = \"MESSAGES2.0\\r\\n#{post_string}.\\r\\n\"\n response_message, response_code = post_data_to_server(text_buffer)\n response_code == 100\n end",
"title": ""
},
{
"docid": "2f0ec5c329b11bf0f6e5c50de9788227",
"score": "0.61420923",
"text": "def send_batch msgs\n @socket.send_batch msgs\n end",
"title": ""
},
{
"docid": "1ea6ac50d9a53d43be300ee01d067f05",
"score": "0.61187077",
"text": "def sent\n @messages = current_user.sent_messages.paginate(:page => params[:page], :per_page => 5, :order => \"created_at DESC\")\n\t\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @messages }\n end\n end",
"title": ""
},
{
"docid": "086311a0ef6e56e57cc755dac87bf52f",
"score": "0.60897666",
"text": "def create\n # Include the helper gateway class\n require_relative 'AfricasTalkingGateway'\n\n # Specify your login credentials\n # Specify your login credentials\n user = params.require(:bulk).permit(:username)\n username = user['username']\n\n api =params.require(:bulk).permit(:apikey)\n apikey = api['apikey']\n\n # Specify the numbers that you want to send to in a comma-separated list\n\n # Please ensure you include the country code (+254 for Kenya in this case)\n to = params.require(:bulk).permit(:number)\n tof = to[:number]\n\n # And of course we want our recipients to know what we really do\n message = params.require(:bulk).permit(:message)\n msg = message[:message]\n\n # Create a new instance of our awesome gateway class\n gateway = AfricasTalkingGateway.new(username, apikey)\n\n # Any gateway error will be captured by our custom Exception class below,\n # so wrap the call in a try-catch block\n begin\n # Thats it, hit send and we'll take care of the rest.\n reports = gateway.sendMessage(tof,msg)\n reports.each {|x|\n @bulk = Bulk.new(number: x.number, status: x.status, message_id: x.messageId, cost: x.cost, message: params[:message] )\n }\n respond_to do |format|\n if @bulk.save\n format.html { redirect_to @bulk, notice: 'Bulk sms was successfully created.' }\n format.json { render :show, status: :created, location: @bulk }\n else\n format.html { render :new }\n format.json { render json: @bulk.errors, status: :unprocessable_entity }\n end\n end\n\n rescue AfricasTalkingGatewayException => ex\n puts 'Encountered an error: ' + ex.message\n end\n end",
"title": ""
},
{
"docid": "a1685ad06d1ec6a5840c0ed2ab851545",
"score": "0.6059199",
"text": "def send_batch_with_http_info(sms_message, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: BatchMessagesApi.send_batch ...\"\n end\n # verify the required parameter 'sms_message' is set\n if @api_client.config.client_side_validation && sms_message.nil?\n fail ArgumentError, \"Missing the required parameter 'sms_message' when calling BatchMessagesApi.send_batch\"\n end\n # resource path\n local_var_path = \"/batch/send\"\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;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 = @api_client.object_to_http_body(sms_message)\n auth_names = ['JWT']\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 => 'BatchMessageResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BatchMessagesApi#send_batch\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "402227b109f116d34625fded9e45a9f9",
"score": "0.60550666",
"text": "def my_messages \n @messages = [] \n Message.find_by_user(current_user.username).order('updated_at DESC').each do |msg| \n @messages << Message.find_by(id: msg.id).transform_message\n end\n render json: @messages\n end",
"title": ""
},
{
"docid": "fbbc28e7d548ff6b7a05ac9c1a2aa6c3",
"score": "0.6052121",
"text": "def index\n @messages = authenticate!.messages\n if @messages\n render json: @messages,\n serializer: MessagesSerializer,\n root: 'results',\n status: :ok,\n event: 'get_all_message'\n else\n render json: error('Error', 400), status: 400\n end\n end",
"title": ""
},
{
"docid": "a55cca83eda3c7608f1903f4f31c1d86",
"score": "0.6032321",
"text": "def index\n group_ids = current_user.groups.map(&:id)\n @messages = Message.all_received_messages(current_user,group_ids).order('created_at DESC').page(params[:page])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @messages }\n end\n end",
"title": ""
},
{
"docid": "3987616c8dbfcfce8652ee58eb710897",
"score": "0.6029289",
"text": "def bulk_save\n\t\tresponse_message = Input.save_inputs(params[:inputList])\t\t\n\t \trender json: {message: response_message}\n\tend",
"title": ""
},
{
"docid": "d1b119543c996fc9841af104f8b3c8f1",
"score": "0.60216135",
"text": "def send_batch(sms_message, opts = {})\n data, _status_code, _headers = send_batch_with_http_info(sms_message, opts)\n return data\n end",
"title": ""
},
{
"docid": "9eb8542ff610a0f8777fe081adbff0c5",
"score": "0.6001416",
"text": "def index\n @message_templates = MessageTemplate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @message_templates }\n end\n end",
"title": ""
},
{
"docid": "ce55dcc65f4a2b4aeec660c67a1047c5",
"score": "0.59955657",
"text": "def read_all_messages\n client.post('/api/read_all_messages')\n end",
"title": ""
},
{
"docid": "555614dd9cd524b98b9f1b76c8465076",
"score": "0.5979118",
"text": "def sendMessage message, recipients, from = nil, enqueue = nil, bulkSMSMode = nil, retryDurationInHours = nil\n\t\t\t# binding.pry\n\t\t\tpost_body = {\n\n\t\t\t\t'username' => @username, \n\t\t\t\t'message' => message, \n\t\t\t\t'to' => recipients\n\t\t\t}\n\t\t\tif from != nil\n\t\t\t\tpost_body['from'] = from\n\t\t\tend\n\t\t\tif enqueue != nil\n\t\t\t\tpost_body['enqueue'] = enqueue\n\t\t\tend\n\t\t\tif bulkSMSMode != nil\n\t\t\t\tpost_body['bulkSMSMode'] = bulkSMSMode\n\t\t\tend\n\t\t\tif retryDurationInHours != nil\n\t\t\t\tpost_body['retryDurationInHours'] = retryDurationInHours\n\t\t\tend\n\t\t\t\n\t\t\tresponse = executePost(getSmsUrl(), post_body)\n\t\t\t# binding.pry\n\t\t\tif @response_code == HTTP_CREATED\n\t\t\t\tmessageData = JSON.parse(response,:quirks_mode=>true)[\"SMSMessageData\"]\n\t\t\t\trecipients = messageData[\"Recipients\"]\n\t\t\t\t\n\t\t\t\tif recipients.length > 0\n\t\t\t\t\treports = recipients.collect { |entry|\n\t\t\t\t\t\tStatusReport.new entry[\"number\"], entry[\"status\"], entry[\"cost\"], entry[\"messageId\"]\n\t\t\t\t\t}\n\t\t\t\t\t# binding.pry\n\t\t\t\t\treturn reports\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\traise AfricasTalkingGatewayException, messageData[\"Message\"]\n\t\t\t\t\n\t\t\telse\n\t \t\t\traise AfricasTalkingGatewayException, response\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "c014b3668f022be57e0b52a48c9989ea",
"score": "0.59715945",
"text": "def destroy\n @send_bulk_message = SendBulkMessage.find(params[:id])\n @send_bulk_message.destroy\n\n respond_to do |format|\n format.html { redirect_to send_bulk_messages_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "43954195b618def955c96d6997450f75",
"score": "0.59658766",
"text": "def sent_messages\n oauth_response = access_token.get('/direct_messages/sent.json')\n JSON.parse(oauth_response.body)\n end",
"title": ""
},
{
"docid": "fa220fe398d82c48bd1628949101a074",
"score": "0.5965724",
"text": "def get_messages\n @con = Conversation.find(params[:id])\n \n @msgs = []\n \n if (params[:last].nil?)\n @msgs = @con.get_messages_limit(params[:from], params[:to])\n else\n time = params[:last].to_f / 1000.0\n puts time\n time = Time.at(time)\n puts \"PARAMS LAST: \" + time.to_s\n @msgs = @con.get_messages_newer(time)\n end\n \n @users = {}\n \n @con.get_users.each do |u|\n @users[u.id] = User.find(u.id)\n end\n \n @temp = []\n @msgs.each do |msg|\n m = {}\n sender = @users[msg.sender_id]\n m[:body] = msg.body\n m[:sender] = sender.name + \" \" + sender.surname\n m[:sender_id] = sender.id\n m[:date] = msg.created_at\n m[:own] = msg.sender_id.to_i == session[:user_id]\n m[:img] = User.find(msg.sender_id).avatar_url(:display)\n @temp << m\n end\n @msgs = @temp\n \n respond_to do |format|\n format.json {\n render json: @msgs.to_json.html_safe\n }\n end\n end",
"title": ""
},
{
"docid": "eefc0424648f712b404679378ba976f2",
"score": "0.5963705",
"text": "def call\n return nil if @actions.empty?\n\n body = @actions.join(\"\\n\") + \"\\n\"\n client.bulk(body, @params)\n ensure\n @current_request_size = 0\n @current_action_count = 0\n @actions.clear\n end",
"title": ""
},
{
"docid": "9c8fe19bdc55d44035e0e70ebe11bb59",
"score": "0.59622264",
"text": "def send_pending_messages\n begin\n while (msg = @pending.pop)\n self.discover_channel_id if !@channel_id\n\n data = \"{\"\n data += %( channel: \"#{@channel_id}\" )\n data += %(, ts: \"#{msg[:from_action].message_ts}\" ) if msg[:from_action]\n data += %(, text: #{msg[:text].to_json} ) if msg[:text]\n data += %(, blocks: #{msg[:blocks]} ) if msg[:blocks]\n data += \"}\"\n\n method = msg[:from_action] ? SLACK_UPDATE_MESSAGE_METHOD : SLACK_POST_MESSAGE_METHOD\n response_data = slack_api(method, SLACK_BOT_TOKEN, data, accept_notok=true)\n \n if response_data['ok'] == false\n # @pending.unshift msg\n break\n end\n\n sleep 0.5 # send up to 2 per second\n end\n rescue => e\n log :error, 'slack sender died', exception: e\n end\n end",
"title": ""
},
{
"docid": "8b25d278b901e8ffe4ce27618b0e2952",
"score": "0.5959035",
"text": "def index\n messages = Message.all\n render json: messages \n end",
"title": ""
},
{
"docid": "3e9324d97a54b128a45407310cfb5a76",
"score": "0.5955664",
"text": "def read_all_messages\n @client.post('/api/read_all_messages')\n end",
"title": ""
},
{
"docid": "86c0031a6c24d2c67033d192ae808cc0",
"score": "0.5955254",
"text": "def bulk_delete\n sms_template_ids = []\n sms_template_params[:sms_template_ids].each do |tid|\n sms_template_ids << BSON::ObjectId.from_string(tid)\n end\n\n deleted = SmsTemplate.where(uid: current_user.id).in(:_id => sms_template_ids).delete_all\n\n respond_to do |format|\n format.html { redirect_to sms_templates_url, notice: notice }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2fa24f18ff10e07e00cd6cc516c2b434",
"score": "0.5953647",
"text": "def index\n @messages = Message.order(created_at: :desc).page(params[:page]).per(NUM_PER_PAGE)\n end",
"title": ""
},
{
"docid": "22a458542f6785cb692955a7f552aade",
"score": "0.59468323",
"text": "def batched_send(send_params_array)\n batched_payload = []\n\n send_params_array.each do |sp|\n batched_payload << {\n path: '/api/v1/send',\n method: 'POST',\n body: build_send_payload(*sp)\n }\n end\n\n batched_payload_json = batched_payload.to_json\n SendWithUs::ApiRequest.new(@configuration).post(:batch, batched_payload_json)\n end",
"title": ""
},
{
"docid": "0e248d1139525bc4a8ead494395ae1df",
"score": "0.5928271",
"text": "def send_bulk_operation\n raise \"No SF bulk operation defined for #{operation}\"\n end",
"title": ""
},
{
"docid": "353bd6544f18c9f82cce303809539ae1",
"score": "0.5927143",
"text": "def bulk\n ids = params[\"#{model.name.underscore}_ids\"]\n if ids.is_a?(Array) && ids.length > 0\n invoices = Invoice.where(id: params[\"#{model.name.underscore}_ids\"])\n case params['bulk_action']\n when 'delete'\n invoices.destroy_all\n flash[:info] = \"Successfully deleted #{ids.length} invoices.\"\n when 'send_email'\n begin\n invoices.each {|inv| inv.send_email}\n flash[:info] = \"Successfully sent #{ids.length} emails.\"\n rescue Exception => e\n flash[:alert] = e.message\n end\n when 'set_paid'\n total = invoices.inject(0) do |n, inv|\n inv.set_paid! ? n + 1 : n\n end\n flash[:info] = \"Successfully set as paid #{total} invoices.\"\n when 'pdf'\n html = ''\n invoices.each do |inv|\n @invoice = inv\n html += render_to_string \\\n :inline => inv.get_print_template.template,\n :locals => {:invoice => @invoice,\n :settings => Settings}\n html += '<div class=\"page-break\" style=\"page-break-after:always;\"></div>'\n end\n send_data(@invoice.pdf(html),\n :filename => \"invoices.pdf\",\n :disposition => 'attachment'\n )\n return\n when 'duplicate'\n invoices.each do |inv|\n inv.duplicate\n end\n flash[:info] = \"Successfully copy #{invoices.length} invoices.\"\n else\n flash[:info] = \"Unknown action.\"\n end\n end\n redirect_to action: :index\n end",
"title": ""
},
{
"docid": "6dad33e48a548208e368d707d07aab05",
"score": "0.59222287",
"text": "def index\n @received_request_messages = ReceivedRequestMessage.search_with_query_definition(@query_definition).order(\"created_at\").limit(100)\n end",
"title": ""
},
{
"docid": "552122ede492bad3033a5f5733203c91",
"score": "0.59217",
"text": "def publish_batch_messages batch\n resp = connection.publish name, batch.messages\n if resp.success?\n batch.to_gcloud_messages resp.data[\"messageIds\"]\n else\n fail ApiError.from_response(resp)\n end\n end",
"title": ""
},
{
"docid": "552122ede492bad3033a5f5733203c91",
"score": "0.59217",
"text": "def publish_batch_messages batch\n resp = connection.publish name, batch.messages\n if resp.success?\n batch.to_gcloud_messages resp.data[\"messageIds\"]\n else\n fail ApiError.from_response(resp)\n end\n end",
"title": ""
},
{
"docid": "6f112322adf6e6b4b0c2b747a118d925",
"score": "0.5920148",
"text": "def send_message\n @dib.contact_other_party(current_user, message_params[:body] )\n @messages = @dib.alerts.sort\n render json: @messages, each_serializer: AlertSerializer, status: :ok\n end",
"title": ""
},
{
"docid": "a3aa9c80b9bb4b951dbf1f9c77edfbcb",
"score": "0.59186876",
"text": "def index\n create_message(params)\n end",
"title": ""
},
{
"docid": "a3aa9c80b9bb4b951dbf1f9c77edfbcb",
"score": "0.59186876",
"text": "def index\n create_message(params)\n end",
"title": ""
},
{
"docid": "76daaaf795a61ec846e2026e7255605a",
"score": "0.5917228",
"text": "def send_multi(options)\n data = @api.do_request(\"POST\", get_base_api_path() + \"/send_multi\", options)\n return data\n end",
"title": ""
},
{
"docid": "76daaaf795a61ec846e2026e7255605a",
"score": "0.5917228",
"text": "def send_multi(options)\n data = @api.do_request(\"POST\", get_base_api_path() + \"/send_multi\", options)\n return data\n end",
"title": ""
},
{
"docid": "ea4aa88722762535e0b84980f2903cdd",
"score": "0.5912127",
"text": "def send_batch_sms(fromNumber)\n begin\n bodyParams = {\n 'from': fromNumber,\n 'text': \"Hello Team\",\n 'messages': [\n { 'to': [RECIPIENT] }\n # Adding more recipients\n # { 'to': [ \"Recipient-2-Phone-Number\"] },\n #\t{ 'to': [ \"Recipient-N-Phone-Number\"] }\n #\n ]\n }\n\n endpoint = \"/restapi/v1.0/account/~/a2p-sms/batches\"\n resp = $platform.post(endpoint, payload: bodyParams)\n puts (\"Batch sent. Batch id: \" + resp.body['id'])\n check_batch_status(resp.body['id'])\n rescue StandardError => e\n puts (e)\n end\nend",
"title": ""
},
{
"docid": "f311a7580147118b9a01335e5f009984",
"score": "0.5910738",
"text": "def publish_batch_messages batch\n resp = connection.publish name, batch.messages\n if resp.success?\n batch.to_gcloud_messages resp.data[\"messageIds\"]\n else\n ApiError.from_response(resp)\n end\n end",
"title": ""
},
{
"docid": "76514ef1a6599bfcabf9e93a088d86f0",
"score": "0.5909571",
"text": "def index\n # Get the templates\n @message_templates = MessageTemplate.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @message_templates }\n end\n end",
"title": ""
},
{
"docid": "4c1e91e5b2c9aec806e3390d95b9cc89",
"score": "0.5905371",
"text": "def sent_messages\n mailbox_messages('sent')\n end",
"title": ""
},
{
"docid": "5580af9e71af23ba99d2cbacb7ded1a0",
"score": "0.5899852",
"text": "def index\n gone!\n # deprecated gone_on: \"2018-08-01\" do\n # @messages = Message.where(sender: @user).where.not(status: 'Deleted').includes(:message_recipients).order('message_recipients.send_at')\n # # NOTE: Remove archived messages unless explicitly requested\n # @messages = @messages.to_a.reject!{ |m| m['status'] == 'Archived'} unless params[:include_archived].present? && params[:include_archived] == 'true'\n #\n # if @messages\n # render json: @messages.as_json(only: %i[id body media_id send_at created_at updated_at], methods: [:next_send_at, :current_status, :recipients])\n # else\n # render json: {\n # errors: Stitches::Errors.from_active_record_object(@messages)\n # }, status: 422\n # end\n # end\n end",
"title": ""
},
{
"docid": "31cdf2bacfdca2c6fe280925e5c3879d",
"score": "0.58992463",
"text": "def sent_messages\n render json: current_user.messages\n end",
"title": ""
},
{
"docid": "7f58843dc43a51d7298989bdecfee994",
"score": "0.5898022",
"text": "def send_batch(meta_events)\n split_batches(meta_events.compact).each_pair do |k, batch|\n key, tag = *k\n if tag.nil?\n url = \"#{@proto}://#{@host}/bulk/#{key}\"\n else\n url = \"#{@proto}://#{@host}/bulk/#{key}/tag/#{tag}\"\n end\n\n\n build_message_bodies(batch) do |body|\n perform_api_call url, body\n end\n end\n end",
"title": ""
},
{
"docid": "548406365d164306a24ccf3b9b959201",
"score": "0.588835",
"text": "def sent\n @messages = current_user.messages.find(:all, :order=>\"created_at DESC\")\n end",
"title": ""
},
{
"docid": "db9289ec741aec52b5be5891b6857460",
"score": "0.58878064",
"text": "def index\n render json: Message.all\n end",
"title": ""
},
{
"docid": "172beb2dc3f644b08822c06472549d3f",
"score": "0.5884177",
"text": "def index\n # byebug\n # .... riiiiiight. Get the messages from Message where recipient_id = user_id. \n # .... maybe it's time to get global props somehow? \n #get the message_id's from message_recipients\n #where recipient_id = user\n user_messages = []\n user_groups = UserGroup.where(user_id: User.find(decode_jwt(cookies.signed[:jwt])[\"user_id\"])).pluck(:group_id)\n user_groups.each do |grp| \n message_ids = MessageRecipient.where(recipient_group_id: grp)\n messages = Message.where(id: message_ids.map{|msg_id| msg_id[\"message_id\"]})\n user_messages.push([grp, message_ids, messages])\n end\n # @message_ids=MessageRecipient.where( recipient_id: retrieve_message_params[:userId] )\n # User.find(retrieve_message_params[:userId])\n #for each message_id, add the message\n # @message_ids.map{|mid| mid[\"message_id\"]}\n # @messages=Message.where(id: @message_ids.map{|mid| mid[\"message_id\"]})\n \n render json: {messages: user_messages}\n end",
"title": ""
},
{
"docid": "9aa31d3707c55e8c9ab95dd2e29b2781",
"score": "0.58816177",
"text": "def bulk_delete_messages(auth, channel_id, messages = [])\n MijDiscord::Core::API.request(\n :channels_cid_messages_bulk_delete,\n channel_id,\n :post,\n \"#{MijDiscord::Core::API::APIBASE_URL}/channels/#{channel_id}/messages/bulk-delete\",\n { messages: messages }.to_json,\n Authorization: auth,\n content_type: :json\n )\n end",
"title": ""
},
{
"docid": "02a2bf8049fcf60b98fca232b4f89ba4",
"score": "0.58801174",
"text": "def index\n @sent_messages = SentMessage.all\n end",
"title": ""
},
{
"docid": "b7ed75fc7c53ba14bea5f080d4fdb079",
"score": "0.58761996",
"text": "def get_bulk_send_lists_with_http_info(account_id)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: BulkEnvelopesApi.get_bulk_send_lists ...\"\n end\n # verify the required parameter 'account_id' is set\n fail ArgumentError, \"Missing the required parameter 'account_id' when calling BulkEnvelopesApi.get_bulk_send_lists\" if account_id.nil?\n # resource path\n local_var_path = \"/v2.1/accounts/{accountId}/bulk_send_lists\".sub('{format}','json').sub('{' + 'accountId' + '}', account_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 = []\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 => 'BulkSendingListSummaries')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BulkEnvelopesApi#get_bulk_send_lists\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "b7ed75fc7c53ba14bea5f080d4fdb079",
"score": "0.58761996",
"text": "def get_bulk_send_lists_with_http_info(account_id)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: BulkEnvelopesApi.get_bulk_send_lists ...\"\n end\n # verify the required parameter 'account_id' is set\n fail ArgumentError, \"Missing the required parameter 'account_id' when calling BulkEnvelopesApi.get_bulk_send_lists\" if account_id.nil?\n # resource path\n local_var_path = \"/v2.1/accounts/{accountId}/bulk_send_lists\".sub('{format}','json').sub('{' + 'accountId' + '}', account_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 = []\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 => 'BulkSendingListSummaries')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BulkEnvelopesApi#get_bulk_send_lists\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "5424309524919e21ec1eb7b0d2c7958a",
"score": "0.58753896",
"text": "def index\n @messages = @conversation.messages\n render json: @messages\n end",
"title": ""
},
{
"docid": "6adf50da9cffd4a113de20e5f2097fcd",
"score": "0.58730185",
"text": "def index\n @messages = Message.all\n\n render json: @messages\n end",
"title": ""
},
{
"docid": "6adf50da9cffd4a113de20e5f2097fcd",
"score": "0.58730185",
"text": "def index\n @messages = Message.all\n\n render json: @messages\n end",
"title": ""
},
{
"docid": "f7475a6f0dd5f2e2df3bff730288bad3",
"score": "0.58606625",
"text": "def index\n @b_messages = BMessage.all\n end",
"title": ""
},
{
"docid": "6f9e82fd0b4ab35e7366ed3330befd3d",
"score": "0.58593285",
"text": "def index\n @messages = Message.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @messages }\n end\n end",
"title": ""
},
{
"docid": "a771e18f94454b6a957da7f5324f2891",
"score": "0.5849722",
"text": "def index\n @messages = Message.where(:to_user_id => current_user.id).group_by(&:ticket_id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @messages }\n end\n end",
"title": ""
},
{
"docid": "962ca449d5cdbe5f6638d9530bcf0ca9",
"score": "0.58407664",
"text": "def index\n limit = params[:limit]\n limit ||= 15\n before = params[:before]\n after = params[:after]\n\n # TODO: check parameters\n\n # Build our query\n msg_query = @user.messages\n if !before.nil?\n msg_query = msg_query.where(\"created_at > ?\", Time.at(before))\n end\n if !after.nil?\n msg_query = msg_query.where(\"created_at <= ?\", Time.at(after))\n end\n msg_query = msg_query.limit(limit)\n\n msg_list = []\n msg_query.all.each do |msg|\n msg_list << msg_as_hash(msg)\n end\n\n render :status => 200,\n :json => {\n status: 200,\n messages: msg_list\n }\n end",
"title": ""
},
{
"docid": "a2bd09a785183c66dde6ce4a4034f317",
"score": "0.5826179",
"text": "def sent\n @messages = current_user.messages_as_sender.threads.order('created_at').page(params[:page])\n add_breadcrumb :sent.l, cooperative.sent_messages_path\n \n respond_to do |format|\n format.html # index.html.haml\n format.json { render :json => @messages }\n end\n end",
"title": ""
},
{
"docid": "33a26b540133df7d9665d2dc5b0e2355",
"score": "0.5808968",
"text": "def index\n @sent_request_messages = SentRequestMessage.includes(:response_messages).order(\"created_at\").limit(100)\n end",
"title": ""
},
{
"docid": "acceab1032c3ef27aaa36733104db4b3",
"score": "0.58063006",
"text": "def index\n @messages = Message.all\n\n\n render json: @messages\n\n end",
"title": ""
},
{
"docid": "7ad369de6a256d48dff8175e6670c7ed",
"score": "0.5802821",
"text": "def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @message_lists }\n end\n end",
"title": ""
},
{
"docid": "ccd952e4a5ba7fd489a55a90c3967fc7",
"score": "0.57803166",
"text": "def index\n respond_with AdminMessage.all\n end",
"title": ""
},
{
"docid": "a1b156d3c72e4f86b9d37c8276dec3a5",
"score": "0.5774452",
"text": "def index\n @system_messages = SystemMessage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @system_messages }\n end\n end",
"title": ""
},
{
"docid": "39cd9ba3daacb611a51a154236b1da56",
"score": "0.57716984",
"text": "def index\n # @messages = Message.all #NOT ORDERED\n @messages = []\n if (params[:username]) #return all messages for this username & order messages by most recent message on top\n @messages = Message.find_by_user(params[:username]).order('updated_at DESC') \n else #return all messages for all users\n Message.order('updated_at DESC').each do |msg|\n @messages << Message.find_by(id: msg.id).transform_message\n end\n end\n render json: @messages\n end",
"title": ""
},
{
"docid": "7a5f2ffc755ed761ad9d356e0522546f",
"score": "0.57695425",
"text": "def index\n @messages = Message.find_all_by_course_id(params[:course_id])\n\n respond_to do |format|\n format.html # index.html.erb]\n format.json { render json: @messages }\n end\n end",
"title": ""
},
{
"docid": "088411cccad893ec2644c54e4a8908c4",
"score": "0.5767225",
"text": "def send_message(json_msg)\n res = post(\"message/custom/send\",{},json_msg.to_s)\n return MultiJson.load(res.body)\n end",
"title": ""
},
{
"docid": "c9738cceefa715536a7c549e9a4e1d80",
"score": "0.5763276",
"text": "def index\n @message_updates = MessageUpdate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @message_updates }\n end\n end",
"title": ""
},
{
"docid": "791b6567551bd18c1b0159cb60589a17",
"score": "0.5763064",
"text": "def message_index\n \n Rails.logger.info request.query_parameters.inspect\n puts \"params: #{params}\"\n \n resp = Pod.message_index(params[:pod_id], @current_user.id)\n \n response = []\n resp.each do |message|\n response << {\n :id => message['id'].to_s,\n :pod_id => message['pod_id'].to_s,\n :sequence => message['sequence'].to_s,\n :from_id => message['user_id'].to_s,\n :from_name => message['full_name'],\n :from_picture_url => \"http://graph.facebook.com/\"+message['facebook_id'].to_s+\"/picture?type=square\",\n :message_type => message['message_type'],\n :metadata => message['metadata'],\n :timestamp => message['updated_at'].to_i\n }\n end\n \n @response_hash = {}\n @response_hash['data'] = response\n \n respond_to do |format|\n format.html\n format.xml { render :xml => response_hash }\n format.json { render :json => @response_hash }\n end\n \n end",
"title": ""
},
{
"docid": "cf278b2d5c5b7dce45fdeefb6e369295",
"score": "0.5751769",
"text": "def sent\n @messages = Message.sent_from(current_user).ordered\n render json: @messages\n end",
"title": ""
},
{
"docid": "177294a1b9801e6ad02b92996a59d4d4",
"score": "0.57477814",
"text": "def index\n @messages = Message.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @messages }\n end\n end",
"title": ""
},
{
"docid": "e4f26dd6e06cd802df8cb4fc481389cf",
"score": "0.574302",
"text": "def receive\n Message.where(id: params[:id]).limit(1).update_all(received: \"1\")\n render json: {sucess: true}\n end",
"title": ""
},
{
"docid": "60e797a3553f95120cb33774d2dd9c6d",
"score": "0.57377434",
"text": "def index\n @messages = JobMessage.where(\"id >= ?\", params.require(:offset))\n @messages = @messages.where(job_id: params.require(:job_id))\n @messages = @messages.order(id: :asc)\n @messages = @messages.limit(params[:limit] || 100)\n render json: @messages, each_serializer: JobMessageEachSerializer\n end",
"title": ""
},
{
"docid": "4d217914baf144cac1cbcbab1c0c6f62",
"score": "0.5736087",
"text": "def index\n if params[:message]\n @search = Message.search :name_like => params[:message][:name]\n params.clear\n else\n @search = Message.search(params[:search])\n end\n\n @messages = @search.paginate(:per_page => \"20\", :page => params[:page])\n\n if params[:search].nil? || params[:search][:meta_sort].nil?\n @messages = @messages.order(\"updated_at desc\")\n end\n\n redirect_to admin_message_path(@messages.first, params) and return if (@messages.size.eql?(1))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @messages }\n end\n end",
"title": ""
},
{
"docid": "3935361d1e05f6dd585bc7d5c2b37b4e",
"score": "0.5734271",
"text": "def index\n @send_messages = current_user.send_messages\n @recv_messages = current_user.recv_messages\n end",
"title": ""
},
{
"docid": "ff39d1f10c7f95f3158c0f2c96c3d248",
"score": "0.5734038",
"text": "def batch\n logger.info \"*** twitter#batch\"\n \n @news_items = NewsItem.order(\"post_at DESC\").current.tweet \n @news_items.each do |news_item|\n send_news_tweet(news_item)\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tweet }\n end\n end",
"title": ""
},
{
"docid": "785eeafd1ceb62104a833d794202a048",
"score": "0.5733928",
"text": "def index\n match_id = params[:match_id]\n @messages = Message.where(match_id: match_id)\n render json: @messages\n # this will look like\n # [\n # {message: \"sdhfkas\", user1_id: 34},\n # {message: \"sdhfkas\", user1_id: 34},\n # {message: \"sdhfkas\", user1_id: 34},\n # ]\n end",
"title": ""
},
{
"docid": "20f4de660d40a700e18f611316343734",
"score": "0.5732365",
"text": "def messages\n @user = User.find(params[:id])\n @sent = Message.sent_from(@user).ordered\n @received = Message.sent_to(@user).ordered\n render json: { user: @user, sent: @sent, received: @received }\n end",
"title": ""
},
{
"docid": "5293845394e63c33c789c0a1d9502418",
"score": "0.5730985",
"text": "def index\n @message_templates = MessageTemplate.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @message_templates }\n end\n end",
"title": ""
},
{
"docid": "c8b9c288331eee6186520f015a2e3df1",
"score": "0.57279164",
"text": "def list_messages\n\t messages = []\n if Conversation.between(current_user.id, params[:recipient_id]).present?\n conversation = Conversation.between(current_user.id, params[:recipient_id]).first\n \t messages = conversation.messages\n end\n render json: {conversation: messages}\n end",
"title": ""
},
{
"docid": "e32b8d79bf5bb1808e79900f3c682b46",
"score": "0.57222897",
"text": "def index\n @message = Message.new\n @message.message_assets.build\n @users = current_user.account.users\n \n @owned_messages = Message.owned_messages(current_user)\n @assigned_messages = Message.assigned_messages(current_user)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @messages }\n end\n end",
"title": ""
},
{
"docid": "a5572215a9a7c7bd74d85b373caece7a",
"score": "0.5719758",
"text": "def send_messages(messages)\n messages.each { |m| write_to_stream m }\nend",
"title": ""
},
{
"docid": "a5572215a9a7c7bd74d85b373caece7a",
"score": "0.5719758",
"text": "def send_messages(messages)\n messages.each { |m| write_to_stream m }\nend",
"title": ""
},
{
"docid": "50e89f1c23564f84effb50236d781578",
"score": "0.5711758",
"text": "def sent \n @messages = @user.sent_messages.paginate(:page => params[:page], :per_page => 10)\n render :action => 'index'\n end",
"title": ""
},
{
"docid": "13abec2cc54cedc84279aa3199dd97c2",
"score": "0.57110023",
"text": "def index\n @messages = Message.all.page(params[:page]).per(20)\n end",
"title": ""
},
{
"docid": "574e8d3148abf5b38b0f4ab3796108ea",
"score": "0.5704315",
"text": "def index\n# if request.post?\n Message.delay(run_at: 1.minute.from_now).create_message\n# end\n\n # Retrieve the last 10 msgs\n @bottom = Message.order(\"id desc\")#.limit(10)\n end",
"title": ""
}
] |
460679ca8b40cb79758ad922cd6a4afb
|
Returns a job to process, if any is available
|
[
{
"docid": "1e7409dbf4e3b8f96915072a62eb9d82",
"score": "0.7297208",
"text": "def request_job_to_process\n \n response = HTTParty.get(\"#{@host}/api/process/request_job/#{@process_code}.json\", query: {\n api_key: @api_key\n })\n\n job = response[\"job\"]\n #If there is no job waiting, end script\n if job.nil? || job[\"id\"].to_i == 0 \n @helper.terminate(\"No job to process at this time\")\n else\n @helper.log(\"Starting process #{@process_code} for job: #{job[\"id\"]} - #{job[\"author\"]} - #{job[\"title\"]} - #{job[\"created_at\"]}\")\n end\n return job\n end",
"title": ""
}
] |
[
{
"docid": "e57df806ea0227bf4fa78881f6c9f773",
"score": "0.7589804",
"text": "def get_job\n begin\n s, sproc, clazz = selector\n # Take the job from TS using the job selector\n job = take s, 0, false\n\n # Remove job from envelope\n sproc_meth = sproc.respond_to?(:process) ? :process : :call\n job = sproc.send sproc_meth, job\n\n yield job['job']\n rescue Rinda::RequestExpiredError => e\n # This happens when the lookup expires, it's an OK exception\n # TODO use wait time in take?\n sleep @job_search_timeout\n end\n end",
"title": ""
},
{
"docid": "3eafea9496d5cada0b3b7072d3d99ed2",
"score": "0.70246387",
"text": "def work\n possible_job = pluck_queue_message(:job_requests) # FIX: pluck doesn't delete\n job = Job.build(@instance_id, possible_job)\n job.valid? ? process(job) : process_invalid(job)\n end",
"title": ""
},
{
"docid": "0765a2350608be481dc0c05a4680e456",
"score": "0.7023933",
"text": "def get_job (job_id)\n\n @cron_jobs[job_id] || @non_cron_jobs[job_id]\n end",
"title": ""
},
{
"docid": "603e9d6204526cc1f6ddfaba89c8941e",
"score": "0.6994417",
"text": "def retrieve_job\n json = Server.redis { |c| c.brpop(Server.keys[:perform_list]) }\n Job.new(JSON.parse(json.last))\n rescue => e\n raise ServerError, e.message\n end",
"title": ""
},
{
"docid": "cc5837252577cbb5ed4dd8d64755e5a3",
"score": "0.6958672",
"text": "def job\n job_uuid && Jobber::Job::Base.find_job(job_uuid)\n end",
"title": ""
},
{
"docid": "ec066696343eab200da2cddc58be17d8",
"score": "0.69425464",
"text": "def find_job(job_id)\n response = HTTParty.get(\"#{@host}/api/jobs/#{job_id}\")\n\n return response['job']\n end",
"title": ""
},
{
"docid": "581592837b714530d6080d4256e26bcb",
"score": "0.69384855",
"text": "def job\n operation_ids = operations.map(&:id)\n ja_ids = JobAssociation.where(operation_id: operation_ids).map(&:job_id).uniq\n jobs = Job.find(ja_ids).select(&:active?)\n raise ProtocolError, 'Cannot resolve the current Job' if jobs.length > 1\n\n jobs.last\n end",
"title": ""
},
{
"docid": "1d1c2d107ccf28c06bf0e6705ef13162",
"score": "0.6842142",
"text": "def job\n return nil if self.job_id.nil?\n Delayed::Job.find(self.job_id)\n end",
"title": ""
},
{
"docid": "a140f307834067472f2421992b23b804",
"score": "0.6806293",
"text": "def job\n @job\n end",
"title": ""
},
{
"docid": "a140f307834067472f2421992b23b804",
"score": "0.6806293",
"text": "def job\n @job\n end",
"title": ""
},
{
"docid": "3532d909246bf5422e7656ec9e334822",
"score": "0.6775484",
"text": "def pull_job(job_name = nil)\r\n lock\r\n job,status = internal_find_job(job_name)\r\n if job && status == ST_QUEUED\r\n # Move to run, notice use of job.name rather than job_name\r\n # .. if we are pulling a new job, it could be nil\r\n FileUtils.mv(@dir + '/que/' + job.name, @dir + '/run/' + job.name)\r\n job.set_as_active\r\n elsif job\r\n # We cannot pull a job that isn't queued\r\n log(\"cannot pull job that isn't queued: \" + job_name)\r\n job = nil\r\n end\r\n unlock\r\n return job\r\n end",
"title": ""
},
{
"docid": "394343aa8919bf3b44fc3a4b3d083618",
"score": "0.6769124",
"text": "def get_job(job, ds = nil)\n (jobs_to_run + jobs_running).find do |j|\n if ds.nil?\n j[:ds].nil? and j[:job] == job\n else\n (! j[:ds].nil?) and j[:ds].name == ds.name and j[:job] == job\n end\n end\n end",
"title": ""
},
{
"docid": "fbb0787cc689ffa0c9537478f24b6b31",
"score": "0.6765918",
"text": "def get( name )\n @jobs.each { |job| return job if job[:name] == name }\n nil\n end",
"title": ""
},
{
"docid": "6d6be7269ba5fa8a9db444bbd4789681",
"score": "0.674622",
"text": "def grab_job(unique = false)\n worker = Worker.find_or_create_by_worker_id(@worker_id)\n worker.update_attributes({:last_seen => Time.now()})\n \n if job = worker_queue.grab_job(@capabilities) \n logger.debug \"Handed out job\"\n if unique\n respond :job_assign_uniq, job[:job_handle], job.func_name, job[:uniq], job[:data]\n else \n respond :job_assign, job[:job_handle], job.func_name, job[:data]\n end\n else\n logger.debug \"No job!\"\n respond :no_job\n end\n \n end",
"title": ""
},
{
"docid": "64fc7bdf187b1d3c72f986106aa324bd",
"score": "0.67456627",
"text": "def job\n @job\n end",
"title": ""
},
{
"docid": "758f28b3da52a28720d00d8aadc206f2",
"score": "0.6685303",
"text": "def job(name)\n @manifest[\"jobs\"].find { |job| job[\"name\"] == name }\n end",
"title": ""
},
{
"docid": "dffd804c579f750ae17a11be6c31e5be",
"score": "0.66478777",
"text": "def job(job_name)\n jobs job_name\n end",
"title": ""
},
{
"docid": "833adfac7207d44838e1c320a856da38",
"score": "0.66437316",
"text": "def getNextJob()\n\t\t\t\tjob = nil\n\t\t\t\t\n\t\t\t\tThread.exclusive {\n\t\t\t\t\ti = @jobs.index { |j| j.canStart() }\n\t\t\t\t\tjob = @jobs.delete_at( i ) if ( i != nil )\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn job\n\t\t\tend",
"title": ""
},
{
"docid": "1d292d54328cbc23c92823f127a7b106",
"score": "0.66215587",
"text": "def persistent_job\n job_id = Thread.current[:persistent_job_id]\n job_id ? BdrbJobQueue.find_by_id(job_id) : nil\n end",
"title": ""
},
{
"docid": "12b6a68af338e36e25d4d576cbfb67da",
"score": "0.65949494",
"text": "def get(jid)\n results = @client.call('get', jid)\n Job.new(@client, JSON.parse(results)) unless results.nil?\n end",
"title": ""
},
{
"docid": "35458c1ac053b8664fcb178d4c83128a",
"score": "0.65874904",
"text": "def getJob(db, jid)\n\tjob = JobAbstract.new(db, jid)\n\ttype = job.type\n\t\n\t#if type == 'build'\n\t#\treturn JobBuild.new(db, jid)\n\t#end\n\t\n\tjob\nend",
"title": ""
},
{
"docid": "db796a5da58bb2fe6d570a659b10b4ba",
"score": "0.65701395",
"text": "def job\n\t\tjid = @db.hget('sgt-unit:'+@id, 'job')\n\t\treturn nil if jid == nil\n\t\tgetJob(@db, jid)\n\tend",
"title": ""
},
{
"docid": "4e767796ea38f101d7269fc460a22c1e",
"score": "0.6544631",
"text": "def job \n @job\n end",
"title": ""
},
{
"docid": "f3c4502dab24c99a6641b238ce03c065",
"score": "0.6539653",
"text": "def work_job\n \n # MAINTENANCE\n \n # Are we shutting down?\n if @shutdown\n Kernel.exit!(0) if @current_jobs.size == 0\n end\n \n # PROCESSING JOBS\n \n # Get a job\n job = get_new_job\n return unless job\n log.info \"Got a new job #{job.id}\"\n \n if job.job_class.fork?\n # Job that requires a fork, perfect for long-running stuff.\n log.debug \"Forking the process for job #{job.id}\"\n pid = fork do\n process_job job\n end\n @job_pids[job.id] = pid\n # TODO: We need to store which PID corresponds to this job\n elsif job.job_class.fiber?\n # A job that requires a separate fiber.\n log.debug \"Creating a new fiber for job #{job.id}\"\n Fiber.new do\n process_job job\n finish_job job\n end.resume\n else\n # Old-school, blocking job\n log.debug \"Running job #{job.id} in the blocking mode\"\n process_job job\n finish_job job\n end\n end",
"title": ""
},
{
"docid": "f8d00f02163221f8d6fa4dedb17e4672",
"score": "0.651612",
"text": "def find(id)\n res = transmit(\"peek #{id}\")\n Job.new(client, res)\n rescue Beaneater::NotFoundError\n nil\n end",
"title": ""
},
{
"docid": "d63423c2c91c4c2b0262f89ea1e140e3",
"score": "0.6499025",
"text": "def job_parser\n @job_parser || Job\n end",
"title": ""
},
{
"docid": "b696d0664dc785015e04a6794f05460e",
"score": "0.6489383",
"text": "def job_class\n return if job_class_name.nil?\n job_class_name.constantize\n rescue NameError\n nil\n end",
"title": ""
},
{
"docid": "2ebb92e83d3a161333f2f66d67647f95",
"score": "0.647389",
"text": "def find_and_lock_job(node)\r\n\t\t\tArmory::Job.find_job(node).each do |job|\r\n\t\t\t\treturn job if job.aquire_lock?(self.name)\r\n\t\t\tend\r\n\t\t\t\r\n\t\t\treturn nil\r\n\t\tend",
"title": ""
},
{
"docid": "2eb2ff36395170fd06984f03316145e5",
"score": "0.6437035",
"text": "def fetch_job\n @job = Job.find(params.require(:id))\n end",
"title": ""
},
{
"docid": "8f172c87841378830dfbf008e9d4ccb6",
"score": "0.6412018",
"text": "def sync_job\n return sync_jobs.last unless sync_jobs.empty?\n end",
"title": ""
},
{
"docid": "440e2a3c2c5d165bfa06e2b313b46a39",
"score": "0.63957536",
"text": "def get_job(jobid, cluster)\n begin\n data = cluster.job_adapter.info(jobid)\n\n raise OodCore::JobAdapterError if data.native.nil?\n ActiveJobs::Jobstatusdata.new(data, cluster, true)\n\n rescue OodCore::JobAdapterError\n OpenStruct.new(name: jobid, error: \"No job details because job has already left the queue.\" , status: status_label(\"completed\") )\n rescue => e\n Rails.logger.info(\"#{e}:#{e.message}\")\n Rails.logger.info(e.backtrace.join(\"\\n\"))\n OpenStruct.new(name: jobid, error: \"No job details available.\\n\" + e.backtrace.to_s, status: status_label(\"\") )\n end\n end",
"title": ""
},
{
"docid": "a4d890483835409d27442f4b6e9c53ba",
"score": "0.6379111",
"text": "def rocket_job_next_job(worker_name, filter = {})\n while (job = rocket_job_retrieve(worker_name, filter))\n # Batch Job?\n return job if job.running?\n\n if job.expired?\n job.rocket_job_fail_on_exception!(worker_name) { job.destroy }\n logger.info \"Destroyed expired job #{job.class.name}, id:#{job.id}\"\n elsif (new_filter = job.send(:rocket_job_evaluate_throttles))\n rocket_job_merge_filter(filter, new_filter)\n # Restore retrieved job so that other workers can process it later\n job.set(worker_name: nil, state: :queued)\n else\n job.worker_name = worker_name\n job.rocket_job_fail_on_exception!(worker_name) do\n job.start!\n end\n return job if job.running?\n end\n end\n end",
"title": ""
},
{
"docid": "d9c8007bfbf515c5a0b53e33709ad4d3",
"score": "0.6373301",
"text": "def job # this is a getter\n @job\n end",
"title": ""
},
{
"docid": "58c050efba4f988ddaf6c8b59cd382f4",
"score": "0.6340092",
"text": "def current_job\n return @job_current\n end",
"title": ""
},
{
"docid": "6ffd14c46c8e2e826a5983beb576cd3d",
"score": "0.6336013",
"text": "def next_runnable_job(queue)\n tracking_key = get_next_runnable(queue)\n return nil unless tracking_key\n\n job = nil\n lock_key = lock_key(tracking_key)\n\n run_atomically(lock_key) do\n \n # since we don't have a lock when we get the runnable,\n # we need to check it again\n still_runnable = runnable?(tracking_key, queue)\n if still_runnable\n klazz = tracking_class(tracking_key)\n job = klazz.pop_from_restriction_queue(tracking_key, queue)\n end\n\n end\n\n return job\n \n end",
"title": ""
},
{
"docid": "cca2060bcecab64d0554cf3bd96f6c51",
"score": "0.6323157",
"text": "def find_job(job_id)\n find_users.each do |user|\n user.find_jobs.each do |job|\n return job if job.id == job_id\n end\n end\n\n return nil\n end",
"title": ""
},
{
"docid": "58084bf417c8c68b86d46a5af83e8c7a",
"score": "0.6322331",
"text": "def job(job,params={})\n if (@job[extract_job(job)] && !params[:force])\n return @job[extract_job(job)]\n end\n @job[extract_job(job)] = get_job(job)\n end",
"title": ""
},
{
"docid": "73b6b93b2601907cd9ab4d9cf78bcf11",
"score": "0.632083",
"text": "def method_missing sym, *args, &block\n if job = @hud.jobs.find_by_name( sym )\n job\n else\n super sym, *args, &block\n end\n end",
"title": ""
},
{
"docid": "cb75cebb7bdc84f185211580e943cf9f",
"score": "0.63084495",
"text": "def job(id, options = {})\n objectify get(\"/job/#{id}\", options)['joblist']['job']\n end",
"title": ""
},
{
"docid": "b1ee7808110fae9b9e4ef08057e429b8",
"score": "0.6307932",
"text": "def job\n OSC::Machete::Job.new(\n script: script,\n pbsid: pbsid,\n host: host || workflow.batch_host,\n torque_helper: ResourceMgrAdapter.new(workflow)\n )\n end",
"title": ""
},
{
"docid": "7a568ebf3b6767ed07c91b26c2134f54",
"score": "0.6303357",
"text": "def working!\n disque.with {|cn| cn.call :working, job_id } if disque && job_id\n end",
"title": ""
},
{
"docid": "cd3a18c4569c3e05d5544db200ca69d2",
"score": "0.6277407",
"text": "def background_job\n values.find { | job | job.is_background? } \n end",
"title": ""
},
{
"docid": "4e461af041c29339149114cd21bfef0b",
"score": "0.6275479",
"text": "def enqueue_job\n COMMANDS.each do |command, job|\n next unless (matches = text&.match(/>\\s+(?<command>#{command})(\\s+(?<options>.*?))?\\s*$/))\n\n return job.enqueue(event_id: id, options: matches['options'])\n end\n nil\n end",
"title": ""
},
{
"docid": "9451c0e0aad8dfc4039018a275267233",
"score": "0.6268798",
"text": "def find_job\n @job = Job.find(params[:job_id])\n end",
"title": ""
},
{
"docid": "be8c0e523e44bef6196ea68a2b77a5fe",
"score": "0.62630385",
"text": "def get_job job_id, location: nil\n # The get operation is considered idempotent\n execute backoff: true do\n service.get_job @project, job_id, location: location\n end\n end",
"title": ""
},
{
"docid": "6f6885163fb4b6bc78f797bc0d09872f",
"score": "0.6246432",
"text": "def for_job(id)\n job = HydroponicBean.find_job(id)\n if !job || !yield(job)\n output(Protocol::NOT_FOUND)\n return false\n end\n end",
"title": ""
},
{
"docid": "9dcab9a8257fb58a2be97d29f66dd96b",
"score": "0.6236936",
"text": "def reserve_and_run_one_job; end",
"title": ""
},
{
"docid": "86ccd2f24bdf1a37e4dac0e68d755fcb",
"score": "0.6217795",
"text": "def next_availability\n if job = jobs.detect { |k, v| v['reserved_at'].nil? }\n job.first\n end\n end",
"title": ""
},
{
"docid": "274dd152e9ab1d54418fc86601453372",
"score": "0.61915433",
"text": "def job\n job_name.constantize.new({\n :context => self\n })\n end",
"title": ""
},
{
"docid": "fa5c1c8315769cf37c3f4968720ab5f4",
"score": "0.6190988",
"text": "def run_next_job(proc_node)\n job = nil\n get_next_job = true\n self.transaction do\n while get_next_job\n begin\n job = jobs.first\n job.run(proc_node) if job\n get_next_job = false\n rescue => ex\n # Just name sure we go on\n logger.info \"Exception getting next job from queue: #{ex}\"\n end\n end\n end\n job\n end",
"title": ""
},
{
"docid": "f3ea8d938316cf638f7d5cf916d989e9",
"score": "0.6189658",
"text": "def queue_job; end",
"title": ""
},
{
"docid": "c668ab32c46cff08acfc6dd86332e929",
"score": "0.61850196",
"text": "def job_exists? name\n\t\t\tjob = get_job name\n\t\t\treturn job[:success]\n\t\tend",
"title": ""
},
{
"docid": "723192db8f29bb5a4e9f755199dbf69d",
"score": "0.6176669",
"text": "def has_job?(job_name)\n jobs.exists?(job_name)\n end",
"title": ""
},
{
"docid": "c372547e0b159414ce7faa1e38c27305",
"score": "0.6161778",
"text": "def run_next_job(proc_node)\n job = nil\n get_next_job = true\n self.transaction do\n while get_next_job\n begin\n job = jobs.first\n job.run(proc_node) if job\n get_next_job = false\n rescue => ex\n # Just name sure we go on\n logger.info \"Exception getting next job from queue: #{ex}\"\n get_next_job = false\n reload\n end\n end\n end\n job\n end",
"title": ""
},
{
"docid": "ffd6423b2d2970a0c955d7a876e4c045",
"score": "0.61374235",
"text": "def work_one_job(conn = connection)\n begin\n job = reserve_job(conn)\n rescue Beaneater::TimedOutError => e\n return\n end\n\n self.log_job_begin(job.name, job.args)\n job.process\n self.log_job_end(job.name)\n\n rescue Backburner::Job::JobFormatInvalid => e\n self.log_error self.exception_message(e)\n rescue => e # Error occurred processing job\n self.log_error self.exception_message(e) unless e.is_a?(Backburner::Job::RetryJob)\n\n unless job\n self.log_error \"Error occurred before we were able to assign a job. Giving up without retrying!\"\n return\n end\n\n # NB: There's a slight chance here that the connection to beanstalkd has\n # gone down between the time we reserved / processed the job and here.\n num_retries = job.stats.releases\n max_job_retries = resolve_max_job_retries(job.job_class)\n retry_status = \"failed: attempt #{num_retries+1} of #{max_job_retries+1}\"\n if num_retries < max_job_retries # retry again\n retry_delay = resolve_retry_delay(job.job_class)\n delay = resolve_retry_delay_proc(job.job_class).call(retry_delay, num_retries) rescue retry_delay\n job.retry(num_retries + 1, delay)\n self.log_job_end(job.name, \"#{retry_status}, retrying in #{delay}s\") if job_started_at\n else # retries failed, bury\n job.bury\n self.log_job_end(job.name, \"#{retry_status}, burying\") if job_started_at\n end\n\n handle_error(e, job.name, job.args, job)\n end",
"title": ""
},
{
"docid": "77d51f3b53aeb01c626258c4008af412",
"score": "0.61302906",
"text": "def run\n case self[:job]\n when Proc\n self[:job].call\n else\n self[:job]\n end\n end",
"title": ""
},
{
"docid": "1b2493520c75540bf94bbb9d30a885f1",
"score": "0.6126399",
"text": "def get_job(id)\n conn = @client.get do |req|\n req.url \"/api/v2/job/#{id}\"\n req.headers[\"Authorization\"] = @token\n end\n conn.body\n end",
"title": ""
},
{
"docid": "d862f34dcf1cbe01b617319eb9adad68",
"score": "0.6120126",
"text": "def find_pending(job, batch)\n sql = \"Select * from #{@schema_name}.job_runs where job_id = '#{job.id}' and batch = '#{batch.to_json}' and (status = 'queued' or status = 'running' );\"\n job_run_query(sql)\n end",
"title": ""
},
{
"docid": "ea1cfd8dee073c4b1a89a24441068eeb",
"score": "0.6114288",
"text": "def job\n fetch('games.final_fantasy_xiv.jobs')\n end",
"title": ""
},
{
"docid": "112fddd989387d059b494e3af86a1163",
"score": "0.610812",
"text": "def get_job(uuid, username, password)\n jobs = get_json('jobs.json', username, password)\n job = jobs['jobs'].find { |j| j['uuid'] == uuid }\n\n if job['jobURL']\n job.merge!(get_json(job['jobURL'], username, password, ''))\n end\n\n fail \"Could not find job with UUID=#{uuid}\" unless job\n job\nend",
"title": ""
},
{
"docid": "0815b6275facd6128bc9c23c4bad2eff",
"score": "0.60956824",
"text": "def try_perform_later(...)\n job = job_or_instantiate(...)\n\n result = job.enqueue\n\n yield job if block_given?\n\n return Failure(job) if result == false\n\n Success(job)\n end",
"title": ""
},
{
"docid": "4be356caa5d0af54395370149ec3f731",
"score": "0.6085689",
"text": "def job(id)\n Job.new(id, self)\n end",
"title": ""
},
{
"docid": "b3990e80d40fd779e6af033702574673",
"score": "0.60780954",
"text": "def fetch_job\n JSON.parse(RestClient.get(url).body)\n end",
"title": ""
},
{
"docid": "145393f66e48e8dbaa090c5ef93312cc",
"score": "0.6053833",
"text": "def job(url)\n server(url).job(URI(url).path)\n end",
"title": ""
},
{
"docid": "34cacd7a283279d854ea91a2119c318b",
"score": "0.6010618",
"text": "def process!\n Sync::Jenkins.job_by_name(payload[\"name\"])\n end",
"title": ""
},
{
"docid": "cc2633b8df13c00c5b56706143c06d0a",
"score": "0.6002531",
"text": "def access_current_job\n if job = @job\n yield job\n end\n end",
"title": ""
},
{
"docid": "e76868140cea5a465639cd0a6d73882c",
"score": "0.59927994",
"text": "def get_future_job(uuid, klass)\n ResqueFuture::FutureJob.get(queue_from_class(klass), uuid)\n end",
"title": ""
},
{
"docid": "daf4c740b91e2d25549a70fd891d4ee5",
"score": "0.5987527",
"text": "def job_get(organization, jobid)\n uri = server_uri(\"/organizations/#{organization}/jobs/#{jobid}\")\n res_data = api_get(uri)\n @logger.debug res_data\n\n return res_data\n end",
"title": ""
},
{
"docid": "31978c88709e96d3a96790ce94b26e8d",
"score": "0.5973048",
"text": "def work_job(queue = :job)\n worker = Resque::Worker.new(queue)\n worker.perform(worker.reserve)\n end",
"title": ""
},
{
"docid": "4a0cad2c99445cfdb29837dea577917a",
"score": "0.59611195",
"text": "def scrape_jobs\n @scraper = FreelancerFinder::Scraper.new\n @scraper.scrape_recent_jobs.each do |job_hash|\n FreelancerFinder::Job.new(job_hash) unless FreelancerFinder::Job.all.detect {|job| job.path == job_hash[:path]} # next create a job instance from the data we just scraped unless it exists already\n end\n end",
"title": ""
},
{
"docid": "8d3a30f63afcba590aa789ea8f295a45",
"score": "0.59599906",
"text": "def find(id)\n plan_data = with_redis { |redis| redis.get(id) }\n # If found, return the job, otherwise raise NoSuchJob\n if plan_data.nil?\n raise NoSuchJob.new \"No Such DeferredJob: #{id}\"\n else\n plan = MultiJson.decode(plan_data)\n new(id, plan.first, *plan.last)\n end\n end",
"title": ""
},
{
"docid": "445f9e3aa8dcd42c054a9a2a30696396",
"score": "0.5948123",
"text": "def get_job_by_object_path(path)\n obj = @service.object(path)\n .tap(&:introspect)\n Job.new(obj.Get(Job::INTERFACE, 'Id').first, self)\n end",
"title": ""
},
{
"docid": "4ea02ef46c5e232e8baa905493c7379c",
"score": "0.5941374",
"text": "def scrape_job_from_qjob qjob\n args = qjob.body.split(\"\\t\")\n # request_klass = Wukong.class_from_resource(args.shift)\n scrape_job = request_klass.new(*args[1..-1])\n end",
"title": ""
},
{
"docid": "5ccf6681e988bde26e91e4e9e954eb86",
"score": "0.5939795",
"text": "def get_next_task\n if worker_key && !worker_key.empty?\n BdrbJobQueue.find_next(worker_name.to_s,worker_key.to_s)\n else\n BdrbJobQueue.find_next(worker_name.to_s)\n end\n end",
"title": ""
},
{
"docid": "016a701fea8dcd52f5f4059c26a25fd6",
"score": "0.59226364",
"text": "def job\n JenkinsApi::Client::Job.new(self)\n end",
"title": ""
},
{
"docid": "016a701fea8dcd52f5f4059c26a25fd6",
"score": "0.59226364",
"text": "def job\n JenkinsApi::Client::Job.new(self)\n end",
"title": ""
},
{
"docid": "06e9e40186c363c78dceacbe1be2598c",
"score": "0.58942544",
"text": "def job_search_parser\n @job_search_parser || JobSearch\n end",
"title": ""
},
{
"docid": "79038b69f51ea1fa8b4c52ecdd129b00",
"score": "0.5883438",
"text": "def load_job\n @job = Job.find(params[:job_id])\n end",
"title": ""
},
{
"docid": "c069df4296859561ab14a5b58954e757",
"score": "0.5880527",
"text": "def to_job\n job = Patriot::JobStore::Job.new(self.job_id)\n job.read_command(self)\n return job\n end",
"title": ""
},
{
"docid": "ea68605ae8c0d290ba8c557f128f56c1",
"score": "0.5868842",
"text": "def run(job)\n if @inqueue.size >= @queue_length\n @result_handler.call(*result)\n end\n @inqueue.push(job)\n @jobcount += 1\n nil\n end",
"title": ""
},
{
"docid": "2807bdef253ad5c3d64a64840c70cb41",
"score": "0.58668894",
"text": "def process_available_jobs\n processed = false\n until shutdown?\n reset_filter_if_expired\n job = Job.rocket_job_next_job(name, current_filter)\n break unless job\n\n SemanticLogger.named_tagged(job: job.id.to_s) do\n processed = true unless job.rocket_job_work(self, false, current_filter)\n end\n end\n processed\n end",
"title": ""
},
{
"docid": "142ca50cfc52e8857cdc28028ab0c2f3",
"score": "0.5863116",
"text": "def job_class\n SingleInstanceQueueJob\n end",
"title": ""
},
{
"docid": "65d339255129599c76f178e4b274e12c",
"score": "0.585976",
"text": "def grab_job_uniq\n throw :notimpl\n end",
"title": ""
},
{
"docid": "0e868f139a12b9b9d73efcc934c0d91d",
"score": "0.5844912",
"text": "def job_resource(job)\n if job['wrapped']\n job['wrapped']\n else\n job['class']\n end\n end",
"title": ""
},
{
"docid": "2fe615b4173aa7c549f1fc649725573b",
"score": "0.58431804",
"text": "def as_jobs\n @jobs ||= find_latest_completed_jobs\n end",
"title": ""
},
{
"docid": "ab1021eb9aca0acb3faf1173ee4b90c5",
"score": "0.5833289",
"text": "def prepare_job \n if @job_condition\n @job = Job.new\n parse_values(\"JOB\", @job)\n @job = update_job @job\n @jobs << @job\n end\n end",
"title": ""
},
{
"docid": "344cc5a36b9e716d2180aa7fff7591df",
"score": "0.5824765",
"text": "def job_service\n job_arguments(0)\n end",
"title": ""
},
{
"docid": "0c4ebb90947ab69c9d1f8f2be682124a",
"score": "0.58147407",
"text": "def wait_for_job\n\t\tloop {\n\t\t\tputs \":: #{self.feedback['job_desc']}: #{self.job_state}\" if ENV['LKP_VERBOSE']\n\n\t\t\tbreak if self.job_successfull_finished? or\n\t\t\t\t self.job_failed? or\n\t\t\t\t self.job_cancelled?\n\n\t\t\t# otherwise, the job is still in the queue or running; let's wait\n\t\t\tsleep 60\n\t\t}\n\n\t\treturn self.feedback['scheduled_time'] || self.feedback[\"#{self.job_state}_time\"]\n\tend",
"title": ""
},
{
"docid": "15c69a94ba62f63a2cda3371435bc39b",
"score": "0.5812711",
"text": "def jobs\n @jobs || {}\n end",
"title": ""
},
{
"docid": "e95107ef26e082d247c2d058545ed613",
"score": "0.58088017",
"text": "def resolve_job_by_name(name, settings = {})\n job = job_collection.get_item(name)\n raise \"Failed to locate job by name '#{name}'\" if job.nil?\n\n job_value = job[:value]\n logger.debug \"Compiling job #{name}\"\n compiler = JenkinsPipelineBuilder::Compiler.new self\n success, payload = compiler.compile_job(job_value, settings)\n [success, payload]\n end",
"title": ""
},
{
"docid": "d9b4f754ee6ccccc5c7bd8003fcd7393",
"score": "0.58019674",
"text": "def poll\n\t\tactive_node = Node.find_by_mac_address(params[:nodeid]) || create_node\n\n\t\tif params[:jobid]\n\t\t\t# check status of current job\n\t\t\tjob = Job.find(params[:jobid])\n\n\t\t\tif job.status == \"active\"\n\t\t\t\trender :json => '{ \"status\": \"active\"}'\n\t\t\telse\n\t\t\t\trender\t:json => '{ \"status\": \"halt\"}'\n\t\t\tend\n\t\telse\n\t\t\t# check if there are any ongoing jobs\n\t\t\tjobs = Job.active\n\n\t\t\t# If there are any, choose one randomly\n\t\t\tif jobs.count > 0\n\t\t\t\tjob_idx = rand(jobs.count - 1)\n\n\t\t\t\tjob = jobs[job_idx]\n\n\t\t\t\t# If it's a dictionary job let's find the work\n\t\t\t\tif job[:attack_type] == \"dictionary\"\n\t\t\t\t\t# Not elegant, but can't directly assign job[:work] = ...\n\t\t\t\t\tjob.work = dictionary_content_for_job(job.id, active_node.id)\n\n\t\t\t\t\tif job.work == \"\"\n\t\t\t\t\t\tjob.status = \"completed\"\n\t\t\t\t\t\tjob.save\n\t\t\t\t\t\treturn :json => '{ \"status\": \"halt\"}'\n\t\t\t\t\tend\n\t\t\t\telsif job[:attack_type] == \"bruteforce\"\n\t\t\t\t\tjob.next_index = job.next_index.nil? ? 0 : job.next_index\n\n\t\t\t\t\tbruteforce_status = BruteforceStatus.create({\n\t\t\t\t\t\t:node_id => active_node.id,\n\t\t\t\t\t\t:job_id => job.id,\n\t\t\t\t\t\t:index => job.next_index\n\t\t\t\t\t})\n\t\t\t\t\t## Calculate next index. We're just going to increase by 50 for now\n\t\t\t\t\tjob.next_index = job.next_index + 50\n\t\t\t\t\tjob.save\n\n\t\t\t\t\t# TODO: Mark job complete if next_index > length\n\t\t\t\t\tkeyspace_size = Bruteforce::totalSize(job.charset)\n\t\t\t\t\tif job.next_index > keyspace_size\n\t\t\t\t\t\tjob.status = \"completed\"\n\t\t\t\t\t\tjob.save\n\t\t\t\t\tend\n\n\t\t\t\tend\n\n\t\t\t\trender :json => job, methods: [:work, :response_flag_meta]\n\t\t\telse\n\t\t\t\trender :json => '{ \"job\": \"none\"}'\n\t\t\tend\n\t\tend\n\n\t\t# mark the client as active\n\t\tactive_node.mark_active\n\tend",
"title": ""
},
{
"docid": "bbbcb5face82ef942ed26f410692f933",
"score": "0.5785948",
"text": "def [](key)\n @jobs[key]\n end",
"title": ""
},
{
"docid": "b362acb68804ee1e60b66c34591c80b8",
"score": "0.5781543",
"text": "def job?(cmd)\n @job = api.query_job(cmd)\n job.wait_until_done!\n fld = job.failed?\n puts(job.error['message']) if fld\n fld\n end",
"title": ""
},
{
"docid": "c6f3832314752914da482eb96b1c9153",
"score": "0.57803035",
"text": "def queue_retrieve_certificate_job(db_connection = nil, callback=false)\n # if we're not being used inside a pipelined request, grab an\n # existing connection from the db pool\n if(db_connection.nil?)\n # call the rapsheet validation job with 'mute' paramter as true\n # to supress notifications when re-queing\n Store.db.rpush(queue_pending, job_certificate_retrieve_data(callback))\n else\n # when a connection is provided, such as for a pipelined request\n # use it:\n # call the rapsheet validation job with 'mute' paramter as true to\n # supress notifications when re-queing\n db_connection.rpush(queue_pending, job_certificate_retrieve_data(callback))\n end\n\n # update the status\n @status = \"requeued\"\n @location = \"PR.gov GMQ\"\n @state = :retrieving_certificate_from_rci\n # save the transaction state\n save\n return true\n end",
"title": ""
},
{
"docid": "fc61430c3c230e926ea35a6b3f8261f1",
"score": "0.577675",
"text": "def get_single_job_sample(client)\n response = client[\"jobs/#{$job_id}\"].get\n\n p ''\n p 'Get single job'\n p response\nend",
"title": ""
},
{
"docid": "567b19def4e8e426b8dc848aa016e0f5",
"score": "0.577498",
"text": "def get_job_status(job_id)\n @dbh[:progress_bars].filter(:id => job_id).first\n end",
"title": ""
},
{
"docid": "d571ec8638c442309e9da454a7338c2e",
"score": "0.5774567",
"text": "def get_exec_jobno(sc, jobno=nil)\n\t\t\tret = false\n\t\t\tmethod = \"r\"\n\t\t\tmethod = \"w\" if !::File.exist?(JOBLIST_LOCK)\n\n\t\t\tFile::open(JOBLIST_LOCK, method){ |ld|\n\t\t\t\t# lock!\n\t\t\t\tbreak if ld.flock(File::LOCK_SH) != 0\n\t\t\t\t# joblist none...\n\t\t\t\tbreak if !::File.exist?(JOBLIST)\n\n\t\t\t\tsc.collect{ |opt|\n\t\t\t\t\t# get exec jobno(1(wait) or 3(upload now))\n\t\t\t\t\tFile::open(JOBLIST, \"r\"){ |fp|\n\t\t\t\t\t\tfp.gets # line 1(global otpion)\n\t\t\t\t\t\twhile line = fp.gets\n\t\t\t\t\t\t\tbuf = line.split(\",\")\n\t\t\t\t\t\t\tnext if buf.size != 6\n\t\t\t\t\t\t\tif buf[0] == opt and buf[1].size == 36\n\t\t\t\t\t\t\t\tret = buf[1]\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\tif jobno # Select jobno\n\t\t\t\t\t\t\t\tif ret != jobno\n\t\t\t\t\t\t\t\t\tret = false\n\t\t\t\t\t\t\t\t\tnext\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tbreak if ret\n\t\t\t\t\t\tend\n\t\t\t\t\t} # joblist close\n\n\t\t\t\t\tbreak if ret\n\t\t\t\t}\n\n\t\t\t} # unlock joblist\n\n\t\t\treturn ret\n\t\tend",
"title": ""
},
{
"docid": "01917a1b56ec4cd9652498a09daa98cf",
"score": "0.5761594",
"text": "def jobs\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "ec29688e21e77ef057267d108e7d3c06",
"score": "0.57599646",
"text": "def get_job(job_id)\n client = IotHubApiClient.new(@options)\n res = client.get(jobs_path(job_id), @api_version_param)\n JobResponse.new(response_json(res))\n end",
"title": ""
},
{
"docid": "9877e590d58e39e6d315f0d7e7932e2a",
"score": "0.5758772",
"text": "def check_for_job_completion\n self.job.check_for_completion if complete?\n end",
"title": ""
}
] |
57d87b86a147ccf11b31a0b902832ff7
|
LIB template for resource
|
[
{
"docid": "522c3a723685cb65109ccd9d305b565e",
"score": "0.0",
"text": "def base_namespace_file\n <<-FILE.strip_heredoc\n # frozen_string_literal: true\n\n module #{@naming.klass_name}\n VERSION = '0.1.0'\n end\n FILE\n end",
"title": ""
}
] |
[
{
"docid": "363d7c011b4d0cf743103a07fb695aad",
"score": "0.715443",
"text": "def resource; end",
"title": ""
},
{
"docid": "368f76df0db2a836ccb2aa0c3fab315b",
"score": "0.6843928",
"text": "def resource(opts = {})\n @raw.resource(opts)\n end",
"title": ""
},
{
"docid": "77b651e4000bb99a9122fc517d1c02cc",
"score": "0.6778737",
"text": "def resource_class=(_arg0); end",
"title": ""
},
{
"docid": "b0a3f844112a3b8fa053e8b2cb0069f8",
"score": "0.6748339",
"text": "def resource_path; end",
"title": ""
},
{
"docid": "06a985dd7831c4d326a48d457e752e14",
"score": "0.6656565",
"text": "def resources; end",
"title": ""
},
{
"docid": "34ba30c703ca955b578eb289bea9365b",
"score": "0.66168267",
"text": "def generate_resource(data)\n target_folder = File.join(data.output_folder, 'libraries')\n name = data.object.name.underscore\n\n data.generate(\n 'templates/inspec/singular_resource.erb',\n File.join(target_folder, \"google_#{data.product.api_name}_#{name}.rb\"),\n self\n )\n\n data.generate(\n 'templates/inspec/plural_resource.erb',\n File.join(target_folder, \"google_#{data.product.api_name}_#{name}\".pluralize + '.rb'),\n self\n )\n\n generate_documentation(data.clone, name, false)\n generate_documentation(data.clone, name, true)\n generate_properties(data.clone, data.object.all_user_properties)\n end",
"title": ""
},
{
"docid": "c278b1528c5ff6f1ed40c72028d4a74a",
"score": "0.66061527",
"text": "def resource\n # Implemented by subclasses.\n end",
"title": ""
},
{
"docid": "22b26a71051b7bd28480446112cdca18",
"score": "0.65986055",
"text": "def resource_class; end",
"title": ""
},
{
"docid": "64773e4d35d7617b4b9623fe901c3739",
"score": "0.65665936",
"text": "def resource\n self.class::RESOURCE || (raise NotImplementedError, \"#{self.class} does not define a RESOURCE\"; nil)\n end",
"title": ""
},
{
"docid": "17f92223043a5c3b68b557057f8f48a6",
"score": "0.65618193",
"text": "def resource(*args)\n resource_class.new(backend, resource_name, *args)\n end",
"title": ""
},
{
"docid": "17f92223043a5c3b68b557057f8f48a6",
"score": "0.65618193",
"text": "def resource(*args)\n resource_class.new(backend, resource_name, *args)\n end",
"title": ""
},
{
"docid": "8e718e3f66c9b11dddc2f437d464b731",
"score": "0.6532469",
"text": "def code(resource) ; end",
"title": ""
},
{
"docid": "03bc6f23c8bcb48e6b2bb7ed699de141",
"score": "0.6475552",
"text": "def resource_operations; end",
"title": ""
},
{
"docid": "7f965d41815e972692243b5820110f5c",
"score": "0.6466622",
"text": "def resource(path)\t \n Samurai.logger.debug(\"#{self.class}:#{__method__} host:#{@host} port:#{@port}\")\n\t \n Resource.new(self, path)\t \n end",
"title": ""
},
{
"docid": "145e83e198d45d4349e5185bafe9b865",
"score": "0.63868827",
"text": "def resource(path)\t \n Stratum.logger.debug(\"#{self.class}:#{__method__} host:#{@host} port:#{@port} user:#{@user}\")\n\t \n Resource.new(self, path)\t \n end",
"title": ""
},
{
"docid": "f25d3f14fcab1ff301f1c9cefc2b50c5",
"score": "0.6373194",
"text": "def catalogResources\n end",
"title": ""
},
{
"docid": "67a2673707fe30b4c8995082c7fa293f",
"score": "0.637138",
"text": "def resource(name, options = {}, &blk)\n _resource(Resource, name, options, &blk)\n end",
"title": ""
},
{
"docid": "fe7bd1c53baa41eb38c65130eab2425b",
"score": "0.6368231",
"text": "def resource(nm, desc) @all_resources[nm] = { :name => nm, :description => desc } ; end",
"title": ""
},
{
"docid": "2c6b594df150595ca1afab017a732c86",
"score": "0.6350761",
"text": "def resource_name; end",
"title": ""
},
{
"docid": "c3581afe3aab7f5e6e0493aa1d7aa979",
"score": "0.63261706",
"text": "def initialize( resource )\n \t@resource = resource\n end",
"title": ""
},
{
"docid": "8dea954ee1d83f174439fc67a7970958",
"score": "0.6257348",
"text": "def decorate_resource( rsrc )\n klass = SchedResource.block_class_for_resource_name(self.class.name)\n rsrc.label = klass.label\n rsrc.title = @rid\n end",
"title": ""
},
{
"docid": "37bf1efbc65c4270260279eb1ec8094e",
"score": "0.6256306",
"text": "def resource_url(*args,&block)\n\t\t\tif block_given?\n\t\t\t\tresource = [block,args]\n\t\t\telse\n\t\t\t\tresource = Iowa::Resource.new(args[0], args[1], args[2])\n\t\t\tend\n\t\t\tresourceID = \"r_#{@requestCount}.#{@resourceCount}\"\n\t\t\t@resources[resourceID] = resource\n\t\t\t@resources_by_component[@context.requestID] ||= []\n\t\t\t@resources_by_component[@context.requestID].push resourceID\n\t\t\t@resourceCount = @resourceCount.next\n\t\t\treturn \"#{@context.sessionURL}.#{resourceID}#{@context.locationFlag}\"\n\t\tend",
"title": ""
},
{
"docid": "e1ee3b48551099cd86a82c224b34105b",
"score": "0.62449485",
"text": "def generate_resource_files(pwd, data) end",
"title": ""
},
{
"docid": "e1ee3b48551099cd86a82c224b34105b",
"score": "0.62449485",
"text": "def generate_resource_files(pwd, data) end",
"title": ""
},
{
"docid": "777f82e8635d509c83c19dcb0a38dfb4",
"score": "0.62347406",
"text": "def resources\n [resource, \"s\"].join\n end",
"title": ""
},
{
"docid": "56877ea7c31622a18af03e36db2d010c",
"score": "0.6226753",
"text": "def compile_resource(res)\n # Apply meta_functions here \n o = case res\n when PoolParty::Resources::Variable\n # do variable stuff\n variables << res\n \"\"\n when PoolParty::Resources::FileResource\n files << res\n super\n when PoolParty::Resources::ChefAttributesFile\n attribute_files << res\n \"\"\n when PoolParty::Resources::ChefRecipe\n recipes << res\n super\n else\n super\n end\n \n apply_meta_functions(res, o) if res.is_a?(PoolParty::Resource) && res.print_to_chef != :no_print\n end",
"title": ""
},
{
"docid": "7455e4a3232c65571285bbeae402f4fe",
"score": "0.62141097",
"text": "def resource_location; end",
"title": ""
},
{
"docid": "ed5e64d1602fd10610b99bcdada593fb",
"score": "0.6196809",
"text": "def get_static_resource resource_path\t\t\n\t\tresource_path.should! :relative?\n\t\tfname = lookup_resource resource_path\n\t\tunless fname\n\t\t\traise \"File '#{resource_path}' not found!\" \n\t\tend\t\t\t\t\n\t\t\n\t\tres = Core::IO::ResourceData.initialize_from_file fname\n\t\th = header(fname, res)\n\t\t#\t\tset_date! h \n\t\treturn res, h\n\tend",
"title": ""
},
{
"docid": "962cfef595c0c575f9342511015a825f",
"score": "0.6190746",
"text": "def decorate_resource( rsrc )\n rsrc.label = channum\n rsrc.title = name\n end",
"title": ""
},
{
"docid": "f88a2fdf0e4b9c18414ab81caefcb9b3",
"score": "0.6172865",
"text": "def puppet_resource_cmd(res_name, title, property, value)\n PUPPET_BINPATH + \"resource #{res_name} '#{title}' #{property}=#{value}\"\n end",
"title": ""
},
{
"docid": "455cf64358a134e58eedc04506ee7dce",
"score": "0.6163571",
"text": "def resource(*resources)\n resources.each do |r|\n resource = resourceify r\n path = \"#{@path}/#{resource.downcase}\"\n enclosed_module = @sub_module == nil ? (Destiny) : (Destiny.const_get(@sub_module))\n resource_class = enclosed_module.const_get resource\n instance_variable_set(\"@#{r}\", resource_class.new(path, @client))\n end\n\n self.class.instance_eval { attr_reader *resources }\n end",
"title": ""
},
{
"docid": "bd3605ddfa1930f24e804ac261ae10eb",
"score": "0.61589277",
"text": "def resource_for(key)\n format(\"# %s\\n\\n%s\", key, examples(key))\n end",
"title": ""
},
{
"docid": "f4fc731916909bb6c79b1695861fdf1b",
"score": "0.61508495",
"text": "def resource_path\n \"/#{resource_name}/#{self.id}\"\n end",
"title": ""
},
{
"docid": "428d83f2cfa7f1614c1447084255382c",
"score": "0.6147653",
"text": "def resource\n instance_variable_get(:\"@#{resource_name}\")\n end",
"title": ""
},
{
"docid": "354de9e78b8ed35ef15262bd9c90f699",
"score": "0.61361057",
"text": "def resource\n self.class.instance_exec { @__resource ||= nil }\n self.class.instance_variable_get(:@__resource)\n end",
"title": ""
},
{
"docid": "6a82b7a25867bfc2753463e9cfff2fb2",
"score": "0.6132111",
"text": "def template_name\n 'resource.json.jbuilder'\n end",
"title": ""
},
{
"docid": "f586fdb67439b01fd87e87ac69fa96ba",
"score": "0.612262",
"text": "def resource\n instance_variable_get(:\"@#{resource_name}\")\n end",
"title": ""
},
{
"docid": "532a6a33f17d86004da0f832ed7466ca",
"score": "0.6103545",
"text": "def resource_template(name)\n \"#{resource}_#{name}\"\n end",
"title": ""
},
{
"docid": "532a6a33f17d86004da0f832ed7466ca",
"score": "0.6103545",
"text": "def resource_template(name)\n \"#{resource}_#{name}\"\n end",
"title": ""
},
{
"docid": "6103e514533a7e73495164b9a010851a",
"score": "0.6101285",
"text": "def resource\n end",
"title": ""
},
{
"docid": "1388d279c2705daebfa47d3f714c7152",
"score": "0.60957223",
"text": "def resource(xml, object, mime_type, stat, extra = nil)\n pn = dlna_profile mime_type\n\n additional = [pn, 'DLNA.ORG_OP=01', 'DLNA.ORG_CI=0'].compact.join ';'\n\n url = resource_url object\n\n attributes = {\n :protocolInfo => ['http-get', '*', mime_type, additional].join(':'),\n :size => stat.size,\n }\n\n case extra\n when Mp3Info then\n attributes[:bitrate] = extra.bitrate * 128 # bytes/s\n attributes[:sampleFrequency] = extra.samplerate\n channels = extra.channel_mode == 'Single Channel' ? 1 : 2\n attributes[:nrAudioChannels] = channels\n\n secs = extra.length.to_i\n f_secs = (extra.length - secs) * 100\n mins, secs = secs.divmod 60\n hours, mins = mins.divmod 60\n\n attributes[:duration] = '%d:%0.2d:%0.2d.%0.2d' % [\n hours, mins, secs, f_secs]\n when EXIFR::JPEG, EXIFR::TIFF then\n attributes[:resolution] = \"#{extra.height}x#{extra.width}\"\n\n case extra.bits_per_sample\n when Array then\n bits_per_sample = 0\n extra.bits_per_sample.each { |b| bits_per_sample += b }\n\n attributes[:colorDepth] = bits_per_sample\n attributes[:bitsPerSample] = extra.bits_per_sample.first\n when Integer then\n attributes[:colorDepth] = extra.bits if extra.respond_to? :bits\n attributes[:bitsPerSample] = extra.bits_per_sample\n end\n end\n\n xml.res attributes, url\n end",
"title": ""
},
{
"docid": "c07e3eb27b040404318900d23ce569f1",
"score": "0.6090329",
"text": "def resource\n Axel.resources[resource_name]\n end",
"title": ""
},
{
"docid": "bd51822563bb9af32c19d2d269d2f8cc",
"score": "0.6085239",
"text": "def resource_translate resource\n @resource_map ||= {\n \"cookbook_file\" => \"file\",\n \"cron\" => \"cron\",\n \"deploy\" => \"deploy\",\n \"directory\" => \"file\",\n \"erlang_call\" => \"erlang_call\",\n \"execute\" => \"exec\",\n \"file\" => \"file\",\n \"gem_package\" => \"package\",\n \"git\" => \"git\",\n \"group\" => \"group\",\n \"http_request\" => \"http_request\",\n \"ifconfig\" => \"ifconfig\",\n \"link\" => \"file\",\n \"log\" => \"log\",\n \"mdadm\" => \"mdadm\",\n \"mount\" => \"mount\",\n \"package\" => \"package\",\n \"remote_directory\" => \"remote_directory\",\n \"remote_file\" => \"file\",\n \"route\" => \"route\",\n \"ruby_block\" => \"ruby_block\",\n \"scm\" => \"scm\",\n \"script\" => \"script\",\n \"service\" => \"service\",\n \"subversion\" => \"subversion\",\n \"template\" => \"file\",\n \"user\" => \"user\",\n \"include_recipe\" => \"require\"\n }\n return @resource_map[resource.to_s] if @resource_map[resource.to_s]\n resource.to_s\nend",
"title": ""
},
{
"docid": "099ba087fca93abe2bd168c33925a4eb",
"score": "0.6080849",
"text": "def resource_path\n \"#{resource_name}/#{id}\"\n end",
"title": ""
},
{
"docid": "c5258af73ca43a63564e81655689b13a",
"score": "0.6068412",
"text": "def resource\n @resource = instance_variable_get(('@' + resource_name).to_sym)\n end",
"title": ""
},
{
"docid": "67c648ba1bd05d44655b2c8a025f99c6",
"score": "0.60627687",
"text": "def resource_symbol\n @resource_symbol ||= \":#{resource_name}\"\n end",
"title": ""
},
{
"docid": "a7b90073504cc680b7e3e850dd1d4bdf",
"score": "0.60460263",
"text": "def resource_path\n end",
"title": ""
},
{
"docid": "e5d4699c19f9ee3f6b97bddf33d39cb7",
"score": "0.6040686",
"text": "def resource\n instance_variable_get(:\"@#{resource_name}\")\n end",
"title": ""
},
{
"docid": "e5d4699c19f9ee3f6b97bddf33d39cb7",
"score": "0.6040686",
"text": "def resource\n instance_variable_get(:\"@#{resource_name}\")\n end",
"title": ""
},
{
"docid": "a73a0c27106ac9bb2a7a705039c889d1",
"score": "0.60326874",
"text": "def build_resource(hash=nil)\n super\n end",
"title": ""
},
{
"docid": "b9eec964fa42a0c64b38ad86614dbb29",
"score": "0.60309136",
"text": "def create_resource_for(resource_name); end",
"title": ""
},
{
"docid": "5a4d6c9f7862eae83c9903140b510ab9",
"score": "0.60108143",
"text": "def irregular_resource_name; end",
"title": ""
},
{
"docid": "add6f488cde9e70a7431ee43dc6d8a34",
"score": "0.5999469",
"text": "def resource\n instance_variable_get(:\"@#{resource_name}\")\n end",
"title": ""
},
{
"docid": "3350f3cf2a30dcc873ff0af3b520d08d",
"score": "0.5991725",
"text": "def res(resource)\n raise NotInitializedError.new(\"Billomat account or key was not set!\") if @account.nil? or @key.nil?\n\n resource = resource.to_s.split('_').map { |x| x.capitalize }.join('').to_sym\n raise ArgumentError.new(\"Unknown resource type '#{resource}'\") if not Billomat::Resources.constants.include? resource\n\n Billomat::Resources.const_get(resource)\n end",
"title": ""
},
{
"docid": "70c8eedf8175bb065a95b7076147ff3b",
"score": "0.5990604",
"text": "def canonicalized_resource(uri); end",
"title": ""
},
{
"docid": "7816a97918692bf6b97d38bb050ab899",
"score": "0.5976798",
"text": "def path\n base + resource\n end",
"title": ""
},
{
"docid": "7816a97918692bf6b97d38bb050ab899",
"score": "0.5976798",
"text": "def path\n base + resource\n end",
"title": ""
},
{
"docid": "11958497db8164ef2febd4f4c8f4a654",
"score": "0.59752136",
"text": "def make_res(type)\n ::RDFS::Resource.new(type.to_s)\n end",
"title": ""
},
{
"docid": "ef3cd27014d6ec04799e82f0691029b0",
"score": "0.5970771",
"text": "def resource\n @resource ||= json[resource_key]\n end",
"title": ""
},
{
"docid": "823e3aae8a23e14a210316f8464ec294",
"score": "0.59596884",
"text": "def canonicalized_resource(service_type, path); end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.59559137",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.59559137",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.59559137",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "43aff3998062eb02a548fc4ede681e42",
"score": "0.59503525",
"text": "def render_resource (resource) \n return truncate(resource) if !(resource.instance_of? RDFS::Resource) \n #if a view was defined by the user. \n \n if $USE_EXPLORATOR_VIEW && resource.explorator::view != nil && !is_class(resource) \n resource.instance_eval(resource.explorator::view.to_s) \n #render the resource type's view.\n elsif $USE_EXPLORATOR_VIEW && RDFS::Resource.new(resource.type[0].uri).explorator::view != nil \n resource.instance_eval(RDFS::Resource.new(resource.type[0].uri).explorator::view) \n #render a default property: label, name, title, or the resource localname\n else \n session[:label_properties].each do |methodname| \n #Do not use send here.\n value = eval (\"resource.\" + methodname)\n if value != nil \n return truncate(value)\n end\n end \n str = resource.uri.to_s.downcase\n str = str[str.length-4,str.length]\n if str == '.jpg' || str =='.gif' || str =='.png'\n '<img class = \"image\" src =\"' + resource.uri + '\"/>'\n else\n truncate(resource.localname)\n end \n \n end \n end",
"title": ""
},
{
"docid": "a58712f167e274a92441ae78ce493b36",
"score": "0.59477866",
"text": "def resource\n @resource ||=Resource.new(get.body, @entry_point)\n end",
"title": ""
},
{
"docid": "81c821a3d49ff5c78305d5f02443063c",
"score": "0.5931748",
"text": "def _scanResource resource\n\t\n\t\t\n\tend",
"title": ""
},
{
"docid": "983dec9310b36b1aa7bd43dcee6a940a",
"score": "0.59172463",
"text": "def resource_tpl_get(term)\n fail Errors::ArgumentError, '\\'term\\' is a mandatory argument' if term.blank?\n resource_tpl = backend_instances['compute'].get_resource_tpl(term)\n resource_tpl.location = \"/mixin/resource_tpl/#{resource_tpl.term}/\" if resource_tpl\n resource_tpl\n end",
"title": ""
},
{
"docid": "648704eb01d698085486cfaf3b61a31c",
"score": "0.59135544",
"text": "def resource(name)\n Object.const_get(\"RedboothRuby::#{camelize(name)}\") rescue nil\n end",
"title": ""
},
{
"docid": "cf76e136c056fc561ebd1808891dc929",
"score": "0.5908016",
"text": "def processResources(resource)\n o = PuppetResource.new\n o.type = resource['resource_type']\n o.title = resource['resource_title']\n o.status = resource['status']\n o.timestamp = resource['timestamp']\n o.new_value = resource['new_value']\n o.old_value = resource['old_value']\n o.class = resource['containing_class']\n\n o\nend",
"title": ""
},
{
"docid": "0606c8c80156840c62dccec3d2453da0",
"score": "0.59047276",
"text": "def resource\n @resource ||= resource_name.classify.constantize.find(resource_id)\n end",
"title": ""
},
{
"docid": "90ce7c4528ea18711ffdfbc6653b1b19",
"score": "0.5901583",
"text": "def resource(_resource)\n raise ResourceDefentitionError unless _resource.is_a? String\n\n @_resource = _resource\n end",
"title": ""
},
{
"docid": "ca5fde1ba85b7919a73c53269f328b8f",
"score": "0.58992165",
"text": "def img_file\n return \"resource_\" + symbol.to_s\n end",
"title": ""
},
{
"docid": "383cafbe545b7cfefaaf2b4c80c3e4b7",
"score": "0.5897822",
"text": "def generate_resource(data)\n target_folder = data[:output_folder]\n FileUtils.mkpath target_folder\n name = Google::StringUtils.underscore(data[:object].name)\n generate_resource_file data.clone.merge(\n default_template: 'templates/example/resource.erb',\n out_file: File.join(target_folder, \"#{name}.rb\")\n )\n end",
"title": ""
},
{
"docid": "892097500bdde2a04d9d3a0a928dab94",
"score": "0.5890916",
"text": "def method_missing(method_name, *args, &block)\n case method_name\n when \"vars\"\n @vars\n else\n if (args.length != 1)\n msg = \"Too many arguments for resource invocation '#{method_name}'.\"\n logger.fatal(msg)\n raise msg\n end\n resource(method_name.to_sym, args[0], &block)\n end\n end",
"title": ""
},
{
"docid": "13bb2fa8de48587d696e50bb552d6a2b",
"score": "0.5883099",
"text": "def initialize( resource )\n @resource = resource\n end",
"title": ""
},
{
"docid": "8f027b2e11948f01ee3a9c367fd3e175",
"score": "0.5876663",
"text": "def add_resource(name,path)\n @resources[name]=path\n end",
"title": ""
},
{
"docid": "cff980d08011fbb0a1727edff6633b3d",
"score": "0.5875589",
"text": "def resource\n NSLog('Warning: SugarCube\\'s String#resource method has been deprecated in favor of String#resource_path')\n self.resource_path\n end",
"title": ""
},
{
"docid": "c63402bb18696e8c7fad659b86f8c865",
"score": "0.5869081",
"text": "def list_resource_tpl\n @resource_tpl\n end",
"title": ""
},
{
"docid": "e8db626728f4c85467fbdd4534442536",
"score": "0.58581406",
"text": "def path\n resource[:path]\n end",
"title": ""
},
{
"docid": "e8db626728f4c85467fbdd4534442536",
"score": "0.58581406",
"text": "def path\n resource[:path]\n end",
"title": ""
},
{
"docid": "81b224ade849ccb2745db40f23ce9bc7",
"score": "0.58561605",
"text": "def resource\n self.uri_parts['Resource']\n end",
"title": ""
},
{
"docid": "2ca152433d2f032fb6d487b9853bc31c",
"score": "0.5835473",
"text": "def resource(path)\n Resource.new(self, path)\n end",
"title": ""
},
{
"docid": "21278699f433afe6a85a54d0710e0db2",
"score": "0.5828614",
"text": "def resource_web_url(_resource); end",
"title": ""
},
{
"docid": "42166497216de433e80f5f15b4e0398f",
"score": "0.5818987",
"text": "def load_resources; end",
"title": ""
},
{
"docid": "d5481e184879aae8c2566994fad33931",
"score": "0.5816375",
"text": "def extension\n case new_resource.format\n when \"yaml\"\n \"obj\"\n when \"ruby\"\n \"rb\"\n end\nend",
"title": ""
},
{
"docid": "16db60ec8c11c491a4f86d397763743a",
"score": "0.58157146",
"text": "def resource_template\n @resource_template ||= Array.wrap(super).map(&:deep_symbolize_keys)\n end",
"title": ""
},
{
"docid": "f3c3762483ac58aa7b52fc24bc3ca393",
"score": "0.58144516",
"text": "def addResource (params)\r\n\t#Resource(id: integer, type: string, sourceURL: string, filepath: string, mimetype: string, tags: string, description: string, date: datetime, title: string)\r\n\t\tr = Resource.new do |r|\r\n\t\t r.kind = params[:type] unless params[:type].nil?\r\n\t\t r.mimetype = params[:mime] unless params[:mime].nil?\r\n\t\t r.sourceURL = params[:url] unless params[:url].nil?\r\n\t\t #if RUBY_PLATFORM.match(/win/) and !params[:path].nil?\r\n\t\t #\tic = Iconv.new('UTF-8','WINDOWS-1251')\r\n\t\t #\tr.filepath = ic.iconv(params[:path])\r\n\t\t #end\r\n\t\t r.filepath = params[:path] unless params[:path].nil?\r\n\t\t \r\n\t\t r.title = params[:title] unless params[:title].nil?\r\n\t\t r.tags = params[:tags] unless params[:tags].nil?\r\n\t\t r.date = DateTime::now()\r\n\t\tend\r\n\t\tr.save\r\n\t\treturn r.id\r\n\tend",
"title": ""
},
{
"docid": "aa6688a9437c3659eae4fa0821489dd7",
"score": "0.58132243",
"text": "def resources_for(caller)\n raise 'Not Implemented'\n end",
"title": ""
},
{
"docid": "57a40b5b4895e9bd6da27b7c8ad04c05",
"score": "0.58124596",
"text": "def resource_type\n\t\t\t\t\t\traise \"Not implemented.\"\n\t\t\t\t\tend",
"title": ""
},
{
"docid": "fee81cad419341e57bf166f9db555de0",
"score": "0.58123857",
"text": "def register_resource(resource)\n base = resource.new\n\n base.urls.each do |url_name, url|\n base.methods.each do |http_method, resource_method|\n # This would include all HTTP methods. I just have \n # `GET` for simplicity\n case http_method\n when :get\n get url do\n # Just supporting json for this example. Content negotiation\n # would need to be done somewhere in this library\n content_type 'application/json'\n return base.url(url_name, resource_method, request, params)\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "494fd88f403b6abdc1159b0f1eec987f",
"score": "0.58121514",
"text": "def resource\n @resource ||= MethodResource.new\n end",
"title": ""
},
{
"docid": "b3a2e3c038c88c14da87e4c3b3f35382",
"score": "0.5810445",
"text": "def print_resource(resource)\n \"#{resource.to_s.split(\"#\").last}\"\n end",
"title": ""
},
{
"docid": "444e864e28275fab39b24dae6d32a263",
"score": "0.58034986",
"text": "def resource_class\n unless @options[:resource_class]\n require 'dav4rack/resources/file_resource'\n @options[:resource_class] = FileResource\n @options[:root] ||= Dir.pwd\n end\n\n @options[:resource_class]\n end",
"title": ""
},
{
"docid": "7b24c1f72ab453827978d53843e8860f",
"score": "0.5801937",
"text": "def post_resource(kind, template)\n tmpl_str = File.read(template)\n post_resource_str(kind, tmpl_str)\n end",
"title": ""
},
{
"docid": "c9ada6480b1c5f9ab1243b58e33ee402",
"score": "0.57966214",
"text": "def resource\n I18n.t(\n underscored_resource_name,\n scope: [:resources],\n locale: :api,\n default: @record.class.to_s.titlecase\n )\n end",
"title": ""
},
{
"docid": "6bb5a99361028eece46546a52f043043",
"score": "0.57942045",
"text": "def generate_resource(data)\n target_folder = File.join(data[:output_folder], package)\n FileUtils.mkpath target_folder\n name = Google::StringUtils.underscore(data[:object].name)\n version = Google::StringUtils.underscore(data[:object].version)\n version = \"_\" + version unless version.empty?\n product_name = Google::StringUtils.underscore(data[:product_name])\n filepath = File.join(target_folder, \"resource_#{package}_#{product_name}_#{name}#{version}.go\")\n generate_resource_file data.clone.merge(\n default_template: 'templates/terraform/resource.erb',\n out_file: filepath\n )\n # TODO: error check goimports\n %x(goimports -w #{filepath})\n %x(gofmt -w #{filepath})\n\n generate_documentation(data)\n end",
"title": ""
},
{
"docid": "299e8ebebef456215278f3ff4c10a769",
"score": "0.5792424",
"text": "def resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"title": ""
},
{
"docid": "299e8ebebef456215278f3ff4c10a769",
"score": "0.5792424",
"text": "def resource\n instance_variable_get(\"@#{resource_name}\")\n end",
"title": ""
},
{
"docid": "beafc989160a5a5c1cf3e78c34e75620",
"score": "0.57891864",
"text": "def resource(*args)\n args << {}\n Merb::Router.resource(*args)\n end",
"title": ""
},
{
"docid": "32330f9c1d8afd04a4c6954c5329d11f",
"score": "0.5778964",
"text": "def resource_root\n \"/#{self.class.name.demodulize.tableize}\"\n end",
"title": ""
},
{
"docid": "9c63dd9f2a0e1927e17acd9735ea9e2f",
"score": "0.57780707",
"text": "def resourcetype\n raise NotImplementedError\n end",
"title": ""
}
] |
86900ce5ea2fc1a3bb3fb6047bb426f6
|
returns module refs array or raises error
|
[
{
"docid": "0940148d98ea70e4e63eee1c9b3ecfa3",
"score": "0.6733965",
"text": "def get_children_module_refs\n @cache.lookup_dependencies?(@module_ref) || get_children_module_refs_aux\n end",
"title": ""
}
] |
[
{
"docid": "127c9b43ac1b9f10ade082dc21fa6419",
"score": "0.6800419",
"text": "def get_unref_symbols\n unref = []\n @modules.each do |mod|\n mod.symbols.values.each do |s|\n unless s.referenced?\n unref << s.name\n end\n end\n end\n unref\n end",
"title": ""
},
{
"docid": "a1212376029ce2f1b90b6aa3e9fe80e5",
"score": "0.644989",
"text": "def modules\n return @modules if @modules\n @modules = @context.modules.sort.find_all{|m| m.document_self}.collect{|m| R2Doc.all_references[m.full_name]}\n end",
"title": ""
},
{
"docid": "55d84f92fde6f97b353ad82b96de1d74",
"score": "0.63386905",
"text": "def modules\n @modules ||= Array.new\n @modules\nend",
"title": ""
},
{
"docid": "8aa7d912c2e9a2bbc6ecf406203e8d80",
"score": "0.633416",
"text": "def referenced_modules\n # TODO: check content type before scanning\n content.scan(/\\s*(include|extend)\\s+([A-Za-z0-9_\\.]*)/).map { |_, m| m }.uniq\n end",
"title": ""
},
{
"docid": "b142531b7c6c38d8bbe6422fd11cea5d",
"score": "0.6178436",
"text": "def refs\n @refs ||= load_refs\n end",
"title": ""
},
{
"docid": "ac6af3345c1ceff673b7d65e6573463f",
"score": "0.59873855",
"text": "def modules\n @modules.values\n end",
"title": ""
},
{
"docid": "ac6af3345c1ceff673b7d65e6573463f",
"score": "0.59873855",
"text": "def modules\n @modules.values\n end",
"title": ""
},
{
"docid": "4d1d41e5e072f82700d2ca3bba3be5b1",
"score": "0.5866575",
"text": "def module_info(module_name)\n #note: we may need to match something like \"romedia.Flash Player.plugin\" to\n #0x16cda000 - 0x172dfff3 +com.macromedia.Flash Player.plugin 10.0.12.36 (1.0.4f362) <776944fd51654ca2b59ab26a33d8f9b3> /Library/Internet Plug-Ins/Flash Player.plugin/Contents/MacOS/Flash Player\n # \"com.apple.QuickTime\" in the stack trace should match com.apple.QuickTime 7.6.3 (1584) \n #in the module list, but NOT com.apple.QuickTimeFireWireDV.component 7.6.3 (1584)\n if module_name == \"???\"\n return [nil, nil]\n elsif @log_string =~ /(0x[[:xdigit:]]+)\\s+-\\s+(0x[[:xdigit:]]+)\\s+[^\\n]+#{Regexp.escape(module_name)} [^\\/]+(\\/[^\\n]+)$/\n module_base = $1\n crashed_module_path = $3\n return module_base, crashed_module_path\n else\n raise \"Unable to get full path of #{module_name} from log #{@log_path}\"\n end \n \n \n end",
"title": ""
},
{
"docid": "4f25758d810b4989d285e382e8862d0e",
"score": "0.58517444",
"text": "def refs\n @refs\n end",
"title": ""
},
{
"docid": "c6643e558511cd33d77e09e765a30615",
"score": "0.58407605",
"text": "def info_fixups\n\t\t# Each reference should be an array consisting of two elements\n\t\trefs = module_info['References']\n\t\tif(refs and not refs.empty?)\n\t\t\trefs.each_index do |i|\n\t\t\t\tif !(refs[i].respond_to?('[]') and refs[i].length == 2)\n\t\t\t\t\trefs[i] = nil\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# Purge invalid references\n\t\t\trefs.delete(nil)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "bcdbeabf1317cf50515e7327ad6a78ec",
"score": "0.5822594",
"text": "def dependent_modules\n out = [ ]\n @dependencies.each { |dependency| out << @module_set[dependency] }\n out\n end",
"title": ""
},
{
"docid": "959fd2d859273bc23b3a25f32b312348",
"score": "0.57609254",
"text": "def locate_internal_refs\n #require 'debug'; binding.b\n refs = gather_internal_refs\n #@files.keys.reject { |k| @files[k][:attachment] }.each do |identifier|\n @files.keys.reject { |k| @files.get(k,:attachment) }.each do |identifier|\n #id = @c.decode(@isodoc.docid_prefix(\"\", identifier.dup))\n #locate_internal_refs1(refs, identifier, @files[id])\n id = @isodoc.docid_prefix(\"\", identifier.dup)\n locate_internal_refs1(refs, identifier, id)\n end\n refs.each do |schema, ids|\n ids.each do |id, key|\n key == true and refs[schema][id] = \"Missing:#{schema}:#{id}\"\n end\n end\n refs\n end",
"title": ""
},
{
"docid": "b44978fb90407afbd0420a3793d8a926",
"score": "0.57567495",
"text": "def modules; end",
"title": ""
},
{
"docid": "b44978fb90407afbd0420a3793d8a926",
"score": "0.57567495",
"text": "def modules; end",
"title": ""
},
{
"docid": "b44978fb90407afbd0420a3793d8a926",
"score": "0.57567495",
"text": "def modules; end",
"title": ""
},
{
"docid": "89a858be14574e159ab27dc9fb3f5532",
"score": "0.57522446",
"text": "def module_names\n @cache[:modules]\n end",
"title": ""
},
{
"docid": "2670d4c078a6f2bc8410035f493e2b38",
"score": "0.5729178",
"text": "def get_dependencies(module_name)\n module_data = @forge.get_module_data(module_name)\n metadata = module_data.current_release.metadata\n get_dependencies_from_metadata(metadata)\n end",
"title": ""
},
{
"docid": "70ac1491f29b93b252f3fb4118f16784",
"score": "0.56819564",
"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": "659536e46e8093c50f4c21719eeb8c79",
"score": "0.5662822",
"text": "def references\n @references ||= []\n end",
"title": ""
},
{
"docid": "4bc841f82369dbecb99cbffdd7f799f1",
"score": "0.55785936",
"text": "def defined_modules\n # TODO: check content type before scanning\n content.scan(/\\s*module\\s+([A-Za-z0-9_\\.]*)/).flatten\n end",
"title": ""
},
{
"docid": "fd7f1594a1f7d8b8c3586576a704165e",
"score": "0.5545391",
"text": "def references\n @references ||= ApiFactory.new 'GitData::References'\n end",
"title": ""
},
{
"docid": "96166bd6f7cf08ad9ca77593dcef244d",
"score": "0.55391234",
"text": "def dependencies\n @dependencies ||= []\n end",
"title": ""
},
{
"docid": "5318eea6ead45bb4fe3d9eadc2302028",
"score": "0.5525114",
"text": "def dependencies\n @dependencies ||= []\n end",
"title": ""
},
{
"docid": "5318eea6ead45bb4fe3d9eadc2302028",
"score": "0.5525114",
"text": "def dependencies\n @dependencies ||= []\n end",
"title": ""
},
{
"docid": "5318eea6ead45bb4fe3d9eadc2302028",
"score": "0.5525114",
"text": "def dependencies\n @dependencies ||= []\n end",
"title": ""
},
{
"docid": "5318eea6ead45bb4fe3d9eadc2302028",
"score": "0.5525114",
"text": "def dependencies\n @dependencies ||= []\n end",
"title": ""
},
{
"docid": "f0acdc65b3815e9148f6afae004a7ce6",
"score": "0.5520265",
"text": "def modules(&block)\r\n if block_given?\r\n Ragweed::Wrap32::list_modules(@pid, &block)\r\n else\r\n ret = []\r\n Ragweed::Wrap32::list_modules(@pid) {|x| ret << x}\r\n return ret\r\n end\r\n end",
"title": ""
},
{
"docid": "fb1613ebe24a877ae590fa14a3b6cd25",
"score": "0.55141044",
"text": "def bsd_modules(path)\n modules = Mash.new\n so = shell_out(\"#{Ohai.abs_path(path)}\")\n so.stdout.lines do |line|\n # 1 7 0xc0400000 97f830 kernel\n if line =~ /(\\d+)\\s+(\\d+)\\s+([0-9a-fx]+)\\s+([0-9a-fx]+)\\s+([a-zA-Z0-9\\_]+)/\n modules[$5] = { :size => $4, :refcount => $2 }\n end\n end\n modules\n end",
"title": ""
},
{
"docid": "5543dce434a59d93e4e7e12d8ceb1d98",
"score": "0.5513678",
"text": "def dependencies\n []\n end",
"title": ""
},
{
"docid": "f93b184e43f67a6ac4cab151aef1f42b",
"score": "0.54810476",
"text": "def dependencies\n []\n end",
"title": ""
},
{
"docid": "62608b3282afb63ea92d8dd286c41313",
"score": "0.54651934",
"text": "def inspect_modules\n modules = []\n\n if constant.respond_to?(:ancestors)\n parent = inspect_superclass\n\n # Take all the modules included *directly* into the constant.\n modules = constant.ancestors.take_while do |ancestor|\n parent && ancestor != parent\n end\n\n # Get rid of non Module instances and modules that don't have a name.\n modules = modules.select do |mod|\n mod.instance_of?(Module) && mod.name\n end\n end\n\n return modules\n end",
"title": ""
},
{
"docid": "1e4e8eab1cd48ec801ba06f66f6c35f0",
"score": "0.54495776",
"text": "def refs(repo)\n repo.refs_hash[id]\n end",
"title": ""
},
{
"docid": "6fa0e9a11f3754fd350397be095aa1f2",
"score": "0.5448084",
"text": "def references_for_repository(repository_name)\n @reference_mapping[repository_name] || []\n end",
"title": ""
},
{
"docid": "bdf49eb46ee9246660ea40751e1bea5e",
"score": "0.54467756",
"text": "def versions(module_name)\n path = \"/v3/modules/#{module_name.tr('/','-')}\"\n response = @conn.get(path)\n\n if response.status != 200\n raise R10K::Error.new(\"Request to Puppet Forge '#{path}' failed. Status: #{response.status}\")\n end\n\n releases = response.body['releases'].reject { |r| r['deleted_at'] }\n releases = releases.map do |version_info|\n version_info['version']\n end\n releases.reverse\n end",
"title": ""
},
{
"docid": "63400d9df23647d50893da7f762fdfb1",
"score": "0.54342103",
"text": "def moduleList()\n res = \"\"\n leader = \" \"\n begin\n Dir.foreach($opdir) do |name|\n next unless name =~ /(.*)\\.rb$/\n require File.join(\"ri/op\", $1)\n klass = eval $1\n modDesc = klass::desc\n res << leader << $1 << \": \" << modDesc << \"\\n\"\n end\n rescue\n puts $!\n res = leader + \"no modules found...\"\n end\n res\nend",
"title": ""
},
{
"docid": "8a936d737171edbf99d1cae97d942787",
"score": "0.5432806",
"text": "def modules_hash\n @modules\n end",
"title": ""
},
{
"docid": "8a936d737171edbf99d1cae97d942787",
"score": "0.5432806",
"text": "def modules_hash\n @modules\n end",
"title": ""
},
{
"docid": "674eb3b939e5230105cfb47d9dc9bcec",
"score": "0.54319894",
"text": "def modules\n @module_ids.collect { |idx| BModule.store[idx] }\n end",
"title": ""
},
{
"docid": "c96f1d1c89f7e0a71a65ae0795914e97",
"score": "0.54259056",
"text": "def dependencies\n @dependencies.values\n end",
"title": ""
},
{
"docid": "7c4882f6d57cc427056544edf24ce083",
"score": "0.5421773",
"text": "def module_sources(mod)\n graph.each_with_object([]) do |(m,next_modules),ret|\n ret << m if next_modules.include?(mod)\n end\n end",
"title": ""
},
{
"docid": "18ffb76e6592d7b134019cad0419140e",
"score": "0.5400861",
"text": "def bsd_modules(path)\n modules = Mash.new\n so = shell_out(Ohai.abs_path(path).to_s)\n so.stdout.lines do |line|\n # 1 7 0xc0400000 97f830 kernel\n if line =~ /(\\d+)\\s+(\\d+)\\s+([0-9a-fx]+)\\s+([0-9a-fx]+)\\s+([a-zA-Z0-9\\_]+)/\n modules[$5] = { size: $4, refcount: $2 }\n end\n end\n modules\n end",
"title": ""
},
{
"docid": "578e840ef12bf0993971d8c86f096f81",
"score": "0.5399897",
"text": "def modules\n @modules = @modules.call if @modules.is_a?(Proc)\n @modules\n end",
"title": ""
},
{
"docid": "d80bab643e1c6754950bcf0a2b687cf3",
"score": "0.53866315",
"text": "def manifest_dependencies()\n as_bundle = Bundle.fromProject(self)\n as_bundle.nil? ? [] : as_bundle.bundles.collect{|b| b.resolve}.compact + as_bundle.imports.collect {|i| i.resolve}.flatten\n end",
"title": ""
},
{
"docid": "361ef41739f1cf754d99b174b23c34d5",
"score": "0.5386411",
"text": "def references; end",
"title": ""
},
{
"docid": "361ef41739f1cf754d99b174b23c34d5",
"score": "0.5386411",
"text": "def references; end",
"title": ""
},
{
"docid": "c56e0ad0eb7617a5b6d388e0256e1b3b",
"score": "0.5383561",
"text": "def dependencies\n []\n end",
"title": ""
},
{
"docid": "2aa2d513e4233d102f6ad18cdd04b886",
"score": "0.53818417",
"text": "def list_modules(pid=0)\r\n h = CALLS[\"kernel32!CreateToolhelp32Snapshot:LL=L\"].call(0x8, pid)\r\n if h != -1\r\n mi = [260+256+(8*4),0,0,0,0,0,0,0,\"\\x00\"*256,\"\\x00\"*260].pack(\"LLLLLLLLa256a260\")\r\n if CALLS[\"kernel32!Module32First:LP=L\"].call(h, mi) != 0\r\n yield str2module_info(mi)\r\n while CALLS[\"kernel32!Module32Next:LP=L\"].call(h, mi) != 0\r\n yield str2module_info(mi)\r\n end\r\n end\r\n else\r\n raise WinX.new(:create_toolhelp32_snapshot)\r\n end\r\n end",
"title": ""
},
{
"docid": "a9856deb7ea4da6e69906bac5ec5acaa",
"score": "0.5374548",
"text": "def modules_paths\n puppet_environment.full_modulepath\n end",
"title": ""
},
{
"docid": "a6c379de324649f2bd7283ee8d4710f2",
"score": "0.5374509",
"text": "def submodules(options = {})\n ref = options[:ref]\n\n modules = []\n IniParse.parse(`git show #{ref}:.gitmodules 2> #{File::NULL}`).each do |section|\n # git < 1.8.5 does not update the .gitmodules file with submodule\n # changes, so when we are looking at the current state of the work tree,\n # we need to check if the submodule actually exists via another method,\n # since the .gitmodules file we parsed does not represent reality.\n if ref.nil? && GIT_VERSION < '1.8.5'\n result = Overcommit::Utils.execute(%W[\n git submodule status #{section['path']}\n ])\n next unless result.success?\n end\n\n modules << Submodule.new(section['path'], section['url'])\n end\n\n modules\n rescue IniParse::IniParseError => e\n raise Overcommit::Exceptions::GitSubmoduleError,\n \"Unable to read submodule information from #{ref}:.gitmodules file: #{e.message}\"\n end",
"title": ""
},
{
"docid": "c09e7f4438c7382d77ddca6ecdc19410",
"score": "0.5366841",
"text": "def modules_paths\n puppet_environment.full_modulepath\n end",
"title": ""
},
{
"docid": "51c3def0e96301c882730a4c8c7a015d",
"score": "0.53587174",
"text": "def list_modules\n pal.list_modules\n end",
"title": ""
},
{
"docid": "b1bce634780a9ebf9df3e4cb88f3ef75",
"score": "0.5357876",
"text": "def git_refs()\n # This glob pattern matches recursively so we will find a branch named\n # something like 'feature/subfeature/the-cool-feature'.\n # TODO: get remotes also\n git_dir = git_git_dir()\n\n locals = Dir.glob(File.join(git_dir, 'refs', 'heads', '**', '*')).select do |f|\n !File.directory? f\n end.map do |f|\n {\n 'name' => f.split('/refs/heads/')[1],\n 'hash' => File.open(f).read().rstrip\n }\n end\n\n remotes = Dir.glob(File.join(git_dir, 'refs', 'remotes', '**', '*')).select do |f|\n !File.directory?(f) and !f.end_with? \"/HEAD\"\n end.map do |f|\n {\n 'name' => f.split('/refs/remotes/')[1],\n 'hash' => File.open(f).read().rstrip\n }\n end\n\n locals + remotes\nend",
"title": ""
},
{
"docid": "3384aea6d3971d1419b40a0beb4a031c",
"score": "0.53517073",
"text": "def modules\n raise CapabilitiesExceeded\n end",
"title": ""
},
{
"docid": "df2488a761c0f58624eb029d24dd459a",
"score": "0.5351463",
"text": "def ref_names(repo)\n refs(repo).map do |ref|\n ref.sub(%r{^refs/(heads|remotes|tags)/}, \"\")\n end\n end",
"title": ""
},
{
"docid": "f205cdae99c3e965972fef4b50a04b75",
"score": "0.53399235",
"text": "def all_modules\n modules_hash.values\n end",
"title": ""
},
{
"docid": "82e7d4eb61ba6e6744cad8c508c8c216",
"score": "0.5330844",
"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": "e8cb30c86f136fbe1fb831055c24e871",
"score": "0.5327979",
"text": "def module_config\r\n []\r\n end",
"title": ""
},
{
"docid": "51d36d6cd88c1fa40579c8375d753359",
"score": "0.53261185",
"text": "def extension_dependencies\n latest_extension_version.try(:extension_dependencies) || []\n end",
"title": ""
},
{
"docid": "af64972e517a79f03652e69b5b9ef202",
"score": "0.5316832",
"text": "def required_gem_list\n Mack::Utils::GemManager.instance.required_gem_list\n end",
"title": ""
},
{
"docid": "25800caea2acf630cd990e40268dc6fe",
"score": "0.5315789",
"text": "def dependencies\n @dependencies ||= begin\n YARD::Registry.all(:dependency)\n end\nend",
"title": ""
},
{
"docid": "4d14b168da17a1a8d26b60477a79b0c2",
"score": "0.5297946",
"text": "def dependency_list\n @target.dependencies.map(&:display_name)\n end",
"title": ""
},
{
"docid": "185d8ac89db2a8a5a9eeca8d201ad315",
"score": "0.5287847",
"text": "def get_dependencies\n @dependencies\n end",
"title": ""
},
{
"docid": "9094ff4109b87a1b352e59a46a84f3d8",
"score": "0.5287192",
"text": "def all_modules_in_gem_named(gem)\n self.all_modules.select { |mod| mod.belongs_to?(gem) }\n end",
"title": ""
},
{
"docid": "13aca34d6f26431cc0cb98530572024f",
"score": "0.52814525",
"text": "def maintainers\n []\n end",
"title": ""
},
{
"docid": "2a93b785dcf13fbfe944750d37d77885",
"score": "0.5280351",
"text": "def get_refs(way)\n return [] if !way.tags.has_key?('ref')\n return way.tags['ref'].split(/(;|,)/).collect {|ref| ref.strip}\n end",
"title": ""
},
{
"docid": "daef0bd277f508253e39e5a2cd16fe43",
"score": "0.52779806",
"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": "68576a0e0ec1ec68698d1c061314fd1a",
"score": "0.5264162",
"text": "def resolve_array_refs(obj)\n items = obj[ITEMS_KEY]\n\n case items\n when Array\n return resolve_items_array(items)\n when Hash\n # handle a nested any of key\n any_of = items[ANY_OF_KEY]\n return resolve_items_array(any_of) if any_of.is_a?(Array)\n\n resolve_reference_string(items[REF_KEY])\n return [class_name_from_ref(items[REF_KEY])].compact\n else\n return []\n end\n end",
"title": ""
},
{
"docid": "e699e2647ef01dc6549c7f37ad3bcae3",
"score": "0.5258605",
"text": "def dependents_bug_ids\n fetch_bug_ids(dependents)\n end",
"title": ""
},
{
"docid": "1f4226196f280281e5691c279a620f9e",
"score": "0.5246822",
"text": "def unresolved_refs\r\n @unresolved_refs ||= collect_unresolved_refs\r\n if @removed_urefs\r\n @unresolved_refs -= @removed_urefs\r\n @removed_urefs = nil\r\n end\r\n @unresolved_refs\r\n end",
"title": ""
},
{
"docid": "d62c7885721403ef6032576e5e7968f4",
"score": "0.5242002",
"text": "def references\n alias_of.references\n end",
"title": ""
},
{
"docid": "644e79cc79f93538695b2eee96191d3e",
"score": "0.52380216",
"text": "def get_last_versions\n @last_release_mods = {}\n helper = PuppetfileHelper.new(@options[:last_release_puppetfile], @options[:root_dir], false)\n helper.modules.each do |mod|\n @last_release_mods[mod[:name]] = mod[:desired_ref]\n end\n end",
"title": ""
},
{
"docid": "644e79cc79f93538695b2eee96191d3e",
"score": "0.52380216",
"text": "def get_last_versions\n @last_release_mods = {}\n helper = PuppetfileHelper.new(@options[:last_release_puppetfile], @options[:root_dir], false)\n helper.modules.each do |mod|\n @last_release_mods[mod[:name]] = mod[:desired_ref]\n end\n end",
"title": ""
},
{
"docid": "f4d9adb8e9a48bbd372401d9b1b4cd33",
"score": "0.52296466",
"text": "def get_repo_list\n Chef::Log.debug(\n \"Fetching all versions of #{new_resource.module_name} \" +\n \"from #{new_resource.repository}.\",\n )\n latest = powershell_out!(\n <<-EOH,\n $splat = @{\n Name = \"#{new_resource.module_name}\"\n Repository = \"#{new_resource.repository}\"\n AllVersions = $True\n }\n (Find-Module @splat).Version.ForEach({$_.ToString()})\n EOH\n ).stdout.to_s.chomp.split(\"\\r\\n\")\n Chef::Log.debug(\"Available versions: #{latest.join(', ')}\")\n\n return latest.map { |v| Gem::Version.new(v) }\n end",
"title": ""
},
{
"docid": "e95f3d2435f042aab3e3188441528ae4",
"score": "0.5227395",
"text": "def resolve\n if !refs.nil? and refs.select { |ref| File.file? ref }.any?\n paths = refs.select { |ref| File.file? ref }.map { |path| File.expand_path(path) }\n elsif refs and refs.kind_of? Array\n paths, gems = GemsResolver.new(refs).call\n else\n paths = Dir.glob(File.join(\".\", \"lib/**/*.rb\")).map { |path| File.expand_path(path) }\n end\n\n { paths: paths, gems: gems || [] }\n end",
"title": ""
},
{
"docid": "5c01c6c529e3bb874b7f223014fc5de3",
"score": "0.52234286",
"text": "def modules_hash\n @modules_hash\n end",
"title": ""
},
{
"docid": "23c5e85edf144e58797552367faaa170",
"score": "0.5214478",
"text": "def referenced_libraries\n # TODO: check content type before scanning\n content.scan(%r{\\s*needs\\s+[\\\"\\'](.+)/(.+)[\\\"\\']}).map { |a, b| a + '/' + b }.uniq\n end",
"title": ""
},
{
"docid": "cb85bb087a18b69e65812000a46adbf4",
"score": "0.52128315",
"text": "def [](module_name)\n out = nil\n @modules.each { |the_module| out = the_module if the_module.name == module_name }\n raise \"No such module '#{module_name}'\" if out.nil?\n out\n end",
"title": ""
},
{
"docid": "81f4a0cadecfcc4d3f6acbc18a86c67d",
"score": "0.5205511",
"text": "def check_gems\n @gems ||= {}\n @gems.keys.select { |g| Gem.source_index.find_name(g, @gems[g]).size == 0 }\n end",
"title": ""
},
{
"docid": "d7d3f3d63446c2ddc76afdc7fa82c570",
"score": "0.52038056",
"text": "def fetch_refs(repo_user,repo_name)\n uri = URI(API_BASE_URL+ \"/repos/#{repo_user}/#{repo_name}/git/refs\")\n body = response_body(uri)\n \n if body.instance_of? Array\n body\n elsif body.key?('message') && body['message'].downcase == \"not found\"\n raise \"Unable to fetch #{uri}\" \n else\n puts \"WARNING unexpected body = #{body}\"\n [] \n end\n end",
"title": ""
},
{
"docid": "e79470f6a69ef9b4c82f6ddf34e0a400",
"score": "0.52028126",
"text": "def dependencies\n manager.dependencies\n end",
"title": ""
},
{
"docid": "6ec17f86214f3859a99e2778be4cb980",
"score": "0.5199005",
"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": "1fd178b3ead6c2bf4ae9300274346368",
"score": "0.5195479",
"text": "def test_get_ModuleList\n printf \"\\n@T:#{__method__}\\n\"\n @root = XMLParse.read(\"./tp/test001.xml\")\n golden = [\"D78F1070_EVA\",\n \"QLK0RCPUEVA0V3\",\n \"QLK0RCPUEVA0V3_ADR\",\n \"QLK0RCPUEVA0V3_ALU\",\n \"QLK0RCPUEVA0V3_EXE\",\n \"QLK0RCPUEVA0V3_EXE2\",\n \"QLK0RCPUEVA0V3_CLK\",\n \"QLK0RCPUEVA0V3_DEC\"]\n # Normalrror\n assert_equal(golden,XMLParse::get_ModuleList(@root))\n end",
"title": ""
},
{
"docid": "f407c1eea080db8d2b2cd504603c08c8",
"score": "0.51905936",
"text": "def gem_dependencies(rubygem)\n (latest = latest_gemspec(rubygem)) ?\n latest.dependencies.select {|e| e.type == :runtime }.map {|e| e.name} : []\n end",
"title": ""
},
{
"docid": "bef0ba7d36bdb8f319609b0214bf04f4",
"score": "0.5186854",
"text": "def get_dependencies(lib_path)\n\tdeps = []\n\tentry_name_regex = /(.*)\\(compatibility version.*\\)/\n\t`otool -L '#{lib_path}'`.strip.split(\"\\n\").each do |entry|\n\t\tmatch = entry_name_regex.match(entry)\n\t\tif (match)\n\t\t\tdep_path = match[1].strip\n\n\t\t\t# Note - otool lists dependencies separately for each architecture\n\t\t\t# in a universal binary - only return the unique paths\n\t\t\tdeps << dep_path if !deps.include?(dep_path)\n\t\tend\n\tend\n\treturn deps\nend",
"title": ""
},
{
"docid": "bef0ba7d36bdb8f319609b0214bf04f4",
"score": "0.5185541",
"text": "def get_dependencies(lib_path)\n\tdeps = []\n\tentry_name_regex = /(.*)\\(compatibility version.*\\)/\n\t`otool -L '#{lib_path}'`.strip.split(\"\\n\").each do |entry|\n\t\tmatch = entry_name_regex.match(entry)\n\t\tif (match)\n\t\t\tdep_path = match[1].strip\n\n\t\t\t# Note - otool lists dependencies separately for each architecture\n\t\t\t# in a universal binary - only return the unique paths\n\t\t\tdeps << dep_path if !deps.include?(dep_path)\n\t\tend\n\tend\n\treturn deps\nend",
"title": ""
},
{
"docid": "eff07e2ff68f97498ec1ac4b597854a0",
"score": "0.5183842",
"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": "0c7d22d865f03e05503beead3646e766",
"score": "0.51778203",
"text": "def resolve\n require 'puppetfile-resolver'\n\n # Build the document model from the modules.\n model = PuppetfileResolver::Puppetfile::Document.new('')\n\n @modules.each do |mod|\n model.add_module(\n PuppetfileResolver::Puppetfile::ForgeModule.new(mod.title).tap do |tap|\n tap.version = mod.version || :latest\n end\n )\n end\n\n # Make sure the Puppetfile model is valid.\n unless model.valid?\n raise Bolt::ValidationError,\n \"Unable to resolve dependencies for modules: #{@modules.map(&:title).join(', ')}\"\n end\n\n # Create the resolver using the Puppetfile model. nil disables Puppet\n # version restrictions.\n resolver = PuppetfileResolver::Resolver.new(model, nil)\n\n # Configure and resolve the dependency graph, catching any errors\n # raised by puppetfile-resolver and re-raising them as Bolt errors.\n begin\n result = resolver.resolve(\n cache: nil,\n ui: nil,\n module_paths: [],\n allow_missing_modules: true\n )\n rescue StandardError => e\n raise Bolt::Error.new(e.message, 'bolt/puppetfile-resolver-error')\n end\n\n # Validate that the modules exist.\n missing_graph = result.specifications.select do |_name, spec|\n spec.instance_of? PuppetfileResolver::Models::MissingModuleSpecification\n end\n\n if missing_graph.any?\n titles = model.modules.each_with_object({}) do |mod, acc|\n acc[mod.name] = mod.title\n end\n\n names = titles.values_at(*missing_graph.keys)\n plural = names.count == 1 ? '' : 's'\n\n raise Bolt::Error.new(\n \"Unknown module name#{plural} #{names.join(', ')}\",\n 'bolt/unknown-modules'\n )\n end\n\n # Filter the dependency graph to only include module specifications. This\n # will only remove the Puppet version specification, which is not needed.\n specs = result.specifications.select do |_name, spec|\n spec.instance_of? PuppetfileResolver::Models::ModuleSpecification\n end\n\n @modules = specs.map do |_name, spec|\n Bolt::Puppetfile::Module.new(spec.owner, spec.name, spec.version.to_s)\n end.to_set\n end",
"title": ""
},
{
"docid": "7138248003111cb2df132cbe840e4f71",
"score": "0.51692283",
"text": "def references(collection)\n target.manager_refs_by_association&.dig(collection, :ems_ref)&.to_a&.compact || []\n end",
"title": ""
},
{
"docid": "4311e1d5f6ba2f7e1d58fdd6cf9a1944",
"score": "0.5164148",
"text": "def references\n return @references\n end",
"title": ""
},
{
"docid": "45b7d797fbe96aae6a22f758224bf4d3",
"score": "0.5164105",
"text": "def modules(client_id)\n @modules[client_id.to_sym] || []\n end",
"title": ""
},
{
"docid": "bbe680729be684fd43450eadee591208",
"score": "0.5145004",
"text": "def get_installed_modules_for_host(host)\n on host, puppet(\"module list --render-as pson\")\n str = stdout.lines.to_a.last\n pat = /\\(([^()]+)\\)/\n mods = str.scan(pat).flatten\n return mods\n end",
"title": ""
},
{
"docid": "64d32b5cf9f57b374be73937731c1d9a",
"score": "0.51307386",
"text": "def dependencies\n @dependencies ||= {}\n end",
"title": ""
},
{
"docid": "8f8c7817f1b954e4a0bceae5707b9276",
"score": "0.5130161",
"text": "def failing_modules\n modules.reject {|m| %w(passed softfailed running none).include? m['result']}.map {|m| m['name'] }\n end",
"title": ""
},
{
"docid": "3212275a6d41f293532d983f51ac7819",
"score": "0.51300144",
"text": "def modules\n content_offset = self.content_offset\n catalog_header = self.words[content_offset+0]\n first_space_block = catalog_header.half_word[0].to_i\n return nil unless first_space_block == 1\n next_catalog_block = catalog_header.half_word[1].to_i\n sectors = self.sectors\n return nil unless next_catalog_block < sectors\n available_space_block_offset = WORDS_PER_SECTOR\n available_space_block_header = self.words[content_offset+available_space_block_offset]\n return nil unless available_space_block_header.half_word[0].to_i == 0\n next_available_spack_block = available_space_block_header.half_word[1].to_i\n return nil unless next_available_spack_block < sectors\n return nil unless compare_executable_checksum(0)\n return nil unless compare_executable_checksum(available_space_block_offset)\n mods = []\n (EXECUTABLE_MODULE_CATALOG_OFFSET...(WORDS_PER_SECTOR-EXECUTABLE_MODULE_CATALOG_SIZE)).step(EXECUTABLE_MODULE_CATALOG_SIZE) do |i|\n module_name = self.words[content_offset+i].bcd_string\n flag_word = self.words[content_offset+i+1]\n type, blocks, first_block = self.class.split_executable_module_flag(flag_word)\n end_block = first_block + blocks\n return nil if type > 3\n return nil if end_block > sectors\n mods << module_name if blocks > 0\n end\n mods\n end",
"title": ""
},
{
"docid": "1860d7422f572cb234b897b0ed23e668",
"score": "0.51294434",
"text": "def unique_modules\n @unique_modules\n end",
"title": ""
},
{
"docid": "ea15a1aee2e874d3a4ddaf3c29605532",
"score": "0.51292104",
"text": "def find_issues_by_gem(string = \"\")\n issues = []\n @security_checks.each do |check|\n if check.kind == Dawn::KnowledgeBase::DEPENDENCY_CHECK or check.kind == Dawn::KnowledgeBase::UNSAFE_DEPENDENCY_CHECK\n debug_me \"applying check #{check.name}\"\n name = string.split(':')[0]\n version = string.split(':')[1]\n check.please_ignore_dep_version = true if version.nil?\n check.dependencies = [{:name=>name, :version=>version}]\n issues << check if check.vuln?\n end\n end\n debug_me \"#{issues}\"\n return issues\n end",
"title": ""
},
{
"docid": "5ff2e9235477d9b45beeaaef37a40581",
"score": "0.51261467",
"text": "def extension_modules\n local_extensions =\n class <<self\n included_modules-Object.included_modules\n end\n if local_extensions.size > 0\n local_extensions\n else\n [] # There weren't any; must be a literal node\n end\n end",
"title": ""
},
{
"docid": "d34a65622fa37b720163daa2bade7e42",
"score": "0.512572",
"text": "def unused_dependencies_list\n imports = all_unique_imports.map { |import| import.split.last }\n dependency_list - imports\n end",
"title": ""
},
{
"docid": "e2befc048c8aab559bdb08fba7e4a9b3",
"score": "0.5123487",
"text": "def get_ModulePath(connect_path)\n module_path = Array.new\n connect_path.each do |inst|\n# @INST_LIST[@TOP_MODULE] = XMLParse::get_InstanceList(@root,@TOP_MODULE) if @INST_LIST[@TOP_MODULE].nil?\n# instance_list = @INST_LIST[top_module]\n instance_list = XMLParse::get_InstanceList(@root,@TOP_MODULE)\n instance_list.each do |each_inst|\n if each_inst[1] == inst\n module_path << each_inst[0]\n break\n end\n end \n end\n return module_path\n end",
"title": ""
},
{
"docid": "3f85d9566944eed02f1caf0938264ce4",
"score": "0.51231754",
"text": "def runtime_specific_gems\n []\n end",
"title": ""
}
] |
06a17dc537dccae91e915392f4bfe7a7
|
PATCH/PUT /billing_data/1 PATCH/PUT /billing_data/1.json
|
[
{
"docid": "3bcc259d4c30484661ade3d89b3a4750",
"score": "0.63485944",
"text": "def update\n respond_to do |format|\n if @billing_datum.update(billing_datum_params)\n format.html { redirect_to @billing_datum, notice: 'Billing datum was successfully updated.' }\n format.json { render :show, status: :ok, location: @billing_datum }\n else\n format.html { render :edit }\n format.json { render json: @billing_datum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "2cd83e0fbf66ca3a2da3c855f234c05f",
"score": "0.6824921",
"text": "def update\n respond_to do |format|\n if @billing.update(billing_params)\n format.html { redirect_to @billing, notice: 'Billing was successfully updated.' }\n format.json { render :show, status: :ok, location: @billing }\n else\n format.html { render :edit }\n format.json { render json: @billing.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3ada2088a56b51f4a6608ee7ba0f9104",
"score": "0.6695532",
"text": "def update\n respond_to do |format|\n if @order_billing.update(order_billing_params)\n format.html { redirect_to @order_billing, notice: 'Order billing was successfully updated.' }\n format.json { render :show, status: :ok, location: @order_billing }\n else\n format.html { render :edit }\n format.json { render json: @order_billing.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a70193b6995585beb38cd6391cebf75",
"score": "0.66855913",
"text": "def update\n respond_to do |format|\n if @billing.update(billing_params)\n format.html { redirect_to appointment_path(@appointment) + '#tabs-billing', notice: 'Billing was successfully updated.' }\n format.json { render :show, status: :ok, location: @billing }\n else\n format.html { render :edit }\n format.json { render json: @billing.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5803e5c2bbe7e5bab7170dee1008b14c",
"score": "0.6604243",
"text": "def update2\n respond_to do |format|\n if @billing.update(billing_params)\n format.html { redirect_to @billing, notice: 'Billing was successfully updated.' }\n format.json { render :show, status: :ok, location: @billing }\n else\n format.html { render :edit }\n format.json { render json: @billing.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "662983559be47b372a249015e89b29c8",
"score": "0.660202",
"text": "def update\n respond_to do |format|\n if @add_billing.update(add_billing_params)\n format.html { redirect_to @add_billing, notice: 'Add billing was successfully updated.' }\n format.json { render :show, status: :ok, location: @add_billing }\n else\n format.html { render :edit }\n format.json { render json: @add_billing.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "249ce8814cf7e14c1fea476eeb207fdb",
"score": "0.6582061",
"text": "def update\n respond_to do |format|\n if @billing_info.update(billing_info_params)\n format.html { redirect_to @billing_info, notice: 'Billing info was successfully updated.' }\n format.json { render :show, status: :ok, location: @billing_info }\n else\n format.html { render :edit }\n format.json { render json: @billing_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "864b6d643bcdbb28b15535680adb1226",
"score": "0.65127003",
"text": "def update\n respond_to do |format|\n if @billing_detail.update(billing_detail_params)\n format.html { redirect_to @billing_detail, notice: 'Billing detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @billing_detail }\n else\n format.html { render :edit }\n format.json { render json: @billing_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f48118b6e4ff08be980b30127783444",
"score": "0.6469178",
"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": "fe86aa3b4871977b78779c5489cfc5c2",
"score": "0.64594954",
"text": "def update\n @royaltybilling = Royaltybilling.find(params[:id])\n\n respond_to do |format|\n if @royaltybilling.update_attributes(params[:royaltybilling])\n format.html { redirect_to @royaltybilling, notice: 'Royaltybilling was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @royaltybilling.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76118e5354faa5d167399bd51e89a410",
"score": "0.6433191",
"text": "def update\n @client_billing = ClientBilling.find(params[:id])\n\n respond_to do |format|\n if @client_billing.update_attributes(params[:client_billing])\n format.html { redirect_to(@client_billing, :notice => 'Client billing was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @client_billing.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3f298b659edbf3fce209cc5af277ab88",
"score": "0.63355875",
"text": "def update\n respond_to do |format|\n if @billing_entry.update(billing_entry_params)\n format.html { redirect_to @billing_entry, notice: 'Billing entry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @billing_entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e9f5782f482fad9a1e91f58d15cd36c2",
"score": "0.6334383",
"text": "def update\n respond_to do |format|\n if @patient_billing_info.update(patient_billing_info_params)\n format.html { redirect_to @patient_billing_info, notice: 'Patient billing info was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient_billing_info }\n else\n format.html { render :edit }\n format.json { render json: @patient_billing_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5bbbba231812a13f01bc99c3e902d519",
"score": "0.63302624",
"text": "def update\n @opbilling = Opbilling.find(params[:id])\n\n respond_to do |format|\n if @opbilling.update_attributes(params[:opbilling])\n format.html { redirect_to(@opbilling, :notice => 'Opbilling was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @opbilling.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c284f0c7e832ddb238bb65b67673150d",
"score": "0.62846583",
"text": "def update\n @opbilling1 = Opbilling1.find(params[:id])\n\n respond_to do |format|\n if @opbilling1.update_attributes(params[:opbilling1])\n format.html { redirect_to(@opbilling1, :notice => 'Opbilling1 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @opbilling1.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36cd82e3d99e94d6ac4b0ec66e274209",
"score": "0.6246772",
"text": "def update\n @billing_entity = BillingEntity.find(params[:id])\n @invoices = Invoice.all\n respond_to do |format|\n if @billing_entity.update_attributes(params[:billing_entity])\n format.html { redirect_to(@billing_entity, :notice => 'Billing entity was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @billing_entity.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4de632695509268b2c87273a64c12335",
"score": "0.6211451",
"text": "def update\n respond_to do |format|\n if @billing_address.update(billing_address_params)\n format.html { redirect_to @billing_address, notice: 'Billing address was successfully updated.' }\n format.json { render :show, status: :ok, location: @billing_address }\n else\n format.html { render :edit }\n format.json { render json: @billing_address.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7df279bc3fc4f37fd6ee28ace93e9ff9",
"score": "0.6149656",
"text": "def update\n @billing = Billing.find(params[:id])\n\n respond_to do |format|\n if @billing.update_attributes(params[:billing])\n format.html { \n redirect_to @billing.inscription, \n notice: \"Facturation modifiée avec succ&eagrave;s.\".html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @billing.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1ee2cf100d3929bfbbf6d66b45abbaaa",
"score": "0.612422",
"text": "def update\n respond_to do |format|\n if @billing_account.update(billing_account_params)\n format.html { redirect_to @billing_account, notice: 'Billing account was successfully updated.' }\n format.json { render :show, status: :ok, location: @billing_account }\n else\n format.html { render :edit }\n format.json { render json: @billing_account.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "98f19c9c9ee8cfd4df5265cf1f16f616",
"score": "0.6118847",
"text": "def update\n respond_to do |format|\n if @billingaddress.update(billingaddress_params)\n format.html { redirect_to @billingaddress, notice: 'Billingaddress was successfully updated.' }\n format.json { render :show, status: :ok, location: @billingaddress }\n else\n format.html { render :edit }\n format.json { render json: @billingaddress.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "28fbd8e089e8dc397fff00099e4c93e1",
"score": "0.6093639",
"text": "def patch_resource(path, data)\n check_string(path)\n uri = return_uri(path)\n req = Net::HTTP::Patch.new(uri.path)\n if @customer_id == \"Bearer \"\n req.add_field(\"Authorization\", @customer_id+@customer_key)\n else\n req.basic_auth @customer_id, @customer_key\n end\n req.body = data\n res = Net::HTTP.start(uri.hostname, uri.port, :use_ssl => true) {|http|\n http.request(req)\n }\n parse_response(res)['data']\n end",
"title": ""
},
{
"docid": "706529f59ee50b2d43711faae95e1093",
"score": "0.60826325",
"text": "def update\n @cotton_billing = CottonBilling.find(params[:id])\n\n respond_to do |format|\n if @cotton_billing.update_attributes(params[:cotton_billing])\n flash[:notice] = 'CottonBilling was successfully updated.'\n format.html { redirect_to(@cotton_billing) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cotton_billing.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0875f2c6b4df492ca230413aecaa114d",
"score": "0.6024799",
"text": "def update\n @bill = Bill.find(params[:id])\n\n if @bill.update(bill_params)\n head :no_content\n else\n render json: @bill.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "05c1bed948daa058e70016e863c7cd96",
"score": "0.6022476",
"text": "def update_request(data)\n client.create_request('PATCH', url_path, 'data' => data)\n end",
"title": ""
},
{
"docid": "0203adfd3c94f1700625cd8ed9bf9b42",
"score": "0.6010268",
"text": "def update\n respond_to do |format|\n if @order_billing_address.update(order_billing_address_params)\n format.html { redirect_to @order_billing_address, notice: 'Order billing address was successfully updated.' }\n format.json { render :show, status: :ok, location: @order_billing_address }\n else\n format.html { render :edit }\n format.json { render json: @order_billing_address.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2c60a533470d8275139b2f9c3fe9d1a4",
"score": "0.60090256",
"text": "def update_customer(id, data)\n put(\"customers/#{id}\", { body: data })\n end",
"title": ""
},
{
"docid": "2c60a533470d8275139b2f9c3fe9d1a4",
"score": "0.60090256",
"text": "def update_customer(id, data)\n put(\"customers/#{id}\", { body: data })\n end",
"title": ""
},
{
"docid": "ce94b604f9fc205af98075921a23f52d",
"score": "0.59934485",
"text": "def update\n @jari_billing = JariBilling.find(params[:id])\n\n respond_to do |format|\n if @jari_billing.update_attributes(params[:jari_billing])\n flash[:notice] = 'JariBilling was successfully updated.'\n format.html { redirect_to(@jari_billing) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @jari_billing.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae4d0aa8335fe571a4fcc90ded621164",
"score": "0.5988229",
"text": "def do_update_Json(data, *rest)\n obj, res = REST.put(\"#{self.class.path}/#{id}\",data)\n maybe_json_die(obj,res)\n @blob = obj\n self\n end",
"title": ""
},
{
"docid": "ae4d0aa8335fe571a4fcc90ded621164",
"score": "0.5988229",
"text": "def do_update_Json(data, *rest)\n obj, res = REST.put(\"#{self.class.path}/#{id}\",data)\n maybe_json_die(obj,res)\n @blob = obj\n self\n end",
"title": ""
},
{
"docid": "831fb10494858c9121129722cb8b194d",
"score": "0.59773475",
"text": "def update!(**args)\n @billing_account_name = args[:billing_account_name] if args.key?(:billing_account_name)\n @billing_enabled = args[:billing_enabled] if args.key?(:billing_enabled)\n @name = args[:name] if args.key?(:name)\n @project_id = args[:project_id] if args.key?(:project_id)\n end",
"title": ""
},
{
"docid": "dbd95b5c7f91826ebb845bf1d4f875a7",
"score": "0.59496045",
"text": "def update_rebilling(rebill_id, options = {})\n\tpost = {}\n\trequires!(rebill_id)\n\trequires!(options, :rebill)\n\t$options[:view_rebilling] = '1'\n \tpost[:ACCOUNT_ID] = $options[:account_id]\t\n\tpost[:REBILL_ID] = rebill_id\n\tpost[:TRANS_TYPE] = 'SET'\n\tpost[:TAMPER_PROOF_SEAL] = calc_rebill_tps(post)\n post[:REB_AMOUNT] = options[:rebill][:rebill_amount]\n post[:NEXT_DATE] = options[:rebill][:rebill_next_date]\n post[:REB_EXPR] = options[:rebill][:rebill_expression]\n post[:REB_CYCLES] \t = options[:rebill][:rebill_cycles]\n\tpost[:NEXT_AMOUNT] = options[:rebill][:rebill_next_amount]\n post[:REBILL] = '1'\n\tcommit('nil', post)\t\n end",
"title": ""
},
{
"docid": "7d037903e899c32d496d4039b07a3333",
"score": "0.5931605",
"text": "def update_billing_info_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: InvoicesApi.update_billing_info ...\"\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 InvoicesApi.update_billing_info\"\n end\n # resource path\n local_var_path = \"/invoices/{id}/billing-address\".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/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'billing_info_request'])\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\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 if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: InvoicesApi#update_billing_info\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "db280714f42b83990a69be8fef41b8de",
"score": "0.59078836",
"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": "353bb56669cee4f26c0f4f84b7659746",
"score": "0.5903145",
"text": "def update\n respond_to do |format|\n if @billing_information.update(billing_information_params)\n format.html { redirect_to @billing_information, notice: 'La información fiscal se actualizó correctamente.' }\n format.json { render :show, status: :ok, location: @billing_information }\n else\n format.html { render :edit }\n format.json { render json: @billing_information.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1ce3f22623eb21a46ecf3e97222ab57a",
"score": "0.58975166",
"text": "def set_billing_info\n @billing_info = BillingInfo.find(params[:id])\n end",
"title": ""
},
{
"docid": "778e1d3391157e09e446e200f33a5fac",
"score": "0.58847183",
"text": "def update!(**args)\n @project_billing_info = args[:project_billing_info] if args.key?(:project_billing_info)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end",
"title": ""
},
{
"docid": "4b9b35c9afd5685c3cbb2133b1139093",
"score": "0.5871947",
"text": "def api_patch(endpoint:, data:)\n begin\n resp = self.http.patch([self.url, endpoint].join('/'), data.to_json, {'Content-Type' => 'application/json', 'Accept' => 'application/json'})\n begin\n data = JSON.parse(resp.body) unless resp.body.empty?\n rescue JSON::ParserError\n raise Exception, \"Failed to decode response message\"\n end\n if resp.status != 200\n error = data.include?('error') ? data['error'] : data.inspect if data\n raise Exception, \"Query returned a non successful HTTP code (Status: #{resp.status}, Reason: #{resp.reason}#{\", Error: #{error}\" if error}\"\n end\n rescue\n raise Exception, \"Failed to execute PATCH request to Kapacitor REST API (#{$!})\"\n end\n\n data\n end",
"title": ""
},
{
"docid": "8526bda945752e27df3ffdba1b7efea0",
"score": "0.58629185",
"text": "def update_mobile_carrier(args = {}) \n put(\"/mobile.json/#{args[:carrierId]}\", args)\nend",
"title": ""
},
{
"docid": "d92ce1038b9610fddd16a48700a4a38a",
"score": "0.5861729",
"text": "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @project_billing_info = args[:project_billing_info] if args.key?(:project_billing_info)\n end",
"title": ""
},
{
"docid": "eacb86b8fed6983b938cbbe11243d105",
"score": "0.5852443",
"text": "def update\n @bill = Bill.find(params[:id])\n \n respond_to do |format|\n if @bill.update_attributes(params[:bill])\n format.html { redirect_to @bill, :notice => 'Bill was successfully updated.' }\n #format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n #format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7938c0b7f888c8fe46ff2c739a6120bd",
"score": "0.58479047",
"text": "def update\n @monthly_billing = MonthlyBilling.find(params[:id])\n\n respond_to do |format|\n if @monthly_billing.update_attributes(params[:monthly_billing])\n flash[:notice] = 'MonthlyBilling was successfully updated.'\n format.html { redirect_to new_monthly_billing_path(:id => @monthly_billing.condition.id) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @monthly_billing.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1248a0159c0ccedfa349a0bce2e40a41",
"score": "0.5846194",
"text": "def update\n respond_to do |format|\n if @instance_bill.update(instance_bill_params)\n format.html { redirect_to @instance_bill, notice: 'Instance bill was successfully updated.' }\n format.json { render :show, status: :ok, location: @instance_bill }\n else\n format.html { render :edit }\n format.json { render json: @instance_bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab7ae82d44431d4780064de7285c1bfe",
"score": "0.5844857",
"text": "def update\n @cost_bill = CostBill.find(params[:id])\n @cost_bill.cost_type = CostType.find(params[:cost_type][:id])\n respond_to do |format|\n if @cost_bill.update_attributes(params[:cost_bill])\n format.html { redirect_to @cost_bill, notice: 'Cost bill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cost_bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "127e382060bc46f180b5ade97d0069c9",
"score": "0.5844463",
"text": "def update\n get_data\n @purchase_detail = @purchase.details.find(params[:id])\n @purchase_detail.update_attributes(params[:purchase_detail])\n get_data\n end",
"title": ""
},
{
"docid": "69a0ed1d66e2abb241e8b25d3328b908",
"score": "0.58187795",
"text": "def update\n @bill = Bill.find(params[:bill_id])\n @billed_adjustment = @bill.billed_adjustments.find(params[:id])\n\n respond_to do |format|\n if @billed_adjustment.update_attributes(params[:billed_adjustment])\n @bill.billed_taxes.each do |billed_tax|\n billed_tax.recalculate\n end\n #We have to save the flag here, other wise it woun't reflect when the landing page is loaded\n @bill.pending_flag = true\n @bill.save\n call_rake :regenerate_bill, :bill_id => params[:bill_id]\n flash[:notice] = 'Bill is being re-generated.'\n format.html { redirect_to(billing_session_bills_url(@bill.billing_session) + \"?page=\" + params[:page].to_s) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @billed_adjustment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4cc7082b97c973eeab7d1d8381397495",
"score": "0.5812393",
"text": "def update\n respond_to do |format|\n if @data_plan.update(data_plan_params)\n format.html { redirect_to @data_plan, notice: 'Data plan was successfully updated.' }\n format.json { render :show, status: :ok, location: @data_plan }\n else\n format.html { render :edit }\n format.json { render json: @data_plan.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e3fb45f5ac8c0cbfa7343a5127f2015c",
"score": "0.5811542",
"text": "def update\n @jute_billing = JuteBilling.find(params[:id])\n\n respond_to do |format|\n if @jute_billing.update_attributes(params[:jute_billing])\n flash[:notice] = 'JuteBilling was successfully updated.'\n format.html { redirect_to(@jute_billing) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @jute_billing.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "abf6ff198d0be9b0c4f3cfdbbac668df",
"score": "0.58046556",
"text": "def update\n @record = Invoice.find(params[:id]) \n @record.update_attributes(params[:invoice]) \n\n respond_to do |format| \n format.json {\n render json: {}\n }\n end\n end",
"title": ""
},
{
"docid": "a6fe8effb634ca0799fddeb27f27c257",
"score": "0.5793612",
"text": "def update\n if @plan.update(plan_params)\n render json: @plan\n else\n render json: @plan.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ad3f782b32e4c4875e84ad2803bea611",
"score": "0.57897127",
"text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @project_id = args[:project_id] if args.key?(:project_id)\n @billing_account_name = args[:billing_account_name] if args.key?(:billing_account_name)\n @billing_enabled = args[:billing_enabled] if args.key?(:billing_enabled)\n end",
"title": ""
},
{
"docid": "17cedc958aded4a8050191865c7643df",
"score": "0.5782218",
"text": "def update!(**args)\n @billing_info = args[:billing_info] if args.key?(:billing_info)\n @fixed_prices = args[:fixed_prices] if args.key?(:fixed_prices)\n @guaranteed_impressions = args[:guaranteed_impressions] if args.key?(:guaranteed_impressions)\n @guaranteed_looks = args[:guaranteed_looks] if args.key?(:guaranteed_looks)\n @minimum_daily_looks = args[:minimum_daily_looks] if args.key?(:minimum_daily_looks)\n end",
"title": ""
},
{
"docid": "c1a27da72123494de1405d42b0913464",
"score": "0.5771479",
"text": "def update\n @demand = Demand.find(params[:id])\n client = Client.find_by_name(params[:client])\n\n @demand.client_id = client.id\n @demand.state = params[:state]\n @demand.user_id = params[:demand][:user_id]\n \n @demand.save!\n respond_to do |format|\n if @demand.save\n format.html { render action: \"create_bill\", :object => @demand = @demand }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @demand.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9c469b24fa3cb1f1cd504dea7af86f2",
"score": "0.5770441",
"text": "def update\n\t\tbegin\n\t\t\tStripe.api_key = ENV['stripe_key']\n\t\t\tcustomer = Stripe::Customer.retrieve(@user.customer_id)\n\t\t\tsubscription=customer.subscriptions.data[0]\n\t\t\tsubscription.plan= params[:id]\n\t\t\tsubscription.save\n\t\t\tplan=SubscriptionPlan.find_by({plan_id: params[:id]})\n\t\t\t@user.subscription_plan_id=plan.id\n\t\t\t@user.save(validate: false)\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json{render json: customer}\n\t\t\tend\t\n\t\trescue Exception => e\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json{render json: {error: e}}\n\t\t\tend\t\n\t\tend\n\tend",
"title": ""
},
{
"docid": "af9aedd4f428a2c26c3fd57798526020",
"score": "0.57684845",
"text": "def put(path, data = {}, header = {})\n _send(json_request(Net::HTTP::Patch, path, data, header))\n end",
"title": ""
},
{
"docid": "06cff9d10f324b2750f6d05912dc3644",
"score": "0.5766057",
"text": "def update\n @bill = Bill.find(params[:bill_id])\n @billed_service = @bill.billed_services.find(params[:id])\n\n respond_to do |format|\n if @billed_service.update_attributes(params[:billed_service])\n @bill.billed_taxes.each do |billed_tax|\n billed_tax.recalculate\n end\n #We have to save the flag here, other wise it woun't reflect when the landing page is loaded\n @bill.pending_flag = true\n @bill.save\n call_rake :regenerate_bill, :bill_id => params[:bill_id]\n flash[:notice] = 'Bill is being re-generated.'\n format.html { redirect_to(billing_session_bills_url(@bill.billing_session) + \"?page=\" + params[:page].to_s) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @billed_service.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b8648622051376676daa9d07510af3f1",
"score": "0.5756059",
"text": "def update!(**args)\n @billing_method = args[:billing_method] if args.key?(:billing_method)\n @creation_time = args[:creation_time] if args.key?(:creation_time)\n @customer_domain = args[:customer_domain] if args.key?(:customer_domain)\n @customer_id = args[:customer_id] if args.key?(:customer_id)\n @deal_code = args[:deal_code] if args.key?(:deal_code)\n @kind = args[:kind] if args.key?(:kind)\n @plan = args[:plan] if args.key?(:plan)\n @purchase_order_id = args[:purchase_order_id] if args.key?(:purchase_order_id)\n @renewal_settings = args[:renewal_settings] if args.key?(:renewal_settings)\n @resource_ui_url = args[:resource_ui_url] if args.key?(:resource_ui_url)\n @seats = args[:seats] if args.key?(:seats)\n @sku_id = args[:sku_id] if args.key?(:sku_id)\n @status = args[:status] if args.key?(:status)\n @subscription_id = args[:subscription_id] if args.key?(:subscription_id)\n @suspension_reasons = args[:suspension_reasons] if args.key?(:suspension_reasons)\n @transfer_info = args[:transfer_info] if args.key?(:transfer_info)\n @trial_settings = args[:trial_settings] if args.key?(:trial_settings)\n end",
"title": ""
},
{
"docid": "827a6178dba0d76745d5f589e5938641",
"score": "0.5752477",
"text": "def update\n budget = Budget.find(params[:id])\n\n if budget.update_attributes(params.slice(:budget_name, :amount, :recur,\n :start_date, :recurrence_duration,\n :other_duration))\n render :json => budget\n else\n render :json => entry.errors, :status => :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "841d960fed8a53595c6499afc85701b7",
"score": "0.5752301",
"text": "def update!(**args)\n @billing_method = args[:billing_method] if args.key?(:billing_method)\n @creation_time = args[:creation_time] if args.key?(:creation_time)\n @customer_domain = args[:customer_domain] if args.key?(:customer_domain)\n @customer_id = args[:customer_id] if args.key?(:customer_id)\n @deal_code = args[:deal_code] if args.key?(:deal_code)\n @kind = args[:kind] if args.key?(:kind)\n @plan = args[:plan] if args.key?(:plan)\n @purchase_order_id = args[:purchase_order_id] if args.key?(:purchase_order_id)\n @renewal_settings = args[:renewal_settings] if args.key?(:renewal_settings)\n @resource_ui_url = args[:resource_ui_url] if args.key?(:resource_ui_url)\n @seats = args[:seats] if args.key?(:seats)\n @sku_id = args[:sku_id] if args.key?(:sku_id)\n @sku_name = args[:sku_name] if args.key?(:sku_name)\n @status = args[:status] if args.key?(:status)\n @subscription_id = args[:subscription_id] if args.key?(:subscription_id)\n @suspension_reasons = args[:suspension_reasons] if args.key?(:suspension_reasons)\n @transfer_info = args[:transfer_info] if args.key?(:transfer_info)\n @trial_settings = args[:trial_settings] if args.key?(:trial_settings)\n end",
"title": ""
},
{
"docid": "3c7df28c4e88fdc0d7a999cfcfbd1c0a",
"score": "0.57479596",
"text": "def quick_update_customer(options = {})\n requires! options, :customer_number\n requires! options, :update_data\n\n request = build_request(__method__, options)\n commit(__method__, request)\n end",
"title": ""
},
{
"docid": "f694f5758f333f34834035fdbce80d42",
"score": "0.5746436",
"text": "def update\n respond_to do |format|\n if @other_billing_in_agreement.update(other_billing_in_agreement_params)\n format.html { redirect_to @other_billing_in_agreement, notice: 'Other billing in agreement was successfully updated.' }\n format.json { render :show, status: :ok, location: @other_billing_in_agreement }\n else\n format.html { render :edit }\n format.json { render json: @other_billing_in_agreement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "75aaf604735d3684293d482122cbdfcb",
"score": "0.573855",
"text": "def update\n @bill = Bill.find(params[:id])\n\n respond_to do |format|\n if @bill.update_attributes(params[:bill])\n format.html { redirect_to @bill, :notice => 'Bill was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @bill.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d03c32a6835e07d69e790d89de77e00e",
"score": "0.5738327",
"text": "def update!(**args)\n @account_id = args[:account_id] if args.key?(:account_id)\n @billing_id = args[:billing_id] if args.key?(:billing_id)\n @budget_amount = args[:budget_amount] if args.key?(:budget_amount)\n @currency_code = args[:currency_code] if args.key?(:currency_code)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n end",
"title": ""
},
{
"docid": "d03c32a6835e07d69e790d89de77e00e",
"score": "0.5738327",
"text": "def update!(**args)\n @account_id = args[:account_id] if args.key?(:account_id)\n @billing_id = args[:billing_id] if args.key?(:billing_id)\n @budget_amount = args[:budget_amount] if args.key?(:budget_amount)\n @currency_code = args[:currency_code] if args.key?(:currency_code)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n end",
"title": ""
},
{
"docid": "665e83e3661985aa40eae3ef5c958934",
"score": "0.57298464",
"text": "def update\n respond_to do |format|\n if @admin_bill.update(admin_bill_params)\n format.html { redirect_to @admin_bill, notice: 'Bill was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_bill }\n else\n format.html { render :edit }\n format.json { render json: @admin_bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5600fa26d406c685900108eccf887495",
"score": "0.57211804",
"text": "def update!(**args)\n @billing_address = args[:billing_address] if args.key?(:billing_address)\n @expiration_month = args[:expiration_month] if args.key?(:expiration_month)\n @expiration_year = args[:expiration_year] if args.key?(:expiration_year)\n @last_four_digits = args[:last_four_digits] if args.key?(:last_four_digits)\n @phone_number = args[:phone_number] if args.key?(:phone_number)\n @type = args[:type] if args.key?(:type)\n end",
"title": ""
},
{
"docid": "368b8150b93c81e0480f48767374b148",
"score": "0.5718524",
"text": "def update\n @billed_order = @order.billed_order\n\n respond_to do |format|\n if @billed_order.update_attributes(params[:billed_order])\n format.html { redirect_to(@order, :notice => 'Billing details successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @billed_order.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa4e45cb6554c93524771d4f741cc739",
"score": "0.5712949",
"text": "def update!(**args)\n @billing_accounts = args[:billing_accounts] if args.key?(:billing_accounts)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end",
"title": ""
},
{
"docid": "aa4e45cb6554c93524771d4f741cc739",
"score": "0.5712949",
"text": "def update!(**args)\n @billing_accounts = args[:billing_accounts] if args.key?(:billing_accounts)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end",
"title": ""
},
{
"docid": "6650fa3aaaa6f1326b058fc1b69f28a1",
"score": "0.5709815",
"text": "def update(billing_key, credit_card = nil, address = nil)\n raise MethodNotImplemented\n end",
"title": ""
},
{
"docid": "6b69329405f16f1a65e62a063b8d46b7",
"score": "0.5706436",
"text": "def update\n @billing_session = BillingSession.find(params[:billing_session_id])\n @bill = @billing_session.bills.find(params[:id])\n\n respond_to do |format|\n if @bill.update_attributes(params[:bill])\n flash[:notice] = 'Bill was successfully updated.'\n format.html { redirect_to(billing_session_bills_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bill.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cf7857a9ce65e3603d2822e8d0378a14",
"score": "0.57061595",
"text": "def update\n\n customer_plan_params[:plan_type] = customer_plan_params[:allergy_type].to_i\n customer_plan_params[:prior_authorization_type] = customer_plan_params[:prior_authorization_type].to_i\n customer_plan_params[:relationship_code] = customer_plan_params[:relationship_code].to_i\n customer_plan_params[:accounting_method] = customer_plan_params[:accounting_method].to_i\n customer_plan_params[:payor_type] = customer_plan_params[:payor_type].to_i\n\n respond_to do |format|\n if @customer_plan.update(customer_plan_params)\n format.html { redirect_to @customer_plan, notice: 'Customer plan was successfully updated.' }\n format.json { render :show, status: :ok, location: @customer_plan }\n else\n format.html { render :edit }\n format.json { render json: @customer_plan.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ea753ab49a04b047d58e07d0513b585",
"score": "0.5704613",
"text": "def update\n @bill = Bill.find(params[:id])\n\n respond_to do |format|\n if @bill.update_attributes(params[:bill])\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ea753ab49a04b047d58e07d0513b585",
"score": "0.5704613",
"text": "def update\n @bill = Bill.find(params[:id])\n\n respond_to do |format|\n if @bill.update_attributes(params[:bill])\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ea753ab49a04b047d58e07d0513b585",
"score": "0.5704613",
"text": "def update\n @bill = Bill.find(params[:id])\n\n respond_to do |format|\n if @bill.update_attributes(params[:bill])\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ea753ab49a04b047d58e07d0513b585",
"score": "0.5704613",
"text": "def update\n @bill = Bill.find(params[:id])\n\n respond_to do |format|\n if @bill.update_attributes(params[:bill])\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ea753ab49a04b047d58e07d0513b585",
"score": "0.5704613",
"text": "def update\n @bill = Bill.find(params[:id])\n\n respond_to do |format|\n if @bill.update_attributes(params[:bill])\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ea753ab49a04b047d58e07d0513b585",
"score": "0.5704613",
"text": "def update\n @bill = Bill.find(params[:id])\n\n respond_to do |format|\n if @bill.update_attributes(params[:bill])\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "652baf656a5a6d570f0045bec825b032",
"score": "0.5702897",
"text": "def update(options = nil)\n request = Request.new(@client)\n path = \"/plans/\" + CGI.escape(@id) + \"\"\n data = {\n \"name\"=> @name, \n \"trial_period\"=> @trial_period, \n \"metadata\"=> @metadata, \n \"return_url\"=> @return_url, \n \"cancel_url\"=> @cancel_url\n }\n\n response = Response.new(request.put(path, data, options))\n return_values = Array.new\n \n body = response.body\n body = body[\"plan\"]\n \n \n return_values.push(self.fill_with_data(body))\n \n\n \n return_values[0]\n end",
"title": ""
},
{
"docid": "0d7f3c4425a5471d674b588d5282d1ea",
"score": "0.5701197",
"text": "def set_billing\n @billing = Billing.find(params[:id])\n end",
"title": ""
},
{
"docid": "0d7f3c4425a5471d674b588d5282d1ea",
"score": "0.5701197",
"text": "def set_billing\n @billing = Billing.find(params[:id])\n end",
"title": ""
},
{
"docid": "0d7f3c4425a5471d674b588d5282d1ea",
"score": "0.5701197",
"text": "def set_billing\n @billing = Billing.find(params[:id])\n end",
"title": ""
},
{
"docid": "2d5dc23a513bbc7e45aefe91ad790e49",
"score": "0.5698618",
"text": "def set_or_update_arrays_for_floorplan(args = {}) \n id = args['id']\n temp_path = \"/floorplans.json/{floorplanId}/arrays\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"floorplanId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "a3613fdb5e8aff530a7a22da9f3ba8da",
"score": "0.56971884",
"text": "def update\n @bill = Bill.find(params[:id])\n\n respond_to do |format|\n if @bill.update_attributes(params[:bill])\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bec6d924dd3f903b6fb23029a2dbba0a",
"score": "0.5690533",
"text": "def update\n respond_to do |format|\n if @bill_payment.update_attributes(params[:bill_payment])\n format.html { redirect_to bill_path(@bill), notice: 'Bill Payment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :edit }\n format.json { render json: @bill_payment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5fd5f00640bdb0c785bcac4689a46f3c",
"score": "0.5690033",
"text": "def patch(data, options={})\n raise NotImplementedError, \"We only patchs to singular resources.\" if count > 1\n first.patch(data, options)\n end",
"title": ""
},
{
"docid": "336ef0c8cdc524ae3b1ea55c33a2f53e",
"score": "0.56892484",
"text": "def update\n @silk_billing = SilkBilling.find(params[:id])\n\n respond_to do |format|\n if @silk_billing.update_attributes(params[:silk_billing])\n flash[:notice] = 'SilkBilling was successfully updated.'\n format.html { redirect_to(@silk_billing) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @silk_billing.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "00e20290c84c4d7a7a9ab9bcee120558",
"score": "0.5686661",
"text": "def update!(**args)\n @account_id = args[:account_id] unless args[:account_id].nil?\n @billing_id = args[:billing_id] unless args[:billing_id].nil?\n @budget_amount = args[:budget_amount] unless args[:budget_amount].nil?\n @currency_code = args[:currency_code] unless args[:currency_code].nil?\n @id = args[:id] unless args[:id].nil?\n @kind = args[:kind] unless args[:kind].nil?\n end",
"title": ""
},
{
"docid": "c0ab7c73bf58747dbd8164c4b45ddfe5",
"score": "0.5686337",
"text": "def update\n @bill_data = params.require(:bill).permit(:status)\n @student_id = params[:student_id]\n @bill_id = params[:id]\n\n @bill = Bill.find(@bill_id)\n\n if @bill.update(@bill_data)\n render json: {\n status: \"Success\", \n message: \"Updated status field for the bill's ID: #{params[:id]} from the student's ID: #{@student_id}.\", \n data: @bill.as_json(only: [:id, :valor_fatura, :data_vencimento, :status, :enrollment_id])\n }, status: :ok\n end\n\n end",
"title": ""
},
{
"docid": "00e2499af9f820f74986b5795f059747",
"score": "0.5685283",
"text": "def update\n get_data\n @adjustment_detail = @adjustment.details.find(params[:id])\n @adjustment_detail.update_attributes(params[:adjustment_detail])\n get_data\n end",
"title": ""
},
{
"docid": "7b436bce6ea67a90ffdc79beb87f8872",
"score": "0.5685039",
"text": "def update\n respond_to do |format|\n if @bill.update(bill_params)\n format.html { redirect_to @bill, notice: 'Bill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2e8a29c1724f23a1e57ea83e81c3e71a",
"score": "0.568354",
"text": "def update\n respond_to do |format|\n if @customer_bill_address.update(customer_bill_address_params)\n format.html { redirect_to edit_customer_registration_path, notice: t(:bill_address_suc_update) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @customer_bill_address.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bfffefb2433840a4115fb73071c37b9b",
"score": "0.56792617",
"text": "def update(model_name, model_id, data, options = {})\n url = get_brpm_url(model_name, model_id)\n options[\"data\"] = data\n result = Rest.put(url, options)\n result\n end",
"title": ""
},
{
"docid": "570fc786d23f3cd4be186e17af1a632b",
"score": "0.56773996",
"text": "def update\n respond_to do |format|\n if @service_bill.update(service_bill_params)\n format.html { redirect_to @service_bill, notice: 'Service bill was successfully updated.' }\n format.json { render :show, status: :ok, location: @service_bill }\n else\n format.html { render :edit }\n format.json { render json: @service_bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d6715b912902fe01f5eaefb0200ac2ac",
"score": "0.5676339",
"text": "def update\n respond_to do |format|\n if @tenant_bill.update(tenant_bill_params)\n format.html { redirect_to @tenant_bill, notice: 'Tenant bill was successfully updated.' }\n format.json { render :show, status: :ok, location: @tenant_bill }\n else\n format.html { render :edit }\n format.json { render json: @tenant_bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2656a38d0543104f2bd84d6b032fdf7c",
"score": "0.5664785",
"text": "def update\n @warp_billing = WarpBilling.find(params[:id])\n\n respond_to do |format|\n if @warp_billing.update_attributes(params[:warp_billing])\n flash[:notice] = 'WarpBilling was successfully updated.'\n format.html { redirect_to(@warp_billing) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @warp_billing.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c4dda1b1a011359ba7c32221f2e7c81",
"score": "0.56640977",
"text": "def update\n @bill_service = BillService.find(params[:id])\n\n respond_to do |format|\n if @bill_service.update_attributes(params[:bill_service])\n format.html { redirect_to @bill_service, notice: 'Bill service was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bill_service.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d0ab745bef1b2136ed796bde2d725d8d",
"score": "0.5661486",
"text": "def update\n @bill = Bill.find(params[:bill_id])\n @billed_line = @bill.billed_lines.find(params[:id])\n respond_to do |format|\n if @billed_line.update_attributes(params[:billed_line])\n @bill.billed_taxes.each do |billed_tax|\n billed_tax.recalculate\n end\n #We have to save the flag here, other wise it woun't reflect when the landing page is loaded\n @bill.pending_flag = true\n @bill.save\n call_rake :regenerate_bill, :bill_id => params[:bill_id]\n flash[:notice] = 'Bill is being re-generated.'\n format.html { redirect_to(billing_session_bills_url(@bill.billing_session) + \"?page=\" + params[:page].to_s) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @billed_line.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "22e1599bad84653cc4007fbdf8412f66",
"score": "0.56604433",
"text": "def set_billing_information\n @billing_information = BillingInformation.find(params[:id])\n end",
"title": ""
},
{
"docid": "28ab7aa0215858d505278b8d1c5a773f",
"score": "0.56512874",
"text": "def update!(**args)\n @billing_account_skus = args[:billing_account_skus] if args.key?(:billing_account_skus)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end",
"title": ""
},
{
"docid": "217556b90e82cd401746bd187c2e59df",
"score": "0.5650897",
"text": "def update\n authorize! :update, @bill\n respond_to do |format|\n if @bill.update_attributes(params[:bill])\n format.html { redirect_to @bill, notice: '货单更新成功.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bill.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
e2aad330fcbc52302edc86c67b3a36d3
|
Opens a json document in vortex. Example: with_json_doc(path) do |dav_item, json_data| puts json_data["resourcetype"] dav_item.content = dav_item.content.sub('Oxford','UiO') end
|
[
{
"docid": "0f9c4ede7b6696f34aa3ffcc48dadf08",
"score": "0.65732133",
"text": "def with_json_doc(url)\n vortex = Vortex::Connection.new(url,:use_osx_keychain => true)\n if(not(vortex.exists?(url)))then\n puts \"Warning: Can't find \" + url\n return -1\n end\n vortex.find(url) do |item|\n begin\n data = JSON.parse(item.content)\n yield item, data\n rescue\n return -1\n end\n end\nend",
"title": ""
}
] |
[
{
"docid": "5dd7bb8f15c542510bcd20c4e1c98705",
"score": "0.5610668",
"text": "def create_doc_from_json(id, fq_filename)\n json_doc = JSON.parse(File.read(fq_filename))\n json_doc[\"_id\"] = id\n json_doc[:content_hash] = generateCheckSum(json_doc.to_s)\n json_doc[:updated] = Time.now.to_date.iso8601\n json_doc[:version] = Settings[:CURRENT_VERSION]\n \n upsert_doc_via_checksum(@db, json_doc, [:version], @id_checksum_hash[id], @log)\n return json_doc\n end",
"title": ""
},
{
"docid": "50130f6a9dcfa527e28d5ef898ebae50",
"score": "0.54620874",
"text": "def load_json_doc( filename )\n\n begin\n File.open( filename, 'r') do |file|\n json_str = file.read( )\n doc = JSON.parse json_str\n return doc\n end\n\n rescue => ex\n puts \"ERROR: loading #{filename} (#{ex})\"\n return nil\n end\n\n end",
"title": ""
},
{
"docid": "2e86ed03fd518c9d7ac888f79c7bd5a5",
"score": "0.5389389",
"text": "def prepare_doc(req, json)\n var = requestor(req, json)\n parse var.body\n end",
"title": ""
},
{
"docid": "fe588336ed8e28aac6470b387ebc7dfe",
"score": "0.520905",
"text": "def save_design_doc(data)\n attrs = case data\n when String\n MultiJson.load(data)\n when IO\n MultiJson.load(data.read)\n when Hash\n data\n else\n raise ArgumentError, \"Document should be Hash, String or IO instance\"\n end\n rv = nil\n id = attrs.delete('_id').to_s\n attrs['language'] ||= 'javascript'\n if id !~ /\\A_design\\//\n rv = Result.new(:operation => :http_request,\n :key => id,\n :error => ArgumentError.new(\"'_id' key must be set and start with '_design/'.\"))\n yield rv if block_given?\n raise rv.error unless async?\n end\n req = make_http_request(id, :body => MultiJson.dump(attrs),\n :method => :put, :extended => true)\n req.on_body do |res|\n rv = res\n val = MultiJson.load(res.value)\n if block_given?\n if res.success? && val['error']\n res.error = Error::View.new(\"save_design_doc\", val['error'])\n end\n yield(res)\n end\n end\n req.continue\n unless async?\n rv.success? or raise res.error\n end\n end",
"title": ""
},
{
"docid": "0fcbdba8cff9da89f57adcb1e4e8ed19",
"score": "0.50618225",
"text": "def fjson(str)\n pjson(File.open(str))\nend",
"title": ""
},
{
"docid": "290488d4a55d472c71fdf490660d2a13",
"score": "0.5052667",
"text": "def openJsonFile(filepath)\n $file = File.open filepath\n $jsonObjectMain = JSON.load $file\n return $jsonObjectMain\nend",
"title": ""
},
{
"docid": "7419e33d0c44981d94fb7207df337395",
"score": "0.49940482",
"text": "def new_from_json_file(path)\n json = ::File.read(path)\n new_from_json_string(json)\n end",
"title": ""
},
{
"docid": "ed4e80851c6b0e0638de61fd79717635",
"score": "0.49861184",
"text": "def load_json(filename); end",
"title": ""
},
{
"docid": "e89382e14fdfeb9dcaa03e6048e15edd",
"score": "0.49488398",
"text": "def evolution_data\n## reads evolution json (1-120 digimons) and parses\nevo_file = File.read(\"#{__dir__}/../dh-data/json/tree-0002-0120.json\")\nevo_data = JSON.parse(evo_file)\nend",
"title": ""
},
{
"docid": "aff54dd18cff0077df3ac233e593d504",
"score": "0.49231738",
"text": "def json(*files, **options, &block) = read(*files, parse: :json, ext: '.json', **options, &block)",
"title": ""
},
{
"docid": "e516ad27c43a4a6d015200dd145020b4",
"score": "0.48675805",
"text": "def render_file_data(field: :file_data, **opt)\n data = object.try(field) || object.try(:[], field)\n render_json_data(data, **opt, field_root: field)\n end",
"title": ""
},
{
"docid": "98276f3616345161f49bec6ef4512804",
"score": "0.4858669",
"text": "def json_ld; end",
"title": ""
},
{
"docid": "4f3e6ccc36557beb4bbb42dc77c82ef2",
"score": "0.485199",
"text": "def show\n @response = search_service.fetch(params[:id]).first\n @document = @response.documents.first\n if @document.generic_file?\n @document = nil\n raise DRI::Exceptions::BadRequest, \"Invalid object type DRI::GenericFile\"\n end\n\n @children = @document.children(limit: 100).select { |child| child.published? }\n\n # assets ordered by label, excludes preservation only files\n @assets = @document.assets(ordered: true)\n @file_display_type_count = @document.file_display_type_count(published_only: true)\n @presenter = DRI::ObjectInCatalogPresenter.new(@document, view_context)\n supported_licences\n @reader_group = governing_reader_group(@document.collection_id) unless @document.collection?\n\n if @document.doi\n doi = DataciteDoi.where(object_id: @document.id).current\n @doi = doi.doi if doi.present? && doi.minted?\n end\n\n if @document.published?\n dimensions = { collection: @document.root_collection_id, object: @document.id }\n dimensions[:organisation] = @document.depositing_institute.name if @document.depositing_institute.present?\n @dimensions = dimensions\n @track_download = true\n end\n\n respond_to do |format|\n format.html { @search_context = setup_next_and_previous_documents }\n format.json do\n options = {}\n options[:with_assets] = true if can?(:read, @document)\n options[:with_metadata] = true\n formatter = DRI::Formatters::Json.new(self, @document, options)\n render json: formatter.format(func: :as_json)\n end\n format.ttl do\n options = {}\n options[:with_assets] = true if can?(:read, @document)\n options[:with_metadata] = true\n formatter = DRI::Formatters::Rdf.new(self, @document, options)\n render plain: formatter.format({format: :ttl})\n end\n format.rdf do\n options = {}\n options[:with_assets] = true if can?(:read, @document)\n options[:with_metadata] = true\n formatter = DRI::Formatters::Rdf.new(self, @document, options)\n render plain: formatter.format({format: :xml})\n end\n format.js { render layout: false }\n\n additional_export_formats(@document, format)\n end\n end",
"title": ""
},
{
"docid": "cca6312564e019580d51aa4e0e385202",
"score": "0.4827066",
"text": "def get_cr_json_object(cr_doi)\n crr = nil\n doi_file = '../json_files/' + cr_doi.gsub('/','_').downcase() + '.json'\n if !File.exists?(doi_file)\n crr = CrApiWrapper::CrRecord.find(cr_doi)\n File.open(doi_file,\"w\") do |f|\n f.write(JSON.pretty_generate(crr))\n end\n else\n File.open(doi_file,\"r\") do |f|\n crr = JSON.parse(f.read)\n end\n end\n # verify that the recoverd object matches the schema\n if verify_with_schema(doi_file)\n return crr\n else\n return nil\n end\nend",
"title": ""
},
{
"docid": "2d7ac6f11304242cbbda785f7ffe4151",
"score": "0.48113763",
"text": "def update_tv_document(vault_id, api_key, new_data)\n # Encode new_data as a base 64 encoded JSON string.\n tvDocEncode = Base64.encode64(new_data.to_json)\n\n # Update the document on TrueVault.\n tvResponse = `curl https://api.truevault.com/v1/vaults/#{vault_id}/documents/#{self.documentID} \\\n -u #{api_key}: \\\n -X PUT \\\n -d \"document=#{tvDocEncode}\"`\n\n # Parse and return a json hash of the TrueVault response\n tvResponseJSON = JSON.parse(tvResponse).with_indifferent_access\n end",
"title": ""
},
{
"docid": "bee7305f75d9038d36de337ae6ebb1a5",
"score": "0.48080677",
"text": "def show\n @response, @document = fetch params[:id]\n\n @children = @document.children(limit: 100).select { |child| child.published? }\n\n # assets ordered by label, excludes preservation only files\n @assets = @document.assets(ordered: true)\n\n @presenter = DRI::ObjectInCatalogPresenter.new(@document, view_context)\n\n supported_licences\n\n @reader_group = governing_reader_group(@document.collection_id) unless @document.collection?\n\n if @document.published?\n Gabba::Gabba.new(GA.tracker, request.host).event(@document.root_collection_id, \"View\", @document.id, 1, true)\n end\n\n respond_to do |format|\n format.html { setup_next_and_previous_documents }\n format.json do\n options = {}\n options[:with_assets] = true if can?(:read, @document)\n formatter = DRI::Formatters::Json.new(@document, options)\n render json: formatter.format(func: :as_json)\n end\n format.ttl do\n options = {}\n options[:with_assets] = true if can?(:read, @document)\n formatter = DRI::Formatters::Rdf.new(@document, options)\n render text: formatter.format({format: :ttl})\n end\n format.rdf do\n options = {}\n options[:with_assets] = true if can?(:read, @document)\n formatter = DRI::Formatters::Rdf.new(@document, options)\n render text: formatter.format({format: :xml})\n end\n format.js { render layout: false }\n\n additional_export_formats(@document, format)\n end\n end",
"title": ""
},
{
"docid": "e6266c4d8a5683fc8882d9056b2d4a03",
"score": "0.47912052",
"text": "def create_avalon_item(json_read_metadata)\n\n end",
"title": ""
},
{
"docid": "386d94a7740d183a8dab26f3cd3ab7e0",
"score": "0.4767727",
"text": "def create_tv_document(vault_id, api_key, schema = {})\n schemaToJsonString = schema.to_json\n schemaToBase64 = Base64.encode64(schemaToJsonString)\n tvResponse = `curl https://api.truevault.com/v1/vaults/#{vault_id}/documents \\\n -u #{api_key}: \\\n -X POST \\\n -d \"document=#{schemaToBase64}\"`\n\n # Parse and return a json hash of the TrueVault response\n tvResponseJSON = JSON.parse(tvResponse).with_indifferent_access\n end",
"title": ""
},
{
"docid": "118ff3f1558b73e14a1b0eeab0c704a8",
"score": "0.47644868",
"text": "def add_doc(id)\n doc = JSON.parse(File.read(File.expand_path(\"../fixtures/#{id}.json\", __FILE__)))\n solr.add(doc)\n solr.commit\n end",
"title": ""
},
{
"docid": "8e9021b1ac36fd24d30f98e3ed44833b",
"score": "0.47634503",
"text": "def document(path); end",
"title": ""
},
{
"docid": "c54523a3c59162365564ca8c3eae9414",
"score": "0.4749143",
"text": "def orchio_put(jdoc)\n response = client.send_request :put, inst_args(json: jdoc)\n if cache.enabled?\n simple_cache.save(\n Document.new(\n response.body.to_hash,\n Metadata.new(\n :collection => ocollection,\n :key => @id,\n :ref => response.header.etag\n )))\n end\n set_ref_value response\n orchio_status response, 201\n end",
"title": ""
},
{
"docid": "6bb60b24f0e5ce595beafefdf8337c2a",
"score": "0.47411016",
"text": "def create_html_document(directory, filename, locale, deliverable_json = nil)\n version = Settings[:CURRENT_VERSION]\n \n # Why not let CouchDB create the ID? Because it actually affects performance.\n # Also, if we define the ID, then we can find the document without a view.\n id = \"#{Settings[:APP_NAME]}.#{filename}.#{locale}.#{version}\"\n \n # Create a Nokogiri document from the XML file on disk\n content_doc = Nokogiri::XML(open(\"#{directory}/#{filename}\")){|config| config.noent }\n content_doc.remove_namespaces!\n \n # Figure out the title for the document, pick it up from the\n # Dublin Core metadata, if available, otherwise grab it from the\n # title element.\n title=content_doc.xpath(\"/html/head/meta[@name = 'DC.Title']/@content\")\n title ||= content_doc.xpath('/html/head/title').inner_text().to_s\n title = title.to_s rescue nil\n \n # Add facets.\n # The rescue nil is there because if something happens, we're okay\n # with no value.\n app_area = content_doc.xpath(\"/html/head/meta[@name = 'app_area']/@content\").to_s rescue nil \n role = content_doc.xpath(\"/html/head/meta[@name = 'role']/@content\").to_s rescue nil\n edition = content_doc.xpath(\"/html/head/meta[@name = 'edition']/@content\").to_s rescue nil\n topic_type = content_doc.xpath(\"/html/head/meta[@name = 'topic_type']/@content\").to_s rescue nil\n technology = content_doc.xpath(\"/html/head/meta[@name = 'SFDC.Technology']/@content\").to_s rescue nil\n\n # Add deliverable title and other metadata\n deliverable_title = deliverable_json['title'] rescue nil\n deliverable_type = deliverable_json['type'] rescue nil\n deliverable_pdf_name = content_doc.xpath(\"/html/head/meta[@name = 'SFDC.RelatedPDF']/@content\").to_s rescue nil\n deliverable_pdf_url = content_doc.xpath(\"/html/head/meta[@name = 'SFDC.RelatedPDFURL']/@content\").to_s rescue nil\n deliverable_home = deliverable_json['default_topic'] rescue nil\n \n #scrub the table of data we don't need\n body_content = content_doc.xpath('/html/body/*')\n scrub_table(body_content)\n body_content = body_content.to_html\n \n\n # Create a document to add the searchable text. We have to create a\n # new document, we can't reuse content_doc. That's because nodesets\n # are queries of documents. In other words, if you do a\n # nodeset.xpath('//xpath').remove, it removes that xpath from all\n # nodesets created from a document, not just nodeset.\n search_doc = content_doc.dup\n \n # Remove items we don't want returned in the search snippet\n search_content=search_doc.xpath('/html/body')\n search_content.xpath('/html/body//table[contains(@class, \"permTable\") or contains(@class, \"editionTable\")]').remove\n search_content.xpath('/html/body//*[contains(@class, \"breadcrumb\")]').remove\n search_content.xpath('/html/body/h1[1]').remove\n \n # Encode the search_content, replacing unsafe codepoints. This allows search to find items like >\n coder = HTMLEntities.new\n search_content=coder.encode(search_content.children().inner_text()).strip\n \n #remove weird new line characters\n search_content = search_content.gsub(\"\\n\", ' ')\n search_content = HTMLEntities.new.decode(search_content)\n \n #doc fields to create, if needed\n newDoc = {\n '_id' => id,\n :name => filename,\n :locale => locale,\n :version => version,\n :title => title,\n :body_content => body_content,\n :app_area => app_area,\n :role => role,\n :edition => edition,\n :topic_type => topic_type,\n :technology => technology,\n :deliverable_title => deliverable_title,\n :deliverable_type => deliverable_type,\n :deliverable_pdf_name => deliverable_pdf_name,\n :deliverable_pdf_url => deliverable_pdf_url,\n :deliverable_home => deliverable_home,\n :search_content => search_content}\n \n #This content hash accounts for changes necessary from the deliverable metadata as well as changes to the xml document in general\n newDoc[:content_hash] = generateCheckSum(newDoc.inspect)\n \n #Dynamic content added after the hash\n newDoc[:updated] = Time.now.to_date.iso8601\n \n #upsert the document\n upsert_doc_via_checksum(@db, newDoc, [:locale, :version], @id_checksum_hash[id], @log)\n \n return id\n end",
"title": ""
},
{
"docid": "704fab8ac1350e86441d55e4864061f0",
"score": "0.47333488",
"text": "def create_search_doc_cloudant(locales = [Settings[:DEFAULT_LOCALE]])\n json_doc = JSON.parse(File.read(Pathname.new(File.dirname(__FILE__) + \"/../../\" + \"couchdb_views/cloudant_search_view.json\").cleanpath))\n json_doc[\"indexes\"][\"by_content\"][\"analyzer\"][\"fields\"] = \"{#{locales2languages(locales)}}\"\n json_doc[\"indexes\"][\"by_content\"][\"index\"] = construct_design_doc(\"couchdb_views/cloudant_search_view.js\", locales)\n json_doc[:content_hash] = generateCheckSum(json_doc[\"indexes\"][\"by_content\"][\"index\"])\n json_doc[:updated] = Time.now.to_date.iso8601\n upsert_doc(@db, json_doc, json_doc, :content_hash, @log)\n end",
"title": ""
},
{
"docid": "c52f22439313a2fbc35b1c4ded84ad74",
"score": "0.47234762",
"text": "def fstoref(fname)\n if fexistf fname\n doc = eval \"$fname\"\n slots = \"#{fname},slots\"\n sarray = doc[slots].to_a\n doc[slots] = sarray\n doc[slots].each do |slot|\n sarray = doc[\"#{slot},facets\"].to_a\n doc[\"#{slot},facets\"] = sarray\n end\n fbuf = JSON.generate(doc)\n ffile = File.open(fname, \"w\")\n ffile.puts fbuf\n ffile.close\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "b6f4403ae3abeb1c7589dc83c97b6cad",
"score": "0.47169778",
"text": "def fs_index(force = true)\n path = File.join(Rails.root, 'public', self.solr_url.path)\n return true if !force && File.exists?(path)\n yield if block_given?\n File.write(path, JSON.generate(self.document_for_rsolr))\n end",
"title": ""
},
{
"docid": "c537d9ed61adc66b9887228266851636",
"score": "0.47053245",
"text": "def parse_json(item)\n itemhash = Hash.new\n \n # Parse out various fields\n itemhash[:title] = item[\"displayName\"][\"text\"]\n itemhash[:pub_date] = Date.parse(item[\"inDocumentSets\"][\"edges\"][0][\"node\"][\"publishedTime\"]).to_s\n itemhash[:released_date] = itemhash[:pub_date]\n itemhash[:document_date] = Date.parse(item[\"publishedTime\"]).to_s\n itemhash[:document_topic] = [\"SIDtoday\"]\n itemhash[:agency] = [\"NSA\"]\n itemhash[:article_links] = [\"https://theintercept.com/snowden-sidtoday/\"]\n itemhash[:description] = item[\"description\"][\"text\"]\n puts \"Processing #{itemhash[:title]}\"\n # Get ID and PDFs\n split_id = item[\"speakingId\"].split(\"-\")\n fixed_name = itemhash[:title].gsub(\"'\", \"\").gsub(\"?\", \"\").gsub(\":\", \"\").gsub(\"--\", \" \").gsub(\"(\", \"\").gsub(\")\", \"\").gsub(\"...\", \"\").gsub(\",\", \"\").gsub('\"', \"\").gsub(\"!\", \"\").gsub(\" - \", \" \").gsub(\"/\", \"\").gsub(\".\", \"\").gsub(\";\", \"\").gsub(\"&\", \"\").split(\" \").join(\"-\").gsub(\"-—-\", \"-\")\n pdf_path = (itemhash[:document_date]+\"-SIDToday-\"+fixed_name+\".pdf\").gsub(\"é\", \"\")\n itemhash[:pdf_paths] = [pdf_path]\n \n dc_url = item[\"documentSource\"][\"url\"]+\".txt\" \n itemhash[:doc_text] = get_text(dc_url, pdf_path)\n itemhash[:plain_text] = itemhash[:doc_text].gsub(/<\\/?[^>]*>/, \"\")\n \n return itemhash\n end",
"title": ""
},
{
"docid": "2b3f74d32b7eea28bc10cffe85ce0c72",
"score": "0.4699067",
"text": "def json_get\n @content_type = 'text/plain'\n @render_nothing = true\n @rendered_template = true\n @current_layout = nil\n write_json @note if @note\n render :nothing => true\n end",
"title": ""
},
{
"docid": "16ce5ecf7fc1951434e5ff102f76c526",
"score": "0.46882492",
"text": "def initialize(uri = nil, factory = nil, json: nil, ld: nil)\n uri = json ? json['uri'] : nil if uri.nil?\n super(uri, factory)\n if json\n has_part = json['hasPart']\n is_part_of = json['isPartOf']\n self.authors = get_property('authors', json, single: false)\n self.book_jacket_url = get_property('bookjacketURL', json)\n self.date = get_property('date', json)\n self.doi = get_property('doi', json)\n self.edition = get_property('edition', json)\n self.edition_data = get_property('editionData', json)\n self.eissn = get_property('eissn', json)\n self.has_part = has_part ? factory.get(uri, json: has_part) : nil\n self.is_part_of = is_part_of ? factory.get(uri, json: is_part_of) : nil\n self.isbn10 = get_property('isbn10', json)\n self.isbn13 = get_property('isbn13', json)\n self.isbns = get_property('isbns', json, single: false)\n self.issn = get_property('issn', json)\n self.issue = get_property('issue', json)\n self.issued = json ? json['issued'] : nil # TODO\n self.latest_edition = get_property('latestEdition', json)\n self.local_control_number = get_property('lcn', json)\n self.online_resource = get_property('onlineResource', json) ? true : false\n self.page = get_property('page', json)\n self.page_end = get_property('pageEnd', json)\n self.page_start = get_property('pageStart', json)\n self.place_of_publication = get_property('placeOfPublication', json)\n self.publisher = get_property('publisher', json)\n self.title = get_property('title', json)\n self.type = get_property('type', json)\n self.url = get_property('url', json, is_url: true)\n self.volume = get_property('volume', json)\n end\n end",
"title": ""
},
{
"docid": "4a845cd70257c28332ce81f34ba64b90",
"score": "0.46806762",
"text": "def construct_view()\n design_docs = [\"couchdb_views/content_views.json\"]\n design_docs.each { |design_doc|\n #Read the file\n content = File.read(Pathname.new(File.dirname(__FILE__) + \"/../../\" + design_doc).cleanpath)\n check_sum = generateCheckSum(content)\n \n #create the JSON\n design_doc_as_json = JSON.parse(content)\n design_doc_as_json[:content_hash] = check_sum\n \n #upload the JSON as a design document\n upsert_doc(@db, design_doc_as_json, design_doc_as_json, :content_hash, @log)\n }\n end",
"title": ""
},
{
"docid": "9fa9db75855912e118fde4d51ba5b4a3",
"score": "0.4672339",
"text": "def catalog_to_openurl_ctx_kev(document)\n return '' unless document\n # No, be forgiving.\n # fail 'Document has no format! ' + document.id unless document[:format]\n format = if document[:format]\n document[:format].first ||= 'book'\n else\n 'Other'\n end\n\n fields = []\n fields.push('ctx_ver=Z39.88-2004')\n\n if document[:author_display]\n document[:author_display] && document[:author_display].each do |author|\n fields.push(\"rft.au=#{CGI.escape(author)}\")\n end\n else\n # NEXT-1264 - Zotero shows \"unknown\" author for edited works\n # (contradicts NEXT-606, see discussion in ticket)\n # if Rails.env == 'clio_test'\n # fields.push(\"rft.au=\")\n # else\n # fields.push(\"rft.au=#{ CGI.escape('unknown') }\")\n # end\n # 10/2016 decision - go prod with this change\n fields.push('rft.au=')\n end\n\n document[:title_display] && Array.wrap(document[:title_display]).each do |title|\n fields.push(\"rft.title=#{CGI.escape(title)}\")\n end\n\n document[:pub_name_display] && document[:pub_name_display].each do |publisher|\n fields.push(\"rft.pub=#{CGI.escape(publisher)}\")\n end\n\n document[:pub_year_display] && Array.wrap(document[:pub_year_display]).each do |pub_year|\n fields.push(\"rft.date=#{CGI.escape(pub_year)}\")\n end\n\n document[:pub_place_display] && Array.wrap(document[:pub_place_display]).each do |pub_place|\n fields.push(\"rft.place=#{CGI.escape(pub_place)}\")\n end\n\n document[:isbn_display] && document[:isbn_display].each do |isbn|\n fields.push(\"rft.isbn=#{CGI.escape(isbn)}\")\n end\n\n document[:subject_topic_facet] && document[:subject_topic_facet].each do |subject|\n fields.push(\"rft.subject=#{CGI.escape(subject)}\")\n end\n\n document[:subject_form_facet] && document[:subject_form_facet].each do |subject|\n fields.push(\"rft.subject=#{CGI.escape(subject)}\")\n end\n\n document[:subject_geo_facet] && document[:subject_geo_facet].each do |subject|\n fields.push(\"rft.subject=#{CGI.escape(subject)}\")\n end\n\n document[:subject_era_facet] && document[:subject_era_facet].each do |subject|\n fields.push(\"rft.subject=#{CGI.escape(subject)}\")\n end\n\n if format =~ /journal/i\n fields.push('rft_val_fmt=info:ofi/fmt:kev:mtx:journal')\n document[:title_display] && Array.wrap(document[:title_display]).each do |title|\n fields.push(\"rft.atitle=#{CGI.escape(title)}\")\n end\n elsif format =~ /Recording/i\n fields.push('rft_val_fmt=info:ofi/fmt:kev:mtx:dc')\n fields.push('rft.type=audioRecording')\n elsif format =~ /Video/i\n fields.push('rft_val_fmt=info:ofi/fmt:kev:mtx:dc')\n fields.push('rft.type=videoRecording')\n else\n fields.push('rft_val_fmt=info:ofi/fmt:kev:mtx:dc')\n fields.push('rft.type=book')\n document[:title_display] && Array.wrap(document[:title_display]).each do |title|\n fields.push(\"rft.btitle=#{CGI.escape(title)}\")\n end\n end\n\n genre = format_to_rft_genre(format)\n fields.push(\"rft.genre=#{CGI.escape(genre)}\") if genre\n\n fields.join('&')\n end",
"title": ""
},
{
"docid": "07037e4c105722a7269d4e1ac88eb8b1",
"score": "0.4670979",
"text": "def parse_json\n attributes = JSON.parse(document)\n Omdb::Movie.new(attributes)\n end",
"title": ""
},
{
"docid": "19602d27a96d4df369e59f698e1b8111",
"score": "0.46548292",
"text": "def open_as_json(json_url)\n uri = URI.parse(json_url)\n response = Net::HTTP.get_response(uri)\n return {} unless response.code == \"200\"\n JSON.parse(response.body)\n end",
"title": ""
},
{
"docid": "6cf49d3f8c550ac164a79a5d6d11b4e7",
"score": "0.46525216",
"text": "def run\n super\n\n f = _get_entity_name\n\n # Read and split the file up\n begin\n json = JSON.parse (File.open(f,\"r\").read)\n rescue JSON::ParserError => e\n _log_error \"Unable to parse, failing...\"\n return\n end\n\n\n\n\n\n end",
"title": ""
},
{
"docid": "84c925644064f573e2721eb77b01bba4",
"score": "0.46461177",
"text": "def build_resource_and_document\n manifest = @resource.iiif_manifests.first # See /models/spotlight/resources/vault_iiif_manifest.rb\n manifest.with_exhibit(@resource.exhibit)\n manifest.with_resource(@resource)\n @resource.data = manifest.manifest_metadata.transform_values { |v| v.first } # We want to index the SolrDocument with a multiple value ({ k => ['v'] }\n end",
"title": ""
},
{
"docid": "572a4ff46803fa455ca2688a6bc5294b",
"score": "0.4644791",
"text": "def put_json_in_path(path, json_data)\n res = nil\n uri = URI(@url + path)\n req = Net::HTTP::Post.new(uri)\n req['X-Vault-Token'] = @token\n res = Net::HTTP.start(uri.hostname, uri.port) do |http|\n req.body = if json_data.class == Hash\n json_data.to_json\n else\n json_data\n end\n http.request(req)\n end\n res.code.to_i\n end",
"title": ""
},
{
"docid": "41aa8d7b75e6da9a24a2a5f0e38c0e85",
"score": "0.46355766",
"text": "def augment_new_json(json)\n json\n end",
"title": ""
},
{
"docid": "fe858870b146ba0670912d6eaf5167e0",
"score": "0.46144354",
"text": "def get_document_schema\n filePath = Rails.root.join(\"lib\", \"base_truevault_doc.json\")\n file = File.read(filePath)\n schema = JSON.parse(file).with_indifferent_access\n end",
"title": ""
},
{
"docid": "6671fae3369ffcf65228e4437ad2d539",
"score": "0.4613228",
"text": "def open\n html_url = url.sub('.json?', '?')\n Launchy.open(html_url)\n end",
"title": ""
},
{
"docid": "8b86e08c083f1ed8264b52497e82eb38",
"score": "0.46076572",
"text": "def update\n\tdata = unpack_document(params[:document][:datafile]) \n\tdoc_params = {:title => document_params[\"title\"], :date => get_date(document_params,\"date\")}\n\tif !data.nil? then\n\t\tdoc_params[:content] = data[:content]\n\t\tdoc_params[:styles] = data[:styles]\n\tend\n respond_to do |format|\n if @document.update(doc_params)\n format.html { redirect_to @document, notice: \"Document updated successfully\"}\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8241ae4db4d1539ce926d2abcec85135",
"score": "0.45973986",
"text": "def read_tv_document(vault_id, api_key)\n # Retrieves the TrueVault document for the current user and returns a base 64 encoded JSON string\n tvDocBase64 = `curl https://api.truevault.com/v1/vaults/#{vault_id}/documents/#{self.documentID} \\\n -X GET \\\n -u #{api_key}:`\n\n # Decode the encoded JSON string\n tvDocDecode = Base64.decode64(tvDocBase64)\n\n # Parse and return the decoded string as a JSON hash\n tvDocDecodeJson = JSON.parse(tvDocDecode).with_indifferent_access\n end",
"title": ""
},
{
"docid": "98d493129b57993bda339000ff9adacd",
"score": "0.45922652",
"text": "def payload_from_doc(req, doc, opts = {})\n if doc.is_a?(IO) || doc.is_a?(StringIO) || doc.is_a?(Tempfile) # attachments\n req[:header]['Content-Type'] = mime_for(req[:uri].path)\n doc\n elsif opts[:raw] || doc.nil?\n doc\n else\n MultiJson.encode(doc.respond_to?(:as_couch_json) ? doc.as_couch_json : doc)\n end\n end",
"title": ""
},
{
"docid": "bfd06f700f5f43a1b1ab0160d2920d02",
"score": "0.4581166",
"text": "def json_plain(path, params = {}, env = {}, &block)\n params = {:api_key => '5c87948ac1979401'}.merge params\n meth = params.delete(:method) || :get\n \n json = JSON.parse(send(meth, path + '.json', params, env).body)\n \n if block_given?\n yield json\n else\n json\n end\n end",
"title": ""
},
{
"docid": "cb07be446e0d5c41f830c516d1eec4de",
"score": "0.45729947",
"text": "def save_design_doc(data)\n attrs = case data\n when String\n MultiJson.load(data)\n when IO\n MultiJson.load(data.read)\n when Hash\n data\n else\n raise ArgumentError, \"Document should be Hash, String or IO instance\"\n end\n\n id = attrs.delete('_id').to_s.split('/')[1]\n\n design_doc = DesignDocument.new(id)\n\n attrs['views'].each_pair do |view, functions|\n view_design = if functions['reduce']\n ViewDesign.new(view.to_s.to_java_string, functions['map'].to_java_string, functions['reduce'].to_java_string)\n else\n ViewDesign.new(view.to_s.to_java_string, functions['map'].to_java_string)\n end\n design_doc.getViews.add(view_design)\n end\n\n client.createDesignDoc(design_doc)\n end",
"title": ""
},
{
"docid": "3f2e6ffcdd47cf8fc865ae50bfeef337",
"score": "0.45493522",
"text": "def show\n @document = Document.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render jbuilder: @document }\n end\n end",
"title": ""
},
{
"docid": "497acfc4932d654dd2dba3ad7fc94afe",
"score": "0.454922",
"text": "def json_request(verb, path, body = {}, headers = {})\n headers['Content-Type'] = 'application/json'\n result = @http.send_request(verb, path, body, headers)\n result = Oj.safe_load(result) if result.is_a? String\n result\n end",
"title": ""
},
{
"docid": "87cd37f864f4a38a3cf166b243e6a857",
"score": "0.45290673",
"text": "def write_json_file(json, filepath)\n File.open(filepath,\"w\") do |f|\n f.write(json.to_json)\n end\nend",
"title": ""
},
{
"docid": "981560e14087ffb58cc3f4de0f419557",
"score": "0.45141003",
"text": "def open(path)\n document = parse(File.read(path))\n document.path = path\n document\n end",
"title": ""
},
{
"docid": "ac8ae37580e6136da39e0c8337a58c20",
"score": "0.45122638",
"text": "def ac_to_openurl_ctx_kev(document)\n fields = []\n fields.push('ctx_ver=Z39.88-2004')\n # Many fields used to be arrays on katana, but on macana appear to be strings?\n # Defend ourselves by using Array.wrap() on everything.\n\n # by default, titles will be \"atitle\" - unless we override below\n title_key = 'rft.atitle'\n\n if document[:type_of_resource_mods] && Array.wrap(document[:type_of_resource_mods])[0].match(/recording/i)\n fields.push('rft_val_fmt=info:ofi/fmt:kev:mtx:dc&rft.type=audioRecording')\n title_key = 'rft.title'\n elsif document[:type_of_resource_mods] && Array.wrap(document[:type_of_resource_mods])[0].match(/moving image/i)\n fields.push('rft_val_fmt=info:ofi/fmt:kev:mtx:dc&rft.type=videoRecording')\n title_key = 'rft.title'\n else\n fields.push('rft_val_fmt=info:ofi/fmt:kev:mtx:journal')\n end\n\n document[:title_display] && Array.wrap(document[:title_display]).each do |title|\n fields.push(\"#{title_key}=#{CGI.escape(title)}\")\n end\n\n Array.wrap(document[:id]).each do |id|\n document_url = academic_commons_url(id)\n fields.push(\"rft_id=#{CGI.escape(document_url)}\")\n end\n\n document[:author_facet] && Array.wrap(document[:author_facet]).each do |author|\n fields.push(\"rft.au=#{CGI.escape(author)}\")\n end\n\n document[:publisher] && Array.wrap(document[:publisher]).each do |publisher|\n fields.push(\"rft.pub=#{CGI.escape(publisher)}\")\n end\n\n document[:pub_date_sort] && Array.wrap(document[:pub_date_sort]).each do |pub_date_sort|\n fields.push(\"rft.date=#{CGI.escape(pub_date_sort)}\")\n end\n\n fields.join('&')\n end",
"title": ""
},
{
"docid": "8fa9afac6857aa5ec9b7a4d75f5d7e80",
"score": "0.45093945",
"text": "def show\n render json: @finance_document\n end",
"title": ""
},
{
"docid": "f744f6bf72a98aa66462b3d6c15ed23d",
"score": "0.45087114",
"text": "def test_get_ctools_json_data_todolms\n file_name = \"ctools01\"\n file_name = IO.read(\"#{@@testFileDir}/todolms/ctools/#{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": "de52bc0d09cf3a5ac437f6f4c05e96dd",
"score": "0.45023602",
"text": "def documentation_search store, generator, req, res\n json_index = @cache[store].fetch :json_index do\n @cache[store][:json_index] =\n JSON.dump generator.json_index.build_index\n end\n\n res.content_type = 'application/javascript'\n res.body = \"var search_data = #{json_index}\"\n end",
"title": ""
},
{
"docid": "2b00c2d2f8c312672144aceeb2ac0b85",
"score": "0.44997364",
"text": "def data; @doc[key] end",
"title": ""
},
{
"docid": "a73ff37a29f4a4a4923eb71ebfff38d7",
"score": "0.44956604",
"text": "def request_doc\n \n end",
"title": ""
},
{
"docid": "e026ec866bf6af186ac304c3d115f487",
"score": "0.4493931",
"text": "def tjson(str)\n path = tmp_file(str)\n \n if File.exists?(path)\n fjson(path)\n else\n fjson(tmp_file(\"#{str}.json\"))\n end\nend",
"title": ""
},
{
"docid": "26e7e9cb44a19c1b0a81fa3ab82f91c8",
"score": "0.44917774",
"text": "def new\n @document = Document.new\n @document.document_type = 1\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end",
"title": ""
},
{
"docid": "a32cb0fefad820ff71dbe06610a7b031",
"score": "0.44784993",
"text": "def parse(document, options = {})\n hash = document.is_a?(Hash) ? document : JSON.parse(document)\n\n Document.new(hash, options)\n end",
"title": ""
},
{
"docid": "bf1c988d3217c47aca7ae1a280dba776",
"score": "0.44758582",
"text": "def parse json; return JSON.parse File.read json end",
"title": ""
},
{
"docid": "bf1c988d3217c47aca7ae1a280dba776",
"score": "0.44758582",
"text": "def parse json; return JSON.parse File.read json end",
"title": ""
},
{
"docid": "9093cd1194c18905b8870d3b38328a6d",
"score": "0.44697595",
"text": "def parse_json(infile, design, outfile_hier, outfile_conn)\n\ninfile = File.open(infile, 'r')\ntmpfile = File.open(File.dirname(__FILE__) + \"/tmp_resolved_design.json\", 'w')\n\nto_n = 0\ninfile.each_line { |line|\n if line =~ /\\\"to\\\"/\n tmpfile.write(line.gsub(\"\\\"to\\\"\", \"\\\"to_#{to_n}\\\"\"))\n to_n += 1\n else\n tmpfile.write(line)\n end\n}\ninfile.close\ntmpfile.close\n\nread_json = File.read(File.dirname(__FILE__) + \"/tmp_resolved_design.json\")\noutfile0 = File.open(outfile_hier, 'w')\noutfile = File.open(outfile_conn, 'w')\n\nmy_hash = JSON.parse(read_json)\noutfile0.write(\"load File.dirname(__FILE__) + \\\"/Define_SoCParameters.rb\\\"\\n\\n\")\noutfile0.write(\"require 'IPXACT2009API'\\n\\n\")\noutfile.write(\"load File.dirname(__FILE__) + \\\"/Define_SoCParameters.rb\\\"\\n\\n\")\noutfile.write(\"require 'IPXACT2009API'\\n\\n\")\noutfile.write(\"component = findComponent(:name => \\\"\" +design+\"\\\")\\n\\n\")\noutfile.write(\"loadBusDefinitions(:name => \\\"APB4\\\")\\n\\n\")\noutfile.write(\"loadBusDefinitions(:name => \\\"AHBLite\\\")\\n\\n\")\ntop_name = design\noutfile0.write(\"component = createComponent(:name => \\\"#{top_name}\\\")\\n\\n\")\n\nmodules_array = my_hash['modules']\nfor mod in modules_array\n param_binding = \"\"\n for key in mod.keys\n if key == \"module_name\"\n comp_name = mod['module_name']\n elsif key == \"generator\"\n gen_name = mod['generator']\n elsif key == \"instance_name\"\n inst_name = mod['instance_name']\n elsif key == \"parameters\"\n param_ash = mod['parameters']\n param_binding = \", :parameter_binding => {\"\n for param in param_ash.keys\n param_name = param\n param_value = param_ash[param]\n if param == param_ash.keys.first\n param_binding = param_binding + \"\\\"#{param_name}\\\" => \\\"#{param_value}\\\"\"\n if param_ash.keys.count > 1\n param_binding = param_binding + \", \"\n else\n param_binding = param_binding + \"}\"\n end\n elsif param == param_ash.keys.last\n param_binding = param_binding + \"\\\"#{param_name}\\\" => \\\"#{param_value}\\\"}\"\n else\n param_binding = param_binding + \"\\\"#{param_name}\\\" => \\\"#{param_value}\\\", \"\n end\n end\n end\n end\n if gen_name == \"adc-gen\"\n outfile0.write(\"if INCLUDE_ADCGEN == 1\\n \")\n elsif gen_name == \"cdc-gen\"\n outfile0.write(\"if INCLUDE_CDCGEN == 1\\n \")\n elsif gen_name == \"dcdc-gen\"\n outfile0.write(\"if INCLUDE_DCDCGEN == 1\\n \")\n elsif gen_name == \"ldo-gen\"\n outfile0.write(\"if INCLUDE_LDOGEN == 1\\n \")\n elsif gen_name == \"memory-gen\"\n outfile0.write(\"if INCLUDE_MEMGEN == 1\\n \")\n elsif gen_name == \"pll-gen\"\n outfile0.write(\"if INCLUDE_PLLGEN == 1\\n \")\n elsif gen_name == \"temp-sense-gen\"\n outfile0.write(\"if INCLUDE_TEMPGEN == 1\\n \")\n end\n outfile0.write(\"createComponentInstance(component, :instance_name => \\\"#{inst_name}\\\", :name => \\\"#{comp_name}\\\"#{param_binding})\\n\")\n if gen_name == \"adc-gen\" or gen_name == \"cdc-gen\" or gen_name == \"dcdc-gen\" or gen_name == \"ldo-gen\" \\\n or gen_name == \"memory-gen\" or gen_name == \"pll-gen\" or gen_name == \"temp-sense-gen\"\n outfile0.write(\"end\\n\\n\")\n else\n outfile0.write(\"\\n\")\n end\nend\nconn_array = my_hash['connections']\nfor conn in conn_array\n to_insts = Array.new\n to_ports = Array.new\n to_index = 0\n conn_type = \"\"\n from_inst = \"\"\n from_port = \"\"\n from_range_def = \"false\"\n to_range_def = Array.new\n from_range = \"\"\n from_msb = \"\"\n from_lsb = \"\"\n to_range = Array.new\n to_msb = Array.new\n to_lsb = Array.new\n value = \"\"\n for key in conn.keys\n if key == \"type\"\n type = conn['type']\n elsif key == \"from\"\n from_inst = conn['from']['instance']\n from_port = conn['from']['port']\n if conn['from']['range']\n from_range_def = \"true\"\n from_msb = conn['from']['range']['max']\n from_lsb = conn['from']['range']['min']\n end\n if conn['from']['value']\n value = conn['from']['value']\n end\n elsif key =~ /to_[0-9]+/\n for i in 0..(conn[key].length-1)\n to_insts[to_index] = conn[key][i]['instance']\n to_ports[to_index] = conn[key][i]['port']\n to_range_def[to_index] = \"false\"\n if conn[key][i]['range']\n to_range_def[to_index] = \"true\"\n to_msb[i] = conn[key][i]['range']['max']\n to_lsb[i] = conn[key][i]['range']['min']\n end\n to_index += 1\n end\n end\n end\n if type == \"ahb\"\n outfile.write(\"connect(component, :instance1 => \\\"#{from_inst}\\\", :interface1 => \\\"#{from_port}\\\",\\n\")\n outfile.write(\" :instance2 => \\\"#{to_insts[0]}\\\", :interface2 => \\\"#{to_ports[0]}\\\",\\n\")\n outfile.write(\" :exclude_logical_ports1 => \\\"HSELx,HREADYOUT,HCLK,HRESETn\\\",\\n\")\n outfile.write(\" :check_direct_connection => false)\\n\")\n elsif type == \"apb\"\n outfile.write(\"connect(component, :instance1 => \\\"#{from_inst}\\\", :interface1 => \\\"#{from_port}\\\",\\n\")\n outfile.write(\" :instance2 => \\\"#{to_insts[0]}\\\", :interface2 => \\\"#{to_ports[0]}\\\",\\n\")\n outfile.write(\" :exclude_logical_ports1 => \\\"PCLK|PRESETn\\\")\\n\")\n elsif type == \"tieoff\"\n for i in 0..(to_index-1)\n outfile.write(\"tieOff(component, :instance => \\\"#{to_insts[i]}\\\", :port => \\\"#{to_ports[i]}\\\",\\n\")\n outfile.write(\" :value => \\\"#{value}\\\")\\n\")\n end\n else\n for i in 0..(to_index-1)\n if from_range_def == \"true\"\n from_range = \"[#{from_msb}:#{from_lsb}]\"\n else\n from_range = \"\"\n end\n if to_range_def[i] == \"true\"\n to_range = \"[#{to_msb[i]}:#{to_lsb[i]}]\"\n else\n to_range = \"\"\n end\n if from_inst == \"toplevel\"\n outfile.write(\"export(component, :instance => \\\"#{to_insts[i]}\\\", :port => \\\"#{to_ports[i]}#{to_range}\\\",\\n\")\n outfile.write(\":exported_port_name => \\\"#{from_port}\\\")\\n\")\n elsif to_insts[i] == \"toplevel\"\n outfile.write(\"export(component, :instance => \\\"#{from_inst}\\\", :port => \\\"#{from_port}#{from_range}\\\",\\n\")\n outfile.write(\":exported_port_name => \\\"#{to_ports[i]}\\\")\\n\")\n else\n outfile.write(\"connect(component, :instance1 => \\\"#{from_inst}\\\", :port1 => \\\"#{from_port}#{from_range}\\\",\\n\")\n outfile.write(\" :instance2 => \\\"#{to_insts[i]}\\\", :port2 => \\\"#{to_ports[i]}#{to_range}\\\")\\n\")\n end\n end\n end\nend\n\noutfile0.write(\"\\nsaveDesignElement(component, :force_overwrite => true)\\n\")\noutfile.write(\"tieOff(component, :instance => \\\".*\\\", :port => \\\".*\\\", :direction => :in,\\n\")\noutfile.write(\" :value => \\\"0\\\")\\n\")\noutfile.write(\"tieOff(component, :instance => \\\".*\\\", :port => \\\".*\\\", :direction => :out,\\n\")\noutfile.write(\" :value => \\\"open\\\")\\n\")\noutfile.write(\"\\nsaveDesignElement(component, :force_overwrite => true)\\n\")\n\ntmpfilename = File.dirname(__FILE__) + \"/tmp_resolved_design.json\"\nsystem(\"rm '#{tmpfilename}'\")\noutfile0.close\noutfile.close\nend",
"title": ""
},
{
"docid": "234be3fa1f4fb7ce982f535881704a86",
"score": "0.44550812",
"text": "def documents_for(path, site_path = '')\n ethon = ethon_easy_json_requester\n ethon.url = \"#{computed_web_api_url(site_path)}GetFolderByServerRelativeUrl('#{uri_escape path}')/Files\"\n ethon.perform\n check_and_raise_failure(ethon)\n\n threads = []\n rv = []\n result = JSON.parse( ethon.response_body )\n result['d']['results'].each do |file|\n file_struct = OpenStruct.new(\n title: file['Title'],\n path: file['ServerRelativeUrl'],\n name: file['Name'],\n url: \"#{base_url}#{file['ServerRelativeUrl']}\",\n created_at: Time.parse(file['TimeCreated']),\n updated_at: Time.parse(file['TimeLastModified']),\n record_type: nil,\n date_of_issue: nil,\n )\n\n threads << Thread.new {\n ethon2 = ethon_easy_json_requester\n server_relative_url = \"#{site_path}#{path}/#{file['Name']}\"\n ethon2.url = \"#{computed_web_api_url(site_path)}GetFileByServerRelativeUrl('#{uri_escape server_relative_url}')/ListItemAllFields\"\n ethon2.perform\n rs = JSON.parse(ethon2.response_body)['d']\n file_struct.record_type = rs['Record_Type']\n file_struct.date_of_issue = rs['Date_of_issue']\n\n rv << file_struct\n }\n end\n threads.each { |t| t.join }\n rv\n end",
"title": ""
},
{
"docid": "16e58c93ad7939863a68c64425bd4239",
"score": "0.4452142",
"text": "def show\n @apprenticeship_type = ApprenticeshipType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @apprenticeship_type }\n format.xml { render xml: @apprenticeship_type }\n # format.docx { render word: @apprenticeship_type }\n # file = Rails.root.join(\"public\",\"resources\", \"test.docx\");\n format.docx { send_file @apprenticeship_type.render_to_word, :disposition => 'attachment' }\n # format.docx { send_data @apprenticeship_type.render_to_word(), :disposition => 'attachment' }\n\n # \"#{RAILS_ROOT}/public/resources/newdoc.docx\",\n # :filename=> \"newdoc.docx\",\n # :type=>mime_type)\n\n end\n end",
"title": ""
},
{
"docid": "260b2bd5a14541524a9473a094858454",
"score": "0.44488248",
"text": "def each_json_spec(&block)\n Data.each(json_spec_path, &block)\n end",
"title": ""
},
{
"docid": "370b4856ce1ce78f91e631d3f7dc4e2a",
"score": "0.44487292",
"text": "def getToolsDocs( object, format)\n params = Hash.new\n params['object'] = object\n params['format'] = format\n return doCurl(\"get\",\"/tools/docs\",params)\n end",
"title": ""
},
{
"docid": "3a584045086910571982326c83894752",
"score": "0.44449902",
"text": "def augment_current_json(json)\n json\n end",
"title": ""
},
{
"docid": "454d3b4b18b3a0ff7308f89f3ebf7a15",
"score": "0.44449702",
"text": "def write_json(a)\n write \"(\" + a.write_json_item + \")\\n\"\n @content_type = 'text/plain'\n @render_nothing = true\n @rendered_template = true\n @current_layout = nil\n end",
"title": ""
},
{
"docid": "4e0f12acffca760f58286f562d36ced1",
"score": "0.4444936",
"text": "def read_JSON_file # called a helper method (is helping you to use less code and dealing with something so that your other methods don't have to)\n @json_data = File.read('./lib/contacts.json')\n @contacts = JSON.parse(@json_data, {:symbolize_names => true})\n end",
"title": ""
},
{
"docid": "6d80285faa84cb5965f8d6f49260f620",
"score": "0.44395944",
"text": "def show\n\n \t\n @companydocument = Companydocument.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @companydocument }\n end\n\n end",
"title": ""
},
{
"docid": "15f1e17c86be2f9e55232c0764434c25",
"score": "0.44394177",
"text": "def initialize(uri, factory, parent = nil, json: nil, ld: nil)\n super(uri, factory, parent, json: json, ld: ld)\n section_ld = ld[uri]\n self.description = self.get_property('http://purl.org/vocab/resourcelist/schema#description', section_ld)\n self.name = self.get_property('http://rdfs.org/sioc/spec/name', section_ld)\n end",
"title": ""
},
{
"docid": "c952ac7252eb451794c167f232d6233c",
"score": "0.4434349",
"text": "def generate_document(data)\n template = config.get(:template)\n options = template[:options]\n file = \"#{template[:root]}/mongoid.slim\"\n # create template\n document = Slim::Template.new(\n # delegate file read to slim\n file,\n # declare default options\n options\n )\n .render(\n # ensure helpers are scoped\n self,\n # pass data via parameter\n data: data\n )\n # publish data to file\n publish_document(document)\n # return document\n document\n end",
"title": ""
},
{
"docid": "6047fec1ca33fe8e157964b40e15606b",
"score": "0.44325584",
"text": "def open\n object.open\n end",
"title": ""
},
{
"docid": "f8f1b418df9d2f4749aebf38d1425a1e",
"score": "0.4427665",
"text": "def read_json(avalon_item)\n begin\n uri = URI.parse avalon_item.atom_feed_read.json_url\n something = read_uri(uri)\n if something.kind_of? Net::HTTPSuccess\n json_text = something.body\n avalon_item.update_attributes(json: json_text)\n true\n else\n false\n end\n rescue\n false\n end\n end",
"title": ""
},
{
"docid": "cf648398d7b968fc5ca9cde3e80a739e",
"score": "0.44259807",
"text": "def get(resource_uri, format = \"text/turtle\")\n uri = build_uri_for_resource resource_uri \n log \"get #{uri}\"\n request = Net::HTTP::Get.new(uri)\n request[\"Accept\"] = format\n response = Net::HTTP.start(uri.hostname, uri.port) {|http|\n http.request(request)\n }\n doc = FedoraDoc.new(response)\n log \"resource body \\r\\n#{doc.body}\"\n doc\n end",
"title": ""
},
{
"docid": "4ebcc32a7730ed7bef0638bb7baa8a80",
"score": "0.44246072",
"text": "def load_query_response\n load_file('sample_query_response.json')\nend",
"title": ""
},
{
"docid": "324c36a8fa56196b9bfc8b318526c361",
"score": "0.44130954",
"text": "def get_json(name)\n r = {}\n open_file(name) do |f|\n r = JSON.parse(f.read)\n yield r if block_given?\n end\n r\n end",
"title": ""
},
{
"docid": "d283a8b979e61edc7763b5ea38f21c5a",
"score": "0.4411914",
"text": "def parse_doc_json(docs)\n jurisdiction_titles = JURISDICTION_MATCHERS.reduce({}){|acc, (url, hash)|\n acc[hash[:title]] = {url: url, id: hash[:id], title: hash[:title], type: hash[:type], abbreviation: hash[:abbreviation]}\n acc\n }\n find_id = lambda{ |title|\n jurisdiction = jurisdiction_titles[title]\n if jurisdiction == nil\n puts \"SKIPPING: Missing jurisdiction in jurisdiction_matches.rb: #{title}\"\n return nil\n end\n db_jurisdiction = $db[:jurisdictions].find({_id: jurisdiction[:id]}).to_a.first\n if db_jurisdiction.nil?\n $db[:jurisdictions].insert_one({\n _id: jurisdiction[:id],\n title: jurisdiction[:title],\n type: jurisdiction[:type],\n asnUrl: jurisdiction[:url],\n abbreviation: jurisdiction[:abbreviation]\n })\n else\n $db[:jurisdictions].find({_id: jurisdiction[:id]}).find_one_and_update({\"$set\" => {status: \"active\"}})\n end\n jurisdiction[:id]\n }\n docs[\"hits\"][\"hit\"].reject{|doc|\n jurisdiction = find_id.call(doc[\"data\"][\"jurisdiction\"][0])\n jurisdiction == nil\n }.map{|doc|\n if SOURCE_TO_SUBJECT_MAPPINGS_GROUPED[doc[\"data\"][\"jurisdiction\"][0]] == nil\n puts \"Add \" + doc[\"data\"][\"jurisdiction\"]\n end\n\n subject = SOURCE_TO_SUBJECT_MAPPINGS_GROUPED[doc[\"data\"][\"jurisdiction\"][0]][doc[\"id\"].upcase]\n {\n date_modified: doc[\"data\"][\"date_modified\"][0],\n date_valid: doc[\"data\"][\"date_valid\"][0],\n description: doc[\"data\"][\"description\"][0],\n id: doc[\"id\"].upcase,\n jurisdiction: doc[\"data\"][\"jurisdiction\"][0],\n jurisdiction_id: find_id.call(doc[\"data\"][\"jurisdiction\"][0]),\n subject: subject,\n title: doc[\"data\"][\"title\"][0],\n url: doc[\"data\"][\"identifier\"][0],\n }\n }\nend",
"title": ""
},
{
"docid": "edfce36fd4fcee27898c7e441c30217f",
"score": "0.4409084",
"text": "def as_framed_jsonld\n json_hash = as_jsonld related: true\n\n context = json_hash['@context']\n frame = { '@context' => context }\n frame['@type'] = type.first.pname unless type.empty?\n\n JSON::LD::API.compact(JSON::LD::API.frame(json_hash, frame), context)\n end",
"title": ""
},
{
"docid": "fbd44b718208bf3b22a844d80c283e0a",
"score": "0.44028485",
"text": "def parse(document, options = {})\n hash = document.is_a?(Hash) ? document : JSON.parse(document)\n\n Parser::Document.new(hash, options)\n end",
"title": ""
},
{
"docid": "dc1ed2a47849cd2c77d21057dcf6196b",
"score": "0.44023857",
"text": "def solr_resp_single_doc(doc_id, solr_params = {})\n solr_response(solr_params.merge({'qt'=>'document','id'=>doc_id}))\nend",
"title": ""
},
{
"docid": "122ca5ad785fa50ad42da4ba0fdc74ad",
"score": "0.44013953",
"text": "def doc(options={}, &block)\n open(options)\n yield(self)\n close\n end",
"title": ""
},
{
"docid": "10f3276bb3a090d7fa0452189c0e9cf1",
"score": "0.43997246",
"text": "def doc_raptor_send(options = {})\n default_options ={\n :name => controller_name,\n :document_type => request.format.to_sym,\n :test => true\n }\n\n options = default_options.merge(options)\n options[:document_content] ||= render_to_string\n ext = options[:document_type].to_sym\n \n response = DocRaptor.create(options)\n if response.code == 200\n send_data response, :filename => \"#{options[:name]}.#{ext}\", :type => ext\n else\n render :inline => response.body, :status => response.code\n end\n end",
"title": ""
},
{
"docid": "2972db29925de52031187f3ed876b313",
"score": "0.439635",
"text": "def render_item_list(params)\n docpath = params.fetch(:docpath)\n key = params.fetch(:key)\n klass = params.fetch(:klass, ItemList)\n title = params.fetch(:title, \"Cloud Platform Reports\")\n\n template = docpath.to_sym\n\n item_list = get_data_from_json_file(docpath, key, klass)\n\n locals = {\n title: title,\n updated_at: item_list.updated_at,\n list: item_list.list,\n }\n\n erb template, locals: locals\nend",
"title": ""
},
{
"docid": "5110e6639b02e7ba650644658da1a99d",
"score": "0.43960488",
"text": "def show\n @tdoc = Tdoc.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tdoc }\n end\n end",
"title": ""
},
{
"docid": "09e7a280ecef7af68f3702c0d842670c",
"score": "0.43919668",
"text": "def viewer_data_uri(solr_document_uri)\n uri = URI.parse(solr_document_uri)\n \"#{uri.path}.jsonld\"\n end",
"title": ""
},
{
"docid": "4aadac135b9ed15dcb2588b2fa73826f",
"score": "0.43919376",
"text": "def create_doc(match, path)\n DressCode::Document.new({\n :component => match[0],\n :prose => match[1].strip,\n :path => path,\n :relative_path => path.gsub(@base_dir, '').gsub(/^\\//, '')\n })\n end",
"title": ""
},
{
"docid": "e602a0ac74b077188f70b4291222ac5c",
"score": "0.43881997",
"text": "def generate_solr_document\n super.tap do |solr_doc|\n # account\n solr_doc[Solrizer.solr_name('account', :displayable)] = object.account.to_json\n solr_doc[Solrizer.solr_name('account_type', :facetable)] = object.account.map { |a| a.account_type.first }.reject(&:blank?)\n # contact\n solr_doc[Solrizer.solr_name('contact_label', :facetable)] = object.contact.map { |c| c.label.first }.reject(&:blank?)\n solr_doc[Solrizer.solr_name('contact', :displayable)] = object.contact.to_json\n # template files\n solr_doc['template_path_ss'] = object.members.select {\n |m| m.resource_type.include? ('Data paper template')}.\n map{ |f| Hyrax::Engine.routes.url_helpers.download_path(f.id)\n }\n end\n end",
"title": ""
},
{
"docid": "907ed72e8791b0cac520bfea020cd938",
"score": "0.4386578",
"text": "def document\n params.has_key?('_json') ? params['_json'] : params\n end",
"title": ""
},
{
"docid": "1b127c45b994caa896f89e93a080a4af",
"score": "0.43862313",
"text": "def json\n add option: \"-json\"\n end",
"title": ""
},
{
"docid": "4b8f75c24085311da8bd6b490427966c",
"score": "0.43850052",
"text": "def with_json(json)\n @headers['Content-Type'] ||= 'application/json'\n with_body(json)\n end",
"title": ""
},
{
"docid": "e58ab578f3f5df86418cf345c907bce3",
"score": "0.43750384",
"text": "def add_document(opts={})\n raise ArgumentError, \":title is required\" if opts[:title].nil?\n raise ArgumentError, \":body is required\" if opts[:body].nil?\n raise ArgumentError, \":url is required\" if opts[:url].nil?\n \n if opts[:tags].is_a?(Array)\n opts[:tags] = opts[:tags].join(\",\")\n end\n \n doc = opts.to_json\n \n Srchio::Response.new(self.class.post(\"/searchers/#{searcher_id}/documents\", :body => doc))\n end",
"title": ""
},
{
"docid": "c5689e6ae039842aca1f805ec2bc170b",
"score": "0.4374039",
"text": "def call(template)\n \"begin;#{template.source};end.to_rjson\"\n end",
"title": ""
},
{
"docid": "e48746c6694264b6f952287586ab1939",
"score": "0.43729004",
"text": "def initialize(uri, factory, parent = nil, json: nil, ld: nil)\n\n super(uri, factory, parent, json: json, ld: ld)\n\n if json.nil?\n # Get the JSON API item data from the parent list\n owner = self.parent_list\n json = owner && owner.items ? owner.items[uri] : nil\n end\n\n # item_ld = ld ? ld[uri] : nil\n\n # The digitisation request\n digitisation_json = json ? json['digitisation'] : nil\n\n digitisation_ld = nil # TODO: linked data digitisation - we don't use Talis' digitisation service\n if digitisation_json || digitisation_ld\n digitisation = Digitisation.new(json: digitisation_json, ld: digitisation_ld)\n else\n digitisation = nil\n end\n\n # The resource\n resource_json = json ? json['resource'] : nil\n if resource_json.is_a?(Array)\n resource_json = resource_json.empty? ? nil : resource_json[0]\n puts(\"WARNING: selected first resource of #{resource_json}\") if resource_json # TODO: remove once debugged!\n end\n resource = resource_json ? factory.get(resource_json['uri'], json: resource_json) : nil\n #resource_json = json ? json['resource'] : nil\n #resource_uri = get_property('http://purl.org/vocab/resourcelist/schema#resource', item_ld)\n #resource = resource_json # || resource_uri ? factory.get(resource_uri, json: resource_json, ld: ld) : nil\n\n self.digitisation = digitisation\n self.importance = self.get_property('importance', json)\n self.library_note = self.get_property('libraryNote', json)\n #self.local_control_number = self.get_property('http://lists.talis.com/schema/bibliographic#localControlNumber',\n # item_ld)\n #self.note = self.get_property('http://rdfs.org/sioc/spec/note', item_ld)\n self.local_control_number = self.get_property('lcn', json)\n self.note = self.get_property('note', json)\n self.resource = resource\n self.student_note = self.get_property('studentNote', json)\n self.title = self.get_property('title', json)\n\n end",
"title": ""
},
{
"docid": "1e9f769c4e351207f1ec3915166f3406",
"score": "0.43651804",
"text": "def add_json_ld_schema\r\n edited_document = DcJsonLd.find_document_by_ids(CmsHelper.table_param(params), params[:ids])\r\n yaml = YAML.load_file( CmsHelper.form_file_find('json_ld_schema') )\r\n schema_data = yaml[params[:schema]]\r\n # Existing document\r\n if edited_document.dc_json_lds.find_by(type: \"@#{params[:schema]}\")\r\n return render json: {'msg_error' => t('helpers.help.dc_json_ld.add_error', schema: params[:schema] ) }\r\n else\r\n add_empty_json_ld_schema(edited_document, schema_data, params[:schema], params[:schema], yaml)\r\n end\r\n render json: {'reload_' => 1}\r\nend",
"title": ""
},
{
"docid": "13e360be5e4a8ace2dbf5c920f9d50a8",
"score": "0.43646693",
"text": "def reset_tv_document(vault_id, api_key)\n schema = self.get_document_schema\n schemaToJsonString = schema.to_json\n schemaToBase64 = Base64.encode64(schemaToJsonString)\n tvResponse = `curl https://api.truevault.com/v1/vaults/#{vault_id}/documents/#{self.documentID} \\\n -u #{api_key}: \\\n -X PUT \\\n -d \"document=#{schemaToBase64}\"`\n\n # Parse and return a json hash of the TrueVault response\n tvResponseJSON = JSON.parse(tvResponse).with_indifferent_access\n end",
"title": ""
},
{
"docid": "d5c812b93a1da250da171d91702953a4",
"score": "0.43630922",
"text": "def initialize url\n open(url) {|f| @json = f.read}\n @root = JSON.parse @json\n end",
"title": ""
},
{
"docid": "fb48e15922cbcc4f48795618ecf10c0a",
"score": "0.43611595",
"text": "def open(uri, text, version); end",
"title": ""
},
{
"docid": "bc0fe3248c081ac6f326e7b8c6ab9d14",
"score": "0.436085",
"text": "def get_json(url, expand_path: true, &block)\n url = tenancy_url(url) if expand_path\n url = \"#{url}.json\" unless url.end_with?('.json')\n call(url, auth: false, expand_path: false, &block)\n end",
"title": ""
},
{
"docid": "223a060208534f9ad2c4db7c49b10da6",
"score": "0.43599677",
"text": "def read(path)\n @file_data = ::JSON.parse(open(path).read)\n @json = @file_data\n self\n end",
"title": ""
},
{
"docid": "df968e5bec81aeaa481b6ae74bc8b0ce",
"score": "0.43585187",
"text": "def get_document(file_path, site_path=nil, custom_properties=[])\n url = computed_web_api_url(site_path)\n server_relative_url = odata_escape_single_quote \"#{site_path}#{file_path}\"\n ethon = ethon_easy_json_requester\n ethon.url = \"#{url}GetFileByServerRelativeUrl('#{uri_escape server_relative_url}')/ListItemAllFields\"\n ethon.perform\n check_and_raise_failure(ethon)\n parse_get_document_response(ethon.response_body, custom_properties)\n end",
"title": ""
},
{
"docid": "526f2953efd46361dd752c5a06ab41f7",
"score": "0.43576244",
"text": "def show\n @doc = Doc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @doc }\n end\n end",
"title": ""
},
{
"docid": "ea339c49ae6114e8101d2b522480bef9",
"score": "0.4353444",
"text": "def file_out(string)\nopen('myfile.json', 'a') { |f|\n f.puts string\n }\nend",
"title": ""
}
] |
b3b89bfc09d890c50db0c26399aadb3b
|
GET /resource/edit def edit super end PUT /resource
|
[
{
"docid": "84993c7d6d025412525a93df881f89b0",
"score": "0.0",
"text": "def update\n params = devise_parameter_sanitizer.sanitize(:account_update)\n\n @user = User.find(current_user.id)\n if need_password?\n successfully_updated = @user.update_with_password(params)\n else\n params.delete('current_password')\n params.delete('password')\n params.delete('password_confirmation')\n successfully_updated = @user.update_without_password(params)\n end\n\n if successfully_updated\n set_flash_message :notice, :updated\n bypass_sign_in @user\n redirect_to current_user\n else\n render 'edit'\n end\n\n end",
"title": ""
}
] |
[
{
"docid": "da8f9ab6f67466b608158cce61743bd8",
"score": "0.82021475",
"text": "def edit\r\n @r = Resource.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "3ee6901d0c71c8ab825d9c59699a4d8e",
"score": "0.819061",
"text": "def edit\n\tputs \"edit\"\n @resource = Resource.find(params[:id])\n end",
"title": ""
},
{
"docid": "688bd242d67dbe358b859f0edc90147d",
"score": "0.8022198",
"text": "def edit\n build_responder.call(edit_resource, :action => :edit)\n end",
"title": ""
},
{
"docid": "cd66d7b4d777a617a20ba23723b3c097",
"score": "0.787886",
"text": "def edit\n @resource = Fesources.find(params[:id])\n end",
"title": ""
},
{
"docid": "394370bce628d740ab5baa628df14724",
"score": "0.767747",
"text": "def edit\n update\n end",
"title": ""
},
{
"docid": "394370bce628d740ab5baa628df14724",
"score": "0.767747",
"text": "def edit\n update\n end",
"title": ""
},
{
"docid": "70c8ea0bebb893d9c59be5c7133ecd17",
"score": "0.7607782",
"text": "def edit\n update\n end",
"title": ""
},
{
"docid": "9344c8db86f67779f47dc0ccb6ab793b",
"score": "0.7514583",
"text": "def edit\n authorize! :edit, resource\n yield if block_given? # after_edit\n respond_with resource\n end",
"title": ""
},
{
"docid": "702c46ecb3c70a1d4e46046a25833a07",
"score": "0.73793447",
"text": "def edit\n end",
"title": ""
},
{
"docid": "eca619d26c7b662d1c0fb203cad45ce9",
"score": "0.73174673",
"text": "def edit\n\n end",
"title": ""
},
{
"docid": "e4b74e3a7a65018ca42d3cdc2378d2c9",
"score": "0.7275743",
"text": "def edit\n # not implemented yet\n end",
"title": ""
},
{
"docid": "e4b74e3a7a65018ca42d3cdc2378d2c9",
"score": "0.7275743",
"text": "def edit\n # not implemented yet\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "cc103a6eee1eb0430e3425bacfcd66fd",
"score": "0.7260759",
"text": "def edit\n end",
"title": ""
},
{
"docid": "0fbc11fef24994c1bd67620f4466e8e7",
"score": "0.7259243",
"text": "def update\n @resource = Resource.find(params[:id])\n\n respond_to do |format|\n if @resource.update_attributes(params[:resource])\n format.html { redirect_to @resource, :notice => 'Resource was successfully updated.' }\n format.json { head :no_content }\n format.xml { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @resource.errors, :status => :unprocessable_entity }\n format.xml { render :xml => @resource.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8195322ff763ce07942a3f0c32d8f653",
"score": "0.7224149",
"text": "def update\n @resource = Resource.find(params[:id])\n\n respond_to do |format|\n if @resource.update_attributes(params[:resource])\n format.html { redirect_to @resource, notice: 'Resource was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8195322ff763ce07942a3f0c32d8f653",
"score": "0.7224149",
"text": "def update\n @resource = Resource.find(params[:id])\n\n respond_to do |format|\n if @resource.update_attributes(params[:resource])\n format.html { redirect_to @resource, notice: 'Resource was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8195322ff763ce07942a3f0c32d8f653",
"score": "0.7224149",
"text": "def update\n @resource = Resource.find(params[:id])\n\n respond_to do |format|\n if @resource.update_attributes(params[:resource])\n format.html { redirect_to @resource, notice: 'Resource was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8195322ff763ce07942a3f0c32d8f653",
"score": "0.7224149",
"text": "def update\n @resource = Resource.find(params[:id])\n\n respond_to do |format|\n if @resource.update_attributes(params[:resource])\n format.html { redirect_to @resource, notice: 'Resource was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8195322ff763ce07942a3f0c32d8f653",
"score": "0.7224149",
"text": "def update\n @resource = Resource.find(params[:id])\n\n respond_to do |format|\n if @resource.update_attributes(params[:resource])\n format.html { redirect_to @resource, notice: 'Resource was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8195322ff763ce07942a3f0c32d8f653",
"score": "0.7224149",
"text": "def update\n @resource = Resource.find(params[:id])\n\n respond_to do |format|\n if @resource.update_attributes(params[:resource])\n format.html { redirect_to @resource, notice: 'Resource was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8195322ff763ce07942a3f0c32d8f653",
"score": "0.7224149",
"text": "def update\n @resource = Resource.find(params[:id])\n\n respond_to do |format|\n if @resource.update_attributes(params[:resource])\n format.html { redirect_to @resource, notice: 'Resource was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "706ad27e52f25767791f0e9426bf2880",
"score": "0.7220439",
"text": "def update\n edit\n end",
"title": ""
},
{
"docid": "032dd8df60c9d0640c01979f3429f5e8",
"score": "0.7218493",
"text": "def edit\n\n end",
"title": ""
},
{
"docid": "032dd8df60c9d0640c01979f3429f5e8",
"score": "0.7218493",
"text": "def edit\n\n end",
"title": ""
},
{
"docid": "032dd8df60c9d0640c01979f3429f5e8",
"score": "0.7218493",
"text": "def edit\n\n end",
"title": ""
},
{
"docid": "032dd8df60c9d0640c01979f3429f5e8",
"score": "0.7218493",
"text": "def edit\n\n end",
"title": ""
},
{
"docid": "032dd8df60c9d0640c01979f3429f5e8",
"score": "0.7218493",
"text": "def edit\n\n end",
"title": ""
},
{
"docid": "032dd8df60c9d0640c01979f3429f5e8",
"score": "0.7218493",
"text": "def edit\n\n end",
"title": ""
},
{
"docid": "032dd8df60c9d0640c01979f3429f5e8",
"score": "0.7218493",
"text": "def edit\n\n end",
"title": ""
},
{
"docid": "032dd8df60c9d0640c01979f3429f5e8",
"score": "0.7218493",
"text": "def edit\n\n end",
"title": ""
},
{
"docid": "032dd8df60c9d0640c01979f3429f5e8",
"score": "0.7218493",
"text": "def edit\n\n end",
"title": ""
},
{
"docid": "032dd8df60c9d0640c01979f3429f5e8",
"score": "0.7218493",
"text": "def edit\n\n end",
"title": ""
},
{
"docid": "032dd8df60c9d0640c01979f3429f5e8",
"score": "0.7218493",
"text": "def edit\n\n end",
"title": ""
},
{
"docid": "032dd8df60c9d0640c01979f3429f5e8",
"score": "0.7218493",
"text": "def edit\n\n end",
"title": ""
},
{
"docid": "032dd8df60c9d0640c01979f3429f5e8",
"score": "0.7218493",
"text": "def edit\n\n end",
"title": ""
},
{
"docid": "032dd8df60c9d0640c01979f3429f5e8",
"score": "0.7218493",
"text": "def edit\n\n end",
"title": ""
},
{
"docid": "032dd8df60c9d0640c01979f3429f5e8",
"score": "0.7218493",
"text": "def edit\n\n end",
"title": ""
},
{
"docid": "e2f4ecc89e0e1fa3b4e3c907fef07043",
"score": "0.72156996",
"text": "def update\n @resource = Resource.find(params[:id])\n\n respond_to do |format|\n if @resource.update_attributes(params[:resource])\n format.html { redirect_to @resource, notice: 'Resource was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "09ee50187a4d33083e2319563a9a7613",
"score": "0.7205608",
"text": "def update\n @resource = Resource.find(params[:id])\n\n respond_to do |format|\n if @resource.update_attributes(params[:resource])\n flash[:notice] = 'Resource was successfully updated.'\n format.html { redirect_to(@resource) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @resource.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "09ee50187a4d33083e2319563a9a7613",
"score": "0.7205608",
"text": "def update\n @resource = Resource.find(params[:id])\n\n respond_to do |format|\n if @resource.update_attributes(params[:resource])\n flash[:notice] = 'Resource was successfully updated.'\n format.html { redirect_to(@resource) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @resource.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dcf156fd6531ff2f12f3fe164b2c65eb",
"score": "0.71948963",
"text": "def edit\n \n end",
"title": ""
},
{
"docid": "dcf156fd6531ff2f12f3fe164b2c65eb",
"score": "0.71948963",
"text": "def edit\n \n end",
"title": ""
},
{
"docid": "dcf156fd6531ff2f12f3fe164b2c65eb",
"score": "0.71948963",
"text": "def edit\n \n end",
"title": ""
},
{
"docid": "9cf4e0aa38d5ed113736dd002277588e",
"score": "0.7184379",
"text": "def edit\n\t\t# TODO\n\tend",
"title": ""
},
{
"docid": "ea01cbb224298f0507e70c6f46ff5a81",
"score": "0.71663254",
"text": "def edit\r\n end",
"title": ""
},
{
"docid": "ea01cbb224298f0507e70c6f46ff5a81",
"score": "0.71663254",
"text": "def edit\r\n end",
"title": ""
},
{
"docid": "ea01cbb224298f0507e70c6f46ff5a81",
"score": "0.71663254",
"text": "def edit\r\n end",
"title": ""
},
{
"docid": "ea01cbb224298f0507e70c6f46ff5a81",
"score": "0.71663254",
"text": "def edit\r\n end",
"title": ""
},
{
"docid": "ea01cbb224298f0507e70c6f46ff5a81",
"score": "0.71663254",
"text": "def edit\r\n end",
"title": ""
},
{
"docid": "ea01cbb224298f0507e70c6f46ff5a81",
"score": "0.71663254",
"text": "def edit\r\n end",
"title": ""
},
{
"docid": "ea01cbb224298f0507e70c6f46ff5a81",
"score": "0.71663254",
"text": "def edit\r\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71513844",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.7151031",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.7151031",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
},
{
"docid": "13d9d82b05c59c1d7d22387e67a6f80a",
"score": "0.71508545",
"text": "def edit\n end",
"title": ""
}
] |
573733d1fc49220f13dc90b39b858af4
|
Android only. Get the name of the active IME engine.
|
[
{
"docid": "cfafc2a1e0a3de59cfa8410c79893b6a",
"score": "0.7204082",
"text": "def ime_active_engine\n @bridge.ime_active_engine\n end",
"title": ""
}
] |
[
{
"docid": "6ee7ec8a20d51dd9c91ebc8660642ae2",
"score": "0.7398855",
"text": "def ime_active_engine\n ime.active_engine\n end",
"title": ""
},
{
"docid": "db0015ffc38013c7a5536df4ab492218",
"score": "0.6569442",
"text": "def engine_name\n data[:engine_name]\n end",
"title": ""
},
{
"docid": "997b089871544db3ba03725a05ca7bc5",
"score": "0.6567128",
"text": "def engine_name\n data.engine_name\n end",
"title": ""
},
{
"docid": "6611803ae104492a8c6c35010eaea14a",
"score": "0.6391112",
"text": "def ime_available_engines\n @bridge.ime_available_engines\n end",
"title": ""
},
{
"docid": "878b73c6b4955ed1d6dbb76d6dbdd86d",
"score": "0.63372916",
"text": "def ime\n @ime ||= DeviceIME.new(@bridge)\n end",
"title": ""
},
{
"docid": "68bdf81c4693248a6fc522b1254d2da8",
"score": "0.63293105",
"text": "def engine_name\n @engine_name\n end",
"title": ""
},
{
"docid": "5d6376f67bd7cc65a1e3a547fa2b71dd",
"score": "0.6120035",
"text": "def ime_available_engines\n ime.available_engines\n end",
"title": ""
},
{
"docid": "a3799994aeb011c8d76eb4e797f7fb8a",
"score": "0.61031204",
"text": "def current_engine\n end",
"title": ""
},
{
"docid": "dec4c3be784e2b878df276c53bbfb990",
"score": "0.6018164",
"text": "def name\n @name ||= if !OS.windows? && ruby?\n MRI\n elsif ruby? && engine? && engine == 'rbx'\n Rubinius\n elsif ruby? && engine? && engine == 'maglev'\n MagLev\n elsif engine? && engine == 'jruby'\n JRuby\n end\n end",
"title": ""
},
{
"docid": "d17ded9b4bf8b0cd9ae798a3a26b43df",
"score": "0.6010755",
"text": "def current_engine\n unless defined?(@current_engine)\n processors = environment.attributes_for(self.pathname).processors\n processors.each do |processor|\n if engine = CAPTURE_ENGINES[processor.to_s]\n @current_engine = engine\n break\n end\n end\n end\n\n @current_engine\n end",
"title": ""
},
{
"docid": "6daf3ebe94ede7e463132fe273d35684",
"score": "0.59601253",
"text": "def oem_name\n @values.fetch('ai.device.oemName') { \n @values['ai.device.oemName'] = nil\n }\n end",
"title": ""
},
{
"docid": "c9998a76b31a8c732f0b31402269541c",
"score": "0.58979374",
"text": "def engine\n data[:engine]\n end",
"title": ""
},
{
"docid": "c9998a76b31a8c732f0b31402269541c",
"score": "0.58979374",
"text": "def engine\n data[:engine]\n end",
"title": ""
},
{
"docid": "729058936321ff03c3a550ffbac616d0",
"score": "0.578055",
"text": "def engine_id\n\n @dict.fexp.context.engine_id\n end",
"title": ""
},
{
"docid": "2b59e937c2d954073e0b50a448c01935",
"score": "0.5690078",
"text": "def get_satellite_eyes_app_name()\n app_name = \"Satellite Eyes\"\n return app_name\nend",
"title": ""
},
{
"docid": "be3d531a352b242d82666ed3a308830b",
"score": "0.5629558",
"text": "def platform_name()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = Native.RunMetadata_platform_name(@handle.ptr)\n result\n end",
"title": ""
},
{
"docid": "69e2a511c0395c9e94098a18b557a7ea",
"score": "0.56220067",
"text": "def default_engine\n @@default_engine ? @@default_engine : 'retro'\n end",
"title": ""
},
{
"docid": "47d5444be38f71dc63637a2384453015",
"score": "0.5605886",
"text": "def engine_mode\n data[:engine_mode]\n end",
"title": ""
},
{
"docid": "053014b2f12b471ad1a3b8ad106375e7",
"score": "0.5602575",
"text": "def engine_sym\n @engine_sym ||= self.class.name.to_s.demodulize.underscore.to_sym\n end",
"title": ""
},
{
"docid": "754aa3631b572e07d07cff145e46175d",
"score": "0.55819774",
"text": "def select_engine(name)\n @log.debug \"Bot: select_engine #{name}\"\n found = false\n @all_games_bots.each do |item|\n if item[:key] == name\n found = true\n @log.debug \"Bot: Game Engine selected: #{name}, #{item[:core_name]}, #{item[:alg_name]}\"\n @game_to_play = item\n end\n end\n unless found\n @log.error \"Bot: ERROR Game Engine not found: #{name}\\nExit for me\"\n exit\n end\n end",
"title": ""
},
{
"docid": "022e9e208aff61511ead9a01c07ebe78",
"score": "0.5571668",
"text": "def current_application\n Wasko::Applescript.run do\n \"get name of (info for (path to frontmost application))\"\n end\n end",
"title": ""
},
{
"docid": "c494536b0ce4044199ffa0f33331571c",
"score": "0.5571179",
"text": "def software_name\n self.class.const_get(:SOFTWARE_NAME)\n end",
"title": ""
},
{
"docid": "c809578127549b7ccb0c41ee3ab7bd78",
"score": "0.55550027",
"text": "def platform_shortname\n if platform_family == 'rhel'\n 'el'\n else\n platform\n end\n end",
"title": ""
},
{
"docid": "61922f5dfc947af903a631d85672100b",
"score": "0.55361676",
"text": "def game_name()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = Native.Run_game_name(@handle.ptr)\n result\n end",
"title": ""
},
{
"docid": "2ff676de9d8416d7ad4374cd35c8b01c",
"score": "0.55295545",
"text": "def machine_name\n @values.fetch('ai.device.machineName') { \n @values['ai.device.machineName'] = nil\n }\n end",
"title": ""
},
{
"docid": "9bc00049872c4febf103bb7f11edb454",
"score": "0.5515847",
"text": "def lookup_engine (engine_name)\n e = get_participant_map.lookup_participant engine_name\n return e if e\n get_engine\n end",
"title": ""
},
{
"docid": "a40563839c1ba0a57dd7285eab11311c",
"score": "0.5508192",
"text": "def engine_environment_id\n\n @eei ||= new_fei(\n :workflow_definition_url => 'ee',\n :workflow_definition_name => 'ee',\n :workflow_instance_id => '0',\n :expression_name => EN_ENVIRONMENT)\n end",
"title": ""
},
{
"docid": "ab090447d29a4c3b5fdbcb594fbf0424",
"score": "0.5504917",
"text": "def name\n RUBY_PLATFORM\n end",
"title": ""
},
{
"docid": "ce163b65562a1d764509580d58338ced",
"score": "0.5473989",
"text": "def platform\n self.class.name.split(\"::\").last.gsub(/(?<=[^A-Z])[A-Z]+/, \"-\\\\0\").downcase\n end",
"title": ""
},
{
"docid": "20258f0b1617cd5718b914e7d0d69eb9",
"score": "0.5465197",
"text": "def get_modem\n return self.sendcmd(\"modem.get_name\")\n end",
"title": ""
},
{
"docid": "124867ecec682d2731903b64d46b4df1",
"score": "0.54577345",
"text": "def cloud\n ext_management_system.provider.cloud_ems.first\n end",
"title": ""
},
{
"docid": "d8a231516a29b68063579a4e9cb4b17b",
"score": "0.54538864",
"text": "def platform_name\n self.platform ? self.platform.name : NOT_SET\n end",
"title": ""
},
{
"docid": "511ce52fa22cbcb3a2e2db5d9c00669a",
"score": "0.5447012",
"text": "def engine\n @data.fetch(:ENGINE)\n end",
"title": ""
},
{
"docid": "86f2121248dfc57ea3726e91e5b6bf96",
"score": "0.544607",
"text": "def name\n @name ||= begin \n ioctl(EVIOCGNAME(len = 256), out_name = \" \" * len)\n out_name.rstrip\n end\n end",
"title": ""
},
{
"docid": "5ad4d0c262c633d2a302358f523d38e3",
"score": "0.5433313",
"text": "def get_os_name\n\t\t\t\treturn SystemDetector.get_os_name\n\t\t\tend",
"title": ""
},
{
"docid": "85fbfaf71d007525ccb61e4293be435f",
"score": "0.5420238",
"text": "def text\n platform.text\n end",
"title": ""
},
{
"docid": "feb1751ce6c41a829938e8f49572d13f",
"score": "0.53784317",
"text": "def get_radiant_player_app_name()\n app_name = \"Radiant Player\"\n return app_name\nend",
"title": ""
},
{
"docid": "e0c274e60e368ac9375e4d92046cad26",
"score": "0.53713405",
"text": "def engines_for_name(name)\n components_for_name(name).last\n end",
"title": ""
},
{
"docid": "e265567089ce54a333db078903bdf56d",
"score": "0.53527325",
"text": "def find_engine\n result = nil\n # We already know the name of the gem from user input\n if Gem.loaded_specs.has_key? gem_name\n # Let's get the gem's full path in the filesystem\n gpath = Gem.loaded_specs[gem_name].full_gem_path\n # Then match the path we've got to the path of an engine - \n # which should have its Module Name (aka paydirt)\n Rails::Application::Railties.engines.each do |engine| \n if engine.class.root.to_s == gpath\n # Get the class name from the engine hash\n result = engine.class\n break\n end\n end\n end\n result\n end",
"title": ""
},
{
"docid": "9bb1f50a31bcfe57e3107117813ad89b",
"score": "0.5316963",
"text": "def get_os\n line = Cocaine::CommandLine.new('uname')\n output = line.run\n\n output.chomp.downcase.intern\n end",
"title": ""
},
{
"docid": "ab6c480c472c3b106752d8c0dfbfc505",
"score": "0.531622",
"text": "def android_device_type\n t('device.android.nook')\n end",
"title": ""
},
{
"docid": "6304c43644080c38067b5bd73e6f6ea4",
"score": "0.53064775",
"text": "def get_platform\n rpc_get_fact_direct('kernel')\n end",
"title": ""
},
{
"docid": "1db113262f362e220e2254a69d515151",
"score": "0.5273653",
"text": "def akb_engine(item)\n Akb::AkbMachine.const_get(item.capitalize).new\n end",
"title": ""
},
{
"docid": "2031a1e9625e92da5c9470338b61dbd5",
"score": "0.52424604",
"text": "def browser_name\n begin\n @browser_name ||= begin\n return 'unknown' if ua.nil?\n\n Detector.patterns.each do |pattern, identifier|\n return identifier if pattern.match( ua )\n end\n\n if ua.include?( 'konqueror' )\n 'konqueror'\n elsif ua.include?( 'netscape' )\n 'netscape'\n else\n 'unknown'\n end\n end\n rescue\n 'unknown'\n end\n end",
"title": ""
},
{
"docid": "9583ae0bebef0a5992fa15f0ac85bf77",
"score": "0.5235149",
"text": "def name\n c.environment\n end",
"title": ""
},
{
"docid": "183c78cf383b4e53cabf394a947b7bab",
"score": "0.5229946",
"text": "def engine_class_name(e)\n e.class.name.deconstantize # remove the ::Engine part\n end",
"title": ""
},
{
"docid": "6d520d1560f8903fc36bb8dd386e24ed",
"score": "0.5227677",
"text": "def platform_shortname\n if rhel?\n if \"rocky\" == Ohai[\"platform\"]\n \"rocky\"\n else\n \"el\"\n end\n elsif suse?\n \"sles\"\n else\n Ohai[\"platform\"]\n end\n end",
"title": ""
},
{
"docid": "3373922a50df5deaabe375febc907cf9",
"score": "0.52222514",
"text": "def program_name\n Quickl.program_name\n end",
"title": ""
},
{
"docid": "78880d3a70e066860170d18f509982d6",
"score": "0.52159",
"text": "def name\n return mode_desc\n end",
"title": ""
},
{
"docid": "f85f355565cc98a2509479fbf829086c",
"score": "0.52067673",
"text": "def engine\n @engine ||= find_engine\n end",
"title": ""
},
{
"docid": "e0055b82226a0ce0b2c214874c4c9984",
"score": "0.520606",
"text": "def name\n GCODE_DICTIONARY[cmd.to_sym] || :unknown\n end",
"title": ""
},
{
"docid": "7686ce25a9722de001245d2998618f32",
"score": "0.52018255",
"text": "def rom\n ROM.env\n end",
"title": ""
},
{
"docid": "ccae070b9269bbd37dc5e7d5ea572020",
"score": "0.5190494",
"text": "def engine_id\n\n conf['engine_id'] || 'engine'\n end",
"title": ""
},
{
"docid": "b7291e7c9187dcf40b66c5f34b4ca3f7",
"score": "0.5188567",
"text": "def platform_name\n capabilities['platformName']\n end",
"title": ""
},
{
"docid": "489da4d2e53e8ea16c9f1287e775c3aa",
"score": "0.5187191",
"text": "def iom_mode\n provider.facts[\"iom_mode\"] || \"\"\n end",
"title": ""
},
{
"docid": "5ae4321d8cd51902dae959b0f94e0234",
"score": "0.5179677",
"text": "def engine\n return @engine if @engine\n self.engine = self.default_engine\n @engine\n end",
"title": ""
},
{
"docid": "0eea7f002aee4f6a983f02f7558c9119",
"score": "0.51786625",
"text": "def software_name\n begin\n self.software.name\n rescue\n \"not found\"\n end\n end",
"title": ""
},
{
"docid": "acd1aaf4914cf2fc053b25aed866d76c",
"score": "0.5177323",
"text": "def name_and_engine\n @engine_name_and_engine ||= Hash[*engines.collect {|e| [engine_name(e), e]}.flatten]\n end",
"title": ""
},
{
"docid": "c0d228415c58d404b5c019086b896e8f",
"score": "0.51745003",
"text": "def platform\n fetch('game.platform')\n end",
"title": ""
},
{
"docid": "e875eb72753a11283b31328abbc35480",
"score": "0.5172539",
"text": "def platform\n if os.include?('Android')\n 'Android'\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "24281f03866f6eb0d5ac0da0e47dc43a",
"score": "0.515987",
"text": "def determine_name\n name = nil\n\n case @type\n when :computer\n name = `sudo dmidecode -s system-serial-number`.chomp\n when :hard_drive\n `sudo smartctl -i #{@options['device']}`.each_line do |line|\n line =~ /^Serial\\sNumber:\\s+([A-Za-z0-9_-]+)$/\n name = $1\n end\n end\n\n # Check if the id is valid (all word characters plus dash)\n if ( name =~ /^[A-Za-z0-9_-]+$/ )\n name\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "ae7ebe9d2881764ee79586fb9ce0f656",
"score": "0.5150614",
"text": "def platform_name; non_framework_platforms.first; end",
"title": ""
},
{
"docid": "c844316bc466de02a9619acc777268db",
"score": "0.51482135",
"text": "def current_encoder\n IITEncoder.new(@ole.CurrentEncoder)\n end",
"title": ""
},
{
"docid": "55dbd47e51f887b05898b651a502f85c",
"score": "0.51467496",
"text": "def eclipse_iu\n @resource[:install_options][0]['plugin_name']\n end",
"title": ""
},
{
"docid": "da01b21a829084814ba50369122acf45",
"score": "0.51381266",
"text": "def model_name\n fetch('device.model_name')\n end",
"title": ""
},
{
"docid": "7a969e12ae63523d98bfaf56ad916caa",
"score": "0.51334524",
"text": "def os_name\n if (os_name = @host.at('tag[name=operating-system]'))\n os_name.inner_text\n end\n end",
"title": ""
},
{
"docid": "f92c4f1ae55140868c4e84be4c191e12",
"score": "0.51259696",
"text": "def engine\n Agent.engine_for_user_agent string\n end",
"title": ""
},
{
"docid": "2fedad42f3a8d9acabca5089efc4df73",
"score": "0.5122474",
"text": "def get_app_name\n if ENV.key?('INSTANA_SERVICE_NAME')\n return ENV['INSTANA_SERVICE_NAME']\n end\n\n if defined?(::Resque)\n # Just because Resque is defined doesn't mean this is a resque process necessarily\n # Check arguments for a match\n if ($0 =~ /resque-#{Resque::Version}/)\n return \"Resque Worker\"\n elsif ($0 =~ /resque-pool-master/)\n return \"Resque Pool Master\"\n elsif ($0 =~ /resque-scheduler/)\n return \"Resque Scheduler\"\n end\n end\n\n if defined?(::RailsLts) || defined?(::Rails)\n return Rails.application.class.to_s.split('::')[0]\n end\n\n if $0.to_s.empty?\n return \"Ruby\"\n end\n\n exe = File.basename($0)\n if exe == \"rake\"\n return \"Rake\"\n end\n\n return exe\n rescue Exception => e\n Instana.logger.info \"#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}\"\n Instana.logger.debug { e.backtrace.join(\"\\r\\n\") }\n return \"Ruby\"\n end",
"title": ""
},
{
"docid": "3016159337c18f3471fd28f7ce4bef05",
"score": "0.51199675",
"text": "def get_opera_beta_app_name()\n app_name = \"Opera Beta\"\n return app_name\nend",
"title": ""
},
{
"docid": "7739df6bd1a9eb7a08d0336710320210",
"score": "0.51007694",
"text": "def device_name\n return @device_name\n end",
"title": ""
},
{
"docid": "7739df6bd1a9eb7a08d0336710320210",
"score": "0.51007694",
"text": "def device_name\n return @device_name\n end",
"title": ""
},
{
"docid": "7739df6bd1a9eb7a08d0336710320210",
"score": "0.51007694",
"text": "def device_name\n return @device_name\n end",
"title": ""
},
{
"docid": "720b7e36f0423b5f5db7930ed49d6991",
"score": "0.5096301",
"text": "def engine_version\n\t\tAgent.engine_version_for_agent string\n\tend",
"title": ""
},
{
"docid": "eeb278a46f9e47ce526f89ab333556bd",
"score": "0.5094995",
"text": "def engines; engine_names; end",
"title": ""
},
{
"docid": "069ac3a42799149c8285261469c3f107",
"score": "0.50864196",
"text": "def get_exotic_archname(platform_type)\n case platform_type\n when /aarch64/\n \"ARM\"\n when /ppc64le/\n \"Power\"\n else\n nil\n end\nend",
"title": ""
},
{
"docid": "8399de5bf22e5e2674bf32168d1e7be2",
"score": "0.5078194",
"text": "def platform\n backend.platform\n end",
"title": ""
},
{
"docid": "ae46df399466fbea0a9f6c8791f05462",
"score": "0.50668633",
"text": "def computername\n vm.os_profile.computer_name\n end",
"title": ""
},
{
"docid": "960f0623aa5fcb06759c6763eee6afbb",
"score": "0.5066465",
"text": "def device_display_name\n return @device_display_name\n end",
"title": ""
},
{
"docid": "960f0623aa5fcb06759c6763eee6afbb",
"score": "0.5066465",
"text": "def device_display_name\n return @device_display_name\n end",
"title": ""
},
{
"docid": "948dd63fb1afdf1bf72ecb9c7e037208",
"score": "0.50593334",
"text": "def name\n File.join(\"/dev/\",@device.gsub(/!/, \"/\"))\n end",
"title": ""
},
{
"docid": "b9da50d103ad6fd6273de5cdc8837a33",
"score": "0.5048758",
"text": "def name\n @architecture\n end",
"title": ""
},
{
"docid": "38caf00ce19fcf3c21be8b79e6855137",
"score": "0.504702",
"text": "def describePlatform\n TC.name.gsub(' ', '_')\nend",
"title": ""
},
{
"docid": "73fc869a1e7cb9c0b878e2fbdbf3b7a2",
"score": "0.50441885",
"text": "def device\n device_name\n end",
"title": ""
},
{
"docid": "d06d46eaed9b3c160bc88ace2c35d45c",
"score": "0.50316894",
"text": "def platform\n System::get_property('platform')\n end",
"title": ""
},
{
"docid": "f48577509142bd0f3a3b79f1563782b4",
"score": "0.5030395",
"text": "def name()\n return Vocab::optimize_modes_strings[@v_index][0]\n end",
"title": ""
},
{
"docid": "5ba4b9be491a38176bd84a2d941a1317",
"score": "0.5027475",
"text": "def gl_renderer()\n glGetString(GL_RENDERER)\n end",
"title": ""
},
{
"docid": "22896404f2a30ce6de99e5079100d302",
"score": "0.50222915",
"text": "def model\n\t\t\t\t@@name ||= cpuinfo.find { |x| x.start_with?('model name') }.to_s.split(?:)[-1].to_s.strip\n\t\t\tend",
"title": ""
},
{
"docid": "dd098fa3c0ab9b12058a31237a4fc99f",
"score": "0.5013062",
"text": "def name\n `#@native.name()`\n end",
"title": ""
},
{
"docid": "70c7745583e58cf17df982440897be88",
"score": "0.5009056",
"text": "def launch_exe\n @game_info['launch_exe']\n end",
"title": ""
},
{
"docid": "60f9df57450e55c666082dee2a5a1c26",
"score": "0.500895",
"text": "def name\n \"#{self[:user].strip} #{self[:engine_id]}\".strip\n end",
"title": ""
},
{
"docid": "0bc5266feba86885ef9c285cf036ab67",
"score": "0.5004314",
"text": "def gl_renderer\n glGetString(GL_RENDERER)\n end",
"title": ""
},
{
"docid": "27ff812d54a18f54a03eaba35514f991",
"score": "0.4989808",
"text": "def platform\n fetch('device.platform')\n end",
"title": ""
},
{
"docid": "c421993b5e26b7b6b2e8f03c87064d79",
"score": "0.49835762",
"text": "def editor_name\n File.basename(pry_instance.config.editor).split(\" \").first\n end",
"title": ""
},
{
"docid": "e2df6f9bfff59a76f4c9d975e2359671",
"score": "0.49827188",
"text": "def kiosk_app_display_name\n return @kiosk_app_display_name\n end",
"title": ""
},
{
"docid": "74af50928e963c5795ba982f66cbb210",
"score": "0.4980703",
"text": "def which\n self\n end",
"title": ""
},
{
"docid": "228e754d6e797708007aea0e7915b810",
"score": "0.49757308",
"text": "def oem_name=(value)\n if value == @defaults['ai.device.oemName']\n @values.delete 'ai.device.oemName' if @values.key? 'ai.device.oemName'\n else\n @values['ai.device.oemName'] = value\n end\n end",
"title": ""
},
{
"docid": "a900c549a3aa3b113174959a7461dd90",
"score": "0.4969386",
"text": "def name name\n # work around https://github.com/appium/appium/issues/543\n # @driver.find_element :name, name\n mobile :find, [ [ [7, name] ] ]\n end",
"title": ""
},
{
"docid": "a94535dda2aa6e18ba7af5b7040798d9",
"score": "0.49534324",
"text": "def name\n return 'AedgSmallToMediumOfficeExteriorLighting'\n end",
"title": ""
},
{
"docid": "56855919344029f03bc0978fc5340a58",
"score": "0.4951679",
"text": "def environment_name\n return @environment_name if @environment_name.is_a? String\n if ENV['EY_ENVIRONMENT_NAME']\n @environment_name = ENV['EY_ENVIRONMENT_NAME']\n elsif engine_yard_cloud_api.possible_to_detect_environment_from_git_config?\n @environment_name = engine_yard_cloud_api.environment_name\n end\n raise RuntimeError, \"[engineyard-metadata gem] You need to run this from the application repo, set EY.metadata.environment_name= or set ENV['EY_ENVIRONMENT_NAME']\" unless @environment_name.to_s.strip.length > 0\n @environment_name\n end",
"title": ""
},
{
"docid": "8f856171bbff58f4ee7b77875b96dab3",
"score": "0.49495512",
"text": "def get(name)\n @all.find { |e| e.name == name.to_s || e.name == \"#{name}_engine\" }\n end",
"title": ""
}
] |
d67b622303025c738e3baa172c7a5347
|
GET /variants/1 GET /variants/1.json
|
[
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] |
[
{
"docid": "d432a2862f4d09d6fbb0f3f40e01e084",
"score": "0.7698987",
"text": "def index\n @variants = Variant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @variants }\n end\n end",
"title": ""
},
{
"docid": "34b2ee5c83e7565ea25f57d84bc93e58",
"score": "0.7659386",
"text": "def get_variant\n @product = Spree::Product.find_by :slug => params[:product_id]\n @variant = @product.find_variant_by_options(params[:ids].split(','))\n if @variant\n respond_to do |format|\n format.json {render json: {variant_id: @variant.id, image_ids: @variant.image_ids}}\n end\n end\n end",
"title": ""
},
{
"docid": "bcf53ddf28e17844ff8258f65b36ee83",
"score": "0.756742",
"text": "def show\n @variant = Variant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @variant }\n end\n end",
"title": ""
},
{
"docid": "bcf53ddf28e17844ff8258f65b36ee83",
"score": "0.756742",
"text": "def show\n @variant = Variant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @variant }\n end\n end",
"title": ""
},
{
"docid": "261f15100b01869c30ba03c466e66c0b",
"score": "0.71672744",
"text": "def index\n @variants = Variant.all\n end",
"title": ""
},
{
"docid": "5fed06b8b106eb99be8cb34d7985ed26",
"score": "0.7162939",
"text": "def index\n @sub_variants = SubVariant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sub_variants }\n end\n end",
"title": ""
},
{
"docid": "990fccb302549fe0837f0ca578e8d63b",
"score": "0.714378",
"text": "def show\n @sub_variant = SubVariant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sub_variant }\n end\n end",
"title": ""
},
{
"docid": "59af6bc41da4fb9f2654d74f96afcc06",
"score": "0.70946586",
"text": "def get_sizes\n @item = Item.find(params[:id])\n @sizes = @item.variants_for(:size, nil, params[:colour])\n respond_to do |format|\n format.json { render :json => @sizes }\n end\n end",
"title": ""
},
{
"docid": "c5c74eccd8302d8c33954fc5ad6fa5be",
"score": "0.7022754",
"text": "def index\n @variants =\n if @product\n @product.variants.page params[:page]\n else\n Variant.page params[:page]\n end\n end",
"title": ""
},
{
"docid": "5efa217ef973eac23fa4dfc9fcac0ba7",
"score": "0.6837232",
"text": "def get_colours\n @item = Item.find(params[:id])\n @colours = @item.variants_for(:colour, params[:size], nil)\n respond_to do |format|\n format.json { render :json => @colours }\n end\n end",
"title": ""
},
{
"docid": "1e0231fd3b3e6610d90e3c3f1df6fad9",
"score": "0.67905617",
"text": "def get_selected_variant_data\n @variant = Spree::Variant.where(:id => params[:variant_id]).first\n @sku = @dispatch_no = @variant.sku+\"_\"+Time.now.strftime('%y%m%d%H%L')\n price = @variant.price\n respond_to do |format|\n format.json { render :json => {:variant => @variant,\n :sku => @sku, :price => price }}\n end\n end",
"title": ""
},
{
"docid": "46ed95b9c0d3f83a8557edc48117d498",
"score": "0.6689519",
"text": "def index\n @product_variants = ProductVariant.all\n end",
"title": ""
},
{
"docid": "dce612e380f659a1cfee9c5f97af7850",
"score": "0.66659415",
"text": "def new\n @variant = Variant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @variant }\n end\n end",
"title": ""
},
{
"docid": "f8664a28bcb4b37738ea48dc7434af22",
"score": "0.6644483",
"text": "def show\n @variant_image = VariantImage.find(params[:id])\n @variant = @variant_image.variant\n\n respond_to do |format|\n format.html # show.html.erb\n format.js\n format.json { render json: @variant_image }\n end\n end",
"title": ""
},
{
"docid": "6affb6cf57672f0e7214cca1958609bd",
"score": "0.6565237",
"text": "def index\n @variant_images = VariantImage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @variant_images }\n end\n end",
"title": ""
},
{
"docid": "a9130ad3004fe8f5d334791ba77a737e",
"score": "0.65603095",
"text": "def variant\n shop = params[:shop]\n product_id = params[:id]\n variant_id = params[:variant_id]\n image_url = params[:url]\n\n begin\n url = \"http://variantimages.shopifyapps.com/jquery-preload.js?shop=#{shop}&id=#{product_id}\"\n content = open(url).read\n\n if match = content.match(/variantData = ([^;]+);/)\n variant_url = URI(image_url)\n variant_url.path = variant_path([\n File.dirname(variant_url.path),\n JSON.parse(match[1])[variant_id][\"filename\"].split('.').first,\n File.basename(variant_url.path).split('_').last,\n ])\n image_url = variant_url.to_s\n end\n rescue => e\n end\n\n redirect_to image_url\n end",
"title": ""
},
{
"docid": "80bef8c05c9738f8d6a37971661199da",
"score": "0.6478554",
"text": "def index\n\n unless params[:term].present?\n set_item_param if params[:item_id].present?\n @variants = @item ? @item.variants : Variant.all\n @variants = @variants.order(:name).where( :domain => current_tenant.domain)\n else\n if params[:supplier_id].present?\n @variants = Variant.includes( :item => :supplies ).order(:name).where(\"(variants.name ILIKE ? or items.name ILIKE ?) and product_flow <> ? and supplies.supplier_id = ?\", \"%#{params[:term]}%\", \"%#{params[:term]}%\", 'outgoing', params[:supplier_id]).references(:items)\n else\n @variants = Variant.includes(:item).order(:name).where(\"(variants.name ILIKE ? or items.name ILIKE ?) and product_flow <> ?\", \"%#{params[:term]}%\", \"%#{params[:term]}%\", 'outgoing').references(:items)\n end\n\n render :json => @variants.map{|c| (c.name == 'default' ? c.item.name : c.name )}.uniq, root: false\n end\n end",
"title": ""
},
{
"docid": "764b9f76465a61ffbf62fe17b06bd7cd",
"score": "0.6359342",
"text": "def show\n @variety = Variety.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @variety }\n end\n end",
"title": ""
},
{
"docid": "1488e52586dfb420ad4223fc1bc26a9c",
"score": "0.6211591",
"text": "def new\n @sub_variant = SubVariant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sub_variant }\n end\n end",
"title": ""
},
{
"docid": "64a1710d094a95a203db1e829b4ae408",
"score": "0.620342",
"text": "def new\n @variant = Variant.new\n @master_variant = Variant.find(params[:product_id])\n @variant.prices = @master_variant.prices\n @path = admin_product_variants_path(@master_variant)\n @cancel_path = admin_product_variants_path(@master_variant)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @variant }\n end\n end",
"title": ""
},
{
"docid": "f7444c13952879375dba4c410de747ac",
"score": "0.6203163",
"text": "def variant\n return nil if variants?\n variants.first\n end",
"title": ""
},
{
"docid": "cad1498555544483369b6fe4b669b26f",
"score": "0.61971295",
"text": "def show\n @flavor = compute.get_flavor(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @flavor }\n end\n end",
"title": ""
},
{
"docid": "284a2cb82d21bb2c835bb48a661aec03",
"score": "0.6177925",
"text": "def show\n response = Aws.list_recipe(params[:id])\n render :json => response\n end",
"title": ""
},
{
"docid": "14d693cf3f3cb0ae415f586c011886f9",
"score": "0.61773896",
"text": "def variant\r\n return nil if variants?\r\n variants.first\r\n end",
"title": ""
},
{
"docid": "5adea0c8daaa073f8ae3dd01686c46b4",
"score": "0.61766964",
"text": "def show\n @genotype = Genotype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @genotype }\n end\n end",
"title": ""
},
{
"docid": "2366168749507520137adaea6c2d8455",
"score": "0.61668956",
"text": "def set_variant\n @variant = Variant.find(params[:id])\n end",
"title": ""
},
{
"docid": "2366168749507520137adaea6c2d8455",
"score": "0.61668956",
"text": "def set_variant\n @variant = Variant.find(params[:id])\n end",
"title": ""
},
{
"docid": "2366168749507520137adaea6c2d8455",
"score": "0.61668956",
"text": "def set_variant\n @variant = Variant.find(params[:id])\n end",
"title": ""
},
{
"docid": "2366168749507520137adaea6c2d8455",
"score": "0.61668956",
"text": "def set_variant\n @variant = Variant.find(params[:id])\n end",
"title": ""
},
{
"docid": "e91e5d3f9ef9e02b6a2e211249b2d409",
"score": "0.61144567",
"text": "def index\n @varieties = Variety.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @varieties }\n end\n end",
"title": ""
},
{
"docid": "e808e536539b486f24d3cd7bb916ae65",
"score": "0.6070095",
"text": "def get_skus\n if params[:id].present?\n @msg = 'nothing'\n respond_to do |format|\n format.json { render :json => {:variant => @msg }}\n return\n end\n end\n\n @product = Spree::Product.find(params[:product_id])\n self_parent = @product.variants.map(&:parent_id)\n self_parent << @product.master.id\n self_parent = self_parent.flatten\n @variant = params[:variant]\n @products = @product.seller.products.where(:is_approved=>true)\n @product_hash = []\n @products.each do |product|\n product_variants = []\n product_variants << (product.variants.present? ? product.variants : product.master)\n product_variants = product_variants.flatten\n product_variants.each do |pv|\n if !pv.parent_id.present? && !(self_parent.include? pv.id)\n if pv.option_values.present?\n @product_hash << {:name=> (product.name+\" -> \"+pv.option_values.first.presentation+\" (\"+pv.sku.to_s+\")\"), :id=>pv.id}\n else\n @product_hash << {:name=> (product.name+\" (\"+pv.sku.to_s+\")\"), :id=>pv.id}\n end\n end\n end\n end if @products.present?\n @variant = Spree::Variant.new(:product_id => @product.id)\n @variant.attributes = @variant.product.master.attributes.except('id', 'created_at', 'deleted_at',\n 'sku', 'is_master')\n # Shallow Clone of the default price to populate the price field.\n @variant.default_price = @variant.product.master.default_price.clone\n respond_to do |format|\n format.html { render :partial=>\"map_variant\", :locals => {:product => @product, :variant => @variant}}\n end\n end",
"title": ""
},
{
"docid": "7ce4ca11483b3ba79a60548fbcd94b8c",
"score": "0.6065148",
"text": "def set_variant\n @variant = Variant.find(params[:id])\n end",
"title": ""
},
{
"docid": "e19e516075355d2af249be0238cf9347",
"score": "0.60623044",
"text": "def show\n @volume_type = VolumeType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @volume_type }\n end\n end",
"title": ""
},
{
"docid": "19210ddea6e3a8d6d95c4ca55b670259",
"score": "0.6061089",
"text": "def show\n json_response(@api_v1_product)\n end",
"title": ""
},
{
"docid": "6b45b8410fe39428937801314c41c136",
"score": "0.6054634",
"text": "def show\n @virus = Virus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @virus }\n end\n end",
"title": ""
},
{
"docid": "30b645375c086fb0e53ac93a266b6c97",
"score": "0.605126",
"text": "def show\n params.require(%i[id])\n render json: Ingredient.find_by!(id: params[:id])\n end",
"title": ""
},
{
"docid": "818c6b616276a35e0503f1c9c412787b",
"score": "0.6049295",
"text": "def variants; end",
"title": ""
},
{
"docid": "a43c803a1ed48fd0223339cbf8718819",
"score": "0.60430455",
"text": "def show\n @product = Product.eager_loading.find_by_uuid(params[:id])\n\n respond_to do |format|\n format.html { redirect_to edit_shop_product_path(@product.shop_id, @product)}\n format.json { render json: @product.as_json(:include => {:product_variants => {:include => [:option_types,:pictures]}, :shipping_category => {}}, :methods => [:taxon_ids]) }\n end\n end",
"title": ""
},
{
"docid": "13bdf57538265401bf6fd805508ddbcf",
"score": "0.6042034",
"text": "def show\n mix = BreedMix.find(params[:id])\n render json: mix\n end",
"title": ""
},
{
"docid": "60528cd7ab53148df76a39e37b8f70e9",
"score": "0.6010871",
"text": "def index\n info = Aws.get_recipes_from_db\n render :json => info\n end",
"title": ""
},
{
"docid": "f699d246f6387355ac02221e0a8c8c12",
"score": "0.59625304",
"text": "def set_variant\n @product = Product.find(params[:product_id])\n @variant = @product.variants.new\n end",
"title": ""
},
{
"docid": "cd88c6128c2603eaa99927cb45db31ab",
"score": "0.5960255",
"text": "def show\n @voc = Voc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @voc }\n end\n end",
"title": ""
},
{
"docid": "da3b9d43944deaeafb2ebc265ef25282",
"score": "0.5930373",
"text": "def index\n @variations = Variation.all\n end",
"title": ""
},
{
"docid": "da3b9d43944deaeafb2ebc265ef25282",
"score": "0.5930373",
"text": "def index\n @variations = Variation.all\n end",
"title": ""
},
{
"docid": "74101571e8728411887d8ecd3d97a97d",
"score": "0.5928936",
"text": "def show\n render json: @choice\n end",
"title": ""
},
{
"docid": "4be66e9eb09681de3322b5ad1247bdbd",
"score": "0.5927262",
"text": "def show\n @vet = Vet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vet }\n end\n end",
"title": ""
},
{
"docid": "a8dc65c1d09d1e25366e4502129be5b4",
"score": "0.59148496",
"text": "def create\n @variant = @product.variants.new(params.require(:variant).permit!)\n @variant.price = params[:variant][:price]\n respond_to do |format|\n if @variant.save\n format.html { redirect_to admin_product_variants_url(@product), notice: 'Variant was successfully created.' }\n format.json { render action: 'show', status: :created, location: @variant }\n else\n format.html { render action: 'new' }\n format.json { render json: @variant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eec8464819982108f64598d3630e85aa",
"score": "0.5911904",
"text": "def show\n @version = Version.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @version }\n end\n end",
"title": ""
},
{
"docid": "bdf497599fb40624240aa3296126e939",
"score": "0.59047806",
"text": "def update\n respond_to do |format|\n if @variant.update(variant_params)\n format.html { redirect_to edit_admin_good_url(@variant.good, anchor: \"variants\"), notice: 'Variant was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @variant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f96963e683be0099a804f9769afdde5d",
"score": "0.5903692",
"text": "def variants\n variants = []\n self.cart.each do |variant_id|\n variants << Variant.find(variant_id)\n end\n variants.sort_by! { |variant| variant.category.id }\n end",
"title": ""
},
{
"docid": "9177cf5d4cee3b61cf40bf7fbf841df4",
"score": "0.5899507",
"text": "def create\n @variant = Variant.new(variant_params)\n @variant.good = @good\n\n respond_to do |format|\n if @variant.save\n format.html { redirect_to edit_admin_good_url(@variant.good, anchor: \"variants\"), notice: 'Variant was successfully created.' }\n format.json { render action: 'show', status: :created, location: @variant }\n else\n format.html { render action: 'new' }\n format.json { render json: @variant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fb433e4b4011325a671110c8f02f9603",
"score": "0.58983845",
"text": "def get_product_variant_options_config(id)\n @client.raw('get', \"/ecommerce/products/#{id}/variant-options-config\")\n end",
"title": ""
},
{
"docid": "5b72a01f00bc9a98f48da4c1e274938c",
"score": "0.5896328",
"text": "def associated_variants\n good.variants\n end",
"title": ""
},
{
"docid": "2deb6f8bb6e20497ab98e85e6733d9fc",
"score": "0.5893231",
"text": "def show\n @virtual_storage_array = VirtualStorageArray.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @virtual_storage_array }\n end\n end",
"title": ""
},
{
"docid": "5fbab0a732111b2d16e72db8b9f6db27",
"score": "0.58908826",
"text": "def destroy\n @variant.destroy\n respond_to do |format|\n format.html { redirect_to edit_admin_good_url(@variant.good, anchor: \"variants\") }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4006b79feab72d3da68d12533f0cef1c",
"score": "0.588329",
"text": "def show\n @item_selected_name = ItemSelectedName.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item_selected_name.item_revision }\n end\n end",
"title": ""
},
{
"docid": "4f38dcd52c38e493b3a4bc5bfcb1b39e",
"score": "0.58718735",
"text": "def show\n render json: @vat\n end",
"title": ""
},
{
"docid": "b05a9ed6e84e8c8af9989cdb3ed8e6ed",
"score": "0.5853925",
"text": "def gets(*several_variants)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "21f5eb219a68dad335ec544fe26eb360",
"score": "0.58479995",
"text": "def destroy\n @variant = Variant.find(params[:id])\n @variant.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_product_variants_url(@variant.master_id) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "46f93a2ee41e94f58d32980d2e651d9a",
"score": "0.58332074",
"text": "def show\n @vegetable = Vegetable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vegetable }\n end\n end",
"title": ""
},
{
"docid": "cbe3f5674432cdf52e02385753b37565",
"score": "0.5831771",
"text": "def update\n @variant = Variant.find(params[:id])\n\n respond_to do |format|\n if @variant.update_attributes(params[:variant])\n format.html { redirect_to admin_product_variants_path(@variant.master_id),\n notice: 'Variant was successfully updated.' }\n format.json { head :no_content }\n else\n @path = admin_product_variant_path(@variant.master_id, @variant)\n format.html { render action: \"edit\" }\n format.json { render json: @variant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc55fb953eb018ddb7b01a62feb72c5e",
"score": "0.5828043",
"text": "def new\n @product = Product.new\n @shop = current_user.shops.find_by_uuid(params[:shop_id])\n @product.product_variants.build\n\n respond_to do |format|\n format.html\n format.json { render json: @product}\n end\n end",
"title": ""
},
{
"docid": "04c46ade488615b8d006154046afd9e0",
"score": "0.5796992",
"text": "def show\n @verse = Verse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @verse }\n end\n end",
"title": ""
},
{
"docid": "04c46ade488615b8d006154046afd9e0",
"score": "0.5796992",
"text": "def show\n @verse = Verse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @verse }\n end\n end",
"title": ""
},
{
"docid": "04c46ade488615b8d006154046afd9e0",
"score": "0.5796992",
"text": "def show\n @verse = Verse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @verse }\n end\n end",
"title": ""
},
{
"docid": "1fa4775250626ebde9d930995840c851",
"score": "0.57789606",
"text": "def show\n @document = Document.where(:id => params[:id])\n render :json => @document, :include => [:versions]\n end",
"title": ""
},
{
"docid": "b19d90f2ca8f6561c10b16e4879214a5",
"score": "0.57741445",
"text": "def index\n @variations = Variation.all\nend",
"title": ""
},
{
"docid": "5a4e1b80d375d20fe45897faa24ae72c",
"score": "0.57712644",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @supervisions }\n end\n end",
"title": ""
},
{
"docid": "33793714aab2a36224b4c32f03e82dd4",
"score": "0.57705957",
"text": "def index\n if @indexer.present?\n @variations = @indexer.variations\n render json: @variations\n else\n render json: ErrorSerializer.to_404('Indexer'), status: :not_found\n end\n end",
"title": ""
},
{
"docid": "3503e75535ccbeba6849aee931bb6e9d",
"score": "0.5767929",
"text": "def index\n @api_v1_products = Product.all\n json_response(@api_v1_products)\n end",
"title": ""
},
{
"docid": "7638f26a37e4f9519bf8d1021cd14ca5",
"score": "0.5765864",
"text": "def load_variant\r\n @variant_id = cookies.delete(:load_variant)\r\n if @variant_id\r\n params[:id] = @variant_id\r\n end\r\n end",
"title": ""
},
{
"docid": "846c4df7438be4c7273a10e50c82fdcb",
"score": "0.5756488",
"text": "def show\n @version = Version.find(params[:id])\n @versionconfig= @version.version_configurations.all\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @version }\n end\n end",
"title": ""
},
{
"docid": "158ac24bebbed166cdd7a8f737ca66a2",
"score": "0.5752145",
"text": "def show\n @volume_type_extra_spec = VolumeTypeExtraSpec.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @volume_type_extra_spec }\n end\n end",
"title": ""
},
{
"docid": "d456a34c8070d6d50583b3b4d94ef06b",
"score": "0.57513136",
"text": "def index\n @product_variations = ProductVariation.all\n end",
"title": ""
},
{
"docid": "ffc91496019ba479ecd05d9a9803823c",
"score": "0.5738207",
"text": "def show\n \n @product = Product.find(params[:id])\n @vendors = @product.vendor(:all)\n #@vendors = Vendor.find(params[:id])\n #@vendors = Vendor.all\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end",
"title": ""
},
{
"docid": "a80ec6ed7cc32949a475ae753f9893bd",
"score": "0.5735743",
"text": "def index_bundle_selection\n @bundles = Bundle.order(:id).all\n\n respond_to do |format|\n format.html # index_bundle_selection.html.erb\n format.json { render json: @bundles }\n end\n end",
"title": ""
},
{
"docid": "418e8fd767a66dc4bbb18b4aba3729d0",
"score": "0.5729407",
"text": "def destroy\n @variant.destroy\n respond_to do |format|\n format.html { redirect_to admin_product_variants_url(@product) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a9c582d6c38a6400e2b56c0c62931fdb",
"score": "0.5728772",
"text": "def add_variants\n @report = CreditReportService.new(@user) unless @report\n cart = Cart.find_by_id(params[:cart_id]) || current_cart\n cart.add_variants params[:variant_numbers]\n @cart_calculator = CartProfit::CartCalculator.new(@cart)\n\n respond_to do |format|\n format.html { render :show }\n format.json { render json: {message: 'sucesso!'} }\n end\n end",
"title": ""
},
{
"docid": "2e89d4c09297497fde6d927887f2b3dd",
"score": "0.57250094",
"text": "def index\n @products = Spree::Product.not_deleted.includes(:variants).page(params[:page]).per(Spree::Config[:orders_per_page])\n respond_with @products\n end",
"title": ""
},
{
"docid": "ab439cc2041d43142f1b7b7c2053ed72",
"score": "0.57230026",
"text": "def flavors()\n return get_request(address(\"/flavors/detail\"), @token)\t\n end",
"title": ""
},
{
"docid": "0470f0f8e7c34f8ff8d0e31cf321deb8",
"score": "0.5719688",
"text": "def show\n @mostsmalltrapeffectinventory = Mostsmalltrapeffectinventory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mostsmalltrapeffectinventory }\n end\n end",
"title": ""
},
{
"docid": "c39631ac59c0f9a4237ce34cc34a4acc",
"score": "0.5717244",
"text": "def index\n @store = Store.find(params[:store_id])\n @dish_choices = @store.dish_choices\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dish_choices }\n end\n end",
"title": ""
},
{
"docid": "f37ca9d42e19d8a30b4edef348aa845f",
"score": "0.5710858",
"text": "def give_variants\n @variants.each.with_index(1).map { |variant, index| \"#{index}. #{variant}\" }.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "5d43c1f0d679f8aad1bcc6aa450d5121",
"score": "0.57090116",
"text": "def variant_params\n params.require(:variant).permit(:name)\n end",
"title": ""
},
{
"docid": "3f836673abbce70fde7dbe19570ebaef",
"score": "0.570607",
"text": "def show\n @sub_genre = SubGenre.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sub_genre }\n end\n end",
"title": ""
},
{
"docid": "fa3087efcce1d9ee39b42d703cfedaee",
"score": "0.5705979",
"text": "def new\n @variant_image = VariantImage.new\n @variant = Variant.find(params[:variant_id])\n @variant_image.variant_id = @variant.id\n @product = @variant.product\n\n respond_to do |format|\n format.html # new.html.erb\n format.js # new.js.erb\n format.json { render json: @variant_image }\n end\n end",
"title": ""
},
{
"docid": "4ed9ddfdc766964722945788e002f0a5",
"score": "0.5695948",
"text": "def show\n @api_version = ApiVersion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @api_version }\n end\n end",
"title": ""
},
{
"docid": "1c5d0330d35360a121eef0d6bc2e15f8",
"score": "0.5692261",
"text": "def show\n @sm_volume = SmVolume.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sm_volume }\n end\n end",
"title": ""
},
{
"docid": "c1131125291b7d642c8bc0fc87fddf57",
"score": "0.56919473",
"text": "def show\n render json: @product, status: 200\n end",
"title": ""
},
{
"docid": "5426b424fe55836323b7f1c5ca6314d9",
"score": "0.5688559",
"text": "def index\n @choices = Choice.all\n\n render json: @choices\n end",
"title": ""
},
{
"docid": "0586de656f20c0ad8e3fec80344e74b4",
"score": "0.56870675",
"text": "def show\n @brands = Brand.all\n @variants = Variant.all\n end",
"title": ""
},
{
"docid": "47313d1516e4c5119fba62d0a652a75f",
"score": "0.56869364",
"text": "def show\n @mixproducto = Mixproducto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mixproducto }\n end\n end",
"title": ""
},
{
"docid": "d20ea117b2d1178f507c54fe01cbfaf3",
"score": "0.5685781",
"text": "def show\n puts params[:id]\n @file_versions = FileVersion.where(versioned_file_id: params[:id]) \n #@file_versions = FileVersion.find(:versioned_file_id => params[:versioned_file_id])\n render json: @file_versions\n end",
"title": ""
},
{
"docid": "f2a7e856a45d6b6b2936ba225d6257c4",
"score": "0.5681743",
"text": "def show\n @store = Store.find(params[:store_id])\n @dish_choice = @store.dish_choices.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dish_choice }\n end\n end",
"title": ""
},
{
"docid": "e667d6ecd5ae956896f4e9bd2f698609",
"score": "0.56799877",
"text": "def show\n repo = assets_repo\n @v_asset = repo.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @v_asset }\n end\n end",
"title": ""
},
{
"docid": "8557951fe1c137ef1ef930ae605f48d9",
"score": "0.5678967",
"text": "def show\n @storage = @client.storages.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @storage }\n end\n end",
"title": ""
},
{
"docid": "6f4e94cb5b6f4e2976fa492104a6c3be",
"score": "0.5674987",
"text": "def show\n @gen = Gen.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gen }\n end\n end",
"title": ""
},
{
"docid": "7d3202aa9dec2bbe243d3abfc22b6f8d",
"score": "0.56744105",
"text": "def parent\n current_site.variants.find(params[:variant_id])\n end",
"title": ""
},
{
"docid": "f73d1b6040970b7084f8e60c058b14c7",
"score": "0.56634426",
"text": "def show\n @admin_version = Admin::Version.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_version }\n end\n end",
"title": ""
},
{
"docid": "b792a8666a17bf77cbeaf090ea1321df",
"score": "0.5657614",
"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": "66ccbf17c31a1d47d3a12a1560789c8d",
"score": "0.5644501",
"text": "def get_aos_version(args = {}) \n get(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "779535e7f95b2d12b3241ee25859c6e2",
"score": "0.0",
"text": "def set_source_string\n @source_string = SourceString.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339177",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60135007",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.59219855",
"text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5913137",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5913137",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.589884",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.5889191",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.58780754",
"text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "a80b33627067efa06c6204bee0f5890e",
"score": "0.5863248",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.58094144",
"text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end",
"title": ""
},
{
"docid": "33ff963edc7c4c98d1b90e341e7c5d61",
"score": "0.57375425",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.57285565",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.57149214",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.56900954",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.56665677",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.5651118",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.5648135",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.56357735",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.5627078",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.5608873",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.5598699",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.5598419",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.5589822",
"text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5558845",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5558845",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.55084664",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.5504379",
"text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end",
"title": ""
},
{
"docid": "dcf95c552669536111d95309d8f4aafd",
"score": "0.5465574",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.5464707",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.54471064",
"text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend",
"title": ""
},
{
"docid": "e3aadf41537d03bd18cf63a3653e05aa",
"score": "0.54455084",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.5437386",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.54160327",
"text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.5397424",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.5392518",
"text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "a468b256a999961df3957e843fd9bdf4",
"score": "0.5385411",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53794575",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5357573",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.53487605",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.5346655",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.53448105",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.5342072",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.5341318",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.53243506",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.53025913",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.5283114",
"text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end",
"title": ""
},
{
"docid": "1e1e48767a7ac23eb33df770784fec61",
"score": "0.5282289",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.52585614",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.52571374",
"text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end",
"title": ""
},
{
"docid": "fc88422a7a885bac1df28883547362a7",
"score": "0.52483684",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.5244467",
"text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.5236853",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.52330637",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.52300817",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.522413",
"text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.52226824",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.521999",
"text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end",
"title": ""
},
{
"docid": "8d7ed2ff3920c2016c75f4f9d8b5a870",
"score": "0.5215832",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.5213786",
"text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end",
"title": ""
},
{
"docid": "78ecc6a2dfbf08166a7a1360bc9c35ef",
"score": "0.52100146",
"text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end",
"title": ""
},
{
"docid": "2aba2d3187e01346918a6557230603c7",
"score": "0.52085197",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.5203262",
"text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end",
"title": ""
},
{
"docid": "691d5a5bcefbef8c08db61094691627c",
"score": "0.5202406",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.520174",
"text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end",
"title": ""
},
{
"docid": "d56f4ec734e3f3bc1ad913b36ff86130",
"score": "0.5201504",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51963276",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51963276",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "7fca702f2da4dbdc9b39e5107a2ab87d",
"score": "0.5191404",
"text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end",
"title": ""
},
{
"docid": "063b82c93b47d702ef6bddadb6f0c76e",
"score": "0.5178325",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.51765746",
"text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.5162045",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.5150735",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.5143402",
"text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end",
"title": ""
},
{
"docid": "c594a0d7b6ae00511d223b0533636c9c",
"score": "0.51415485",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.51398855",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "2fcff037e3c18a5eb8d964f8f0a62ebe",
"score": "0.51376045",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "111fd47abd953b35a427ff0b098a800a",
"score": "0.51318985",
"text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end",
"title": ""
},
{
"docid": "f2ac709e70364fce188bb24e414340ea",
"score": "0.5115387",
"text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.5109771",
"text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.5107364",
"text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend",
"title": ""
},
{
"docid": "f04fd745d027fc758dac7a4ca6440871",
"score": "0.5106081",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.51001656",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.50964546",
"text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end",
"title": ""
},
{
"docid": "076c761e1e84b581a65903c7c253aa62",
"score": "0.5093199",
"text": "def add_callbacks(base); end",
"title": ""
}
] |
62e481c04c0f2333e666ede17fcff3ba
|
Format the title of a custom section
|
[
{
"docid": "273dd92076122457e775f0dcd0f774bf",
"score": "0.7595",
"text": "def section(title)\n bold \"\\n#{title}\"\n end",
"title": ""
}
] |
[
{
"docid": "ad242515a0e0e90e8372107ac309cfe4",
"score": "0.82643986",
"text": "def section_title(title)\n self.separator \n puts title.colorize(:green) + \"\\n\\n\"\n end",
"title": ""
},
{
"docid": "35cfbb39c9ad7c5f9e7a5f3be5071577",
"score": "0.7437167",
"text": "def section_title(sec = self)\n sectnumlevels = document.attr(:sectnumlevels, 3).to_i\n\n if sec.numbered && !sec.caption && sec.level <= sectnumlevels\n [sec.sectnum, sec.captioned_title].join(' ')\n else\n sec.captioned_title\n end\n end",
"title": ""
},
{
"docid": "35cfbb39c9ad7c5f9e7a5f3be5071577",
"score": "0.7437167",
"text": "def section_title(sec = self)\n sectnumlevels = document.attr(:sectnumlevels, 3).to_i\n\n if sec.numbered && !sec.caption && sec.level <= sectnumlevels\n [sec.sectnum, sec.captioned_title].join(' ')\n else\n sec.captioned_title\n end\n end",
"title": ""
},
{
"docid": "a58ebbca6c3233555cbb0b7f109aabbf",
"score": "0.74259293",
"text": "def sectiontitle(value)\n merge(sectiontitle: value.to_s)\n end",
"title": ""
},
{
"docid": "a58ebbca6c3233555cbb0b7f109aabbf",
"score": "0.74259293",
"text": "def sectiontitle(value)\n merge(sectiontitle: value.to_s)\n end",
"title": ""
},
{
"docid": "a58ebbca6c3233555cbb0b7f109aabbf",
"score": "0.74259293",
"text": "def sectiontitle(value)\n merge(sectiontitle: value.to_s)\n end",
"title": ""
},
{
"docid": "fe6319c05bfa9764f3e476e5a19ac227",
"score": "0.7375621",
"text": "def section_title(sec = self)\n sectnumlevels = document.attr(:sectnumlevels, DEFAULT_SECTNUMLEVELS).to_i\n\n if sec.numbered && !sec.caption && sec.level <= sectnumlevels\n [sec.sectnum, sec.captioned_title].join(' ')\n else\n sec.captioned_title\n end\n end",
"title": ""
},
{
"docid": "fe6319c05bfa9764f3e476e5a19ac227",
"score": "0.7375621",
"text": "def section_title(sec = self)\n sectnumlevels = document.attr(:sectnumlevels, DEFAULT_SECTNUMLEVELS).to_i\n\n if sec.numbered && !sec.caption && sec.level <= sectnumlevels\n [sec.sectnum, sec.captioned_title].join(' ')\n else\n sec.captioned_title\n end\n end",
"title": ""
},
{
"docid": "fe6319c05bfa9764f3e476e5a19ac227",
"score": "0.7375621",
"text": "def section_title(sec = self)\n sectnumlevels = document.attr(:sectnumlevels, DEFAULT_SECTNUMLEVELS).to_i\n\n if sec.numbered && !sec.caption && sec.level <= sectnumlevels\n [sec.sectnum, sec.captioned_title].join(' ')\n else\n sec.captioned_title\n end\n end",
"title": ""
},
{
"docid": "fe6319c05bfa9764f3e476e5a19ac227",
"score": "0.7375621",
"text": "def section_title(sec = self)\n sectnumlevels = document.attr(:sectnumlevels, DEFAULT_SECTNUMLEVELS).to_i\n\n if sec.numbered && !sec.caption && sec.level <= sectnumlevels\n [sec.sectnum, sec.captioned_title].join(' ')\n else\n sec.captioned_title\n end\n end",
"title": ""
},
{
"docid": "46b5b4eac69bac974e2510b4d6ec498b",
"score": "0.7349941",
"text": "def section_title(sec = self)\r\n sectnumlevels = document.attr(:sectnumlevels, DEFAULT_SECTNUMLEVELS).to_i\r\n\r\n if sec.numbered && !sec.caption && sec.level <= sectnumlevels\r\n [sec.sectnum, sec.captioned_title].join(' ')\r\n else\r\n sec.captioned_title\r\n end\r\n end",
"title": ""
},
{
"docid": "46e085b9264cc3588421724a45c26a6f",
"score": "0.73366994",
"text": "def title\n \"#{modal_section_title if modal_section_title?} #{modal_sub_section_title if modal_sub_section_title?}\".lstrip.chop\n end",
"title": ""
},
{
"docid": "1f4b02ed04d58f19f292f8bdaafcbbe1",
"score": "0.72821015",
"text": "def format_title!\n output << md_h4(endpoint.title)\n end",
"title": ""
},
{
"docid": "54b074542af564a92e468ad904f5e545",
"score": "0.7208409",
"text": "def format_title\n @format_metadata&.dig(:tags, :title)\n end",
"title": ""
},
{
"docid": "a1c81328ec7bcb41605f6b8b0b6d41e0",
"score": "0.71973443",
"text": "def section_title(sec = self, drop_anchors: false)\n title =\n if sec.caption\n sec.captioned_title\n elsif sec.numbered && sec.level <= document.attr(:sectnumlevels, DEFAULT_SECTNUMLEVELS).to_i\n if sec.level < 2 && document.doctype == 'book' && %w[chapter part].include?(sec.sectname)\n signifier = document.attr(\"#{sec.sectname}-signifier\")\n sectnum = sec.sectname == 'part' ? sec.sectnum(nil, ':') : sec.sectnum\n \"#{signifier&.+ ' '}#{sectnum} #{sec.title}\"\n else\n \"#{sec.sectnum} #{sec.title}\"\n end\n else\n sec.title\n end\n\n if drop_anchors && title.include?('<a')\n title.gsub(/<(?:a[^>+]+|\\/a)>/, '')\n else\n title\n end\n end",
"title": ""
},
{
"docid": "02a1baf3aa4020db6ab06281626c1fb5",
"score": "0.71747655",
"text": "def section_title(sec = self)\n sectnumlevels = document.attr(:sectnumlevels, DEFAULT_SECTNUMLEVELS).to_i\n\n if sec.numbered && !sec.caption && sec.level <= sectnumlevels\n [sec.sectnum, sec.captioned_title].join(' ')\n else\n sec.captioned_title\n end\n end",
"title": ""
},
{
"docid": "03698508708b8887957a7785a6896673",
"score": "0.70558375",
"text": "def titled_section(title, options = {})\n relative_indentation = options[:relative] || 0\n verbose_prefix = options [:verbose_prefix] || ''\n if verbose?\n title(title, verbose_prefix, relative_indentation)\n else\n puts title\n end\n\n self.indentation_level += relative_indentation\n self.title_level += 1\n yield if block_given?\n self.indentation_level -= relative_indentation\n self.title_level -= 1\n end",
"title": ""
},
{
"docid": "5865ee6c91b756757833955f0a3e6d43",
"score": "0.70543575",
"text": "def titled_section(title, options = {})\n relative_indentation = options[:relative_indentation] || 0\n verbose_prefix = options[:verbose_prefix] || ''\n if config.verbose?\n title(title, verbose_prefix, relative_indentation)\n else\n puts title\n end\n\n self.indentation_level += relative_indentation\n self.title_level += 1\n yield if block_given?\n ensure\n self.indentation_level -= relative_indentation\n self.title_level -= 1\n end",
"title": ""
},
{
"docid": "1a4b442b0a9e583821cdd3c9c344dfc6",
"score": "0.701447",
"text": "def format_title(doc_hash)\n title = first_if_present doc_hash[\"Title\"]\n subtitle = first_if_present doc_hash[\"Subtitle\"]\n\n if subtitle.present?\n title = \"#{title}: #{subtitle}\"\n end\n\n return handle_highlighting( title )\n end",
"title": ""
},
{
"docid": "5ef4457b7494ab588c6adf131b3d2ef1",
"score": "0.69968414",
"text": "def section_name\n section_key.to_s.humanize.titleize\n end",
"title": ""
},
{
"docid": "85b3f2a8106158789a04a8495ebff643",
"score": "0.6931054",
"text": "def formatted_title\n formatted_title_with_times(start_at, end_at)\n end",
"title": ""
},
{
"docid": "c44a8f24f33ed08e2f5d21ed8807a89c",
"score": "0.69211465",
"text": "def section(title, verbose_prefix = '', relative_indentation = 0)\n if config.verbose?\n title(title, verbose_prefix, relative_indentation)\n elsif title_level < 1\n puts title\n end\n\n self.indentation_level += relative_indentation\n self.title_level += 1\n yield if block_given?\n ensure\n self.indentation_level -= relative_indentation\n self.title_level -= 1\n end",
"title": ""
},
{
"docid": "9e74293b334af1f57e4a5c19573451ef",
"score": "0.6915037",
"text": "def toc_title\n case name\n when \"mainBody\"\n \"Schedules\"\n when \"chapter\"\n title = in_schedules? ? \"Schedule\" : \"Chapter\" \n title << ' ' + num\n title << ' - ' + heading if heading\n title\n when \"part\"\n \"Part #{num} - #{heading}\"\n when \"section\"\n if not heading or heading.empty?\n \"Section #{num}\" \n elsif num\n \"#{num}. #{heading}\"\n else\n heading\n end\n end \n end",
"title": ""
},
{
"docid": "7c067fdfb8c81e014623186be2a255f6",
"score": "0.68937093",
"text": "def section_header\n \"[#{@name}]\"\n end",
"title": ""
},
{
"docid": "a84074b68982f01f71dc7092a0a0ba24",
"score": "0.68865883",
"text": "def section_title(nodes)\n node = nodes.first\n title = nil\n\n while node && defined?(node.parent)\n if node.name == 'sec'\n title_node = node.css('> title')\n title = title_node.text if title_node.present? && title_node.text\n end\n\n node = node.parent\n end\n\n title || '[Unknown]'\n end",
"title": ""
},
{
"docid": "211d09cf9fef2cfdd7304cb0b05c2ff1",
"score": "0.68168855",
"text": "def title_for_layout\n if @title.nil?\n \"Cannibook\"\n else\n \"#{@title} – Cannibook\"\n end\n end",
"title": ""
},
{
"docid": "35170841218fd9b2ff110c04ccfb7da8",
"score": "0.680517",
"text": "def section_label\n type = @section.sub(\"inthenews\", \"\")\n if type == \"newsitems\"\n type = \"news\"\n elsif type == \"contemporarypoets\"\n type = \"contemporary poets\"\n end\n type.titleize if type\n end",
"title": ""
},
{
"docid": "cbf3dd49384bdfd5368dafe8144182d8",
"score": "0.6794755",
"text": "def render_section(title)\n nrows, ncols = winsize\n width = width(title)\n\n rfil = [1, width - 5].max/2\n lfil = [1, width - 5 - rfil].max\n fleuron = '─' * lfil + ' /// ' + '─' * rfil\n\n render_center(\"#{fleuron}\\n\\n#{title}\\n\\n#{fleuron}\\n\")\nend",
"title": ""
},
{
"docid": "72f4842c4e840466c6dc0b88177bcdf8",
"score": "0.67862946",
"text": "def meta_title\n\t\twork.title + \" - \" + heading\n\tend",
"title": ""
},
{
"docid": "1ef4bb2a13b38eca0138f52cf1a566e2",
"score": "0.67858315",
"text": "def section(title, verbose_prefix = '', relative_indentation = 0)\n if verbose?\n title(title, verbose_prefix, relative_indentation)\n elsif title_level < 1\n puts title\n end\n\n self.indentation_level += relative_indentation\n self.title_level += 1\n yield if block_given?\n self.indentation_level -= relative_indentation\n self.title_level -= 1\n end",
"title": ""
},
{
"docid": "4b82e17408de6fbf5c25688c9a8e4fff",
"score": "0.6780656",
"text": "def title_heading\n build_html do\n h2.title do\n span do\n page_title\n end\n end\n end\n end",
"title": ""
},
{
"docid": "0f10364b7819a2d1afce4e2a8a5a9632",
"score": "0.6780446",
"text": "def format_title(title)\n length = @style.line_length || Bee::Util::term_width\n right = ' ' + @style.line_character*2\n size = length - (title.length + 4)\n size = 2 if size <= 0\n left = @style.line_character*size + ' '\n line = left + title + right\n # apply style\n formatted = @style.style(line, :target)\n return formatted\n end",
"title": ""
},
{
"docid": "b39637bb7fb7378e4cbf7d9e930a95e1",
"score": "0.6779718",
"text": "def comments_section_title\r\n \"I'm the talk of the town\"\r\n end",
"title": ""
},
{
"docid": "36c2a05c1209531ed018d88740142e96",
"score": "0.6727378",
"text": "def title\n if @title_text\n @title_text\n else\n if @title_without_prefix\n if @title_prefix\n \"#{@title_prefix} #{@title_without_prefix}\"\n else\n @title_without_prefix\n end\n end\n end\n end",
"title": ""
},
{
"docid": "a9670cc2a38ebd7e380a4d86d1100589",
"score": "0.6726729",
"text": "def section_heading\n \n ''\n \n end",
"title": ""
},
{
"docid": "36c2a05c1209531ed018d88740142e96",
"score": "0.67265123",
"text": "def title\n if @title_text\n @title_text\n else\n if @title_without_prefix\n if @title_prefix\n \"#{@title_prefix} #{@title_without_prefix}\"\n else\n @title_without_prefix\n end\n end\n end\n end",
"title": ""
},
{
"docid": "36c2a05c1209531ed018d88740142e96",
"score": "0.67265123",
"text": "def title\n if @title_text\n @title_text\n else\n if @title_without_prefix\n if @title_prefix\n \"#{@title_prefix} #{@title_without_prefix}\"\n else\n @title_without_prefix\n end\n end\n end\n end",
"title": ""
},
{
"docid": "e050cd6e3de0c996ac137dd146e44a1f",
"score": "0.6713826",
"text": "def title; [name,description].compact.join(\": \").to_s end",
"title": ""
},
{
"docid": "226142b40c8b0d4b5e5d4e8f62f01f68",
"score": "0.67103344",
"text": "def title\n \"\\##{id}: \\\"#{name}\\\"\"\n end",
"title": ""
},
{
"docid": "226142b40c8b0d4b5e5d4e8f62f01f68",
"score": "0.67103344",
"text": "def title\n \"\\##{id}: \\\"#{name}\\\"\"\n end",
"title": ""
},
{
"docid": "75d2d44d2ac181bd632d414a4aad65c7",
"score": "0.6702148",
"text": "def section_header\n \"Unamed section for \"#{self.class.name}.\"\n end",
"title": ""
},
{
"docid": "717cac6e6bd6b80d9bca6d1bc94f436c",
"score": "0.67009026",
"text": "def title_component; end",
"title": ""
},
{
"docid": "3077b0139ece782ab6b24bebe2672ad1",
"score": "0.6658276",
"text": "def event_title()\t\t\n\t\toption = Proc.new {|o| \"#{\"%.2f\" % o.hours} (#{(o.issue || o.project).event_title})\"}\t\t \n\t\tif option.is_a?(Proc)\n\t\t\toption.call(self)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "7881699a4e0b481ca1cbc8e165cf869d",
"score": "0.6646463",
"text": "def render_title(document, full = true)\n title_output = ''\n if document[blacklight_config.index.title_field.to_sym]\n title_output += document[blacklight_config.index.title_field.to_sym]\n title_output += \" : #{document[:title_info_primary_subtitle_tsi]}\" if document[:title_info_primary_subtitle_tsi] && full\n title_output += \". #{document[:title_info_partnum_tsi]}\" if document[:title_info_partnum_tsi]\n title_output += \". #{document[:title_info_partname_tsi]}\" if document[:title_info_partname_tsi]\n if document[:title_info_primary_trans_tsim] && full\n document[:title_info_primary_trans_tsim].each do |parallel_title|\n title_output += \" = #{parallel_title}\"\n end\n end\n else\n title_output = document.id\n end\n regex = /[^\\.]\\.\\.[^\\.]/ # double periods, but not ellipsis\n title_output.gsub!(/\\.\\./, '.') if title_output.match?(regex)\n title_output.squish\n end",
"title": ""
},
{
"docid": "6e670ebc98d71eb5a2b2001907c08b33",
"score": "0.6628971",
"text": "def nice_title\n (title || work[0].nice_title) + \" (#{publisher.name}, #{year})\"\n end",
"title": ""
},
{
"docid": "af628b7ccac96da437feecd18dea468a",
"score": "0.6625873",
"text": "def title\n header.value_replace_master(:title)\n end",
"title": ""
},
{
"docid": "27fa87d2a71ba93f7b3edf69ece37999",
"score": "0.66022366",
"text": "def title\n heading\n end",
"title": ""
},
{
"docid": "afd1c3dc0485e39c862739cf30b1d238",
"score": "0.6591606",
"text": "def section(title, verbose_prefix = '', relative_indentation = 0,\n titled = false)\n if verbose?\n title(title, verbose_prefix, relative_indentation)\n elsif title_level < 1 || titled\n puts title\n end\n\n @indentation_level += relative_indentation\n @title_level += 1\n yield if block_given?\n @indentation_level -= relative_indentation\n @title_level -= 1\n end",
"title": ""
},
{
"docid": "7c90d3f906be42bde6c7679607f0e15f",
"score": "0.65505874",
"text": "def heading\n\t\tname + \" #{generic_heading}\"\n\tend",
"title": ""
},
{
"docid": "a81ff08e2f2be065338c46038acb26ff",
"score": "0.65496033",
"text": "def title\n base_title =\"“Jugend musiziert” Nord- und Osteuropa\"\n # TODO: Append page title?\n # if @title.nil?\n # base_title\n # else\n # \"#{base_title} – #{@title}\"\n # end\n end",
"title": ""
},
{
"docid": "ed0192734cfb6f177b46fddcdfc81999",
"score": "0.6545219",
"text": "def title\n self.header\n end",
"title": ""
},
{
"docid": "ed0192734cfb6f177b46fddcdfc81999",
"score": "0.6545219",
"text": "def title\n self.header\n end",
"title": ""
},
{
"docid": "666113c6b5c40acdb2ace570461f9041",
"score": "0.654479",
"text": "def titleTest(index,object,section)\n endline = \"\\n\"\n sep = \"=================================================================\\n\"\n test = \"TEST [#{index}] #{object} : #{section}\\n\"\n \n puts endline + sep + test + sep\n end",
"title": ""
},
{
"docid": "f04a97aebc76e26544e265e780158c35",
"score": "0.65393424",
"text": "def augmented_title\n if ( self.project )\n if ( self.project.customer )\n return \"#{ self.project.customer.title } - #{ self.project.title }: #{ self.title }\"\n end\n\n return \"#{ self.project.title }: #{ self.title }\"\n end\n\n return \"#{ self.title }\"\n end",
"title": ""
},
{
"docid": "ccf2bc9196ddee21d43658a269522030",
"score": "0.6538782",
"text": "def nice_title\n (title || works[0].nice_title) + \n \" (#{publisher.name}, #{year})\"\n end",
"title": ""
},
{
"docid": "d3de65893257296ed6e1b64ecac051b5",
"score": "0.65290797",
"text": "def section_title(id, hidden = true, text = nil, info_text = nil)\n text = id.to_s.split(\"_\").last.capitalize if text.nil?\n content_tag(\"div\", class: \"subtitle show_attributes\") do\n content = link_to(\"<small>#{hidden ? '►' : '▼'}</small> #{sanitize text}\".html_safe,\n url_for(controller: :home, action: :toggle, id: id),\n remote: true,\n onclick: \"crm.flip_subtitle(this)\")\n content << content_tag(\"small\", info_text.to_s, class: \"subtitle_inline_info\", id: \"#{id}_intro\", style: hidden ? \"\" : \"display:none;\")\n end\n end",
"title": ""
},
{
"docid": "fa86ed0ab0ebfb0a4ad15ee086c30e2b",
"score": "0.6508876",
"text": "def marc_index_title(document)\n title_line = marc_presenter(document, :title).lines[0]\n subtitle_line = marc_presenter(document, :sub_title).lines[0]\n\n title = (title_line ? title_line.join : \"Unknown\")\n subtitle = (subtitle_line ? subtitle_line.join : nil)\n\n if subtitle\n title = title + \": \" + subtitle\n end\n return title\n end",
"title": ""
},
{
"docid": "8d7fe0f23e5d9dc17f49bd72250f7e4a",
"score": "0.65053964",
"text": "def title\n base_title = \"Information Centre.\"\n if @title.nil?\n base_title\n else\n \"#{@title} | #{base_title}\"\n end\n end",
"title": ""
},
{
"docid": "203dae22e32644481375b3fd575bda21",
"score": "0.65043104",
"text": "def display_title\n display_title = ''\n if self.event_title and !self.event_title.empty?\n display_title = self.event_title\n else\n display_title = \"Scene #{self.segment_position}\"\n end\n display_title\n end",
"title": ""
},
{
"docid": "48123e156510fe5957431bd066cc38ad",
"score": "0.64974976",
"text": "def title\n out = name.capitalize\n out << \" (#{note})\" if note\n out\n end",
"title": ""
},
{
"docid": "c9c8cc2a524683617be266624225848b",
"score": "0.64955306",
"text": "def section\n return '' unless self.primary_section\n if primary_section.parent\n [primary_section.parent.title, primary_section.title].join ':'\n else\n primary_section.title\n end\n end",
"title": ""
},
{
"docid": "24a53c13ced54d81852be3a0f47c731e",
"score": "0.64859533",
"text": "def title\n I18n.t('woople_theme.assessment.name')\n end",
"title": ""
},
{
"docid": "eb3a6691ad1872546a0dcdd4f3c32b54",
"score": "0.6482852",
"text": "def title(part_one, part_two = 'MRHS Photo')\n if part_one.to_s == part_two\n content_for :title, part_one.to_s\n else\n content_for :title, \"#{part_one} | #{part_two}\"\n end\n end",
"title": ""
},
{
"docid": "b09b18248068791a2ab2be1844f0ca4d",
"score": "0.6481188",
"text": "def title\n \"#{fetch('name.title.descriptor')} #{fetch('name.title.level')} #{fetch('name.title.job')}\"\n end",
"title": ""
},
{
"docid": "402359013a379fa875650b35c5d715fa",
"score": "0.6477914",
"text": "def title(tag)\n UI.bold { \"%15s\" % tag }\n end",
"title": ""
},
{
"docid": "e8bc9df6bf4377409a9fc4301b01478d",
"score": "0.6475194",
"text": "def display_title(document)\n if document['subtitle_display']\n return document['title_display'].join(\" : \") << \" : \" << document['subtitle_display'].join(\" : \") \n else\n if document['alt_title_display']\n return document['title_display'].join(\" : \") << \" : \" << document['alt_title_display'].join(\" : \")\n else\n return document['title_display'].join (\" : \")\n end\n end\n end",
"title": ""
},
{
"docid": "3ccbd3fed8d68e9f73ef47d8cc567dba",
"score": "0.6456951",
"text": "def title\n if song.count_sections(type) <= 1\n type\n else\n \"#{type} #{(variation + 9).to_s(36).upcase}\"\n end\n end",
"title": ""
},
{
"docid": "e2eebafb2ae79403354e3dab009b75a1",
"score": "0.6452745",
"text": "def title\n self[:title]\n .gsub('&', '&')\n .gsub(\"(#{format} #{number})\", '')\n .strip\n end",
"title": ""
},
{
"docid": "ba828559e3215cd3278e2ae31d47bf0b",
"score": "0.64519405",
"text": "def title title\n @title_parts ||= []\n @title_parts.unshift h(title)\n ''\n end",
"title": ""
},
{
"docid": "3d9b0e2eb23af845599e1b5943b56cc4",
"score": "0.6449424",
"text": "def generate_title\n if self.works.any?\n workname = self.works.first.name\n elsif self.artists.any?\n workname = self.artists.first.name\n else\n workname = self.type.singular\n end\n\n\n \n \tself.title = workname + \" @ \" + self.venue.name\n end",
"title": ""
},
{
"docid": "eda4d77ad827bac1cc5b0932d84c1516",
"score": "0.64473414",
"text": "def doctitle\n if !(title = @attributes.fetch('title', '')).empty?\n title\n elsif !(sect = first_section).nil? && sect.title?\n sect.title\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "9c30f46a702504c4154e29c984324942",
"score": "0.64438564",
"text": "def title title_name\n @config_data.title = title_name\n end",
"title": ""
},
{
"docid": "3114bb4bcbe203b0b71699a3f72ee294",
"score": "0.64406776",
"text": "def title( title )\n output[:title] = title.to_s\n self\n end",
"title": ""
},
{
"docid": "858ecd39884a013ce4445b77ec4d173b",
"score": "0.6438284",
"text": "def full_title\n name\n end",
"title": ""
},
{
"docid": "1881e0886fb01dad5df143be3682e495",
"score": "0.6435987",
"text": "def title format=:full\r\n first_part = self.subject_code + \" \" + self.number\r\n if self.credit > 0\r\n first_part << \"-\" + self.credit.to_s\r\n end \r\n return first_part + \" \" + self.name if format==:full\r\n return first_part \r\n end",
"title": ""
},
{
"docid": "86852c05a7feb339dd98d1bda07641f4",
"score": "0.64311117",
"text": "def short_title\n \"#{dept_abbrev.to_s.strip} #{course_no.to_s.strip} #{section_id.to_s.strip}\"\n end",
"title": ""
},
{
"docid": "a979468c68cb884910369874e9478d20",
"score": "0.6427776",
"text": "def title\n return @title if @title\n\n if @header\n @title = @header.title || @header.name\n elsif @elements.first\n @title = @elements.first.title\n # Blocks don't have a :name method, but Sections do\n @title ||= @elements.first.name if @elements.first.respond_to? :name\n end\n\n @title\n end",
"title": ""
},
{
"docid": "ed644878b1c6f78948c49dc2389c2278",
"score": "0.642645",
"text": "def title\n base_title = \"Echo 360 Custom Interface\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{h(@title)}\"\n end\n end",
"title": ""
},
{
"docid": "e76c87d3ed15d8481a37b199df9491c9",
"score": "0.6423906",
"text": "def title\n if @title.presence\n \"#{BASE_TITLE} | #@title\"\n else\n BASE_TITLE\n end\n end",
"title": ""
},
{
"docid": "eb1a9a38f4bfc51405d13f58c26fb0c3",
"score": "0.64222836",
"text": "def title() @name; end",
"title": ""
},
{
"docid": "65a0b1fc081a6c247ce7d20de4ec1f75",
"score": "0.6417345",
"text": "def title_component=(_arg0); end",
"title": ""
},
{
"docid": "dfc9372cf337bf3241e02a9d580cdb2c",
"score": "0.6417066",
"text": "def header(title, level)\n participatory_text_level = if level > 1\n Decidim::Opinions::ParticipatoryTextSection::LEVELS[:sub_section]\n else\n Decidim::Opinions::ParticipatoryTextSection::LEVELS[:section]\n end\n\n create_opinion(title, title, participatory_text_level)\n\n @num_sections += 1\n title\n end",
"title": ""
},
{
"docid": "40a7d14e111ca61a8dfc0f2f3d5a91e7",
"score": "0.641637",
"text": "def section(title = nil, options = {}, &block)\n #must be overwritten in inerit classes\n end",
"title": ""
},
{
"docid": "020547081f73a677bc6e99b150426811",
"score": "0.64157313",
"text": "def slide_title\n title = @line[/^ *## (.*)/, 1]\n title.nil? ? nil : title.sub(/##/, '').strip\n end",
"title": ""
},
{
"docid": "c44b846aa5c9b7d91a78d4a3204a667a",
"score": "0.6413993",
"text": "def display_title(title)\n title.to_s.gsub(/(\\d{2})(\\d{2})(\\d{2})/, '\\1:\\2:\\3')\n end",
"title": ""
},
{
"docid": "1ec2723cb88e5ab9b5192e20dc8b5561",
"score": "0.6406618",
"text": "def title(element)\n parent = element.parent\n title = nil\n\n while parent\n if parent.name =~ /^h\\d/\n title = parent\n break\n elsif parent.name == 'section'\n if parent.first_element_child.name =~ /^h\\d/\n title = parent.first_element_child\n break\n end\n end\n parent = (parent.parent if parent.respond_to? :parent)\n end\n\n if title and not title['id']\n title['id'] = title.text.downcase.gsub(/\\W+/, '-')\n end\n\n title\nend",
"title": ""
},
{
"docid": "cc4849f90e546a9a35417960222b4b75",
"score": "0.6405531",
"text": "def display_title\n puts @figlet['ASSIGNMENT 2 PART 2']\n puts \"by Tam Minh TRAN - S1499037\\n\\n\"\n end",
"title": ""
},
{
"docid": "4fe1f6eb6934d71c5c2702f21104ff9a",
"score": "0.64054406",
"text": "def title\n base_title = \"POVRay Shortcode Contest\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end",
"title": ""
},
{
"docid": "1176d2bfa16c3523bd86f1558d270b25",
"score": "0.64047563",
"text": "def title\n base_title = \"Student Banking Solution\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end",
"title": ""
},
{
"docid": "d09f96ec4da4fc9c239cac57e4da2a73",
"score": "0.6399622",
"text": "def title \n titleize(@title)\n end",
"title": ""
},
{
"docid": "645d4183e17145c009a956fa1d81dea1",
"score": "0.63988143",
"text": "def formatted_title\n formatted_title_with_times(start_at_as_current_week_date, end_at_as_current_week_date)\n end",
"title": ""
},
{
"docid": "f3959be4ba1612b2f49fd1cd171a2c89",
"score": "0.6397172",
"text": "def title\n return @template.title if @template.customization_of.blank?\n\n \"#{@template.title} - with additional questions for #{@template.org.name}\"\n end",
"title": ""
},
{
"docid": "ce18cd0367c2ec6ea51fc121015d1fb6",
"score": "0.6389807",
"text": "def heading\n\t\ttitle\n\tend",
"title": ""
},
{
"docid": "47e91759b9adbe1662722334c3f1954b",
"score": "0.63882416",
"text": "def full_title\n \"#{title_was} (#{year_was})\"\n end",
"title": ""
},
{
"docid": "7b1338731646b3083a85b3f7deec5bc4",
"score": "0.638662",
"text": "def section label\n text =<<TEXT\n\n\n # Section: #{label}\nTEXT\n end",
"title": ""
},
{
"docid": "5fc7e18d9d7427e865a1d4717f1b9349",
"score": "0.6385351",
"text": "def full_title\n \"#{curriculum.full_name rescue nil || dept_abbrev.to_s.strip} #{course_no.to_s.strip} #{section_id.to_s.strip}\"\n end",
"title": ""
},
{
"docid": "3e3c6f8d6c65daca2e1f0d17a35b7d77",
"score": "0.6384814",
"text": "def title() @metadata['title'] end",
"title": ""
},
{
"docid": "a836a2c607472188f55da3a759018a71",
"score": "0.6381695",
"text": "def title(title)\n content_for(:title) { title }\n end",
"title": ""
},
{
"docid": "b59549917035077412510ba1f79f8b8f",
"score": "0.6376347",
"text": "def display_title\n self.title.present? ? self.title : self.description.squeeze[0,40]\n end",
"title": ""
},
{
"docid": "44a9ceb2327a6b70940625c5de823ad3",
"score": "0.6373993",
"text": "def plain_html\n @title || 'Top Section'\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "8e0d972c59a7ab1b6309e6dec3117a0d",
"score": "0.0",
"text": "def set_db_repl_type\n @db_repl_type = DbReplType.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60328794",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6017492",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.59215194",
"text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5914111",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5914111",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.5899049",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.58896494",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58892167",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58892167",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58892167",
"text": "def actions; end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.5877696",
"text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "a80b33627067efa06c6204bee0f5890e",
"score": "0.58623844",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.58087915",
"text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end",
"title": ""
},
{
"docid": "33ff963edc7c4c98d1b90e341e7c5d61",
"score": "0.57389474",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.5730983",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.5715401",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.57057375",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.5693375",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.56700915",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.56519705",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.56497645",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.56386065",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.5626162",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.56089616",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.55999124",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.5598728",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.55892825",
"text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5561578",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5561578",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.5507942",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.5504877",
"text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.54678446",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "dcf95c552669536111d95309d8f4aafd",
"score": "0.5465615",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.5447922",
"text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend",
"title": ""
},
{
"docid": "e3aadf41537d03bd18cf63a3653e05aa",
"score": "0.5445043",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.54408455",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.54166174",
"text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.54101455",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.54101455",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.5400783",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.53951085",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.53951085",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.53928316",
"text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end",
"title": ""
},
{
"docid": "a468b256a999961df3957e843fd9bdf4",
"score": "0.53882515",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.5378493",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.53563684",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.53487724",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.53475606",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.5346719",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.53449047",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.5341026",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.53280306",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.5304286",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.5285627",
"text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end",
"title": ""
},
{
"docid": "1e1e48767a7ac23eb33df770784fec61",
"score": "0.5280701",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.52592444",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.5259056",
"text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end",
"title": ""
},
{
"docid": "fc88422a7a885bac1df28883547362a7",
"score": "0.524796",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.52446073",
"text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.52396107",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5237911",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5237911",
"text": "def action; end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.5232248",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.5227526",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.52237874",
"text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.52221715",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.52199185",
"text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end",
"title": ""
},
{
"docid": "8d7ed2ff3920c2016c75f4f9d8b5a870",
"score": "0.52144027",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.5213464",
"text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end",
"title": ""
},
{
"docid": "78ecc6a2dfbf08166a7a1360bc9c35ef",
"score": "0.5209238",
"text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end",
"title": ""
},
{
"docid": "2aba2d3187e01346918a6557230603c7",
"score": "0.52063036",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "d56f4ec734e3f3bc1ad913b36ff86130",
"score": "0.52041465",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.52032995",
"text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.5203285",
"text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end",
"title": ""
},
{
"docid": "691d5a5bcefbef8c08db61094691627c",
"score": "0.52010477",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51944184",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51944184",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "7fca702f2da4dbdc9b39e5107a2ab87d",
"score": "0.5193428",
"text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end",
"title": ""
},
{
"docid": "063b82c93b47d702ef6bddadb6f0c76e",
"score": "0.5179032",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.5177801",
"text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5173085",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5173085",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5173085",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.5163755",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.51540434",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.51432824",
"text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end",
"title": ""
},
{
"docid": "c594a0d7b6ae00511d223b0533636c9c",
"score": "0.514179",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "2fcff037e3c18a5eb8d964f8f0a62ebe",
"score": "0.5139888",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.5138596",
"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": "111fd47abd953b35a427ff0b098a800a",
"score": "0.5133951",
"text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end",
"title": ""
},
{
"docid": "f2ac709e70364fce188bb24e414340ea",
"score": "0.5115057",
"text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5113431",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.51112926",
"text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5109581",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5109581",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5109581",
"text": "def action\n end",
"title": ""
},
{
"docid": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.5106878",
"text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend",
"title": ""
},
{
"docid": "f04fd745d027fc758dac7a4ca6440871",
"score": "0.510421",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.5098929",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.5095888",
"text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end",
"title": ""
},
{
"docid": "076c761e1e84b581a65903c7c253aa62",
"score": "0.5095568",
"text": "def add_callbacks(base); end",
"title": ""
}
] |
91976820ad31fc316a0ffc06bd0e31f5
|
scrapes the most recent 50 listings
|
[
{
"docid": "11c069723c47d089cf60a0f71f8d4851",
"score": "0.5871911",
"text": "def scrape_recent_jobs\n scrape_data_from_url(@base_url)\n end",
"title": ""
}
] |
[
{
"docid": "8366d28021f45a080f8191cf3254b362",
"score": "0.69720465",
"text": "def recent_Listings #for homepage\n UserBook.all(limit: 5)\n end",
"title": ""
},
{
"docid": "a2adfb8ff0ac37a15170feade2c275f8",
"score": "0.6885015",
"text": "def getListings(count)\n rcount = 0\n results = []\n url_token = \"\" #Stores additional query tokens\n\n while rcount < count\n feed = RSS::Parser.parse(open(@base_url + url_token).read, false)\n feed.items.each_with_index do |item, index|\n break if index+rcount > count\n\n item = {\n title: item.title,\n price: getPrice(item.title),\n issue_date: item.date\n }\n\n results.push(item)\n rcount += 1\n end\n\n url_token = \"&s=#{rcount}\"\n end \n\n return results\n end",
"title": ""
},
{
"docid": "2ddd6f8995d76c2e71d7ad323f1298fb",
"score": "0.66691554",
"text": "def find_recent_listings(limit)\n features.order(\"#{ListingFeature.quoted_table_name}.created_at DESC\").limit(limit).\n includes(:listing).map(&:listing)\n end",
"title": ""
},
{
"docid": "d10002e1e4b828f3612853f0890dae9b",
"score": "0.66301215",
"text": "def get_all_feeds\n self.long_feed=[]\n feedpage=@koala_client.get_connections(self.uid, \"feed\", {\"limit\"=>\"100\"})\n self.long_feed+=feedpage\n (1..50).map do |page|\n puts \"pulling first #{page}00 feeds, new\"\n begin\n feedpage=feedpage.next_page\n rescue\n puts \"==== Koala facebook error occurred\"\n bread\n end\n\n break if feedpage.empty?\n self.long_feed+=feedpage\n end\n puts \"======pulled #{self.long_feed.length} feeds\"\n save!\n end",
"title": ""
},
{
"docid": "1d8bdf8ea7fadd6171be6d37abe07ec5",
"score": "0.6566516",
"text": "def top_playlists(count=50)\n current_site.top_playlists.all(:limit => count, :order => 'total_requests DESC')\n end",
"title": ""
},
{
"docid": "ab7e2743f6d6f2d0c2281fbdcba395d0",
"score": "0.6451703",
"text": "def find_top\n return @all_listings.tops\n end",
"title": ""
},
{
"docid": "ab7e2743f6d6f2d0c2281fbdcba395d0",
"score": "0.6451703",
"text": "def find_top\n return @all_listings.tops\n end",
"title": ""
},
{
"docid": "38d1e816a246b07dcc02f0dbbda9b793",
"score": "0.63725686",
"text": "def index\n if params[:query].nil?\n @listings = Listing.all.order(\"created_at DESC\")\n else\n @listings = Listing.search_listing(params[:query]).order(\"created_at DESC\")\n end\n @listing_five = Listing.find(5)\n end",
"title": ""
},
{
"docid": "062e493ecb37eff6e9d5709528d8d203",
"score": "0.6344711",
"text": "def get_listings sub\n uri = URI(\"#{base_uri}/r/#{sub}/new.json\")\n params = { limit: 100 }\n uri.query = URI.encode_www_form(params)\n JSON.parse(Net::HTTP.get_response(uri).body)\n end",
"title": ""
},
{
"docid": "c185bdbb14cdd9448dd0305b0e5b10ec",
"score": "0.62745076",
"text": "def get_latest_five_songs\n @latest_songs = Song.recent(5)\n end",
"title": ""
},
{
"docid": "e8a59f41279753d3f2d72478a9de66cb",
"score": "0.62482727",
"text": "def get_top\n url = base_url + 'cryptocurrency/listings/latest'\n fetch_data(url)\n end",
"title": ""
},
{
"docid": "399858e40502d0de9ef941e251437085",
"score": "0.62389",
"text": "def recent_feed_items(limit = 100)\n feed_items.order('created_at DESC').limit(limit)\n end",
"title": ""
},
{
"docid": "399858e40502d0de9ef941e251437085",
"score": "0.62389",
"text": "def recent_feed_items(limit = 100)\n feed_items.order('created_at DESC').limit(limit)\n end",
"title": ""
},
{
"docid": "399858e40502d0de9ef941e251437085",
"score": "0.62389",
"text": "def recent_feed_items(limit = 100)\n feed_items.order('created_at DESC').limit(limit)\n end",
"title": ""
},
{
"docid": "c22d7e314ff63cea7644123206686143",
"score": "0.62304974",
"text": "def latest_entries(n)\n Entry.find(:all, :order => 'created_at DESC', :limit => n)\n end",
"title": ""
},
{
"docid": "8888ea0ae37b52513ba5bb62308446bb",
"score": "0.62089854",
"text": "def find_top\n return @listings.tops\n end",
"title": ""
},
{
"docid": "adf10971e04b2f4b5ca2b8158592b30c",
"score": "0.6171346",
"text": "def refresh_listings\n while next_page_link do\n scrape_house_listings\n # sleep for a second so we don't kill daft\n sleep 1\n @agent.user_agent_alias = random_agent\n next_page_link.click\n end\n end",
"title": ""
},
{
"docid": "c6c489544a143f1dc968b31ec7c0265f",
"score": "0.61628264",
"text": "def top_feed_listings(options = {})\n limit = options.fetch(:limit, -1)\n existing_likes = self.likes(limit: -1, type: :listing, attr: [:listing_id]).map(&:listing_id).compact.to_set\n unliked_feed_likes_by_listing = likers_by_listing.reject { |k, v| existing_likes.include?(k) }\n listings = Listing.active.where(id: unliked_feed_likes_by_listing.map(&:first)).\n group_by(&:seller_id).values.map(&:first).\n sort_by { |l| -unliked_feed_likes_by_listing[l.id].count }.\n slice(0..(limit - 1))\n listings.each_with_object({}) { |l, m| m[l] = unliked_feed_likes_by_listing[l.id] }\n end",
"title": ""
},
{
"docid": "38e32beca36ab4d12479fee25e8049ed",
"score": "0.61246604",
"text": "def pullItems\n (1..80).each do |num|\n begin\n feed = Nokogiri::XML(open('https://edwardsnowden.com/feed?paged='+num.to_s))\n feed.xpath('//item').each do |i| \n item_parsed = parseItem(i)\n if item_parsed[:categories].include? \"Revealed documents\"\n @results.push(parseItem(i))\n end\n end\n rescue\n end\n end\n \n JSON.pretty_generate(@results)\n end",
"title": ""
},
{
"docid": "6120cb254757d6234f83619e2b152856",
"score": "0.60985935",
"text": "def find_most_recent_for_listings(listing_ids, options = {})\n limit = options[:limit] || 1\n with_redis(default_data: {}) do |redis|\n if user_id = options[:interested_user_id]\n interesting_listings = Set.new(redis.smembers(interest_key(user_id, :l)).map {|m| m.split(':').last.to_i})\n interesting_actors = Set.new(redis.smembers(interest_key(user_id, :a)).map {|m| m.split(':').last.to_i})\n\n listing_ids.each_with_object({}) do |id,map|\n key = format_key(:c, :l, id)\n # if the listing is interesting, or there is no chance of finding an interesting actor, just load the\n # most recent stories\n if interesting_listings.member?(id) || interesting_actors.count == 0\n map[id] = redis.zrevrange(key, 0, limit - 1).map {|s| decode(s)}\n else\n # otherwise, we want to find the most recent story from an interesting actor, which means we need\n # to load all the stories and search through them\n stories = redis.zrevrange(key, 0, -1)\n # searching optimized for a limit of 1, because i can't find anywhere we use any other limit\n if limit == 1\n story = stories.find(lambda {stories.first}) {|s| interesting_actors.member?(decode(s).actor_id)}\n map[id] = [decode(story)] if story\n else\n preferred, other = stories.map {|s| decode(s)}.partition do |story|\n interesting_actors.member?(story.actor_id)\n end\n map[id] = preferred.concat(other).slice(0, limit)\n end\n end\n end\n else\n # if there's no user to worry about, just return the most recent :limit story/stories for each listing\n listing_ids.each_with_object({}) do |id, map|\n map[id] = redis.zrevrange(format_key(:c, :l, id), 0, limit - 1).map {|s| decode(s)}\n end\n end\n end\n end",
"title": ""
},
{
"docid": "d9eef92a923439cfd7149b3986de0720",
"score": "0.6061122",
"text": "def get_top_10_stories\n RedisWrapper.new.get_last_10_stories\n end",
"title": ""
},
{
"docid": "c00555d53222377905abb82cf8dace62",
"score": "0.6053349",
"text": "def latest_observations\n observations.limit(10)\n end",
"title": ""
},
{
"docid": "5dc56fc304234d92d5796683deb4ee2b",
"score": "0.6026088",
"text": "def list_latest\n create_list(:latest, {}, latest_results)\n end",
"title": ""
},
{
"docid": "cdba8a4639b5a3b4659a4b7972ac17e3",
"score": "0.6007953",
"text": "def process_list what, username, web\n puts \"Fetching #{what} page 1...\"\n\n url = \"http://www.foodspotting.com/#{username}/#{what}\"\n web.get url\n\n last_page = get_last_page web\n names = get_names web\n\n (2..last_page).each { |page|\n puts \"Fetching #{what} page #{page}...\"\n web.get \"#{url}?page=#{page}\"\n\n names += get_names web\n }\n\n names\nend",
"title": ""
},
{
"docid": "749c4563f7c283f55edc0195c2d05a63",
"score": "0.5981733",
"text": "def listings(options = {})\n # max results is more like \"results per page\"\n options[:max_results] ||= 100\n options[:format] ||= \"basic\"\n\n sort_column = options.delete(:sort)\n sort_direction = options.delete(:sort_direction)\n # -price_min for price_min, descending etc..\n options[:sort_order] = \"#{\"-\" if sort_direction == :desc}#{sort_column}\" if sort_column.present?\n\n listings = []\n more = true\n offset = 0\n\n while more do\n result = request(:get, \"listings\", options)\n\n listings = listings + result[\"listings\"]\n\n offset = offset + options[:max_results]\n options[:offset] = offset\n\n more = result[\"more\"]\n end\n\n listings\n end",
"title": ""
},
{
"docid": "c201bf1406c09cc80de41a24f00e1bee",
"score": "0.5975536",
"text": "def index\n @listings = Listing.includes(:neighborhood, :listing_agent, :sales_agent)\n .page(params[:page])\n .per(100)\n .order(updated_at: :desc)\n end",
"title": ""
},
{
"docid": "c74a6cb8ec332b7fddfa27330e4b97b2",
"score": "0.59624416",
"text": "def rank_new_500_stories\n newest_500_ids = get_500_new_stories\n \n newest_500 = []\n newest_500_ids.each_with_index do |id|\n newest_500 << get_story_item(id)\n end\n \n # rank the retrieved story by its avg_score_over_time\n newest_500.sort_by!{ |story| -story.avg_score_over_time }\n \n RedisWrapper.new.push_stories(newest_500)\n \n # decide new lifetime top story between existing lifetime top story (if any) and the new one with highest score\n find_new_top_story(newest_500[0])\n \n end",
"title": ""
},
{
"docid": "837ed8b638b8a949c242525a171cb35f",
"score": "0.5955762",
"text": "def first_50_tweets_lst\n # return an array of hash\n newest_50_queue = \"newest50queue\"\n if(!$redis.exists(newest_50_queue) || ($redis.llen(newest_50_queue) <= 40))\n sql = \"SELECT T.id, T.content, T.created_at, T.retweet_id, T.has_comment, U.username FROM tweets AS T, users AS U WHERE T.user_id = U.id ORDER BY T.created_at DESC LIMIT 50\"\n records_array = ActiveRecord::Base.connection.execute(sql)\n rt = tweet_array_to_hash(records_array, false)\n rt.each do |tweet|\n $redis.rpush(newest_50_queue, tweet.to_json)\n end\n end\n\n array_of_jsons = $redis.lrange( \"newest50queue\",0,49)\n rt_array = Array.new\n array_of_jsons.each do |js|\n rt_array << JSON.parse(js)\n end\n\n return rt_array\nend",
"title": ""
},
{
"docid": "8364f7897379656a061608017c532713",
"score": "0.59327435",
"text": "def get_shareholder_list_in_order(limit=nil)\n # The more senioruser wins in a tie\n # result = ShareTotal.find_by_sql(\"\n # SELECT * FROM share_totals\n # INNER JOIN users ON users.id = share_totals.user_id\n # WHERE band_id = #{ self.id }\n # ORDER BY net DESC, users.created_at ASC\n # LIMIT 10\n # \")\n # result = ShareTotal.where(:band_id => self.id).joins(:user).includes(:user).order('share_totals.net DESC, users.created_at ASC').limit(10) \n return ShareTotal.where(:band_id => self.id).joins(:user).includes(:user).order('share_totals.net DESC, share_totals.created_at ASC').limit(limit).all \n end",
"title": ""
},
{
"docid": "8364f7897379656a061608017c532713",
"score": "0.59327435",
"text": "def get_shareholder_list_in_order(limit=nil)\n # The more senioruser wins in a tie\n # result = ShareTotal.find_by_sql(\"\n # SELECT * FROM share_totals\n # INNER JOIN users ON users.id = share_totals.user_id\n # WHERE band_id = #{ self.id }\n # ORDER BY net DESC, users.created_at ASC\n # LIMIT 10\n # \")\n # result = ShareTotal.where(:band_id => self.id).joins(:user).includes(:user).order('share_totals.net DESC, users.created_at ASC').limit(10) \n return ShareTotal.where(:band_id => self.id).joins(:user).includes(:user).order('share_totals.net DESC, share_totals.created_at ASC').limit(limit).all \n end",
"title": ""
},
{
"docid": "f7462917094cc797bf6ffda3b9abd78e",
"score": "0.5909266",
"text": "def get_latest_news(start=0,count=LatestNewsPerPage)\n numitems = $r.zcard(\"news.cron\")\n news_ids = $r.zrevrange(\"news.cron\",start,start+(count-1))\n return get_news_by_id(news_ids,:update_rank => true),numitems\nend",
"title": ""
},
{
"docid": "f7462917094cc797bf6ffda3b9abd78e",
"score": "0.5909266",
"text": "def get_latest_news(start=0,count=LatestNewsPerPage)\n numitems = $r.zcard(\"news.cron\")\n news_ids = $r.zrevrange(\"news.cron\",start,start+(count-1))\n return get_news_by_id(news_ids,:update_rank => true),numitems\nend",
"title": ""
},
{
"docid": "ddf7b09cca9bdde637d3cd813e269078",
"score": "0.5891869",
"text": "def lastNScansForThisGame\n\t\t\n\t\t@scans = current_user.currentGame().scans.find(:all, :order => \"updated_at desc\", :limit => params[:limit].to_i)\n\t\t@scans.each do |scan|\n\t\t\tif scan.thisIsAPointModification\n\t\t\t\tscan[\"team_name\"] = Team.find(scan.team_id).name\n\t\t\t\tscan[\"points\"] = scan.modPoints\n\t\t\t\tscan[\"tag_name\"] = \"MODERATOR\"\n\t\t\telse\n\t\t\t\tscan[\"tag_name\"] = Tag.find(scan.tag_id).name\n\t\t\t\tscan[\"team_name\"] = Team.find(scan.team_id).name\n\t\t\t\tscan[\"points\"] = Tag.find(scan.tag_id).points\n\n\t\t\tend\n\n\t\tend\n\t\trespond_to do |format|\n\t\t\tformat.json{render json: @scans}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "225795c704c2f30189dc42a898759634",
"score": "0.58881843",
"text": "def index\n # Order by newest first\n @listings = Listing.all.order(\"created_at DESC\")\n end",
"title": ""
},
{
"docid": "99d59013561493bea786640ff0d19e10",
"score": "0.5880946",
"text": "def newest_places(number)\n real_number = number > all.size ? all.size : number\n all.sort_by(&:date).drop(all.size - real_number)\n end",
"title": ""
},
{
"docid": "f5f46a1c2593ce88e5da31d1a342f7b6",
"score": "0.58759767",
"text": "def load_older(count=200)\n if max_id = oldest_known_id\n store_tweets hose.tweets({:count => count, :max_id => max_id-1})\n else # never was loaded before. So we just load from beginning\n load_newer\n end\n end",
"title": ""
},
{
"docid": "ebf7005516b31497b66702468f0655a5",
"score": "0.586111",
"text": "def find_top_ten\n sorted_tweets = @retweeted_tweets.sort_by {|k, v| v[0]}.reverse\n top_number = sorted_tweets.length > 10 ? 10 : sorted_tweets.length\n sorted_tweets = sorted_tweets.take(top_number)\n end",
"title": ""
},
{
"docid": "c19bad07920f9aa47dcf833c6ec2a8e4",
"score": "0.58486557",
"text": "def index\n @listings = current_club_player.listings.order('created_at DESC').all \n end",
"title": ""
},
{
"docid": "1773d47e4056ecf26a372af35a527f8c",
"score": "0.584843",
"text": "def past_listings\n all_listings.select do |listing|\n listing.check_out < current_time\n end\n end",
"title": ""
},
{
"docid": "0a4e0ececbb8e4659c7317577ce1edff",
"score": "0.58436483",
"text": "def get_popular_songs_today limit = 10\n params = { 'limit' => limit }\n send_request 'getPopularSongsToday', params\n end",
"title": ""
},
{
"docid": "48a1e18dacc8532655dd393721535f99",
"score": "0.5828378",
"text": "def index\n @listings = Listing.all.order(\"created_at DESC\")\n end",
"title": ""
},
{
"docid": "e3fdf242f5b96f64ecffb1a754c9e4ba",
"score": "0.58277637",
"text": "def simple_feed(feed_url, limit = 10)\n feed = Feedjira::Feed.parse(open(feed_url).read)\n\n feed.entries.sort_by!(&:updated).reverse!\n\n feed.entries.take(limit)\n end",
"title": ""
},
{
"docid": "314914ea3c9925e118e19a80896dc009",
"score": "0.58257294",
"text": "def latest_20\n key = \"latest_20_#{to_s.pluralize.downcase}\"\n Rails.cache.fetch(key, expires_in: 2.hours) do\n where(id: latest.revrange(0, 20))\n .order_as_specified(id:\n latest.revrange(0, 20)).map(&:card_json)\n end\n end",
"title": ""
},
{
"docid": "70f216f89d8c91a70235ac38fdacdc52",
"score": "0.58146584",
"text": "def top\n Url.order(visit_count: :desc).limit(100)\n end",
"title": ""
},
{
"docid": "d0f1eaf486776ea11ee1150d8634904c",
"score": "0.5813091",
"text": "def sort \n @listings = Listing.where(:sold_date => 3.hours.from_now.to_date).order(:cached_votes_up => :desc).page(params[:page])\n end",
"title": ""
},
{
"docid": "7ae12ebb58420257190b988949484477",
"score": "0.5809587",
"text": "def top_board\n Url.order(visit_count: :asc).limit(100).reverse\n end",
"title": ""
},
{
"docid": "f061c76f098b73a09498b75b9489d7a6",
"score": "0.58021426",
"text": "def test_small_per_page\n commits = Fetcher.fetch_commits('braspag-rest', 50)\n\n assert_equal(97, commits.size )\n\n Fetcher.clear\n end",
"title": ""
},
{
"docid": "f1497222a657804a2f47e9d24dffb2ce",
"score": "0.57979524",
"text": "def index\n\n #@listings = Listing.where(:sold_date => 3.hours.from_now.to_date).order(\"created_at DESC\").page(params[:page])\n @listings = []\n @sellers = Seller.order(:is_promoted => :desc)\n @sellers.each do |seller|\n #@listings_tmp = seller.listings.where(:sold_date => 3.hours.from_now.to_date).order(:cached_votes_up => :desc)\n @listings_tmp = seller.listings.where(:sold_date => 3.hours.from_now.to_date).order(:updated_at => :asc)\n @listings_tmp.each do |listing|\n @listings.append(listing)\n end\n end\n @listings = Kaminari.paginate_array(@listings).page(params[:page]).per(8)\n end",
"title": ""
},
{
"docid": "04acdc227aa4d85053a919a8b75f88e3",
"score": "0.5797196",
"text": "def get_top_news(start=0,count=TopNewsPerPage)\n numitems = $r.zcard(\"news.top\")\n news_ids = $r.zrevrange(\"news.top\",start,start+(count-1))\n result = get_news_by_id(news_ids,:update_rank => true)\n # Sort by rank before returning, since we adjusted ranks during iteration.\n return result.sort{|a,b| b[\"rank\"].to_f <=> a[\"rank\"].to_f},numitems\nend",
"title": ""
},
{
"docid": "04acdc227aa4d85053a919a8b75f88e3",
"score": "0.5797196",
"text": "def get_top_news(start=0,count=TopNewsPerPage)\n numitems = $r.zcard(\"news.top\")\n news_ids = $r.zrevrange(\"news.top\",start,start+(count-1))\n result = get_news_by_id(news_ids,:update_rank => true)\n # Sort by rank before returning, since we adjusted ranks during iteration.\n return result.sort{|a,b| b[\"rank\"].to_f <=> a[\"rank\"].to_f},numitems\nend",
"title": ""
},
{
"docid": "da202ecd31f1157abd224f95014f2f70",
"score": "0.5793527",
"text": "def show_bookmark \n @listings = []\n @sellers = Seller.order(:cached_votes_up => :desc)\n @sellers.each do |seller|\n if current_user.liked? seller\n @listings_tmp = seller.listings.where(:sold_date => 3.hours.from_now.to_date).order(:cached_votes_up => :desc)\n @listings_tmp.each do |listing|\n @listings.append(listing)\n end\n end\n end\n @listings = Kaminari.paginate_array(@listings).page(params[:page]).per(8)\n end",
"title": ""
},
{
"docid": "cef832cccb2024578d41113ad995ac64",
"score": "0.57778203",
"text": "def index\n @apps = App.all.order(\"updated_at DESC\").limit 5\n end",
"title": ""
},
{
"docid": "552b1fd4e0d022ec7767f796eea6c396",
"score": "0.57770836",
"text": "def my_long_books\n # go through all of *MY BOOKS*\n # check if the pages are greater than 50\n # return a new list of those books that are over 50 pages\n my_books.select do |book|\n book.pages > 50\n end\n end",
"title": ""
},
{
"docid": "955b5da18275d818e902334bd028a861",
"score": "0.57765114",
"text": "def recent_observations(num = 5)\n observations.order(\"created_at DESC\").limit(num)\n end",
"title": ""
},
{
"docid": "72355b2bdcc63750407ca5156fa07e93",
"score": "0.5771448",
"text": "def post_process(grouped_listings)\n max_listings_per_parser = ENV['MAX_LISTINGS_PER_PARSER']&.to_i\n @logger.debug \"Limiting to #{max_listings_per_parser} listings per host\" unless max_listings_per_parser.nil?\n grouped_listings.transform_values do |entries|\n # Remove duplicates in each group\n result = entries.uniq\n # Limit results if configured to do so\n result = entries.take max_listings_per_parser unless max_listings_per_parser.nil?\n\n result\n end\n end",
"title": ""
},
{
"docid": "1e7dea0d78692a28ffa662a995009dc3",
"score": "0.57697433",
"text": "def recent_subscribed_feed_items(limit = 100)\n items = topics.map { |topic| topic.recent_feed_items(limit) }.flatten.\n uniq.sort_by { |item| item.created_at }\n return items.reverse if items.length <= limit\n items[-limit..-1].reverse\n end",
"title": ""
},
{
"docid": "07ceb8f80c811e79a5552294a867c524",
"score": "0.57622516",
"text": "def feed_items_with_max\n if @max_items_to_return and self.feed_items.size > @max_items_to_return\n # randomly select from feed items if it already loaded\n if self.feed_items.loaded?\n srand(Time.now.to_i)\n self.feed_items.sort_by {rand()}.slice(0, @max_items_to_return)\n else\n # might need to revisit this for performance reasons later\n self.feed_items.find(:all, :order => 'RAND()', :limit => @max_items_to_return)\n end\n else\n self.feed_items\n end\n end",
"title": ""
},
{
"docid": "d432d8faab1ff7bb047b0ae69d10f9f2",
"score": "0.57511514",
"text": "def list(n = 20)\n DB::Worker.last(n)\n end",
"title": ""
},
{
"docid": "7c49914d549818209ca1390066314dd4",
"score": "0.57328224",
"text": "def index\n authorize! :create, Listing\n @listings = Listing.includes(:neighborhood, :listing_agent, :sales_agent)\n .page(params[:page])\n .per(500)\n .available\n .order(updated_at: :desc)\n end",
"title": ""
},
{
"docid": "180299949b343b0ccc6e65103c889c35",
"score": "0.5732542",
"text": "def parse_most_popular(uri, count = nil)\n doc = parse_uri uri\n\n # we are only going to sample to first few\n rows = doc.css '.lister-list tr'\n most_popular = rows[0, count || rows.count].map { |row| parse_summary row }\n\n # continue by parsing each show/movie\n most_popular.map { | watchable | parse_details watchable }\nend",
"title": ""
},
{
"docid": "941eeef362730afc2e7da365ef9523d8",
"score": "0.57265294",
"text": "def index\n @unassigned = List.find_by(name:\"Backburner\")\n @lists = List.where.not(name:\"Backburner\").order('date DESC').limit(15)\n end",
"title": ""
},
{
"docid": "c910f332f2f6342940f3c924ed40238e",
"score": "0.57263494",
"text": "def search_trends\n Search.all.order('count DESC').take(5)\n end",
"title": ""
},
{
"docid": "01c01547545a288f55930cd17be23c90",
"score": "0.5717166",
"text": "def get_listings\n @dexknows.page.search('.listing').each do |business|\n get_business_info(business)\n end\n get_next_link\n\n end",
"title": ""
},
{
"docid": "ad9fe4535fd457c24055e0f5b81df923",
"score": "0.57135564",
"text": "def top_games(limit=10)\n placeholder = SecureRandom.uuid.downcase.gsub('-', '')\n games = Event.connection.execute(\n <<-SQL\n select * from (\n select\n regexp_replace(initcap(regexp_replace(lower(t.title), '''', '#{placeholder}')), '#{placeholder}', '''', 'i' ) as title\n ,t.id as title_id\n ,count(distinct c.id) as checkouts\n from games g\n left join (select * from checkouts where event_id = #{self.id}) c on g.id = c.game_id\n inner join titles t on t.id = g.title_id\n where\n g.status = #{Game::STATUS[:active]}\n or (g.status = #{Game::STATUS[:culled]} and g.updated_at::date between '#{self.start_date}' and '#{self.end_date}')\n or (g.status = #{Game::STATUS[:stored]} and g.updated_at::date between '#{self.start_date}' and '#{self.end_date}')\n group by 2\n order by 3 desc,1\n ) c\n where checkouts > 0\n limit '#{Event.connection.quote(limit)}'\n SQL\n )\n games.map do |game|\n game[:available] = Game.copy_available(game[\"title_id\"])\n game\n end\n end",
"title": ""
},
{
"docid": "b5d3517230aa4893348a526960f0f84b",
"score": "0.5695611",
"text": "def get_last count = 20\n\t\t\t\tModel::ChainBlock.where(:chain_id => @chain_id, :in_longest => 1).order(block_height: :desc).limit(count)\r\n\t\t\tend",
"title": ""
},
{
"docid": "e178d1c49b19fd09383776dcca0ce7ba",
"score": "0.56954",
"text": "def get_old_strips(feed)\n (3000..3100).each do |index|\n entry_url = \"http://www.explosm.net/comics/\" + index.to_s\n load_strip(entry_url, feed)\n end\n end",
"title": ""
},
{
"docid": "2669a0232dbc88e8b6e60cbdcb46f397",
"score": "0.5682524",
"text": "def top5\n results[0..4]\n end",
"title": ""
},
{
"docid": "05a7cd76e727717f3a40d89716352709",
"score": "0.56795806",
"text": "def get_top(limit=100)\n\t\treturn ContentGenerator.new('http://www.reddit.com/r/'+@display_name.to_s+'/top.json',limit)\n\tend",
"title": ""
},
{
"docid": "f370fd7cc9c036ada93b0ac8b988a7c5",
"score": "0.5676701",
"text": "def latest_20\n key = \"latest_20_#{self.to_s.pluralize.downcase}\"\n Rails.cache.fetch(key, expires_in: 2.hours) do\n self.where(id: self.latest.revrange(0, 20))\n .order_as_specified(id: self\n .latest.revrange(0, 20)).map{|object| object.card_json }\n end\n end",
"title": ""
},
{
"docid": "171b034a76415b8ca7ea3ec3add013b8",
"score": "0.56734604",
"text": "def latest\n latest = Provider.select(\"id, name, url, updated_at\").order(:updated_at).limit(6)\n end",
"title": ""
},
{
"docid": "9da6f29f25ff2602b0fca64ffc5579a4",
"score": "0.5671782",
"text": "def process_list what, web\n puts \"Fetching #{what} page 1...\"\n\n base_url = 'https://www.flickr.com/people/me/contacts/'\n base_url += 'rev/' if what == :follower\n web.get base_url\n username = get_user_name web\n\n last_page = get_last_page web\n names = get_names web\n\n # Only the first page can use people/me. Subsequent pages need the actual\n # user name.\n base_url = \"https://www.flickr.com/people/#{username}/contacts/\"\n base_url += 'rev/' if what == :follower\n\n (2..last_page).each { |page|\n puts \"Fetching #{what} page #{page}...\"\n web.get \"#{base_url}?page=#{page}\"\n\n names += get_names web\n }\n\n names\nend",
"title": ""
},
{
"docid": "cbdcf187da9bb2e82464eb36b0700777",
"score": "0.567149",
"text": "def fetch_most_recent(identifier, max_items, &callback)\n get_list(identifier) do |event|\n event.data = (event.data[-1*max_items..-1] || event.data).reverse! if event.data\n yield(event)\n end\n end",
"title": ""
},
{
"docid": "98789ea707afb68e02b450dbac1ba469",
"score": "0.5670624",
"text": "def recent_entries(user, count = 5)\n self.feed_entries.order('published_at desc').first(count).map { |entry|\n entry.for_index(user)\n }\n end",
"title": ""
},
{
"docid": "7fc1c99a6c67b0e1ea72aa07dbd0ec57",
"score": "0.5664402",
"text": "def index\n @listings = Listing.order(:name).page params[:page]\n end",
"title": ""
},
{
"docid": "c72e051da9feeb41bf10c4f2cbb07015",
"score": "0.5661417",
"text": "def top_growth_rate_stories\n story_collection = StoryCollection.new\n story_collection.load_newest\n sorted_story_collection = story_collection.stories_sorted_by_growth_rate.take(10)\n\n if sorted_story_collection.size > 0\n save_record_holder(sorted_story_collection.first)\n end\n\n sorted_story_collection.map { |story| story.serialize }\n end",
"title": ""
},
{
"docid": "9f83d16f3e5a944901e2093f28a9547d",
"score": "0.5660869",
"text": "def top10Losers\n gainersLosers.last(10).reverse\n end",
"title": ""
},
{
"docid": "1d0d8210524dc5e9b872af826fa2eef0",
"score": "0.56521595",
"text": "def find_logs( timestamp, limit=500 ) \n session[:filter] = @filter \n @logs = MoleLog.find_logs( @filter, @app_name, timestamp, limit ) \n unless @logs.empty? \nlogger.info \"---- Setting time stamp to first one #{@logs.first.created_at.utc}\" \n session[:last_pull] = @logs.first.created_at\n else \nlogger.info \"---- Setting time stamp to current #{timestamp}\" \n session[:last_pull] = timestamp\n end\n session[:start_pull] = session[:last_pull] if session[:start_pull].nil? \n timerange = @filter.range.minutes.ago( session[:start_pull] )\n find_tops( timerange )\n end",
"title": ""
},
{
"docid": "b16443f561c48e34af15021a7dfdec9e",
"score": "0.5649127",
"text": "def index\n @listings = Listing.all\n \n if params[:search]\n @listings = Listing.search(params[:search]).order(\"created_at DESC\")\n else\n @listings = Listing.all.order(:name).paginate(:page => params[:page], :per_page => 6)\n end\n end",
"title": ""
},
{
"docid": "8c7ee3569389922ca1d88d589951bbbe",
"score": "0.5647557",
"text": "def popular_links\n urls.sort_by { |url| -url.num_clicks }.take(5)\n end",
"title": ""
},
{
"docid": "343bb095590230cbf6690df7ed289be1",
"score": "0.56459653",
"text": "def fetch_new_tweets\n begin\n tweets = collect_with_max_id do |max_id|\n options = {count: 200, include_rts: true}\n options[:max_id] = max_id unless max_id.nil?\n Twitter.client.user_timeline(@account.twitter_name, options)\n end\n rescue Twitter::Error::TooManyRequests => error\n sleep error.rate_limit.reset_in + 1\n retry\n end\n tweets\n end",
"title": ""
},
{
"docid": "75116f894bb417b43ac7279bf1f3b7c3",
"score": "0.56445885",
"text": "def get_books_500_1000(library)\n books = []\n library.each do | book |\n books << book if 500 <= book.pages && book.pages <= 1000\n end\n return books\nend",
"title": ""
},
{
"docid": "eb845903c803bac706ccb28aa9b335c6",
"score": "0.5644571",
"text": "def latest_list_impressions( options = {} )\n $redis.zrevrange latest_list_key,\n 0, (options.try( :[], :limit) || 0) - 1,\n :with_scores => options.try(:[], :with_count)\n end",
"title": ""
},
{
"docid": "dc59f0d9d96a5096d74b4a6f43fb6434",
"score": "0.5643205",
"text": "def top_records(limit, time_of_interest = nil)\n time = time_of_interest || Time.now\n date = time.strftime(DATE_PARTIAL_FORMAT)\n connection.zrevrange(\"#{namespace}:#{name}:date:#{date}\", 0, limit - 1)\n end",
"title": ""
},
{
"docid": "bb8a3a35ef047cfab3917e82b9fb764b",
"score": "0.5635504",
"text": "def last_five_news\n CrNews.find_by_sql(\"select r.item_id, r.title, r.publish_date\n from cr_news n, cr_revisions r, cr_items i\n where n.news_id = r.revision_id\n and i.item_id = r.item_id\n and i.live_revision = r.revision_id\n and r.publish_date < current_timestamp \n and (n.archive_date is null or n.archive_date > current_timestamp)\n order by r.publish_date desc, r.item_id desc\n limit 5\")\n end",
"title": ""
},
{
"docid": "186af28ac62e00f4898ffaadc7639dba",
"score": "0.563335",
"text": "def most_popular()\n sql = \"SELECT screenings.*, films.title\n FROM films\n INNER JOIN screenings\n ON screenings.film_id = films.id\n WHERE film_id = $1\n ORDER BY screenings.tickets_sold DESC;\"\n\n result = SqlRunner.run(sql, [@id])\n #gives all sorted with most sold 1st\n screenings = Screening.map_items(result)\n #pulls out the show_time from the first result in that array\n screenings.first().show_time\nend",
"title": ""
},
{
"docid": "d37d6c34df135833a210d9eccebedda1",
"score": "0.5623014",
"text": "def fetch_bill_list(nointros = false)\n begin\n bill_list_uri = URI(BILL_LIST_URL)\n bill_list_json = Net::HTTP.get(bill_list_uri)\n if bill_list_json.nil?\n raise 'Cato bill list unavailable from Cato server'\n end\n rescue Exception => e\n $stderr.puts e.message\n $stderr.puts e.backtrace.inspect\n end\n raw_bill_list = JSON.parse(bill_list_json)\n puts \"Raw bill list has #{raw_bill_list.length} items\"\n\n # uniqify the bill list to most recent versions.\n # as it comes from Cato, it appears to be sorted by Cato bill number, and within the bill\n # number, by commit date. Not sure it's a good idea to rely on this, so we'll risk some duplicated effort by\n # sorting here.\n puts 'Sorting and de-duping bill list...'\n last_cato_num = -1\n raw_bill_list.sort_by{ |line| [line['billnumber'].to_i, Chronic.parse(line['commitdate']).strftime('%s').to_i]}.each do |item|\n next if nointros && item['billversion'] =~ /^i/\n @bills.pop if item['billnumber'] == last_cato_num\n @bills.push(item)\n last_cato_num = item['billnumber']\n end\n\n unless @sample_size.nil?\n @bills = @bills.sample(@sample_size)\n puts \"Limiting run to #{@sample_size}\"\n end\n\n puts '...sorted.'\n puts \"Most-recentized bill list has #{@bills.length} items\"\n end",
"title": ""
},
{
"docid": "6cc690b5317311cf7b1d72eac3b35410",
"score": "0.56223917",
"text": "def topRests(numRests, dist, access_token)\n path = \"/v2/search?term=restaurants&ll=37.786704,-122.401209&radius_filter=#{dist}&sort=0&limit=#{numRests}\"\n toprated_rests = []\n jsonHash = JSON.parse(access_token.get(path).body)\n businessArray=jsonHash['businesses']\n return businessArray\nend",
"title": ""
},
{
"docid": "90bcaf4d0bdf0c316b623a7821ec6dde",
"score": "0.5621973",
"text": "def list_cards\n initial_page = 0\n card_list = []\n\n puts \"Initial list call\\n\"\n cards_response = list(initial_page)\n\n return card_list if cards_response.blank?\n\n card_list += cards_response['data']\n\n while cards_response['has_more'] == true\n puts \"More to get making call to Scryfall page: #{cards_response.fetch('next_page')}\\n\"\n\n cards_response = get(URI(cards_response.fetch('next_page')))\n card_list += cards_response['data']\n\n # Per Scryfall request no more than 10 requests per second on average.\n puts \"Call successful sleeping before next request\\n\"\n sleep(0.5)\n end\n\n puts \"All calls successful\\n\"\n cards_list\n end",
"title": ""
},
{
"docid": "3c48ac62701e1b9963f816ef0e227163",
"score": "0.5621108",
"text": "def fill_in_recommend_songs\n\t\tsongs_pool = []\n\t\tcount = 0\n\t\tusers_songs = IO.readlines(\"/home/xieyizun/ai/music/app/assets/recommend/offline\") \n\t\tusers_songs.each do |line|\n\t\t\tuser_song = line.split(' ')\n\t\t\tif user_song.first.to_i == current_buyer.id and count <= 100\n\t\t\t\tsongs_pool << user_song.last.to_i\n\t\t\t\tcount += 1\n\t\t\t\tif count > 100\n\t\t\t\t break\n\t\t\t\tend\t\t\n\t\t\tend\n\t\tend\n\t\treturn songs_pool\n\tend",
"title": ""
},
{
"docid": "3c48ac62701e1b9963f816ef0e227163",
"score": "0.5621108",
"text": "def fill_in_recommend_songs\n\t\tsongs_pool = []\n\t\tcount = 0\n\t\tusers_songs = IO.readlines(\"/home/xieyizun/ai/music/app/assets/recommend/offline\") \n\t\tusers_songs.each do |line|\n\t\t\tuser_song = line.split(' ')\n\t\t\tif user_song.first.to_i == current_buyer.id and count <= 100\n\t\t\t\tsongs_pool << user_song.last.to_i\n\t\t\t\tcount += 1\n\t\t\t\tif count > 100\n\t\t\t\t break\n\t\t\t\tend\t\t\n\t\t\tend\n\t\tend\n\t\treturn songs_pool\n\tend",
"title": ""
},
{
"docid": "f6d689a3f07dbe1978ec6c1a3f84bac3",
"score": "0.56172645",
"text": "def find_all\n return @all_listings\n end",
"title": ""
},
{
"docid": "f6d689a3f07dbe1978ec6c1a3f84bac3",
"score": "0.5616753",
"text": "def find_all\n return @all_listings\n end",
"title": ""
},
{
"docid": "ba3212ea07854af17bb98d63ed89c3f2",
"score": "0.56151253",
"text": "def fetch_search\n tweets = Twitter::Search.new(@keyword, :page => @page).fetch\n tweets.results.each do |tweet|\n puts JSON.dump(tweet)\n logger.info \"Fetched tweet ##{tweet.id} via Search API\"\n logger.info \"Job Status: #{@count}/#{@limit}\"\n if @limit and @count >= @limit\n logger.info \"Limit reached (#{@count} out of #{@limit})\"\n return\n else\n @count += 1\n end\n end\n @page += 1\n fetch_search\n end",
"title": ""
},
{
"docid": "23126ef2da9a21f9df91f878da70c18e",
"score": "0.56098497",
"text": "def fetch\n fetch_limit = 5\n stations_to_be_refreshed = Station.order(updated_at: :asc)\n .where(\"expiry_date > ? \", Time.zone.now)\n .limit(fetch_limit)\n .select(:place_id, :link)\n render json: stations_to_be_refreshed\n end",
"title": ""
},
{
"docid": "1a8be651e1c9b3052b82f9b9e867a2f2",
"score": "0.5607624",
"text": "def fetch_listings(conditions, order = 'id DESC')\n @listings = Listing.paginate(:page => params[:page], \n :per_page => per_page,\n :order => order,\n :select => 'id, created_at, author_id, title, status, times_viewed, category, good_thru, visibility', \n :conditions => conditions) \n end",
"title": ""
},
{
"docid": "5a7a146aeb6a9b1750c6443dfd0a031b",
"score": "0.56059355",
"text": "def favorite_recent\n @client.search(\"#{@hashtag}\", result_type:\"recent\").take(25).each{|tweet| client.favorite(tweet)}\nend",
"title": ""
},
{
"docid": "480442b2dc8391f5a73ba1721ffd446f",
"score": "0.5604249",
"text": "def most_recent_tweets\n if tweets_are_stale?\n tweets.destroy_all\n fetch_tweets!\n end\n\n tweets.limit(10)\n end",
"title": ""
},
{
"docid": "03e2d31544086553f4388b89aa7806f7",
"score": "0.5601607",
"text": "def index\n @q = Listing.ransack(params[:q])\n @pagy, @listings = pagy(@q.result, items: 24)\n end",
"title": ""
},
{
"docid": "0a7e57e9365a2a05b7f6638ab8bad488",
"score": "0.5597402",
"text": "def get_pr_links#(index_page_number)\n all_pr_links = []\n\n #Instead of loop do, I set the get_pr_links method to only get links for the first 5 pages (125 Pull Requests)\n pr_index_page_numbers = (1..5).to_a\n\n pr_index_page_numbers.each do |page_number|\n # We start form the frist PR and go toward the last - the base url is 'created-asc'\n # I tried to add a 'limit=100' parameter in the url to show 100 records instead of just 25,\n # decreasing the number of pages to loop through, but it wasnt accepted.\n base_url = \"https://github.com/rails/rails/pulls?page=#{page_number}&q=is%3Apr+sort%3Acreated-asc\"\n current_index_doc = Nokogiri::HTML(URI.open(base_url).read)\n urls_on_current_index = current_index_doc.search(PR_ELEMENT_PATH).map { |element| element['href'] }\n all_pr_links += urls_on_current_index\n # break if all_pr_links.last == find_last_pr_url\n #index_page_number += 1\n sleep 1\n end\n all_pr_links.delete_at(2)\n all_pr_links\nend",
"title": ""
},
{
"docid": "a5518ccec888e81e677fb716201872de",
"score": "0.5594832",
"text": "def retrieve_each(count, params:, max_call: 1000)\n offset = params.fetch(:offset, 0)\n calls = 0\n\n loop do\n ret = retrieve(params.merge(count: count, offset: offset))\n if ret.err?\n yield(ret, nil)\n break\n end\n\n json = ret.response.body_json\n calls += 1\n\n yield(ret, json)\n break if json['list'].empty? || max_call <= calls\n\n offset += count\n end\n end",
"title": ""
}
] |
4bec79283b54934eec70ff708adb2f63
|
returns the fiscal year epoch the first allowable fiscal year for the application
|
[
{
"docid": "8512a0766ee0258394af17ceabb10a5c",
"score": "0.8647087",
"text": "def fiscal_year_epoch_year\n fiscal_year_year_on_date(SystemConfig.instance.epoch)\n end",
"title": ""
}
] |
[
{
"docid": "edbeaf459565dca599918cb08a39d19b",
"score": "0.77542317",
"text": "def last_fiscal_year_year\n current_fiscal_year_year + SystemConfig.instance.num_forecasting_years\n end",
"title": ""
},
{
"docid": "c5485c124fce868f3a8375e6dc91aa0f",
"score": "0.7658026",
"text": "def start_of_fiscal_year date_year\n # System Config provides a string giving the start day of the fiscal year as \"mm-dd\" eg 07-01 for July 1st. We can\n # append the date year to this and generate the date of the fiscal year starting in the date calendar year\n date_str = \"#{SystemConfig.instance.start_of_fiscal_year}-#{date_year}\"\n\n start_of_fiscal_year = Date.strptime(date_str, \"%m-%d-%Y\")\n end",
"title": ""
},
{
"docid": "b65512b77868f4635aba9e862ca6076a",
"score": "0.76269037",
"text": "def current_fiscal_year_year(use_system_config=true)\n\n fy_year = SystemConfig.instance.fy_year if use_system_config\n fy_year = fiscal_year_year_on_date(Date.today) if fy_year.blank? || fiscal_year_year_on_date(Date.today) - fy_year > 1 # dont let a manual rollover go over 2 years\n\n fy_year\n\n end",
"title": ""
},
{
"docid": "59e358779c0ffe88d9a551b2564b71ff",
"score": "0.7447821",
"text": "def effective_year\n if next_year_start_at && Time.zone.now < 1.year.from_now(next_year_start_at)\n if Time.zone.now < next_year_start_at\n return Time.zone.now.year\n elsif Time.zone.now >= next_year_start_at\n if Time.zone.now.year == next_year_start_at.year\n return Time.zone.now.year + 1\n else\n return Time.zone.now.year\n end\n end\n elsif Time.zone.now.month == 12 && Time.zone.now.day >= 1\n return Time.zone.now.year + 1\n end\n\n Time.zone.now.year\n end",
"title": ""
},
{
"docid": "3bdbc28f95716c18afa2db09958cfecf",
"score": "0.73831636",
"text": "def current_planning_year_year\n current_fiscal_year_year + 1\n end",
"title": ""
},
{
"docid": "a1c9dabee18edcb7a9cd5926328a925a",
"score": "0.7352745",
"text": "def current_fiscal_year\n fiscal_year(current_fiscal_year_year)\n end",
"title": ""
},
{
"docid": "5bc0310a976b21fc64e2c1d2aff87741",
"score": "0.7323478",
"text": "def calculate_fiscal_year(date = Date.current)\n date >= Date.new(date.year, 05, 01) ? date.year+1 : date.year\n end",
"title": ""
},
{
"docid": "c3bdd9766e6e5c0efc33423d7ff40de3",
"score": "0.72001904",
"text": "def start_of_planning_year\n start_of_fiscal_year current_planning_year_year\n end",
"title": ""
},
{
"docid": "14d9a7552678648b93b7af831c737c19",
"score": "0.7135993",
"text": "def fiscal_year_start_date\n Date.today.month < 7 ? \"07/01/#{Date.today.year - 1}\" : \"07/01/#{Date.today.year}\"\n end",
"title": ""
},
{
"docid": "5fd9c91997c8f8f90407dc95de9b9054",
"score": "0.71276295",
"text": "def current_planning_year\n fiscal_year(current_planning_year_year)\n end",
"title": ""
},
{
"docid": "e4c676ce356a8e968389f7e9a1af23ea",
"score": "0.71034855",
"text": "def epochyear\n 2000 + @line1[18...20].to_i\n end",
"title": ""
},
{
"docid": "7992b31d451ca327426d9ee59582a32c",
"score": "0.70148456",
"text": "def fiscal_years\n get_fiscal_years\n end",
"title": ""
},
{
"docid": "c6e8fc50eeaffcd2a9c38a7463ee269b",
"score": "0.69187915",
"text": "def year(input) = new_year(input).year - 621",
"title": ""
},
{
"docid": "419ee6f3c4f5f6dd7fcc49e1dd1878ec",
"score": "0.689143",
"text": "def year_rome_founded\n bce(753)\n end",
"title": ""
},
{
"docid": "4bbd85960afb123376316c07b5eb16d1",
"score": "0.6869436",
"text": "def day_of_year\n (seconds_since_start_of_year / D_SECS).to_i + 1\n end",
"title": ""
},
{
"docid": "e7f3a500f5e719e04e15403b94d973a0",
"score": "0.68635315",
"text": "def first_year\n 2012\n end",
"title": ""
},
{
"docid": "b71b4cd0ec73bf5aa90216f0b89a38cb",
"score": "0.6818702",
"text": "def fiscal_year_on_date(date)\n fiscal_year(fiscal_year_year_on_date(date))\n end",
"title": ""
},
{
"docid": "4e7fc5d059c083254dd73f3b561d2342",
"score": "0.68127257",
"text": "def fiscal_year_year_on_date(date)\n\n if date.nil?\n date = Date.today\n end\n date_year = date.year\n\n # If the start of the fiscal year in the calendar year is before date, we are in the fiscal year that starts in this\n # calendar years, otherwise the date is in the fiscal year that started the previous calendar year\n (date < start_of_fiscal_year(date_year)) ? date_year - 1 : date_year\n\n end",
"title": ""
},
{
"docid": "29ca9a917ed33a38bef68748587ef9e5",
"score": "0.6809855",
"text": "def fiscal_year_end_date(date=Date.today)\n date_year = fiscal_year_year_on_date(date)\n\n # System Config provides a string giving the start day of the fiscal year as \"mm-dd\" eg 07-01 for July 1st. We can\n # append the date year to this and generate the date of the fiscal year starting in the date calendar year\n date_str = \"#{SystemConfig.instance.start_of_fiscal_year}-#{date_year}\"\n\n start_of_fiscal_year = Date.strptime(date_str, \"%m-%d-%Y\")\n\n # get end of last fiscal year and add a year for current fiscal year\n start_of_fiscal_year - 1.days + 1.years\n\n end",
"title": ""
},
{
"docid": "c54d9c5b34cda3c43eef97660aedec57",
"score": "0.6765296",
"text": "def get_next_yr\n\tset_cur_year(get_cur_year+1)\nend",
"title": ""
},
{
"docid": "8afb39dc4be5d97bc3dcdb107652d41a",
"score": "0.6764391",
"text": "def first_eligible_qts_award_year(claim_year = nil)\n claim_year ||= configuration.current_academic_year\n claim_year - ELIGIBLE_CAREER_LENGTH\n end",
"title": ""
},
{
"docid": "0ea1063b9527b5f140387fc75d7ee399",
"score": "0.6756327",
"text": "def start_year\n Time.now.year - 75\n end",
"title": ""
},
{
"docid": "9850b49e8578908bdec816b2bdd15731",
"score": "0.6753356",
"text": "def alt_year_from_fixed(date)\n approx = quotient(date - gregorian_epoch + 2, 146097/400.0)\n start = (gregorian_epoch +\n (365 * approx) +\n quotient(approx, 4) +\n -quotient(approx, 100) +\n quotient(approx, 400))\n (date < start) ? approx : (approx + 1)\n end",
"title": ""
},
{
"docid": "c08ace96d92420f86ba862bcda7fe25a",
"score": "0.67335236",
"text": "def start_year\n Time.now.year - 18\n end",
"title": ""
},
{
"docid": "2468cd44942fcb09d6afb7969baafa5b",
"score": "0.67208713",
"text": "def start_of_year\n @start_of_year ||= year_start_date\n end",
"title": ""
},
{
"docid": "2d9eaf282df61e4b1729b306e9c7e8b5",
"score": "0.6708705",
"text": "def start_of_year(year)\n date_calc.start_of_year(year)\n end",
"title": ""
},
{
"docid": "9f57e0d001152fa279b2df27f4dcd807",
"score": "0.6708522",
"text": "def fy(d)\n\t\td = d.to_date\n\t\tif(d.month >= 2)\n\t\t\treturn (d.year+1)\n\t\telse\n\t\t\treturn d.year\n\t\tend\n\tend",
"title": ""
},
{
"docid": "48ab82b438de62c4ca97a7ae118d0ac7",
"score": "0.6704721",
"text": "def year\n current_year = Date.today.year\n\n case raw_year\n when current_year; \"this year\"\n when current_year.next; \"next year\"\n when current_year.pred; \"last year\"\n else; raw_year.to_s\n end\n end",
"title": ""
},
{
"docid": "36213d1dccd2333295226009456ad22f",
"score": "0.6692171",
"text": "def year\n (seconds_since_epoch / Y_SECS).to_i\n end",
"title": ""
},
{
"docid": "466e9193bfdaa6625bf411a06fd03504",
"score": "0.6679206",
"text": "def centuryFromYear(year)\n if (year % 100 == 0)\n year/100\n else\n (year/100) + 1\n end\nend",
"title": ""
},
{
"docid": "54e405cd74b9af079b695d80cf130d17",
"score": "0.66673315",
"text": "def fiscal_year(year, klass = nil)\n\n # some controllers might have a special formatter instead of the default one to use the FY string\n # eventually default might be a SystemConfig.instance attribute as well but for now hard-coded\n\n unless klass\n if defined? params\n klass = params[:controller].classify\n elsif self.class.to_s.include? 'Controller'\n klass = self.class.to_s[0..-('Controller'.length+1)]\n else\n klass = self.class.to_s\n end\n end\n\n formatter = SystemConfig.instance.special_fiscal_year_formatters[klass]\n formatter = SystemConfig.instance.default_fiscal_year_formatter if formatter.nil?\n\n if formatter == 'start_year'\n \"#{year}\"\n elsif formatter == 'end_year'\n \"#{year+1}\"\n else\n yr = year - fy_century(year)\n first = \"%.2d\" % yr\n if yr == 99 # when yr == 99, yr + 1 would be 100, which causes: \"FY 99-100\"\n next_yr = 00\n else\n next_yr = (yr + 1)\n end\n last = \"%.2d\" % next_yr\n \"#{first}-#{last}\"\n end\n end",
"title": ""
},
{
"docid": "9a08bff91cf09b54b923c605bd564c8c",
"score": "0.66512907",
"text": "def year_from_fixed(date)\n d0 = date - epoch\n n400 = quotient(d0, 146097)\n d1 = d0 % 146097\n n100 = quotient(d1, 36524)\n d2 = d1 % 36524\n n4 = quotient(d2, 1461)\n d3 = d2 % 1461\n n1 = quotient(d3, 365)\n year = (400 * n400) + (100 * n100) + (4 * n4) + n1\n ((n100 == 4) || (n1 == 4)) ? year : (year + 1)\n end",
"title": ""
},
{
"docid": "d41577ae434237cc372e51f75942ddf1",
"score": "0.6608921",
"text": "def faith_years\n (Time.now.year - 1991).ordinalize\n end",
"title": ""
},
{
"docid": "03795a2e5e1aac5acf0b99f7114292af",
"score": "0.65822595",
"text": "def fiscal_year\n super(fy_year)\n end",
"title": ""
},
{
"docid": "f62ad9698c3b3d66f40674a3bee89cce",
"score": "0.6570859",
"text": "def gas_year\n y = year\n if self< Date.new(y,10,1)\n y\n else\n y+1\n end\n end",
"title": ""
},
{
"docid": "f6be2cbe303971b0a59396b330dc04b5",
"score": "0.65622646",
"text": "def year\n if self.mitDirStudentYear\n Date.today.year + 4 - self.mitDirStudentYear.to_i + ((Date.today.month > 6)?1:0)\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "43986428646479ca0e1969b751cfa4d4",
"score": "0.65139407",
"text": "def end_year\n Time.now.year \n end",
"title": ""
},
{
"docid": "07cb1375b09a060501d85a6389b6eb32",
"score": "0.65090317",
"text": "def what_century(year)\n year % 100 == 0 ? year / 100 : year / 100 + 1\nend",
"title": ""
},
{
"docid": "4d637287c3e2c0b24581566751044080",
"score": "0.65051717",
"text": "def end_year\n Time.now.year - 90\n end",
"title": ""
},
{
"docid": "f169d501bd80cee1073830591dbe9b13",
"score": "0.6489424",
"text": "def min_year\n 2015\n end",
"title": ""
},
{
"docid": "abe0bd06829c3146aaaefb2d4831eb53",
"score": "0.6485656",
"text": "def getFiscalYearObjName\r\n\t\t return \"mfiforce__fiscal_year__c\"\r\n\t\tend",
"title": ""
},
{
"docid": "2ac525538502e12fc7a933225769124c",
"score": "0.64785933",
"text": "def year\n ((semester - 1) / 2) + 1\n end",
"title": ""
},
{
"docid": "41d5a4288eccb60580b07c671b57e1f9",
"score": "0.64761335",
"text": "def fiscal_new_year_date(date = Date.current)\n Date.new(calculate_fiscal_year(date),05,01)\n end",
"title": ""
},
{
"docid": "d61147873750a18eba1a2fb546fe46c4",
"score": "0.6469124",
"text": "def calculate_century(year)\n (year % 100).zero? ? year / 100 : year / 100 + 1\nend",
"title": ""
},
{
"docid": "88d5e2ddf4f45804e7309f33ff3dcb19",
"score": "0.64607567",
"text": "def full_academic_year\n unless academic_year.blank?\n academic_year.to_s + '-' + (academic_year + 1).to_s\n end\n end",
"title": ""
},
{
"docid": "8a270c291f0873b45e51f6091bc39296",
"score": "0.64564884",
"text": "def days_in_year(year)\n Time.days_in_month(2, year) + 337\n end",
"title": ""
},
{
"docid": "e0982fc606b42a11774902fa7dea3617",
"score": "0.64444286",
"text": "def start_year\n @start_year ||=\n (Atlas::Dataset.exists?(area_code) &&\n Atlas::Dataset.find(area_code).analysis_year) ||\n 2019\n end",
"title": ""
},
{
"docid": "742146012cac229f577b31ba80a429bc",
"score": "0.6431964",
"text": "def this_year\n year(Time.now)\n end",
"title": ""
},
{
"docid": "d5407e1aa46185e0715f8a66f4710d3d",
"score": "0.64293534",
"text": "def iso_year_start(wkst)\n iso_year_and_week_one_start(wkst)[1]\n end",
"title": ""
},
{
"docid": "d26c118352623ca0f3c92e6afdfb0e3d",
"score": "0.64233196",
"text": "def which_century(year)\n year.to_s[-1] == \"0\" ? (year / 100).to_s : (year / 100 + 1).to_s\nend",
"title": ""
},
{
"docid": "bcaecf3783dbc59fbe0eff4dc901c416",
"score": "0.64113855",
"text": "def succ\n FiscalYear.new(self + 1)\n end",
"title": ""
},
{
"docid": "6b650f0ba8d969b6ead8b881fb97f113",
"score": "0.6398309",
"text": "def year() end",
"title": ""
},
{
"docid": "3f5067c35ad68732c4055c385ffd6f68",
"score": "0.637794",
"text": "def work_out_year(value)\n case value\n when 0..39\n 2000 + value\n when 40..99\n 1900 + value\n when nil\n Time.zone.now.year\n else\n # We may be passed something that's not a straight out integer\n # These things include: BigDecimals, Floats and Strings.\n value.to_i\n end\n end",
"title": ""
},
{
"docid": "4dafc3c12fe1892c5631b478a8abd42f",
"score": "0.6377937",
"text": "def next_year\n AcademicYear.find_by(year: self.year + 1)\n end",
"title": ""
},
{
"docid": "3f40762823fdccc55ec667301435b6ce",
"score": "0.63559514",
"text": "def days_in_year(year = current.year)\n days_in_month(2, year) + 337\n end",
"title": ""
},
{
"docid": "ce7bf68f3d76fce850864e0e9aa88a22",
"score": "0.6317015",
"text": "def max_year\n year - (month < 12 ? 1 : 0)\n end",
"title": ""
},
{
"docid": "8371a6939c3ed1b2c8b072735775447a",
"score": "0.63098097",
"text": "def in_the_last_year\n date_factory(Time.random(:year_range=>1))\n end",
"title": ""
},
{
"docid": "6d2b05901d319834e15a6ae3519fbd55",
"score": "0.6306201",
"text": "def century_year(year)\n\n\tcentury_year = year.div(100) + 1\n\tcentury_year -= 1 if year % 100 == 0\n\tcentury_year.to_s + century_suffix(century_year)\n\nend",
"title": ""
},
{
"docid": "6d0f6ca51839481a928d1f9f4df9b591",
"score": "0.6288997",
"text": "def work_out_year(value)\n case value\n when 0..39\n 2000 + value\n when 40..99\n 1900 + value\n else\n value\n end\n end",
"title": ""
},
{
"docid": "473c49f07d6d32554db9b67198428571",
"score": "0.6279885",
"text": "def days_in_year(year)\n ::Montrose::Utils.days_in_month(2, year) + 337\n end",
"title": ""
},
{
"docid": "747a453e768757fae4a1830e5ac66fb3",
"score": "0.62743783",
"text": "def new_year(input)\n equinox = Integer === input ? @astro.solar_event(:march_equinox, input) : @astro.previous(:march_equinox, input)\n date = local_date(equinox)\n equinox.localtime(utc_offset).hour < 12 ? date : date + 1\n end",
"title": ""
},
{
"docid": "b215be5a2ff243f540f2c67056901418",
"score": "0.62739396",
"text": "def year\n 2020\n end",
"title": ""
},
{
"docid": "09d44ec0b9f1d689e407c1d406778da3",
"score": "0.6246371",
"text": "def sred_year_for_date(date=today_as_date)\n start_of_year = (Date.new(date.year, 1, 1)..Date.new(date.year, 7, 31))\n if start_of_year.include?(date)\n return date.year - 1\n else\n return date.year\n end\n end",
"title": ""
},
{
"docid": "9d0f2773d08e86e0c277d107c3cdd1f6",
"score": "0.6239864",
"text": "def year\n @year ||= TODAY.year\n end",
"title": ""
},
{
"docid": "6b120646d3228a46bd4c723b7d2f2c72",
"score": "0.62183136",
"text": "def end_of_year\n @end_of_year ||= date_calc.end_of_year(year)\n end",
"title": ""
},
{
"docid": "1c6b0babbcc800f30e9f89523dea8857",
"score": "0.6216271",
"text": "def yn(year)\n return year if year.size == 4\n\n y = Date.today.year.to_s[2..4].to_i + 1\n case year.to_i\n when 0...y then \"20#{year}\"\n when y..99 then \"19#{year}\"\n end\n end",
"title": ""
},
{
"docid": "72bba8544948d9eb0be3e551315f08d9",
"score": "0.6215848",
"text": "def fiscal_year_ranges(fiscal_year)\n start_date = Date.new(fiscal_year - 1, 7, 1)\n end_date = [Date.today, Date.new(fiscal_year, 6, 30)].min\n this_year = start_date..end_date\n last_year = (start_date - 1.year)..(end_date - 1.year)\n return this_year, last_year\n end",
"title": ""
},
{
"docid": "6a519b40e8062ee7d534b5c797bd06ae",
"score": "0.62103647",
"text": "def year\n if @date.cweek == 1 && @date.month == 12\n @date.year + 1\n elsif @date.cweek == 52 && @date.month == 1\n @date.year - 1\n else\n @date.year\n end\n end",
"title": ""
},
{
"docid": "1d09ff5a5b1d604f7e27935b31ddcee4",
"score": "0.62093353",
"text": "def daysInYear\n if leapYear?\n return 366\n else\n return 365\n end\n end",
"title": ""
},
{
"docid": "0f58509ed81880abb27a1d80f45a492b",
"score": "0.62040734",
"text": "def local_year(planet)\n (@formation_year / planet.orbital_period).round(2)\n end",
"title": ""
},
{
"docid": "9950094aa42fb4a5b500215f946a7fda",
"score": "0.620244",
"text": "def end_of_year(year)\n date_calc.end_of_year(year)\n end",
"title": ""
},
{
"docid": "917c0c6a2f580c9d3a083b79cc568546",
"score": "0.62010264",
"text": "def get_begin_date\n get_end_date.prev_year\n end",
"title": ""
},
{
"docid": "6d44a271da23f2eeaaf59dbc8f512cbb",
"score": "0.61991614",
"text": "def update_project_fiscal_year\n if multi_year? and activity_line_items.present?\n self.fy_year = activity_line_items.pluck(:fy_year).min\n end\n end",
"title": ""
},
{
"docid": "1af20329f408a9b6e80852204ed71b6b",
"score": "0.61962306",
"text": "def a_year()\n now = Time.now\n if now.month < 4\n now.year - 1\n else\n now.year\n end\nend",
"title": ""
},
{
"docid": "3ffdb65c248b5c62bda8c7d4a8d1ffac",
"score": "0.6193318",
"text": "def get_all_fiscal_years\n get_fiscal_years(Date.today - 4.years)\n end",
"title": ""
},
{
"docid": "c68ef7448c291727fb646209e94ed293",
"score": "0.6179562",
"text": "def set_FiscalYear(value)\n set_input(\"FiscalYear\", value)\n end",
"title": ""
},
{
"docid": "c68ef7448c291727fb646209e94ed293",
"score": "0.6179562",
"text": "def set_FiscalYear(value)\n set_input(\"FiscalYear\", value)\n end",
"title": ""
},
{
"docid": "c68ef7448c291727fb646209e94ed293",
"score": "0.6179562",
"text": "def set_FiscalYear(value)\n set_input(\"FiscalYear\", value)\n end",
"title": ""
},
{
"docid": "836af1d1c08b4777bc69691d550416c4",
"score": "0.61758167",
"text": "def century(year)\n which_century(year) + numberth(which_century(year))\nend",
"title": ""
},
{
"docid": "5a580e1c35d8cbde14b4c6fa0de3ef47",
"score": "0.6175727",
"text": "def raw_year\n start_on.year\n end",
"title": ""
},
{
"docid": "f70306723943ca1c9afb3898894b5a77",
"score": "0.61743855",
"text": "def get_cur_year\n\treturn $cur_year.to_i\nend",
"title": ""
},
{
"docid": "e7738f801f228a06d08f3689d9b16468",
"score": "0.61712617",
"text": "def year(index)\n i = get_field_index_by_external_id(index,@fields[:year])\n fields(index, i).to_i unless i.nil?\n end",
"title": ""
},
{
"docid": "6eb1cbe0093394c59b0e628ae82c4248",
"score": "0.61620516",
"text": "def century_validate(year)\n century = (year / 100) + 1\n century.to_s + validate_ordinal(year)\nend",
"title": ""
},
{
"docid": "33cf365ddb7b199f1e04a2fa3b34ca46",
"score": "0.6158175",
"text": "def w_year; end",
"title": ""
},
{
"docid": "bd1343a39972ba944a8f923f208f3347",
"score": "0.61564803",
"text": "def iso_year(wkst)\n iso_year_and_week_num(wkst)[0]\n end",
"title": ""
},
{
"docid": "29282ec75b0d0931cf82bb06852063b7",
"score": "0.6150603",
"text": "def set_year\n if set_month > 2 and set_month < 13\n @year.to_i\n else\n @year.to_i - 1\n end\n end",
"title": ""
},
{
"docid": "e39b00b4eda654f04f2c01738978136d",
"score": "0.6139894",
"text": "def year\n Faker::Time.backward(days: rand_in_range(365, 5475), period: :all, format: '%Y').to_i\n end",
"title": ""
},
{
"docid": "4dbfd913841333bacc26c1467169f1d0",
"score": "0.61348444",
"text": "def get_plain_four_digit_year(dates)\n dates.each do |f_date|\n matches = f_date.scan(/\\d{4}/)\n if matches.length == 1\n @pub_year = matches.first\n else\n # when there are multiple matches, check for ones with CE after them\n matches.each do |match|\n # look for things like '1865-6 CE'\n pos = f_date.index(Regexp.new(match + '...CE'))\n pos = pos ? pos.to_i : 0\n if f_date.include?(match + ' CE') || pos > 0\n @pub_year = match\n return match\n end\n end\n end\n return matches.first\n end\n nil\n end",
"title": ""
},
{
"docid": "03ef5fc4b4c761a25dc5175a08fb8d7c",
"score": "0.61289734",
"text": "def beginning_of_year\n change(:month => 1,:day => 1,:hour => 0, :min => 0, :sec => 0, :usec => 0)\n end",
"title": ""
},
{
"docid": "e6369a876267d878f31dbf231175c71b",
"score": "0.6125041",
"text": "def days_since_epoch\n self.day_of_year + (307 * year)\n end",
"title": ""
},
{
"docid": "e2924b8c96be76adf7a50836a7d0dd66",
"score": "0.61164623",
"text": "def get_year_ary\n (Date.today.year-99..Date.today.year).inject([]){|x,y| x << y}.reverse\n end",
"title": ""
},
{
"docid": "3d7b5be90750e9fc2071621bd237735d",
"score": "0.61104286",
"text": "def get_fiscal_years(date = nil, num_forecasting_years = nil)\n if date\n current_year = fiscal_year_year_on_date(date)\n else\n current_year = current_planning_year_year\n end\n a = []\n\n # get last fiscal year from current year and num of forecasting years\n if num_forecasting_years.nil?\n last_year = last_fiscal_year_year\n else\n last_year = current_year + num_forecasting_years\n end\n\n (current_year..last_year).each do |year|\n a << [fiscal_year(year), year]\n end\n a\n end",
"title": ""
},
{
"docid": "51a75ee93e556a5857fa46842f3cebae",
"score": "0.6109761",
"text": "def cwyear\n end",
"title": ""
},
{
"docid": "f062c599bac20078447b0065f72235a7",
"score": "0.61017686",
"text": "def validate_year(input, year)\n max_year = Date.today.year + 2\n year <= max_year && year >= 1900\n end",
"title": ""
},
{
"docid": "a35dcc8be0f5af0ce424e348d23e53cc",
"score": "0.61001384",
"text": "def get_year\n @year ||= params[:year] ? params[:year].to_i : Time.now.year\n end",
"title": ""
},
{
"docid": "499f0de5a185a978cd44c36f396e75a6",
"score": "0.60987705",
"text": "def century(year)\n century = year / 100 if year % 100 == 0\n century = (year / 100) + 1 if year % 100 != 0\n \"#{century}#{ordinal(century)}\"\nend",
"title": ""
},
{
"docid": "a9206a2872eeddaf24cc28e10cccc71d",
"score": "0.609871",
"text": "def academic_year\n academic_year = case quarter_code_id\n when 1\n \"#{year-1}-#{year}\"\n when 2\n \"#{year-1}-#{year}\"\n when 3\n \"#{year}-#{year+1}\"\n when 4\n \"#{year}-#{year+1}\"\n end\n academic_year\n end",
"title": ""
},
{
"docid": "0bf7975859472a5a92d0b7bf7a0cc031",
"score": "0.6098621",
"text": "def beginning_of_year\n change(month: 1).beginning_of_month\n end",
"title": ""
},
{
"docid": "4c026f7a31e5f236e18c0ecae75b68f5",
"score": "0.6095544",
"text": "def calc_century(year)\n if year.to_s.end_with?('0')\n year / 100\n else\n (year + 100) / 100\n end\nend",
"title": ""
},
{
"docid": "bf87d0c9075c62c2bca0bf03b014ee24",
"score": "0.6094095",
"text": "def year_int(date_el_array)\n result = date_parsing_result(date_el_array, :year_int_from_date_str)\n return result if result\n\n year_int, _ignore = self.class.earliest_year_int(date_el_array)\n year_int if year_int\n end",
"title": ""
}
] |
e0708ef619f1a0fe549ea847d9f7353b
|
Beans are defined as follows: name: a jmx find string, such as java.lang:type=Memory it may also include wildcards such as java.lang:type=MemoryPool,name= in this usage, it will process the path for each item found path: an array of elements to walk down the jmx tree. if an element is an array, the elements within that array are each applied at the current state
|
[
{
"docid": "19953309b647ef25116dbbfeeb88600d",
"score": "0.5927026",
"text": "def initialize(bean)\n @name=bean[\"name\"]\n @path=bean[\"path\"]\n @results = {}\n begin\n @state = JMX::MBean.find_all_by_name @name\n rescue Exception => e\n end\n end",
"title": ""
}
] |
[
{
"docid": "a090304e3404d8acf732ddf87e6b58da",
"score": "0.4669873",
"text": "def [] name\n name = name.to_s\n node = @node.find(nil, name) rescue nil\n return nil unless node\n begin\n type = _typemap()[name]\n rescue\n raise \"Property #{name} of #{self.class} has unknown type\"\n end\n# puts \"#{self.class}[#{name}]: #{node.name}<#{type.inspect}>\"\n Wbem::Conversion.to_ruby type, node\n end",
"title": ""
},
{
"docid": "e744bed52733701bedb8600fd81dbbe3",
"score": "0.4580376",
"text": "def class_elements(*element_names)\n options = element_names.extract_options!\n\n patterned_elements \".%{element_name}\", *element_names, options.slice(:element_array)\n end",
"title": ""
},
{
"docid": "74911715dc0f6186bb978a56a4d657bf",
"score": "0.44695908",
"text": "def boots(state,path,descr=\"\")\n begin\n # get our current position\n curr = path.shift\n case\n when curr.instance_of?(String)\n descr=\"#{descr}.#{curr}\"\n\n # we may have a hash or a mbean from which to get attributes\n # either way, we can \"gettr\" done\n state = (state.respond_to?(:keys) ? state[curr] : state.send(curr))\n if path.empty?\n @results[descr]=state\n else\n boots(state,path,descr)\n end\n when curr.instance_of?(Array)\n curr_state = state\n curr.each do |rabbit|\n hole = path.dup\n my_desc = \"#{descr}.#{rabbit}\"\n my_state = (curr_state.respond_to?(:keys) ? curr_state[rabbit] : curr_state.send(rabbit))\n if hole.empty?\n @results[my_desc]=my_state\n else\n boots(my_state,hole,my_desc)\n end\n end\n end\n rescue Exception => e\n puts \"Exception required processing #{@name}: #{e}\"\n end\n end",
"title": ""
},
{
"docid": "76d39c78832de5bd0a3e579c2ed39475",
"score": "0.4447243",
"text": "def get_mbeanmap_for_higherversion\n metric_type_to_solr_core_mbean_attr_map = {\n \"ADD_METRICS\" => {\n # category, scope, name are the elements of the mbean object\n \"category=QUERY,scope=/get,name=org.apache.solr.handler.RealTimeGetHandler\" =>\n [\"requests,5minRateRequestsPerSecond,15minRateRequestsPerSecond,timeouts,errors,clientErrors,serverErrors\"],\n \"category=QUERY,scope=/select,name=org.apache.solr.handler.component.SearchHandler\" =>\n [\"requests,5minRateRequestsPerSecond,15minRateRequestsPerSecond,timeouts,errors,clientErrors,serverErrors\"],\n \"category=UPDATE,scope=/update,name=org.apache.solr.handler.UpdateRequestHandler\" =>\n [\"requests,5minRateRequestsPerSecond,15minRateRequestsPerSecond,timeouts,errors,clientErrors,serverErrors\"],\n \"category=CACHE,scope=fieldValueCache,name=org.apache.solr.search.FastLRUCache\" =>\n [\"hits,hitratio,evictions\"],\n \"category=CACHE,scope=filterCache,name=org.apache.solr.search.FastLRUCache\" =>\n [\"hits,hitratio,evictions\"],\n \"category=CACHE,scope=documentCache,name=org.apache.solr.search.LRUCache\" =>\n [\"hits,hitratio,evictions\"],\n \"category=CACHE,scope=queryResultCache,name=org.apache.solr.search.LRUCache\" =>\n [\"hits,hitratio,evictions\"],\n \"category=CACHE,scope=perSegFilter,name=org.apache.solr.search.LRUCache\" =>\n [\"hits,hitratio,evictions\"],\n \"category=UPDATE,scope=updateHandler,name=org.apache.solr.update.DirectUpdateHandler2\" =>\n [\"commits,soft autocommits\"],\n \"category=ADMIN,scope=/admin/segments,name=org.apache.solr.handler.admin.SegmentsInfoRequestHandler\" =>\n [\"requests\"],\n \"category=CORE,scope=searcher,name=org.apache.solr.search.SolrIndexSearcher\" =>\n [\"deletedDocs,maxDoc,numDocs\"],\n \"category=CACHE,scope=fieldCache,name=org.apache.solr.search.SolrFieldCacheMBean\" =>\n [\"entries_count,total_size\"]\n },\n \"AVG_METRICS\" => {\n # category, scope, name are the elements of the mbean object\n \"category=QUERY,scope=/get,name=org.apache.solr.handler.RealTimeGetHandler\" =>\n [\"95thPcRequestTime,99thPcRequestTime\"],\n \"category=QUERY,scope=/select,name=org.apache.solr.handler.component.SearchHandler\" =>\n [\"95thPcRequestTime,99thPcRequestTime\"],\n \"category=UPDATE,scope=/update,name=org.apache.solr.handler.UpdateRequestHandler\" =>\n [\"95thPcRequestTime,99thPcRequestTime\"]\n }\n }\n return metric_type_to_solr_core_mbean_attr_map\n end",
"title": ""
},
{
"docid": "cc3205c707e02ef8b0d8dec22ee9f34c",
"score": "0.4329897",
"text": "def get_solr_core_mbean_type_for_solr7(mbean_name)\n\n mbean_parts = mbean_name.split(\",\")\n scope_value = nil\n name_value = nil\n\n mbean_parts.each do |mbean_part|\n if mbean_part.start_with? \"scope=\"\n mbean_type = mbean_part.slice(mbean_part.index(\"scope=\")+6, mbean_part.length-1)\n # Removing the code to trim the beginning slash in scope and instead we remove it right before writing to the log file.\n # if mbean_type.start_with? \"/\"\n # scope_value = mbean_type.slice(1,mbean_type.length-1)\n # else\n scope_value = mbean_type\n # end\n end\n\n if mbean_part.start_with? \"name=\"\n mbean_type = mbean_part.slice(mbean_part.index(\"name=\")+5, mbean_part.length-1)\n if mbean_type.start_with? \"/\"\n name_value = mbean_type.slice(1,mbean_type.length-1)\n else\n name_value = mbean_type\n end\n end\n end\n\n return scope_value + \".\" + name_value\n end",
"title": ""
},
{
"docid": "03566c006c45252b7db60d9981d5b494",
"score": "0.42731792",
"text": "def addWatchingElement(name)\n if(name.is_a?(Array)) then\n\tname.each{ |n| \n\t addWatchingElement(n);\n\t}\n else\n\t@watcher.push(name) ;\n end\n end",
"title": ""
},
{
"docid": "062ea78121c0a9e74224a2dc45825e62",
"score": "0.42677802",
"text": "def send_solr_jmx_metrics_to_metric_reporter(mbean_type, collection_name, metric_aggr_type, solr_mbean_json_resp_obj)\n\n if mbean_type.start_with? \"/\"\n mbean_type = mbean_type.slice(1,mbean_type.length-1)\n end\n\n # Some mbean types contains slash(/). All such slashes will be converted to '.' ex: admin/segments will be converted to admin.segments\n mbean_type = mbean_type.sub(/\\//, '.')\n\n # Format of mbeans is:\n # {\n # \"solr:category=QUERY,dom1=core,dom2=ngiso-app_shard2_replica1,name=org.apache.solr.handler.component.SearchHandler,reporter=_jmx_994115484,scope=/select\":\n # {\n # \"95thPcRequestTime\": 0.392329,\n # \"99thPcRequestTime\": 0.392329\n # }\n #}\n mbeans = solr_mbean_json_resp_obj[\"value\"]\n\n # Format of mbean_names - solr:category=QUERY,dom1=core,dom2=ngiso-app_shard2_replica1,name=org.apache.solr.handler.component.SearchHandler,reporter=_jmx_994115484,scope=/select\n mbean_names = mbeans.keys\n\n mbean_aggr_metric_map_obj = Hash.new()\n mbeans.each do |mbean_name, mbean_metrics|\n\n mbean_metrics.each do |metric_key, metric_value|\n metric_value = get_raw_metrics(metric_value, mbean_aggr_metric_map_obj[metric_key])\n mbean_aggr_metric_map_obj[metric_key] = metric_value\n end\n end\n\n mbean_aggr_metric_map_obj.each do |metric_key, metric_agg_value|\n metric_key = metric_key.delete \"\\s\\n\"\n if metric_aggr_type == \"ADD_METRICS\"\n\n fields = {\"#{mbean_type}.\"+metric_key => metric_agg_value.to_s }\n\n # write metrics to medusa log (/opt/solr/log/jmx_medusa_stats.log)\n if (@medusa_log_writer != nil)\n if collection_name != nil && !collection_name.empty?\n @medusa_log_writer.write_medusa_log(collection_name, fields, @time)\n else\n @medusa_log_writer.write_medusa_log(MedusaLogWriter::CONST_CLUSTER_SUMMARY, fields, @time)\n end\n end\n\n # Write the metrics to Graphite\n if (@graphite_writer != nil)\n if collection_name != nil && !collection_name.empty?\n @graphite_writer.write_collection_specific_metric(\"#{mbean_type}.\"+metric_key, GraphiteWriter::CONST_CORE_SUMMARY, metric_agg_value.to_s, @time, collection_name)\n else\n @graphite_writer.write_metric(\"#{mbean_type}.\"+metric_key, GraphiteWriter::CONST_CORE_SUMMARY, metric_agg_value.to_s, @time)\n end\n end\n\n else\n metric_avg_aggr_value = metric_agg_value / mbean_names.size\n\n fields = {\"#{mbean_type}.\"+metric_key => metric_avg_aggr_value.to_s}\n # write metrics to medusa log (/opt/solr/log/jmx_medusa_stats.log)\n if (@medusa_log_writer != nil)\n if collection_name != nil && !collection_name.empty?\n @medusa_log_writer.write_medusa_log(collection_name, fields, @time)\n else\n @medusa_log_writer.write_medusa_log(MedusaLogWriter::CONST_CLUSTER_SUMMARY, fields, @time)\n end\n end\n\n # Write the metrics to Graphite\n if (@graphite_writer != nil)\n if collection_name != nil && !collection_name.empty?\n @graphite_writer.write_collection_specific_metric(\"#{mbean_type}.\"+metric_key, GraphiteWriter::CONST_CORE_SUMMARY, metric_avg_aggr_value.to_s, @time, collection_name)\n else\n @graphite_writer.write_metric(\"#{mbean_type}.\"+metric_key, GraphiteWriter::CONST_CORE_SUMMARY, metric_avg_aggr_value.to_s, @time)\n end\n\n end\n\n end\n end\n end",
"title": ""
},
{
"docid": "25a08fcdd579fcda4484dd0b37253e76",
"score": "0.42042005",
"text": "def get_bean(id)\n bean = @@app_ctx.get_bean id\n while bean.nil? do\n @@app_ctx = @app_ctx.get_parent\n bean = @app_ctx.get_bean id unless @app_ctx.nil?\n end\n return bean\n end",
"title": ""
},
{
"docid": "2ba277786f2c368f521b59535c196b59",
"score": "0.41983312",
"text": "def process_member_spec(spec)\n case spec.strip\n when /^['\"\\[]?(.+?)['\"\\]]?\\.(Parent|I?Children|I?R?Descendants|I?R?Ancestors|R?Level0|R?Leaves|I?Shared)$/i\n # Memer name with expansion macro\n mbr = self[$1]\n raise ArgumentError, \"Unrecognised #{self.name} member '#{$1}' in #{spec}\" unless mbr\n mthd = $2.downcase\n mthd += '_members' if mthd =~ /shared$/\n rels = mbr.send(mthd.intern)\n rels.is_a?(Array) ? rels : [rels]\n when /^['\"\\[]?(.+?)['\"\\]]?\\.(R)?(Level|Generation|Relative)\\(?(\\d+)\\)?$/i\n # Memer name with level/generation expansion macro\n mbr = self[$1]\n sign = $3.downcase == 'level' ? -1 : 1\n raise ArgumentError, \"Unrecognised #{self.name} member '#{$1}' in #{spec}\" unless mbr\n mbr.relative($4.to_i * sign, !!$2)\n when /^['\"\\[]?(.+?)['\"\\]]?\\.UDA\\(['\"]?(.+?)['\"]?\\)$/i\n # Memer name with UDA expansion macro\n mbr = self[$1]\n raise ArgumentError, \"Unrecognised #{self.name} member '#{$1}' in #{spec}\" unless mbr\n mbr.idescendants.select{ |mbr| mbr.has_uda?($2) }\n when /[@:,]/\n # An Essbase calc function or range - execute query and use results to find Member objects\n mbrs = []\n mbr_sel = try{ @cube.open_member_selection(\"MemberQuery\") }\n begin\n mbr_sel.execute_query(<<-EOQ.strip, spec)\n <OutputType Binary\n <SelectMbrInfo(MemberName, ParentMemberName)\n EOQ\n mbr_sel.get_members && mbr_sel.get_members.get_all.each do |ess_mbr|\n mbr = self[ess_mbr.name]\n raise ArgumentError, \"No member in #{self.name} named '#{ess_mbr.name}'\" unless mbr\n if mbr.parent && mbr.parent.name != ess_mbr.parent_member_name\n mbr = mbr.shared_members.find{ |mbr| mbr.parent.name == ess_mbr.parent_member_name }\n raise \"Cannot locate #{ess_mbr.name} with parent #{ess_mbr.parent_member_name}\" unless mbr\n end\n mbrs << mbr\n end\n ensure\n mbr_sel.close\n end\n mbrs\n when /^['\"\\[]?(.+?)['\"\\]]?$/\n # Plain member name\n mbr = self[$1]\n raise ArgumentError, \"Unrecognised #{self.name} member '#{$1}'\" unless mbr\n [mbr]\n else\n raise ArgumentError, \"Unrecognised #{self.name} member '#{spec}'\"\n end\n end",
"title": ""
},
{
"docid": "07219b7f01e745ac10b328c1080094e3",
"score": "0.4194917",
"text": "def parse(erm, elements) \n klas = Object.const_get(self.name.capitalize.to_s)\n elements.to_a(\"#{erm.name}/#{self.name}\").collect {|xml_ele| klas.new(self, xml_ele)}\n end",
"title": ""
},
{
"docid": "eb3639b13f24830cf1f53bf92e058fcf",
"score": "0.41642517",
"text": "def update_class_list_variable(element)\n element.children.each do |child_elem|\n elem_name = child_elem.name.to_sym\n next unless self.class.constants.include?(elem_name)\n\n # Ex. Ekispert::DataVersion.new(child_elem)\n sub_instance = self.class.const_get(elem_name).new(child_elem)\n class_list_name = \"#{snakecase(elem_name)}_list\"\n # Ex. sub_instance.version_list << sub_instance\n self.send(class_list_name) << sub_instance\n end\n end",
"title": ""
},
{
"docid": "3b6ef79d02d268c72f7f6af804174c15",
"score": "0.4156344",
"text": "def initialize(name, description)\n operations = self.class.all_operations.to_java MBeanOperationInfo\n attributes = self.class.all_attributes.to_java MBeanAttributeInfo\n @info = MBeanInfo.new name, description, attributes, nil, operations, nil\n end",
"title": ""
},
{
"docid": "580c16983511ea8ae01b76304a209faf",
"score": "0.41514948",
"text": "def index\n @beans = Bean.all\n end",
"title": ""
},
{
"docid": "18f4e69106a2513a120aeeaa2203d38e",
"score": "0.41037142",
"text": "def get_all(regexp)\n Jamie::Config::Collection.new(\n __getobj__.find_all { |i| i.name =~ regexp }\n )\n end",
"title": ""
},
{
"docid": "37dfc56baa5c73f74737f83e89338393",
"score": "0.41004336",
"text": "def elements_by_xpath(xpath)\r\n element = Element.new(nil, self)\r\n elem_names = element.elements_by_xpath(self, xpath)\r\n a = elem_names.inject([]) {|elements,name| elements << element_factory(name)}\r\n end",
"title": ""
},
{
"docid": "f0c000148ad86bc392a0b3a953c12503",
"score": "0.40577954",
"text": "def process_property_name\n return [create_name] unless @name.is_a?(Array)\n @name.inject([]) do |name, part|\n name << create_name(part)\n end\n end",
"title": ""
},
{
"docid": "046b1137af0ee32424ea45ecaba85a77",
"score": "0.4054014",
"text": "def get_mbeanmap_for_lowerversion\n metric_type_to_solr_core_mbean_attr_map = {\n \"ADD_METRICS\" => {\n \"type=/get,id=org.apache.solr.handler.RealTimeGetHandler\" =>\n [\"requests,5minRateReqsPerSecond,15minRateReqsPerSecond,timeouts,errors,clientErrors,serverErrors\"],\n \"type=/select,id=org.apache.solr.handler.component.SearchHandler\" =>\n [\"requests,5minRateReqsPerSecond,15minRateReqsPerSecond,timeouts,errors,clientErrors,serverErrors\"],\n \"type=/update,id=org.apache.solr.handler.UpdateRequestHandler\" =>\n [\"requests,5minRateReqsPerSecond,15minRateReqsPerSecond,timeouts,errors,clientErrors,serverErrors\"],\n \"type=fieldValueCache,id=org.apache.solr.search.FastLRUCache\" =>\n [\"hits,hitratio,evictions\"],\n \"type=filterCache,id=org.apache.solr.search.FastLRUCache\" =>\n [\"hits,hitratio,evictions\"],\n \"type=documentCache,id=org.apache.solr.search.LRUCache\" =>\n [\"hits,hitratio,evictions\"],\n \"type=queryResultCache,id=org.apache.solr.search.LRUCache\" =>\n [\"hits,hitratio,evictions\"],\n \"type=perSegFilter,id=org.apache.solr.search.LRUCache\" =>\n [\"hits,hitratio,evictions\"],\n \"type=updateHandler,id=org.apache.solr.update.DirectUpdateHandler2\" =>\n [\"commits,soft autocommits\"],\n \"type=/admin/segments,id=org.apache.solr.handler.admin.SegmentsInfoRequestHandler\" =>\n [\"requests\"],\n \"type=fieldCache,id=org.apache.solr.search.SolrFieldCacheMBean\" =>\n [\"entries_count\"]\n },\n \"AVG_METRICS\" => {\n \"type=/get,id=org.apache.solr.handler.RealTimeGetHandler\" =>\n [\"95thPcRequestTime,99thPcRequestTime\"],\n \"type=/select,id=org.apache.solr.handler.component.SearchHandler\" =>\n [\"95thPcRequestTime,99thPcRequestTime\"],\n \"type=/update,id=org.apache.solr.handler.UpdateRequestHandler\" =>\n [\"95thPcRequestTime,99thPcRequestTime\"]\n }\n }\n return metric_type_to_solr_core_mbean_attr_map\n end",
"title": ""
},
{
"docid": "9267a20c046040d54c76e74b041250f8",
"score": "0.40488175",
"text": "def research\n @name_parts.each_with_index do |name_part, index|\n @name_builtup << name_part\n\n # The last part should be the attribute name.\n if index == @name_parts.length - 1\n if attribute_result = attribute_by_builtup\n puts \"Attribute was: #{attribute_result[:name]}\" if @debug\n @attribute = attribute_result[:name]\n break\n else\n puts \"Not found: #{@name_builtup.join(\"_\")}\" if @debug\n next\n end\n end\n\n # Try next - maybe next key need to be added? (which is common!)\n next unless reflection_result = reflection_by_builtup\n\n @name_builtup = []\n name = reflection_result[:name]\n reflection = reflection_result[:reflection]\n\n puts \"Name: #{name}\" if @debug\n puts \"Reflection: #{reflection}\" if @debug\n\n @current_clazz = reflection.klass\n @generated_name_classes << {clazz: @current_clazz, reflection: reflection}\n end\n end",
"title": ""
},
{
"docid": "a50c25a100868492ad56b82e4ef3eb71",
"score": "0.40413767",
"text": "def element_definitions_by_name(names)\n return [] if names.blank?\n\n if names.to_s == \"all\"\n Element.definitions\n else\n Element.definitions.select { |e| names.include? e['name'] }\n end\n end",
"title": ""
},
{
"docid": "d7038d2959188ae329807277c91405d2",
"score": "0.4035753",
"text": "def research\n @name_parts.each_with_index do |name_part, index|\n @name_builtup << name_part\n\n # The last part should be the attribute name.\n if index == @name_parts.length - 1\n attribute_result = attribute_by_builtup\n next unless attribute_result\n\n @attribute = attribute_result.fetch(:name)\n break\n end\n\n # Try next - maybe next key need to be added? (which is common!)\n reflection_result = reflection_by_builtup\n next unless reflection_result\n\n @name_builtup = []\n reflection = reflection_result.fetch(:reflection)\n\n @current_clazz = reflection.klass\n @generated_name_classes << {clazz: @current_clazz, reflection: reflection}\n end\n end",
"title": ""
},
{
"docid": "b1742c831d70d20e86edb3a0ce3f4734",
"score": "0.40329358",
"text": "def elements\n @elements ||= @space_allocator.fields.map do |f|\n v = log[f.label]\n next unless v\n\n meth = \"render_#{f.label}\"\n elem = respond_to?(meth) ? __send__(meth, v) : default(f.label, v)\n\n elem[:label] = f.label\n elem[:value] = elem[:value].to_s\n elem[:width] = elem[:value].size\n\n f.record_length elem[:value].size\n\n elem\n end.compact\n end",
"title": ""
},
{
"docid": "f94eda4cdd6b0c6fe065a61b4778448d",
"score": "0.40194958",
"text": "def find_by_name_resolver\n return unless not_from_rest.nil?\n unless self.find_properties.blank?\n self.find_properties.each {|key, value|\n initialize_attr_accessors if self.find_property.nil? || self.current_value.nil?\n if value.is_a?(Hash)\n self.find_property = value[\"find_property\"] if value.has_key?(\"find_property\")\n self.current_value[value[\"find_property\"]] = value[\"current_value\"] if self.find_property && value.has_key?(\"current_value\")\n elsif value.is_a?(Array)\n value.each do |hsh|\n self.find_property << hsh[\"find_property\"] if hsh.has_key?(\"find_property\")\n self.current_value[hsh[\"find_property\"]] = hsh[\"current_value\"] if self.find_property && hsh.has_key?(\"current_value\")\n end\n end\n }\n end\n self.application_failed = find_application.nil?\n self.environment_failed = find_environment.nil?\n logger.info \"SS__ ComponentResolver: #{self.inspect}\"\n # from the validation loop\n return true\n end",
"title": ""
},
{
"docid": "319eec0a92807c704e9b624380dfe555",
"score": "0.4010328",
"text": "def propvaluearray(name) #:nodoc:\n @properties.select{ |f| f.name? name }.map{ |p| p.value }\n end",
"title": ""
},
{
"docid": "e23bba1c5ed67fed398b3495303d5f35",
"score": "0.3992107",
"text": "def property( name )\n ( @properties ||= Hash.new )[ name ]\n end",
"title": ""
},
{
"docid": "ff5a85e9991cecfb38b5d24f07e24aeb",
"score": "0.3986857",
"text": "def parse\n @klass.schema.combined_properties.each do |name, schema|\n add_accessors(name, schema)\n end\n\n @klass.schema.pattern_properties.each do |name, schema|\n @pattern_accessors.store(name, ::Jsclass::Accessor.new(name, :pattern_property, schema))\n end\n end",
"title": ""
},
{
"docid": "0989ae3fd5c728bc7a2d4de5fafce7fa",
"score": "0.3985541",
"text": "def attrs_from_props\n @doc.find('//apps:property').each do |entry|\n prop_name = entry.attributes['name'].to_sym\n if @map.keys.include?(prop_name)\n instance_variable_set \"@#{@map[prop_name]}\", check_value(entry.attributes['value'])\n end\n end\n end",
"title": ""
},
{
"docid": "d259e1d393b11bb86ace352a3fc61948",
"score": "0.39768502",
"text": "def properties\n { 'object_type' => 'array', 'elements' => @elements.map(&:properties) }\n end",
"title": ""
},
{
"docid": "ff48a0061671f1a7f559c1af41c03b07",
"score": "0.3962464",
"text": "def retrieve_members\n @root_member = nil\n @members = []\n shared = []\n @member_lookup = {}\n log.finer \"Retrieving members of dimension '#{@name}'\"\n alias_tbls = try{ @cube.get_alias_table_names.to_a }\n mbr_sel = try{ @cube.open_member_selection(\"MemberQuery\") }\n begin\n spec = %Q{@IDESCENDANTS(\"#{self.name}\")}\n query = <<-EOQ.strip\n <OutputType Binary\n <SelectMbrInfo(MemberName, MemberAliasName, ParentMemberName,\n MemberGeneration, MemberLevel, Consolidation,\n ShareOption, MemberFormula, UDAList)\n EOQ\n @cube.instrument 'retrieve_members', dimension: self do\n try{ mbr_sel.execute_query(query, spec) }\n end\n mbr_sel.get_members.get_all.each do |ess_mbr|\n mbr = Member.new(self, ess_mbr, alias_tbls)\n @members << mbr\n if mbr.shared?\n shared << mbr\n else\n @member_lookup[mbr.name.upcase] = mbr\n end\n end\n # Link shared members to non-shared member (and vice versa)\n shared.each do |smbr|\n mbr = @member_lookup[smbr.name.upcase]\n smbr.instance_variable_set(:@non_shared_member, mbr)\n mbr.instance_variable_get(:@shared_members) << smbr\n end\n @root_member = @member_lookup[self.name.upcase]\n # Convert parent names to references to the parent Member object\n # This can only be done after we've seen all members, since the\n # member selection query returns parents after children\n @members.each do |mbr|\n par = @member_lookup[mbr.parent.upcase]\n mbr.instance_variable_set(:@parent, par)\n par.instance_variable_get(:@children) << mbr if par\n end\n ensure\n try{ mbr_sel.close }\n end\n log.finer \"Retrieved #{@members.size} members\"\n end",
"title": ""
},
{
"docid": "3bcbf354e04b6071ed7aa3899df3e626",
"score": "0.39553726",
"text": "def [](name)\r\n\t\tif name == \"properties\" then @properties\r\n\t\telsif name == \"fields\" then @fields\r\n\t\telse @properties[prop_get(name)] || @fields[field_get(name)]\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "84e3e20f9ae86d4ad60e50ddd1f0cb98",
"score": "0.39478886",
"text": "def setting(name)\n roots = []\n if @environment_name\n roots << @config.send(@environment_name)\n end\n roots << @config\n roots.each do |root|\n begin\n setting_value = name.split('.').inject(root) { |node,prop| if node.include?(prop.to_sym) then node.send(prop) else raise \"Undefined property #{prop} for #{node.name}\" end}\n return setting_value\n rescue => e\n # Fall through to next case\n end\n end\n # If we get here the property does not exist\n #XXX - should probably ask for a default, and if one is not provided, raise an error\n nil\n end",
"title": ""
},
{
"docid": "4be2c421196a4b68e0e239f7d0e0e40b",
"score": "0.39465642",
"text": "def [](name)\n @elements[name]\n end",
"title": ""
},
{
"docid": "4be2c421196a4b68e0e239f7d0e0e40b",
"score": "0.39465642",
"text": "def [](name)\n @elements[name]\n end",
"title": ""
},
{
"docid": "a892eff2b82fabf492abe6115c147bbc",
"score": "0.39465094",
"text": "def get_children(name, args)\n children_hash = {}\n\n blue_prints.send(name).each do |child_key, child_blue_prints|\n child_location = location + \"[#{child_key}]\"\n\n children_hash[child_key] = args.fetch(:interface).new(driver,\n child_blue_prints,\n child_key, self, child_location)\n end\n\n children_hash\n end",
"title": ""
},
{
"docid": "6d742e275109da1fc5765c0dfed149d6",
"score": "0.39439037",
"text": "def method_missing name, *args\n# STDERR.puts \"Wbem::WsmanInstance.method_missing #{name}\"\n # http://stackoverflow.com/questions/8960685/ruby-why-does-puts-call-to-ary\n raise NoMethodError if name == :to_ary\n name = name.to_s\n assign = false\n if name[-1,1] == '=' # assignment\n name = name[0...-1]\n assign = true\n end\n type = _typemap[name]\n if type.is_a? Array\n invoke(name, type, args)\n else\n return nil unless type # unknown property\n if assign\n # property assignment\n self[name] = Wbem::Conversion.from_ruby type, args[0]\n else\n # property read\n value = self[name]\n Wbem::Conversion.to_ruby type, value\n end\n end\n end",
"title": ""
},
{
"docid": "be80834ee6cf3abc838f42b06f60b1d4",
"score": "0.39406717",
"text": "def list(name, &block)\n list_type = @compendium.type name.to_s.singularize.to_sym, &block\n\n add_property name.to_sym, list_type, true\n end",
"title": ""
},
{
"docid": "5475dffaeed786d7a121e948523bb9d2",
"score": "0.39314464",
"text": "def map name, &block\n mapped_name, mapped_class = name.first\n mappings[mapped_name] =\n HotCocoa::Mappings::Mapper.map_instances_of mapped_class, mapped_name, &block\n end",
"title": ""
},
{
"docid": "2310e0c29d865a9094af36fe9dd06b25",
"score": "0.39291468",
"text": "def get_property_path(element, path)\n path = path.split('/') unless path.is_a?(Array)\n element = [element] unless element.is_a?(Array)\n unless path.size < 1\n path_piece = path.shift\n results = []\n element.each do |el|\n results << get_property(el, path_piece)\n end\n element = get_property_path(results.flatten, path)\n end\n return element\n end",
"title": ""
},
{
"docid": "a92a9fdc5d40fd9ac3583399b0d7f4af",
"score": "0.3927136",
"text": "def term(name)\n element(name, :class=>:object_type)\n end",
"title": ""
},
{
"docid": "a92a9fdc5d40fd9ac3583399b0d7f4af",
"score": "0.3927136",
"text": "def term(name)\n element(name, :class=>:object_type)\n end",
"title": ""
},
{
"docid": "a92a9fdc5d40fd9ac3583399b0d7f4af",
"score": "0.3927136",
"text": "def term(name)\n element(name, :class=>:object_type)\n end",
"title": ""
},
{
"docid": "c79f9a8dcba3e08427b28085b3581f6c",
"score": "0.3921633",
"text": "def prefetch_property_hashes(names, portsdir, port_dbdir)\n names = [names] unless names.is_a?(Array)\n\n origins = names.select{|name| name=~/^#{PORTORIGIN_RE}$/}\n pkgnames_or_portnames = names - origins\n\n records_by_origin = search_ports_by_origin(origins, portsdir, port_dbdir)\n origins -= records_by_origin.keys\n\n records_by_pkgname = search_ports_by_pkgname(pkgnames_or_portnames, portsdir, port_dbdir)\n pkgnames_or_portnames -= records_by_pkgname.keys\n\n records_by_portname = search_ports_by_portname(pkgnames_or_portnames, portsdir, port_dbdir)\n pkgnames_or_portnames -= records_by_portname.keys\n\n array = records_by_portname.to_a + records_by_pkgname.to_a + records_by_origin.to_a\n\n errors = []\n missing = origins + pkgnames_or_portnames # what's left was not found\n unless missing.empty?\n list = missing.map{|m| \"'#{m}'\"}.join(', ')\n errors << \"the following packages could not be found: #{list}\"\n end\n detected = detect_ambiguous_search_results(array)\n unless detected.empty?\n detected[0] = \"found #{detected[0]}\"\n errors += detected\n end\n unless errors.empty?\n msg = errors.join(' and ')\n raise Puppet::Error, msg\n end\n\n # at this point we know, that array[i][1].length == 1 for each i\n Hash[ array.map{|key,records| [key, build_property_hash(records[0])]} ]\n end",
"title": ""
},
{
"docid": "845cbe019c6fe085ee10047feca8efde",
"score": "0.39204255",
"text": "def member_list\n members = []\n\n @spec['members'].each do |member|\n members << TypeSpec.new(member['type']).variable(member['name'])\n end\n\n members.join ', '\n end",
"title": ""
},
{
"docid": "6148ca64ea9b0fe6571945b7a1d7f1bf",
"score": "0.39146498",
"text": "def initialize(name, weighting, size, adjustable, total_memory)\n @name = MemoryBucket.validate_name name\n @weighting = validate_weighting weighting\n @size_specified = size ? validate_memory_size(size, 'size') : nil\n @adjustable = (validate_adjustable adjustable) && !@size_specified && total_memory\n @total_memory = total_memory ? validate_memory_size(total_memory, 'total_memory') : nil\n @size = @size_specified || default_size\n logger = JavaBuildpack::Diagnostics::LoggerFactory.get_logger\n logger.debug { inspect }\n end",
"title": ""
},
{
"docid": "6b0922a8e5b4ce6ee0db17784a86c57d",
"score": "0.3914007",
"text": "def nodes_for_name(name)\n if node = self.nodes[name]\n Config::ObjectList.new(node)\n elsif service = self.services[name]\n service.node_list\n elsif tag = self.tags[name]\n tag.node_list\n else\n {}\n end\n end",
"title": ""
},
{
"docid": "c5e53e2d0c76aeaa1741d3e5ed93ac7c",
"score": "0.39072958",
"text": "def get_solr_core_mbean_type_for_solr6_lower(mbean_name)\n mbean_parts = mbean_name.split(\",\")\n mbean_type = nil\n if solr_version_high()\n mbean_parts.each do |mbean_part|\n if mbean_part.start_with? \"scope=\"\n mbean_type = mbean_part.slice(mbean_part.index(\"scope=\")+6, mbean_part.length-1)\n # if mbean_type.start_with? \"/\"\n # mbean_type = mbean_type.slice(1,mbean_type.length-1)\n # end\n end\n end\n else\n mbean_parts.each do |mbean_part|\n if mbean_part.start_with? \"type=\"\n mbean_type = mbean_part.slice(mbean_part.index(\"type=\")+5, mbean_part.length-1)\n if mbean_type.start_with? \"/\"\n mbean_type = mbean_type.slice(1,mbean_type.length-1)\n end\n end\n end\n end\n return mbean_type\n end",
"title": ""
},
{
"docid": "01aeddfec4f6e9c1d670e1fdebe2edb7",
"score": "0.39060378",
"text": "def arrayofpathelements=(pathElements)\n arrayOfPathElements = pathElements\n if arrayOfPathElements.respond_to? \"patharray\"\n arrayOfPathElements = arrayOfPathElements.patharray\n end\n @elementHash[:arrayofpathelements] = arrayOfPathElements\n end",
"title": ""
},
{
"docid": "e4d20baba46dfcc3f127ca9c41f525b6",
"score": "0.38993323",
"text": "def cell_elements_by_name(name)\n if cell = cells.find_by_name(name)\n cell.elements\n else\n Alchemy::Logger.warn(\"Cell with name `#{name}` could not be found!\", caller.first)\n Element.none\n end\n end",
"title": ""
},
{
"docid": "d8ac87604bdb69c12d8a75d1f59889b4",
"score": "0.389603",
"text": "def compact(element, property = nil)\n if property.nil?\n debug(\"compact\") {\"element: #{element.inspect}, ec: #{context.inspect}\"}\n else\n debug(\"compact\") {\"property: #{property.inspect}\"}\n end\n case element\n when Array\n # 1) If value is an array, process each item in value recursively using\n # this algorithm, passing copies of the active context and the\n # active property.\n debug(\"compact\") {\"Array #{element.inspect}\"}\n result = depth {element.map {|v| compact(v, property)}}\n\n # If element has a single member and the active property has no\n # @container mapping to @list or @set, the compacted value is that\n # member; otherwise the compacted value is element\n if result.length == 1 && @options[:compactArrays]\n debug(\"=> extract single element: #{result.first.inspect}\")\n result.first\n else\n debug(\"=> array result: #{result.inspect}\")\n result\n end\n when Hash\n # 2) Otherwise, if element is an object:\n result = {}\n\n if k = %w(@list @set @value).detect {|container| element.has_key?(container)}\n debug(\"compact\") {\"#{k}: container(#{property}) = #{context.container(property)}\"}\n end\n\n k ||= '@id' if element.keys == ['@id']\n\n case k\n when '@value', '@id'\n # If element has an @value property or element is a node reference, return the result of performing Value Compaction on element using active property.\n v = context.compact_value(property, element, :depth => @depth)\n debug(\"compact\") {\"value optimization for #{property}, return as #{v.inspect}\"}\n return v\n when '@list'\n # Otherwise, if the active property has a @container mapping to @list and element has a corresponding @list property, recursively compact that property's value passing a copy of the active context and the active property ensuring that the result is an array with all null values removed.\n\n # If there already exists a value for active property in element and the full IRI of property is also coerced to @list, return an error.\n # FIXME: check for full-iri list coercion\n\n # Otherwise store the resulting array as value of active property if empty or property otherwise.\n compacted_key = context.compact_iri('@list', :position => :predicate, :depth => @depth)\n v = depth { compact(element[k], property) }\n\n # Return either the result as an array, as an object with a key of @list (or appropriate alias from active context\n v = [v].compact unless v.is_a?(Array)\n unless context.container(property) == '@list'\n v = {compacted_key => v}\n if element['@index']\n compacted_key = context.compact_iri('@index', :position => :predicate, :depth => @depth)\n v[compacted_key] = element['@index']\n end\n end\n debug(\"compact\") {\"@list result, return as #{v.inspect}\"}\n return v\n end\n\n # Check for property generators before continuing with other elements\n # For each term pg in the active context which is a property generator\n # Select property generator terms by shortest term\n context.mappings.keys.sort.each do |term|\n next unless context.mapping(term).is_a?(Array)\n # Using the first expanded IRI p associated with the property generator\n expanded_iris = context.mapping(term).map(&:to_s)\n p = expanded_iris.first.to_s\n\n # Skip to the next property generator term unless p is a property of element\n next unless element.has_key?(p)\n\n debug(\"compact\") {\"check pg #{term}: #{expanded_iris}\"}\n\n # For each node n which is a value of p in element\n node_values = []\n element[p].dup.each do |n|\n # For each expanded IRI pi associated with the property generator other than p\n next unless expanded_iris[1..-1].all? do |pi|\n debug(\"compact\") {\"check #{pi} for (#{n.inspect})\"}\n element.has_key?(pi) && element[pi].any? do |ni|\n nodesEquivalent?(n, ni)\n end\n end\n\n # Remove n as a value of all p and pi in element\n debug(\"compact\") {\"removed matched value #{n.inspect} from #{expanded_iris.inspect}\"}\n expanded_iris.each do |pi|\n # FIXME: This removes all values equivalent to n, not just the first\n element[pi] = element[pi].reject {|ni| nodesEquivalent?(n, ni)}\n end\n\n # Add the result of performing the compaction algorithm on n to pg to output\n node_values << n\n end\n\n # If there are node_values, or all the values from expanded_iris are empty, add node_values to result, and remove the expanded_iris as keys from element\n if node_values.length > 0 || expanded_iris.all? {|pi| element.has_key?(pi) && element[pi].empty?}\n debug(\"compact\") {\"compact extracted pg values\"}\n result[term] = depth { compact(node_values, term)}\n result[term] = [result[term]] if !result[term].is_a?(Array) && context.container(term) == '@set'\n\n debug(\"compact\") {\"remove empty pg keys from element\"}\n expanded_iris.each do |pi|\n debug(\" =>\") {\"#{pi}? #{element.fetch(pi, []).empty?}\"}\n element.delete(pi) if element.fetch(pi, []).empty?\n end\n end\n end\n\n # Otherwise, for each property and value in element:\n element.each do |key, value|\n debug(\"compact\") {\"#{key}: #{value.inspect}\"}\n\n if %(@id @type).include?(key)\n position = key == '@id' ? :subject : :type\n compacted_key = context.compact_iri(key, :position => :predicate, :depth => @depth)\n\n result[compacted_key] = case value\n when String\n # If value is a string, the compacted value is the result of performing IRI Compaction on value.\n debug {\" => compacted string for #{key}\"}\n context.compact_iri(value, :position => position, :depth => @depth)\n when Array\n # Otherwise, value must be an array. Perform IRI Compaction on every entry of value. If value contains just one entry, value is set to that entry\n compacted_value = value.map {|v2| context.compact_iri(v2, :position => position, :depth => @depth)}\n debug {\" => compacted value(#{key}): #{compacted_value.inspect}\"}\n compacted_value = compacted_value.first if compacted_value.length == 1 && @options[:compactArrays]\n compacted_value\n end\n elsif key == '@index' && context.container(property) == '@index'\n # Skip the annotation key if annotations being applied\n next\n else\n if value.empty?\n # Make sure that an empty array is preserved\n compacted_key = context.compact_iri(key, :position => :predicate, :depth => @depth)\n next if compacted_key.nil?\n result[compacted_key] = value\n next\n end\n\n # For each item in value:\n value = [value] if key == '@index' && value.is_a?(String)\n raise ProcessingError, \"found #{value.inspect} for #{key} of #{element.inspect}\" unless value.is_a?(Array)\n value.each do |item|\n compacted_key = context.compact_iri(key, :position => :predicate, :value => item, :depth => @depth)\n\n # Result for this item, typically the output object itself\n item_result = result\n item_key = compacted_key\n debug {\" => compacted key: #{compacted_key.inspect} for #{item.inspect}\"}\n next if compacted_key.nil?\n\n # Language maps and annotations\n if field = %w(@language @index).detect {|kk| context.container(compacted_key) == kk}\n item_result = result[compacted_key] ||= Hash.new\n item_key = item[field]\n end\n\n compacted_item = depth {self.compact(item, compacted_key)}\n debug {\" => compacted value: #{compacted_value.inspect}\"}\n\n case item_result[item_key]\n when Array\n item_result[item_key] << compacted_item\n when nil\n if !compacted_value.is_a?(Array) && context.container(compacted_key) == '@set'\n compacted_item = [compacted_item].compact\n debug {\" => as @set: #{compacted_item.inspect}\"}\n end\n item_result[item_key] = compacted_item\n else\n item_result[item_key] = [item_result[item_key], compacted_item]\n end\n end\n end\n end\n\n # Re-order result keys\n r = Hash.ordered\n result.keys.kw_sort.each {|kk| r[kk] = result[kk]}\n r\n else\n # For other types, the compacted value is the element value\n debug(\"compact\") {element.class.to_s}\n element\n end\n end",
"title": ""
},
{
"docid": "13483e6a70e382d044cb0adf19f1ba8a",
"score": "0.38862336",
"text": "def process_class exp\n if exp.class_name == :Application\n @inside_config = true\n process_all exp.body if sexp? exp.body\n @inside_config = false\n end\n\n exp\n end",
"title": ""
},
{
"docid": "f47a0ab437933cf979849c9320e4eb7c",
"score": "0.38843212",
"text": "def [](name)\n self.class._mwares[name]\n end",
"title": ""
},
{
"docid": "d0a6eb665d73a12e8fd6c40154abb710",
"score": "0.38825983",
"text": "def definition\n if definition = self.class.definition_by_name(name)\n definition\n else\n log_warning \"Could not find element definition for #{name}. \" \\\n \"Please check your elements.yml file!\"\n {}\n end\n end",
"title": ""
},
{
"docid": "4f64d4e2b3ef8bc7378ba0824db0a3b8",
"score": "0.38774893",
"text": "def walk()\n @state.each do |state|\n desc = state.respond_to?(:name) ? state.name : @name\n boots(state,@path,desc)\n end\n return @results\n end",
"title": ""
},
{
"docid": "6d19b4349f22129f1ed355c7998b4f98",
"score": "0.3877457",
"text": "def definition\n if (definition = self.class.definition_by_name(name))\n definition\n else\n log_warning \"Could not find element definition for #{name}. \" \\\n \"Please check your elements.yml file!\"\n {}\n end\n end",
"title": ""
},
{
"docid": "ea4ec22a908b0c888b492e99fa2e632d",
"score": "0.38744187",
"text": "def property(name); end",
"title": ""
},
{
"docid": "126686b6264840e9a23a17823479dc07",
"score": "0.38696954",
"text": "def inspect\n generate_inspect(self, :name, :cache, :elements)\n end",
"title": ""
},
{
"docid": "a0a54e22ecdaeb3520e40ee4fe51f2b8",
"score": "0.38661763",
"text": "def expand_properties\n @properties.each do |key,value|\n value.expand_to_element self\n end\n end",
"title": ""
},
{
"docid": "4f3207a7d82d6c0afddd9b0fb13f7b5b",
"score": "0.38659477",
"text": "def property(name, opts)\n @properties ||= []\n @properties << Property.new(name, opts)\n end",
"title": ""
},
{
"docid": "0baddd0c721d055cdc86a5aace5180b1",
"score": "0.38634187",
"text": "def definition_by_name(name)\n ElementDefinition.get(name)\n end",
"title": ""
},
{
"docid": "aee277d45219923f25c70414cfc9983b",
"score": "0.38540992",
"text": "def containers\n obj = parse_object(1)\n return nil unless obj && obj.m_Container && obj.m_Container.array?\n obj.m_Container.value.map do |e|\n {:name => e.first.value, :preload_index => e.second.preloadIndex.value, :path_id => e.second.asset.m_PathID.value}\n end\n end",
"title": ""
},
{
"docid": "043e9c11bc48ada72de269ae6e2a1573",
"score": "0.38523543",
"text": "def get_solr_core_mbean_name_for_solr7(mbean_name, collection_name)\n\n if collection_name != nil && !collection_name.empty?\n # Solr Mbean object name created by the JMX reporter are hierarchical, dot-separated but also properly structured in JConsole.\n # This hierarchy consists of following elements : (registry name, reporter name, category, scope, name)\n # 1. registry name - It contains dot seperated registry names that the metrics will be shown under particular hierarchy.\n # Each domain part will be assigned to the dom variables. ex: dom1, dom2, ... domN properties in registry element.\n # 2. reporter - This element contains the reporter name i.e _jmx_\n solr_mbean_name = \"solr:dom1=core,dom2=#{collection_name},dom3=*,dom4=*,#{mbean_name}\"\n else\n solr_mbean_name = \"solr:dom1=core,dom2=*,reporter=*jmx*,#{mbean_name}\"\n end\n\n return solr_mbean_name\n end",
"title": ""
},
{
"docid": "86e9219864a0e6bbb26b75868e278160",
"score": "0.38493645",
"text": "def call(name) # motor\n #name = name.to_s\n if w = @dict[name]\n w.call(self)\n else # other lookups\n case name\n when /^\\[.*\\]$/ # quote\n push(name[1..-2])\n when /^'/ # single quote\n push(name[1..-1])\n when /^[+-]?\\d+$/ # integer\n push(name.to_i)\n when /^[+-]?\\d+\\.\\d+$/ # float\n push(name.to_f)\n # TODO: add hooks for extensible types / macros\n else\n raise WordNotFound, \"word `#{name}` does not exist in dictionary\"\n end\n end\n self\n end",
"title": ""
},
{
"docid": "0fe70910579478456358c07d5eb37c9d",
"score": "0.38447335",
"text": "def members\n @source.get_elements('//Member').map { |item| Member.new(item) }\n end",
"title": ""
},
{
"docid": "3888797295abc4bb07d0371e94ecf09c",
"score": "0.3836751",
"text": "def job_grep name='.'\n recipe_grep(name)\n .map{ |r| r.job.select{ |n| n.name === name } }\n .flatten\n end",
"title": ""
},
{
"docid": "23be9852f0d4e13a6781f8febfc1c481",
"score": "0.3834907",
"text": "def children_lookup(cube_unique_name, member = nil, recursive = false)\n return dimensions cube_unique_name if member.nil?\n\n if member.split(\".\").length == 1\n cube(cube_unique_name).get_dimensions.reject { |dimension| dimension.get_unique_name != member }.first.get_hierarchies.map { |hierarchy| hierarchy.get_root_members.map { |member| dimension(member, recursive)} }.flatten\n else\n children cube(cube_unique_name).send(:lookup_member, Java::OrgOlap4jMdx::IdentifierNode.parse_identifier(member).get_segment_list()), recursive\n end\n end",
"title": ""
},
{
"docid": "c0e4b0776931f69568c0f448378f91cb",
"score": "0.38333356",
"text": "def find_property(properties, path, res_name = '')\n # Add context for debugging property name typos\n available = []\n prefix = ''\n\n prop = nil\n path.each do |part|\n available = properties.map { |p| prefix + p.name } unless properties.empty?\n prefix = \"#{prefix}#{part}.\"\n\n prop = properties.select { |o| o.name == part }.first\n properties = prop&.nested_properties || []\n end\n raise \"#{path.join('.')} does not exist on #{res_name}.\\n Possible values #{available}\" \\\n unless prop\n\n prop\n end",
"title": ""
},
{
"docid": "0d39a3bae4359d245c6f010d434bbd38",
"score": "0.3830674",
"text": "def get_elements(path)\n elements = self./(path)\n return nil unless elements\n elements = elements.map{|element| Element.new(element)}\n end",
"title": ""
},
{
"docid": "ea62f3538a6b91badd336c770fc571d3",
"score": "0.38285586",
"text": "def elements(name, *find_args)\n build_elements(name, *find_args) do\n define_method(name) do |*runtime_args, &block|\n raise_if_block(self, name, !block.nil?, :elements)\n _all(*merge_args(find_args, runtime_args))\n end\n\n create_get_element_params(name, find_args)\n end\n end",
"title": ""
},
{
"docid": "c345a1fad357891f560608bd27d50acd",
"score": "0.38276038",
"text": "def find_all(name)\n if name and not name.empty?\n proxy_owner.send(:list_queues, \"QueueNamePrefix\" => name)\n else\n proxy_target\n end\n end",
"title": ""
},
{
"docid": "1a8b3ae37b4e6370b3600a73baa26558",
"score": "0.3827125",
"text": "def collect_solr_core_jmx_metrics(metric_type_to_solr_core_mbean_attr_map)\n collections, collection_to_core_name_map = execute_solr_jmx_list_request()\n if @metric_level == \"CollectionLevel\"\n # If the metric level is equal to 'CollectionLevel' then aggregating the metrics of all cores for each collection on a node.\n collections.each do |collection_name|\n updated_metric_type_to_solr_core_mbean_attr_map = construct_jmx_metrics_with_core_name_as_id(metric_type_to_solr_core_mbean_attr_map, collection_name, collection_to_core_name_map)\n solr_core_mbean_bulk_request, metric_type_to_mbean_type_obj = create_solr_core_mbean_bulkrequest_and_mbeantype_list(updated_metric_type_to_solr_core_mbean_attr_map, collection_name)\n execute_solr_core_jmx_read_request(solr_core_mbean_bulk_request, metric_type_to_mbean_type_obj, collection_name)\n end\n else\n # If the metric level is not equal to 'CollectionLevel' then the other option 'ClusterLevel' was choosen.\n # Hence, aggregating the metrics at cluster level. i.e, For all cores on a node.\n solr_core_mbean_bulk_request, metric_type_to_mbean_type_obj = create_solr_core_mbean_bulkrequest_and_mbeantype_list(metric_type_to_solr_core_mbean_attr_map, nil)\n execute_solr_core_jmx_read_request(solr_core_mbean_bulk_request, metric_type_to_mbean_type_obj, nil)\n end\n end",
"title": ""
},
{
"docid": "50b18e1b4e4db1fbb2e1da4d4663a9ad",
"score": "0.38238403",
"text": "def structure\n [\n item('Churches', path: admin_churches_path),\n item('Members', path: admin_members_path),\n item('Suppliers', path: admin_suppliers_path),\n item('Accounts', path: admin_accounts_path),\n item('Recurrings', path: admin_recurrings_path),\n item('Entries', path: admin_entries_path),\n item('Campaigns', path: admin_campaigns_path),\n ]\n end",
"title": ""
},
{
"docid": "2e8b1e8a714ad7cfa3aae1e4561414b8",
"score": "0.38162607",
"text": "def get_property(element, property)\n prop = nil\n\n return [element.get_attribute(property)] if element.has_attribute?(property)\n\n props = element.xpath(\"./#{property}\")\n return [] if props.nil?\n\n results = []\n props.each do |prop|\n # we should now have an element\n next if ! prop.kind_of?(Nokogiri::XML::Element)\n\n resolved_children = resolve_elements(prop.children)\n if property =~ /\\[(.*)\\]$/\n results << resolved_children[$1.to_i]\n end\n results << resolved_children\n end\n return results\n end",
"title": ""
},
{
"docid": "dc087ddcc27171b2a4d0a658a629e46d",
"score": "0.38139284",
"text": "def many(name, *paths)\n transform = pop_transformation paths\n\n define_method name do\n @node.search(*paths).map { |node| transform.call node }\n end\n end",
"title": ""
},
{
"docid": "f0d195ae5a0b5fd0383f149de144a89c",
"score": "0.38121963",
"text": "def build\n return @entries.first.elements if @entries.length == 1\n @entries.each(&:restrict)\n\n @entries.flat_map do |entry|\n entry.restricted_elements.map do |element|\n next if (level_ids_in_grain - element.grain_level_ids).present?\n element.grain_hash\n end.compact\n end.uniq.map do |grain_hash|\n elm = VirtualElement.new grain_hash, @memory_slice, @entries.map(&:element_locator)\n elm.rollup(*@virtual_metrics)\n end\n end",
"title": ""
},
{
"docid": "b258157d9eb5f7e67daaf7f0be0db7dd",
"score": "0.3811085",
"text": "def form_elements(model_name, *field_names)\n options = field_names.extract_options!\n\n patterned_elements \"\\##{model_name}_%{element_name}\", *field_names, options.slice(:element_array)\n end",
"title": ""
},
{
"docid": "7072f6b44ef75e195c6b2e09633cdcda",
"score": "0.38103053",
"text": "def get_bean(bean_metadata)\n RequestStore.store[:_iocrb_beans] ||= {}\n if bean = RequestStore.store[:_iocrb_beans][bean_metadata.name]\n bean\n else\n @bean_factory.create_bean_and_save(bean_metadata, RequestStore.store[:_iocrb_beans])\n end\n end",
"title": ""
},
{
"docid": "41c5d5d949e9694c7a77cd069b78b4d6",
"score": "0.38094708",
"text": "def property(*props)\n if props.size == 2 and props[1].kind_of?(Hash)\n props[1].each_pair do |key,value|\n pname = props[0].to_sym\n properties_info[pname] ||= {}\n properties_info[pname][key] = value\n end\n props = props[0..0]\n end\n\n props.each do |prop|\n pname = prop.to_sym\n properties_info[pname] ||= {}\n properties_info[pname][:defined] = true\n \n define_method(pname) do\n get_property(pname.to_s)\n end\n\n name = (pname.to_s() +\"=\").to_sym\n define_method(name) do |value|\n set_property(pname.to_s, value)\n end\n end\n end",
"title": ""
},
{
"docid": "4f312e03406f270f76439ea34950de74",
"score": "0.3805696",
"text": "def [] name\n get name\n end",
"title": ""
},
{
"docid": "4648be745d15e79e43fa701adefe8cf9",
"score": "0.37993738",
"text": "def els(element_name)\n element_reader = get_locator(element_name)\n begin\n if element_reader.length > 0\n element_reader.each do |k,v|\n if(k=='class' || k=='css' || k=='id' || k=='xpath' || k=='partial_link_text' || k=='tag_name')\n begin\n $elems = $driver.find_elements(k.to_sym,v.to_s)\n $LOG.info \"Elements found \\n #{element_name} : #{k} => #{v}\"\n rescue Exception => e\n $LOG.error \"Element not found \"\n $LOG.error \"#{element_name} : #{k} => #{v}\"\n $LOG.error \"Error message :: \" + e.message\n raise \"Element not found \\n #{element_name} : #{k} => #{v} \\n Error Message :: \" + e.message\n end\n $elems\n end\n end\n else\n $LOG.error \"Element not present in object repository\"\n raise \"Element not present in object repository\"\n end\n $elems\n rescue Exception => e\n $LOG.error \"Error in finding the element :: \" + e.message\n raise \"Error in finding the element :: \" + e.message\n end\n end",
"title": ""
},
{
"docid": "700670e7b237c77455f1961fc2b89c59",
"score": "0.37987846",
"text": "def get_elements(path)\n elements = self./(path)\n return unless elements\n elements = elements.map{|element| Element.new(element)}\n end",
"title": ""
},
{
"docid": "b51804283b22656dd853834194bc611e",
"score": "0.37980562",
"text": "def prefix_elements\n\n\t\t[ :process_name, :thread_id, :timestamp, :severity ]\n\tend",
"title": ""
},
{
"docid": "7ec94bf99c72d71f470b32ebfc44cec8",
"score": "0.3798004",
"text": "def [](name)\n _mwares[name]\n end",
"title": ""
},
{
"docid": "fb82e26a1dd2c9a088b78eba06cfd851",
"score": "0.37964863",
"text": "def query\n # support names, portorigin, pkgname and portname\n (inst = self.class.instances([name]).last) ? inst.properties : nil\n end",
"title": ""
},
{
"docid": "c047cb3512e8cff3662aabe7e9e39188",
"score": "0.3795065",
"text": "def mx_records\n @mx_records ||= Resolv::DNS.open do |dns|\n records = dns.getresources(name, Resolv::DNS::Resource::IN::MX)\n records.map(&:exchange).join(\" \")\n end\n end",
"title": ""
},
{
"docid": "3def5b1c726cb5477a743b45c0f9b583",
"score": "0.37934798",
"text": "def entries\n xpath './alias', './bookmark', './folder', './separator'\n end",
"title": ""
},
{
"docid": "9ee1f6a12eef60fbc80c78765390d6d6",
"score": "0.37894252",
"text": "def [] aProp\n access_prop(aProp)\n end",
"title": ""
},
{
"docid": "fd139ef8e103c17df7d0cc2ac37f8671",
"score": "0.37880445",
"text": "def members\n values.map(&method(:new))\n end",
"title": ""
},
{
"docid": "7c16e52d97b698141d09c2c9e5d08b71",
"score": "0.37876102",
"text": "def objects_of_type(name)\n find_all { |r| name === r['type'] }\n end",
"title": ""
},
{
"docid": "69c58ef31fd79af0ec6dbd270ba1808b",
"score": "0.3782049",
"text": "def [](name)\n return super(name) if name.is_a?(Fixnum)\n\n if name == 'children'\n fail 'Starting sabre/vobject 4.0 the children property is now protected. You should use the children method instead'\n end\n\n matches = select(name)\n\n if matches.empty?\n return nil\n else\n first_match = matches.first\n # @return [first_match] Property\n first_match.iterator = ElementList.new(matches.to_a)\n return first_match\n end\n end",
"title": ""
},
{
"docid": "4caf91a3486cb072aaacfa7f1598e2ae",
"score": "0.377983",
"text": "def inspect\n generate_inspect(self, :path, :elements)\n end",
"title": ""
},
{
"docid": "cf576822d3908f45939a8bc656b085ec",
"score": "0.37768677",
"text": "def filter property_blueprints, jobName\n imap = ignore_map jobName,true\n #STDERR.puts \"ignore map is:: \"+imap.to_s\n property_blueprints.select {|propblue|\n imap[propblue[\"name\"]].nil?\n }\n end",
"title": ""
},
{
"docid": "4b5185710b49055c670af0b4e7100336",
"score": "0.37744647",
"text": "def elements(elements = {})\n elements.each do |k,v|\n define_accessor(k.underscore, v)\n end\n @class_elements = elements\n end",
"title": ""
},
{
"docid": "bb9845b0e2be181dca6e7d1f15bb9e92",
"score": "0.37659428",
"text": "def collect_metrics(name, check_cfg)\n metrics = []\n begin\n # invoke method name method on metric object\n metrics = @metrics.send(name, check_cfg)\n # :nocov:\n rescue NoMethodError => e\n log.error(\n \"Method '#{name}' is not present on Metrics object: '#{e}'\"\n )\n end\n # :nocov:\n metrics\n end",
"title": ""
},
{
"docid": "1bfc861e6ab0dff30a5817ab2378ad0a",
"score": "0.3764881",
"text": "def [](name)\n @j_map.get(name)\n end",
"title": ""
},
{
"docid": "adc7baab89d9c2129bf3ac6e9122c4e8",
"score": "0.3764119",
"text": "def element_property(element, name)\n execute_script 'return arguments[0][arguments[1]]', element, name\n end",
"title": ""
},
{
"docid": "c6d007584808676f5938cb390d97b046",
"score": "0.37552845",
"text": "def []( name )\n\n\t\t# Query root\n\t\tresult = @root.find_name name\n\n\t\tif result.empty?\n\t\t\tnil\n\t\telsif result.size == 1 # Only one match found\n\t\t\tresult.last.value\n\t\telse\n\t\t\tresult\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f2746c9620115bd78f99397c357fc4eb",
"score": "0.37532642",
"text": "def [](name)\n @configs[name]\n end",
"title": ""
},
{
"docid": "f2746c9620115bd78f99397c357fc4eb",
"score": "0.37532642",
"text": "def [](name)\n @configs[name]\n end",
"title": ""
},
{
"docid": "4e554a4b52fd504e3fc3edc9c6f1a5c0",
"score": "0.37525985",
"text": "def array_of_name_value_hash_for(collection_klass, item_klass, name)\n injected = injected_options.fetch(name, nil)\n if injected\n injected = collection_klass.new(\n injected.map do |l|\n item_klass.new(\n *l.flatten,\n resource: resource, serializer: serializer\n )\n end\n )\n end\n\n allowed = collection_klass.new(\n allowed_options.fetch(name).map do |l|\n item_klass.new(\n *l,\n resource: resource, serializer: serializer\n )\n end\n )\n\n collection_klass.new(priority_options_for(\n # TODO: correctly loop over injected properties\n injected: injected,\n allowed: allowed\n ).uniq(&:name))\n end",
"title": ""
},
{
"docid": "ae48d77524083f58db8b96d108da0b78",
"score": "0.37525064",
"text": "def config(path_elements)\n path_elements.inject(project_config){|reduction, path_element| reduction[path_element]} rescue nil\nend",
"title": ""
},
{
"docid": "1afb1214bb969f641ae6a990a42742ad",
"score": "0.3750082",
"text": "def lookup_config(name)\n\t\tend",
"title": ""
}
] |
64f430e09d2f83b35fe408bfa4305fe9
|
Deserializes a value of this type as returned by the server.
|
[
{
"docid": "11b3b62d7ddc0a1a4dfd24fa8dd403df",
"score": "0.0",
"text": "def deserialize(bytes)\n return nil if bytes.nil?\n deserializer.call(bytes)\n end",
"title": ""
}
] |
[
{
"docid": "118f3949a4f1c1e8e15c591924a8b6a9",
"score": "0.82730633",
"text": "def deserialize(value)\n cast(value)\n end",
"title": ""
},
{
"docid": "6c72d7a49830a02cd8df411fc5290e68",
"score": "0.7819937",
"text": "def deserialize(value); end",
"title": ""
},
{
"docid": "6c72d7a49830a02cd8df411fc5290e68",
"score": "0.7819937",
"text": "def deserialize(value); end",
"title": ""
},
{
"docid": "e0ec94bf60bf112b5c2d326ecc08c8dd",
"score": "0.7744025",
"text": "def deserialize(value)\n raise \"Must be implemented\"\n end",
"title": ""
},
{
"docid": "bb10fd597a0850a662862ac04db09176",
"score": "0.75116706",
"text": "def deserialize(value)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "b2910e57790d75ad6fab3c86ff196cba",
"score": "0.69113874",
"text": "def deserialize(value)\n value = super(value)\n value ? value.unpack1(PACK_FORMAT) : nil\n end",
"title": ""
},
{
"docid": "b7d7975b5deb823a0640c605522cd320",
"score": "0.6900013",
"text": "def deserialize(value)\n JSON.parse(value, symbolize_names: true)\n end",
"title": ""
},
{
"docid": "bcf7055302a673cc7792d2718e284a89",
"score": "0.6869545",
"text": "def unserialize(value)\n value\n end",
"title": ""
},
{
"docid": "bcc202e9dcb0745d689a4062999443a7",
"score": "0.6847893",
"text": "def value\n if @value.nil? && serialized_value\n @value = deserialized_value\n end\n @value\n end",
"title": ""
},
{
"docid": "2b19c67759cc2dbda6fcfc0ad3391dec",
"score": "0.68171656",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = VericredClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ecd2b5e1ecf08a0229b8465f0f888618",
"score": "0.6809944",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = UltracartClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "4da1c9caef0d46acd87f4f1efa4bd842",
"score": "0.6790142",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n Radarbox.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "4da1c9caef0d46acd87f4f1efa4bd842",
"score": "0.6790142",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n Radarbox.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "b97d5636ae542bf5ed4170ca1e934531",
"score": "0.67848504",
"text": "def deserialize(value)\n cast_to_uuid(s_deserialize(value))\n end",
"title": ""
},
{
"docid": "47508d2bb1f32ccf495ab3b842da1934",
"score": "0.6783924",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = BombBomb.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "47508d2bb1f32ccf495ab3b842da1934",
"score": "0.6783924",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = BombBomb.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "47508d2bb1f32ccf495ab3b842da1934",
"score": "0.6783924",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = BombBomb.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "b24020f6db4b9281a2d1c9691a85ebde",
"score": "0.6783002",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n Hubspot::Cms::Domains.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "dd266edc3e62a8c423086bb6120e0e34",
"score": "0.67695445",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n Nodeum.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "668fef26eefacc1c3166c89ae867c575",
"score": "0.6765429",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = StravaClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "3e3c00a8309b42cbf9ec35f30ada53ac",
"score": "0.6753975",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Hubspot::Cms::Domains.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "c087b07780146799ada794b9733f175d",
"score": "0.67497855",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = BudgeaClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "001ab617bba4cfc88b7c1bcb9e34cfa7",
"score": "0.67494345",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n InfluxDB2::API.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "cfda58bf1177b053db1ee3061d614932",
"score": "0.67450225",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n KeycloakRest.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "cfda58bf1177b053db1ee3061d614932",
"score": "0.67450225",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n KeycloakRest.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "c863fc4789e57a5b06d07ea3e4c657bb",
"score": "0.6739505",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n EdinetAPIClient.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "f5fd9871702eeb0e840a41b6d80471ce",
"score": "0.6739027",
"text": "def deserialize( data )\n self.class.deserialize( data )\n end",
"title": ""
},
{
"docid": "8474dbad225f9c51e45956c1849b6063",
"score": "0.67295724",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = VictorOpsClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "8474dbad225f9c51e45956c1849b6063",
"score": "0.67295724",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = VictorOpsClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "2f3b5300aa69bf87b4ce18745ee69158",
"score": "0.672777",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ReliefWebAPI.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "3f8c980c677776776a53e110fe09f877",
"score": "0.672244",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = IFClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "3f8c980c677776776a53e110fe09f877",
"score": "0.672244",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = IFClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "fb23ae0fc0ae96400b1c9a6c90e2cab6",
"score": "0.67211485",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n AvmClient.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ad01a4ac6b7f8a90603a753edbab5ec7",
"score": "0.6718899",
"text": "def _deserialize(value)\n MultiJson.load(value)\n end",
"title": ""
},
{
"docid": "9163703619be533c73fa08738218a05e",
"score": "0.6718738",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = SamplifyAPIClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "3f0a1e6cd992b7fd52395b34ad285131",
"score": "0.6712969",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TreezorClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "3f0a1e6cd992b7fd52395b34ad285131",
"score": "0.6712969",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TreezorClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "3f0a1e6cd992b7fd52395b34ad285131",
"score": "0.6712969",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TreezorClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "3f0a1e6cd992b7fd52395b34ad285131",
"score": "0.6712969",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TreezorClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "3f0a1e6cd992b7fd52395b34ad285131",
"score": "0.6712969",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TreezorClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "3f0a1e6cd992b7fd52395b34ad285131",
"score": "0.6712969",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TreezorClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "3f0a1e6cd992b7fd52395b34ad285131",
"score": "0.6712969",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TreezorClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "0816deffeb37c7c4df5acb55edb7449f",
"score": "0.67094904",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(parse_date(value))\n when :Date\n Date.parse(parse_date(value))\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BigDecimal\n BigDecimal(value.to_s)\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n XeroRuby::Finance.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "0816deffeb37c7c4df5acb55edb7449f",
"score": "0.67094904",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(parse_date(value))\n when :Date\n Date.parse(parse_date(value))\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BigDecimal\n BigDecimal(value.to_s)\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n XeroRuby::Finance.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "0e9a331de50cc04991762af5699bf8b7",
"score": "0.6708071",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n DearInventoryRuby.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "0e9a331de50cc04991762af5699bf8b7",
"score": "0.6708071",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n DearInventoryRuby.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "0e9a331de50cc04991762af5699bf8b7",
"score": "0.6708071",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n DearInventoryRuby.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "395a849d1c636176f34d19b18f727f9d",
"score": "0.66988635",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n PulpDockerClient.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "db6ede8a72980d81a84e5e3093c5b291",
"score": "0.6691593",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = NfeClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "9487ff034d72699f5b43e1902cde6d39",
"score": "0.6688467",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TelestreamCloud::Flip.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "9487ff034d72699f5b43e1902cde6d39",
"score": "0.6688467",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TelestreamCloud::Flip.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "e5bbbd49ff11db3233f9052727c88af1",
"score": "0.6688461",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = LemonWayClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "e5bbbd49ff11db3233f9052727c88af1",
"score": "0.6688461",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = LemonWayClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "e5bbbd49ff11db3233f9052727c88af1",
"score": "0.6688461",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = LemonWayClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "cafa16826237c7c6cd554da2359c1c04",
"score": "0.66881585",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = JCAPIv1.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "f7399a64586ca76ee18a97535738006a",
"score": "0.6677509",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = CrelateClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "f7399a64586ca76ee18a97535738006a",
"score": "0.6677509",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = CrelateClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "f7399a64586ca76ee18a97535738006a",
"score": "0.6677509",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = CrelateClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "ccb7ff760bcdebd1528420a816e34f7c",
"score": "0.6674047",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ZenodoClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "b5be27a945d64a868f639a782fa8dae1",
"score": "0.6669556",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n MailSlurpClient.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "b5be27a945d64a868f639a782fa8dae1",
"score": "0.6669556",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n MailSlurpClient.const_get(type).build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "a418b216012971181d2d52000c20ec8b",
"score": "0.6667778",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = BitbarCloudApiClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "a418b216012971181d2d52000c20ec8b",
"score": "0.6667778",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = BitbarCloudApiClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "a418b216012971181d2d52000c20ec8b",
"score": "0.6667778",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = BitbarCloudApiClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "a418b216012971181d2d52000c20ec8b",
"score": "0.6667778",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = BitbarCloudApiClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
},
{
"docid": "a418b216012971181d2d52000c20ec8b",
"score": "0.6667778",
"text": "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = BitbarCloudApiClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end",
"title": ""
}
] |
037e450b4d48f75749d20abe2d90b3fa
|
cleaner solution using basic array and string functions
|
[
{
"docid": "a927442ae4a9c2c29047a254664bcb2a",
"score": "0.0",
"text": "def Fizz2\r\n\t\t(1..100).each do |x|\r\n\t\t\tstr = [(\"Fizz\" if x % 3 == 0),(\"Buzz\" if x % 5 == 0)].compact.join\r\n\t\t\tif str == \"\" then str << x.to_s end\r\n\t\t\tputs str\t\t\r\n\t\tend\r\n\tend",
"title": ""
}
] |
[
{
"docid": "eeef17da5813f86f4fcf8625c650e59f",
"score": "0.6502763",
"text": "def return_string_array(array)\n count = 0\n # create new array to store converted elements\n new_array = []\n # iterate over a provided array\n while count < array.length do\n # add each converted element to the end of a new array with Shovel Method\n new_array << array[count].to_s\n count += 1\n end\n # return new array\n new_array\nend",
"title": ""
},
{
"docid": "48a65cdcad6bdceed55d84cef9d45ae0",
"score": "0.6481642",
"text": "def array_method(string)\n string.join(\" \")\nend",
"title": ""
},
{
"docid": "779bc1ac7e646f924c20f032171d2d2c",
"score": "0.6390093",
"text": "def convertObjectsArrToStringArr(arr)\r\n i = 0\r\n stringArr = []\r\n while i < arr.length\r\n holder = arr[i].to_s\r\n if(holder != \"\")\r\n if(holder[0] != \"#\")\r\n if(!holder.include? \"::\")\r\n stringArr.append(holder)\r\n end\r\n end\r\n end\r\n #p holder\r\n # puts stringArr[i]\r\n i += 1\r\n end\r\n return stringArr\r\n end",
"title": ""
},
{
"docid": "48297d3d2167a5921325c14518877c14",
"score": "0.62941664",
"text": "def string(arr)\n arr.join(\" \")\nend",
"title": ""
},
{
"docid": "e4dcc74d91b9b71295399577e38fa797",
"score": "0.62662756",
"text": "def fixed_array\n reformated_array.map! do |element|\n element.join(\", \").split(\", \")\n end \nend",
"title": ""
},
{
"docid": "587b45a95fe91feb975cca4fedfb2732",
"score": "0.6265369",
"text": "def strings_for_select( *_array)\n _array = _array.flatten\n if _array.blank?\n []\n else\n _array.zip _array\n end\n end",
"title": ""
},
{
"docid": "5f854c6c1ddcd80ed5884de1eae4e7fd",
"score": "0.62475693",
"text": "def numarray_to_stringarray(array)\n\tif array.respond_to?(:push) #checks for an array\n\t\tarray.join(\" \").split(\" \")\n\telsif array.respond_to?(:zero?) #checks for an int/float\n\t\tarray.to_s.split('')\n\telsif array.respond_to?(:upcase) #checks for a string\n\t\tarray.split(\"\")\n\telse\n\t\t\"Something was wrong with your input\"\n\tend\nend",
"title": ""
},
{
"docid": "7ed20f229d7c8f189c2206cbfbf137cd",
"score": "0.62272936",
"text": "def filter_repeated_character_strings(arr)\nend",
"title": ""
},
{
"docid": "eadd117fe5d2159ef48cada3b59085ee",
"score": "0.619718",
"text": "def clever_octopus!(array)\n str = \"\"\n array.each do |ele|\n if ele.length > str.length \n str = ele \n end\n end \n str\nend",
"title": ""
},
{
"docid": "91f10257a3a1796ce85824f2983fcfe6",
"score": "0.6181237",
"text": "def aba_array(arr)\n arr.map{|str| aba_translate(str)}\nend",
"title": ""
},
{
"docid": "a09d7def22482de1103de35604cfcff9",
"score": "0.6160203",
"text": "def symbolise_array_strings(source, snake_case_keys=true)\n # returns snake case values\n return %I[#{sanitise_string(source, snake_case_keys)}]\n end",
"title": ""
},
{
"docid": "0bc6b60a746a494961111c4efc89f6b8",
"score": "0.6155216",
"text": "def arrayify_and_stringify_elements(arg)\n return false if arg == false\n \n case\n when arg.blank? then []\n when arg.is_a?(Array) then arg\n else arg.to_s.strip.split(/\\s/)\n end.map(&:to_s)\n end",
"title": ""
},
{
"docid": "b4810cf8f42e37ae49a48127389ced97",
"score": "0.6125873",
"text": "def convert_array(str)\n return \"*invalid input*\" if (str.length < 3) || (str.length % 3 != 0)\n\n set = str.length / 3 # determines number of iterations for a full set\n ary = str.split('')\n\n n = str.length / 3 # track the number of chars remaining in the sets\n a = 0\n i = 0\n\n for i in (1...set)\n ## insert method puts char BEFORE current index\n ## i represents the number of sets that have been itterated\n b = a + n\n b_value = ary.slice!(b)\n ary.insert(a + 1, b_value)\n\n c = b + n\n c_value = ary.slice!(c)\n ary.insert(a + 2, c_value)\n\n n -= 1 # all sets reduced by 1\n a += 3\n end\n\n ary.join\n\nend",
"title": ""
},
{
"docid": "bcbc94bde3455e60c3b6684dc890caba",
"score": "0.61111945",
"text": "def strify_array( array )\n\t\tarray = [ array ] if !array.is_a?( Array )\n\t\tarray.map do |m|\n\t\t\tm = (Array === m) ? strify_array(m) : m\n\t\t\tm = (Hash === m) ? strify_hash(m) : m\n\t\t\tSymbol === m ? m.to_s : m\n\t\tend\n\tend",
"title": ""
},
{
"docid": "c4305633dde8bd419e5406f647a5de0f",
"score": "0.61024535",
"text": "def names_two(names)\n\t\tnames.map{ |i| %Q('#{i}') }.join(',')\n\t\tnames = names.map(&:capitalize)\n\t\tlittle_array = []\n\t\tsets = names.shuffle\n\tif names.length % 2 == 0\n\t\ta = names.length/2\n\t\ta.times do \n\t\tsets_1 = sets.pop(2).to_a\n\t\tlittle_array << sets_1\n\t\tset_1 = 0\n\tend\n\n\telse \n\t\textra = sets.pop\n\t\tb = names.length/2\n\t\tb.times do \n\t\tsets_1 = sets.pop(2).to_a\n\t\tlittle_array << sets_1\n\t\tset_1 = 0\n\tend\n\tlittle_array[0] << extra\nend\nclean_array = clean(little_array)\np clean_array\nend",
"title": ""
},
{
"docid": "e920ccfc16bc2e9faaa8e1b812e5e62b",
"score": "0.6096655",
"text": "def arrayfun(array) #BROKEN\n string=\"\"\n for i in 0..array.length-1\n string << \"&\"\n is=array[i].to_s\n for q in 0..(is.length-1)/3\n puts is[q,3].to_i.chr\n end\n end\nend",
"title": ""
},
{
"docid": "c0a2e72c3039312dd098a124fbaebca4",
"score": "0.60902476",
"text": "def awesomesauce(string_array)\n awesome_array = []\n string_array.each do |i|\n awesome_array << i\n awesome_array << 'awesomesauce'\n end\n awesome_array.pop\n return awesome_array\nend",
"title": ""
},
{
"docid": "ecce26a0774fa670e34f43e1360877f2",
"score": "0.6076656",
"text": "def concatenate_array_of_strings(array)\n array_of_strings_concatenated = array.join\nend",
"title": ""
},
{
"docid": "6849643aae4a50ad2936e36eac26d340",
"score": "0.6064075",
"text": "def kesha_maker(array)\n array.collect do |element|\n split_element_to_array = element.split(\"\")\n split_element_to_array[2] = \"$\"\n joined_array = split_element_to_array.join\n joined_array\n end\nend",
"title": ""
},
{
"docid": "bd4ec39bc11da7a4ee4ad2bf10636724",
"score": "0.60513717",
"text": "def convertFinalArrayToString\n string = \"\"\n @arrayOfElements.each { |row| \n rowString = \"\"\n row.each { |word|\n if \"\" == rowString\n rowString = rowString + word\n else\n rowString = rowString + \" \" + word\n end\n }\n if \"\" == string\n string = rowString\n else\n string = string + \"\\n\" + rowString\n end\n }\n return string\nend",
"title": ""
},
{
"docid": "7c484e90ad6564e8d6d0d559d5324814",
"score": "0.6051079",
"text": "def array_translate(array)\n # can be done in a single loop\n # grab two elements at a time, using a while loop\n # add string to the return string the specified number of times\n translated_str = \"\"\n i = 0\n while i < array.length\n str = array[i]\n num = array[i + 1]\n num.times do |useless|\n translated_str += str\n end\n # translated_str += str * num #<= also works (in Ruby)\n i += 2\n end\n return translated_str\nend",
"title": ""
},
{
"docid": "2a205018a1445880aeb3f51bce965456",
"score": "0.6036029",
"text": "def translate(arr)\n vowels = %w{a e i o u y}\n consonants = %w{b c d f g h j k l m n p q r s t v w x y z}\n\n a = arr.split.map do |word| \n if vowels.include?(word[0])\n word + \"ay\"\n elsif word[0..1] == \"qu\"\n word[2..-1] + \"quay\"\n elsif word[0..2] == \"sch\"\n word[3..-1] + \"schay\"\n elsif word[0..2] == \"squ\"\n word[3..-1] + \"squay\"\n elsif consonants.include?(word[0]) && consonants.include?(word[1]) && consonants.include?(word[2])\n word[3..-1] + word[0..2] + \"ay\"\n elsif consonants.include?(word[0]) && consonants.include?(word[1])\n word[2..-1] + word[0..1] + \"ay\"\n elsif consonants.include?(word[0])\n word[1..-1] + word[0] + \"ay\"\n end\n end\n\n a.join(\" \")\nend",
"title": ""
},
{
"docid": "f1f90afce163cc44b25cbde2622c234c",
"score": "0.6030139",
"text": "def add_to_array(arr,str)\n if arr == nil\n return [str.to_s]\n end\n if arr == ''\n return [str.to_s]\n end\n if arr.is_a? Array\n return arr + [str.to_s]\n end\n return arr.to_s + ',' + str.to_s\n end",
"title": ""
},
{
"docid": "203a945f4bdd00e0acc8d85397465c55",
"score": "0.60260093",
"text": "def array_to_sentence_string(array, connector = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "3f7eabf349e4deb8d9f9bb28bd89503a",
"score": "0.6024505",
"text": "def back_to_s(array)\n array.join(\"\")\nend",
"title": ""
},
{
"docid": "1803fd990b1fb0724c8875b2fc07e656",
"score": "0.600403",
"text": "def formatAnswersToSimple( answerArr )\n resultString = \"\"\n # answerArr.each{ |ansArr|\n# resultString = resultString + ansArr.join( \",\" )\n # resultString = resultString + \"~\"\n # }\n resultString = answerArr.join(\"~\")\nend",
"title": ""
},
{
"docid": "86cb448f0ba06cfa6fd325ecc330b11d",
"score": "0.5987707",
"text": "def def_string_array sym, name=nil, &block\n def_transform(sym) {|v|\n next nil if v == nil\n orig = self[sym]\n if v.one_of_type? Array, Enumerable\n add = v.map {|x| x.to_s}\n next orig ? orig + add : add\n end\n orig ? orig << v.to_s : [v.to_s]\n }\n def_checker(sym) { |v|\n next true if v == nil\n next false unless (v.one_of_type?(Array, Enumerable) && !v.is_a?(Hash))\n v.each {|x| \n return false unless block.call(x) \n } if block_given?\n true\n }\n def_alias sym, name if name\n end",
"title": ""
},
{
"docid": "86cb448f0ba06cfa6fd325ecc330b11d",
"score": "0.5987707",
"text": "def def_string_array sym, name=nil, &block\n def_transform(sym) {|v|\n next nil if v == nil\n orig = self[sym]\n if v.one_of_type? Array, Enumerable\n add = v.map {|x| x.to_s}\n next orig ? orig + add : add\n end\n orig ? orig << v.to_s : [v.to_s]\n }\n def_checker(sym) { |v|\n next true if v == nil\n next false unless (v.one_of_type?(Array, Enumerable) && !v.is_a?(Hash))\n v.each {|x| \n return false unless block.call(x) \n } if block_given?\n true\n }\n def_alias sym, name if name\n end",
"title": ""
},
{
"docid": "bf38e991867d8a81ee57e402e12decba",
"score": "0.59863794",
"text": "def name_muddler (array)\nvowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]\nconsonants = \"bcdfghjklmnpqrstvwxyz\"\nconsonant_array = consonants.chars \nnew_name = []\nindex = 0\nwhile index < array.length\n if array[index] == \"u\"\n new_name[index] = \"a\"\n elsif vowels.include?(array[index])\n new_name[index] = vowels[vowels.index(array[index]).next]\n elsif array[index] == \"z\"\n new_name[index] = \"b\"\n else new_name[index] = consonant_array[consonant_array.index(array[index]).next]\n end\n index += 1\nend \nreturn new_name\nend",
"title": ""
},
{
"docid": "7e28f733e4bf25c1b7c415e6fd74749e",
"score": "0.5985937",
"text": "def sentence_maker(array)\n str_array = array.collect{|i| i.to_s} #collect method returns entire array or hash; we are converting all elements of array into string\n sentence = array[0] #converts first element of array into new array\n sentence[0] = str_array[0][0].upcase #makes first letter uppercase\n str_array.shift\n\tstr_array.each { |i| sentence = sentence + \" \" + i.to_s}\n\treturn sentence + \".\"\nend",
"title": ""
},
{
"docid": "0d39a04567ab7135fe0e4bc243ed5019",
"score": "0.595123",
"text": "def convert_guesses_to_str(arr)\n str = \"\"\n arr.each do |char|\n if char.nil?\n str << \"_\"\n else\n str << char\n end\n end\n str\nend",
"title": ""
},
{
"docid": "6ab6d6270d04e984934c675ddacdb960",
"score": "0.59409934",
"text": "def format_comb(arr)\n ret = []\n arr.each do |sub_arr|\n if sub_arr.size > 1\n # use dash to connect the multiple strings \n ret << sub_arr.inject('') {|acc, e| acc + e + '-' }[0..-2]\n elsif sub_arr.size == 1\n ret << sub_arr[0]\n else\n # do nothing...\n end\n end\n return ret\n end",
"title": ""
},
{
"docid": "968a349354d6860a1ea4be0ee3a5701b",
"score": "0.5936919",
"text": "def add_rutabaga_to_string_and_array(str, ary)\n str << \"rutabaga\"\n ary << \"rutabaga\"\nend",
"title": ""
},
{
"docid": "00c9b32e642e5107e9825369345b0922",
"score": "0.5931717",
"text": "def human_string(array)\n length = array.length\n \n new_string = array[0...-1].join(\", \")\n new_string << \" and #{array[-1]}\"\n \n return new_string\nend",
"title": ""
},
{
"docid": "4b72a7e02ad35d2598d052f9daeb0e5e",
"score": "0.59255165",
"text": "def pirates_say_arrrrrrrrr(string)\n\tarray_1 = string.downcase.split\"\"\n\tarray_2 = []\n\nloop do \n\tarrr = array_1.index(\"r\")\n\tbreak if arrr == nil\n\tarray_1.delete_at(arrr)\n\tarray_2 << array_1[arrr]\n\t\nend\n\narray_2.join\n\nend",
"title": ""
},
{
"docid": "5940860c122f71eab8d789e524b36be8",
"score": "0.5923995",
"text": "def c(array = [])\n str = \"\"\n\n for a in array\n str += a + \" \"\n end\n\n str.strip\n end",
"title": ""
},
{
"docid": "8c02bc9da1cad54406886893a58c9514",
"score": "0.590107",
"text": "def transform_string_array(value)\n (value.is_a?(Array) ? value : [value]).map(&:to_s)\n end",
"title": ""
},
{
"docid": "7fcb0c23c5f80cb15b7794951c6d0731",
"score": "0.58940876",
"text": "def array_from_string string\n # takes the string found when params tries to return an array, and reconstruct the array.\n array = string.split(/[^Q1234567890]+/)\n array.delete(\"\")\n array\n end",
"title": ""
},
{
"docid": "1e9e87719c576e94cfb0604850597483",
"score": "0.58887863",
"text": "def array_to_string(arr)\n arr.map { |e| \"'#{sanitize(e)}'\" }.join(\",\")\n end",
"title": ""
},
{
"docid": "c8792bd4471c4e634c95b9fa414446df",
"score": "0.5882165",
"text": "def return_string_array(array)\n array.collect do |element|\n element.to_s\n end\nend",
"title": ""
},
{
"docid": "2fdcb530597086ddf9cbfb4d13d4f195",
"score": "0.58814996",
"text": "def array_translate(array)\n new_str = ''\n i = 0\n while i < array.length\n ele = array[i]\n num = array[i+1]\n num.times {new_str += ele}\n i += 2\n end\n return new_str\nend",
"title": ""
},
{
"docid": "3b7970a14fa881cce2c4e978458d07c3",
"score": "0.5863466",
"text": "def yeller(words) # words is var of an array of strings\n loud_arr = [] # empty array for strings\n i = 0 # the indice counter starting @ 0\n while i < words.length\n word = words[i] # can't store indice of an int, so keep value of the int \"which is string\"\n loud_word = (word + \"!\") # concat \"!\" to string store the result new word for each iteration\n loud_arr << loud_word # shovel result into the array\n i += 1 # next iteration\n end\n return loud_arr\n puts loud_arr\nend",
"title": ""
},
{
"docid": "95cda185d1f8eddef593e47743578eda",
"score": "0.5857368",
"text": "def list(arr)\n return \"\" if arr.empty?\n\n str = []\n\n arr.each do |hsh|\n hsh.each do |k, v|\n str << v\n end\n end\n \n return str[0] if str.length < 2\n\n names = ''\n idx = 0\n\n until idx == str.length - 2\n names << str[idx] + ', '\n idx += 1\n end\n names << str[-2] + ' & '\n names << str[-1]\n \nend",
"title": ""
},
{
"docid": "7e613abdf4729f9285123174b3859089",
"score": "0.5830422",
"text": "def awesomesauced(strings)\n index = 0\n awesomesauced_array = []\n\n while index < strings.length\n awesomesauced_array << strings[index]\n if index != strings.length - 1\n awesomesauced_array << \"awesomesauce\"\n end\n index += 1\n end\n awesomesauced_array\nend",
"title": ""
},
{
"docid": "fc6e84a22dbfb7630f2ad00aface3d04",
"score": "0.58301044",
"text": "def kesha_maker(array)\n kesha_array = []\n\n array.each do |name|\n name_array = name.split(\"\")\n name_array[2] = \"$\"\n result = name_array.join\n kesha_array << result\n end\n\n kesha_array\nend",
"title": ""
},
{
"docid": "792e5ea667d5cf0347b36ba4283efadc",
"score": "0.5826528",
"text": "def array_of_2_char_substrings\n @array_of_2_char_substrings ||= array_of_single_char_substrings.map do |a|\n array_of_single_char_substrings.map {|b| \"#{a}#{b}\" }\n end.flatten\n end",
"title": ""
},
{
"docid": "84f6545fa7ca02c0a67ce3891a119ef0",
"score": "0.58249366",
"text": "def concatenate_array\n\tarr = [\"this is my string\", \"where I concatenate\", \"everything together\"]\n\tstring_arr = arr.join(\" \")\nend",
"title": ""
},
{
"docid": "a93f5b03210b2839cbfed44c6abf84da",
"score": "0.5822718",
"text": "def canolical(palabra)\n#convierte string a array y ordena las letras alfabeticamente\n palabra.split('').sort.join\nend",
"title": ""
},
{
"docid": "af32cfba6a6277c14883bc4051c3827e",
"score": "0.5821663",
"text": "def yeller(array)\n array.join.upcase\nend",
"title": ""
},
{
"docid": "2fcf231ed301c6942846cbf9dd6de593",
"score": "0.5816546",
"text": "def awesomesauced(strings)\n index = 0\n length_of_array = strings.length\n awesomesauced_array = []\n\n while index < length_of_array\n awesomesauced_array << strings[index]\n if index != length_of_array - 1\n awesomesauced_array << \"awesomesauce\"\n end\n index += 1\n end\n p awesomesauced_array\nend",
"title": ""
},
{
"docid": "43d21af35346639dc5c72198eb9cd176",
"score": "0.58050406",
"text": "def sentence_maker(array)\n sentence = \"\"\n array.each do |x|\n sentence = sentence + x.to_s + \" \"\n end\n\n sentence[0] = sentence[0].upcase\n sentence = sentence.rstrip\n sentence = sentence + \".\"\n return sentence\n\nend",
"title": ""
},
{
"docid": "1b5b7e8a4ea78f40a18da5d0de6c9b93",
"score": "0.5802596",
"text": "def letter_array (name)\n\tname.chars\nend",
"title": ""
},
{
"docid": "f07c84dcd53ed27b79089ebc82a7b717",
"score": "0.5802084",
"text": "def aba_array(arr)\n return arr.map{|word| aba_translate(word)}\nend",
"title": ""
},
{
"docid": "763a22ddb03eaf6294c2f2f40e01a3e0",
"score": "0.57927704",
"text": "def add_s(array)\n newarray = []\n array.each_with_index do |element, index|\n if index != 1\n newarray << (element.concat(\"s\"))\n end\n end\nend",
"title": ""
},
{
"docid": "26d423f2149763737bf6b0d017001e5b",
"score": "0.5788255",
"text": "def awesomesauced(strings)\n length_of_array = strings.length\n new_array = []\n index = 0\n\n while index < length_of_array\n new_array << strings[index]\n\n if index != length_of_array - 1\n new_array << \"awesomesauce\"\n end\n\n index += 1\n end\n\n return new_array\nend",
"title": ""
},
{
"docid": "5e7e7b464da236c55af2123075b40bde",
"score": "0.57872635",
"text": "def sentence_maker(array)\n\tx = 0\n\tsum = \"\"\n\n\t\twhile x < (array.length - 1)\n\t\t\tsum += array[x].concat \" \" \n\t\t\tx += 1\n\t\tend \n\t\t\tsum += array[x].concat \".\" \n\treturn sum\n\nend",
"title": ""
},
{
"docid": "98175f9ddf9cf7110d24ef486f88308e",
"score": "0.5771798",
"text": "def vowel_checker(array)\n vowel_guide = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n array.map! do |name|\n name_split = name.split('')\n name_split.map! do |char|\n index = 0\n while index < vowel_guide.length\n if char == vowel_guide[index]\n char = vowel_guide[index += 1]\n index += 1\n elsif char == \"u\"\n char = \"a\"\n index += 1\n else\n char\n index += 1\n end\n char\n end\n char\n end\n name_split\n name_join = name_split.join('')\n name_join\n end\n array\nend",
"title": ""
},
{
"docid": "bfe3760c505ad45b32b6cbbdc7d5ed69",
"score": "0.57631636",
"text": "def combine(str, arr)\n out = ''\n arr.each do |el|\n out += el\n end\n out + str\nend",
"title": ""
},
{
"docid": "7b9d909de13915bc19c38ced0866b765",
"score": "0.57581496",
"text": "def strings; end",
"title": ""
},
{
"docid": "8c3d4ca2b791fe002ad5341cef08bed7",
"score": "0.575674",
"text": "def add_bang(array)\n array.map {|string| string+\"!\"}\nend",
"title": ""
},
{
"docid": "b7334e4ab981c77efaef02419da0fc0a",
"score": "0.57456774",
"text": "def strip_string_array(arr)\n arr.first.lstrip! if arr.first.is_a?(String)\n arr[-1] = Sass::Util.rstrip_except_escapes(arr[-1]) if arr.last.is_a?(String)\n arr\n end",
"title": ""
},
{
"docid": "deda13e7a3275936c63679b920055050",
"score": "0.57452065",
"text": "def add_bang(array)\n # TODO: Take an array of strings and return a new array with \"!\" appended to each string.\n # You should use Enumerable#map\n array.map do |element|\n element+\"!\"\n end\nend",
"title": ""
},
{
"docid": "bdf3198a9aeb4d56f6474d7d4d09bad7",
"score": "0.57353675",
"text": "def array_index (letras = 'f, g, h')\r\n\tputs letras\r\nend",
"title": ""
},
{
"docid": "113224d2c7672060e46a5ea43c573016",
"score": "0.5734766",
"text": "def pirates_say_arrrrrrrrr(string)\n array_1 = string.downcase.split\"\"\n array_2 = []\n \n loop do\n arrr = array_1.index(\"r\")\n break if arrr == nil\n array_1.delete_at(arrr)\n array_2 << array_1[arrr]\n end\n \narray_2.join\n\nend",
"title": ""
},
{
"docid": "bcb218ea3498ff0fe80854d27e3c6e17",
"score": "0.5730782",
"text": "def convert_word(arr)\n return nil if arr.nil?\n return [] if arr.empty?\n\n word = ''\n arr.each do |n|\n return nil unless @nmap.key? n\n\n word += @nmap[n]\n end\n word\n end",
"title": ""
},
{
"docid": "21e36faf9df000d82870d05923f9f9d5",
"score": "0.57206297",
"text": "def name(arr)\n\tarr.join(' ')\nend",
"title": ""
},
{
"docid": "9c584f70e959dd18553f6ded192f229d",
"score": "0.5720272",
"text": "def unsymbolize_array(array)\n array.collect{|c| c.to_s}\n end",
"title": ""
},
{
"docid": "3541075dcdd1c90c0d2611b638c02b63",
"score": "0.57177615",
"text": "def array_translate(array)\n translated = \"\"\n i = 0\n while i < array.length\n \tarray[i+1].times do\n \ttranslated += array[i]\n end\n i += 2\n end\n return translated\nend",
"title": ""
},
{
"docid": "8cbacc3e37dfbc066e12c0aca0e45001",
"score": "0.5713291",
"text": "def arrayorize(value)\n case value\n when nil then return []\n when String then value.to_s.split\n when Symbol then value.to_s.split\n else value\n end\n end",
"title": ""
},
{
"docid": "272f642b7033de378f5916f30b158479",
"score": "0.57124025",
"text": "def normalize_array(array)\n array.map(&:to_s)\n end",
"title": ""
},
{
"docid": "272f642b7033de378f5916f30b158479",
"score": "0.57124025",
"text": "def normalize_array(array)\n array.map(&:to_s)\n end",
"title": ""
},
{
"docid": "5e20c3cbe0d5b33ed3e5027b9cc8a5fe",
"score": "0.5706186",
"text": "def create_arr_arrays(arr_strings)\n\tarr_strings.map do |row| \n\t\trow.split(\",\").map { |word| word.strip }\n\t\tend\nend",
"title": ""
},
{
"docid": "3133cd410d02d611d86c4d27561f5a6b",
"score": "0.5701818",
"text": "def make_sentence(array) \n\tsentence = \"\"\n\tarray.each do |mini_arrays|\n mini_arrays.each do |element|\n sentence << \"a#{element}a \"\n end\n end \n \n\tsentence\n end",
"title": ""
},
{
"docid": "b183b56a3c058dad0d18a271d053112a",
"score": "0.5699757",
"text": "def array(input_array)\n output = input_array + [100] # Creates a new array by adding '[]' to the string \"100\",\n # then combines \"input_array\" and \"[\"100\"]\" arrays by '+'\n return output\nend",
"title": ""
},
{
"docid": "c7c13e5f55c33f3ef4b9f4ea051c006c",
"score": "0.56926835",
"text": "def join_nested_strings(array)\n string_array = []\n count = 0\n while count < array.length do\n\n inner_count = 0\n while inner_count < array[count].length do\n if array[count][inner_count].class == String\n string_array << array[count][inner_count]\n else\n string_array = string_array\n end\n inner_count += 1\n\n end\n count += 1\n end\n string_array.join(\" \")\nend",
"title": ""
},
{
"docid": "b136ac3be8a9557d2fa36f9e9dc04f53",
"score": "0.56917334",
"text": "def strings(array)\n string = \"\"\n array.each do |word|\n if word == array[-1]\n string << word\n else\n string << word + \", \"\n end\n end\n p string\nend",
"title": ""
},
{
"docid": "664510ebd090638fb96e20604081c29e",
"score": "0.5679336",
"text": "def add_s(arry)\n arry.map! do |item|\n item = item + \"s\"\n# arry[1] >> arry[1].slice(0..-2)\n\n end\n arry[1]=arry[1].slice(0..-2)\n arry\nend",
"title": ""
},
{
"docid": "7a2ee4c55cdd9aef66aad081b6f427fe",
"score": "0.5677086",
"text": "def array_translate(array)\n string = ''\n i = 0 \n while i < array.length\n word = array[i]\n num = array[i + 1]\n string += (word * num)\n\n i += 2\n end\n\n string\nend",
"title": ""
},
{
"docid": "7c75d8c12920d64780efbba3a3861231",
"score": "0.56769305",
"text": "def generate_str(arr)\n # Create a string for each of the lights arrays.\n# Loop through array\n # Add current element to new string\n# If array is 2 elements long and its the next to last element\n# Add \"and\"\n # If current element is next to last\n # add \", and\"\n # Else\n # if current element is not the last element\n# add \",\"\n str = \"\"\n counter = 0\n loop do\n str << arr[counter].to_s\n\n if arr.size == 2 && counter == arr.size-2\n str << \" and \"\n elsif counter == arr.size-2\n str << \", and \"\n elsif counter != arr.size-1\n str << \", \"\n end\n\n counter += 1\n break if counter == arr.size\n end\n\n str\nend",
"title": ""
},
{
"docid": "22d5995552e70d8307c1af07acce0610",
"score": "0.5672154",
"text": "def vogal(str)\n vogals = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n cons = [\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\"]\n# splitting the string given into arrays \n str = str.chars\n str_new = str.map do |char|\n#looping the string into the next letter\n if vogals.include?(char)\n vogals.rotate(1)[vogals.index(char)]\n else cons.include?(char)\n cons.rotate(1)[cons.index(char)]\n end\n end\n#joining the strings back\n str_new.join\nend",
"title": ""
},
{
"docid": "e2e680b2a43402f74f0e0bdd08707bd8",
"score": "0.5671462",
"text": "def abbreviate_sentence(sent)\n # Write your code here\n empty_array = []\n sent.chars.each do |element|\n if element.length > 4\n element.each do |letters|\n letters.gsub(/[aeiou]/i, \" \" )\n letters << empty_array\n end\n end\n end\n p empty_array.join(\"\")\nend",
"title": ""
},
{
"docid": "9671a9c715be8c47cffcfbcc43168e31",
"score": "0.5670612",
"text": "def not_so_tricky_method(a_string_param, an_array_param)\n a_string_param += \"rutabaga\"\n an_array_param += [\"rutabaga\"]\n\n return a_string_param, an_array_param\n end",
"title": ""
},
{
"docid": "9af7828471682e9ad0c4bde3d083b84c",
"score": "0.56688374",
"text": "def processor(str, num)\n # Split arguments into arrays of individual letters\n arr = str.split(\"\")\n\n # For each arr, locate index location of first vowel after the first letter\n vow = arr.find_index { |let|\n let =~ /[aeiouy]/ if arr.index != 0\n }\n\n # Cut letters from array to create wom1 and wom2\n # Only return both if they are different (which will be whenever the\n # first vowels are different between the two words)\n\n # If first word...\n if num == 1\n # Option 1: begin from index 0 and length is vow + 1 if using word 1 vowel\n # Option 2: begin from index 0 and length is vow if using word 2 vowel\n wom1 = arr.slice(0, vow + 1)\n wom2 = arr.slice(0, vow)\n\n # If second word...\n else\n # Option 1: begin from index vow + 1 if using word 1 vowel\n # Option 2: begin from index vow if using word 2 vowel\n # To ensure length is enough to get to last letter, use arr.length\n wom1 = arr.slice(vow + 1, arr.length)\n wom2 = arr.slice(vow, arr.length)\n\n end\n\n # Return array of wom1 and wom2 joined up into strings\n res = [wom1.join(\"\"), wom2.join(\"\")]\nend",
"title": ""
},
{
"docid": "56c862b19e1fb6fd6733d5fdd64c6e3f",
"score": "0.56663626",
"text": "def format_address(arr)\n downcase_arr = arr.map(&:downcase)\n formatted_arr = downcase_arr.map{|a| a.gsub(\", \", \"\").gsub(\" \", \"-\")}\n # puts formatted_arr\nend",
"title": ""
},
{
"docid": "2585efb98b8e123339afe2176ebd733a",
"score": "0.56620955",
"text": "def kesha_maker(array)\n array.map do |elem|\n word_splice = elem.split(\"\")\n word_splice[2] = \"$\"\n word_splice.join\n end\nend",
"title": ""
},
{
"docid": "733f8b703efc506cf7038a814186943f",
"score": "0.5659475",
"text": "def my_array_modification_method(source, thing_to_modify)\n len = source.length; # find the number of elements in the array\n # for each element in the array see if it is a string\n 0.upto(len - 1) do |loc|\n # if the element is NOT a string, add thing_to_modify to it\n if source[loc].is_a?(String) === false\n source[loc] += thing_to_modify\n end\n end\n return source\nend",
"title": ""
},
{
"docid": "f58502cc3192ecffcad185c0ca2e6128",
"score": "0.56478506",
"text": "def resume_to_array(text)\n result = text\n result.gsub!(\",\",\"\")\n result.gsub!(\"(\",\"\")\n result.gsub!(\")\",\"\")\n result.gsub!(\"[\",\"\")\n result.gsub!(\"]\",\"\")\n result.downcase!\n return result.split\nend",
"title": ""
},
{
"docid": "b07127f211855a9b7a38e7667fb0c85d",
"score": "0.5647845",
"text": "def my_array_splitting_method(source)\n\n arrayInt = []\n arrayStr = []\n\n for x in 0..(source.length - 1)\n if source[x].to_s =~ /\\A[-+]?[0-9]+\\z/\n arrayInt[arrayInt.length] = source[x].to_i\n\n else\n arrayStr[arrayStr.length] = source[x]\n\n end\n end\n outputArray = [arrayInt, arrayStr]\n # p outputArray\n return outputArray\nend",
"title": ""
},
{
"docid": "c6c432a94ed7112ab77b2e258e2d96fe",
"score": "0.5647324",
"text": "def genStr strLen\nsortedAlphabet = @alphabet.sort\nresultStrs = [ ]\ntestStrings = [ ]\ntestStrings[0] = []\ntestStrings[0].push \"\"\n1.upto(strLen.to_i) { |x|\ntestStrings[x] = []\ntestStrings[x-1].each { |s|\nsortedAlphabet.each { |c|\ntestStrings[x].push s+c\n}\n}\n}\ntestStrings.flatten.each { |s|\nresultStrs.push s if accept? s, @start\n}\nresult = \"\"\nresultStrs.each { |x| result.concat '\"'+x+'\" ' }\nresult\nend",
"title": ""
},
{
"docid": "d6a6ba3fdc43350ea4a4b5b92df18216",
"score": "0.56428206",
"text": "def sentence_maker(array)\n combination = \"\"\n array[0].capitalize!\n array.each {|x| combination = combination + x.to_s + \" \"}\n combination.rstrip!\n combination = combination + \".\"\n return combination\nend",
"title": ""
},
{
"docid": "a46b2fcf38976306ffb94ed687fa7904",
"score": "0.56424165",
"text": "def add_s(array)\n\tarray.each_with_index.collect{|e, i| if i == 1 e : e+\"s\"}\nend",
"title": ""
},
{
"docid": "837f588fdc64337db6477ab75b8daddb",
"score": "0.56386197",
"text": "def process_text arr\n puts arr.map { |s| s.strip }.join(\" \") \nend",
"title": ""
},
{
"docid": "98e18fdf3a32f54daa8c8ddfec7d3f26",
"score": "0.5637763",
"text": "def add_s(array)\n\t\tarray.each_with_index.collect do |word, i|\n\t\t\tif i == 1 then\n\t\t\t\tword = word\n\t\t\telse\n\t\t\t\tword << \"s\"\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "d05693aa29233a92a184a020c7610e68",
"score": "0.56331974",
"text": "def to_sentence(arr)\n\t# return arr.first if arr.length == 1\n\t# last = arr.pop\n\t# arr.join(', ') + ' and ' + last\n\tcase arr.length\n\twhen 1\n\t\tarr[0]\n\twhen 2\n\t\tarr.join(' and ')\n\telse\n\t\t\"#{arr[0..-2].join(', ')} and #{arr[-1]}\"\n\tend\nend",
"title": ""
},
{
"docid": "4c4dfe37253cd8c5b0b5cb84947b6a0c",
"score": "0.5627538",
"text": "def anagrams(string, array)\nend",
"title": ""
},
{
"docid": "ae026be48de89b0636df49bf6db508d6",
"score": "0.56272674",
"text": "def concatenate_array_of_strings(array)\n counter = 0\n strings_concatenated = ''\n\n until array.length <= counter \n strings_concatenated << array[counter]\n counter += 1\n end\n strings_concatenated \nend",
"title": ""
},
{
"docid": "6b5040887255d0a236dfb43d13580bc2",
"score": "0.56239873",
"text": "def join_nested_strings(src)\n # src will be an Array of Arrays of Strings and Integers\n # Combine all Strings present in the AoA into a single value and return it\n result = \"\"\n \n # loop over outer array\n row_index = 0\n while row_index < src.count do\n \n # loop over inner array\n element_index = 0\n while element_index < src[row_index].count do\n element = src[row_index][element_index]\n if element.is_a? String\n result += element + \" \"\n end\n \n # do something with each element of the inner array\n element_index += 1\n end\n\n row_index += 1\n end\n\n # return \"The brown fox ... \"\n result\nend",
"title": ""
},
{
"docid": "64fac782bc9803bcc130eac9fb1a32dd",
"score": "0.562164",
"text": "def lookup_array_attribute (attname, workitem, options={})\n\n tostring = options.delete(:to_s)\n\n v = lookup_attribute(attname, workitem, options)\n\n return nil unless v\n\n v = v.to_s.split(',').collect { |e| e.strip } \\\n unless v.is_a?(Array)\n\n v = v.collect { |e| e.to_s } \\\n if tostring\n\n v\n end",
"title": ""
},
{
"docid": "93046bdcb436353af2a6596552f35039",
"score": "0.56194156",
"text": "def array_to_string(value)\n result = ''\n value.each { |value| result += to_cli_value(value) + ',' }\n result = '[' + result.chomp(',') + ']'\n end",
"title": ""
},
{
"docid": "1edcd89a8b92b6a78dbfd093c37a7977",
"score": "0.56189686",
"text": "def array_word\n p @arrayed_word = @secret_word.split(\"\")\n end",
"title": ""
},
{
"docid": "e0ea33e034d5fdb580a36ab2c0380aef",
"score": "0.5617025",
"text": "def kesha_maker(array)\n array.map do |string|\n string[2] = \"$\"\n end\n array\nend",
"title": ""
}
] |
843fa1db967171bd3520ef1e3ed48c45
|
Returns the maximum result
|
[
{
"docid": "88fefb75146e01c0a09ee4ae5e2a8088",
"score": "0.77112234",
"text": "def max_result\n x = attributes.size\n sort_by { |result| result[x] }.last[x]\n end",
"title": ""
}
] |
[
{
"docid": "89092bf829572274bbf07679bc9dadec",
"score": "0.8021928",
"text": "def max()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "a103989d00ccb90a682e35a9dc70a87b",
"score": "0.8013019",
"text": "def max()\n @max\n end",
"title": ""
},
{
"docid": "98bdf3fa12ad3e10e9c0d0718512bb4f",
"score": "0.7867268",
"text": "def max\n end",
"title": ""
},
{
"docid": "98bdf3fa12ad3e10e9c0d0718512bb4f",
"score": "0.7867268",
"text": "def max\n end",
"title": ""
},
{
"docid": "ae540998b6e809c3b004c8e6f92bf42f",
"score": "0.78009415",
"text": "def max\n compute_stats :max\n end",
"title": ""
},
{
"docid": "b609e88f0c0ebd95db2a9635acf69e04",
"score": "0.77981305",
"text": "def max; end",
"title": ""
},
{
"docid": "b609e88f0c0ebd95db2a9635acf69e04",
"score": "0.77981305",
"text": "def max; end",
"title": ""
},
{
"docid": "b609e88f0c0ebd95db2a9635acf69e04",
"score": "0.77981305",
"text": "def max; end",
"title": ""
},
{
"docid": "b609e88f0c0ebd95db2a9635acf69e04",
"score": "0.77981305",
"text": "def max; end",
"title": ""
},
{
"docid": "b609e88f0c0ebd95db2a9635acf69e04",
"score": "0.77981305",
"text": "def max; end",
"title": ""
},
{
"docid": "b609e88f0c0ebd95db2a9635acf69e04",
"score": "0.77981305",
"text": "def max; end",
"title": ""
},
{
"docid": "29c7b92077f4cb3e8a39602840c991d4",
"score": "0.7756931",
"text": "def maximum; end",
"title": ""
},
{
"docid": "7d55b9745f11fdcf811f070597edf94f",
"score": "0.7726969",
"text": "def max\n @max\n end",
"title": ""
},
{
"docid": "7d55b9745f11fdcf811f070597edf94f",
"score": "0.7726969",
"text": "def max\n @max\n end",
"title": ""
},
{
"docid": "2075aae9ed54b344ced72949e0cfa118",
"score": "0.77259487",
"text": "def max\n return @max\n end",
"title": ""
},
{
"docid": "0afdece154a9634e2cdfb7cf837306e0",
"score": "0.77041495",
"text": "def max_score\n max_method.last\n end",
"title": ""
},
{
"docid": "36c36ba51fed56893bfda421d46c03cd",
"score": "0.7667589",
"text": "def get_maximum(context)\n max_value\n end",
"title": ""
},
{
"docid": "36c36ba51fed56893bfda421d46c03cd",
"score": "0.7667589",
"text": "def get_maximum(context)\n max_value\n end",
"title": ""
},
{
"docid": "36c36ba51fed56893bfda421d46c03cd",
"score": "0.7667589",
"text": "def get_maximum(context)\n max_value\n end",
"title": ""
},
{
"docid": "36c36ba51fed56893bfda421d46c03cd",
"score": "0.7667589",
"text": "def get_maximum(context)\n max_value\n end",
"title": ""
},
{
"docid": "77ea8556459aec7837704ddb55cd84ed",
"score": "0.7667562",
"text": "def find_max y\n print y.max\nend",
"title": ""
},
{
"docid": "08a3f9b8bf21ee1296a7d1740fc1a4ac",
"score": "0.76535124",
"text": "def maximum\n return @maximum\n end",
"title": ""
},
{
"docid": "e349017f9b75ac22d6e5964ea62bc9c7",
"score": "0.7612858",
"text": "def find_max_value(array)\n array.max\n\n\n # Add your solution here\nend",
"title": ""
},
{
"docid": "1d955a2aef95130478eac02b2de5d394",
"score": "0.7547904",
"text": "def find_the_maximum_value(number)\n\tputs number.max\nend",
"title": ""
},
{
"docid": "d596ba287ae5b6b8357d0f1bf7aecc50",
"score": "0.7532483",
"text": "def find_max_value(array)\n p array.max \nend",
"title": ""
},
{
"docid": "9f432b9ea2131244b74b7c4cdc50f31d",
"score": "0.75131124",
"text": "def max_value\n @max_value\n end",
"title": ""
},
{
"docid": "47dcdd9dd0afe05929153fc4d53b4e99",
"score": "0.7512802",
"text": "def determine_max\n\t\treturn @sort[4]\n\tend",
"title": ""
},
{
"docid": "b841cf17ffecc4cb5cea4e04d461e1a0",
"score": "0.7512151",
"text": "def get_max_value (result_string)\n values = get_values(result_string).map { |x| x.to_f }\n values.max\n end",
"title": ""
},
{
"docid": "5d5fad07c583c408469854669388857d",
"score": "0.7507581",
"text": "def max\n @max\n end",
"title": ""
},
{
"docid": "3dee2ab8e2fe93b37cca85b60b5b77c0",
"score": "0.74986535",
"text": "def max\n @model.get_numbers.max\n end",
"title": ""
},
{
"docid": "3c610b2aa1019d5b474a57df0bcde175",
"score": "0.7488915",
"text": "def maximum\n @maximum ||= begin\n op = operands.detect {|o| o.is_a?(Array) && o.first == :max} || [:max, 1]\n op[1] == '*' ? Float::INFINITY : op[1]\n end\n end",
"title": ""
},
{
"docid": "b79badaa16b858240fba7d960b40657a",
"score": "0.74813974",
"text": "def find_max\n x = [1, 3, -5, 7, 9, 13]\n puts x.max\nend",
"title": ""
},
{
"docid": "dde074320509e5a3e1e88d871e541ea4",
"score": "0.7467234",
"text": "def max\r\n \"Biggest number in array: #{@calc_array.max}\"\r\n end",
"title": ""
},
{
"docid": "b4e4b14185e8ddb108f81bba431aecb8",
"score": "0.7458325",
"text": "def max\n\t\tm = self.valor[0]\n\t\tfor i in (0...self.valor.size.to_i)\n\t\t\t\tif (self.valor[i]> m)\n\t\t\t\t\tm = self.valor[i]\n\t\t\t\tend\n\t\tend\n\t\treturn m\n\tend",
"title": ""
},
{
"docid": "05275a630b7c60e354b21cd9fd155744",
"score": "0.74452287",
"text": "def max_method\n totals.max_by { |_, score| score }\n end",
"title": ""
},
{
"docid": "cfba709ca4d75251ec7854fa4b6fb3e0",
"score": "0.74328697",
"text": "def maximum!\n @calculations[:maximum] = @adapter.method(:maximum)\n end",
"title": ""
},
{
"docid": "508d91d898f0a02ff0f493207ea1ec20",
"score": "0.74292064",
"text": "def find_max_value(array)\n array.max \n \nend",
"title": ""
},
{
"docid": "f864291fa523a4bdd0e62d494a976331",
"score": "0.7421481",
"text": "def max(numsss)\n return numsss.max\nend",
"title": ""
},
{
"docid": "42007333cbf7011c618006ca06beda03",
"score": "0.74167836",
"text": "def find_max\n\tputs \"Max of Array: #{[-3,-5,-7].max}\"\nend",
"title": ""
},
{
"docid": "320a45910f12a46e5819c37b5f1a23df",
"score": "0.741508",
"text": "def max\n if valid\n max_value\n else\n # fetch max from stack if stored obj is invalid right now\n # due to unfinished data operations (see challenge_big_data.rb)\n set_max(get_max)\n end\n end",
"title": ""
},
{
"docid": "b56ceaad0fecbf6fac4cf01c06608dff",
"score": "0.740582",
"text": "def find_max_value(array)\n array.max\nend",
"title": ""
},
{
"docid": "b142447b1e38ea27e0c5e96bad3d0f49",
"score": "0.73912764",
"text": "def max \n @max_number\n end",
"title": ""
},
{
"docid": "f380f759bf8f12ddcedf914e3d613300",
"score": "0.7358833",
"text": "def find_max_value(array)\n return array.max\nend",
"title": ""
},
{
"docid": "f3e9497d0e455c6c8b8c1a42190fecec",
"score": "0.7344638",
"text": "def max\n apply_method :numeric, :max\n end",
"title": ""
},
{
"docid": "f3e9497d0e455c6c8b8c1a42190fecec",
"score": "0.7344638",
"text": "def max\n apply_method :numeric, :max\n end",
"title": ""
},
{
"docid": "897ef218ea08b4c84658b5c1e9924600",
"score": "0.73411083",
"text": "def value\n max1\n end",
"title": ""
},
{
"docid": "fed87d76a5618d7a97804a593759e01e",
"score": "0.7339533",
"text": "def max\n\t\teach_pair DESCENDING do |pair| return pair end\n\tend",
"title": ""
},
{
"docid": "5df4191f21b61732da856f2a0abddbea",
"score": "0.732274",
"text": "def max\n @q.max\n end",
"title": ""
},
{
"docid": "1bed5eb0947ad9df11836a82b6d4e653",
"score": "0.7321028",
"text": "def personal_best\r\n\t\t@ary.max\r\n\tend",
"title": ""
},
{
"docid": "1aa45398853cf47ef970624cd7c64706",
"score": "0.7318286",
"text": "def max\n @S.last.v\n end",
"title": ""
},
{
"docid": "dead8b415b6609d9546b8db84313a3d8",
"score": "0.73142153",
"text": "def max\n self['max']\n end",
"title": ""
},
{
"docid": "5d93383e9cbbcec47cce295126ef134a",
"score": "0.73008674",
"text": "def maximo\n\t\taux = @vval[0]\n\t\tfor i in(0...@vval.size)\n\t\t\tif(@vval[i] > aux)\n\t\t\t\taux = @vval[i]\n\t\t\tend\t\n\t\tend\t\n\t\treturn aux\n\tend",
"title": ""
},
{
"docid": "a6b04ae05544fb350ddb486157660673",
"score": "0.72687334",
"text": "def max\n m = get(0,0)\n\t@filas.times do |i|\n\t @columnas.times do |j|\n# i = 0\n# while(i < @filas)\n# j = 0\n# while(j < @columnas)\n if (get(i,j) > m)\n m = get(i,j)\n end\n# j += 1\n end\n# i += 1\n end\n m\n end",
"title": ""
},
{
"docid": "641db62c8b596f56747702f68f4b777d",
"score": "0.72626036",
"text": "def max(x)\n x.max\n end",
"title": ""
},
{
"docid": "79609dd1ac9eb8233d96bbac4ea2d79f",
"score": "0.72568387",
"text": "def maximum\n max_at(0, @operands.size - 1)\n end",
"title": ""
},
{
"docid": "67cc15e412c8798b3ef9380a513fb783",
"score": "0.72481865",
"text": "def max\n _, max_value = @registers.max_by { |name, value| value }\n max_value\n end",
"title": ""
},
{
"docid": "ce3c1cce6ebe5eafa3ea70de3948c190",
"score": "0.7242643",
"text": "def max\n return 0 if @values.empty?\n @values.last\n end",
"title": ""
},
{
"docid": "cf022a98e0d9662bb4e9594fc1526429",
"score": "0.7242213",
"text": "def max\n @max ||= DoubleDescriptive.max(@array_list)\n end",
"title": ""
},
{
"docid": "dd499938843388debf426100b2d8008e",
"score": "0.7233439",
"text": "def max\n max = hash.values[0] # max toma el primer valor del hash\n hash.collect do |clave,valor| # collect recorre cada elemento y devuelve un array con los resultados del bloque\n\t if (valor > max)\n\t max=valor\n end\n end\n return max \n end",
"title": ""
},
{
"docid": "d54e9157da0c11ed7902185be3443f09",
"score": "0.72256225",
"text": "def max\n return @def.max\n end",
"title": ""
},
{
"docid": "d68d70014361f678e0750d08ca9ecec9",
"score": "0.72228664",
"text": "def max_value()\n\t\t@max_array.empty? ? -1 : @max_array[-1]\n end",
"title": ""
},
{
"docid": "f781a48f2b4e84e443d678cd5bf9fc7c",
"score": "0.7221443",
"text": "def max_value(array)\n p array.max\nend",
"title": ""
},
{
"docid": "b46840c4341519eb1528521679c7de7e",
"score": "0.7206317",
"text": "def maxcount \n count.values.max\n end",
"title": ""
},
{
"docid": "cdad5f9535af749175f356fa7714b8c5",
"score": "0.72030175",
"text": "def max\n m = get(0,0)\n @filas.times do |i|\n @columnas.times do |j|\n# i = 0\n# while(i < @filas)\n# j = 0\n# while(j < @columnas)\n if (get(i,j) > m)\n m = get(i,j)\n end\n# j += 1\n end\n# i += 1\n end\n m\n end",
"title": ""
},
{
"docid": "b92c1a7a3233b82f6fe584791eb97c8d",
"score": "0.72019815",
"text": "def max\n @max ||= [data.compact.max, data.compact.min.abs].max.to_f\n end",
"title": ""
},
{
"docid": "701286a1c7b95d36bf17208fc36c9396",
"score": "0.7191137",
"text": "def max(&block)\n extrema_by(&block)\n end",
"title": ""
},
{
"docid": "1d14d8a36956245771a3b70d5fd0e123",
"score": "0.7176259",
"text": "def getMax(array)\n\tsol = array[0]\n\tarray.each do |num|\n\t\tif num > sol\n\t\t\tsol = num\n\t\tend\n\tend\n\treturn sol\nend",
"title": ""
},
{
"docid": "36e7c17cc51a9211913ba539beac69ca",
"score": "0.71761",
"text": "def maximum\n raise NotImplementedError.new(\"You must implement maximum method.\")\n end",
"title": ""
},
{
"docid": "f12bea130de6cf0a01fed9196d7d8814",
"score": "0.7170364",
"text": "def max\r\n temp = @first\r\n maxValue = -99999\r\n while !temp.nil?\r\n if temp.value > maxValue then\r\n maxValue = temp.value\r\n end\r\n temp = temp.next\r\n end\r\n maxValue\r\n end",
"title": ""
},
{
"docid": "f12bea130de6cf0a01fed9196d7d8814",
"score": "0.7170364",
"text": "def max\r\n temp = @first\r\n maxValue = -99999\r\n while !temp.nil?\r\n if temp.value > maxValue then\r\n maxValue = temp.value\r\n end\r\n temp = temp.next\r\n end\r\n maxValue\r\n end",
"title": ""
},
{
"docid": "60e5e879bc41b3c593848ee5a34fe382",
"score": "0.7162143",
"text": "def max\n temp = @first\n maxValue = -999999\n while !temp.nil?\n if temp.value > maxValue\n maxValue = temp.value\n end\n temp = temp.next\n end\n return maxValue\n end",
"title": ""
},
{
"docid": "0c4c7039cd7c4c5725bc7b84243c6f3e",
"score": "0.71572214",
"text": "def highest_value\n if data.kind_of?( Array ) && ! data.empty?\n max = data.flatten.compact.max\n else\n max = 0\n end\n return max\n end",
"title": ""
},
{
"docid": "2b50deb5e0b6c38dd8c970d4639b2db9",
"score": "0.7155028",
"text": "def max\n temp = @first\n maxValue = -99999\n while !temp.nil?\n if temp.value > maxValue then\n maxValue = temp.value\n end\n temp = temp.next\n end\n maxValue\n end",
"title": ""
},
{
"docid": "8ed1c7039d5a846c890d678890125a03",
"score": "0.7154044",
"text": "def max\n encontrado = false\n value = 0\n i = -1\n # Se revisan todos los elementos de la matriz.\n while encontrado == false\n i += 1\n j = 0\n while j < self.cols\n if self[i][j] != nil and value == 0\n value = self[i][j]\n encontrado = true\n break\n else\n j += 1\n end\n end\n end\n # Se recorre la matriz y se asigna un valor mayor en caso de encontrarlo a la variable value.\n @rows.times do |i|\n @cols.times do |j|\n if self[i][j] != nil && self[i][j] > value\n value = self[i][j]\n end\n end\n end\n # Se retorna el maximo de los elementos de la matriz.\n value\n end",
"title": ""
},
{
"docid": "0dc54e9a377fb8a2c54ceef7a7b106d7",
"score": "0.71447515",
"text": "def max\r\n temp = @first\r\n maxValue = -999999\r\n while !temp.nil?\r\n if temp.value > maxValue\r\n maxValue = temp.value\r\n end\r\n temp = temp.next\r\n end\r\n return maxValue\r\n end",
"title": ""
},
{
"docid": "0dc54e9a377fb8a2c54ceef7a7b106d7",
"score": "0.71447515",
"text": "def max\r\n temp = @first\r\n maxValue = -999999\r\n while !temp.nil?\r\n if temp.value > maxValue\r\n maxValue = temp.value\r\n end\r\n temp = temp.next\r\n end\r\n return maxValue\r\n end",
"title": ""
},
{
"docid": "95cd9150905b6c00c75a152378f9be47",
"score": "0.71364987",
"text": "def max_m\n @max_m\n end",
"title": ""
},
{
"docid": "46dbf1f74c7d2edacb03112171314b8a",
"score": "0.71335053",
"text": "def highest_value\n cards.map(&:value).max\n end",
"title": ""
},
{
"docid": "75415739021100cc9ca04f9799e3131d",
"score": "0.71170014",
"text": "def my_max(array)\n\tarray.sort.last\nend",
"title": ""
},
{
"docid": "548ecf8264d47d2d2f6855876446e78b",
"score": "0.7112993",
"text": "def maximum(max, options = {})\n options[:field] = max\n calculate(\"MAX(#{max})\", options)\n end",
"title": ""
},
{
"docid": "d887e3ba2ce105d21b252cbfac55f646",
"score": "0.71020573",
"text": "def find_max(arr)\n\tputs arr.max\nend",
"title": ""
},
{
"docid": "96f1b9dca729fe932c014fbfcd8cc29e",
"score": "0.7092551",
"text": "def max\r\n temp = @first\r\n maxValue = -999999\r\n while !temp.nil?\r\n \t if temp.value > maxValue\r\n \t maxValue = temp.value\r\n \t end\r\n \t temp = temp.next\r\n end\r\n return maxValue\r\n end",
"title": ""
},
{
"docid": "01b403af23fdae80b6b2a6b02f0cd4ed",
"score": "0.7092159",
"text": "def max_cryptoval(array)\n\nputs\n\tputs \"Chosis le nombre du TOP de crypto que tu veux voir (TOP 1, 5, 10..)\"\n\tvalue = gets.chomp.to_i\n\tprint \">\"\n\tmax_cv = array.max(value)\n\n\n\t\treturn max_cv\n\nend",
"title": ""
},
{
"docid": "a88fb232a569d83d9601fe1d5ea84d27",
"score": "0.7089099",
"text": "def max\n \n max = @matrix[0][0]\n # Establecemos valor del primer elemento\n #Fila a fila actualizando el valor maximo\n @fil.times do |i|\n @matrix[i].inject(max) do |acc , j|\n acc > j ? max : max = j\n end\n end\n max\n end",
"title": ""
},
{
"docid": "9599af627b2b91384b170946f0cedbbd",
"score": "0.70849866",
"text": "def find_largest array\n array.max\nend",
"title": ""
},
{
"docid": "a39f560677e739babc4e37f35f7b9f02",
"score": "0.70821923",
"text": "def maximum_value\n (@maximum_value || store.max).to_f\n end",
"title": ""
},
{
"docid": "aa607eb0d3f01f52dc53ef7b9ede4486",
"score": "0.707365",
"text": "def largest_val(sample_array)\n return sample_array.max\nend",
"title": ""
},
{
"docid": "c9406cee92d707bee47547058f4b6de8",
"score": "0.70733994",
"text": "def most\n @awesomes.max\n end",
"title": ""
},
{
"docid": "f4e8ade1d3ff2c15899c075fda6792b1",
"score": "0.70711106",
"text": "def max\n items.map(&:to_f).max\n end",
"title": ""
},
{
"docid": "595ef42da849ebbbd09175cfa83af4d3",
"score": "0.7043045",
"text": "def max_hand\n if self.total == []\n return 0\n end\n max = self.total[0]\n for value in self.total\n max = value < max ? max : value\n end\n return max\n end",
"title": ""
},
{
"docid": "282b87bedad7f3b461ab0115e7febed4",
"score": "0.7034335",
"text": "def max\n\ttemp = @first\n\tmaxValue = nil\n\tif !temp.nil? then\n\t\tmaxValue = temp.value\n\t\ttemp = temp.next\n\tend\n\twhile !temp.nil?\n\t\tif temp.value > maxValue then\n\t\t\tmaxValue = temp.value\n\t\tend\n\t\ttemp = temp.next\n\tend\n\treturn maxValue\n end",
"title": ""
},
{
"docid": "140d2ee4495f54b69ba05c476ecf661b",
"score": "0.7033817",
"text": "def max_salary\n approx_salaries.maximum(:max_salary)\n end",
"title": ""
},
{
"docid": "615518d8970496cfd90f49eae3201205",
"score": "0.7032508",
"text": "def max_x; end",
"title": ""
},
{
"docid": "684c371f72560a39278b0a0ba3041c92",
"score": "0.7018436",
"text": "def max\n max=mat[0][0] # Maximo toma como valor inicial el primer elemento de la matriz\t\n 0.upto(nfil-1) do |i|\n\t @mat[i].inject(max) do |aux , j| # j recorre la matriz \n aux > j ? max : max = j\n end\n end \t\t\t\t \t\n return max \n end",
"title": ""
},
{
"docid": "cc937fa2f8cfe3221c35f035c596a2cd",
"score": "0.7017986",
"text": "def max\n \n maximo = @m[0][0].to_f\n for i in 0...@f do\n for j in 0...@c do\n if @m[i][j].to_f > maximo.to_f\n maximo = @m[i][j]\n end\n end\n end\n maximo\n\n end",
"title": ""
},
{
"docid": "3bc044e1bbc59757edd71c6ecd0e80a6",
"score": "0.7015502",
"text": "def max\r\n # Si toda la matriz es 0, el maximo sera 0\r\n if(porcentaje_nulos == 1.0)\r\n return 0\r\n end\r\n \r\n max = nil\r\n \r\n # Asignar al primer valor no-nulo de la matriz (el primero que encuentre hasta que deje de ser nil)\r\n i = 0\r\n while(max == nil)\r\n if(@matrix[i].size != 0)\r\n max = @matrix[i].values[0]\r\n end\r\n i += 1\r\n end\r\n \r\n # Iterar por todos los elementos no nulos para encontrar el maximo\r\n i = 0\r\n (0..(@matrix.size-1)).each do |i|\r\n if(@matrix[i].values.max != nil and @matrix[i].values.max > max)\r\n max = @matrix[i].values.max\r\n end\r\n end\r\n \r\n max\r\n end",
"title": ""
},
{
"docid": "650cfe001eb1ba958466ec326f230018",
"score": "0.7014799",
"text": "def test_max_by\n assert_equal 2, @triple.max_by { |e| -e }\n end",
"title": ""
},
{
"docid": "bdb0721bc8d85e3a0f1e6445ff6cc734",
"score": "0.701402",
"text": "def get_max()\n \n return @min_max_stack[-1][\"max\"]\n end",
"title": ""
},
{
"docid": "97927818ce2b59729d39c8c61183cbd6",
"score": "0.7014",
"text": "def base_max; end",
"title": ""
},
{
"docid": "97927818ce2b59729d39c8c61183cbd6",
"score": "0.7014",
"text": "def base_max; end",
"title": ""
}
] |
b8737c8429d80b89e4359c3460a323c3
|
Public: Turn the piezo off. Returns nothing.
|
[
{
"docid": "2b7e1b7098a6cb51237a9592b9a533d7",
"score": "0.61958396",
"text": "def off\n @is_on = false\n @pin.analog_write(0)\n end",
"title": ""
}
] |
[
{
"docid": "3efa246ed55c3d7527c5d82b56eb480a",
"score": "0.69996804",
"text": "def off\n set_power(\"off\", \"smooth\",1000)\n end",
"title": ""
},
{
"docid": "b8d44e581429918a95d9e83ed1fc58c8",
"score": "0.6718495",
"text": "def turn_off\n set_power(:off)\n end",
"title": ""
},
{
"docid": "8a3695597664110422c8c50ed4fc8e67",
"score": "0.65401185",
"text": "def off!\n set(:on => false)\n end",
"title": ""
},
{
"docid": "186eaa2664d34aaab41da8944077ce45",
"score": "0.6468836",
"text": "def off! \n set_state(0) \n end",
"title": ""
},
{
"docid": "df0ded3724ec6f27d235d395b371bb35",
"score": "0.6269662",
"text": "def off!\n pin.off!\n end",
"title": ""
},
{
"docid": "54a9271dcfc757c2206828fd5ee83dff",
"score": "0.6231525",
"text": "def off\n Razor::IPMI.power(self, false)\n end",
"title": ""
},
{
"docid": "e7375e696efad0e30e92a6ba3c7544cb",
"score": "0.6197238",
"text": "def off\n update(0, 0, 0)\n end",
"title": ""
},
{
"docid": "308f769bcf4a7a1c538167b294ae0ee8",
"score": "0.61963576",
"text": "def off!\n\t\t\tself.on = false\n\t\tend",
"title": ""
},
{
"docid": "1ed6cfa3dd35db918a6360e74437c05d",
"score": "0.61679375",
"text": "def off\n @on = false\n Rpio.driver.pwm_set_mode(@options[:pin], options[:mode], 0) #check if compatible with other driver than bcm2835\n end",
"title": ""
},
{
"docid": "19c3555d44efe8546b678eed4597768d",
"score": "0.60622877",
"text": "def off\n Rpio.driver.gpio_write(@options[:pin], GPIO_LOW) if @options[:direction] == :out\n end",
"title": ""
},
{
"docid": "c7ef939d73678775dcae9288787f2c4c",
"score": "0.60389864",
"text": "def off\n :off\n end",
"title": ""
},
{
"docid": "50fab46075ee0549890a832a6b818294",
"score": "0.6019377",
"text": "def off!\n\tlight.off!\n end",
"title": ""
},
{
"docid": "22ceb9e4bea4b044e96c85cbd84163c5",
"score": "0.5944094",
"text": "def off\n @pin.set_mode(Pin::OUTPUT)\n @pin.digital_write(Pin::LOW)\n @is_on = false\n end",
"title": ""
},
{
"docid": "b2d740542b5ad693d01f38fc80be7020",
"score": "0.5930468",
"text": "def off\n @command.execute(zone_id, [0x31, 0x00, 0x00, 0x08, 0x04, 0x02, 0x00, 0x00, 0x00])\n\n self\n end",
"title": ""
},
{
"docid": "e2055b8184438b6f42ebe04b37e8fe1c",
"score": "0.58600587",
"text": "def off\n GPIO.write \"gpio#{@number}/value\", \"0\"\n end",
"title": ""
},
{
"docid": "07aa0a2ff7c22b436a514ac1c980ec0a",
"score": "0.584438",
"text": "def off(light)\n write(light, on: false)\n end",
"title": ""
},
{
"docid": "9126db7e6b618204623659cd7fb1f5b0",
"score": "0.58285725",
"text": "def off\n Platform.driver.pin_set(pin, GPIO_LOW) if direction == :out\n end",
"title": ""
},
{
"docid": "12a0996d45d86db8af4b276565b82c0d",
"score": "0.5813259",
"text": "def turn_off() \n super()\n @dancers.each do |dancer|\n dancer.turn_off()\n end\n end",
"title": ""
},
{
"docid": "d95150eb5beeacdc6a0230a106cb2f42",
"score": "0.58090323",
"text": "def turn_off\n @output_pins.each do |pin|\n set_low(pin)\n end\n end",
"title": ""
},
{
"docid": "f7b4ffcb028678a342816fc1d9e7fcab",
"score": "0.57946277",
"text": "def deja_vue_off\n self.deja_vue_active = false\n end",
"title": ""
},
{
"docid": "e698c8afe21cbcbbbe8840db3f2ceefa",
"score": "0.57658845",
"text": "def accessory_panel_power_off\n command(\"#:f-#\")\n end",
"title": ""
},
{
"docid": "73e0815d6d1e344149f6c4d6cad23a2e",
"score": "0.5750326",
"text": "def turn_off\n change_speed(-speed)\n return(self)\n end",
"title": ""
},
{
"docid": "d32e2385def0a5e7a17f3ab25f0542ff",
"score": "0.5745557",
"text": "def lightsOff\n @turn_lights_on_off=false\n end",
"title": ""
},
{
"docid": "be3553676d9e48999a4fc9e2ba7260bc",
"score": "0.5733625",
"text": "def execute\n @light.off\n end",
"title": ""
},
{
"docid": "5e37b159cf761889845f5b3e51cb4bc5",
"score": "0.5709851",
"text": "def off\n publish_command(:off)\n # also notify all listeners\n update_state(:off)\n end",
"title": ""
},
{
"docid": "2099602de0db0ca16a4bad002ab78be5",
"score": "0.56937385",
"text": "def power_off(force = false)\n set_power_state('off', force)\n end",
"title": ""
},
{
"docid": "b5130ee8c4578b5e8aa21298d9f405f2",
"score": "0.5671896",
"text": "def turnLightsOff\n @lightsOn = false\n end",
"title": ""
},
{
"docid": "71059b31026a5571f76e3121f94e96b1",
"score": "0.5634794",
"text": "def off\n\t\t\tself.reset_strip\n\t\t\t\n\t\t\tself.write(only_if_autowrite: true)\n\t\tend",
"title": ""
},
{
"docid": "2eb1685f935f817429ce09b0edb38716",
"score": "0.5611963",
"text": "def execute\n @light.off\n end",
"title": ""
},
{
"docid": "c896a3bdd4ae138cf21e5830177101c4",
"score": "0.55624145",
"text": "def zoff\n midi_local_control_off\n midi_all_notes_off\n end",
"title": ""
},
{
"docid": "6ee178cf9e8da69ec1dc3418c8ab53f1",
"score": "0.5518976",
"text": "def off() \n stop\n @handle.release_interface(0)\n end",
"title": ""
},
{
"docid": "fa094535493d57f745d5f320de8ccc95",
"score": "0.5513097",
"text": "def disable!\n set_enabled!(false)\n end",
"title": ""
},
{
"docid": "a77973f1d6b280149019e7006f81c067",
"score": "0.5504934",
"text": "def off\n @speed = OFF\n puts \"#{@location} ceiling fan is off\"\n end",
"title": ""
},
{
"docid": "a77973f1d6b280149019e7006f81c067",
"score": "0.5504934",
"text": "def off\n @speed = OFF\n puts \"#{@location} ceiling fan is off\"\n end",
"title": ""
},
{
"docid": "a77973f1d6b280149019e7006f81c067",
"score": "0.5504934",
"text": "def off\n @speed = OFF\n puts \"#{@location} ceiling fan is off\"\n end",
"title": ""
},
{
"docid": "95216ad768881c556e2f2b31ffb38ecd",
"score": "0.54936147",
"text": "def turn_off\n each &:turn_off\n end",
"title": ""
},
{
"docid": "57670218d382b66654eaffef580b5aa5",
"score": "0.5488583",
"text": "def gps_off\n command(\"#:g-#\")\n end",
"title": ""
},
{
"docid": "fce6f0e5c19922da009c3cc1145cbc95",
"score": "0.54723626",
"text": "def disable_background\n @show_background = false\n end",
"title": ""
},
{
"docid": "8a903664cb66c75958948ac4b20f1a53",
"score": "0.5450289",
"text": "def off\n target.off(self)\n end",
"title": ""
},
{
"docid": "068ec8e19c47f0513d405f1caef1cadd",
"score": "0.54353696",
"text": "def turn_off(options = { })\n if @options_stored\n @options_store.each do |key, value|\n if value\n run_client \"set #{ key } #{ value }\"\n else\n run_client \"set -u #{ key }\"\n end\n end\n\n reset_options_store\n end\n\n run_client 'set quiet off'\n end",
"title": ""
},
{
"docid": "1971d761eb91ff49962ab3dc203ec05f",
"score": "0.541397",
"text": "def disable_landmark()\n Landmark::Rails.enabled = false\n end",
"title": ""
},
{
"docid": "5680de3c7ef41d60488163eb01db3a72",
"score": "0.5401345",
"text": "def hide\n call Screen.setColor(false)\n call draw\n end",
"title": ""
},
{
"docid": "57fafb079d8bdef8c3df1aa578b948bb",
"score": "0.5386979",
"text": "def noDisplay\n @displaycontrol &= ~LCD_DISPLAYON\n write(LCD_DISPLAYCONTROL | @displaycontrol) \n end",
"title": ""
},
{
"docid": "dc8881163b80163349d1992d27efafae",
"score": "0.53637666",
"text": "def turn_off\n @speed = 0\n puts \"The car is stopped and is off!\"\n end",
"title": ""
},
{
"docid": "ec77b58ef0c0f36d866392d69c9404c5",
"score": "0.5347897",
"text": "def off\n response = put('state', on: false)\n set_power_from_response!(response)\n response_successful?(response)\n end",
"title": ""
},
{
"docid": "190571592cf7ff62be02c24db0366468",
"score": "0.5337983",
"text": "def noBlink\n @displaycontrol &= ~LCD_BLINKON\n write(LCD_DISPLAYCONTROL | @displaycontrol)\n end",
"title": ""
},
{
"docid": "4f20db61c22dee8de65e7787e4ab3dbd",
"score": "0.53371966",
"text": "def no_display\n @displaycontrol &= ~LCD_DISPLAYON\n write(LCD_DISPLAYCONTROL | @displaycontrol)\n end",
"title": ""
},
{
"docid": "7f2cbe80a4a45bb20ca3b7fa12fca425",
"score": "0.5334059",
"text": "def shut_off()\n @current_speed = 0\n puts \"It's all shut down now.\"\n end",
"title": ""
},
{
"docid": "5c1526e065a599eb9d635af72d40d143",
"score": "0.5332737",
"text": "def disable_colours\n @disable_colours = true\n end",
"title": ""
},
{
"docid": "43ede65807b13257a4401db707d8d41d",
"score": "0.5326887",
"text": "def disable()\n @enabled = false\n FTO.rebuildEffectorList()\n end",
"title": ""
},
{
"docid": "c1f5d5a5835b2246913691a37259711a",
"score": "0.53211",
"text": "def turn_off_debugging!\n @savon_options[:log] = false # disable logging\n @savon_options[:log_level] = :info # changing the log level\n end",
"title": ""
},
{
"docid": "232275cee9ea48713d5fabf63521a7d0",
"score": "0.5316862",
"text": "def disable() @enabled = false end",
"title": ""
},
{
"docid": "788c0bcfe9d4b953c6eefe0d7a90bf44",
"score": "0.5316089",
"text": "def disable_telemetry\n @telemetry_toggled_off = true\n end",
"title": ""
},
{
"docid": "9d399cb344f3f729ebc4188d14865fa8",
"score": "0.5308538",
"text": "def hide!\n # TODO actually mess with the blend modes instead of\n # just putting things way off canvas\n return if @hidden_by_kelly\n translate(100000, 10000)\n @hidden_by_kelly = true\n end",
"title": ""
},
{
"docid": "9d7a6cb29ec87b6193f23510cc32cb09",
"score": "0.5303838",
"text": "def off?\n Rlint.switch ? false : true\n end",
"title": ""
},
{
"docid": "c5a8486231d5de68bee581b66a5a555c",
"score": "0.529924",
"text": "def disable\n {\n method: \"Animation.disable\"\n }\n end",
"title": ""
},
{
"docid": "19d66fc683894427cbfc9a9b57850ef5",
"score": "0.52933764",
"text": "def turn_off_debugging!\n @savon_options[:log] = false # disable logging\n @savon_options[:log_level] = :info # changing the log level\n end",
"title": ""
},
{
"docid": "8b267853d19a876ecd1fade796c2ed91",
"score": "0.52898055",
"text": "def no_prorate\n @proration_behavior = 'none'\n\n self\n end",
"title": ""
},
{
"docid": "778e6ae66fd0e90a2791a894c50e1675",
"score": "0.52864134",
"text": "def turn_all_off\n LOCATION_TO_BCM.each do |_location, bcm|\n RPi::GPIO.set_low bcm\n end\n end",
"title": ""
},
{
"docid": "04cb08c11d2354ba8d4378eff9c9508b",
"score": "0.5284889",
"text": "def disable!\n self.enabled = false\n end",
"title": ""
},
{
"docid": "a384488edb94e10e91264ffb2c989882",
"score": "0.52764136",
"text": "def turn_weather_off(player_turn)\n if @weather[0] + @weather[3] == @day and @weather[1] == player_turn\n set_weather('none')\n end\n end",
"title": ""
},
{
"docid": "2c398f0b207e6abf1dc00e0443412805",
"score": "0.5271054",
"text": "def disable_colorization=(value)\n @disable_colorization = (value || false)\n end",
"title": ""
},
{
"docid": "2c398f0b207e6abf1dc00e0443412805",
"score": "0.5271054",
"text": "def disable_colorization=(value)\n @disable_colorization = (value || false)\n end",
"title": ""
},
{
"docid": "5d2bb1198055b7a9fa2efc66502ca69a",
"score": "0.52705526",
"text": "def off\n heroku.maintenance(app, :off)\n display \"Maintenance mode disabled.\"\n end",
"title": ""
},
{
"docid": "f172c7befb7bf375e75a4d47e2c0c0cf",
"score": "0.52660745",
"text": "def no_blink\n @displaycontrol &= ~LCD_BLINKON\n write(LCD_DISPLAYCONTROL | @displaycontrol)\n end",
"title": ""
},
{
"docid": "e855c1747a7973ec8fe657e77c729e66",
"score": "0.52643216",
"text": "def tv_off\n unless @tv[:on].nil? || @tv[:on] == false\n system('echo \"standby 0\" | cec-client -s >/dev/null')\n end\n\n @tv[:on] = false unless @tv[:on].nil?\n end",
"title": ""
},
{
"docid": "627bc034bd4e29e6d7bb6543437f0f25",
"score": "0.5257346",
"text": "def reset!\n @data_series = []\n @telemetry_toggled_off = false\n end",
"title": ""
},
{
"docid": "ee58e269ed37c83f1375a96d5a11171f",
"score": "0.5254715",
"text": "def disable!\n @enabled = false\n end",
"title": ""
},
{
"docid": "5b866dd8442e0e0d11ed72ffba82e63c",
"score": "0.5243666",
"text": "def turn_widget_off() @do_not_show_widget = true end",
"title": ""
},
{
"docid": "e68256d6812e5b552e6df1c8628223cf",
"score": "0.523659",
"text": "def off()\n if (! @on)\n return\n end\n\n url = \"#{@url}&command=stop\"\n NodeHandler.service_call(url, \"Can't switch generator off\")\n #info(\"Switched off signal generator #{inst_id}\")\n info(\"Switched off signal generator\")\n @on = false\n end",
"title": ""
},
{
"docid": "5125aaf9624abc6e24b1ea6f478e0d42",
"score": "0.5233718",
"text": "def reset\n @trig_pin.off\n end",
"title": ""
},
{
"docid": "f95aa6fb6274c0976cd6e1403f85e6aa",
"score": "0.52336544",
"text": "def set_type_none\n set_type_reset_sprite(nil)\n end",
"title": ""
},
{
"docid": "6c22d5697e4da3556137fd46a72c9fe6",
"score": "0.5225548",
"text": "def turn_off\n do_request post_request(\"/api/services/remote/turn_off\")\n end",
"title": ""
},
{
"docid": "483840564c54e8df48b4016131c74e0c",
"score": "0.52172995",
"text": "def disable\n conf.disable\n end",
"title": ""
},
{
"docid": "13b1929859cda5d2d9f4ad6557ffcb4a",
"score": "0.52148026",
"text": "def uncolor; end",
"title": ""
},
{
"docid": "76903c5288051eafbe0ecded0b04ff4d",
"score": "0.5209274",
"text": "def clear\n @visible = false\n @isghost = false\n @stone_placed = false\n @color = nil\n end",
"title": ""
},
{
"docid": "6168a81efa7cc4d599d300bd212f092e",
"score": "0.5209102",
"text": "def set_all_off\n data = Array.new(80, (@double_buffer ? 0x00 : 0x0C))\n if @offline_updates\n @offline_updates = data\n else\n send_midi(0x92, *data)\n end\n end",
"title": ""
},
{
"docid": "71026634470d6160a587dc19a9607de8",
"score": "0.52014303",
"text": "def disable!\n @enabled = false\n end",
"title": ""
},
{
"docid": "71026634470d6160a587dc19a9607de8",
"score": "0.52014303",
"text": "def disable!\n @enabled = false\n end",
"title": ""
},
{
"docid": "71026634470d6160a587dc19a9607de8",
"score": "0.52014303",
"text": "def disable!\n @enabled = false\n end",
"title": ""
},
{
"docid": "71026634470d6160a587dc19a9607de8",
"score": "0.52014303",
"text": "def disable!\n @enabled = false\n end",
"title": ""
},
{
"docid": "2a5aae775b715525476bb88f405ce793",
"score": "0.51957524",
"text": "def unforceVisible\r\n @forced=false\r\n end",
"title": ""
},
{
"docid": "2a5aae775b715525476bb88f405ce793",
"score": "0.51957524",
"text": "def unforceVisible\r\n @forced=false\r\n end",
"title": ""
},
{
"docid": "584e7fb3e5e8db4df06eb9ea327c307f",
"score": "0.5186118",
"text": "def sweep_stairs\n turn_off\n end",
"title": ""
},
{
"docid": "584e7fb3e5e8db4df06eb9ea327c307f",
"score": "0.5186118",
"text": "def sweep_stairs\n turn_off\n end",
"title": ""
},
{
"docid": "12ca4b6b7d596279475b7c4c449145eb",
"score": "0.5178269",
"text": "def off\n Heroku::JSPlugin.install('heroku-apps')\n Heroku::JSPlugin.run('maintenance', 'off', ARGV[1..-1])\n end",
"title": ""
},
{
"docid": "dfb7e37349fd4705e2f3d7025947c6ca",
"score": "0.5176123",
"text": "def turn_off_pair(pair_number)\n each_beacon_in_pair(pair_number) do |color, device|\n device.mode = :off\n end\n end",
"title": ""
},
{
"docid": "6a69dd794e8a413a61f2c25039c9d3d1",
"score": "0.51751816",
"text": "def turn_off_zone(zone=1)\n send_code(\"40#{module_address_for_zone(zone)}4#{zone}\")\n end",
"title": ""
},
{
"docid": "12b8e7650b56d58acd2005406f580922",
"score": "0.5174304",
"text": "def off?\n !@is_on\n end",
"title": ""
},
{
"docid": "3cb24e3aeb01d0f9e6f9eea398912178",
"score": "0.5172115",
"text": "def st_off\n write(Barrister::COMMAND[:st_off])\n end",
"title": ""
},
{
"docid": "f7eadacd5b1721005f3283a145610371",
"score": "0.51704293",
"text": "def disable!\n model.enabled = false\n\n hide_bottom!\n hide_left!\n hide_right!\n hide_top!\n\n model.enabled\n end",
"title": ""
},
{
"docid": "dcbfc76fef5e51067082c05a7cafbe51",
"score": "0.51569337",
"text": "def turn_off_all\n Thread.exclusive do\n beacons.each {|device| device.mode = :off}\n end\n end",
"title": ""
},
{
"docid": "9b6bb3e0e20a362cfb0740d7fe33ef5b",
"score": "0.5154936",
"text": "def disable!\n @enable = false\n end",
"title": ""
},
{
"docid": "882f25290193c7212582743142b9f127",
"score": "0.5153219",
"text": "def off\n validate_arguments!\n\n action(\"Disabling maintenance mode for #{app}\") do\n api.post_app_maintenance(app, '0')\n end\n end",
"title": ""
},
{
"docid": "38d4511f77c5d7a25484d89ddde00beb",
"score": "0.51487875",
"text": "def unlight_area\n @selected = false\n @select_sprite.opacity = 0\n refresh\n end",
"title": ""
},
{
"docid": "ccd8bf9dabb244c506e210ffaa5afc21",
"score": "0.5143093",
"text": "def turnBrakeOff\n @parkingBrakeOn = false\n end",
"title": ""
},
{
"docid": "338398215780940bb9bb67294d5bfb2d",
"score": "0.5143003",
"text": "def hide\n ole_obj.Hide\n end",
"title": ""
},
{
"docid": "e93b143862137c30b54906d2943fd9b0",
"score": "0.51388556",
"text": "def clear_shadow\n\t\t@shadow_active = false\n\tend",
"title": ""
},
{
"docid": "431301ad75af1ae26c33f0fb33e9297d",
"score": "0.51385754",
"text": "def disable\n @enable = false\n end",
"title": ""
},
{
"docid": "27974f9c5fa51e1d90ac720cbc4e67f0",
"score": "0.51348305",
"text": "def default_off\n @default_activated = false\n end",
"title": ""
}
] |
c0b9377aa1c9ca745bd453ad49d91136
|
GET /interventions/1 GET /interventions/1.json
|
[
{
"docid": "64afe09c133b9460353c4183891be80a",
"score": "0.0",
"text": "def show\n @page = Page.new\n end",
"title": ""
}
] |
[
{
"docid": "b234784c4191f9b2ac571d4c9197e48e",
"score": "0.70164526",
"text": "def show\n @intervention = Intervention.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @intervention }\n end\n end",
"title": ""
},
{
"docid": "29098608e0e8755a4e325274959eca20",
"score": "0.6971287",
"text": "def index\n @interventions = Intervention.all\n end",
"title": ""
},
{
"docid": "29098608e0e8755a4e325274959eca20",
"score": "0.6971287",
"text": "def index\n @interventions = Intervention.all\n end",
"title": ""
},
{
"docid": "29098608e0e8755a4e325274959eca20",
"score": "0.6971287",
"text": "def index\n @interventions = Intervention.all\n end",
"title": ""
},
{
"docid": "29098608e0e8755a4e325274959eca20",
"score": "0.6971287",
"text": "def index\n @interventions = Intervention.all\n end",
"title": ""
},
{
"docid": "29098608e0e8755a4e325274959eca20",
"score": "0.6971287",
"text": "def index\n @interventions = Intervention.all\n end",
"title": ""
},
{
"docid": "29098608e0e8755a4e325274959eca20",
"score": "0.6971287",
"text": "def index\n @interventions = Intervention.all\n end",
"title": ""
},
{
"docid": "29098608e0e8755a4e325274959eca20",
"score": "0.6971287",
"text": "def index\n @interventions = Intervention.all\n end",
"title": ""
},
{
"docid": "29098608e0e8755a4e325274959eca20",
"score": "0.6971287",
"text": "def index\n @interventions = Intervention.all\n end",
"title": ""
},
{
"docid": "3c77b525194d76bf74f575dab0ef3a76",
"score": "0.67083055",
"text": "def index\n @inventions = Invention.all\n end",
"title": ""
},
{
"docid": "0cd387d1ee662aac4cb8091eb2b8b026",
"score": "0.65200543",
"text": "def show\n @initiative = Initiative.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @initiative }\n end\n end",
"title": ""
},
{
"docid": "0cd387d1ee662aac4cb8091eb2b8b026",
"score": "0.65200543",
"text": "def show\n @initiative = Initiative.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @initiative }\n end\n end",
"title": ""
},
{
"docid": "29a3b921c0e5fa0528d7356272103a42",
"score": "0.65101",
"text": "def show\n @initiative = Initiative.friendly.find(params[:id])\n\n render json: @initiative\n end",
"title": ""
},
{
"docid": "59919ccba9a843a1ff81f9729874363f",
"score": "0.64882845",
"text": "def index\n redirect_to index_url\n @interventions = Intervention.all\n end",
"title": ""
},
{
"docid": "59919ccba9a843a1ff81f9729874363f",
"score": "0.64882845",
"text": "def index\n redirect_to index_url\n @interventions = Intervention.all\n end",
"title": ""
},
{
"docid": "d34c292d7022c563d0fd8656c8e03e33",
"score": "0.6420367",
"text": "def search_ctrp_interventions\n @intervention = nil\n if params[:c_code].present?\n @intervention = Intervention.find_by_c_code(params[:c_code]) # first match\n end\n\n respond_to do |format|\n format.json { render :json => { :data => @intervention } }\n end\n\n end",
"title": ""
},
{
"docid": "49df72e7ea36610748b7b9e7b1278ac4",
"score": "0.6355312",
"text": "def index\n @theader = Theader.find params[:office_id]\n respond_to { |f| f.json {} }\n end",
"title": ""
},
{
"docid": "22180ff143e31ff696cb17a5f9e67276",
"score": "0.6337151",
"text": "def show\n @interveniente = Interveniente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interveniente }\n end\n end",
"title": ""
},
{
"docid": "f46ecd73de2c4a8101d5c84dd032dce6",
"score": "0.6305379",
"text": "def show\n @occasion = Occasion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @occasion }\n end\n end",
"title": ""
},
{
"docid": "50e0770d44fa981d4381696e81f7ca35",
"score": "0.63040197",
"text": "def show\n @interim_attestation = InterimAttestation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interim_attestation }\n end\n end",
"title": ""
},
{
"docid": "a213135f274ce6ebaeab0f98c93aa87a",
"score": "0.6283942",
"text": "def show\n @convenio = Convenio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @convenio }\n end\n end",
"title": ""
},
{
"docid": "3c9688612d37a2bd2711099d2a17df8d",
"score": "0.6208724",
"text": "def show\n @interior = Interior.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interior }\n end\n end",
"title": ""
},
{
"docid": "3fa3397b0704a848f398083a2e50d587",
"score": "0.6185265",
"text": "def show\n @equipment = Equipment.find(params[:equipment_id])\n @interventions = Intervention.where(equipment_id: @equipment.id)\n end",
"title": ""
},
{
"docid": "398a2e9bf4d356b5b16193d315b5cf25",
"score": "0.6149069",
"text": "def show\n @ice_ore = IceOre.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ice_ore }\n end\n end",
"title": ""
},
{
"docid": "3656158a031f8dd6db202f37f14297d2",
"score": "0.61146873",
"text": "def show\n @inventario = Inventario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inventario }\n end\n end",
"title": ""
},
{
"docid": "668660e8b3ca148a64f4c0d87c20f01d",
"score": "0.6111159",
"text": "def index\n \n @interviews = Interview.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interviews }\n end\n end",
"title": ""
},
{
"docid": "e1b333b5e91cf6bc9b95ce1994a8e568",
"score": "0.61070377",
"text": "def set_intervention\n @interventions = Intervention.find(params[:id])\n end",
"title": ""
},
{
"docid": "6b90793e4a546fae05ff41f37c0992a7",
"score": "0.6103942",
"text": "def index\n @ice_ores = IceOre.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ice_ores }\n end\n end",
"title": ""
},
{
"docid": "00b5e33796dc772cd9775f85da31a2e9",
"score": "0.6090958",
"text": "def show\n @interview_type = InterviewType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interview_type }\n end\n end",
"title": ""
},
{
"docid": "250c8d925d39015776e9c74f98a8380b",
"score": "0.6087873",
"text": "def show\n @economia1 = Economia1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @economia1 }\n end\n end",
"title": ""
},
{
"docid": "572ee53137a0b0bbba11206641e74a50",
"score": "0.60854375",
"text": "def interventions\n get_data_elements('intervention')\n end",
"title": ""
},
{
"docid": "aeeabc1ebdcd4a20b721f865b0608879",
"score": "0.60640705",
"text": "def get_info_cal_risk\n\t\tcal = RiskCalification.where(\"risk_id = ? AND risk_escenario_id = ?\", params[:idRisk].to_i, params[:idEsc].to_i).first\n\t\trespond_to do |format|\n\t\t\tformat.json {render json: cal}\n \tend\n\tend",
"title": ""
},
{
"docid": "20d7ebc0c93fdaa14fe231fc64528eda",
"score": "0.60594726",
"text": "def show\n @one_time_obligation = OneTimeObligation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @one_time_obligation }\n end\n end",
"title": ""
},
{
"docid": "b6d15f96e9ea083952fd1cc292938896",
"score": "0.60573053",
"text": "def show\n @obligation = Obligation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @obligation }\n end\n end",
"title": ""
},
{
"docid": "b7f6ef8c2675c02accad2bc78ada5505",
"score": "0.605262",
"text": "def show\n @interpro = Interpro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interpro }\n end\n end",
"title": ""
},
{
"docid": "03f335f5956bf1773a837731f1d63266",
"score": "0.6037173",
"text": "def show\n @rdf_intervention = RdfIntervention.find_by_id(params[:rdf_uri])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rdf_intervention }\n end\n end",
"title": ""
},
{
"docid": "0c465458441ad29dbbae281b9610a37d",
"score": "0.6036475",
"text": "def show\n @itenerary = Itenerary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @itenerary }\n end\n end",
"title": ""
},
{
"docid": "45ba9dd920a60a2d8dcf2183de8aea15",
"score": "0.6028998",
"text": "def show\n @inspiration = get_inspiration(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inspiration }\n end\n end",
"title": ""
},
{
"docid": "67a31951fc32f95b3ba3e96433822ddb",
"score": "0.6025325",
"text": "def show\n @involve = Involve.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @involve }\n end\n end",
"title": ""
},
{
"docid": "e7bb8b3fdbcabecf5613c80e3afba4aa",
"score": "0.60246444",
"text": "def show\n @reoccuring_obligation = ReoccuringObligation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reoccuring_obligation }\n end\n end",
"title": ""
},
{
"docid": "b4554a1a82d11d88d7d18b7244b7b324",
"score": "0.6019165",
"text": "def invention\n fetch('silicon_valley.inventions')\n end",
"title": ""
},
{
"docid": "b69d93ea6d591c790c7919ade9ebdf83",
"score": "0.6000845",
"text": "def show\n @apprenticeship = Apprenticeship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @apprenticeship }\n end\n end",
"title": ""
},
{
"docid": "c9f0fe312f467bc931e05720ceefd843",
"score": "0.59847534",
"text": "def show\n @experiencium = Experiencium.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experiencium }\n end\n end",
"title": ""
},
{
"docid": "e49fd845c1f5d5d5fde3a5ec23a73a27",
"score": "0.59841937",
"text": "def show\n @ontology = Ontology.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ontology }\n end\n end",
"title": ""
},
{
"docid": "cdadcd16ff22bcc6261936c13ab2a519",
"score": "0.5965161",
"text": "def show\n @industry = Industry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @industry }\n end\n end",
"title": ""
},
{
"docid": "01e8d69bf2a74001e04caf2c58de9f76",
"score": "0.5955262",
"text": "def create\n \n respond_to do |format|\n if @interventions.save\n format.html { redirect_to @intervention, notice: 'Intervention was successfully created.' }\n format.json { render :show, status: :created, location: @intervention }\n else\n format.html { render :new }\n format.json { render json: @intervention.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7d2c5bc68af68c13f05e0cad57e84bc1",
"score": "0.59459066",
"text": "def income_resource\n income_resource = InvestorDetail.income_resources\n render json: {\n ststus: 'OK',\n results: income_resource,\n error: nil\n }, status: :ok\n end",
"title": ""
},
{
"docid": "aa13cf2b3e14342f4d1c7a9db3b2a886",
"score": "0.59442204",
"text": "def show\n @initiative = Initiative.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @initiative }\n end\n end",
"title": ""
},
{
"docid": "168a30994ae94eb958afa21d6684c70a",
"score": "0.59416413",
"text": "def show\n @initiative = Initiative.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @initiative }\n end\n end",
"title": ""
},
{
"docid": "678fe4d11296e7536799bec567192df1",
"score": "0.59412146",
"text": "def show\n @icd = Icd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @icd }\n end\n end",
"title": ""
},
{
"docid": "82dd3438fab96195118709b737800b29",
"score": "0.59297407",
"text": "def show\n @appreciation = Appreciation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appreciation }\n end\n end",
"title": ""
},
{
"docid": "23a4630a291ea01f70ba2bceb17e78c9",
"score": "0.5928014",
"text": "def show\n @ocupation = Ocupation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ocupation }\n end\n end",
"title": ""
},
{
"docid": "ce97c0ec09002da45135ad65feee595d",
"score": "0.59275055",
"text": "def index\n @residenciais = Residencial.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @residenciais }\n end\n end",
"title": ""
},
{
"docid": "5f6d070fbfb8e653db5426620ad8cf71",
"score": "0.59212494",
"text": "def index\n @confessions = Confession.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @confessions }\n end\n end",
"title": ""
},
{
"docid": "c6a4eacc4ff3895abe543921c75ed3f1",
"score": "0.59130293",
"text": "def new\n @intervention = Intervention.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @intervention }\n end\n end",
"title": ""
},
{
"docid": "459860d9128ae81f9ffbab5c4b56ad91",
"score": "0.59027267",
"text": "def show\n @insurance = Insurance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @insurance }\n end\n end",
"title": ""
},
{
"docid": "405166aa3f45ad115d6fcc1eae233409",
"score": "0.5892498",
"text": "def show\n @incident = Incident.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @incident }\n end\n end",
"title": ""
},
{
"docid": "d6c77aaa3cd7ccf02cce115ae24e57e1",
"score": "0.58912426",
"text": "def show\n @religion = Religion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @religion }\n end\n end",
"title": ""
},
{
"docid": "0be427cfa8b21041ca2bd64f0b92e47f",
"score": "0.5887201",
"text": "def show\n @ice = Ice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @ice }\n end\n end",
"title": ""
},
{
"docid": "a39ea2e3a2f7e28334539e27d3b3a6e9",
"score": "0.58835",
"text": "def show\n @implate = Implate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @implate }\n end\n end",
"title": ""
},
{
"docid": "5f010375aa1fc1dd028d0caa37323cd5",
"score": "0.5882782",
"text": "def show\n @incident = Incident.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @incident }\n end\n end",
"title": ""
},
{
"docid": "1ca1ea979e9353a9d7f2ef0504f97958",
"score": "0.5874478",
"text": "def show\n @iesire = Iesire.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @iesire }\n end\n end",
"title": ""
},
{
"docid": "5b48f4e6db7e05967eadea35edf0ac51",
"score": "0.58743775",
"text": "def show\n @indonation = Indonation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @indonation }\n end\n end",
"title": ""
},
{
"docid": "344ea8984a9000ed7beca5909b8bf5bc",
"score": "0.5869144",
"text": "def show\n @request_vocational = RequestVocational.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @request_vocational }\n end\n end",
"title": ""
},
{
"docid": "aa9a4d7de3d07b7de03cd5e44b110b97",
"score": "0.5864243",
"text": "def show\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @interview }\r\n end\r\n end",
"title": ""
},
{
"docid": "26bd30e3938dcdac0a1885a4454e64be",
"score": "0.586265",
"text": "def show\n @institute = Institute.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @institute }\n end\n end",
"title": ""
},
{
"docid": "4f78b7035eb982aa7ed154286ad20a1a",
"score": "0.5860747",
"text": "def show\n @competence = Competence.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competence }\n end\n end",
"title": ""
},
{
"docid": "4f78b7035eb982aa7ed154286ad20a1a",
"score": "0.5860747",
"text": "def show\n @competence = Competence.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competence }\n end\n end",
"title": ""
},
{
"docid": "b6a66ee054346177cf81355d8e3a0023",
"score": "0.58599186",
"text": "def show\n @residencial = Residencial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @residencial }\n end\n end",
"title": ""
},
{
"docid": "28ebe4223182eb1313245ef8f890e1f1",
"score": "0.5858609",
"text": "def show\n @economia3 = Economia3.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @economia3 }\n end\n end",
"title": ""
},
{
"docid": "fe9aa10b8a9bf0b13a5329dea7d8c5c6",
"score": "0.58507663",
"text": "def show\n puts \"dddddddddddddddddddddddddddddddddddddd\"\n puts params[:id]\n @interview_event = InterviewEvent.find_by_id(params[:id])\n\n puts @interview_event\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interview_event }\n end\n end",
"title": ""
},
{
"docid": "991664738b63a4d2aa6c27da6f06fdb4",
"score": "0.5843943",
"text": "def index\n @services = @university.services\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @services }\n end\n end",
"title": ""
},
{
"docid": "c3df6d85c9727e04314f5d630e600bc3",
"score": "0.5843165",
"text": "def index\n @societies = Society.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @societies }\n end\n end",
"title": ""
},
{
"docid": "7d17735eb38edf7a7e88e3936dff9174",
"score": "0.58393127",
"text": "def show\n @infomation = Infomation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @infomation }\n end\n end",
"title": ""
},
{
"docid": "2681bce5c14d7a19cb9bba5f4c996fd3",
"score": "0.58383375",
"text": "def show\n @representative = current_company.representatives.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @representative }\n end\n end",
"title": ""
},
{
"docid": "31031c01e68a92c93c4cb0575766b78b",
"score": "0.5834527",
"text": "def show\n\n @comic = Comic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comic }\n end\n end",
"title": ""
},
{
"docid": "00a4db8b88fade7379b533c6c5abcfe0",
"score": "0.582563",
"text": "def show\n @celebration = Celebration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @celebration }\n end\n end",
"title": ""
},
{
"docid": "f8e174bf7959d00f650adaa153070000",
"score": "0.5825428",
"text": "def index\n\n @interviewees = Interviewee.all\n\n \n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interviewees }\n end\n end",
"title": ""
},
{
"docid": "e7f7fa2342974fe7c01f2a1ca9943fd5",
"score": "0.58228713",
"text": "def index\n @institutions = Institution.all\n respond_with(@institutions)\n end",
"title": ""
},
{
"docid": "f2e447d781217579497d4d26f490fa65",
"score": "0.5821381",
"text": "def show\n @auto1h_r2_fold_change = Auto1hR2FoldChange.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @auto1h_r2_fold_change }\n end\n end",
"title": ""
},
{
"docid": "057636aafe504d09f43cb8963e8e233c",
"score": "0.58211756",
"text": "def index\n @intervients = Intervient.all\n end",
"title": ""
},
{
"docid": "c24dc35a5a4a968c14e5d6ce1c9927f3",
"score": "0.5818879",
"text": "def show\n @ignitor_time = IgnitorTime.find(params[:id])\n @associated_institutions = @ignitor_time.institutions\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ignitor_time }\n end\n end",
"title": ""
},
{
"docid": "8cef53fa5ed38129f6660766e61fd414",
"score": "0.5817878",
"text": "def show\n @estetica = Estetica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estetica }\n end\n end",
"title": ""
},
{
"docid": "bbf3c550e293de741b4dac7d651880ed",
"score": "0.5817621",
"text": "def show\n @orgainzation = Orgainzation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @orgainzation }\n end\n end",
"title": ""
},
{
"docid": "27ea58942ef744964ec02b5fe2f6da2d",
"score": "0.580957",
"text": "def show\n @residential = Residential.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @residential }\n end\n end",
"title": ""
},
{
"docid": "b955afafbba42776832149bc30e3593b",
"score": "0.5807148",
"text": "def show\n @title = \"Страховая компания\"\n @insurance_company = InsuranceCompany.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @insurance_company }\n end\n end",
"title": ""
},
{
"docid": "9514ccaf0385d781c7b302a5f279f4ac",
"score": "0.5801177",
"text": "def show\n @economia5 = Economia5.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @economia5 }\n end\n end",
"title": ""
},
{
"docid": "1c4638ddaad5c118a2cb06a045ed4943",
"score": "0.57948047",
"text": "def show\r\n @interview = Interview.find(params[:id])\r\n # Using the current interview, find the associated company\r\n @company = Company.find_by_name(@interview.company_name)\r\n respond_to do |format|\r\n format.html { render \"users/interviews/show\" }# show.html.erb\r\n format.json { render json: @interview }\r\n end\r\n end",
"title": ""
},
{
"docid": "de90c1bc668e199525ee6aff786d3e10",
"score": "0.5794733",
"text": "def index\n @representatives = current_company.representatives\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @representatives }\n end\n end",
"title": ""
},
{
"docid": "767d7d5679e904652cbed550c5e70397",
"score": "0.5794519",
"text": "def show\n @institution = Institution.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @institution }\n end\n end",
"title": ""
},
{
"docid": "9edffc37cffef3a91173c0523d642785",
"score": "0.579376",
"text": "def show\n @constituency = Constituency.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @constituency }\n end\n end",
"title": ""
},
{
"docid": "9edffc37cffef3a91173c0523d642785",
"score": "0.57932544",
"text": "def show\n @constituency = Constituency.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @constituency }\n end\n end",
"title": ""
},
{
"docid": "1aa2e382dcfd2bd45363e35fd23dfbdc",
"score": "0.57908225",
"text": "def index\n @title = t('view.interventions.index_title')\n @from, @to = make_datetime_range(params[:interval])\n\n @interventions = intervention_scope.includes(:intervention_type)\n @interventions = @interventions.between(@from, @to) if params[:interval]\n @interventions = @interventions.where(intervention_type_id: params[:type]) if params[:type]\n @interventions = @interventions.where(receptor_id: params[:user]) if params[:user]\n @interventions = @interventions.order(created_at: :desc).page(params[:page])\n end",
"title": ""
},
{
"docid": "f0900ce826e3e1af71379ff298a3edec",
"score": "0.5787576",
"text": "def index\n @indonations = Indonation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @indonations }\n end\n end",
"title": ""
},
{
"docid": "7d82b22d6aafc50745ae14930299981d",
"score": "0.5785907",
"text": "def show\n @violence_kind = ViolenceKind.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @violence_kind }\n end\n end",
"title": ""
},
{
"docid": "084cffd78d5b471ed33b1153abbf28bc",
"score": "0.5785333",
"text": "def show\n @council = Council.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @council }\n end\n end",
"title": ""
},
{
"docid": "789f5181dea39f41a3b5371d3a1c5735",
"score": "0.57821345",
"text": "def show\n @economia6 = Economia6.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @economia6 }\n end\n end",
"title": ""
},
{
"docid": "f4009a4851983c625c1323c63e31a183",
"score": "0.5781104",
"text": "def show\n @indicacao = Indicacao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @indicacao }\n end\n end",
"title": ""
},
{
"docid": "0bb94e58cc77adf487f271485c14a4d4",
"score": "0.57795185",
"text": "def show\n @council = Council.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @council }\n end\n end",
"title": ""
},
{
"docid": "35a199b7b2e1b8707d26973958eeecc8",
"score": "0.57783383",
"text": "def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @life_insurance_contracts }\n end\n end",
"title": ""
},
{
"docid": "9208b00d44d5d82005f4d8a04d783e90",
"score": "0.5776488",
"text": "def show\n @establish = Establish.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @establish }\n end\n end",
"title": ""
}
] |
a462ccc57356a283c4ec96dc785a0bcd
|
Returns whether the given PropertyDescriptor pd corresponds to a transient field in this class, or nil if there is no such field.
|
[
{
"docid": "9a656558a55273d6dadec8e88d4d9196",
"score": "0.82484126",
"text": "def transient?(pd)\n begin\n field = java_class.declared_field(pd.name)\n rescue Exception\n # should occur only if a property is not a field; not an error\n return\n end\n Java::JavaLangReflect::Modifier.isTransient(field.modifiers) if field\n end",
"title": ""
}
] |
[
{
"docid": "b845de63632ce84089805f9d3f0a7a4b",
"score": "0.5986083",
"text": "def transient?\n @transient\n end",
"title": ""
},
{
"docid": "59eede5a72889fbd91bfdb1fdbe62fd9",
"score": "0.5899811",
"text": "def transient?(_level = nil)\n return false if info.nil?\n info[:transient]\n end",
"title": ""
},
{
"docid": "5de2ab568d7810d748a775716d7c6860",
"score": "0.57875574",
"text": "def transient?\n @flags.include?(:transient)\n end",
"title": ""
},
{
"docid": "f2dd01fddfd5b89fcd92d10a42cac57a",
"score": "0.5700389",
"text": "def is_transient_type?\n __boolean(OCI_ATTR_IS_TRANSIENT_TYPE)\n end",
"title": ""
},
{
"docid": "6ad14e9cdf8f6904519d70da0bfec729",
"score": "0.55198604",
"text": "def lazy_settable?(field, value)\n !frozen? && value.nil? && field.lazy?\n end",
"title": ""
},
{
"docid": "038b8dd42b2728ce04193e621b1c8613",
"score": "0.5430944",
"text": "def property_field?(field)\n property_fields.include?(field.to_s)\n end",
"title": ""
},
{
"docid": "4378dd9e996447cbec30347eecff1e4f",
"score": "0.53706926",
"text": "def field\n @property ? @property.field : nil\n end",
"title": ""
},
{
"docid": "b3a2e9f65353982b75b2e97cefd724b5",
"score": "0.5369618",
"text": "def translated_field?(field_or_name)\n field = field_or_name.respond_to?(:name) ? field_or_name : self.fields[field_or_name.to_s]\n\n if field.try(:localized?)\n locale = ::Mongoid::Fields::I18n.locale.to_s\n (self.attributes[field.name] || {}).key?(locale)\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "905d531192202cf9238a29eedba9d3ad",
"score": "0.5345104",
"text": "def get_field?(field)\n self[field] || update_obj!(field)[field]\n end",
"title": ""
},
{
"docid": "990a9a0999909e21f8e8f91a53f1c112",
"score": "0.5333503",
"text": "def localized?(document, attribute)\n document.fields[document.database_field_name(attribute)].try(:localized?)\n end",
"title": ""
},
{
"docid": "1047f1fd9d9c9e42d3a3694d698705f9",
"score": "0.52578515",
"text": "def has_field(cusom_field_id)\n self.fields.select{|f| f.custom_field_id == cusom_field_id.to_i }\n end",
"title": ""
},
{
"docid": "6c509308a1973ce9fe16d358f68b8a27",
"score": "0.52437586",
"text": "def is_pdc?\n true\n end",
"title": ""
},
{
"docid": "bbbf3344089d5d739bc1fe563fbbcedb",
"score": "0.5206963",
"text": "def check_field_has_data field\n find_column_value(field).blank? ? false : true\n end",
"title": ""
},
{
"docid": "e6e15c49b2b11e846ef032e07d8b2fb7",
"score": "0.51624465",
"text": "def document_has_value?(document, field_config)\n document.has?(field_config.field) ||\n (document.has_highlight_field? field_config.field if field_config.highlight) ||\n (field_config.accessor && document.send(field_config.accessor).present?)\n end",
"title": ""
},
{
"docid": "1c97cef443362a73c5441df7da937133",
"score": "0.516153",
"text": "def paciente_nuevo?(pax)\n Patient.find_by_name_and_rut_and_ingreso(pax[:name], pax[:rut], pax[:ingreso]) ? false : true\n end",
"title": ""
},
{
"docid": "812d4b1734c645250902b3ccc7503651",
"score": "0.5155816",
"text": "def pii_present?\n proc { |a| a.form_data.present? }\n end",
"title": ""
},
{
"docid": "1263d2596560e656a260bcfdfe273fa7",
"score": "0.5141071",
"text": "def field_declared?(field,klass)\n @@fields[klass.to_s.make_key].each do |f|\n return true if f[:name] == field\n end\n false\n end",
"title": ""
},
{
"docid": "12dbe48e4ab60fa15764da631e3d50b9",
"score": "0.51395506",
"text": "def const_field?\r\n false\r\n end",
"title": ""
},
{
"docid": "5a8e6296cc839f76bf3a5a7f7c7081c8",
"score": "0.5122624",
"text": "def has_field?(name_or_sym_or_field)\n (not self[name_or_sym_or_field].nil?)\n end",
"title": ""
},
{
"docid": "04954b47070c5f3c7557b5813fcf64ec",
"score": "0.5113464",
"text": "def optional?(field)\n @optional_fields.key? field\n end",
"title": ""
},
{
"docid": "b54b741b48157adaa3d136fa52001dee",
"score": "0.51084095",
"text": "def present?(field)\n return true unless optional?(field)\n\n @optional_fields[field].call(self)\n end",
"title": ""
},
{
"docid": "18afc5f49030a967fb4fea3471104d92",
"score": "0.5089369",
"text": "def has_field?(name)\n self.class.has_field?(name)\n end",
"title": ""
},
{
"docid": "4f76231951711aad4872cedafc3b3e91",
"score": "0.507679",
"text": "def ppi_not_set?\n self.attributes['ppi'].nil?\n end",
"title": ""
},
{
"docid": "be706c8e13c7ac831d26458b1b540e20",
"score": "0.5067067",
"text": "def document_has_value? document, field_config\n document.has?(field_config.field) ||\n (document.has_highlight_field? field_config.field if field_config.highlight) ||\n field_config.accessor\n end",
"title": ""
},
{
"docid": "b3cf5369f3d4b80e7f83f79b3866e26d",
"score": "0.50477964",
"text": "def real_field\n # If the selected field is a local attribute return the condition as-is (that's the most usual case)\n is_local_attribute = @model.column_names.include?(@field.to_s)\n return @field if is_local_attribute\n # If the selected field is the name of an association, convert it to be a right condition\n association = @model.reflect_on_association(@field.to_sym)\n # Only if the association is belongs to, the other associations will be checked by foreign filter method\n return association.foreign_key if association && association.belongs_to?\n # Field that is not present in the model\n raise \"Unrecognized field #{@field} for model #{@model} in filter/exclude\"\n end",
"title": ""
},
{
"docid": "3e8f3b3109198c8f31177defc8bca091",
"score": "0.5041675",
"text": "def has_field?( field_name )\n !@fields.assoc( field_name ).nil?\n end",
"title": ""
},
{
"docid": "95daaccf2fbbf550fb7b379a652095e9",
"score": "0.50114757",
"text": "def deserialized?\n !! field_contents_by_field_name\n end",
"title": ""
},
{
"docid": "d52daa808000506bd4f2a81d59271280",
"score": "0.50103426",
"text": "def has_values_for?(field_name)\n solr_document[field_name].present?\n end",
"title": ""
},
{
"docid": "c5655411ab15ccae426c043d5ac280e2",
"score": "0.50033665",
"text": "def is_association?(field)\n !!get_association_reflection(field)\n end",
"title": ""
},
{
"docid": "73c3caa97f8620475aad76c61e1f7076",
"score": "0.49924925",
"text": "def persisted?\n !@ptr.null?\n end",
"title": ""
},
{
"docid": "235afae419dd4cac1c554b921419b02b",
"score": "0.49906346",
"text": "def is_percent_field?(fieldname)\n self.percent_fields.include?(fieldname.to_sym)\n end",
"title": ""
},
{
"docid": "307738288a3f68fee1d734ed92e0dc94",
"score": "0.49662936",
"text": "def complaint_filed?\n self.filed?\n end",
"title": ""
},
{
"docid": "9799cd27067d4acbf8cb169ee800bcbc",
"score": "0.49584943",
"text": "def is_dynamic_field?(name)\n name = name.to_s.gsub(/\\=$/, '').to_sym\n !self.content_type.find_field(name).nil?\n end",
"title": ""
},
{
"docid": "6ac360306c7c85c420f859e31650acef",
"score": "0.49522826",
"text": "def is_money_field?(fieldname)\n self.money_fields.include?(fieldname.to_sym)\n end",
"title": ""
},
{
"docid": "8a2cb40ca5fb0149bac4848fbda0a838",
"score": "0.49405563",
"text": "def invisible?\n !custom_property? && resolved_value.empty?\n end",
"title": ""
},
{
"docid": "23a6c1d797b29be27578ac479d4b3259",
"score": "0.49393997",
"text": "def has_value? field_config\n document.has?(field_config.field) ||\n (document.has_highlight_field? field_config.field if field_config.highlight) ||\n field_config.accessor\n end",
"title": ""
},
{
"docid": "2c3efd9b56b971b4c19fc1e328c18111",
"score": "0.4930007",
"text": "def persisted?(name = nil, value = value_omitted = true)\n if name && persisted_flags\n persisted_flags.key?(name.to_sym) && (value_omitted || persisted(name) == value)\n else\n !persisted_flags.nil?\n end\n end",
"title": ""
},
{
"docid": "7985d5c712b55f4e669889601dd73318",
"score": "0.48865515",
"text": "def persistent?\n primary_key = self['attributes'][self.class.primary_key]\n if primary_key_value = self['attributes'][primary_key]\n obj = self.class.where(primary_key.to_sym => primary_key_value).select(primary_key).first\n obj ? true : false\n end\n end",
"title": ""
},
{
"docid": "299c7121592a6e4d626bc027528bf576",
"score": "0.48861933",
"text": "def validation_property(field_name)\n false\n end",
"title": ""
},
{
"docid": "825f7c6073dbf20ad39508250450d277",
"score": "0.48832065",
"text": "def transient?; end",
"title": ""
},
{
"docid": "825f7c6073dbf20ad39508250450d277",
"score": "0.48832065",
"text": "def transient?; end",
"title": ""
},
{
"docid": "f20b1f7f4ae62c2b845e8030d0ed73d5",
"score": "0.48775277",
"text": "def pdc_product_exists\n unless product.pdc_product.present?\n errors.add(:is_pdc, 'can\\'t be set for a non PDC product. Please make sure that the ET Product has been mapped to a PDC Product')\n end\n end",
"title": ""
},
{
"docid": "603971d80d3f1127c9f949041496e9e6",
"score": "0.486946",
"text": "def value?\n @fields.nil?\n end",
"title": ""
},
{
"docid": "fa0522c41994191c0ef9f54a173a3634",
"score": "0.485715",
"text": "def foreign_key_for?(record)\n record.has_attribute?(reflection.foreign_key)\n end",
"title": ""
},
{
"docid": "dce6542d74b3af0174a6df65d7ce1078",
"score": "0.48552075",
"text": "def present?(value, property)\n boolean_type?(property) ? !value.nil? : !DataMapper::Ext.blank?(value)\n end",
"title": ""
},
{
"docid": "6b9f1dfc40c7e085a38d87875d166a5f",
"score": "0.48516536",
"text": "def get_field_from_document(doc)\n # Map the 'facet' fields to normal values\n return doc.journal if field == :journal_facet\n return doc.authors if field == :authors_facet\n\n # Clean up pathological year values\n return clean_year(doc.year) if field == :year\n\n # We're not yet actually faceting on anything other than journal,\n # author, or year; so this code isn't tested\n # :nocov:\n nil\n # :nocov:\n end",
"title": ""
},
{
"docid": "2c53bb690d79296d2dc9d7fd8b63d039",
"score": "0.48489636",
"text": "def has_field?(field_type)\n self.fields.any?{|f| f.custom_field.is_a?(field_type) }\n end",
"title": ""
},
{
"docid": "b650f7bf18dbb99082949476662ce59e",
"score": "0.48414156",
"text": "def read_respond_exist?(p_attr)\n @klass.respond_to?(p_attr)\n end",
"title": ""
},
{
"docid": "2c1a9c0674925170ebba33aecd6afdb3",
"score": "0.48341084",
"text": "def persisted?( key )\n\n return get_object_id( key ) ? true : false\n\n end",
"title": ""
},
{
"docid": "6da38fa9f6b39cbadb95e5a5f8fd6e9e",
"score": "0.48265615",
"text": "def get_field_value(obj, field)\n temp = obj.java_class.declared_field(field)\n temp.accessible = true unless temp.accessible?\n temp.value(obj.java_object)\nend",
"title": ""
},
{
"docid": "f74be01edd142593dccb937213dc65eb",
"score": "0.48173618",
"text": "def persisted?\n\t\t\t\tself.class.key_columns.map do |field|\n\t\t\t\t\t@attributes[field] or return false\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "39f452881b0c321976b464b1acb94720",
"score": "0.47929236",
"text": "def has_field?(name_or_id)\n begin\n self.field_id(name_or_id)\n rescue InvalidField\n return false\n else\n return true\n end\n end",
"title": ""
},
{
"docid": "f6fe14500cecd71ea6e5189a4f5583f7",
"score": "0.47913373",
"text": "def direct?\n return self[direct_column_name]\n end",
"title": ""
},
{
"docid": "9e402b5db0b3fda83362903098b266cf",
"score": "0.47888568",
"text": "def is_periodical\n return source_object.try(:is_periodical, metadata_value('type_of_record'))\n end",
"title": ""
},
{
"docid": "9e402b5db0b3fda83362903098b266cf",
"score": "0.47888568",
"text": "def is_periodical\n return source_object.try(:is_periodical, metadata_value('type_of_record'))\n end",
"title": ""
},
{
"docid": "05747e0626f232df3e157e10132eeaf8",
"score": "0.47873044",
"text": "def transients?; end",
"title": ""
},
{
"docid": "05747e0626f232df3e157e10132eeaf8",
"score": "0.47873044",
"text": "def transients?; end",
"title": ""
},
{
"docid": "c8f73a4e3b81c227b775be88728f6058",
"score": "0.4783144",
"text": "def valid_inverse_reflection?(reflection)\n reflection &&\n reflection != self &&\n foreign_key == reflection.foreign_key &&\n klass <= reflection.active_record &&\n can_find_inverse_of_automatically?(reflection, true)\n end",
"title": ""
},
{
"docid": "ad76a13e47b1d0e4341810f27bcc6794",
"score": "0.4782507",
"text": "def show_pdf? document\n document.pdf_item.present? # if it's nil, return false\n end",
"title": ""
},
{
"docid": "bed3e2c62daf9f9bebc0ad9265dcb2fb",
"score": "0.47746897",
"text": "def localized?\n self.respond_to?(:\"#{_label_field_name}_translations\")\n end",
"title": ""
},
{
"docid": "3503a570f752e859025bcef9fea1a0ac",
"score": "0.47639257",
"text": "def field_presence(field)\n test_class.field_presence @record, field\n end",
"title": ""
},
{
"docid": "e4017ee4de628d0c918a1323e9896a62",
"score": "0.4759654",
"text": "def has_field?(field)\n !!directives.select { |d| d.name == field }.first\n end",
"title": ""
},
{
"docid": "dd2cfc4999868149cfa5b1e620fb1cf8",
"score": "0.47537497",
"text": "def show_field?(key)\n !Comatose.config.hidden_meta_fields.include? key\n end",
"title": ""
},
{
"docid": "6fb32c4644677c71997fc127adac331c",
"score": "0.47421652",
"text": "def persisted?\n !!@_persisted\n end",
"title": ""
},
{
"docid": "9b8ac497ec1dcd749e9d4b74c8f370b8",
"score": "0.47410974",
"text": "def field_modified?(name)\n instance_variable_get(\"@__modified_#{k}\") == true\n end",
"title": ""
},
{
"docid": "363469c46337444234e18fa26c4dc6be",
"score": "0.47395098",
"text": "def direct?\n self[direct_column_name]\n end",
"title": ""
},
{
"docid": "ed338ccb2d95e89b45804042f31c84d7",
"score": "0.4738957",
"text": "def invertible_for?(record)\n foreign_key_for?(record) && inverse_reflection_for(record)\n end",
"title": ""
},
{
"docid": "44a2008ec8d9ea752d807fa336ecf015",
"score": "0.4734417",
"text": "def localized_field?(name)\n method_name = :\"#{name}_localized?\"\n self.respond_to?(method_name) && self.send(method_name)\n end",
"title": ""
},
{
"docid": "51df99fc2ea7938c62a8f70f9026ef82",
"score": "0.47310346",
"text": "def child_persistable?(doc)\n (persistable? || _creating?) &&\n !(doc.persisted? && _association.forced_nil_inverse?)\n end",
"title": ""
},
{
"docid": "69a8497d0ccd6ef04612d20b5cf5da7f",
"score": "0.47277936",
"text": "def document_has_value?(doc, field_def)\n doc.has?(field_def.field) || field_def.accessor ||\n (field_def.highlight && doc.has_highlight_field?(field.field_def))\n end",
"title": ""
},
{
"docid": "10094479c32aeb6d9d49258dca5226a4",
"score": "0.47259387",
"text": "def transient_state?\n TRANSIENT_STATES.include? STATE_STR[state]\n end",
"title": ""
},
{
"docid": "a7c93e18e081a006635df8c4c6d1a3b3",
"score": "0.47215086",
"text": "def persisted?\n @is_persisted\n end",
"title": ""
},
{
"docid": "c8dcf8f1a61df6bc67d92b3d002e7b5b",
"score": "0.4716014",
"text": "def has_updated_existing_primary_key reflection\n send(\"#{reflection.association_foreign_key}_changed?\") && send(\"#{reflection.association_foreign_key}_was\")\n end",
"title": ""
},
{
"docid": "c8dcf8f1a61df6bc67d92b3d002e7b5b",
"score": "0.4716014",
"text": "def has_updated_existing_primary_key reflection\n send(\"#{reflection.association_foreign_key}_changed?\") && send(\"#{reflection.association_foreign_key}_was\")\n end",
"title": ""
},
{
"docid": "cb0b03d2045bd02e681ec7ec204f906d",
"score": "0.47148275",
"text": "def form_has_input_field?(field_name)\n field = dc_get_field_form_definition(field_name)\n return if field.nil?\n\n !(field['type'] == 'readonly' || field['readonly'])\nend",
"title": ""
},
{
"docid": "d4633b1aa7be3f243cb5f808b6961a2f",
"score": "0.4710905",
"text": "def pdf_metadata_fields\n self.class.fields.select { |field_symbol| !non_pdf_metadata_fields.include?(field_symbol) }\n end",
"title": ""
},
{
"docid": "d3430a0f55a5295c54349eec92d79c62",
"score": "0.47102642",
"text": "def attribute_present?(attribute)\n attribute.to_s == 'common_fields_fake_foreign_key' ? true : super\n end",
"title": ""
},
{
"docid": "8209adc9a4a3c6131b05cd5f56942763",
"score": "0.47089788",
"text": "def persisted?\n @persisted ||= false\n return (@persisted and parent.persisted?) if parent\n @persisted\n end",
"title": ""
},
{
"docid": "3e548060b780321791fe285a5d3b5ef6",
"score": "0.47003043",
"text": "def present?(value, property)\n boolean_type?(property) ? !value.nil? : !value.blank?\n end",
"title": ""
},
{
"docid": "2ce75a66bf5105b1aa0abb8f8afbff17",
"score": "0.46990883",
"text": "def persisted?\n !!@persisted\n end",
"title": ""
},
{
"docid": "2ce75a66bf5105b1aa0abb8f8afbff17",
"score": "0.46990883",
"text": "def persisted?\n !!@persisted\n end",
"title": ""
},
{
"docid": "6a91d07a7f7178105ec7766e3b26fe26",
"score": "0.4699055",
"text": "def for_field(field)\n detect { |attribute| attribute.field == field }\n end",
"title": ""
},
{
"docid": "b3f9c4b2b5393a50540c38179941e6e6",
"score": "0.4697866",
"text": "def render_field?\n view_context.should_render_field?(field_config, document)\n end",
"title": ""
},
{
"docid": "02dab1f63e65ab4b67beff9061ad742f",
"score": "0.46918",
"text": "def persisted?\n paranoid? ? !new_record? : super\n end",
"title": ""
},
{
"docid": "886561d2ba99ab8680b34db7f9a59b02",
"score": "0.4691598",
"text": "def invertible_for?(record)\n inverse_reflection_for(record)\n end",
"title": ""
},
{
"docid": "74de4eea222274e21faa3e24fc7faa3d",
"score": "0.4689658",
"text": "def has_field?(name); @fields.any? { |n, t| n == name } end",
"title": ""
},
{
"docid": "d7e8340d92811a11731bee1e0dc21868",
"score": "0.46721858",
"text": "def hidden_field?(field_name)\n hiddens.find { |f| f.name == field_name }\n end",
"title": ""
},
{
"docid": "fbd36d333ae4e3df277dbdbddf4868a9",
"score": "0.46705535",
"text": "def persistent_attribute_accessor?( *attributes )\n\n return persistent_attribute_accessors.has_attributes?( *attributes )\n\n end",
"title": ""
},
{
"docid": "caa9ce7a05dbe17979440c0967d3be06",
"score": "0.46691406",
"text": "def object_id_field?\n @object_id_field ||=\n metadata.polymorphic? ? true : metadata.klass.using_object_ids?\n end",
"title": ""
},
{
"docid": "103ec626ff6d7c73186e435d57225f49",
"score": "0.46631002",
"text": "def p?\n !@p.nil?\n end",
"title": ""
},
{
"docid": "eea3b1a3ce83930d1ce2bcfec5d7198e",
"score": "0.4662697",
"text": "def field(var)\n each_element { |xe|\n return xe if xe.kind_of?(XDataField) and xe.var == var\n }\n nil\n end",
"title": ""
},
{
"docid": "29986fd98ce96c34874e32f4bce22797",
"score": "0.46611908",
"text": "def value?\n @value != :__undefined__\n end",
"title": ""
},
{
"docid": "41b7c7057f632d0cd9894a784baedede",
"score": "0.46588284",
"text": "def patient_on_permanent_fp_method?(patient)\n permanent_fp_concepts = [concept('Hysterectomy'), concept('Tubal ligation')]\n Observation.where(concept: permanent_fp_concepts, person: patient.person).exists?\n end",
"title": ""
},
{
"docid": "d7c90f10fc8e164c29daebb46889f988",
"score": "0.46580935",
"text": "def field_provided?(key)\n !!@provided_fields[key]\n end",
"title": ""
},
{
"docid": "c2708a1bd3b16bd7e573541e2c40ba63",
"score": "0.46560818",
"text": "def persisted?\n if instance_variable_defined?(:@persisted)\n instance_variable_get(:@persisted)\n else\n instance_variable_set(:@persisted, false)\n instance_variable_get(:@persisted)\n end\n end",
"title": ""
},
{
"docid": "353967536b516a226c0a6891ed821e6c",
"score": "0.465549",
"text": "def va_patient?\n mhv_correlation_id.present?\n end",
"title": ""
},
{
"docid": "b2266f65ef97285195a820ba1f5ba70b",
"score": "0.4647018",
"text": "def published?\n !forms.detect{|f| f.published?}.nil?\n end",
"title": ""
},
{
"docid": "d5648b4ae233c50c0cc2d40fd9107ed7",
"score": "0.4636733",
"text": "def persisted?\n # Changed? is provided by ActiveModel::Dirty\n !!@__metadata__.key\n end",
"title": ""
},
{
"docid": "9611251df790a321444bdba0b78f136c",
"score": "0.46365693",
"text": "def invertible_for?(record)\n inverse_reflection_for(record)\n end",
"title": ""
},
{
"docid": "a6db1ea7857b7d4f6a21f24bc196a925",
"score": "0.4632842",
"text": "def persistent?\n !!self._persistent\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "e05fa5f54e8b8af79c27c60932b58c92",
"score": "0.0",
"text": "def reviewer_params\n params.require(:reviewer).permit(:name, :location)\n end",
"title": ""
}
] |
[
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7496205",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6957069",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.69229627",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.6893983",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.67861825",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.6745682",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.66826516",
"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.66377175",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.6629774",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.6628605",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.65628505",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.6491797",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.64796996",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.64542365",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.63998276",
"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.6383421",
"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.6363668",
"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.63399816",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.6337114",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.63254243",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.6321026",
"text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end",
"title": ""
},
{
"docid": "5ec018b4a193bf3bf8902c9419279607",
"score": "0.63158673",
"text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end",
"title": ""
},
{
"docid": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.6314176",
"text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.63081384",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.6302448",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.6299638",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.6296883",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6293299",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6293299",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.62786317",
"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.6273656",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.6267276",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.6256883",
"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.62563425",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.6252804",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.62361884",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.62290865",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.6228019",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6227782",
"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": "fde8b208c08c509fe9f617229dfa1a68",
"score": "0.62265575",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.6202215",
"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.6191506",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.61839265",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.61796445",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.61629957",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.61614954",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.61562926",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.61559725",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.61367077",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.613438",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.61218476",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.61168486",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.61168486",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.6114562",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.6111449",
"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.61031544",
"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.61031544",
"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.60993665",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.60993665",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.60861844",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.6085748",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.60850567",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.60785514",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.60761863",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.60688645",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.6068223",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "fa0608a79e8d27c2a070862e616c8c58",
"score": "0.60669994",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.60667104",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.6064905",
"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.6063823",
"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.6062597",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "d6886c65f0ba5ebad9a2fe5976b70049",
"score": "0.6058041",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "96ddf2d48ead6ef7a904c961c284d036",
"score": "0.60491157",
"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.60489345",
"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.60489345",
"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.6046292",
"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.604085",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.6036289",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.60301423",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.60258883",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.60220164",
"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.6021605",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.60170144",
"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.6016164",
"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.60093164",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "9c8cd7c9e353c522f2b88f2cf815ef4e",
"score": "0.6007339",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6006092",
"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.6006092",
"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.6004109",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.6002896",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.6002408",
"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.60018224",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.60018224",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.5999894",
"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.5999894",
"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": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.5999669",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "a50ca4c82eaf086dcbcc9b485ebd4261",
"score": "0.5995008",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.5994646",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.5993731",
"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.599175",
"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.599123",
"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": ""
}
] |
4302d8fa3d951b90e08f79a73fd25054
|
Comment on a given video
|
[
{
"docid": "2d7f578ff287ed8688487cdc01826728",
"score": "0.77194303",
"text": "def comment (video, str, user)\r\n self.connect(user) unless user.token?\r\n uri = URI(HOST + 'feeds/api/videos/' + video.id.to_s + '/comments')\r\n post = Net::HTTP::Post.new uri.path\r\n post.content_type = 'application/atom+xml'\r\n post.body = Comment.formatString(str)\r\n _http_post(uri, post, user)\r\n end",
"title": ""
}
] |
[
{
"docid": "01fa7591defc7c30e6787023f5774d9a",
"score": "0.727657",
"text": "def show\n #2nd you retrieve the comment thanks to params[:id]\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "f403638245fabd249eeb72269eff9c76",
"score": "0.7218685",
"text": "def set_video_comment\n @video_comment = VideoComment.find(params[:id])\n end",
"title": ""
},
{
"docid": "85ec28d0fd4e3590f2eea21a86013daa",
"score": "0.66839445",
"text": "def show\n @video = Video.find(params['id'])\n @comment = @video.comments.new\n @comments = @video.comments\n end",
"title": ""
},
{
"docid": "06355864aa4b56ac0099dc77fe214dad",
"score": "0.66776454",
"text": "def show\n\n\n @video = Video.find(params[:id])\n \n @vid = params[:id]\n #@video = Video.where(:id=>@vid, :is_active=>'1').take\n #@video = Video.where(\"id = ? AND is_active = ?\", @vid, 1)\n \n @video_id = (/([\\w-]{11})/.match(@video.video_link)).to_s\n @embed_code = %Q{<iframe title=\"YouTube video player\" style=\" margin-top: 24px;\" width=\"640\" height=\"390\" src=\"http://www.youtube.com/embed/#{ @video_id}\" frameborder=\"0\" allowfullscreen></iframe>}\n \n \n @commentable = @video\n @comments = @commentable.comments\n @comment = Comment.new\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"title": ""
},
{
"docid": "43d2d1ee85f0311eb4abd100b799bc82",
"score": "0.66604507",
"text": "def show\n @video = Video.find(params[:id])\n @comments = Comment.all.paginate(:page => params[:page],:per_page => 10)\n @comment = @video.comments.build()\n @recomment = Comment.new\n end",
"title": ""
},
{
"docid": "7dba652743fba177ed0a13b180390ad8",
"score": "0.6656971",
"text": "def show\n @video = Video.find(params[:id])\n @run = Run.find(@video.run_id)\n @videos = @run.visiblevideos\n @video.counter += 1\n @video.save\n \n @videocomments = Videocomment.find(:all, :conditions => {:video_id => @video.id})\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @video }\n end\n end",
"title": ""
},
{
"docid": "b91a49a0d73751e0ec718de22ad996d4",
"score": "0.63973445",
"text": "def show\n @comments = Comment.where(video_id: params[:id])\n end",
"title": ""
},
{
"docid": "c0c498082404d2c7bfb7e774762cd488",
"score": "0.634301",
"text": "def show\n @yt_client = YouTubeIt::Client.new(:dev_key => \"AI39si6hkRNCL77mzzv1LycIohZtksVIi0L5S9lQMx6crqOfGdyKcB2U2M5WHeNBUT2VLgTVzjR9rxPa1RJZw-sZ6wqtnaZ7AA\")\n @video = Video.find(params[:id])\n\n @comments = @video.comments.all\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end",
"title": ""
},
{
"docid": "64a76df40be517bff86657141b0ab954",
"score": "0.6326007",
"text": "def set_video_request_comment\n @video_request_comment = VideoRequestComment.find(params[:id])\n end",
"title": ""
},
{
"docid": "0bbaa79e6721c19da4c4377b30046fd9",
"score": "0.6207988",
"text": "def send_video(url, name, video_info = {})\n client.api.send_content(id, url, name, 'm.video', extra_information: video_info)\n end",
"title": ""
},
{
"docid": "5e819af7fbe34434df438ba8ab89bb8f",
"score": "0.6154224",
"text": "def video_comment_params\n params.require(:video_comment).permit(:creation, :video_id, :customer_id, :comment)\n end",
"title": ""
},
{
"docid": "f0ed1ff7b1b1315c27e0c20ad6089afb",
"score": "0.60900444",
"text": "def update\n @videocomment = Videocomment.find(params[:id])\n\n respond_to do |format|\n if @videocomment.update_attributes(params[:videocomment])\n flash[:notice] = 'Videocomment was successfully updated.'\n format.html { redirect_to(@videocomment) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @videocomment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c36586a37fabb0de92bd239d629f1158",
"score": "0.6065956",
"text": "def set_comment\n @comment = @snippet.comments.find(params[:id])\n end",
"title": ""
},
{
"docid": "cc87ee08dfd895e76d9386b22c8ec7ba",
"score": "0.60371846",
"text": "def add_video_comment_with_http_info(video_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: MediaVideosApi.add_video_comment ...\"\n end\n # verify the required parameter 'video_id' is set\n if @api_client.config.client_side_validation && video_id.nil?\n fail ArgumentError, \"Missing the required parameter 'video_id' when calling MediaVideosApi.add_video_comment\"\n end\n # resource path\n local_var_path = \"/media/videos/{video_id}/comments\".sub('{' + 'video_id' + '}', video_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 = @api_client.object_to_http_body(opts[:'comment_resource'])\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CommentResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: MediaVideosApi#add_video_comment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "160e337d258ace6970ed59cd1b70e287",
"score": "0.60341245",
"text": "def update\n respond_to do |format|\n if @video_comment.update(video_comment_params)\n format.html { redirect_to @video_comment, notice: 'Video comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @video_comment }\n else\n format.html { render :edit }\n format.json { render json: @video_comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1d182d64288945f3af94aca3403f7b8f",
"score": "0.59561646",
"text": "def comment comment\n end",
"title": ""
},
{
"docid": "b0c40b47e96c900707a461895f40a3fc",
"score": "0.595033",
"text": "def create_media_comment(id, text, options = {})\n response = post(\"media/#{id}/comments\", options.merge(text: text), signature = true)\n response\n end",
"title": ""
},
{
"docid": "b0407bab7f3fa0f3dbae3e098f692ab4",
"score": "0.5889025",
"text": "def test03_post_open_blog_MediaVideo\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_blogs_post_open)\n\t\t\t\n\t\tsleep 2\n\t\tassert $post_media_description.exists?\n\t\t$post_media_description.set(\"the elwah river original flow was recently restored #{random}.\")\n \t\trepostGroupPop\n\t\t$post_media_button.click\n\t\tfile_upload \"DungenessSpit102.26.2012.mov\"\n\t\t$post_now.fire_event(\"onclick\")\n\t\t\t\n\t\tsleep 2\n\t\tassert $post_new_post.exists?\n\tend",
"title": ""
},
{
"docid": "ceeb0ce4c34530e52179c783bdef62d9",
"score": "0.586853",
"text": "def put_video(*video_args, &block)\n args = parse_media_args(video_args, \"videos\")\n args.last[:video] = true\n put_connections(*args, &block)\n end",
"title": ""
},
{
"docid": "2a3b4bd1ef568a1581a95c3609a5ac37",
"score": "0.5846",
"text": "def get_comments(video_id)\n Comment.all(:videoid => video_id, :order => [ :date.desc ], :comment_id => nil)\n end",
"title": ""
},
{
"docid": "685f0f183694d9350baf11274343101c",
"score": "0.5836319",
"text": "def on_comment(msg)\n end",
"title": ""
},
{
"docid": "8e11aa2549c04fe61aa527d077dbbe1e",
"score": "0.5834018",
"text": "def comment #create comment\n comment = Comment.new\n if comment.create_comment(params[:body], params[:video_id])#calling create_comment method of Comment model\n respond_with do |format|\n format.json {render :json => {:success => true, :message => \"comment successfully posted\"}}\n end\n else\n respond_with do |format|\n format.json {render :json => {:success => false}}\n end\n end\n end",
"title": ""
},
{
"docid": "f979b65683d9560cb1c6f8c4b1cd166c",
"score": "0.58280224",
"text": "def video_params\n params.require(:video).permit(:title, :link, :published_at, \n :likes, :dislikes, :uid, :description, :view_count)\n end",
"title": ""
},
{
"docid": "b163e546b399ce9ec51b2b12d2675915",
"score": "0.5811185",
"text": "def video_params\n params.require(:video).permit(:title, :author, :video_url, :caption)\n end",
"title": ""
},
{
"docid": "a171d9d20dcf40ac21717d7042e0a940",
"score": "0.58065075",
"text": "def comment\n expose Challenge.comment(@oauth_token, params[:data])\n end",
"title": ""
},
{
"docid": "4aa0e88da0842dd03109da31b2841c78",
"score": "0.5780944",
"text": "def embed\n \"#{video.__embed__}#{tracker(true)}\"\n end",
"title": ""
},
{
"docid": "a472de7ffda4b557faef5787bdebc7e7",
"score": "0.5733839",
"text": "def update_video_comment_with_http_info(video_id, id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: MediaVideosApi.update_video_comment ...\"\n end\n # verify the required parameter 'video_id' is set\n if @api_client.config.client_side_validation && video_id.nil?\n fail ArgumentError, \"Missing the required parameter 'video_id' when calling MediaVideosApi.update_video_comment\"\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 MediaVideosApi.update_video_comment\"\n end\n # resource path\n local_var_path = \"/media/videos/{video_id}/comments/{id}/content\".sub('{' + 'video_id' + '}', video_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 # 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[:'content'])\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\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 if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: MediaVideosApi#update_video_comment\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "409bd67335df5a5ca404a12887d134cb",
"score": "0.5718438",
"text": "def add_video_comment(video_id, opts = {})\n data, _status_code, _headers = add_video_comment_with_http_info(video_id, opts)\n return data\n end",
"title": ""
},
{
"docid": "db8219be84ba73caa5406771f80300b6",
"score": "0.57087666",
"text": "def add_video_to_queue(video)\n visit home_path\n click_on_video_on_home_page(video) # This method is in macros.rb\n click_link \"+ My Queue\"\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "2092bcf9331fdfe6473a3af811f5b751",
"score": "0.5707346",
"text": "def set_video\n @video = Video.find(params[:id])\n end",
"title": ""
},
{
"docid": "bcccafcdc1ebcdb9c9f217dac5b44fb9",
"score": "0.56961393",
"text": "def add_video_to_my_queues(video)\n visit home_path\n #find(\"a[href='/videos/#{video.to_param}']\").click\n find(\"a[href='/videos/#{video.token}']\").click\n click_link \"+ My Queue\"\n end",
"title": ""
},
{
"docid": "81cab7fc89cb9e2402dc43658a2bc877",
"score": "0.5694196",
"text": "def vimeo_video_id\n self.vid = link.split('/').last\n end",
"title": ""
},
{
"docid": "53644d8858f7bdc179af9fe3cc497c19",
"score": "0.56940746",
"text": "def video_link\n if video_type? && !body.nil?\n vimeo_video(body) || youtube_video(body)\n end\n end",
"title": ""
},
{
"docid": "8a18a8ec6ce2dc924814aa921daff12e",
"score": "0.56901664",
"text": "def specified_comment(token, action)\n @comment = @graph.get_connections(@post_id, \"comments\",\n :limit=>1,\n :fields => [\"from{name,id,picture}\",\n \"id\",\n \"message\",\n \"created_time\",\n \"like_count\", \n ],\n action => token,\n )\n end",
"title": ""
},
{
"docid": "2802df1dd448afc3c357e4dd91c7b8ce",
"score": "0.5683124",
"text": "def comment; end",
"title": ""
},
{
"docid": "2802df1dd448afc3c357e4dd91c7b8ce",
"score": "0.5683124",
"text": "def comment; end",
"title": ""
},
{
"docid": "2802df1dd448afc3c357e4dd91c7b8ce",
"score": "0.5683124",
"text": "def comment; end",
"title": ""
},
{
"docid": "2802df1dd448afc3c357e4dd91c7b8ce",
"score": "0.5683124",
"text": "def comment; end",
"title": ""
},
{
"docid": "2802df1dd448afc3c357e4dd91c7b8ce",
"score": "0.5683124",
"text": "def comment; end",
"title": ""
},
{
"docid": "2802df1dd448afc3c357e4dd91c7b8ce",
"score": "0.5683124",
"text": "def comment; end",
"title": ""
},
{
"docid": "2802df1dd448afc3c357e4dd91c7b8ce",
"score": "0.5683124",
"text": "def comment; end",
"title": ""
},
{
"docid": "2802df1dd448afc3c357e4dd91c7b8ce",
"score": "0.5683124",
"text": "def comment; end",
"title": ""
},
{
"docid": "2802df1dd448afc3c357e4dd91c7b8ce",
"score": "0.5683124",
"text": "def comment; end",
"title": ""
},
{
"docid": "2802df1dd448afc3c357e4dd91c7b8ce",
"score": "0.5683124",
"text": "def comment; end",
"title": ""
},
{
"docid": "2802df1dd448afc3c357e4dd91c7b8ce",
"score": "0.5683124",
"text": "def comment; end",
"title": ""
},
{
"docid": "2802df1dd448afc3c357e4dd91c7b8ce",
"score": "0.5683124",
"text": "def comment; end",
"title": ""
},
{
"docid": "2802df1dd448afc3c357e4dd91c7b8ce",
"score": "0.5683124",
"text": "def comment; end",
"title": ""
},
{
"docid": "2802df1dd448afc3c357e4dd91c7b8ce",
"score": "0.5683124",
"text": "def comment; end",
"title": ""
},
{
"docid": "2802df1dd448afc3c357e4dd91c7b8ce",
"score": "0.5683124",
"text": "def comment; end",
"title": ""
},
{
"docid": "2802df1dd448afc3c357e4dd91c7b8ce",
"score": "0.5683124",
"text": "def comment; end",
"title": ""
},
{
"docid": "2802df1dd448afc3c357e4dd91c7b8ce",
"score": "0.5683124",
"text": "def comment; end",
"title": ""
},
{
"docid": "e5c2599b5099f5370c4c273a03793e01",
"score": "0.56831235",
"text": "def update\n @video = Video.find(params[:id])\n params[:video][:token] = token_from_link params[:video][:token]\n\n respond_to do |format|\n if @video.update_attributes(params[:video])\n format.html { redirect_to @video, notice: 'Video was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "603db7f8d8a871a4c761b4622059653c",
"score": "0.5683105",
"text": "def add_video(tag)\n\n @driver.find_element(:link, 'Add Video').click\n\n wait = Selenium::WebDriver::Wait.new(:timeout => 30) # seconds\n wait.until { @driver.find_element(:link_text, \"Save Video\") }\n\n # Type in URL of video into\n @driver.find_element(:id, 'videoUrlField').send_keys(tag)\n @driver.find_element(:link_text, \"Save Video\").click\n\n # Wait while video is processed\n wait = Selenium::WebDriver::Wait.new(:timeout => 30) # seconds\n wait.until { @driver.find_element(:link_text, \"Edit Video\") }\n end",
"title": ""
},
{
"docid": "b365c5da5c94f75391d6aaec14b479ab",
"score": "0.5678895",
"text": "def comment(id)\n record \"/msg/comment/#{id}\"\n end",
"title": ""
},
{
"docid": "07271a1cb32f5f14751819892737074d",
"score": "0.56726784",
"text": "def video\n YouTubeApi.find_video(youtube_id)\n end",
"title": ""
},
{
"docid": "6ed6bf0e4b0c02b4fb81c31d77a70c0e",
"score": "0.5671317",
"text": "def add_comment(comment); end",
"title": ""
},
{
"docid": "ecf02038548e1ebf167da3a7b5180c3f",
"score": "0.5669134",
"text": "def set_video\n @video = Video.find_by(id: params[:id], user_id: get_user_id)\n end",
"title": ""
},
{
"docid": "ba5570cbeea9cb9102d91087903d2694",
"score": "0.566382",
"text": "def set_video_post\n @video_post = VideoPost.find(params[:id])\n end",
"title": ""
}
] |
84e9a0f48e14cd755e8fbe658abe88f3
|
Faker::Lorem.word generates random word from standard wordlist
|
[
{
"docid": "7a3afb4dd42250099ff90e10ae4ea879",
"score": "0.6753845",
"text": "def test_word\n @standard_wordlist = I18n.translate('faker.lorem.words')\n\n 100.times { assert_includes @standard_wordlist, @tester.word }\n end",
"title": ""
}
] |
[
{
"docid": "aea9678605df6299a39cc0a9609ebc81",
"score": "0.7715688",
"text": "def words(number = 3)\n Faker::Lorem.words(number).join(' ')\n end",
"title": ""
},
{
"docid": "83a00c830b6f6562879621e742f2f93c",
"score": "0.76609224",
"text": "def words(number = 3)\n Faker::Lorem.words(number: number).join(' ')\n end",
"title": ""
},
{
"docid": "d8ddfb49039a4c0c80f74d01b6ee2edf",
"score": "0.75748825",
"text": "def random_word\n\t\tLEGAL_WORDS.sample # Gets random element from array\n\tend",
"title": ""
},
{
"docid": "e7ce61e5de6f8c04225cee05de304e6f",
"score": "0.7493612",
"text": "def get_random_word\r\n @word_list.sample\r\n end",
"title": ""
},
{
"docid": "8244cc0d9aa4843d33d178ecff000129",
"score": "0.7432701",
"text": "def pick_random_word\n random_word = @words.sample.gsub!(/\\s+/, \"\")\n end",
"title": ""
},
{
"docid": "c4f681c322dbc8e6cab321f3f353949d",
"score": "0.72852427",
"text": "def random_word\n @words.fetch(rand(@words.length)).chomp\n end",
"title": ""
},
{
"docid": "d702fef2331a80e4d0d946ebd661b57b",
"score": "0.7284297",
"text": "def random_word\n words = @dictionary.dictionary.keys\n words[rand(words.length)]\n end",
"title": ""
},
{
"docid": "a588034e06a19d319a609b5d7e5b63a3",
"score": "0.7280406",
"text": "def catch_phrase\n translate('faker.company.buzzwords').collect {|list| list.sample }.join(' ')\n end",
"title": ""
},
{
"docid": "cebc69ff8c16a07daf657d75b47cff24",
"score": "0.72501683",
"text": "def random_word\n word = WORDS[rand(WORDS.length)]\n word == \"\" ? random_word : word\nend",
"title": ""
},
{
"docid": "39c0495bde9ccdc9e16419b76734d10f",
"score": "0.72315437",
"text": "def get_random_word(words)\n # rand method with an integer argument (the length of words) get a new integer between 0 & the length of words\n return words[rand(words.count)]\n end",
"title": ""
},
{
"docid": "0df83e074481379dd8f00c505a8d56e8",
"score": "0.72280055",
"text": "def catch_phrase\n translate('faker.company.buzzwords').collect { |list| sample(list) }.join(' ')\n end",
"title": ""
},
{
"docid": "48cf9186e435a6e5f3a756688f8a938e",
"score": "0.7226218",
"text": "def random_word\n wordpair = nil\n File.foreach(\"wordlist\").each_with_index do |line, number|\n wordpair = line if rand < 1.0/(number+1)\n end\n word = Word.new(wordpair.split(':')[0], wordpair.split(':')[1])\n return word\n end",
"title": ""
},
{
"docid": "fd9a407e26bf1556e8380e59a033d617",
"score": "0.7205939",
"text": "def sentence(min_word_count = 4)\n Faker::Lorem.sentence(min_word_count)\n end",
"title": ""
},
{
"docid": "7e08ea170921480d9fcd0e61300dd8cd",
"score": "0.7185469",
"text": "def buzzword\n sample(translate('faker.company.buzzwords').flatten)\n end",
"title": ""
},
{
"docid": "8966def4b7a276ab677d7b1af67a4f0c",
"score": "0.71557564",
"text": "def random_word\n open('/usr/share/dict/words').read.split(/\\n/).sample\n end",
"title": ""
},
{
"docid": "907e78c24e2eabe081ab976c949233eb",
"score": "0.71502334",
"text": "def get_word\n word = @word_list[rand(@word_list.length)]\n @word = word.gsub(/\\s+/, \"\").downcase\n end",
"title": ""
},
{
"docid": "58837b82cf3295c3a9fb1f83fc473bba",
"score": "0.7124505",
"text": "def add_random_words(string, count = 5)\n words = string.dup.split\n ipsum = File.read(fixture_path('ipsum.txt')).split\n count.times do\n word = ipsum[Random.rand(ipsum.length)]\n index = Random.rand(words.length)\n words.insert(index, word)\n end\n words.join(' ')\nend",
"title": ""
},
{
"docid": "e38b220c2122161b4db25a30580b023c",
"score": "0.7061889",
"text": "def fake_word\n DataFaker.hawaiian_word\nend",
"title": ""
},
{
"docid": "9ad5bc71e0922a2fce1221c200a22234",
"score": "0.70570046",
"text": "def sentence(min_word_count = 4)\n Faker::Lorem.sentence(word_count: min_word_count)\n end",
"title": ""
},
{
"docid": "8694844330b20bae8a9c95d37ba3c58b",
"score": "0.7041162",
"text": "def test_word\n @tester = Faker::Hipster\n @standard_wordlist = I18n.translate('faker.hipster.words')\n\n 1000.times { assert_includes @standard_wordlist, @tester.word }\n end",
"title": ""
},
{
"docid": "648a011afe414198785491a668f58f9f",
"score": "0.70302963",
"text": "def random_word(lexicon)\n lexicon[rand(lexicon.length)] \n end",
"title": ""
},
{
"docid": "c14360bad396641bbd6e0b2ec1992d17",
"score": "0.6980834",
"text": "def sentence(word_count: rand(DEFAULT_WORD_COUNT_RANGE), fillers: dictionnary.fillers)\n word_count = 0 if word_count.negative?\n dictionnary_words = dictionnary.words\n words = (0...word_count).map do\n next dictionnary_words.sample if fillers.nil? || fillers == false || fillers.empty?\n\n rand(3).zero? ? dictionnary_words.sample : fillers.sample\n end\n return '' if words.empty?\n\n words[0] = words[0].capitalize\n words = words.join(' ')\n \"#{words}.\"\n end",
"title": ""
},
{
"docid": "dd27bf6ea1bf222bffbf2b9844e30ebf",
"score": "0.6970199",
"text": "def generate_random_characteristic\n self.characteristic = Faker::Lorem.sentences(Random.rand(1..50)).join if Random.rand(9).even?\n end",
"title": ""
},
{
"docid": "95aaac8033e9da290910ef957a877fbb",
"score": "0.6944766",
"text": "def random_word(fandom_name_or_names = random_fandom)\r\n fandom_name = case fandom_name_or_names\r\n when Array\r\n validate_fandom_list fandom_name_or_names\r\n random_fandom_name_from fandom_name_or_names\r\n when String\r\n fandom_name_or_names\r\n else\r\n raise ArgumentError, \"Argument must be [Array, String] not #{fandom_name_or_names.class}\"\r\n end\r\n\r\n fetch_fandom fandom_name\r\n end",
"title": ""
},
{
"docid": "8788100c8db50aa1b0a374583db57daf",
"score": "0.6858526",
"text": "def random_word\n\t\tnumber = rand(@modified_dictionary.length)\n\t\t@modified_dictionary[number]\n\tend",
"title": ""
},
{
"docid": "08374f1f1dc1323b403c7b88824a77be",
"score": "0.6848694",
"text": "def a_word\n return @random_word\n end",
"title": ""
},
{
"docid": "a4e611aceb118bc006c3de261325b6ce",
"score": "0.6838429",
"text": "def selectWord\n\twords = [\n\t\t\"anvil\",\n\t\t\"black\",\n\t\t\"break\",\n\t\t\"clear\",\n\t\t\"doubt\",\n\t\t\"exist\",\n\t\t\"first\",\n\t\t\"girth\",\n\t\t\"heart\",\n\t\t\"icons\",\n\t\t\"joker\",\n\t\t\"loath\",\n\t\t\"mirth\",\n\t\t\"notch\",\n\t\t\"overt\",\n\t\t\"print\",\n\t\t\"qualm\",\n\t\t\"react\",\n\t\t\"solid\",\n\t\t\"trick\",\n\t\t\"until\",\n\t\t\"viola\",\n\t\t\"water\",\n\t\t\"young\",\n\t\t\"zebra\"\n\t]\n\treturn words[Random.rand(words.length)]\nend",
"title": ""
},
{
"docid": "4d551091cb93b8786be017ea11c01d64",
"score": "0.6825585",
"text": "def pick_random_word(dictionary)\n random_num = rand(dictionary.length)\n dictionary[random_num]\n end",
"title": ""
},
{
"docid": "f2235efe1ac8766786be44eeec001e39",
"score": "0.6812433",
"text": "def random\n init if @words.empty?\n\n @words.pop\n end",
"title": ""
},
{
"docid": "1da22da9c82cd59a6d9c9feddbddca64",
"score": "0.67704725",
"text": "def random_word(length = 5)\n rand(36**length).to_s(36)\nend",
"title": ""
},
{
"docid": "1da22da9c82cd59a6d9c9feddbddca64",
"score": "0.67704725",
"text": "def random_word(length = 5)\n rand(36**length).to_s(36)\nend",
"title": ""
},
{
"docid": "1da22da9c82cd59a6d9c9feddbddca64",
"score": "0.67704725",
"text": "def random_word(length = 5)\n rand(36**length).to_s(36)\nend",
"title": ""
},
{
"docid": "1da22da9c82cd59a6d9c9feddbddca64",
"score": "0.67704725",
"text": "def random_word(length = 5)\n rand(36**length).to_s(36)\nend",
"title": ""
},
{
"docid": "864934cfc7709d88302952872ad3305a",
"score": "0.6754343",
"text": "def sentence(word_count: 4, supplemental: false, random_words_to_add: 6, open_compounds_allowed: true)\n \"#{words(number: word_count + rand(random_words_to_add.to_i).to_i, supplemental: supplemental, spaces_allowed: open_compounds_allowed).join(' ').capitalize}.\"\n end",
"title": ""
},
{
"docid": "6dc9ae0b0ecea7123442b26259f56013",
"score": "0.6739846",
"text": "def random_word(msg)\n return if Variables::Constants::IGNORED_USERS.include?(msg.user.nick)\n word = LiterateRandomizer.word\n @last_words = [] if @last_words.nil?\n word = LiterateRandomizer.word while @last_words.include?(word)\n @last_words.prepend_capped(word, 5)\n msg.reply(word)\n end",
"title": ""
},
{
"docid": "a674f76c74d3fdabd29dce65b36d2c3a",
"score": "0.673241",
"text": "def print_random_text(next_words)\nend",
"title": ""
},
{
"docid": "64bdcfec9490fd2ec65d583c5424c728",
"score": "0.6730113",
"text": "def catch_phrase\n Faker::Company.catch_phrase\n end",
"title": ""
},
{
"docid": "64bdcfec9490fd2ec65d583c5424c728",
"score": "0.6730113",
"text": "def catch_phrase\n Faker::Company.catch_phrase\n end",
"title": ""
},
{
"docid": "ce41ea4c0e5ad454e67634351eb37a78",
"score": "0.67283386",
"text": "def random_word(length = 5)\r\n rand(36**length).to_s(36)\r\nend",
"title": ""
},
{
"docid": "cd90ba760be9186cfa970caad8b13552",
"score": "0.67266005",
"text": "def create_random_name\n String.new(Faker::Games::ElderScrolls.creature)\n end",
"title": ""
},
{
"docid": "c77e02293197f6582be7409b110246b6",
"score": "0.672561",
"text": "def select_word\n uri = URI('https://random-word-api.herokuapp.com/word?number=5')\n words = Net::HTTP.get(uri) \n words = words.delete(\"[\").delete(\"]\").delete(\"\\\"\")\n words = words.split(\",\")\n index = rand(words.count - 1)\n return words[index]\n end",
"title": ""
},
{
"docid": "49e6d3a93cb127a7442b35834673da34",
"score": "0.6694469",
"text": "def generate(num_words)\n words = Array.new\n (1..num_words).to_a.each do\n words.push random_word\n end\n words.join ' '\n end",
"title": ""
},
{
"docid": "a21dc7aae3485abd46425361b0992368",
"score": "0.66911036",
"text": "def dictionary_word\n dict = File.readlines(\"./data/5desk.txt\")\n word = dict[rand(dict.length)].strip while word.nil? || word.length <= 5 || word.length >= 12\n word\n end",
"title": ""
},
{
"docid": "ffcda008886c52258a26be496f2265a8",
"score": "0.6686966",
"text": "def random_word\n letters = ('a'..'z').to_a\n word = []\n length = (rand 15) + 1\n \n length.times do\n word << letters[rand(25)] \n end\n\n word.join ''\nend",
"title": ""
},
{
"docid": "96e5f8a6d9896ef2754d595c30f55f95",
"score": "0.6677675",
"text": "def choose_word\n @words = read_words unless @words\n return @words [rand @words.size]\nend",
"title": ""
},
{
"docid": "36642db1639207c0cba932ade6f43f41",
"score": "0.6672326",
"text": "def randomWord(smallest, largest)\n\t\tlist = to_a(smallest,largest)\n\t\tnumber = rand(list.size) + 1\n\t\tlist[number].downcase.chomp\n\tend",
"title": ""
},
{
"docid": "979618a59729489ef03f0811efc6d0c9",
"score": "0.6666408",
"text": "def zh_lorem_words(total, replacement = nil)\n s = []\n while (s.length < total)\n x = random_one(SENTENCES[ rand(3) ])\n s << random_one(x.split(//u)[0..-2])\n end\n return s.join(\"\")\n end",
"title": ""
},
{
"docid": "2ef98ac81572a2f2e49c2e9eb9a11e51",
"score": "0.6663047",
"text": "def any_sentence(options = {})\n min = 11\n max = 21\n\n if options[:max]\n min = 1\n max = options[:max]\n elsif options[:min]\n min = options[:min]\n max = min + 10\n end\n\n Faker::Lorem.words(rand(max - min) + min).join(' ')\n end",
"title": ""
},
{
"docid": "40f663965c468c5a9a17b6beb7111cfd",
"score": "0.66525114",
"text": "def random_word(random_generator:, random_capitalize: true) # :nodoc:\n random_word = WORDSET[random_bits(random_generator: random_generator, n_bits: log2(WORDSET.length))].dup\n random_word.capitalize! if random_capitalize && (random_bits(random_generator: random_generator, n_bits: 1) == 1)\n random_word\n end",
"title": ""
},
{
"docid": "889e0082dc18c7572b491350ad4b961d",
"score": "0.6651377",
"text": "def word_generator\ntotal_words = []\nFile.open(\"5desk.txt\", \"r\") do |f|\n f.each_line do |line|\n total_words << line \n end\n end\nwords_count = 61407\nrandom_number = rand(0...words_count)\nrandom_word = total_words[random_number]\n# random_word if random_word.length >= 5\nend",
"title": ""
},
{
"docid": "afda4dcc9b0a5f1ffb8caf7761a6368c",
"score": "0.6635809",
"text": "def test_word_without_spaces\n @tester = Faker::Hipster\n\n 1000.times { refute_match(/\\s/, @tester.word) }\n end",
"title": ""
},
{
"docid": "6a4d18c2c59052a432d0386269eac6ec",
"score": "0.66304326",
"text": "def words(total)\n if total.class == Range\n (1..interpret_value(total)).map { WORDS[random_number(total.min, total.max)] }.join(' ')\n else\n (1..interpret_value(total)).map { WORDS[random_number(0, total)] }.join(' ')\n end\n end",
"title": ""
},
{
"docid": "09177940ca806d43a4705c2e0a2ccd4c",
"score": "0.66260314",
"text": "def generate_secret_word\n dictionary = File.open('5desk.txt', 'r').readlines\n legal_words = []\n\n dictionary.each do |line|\n word = line.chomp\n legal_words << word if legal_word?(word)\n end\n\n legal_words.sample\n end",
"title": ""
},
{
"docid": "cd996f2a71d544f13c7d7abc1ffe91af",
"score": "0.6596417",
"text": "def get_word\r\n\t # Variable initialization\r\n\t wordArray = []\r\n\t count = 0\r\n\t random_int = 0\r\n\t \r\n\t # Stores each word that is on a new line into an array\r\n\t f = File.open(\"5desk.txt\", \"r\")\r\n\t f.each_line{ |line| wordArray << line }\r\n\t f.close\r\n\t \r\n\t # Selects the random word between the desired length of between 5 and 12 characters. \r\n\t # Note that this includes an extra delimiter at the end of each word\r\n\t until wordArray[random_int].length > 5 && wordArray[random_int].length < 14 do\r\n\t random_int = Random.new.rand(0..61405)\r\n\t end\r\n\t wordArray[random_int].chomp!\r\n\tend",
"title": ""
},
{
"docid": "777f81562180fff029473d679ba19bcf",
"score": "0.65882885",
"text": "def select_word(words)\n word_selected = words[rand(words.length)].strip\n word_selected\n end",
"title": ""
},
{
"docid": "8383b814a8c6157309b5b77a37b3a0c2",
"score": "0.65742415",
"text": "def choose_word\n input = File.open(\"words.txt\", 'r')\n words = []\n input.readlines.each do |line|\n words.push(line.strip().downcase)\n end\n input.close()\n words[rand(words.length)]\n end",
"title": ""
},
{
"docid": "a93804452ab8adbf2910189342324838",
"score": "0.6556271",
"text": "def rand_text_english(length, bad=payload_badchars)\n if debugging?\n rand_text_debug(length)\n else\n Rex::Text.rand_text_english(length, bad)\n end\n end",
"title": ""
},
{
"docid": "89f4b7931b74d0ad8b105f4d6ec2c1d9",
"score": "0.6551102",
"text": "def add_random_words(string, count = 5)\n string = string.dup\n ipsum = %w(lorem ipsum dolor sit amet consectetur adipiscing elit)\n count.times do\n string << \" #{ipsum[Random.rand(ipsum.length)]}\"\n end\n string\nend",
"title": ""
},
{
"docid": "ded0232384c9a2421c8549a4445521ba",
"score": "0.65495557",
"text": "def random_username\n word_list.sample.gsub(/[^0-9a-z]/i, '')\n end",
"title": ""
},
{
"docid": "95b3297ab170d9d7c6994341cec2b80d",
"score": "0.6549003",
"text": "def words(n)\n final = []\n while n > 0\n if n < 249\n final += FFaker::Lorem.words(n)\n n = 0\n else\n final += FFaker::Lorem.words(249)\n n -= 249\n end\n end\n final.join(\" \")\nend",
"title": ""
},
{
"docid": "eaae0974e3df94caceb7b34b63599a4b",
"score": "0.6545538",
"text": "def new_word\n\t\tdictionary = File.open(\"5desk.txt\", \"r\").readlines\n\t\tbegin \n\t\t\t@the_word = dictionary[rand(0..dictionary.length)]\n\t\tend while @the_word.length >= 12 || @the_word.length <=5\n\t\t@the_word\n\tend",
"title": ""
},
{
"docid": "54c2e3fa686bdcae6511672c82e79b0b",
"score": "0.6533222",
"text": "def words(number: 3, supplemental: false, spaces_allowed: false)\n resolved_num = resolve(number)\n word_list = (\n translate('faker.hipster.words') +\n (supplemental ? translate('faker.lorem.words') : [])\n )\n word_list *= ((resolved_num / word_list.length) + 1)\n\n return shuffle(word_list)[0, resolved_num] if spaces_allowed\n\n words = shuffle(word_list)[0, resolved_num]\n words.each_with_index { |w, i| words[i] = word if w =~ /\\s/ }\n end",
"title": ""
},
{
"docid": "eb92806dd51fbd6aae9ea4f353a69c17",
"score": "0.6522492",
"text": "def lorem\n require 'ffaker'\n\n Faker::Lorem\n end",
"title": ""
},
{
"docid": "aac89394c266d600a0591099c7bd1e4b",
"score": "0.6502419",
"text": "def choose_word\n @word = @lines[rand(0..(@lines.length - 1))].chomp\n choose_word if @word.length < 5 || @word.length > 12\n end",
"title": ""
},
{
"docid": "aad0cdd5c81f1ff02b3916d69151450a",
"score": "0.6497052",
"text": "def add_random_words(string, count = 5)\n string = string.dup\n ipsum = %w[lorem ipsum dolor sit amet consectetur adipiscing elit]\n count.times do\n string << \" #{ipsum[Random.rand(ipsum.length)]}\"\n end\n string\nend",
"title": ""
},
{
"docid": "82db6165dd125195c3100fb6feb3c2a1",
"score": "0.6493523",
"text": "def words(length)\n WORDS.sample(length)\nend",
"title": ""
},
{
"docid": "fa5f90e4b26ef7d2f46e6b20caa5b339",
"score": "0.64846265",
"text": "def get_word(key = '')\n words = self.words[key] || []\n extras = key == '' ? 2 : 3\n\n while true\n n = rand(words.length + extras)\n existing_word = words[n]\n return existing_word if existing_word\n\n new_word = make_word(key)\n bad = false\n self.words.each do |word|\n if word.include? new_word\n bad = true\n break\n end\n end\n next if bad\n words << new_word\n self.words[key] = words\n\n return new_word\n end\n end",
"title": ""
},
{
"docid": "73d7a5fd82c415c07e5eb99b005efe81",
"score": "0.64834356",
"text": "def word_picker\n dictionary = File.readlines('lib/5desk.txt')\n word = dictionary.sample(1)[0].chomp.downcase\n word = dictionary.sample(1)[0].chomp.downcase until word.length.between?(5, 12)\n word\n end",
"title": ""
},
{
"docid": "73b5207d115d753782c97bcd3b1da7f9",
"score": "0.6472014",
"text": "def pick_secret_word\n @word = dictionary.sample\n word\n end",
"title": ""
},
{
"docid": "4164e326e2c2a397d66abb3d9deb52e7",
"score": "0.6454687",
"text": "def draw_word\n @words.sample(random: Ibsenphrase::Random.prng)\n end",
"title": ""
},
{
"docid": "fc65b3e1b2ae3a38ee8a1d4cbd4d9c3b",
"score": "0.6448726",
"text": "def getRandomWord\n @word = Wordnik.words.get_random_word(\n includePartOfSpeech: \"noun\",\n minLength: 5,\n maxLength: 10\n )\n if request.xhr?\n render :json => @word\n end\n end",
"title": ""
},
{
"docid": "7f5ce46ce53ba182647488ab97981254",
"score": "0.64231515",
"text": "def utter_randomly\n length = Utterance::MinLength +\n rand(Utterance::MaxLength - Utterance::MinLength)\n (0...length).map{ Alphabet.sample }.join\n end",
"title": ""
},
{
"docid": "5b4ed387b0a48b66d1a2b813f7f27fec",
"score": "0.63992697",
"text": "def rand_title_two\n 5.times.map do\n rand_word(8).capitalize + ' '\n end.join(' ').rstrip!\nend",
"title": ""
},
{
"docid": "bfe9dbda620adc2088dbb7873510140b",
"score": "0.63965327",
"text": "def pick_random\n random_word = nil\n File.open(\"words.txt\") do |file|\n file_lines = file.readlines()\n random_word = file_lines[Random.rand(0...file_lines.size())]\n end\n return random_word\n end",
"title": ""
},
{
"docid": "8b5271db7820ca23681ad3bd203e7154",
"score": "0.6384503",
"text": "def get_word\n words = File.readlines(\"lib/5desk.txt\")\n words.each { |word| word.chomp! }\n words_list = words.select { |word| word.length.between?(5, 12)}\n\n words_list.sample.downcase.split(\"\")\n end",
"title": ""
},
{
"docid": "f29a395efe782af30ca50f093933a8f5",
"score": "0.63796794",
"text": "def GetRandomWord(wordArray)\n index = rand(wordArray.size)\n return wordArray[index]\nend",
"title": ""
},
{
"docid": "83a0adb32a7e43c343f63fc9e613ec9c",
"score": "0.6370854",
"text": "def random_tweet\n number_of_words = 6 + rand(10)\n ((number_of_words.times.map{word_list.sample}.join(\" \"))[0,139])+\".\"\n end",
"title": ""
},
{
"docid": "f82a4923ece247833506ea581ce92ca4",
"score": "0.63414365",
"text": "def select_word\n words = File.readlines(\"5desk.txt\").select { |word| word.length.between?(5, 12) }\n words[rand(words.length)].strip\n end",
"title": ""
},
{
"docid": "87e5afb0b9d317f5d83716d9ebad8b4e",
"score": "0.6341295",
"text": "def randomly( word )\n send( [ :point, :delete, :insert ].random, word )\n end",
"title": ""
},
{
"docid": "03881cd4ef735601ebfdc92e0bed8d5a",
"score": "0.63259894",
"text": "def rand_brancket\n (rand(2) == 0) ? \"【#{FFaker::Food.meat}】\" : ''\nend",
"title": ""
},
{
"docid": "618f2502bc6ee9efdf5b25a5e14f470b",
"score": "0.6301951",
"text": "def choose_word\n word_index = 0\n loop{\n word_index = rand(@text_file.length.to_i)\n if @text_file[word_index].length.to_i > 4 && @text_file[word_index].length.to_i < 12\n break\n end\n }\n @word = @text_file[word_index]\n end",
"title": ""
},
{
"docid": "0336a2707b779da9739d301f7255b1ac",
"score": "0.6298329",
"text": "def rand_title_three\n Array.new(4) do\n rand_word(5).capitalize + ' '\n end.join(' ').rstrip!\nend",
"title": ""
},
{
"docid": "36d9acb47b923b3450bed2e45a095431",
"score": "0.6298146",
"text": "def random_capitalized_word\n attempts = 0\n # If you don't find a capitalized word after 15 attempts, just use\n # a lowercase word as there may be no capitals in the dicationary.\n until attempts > 15\n attempts += 1\n words = @dictionary.dictionary.keys\n random_choice = words[rand(words.length)]\n if random_choice[0] =~ /[A-Z]/\n return random_choice\n end\n end\n random_word\n end",
"title": ""
},
{
"docid": "e7d2b716dfd33a5db2f463fbe0e19098",
"score": "0.62844074",
"text": "def get_word(dictionary)\n word = dictionary[rand(dictionary.length)]\n # Ensure that the word is between 5 and 12 letters long.\n if word.length.between?(5,12)\n return word.downcase.strip\n else\n get_word(dictionary)\n end\n end",
"title": ""
},
{
"docid": "1a7abd8cfcb2640986cdb29f6ca6d312",
"score": "0.6283702",
"text": "def random_phrase(text_array)\n enable_start = @nr_of_words - @phrase_length\n start = rand(0..enable_start)\n text_array[start..(start+@phrase_length)].join(\" \")\n end",
"title": ""
},
{
"docid": "5ce01ea60f7cc2206f4bc8252eaa42f3",
"score": "0.62828344",
"text": "def get_random_word(filename)\n dictFile = File.open filename\n words = dictFile.readlines.reduce([]) do |words, word|\n if word.strip!.length >= 8\n words << word\n end\n words\n end\n words[(rand words.length)]\nend",
"title": ""
},
{
"docid": "163113b1c12cf93db77aaad756404261",
"score": "0.62761754",
"text": "def name\n \"#{WORDS.sample} #{WORDS.sample} #{rand(1_000_000)} #{Time.now.to_i}\"\n end",
"title": ""
},
{
"docid": "23eec7e905b6ad06e5dd21dfe0d9ad6c",
"score": "0.6259461",
"text": "def chooseRandomWord() \n @randomWord = @wordsList[rand(0..@wordsList.size)]\n @randomWord.downcase\n \n #adding \"_\" to the letters array to display during the game\n randomWordSize = @randomWord.size - 1\n (1..randomWordSize).each do |i| \n @lettersDisplayArr.push(\" _ \")\n \n end\n beginGame()\n end",
"title": ""
},
{
"docid": "f09243824f2f41fc9a64f081ba94c16d",
"score": "0.62489736",
"text": "def get_random_word(dictionary, min_length, max_length)\n random_word = nil\n loop do\n random_index = rand(dictionary.length)\n random_word = dictionary[random_index]\n break if not random_word.nil? and\n (min_length..max_length).cover? random_word.length\n end\n return random_word\n end",
"title": ""
},
{
"docid": "3f61c81d434126a7fb57726e9d6916fc",
"score": "0.62456375",
"text": "def get_word\n dictionary_file = '5desk.txt'\n dictionary = File.readlines(dictionary_file)\n until @secret_word.length > 5 && @secret_word.length < 12\n @secret_word = dictionary.sample.rstrip.downcase\n end\n @secret_word\n end",
"title": ""
},
{
"docid": "e8057d5050c6a94b5ad3bffb220fde46",
"score": "0.6234624",
"text": "def weighted_random(lastword)\n # If word has no words in its dictionary (last word in source text file)\n # have it pick a random word to display instead.\n @dictionary.dictionary.fetch(lastword, NULL_OBJECT).sample\n end",
"title": ""
},
{
"docid": "f0ee92dcc174dc1fed96d3d89043fb0c",
"score": "0.62273437",
"text": "def getWord\n return RandomWord.adjs.next\nend",
"title": ""
},
{
"docid": "7e7c145358dc46ec0c265bd0bda25686",
"score": "0.62211466",
"text": "def get_subtitle\n number_of_items_in_subtitle = rand(1..3)\n\n subtitle = Faker::Commerce.product_name\n\n if number_of_items_in_subtitle > 1\n subtitle += \" and \" + Faker::Commerce.product_name\n end\n if number_of_items_in_subtitle > 2\n subtitle.prepend Faker::Commerce.product_name + \", \"\n end\n\n subtitle\nend",
"title": ""
},
{
"docid": "ae04284b058799d816aea1a95ee244ef",
"score": "0.62109584",
"text": "def random(count,&block)\n @word_letters = WordLetterMap.new @words\n (0..count).each {|i| random_pangram([],&block)}\n end",
"title": ""
},
{
"docid": "23c19cb8b15655f4724f8e321c1b1086",
"score": "0.62003094",
"text": "def sentence_length\n Random.rand(9)+3\nend",
"title": ""
},
{
"docid": "16df2bd863411da32f85b444a8569c13",
"score": "0.6185565",
"text": "def gensecretword\r\n\t\t \trand_index = rand(@wordtable.length)\r\n\t\t \t@secret_clue = @descr[rand_index]\r\n\t\t \t@num_words = @wordtable[rand_index].split(\" \").length\r\n\t\t return @wordtable[rand_index].upcase\r\n\t\t end",
"title": ""
},
{
"docid": "a8dfa4014a326c6eafd8260ee180ebd4",
"score": "0.6181592",
"text": "def make_word(key)\n num_sylls = rand(self.minsyll..self.maxsyll)\n word = ''\n keys = []\n\n # If a key is defined, then select one of the syllables\n # to have a morpheme of that type.\n keys[rand(num_sylls)] = key\n num_sylls.times { |i| word << get_morpheme(keys[i]) }\n\n word\n end",
"title": ""
},
{
"docid": "5cfe8ddd4d6a7615bb6ef9967be1b197",
"score": "0.6175946",
"text": "def any_string(options = {})\n if options[:min] && options[:max]\n raise \":min must be less than :max\" if options[:min] > options[:max]\n end\n if options[:min]\n raise \":min must be positive\" if options[:min] < 1\n end\n\n min_size = options[:min]\n max_size = options[:max]\n\n if min_size.nil? && max_size.nil?\n min_size = rand(80) + 1\n max_size = min_size + rand(80)\n elsif min_size.nil?\n min_size = max_size - rand(max_size)\n min_size = 1 if min_size < 1\n else\n max_size = min_size + rand(min_size) + 1\n end\n\n string = Faker::Lorem.words(1).join(' ')\n while string.length < min_size\n string += Faker::Lorem.words(1).join(' ') \n end\n\n string[0..(max_size-1)]\n end",
"title": ""
},
{
"docid": "bbc8be1b1cab42d4066e3a6a56ec956e",
"score": "0.6174346",
"text": "def rand_text(length, bad=payload_badchars)\n if debugging?\n rand_text_debug(length)\n else\n Rex::Text.rand_text(length, bad)\n end\n end",
"title": ""
},
{
"docid": "1fd8b42242543300a699a9c63a09c020",
"score": "0.6167812",
"text": "def characters(character_count = 255)\n Faker::Lorem.characters(character_count)\n end",
"title": ""
}
] |
cb2cf2b93aced23fcefc3a0ee0b45e53
|
Indicate whether the user can recommend an item for purchase.
|
[
{
"docid": "217fc3c3db8a1ce8bef7f235ac7a1a03",
"score": "0.63130325",
"text": "def can_request_purchase?\n true # TODO: Should this be !virginia_borrower? ?\n end",
"title": ""
}
] |
[
{
"docid": "e65d7a7672ddeb7483a2b90382616dc0",
"score": "0.7157503",
"text": "def can_buy?(item)\r\n item.buyable_by?(self)\r\n end",
"title": ""
},
{
"docid": "eb73746ca54e2556c4dcaf21b3accf5f",
"score": "0.7148289",
"text": "def recommendable?() false end",
"title": ""
},
{
"docid": "bc347fde9b8c41ed6413834016f62927",
"score": "0.7135049",
"text": "def can_buy?(item)\n item.buyable_by?(self)\n end",
"title": ""
},
{
"docid": "c808389d4e722ff2fa9fd7a82d8789e8",
"score": "0.68390083",
"text": "def item_usable?\r\n user.usable?(item) && item_effects_valid?\r\n end",
"title": ""
},
{
"docid": "144e4b0d56b0900f46913f0f412fdc66",
"score": "0.6827606",
"text": "def item_usable?\n user.usable?(item) && item_effects_valid?\n end",
"title": ""
},
{
"docid": "7168aaa3a1a69c2857e3d697f68c4e81",
"score": "0.66412073",
"text": "def recommended?(user_id)\n return self.article_recommendations.exists?(user_id: user_id)\n end",
"title": ""
},
{
"docid": "f2955b15568a7a68b74c44aa5bcd7047",
"score": "0.6575622",
"text": "def recommendations_enabled\n return @recommendations_enabled\n end",
"title": ""
},
{
"docid": "f17628a7895fbca50471f5d09792bd8a",
"score": "0.65648973",
"text": "def enable?(item)\n CookingManager.quantity(item) > 0\n end",
"title": ""
},
{
"docid": "9b1999ed5d752eb69fdda5794e4191d7",
"score": "0.6534497",
"text": "def is_favoritable?\n true\n end",
"title": ""
},
{
"docid": "7e806b7a80f70ef8a9959588e690329b",
"score": "0.6449945",
"text": "def has_discounts?\n rpg_shop.permit_sales\n end",
"title": ""
},
{
"docid": "53912226dfa399ee97cd2de198c3aa83",
"score": "0.64439887",
"text": "def purchased?(product)\n purchase_items.exists?(product_id: product.id)\n end",
"title": ""
},
{
"docid": "0f7f55b770cdd9847ef980da92f0f419",
"score": "0.6420681",
"text": "def enable?(item)\n return (item.price > 0)\n end",
"title": ""
},
{
"docid": "248dfe6f4170c653d7add24053dd163e",
"score": "0.63699496",
"text": "def premium?\n product == \"premium\"\n end",
"title": ""
},
{
"docid": "b468f47330f04743760b925bdfddfda2",
"score": "0.63678914",
"text": "def item_need_review\n return @item_need_review\n end",
"title": ""
},
{
"docid": "16d92c32b64c78f12b4aa1e3d3b63ac7",
"score": "0.6348184",
"text": "def recommended_by_current_user\n if current_user\n extract = Csvarchive.find(params[:id])\n e_rec = extract.recommendations\n u_rec = current_user.recommendations\n all_rec = e_rec & u_rec\n if !all_rec.empty?\n @recommended = true\n else\n @recommended = false\n end\n else\n @recommended = false\n end\n end",
"title": ""
},
{
"docid": "9093a70d87f1d599ead79960155a79a1",
"score": "0.6330634",
"text": "def shares_available_for_purchase?\n if Stock.all.find_by(id: trade.stock_id).shares_available < trade.num_shares\n return false\n else\n return true\n end\n end",
"title": ""
},
{
"docid": "e27c32c41af4c7041c45a9fe550dccec",
"score": "0.6326045",
"text": "def can_activate?(item)\r\n item.activatable_by?(self)\r\n end",
"title": ""
},
{
"docid": "3bb8f7325f619dfc3341ee94005d641a",
"score": "0.631778",
"text": "def enable?(item)\n return false if item.nil?\n return false unless has_recipebook?\n return false if item.tocrafting_gold_fee > $game_party.gold\n return false if $game_party.item_max?(item)\n return false unless have_tools?(item)\n return false unless have_actors?(item)\n return true if item.ingredient_list.empty?\n return have_ingredients?(item)\n end",
"title": ""
},
{
"docid": "e6c9ecaf7c02390a4546154d9e767a2c",
"score": "0.63173556",
"text": "def is_recommendation_enabled\n return @is_recommendation_enabled\n end",
"title": ""
},
{
"docid": "3f5b2f0500b21a18392b51c471acbab7",
"score": "0.63016737",
"text": "def user_may_view_item?\n @pcp_item.pcp_step.released? || @pcp_item.pcp_step.in_commenting_group?\n end",
"title": ""
},
{
"docid": "975b27f5b07e060262dcb0561288c1a4",
"score": "0.6295547",
"text": "def enable?(item)\n item && item.price > 0\n end",
"title": ""
},
{
"docid": "92c6827ba802bd4785f416b4b68d1ad2",
"score": "0.6280972",
"text": "def can_activate?(item)\n item.activatable_by?(self)\n end",
"title": ""
},
{
"docid": "51fae854a02e06f2e752aa967a4e08f4",
"score": "0.62651604",
"text": "def purchased?\n state == \"purchased\" or stolen == true\n end",
"title": ""
},
{
"docid": "d53269844b2171454026faab62fdfda7",
"score": "0.62580764",
"text": "def permitted_for_research_object?(item = self)\n if item.is_downloadable?\n item.can_download?(nil)\n else\n item.can_view?(nil)\n end\n end",
"title": ""
},
{
"docid": "a1e28af48733a9a26395b2a4d87cc680",
"score": "0.6228964",
"text": "def premium?\n premium\n end",
"title": ""
},
{
"docid": "1ded53fbb87bcdd6d7caf8cf90113ea0",
"score": "0.621769",
"text": "def can_sell_drug?(drug)\n drug.can_be_sold?\n end",
"title": ""
},
{
"docid": "1b413651bb67e4d3a142e521597d292c",
"score": "0.6185939",
"text": "def should_i_buy?(item)\n !!list[item.to_sym]\n end",
"title": ""
},
{
"docid": "dba3628b3359d5bd0c922fea7bcee3ac",
"score": "0.61818296",
"text": "def check_item_condition?\n # disallow usage if item button disabled\n return false if !$game_system.item_button\n # disallow usage\n item_condition = false\n # if using direct hotkeys\n if BlizzABS::Config::DIRECT_HOTKEYS\n # check direct hotkeys\n item_condition = self.item_hotkeys?\n # if item button pressed\n elsif Input.trigger?(Input::Item)\n # allow usage\n item_condition = true\n end\n # return result\n return item_condition\n end",
"title": ""
},
{
"docid": "7d4e9a83841606cc9eb63e42962ce81a",
"score": "0.613762",
"text": "def pro_rating?\n safe_rating >= Elo.config.pro_rating_boundry\n end",
"title": ""
},
{
"docid": "f944b637a31d4d51a9a1badea4d1ecaf",
"score": "0.6115583",
"text": "def suggestion_check?\n session[:suggested_item].empty?\n end",
"title": ""
},
{
"docid": "a55e00893e331aec3fbf45214138a283",
"score": "0.61040443",
"text": "def validate_item_results?\n if @item.user.private\n authenticate_user!\n if !current_user.subscribed_to(@item.user)\n return false\n end\n end\n return true\n end",
"title": ""
},
{
"docid": "66ef285e2dbe22fa01848b684cffbb8a",
"score": "0.61035925",
"text": "def price_to_be_announced?\n unless self.product_supplies.empty? || self.product_supplies.first.supply_details.empty?\n unpriced_item_type = self.product_supplies.first.supply_details.first.unpriced_item_type\n end\n unpriced_item_type ? unpriced_item_type.human==\"PriceToBeAnnounced\" : false\n end",
"title": ""
},
{
"docid": "b2bca8bedeee54b359561036ee56d0c3",
"score": "0.6097516",
"text": "def item_can_use?(item)\n return false unless item.is_a?(RPG::Item)\n return false if item_number(item) == 0\n if $game_temp.in_battle\n return item.battle_ok?\n else\n return item.menu_ok?\n end\n end",
"title": ""
},
{
"docid": "4d6294de050caa8ccb43421e33738c8c",
"score": "0.6092808",
"text": "def check_buyable\n raise PermissionDeniedError, \"出品したアイテムはサポートできません\" if @item.owner?(current_user)\n end",
"title": ""
},
{
"docid": "d6772af6bf43614a0071d606e01f915b",
"score": "0.60500866",
"text": "def enable?(item)\n return false if item.nil?\n return false if $game_party.gold < item.dismantle_gold_fee \n return item.dismantlable?\n end",
"title": ""
},
{
"docid": "e3e0a9bf59777dd5d85b0d78eebd10a5",
"score": "0.6046043",
"text": "def can_be_approved?\n self.applied?\n end",
"title": ""
},
{
"docid": "ae25227d0212ed001e4707cf089814f0",
"score": "0.60429233",
"text": "def invited_for_interview?\n if offering.uses_interviews?\n application_review_decision_type.nil? ? false : application_review_decision_type.yes_option\n else\n false\n end\n end",
"title": ""
},
{
"docid": "569893568c91ad52cb78930801dd71a5",
"score": "0.60255706",
"text": "def reserved?(product)\n product.status == 'Reserved'\n end",
"title": ""
},
{
"docid": "0865376d5a452d2e0c7d991bc90dde16",
"score": "0.6015206",
"text": "def enable?(item)\n if item.is_a?(RPG::Item)\n return true if !item.key_item?\n elsif item.is_a?(RPG::Weapon) || item.is_a?(RPG::Armor)\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "04d14027882e8b649d3a54630fdf8ccb",
"score": "0.60151035",
"text": "def require_product?\n !!!catalog_request?\n end",
"title": ""
},
{
"docid": "04d14027882e8b649d3a54630fdf8ccb",
"score": "0.60151035",
"text": "def require_product?\n !!!catalog_request?\n end",
"title": ""
},
{
"docid": "93a27a7fbeebbba814fec2bbfca1ecf3",
"score": "0.6013756",
"text": "def has_editorial_or_stock_for_sale\n return false if self.requests.length == 0\n self.requests.each do |r|\n return false if r.state == \"denied\"\n end\n true\n end",
"title": ""
},
{
"docid": "0d0211a6506dde86eb504b16a25f99b3",
"score": "0.60047805",
"text": "def in_use?\n published? || has_answers? || has_choices?\n end",
"title": ""
},
{
"docid": "b3ff4870e0d1fc3745b172db09f204e7",
"score": "0.5997057",
"text": "def premium?\n \t! free?\n end",
"title": ""
},
{
"docid": "ebb6649ff64049c46522003e89b00ff0",
"score": "0.599381",
"text": "def enable?(item)\n end",
"title": ""
},
{
"docid": "c9c0c6b0634d04fb343a6795c7bcf94f",
"score": "0.5991887",
"text": "def within_limit_of?(item, user)\r\n @member_limits.fetch(user.email).has_resources_for?(item.price)\r\n end",
"title": ""
},
{
"docid": "39459e55d103b0bf7cca32f43c979fe1",
"score": "0.5982159",
"text": "def current_item_enabled?\n return true\n end",
"title": ""
},
{
"docid": "dc42e57d8a8ff2f0fb8ee3d01ea633a3",
"score": "0.5976384",
"text": "def recommendations_enabled=(value)\n @recommendations_enabled = value\n end",
"title": ""
},
{
"docid": "7677eeb359bf3b289d2c03f3a76e50c2",
"score": "0.5976112",
"text": "def can_supply?(required)\n total_on_hand >= required || backorderable?\n end",
"title": ""
},
{
"docid": "5ceb09676f6ea12f7342c81ce2fc232d",
"score": "0.59735507",
"text": "def bought?\n # paym\n end",
"title": ""
},
{
"docid": "016c18e372213a7bd584fe2cc5719cec",
"score": "0.5972734",
"text": "def eligible?(product)\n @product_codes.include?(product.product_code)\n end",
"title": ""
},
{
"docid": "4688754dedcfddfbd01ebf09b59e33b7",
"score": "0.59719646",
"text": "def canViewWriteReviewButtonForItem(user, item)\n\t \t\t\tif item.nil?\n\t \t\t\t\treturn false\n\t \t\t\tend\n\n\t \t\t\tif user.nil?\n\t \t\t\t\t# different than above, b/c we handle login differently\n\t \t\t\t\treturn false\n\t \t\t\tend\n\t \t\t\tif isStoreManager(user) || isStoreOwner(user)\n\t \t\t\t\treturn \"store managers cannot review items\"\n\t \t\t\tend\n\n\t \t\t\tpreviousreview = item.store_item_reviews.find_by user_id: user.id\n\t \t\t\tif previousreview.nil?\n\t \t\t\t\treturn true\n\t \t\t\telse\n\t \t\t\t\treturn \"you've already reviewed this item\"\n\t \t\t\tend\n\t \t\tend",
"title": ""
},
{
"docid": "0bcd6c44eda810c38e99e7031a1f3896",
"score": "0.5967236",
"text": "def has_met_requirement?\n yeas >= required_votes\n end",
"title": ""
},
{
"docid": "b24afe184ae58556bd2c800d762c80b3",
"score": "0.5951377",
"text": "def enable?(item)\n true\n end",
"title": ""
},
{
"docid": "b24afe184ae58556bd2c800d762c80b3",
"score": "0.5951377",
"text": "def enable?(item)\n true\n end",
"title": ""
},
{
"docid": "f5d6ca8ff5947e70e6c93e59c707344b",
"score": "0.5949628",
"text": "def has_buyer_review?\n buyer_reviews.present?\n end",
"title": ""
},
{
"docid": "2eff37e7aa8a32808daf2017bcc30f22",
"score": "0.59488964",
"text": "def renewal_or_review_mandatory?\n existing_agreement? && waste_producer_water_discount?\n end",
"title": ""
},
{
"docid": "fe93eb869565de66d8ea2c87de6346c5",
"score": "0.5942727",
"text": "def current_item_enabled?\n true\n end",
"title": ""
},
{
"docid": "d626441bf000d4a16bc56a61e2b3a074",
"score": "0.5942559",
"text": "def donatable?\n show_donation_basket? && has_an_approved_account_set? && money_approved?\n end",
"title": ""
},
{
"docid": "77aa3a139f1bf0c60898216d5ea4ae9a",
"score": "0.5937809",
"text": "def should_notify?\n (article.recommendations_count > 0 and\n article.recommendations_count.modulo(5) == 0)\n end",
"title": ""
},
{
"docid": "08653598706c32f52564f54b9499f707",
"score": "0.59308124",
"text": "def rateable_by?(user)\n self.user.rateable_by?(user)\n end",
"title": ""
},
{
"docid": "08653598706c32f52564f54b9499f707",
"score": "0.59308124",
"text": "def rateable_by?(user)\n self.user.rateable_by?(user)\n end",
"title": ""
},
{
"docid": "7ac100fb9f3066c3a845935e2d0e14c4",
"score": "0.59289074",
"text": "def valid_recommendation_hash? input\n (input[:action] == RECOMMEND_ACTION && input[:customer_name] && input[:invitee_name]) ||\n (input[:action] == ACCEPT_ACTION && input[:customer_name])\n end",
"title": ""
},
{
"docid": "afce4edaa9d788ba74afc4096660681f",
"score": "0.59262925",
"text": "def enable?(item)\n return true\n end",
"title": ""
},
{
"docid": "afce4edaa9d788ba74afc4096660681f",
"score": "0.59262925",
"text": "def enable?(item)\n return true\n end",
"title": ""
},
{
"docid": "ec0cbabb8c645c9530417757a37f4f2e",
"score": "0.5925081",
"text": "def can_afford_to_rent?(movie)\n end",
"title": ""
},
{
"docid": "ebffe53a259f5fd4daac75c9371c1288",
"score": "0.5921658",
"text": "def is_recommendation_enabled=(value)\n @is_recommendation_enabled = value\n end",
"title": ""
},
{
"docid": "c2cb158d1a3b2e767f5f2f33d9dd5ea6",
"score": "0.5916248",
"text": "def can_review?\n reviewer? || moderator? || administrator?\n end",
"title": ""
},
{
"docid": "a7a52acb7e1c787f24fce4f782660754",
"score": "0.5913436",
"text": "def available?(object)\n line_items = object_to_line_items(object)\n return false if line_items.nil?\n\n weight_rate = get_rate(get_total_weight(line_items), AdditionalCalculatorRate::WEIGHT)\n !weight_rate.nil? # available only if the weight rate is not nil\n end",
"title": ""
},
{
"docid": "0ceb9b45183702c61d1fd1a27d127645",
"score": "0.5913428",
"text": "def available?\n self.available_product_supplies.length > 0 and not self.delete?\n end",
"title": ""
},
{
"docid": "bf6c78bfb5608fe31a17f2a25616a07f",
"score": "0.59122306",
"text": "def must_buy_train?(entity)\n must_buy_power?(entity)\n end",
"title": ""
},
{
"docid": "31d0af02baa91e9e26d529ecd95f23d7",
"score": "0.59122294",
"text": "def custom_order?\n order_items.all? { |oi| oi.purchasable_type == 'Effective::Product' }\n end",
"title": ""
},
{
"docid": "e4ed8d6e6eea689c06e1ecd9a02d6097",
"score": "0.58996826",
"text": "def fulfilled?\n user.donations.active.count >= quantity\n end",
"title": ""
},
{
"docid": "bbb9c806046e18374342d026a6c519a0",
"score": "0.58979404",
"text": "def enable?(item); true; end",
"title": ""
},
{
"docid": "34ebc56a9f09de403edc82cc3560e9c9",
"score": "0.58880806",
"text": "def usable_item_conditions_met?(item)\r\n movable? && occasion_ok?(item)\r\n end",
"title": ""
},
{
"docid": "0349b0477fe060fe291d6f33a1bafcf8",
"score": "0.58810717",
"text": "def has_item?(item)\n return true if drops_item?(item)\n return true if can_steal_item?(item)\n false\n end",
"title": ""
},
{
"docid": "d423e6ce5bdf507a33f2beba4b616678",
"score": "0.5879438",
"text": "def include?(item)\n case @category\n when :item\n item.is_a?(RPG::Item) && !item.key_item? && item.dismantlable?\n when :weapon\n item.is_a?(RPG::Weapon) && item.dismantlable?\n when :armor\n item.is_a?(RPG::Armor) && item.dismantlable?\n when :key_item\n item.is_a?(RPG::Item) && item.key_item? && item.dismantlable?\n else\n false\n end\n end",
"title": ""
},
{
"docid": "aa168511a7866ba7a9c7f9a06cad91ee",
"score": "0.5872137",
"text": "def available?\n self.active == true and self.quantity_available > 0\n end",
"title": ""
},
{
"docid": "3ba9bbaffa3e1d52a0880dac79462289",
"score": "0.58692294",
"text": "def can_user_buy_photos?(user)\n return true if who_can_buy == WHO_EVERYONE\n return true if who_can_buy == WHO_OWNER && user && admin?(user.id)\n return true if who_can_buy == WHO_VIEWERS && user && can_view_or_not_private?(user.id)\n\n return false\n end",
"title": ""
},
{
"docid": "bc2a9d61288f1f7ed73c7c876c38152b",
"score": "0.5868313",
"text": "def may_purchase?(_company)\n false\n end",
"title": ""
},
{
"docid": "2901b28cd14543fcd5689a5a59d31bd6",
"score": "0.58601165",
"text": "def is_purchasing_credit?\n sku_type.to_s == Product::SKU_TYPE_PURCHASING_CREDIT && self.internal?\n end",
"title": ""
},
{
"docid": "c53c86c222c550d004ef83abcecbc6d6",
"score": "0.58572674",
"text": "def rated?\n liked_by_count > 0 || disliked_by_count > 0\n end",
"title": ""
},
{
"docid": "5ddf8d90927d1c52eca7116e394ad4a6",
"score": "0.58546203",
"text": "def item_usable?\n return false unless @item\n return @actor ? @actor.usable?(@item) : $game_player.usable?(@item)\n end",
"title": ""
},
{
"docid": "82d456c8bb2972412a6fed5b85a068f5",
"score": "0.58539987",
"text": "def has_discount?\n !discount.nil? && (!discount.product_list? || discount.product_ids.include?(line_item.product_id))\n end",
"title": ""
},
{
"docid": "f8dcc00f06a498610f045f21526bd556",
"score": "0.5852824",
"text": "def available?\n self.in_stock? || self.backorderable?\n end",
"title": ""
},
{
"docid": "3b697e8b9c776451eaa2cb5216357087",
"score": "0.5844589",
"text": "def enable?(item)\n true#$game_party.usable?(item)\n end",
"title": ""
},
{
"docid": "2d6645388d22d6109574795ed0ac7b1b",
"score": "0.58444977",
"text": "def canYouGiveMeATreasure\n !getVisibleTreasures.empty?\n end",
"title": ""
},
{
"docid": "7470a94d921d2c8c9bd6064779c63c5b",
"score": "0.58425015",
"text": "def licensed?\n end",
"title": ""
},
{
"docid": "13796f26597dee4b425b14411e8a68e6",
"score": "0.5832107",
"text": "def under_review?(item = nil)\n # noinspection RubyMismatchedArgumentType\n super(item || self)\n end",
"title": ""
},
{
"docid": "1b2baa7e5e79ccb28dab071cd45d2799",
"score": "0.5820247",
"text": "def can_sell?\n inventory.any? { |inv| inv.price > 0 }\n end",
"title": ""
},
{
"docid": "9c1f4647772b1242fb4d930663d74cac",
"score": "0.581987",
"text": "def offers_reward?\n !self.rewards.visible.empty?\n end",
"title": ""
},
{
"docid": "71a91831173481336b75230e4c1e945e",
"score": "0.5812441",
"text": "def voted_on?(user)\n return !self.ratings.find_by_user_id(user.id).nil?\n end",
"title": ""
},
{
"docid": "560ba03076967959572e06ff669dd79a",
"score": "0.58107156",
"text": "def under_review?(item)\n state_group(item) == :review\n end",
"title": ""
},
{
"docid": "f1efbd2da0512d32adf24ec06180f0b9",
"score": "0.5810298",
"text": "def user_meets_criteria?(user)\n user.credits > 0\n end",
"title": ""
},
{
"docid": "f1d61ccdd0235b066453dc16b15ac737",
"score": "0.5807469",
"text": "def can_supply?\n payment_received? || payment_on_account?\n end",
"title": ""
},
{
"docid": "c1b67113f0e4dca1e933a1c462ad5133",
"score": "0.5804405",
"text": "def redeemable?\n [AVAILABLE, EXPIRED].include?(status) and started? and delay_passed?\n end",
"title": ""
},
{
"docid": "5a4b7abd8022f4b3cc45029089595aa9",
"score": "0.58035856",
"text": "def sold?(product)\n product.status == 'Sold'\n end",
"title": ""
},
{
"docid": "0144c3ad17fc1f245fce383d98119660",
"score": "0.57960606",
"text": "def approved?\n closed? && has_met_requirement?\n end",
"title": ""
},
{
"docid": "1e4f49a4ed8bf5b1b1d7bb0d5d4d8ed4",
"score": "0.5794641",
"text": "def rating_checked?(rating)\n @selected_ratings.has_key?(rating)\n end",
"title": ""
},
{
"docid": "875e8807af2b2daf108bbe08b3fab783",
"score": "0.57936364",
"text": "def recommendations_for(obj)\n recommend_by_item_based obj\n end",
"title": ""
}
] |
7735bbcf914dac6dc4ebe97ffadc5cc7
|
POST /distbutors POST /distbutors.json
|
[
{
"docid": "bcb0a96605ef11c3221d97d7d8a2b372",
"score": "0.5391399",
"text": "def create\n permision_ok = true\n distbutor_save = false\n @distbutor = Distbutor.new(distbutor_params)\n unless params[:distbutor][:primary_dist_id].nil?\n params[:distbutor][:included_cities].each do |city_id|\n if city_id != \"\"\n city = City.find_by(id: city_id)\n state_id = city.state_id\n country_id = city.state.country_id\n permision_ok = false unless check_premisions(params[:distbutor][:primary_dist_id], country_id, state_id,city_id)\n end\n end\n if permision_ok\n params[:distbutor][:included_states].each do |state_id|\n if state_id != \"\"\n country_id = State.find_by(id: state_id).country_id\n permision_ok = false unless check_premisions(params[:distbutor][:primary_dist_id], country_id, state_id,\"\")\n end\n end\n end\n if permision_ok\n params[:distbutor][:included_countries].each do |country_id|\n if country_id != \"\"\n permision_ok = false unless check_premisions(params[:distbutor][:primary_dist_id], country_id, \"\",\"\")\n end\n end\n end\n end\n (params[:distbutor][:included_countries] - State.where(id: params[:distbutor][:included_states]).pluck(:country_id).uniq).each{ |country_id| @distbutor.included_countries.build country_id: country_id if country_id != \"\"}\n (params[:distbutor][:included_states] - City.where(id: params[:distbutor][:included_cities]).pluck(:state_id).uniq).each{ |state_id| @distbutor.included_states.build state_id: state_id if state_id != \"\"}\n params[:distbutor][:included_cities].each{ |city_id| @distbutor.included_cities.build city_id: city_id if city_id != \"\"}\n (params[:distbutor][:excluded_states] - City.where(id: params[:distbutor][:excluded_cities]).pluck(:state_id).uniq).each{ |state_id| @distbutor.excluded_states.build state_id: state_id if state_id != \"\"}\n params[:distbutor][:excluded_cities].each{ |city_id| @distbutor.excluded_cities.build city_id: city_id if city_id != \"\"}\n respond_to do |format|\n if permision_ok\n distbutor_save = @distbutor.save\n end \n if distbutor_save\n format.html { redirect_to @distbutor, notice: 'Distbutor was successfully created.' }\n format.json { render :show, status: :created, location: @distbutor }\n else\n format.html { render :new }\n format.json { render json: @distbutor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "c319c463a212c0eb6bc6f409cb1269f9",
"score": "0.61072874",
"text": "def create\n @distraction = Distraction.new(params[:distraction])\n\n respond_to do |format|\n if @distraction.save\n format.html { redirect_to @distraction, notice: 'Distraction was successfully created.' }\n format.json { render json: @distraction, status: :created, location: @distraction }\n else\n format.html { render action: \"new\" }\n format.json { render json: @distraction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ee17c3626a3e3fbddfbf163db94be7b4",
"score": "0.5995997",
"text": "def distbutor_params\n params.require(:distbutor).permit(:name)\n end",
"title": ""
},
{
"docid": "d7c65aea6838cc3dd5f7e8d97b7e0a44",
"score": "0.58573854",
"text": "def create\n @distributor = Distributor.new(params[:distributor])\n\n respond_to do |format|\n if @distributor.save\n format.html { redirect_to distributors_url }\n format.json { render json: @distributor, status: :created, location: @distributor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @distributor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff0e7431cc4e94a0c35add655d2a0ac4",
"score": "0.5799921",
"text": "def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend",
"title": ""
},
{
"docid": "ed8e6f93936427341eb4faf2be00ddf3",
"score": "0.57047284",
"text": "def create\n @distribuidor = Distribuidor.new(distribuidor_params)\n\n respond_to do |format|\n if @distribuidor.save\n format.html { redirect_to @distribuidor, notice: 'El distribuidor a sido creado.' }\n format.json { render :show, status: :created, location: @distribuidor }\n else\n format.html { render :new }\n format.json { render json: @distribuidor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c92db42a8356c6583edc5babc0cd67dc",
"score": "0.56995595",
"text": "def create\n @odist = Odist.new(odist_params)\n\n respond_to do |format|\n if @odist.save\n format.html { redirect_to @odist, notice: 'Odist was successfully created.' }\n format.json { render :show, status: :created, location: @odist }\n else\n format.html { render :new }\n format.json { render json: @odist.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6fa261fa6c942b9e7b22294bd272d584",
"score": "0.56933165",
"text": "def create\n @distro = Distro.new(distro_params)\n\n respond_to do |format|\n if @distro.save\n format.html { redirect_to @distro, notice: 'Distro was successfully created.' }\n format.json { render action: 'show', status: :created, location: @distro }\n else\n format.html { render action: 'new' }\n format.json { render json: @distro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "650fbaeb6d88cb6701d626f26aa40531",
"score": "0.566171",
"text": "def create\n @denuncium = Denuncium.new(params[:denuncium])\n\n respond_to do |format|\n if @denuncium.save\n format.html { redirect_to @denuncium, notice: 'Denuncium was successfully created.' }\n format.json { render json: @denuncium, status: :created, location: @denuncium }\n else\n format.html { render action: \"new\" }\n format.json { render json: @denuncium.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "98fd14e7e991c0544c8ad7f28721d78a",
"score": "0.5570877",
"text": "def denunciation_params\n params.require(:denunciation).permit(:survivor_id, :sender_id)\n end",
"title": ""
},
{
"docid": "d6d2c3dc289a3f8408e1b931e444d822",
"score": "0.5405011",
"text": "def create\n \n @distribution = @foyer.distributions.build(params[:distribution])\n\n respond_to do |format|\n if @distribution.save\n flash[:notice] = 'Distribution a bien été crée.'\n format.html { redirect_to foyer_distributions_url(@foyer) }\n format.xml { render :xml => @distribution, :status => :created, :location => @distribution }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @distribution.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9b36097d38e423bb3f674416c9d98354",
"score": "0.5402178",
"text": "def create\n @asserted_distribution = AssertedDistribution.new(asserted_distribution_params)\n respond_to do |format|\n if @asserted_distribution.save\n format.html { redirect_to @asserted_distribution, notice: 'Asserted distribution was successfully created.' }\n format.json { render :show, status: :created, location: @asserted_distribution }\n else\n format.html { render :new }\n format.json { render json: @asserted_distribution.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "722bddbf9a07fb7e54d749bfdacebc0d",
"score": "0.5346824",
"text": "def create\n @therapist = Therapist.new(therapist_params)\n\n respond_to do |format|\n if @therapist.save\n format.html { redirect_to @therapist, notice: 'Therapist was successfully created.' }\n format.json { render :show, status: :created, location: @therapist }\n else\n format.html { render :new }\n format.json { render json: @therapist.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "722bddbf9a07fb7e54d749bfdacebc0d",
"score": "0.5346824",
"text": "def create\n @therapist = Therapist.new(therapist_params)\n\n respond_to do |format|\n if @therapist.save\n format.html { redirect_to @therapist, notice: 'Therapist was successfully created.' }\n format.json { render :show, status: :created, location: @therapist }\n else\n format.html { render :new }\n format.json { render json: @therapist.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9f2142b93dc29198f09831d312479608",
"score": "0.5345333",
"text": "def create\n @therapist = Therapist.new(params[:therapist])\n\n respond_to do |format|\n if @therapist.save\n format.html { redirect_to @therapist, notice: 'Therapist was successfully created.' }\n format.json { render json: @therapist, status: :created, location: @therapist }\n else\n format.html { render action: \"new\" }\n format.json { render json: @therapist.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d150a70b29ba6a251519dff4d7479c13",
"score": "0.532258",
"text": "def post(path, **args); end",
"title": ""
},
{
"docid": "3f7411fcb849219fdf74ee56e1acc21f",
"score": "0.53208166",
"text": "def create\n @doctor = Doctor.new(params[:doctor])\n\n if @doctor.save\n render json: @doctor, status: :created, location: @doctor\n else\n render json: @doctor.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "16ddf86db9476dc4bfe544fbf0d14c53",
"score": "0.531193",
"text": "def create\n @distribuidora = Distribuidora.new(params[:distribuidora])\n\n respond_to do |format|\n if @distribuidora.save\n format.html { redirect_to(@distribuidora, :notice => 'Distribuidora was successfully created.') }\n format.xml { render :xml => @distribuidora, :status => :created, :location => @distribuidora }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @distribuidora.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "319454aa3a1e0ce6471b90ba3b5fbaab",
"score": "0.5310517",
"text": "def create\n @vendedor = Vendedor.new(vendedor_params)\n\n respond_to do |format|\n if @vendedor.save\n format.html { redirect_to @vendedor, notice: 'Vendedor was successfully created.' }\n format.json { render :show, status: :created, location: @vendedor }\n else\n format.html { render :new }\n format.json { render json: @vendedor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "319454aa3a1e0ce6471b90ba3b5fbaab",
"score": "0.5310517",
"text": "def create\n @vendedor = Vendedor.new(vendedor_params)\n\n respond_to do |format|\n if @vendedor.save\n format.html { redirect_to @vendedor, notice: 'Vendedor was successfully created.' }\n format.json { render :show, status: :created, location: @vendedor }\n else\n format.html { render :new }\n format.json { render json: @vendedor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9a57363b6de8b1ebdc760106c3783361",
"score": "0.530808",
"text": "def create\n @distributor = Distributor.new(distributor_params)\n\n respond_to do |format|\n if @distributor.save\n format.js { render_js_for_form @distributor,distributors_path, '创建成功!' }\n else\n format.js { render_js_for_form @distributor }\n end\n end\n end",
"title": ""
},
{
"docid": "f9a403865c56af602cf5426509b58574",
"score": "0.5288895",
"text": "def create\n @d_dungeoneer = DDungeoneer.new(d_dungeoneer_params)\n\n ActiveRecord::Base.transaction do\n respond_to do |format|\n if @d_dungeoneer.save\n format.html { redirect_to @d_dungeoneer, notice: 'D dungeoneer was successfully created.' }\n format.json { render :show, status: :created, location: @d_dungeoneer }\n else\n format.html { render :new }\n format.json { render json: @d_dungeoneer.errors, status: :unprocessable_entity }\n end\n end\n end\n\n end",
"title": ""
},
{
"docid": "f61bf465125ba3e514f2331eb3a6e4e7",
"score": "0.52859885",
"text": "def create\n @user_distributor = UserDistributor.new(user_distributor_params)\n\n respond_to do |format|\n if @user_distributor.save\n format.html { redirect_to @user_distributor, notice: 'User distributor was successfully created.' }\n format.json { render :show, status: :created, location: @user_distributor }\n else\n format.html { render :new }\n format.json { render json: @user_distributor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36c7f0b51e4d8e491c6fa39427543447",
"score": "0.5281137",
"text": "def create\n @dte_direction = DteDirection.new(dte_direction_params)\n\n respond_to do |format|\n if @dte_direction.save\n format.html { redirect_to @dte_direction, notice: 'Dte direction was successfully created.' }\n format.json { render :show, status: :created, location: @dte_direction }\n else\n format.html { render :new }\n format.json { render json: @dte_direction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "09855571b83558be6d1320a4e6689c65",
"score": "0.5268417",
"text": "def create\n @distro = Distro.new(params[:distro])\n @distro.account_id = @oeaccount.id\n respond_to do |format|\n if @distro.save\n\taddtoaccount(\"distros\", @distro)\n format.html { redirect_to distros_url, notice: 'Distro was successfully created.' }\n format.json { render json: @distro, status: :created, location: @distro }\n else\n format.html { render action: \"new\" }\n format.json { render json: @distro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8f7bf0f7def562e6b65e76f39850b9c1",
"score": "0.5240691",
"text": "def create\n @dteor = Dteor.new(params[:dteor])\n\n respond_to do |format|\n if @dteor.save\n format.html { redirect_to @dteor, notice: t(:created) }\n format.json { render json: @dteor, status: :created, location: @dteor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dteor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c12462fae2ffa06dbde700f23b82eb51",
"score": "0.52387637",
"text": "def add_tenant_to_specified_shard(args = {}) \n post(\"/tenants.json/shard/#{args[:shardId]}\", args)\nend",
"title": ""
},
{
"docid": "4725e14848f6ffba1a331fc091057521",
"score": "0.52325046",
"text": "def post\n Typhoeus.post(@url,\n body: @results_hash.to_json,\n headers: { 'Content-Type' => 'application/json' })\n end",
"title": ""
},
{
"docid": "7f3b0d9ba073a0c642ede2aabc0ddc95",
"score": "0.5232196",
"text": "def create\n @distrito_origen = DistritoOrigen.new(distrito_origen_params)\n\n respond_to do |format|\n if @distrito_origen.save\n format.html { redirect_to @distrito_origen, notice: 'Distrito origen was successfully created.' }\n format.json { render :show, status: :created, location: @distrito_origen }\n else\n format.html { render :new }\n format.json { render json: @distrito_origen.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cdc2524e83c3376b67608df802428138",
"score": "0.5224682",
"text": "def create\n @dress = Dress.new(params[:dress])\n\n respond_to do |format|\n if @dress.save\n format.html { redirect_to @dress, notice: 'Dress was successfully created.' }\n format.json { render json: @dress, status: :created, location: @dress }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dress.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5df7d6b3019d76b25828496db980cf21",
"score": "0.5223035",
"text": "def create\n @therapist = Therapist.new(therapist_params)\n @therapist.user_id = current_user.id\n @therapist.specialty_ids = params[:therapist][:specialty_ids]\n\n respond_to do |format|\n if @therapist.save\n format.html { redirect_to root_path, notice: \"Therapist was successfully created.\" }\n else\n format.html { render :new }\n end\n end\n end",
"title": ""
},
{
"docid": "2b0fc08a93d0e12158503531131c9a45",
"score": "0.5218941",
"text": "def create\n @dress = Dress.new(params[:dress])\n\n respond_to do |format|\n if @dress.save\n format.html { redirect_to @dress, notice: 'Vestido criado com sucesso.' }\n format.json { render json: @dress, status: :created, location: @dress }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dress.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "479a2cd43ca8d89086b80bf4186db948",
"score": "0.5216363",
"text": "def create\n @denomination = Denomination.new(params[:denomination])\n\n respond_to do |format|\n if @denomination.save\n format.html { redirect_to @denomination, notice: 'Denomination was successfully created.' }\n format.json { render json: @denomination, status: :created, location: @denomination }\n else\n format.html { render action: \"new\" }\n format.json { render json: @denomination.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0980a19a5d51c5a90c546618c45be553",
"score": "0.52073693",
"text": "def create\n # @route = Route.new(params[:route])\n \n waypoints = params[:waypoints]\n creator = params[:creator]\n updated_at = params[:updated_at]\n name = params[:name]\n\n @route = Route.new(waypoints: waypoints, creator: creator, updated_at: updated_at, name: name)\n \n @route.save\n\n render json: @route\n\n # @vote_creator = VoteCreator.new(vote_params)\n # @vote = @vote_creator.vote\n # if @vote_creator.save\n # render json: @vote, status: :created, location: @vote\n # else\n # render json: @vote.errors, status: :unprocessable_entity\n # end\n end",
"title": ""
},
{
"docid": "06590d280105ccb292a553bee700ac60",
"score": "0.52002",
"text": "def create\n @hot_water_distribution = HotWaterDistribution.new(params[:hot_water_distribution])\n\n respond_to do |format|\n if @hot_water_distribution.save\n format.html { redirect_to @hot_water_distribution, notice: 'Hot water distribution was successfully created.' }\n format.json { render json: @hot_water_distribution, status: :created, location: @hot_water_distribution }\n else\n format.html { render action: \"new\" }\n format.json { render json: @hot_water_distribution.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc71a17d5a63135f60a80de63f10cfb7",
"score": "0.5179217",
"text": "def create\n @duer = Duer.new(duer_params)\n\n respond_to do |format|\n if @duer.save\n format.html { redirect_to @duer, notice: 'Duer was successfully created.' }\n format.json { render :show, status: :created, location: @duer }\n else\n format.html { render :new }\n format.json { render json: @duer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dcde48b222ae15d53553f74cd918af4a",
"score": "0.5174132",
"text": "def create\n @docter = Docter.new(docter_params)\n\n respond_to do |format|\n if @docter.save\n format.html { redirect_to @docter, notice: \"Docter was successfully created.\" }\n format.json { render :show, status: :created, location: @docter }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @docter.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c3a975e7f0060a2aec3c8950aca4864",
"score": "0.51725316",
"text": "def create\n @dater = Dater.new(dater_params)\n\n respond_to do |format|\n if @dater.save\n format.html { redirect_to @dater, notice: 'Dater was successfully created.' }\n format.json { render :show, status: :created, location: @dater }\n else\n format.html { render :new }\n format.json { render json: @dater.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d0ef15b4ae9b863026fed3c5ee7d165a",
"score": "0.5172369",
"text": "def post operation, data={}\n body = case data\n when String\n body = data\n else\n Yajl::Encoder.encode(data)\n end\n\n request = new_request operation, body\n request.sign sts\n hydra.queue request\n hydra.run\n response = request.response\n puts response.inspect if @debug\n\n if response.code == 200\n Yajl::Parser.parse response.body\n else\n raise_error response\n end\n end",
"title": ""
},
{
"docid": "8cfdfff9557880c5f8e73572a3c13aae",
"score": "0.51708376",
"text": "def create\n @daw_representante = DawRepresentante.new(daw_representante_params)\n\n respond_to do |format|\n if @daw_representante.save\n format.html { redirect_to @daw_representante, notice: 'Daw representante was successfully created.' }\n format.json { render :show, status: :created, location: @daw_representante }\n else\n format.html { render :new }\n format.json { render json: @daw_representante.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5dcd926611db3c4b3b042d7b0468e0e6",
"score": "0.516395",
"text": "def create\n @tree = Tree.new(params[:tree])\n @tree.synclatlon\n respond_to do |format|\n if @tree.save\n format.html { redirect_to @tree, notice: 'Tree was successfully created.' }\n format.json { render json: @tree, status: :created, location: @tree }\n else\n format.html { render 'new' }\n format.json { render json: @tree.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7fbb88d1de5dc8b26383ef3d52b7ed14",
"score": "0.51622903",
"text": "def create\n @tipo_distribucion = TipoDistribucion.new(tipo_distribucion_params)\n\n respond_to do |format|\n if @tipo_distribucion.save\n format.html { redirect_to @tipo_distribucion, notice: 'Tipo distribucion was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tipo_distribucion }\n else\n format.html { render action: 'new' }\n format.json { render json: @tipo_distribucion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a2304a4bd8954b29cd9f92c8a94bdc40",
"score": "0.5162168",
"text": "def set_distbutor\n @distbutor = Distbutor.find(params[:id])\n end",
"title": ""
},
{
"docid": "c611a8a58edb70af265ae20dc65ffc81",
"score": "0.5159773",
"text": "def create\n @denomination = Denomination.new(denomination_params)\n\n respond_to do |format|\n if @denomination.save\n format.html { redirect_to @denomination, notice: 'Denomination was successfully created.' }\n format.json { render :show, status: :created, location: @denomination }\n else\n format.html { render :new }\n format.json { render json: @denomination.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "878ce5b0f6cd25519b9fef4532581489",
"score": "0.5133728",
"text": "def create\n @dna = Dna.new(dna_params)\n\n if @dna.save\n render json: @dna, status: :created, location: @dna\n else\n render json: @dna.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c0b5a784e3773387fdf8ccedcbdbf835",
"score": "0.51299775",
"text": "def create\n @distribuitor = Distribuitor.new(distribuitor_params)\n\n respond_to do |format|\n if @distribuitor.save\n format.html { redirect_to @distribuitor, notice: 'Distribuitor was successfully created.' }\n format.json { render :show, status: :created, location: @distribuitor }\n else\n format.html { render :new }\n format.json { render json: @distribuitor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a2da68838c65fff5c0a875a9d2f47997",
"score": "0.5129499",
"text": "def new\n @distraction = Distraction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @distraction }\n end\n end",
"title": ""
},
{
"docid": "9c6e06befa0102178692c385363fe014",
"score": "0.51266843",
"text": "def create\n res = self.class.post('/', body: attrs)\n res.created?\n end",
"title": ""
},
{
"docid": "04fcda5fdf2d67b2f25ea0c79013dc2d",
"score": "0.5126463",
"text": "def create\n @orden = Orden.new(params[:orden])\n\n respond_to do |format|\n if @orden.save\n format.html { redirect_to @orden, notice: 'Orden was successfully created.' }\n format.json { render json: @orden, status: :created, location: @orden }\n else\n format.html { render action: \"new\" }\n format.json { render json: @orden.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "223cde455faacd2a7a556f079ffc6a33",
"score": "0.5125011",
"text": "def post(*args)\n prepare_request(:post, args)\n @@client.add(:post, @path, *args)\n end",
"title": ""
},
{
"docid": "bb4625bc63c29a816aee1e04665213f7",
"score": "0.5123077",
"text": "def create\n @trnodo = Trnodo.new(params[:trnodo])\n\n respond_to do |format|\n if @trnodo.save\n format.html { redirect_to @trnodo, notice: 'Trnodo was successfully created.' }\n format.json { render json: @trnodo, status: :created, location: @trnodo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trnodo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bc1801b1fe16c80f1b13ecc248131ae",
"score": "0.5121458",
"text": "def create\n @district = District.new(district_params)\n\n respond_to do |format|\n if @district.save\n format.html { redirect_to @district, notice: 'District was successfully created.' }\n format.json { render :show, status: :created, location: @district }\n else\n format.html { render :new }\n format.json { render json: @district.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bc1801b1fe16c80f1b13ecc248131ae",
"score": "0.5121458",
"text": "def create\n @district = District.new(district_params)\n\n respond_to do |format|\n if @district.save\n format.html { redirect_to @district, notice: 'District was successfully created.' }\n format.json { render :show, status: :created, location: @district }\n else\n format.html { render :new }\n format.json { render json: @district.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "391e8ea0fab53515e6ee0b9e624c721d",
"score": "0.51176214",
"text": "def create\n dive = Dive.new(dive_params)\n if dive.save\n render json: dive\n else\n render json: {message: dive.errors}, status: 400\n end\n end",
"title": ""
},
{
"docid": "cdaf848daa4d00c8cb7a80728abcf53d",
"score": "0.51124614",
"text": "def create\n @dinosaur = Dinosaur.new(params[:dinosaur])\n\n respond_to do |format|\n if @dinosaur.save\n format.html { redirect_to @dinosaur, notice: 'Dinosaur was successfully created.' }\n format.json { render json: @dinosaur, status: :created, location: @dinosaur }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dinosaur.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9b013812ed1b2e69acfe668c1b6d0a27",
"score": "0.51100236",
"text": "def create\n @dinosaur = Dinosaur.new(dinosaur_params)\n\n respond_to do |format|\n if @dinosaur.save\n format.html { redirect_to @dinosaur, notice: \"Dinosaur was successfully created.\" }\n format.json { render :show, status: :created, location: @dinosaur }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @dinosaur.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "58222157a274444e756fe4a0bad42166",
"score": "0.5101661",
"text": "def create\n @vendedor = Vendedor.new(vendedor_params)\n\n respond_to do |format|\n if @vendedor.save\n format.html { redirect_to @vendedor, notice: t('.sucesso') }\n format.json { render :show, status: :created, location: @vendedor }\n else\n format.html { render :new }\n format.json { render json: @vendedor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b59b1401ce0bc0cb75dc1677e9f22f0e",
"score": "0.51011044",
"text": "def distribution_params\n params.require(:distribution).permit(:name)\n end",
"title": ""
},
{
"docid": "ddc96d65d095c40a8a9866dbcc5f5a39",
"score": "0.5098743",
"text": "def create\n @ordinateur = Ordinateur.new(ordinateur_params)\n\n respond_to do |format|\n if @ordinateur.save\n format.html { redirect_to @ordinateur, notice: 'Ordinateur was successfully created.' }\n format.json { render :show, status: :created, location: @ordinateur }\n else\n format.html { render :new }\n format.json { render json: @ordinateur.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4bd072b46dde00db39e211eafe8b0cd0",
"score": "0.5097471",
"text": "def create\n @admins_district = Admins::District.new(admins_district_params)\n\n respond_to do |format|\n if @admins_district.save\n format.html { redirect_to @admins_district, notice: 'District was successfully created.' }\n format.json { render :show, status: :created, location: @admins_district }\n else\n format.html { render :new }\n format.json { render json: @admins_district.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64622fe5a0f18a4c5be4314e86db5b3c",
"score": "0.5096036",
"text": "def create\n TargetsForm.new(target_params).save\n\n respond_to do |format|\n format.html { redirect_to after_write_path, notice: 'Targets were successfully created.' }\n format.json { render :show, status: :created, location: @target }\n end\n end",
"title": ""
},
{
"docid": "dae9185673bc1b77795a55f5dde33584",
"score": "0.5092425",
"text": "def create\n @department = Department.find(params[:department_id])\n @town = @department.towns.new(town_params)\n respond_to do |format|\n if @town.save\n format.json { render json: @town, status: :ok }\n else\n format.json { render json: @town.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0b5f5cb20e63a21915fe3d2b9e7c2679",
"score": "0.50911075",
"text": "def create\n @persons_release = PersonsRelease.new(params[:persons_release])\n\n respond_to do |format|\n if @persons_release.save\n format.html { redirect_to @persons_release, notice: 'Persons release was successfully created.' }\n format.json { render json: @persons_release, status: :created, location: @persons_release }\n else\n format.html { render action: \"new\" }\n format.json { render json: @persons_release.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1da7a9b05d571095c375f507b69d2a89",
"score": "0.5083511",
"text": "def create\n @cognitive_distortion = CognitiveDistortion.new(cognitive_distortion_params)\n\n respond_to do |format|\n if @cognitive_distortion.save\n format.html { redirect_to @cognitive_distortion, notice: 'Cognitive distortion was successfully created.' }\n format.json { render :show, status: :created, location: @cognitive_distortion }\n else\n format.html { render :new }\n format.json { render json: @cognitive_distortion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ecfd7032115baf532d585bcce3aa0014",
"score": "0.5079531",
"text": "def create\n @dino = Dino.new(dino_params)\n\n respond_to do |format|\n if @dino.save\n format.html { redirect_to @dino, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @dino }\n else\n format.html { render :new }\n format.json{ render json: @dino.errors, status: :unprocessable_entity }\n end\n end\nend",
"title": ""
},
{
"docid": "b639c49258c902c2226dd0aba0a0e091",
"score": "0.5067846",
"text": "def create\n @derp = Derp.new(derp_params)\n\n respond_to do |format|\n if @derp.save\n format.html { redirect_to @derp, notice: 'Derp was successfully created.' }\n format.json { render :show, status: :created, location: @derp }\n else\n format.html { render :new }\n format.json { render json: @derp.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f2167fb6a8c594755f8875c48a07349d",
"score": "0.5067683",
"text": "def create\n @calendar = Calendar.new(params[:calendar])\n @calendar.update_attribute :user_id, current_user.id\n\n params[:doors].each_value do |door|\n @calendar.doors.build(door)\n end\n\n respond_to do |format|\n if @calendar.save\n format.html { redirect_to @calendar, notice: 'Calendar was successfully created.' }\n format.json { render json: @calendar, status: :created, location: @calendar }\n else\n format.html { render action: \"new\" }\n format.json { render json: @calendar.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2b5cc1716b1800118eea17d3772b4b21",
"score": "0.50658625",
"text": "def create\n @electoral_district = ElectoralDistrict.new(params[:electoral_district])\n\n respond_to do |format|\n if @electoral_district.save\n format.html { redirect_to @electoral_district, notice: 'Electoral district was successfully created.' }\n format.json { render json: @electoral_district, status: :created, location: @electoral_district }\n else\n format.html { render action: \"new\" }\n format.json { render json: @electoral_district.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77d5dc7ab8cda9cdbfd73b8d6471a6a7",
"score": "0.5063755",
"text": "def create\n @ref_sanatorium = Ref::Sanatorium.new(params[:ref_sanatorium])\n\n respond_to do |format|\n if @ref_sanatorium.save\n format.html { redirect_to ref_sanatoria_path, notice: I18n.t(:record_created) }\n format.json { render json: @ref_sanatorium, status: :created, location: @ref_sanatorium }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ref_sanatorium.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4c1473adf73c584f2187d8137860d167",
"score": "0.50637114",
"text": "def create\n @destination = @organism.destinations.new(params[:destination])\n\n respond_to do |format|\n if @destination.save\n format.html { redirect_to admin_organism_destinations_path(@organism),\n notice: \"L'activité #{@destination.name} a été créée.\" }\n \n format.json { render json: @destination, status: :created, location: @destination }\n else\n format.html { render action: \"new\" }\n format.json { render json: @destination.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5b0cffa8b1b7caff27634132f6a0a995",
"score": "0.5063006",
"text": "def create\n @trein_coord_pedag = TreinCoordPedag.new(trein_coord_pedag_params)\n\n respond_to do |format|\n if @trein_coord_pedag.save\n format.html { redirect_to @trein_coord_pedag, notice: 'Trein coord pedag was successfully created.' }\n format.json { render action: 'show', status: :created, location: @trein_coord_pedag }\n else\n format.html { render action: 'new' }\n format.json { render json: @trein_coord_pedag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eeb2ae589ec17723b0e4ec6bfb7c71d2",
"score": "0.5062517",
"text": "def create\n @track_dress = TrackDress.new(params[:track_dress])\n\n respond_to do |format|\n if @track_dress.save\n format.html { redirect_to @track_dress, notice: 'Track dress was successfully created.' }\n format.json { render json: @track_dress, status: :created, location: @track_dress }\n else\n format.html { render action: \"new\" }\n format.json { render json: @track_dress.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f7fa8185d29514e57684cee067912283",
"score": "0.5062234",
"text": "def create\n @dinosaur = Dinosaur.new(dinosaur_params)\n\n respond_to do |format|\n if @dinosaur.save\n format.html { redirect_to @dinosaur, notice: 'Dinosaur was successfully created.' }\n format.json { render :show, status: :created, location: @dinosaur }\n else\n format.html { render :new }\n format.json { render json: @dinosaur.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "45dfeab99155fb70edc0c1551cf0f488",
"score": "0.5061561",
"text": "def create\n @derpu = Derpu.new(params[:derpu])\n\n respond_to do |format|\n if @derpu.save\n format.html { redirect_to @derpu, notice: 'Derpu was successfully created.' }\n format.json { render json: @derpu, status: :created, location: @derpu }\n else\n format.html { render action: \"new\" }\n format.json { render json: @derpu.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "89fd3c3eed1cbd52cc2bbbdbb5829ea1",
"score": "0.5048598",
"text": "def create\n @door_tag = DoorTag.new(door_tag_params)\n\n respond_to do |format|\n if @door_tag.save\n format.html { redirect_to @door_tag, notice: 'Door tag was successfully created.' }\n format.json { render :show, status: :created, location: @door_tag }\n else\n format.html { render :new }\n format.json { render json: @door_tag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0962039645fba192bc9f2348f47798fb",
"score": "0.50451535",
"text": "def post(*args)\n request(:post, *args)\n end",
"title": ""
},
{
"docid": "14fd4f9bcfe5a872402101afd1f754a4",
"score": "0.50401825",
"text": "def create\n @tour = Tour.find(params[:tour_id])\n @attraction_tour = AttractionTour.new(params[:attraction_tour])\n\n respond_to do |format|\n if @attraction_tour.save\n format.html { redirect_to @tour, notice: 'Attraction tour was successfully created.' }\n # format.json { render json: @attraction_tour, status: :created, location: @attraction_tour }\n else\n # format.html { render action: \"new\" }\n # format.json { render json: @attraction_tour.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4d7a3c401babe71fdd07129894c6ba2",
"score": "0.5039056",
"text": "def create\n @direcciont = Direcciont.new(direcciont_params)\n\n respond_to do |format|\n if @direcciont.save\n format.html { redirect_to @direcciont, notice: 'Direcciont was successfully created.' }\n format.json { render :show, status: :created, location: @direcciont }\n else\n format.html { render :new }\n format.json { render json: @direcciont.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06e80aef2a1efdc93595329df72ea208",
"score": "0.5038426",
"text": "def index\n @distbutors = Distbutor.page(params[:page])\n end",
"title": ""
},
{
"docid": "4b9fae50ac2cd30efa36ef128591e56c",
"score": "0.5029812",
"text": "def create\n init = params[:distrik][:name][0]\n distributor = Distributor.find_by_name(params[:distributor_id])\n distrik_number = Distrik.create_number(params)\n @distrik = Distrik.new(distrik_params.merge(:distributor_id => (distributor.id rescue nil)))\n if @distrik.save\n flash[:notice] = t(:successfully_created)\n redirect_to distriks_path\n else\n flash[:error] = @distrik.errors.full_messages.join('<br/>')\n render \"new\"\n end\n end",
"title": ""
},
{
"docid": "47855270daa893928c1e8d74f15d2f78",
"score": "0.502857",
"text": "def create\n # @cord = Cord.new(cord_params)\n @cord = @racquet.cords.new(cord_params)\n @cord.user = current_user\n respond_to do |format|\n if @cord.save\n format.html { redirect_to @cord, notice: t('cords.create.success') }\n format.json { render :show, status: :created, location: @cord }\n else\n format.html { render :new }\n format.json { render json: @cord.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e3ea259b63999fd83c7d0cd6f0b01755",
"score": "0.5028405",
"text": "def create\n @fornecedor = Fornecedor.new(fornecedor_params)\n\n respond_to do |format|\n if @fornecedor.save\n format.html { redirect_to @fornecedor, notice: 'Fornecedor was successfully created.' }\n format.json { render :show, status: :created, location: @fornecedor }\n else\n format.html { render :new }\n format.json { render json: @fornecedor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "afd2dad878db0d26797e5906ea5addcc",
"score": "0.50280416",
"text": "def create\n @dor_master = DorMaster.new(dor_master_params)\n\n respond_to do |format|\n if @dor_master.save\n format.html { redirect_to @dor_master, notice: 'Dor master was successfully created.' }\n format.json { render :show, status: :created, location: @dor_master }\n else\n format.html { render :new }\n format.json { render json: @dor_master.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2a31851a8ad46dc998087cebe519ba62",
"score": "0.50170434",
"text": "def create\n @realtor = Realtor.new(realtor_params)\n\n respond_to do |format|\n if @realtor.save\n format.html { redirect_to @realtor, notice: 'Realtor was successfully created.' }\n format.json { render :show, status: :created, location: @realtor }\n else\n format.html { render :new }\n format.json { render json: @realtor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa82ceaece4faa208901b72ed9490e72",
"score": "0.50162715",
"text": "def create\n @orden = Orden.new(orden_params)\n\t\tset_options_for_selects(@vendedor)\n\n respond_to do |format|\n if current_user.tiene_permiso_sobre?(@orden) && @orden.save\n format.html { redirect_to @orden, notice: 'La orden se creó exitosamente.' }\n format.json { render :show, status: :created, location: @orden }\n else\n format.html { render :new }\n format.json { render json: @orden.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "50d865b94c52890f1b0abd296ef14f9e",
"score": "0.50106215",
"text": "def create(*args)\n post(*args)\n end",
"title": ""
},
{
"docid": "50d865b94c52890f1b0abd296ef14f9e",
"score": "0.50106215",
"text": "def create(*args)\n post(*args)\n end",
"title": ""
},
{
"docid": "fdecb77e3b4af059bb37d0a164d4826d",
"score": "0.50089955",
"text": "def create\n @dino = Dino.new(dino_params)\n\n if @dino.save\n render json: @dino, status: :created, location: @dino\n else\n render json: @dino.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c4885ea84be40ec9bcee69b9d1269368",
"score": "0.49983227",
"text": "def create\n @uder = Uder.new(uder_params)\n\n respond_to do |format|\n if @uder.save\n format.html { redirect_to @uder, notice: 'Uder was successfully created.' }\n format.json { render action: 'show', status: :created, location: @uder }\n else\n format.html { render action: 'new' }\n format.json { render json: @uder.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "72f46551e420a471f09d53f0740d5495",
"score": "0.49963295",
"text": "def create\n @scrapping_datum = ScrappingDatum.new(scrapping_datum_params)\n\n respond_to do |format|\n if @scrapping_datum.save\n format.html { redirect_to @scrapping_datum, notice: 'Scrapping datum was successfully created.' }\n format.json { render :show, status: :created, location: @scrapping_datum }\n else\n format.html { render :new }\n format.json { render json: @scrapping_datum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ac09d1821747987355ea3903be4a25f5",
"score": "0.49943298",
"text": "def create\n @account_balance_distribution = AccountBalanceDistribution.new(account_balance_distribution_params)\n\n respond_to do |format|\n if @account_balance_distribution.save\n format.html { redirect_to @account_balance_distribution, notice: 'Account balance distribution was successfully created.' }\n format.json { render :show, status: :created, location: @account_balance_distribution }\n else\n format.html { render :new }\n format.json { render json: @account_balance_distribution.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a313ffecfa5e1cd00ba477cb5525079",
"score": "0.49917698",
"text": "def create\n @trash_wheel = TrashWheel.new(trash_wheel_params)\n\n respond_to do |format|\n if @trash_wheel.save\n format.html { redirect_to @trash_wheel, notice: 'Trash wheel was successfully created.' }\n format.json { render :show, status: :created, location: @trash_wheel }\n else\n format.html { render :new }\n format.json { render json: @trash_wheel.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4e33701cdafddc8dcd3869f026c7fa31",
"score": "0.4990709",
"text": "def create\n @denuncia_tipo = DenunciaTipo.new(params[:denuncia_tipo])\n\n respond_to do |format|\n if @denuncia_tipo.save\n format.html { redirect_to @denuncia_tipo, notice: 'Denuncia tipo was successfully created.' }\n format.json { render json: @denuncia_tipo, status: :created, location: @denuncia_tipo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @denuncia_tipo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a3619ee514ed3b5753cb0dbec9ffdb0",
"score": "0.49874306",
"text": "def create\n @dolgnost = Dolgnost.new(params[:dolgnost])\n\n respond_to do |format|\n if @dolgnost.save\n format.html { redirect_to @dolgnost, notice: 'Dolgnost was successfully created.' }\n format.json { render json: @dolgnost, status: :created, location: @dolgnost }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dolgnost.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6d0e4e8c594b2e1646bd4d998bcb9ef7",
"score": "0.4987331",
"text": "def create\n @donante = Donante.new(donante_params)\n\n respond_to do |format|\n if @donante.save\n format.html { redirect_to @donante, notice: 'Donante was successfully created.' }\n format.json { render action: 'show', status: :created, location: @donante }\n else\n format.html { render action: 'new' }\n format.json { render json: @donante.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e6e0b617fa26ee568dc12855ae4d61be",
"score": "0.49831742",
"text": "def create\n @distortion_pattern = DistortionPattern.new(distortion_pattern_params)\n\n respond_to do |format|\n if @distortion_pattern.save\n format.html { redirect_to @distortion_pattern, notice: 'Distortion pattern was successfully created.' }\n format.json { render :show, status: :created, location: @distortion_pattern }\n else\n format.html { render :new }\n format.json { render json: @distortion_pattern.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0848a785d25d6e58f0961cd92ff6c43f",
"score": "0.49785528",
"text": "def create\n @therapist = Therapist.new(therapist_params.merge({code: create_code}))\n if @therapist.save\n render :json => {\n id: @therapist.id,\n email: @therapist.email,\n firstName: @therapist.first_name,\n lastName: @therapist.last_name,\n prefix: @therapist.prefix,\n profession: @therapist.profession,\n code: @therapist.code,\n token: get_token(@therapist)\n }\n else\n render json: @therapist.errors, status: :unprocessable_entity\n # render json: @therapist.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "b844674b36965cd0570b9f018492c639",
"score": "0.49766102",
"text": "def create\n\n # process the dob\n params[:actor][:dob] = DateSelectHelper.to_datetime(params[:selected_date])\n\n @actor = Actor.new(params[:actor])\n\n # check for new dvds\n @dvd_ids = params[:dvds] ? params[:dvds][\"ids\"] : nil\n if @dvd_ids\n @dvd_ids.shift\n @actor.dvds << Dvd.find(@dvd_ids)\n end\n\n respond_to do |format|\n if @actor.save\n format.html { redirect_to @actor, notice: 'Actor was successfully created.' }\n format.json { render json: @actor, status: :created, location: @actor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @actor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "18fc76c40b67abca0f6c794e6d583787",
"score": "0.49749509",
"text": "def create\n @dn = Dn.new(dn_params)\n\n respond_to do |format|\n if @dn.save\n format.html { redirect_to @dn, notice: 'Dn was successfully created.' }\n format.json { render :show, status: :created, location: @dn }\n else\n format.html { render :new }\n format.json { render json: @dn.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4a19d86083a41283e12f8db5234f024e",
"score": "0.49742284",
"text": "def destroy\n @distbutor.included_countries.destroy_all\n @distbutor.included_states.destroy_all\n @distbutor.included_cities.destroy_all\n @distbutor.excluded_states.destroy_all\n @distbutor.excluded_cities.destroy_all\n @distbutor.destroy\n respond_to do |format|\n format.html { redirect_to distbutors_url, notice: 'Distbutor was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "17e8fe85a18960defd1e0986db27d312",
"score": "0.4973011",
"text": "def create\n @verb = Verb.new(verb_params)\n\n if @verb.save\n render json: @verb, status: :created, location: @verb\n else\n render json: @verb.errors, status: :unprocessable_entity\n end\n end",
"title": ""
}
] |
94f1bd7dfc792b6291c8572ebf3711e2
|
PUT /when_customs/1 PUT /when_customs/1.xml
|
[
{
"docid": "20b32d87fb13ad87eb366ac9927700bf",
"score": "0.6847393",
"text": "def update\n @when_custom = WhenCustom.find(params[:id])\n\n respond_to do |format|\n if @when_custom.update_attributes(params[:when_custom])\n format.html { redirect_to(@when_custom, :notice => 'WhenCustom was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @when_custom.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "d97aa146e297bf37931b504af91b246b",
"score": "0.59091234",
"text": "def update\n @custom_event = CustomEvent.find(params[:id])\n\n respond_to do |format|\n if @custom_event.update_attributes(params[:custom_event])\n format.html { redirect_to(@custom_event, :notice => 'Custom event was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @custom_event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "87046a2dc063507b72a76e485119ebc0",
"score": "0.58808476",
"text": "def update\n @custom = Custom.find(params[:id])\n\n if @custom.update_attributes(params[:custom])\n response_message = {:message => \"Label for custom field updated successfully\", :custom => @custom}\n else\n response_message = {:message => \"Label updation failed. Please try again!\"}\n end\n\n respond_to do |format|\n format.xml { render :xml => response_message }\n format.json { render :json => response_message }\n end\n end",
"title": ""
},
{
"docid": "9ddf960eb3f437e62b9b99d34992bc0f",
"score": "0.5848155",
"text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :api_key => 'testapikey',\r\n :status_post => {:body => 'API Status Post 1' }\r\n assert_response :success\r\n end",
"title": ""
},
{
"docid": "cb3be4473d829b077ce292bd1834caec",
"score": "0.581075",
"text": "def update\n @action_custom = ActionCustom.find(params[:id])\n\n respond_to do |format|\n if @action_custom.update_attributes(params[:action_custom])\n format.html { redirect_to(@action_custom, :notice => 'ActionCustom was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @action_custom.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d61a25d69ed10b03601d4f17ba7d9ef3",
"score": "0.5810427",
"text": "def update\n #RAILS_DEFAULT_LOGGER.debug(\"******** REST Call to CRMS: Updating #{self.class.name}:#{self.id}\")\n #RAILS_DEFAULT_LOGGER.debug(caller[0..5].join(\"\\n\")) \n response = connection.put(element_path(prefix_options), to_xml, self.class.headers)\n save_nested\n load_attributes_from_response(response)\n merge_saved_nested_resources_into_attributes\n response\n end",
"title": ""
},
{
"docid": "23b5f5e4dacfb330cb1e0ffd4590ef63",
"score": "0.58017623",
"text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post opts.fetch(:path, update_path), opts\n end",
"title": ""
},
{
"docid": "6fd8842ed08fa1572950f3e78514aecf",
"score": "0.5776524",
"text": "def do_PUT(req, res)\n domain, resource, id, format = parse_request_path(req.path_info)\n attributes = from_xml(resource, req.body)\n attributes['updated-at'] = Time.now.iso8601\n logger.debug \"Updating item with attributes: #{attributes.inspect}\"\n sdb_put_item(domain, attributes, true)\n raise WEBrick::HTTPStatus::OK\n end",
"title": ""
},
{
"docid": "99d24a74bc96db3bd84b0451ef3afb5f",
"score": "0.57324284",
"text": "def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end",
"title": ""
},
{
"docid": "2a883e27d7c2ac9dc7142cf4483f6815",
"score": "0.5721795",
"text": "def _update(type, current_name, metadata={})\n type = type.to_s.camelize\n request :update do |soap|\n soap.body = {\n :metadata => {\n :current_name => current_name,\n :metadata => prepare(metadata),\n :attributes! => { :metadata => { 'xsi:type' => \"ins0:#{type}\" } }\n }\n }\n end\n end",
"title": ""
},
{
"docid": "ad54471b285e5e357d9be959c8ade2d8",
"score": "0.57010233",
"text": "def update\n path = \"/workflow/#{repo}/objects/druid:#{druid}/workflows/#{workflow}/#{step}\"\n conn = Faraday.new(url: config['host'])\n conn.basic_auth(config['user'], config['password'])\n conn.headers['content-type'] = 'application/xml'\n\n conn.put path, payload\n end",
"title": ""
},
{
"docid": "ebf49d78135761b000c449f5c4ca3ae1",
"score": "0.5700744",
"text": "def create\n @when_custom = WhenCustom.new(params[:when_custom])\n\n respond_to do |format|\n if @when_custom.save\n format.html { redirect_to(@when_custom, :notice => 'WhenCustom was successfully created.') }\n format.xml { render :xml => @when_custom, :status => :created, :location => @when_custom }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @when_custom.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "38979984bdedacd95706689e25f09f9e",
"score": "0.5657886",
"text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end",
"title": ""
},
{
"docid": "96c2c4ca74afa5a26914fb582062f271",
"score": "0.55886835",
"text": "def test_should_update_event_via_API_XML\r\n get \"/logout\"\r\n put \"/events/1.xml\", :event => {:name => 'Test API Event 1',\r\n :start_time => Time.now.to_s(:db),\r\n :end_time => Time.now.to_s(:db),\r\n :user_id => 1,\r\n :description => 'Test API Event 1 Desc',\r\n :event_type => 'API Type',\r\n :location => 'Testville, USA',\r\n :street => 'Testers Rd.',\r\n :city => 'TestTown',\r\n :website => 'http://www.test.com',\r\n :phone => '555-555-5555',\r\n :organized_by => 'API Testers of America'}\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "238fd956be713471aa406c76bf19254a",
"score": "0.554135",
"text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :status_post => {:body => 'API Status Post 1' }\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "428897e203fb830fe1b47a9a7969c8e6",
"score": "0.5519851",
"text": "def update(xml_rpc_appointment)\n appointment = Appointment.find(xml_rpc_appointment[\"uuid\"])\n appointment.header = xml_rpc_appointment[\"header\"]\n appointment.start_at = xml_rpc_appointment[\"start_at\"]\n appointment.duration_in_minutes = xml_rpc_appointment[\"duration_in_minutes\"]\n appointment.comment = xml_rpc_appointment[\"comment\"]\n\n appointment.save\n end",
"title": ""
},
{
"docid": "d24573c3412f155e56aac789e9d2b190",
"score": "0.5513295",
"text": "def update\n @custom = Custom.find(params[:id])\n\n respond_to do |format|\n if @custom.update_attributes(params[:custom])\n format.html { redirect_to @custom, notice: 'Custom was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @custom.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5aec41d527985b1cfc8aca1810efde72",
"score": "0.5474901",
"text": "def update\n @custom_object = Salesforce::CustomObject.find(params[:id])\n\n respond_to do |format|\n if @custom_object.update_attributes(params[:custom_object])\n format.html { redirect_to(@custom_object, :notice => 'Salesforce::CustomObject was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @custom_object.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9befce453483ca4920c8f1c62a831a6c",
"score": "0.54556185",
"text": "def update!\n !! api_request(:put, \"/subscribers/#{self.customer_id}.xml\", :body => self.to_xml(:exclude => [:customer_id]))\n end",
"title": ""
},
{
"docid": "76947a495f8371e8e772fdb40663d3b8",
"score": "0.5410706",
"text": "def update_report_template(args = {}) \n put(\"/reports.json/template/#{args[:templateId]}\", args)\nend",
"title": ""
},
{
"docid": "dfbcbe2b5b9ccf755a1daacc361132b0",
"score": "0.5346173",
"text": "def update_custom_xml_part(request)\n begin\n data, _status_code, _headers = update_custom_xml_part_with_http_info(request)\n rescue ApiError => e\n if e.code == 401\n request_token\n data, _status_code, _headers = update_custom_xml_part_with_http_info(request)\n else\n raise\n end\n end\n data\n end",
"title": ""
},
{
"docid": "c99238efa98a6e05678c5d303dd5515d",
"score": "0.5313575",
"text": "def update_ticket(ticket_num)\n \n url = ['/tickets/',ticket_num,'.xml'].join\n result = @connection.put url, \n (\n xml = Builder::XmlMarkup.new( :indent => 2 )\n xml.instruct! :xml, :encoding => \"UTF-8\"\n xml.ticket do |t|\n t.tag! \"solved-at\", Time.now\n t.tag! \"status-id\", \"3\"\n end\n )\n end",
"title": ""
},
{
"docid": "07b3335163f1f7915e95f588eee023ad",
"score": "0.52355796",
"text": "def update\n @custom_object_c = Salesforce::CustomObject_c.find(params[:id])\n\n respond_to do |format|\n if @custom_object_c.update_attributes(params[:custom_object_c])\n format.html { redirect_to(@custom_object_c, :notice => 'Salesforce::CustomObject_c was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @custom_object_c.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f6018bfebe02fd19d8e4c850bb2ef58f",
"score": "0.5219878",
"text": "def test_changeset_update_invalid\n basic_authorization create(:user).email, \"test\"\n\n changeset = create(:changeset)\n new_changeset = changeset.to_xml\n new_tag = XML::Node.new \"tag\"\n new_tag[\"k\"] = \"testing\"\n new_tag[\"v\"] = \"testing\"\n new_changeset.find(\"//osm/changeset\").first << new_tag\n\n content new_changeset\n put :update, :params => { :id => changeset.id }\n assert_response :conflict\n end",
"title": ""
},
{
"docid": "56b9e9d8ce0852a1595003cb6f628faa",
"score": "0.5211169",
"text": "def update\n @client.soap_client.call(:update, message: \"<Entity xsi:type=\\\"#{self.class.to_s.demodulize}\\\">#{fields_to_xml}</Entity>\")\n end",
"title": ""
},
{
"docid": "8a88b5766fd34d1c68d639ce7a2e2a40",
"score": "0.51768863",
"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": "167e99552d3d49c777b94d6ddf7b5727",
"score": "0.51693505",
"text": "def test_create_file_modified\n request = Http::Sapi.create_from_server_array(\n 'REQUEST_METHOD' => 'PUT',\n 'PATH_INFO' => '/calendars/admin/calendar1/blabla.ics'\n )\n request.body = \"BEGIN:VCALENDAR\\r\\nBEGIN:VEVENT\\r\\nUID:foo\\r\\nSUMMARY:Meeting in M\\xfcnster\\r\\nEND:VEVENT\\r\\nEND:VCALENDAR\\r\\n\"\n\n response = request(request)\n\n assert_equal(201, response.status, \"Incorrect status returned! Full response body: #{response.body_as_string}\")\n assert_nil(response.header('ETag'))\n end",
"title": ""
},
{
"docid": "243b91912ef5f24345415359a84c06ba",
"score": "0.51474977",
"text": "def update\n @custom_page = CustomPage.find(params[:id])\n\n respond_to do |format|\n if @custom_page.update_attributes(params[:custom_page])\n flash[:notice] = 'CustomPage was successfully updated.'\n format.html { redirect_to(@custom_page) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @custom_page.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bf08fa2c1db18044fdff14a66e17167b",
"score": "0.5143089",
"text": "def update\n @event_custom_view = EventCustomView.find(params[:id])\n\n respond_to do |format|\n if @event_custom_view.update_attributes(params[:event_custom_view])\n\t\t\t\tmsg = I18n.t('app.msgs.success_updated', :obj => I18n.t('app.common.event_custom_view'))\n\t\t\t\tsend_status_update(I18n.t('app.msgs.cache_cleared', :action => msg))\n format.html { redirect_to admin_event_custom_views_path, notice: msg }\n format.json { head :ok }\n else\n\t\t\t\tgon.load_js_event_custom_view_form = true\n\t\t\t\tgon.event_id = @event_custom_view.event_id\n\t\t\t\tgon.shape_type_id = @event_custom_view.shape_type_id\n\t\t\t\tgon.descendant_shape_type_id = @event_custom_view.descendant_shape_type_id\n format.html { render action: \"edit\" }\n format.json { render json: @event_custom_view.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c24d1e0c86556c88abf258fdbde3ef39",
"score": "0.514306",
"text": "def update_metadata(params)\n @client.put(metadata_path, nil, params, \"Content-Type\" => \"application/json\")\n end",
"title": ""
},
{
"docid": "c24d1e0c86556c88abf258fdbde3ef39",
"score": "0.514306",
"text": "def update_metadata(params)\n @client.put(metadata_path, nil, params, \"Content-Type\" => \"application/json\")\n end",
"title": ""
},
{
"docid": "2db8510634a8588feaf130b0ace4c384",
"score": "0.5129952",
"text": "def test_should_update_blog_post_via_API_XML\r\n get \"/logout\"\r\n put \"/blog_posts/1.xml\", :api_key => 'testapikey',\r\n :blog_post => {:title => 'API Test Post',\r\n :body => 'API Test Body',\r\n :published => true,\r\n :featured => false,\r\n :summary => 'Blog Post Summary',\r\n :url => 'http://www.apiblogpost.com',\r\n :guid => '22222' }\r\n assert_response :success\r\n end",
"title": ""
},
{
"docid": "fbd7c46b15ae2792fd842ba0d764b7d0",
"score": "0.51266134",
"text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end",
"title": ""
},
{
"docid": "769a44546021a56ec9d8aa5cc64aaf1e",
"score": "0.51217645",
"text": "def update\n @when_timeslot = WhenTimeslot.find(params[:id])\n\n respond_to do |format|\n if @when_timeslot.update_attributes(params[:when_timeslot])\n format.html { redirect_to(@when_timeslot, :notice => 'WhenTimeslot was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @when_timeslot.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9fce3f29c318c7099d52caa1901b9466",
"score": "0.51200867",
"text": "def ajax_save_edit_trigger\n trigger = Trigger.find(params[:id])\n\n trigger.name = params[:name]\n trigger.description = params[:description]\n trigger.hook_id = params[:hook_id]\n trigger.product_id = params[:product_id]\n\n # Save and verify Node and return correct JSON response\n trigger.put('', {\n :name => trigger.name,\n :description => trigger.description,\n :hook_id => trigger.hook_id,\n :product_id => trigger.product_id,\n })\n\n # Return Success Response\n response = {\n success: true,\n message: 'Trigger Updated!'\n }\n render json: response\n\n end",
"title": ""
},
{
"docid": "c4733119c343f697381348ae861486f9",
"score": "0.51164365",
"text": "def stub_any_publishing_api_put_content\n stub_request(:put, %r{\\A#{PUBLISHING_API_V2_ENDPOINT}/content/})\n end",
"title": ""
},
{
"docid": "ea416b077fa0aa7e84ec3fe2ef9c3772",
"score": "0.511246",
"text": "def put\n request_method('PUT')\n end",
"title": ""
},
{
"docid": "6d5fa6ce6925f7b9e1f1b0304584026a",
"score": "0.5094311",
"text": "def resource_updated(resource, action); end",
"title": ""
},
{
"docid": "bfea044dc3f6ce25ed9e8f98d41d9e4d",
"score": "0.50942516",
"text": "def update_rest\n @instrument_content = InstrumentContent.find(params[:id])\n\n respond_to do |format|\n if @instrument_content.update_attributes(params[:instrument_content])\n flash[:notice] = 'InstrumentContent was successfully updated.'\n format.html { redirect_to(@instrument_content) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @instrument_content.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7dcf61d28367255f0ec9cea7ade341de",
"score": "0.5081521",
"text": "def update(id, name=\"Updated Name\", published=\"false\", genre=\"movie\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <timeline>\r\n <published type='string'>#{published}</published>\r\n <id type='integer'>#{id}</id>\r\n <description>#{name}</description>\r\n <genre>#{genre}</genre>\r\n </timeline>\"\r\n \r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n \r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"title": ""
},
{
"docid": "7d2b6a2057aa28b4e2d566f9c083afce",
"score": "0.5071236",
"text": "def new\n @when_custom = WhenCustom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @when_custom }\n end\n end",
"title": ""
},
{
"docid": "7dd7930406cdb8ec978a21862de2ae6b",
"score": "0.50671184",
"text": "def setup(easy)\n super\n easy.customrequest = \"PATCH\"\n end",
"title": ""
},
{
"docid": "375572468eca97b6dde9328e39cc6dd2",
"score": "0.50627697",
"text": "def update\n @when_week = WhenWeek.find(params[:id])\n\n respond_to do |format|\n if @when_week.update_attributes(params[:when_week])\n format.html { redirect_to(@when_week, :notice => 'WhenWeek was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @when_week.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "40548e4636a23250e837849deafda499",
"score": "0.50219005",
"text": "def update\n @custom_field = CustomField.find(params[:id])\n\n respond_to do |format|\n if @custom_field.update_attributes(params[:custom_field])\n format.json { head :no_content }\n else\n format.json { render json: @custom_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25d3678c7e04ea54b622df51295086a6",
"score": "0.50210595",
"text": "def update\n @custom_value = CustomValue.find(params[:id])\n\n respond_to do |format|\n if @custom_value.update_attributes(params[:custom_value])\n format.html { redirect_to @custom_value, notice: 'Custom value was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @custom_value.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2a6a2e26ccdf71a21a8169aa389d5db4",
"score": "0.502083",
"text": "def update\n @custom_promotion = CustomPromotion.find(params[:id])\n\n respond_to do |format|\n if @custom_promotion.update_attributes(params[:custom_promotion])\n format.html { redirect_to(@custom_promotion, :notice => 'CustomPromotion was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @custom_promotion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d0fba1bf3c5e1dc0008c27994e1dabe4",
"score": "0.50160694",
"text": "def test_should_update_blog_post_via_API_XML\r\n get \"/logout\"\r\n put \"/blog_posts/1.xml\", :blog_post => {:title => 'API Test Post',\r\n :body => 'API Test Body',\r\n :published => true,\r\n :featured => false,\r\n :summary => 'Blog Post Summary',\r\n :url => 'http://www.apiblogpost.com',\r\n :guid => '22222' }\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "a7ce3211964ca7b190522c77982b064a",
"score": "0.4995407",
"text": "def submit_ohms_xml\n authorize! :update, @work\n unless params[:ohms_xml].present?\n redirect_to admin_work_path(@work, anchor: \"tab=nav-oral-histories\"), flash: { error: \"No file received\" }\n return\n end\n\n xml = params[:ohms_xml].read\n validator = OralHistoryContent::OhmsXmlValidator.new(xml)\n\n if validator.valid?\n @work.oral_history_content!.update!(ohms_xml_text: xml)\n redirect_to admin_work_path(@work, anchor: \"tab=nav-oral-histories\"), notice: \"OHMS XML file updated\"\n else\n Rails.logger.debug(\"Could not accept invalid OHMS XML for work #{@work.friendlier_id}:\\n #{xml.slice(0, 60).gsub(/[\\n\\r]/, '')}...\\n\\n #{validator.errors.join(\"\\n \")}\")\n redirect_to admin_work_path(@work, anchor: \"tab=nav-oral-histories\"), flash: {\n error: \"OHMS XML file was invalid and could not be accepted: #{validator.errors.join('; ')}\"\n }\n end\n end",
"title": ""
},
{
"docid": "a2f88446f4ffaa4102dc4352b343ac5b",
"score": "0.49919513",
"text": "def update\n @incident_request = Icm::IncidentRequest.find(params[:id])\n\n respond_to do |format|\n if @incident_request.update_attributes(params[:icm_incident_request])\n format.html { redirect_to({:action=>\"index\"}, :notice => t(:successfully_updated)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\", :layout => \"application_full\" }\n format.xml { render :xml => @incident_request.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1f29b1f83d4b1eb9b7f7c57161bf57eb",
"score": "0.4991466",
"text": "def update\n @scrap_xml = ScrapXml.find(params[:id])\n\n respond_to do |format|\n if @scrap_xml.update_attributes(params[:scrap_xml])\n flash[:notice] = 'ScrapXml was successfully updated.'\n format.html { redirect_to(@scrap_xml) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @scrap_xml.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bc0f11a2e72881de39415feda887256",
"score": "0.4987067",
"text": "def update\n @ayudastiposevento = Ayudastiposevento.find(params[:id])\n\n respond_to do |format|\n if @ayudastiposevento.update_attributes(params[:ayudastiposevento])\n flash[:notice] = 'Ayudastiposevento was successfully updated.'\n format.html { redirect_to(@ayudastiposevento) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ayudastiposevento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5a12bcc0eb656f9076a3ec39bf2803b6",
"score": "0.4982083",
"text": "def update\n respond_to do |format|\n if @bookmark.update(bookmark_params)\n if @bookmark.custom\n @custom = @bookmark.custom.update(:user_id => current_user.id, :fields => params[:custom], :bookmark_id => @bookmark.id)\n else\n @custom = Custom.create(:user_id => current_user.id, :fields => params[:custom], :bookmark_id => @bookmark.id)\n end\n format.html { redirect_to @bookmark, notice: 'Bookmark was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bookmark.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "882c8317370987b86425c0adbf5bfe8c",
"score": "0.49699026",
"text": "def update_aos_version(args = {}) \n put(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "ed44f5b0210fa250765d049693a2b589",
"score": "0.49638465",
"text": "def put_cm_rest_resource(args = {})\n args[:headers] = { 'Content-Type' => 'application/json' }\n req_cm_rest_resource(args) { |req_args| API.put_req(req_args) }\n end",
"title": ""
},
{
"docid": "27096800d14893529f640b6cf4566aba",
"score": "0.49624544",
"text": "def update\n connection.put(\"/todo_lists/#{id}.xml\",\n \"<todo-list>\n <name>#{name}</name>\n <description>#{description}</description>\n <milestone_id>#{milestone_id}</milestone_id>\n </todo-list>\",\n XML_REQUEST_HEADERS)\n end",
"title": ""
},
{
"docid": "44b50c680a2923bc4d45a816987295cc",
"score": "0.4961785",
"text": "def set_custom\n @custom = Custom.find(params[:id])\n end",
"title": ""
},
{
"docid": "44b50c680a2923bc4d45a816987295cc",
"score": "0.4961785",
"text": "def set_custom\n @custom = Custom.find(params[:id])\n end",
"title": ""
},
{
"docid": "44b50c680a2923bc4d45a816987295cc",
"score": "0.4961785",
"text": "def set_custom\n @custom = Custom.find(params[:id])\n end",
"title": ""
},
{
"docid": "330e65581254f7eb9913e4f5952a3265",
"score": "0.49520057",
"text": "def update\n respond_to do |format|\n if @customvalue.update(customvalue_params)\n format.html { redirect_to @customvalue, notice: 'Customvalue was successfully updated.' }\n format.json { render :show, status: :ok, location: @customvalue }\n else\n format.html { render :edit }\n format.json { render json: @customvalue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "35d88127391168ba84afd2f1894e3b48",
"score": "0.49501532",
"text": "def update\n respond_to do |format|\n if @customtemplatetype.update(customtemplatetype_params)\n format.html { redirect_to @customtemplatetype, notice: 'Customtemplatetype was successfully updated.' }\n format.json { render :show, status: :ok, location: @customtemplatetype }\n else\n format.html { render :edit }\n format.json { render json: @customtemplatetype.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab05d2d3850ab650bb86caa53f0130b7",
"score": "0.49477103",
"text": "def update\n headers = self.class.headers.merge 'Accept' => 'application/xml'\n connection.post(element_path(prefix_options.merge(:action_hack => :update)), encode, headers).tap do |response|\n load_attributes_from_response(response)\n end\n end",
"title": ""
},
{
"docid": "0f4df4593e67f403c2009d4294e2aaf3",
"score": "0.49437782",
"text": "def modify what, message, method, options = {}\n h = options.delete(:headers) || headers(:xml)\n request = client[url_for(what, options)]\n request.options[:headers] = h\n $logger.debug \"Modifying: \\n #{message}\"\n begin\n ap({:modify_request => request, :modify_message => Nokogiri::XML(message)}) if $DEBUG\n return request.send method, message\n rescue RestClient::InternalServerError => e\n $logger.error e.response\n $logger.flush if $logger.respond_to? :flush\n raise GeoServerInvalidRequest, \"Error modifying #{what.inspect}. See $logger for details\"\n end\n\n end",
"title": ""
},
{
"docid": "75257bcacbc16f7963754f7d8ca9fb70",
"score": "0.49423736",
"text": "def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n \n \n format.xml \n else\n \n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cdd76a4b3a18f416052240b1a19efb20",
"score": "0.49367154",
"text": "def update!(**args)\n @custom_attributes = args[:custom_attributes] if args.key?(:custom_attributes)\n @etag = args[:etag] if args.key?(:etag)\n @event_types = args[:event_types] if args.key?(:event_types)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n @object_name_prefix = args[:object_name_prefix] if args.key?(:object_name_prefix)\n @payload_format = args[:payload_format] if args.key?(:payload_format)\n @self_link = args[:self_link] if args.key?(:self_link)\n @topic = args[:topic] if args.key?(:topic)\n end",
"title": ""
},
{
"docid": "c973b77554bee4c1e0a6f99b14b11594",
"score": "0.49365476",
"text": "def update\n @custom_field = CustomField.find(params[:id])\n authorize! :update, @custom_field\n\n respond_to do |format|\n if @custom_field.update_attributes(params[:custom_field])\n format.html { redirect_to(@custom_field, notice: 'Custom field was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render action: 'edit' }\n format.xml { render xml: @custom_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a2abaea7eb23530e64c3f72049a5c3cb",
"score": "0.4933973",
"text": "def update_xml(xml, value)\n xml\n end",
"title": ""
},
{
"docid": "fac1d4857a1d90a8d06ad8598ebf2e52",
"score": "0.49286875",
"text": "def update!(**args)\n @custom_id = args[:custom_id] if args.key?(:custom_id)\n @id = args[:id] if args.key?(:id)\n @isrc = args[:isrc] if args.key?(:isrc)\n @iswc = args[:iswc] if args.key?(:iswc)\n @kind = args[:kind] if args.key?(:kind)\n @time_created = args[:time_created] if args.key?(:time_created)\n @title = args[:title] if args.key?(:title)\n @type = args[:type] if args.key?(:type)\n end",
"title": ""
},
{
"docid": "49c658dbed767ba83747fb047382ebdc",
"score": "0.492446",
"text": "def show\n @when_custom = WhenCustom.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @when_custom }\n format.json { render :json => @when_customs }\n format.rule { render :rule => @when_customs }\n end\n end",
"title": ""
},
{
"docid": "5ce7c02517a687bff34ee2138db374f5",
"score": "0.49214238",
"text": "def update_resource(resource, params)\n super\n end",
"title": ""
},
{
"docid": "43899873890be697f69481952fb1e09e",
"score": "0.4919724",
"text": "def change(timeframe, options = {})\n raise \"Timeframe must be :now or :renewal.\" unless ['now','renewal'].include?(timeframe)\n options[:timeframe] = timeframe\n path = \"/accounts/#{CGI::escape(self.subscription_account_code.to_s)}/subscription.xml\"\n connection.put(path,\n self.class.format.encode(options, :root => :subscription),\n self.class.headers)\n end",
"title": ""
},
{
"docid": "72ab3f2643692ca995ef5bf6ffac7007",
"score": "0.49154425",
"text": "def input(input)\n RestClient.post(request_url, '<YAMAHA_AV cmd=\"PUT\"><Main_Zone><Input><Input_Sel>'+input+'</Input_Sel></Input></Main_Zone></YAMAHA_AV>', :content_type => \"text/xml\")\n end",
"title": ""
},
{
"docid": "885974626a5b21dd0bf9af5742f9a60d",
"score": "0.49078315",
"text": "def update\n @custom = Custom.find(params[:id])\n if @custom.update_attributes(params[:custom])\n redirect_to @custom, notice: 'Custom was successfully updated.'\n else\n flash[:alert] = @custom.errors.full_messages.join(\",\")\n render action: \"edit\" \n end\n end",
"title": ""
},
{
"docid": "6c599ef7192cee6370183799cb315c8e",
"score": "0.4905165",
"text": "def create_method\n :http_put\n end",
"title": ""
},
{
"docid": "6c599ef7192cee6370183799cb315c8e",
"score": "0.4905165",
"text": "def create_method\n :http_put\n end",
"title": ""
},
{
"docid": "8e18db431964c254de53caa41795b702",
"score": "0.49031264",
"text": "def put *args\n make_request :put, *args\n end",
"title": ""
},
{
"docid": "376770d4daf61e7c7c7d4873be1c38b4",
"score": "0.48989525",
"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": "2c8f03a2633f8f9d583c3fe73716aafc",
"score": "0.4895612",
"text": "def update_xml(xml, value)\r\n xml\r\n end",
"title": ""
},
{
"docid": "d6607de8935ebd99186eca0e7bf22354",
"score": "0.48928133",
"text": "def write(content)\n @client.update(content) \nend",
"title": ""
},
{
"docid": "78d4feb458b72dac95728e0c7c289cb5",
"score": "0.4890645",
"text": "def update_rest\n @instrument = Instrument.find(params[:id])\n\n respond_to do |format|\n if @instrument.update_attributes(params[:instrument])\n flash[:notice] = 'Instrument was successfully updated.'\n format.html { redirect_to(@instrument) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @instrument.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "47abb2cddfa1a665018f717cdaaa4164",
"score": "0.48887458",
"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": "1b57231ba2ba0a84b687da72812aa027",
"score": "0.48883936",
"text": "def update_report_template(args = {}) \n id = args['id']\n temp_path = \"/reports.json/template/{templateId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"reportId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "3c7c78b457f7e58ed2b8350a3212d89b",
"score": "0.48883832",
"text": "def update\n @xoso = Xoso.find(params[:id])\n\n respond_to do |format|\n if @xoso.update_attributes(params[:xoso])\n format.html { redirect_to @xoso, notice: 'Xoso was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @xoso.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "608d2f58e93e2a844cba814b363df9ef",
"score": "0.4875862",
"text": "def update(id, name=\"Updated Name\", extension=0000)\n xml_req =\"{\\\"device\\\":{ \\\"id\\\":#{id},\\\"number\\\":\\\"#{number}\\\",\\\"name\\\":\\\"#{name}\\\",\\\"address\\\":\\\"#{address}\\\"}}\"\n \n \n request = Net::HTTP::Put.new(\"#{@url}/#{id}.json\")\n request.add_field \"Content-Type\", \"application/json\"\n request.body = xml_req\n \n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n \n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end",
"title": ""
},
{
"docid": "437820a68e33859069b63566ba50eecc",
"score": "0.48750657",
"text": "def destroy\n @when_custom = WhenCustom.find(params[:id])\n @when_custom.destroy\n\n respond_to do |format|\n format.html { redirect_to(when_customs_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "aa8cd2f371265666d2020f35a2747289",
"score": "0.48708832",
"text": "def update_location_custom_attribute_definition(key:,\n body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::PUT,\n '/v2/locations/custom-attribute-definitions/{key}',\n 'default')\n .template_param(new_parameter(key, key: 'key')\n .should_encode(true))\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": "605d8f74424b13ee9fbe5373f1b5283d",
"score": "0.48684055",
"text": "def modify what, message, method, options = {}\n h = options.delete(:headers) || headers(:xml)\n request = client[url_for(what, options)]\n request.options[:headers] = h\n $logger.debug \"Modifying: \\n #{message}\"\n begin \n return request.send method, message\n rescue RestClient::InternalServerError => e\n $logger.error e.response\n $logger.flush if $logger.respond_to? :flush\n raise GeoServerInvalidRequest, \"Error modifying #{what.inspect}. See $logger for details\"\n end\n \n end",
"title": ""
},
{
"docid": "d5131c0bd5fb807d13722b05f0e9a481",
"score": "0.4863448",
"text": "def update\n @service_request = ServiceRequest.lookup(params[:id])\n\n respond_to do |format|\n \n if @service_request.update_attributes(params[:service_request])\n \n @service_request.update_watcher\n\n if @service_request.escalation > 0 \n send_notifications :event => :sr_escalated, :data => {:service_request => @service_request},\n :user_ids => @service_request.watchers.collect(&:owner_id)\n end\n flash[:notice] = 'ServiceRequest was successfully updated.'\n logger.info \"Adding a note during SR update via controller - should be in model?????\"\n \n \n format.html { redirect_to(@service_request) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @service_request.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2f43d79cb8ce757f5e82d8476fd01962",
"score": "0.48626795",
"text": "def test_should_update_topic_via_API_XML\r\n get \"/logout\"\r\n put \"/forum_topics/1.xml\", :forum_topic => {:title=>'Updated API Test Topic',\r\n :description=>'Updated Test topic desc',\r\n :user_id=>1}\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "6cd052f1d416a9071420779b1c5c3444",
"score": "0.48591635",
"text": "def _update(type, metadata={})\n type = type.to_s.camelize\n message = { metadata: metadata.merge({'@xsi:type' => \"tns:#{type}\"}) }\n client.call(:update_metadata, message: message)\n end",
"title": ""
},
{
"docid": "80f52a6d4c61e3ed5db20487390349a4",
"score": "0.48573184",
"text": "def update_entity(container, entity, id, version = nil, options={})\n results = get_entity container, id\n entity = REXML::Document.new(results.body)\n \n options.each { |key, value|\n if(entity.root().elements[key.to_s].nil?)\n entity.root().add_element(key.to_s)\n entity.root().elements[key.to_s].add_attribute('xsi:type', infer_type(value))\n end\n \n entity.root().elements[key.to_s].text = value\n }\n url = get_request_url(container, id)\n put(url, entity, version)\n end",
"title": ""
},
{
"docid": "05c00ed873755a5d8a517a68abc3f9ec",
"score": "0.4856967",
"text": "def update_notification(id, model) path = \"/api/v2/notifications/#{id}\"\n put(path, model, {}, AvaTax::VERSION) end",
"title": ""
},
{
"docid": "2ab2c86fb88df7a1979eabf3ea952b51",
"score": "0.4854889",
"text": "def update\n @company_datum = CompanyDatum.find(params[:id])\n\n respond_to do |format|\n if @company_datum.update_attributes(params[:company_datum])\n \n create_company_data_xml unless FileTest.exists?(\"app/data/company_data.xml\")\n update_company_data_xml() \n \n format.html { redirect_to(@company_datum, :notice => 'Company datum was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company_datum.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7912273c6f7c89f645ee9840543ab2df",
"score": "0.48519602",
"text": "def update\n respond_to do |format|\n if @custom_definition_value.update(custom_definition_value_params)\n format.html do\n redirect_to @custom_definition_value, notice: 'Custom definition value was successfully updated.'\n end\n format.json { render :show, status: :ok, location: @custom_definition_value }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @custom_definition_value.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc3ec1a65446d75c44cf14aa0d7f8825",
"score": "0.48519477",
"text": "def update\n @custom_agent = CustomAgent.find(params[:id])\n\n respond_to do |format|\n if @custom_agent.update_attributes(params[:custom_agent])\n format.html { redirect_to @custom_agent, notice: 'Custom agent was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @custom_agent.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "005ff5c33e33aabc42dc27246dd9a4bd",
"score": "0.4851233",
"text": "def update\n @when = When.find(params[:id])\n\n respond_to do |format|\n if @when.update_attributes(params[:when])\n format.html { redirect_to @when, notice: 'When was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @when.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d06e37662a4d2a8a6b898c4c221034fc",
"score": "0.48501793",
"text": "def stub_publishing_api_put_intent(base_path, params = {})\n url = PUBLISHING_API_ENDPOINT + \"/publish-intent#{base_path}\"\n body = params.is_a?(String) ? params : params.to_json\n\n response = {\n status: 200,\n headers: { content_type: \"application/json\" },\n body: body,\n }\n stub_request(:put, url).with(body: params).to_return(response)\n end",
"title": ""
},
{
"docid": "501a9c296192754d6b0c846526fece34",
"score": "0.48491782",
"text": "def update\n @custom_question_answer = CustomQuestionAnswer.find(params[:id])\n\n respond_to do |format|\n if @custom_question_answer.update_attributes(params[:custom_question_answer])\n format.html { redirect_to(@custom_question_answer, :notice => 'Custom question answer was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @custom_question_answer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd70045cd97467789d70ad0eae926b13",
"score": "0.48478487",
"text": "def update(args)\n @service.request({:method => :POST,\n :namespace => @namespace,\n :resource => @resource + [name],\n :body => args})\n self\n end",
"title": ""
},
{
"docid": "2827d845ba442028d80242de02c60173",
"score": "0.48437724",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { head :no_content, status: :ok }\n format.xml { head :no_content, status: :ok }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n format.xml { render xml: @event.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "64d03331cf8ad06e52af2a2ef5d4684e",
"score": "0.48396614",
"text": "def update_appointment\n\t\tid = grab_id(\"update\")\n\t\taddress = @url + \"/\" + id\n\t\tupdate_value = what_to_update\n\t\tkey = format_value(update_value)\n\t\tif update_value == \"s\"\n\t\t\tresponse = change_start_time(address, key, get_appointment_start_time)\n\t\telse\n\t\t\tresponse = change_data(address, key)\n\t\tend\n\t\tresponse.body\n\tend",
"title": ""
},
{
"docid": "5c8334815c9afb74f182af9fdfdc8c7c",
"score": "0.4838192",
"text": "def update\n respond_to do |format|\n if @customizable_attribute.update(customizable_attribute_params)\n format.html { redirect_to([:admin, @customizable_attribute], notice: 'Customizable Attribute was successfully updated.') }\n format.xml { head :ok }\n website.add_log(user: current_user, action: \"Updated customizable attribute: #{@customizable_attribute.name}\")\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @customizable_attribute.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
1304bd6dee3dfe69de92a9cd212f7919
|
Methods to convert absolute URLs in links into relative URLs. This is necessary because the URLs in emails sent during testing have host: localhost and port: 3000, but port 3000 in localhost is not really made available by Capybara. We need to use a relative URL when trying to access these URLs during testing. Given a confirmation link sent in a sign up email, returns a relative URL that can be accessed to confirm the new user's email address during testing.
|
[
{
"docid": "9c38907df05f35252ac5782a3bf4aaca",
"score": "0.6805437",
"text": "def get_confirm_address_link_from_email(email_link)\n uri = URI email_link\n confirm_uri = URI confirmation_path\n confirm_uri.query = uri.query\n confirm_link = confirm_uri.to_s\n return confirm_link\nend",
"title": ""
}
] |
[
{
"docid": "b86eece44f07ef3758f71470795881f0",
"score": "0.6428945",
"text": "def fix_link_relative_path(link, domain_uri)\n fixed = URI.parse(link)\n return link if fixed.host && fixed.scheme\n\n original_domain = URI.parse(domain_uri)\n fixed.host = original_domain.host unless fixed.host\n fixed.scheme = original_domain.scheme unless fixed.scheme\n fixed.to_s\n end",
"title": ""
},
{
"docid": "b5911070190359375f89fef3c287e906",
"score": "0.63605285",
"text": "def resolve_link_paths(document)\n document.gsub(/<(?:a[^>]+href)=[\"'](\\/)/) do |match|\n match.chomp('/') + base_url + '/'\n end\n end",
"title": ""
},
{
"docid": "b555f458a45ac9bab8d5f527c47f684e",
"score": "0.6296591",
"text": "def fix_relative_url(url)\n begin\n return URI.join(self.link, url).to_s if URI.parse(url).host.nil? && !URI.join(self.link, url).host.nil?\n rescue\n end\n return url\n end",
"title": ""
},
{
"docid": "5f8544c7f9b86f6951352e93512573df",
"score": "0.6205081",
"text": "def to_abs(link)\n return nil if link.nil?\n\n # remove anchor\n link = URI.encode(URI.decode(link.to_s.gsub(/#[a-zA-Z0-9_-]*$/,'')))\n return nil if link.nil?\n if link =~ /^https?:\\/\\/[\\S]+/\n #puts \"keeper\"\n #puts \"\"\n link\n elsif link =~ /^http?:\\/\\/[\\S]+/\n #puts \"keeper\"\n #puts \"\"\n link\n elsif link =~ /^\\/\\// \n #puts \"should be tossed\"\n #puts \"\"\n elsif link =~ /^\\/\\w/ \n #puts \"should be absolute\"\n #puts \"\"\n link = \"#{@url.scheme}://#{@url.host}#{link}\"\n elsif link =~ /^\\w/ \n #puts \"should be relative\"\n #puts \"\"\n link = \"#{@url.to_s}/#{link}\"\n else\n #puts \"im lost\"\n #puts \"\" \n end\n URI(link)\n end",
"title": ""
},
{
"docid": "9cacd4b194d6d31d50a23e2acdde9c45",
"score": "0.6184504",
"text": "def confirmation_link\n # due to a bug(?) the named path is wrong when this url is created,\n # solved by hardcoding the url\n\n \"http://localhost:5000/v1/confirmations/\"\n end",
"title": ""
},
{
"docid": "7a0f72a9ccfeb8d892ae73d65dca54a3",
"score": "0.61822605",
"text": "def get_link(url)\n # puts \"value of variable is #{url}\"\n # link_to('confirm email',\n link_to(\"#{url}#{generate_confirmation_path()}\",\n \"#{url}#{generate_confirmation_path()}\")\n end",
"title": ""
},
{
"docid": "1b34e39186f28538994324275b3b0bbd",
"score": "0.61571205",
"text": "def links_in_email(email)\r\n URI.extract(email.to_s, ['http', 'https'])\r\n end",
"title": ""
},
{
"docid": "91096d5091c9f0e5eca830acbfcd0b7b",
"score": "0.6074153",
"text": "def to_absolute(link)\n begin\n url = @url.merge(link.to_s)\n rescue URI::InvalidURIError, URI::InvalidComponentError\n return nil\n end\n\n unless (url.path.nil? || url.path.empty?)\n # make sure the path does not contain any .. or . directories,\n # since URI::Generic#merge cannot normalize paths such as\n # \"/stuff/../\"\n url.path = URI.expand_path(url.path)\n end\n\n return url\n end",
"title": ""
},
{
"docid": "f7f9fcdcdc8978853b42ce1ea45dd68a",
"score": "0.6060533",
"text": "def generate_url_for_link(link)\n if link.is_a? InternalLink\n aliased_or_delegated_path link.linked_node\n else # ExternalLink\n link.url\n end\n end",
"title": ""
},
{
"docid": "04e024683d765356990dc33776166143",
"score": "0.60513955",
"text": "def absolutize_links(node)\n node.search(\"a\") do |item|\n item.attributes[\"href\"] = fix_relative_url(item.attributes[\"href\"])\n end\n end",
"title": ""
},
{
"docid": "3ffb1e63accc9bebdaeb0f0eb30d11ac",
"score": "0.60488164",
"text": "def to_absolute(link)\n link = link.to_s\n new_url = begin\n url.merge(link)\n rescue Exception\n return\n end\n\n if (!new_url.opaque) && (path = new_url.path)\n # ensure that paths begin with a leading '/' for URI::FTP\n if (new_url.scheme == 'ftp' && !path.start_with?('/'))\n path.insert(0,'/')\n end\n\n # make sure the path does not contain any .. or . directories,\n # since URI::Generic#merge cannot normalize paths such as\n # \"/stuff/../\"\n new_url.path = URI.expand_path(path)\n end\n\n return new_url\n end",
"title": ""
},
{
"docid": "03f856a3eb45d9178af01235b1c970ef",
"score": "0.6024857",
"text": "def link_helper(url)\n\n # set up another variable for the link\n link = url\n\n # add http if missing from url\n if !url.include?(\"http://\") && !url.include?(\"https://\")\n url = \"http://\" + url\n end\n\n # strip out http/https from link\n if link.include?(\"http://\") || link.include?(\"https://\")\n link = link.split(\"://\")[1]\n end\n\n # strip out the www from the link\n if link.include?(\"www.\")\n link = link.split(\"www.\")[1]\n end\n\n # remove trailing slash\n if link[link.length-1].eql?(\"/\")\n link = link[0..(link.length - 2)]\n end\n\n # return a link_to with the final link and url\n link_to(link, url)\n end",
"title": ""
},
{
"docid": "03f856a3eb45d9178af01235b1c970ef",
"score": "0.6024857",
"text": "def link_helper(url)\n\n # set up another variable for the link\n link = url\n\n # add http if missing from url\n if !url.include?(\"http://\") && !url.include?(\"https://\")\n url = \"http://\" + url\n end\n\n # strip out http/https from link\n if link.include?(\"http://\") || link.include?(\"https://\")\n link = link.split(\"://\")[1]\n end\n\n # strip out the www from the link\n if link.include?(\"www.\")\n link = link.split(\"www.\")[1]\n end\n\n # remove trailing slash\n if link[link.length-1].eql?(\"/\")\n link = link[0..(link.length - 2)]\n end\n\n # return a link_to with the final link and url\n link_to(link, url)\n end",
"title": ""
},
{
"docid": "aee9b9b09c3a3ff7763dc2f05d97ef13",
"score": "0.5992155",
"text": "def to_absolute(link)\n return nil if link.nil?\n\n # remove anchor\n link = URI.encode(URI.decode(link.to_s.gsub(/#[a-zA-Z0-9_-]*$/,'')))\n\n relative = URI(link)\n absolute = url.merge(relative)\n\n absolute.path = '/' if absolute.path.empty?\n\n return absolute\n end",
"title": ""
},
{
"docid": "badfaed9e45eed9860f306cf688d4464",
"score": "0.59912884",
"text": "def to_absolute(link)\n return nil if link.nil?\n\n # remove anchor\n link = URI.encode(URI.decode(link.to_s.gsub(/#[a-zA-Z0-9_-]*$/,'')))\n\n relative = URI(link)\n absolute = @url.merge(relative)\n\n absolute.path = '/' if absolute.path.empty?\n\n return absolute\n end",
"title": ""
},
{
"docid": "866290311e60fb7038c8ccf4aec58f75",
"score": "0.598554",
"text": "def to_absolute(link)\n return nil if link.nil?\n\n # remove anchor\n link = URI.encode(URI.decode(link.to_s.gsub(/#[a-zA-Z0-9_-]*$/,'')))\n\n relative = URI(link)\n absolute = base ? base.merge(relative) : URI(url).merge(relative)\n\n absolute.path = '/' if absolute.path.empty?\n\n return absolute\n end",
"title": ""
},
{
"docid": "5f56f6f2d3eeefce18ed607ae109a31b",
"score": "0.5955501",
"text": "def to_absolute( root, link )\n\n parsed = URI.parse( link )\n if parsed.scheme == 'file'\n parsed.scheme = nil\n return parsed.to_s\n end\n\n return link if URI.parse( link ).host\n\n begin\n # remove anchor\n link = URI.encode( link.to_s.gsub( /#[a-zA-Z0-9_-]*$/,'' ) )\n\n base_url = URI.parse( URI.encode( root ) )\n relative = URI.parse( link )\n absolute = base_url.merge( relative )\n\n absolute.path = '/' if absolute.path && absolute.path.empty?\n\n return absolute.to_s\n rescue Exception => e\n $stderr.puts e\n $stderr.puts e.backtrace.join( \"\\n\" )\n return nil\n end\n end",
"title": ""
},
{
"docid": "d4df3be44c2ecd92767ed546a6ff266d",
"score": "0.5945459",
"text": "def test_link_tag_with_straight_url\n assert_equal \"<a href=\\\"http://www.world.com\\\">Hello</a>\", link_to(\"Hello\", \"http://www.world.com\")\n end",
"title": ""
},
{
"docid": "66f25ea58f6286c7aa5ca8f661baa241",
"score": "0.5935936",
"text": "def convert_relative_href(href, current_url)\n relative_depth = href.split('..').count - 1\n url_parts = current_url.split('/')\n url_parts.slice!(-relative_depth, relative_depth)\n fixed_href = href.gsub('../', '')\n url_parts.join('/') + '/' + fixed_href\n end",
"title": ""
},
{
"docid": "10ba6d66a3bd8dfee21e282d9e8aeb92",
"score": "0.59042877",
"text": "def relative_url(input)\n return if input.nil?\n site = @context.registers[:site]\n parts = [site.config[\"baseurl\"], input]\n Addressable::URI.parse(\n parts.compact.map { |part| ensure_leading_slash(part.to_s) }.join\n ).normalize.to_s\n end",
"title": ""
},
{
"docid": "d0019974bf968e071f65dd5d01052518",
"score": "0.5870785",
"text": "def fix_relative_link(text)\n title, link = text.scan(/\\[(.+?)\\]\\((.+?)\\)/m).flatten\n return text if link.match?(/^https?:/)\n\n current_path = File.dirname(chapter.out_path.sub('../', '')).split('/').grep_v(/^\\.$/)\n link_path = link.split('/').tap { _1.unshift(nil) until _1.length >= current_path.length }\n\n link_path.zip(current_path)\n .drop_while { _1 == _2 }\n .transpose\n .then { |lnk, cur| '../' * cur.compact.length + lnk.compact.join('/') }\n .then { \"[#{title}](#{_1})\"}\n # .tap {\n # if chapter.out_path.include?('keywords.md') && link.include?('exceptions.md')\n # p [current_path, link_path, _1]\n # exit\n # end\n # }\n end",
"title": ""
},
{
"docid": "9d9bf5a9e2413cd610b538c8ea6fa3ad",
"score": "0.58683753",
"text": "def test_url normalized, href=nil\n insecure = normalized.sub /^https:/, 'http:'\n secure = insecure.sub /^http:/, 'https:'\n if !(valid_url = test_link(insecure) || test_link(secure))\n # Try to construct a valid normalized by merging the href and the url\n if (uri = safe_parse(href)) && (normalized = uri.normalize.merge(normalized).to_s)\n valid_url = test_link(normalized) ||\n ((normalized =~ /^https/) && test_link(normalized.sub! /^https/, 'http'))\n end\n end\n ((valid_url.kind_of? String) ? valid_url : normalized) if valid_url\nend",
"title": ""
},
{
"docid": "78c5b4d9e6fbce191250291f1e15d236",
"score": "0.5817959",
"text": "def normalize_links(links)\n extensions = \"png|gif|jpg|pdf|zip\"\n beginnings = \"mailto|tel\"\n\n links_array = []\n warnings = []\n\n links.each do |link|\n link = link.attribute('href').to_s\n\n # Remove #hash\n link = link.gsub(/#.+$/, '')\n next if link.empty?\n\n # Remove links to specific extensions and protocols\n next if link =~ /\\.(#{extensions})(\\?.*)?$/\n next if link =~ /^(#{beginnings})/\n\n # Strip spaces\n link.strip!\n\n # Convert relative links to absolute\n begin\n link = URI.join( @opts.base, link ).to_s\n rescue URI::InvalidURIError\n escaped_link = URI.escape link\n warnings << { link: link, message: \"Using escaped link: #{escaped_link}\" }\n link = URI.join( @opts.base, escaped_link ).to_s\n rescue => e\n warnings << { link: link, message: \"#{e.class} #{e.message}\" }\n next\n end\n\n # Keep only links in our base domain\n next unless link.include? @opts.base\n\n links_array << link\n end\n\n [links_array.uniq, warnings]\n end",
"title": ""
},
{
"docid": "4537cfc45ba3e0efbd14f416d593fe2d",
"score": "0.58044595",
"text": "def resolve_relative_url(url)\n if @last_remote_uri\n base_uri = @last_remote_uri\n path_prefix = ''\n else\n host = Capybara.app_host || Capybara.default_host\n # do this in text so we don't get the host interpretted as the scheme.\n host = \"http://#{host}\" unless host =~ %r{^https?://.*}\n base_uri = URI.parse(host)\n base_uri.path = '/' if base_uri.path.nil? || base_uri.path.empty?\n if base_uri.path.length > 1\n path_prefix = base_uri.path\n path_prefix += '/' unless path_prefix.end_with?('/') || url.start_with?('/')\n\n # if the prefix is already in the path, don't let it be there twice.\n if url.start_with?(path_prefix)\n path_prefix = ''\n end\n else\n path_prefix = ''\n end\n end\n uri = URI.parse(path_prefix + url)\n result_uri = base_uri.merge uri\n end",
"title": ""
},
{
"docid": "290c34ffe2f792677b48114de6fbbc11",
"score": "0.57941854",
"text": "def absolutize_links(html)\n return unless defined?(Nokogiri)\n doc = Nokogiri::HTML(html)\n doc.search('a').each do |link|\n href = link['href'].to_s\n link['href'] = \"http://#{request.host}#{href}\" if href =~ /^\\//\n end\n doc.at('*').to_html.html_safe\n end",
"title": ""
},
{
"docid": "e518c0cce207fc1e3cc8b1c6440b5289",
"score": "0.57891524",
"text": "def basis_url\n uri = URI.parse(link)\n return \"#{uri.scheme}://#{uri.host}\"\n end",
"title": ""
},
{
"docid": "7f87e8cf08e9cc34a3e26cd3834dadd3",
"score": "0.5783249",
"text": "def link_to(relative_url)\n dst = dst_localpath(relative_url)\n res = @@urlmap[dst]\n unless res\n @ctx.env.warn('internal link', dst, 'is error')\n res=''\n end\n res\n end",
"title": ""
},
{
"docid": "c777c94369aebf5f27388144f1306311",
"score": "0.5741426",
"text": "def href\n return external_link if external_link\n\n url = (link&.try(:slug) || link&.try(:url))\n return if url.blank? && fragment.blank?\n\n url = URI(url || '')\n\n url = rewrite_to_locale(url, sys.locale) if default_locale && sys.locale != default_locale\n\n url.fragment = fragment if fragment.present?\n url.to_s\n end",
"title": ""
},
{
"docid": "97c285c8dd2f7d00e4650a171e62ee8a",
"score": "0.5732734",
"text": "def link_url\n self.url =~ /^http/ ? self.url : \"http://#{self.url}\"\n end",
"title": ""
},
{
"docid": "b7b8674b5749c6cef2b7c1a4862293f3",
"score": "0.5723458",
"text": "def original_url_formatted\n url = URI.parse(original_url)\n if url.scheme.present?\n original_url\n else\n 'http://' + url.path\n end\n end",
"title": ""
},
{
"docid": "f080a33b24288d45fbeb25cbd415c009",
"score": "0.5714847",
"text": "def url_from_path(path)\n unless path =~ /http:\\/\\//\n \"http://\" + [ActionMailer::Base.default_url_options[:host], path.split('/').map{|p|p.delete '/'}.reject(&:empty?) ].join(\"/\")\n else\n path\n end\n end",
"title": ""
},
{
"docid": "ba479d0f6ea0d977fa9bf33b6299ba99",
"score": "0.5709923",
"text": "def href\n return external_link if external_link\n\n url = (link&.try(:slug) || link&.try(:url))\n return url unless fragment.present?\n\n url = URI(url || '')\n url.fragment = fragment\n url.to_s\n end",
"title": ""
},
{
"docid": "c7e8cb72dc224f7a49306ed56725e09d",
"score": "0.5673539",
"text": "def abs_url url, host\n uri = url\n if uri && uri !~ /^http/\n uri = \"//#{host}#{uri}\"\n end\n uri\n end",
"title": ""
},
{
"docid": "c9ad8ddfabf4e208343a14c724f3827f",
"score": "0.56601673",
"text": "def abs_url url, host\n uri = url\n if uri && uri !~ /^http/\n uri = \"http://#{host}#{uri}\"\n end\n uri\n end",
"title": ""
},
{
"docid": "2b8ea1935faadbd69a32b9f38bcdfad6",
"score": "0.56592894",
"text": "def relative_url(url)\n url.gsub(%r{\\Ahttp://[^/]*}, '')\n end",
"title": ""
},
{
"docid": "c09730204ef6a229ed6cc87b3568da2f",
"score": "0.5654063",
"text": "def resolve_url(a_href, abs_url)\n unless [a_href, abs_url].all?{ |a| [String, Addressable::URI, URI].any?{|c| a.is_a?(c) } }\n raise ArgumentError, 'Arguments must either be Strings or URIs' \n end\n\n absolute_url = Addressable::URI.parse(abs_url).normalize \n raise ArgumentError, \"#{absolute_url} must be absolute\" unless absolute_url.absolute?\n href = Addressable::URI.parse(a_href).normalize \n \n # return :href if :href is already absolute\n return href.to_s if href.absolute?\n\n return absolute_url.join(href).to_s\n end",
"title": ""
},
{
"docid": "a18b0f58cd791b97113445dcc4da5785",
"score": "0.56398886",
"text": "def link_urls(tweet)\n tweet.gsub(/([A-Z]+:\\/\\/[^\\s]+)/i, '<a href=\"\\1\">\\1</a>')\n end",
"title": ""
},
{
"docid": "fbd64868adf2f76975ddca0d06df061f",
"score": "0.56364036",
"text": "def invitation_link\n #TODO: use a config file setting\n hostname = ENV['BASE_URL'] || 'http://localhost:3000'\n # user_url = Rails.application.routes.url_helpers.user_url(invitee_user)\n # \"#{user_url}/complete_invitation/#{invitee_user.invitation_token}\"\n \"#{hostname}/#{self.class.name.tableize}/#{self.id}/complete_invitation/#{self.invitation_token}\"\n end",
"title": ""
},
{
"docid": "49c2bf140db97949c2c7751b4ddd64e1",
"score": "0.5632403",
"text": "def normalize_links(links)\r\n extensions = \"png|gif|jpg|pdf|zip\"\r\n beginnings = \"mailto|tel\"\r\n\r\n links_array = []\r\n\r\n links.each_with_index do |link|\r\n link = link.attribute('href').to_s\r\n\r\n # remove #hash\r\n link.gsub!(/#.+$/, '')\r\n next if link.empty?\r\n\r\n # Remove links to images and other files then to mailto/tel \r\n next if link =~ /\\.(#{extensions})(\\?.*)?$/\r\n next if link =~ /^(#{beginnings})/\r\n \r\n # Add the base domain to relative URLs\r\n link = link =~ /^http/ ? link : \"#{@opts.base}#{link}\" \r\n link = \"http://#{link}\" unless link =~ /^http/\r\n\r\n # Keep only links in our base domain\r\n next unless link.include? @opts.base\r\n\r\n links_array << link\r\n end\r\n\r\n links_array.uniq\r\n end",
"title": ""
},
{
"docid": "64e9648d9d01528bab398bcf857c4865",
"score": "0.562492",
"text": "def ensure_valid_link(link)\n if link.start_with? '//'\n link = 'https:' + link\n end\n link\n end",
"title": ""
},
{
"docid": "e859d651be0a48b152066fe4a0a4a5f9",
"score": "0.56142956",
"text": "def fix_link(link_text)\n if link_text.include?(\"www.\") && !link_text.include?(\"http\")\n return link_text.gsub(\"www.\", \"http://\")\n else\n return link_text\n end\n end",
"title": ""
},
{
"docid": "5d96d61d96112e02242d7e1f804987a8",
"score": "0.56047636",
"text": "def fix_links(doc, old_path, new_path)\n # figure out relative link mapping\n prefix = Pathname.new(old_path).relative_path_from(Pathname.new(new_path))\n\n url_tags = {\n 'img' => 'src',\n 'script' => 'src',\n 'a' => 'href'\n }\n\n # grab all url links\n doc.search(url_tags.keys.join(',')).each do |node|\n url_param = url_tags[node.name]\n src = node[url_param]\n\n unless src.empty?\n path = Pathname.new(src)\n uri = URI.parse(src)\n # only fix relative links and non http calls\n if path.relative? && !%w( http https ).include?(uri.scheme)\n node[url_param] = (prefix+path).to_s\n end\n end\n end\nend",
"title": ""
},
{
"docid": "8fc61604a100c179633a2e06e2cadd6c",
"score": "0.55611736",
"text": "def create_absolute_url url\n # Append the base URL (scheme+host) if the provided URL is relative\n URI.parse(URI.encode url).host.nil? ? \"#{URI.parse(@url).scheme}://#{URI.parse(@url).host}#{url}\" : url\n end",
"title": ""
},
{
"docid": "e9fe9d7524407d9ecf64be2c29fe679c",
"score": "0.55556065",
"text": "def link_urls_and_email(val)\n val = val.dup\n # http://daringfireball.net/2010/07/improved_regex_for_matching_urls\n url = %r{(?i)\\b(?:https?://|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\\/)(?:[^\\s()<>]+|\\([^\\s()<>]+|\\([^\\s()<>]+\\)*\\))+(?:\\([^\\s()<>]+|\\([^\\s()<>]+\\)*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’])}i\n # http://www.regular-expressions.info/email.html\n email = /[A-Z0-9_\\.%\\+\\-\\']+@(?:[A-Z0-9\\-]+\\.)+(?:[A-Z]{2,4}|museum|travel)/i\n matches = [val.scan(url), val.scan(email)].flatten\n unless val =~ /<a/ # we'll assume that linking has alraedy occured and we don't want to double link\n matches.each do |match|\n if match =~ email\n val = val.gsub(match, \"<a href='mailto:#{match}'>#{match}</a>\")\n else\n val = val.gsub(match, \"<a href='#{match}'>#{match}</a>\")\n end\n end\n end\n val\n end",
"title": ""
},
{
"docid": "bf3b6703ec1834a14d444cc1527beea4",
"score": "0.5551844",
"text": "def redirect_link(link)\n return nil if link.blank?\n\n begin\n uri = URI.parse(link)\n rescue URI::InvalidURIError\n end\n\n if uri&.host\n link # fully qualified url\n elsif link.start_with?('/')\n dm_cms.showpage_url(slug: link[1..-1]) # absolute link to this site, with no host/scheme\n else\n dm_cms.showpage_url(slug: link) # relative link/slug\n end\n end",
"title": ""
},
{
"docid": "7590aaf5c4d508f51c3847c661177d3a",
"score": "0.555007",
"text": "def url_for_link link\n case link\n when LINK_REGEX # => [[foo bar]]\n '/wiki/' + Article.parametrize($~[1]) # => /wiki/foo_bar\n when EXTERNAL_LINK_REGEX # => http://example.com/\n $~[1] # => http://example.com/\n when RELATIVE_PATH_REGEX # => /issues/100\n $~[1] # => /issues/100\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "5b5793ab3402801232b6fe0d9af4ce72",
"score": "0.55489826",
"text": "def external_link(url)\n if url =~ URI::regexp\n return link_to url, url\n else\n return url\n end\n end",
"title": ""
},
{
"docid": "69e2ca2e0e66e78b45c4bac45c5549fb",
"score": "0.5543475",
"text": "def normalize_url(var)\n\t\t\tquerystring = (!var.query.nil?) ? '?' + var.query : ''\n\t\t\tif var.scheme.nil? || (var.scheme.downcase != \"mailto\" && var.scheme != \"javascript\")\n\t\t\t\tif var.relative?\n\t\t\t\t\tpath = var.path\n\t\t\t\t\tif url.path.nil? \n\t\t\t\t\t\tmain_path = url.path.slice(0..url.path.rindex('/')) \n\t\t\t\t\t\telse\n\t\t\t\t\t\tmain_path = '/'\n\t\t\t\t\tend\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif path.match('^\\/')\n\t\t\t\t\t\tpath = url.scheme + '://' + url.host + path + querystring\n\t\t\t\t\t\telse\t\t\t\t\t\t\n\t\t\t\t\t\tpath = url.scheme + '://' + url.host + main_path + path + querystring\n\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\tpath = var.scheme + '://' + var.host + var.path + querystring\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\treturn path\n\t\tend",
"title": ""
},
{
"docid": "304cb869985e53b533cba52934aa5f5b",
"score": "0.55406606",
"text": "def normalize_url url\n unless url.match(/https?:\\/\\//)\n url = \"http://#{url}\"\n end\n\n url\n end",
"title": ""
},
{
"docid": "36aba0eecae8b1a76ae22d92bc8db95e",
"score": "0.5528998",
"text": "def absolutize_url(url, base_path = '')\n original_url = url\n\n unless original_url[URI::regexp(%w[http https])]\n protocol = default_url_options[:protocol]\n protocol = \"http://\" if protocol.blank?\n protocol+= \"://\" unless protocol.include?(\"://\")\n\n host = default_url_options[:host]\n\n [host,protocol].each{|r| original_url.gsub!(r,\"\") }\n host = protocol+host unless host[URI::regexp(%w[http https])]\n\n url = URI.join host, base_path, original_url\n end\n\n url.to_s\n end",
"title": ""
},
{
"docid": "2cae3f96d01303685bcb34193073e1c7",
"score": "0.5527911",
"text": "def relative_link?(link)\n uri = URI.parse(link)\n uri.relative?\n rescue URI::InvalidURIError\n false\n end",
"title": ""
},
{
"docid": "5d1d31be62b19cc7563432a0db4e22e5",
"score": "0.5513268",
"text": "def normalize_url(href) #:nodoc:\n uri = URI.parse(href)\n normalized_url = []\n normalized_url << \"#{uri.scheme}://\" if uri.scheme\n normalized_url << uri.host if uri.host\n normalized_url << \":#{uri.port}\" if uri.port && ![80,443].include?(uri.port)\n normalized_url << uri.path if uri.path\n normalized_url << \"?#{uri.query}\" if uri.query\n normalized_url.join\n end",
"title": ""
},
{
"docid": "6c0eda015003619789d31f16e983a6aa",
"score": "0.55107087",
"text": "def relative_link(file, link)\n f = Pathname.new(file).dirname\n l = Pathname.new(\"#{@out}/#{link}\")\n l.relative_path_from f\n end",
"title": ""
},
{
"docid": "1eda9f30838bca150fccc30e2e99691a",
"score": "0.5506445",
"text": "def forward_link\n uri_parts = @_ctx.env['PATH_INFO'].split(/(?<!\\$)\\//)\n link_parts = link.split(/(?<!\\$)\\//)\n link_parts.each_index {|i| uri_parts[i] = link_parts[i] }\n uri_parts.join('/') << ((qs = @_ctx.env['QUERY_STRING']).empty? ? '' : \"?#{qs}\")\n end",
"title": ""
},
{
"docid": "488a96a0f3afc1ede2f962835270f76b",
"score": "0.5499606",
"text": "def format_link link\n puts \"reformatting: \" + link\n return URI::join( $root_url, link )\nend",
"title": ""
},
{
"docid": "d40768806f4d8161b0f8cb45b29190b1",
"score": "0.54911876",
"text": "def absolute_url(relative)\n \"#{server_url}#{relative}\"\n end",
"title": ""
},
{
"docid": "ec6aeec1e02592e71805d82dd89adaee",
"score": "0.5488527",
"text": "def url_absolute(relative_url)\n unless relative_url.blank?\n case Rails.env\n when 'development'\n host = 'http://localhost:3000'\n when 'staging'\n host = 'http://apifoodapp.stagingapps.net'\n when 'production'\n host = '**CHANGE HOSTNAME HERE**'\n end\n\n URI::join(host, relative_url).to_s\n end\nend",
"title": ""
},
{
"docid": "f8728106c9d53c5afe9db31817e962e6",
"score": "0.5487642",
"text": "def normalize_url(options = {})\n href = URI(url)\n href.path = item.normalized_hashed_url(options)\n href.to_s\n end",
"title": ""
},
{
"docid": "ca4b69ad659dde7191ae5900230c0ae7",
"score": "0.5474681",
"text": "def relative_url(protocol='https')\n url(protocol).gsub(/[^\\/]*\\/\\/maps\\.googleapis\\.com/, \"\")\n end",
"title": ""
},
{
"docid": "bc367680a050c696e1077acec9080458",
"score": "0.5471034",
"text": "def auto_link_urls(text, options = {})\n # to_str is for SafeBuffer objects (text marked html_safe)\n text.to_str.gsub(AUTO_LINK_RE) do\n match = Regexp.last_match\n href = match[0]\n scheme = match[1]\n punctuation = []\n\n if auto_linked?(match)\n # do not change string; URL is already linked\n href\n else\n # don't include trailing punctuation character as part of the URL\n while href.sub!(PUNCTUATION_RE, \"\")\n punctuation.push Regexp.last_match(0)\n if (opening = BRACKETS[punctuation.last]) && href.scan(opening).size > href.scan(punctuation.last).size\n href << punctuation.pop\n break\n end\n end\n\n link_text = block_given? ? yield(href) : href\n href = \"http://\" + href unless scheme\n\n # content_tag(:a, link_text, html.merge(href: href)) + punctuation.reverse.join('')\n anchor_tag(href, link_text, options) + punctuation.reverse.join\n end\n end\n end",
"title": ""
},
{
"docid": "987d11722c5db3f8c4aa3de5255a8147",
"score": "0.54617345",
"text": "def expect_user_confirmation_path\n 'http://localhost:3000' + user_confirmation_path({ confirmation_token: user.confirmation_token })\n end",
"title": ""
},
{
"docid": "54022ace2773086a06f0450b7d3ecb11",
"score": "0.54555815",
"text": "def toAbsoluteUrls(input, page_url)\n content = Nokogiri::HTML.fragment(input)\n content.css(\"a\").each do |a|\n next unless a.get_attribute('href').start_with?('#')\n a['href'] = canonical(page_url) + a['href']\n end\n content.to_s\n end",
"title": ""
},
{
"docid": "d2ded5dbb0a989d57e9d46b54b3e04de",
"score": "0.54468197",
"text": "def urls_to_links(s)\n urls = /((https?:\\/\\/|www\\.)([-\\w\\.]+)+(:\\d+)?(\\/([\\w\\/_\\.\\-\\%]*(\\?\\S+)?)?)?)/\n s.gsub(urls) {\n if $1[-1..-1] == '.'\n url = $1.chop\n '<a href=\"'+url+'\">'+url+'</a>.'\n else\n '<a href=\"'+$1+'\">'+$1+'</a>'\n end\n }\nend",
"title": ""
},
{
"docid": "e2e844a7d48a54073ed01f5ef70d07dd",
"score": "0.5437214",
"text": "def unify_link(s)\n s = s.downcase.sub(/^https?\\:\\/\\//, '').sub(/^www./,'').sub(/^http?\\:\\/\\//, '')\n end",
"title": ""
},
{
"docid": "109a693ac0d8db858b5c4be61292ccb6",
"score": "0.5436736",
"text": "def confirm_email_link\n link = \"#{ENV['PORTAL_LINK']}/confirm_email?token=#{self.access_key}&email=#{self.user.email}\"\n end",
"title": ""
},
{
"docid": "f456c88a4e69051d77c56436e59bad94",
"score": "0.54282385",
"text": "def relative_link(relurl,cur_folder=nil)\n\t\t\treturn relurl if ! cur_folder or cur_folder.empty?\n\t\t\tcur_folder+='/' unless cur_folder[cur_folder.length-1]='/'\n\t\t\tif relurl=~/^#{cur_folder}/\n\t\t\t\treturn relurl.sub(/^#{cur_folder}/,'')\n\t\t\telse\n\t\t\t\treturn \"../\"+relurl\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "89351eeb2c080e9b61e3468df305b4c9",
"score": "0.5422652",
"text": "def format_hint_external_links(html)\n html.gsub(/href=\"http/i, 'target=\"_blank\" href=\"http').html_safe\n end",
"title": ""
},
{
"docid": "6e3a113ed59def7ed16e2d98f64210ca",
"score": "0.5422259",
"text": "def apply_link\n arr = self.message.split\n i = arr.map { |x| x.include? (\"http://\") || x.include?(\"https://\") }.index(true)\n unless i.nil?\n url = arr[i]\n arr[i] = \"<a href='#{self.link}' target='_blank'>#{url}</a>\"\n end\n self.message = arr.join(\" \")\n end",
"title": ""
},
{
"docid": "db177728fa0aa6048242e00b6d34b2c9",
"score": "0.54219955",
"text": "def url_for_link( link )\n link_helper.url_for_link( find_project, :bulletin => find_bulletin, :link => link )\n end",
"title": ""
},
{
"docid": "2e06103bbfb4c1116762d55d15b68ea8",
"score": "0.54217964",
"text": "def relative_link(params, attrs=nil, &block)\n params.each do |k,v|\n params[k.to_s] = params.delete(k)\n end\n params = @parameters.to_hash.merge(params)\n a(Session.http_get_address(params), attrs, &block)\n end",
"title": ""
},
{
"docid": "d77f8282e9ce013ce0b406812f4a6024",
"score": "0.5416152",
"text": "def convert_link(url, link)\n url.match /([a-z]+.)(\\/\\/[^\\/]+)/\n schema = $1\n authority = $2\n path = url.gsub schema+authority, ''\n path = path.gsub(/[a-z]{1}\\.html/, '')\n\n # puts \"schema, #{schema}\"\n # puts \"authority, #{authority}\"\n # puts \"path, #{path}\"\n\n case link\n when /^(\\/{1})/\n schema + authority + link\n when /^(\\.{2})/\n result = link.split('/').inject(path) do |memo, element|\n # if element is .., we want to remove one level of the current path\n if element == '..'\n memo.split('/')[0..-2].join('/')\n else\n # if the element is not .., we want to add it to the schema\n memo += ('/' + element)\n end\n end\n schema + authority + result\n when /^([a-z]+:)/\n link\n else\n schema + authority + path + link\n end\nend",
"title": ""
},
{
"docid": "006088e4b9c6dfedf81e6b72935f2309",
"score": "0.5403895",
"text": "def auto_link_urls_custom(text, href_options = {})\n options = href_options.dup\n options[:rel] = \"nofollow\" unless options.delete(:suppress_no_follow)\n\n text.gsub(Twitter::Regex[:valid_url]) do\n all, before, url, protocol = $1, $2, $3, $4\n html_attrs = tag_options(options.stringify_keys) || \"\"\n full_url = (protocol =~ WWW_REGEX ? \"http://#{url}\" : url)\n \"#{before}<a href=\\\"#{full_url}\\\"#{html_attrs}>#{url}</a>\"\n end\n end",
"title": ""
},
{
"docid": "44d14248e1f1416a104573f330b4be64",
"score": "0.53984547",
"text": "def get_relative_href(url)\n url.gsub!(@selfservice_url,\"\")\n end",
"title": ""
},
{
"docid": "b9b394df98be531a787dbe183e1d47f3",
"score": "0.5394005",
"text": "def auto_link_urls(text, html_options = {})\n link_attributes = html_options\n text.gsub(AUTO_LINK_RE) do\n href = $&\n punctuation = ''\n left, right = $`, $'\n # detect already linked URLs and URLs in the middle of a tag\n if left =~ /<[^>]+$/ && right =~ /^[^>]*>/\n # do not change string; URL is alreay linked\n href\n else\n # don't include trailing punctuation character as part of the URL\n if href.sub!(/[^\\w\\/-]$/, '') and punctuation = $& and opening = BRACKETS[punctuation]\n if href.scan(opening).size > href.scan(punctuation).size\n href << punctuation\n punctuation = ''\n end\n end\n\n link_text = block_given?? yield(href) : href\n href = 'http://' + href unless href.index('http') == 0\n\n \"<a href=\\\"#{href}\\\">#{h(link_text)}</a>\" + punctuation\n end\n end\n end",
"title": ""
},
{
"docid": "03cfc14684d09e01921c2d74a2ad6aa4",
"score": "0.5389785",
"text": "def url_for(relative_path)\n if relative_path.respond_to?(:relative_url)\n return safe(relative_path.relative_url) # new resource engine\n elsif relative_path.respond_to?(:url)\n return safe(relative_url(relative_path.url)) # old legacy engine\n elsif relative_path.to_s.start_with?(\"/\", \"http\", \"#\", \"mailto:\", \"tel:\")\n return safe(relative_path)\n end\n\n find_relative_url_for_path(relative_path)\n end",
"title": ""
},
{
"docid": "bf0f88208d865975c81c2e0d6c0490d7",
"score": "0.5380449",
"text": "def absolutize link_or_path, attr=:href\n path =\n case link_or_path\n when String\n link_or_path\n when Mechanize::Page::Link\n link_or_path.href\n when Nokogiri::XML::Element\n link_or_path.attribute(attr.to_s).to_s\n when Nokogiri::XML::Attr\n link_or_path.to_s\n when respond_to?(attr.to_sym)\n link_or_path.send attr.to_sym\n when nil\n return nil\n end\n path.present? ? URI.decode(safe_uri_join(url, path).to_s) : url\n end",
"title": ""
},
{
"docid": "a5238164719d35b5a58749db993fb397",
"score": "0.53712684",
"text": "def absolute_url(append = '/', base_url: config[:base_url])\n return append if append&.match(/\\A(http[s]?:)?\\/\\//) # already a url (https://, http://, //)\n\n append = strip_html_from_path(append)\n append = strip_index_from_path(append)\n\n append = '' if append == '/' # No trailing slash for base index like `sharesight.com`, but still for `sharesight.com/xero/`.\n return \"#{base_url}#{append}\"\n end",
"title": ""
},
{
"docid": "51a7b48b2b439208af410e9f41fa20dd",
"score": "0.53631115",
"text": "def link_urls(my_str)\n # auto_link is part of rinku which gets added to ActionController\n out = ActionController::Base.helpers.auto_link(my_str, html: { target: '_blank' }) do |text|\n ActionController::Base.helpers.truncate(text, length: 60)\n # text.ellipsisize(80)\n end\n # We need to add the title attribute with the full URL so people can see the full url with hover on most browser if they like\n # unfortunately, rinku doesn't allow a dynamic title attribute to be easily added that is based on the href value, so Nokogiri\n doc = Nokogiri::HTML::DocumentFragment.parse(out)\n doc.css('a').each do |link|\n link['title'] = link.attributes['href'].value\n end\n doc.to_s\n end",
"title": ""
},
{
"docid": "004541c1cdaca824755639c038e83537",
"score": "0.53565806",
"text": "def urls\n links.map { |link| to_absolute(link) }.compact\n end",
"title": ""
},
{
"docid": "448db2835ee6ee551f07fb07db7d045f",
"score": "0.53539723",
"text": "def normalized_url\n \t\"http://#{self.original_url}\" unless self.original_url=~/^https?:\\/\\//\n end",
"title": ""
},
{
"docid": "3d7bf5b9891e4614eff23b0e41ff76af",
"score": "0.5352722",
"text": "def url_for(options)\n url = ''\n\n unless options.delete(:only_path)\n url << (options.delete(:protocol) || 'http')\n url << '://' unless url.match(\"://\")\n\n raise \"Missing host to link to! Please provide :host parameter or set default_url_options[:host]\" unless options[:host]\n\n url << options.delete(:host)\n url << \":#{options.delete(:port)}\" if options.key?(:port)\n else\n # Delete the unused options to prevent their appearance in the query string.\n [:protocol, :host, :port, :skip_relative_url_root].each { |k| options.delete(k) }\n end\n trailing_slash = options.delete(:trailing_slash) if options.key?(:trailing_slash)\n url << ActionController::Base.relative_url_root.to_s unless options[:skip_relative_url_root]\n anchor = \"##{CGI.escape options.delete(:anchor).to_param.to_s}\" if options[:anchor]\n generated = ActionController::Routing::Routes.generate(options, {})\n url << (trailing_slash ? generated.sub(/\\?|\\z/) { \"/\" + $& } : generated)\n url << anchor if anchor\n\n url\n end",
"title": ""
},
{
"docid": "5478ba6873b5b4189ba11d59b29f082f",
"score": "0.5350029",
"text": "def url\n begin\n if (linked_to.match(/:\\/\\/|^\\//))\n url_for(linked_to)\n else\n p = linked_to.split('#')\n\n controller = p.first\n controller = \"/#{controller}\" unless controller.include?('/')\n\n action, id = p.last.split(':')\n action = 'index' if action.blank? or action.strip == '*'\n\n options = {}\n options = options.merge(controller: controller, action: action, only_path: true)\n options = options.merge(id: id) if id.present?\n\n url_for(options)\n end\n rescue => e\n logger.error e.message\n logger.error e.backtrace.join(\"\\n\")\n # in case we could not create a proper backlink url we will silently\n # fail with the app's root url.\n root_url(only_path: true)\n end\n end",
"title": ""
},
{
"docid": "e097e2dd7590022e001c106fc53745f1",
"score": "0.53486174",
"text": "def parse_email_for_anchor_text_link(email, link_text)\n if textify_images(email.default_part_body) =~ %r{<a[^>]*href=['\"]?([^'\"]*)['\"]?[^>]*?>[^<]*?#{link_text}[^<]*?</a>}\n URI.split($1)[5..-1].compact!.join(\"?\").gsub(\"&\", \"&\")\n # sub correct ampersand after rails switches it (http://dev.rubyonrails.org/ticket/4002)\n else\n return nil\n end\nend",
"title": ""
},
{
"docid": "2660ffa1907a8d6ff9fcc5ac9e35dc0c",
"score": "0.5345102",
"text": "def extract_url_from_email(email)\n doc = Nokogiri::HTML(email.to_s)\n\n hrefs = doc.xpath(\"//a[starts-with(text(), 'C')]/@href\").map(&:to_s)\n\n # We don't actually want our string to say test.test.com, cause\n # apparently that's a website!\n hrefs[0][\"http://test.test.com\"] = \"\"\n hrefs[0]\n end",
"title": ""
},
{
"docid": "a3bf895c72ca9a6342665015b0bd06b5",
"score": "0.53345793",
"text": "def sanitize link\n link = \"http://#{link.strip}\" unless link.nil? or link =~ /\\s*https?:\\/\\//i\n\n begin\n uri = URI.parse link\n %w{ fragment query user password userinfo port }.each { |p| uri.send \"#{p}=\", nil }\n\n return uri.normalize.to_s\n rescue URI::InvalidURIError\n # do nothing\n end\n\n link\n end",
"title": ""
},
{
"docid": "9bcbd369952513e9b9a3366641305ed7",
"score": "0.5331941",
"text": "def normalize_url(original_url)\n if original_url.nil? || original_url.strip.empty?\n nil\n else\n uri = Addressable::URI.heuristic_parse(original_url.strip).normalize\n uri.host.present? && /^http(s)?$/.match(uri.scheme) ? uri.to_s : nil\n end\n end",
"title": ""
},
{
"docid": "7593c4746b71d826faedc1978e1ccd28",
"score": "0.53315806",
"text": "def get_password_change_link_from_email(email_link)\n uri = URI email_link\n pwd_change_uri = URI edit_user_password_path\n pwd_change_uri.query = uri.query\n pwd_change_link = pwd_change_uri.to_s\n return pwd_change_link\nend",
"title": ""
},
{
"docid": "7a2b249a5a2f48a93515de83335b1250",
"score": "0.5327766",
"text": "def test_tokenize_urls_with_link_as_name\n mailer = Harbor::Mailer.new\n destination_url = \"http://test.com\"\n\n mailer.rawhtml = \"<a href=\\\"#{destination_url}\\\">#{destination_url}</a>\"\n mailer.tokenize_urls!(\"http://m.wieck.com\")\n\n url = \"http://m.wieck.com/m/#{mailer.envelope_id}?r=#{CGI.escape([destination_url].pack(\"m\"))}\"\n assert_equal(\"<a href=\\\"#{url}\\\">#{destination_url}</a>\", mailer.html)\n end",
"title": ""
},
{
"docid": "6be90c14499fa3f5dc45aaba91bf7fe4",
"score": "0.5323524",
"text": "def auto_link_urls_custom(text, href_options = {})\n options = href_options.dup\n options[:rel] = \"nofollow\" unless options.delete(:suppress_no_follow)\n\n text.gsub(Twitter::Regex[:valid_url]) do\n all, before, url, protocol, domain, path, query_string = $1, $2, $3, $4, $5, $6, $7\n if !protocol.blank?\n html_attrs = tag_options(options.stringify_keys) || \"\"\n \"#{before}<a href=\\\"#{html_escape(url)}\\\"#{html_attrs}>#{html_escape(url)}</a>\"\n else\n all\n end\n end\n end",
"title": ""
},
{
"docid": "32e34bdc4d802e18c6d7c13aa8dff9f1",
"score": "0.53198034",
"text": "def http \n (link =~ /^http:\\/\\//) ? link : \"http://#{link}\"\n end",
"title": ""
},
{
"docid": "7909e86ebb59f55480b5e7d05bd04d85",
"score": "0.53180563",
"text": "def confirmation_url_from_email(email)\n body = email.body\n match = body.match(%r{http://localhost:3000(/identity/confirmation\\?confirmation_token=[^\"]+)})\n\n raise 'No reset password link found' unless match\n\n match[1]\n end",
"title": ""
},
{
"docid": "d309ed643cc051a9ff0324c982a1e971",
"score": "0.5312117",
"text": "def link_urls(my_str)\n out = ActionController::Base.helpers.auto_link(my_str, html: { target: '_blank' }) do |text|\n ActionController::Base.helpers.truncate(text, length: 60)\n # text.ellipsisize(80)\n end\n # We need to add the title attribute with the full URL so people can see the full url with hover on most browser if they like\n # unfortunately, rinku doesn't allow a dynamic title attribute to be easily added that is based on the href value, so Nokogiri\n doc = Nokogiri::HTML::DocumentFragment.parse(out)\n doc.css('a').each do |link|\n link['title'] = link.attributes['href'].value\n end\n doc.to_s\n end",
"title": ""
},
{
"docid": "fed9a0d9db8ef4331c61e98f2cbf56ba",
"score": "0.5311041",
"text": "def url\n return @link['href'] unless templated?\n raise MissingURITemplateVariablesException if @uri_variables == nil\n\n @url ||= URITemplate.new(@link['href']).expand(@uri_variables)\n end",
"title": ""
},
{
"docid": "a21d433ebb27d9478c43a503776187d5",
"score": "0.53099346",
"text": "def standardize_hrefs\n nodes do |node|\n if node['href']\n node['href'] = escape_path( node['href'] )\n end\n end\n end",
"title": ""
},
{
"docid": "24107d0d649dfbe0757b4764eedbcf6d",
"score": "0.5309445",
"text": "def simple_format_urls text\n markdown_inline_style = %r{\\[(.*?)\\]\\(((https?://|mailto:).*?)\\)}\n text = text.gsub markdown_inline_style, '<a href=\"\\2\" target=\"_blank\">\\1</a>'\n angle_brackets = %r{\\<((https?://|mailto:).*?)\\>}\n text.gsub angle_brackets, '<a href=\"\\1\" target=\"_blank\">\\1</a>'\n end",
"title": ""
},
{
"docid": "023a540c2bb5d8fcdc26a9e605305043",
"score": "0.5306491",
"text": "def link_to( url )\n [@base, url].join(\"\")\n end",
"title": ""
},
{
"docid": "84df23af5fc242c04de3cee409d9623c",
"score": "0.53053236",
"text": "def confirm_user_url(user)\n url_for(only_path: false, \n controller: \"users\", \n id: \"#{user.id}\", \n action: \"confirm\", \n confirmation_code: \"#{user.confirmation_code}\")\n end",
"title": ""
},
{
"docid": "0b7041068078f7c4bfc5f10c84d4e6d2",
"score": "0.53014165",
"text": "def mms_auto_link_urls(text, html_options = {})\n \n link_attributes = html_options.stringify_keys\n \n text.gsub(MMS_AUTO_LINK_RE) do\n href = $& \n punctuation = ''\n left, right = $`, $'\n if /[@]/ =~ left or /[@]/ =~ right\n return text\n end\n # detect already linked URLs and URLs in the middle of a tag\n if left =~ /<[^>]+$/ && right =~ /^[^>]*>/\n # do not change string; URL is alreay linked\n href \n else\n # don't include trailing punctuation character as part of the URL\n if href.sub!(/[^\\w\\/-]$/, '') and punctuation = $& and opening = MMS_BRACKETS[punctuation]\n if href.scan(opening).size > href.scan(punctuation).size\n href << punctuation\n punctuation = ''\n end\n end\n \n link_text = block_given?? yield(href) : href\n href = 'http://' + href unless href.index('http') == 0\n \n content_tag(:a, h(link_text), link_attributes.merge('href' => href)) + punctuation\n end\n end\n end",
"title": ""
},
{
"docid": "6d89dbb1d6ee6a15c9e6b590b9b46fb9",
"score": "0.5300732",
"text": "def urls(text)\n \n text.gsub(@regex[:protocol]) do\n scheme, href = $1, $&\n punctuation = []\n\n if auto_linked?($`, $')\n # do not change string; URL is already linked\n href\n else\n # don't include trailing punctuation character as part of the URL\n while href.sub!(/[^#{@regex[:word_pattern]}\\/-]$/, '')\n punctuation.push $&\n if opening = @regex[:brackets][punctuation.last] and href.scan(opening).size > href.scan(punctuation.last).size\n href << punctuation.pop\n break\n end\n end\n\n link_text = block_given?? yield(href) : href\n href = '//' + href unless scheme\n\n \"<a href='#{href}' target='_blank'>#{link_text}</a>\" + punctuation.reverse.join('')\n end\n end\n end",
"title": ""
},
{
"docid": "194f5dd041eb8691168284223afbbcde",
"score": "0.52938855",
"text": "def url_for_link( link )\n link_helper.url_for_link( bulletin.project, :bulletin => bulletin, :link => link )\n end",
"title": ""
}
] |
eec9e0d256bd6b7523115228153747e1
|
Currently unused, this was an experiment in how to get the width of a successful tb.render.
|
[
{
"docid": "26cc7eeab5c2b1a2561992589497cc71",
"score": "0.0",
"text": "def accumulated_width\n # puts \"In PrawnPDFFormattedWrap.accumulated_width, value is #{@line_wrap.accumulated_width}\"\n @line_wrap.accumulated_width\n end",
"title": ""
}
] |
[
{
"docid": "8342563c5f84b78808a7dc47865b9921",
"score": "0.6987743",
"text": "def width\n unless self.display_length.nil?\n self.display_length\n else\n if self.text.length > 23\n 3\n elsif self.text.length > 10\n 2\n else\n 1\n end\n end\n end",
"title": ""
},
{
"docid": "0addb39f1ff6f152e9a753d6c2dbc9e7",
"score": "0.69714576",
"text": "def width; end",
"title": ""
},
{
"docid": "0addb39f1ff6f152e9a753d6c2dbc9e7",
"score": "0.69714576",
"text": "def width; end",
"title": ""
},
{
"docid": "0addb39f1ff6f152e9a753d6c2dbc9e7",
"score": "0.69714576",
"text": "def width; end",
"title": ""
},
{
"docid": "0addb39f1ff6f152e9a753d6c2dbc9e7",
"score": "0.69714576",
"text": "def width; end",
"title": ""
},
{
"docid": "0addb39f1ff6f152e9a753d6c2dbc9e7",
"score": "0.69714576",
"text": "def width; end",
"title": ""
},
{
"docid": "0addb39f1ff6f152e9a753d6c2dbc9e7",
"score": "0.69714576",
"text": "def width; end",
"title": ""
},
{
"docid": "0addb39f1ff6f152e9a753d6c2dbc9e7",
"score": "0.69714576",
"text": "def width; end",
"title": ""
},
{
"docid": "0addb39f1ff6f152e9a753d6c2dbc9e7",
"score": "0.69714576",
"text": "def width; end",
"title": ""
},
{
"docid": "0addb39f1ff6f152e9a753d6c2dbc9e7",
"score": "0.69714576",
"text": "def width; end",
"title": ""
},
{
"docid": "0addb39f1ff6f152e9a753d6c2dbc9e7",
"score": "0.69714576",
"text": "def width; end",
"title": ""
},
{
"docid": "0addb39f1ff6f152e9a753d6c2dbc9e7",
"score": "0.69714576",
"text": "def width; end",
"title": ""
},
{
"docid": "0addb39f1ff6f152e9a753d6c2dbc9e7",
"score": "0.69714576",
"text": "def width; end",
"title": ""
},
{
"docid": "0addb39f1ff6f152e9a753d6c2dbc9e7",
"score": "0.69714576",
"text": "def width; end",
"title": ""
},
{
"docid": "0addb39f1ff6f152e9a753d6c2dbc9e7",
"score": "0.69714576",
"text": "def width; end",
"title": ""
},
{
"docid": "0addb39f1ff6f152e9a753d6c2dbc9e7",
"score": "0.69714576",
"text": "def width; end",
"title": ""
},
{
"docid": "0addb39f1ff6f152e9a753d6c2dbc9e7",
"score": "0.69714576",
"text": "def width; end",
"title": ""
},
{
"docid": "0addb39f1ff6f152e9a753d6c2dbc9e7",
"score": "0.69714576",
"text": "def width; end",
"title": ""
},
{
"docid": "0addb39f1ff6f152e9a753d6c2dbc9e7",
"score": "0.69714576",
"text": "def width; end",
"title": ""
},
{
"docid": "0addb39f1ff6f152e9a753d6c2dbc9e7",
"score": "0.69714576",
"text": "def width; end",
"title": ""
},
{
"docid": "0addb39f1ff6f152e9a753d6c2dbc9e7",
"score": "0.69714576",
"text": "def width; end",
"title": ""
},
{
"docid": "4ed3222bc9e82d6cb819308171c119a9",
"score": "0.69603115",
"text": "def width\r\n end",
"title": ""
},
{
"docid": "1fcccf0401046e6ca2c7eb0e73224daa",
"score": "0.6902283",
"text": "def width\n end",
"title": ""
},
{
"docid": "1fcccf0401046e6ca2c7eb0e73224daa",
"score": "0.6901463",
"text": "def width\n end",
"title": ""
},
{
"docid": "1fcccf0401046e6ca2c7eb0e73224daa",
"score": "0.6901463",
"text": "def width\n end",
"title": ""
},
{
"docid": "1fcccf0401046e6ca2c7eb0e73224daa",
"score": "0.6901463",
"text": "def width\n end",
"title": ""
},
{
"docid": "0504e7be7f76db7fed380b33a774523f",
"score": "0.68937904",
"text": "def width\r\n 0\r\n end",
"title": ""
},
{
"docid": "aff69e3899e7ab2d85b334f72b6125f6",
"score": "0.68794674",
"text": "def dynamic_width; end",
"title": ""
},
{
"docid": "aff69e3899e7ab2d85b334f72b6125f6",
"score": "0.68794674",
"text": "def dynamic_width; end",
"title": ""
},
{
"docid": "aa5cb59ef8409690cca5ce1322a89359",
"score": "0.68677557",
"text": "def width\n assert_exists\n return @o.invoke(\"width\").to_s\n end",
"title": ""
},
{
"docid": "aa5cb59ef8409690cca5ce1322a89359",
"score": "0.68677557",
"text": "def width\n assert_exists\n return @o.invoke(\"width\").to_s\n end",
"title": ""
},
{
"docid": "b6525e6ab0612c223104b128d46895bc",
"score": "0.68540794",
"text": "def calc_width\n Graphics.width\n end",
"title": ""
},
{
"docid": "3ddc1cbcab75f2ae83c441d6401bdab5",
"score": "0.6842948",
"text": "def show_width\n\treturn @width\nend",
"title": ""
},
{
"docid": "91868e6da7baaba68ede5b55ca58b497",
"score": "0.68420297",
"text": "def width\n \n end",
"title": ""
},
{
"docid": "47b467c4ac0011014f3fd0f64883a3be",
"score": "0.68364054",
"text": "def get_width\n \t@width\n end",
"title": ""
},
{
"docid": "3e0e8b76018caca4c2eb6d7cb065f94f",
"score": "0.68234",
"text": "def print_width; end",
"title": ""
},
{
"docid": "5c8b6ca7f260860e07d346abfe9af14d",
"score": "0.6806644",
"text": "def width\n actual_width / 12\n end",
"title": ""
},
{
"docid": "e5a2d1ab51b7164f566074a865e8c18a",
"score": "0.6797849",
"text": "def printWidth\n @width\n end",
"title": ""
},
{
"docid": "0c082742b7afa6d87e999fcdd971f5b2",
"score": "0.6797804",
"text": "def width\n span\n end",
"title": ""
},
{
"docid": "5c952b4a8df66f1ed9534b246d96e51a",
"score": "0.6781965",
"text": "def width\n @width\n end",
"title": ""
},
{
"docid": "1a827fb99964e2e7d145da0056fbdebd",
"score": "0.6779259",
"text": "def width\n 1\n end",
"title": ""
},
{
"docid": "1a827fb99964e2e7d145da0056fbdebd",
"score": "0.6779259",
"text": "def width\n 1\n end",
"title": ""
},
{
"docid": "1a827fb99964e2e7d145da0056fbdebd",
"score": "0.6779259",
"text": "def width\n 1\n end",
"title": ""
},
{
"docid": "1a827fb99964e2e7d145da0056fbdebd",
"score": "0.6779259",
"text": "def width\n 1\n end",
"title": ""
},
{
"docid": "1a827fb99964e2e7d145da0056fbdebd",
"score": "0.6779259",
"text": "def width\n 1\n end",
"title": ""
},
{
"docid": "1870f99bf43e563e81fe973e9d5aa742",
"score": "0.6773968",
"text": "def width\n get_width\n end",
"title": ""
},
{
"docid": "93a9420a730ff0158c129bc1aa841290",
"score": "0.6772038",
"text": "def width()\n return @width\n end",
"title": ""
},
{
"docid": "7df5463f26b005b5fd3d81117defd4b4",
"score": "0.6770389",
"text": "def getWidth\n @width\n end",
"title": ""
},
{
"docid": "7df5463f26b005b5fd3d81117defd4b4",
"score": "0.6770389",
"text": "def getWidth\n @width\n end",
"title": ""
},
{
"docid": "7df5463f26b005b5fd3d81117defd4b4",
"score": "0.6770389",
"text": "def getWidth\n @width\n end",
"title": ""
},
{
"docid": "7df5463f26b005b5fd3d81117defd4b4",
"score": "0.6770389",
"text": "def getWidth\n @width\n end",
"title": ""
},
{
"docid": "7df5463f26b005b5fd3d81117defd4b4",
"score": "0.6770389",
"text": "def getWidth\n @width\n end",
"title": ""
},
{
"docid": "87c567ac8ebdda7193968b03eac0e39c",
"score": "0.6752001",
"text": "def getWidth\n \t@width\n end",
"title": ""
},
{
"docid": "dc4597b1509b0760ccce3095b813aea9",
"score": "0.6751067",
"text": "def getWidth\n @width\n end",
"title": ""
},
{
"docid": "dc4597b1509b0760ccce3095b813aea9",
"score": "0.6751067",
"text": "def getWidth\n @width\n end",
"title": ""
},
{
"docid": "2ee8bd96b6eec795ee8d44a704e675e2",
"score": "0.6739954",
"text": "def getWidth\n @width\n end",
"title": ""
},
{
"docid": "93b015e44bdbf1ebeb3ef6c850c577b4",
"score": "0.6734467",
"text": "def getPageWidth()\n return @w;\n end",
"title": ""
},
{
"docid": "7638f95f9182e6da3638a44409fb2dfc",
"score": "0.673071",
"text": "def width\n 0\n end",
"title": ""
},
{
"docid": "7638f95f9182e6da3638a44409fb2dfc",
"score": "0.673071",
"text": "def width\n 0\n end",
"title": ""
},
{
"docid": "ccadeb30eea79578831bcb0e52ef2856",
"score": "0.67154443",
"text": "def width\n size[0]\n end",
"title": ""
},
{
"docid": "b8d4c0267e163ff9b88b2e9e3a08df04",
"score": "0.67073953",
"text": "def width\n @stuff.size\n end",
"title": ""
},
{
"docid": "f72eab754943e84c3dfae24f4e145c1b",
"score": "0.6700865",
"text": "def width\n\t@font.text_width(self.text)\n end",
"title": ""
},
{
"docid": "f9ddc00d3b36dafce8a1665367e518ca",
"score": "0.66962576",
"text": "def width!\n size![1]\n end",
"title": ""
},
{
"docid": "a93404648d9c2a8aedad8c76f345a182",
"score": "0.66958654",
"text": "def width\n @table_width\n end",
"title": ""
},
{
"docid": "08c7cf75c1ecbfbf084ac194d9d5020c",
"score": "0.6678528",
"text": "def print_width\n \t@width\n end",
"title": ""
},
{
"docid": "db2e9fe629dc9d0899c767e89a682447",
"score": "0.6677525",
"text": "def width\r\n @font.text_width(self.text)\r\n end",
"title": ""
},
{
"docid": "62a0be7bca1034546f7322b3e80a6999",
"score": "0.66721356",
"text": "def width=(_arg0); end",
"title": ""
},
{
"docid": "b61a4abfabf8e6c43e8fde6f95f16527",
"score": "0.6670818",
"text": "def width\n @entity.w\n end",
"title": ""
},
{
"docid": "e7ef6f3a40979d41f1334fcbcb009f1d",
"score": "0.66699356",
"text": "def width\n result = super\n result = text_width if result == 0 # TODO: :auto\n \n result\n end",
"title": ""
},
{
"docid": "47b9a88d330047235b40f84aa11fe0a9",
"score": "0.6622901",
"text": "def width\n # returns a number\n throw NotImplementedError\n end",
"title": ""
},
{
"docid": "47b9a88d330047235b40f84aa11fe0a9",
"score": "0.6622901",
"text": "def width\n # returns a number\n throw NotImplementedError\n end",
"title": ""
},
{
"docid": "6d07ea81b1e8f867fc505f697fab4129",
"score": "0.6620871",
"text": "def width\n self[:base].width\n end",
"title": ""
},
{
"docid": "35d1f46454755901b6826ea1cad2cfd7",
"score": "0.66195506",
"text": "def width\n @font.text_width(self.text)\n end",
"title": ""
},
{
"docid": "35d1f46454755901b6826ea1cad2cfd7",
"score": "0.66195506",
"text": "def width\n @font.text_width(self.text)\n end",
"title": ""
},
{
"docid": "e5e12e00f059718d27ea7a2bb441de43",
"score": "0.6611402",
"text": "def width\n 0\n end",
"title": ""
},
{
"docid": "a543f74aea9d21710148d64628bc4ac4",
"score": "0.66022414",
"text": "def printWidth\n\t\t@width\n\tend",
"title": ""
},
{
"docid": "c772fddc4f55b695221b4f2f687d4700",
"score": "0.66012245",
"text": "def width\n text_width = @font.text_width(self.text)\n if text_width > @default_width\n return text_width \n end \n @default_width\n end",
"title": ""
},
{
"docid": "f087bc2f80a5212f090bc8c717c31a72",
"score": "0.6597432",
"text": "def dynamic_width_tput\n %x(tput cols 2>/dev/null).to_i\n end",
"title": ""
},
{
"docid": "b304b8e6fa23e0855d0de255f2902d69",
"score": "0.65906477",
"text": "def getWidth\r\n\t\treturn @width\r\n\tend",
"title": ""
},
{
"docid": "66f3419eb159ad1ff771e66a590cf7d2",
"score": "0.65871906",
"text": "def width\n\t\t@data[1]\n\tend",
"title": ""
},
{
"docid": "0c54862f14d682e31d5c220b4a149187",
"score": "0.6571083",
"text": "def width\n return @width\n end",
"title": ""
},
{
"docid": "0c54862f14d682e31d5c220b4a149187",
"score": "0.6571083",
"text": "def width\n return @width\n end",
"title": ""
},
{
"docid": "0ec82694c30e52ecba369a1f85d7c004",
"score": "0.65704787",
"text": "def full_width\n # returns a number\n throw NotImplementedError\n end",
"title": ""
},
{
"docid": "78f74b11bd8d6ecb3e8608650eafde0c",
"score": "0.65672886",
"text": "def width\n @graphic_width ||= 0\n end",
"title": ""
},
{
"docid": "aa9dd88955eed06d266218bb77d1af2c",
"score": "0.65664005",
"text": "def width\n element.wd.size['width']\n end",
"title": ""
},
{
"docid": "4c755e1709b8069cdd513db2cf3febba",
"score": "0.65584224",
"text": "def current_width\n guess = `tput cols`.to_i\n guess == 0 ? 80 : guess\n end",
"title": ""
},
{
"docid": "81373643e9701861471ac17ef0945992",
"score": "0.65540946",
"text": "def original_width; end",
"title": ""
},
{
"docid": "bb64ef11904354aba396ac9bbc962b0c",
"score": "0.6551612",
"text": "def width=(_); end",
"title": ""
},
{
"docid": "bb64ef11904354aba396ac9bbc962b0c",
"score": "0.6551612",
"text": "def width=(_); end",
"title": ""
},
{
"docid": "73140efa9070abfb404a306526a1c124",
"score": "0.6539146",
"text": "def width\n @width ||= nil\n @width\n end",
"title": ""
},
{
"docid": "243f3bb773a521b45b11cd799590cf09",
"score": "0.6538826",
"text": "def width\n Termbox.width\n end",
"title": ""
},
{
"docid": "2ed657f18d5c3addbda7dc1761328563",
"score": "0.65369934",
"text": "def width\n @width ||= size.last.split('x').first.strip!.to_i\n end",
"title": ""
},
{
"docid": "64e946f8b2ea124d1654367d0bc42c2d",
"score": "0.6533929",
"text": "def width\n return @def.width\n end",
"title": ""
},
{
"docid": "95190cd437ad963cccd6fc96863ae03f",
"score": "0.65223444",
"text": "def width; nil; end",
"title": ""
},
{
"docid": "0da7b3e02290659a99e96aea39bcf3e9",
"score": "0.6512591",
"text": "def width\n return @sizeX ;\n end",
"title": ""
},
{
"docid": "0da7b3e02290659a99e96aea39bcf3e9",
"score": "0.6512591",
"text": "def width\n return @sizeX ;\n end",
"title": ""
},
{
"docid": "379aa02fd09a839fd661a0260f529fd4",
"score": "0.65028334",
"text": "def body_width\n @style.body_width\n end",
"title": ""
},
{
"docid": "c554eb80bc1c2c061c6174bf8fffed84",
"score": "0.64780056",
"text": "def width\n @graphic.split(\"\\n\").map(&:length).max\n end",
"title": ""
},
{
"docid": "8c5e47284824c213216d495f4dbfdb5e",
"score": "0.6475342",
"text": "def get_width\n UI.terminal_helper.output_cols\n end",
"title": ""
},
{
"docid": "86bfadd42da4662b853ded8057bea8ff",
"score": "0.64656216",
"text": "def width\n # TODO: auto unit conversion\n measurement(2).try(:measurement)\n end",
"title": ""
},
{
"docid": "88e59fa5e1a39af798c5cd276d2a2b2e",
"score": "0.64599466",
"text": "def width\n size[0]\n end",
"title": ""
}
] |
00f8a4c3998d35d4972cadcac12bbae3
|
Method to return exponify
|
[
{
"docid": "d4a6cecb8f72bacfbcf638804293067b",
"score": "0.5204379",
"text": "def exponify a, b\n return \"a ^ b = #{display_exponify a, b}#{a**b}\"\nend",
"title": ""
}
] |
[
{
"docid": "e1f022fc12a904e9a5119db430343d54",
"score": "0.6375202",
"text": "def to_s\n return @exp\n end",
"title": ""
},
{
"docid": "3a31747752211bdf32ad571f3be8e2f1",
"score": "0.6249908",
"text": "def exp_text\n @exp.to_s\n end",
"title": ""
},
{
"docid": "a0b4c8c76509321f85a02b9646b5e35f",
"score": "0.5907656",
"text": "def to_s\n return \"exp(#{self.arg.to_s})\"\n end",
"title": ""
},
{
"docid": "6b71f0d26c7c7671b80af8dab8d3acd3",
"score": "0.5808493",
"text": "def exponential(value1)\n result = Math.exp(value1)\n puts \"The result is #{ result }\"\nend",
"title": ""
},
{
"docid": "47aa3825c3d551ef1267e92f984a1b29",
"score": "0.5767994",
"text": "def to_rexp\n raise \"hell\" if returns.kind_of?(Array)\n \"{#{returns}:#{reduction_id}}\"\n end",
"title": ""
},
{
"docid": "4c840ab704667cbe42e1e15efd5579ef",
"score": "0.5646745",
"text": "def expression; end",
"title": ""
},
{
"docid": "5aca6861230c5a2ecb708dfa0c8805a9",
"score": "0.5631511",
"text": "def expressions; end",
"title": ""
},
{
"docid": "e947011ee88da4e3859e4253053f58a2",
"score": "0.5569248",
"text": "def getex\n url = prefix + \"getex\"\n return response(url)\n end",
"title": ""
},
{
"docid": "e947011ee88da4e3859e4253053f58a2",
"score": "0.5569248",
"text": "def getex\n url = prefix + \"getex\"\n return response(url)\n end",
"title": ""
},
{
"docid": "c4dd06c255d178b05847b18bb6b4821b",
"score": "0.5509479",
"text": "def exp _args\n \"exp _args;\" \n end",
"title": ""
},
{
"docid": "8f5952f463f7cdd1c63fb074dcde63a5",
"score": "0.55064255",
"text": "def exa\n big_self * EXA\n end",
"title": ""
},
{
"docid": "5186b8d398d3372ab332dbcc05db4f76",
"score": "0.54981154",
"text": "def getex\n url = prefix + \"getex\"\n return response(url)\n end",
"title": ""
},
{
"docid": "5186b8d398d3372ab332dbcc05db4f76",
"score": "0.54981154",
"text": "def getex\n url = prefix + \"getex\"\n return response(url)\n end",
"title": ""
},
{
"docid": "8d02c95c0bbae50e5920b55f84a87582",
"score": "0.5447728",
"text": "def gPXE; iPXE; end",
"title": ""
},
{
"docid": "f89499535434c6e199ca03319fcf3c7b",
"score": "0.54358983",
"text": "def single_exploit\n end",
"title": ""
},
{
"docid": "5b08fbbe3e90d3a3a6d220137366856d",
"score": "0.54341024",
"text": "def to_s\n unless Semantic.in_function\n SodaLogger.error('return can only be used inside a function definition')\n end\n \"#{Indentation.get}return #{@expression};\"\n end",
"title": ""
},
{
"docid": "cf8abd6a6d2d77008e7d328578e26cbd",
"score": "0.54321015",
"text": "def process_return(exp)\n return \"return #{process exp.shift}\"\n end",
"title": ""
},
{
"docid": "77bdc3d09c82dfb5fc425fda13f38697",
"score": "0.5424196",
"text": "def exp(str); end",
"title": ""
},
{
"docid": "77bdc3d09c82dfb5fc425fda13f38697",
"score": "0.5424196",
"text": "def exp(str); end",
"title": ""
},
{
"docid": "171b96ecab5f184f6bee7db714fe4659",
"score": "0.5367194",
"text": "def process_true(exp)\n return \"1\"\n end",
"title": ""
},
{
"docid": "d4248303d83e601fedcb6595d7408f7d",
"score": "0.5308012",
"text": "def expanded; end",
"title": ""
},
{
"docid": "c072daebdc6b088408d965f76b2b188f",
"score": "0.5294457",
"text": "def exp(str) # :nodoc:\n Parslet::Expression.new(str).to_parslet\n end",
"title": ""
},
{
"docid": "c0423696e224752923adcb6a0d355499",
"score": "0.5284392",
"text": "def get_return_value exp, env = nil\n process_method exp, env\n value = make_return_value\n value.original_line = exp.line\n value\n end",
"title": ""
},
{
"docid": "8f914228f3768568170f7bd5243b7bbd",
"score": "0.52782804",
"text": "def expand(*args)\n\t\t\t#\tjust the default value, not the Response\n\t\t\t(super *args).to_s\n\t\tend",
"title": ""
},
{
"docid": "49fabc296460e332fe80689e3d1d499b",
"score": "0.52765465",
"text": "def get_expid_from_env(o = {})\n #puts \"[get_expid_from_env] #{$method}\"\n code = [(o[:col] || $col) , (o[:exp] || $exp) , (o[:method] || $method) , (o[:remark] || $remark)].join(SEP_1)\n o = $o if o.size == 0\n if o.size > 0\n code += (SEP_1 + o.find_all{|k,v|v}.map{|e|[e[0],((e[1].class==Symbol)? \":\" : \"\")+e[1].to_s.to_fname].join(SEP_3)}.join(SEP_2)) \n else\n code += SEP_1\n end\nend",
"title": ""
},
{
"docid": "9671d84d2f0691fb8a74ec3382d886a4",
"score": "0.52647614",
"text": "def process_iasgn(exp)\n ivar = exp.shift\n value = exp.shift\n ivar_name = @model.encode_instance_variable(ivar)\n\n str = without_result do\n want_expression do\n \"#{@model.encode_self}.#{ivar_name}=#{process(value)}\"\n end\n end\n\n resultify(str)\n end",
"title": ""
},
{
"docid": "79f1ed1340e971023dc501b7b2fdb342",
"score": "0.5259095",
"text": "def exponential_function\n num_1 ** num_2\n return num_1 ** num_2\nend",
"title": ""
},
{
"docid": "f8e9b495f72cf46c83eb7e7ad8795fd1",
"score": "0.5252319",
"text": "def exponent\n return @exp\n end",
"title": ""
},
{
"docid": "9ce28ed546ff5164110de992f122be50",
"score": "0.52415675",
"text": "def to_exp(options = {})\n return nil if to_exp? == false\n t = @statement_list[0].to_exp(options)\n return t.to_exp(options) if @statement_list.length <= 1\n i = 1\n while(i < @statement_list.length)\n t = ExpComma.new(t, @statement_list[i])\n i += 1\n end\n t\n end",
"title": ""
},
{
"docid": "0339dbbe6b38f42e9eb6c11fa2f1ec57",
"score": "0.5236107",
"text": "def exp\n Double.new(Math.exp(self.to_f))\n end",
"title": ""
},
{
"docid": "12ad34bb64806271b13ede17b4b4ced6",
"score": "0.5222776",
"text": "def getExp ( x , y )\n\texp = x ** y\n\treturn exp\nend",
"title": ""
},
{
"docid": "fe40d7a4f08221b6c8ec9f25b4e84d76",
"score": "0.52207446",
"text": "def process_str(exp)\n str = exp.shift\n resultify(str.inspect)\n end",
"title": ""
},
{
"docid": "d2ea8a8ab0e94f363f1745f4a50f287d",
"score": "0.52080613",
"text": "def fetch_exp (fei_or_wfid)\n\n exp = if fei_or_wfid.is_a?(String)\n\n get_expression_pool.fetch_root(fei_or_wfid)\n\n else\n\n get_expression_pool.fetch_expression(fei_or_wfid)\n end\n\n exp || raise(\"no expression found for '#{fei_or_wfid.to_s}'\")\n end",
"title": ""
},
{
"docid": "2214772e8c9d45016315fc1a2b4560d4",
"score": "0.52048177",
"text": "def getex\n url = prefix + \"getex\" + id_param\n return response(url)\n end",
"title": ""
},
{
"docid": "aa087d71410e786f59b0ddbd8a9089f7",
"score": "0.5192207",
"text": "def to_exa\n big_self / EXA\n end",
"title": ""
},
{
"docid": "72ec3d84520d7dd42adb5d35c280e8ba",
"score": "0.51720315",
"text": "def evaluate\n super\n content\n end",
"title": ""
},
{
"docid": "f741d4352d70048eeefb1efaa0b40218",
"score": "0.51619256",
"text": "def evaluate\n\n end",
"title": ""
},
{
"docid": "3bbde9032a5ea75e4146e5fb7114c102",
"score": "0.51584834",
"text": "def exp\n\t\tresult = Math.exp(@input)\n\n\t render json: result, status: 200\n\trescue\n\t\trender json: {\"message\": 'Use the format: {\"input\": num}'}, status: 400\n\tend",
"title": ""
},
{
"docid": "feeaa85d6530b809e6fea99062e149f3",
"score": "0.5148102",
"text": "def return_expression(method)\n\n\n\n # 193:7: RETURN ( expression[method] )* ';'\n match(:RETURN)\n # 193:14: ( expression[method] )*\n while true\n alt26 = 2\n # ()* loopback of 193:14: ( expression[method] )*\n look_ahead26_0 = look_ahead(1)\n if look_ahead26_0 == :IDENTIFIER || look_ahead26_0 == :NUMBER || (TOKENS[look_ahead26_0] >= 25 && TOKENS[look_ahead26_0] <= 26) || look_ahead26_0 == :ECOMMERCIAL || (TOKENS[look_ahead26_0] >= 31 && TOKENS[look_ahead26_0] <= 32) || (TOKENS[look_ahead26_0] >= 35 && TOKENS[look_ahead26_0] <= 46) || (TOKENS[look_ahead26_0] >= 48 && TOKENS[look_ahead26_0] <= 49) || look_ahead26_0 == :T58 \n alt26 = 1\n end\n case alt26\n when 1\n # 193:16: expression[method]\n expression(method)\n\n else\n break\n end\n end\n match(:SEMICOLON)\n\n\n\n end",
"title": ""
},
{
"docid": "3fc4f599d5451acf5603043741a1ca71",
"score": "0.513767",
"text": "def exp_type\n return data.exp_type\n end",
"title": ""
},
{
"docid": "05886df64a934e8872c71720525ae022",
"score": "0.51302826",
"text": "def to_exp?\n @statement_list.each do |s|\n return false if s.to_exp? == false\n end\n return true\n end",
"title": ""
},
{
"docid": "094bf8c09146db41fe52fea2d1450c38",
"score": "0.51208186",
"text": "def respond(); end",
"title": ""
},
{
"docid": "0bfa6e5f6289a276ed425abce03e863d",
"score": "0.51181334",
"text": "def exp_result(enemy)\n # stop if enemy gives no EXP\n return 0 if enemy.exp == 0\n # get EXP\n exp = enemy.exp\n # if Tons is there\n if $tons_version != nil\n # if version is correct and using Different Difficulties\n if $tons_version >= 6.4 && TONS_OF_ADDONS::DIFFICULTY\n # multiply gained gold\n exp = exp * $game_system.exp_rate / 100\n end\n # if version is correct and using Passive Skills\n if $tons_version >= 6.5 && $game_system.PASSIVE_SKILLS\n # multiply gained gold with each actor's rate\n $game_party.actors.each {|actor| exp *= actor.exp_rate}\n exp = exp.to_i\n end\n end\n # iterate through all actors and pets\n ($BlizzABS.actors + $BlizzABS.pets).each {|b|\n # increase EXP if actor is valid and actor can get EXP\n b.battler.exp += exp if b.valid? && !b.battler.cant_get_exp?}\n # return exp value for further processing\n return exp\n end",
"title": ""
},
{
"docid": "0cf7c636ae134c3a265a1144ae9b014b",
"score": "0.51161385",
"text": "def api_expressions\n return @api_expressions\n end",
"title": ""
},
{
"docid": "5c2041ba4724e658d2ca1e10cde65d6c",
"score": "0.5115884",
"text": "def process_defn exp\n process_all exp.body\n end",
"title": ""
},
{
"docid": "38bc57bb95a2616799e14473480a0912",
"score": "0.51126194",
"text": "def expand\n end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5103909",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5103909",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5103909",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5103909",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5103909",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5103909",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5103909",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5103909",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5103909",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5103909",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5103909",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5103909",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5103909",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.5103909",
"text": "def inspect() end",
"title": ""
},
{
"docid": "a7e46056aae02404670c78192ffb8f3f",
"score": "0.5098186",
"text": "def original_result; end",
"title": ""
},
{
"docid": "f68ca4ccac39a4ace815c59837f3d088",
"score": "0.50824773",
"text": "def defender_exploit_protection_xml\n return @defender_exploit_protection_xml\n end",
"title": ""
},
{
"docid": "fffacb139f83df49062270b54a50ef9b",
"score": "0.5080214",
"text": "def exp_rate; CPanel::EXPRATE; end",
"title": ""
},
{
"docid": "c0db09f6764785a014b758650db14328",
"score": "0.50667316",
"text": "def exp(v); Math.exp(v); end",
"title": ""
},
{
"docid": "03b39b39e83da2f7d3740246f051f69c",
"score": "0.5064624",
"text": "def eplore\n end",
"title": ""
},
{
"docid": "dd68931a1a7f77eb4fd41ce35988a9bb",
"score": "0.5045369",
"text": "def returns; end",
"title": ""
},
{
"docid": "6ca97d7b45ab6632b4d763aa43a7e3cb",
"score": "0.5043648",
"text": "def make_result_info\n end",
"title": ""
},
{
"docid": "a8f34ddb78c89490a735ff3fb106c792",
"score": "0.50418997",
"text": "def exp_buffer\n result = @exp_buffer\n @exp_buffer = ''\n result\n end",
"title": ""
},
{
"docid": "c918c608568a07ccb7942829faf6d0ff",
"score": "0.503675",
"text": "def result; end",
"title": ""
},
{
"docid": "c918c608568a07ccb7942829faf6d0ff",
"score": "0.503675",
"text": "def result; end",
"title": ""
},
{
"docid": "c918c608568a07ccb7942829faf6d0ff",
"score": "0.503675",
"text": "def result; end",
"title": ""
},
{
"docid": "c918c608568a07ccb7942829faf6d0ff",
"score": "0.503675",
"text": "def result; end",
"title": ""
},
{
"docid": "c918c608568a07ccb7942829faf6d0ff",
"score": "0.503675",
"text": "def result; end",
"title": ""
},
{
"docid": "c918c608568a07ccb7942829faf6d0ff",
"score": "0.503675",
"text": "def result; end",
"title": ""
},
{
"docid": "c918c608568a07ccb7942829faf6d0ff",
"score": "0.503675",
"text": "def result; end",
"title": ""
},
{
"docid": "c918c608568a07ccb7942829faf6d0ff",
"score": "0.503675",
"text": "def result; end",
"title": ""
},
{
"docid": "39edef5b759367da9210ee37a06c1b14",
"score": "0.50277936",
"text": "def exp\n @exp ||= ComplexNumber.new((Math::E**real).round(15), 0) \\\n * ComplexNumber.new(\n Math.cos(imaginary).round(15),\n Math.sin(imaginary).round(15)\n )\n end",
"title": ""
},
{
"docid": "46eb530260f6d1196cd6c82c3c73811d",
"score": "0.5025378",
"text": "def exposure\n market_value\n end",
"title": ""
},
{
"docid": "bc5e70e6884c8d32597362ad3e153b1f",
"score": "0.50179374",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "bc5e70e6884c8d32597362ad3e153b1f",
"score": "0.50179374",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "12866289d5098a9ad100abe8d8862062",
"score": "0.5017867",
"text": "def expunge\n multi_data_response(\"EXPUNGE\").transform do |untagged_responses|\n untagged_responses.map(&:data)\n end\n end",
"title": ""
},
{
"docid": "d085a2460460f0af59aa75fdb7e10d94",
"score": "0.50147194",
"text": "def beautify; end",
"title": ""
},
{
"docid": "d085a2460460f0af59aa75fdb7e10d94",
"score": "0.50147194",
"text": "def beautify; end",
"title": ""
},
{
"docid": "ff7bd05f6db71255a2fe31df6dd4bc41",
"score": "0.5012924",
"text": "def desired_result\n CodeEvaluator.evaluate(result)\n end",
"title": ""
},
{
"docid": "cb1fac16798563026e576088aeffbb7e",
"score": "0.5005949",
"text": "def expression\n super\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.49939007",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.49939007",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.49939007",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.49939007",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.49939007",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.49939007",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.49939007",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.49939007",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.49939007",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.49939007",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.49939007",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.49939007",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.49939007",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "b90169e888700af0cb0b3eb65f3350aa",
"score": "0.49760273",
"text": "def fetch (exp)\n\n fei = extract_fei(exp)\n\n [ get_expression_storage[fei], fei ]\n end",
"title": ""
},
{
"docid": "990970091c2462662cd82ec09ce73751",
"score": "0.4974732",
"text": "def herebody_s; end",
"title": ""
}
] |
825ccec54f3dcbc9dbca2484f4ad6f8c
|
creates pad and sets repaint_all so populate happens FIXME earlier used to create and populate, but now i have decoupled populate since that was forcing create to happen.
|
[
{
"docid": "e6c622a46c04f3a9c4347bab122ff645",
"score": "0.74653804",
"text": "def populate_pad\n @_populate_needed = false\n\n create_pad\n\n # clearstring is the string required to clear the pad to background color\n @clearstring = nil\n $log.debug \" populate pad color = #{@color} , bg = #{@bgcolor} \"\n #cp = get_color($datacolor, color(), bgcolor())\n # commenting off next line meant that textdialog had a black background 2014-05-01 - 23:37\n #@cp = FFI::NCurses.COLOR_PAIR(cp)\n # we seem to be clearing always since a pad is often reused. so making the variable whenever pad created.\n\n @repaint_all = true\n\n end",
"title": ""
}
] |
[
{
"docid": "1c4dd432b080142e97997a3a0503f590",
"score": "0.67523223",
"text": "def populate_pad\n @_populate_needed = false\n # how can we make this more sensible ? FIXME\n @renderer ||= DefaultRubyRenderer.new if \".rb\" == @filetype\n @content_rows = @content.count\n @content_cols = content_cols()\n @content_rows = @rows if @content_rows < @rows\n @content_cols = @cols if @content_cols < @cols\n $log.debug \"XXXX content_cols = #{@content_cols}\"\n\n create_pad\n\n Ncurses::Panel.update_panels\n @content.each_index { |ix|\n #FFI::NCurses.mvwaddstr(@pad,ix, 0, @content[ix])\n render @pad, ix, @content[ix]\n }\n\n end",
"title": ""
},
{
"docid": "a3e1617f88ea02698391e2b78d02418b",
"score": "0.6039406",
"text": "def create_pad\n #raise \"Pad already created\" if @pad\n return @pad if @pad\n r = @top\n c = @left\n layout = { :height => @pad_h, :width => @pad_w, :top => r, :left => c } \n @window = VER::Pad.create_with_layout(layout)\n \n @window.name = \"Pad::ScrollPad\" # 2010-02-02 20:01 \n @name = \"Form::ScrollForm\"\n @pad = @window\n return @window\n end",
"title": ""
},
{
"docid": "e43385b801d6b3d3b8c1391eb1b3a228",
"score": "0.5964613",
"text": "def padrefresh\n FFI::NCurses.prefresh(@pad,@prow,@pcol, @startrow, @startcol, @rows + @startrow, @cols+@startcol);\n end",
"title": ""
},
{
"docid": "541e97e5d8caf95477bc5a59e337c06e",
"score": "0.59632385",
"text": "def render_all pad, arr\n pre_render\n @content_cols = @source.pad_cols\n @clearstring = \" \" * @content_cols\n @list = arr\n\n att = @attr || NORMAL\n FFI::NCurses.wattron(pad, @cp | att)\n\n arr.each_with_index { |line, ix|\n render pad, ix, line\n }\n FFI::NCurses.wattroff(pad, @cp | att)\n end",
"title": ""
},
{
"docid": "98ced8c6db026ffa6cdc61b6e2d13004",
"score": "0.5822098",
"text": "def fill_paint(paint)\n end",
"title": ""
},
{
"docid": "5b1a156842c87684a4f14054d5aadeaf",
"score": "0.56633395",
"text": "def GenPad(x1, y1, x2, y2, name, number, flags)\n if x1 > x2\n x1, x2 = x2, x1\n end\n if y1 > y2\n y1, y2 = y2, y1\n end\n if (x2 - x1) > (y2 - y1)\n thickness = (y2 - y1)\n y1 = y2 = (y1 + y2) / 2.0 # same value, no eps\n x1 += thickness / 2.0\n x2 -= thickness / 2.0\n else\n thickness = (x2 - x1)\n x1 = x2 = (x1 + x2) / 2.0\n y1 += thickness / 2.0\n y2 -= thickness / 2.0\n end\n PcbSmartPad(x1, y1, x2, y2, thickness, name, number, flags)\nend",
"title": ""
},
{
"docid": "588fe3e3861265e94749398afbf2cb98",
"score": "0.558052",
"text": "def make_board\n make_blank_board\n populate_board\n end",
"title": ""
},
{
"docid": "79926b4a846d25f83c0330bac6c4ab3b",
"score": "0.5530188",
"text": "def populate_board\n\t\t8.times{|x|\t@board[x][6] = Pawn.new([x, 6], \"black\", @board)}\n\t\t@board[0][7] = Rook.new([0, 7], \"black\", @board)\t\n\t\t@board[1][7] = Knight.new([1, 7], \"black\", @board)\n\t\t@board[2][7] = Bishop.new([2, 7], \"black\", @board)\n\t\t@board[3][7] = Queen.new([3, 7], \"black\", @board)\n\t\t@board[4][7] = King.new([4, 7], \"black\", @board)\t\t\n\t\t@board[5][7] = Bishop.new([5, 7], \"black\", @board)\n\t\t@board[6][7] = Knight.new([6, 7], \"black\", @board)\n\t\t@board[7][7] = Rook.new([7, 7], \"black\", @board)\n\t\t\t\t\n\t\t 8.times{|x|\t@board[x][1] = Pawn.new([x, 1], \"white\", @board)}\n\t\t@board[0][0] = Rook.new([0, 0], \"white\", @board)\t\n\t\t@board[1][0] = Knight.new([1, 0], \"white\", @board)\n\t\t@board[2][0] = Bishop.new([2, 0], \"white\", @board)\n\t\t@board[3][0] = Queen.new([3, 0], \"white\", @board)\n\t\t@board[4][0] = King.new([4, 0], \"white\", @board)\t\t\n\t\t@board[5][0] = Bishop.new([5, 0], \"white\", @board)\n\t\t@board[6][0] = Knight.new([6, 0], \"white\", @board)\n\t\t@board[7][0] = Rook.new([7, 0], \"white\", @board)\n\tend",
"title": ""
},
{
"docid": "549d2432fd868a40008ddf64c334f345",
"score": "0.5528017",
"text": "def prefresh\n ## reduce so we don't go off in top+h and top+w\n $log.debug \" start ret = @buttonpad.prefresh( #{@pminrow} , #{@pmincol} , #{@top} , #{@left} , top + #{@display_h} left + #{@display_w} ) \"\n if @pminrow + @display_h > @orig_top + @pad_h\n $log.debug \" if #{@pminrow} + #{@display_h} > #{@orig_top} +#{@pad_h} \"\n $log.debug \" ERROR 1 \"\n #return -1\n end\n if @pmincol + @display_w > @orig_left + @pad_w\n $log.debug \" if #{@pmincol} + #{@display_w} > #{@orig_left} +#{@pad_w} \"\n $log.debug \" ERROR 2 \"\n return -1\n end\n # actually if there is a change in the screen, we may still need to allow update\n # but ensure that size does not exceed\n if @top + @display_h > @orig_top + @pad_h\n $log.debug \" if #{@top} + #{@display_h} > #{@orig_top} +#{@pad_h} \"\n $log.debug \" ERROR 3 \"\n return -1\n end\n if @left + @display_w > @orig_left + @pad_w\n $log.debug \" if #{@left} + #{@display_w} > #{@orig_left} +#{@pad_w} \"\n $log.debug \" ERROR 4 \"\n return -1\n end\n # maybe we should use copywin to copy onto @target_window\n $log.debug \" ret = @window.prefresh( #{@pminrow} , #{@pmincol} , #{@top} , #{@left} , #{@top} + #{@display_h}, #{@left} + #{@display_w} ) \"\n omit = 0\n # this works but if want to avoid copying border\n #ret = @window.prefresh(@pminrow, @pmincol, @top+@row_offset, @left+@col_offset, @top + @display_h - @row_offset , @left + @display_w - @col_offset)\n #\n $log.debug \"ret = @window.copywin( #{@pminrow} , #{@pmincol} , #{@top+@row_offset} , #{@left+@col_offset} , #{@top} + #{@display_h} - #{@row_offset} , #{@left} + #{@display_w} - #{@col_offset} , 0)\"\n ## Haha , we are back to the old notorious copywin which has given mankind\n # so much grief that it should be removed in the next round of creation.\n ret = @window.copywin(@target_window.get_window, @pminrow, @pmincol, @top+@row_offset, @left+@col_offset, \n @top + @display_h - @row_offset , @left + @display_w - @col_offset, 0)\n\n $log.debug \" copywin ret = #{ret} \"\n end",
"title": ""
},
{
"docid": "7fe472d3c1da0aac61334e6f8de1ea41",
"score": "0.5468594",
"text": "def XXXpadrefresh\n top = @window.top\n left = @window.left\n sr = @startrow + top\n sc = @startcol + left\n # first do header always in first row\n retval = FFI::NCurses.prefresh(@pad,0,@pcol, sr , sc , 2 , @cols+ sc );\n # now print rest of data\n # h is header_adjustment\n h = 1 \n retval = FFI::NCurses.prefresh(@pad,@prow + h,@pcol, sr + h , sc , @rows + sr , @cols+ sc );\n $log.warn \"XXX: PADREFRESH #{retval}, #{@prow}, #{@pcol}, #{sr}, #{sc}, #{@rows+sr}, #{@cols+sc}.\" if retval == -1\n # padrefresh can fail if width is greater than NCurses.COLS\n end",
"title": ""
},
{
"docid": "8f36ca16bceb79b49ffa29849b229e86",
"score": "0.5407994",
"text": "def get_pad content_rows, content_cols\n pad = FFI::NCurses.newpad(content_rows, content_cols)\n @pads ||= []\n @pads << pad\n ## added 2013-03-05 - 19:21 without next line how was pad being returned\n return pad\n end",
"title": ""
},
{
"docid": "f019f0109debc933c89a94a771bdb676",
"score": "0.5332552",
"text": "def populate\n black = [\n Rook.new(:black, self, [0,0], \" ♜ \"),\n Knight.new(:black, self, [0,1], \" ♞ \"),\n Bishop.new(:black, self, [0,2], \" ♝ \"),\n Queen.new(:black, self, [0,3], \" ♛ \"),\n King.new(:black, self, [0,4], \" ♚ \"),\n Bishop.new(:black, self, [0,5], \" ♝ \"),\n Knight.new(:black, self, [0,6],\" ♞ \"),\n Rook.new(:black, self, [0,7], \" ♜ \")\n ]\n white = [\n Rook.new(:white, self, [7,0], \" ♖ \"),\n Knight.new(:white, self, [7,1], \" ♘ \"),\n Bishop.new(:white, self, [7,2], \" ♗ \"),\n Queen.new(:white, self, [7,3], \" ♕ \"),\n King.new(:white, self, [7,4], \" ♔ \"),\n Bishop.new(:white, self, [7,5], \" ♗ \"),\n Knight.new(:white, self, [7,6], \" ♘ \"),\n Rook.new(:white, self, [7,7], \" ♖ \")\n ]\n\n @grid.each_with_index do |row, i|\n row.each_with_index do |column, j|\n pos = [i, j]\n if i == 0\n self[pos]= black[j]\n @black_pieces << black[j]\n elsif i == 7\n self[pos]= white[j]\n @white_pieces << white[j]\n elsif i == 1\n black_pawn = Pawn.new(:black, self, pos, \" ♟ \")\n self[pos]= black_pawn\n @black_pieces << black_pawn\n elsif i == 6\n white_pawn = Pawn.new(:white, self, pos, \" ♙ \")\n self[pos] = white_pawn\n @white_pieces << white_pawn\n end\n end\n end\n\n @grid\n end",
"title": ""
},
{
"docid": "632b588c01aef6ce8dbfbdde2fb7629d",
"score": "0.533224",
"text": "def update_fill\n end",
"title": ""
},
{
"docid": "e82612e347525be0054c15a94fc1f63f",
"score": "0.5290425",
"text": "def create_board\n\t\t8.times{|x| @board.push([nil,nil,nil,nil,nil,nil,nil,nil])}\n\t\tpopulate_board\n\tend",
"title": ""
},
{
"docid": "b4d2e6304673af2fc89170d6dfb0f95b",
"score": "0.5275175",
"text": "def populate()\n @card_values.shuffle!\n i = 0\n (0...@size).each do |row|\n (0...@size).each do |col|\n @grid[row][col] = Card.new(@card_values[i])\n i += 1\n end\n end\n end",
"title": ""
},
{
"docid": "4e03e97577581d1308c12c1668ad4750",
"score": "0.52727854",
"text": "def populate_board!\n\n # Populate Pawns\n (0..7).each do |x|\n Pawn.create(x_coordinates: x, y_coordinates: 1, game_id: self.id, color: 'white', image: 'white-pawn.png', status: 'active') # White\n Pawn.create(x_coordinates: x, y_coordinates: 6, game_id: self.id, color: 'black', image: 'blk-pawn.png', status: 'active') # Black\n end\n\n # Populate Rook\n Rook.create(x_coordinates: 0, y_coordinates: 0, game_id: self.id, color: 'white', image: 'white-rook.png', status: 'active') # White\n Rook.create(x_coordinates: 7, y_coordinates: 0, game_id: self.id, color: 'white', image: 'white-rook.png', status: 'active') # White\n Rook.create(x_coordinates: 0, y_coordinates: 7, game_id: self.id, color: 'black', image: 'blk-rook.png', status: 'active') # Black\n Rook.create(x_coordinates: 7, y_coordinates: 7, game_id: self.id, color: 'black', image: 'blk-rook.png', status: 'active') # Black\n\n # Populate Knight\n Knight.create(x_coordinates: 1, y_coordinates: 0, game_id: self.id, color: 'white', image: 'white-knight.png', status: 'active' ) # White\n Knight.create(x_coordinates: 6, y_coordinates: 0, game_id: self.id, color: 'white', image: 'white-knight.png', status: 'active' ) # White\n Knight.create(x_coordinates: 1, y_coordinates: 7, game_id: self.id, color: 'black', image: 'blk-knight.png', status: 'active' ) # Black\n Knight.create(x_coordinates: 6, y_coordinates: 7, game_id: self.id, color: 'black', image: 'blk-knight.png', status: 'active' ) # Black\n\n # Populate Bishop\n Bishop.create(x_coordinates: 2, y_coordinates: 0, game_id: self.id, color: 'white', image: 'white-bishop.png', status: 'active') # White\n Bishop.create(x_coordinates: 5, y_coordinates: 0, game_id: self.id, color: 'white', image: 'white-bishop.png', status: 'active') # White\n Bishop.create(x_coordinates: 2, y_coordinates: 7, game_id: self.id, color: 'black', image: 'blk-bishop.png', status: 'active') # Black\n Bishop.create(x_coordinates: 5, y_coordinates: 7, game_id: self.id, color: 'black', image: 'blk-bishop.png', status: 'active') # Black\n\n # Populate Queen\n Queen.create(x_coordinates: 3, y_coordinates: 0, game_id: self.id, color: 'white', image: 'white-queen.png', status: 'active') # White\n Queen.create(x_coordinates: 3, y_coordinates: 7, game_id: self.id, color: 'black', image: 'blk-queen.png', status: 'active') # Black\n\n # Populate King\n King.create(x_coordinates: 4, y_coordinates: 0, game_id: self.id, color: 'white', image: 'white-king.png', status: 'active') # White\n King.create(x_coordinates: 4, y_coordinates: 7, game_id: self.id, color: 'black', image: 'blk-king.png', status: 'active') # Black\n end",
"title": ""
},
{
"docid": "6280f8bcb514d2a6ba4d1197ece41a96",
"score": "0.5270497",
"text": "def test_padding\n [@window, @sprite, @bitmap].each{|container|\n uc = UCGraph.new(container, 100, 300, 50, @elements, nil, 100, -100, Font.normal_font,\n Color.hp_gauge_color1, Color.hp_gauge_color2,\n Color.mp_gauge_color1, Color.mp_gauge_color2)\n uc.padding = 5\n uc.draw()\n }\n return true\n end",
"title": ""
},
{
"docid": "d28c2b9ffe42029b6dd70bb3f29b18aa",
"score": "0.5269316",
"text": "def populate\n self.start_coordinate_x = rand(11)\n self.start_coordinate_y = rand(11)\n if ship_position == 'vertical'\n self.end_coordinate_x = self.start_coordinate_x\n self.end_coordinate_y = (self.start_coordinate_y + SHIP_SIZE) > MAX_SIZE_BOARD ? (self.start_coordinate_y - SHIP_SIZE) : (self.start_coordinate_y + SHIP_SIZE)\n else\n self.end_coordinate_y = self.start_coordinate_y\n self.end_coordinate_x = (self.start_coordinate_x + SHIP_SIZE) > MAX_SIZE_BOARD ? (self.start_coordinate_x - SHIP_SIZE) : (self.start_coordinate_x + SHIP_SIZE)\n end\n end",
"title": ""
},
{
"docid": "7264ad49e5841d444f8649da8be93619",
"score": "0.5234076",
"text": "def padding=(pad); end",
"title": ""
},
{
"docid": "53c9bdbe22e3647cf06a81cb602ce847",
"score": "0.5211856",
"text": "def PcbSmartPad(x1, y1, x2, y2, thickness, name, number, flags)\n clearance = GetDim('clearance') * 2\n mask = GetDim('mask') * 2 + thickness\n PcbPad(x1, y1, x2, y2, thickness, clearance, mask, name, number, flags)\nend",
"title": ""
},
{
"docid": "d9c7deabcc4466ddcf3f1a5adcd7b72c",
"score": "0.52107394",
"text": "def draw\n @app.clear\n @life.cells.each do |coordinates|\n x = coordinates[0]\n y = coordinates[1]\n # Cells that are going to live look different from dying cells.\n if @life.should_remain_alive?(x, y)\n @app.fill rgb(0x30, 0x30, 0xBB)\n else\n @app.fill rgb(0x50, 0x50, 0xFF)\n end\n @app.rect :left => x * @cell_width,\n :top => y * @cell_height, \n :width => @cell_width,\n :height => @cell_height\n end\n end",
"title": ""
},
{
"docid": "ae5811266350a773516f76106db6b7b1",
"score": "0.5207353",
"text": "def refresh\n generate_part_rects\n generate_buffers\n self\n end",
"title": ""
},
{
"docid": "e5d3b0b4188786127872846541e8e8c7",
"score": "0.5206814",
"text": "def populate_black\n self[0,0] = Rook.new(:black, [0,0], self)\n self[0,1] = Knight.new(:black, [0,1], self)\n self[0,2] = Bishop.new(:black, [0,2], self)\n self[0,3] = King.new(:black, [0,3], self)\n self[0,4] = Queen.new(:black, [0,4], self)\n self[0,5] = Bishop.new(:black, [0,5], self)\n self[0,6] = Knight.new(:black, [0,6], self)\n self[0,7] = Rook.new(:black, [0,7], self)\n\n # self[1,0] = Pawn.new(:pawn, :black, [1,0], self)\n # self[1,1] = Pawn.new(:pawn, :black, [1,1], self)\n # self[1,2] = Pawn.new(:pawn, :black, [1,2], self)\n # self[1,3] = Pawn.new(:pawn, :black, [1,3], self)\n # self[1,4] = Pawn.new(:pawn, :black, [1,4], self)\n # self[1,5] = Pawn.new(:pawn, :black, [1,5], self)\n # self[1,6] = Pawn.new(:pawn, :black, [1,6], self)\n # self[1,7] = Pawn.new(:pawn, :black, [1,7], self)\n end",
"title": ""
},
{
"docid": "e5f12259a6eebbbbb5fad329478995df",
"score": "0.5184149",
"text": "def populate_board!\n # white pieces\n # creates the 8 pawn pieces across the board\n 8.times do |i|\n # sets game_id in Piece model to current id in Game\n # color is boolean - true for white, false for black\n Pawn.create(game_id: id, x_coord: i, y_coord: 1, color: true, captured: false)\n end\n # creates the 2 rook, knight, and bishop pieces on opposite sides of the board\n (0..7).step(7) do |i|\n Rook.create(game_id: id, x_coord: i, y_coord: 0, color: true, captured: false)\n end\n (1..7).step(5) do |i|\n Knight.create(game_id: id, x_coord: i, y_coord: 0, color: true, captured: false)\n end\n (2..7).step(3) do |i|\n Bishop.create(game_id: id, x_coord: i, y_coord: 0, color: true, captured: false)\n end\n\n Queen.create(game_id: id, x_coord: 3, y_coord: 0, color: true, captured: false)\n King.create(game_id: id, x_coord: 4, y_coord: 0, color: true, captured: false)\n\n # black pieces\n 8.times do |i|\n Pawn.create(game_id: id, x_coord: i, y_coord: 6, color: false, captured: false)\n end\n (0..7).step(7) do |i|\n Rook.create(game_id: id, x_coord: i, y_coord: 7, color: false, captured: false)\n end\n (1..7).step(5) do |i|\n Knight.create(game_id: id, x_coord: i, y_coord: 7, color: false, captured: false)\n end\n (2..7).step(3) do |i|\n Bishop.create(game_id: id, x_coord: i, y_coord: 7, color: false, captured: false)\n end\n Queen.create(game_id: id, x_coord: 3, y_coord: 7, color: false, captured: false)\n King.create(game_id: id, x_coord: 4, y_coord: 7, color: false, captured: false)\n end",
"title": ""
},
{
"docid": "bf1162789e3b236605153619fcd6b62f",
"score": "0.5174125",
"text": "def populate_board(board)\n #Fills in the top and bottom rows\n [0, 7].each do |row|\n 4.times do |col|\n board[row][col] = create_piece(row, col)\n board[row][(7-col)] = create_piece(row, (7-col))\n end\n end\n\n #Fills in the pawns\n 8.times do |col|\n board[1][col] = BlackPawn.new(1, col)\n board[6][col] = WhitePawn.new(6, col)\n end\n\n board\n end",
"title": ""
},
{
"docid": "dfc0227d352772ba43511718941be836",
"score": "0.51588464",
"text": "def deep_refresh\n recalc_height\n update_placement\n create_contents\n refresh\n end",
"title": ""
},
{
"docid": "ef7b2f5dec1e40c17c9d32b042aee570",
"score": "0.5157073",
"text": "def __calc_dimensions\n ## NOTE\n # ---------------------------------------------------\n # Since we are using pads, you need to get your height, width and rows correct\n # Make sure the height factors in the row, else nothing may show\n # ---------------------------------------------------\n\n\n raise \" CALC inside #{@name} h or w is nil #{@height} , #{@width} \" if @height.nil? or @width.nil?\n @rows = @height\n @cols = @width\n # NOTE XXX if cols is > COLS then padrefresh can fail\n @startrow = @row\n @startcol = @col\n unless @suppress_borders\n @row_offset = @col_offset = 1\n @startrow += 1\n @startcol += 1\n @rows -=3 # 3 is since print_border_only reduces one from width, to check whether this is correct\n @cols -=3\n @scrollatrows = @height - 3\n else\n # no borders printed\n @rows -= 1 # 3 is since print_border_only reduces one from width, to check whether this is correct\n ## if next is 0 then padrefresh doesn't print, gives -1 sometimes.\n ## otoh, if we reduce 1, then there is a blank or white left at 128 since clear_pad clears 128\n # but this only writes 127 2014-05-01 - 12:31 CLEAR_PAD\n #@cols -=0\n @cols -=1\n @scrollatrows = @height - 1 # check this out 0 or 1\n @row_offset = @col_offset = 0\n end\n @top = @row\n @left = @col\n @lastrow = @row + @row_offset\n @lastcol = @col + @col_offset\n $log.debug \" CALC_DIMENSION r:#{@rows} , c:#{@cols}, h:#{@height} , w:#{@width} , top:#{@top} , left:#{@left} \"\n end",
"title": ""
},
{
"docid": "0e33e0852e4246da8aa85a0e401ead73",
"score": "0.51555365",
"text": "def fill_station(station)\n\t\t20.times { station.dock(Bike.new) }\n\tend",
"title": ""
},
{
"docid": "d881420ce361a0db81d082cf77ac1d22",
"score": "0.5146854",
"text": "def fill_setup(gc)\n if @obj.fill\n gc.set_background @obj.fill\n gc.set_alpha @obj.fill_alpha\n true\n end\n end",
"title": ""
},
{
"docid": "89ccf23cfd5dd1389b666032a7219c8d",
"score": "0.5130842",
"text": "def fill_board\n\t\tfill_row_pieces(0, 'b')\n\t\tfill_row_pawn(1, 'b')\n\t\tfill_row_pieces(7, 'w')\n\t\tfill_row_pawn(6, 'w')\n\tend",
"title": ""
},
{
"docid": "79f9fd19832bb46a4881f29d5864f963",
"score": "0.51260614",
"text": "def copy_pad_to_win\n # check that we don't exceed other windows height/maxrow\n smr = smaxrow()\n # SHIT, this means the otherwin has to be a Pad, cannot be a window\n osw = @otherwin.width\n osh = @otherwin.height\n osh = @height if osh == 0 # root window has 0\n osw = @width if osw == 0 # root window has 0\n osmr = @otherwin.smaxrow() rescue osh # TRYING for windows\n osmc = @otherwin.smaxcol() rescue osw\n if smr >= osmr\n $log.debug \" adjusted smr from #{smr} to #{osmr} -1 causing issues in viewfooter\"\n smr = osmr-1 # XXX causing issues in viewport, wont print footer with this\n end\n if smr > @sheight + @top -1 -@pminrow # 2010-01-17 13:27 \n smr = @sheight + @top -1 -@pminrow \n $log.debug \" adjusted smr to #{smr} to prevent crash \"\n end\n smc = smaxcol()\n $log.debug \" SMC original = #{smc} \"\n if smc >= osmc\n smc = osmc-1\n smc = @width # XXX ??? THIS WAS WORKING< but throwing error in viewport case\n smc = [osmc-1, @width].min # yet another hack\n $log.debug \" SMC o-1 #{osmc-1} wdth #{@width}, smc #{smc} \"\n end\n ### XXX commented out since it doesn't let a comp print fully if widget expanded (splitpane)\n #smc = osw -1 if smc >= osw; # added 2009-11-02 17:01 for tabbedpanes\n\n # dang, this is coming up a lot. 2010-01-16 20:34 \n # the second scrollpane was one row too large in testsplit3a.rb\n if smr - @top > @padheight\n $log.debug \" fixing smr to padheight 2010-01-16 20:35 HOPE THIS DOESNT BREAK ANYTHING\"\n smr = @padheight\n end\n @pminrow = 0 if @pminrow < 0\n @pmincol = 0 if @pmincol < 0\n $log.debug \" COPYING #{self.name} to #{@otherwin.name} \"\n $log.debug \" calling copy pad #{@pminrow} #{@pmincol}, #{@top} #{@left}, #{smr} #{smc} self #{self.name} \"\n $log.debug \" calling copy pad H: #{@height} W: #{@width}, PH #{@padheight} PW #{@padwidth} WIN:#{@window} \"\n# $log.debug \" -otherwin target copy pad #{@otherwin.pminrow} #{@otherwin.pmincol}, #{@otherwin.top} #{@otherwin.left}, #{osmr} #{osmc} OTHERWIN:#{@otherwin.name} \"\n ret=\"-\"\n #if ret == -1\n#x XXX $log.debug \" #{ret} otherwin copy pad #{@otherwin.pminrow} #{@otherwin.pmincol}, #{@otherwin.top} #{@otherwin.left}, #{osmr} #{osmc} \"\n $log.debug \" #{ret} otherwin copy pad H: #{osh} W: #{osw}\"\n if @top >= osh\n $log.debug \" #{ret} ERROR top exceeds other ht #{@top} H: #{osh} \"\n end\n if @left >= osw\n $log.debug \" #{ret} ERROR left exceeds other wt #{@left} W: #{osw} \"\n end\n if smr >= osh\n $log.debug \" #{ret} ERROR smrow exceeds other ht #{smr} H: #{osh} \"\n smr = osh() -1 # testing 2010-01-31 21:47 , again 2010-02-05 20:22 \n end\n if smc >= osw\n $log.debug \" #{ret} ERROR smcol exceeds other wt #{smc} W: #{osw} \"\n end\n if smc - @left > @padwidth\n $log.debug \" #{ret} ERROR smcol - left exceeds padwidth #{smc}- #{@left} PW: #{@padwidth} \"\n end\n if smr - @top > @padheight\n $log.debug \" #{ret} ERROR smr - top exceeds padheight #{smr}- #{@top} PH: #{@padheight} \"\n end\n ret = @window.copywin(@otherwin.get_window,@pminrow,@pmincol, @top, @left, smr, smc, 0)\n $log.debug \" copywin ret #{ret} \"\n # 2010-01-11 19:42 one more cause of -1 coming is that padheight (actual height which never\n # changes unless pad increases) or padwidth is smaller than area being printed. Solution: increase \n # buffer by increasing widgets w or h. smc - left should not exceed padwidth. smr-top should not\n # exceed padheight\n #end\n @modified = false\n return ret\n end",
"title": ""
},
{
"docid": "fba4bbbcaccc1fc987fe8916fb1bfab6",
"score": "0.5108477",
"text": "def create_graphics\n create_viewport\n create_background\n create_buttons\n init_entering\n end",
"title": ""
},
{
"docid": "dd6fe5e02638ec331115739c55613457",
"score": "0.508909",
"text": "def fill_setup(gc)\n end",
"title": ""
},
{
"docid": "eaaa12a8852619db715deb6718e5f2b1",
"score": "0.5082868",
"text": "def draw_board_start\n #Places the pawns\n 8.times do |x|\n @b[x][1] = @WP\n @b[x][6] = @BP\n end\n #white, on bottom, the opaque pieces\n @b[0][0] = @WR; @b[7][0] = @WR\n @b[1][0] = @WK; @b[6][0] = @WK\n @b[2][0] = @WB; @b[5][0] = @WB\n @b[3][0] = @WQ\n @b[4][0] = @WKg\n #black, on top, the filled in pieces\n @b[0][7] = @BR; @b[7][7] = @BR\n @b[1][7] = @BK; @b[6][7] = @BK\n @b[2][7] = @BB; @b[5][7] = @BB\n @b[3][7] = @BQ\n @b[4][7] = @BKg\n \n #TESTING PIECES HERE\n\n\n draw_board\n end",
"title": ""
},
{
"docid": "f83cc3b90ee1e5290ae58bccfd8edbdc",
"score": "0.5080658",
"text": "def generateButtons\n @moves = @battler.moves\n @nummoves = 0\n @oldindex = -1\n @x = []; @y = []\n for i in 0...4\n @button[\"#{i}\"].dispose if @button[\"#{i}\"]\n @nummoves += 1 if @moves[i] && @moves[i].id\n @x.push(@viewport.width/2 + (i%2==0 ? -1 : 1)*(@viewport.width/2 + 99))\n @y.push(@viewport.height - 90 + (i/2)*44)\n end\n for i in 0...4\n @y[i] += 22 if @nummoves < 3\n end\n @button = {}\n for i in 0...@nummoves\n # get numeric values of required variables\n movedata = GameData::Move.get(@moves[i].id)\n category = movedata.physical? ? 0 : (movedata.special? ? 1 : 2)\n type = GameData::Type.get(movedata.type).id_number\n # create sprite\n @button[\"#{i}\"] = Sprite.new(@viewport)\n @button[\"#{i}\"].param = category\n @button[\"#{i}\"].z = 102\n @button[\"#{i}\"].bitmap = Bitmap.new(198*2, 74)\n @button[\"#{i}\"].bitmap.blt(0, 0, @buttonBitmap, Rect.new(0, type*74, 198, 74))\n @button[\"#{i}\"].bitmap.blt(198, 0, @buttonBitmap, Rect.new(198, type*74, 198, 74))\n @button[\"#{i}\"].bitmap.blt(65, 46, @catBitmap, Rect.new(0, category*22, 38, 22))\n @button[\"#{i}\"].bitmap.blt(3, 46, @typeBitmap, Rect.new(0, type*22, 72, 22))\n baseColor = @buttonBitmap.get_pixel(5, 32 + (type*74)).darken(0.4)\n pbSetSmallFont(@button[\"#{i}\"].bitmap)\n pbDrawOutlineText(@button[\"#{i}\"].bitmap, 198, 10, 196, 42,\"#{movedata.real_name}\", Color.white, baseColor, 1)\n pp = \"#{@moves[i].pp}/#{movedata.total_pp}\"\n pbDrawOutlineText(@button[\"#{i}\"].bitmap, 0, 48, 191, 26, pp, Color.white, baseColor, 2)\n pbSetSystemFont(@button[\"#{i}\"].bitmap)\n text = [[movedata.real_name, 99, 4, 2, baseColor, Color.new(0, 0, 0, 24)]]\n pbDrawTextPositions(@button[\"#{i}\"].bitmap, text)\n @button[\"#{i}\"].src_rect.set(198, 0, 198, 74)\n @button[\"#{i}\"].ox = @button[\"#{i}\"].src_rect.width/2\n @button[\"#{i}\"].x = @x[i]\n @button[\"#{i}\"].y = @y[i]\n end\n end",
"title": ""
},
{
"docid": "890c0da9a19e343ac3f8713719d26cd1",
"score": "0.507215",
"text": "def create\n (0..7).each do |row|\n @board << []\n (0..7).each do |col| \n @board[row] << \"[ ]\"\n end\n end\n end",
"title": ""
},
{
"docid": "4ee0eceed817e00bdea70e0960d022b2",
"score": "0.50702584",
"text": "def create_board\n\n 8.times do |row|\n 8.times do |col|\n new_cell = Cell.new([col + 1, row + 1])\n @@cells.push(new_cell)\n end\n end\n\n end",
"title": ""
},
{
"docid": "f92c6db97255702b78200d9b0864e6fe",
"score": "0.50646985",
"text": "def setup_board\n gameboard.build_board\n build_white_side\n build_black_side\n end",
"title": ""
},
{
"docid": "38985863e8a678169c06490e14822477",
"score": "0.50328195",
"text": "def populate\n spots = @spaces.length**2\n asteroids = (spots * 0.3).round\n gravity_wells = (spots * 0.1).round\n empty_space = (spots * 0.6 ).round\n\n asteroids.times {fill_spot('A')}\n gravity_wells.times {fill_spot('G')}\n #Because we fill two empty space with start, end marks\n empty_space.times {fill_spot('.')}\n end",
"title": ""
},
{
"docid": "c149edd2c3ce2560f93f327a752307dc",
"score": "0.50237936",
"text": "def place_figures(fill_board)\n @rows = Array.new(8) { Array.new(8) { EmptyPlace.instance } }\n return unless fill_board\n\n place_second_color_rows\n place_pawn_first_rows\n end",
"title": ""
},
{
"docid": "30a75b1fb8c17e2cfe777e74d1e87e92",
"score": "0.50209385",
"text": "def populate_board\n rows_of_pieces = (size - 2) / 2\n make_pieces([0, 1], 'red', rows_of_pieces, 1)\n make_pieces([size - 1, 0], 'black', rows_of_pieces, -1)\n end",
"title": ""
},
{
"docid": "aab974a85cf02d0547badb0c5a71b52f",
"score": "0.49717823",
"text": "def init_layout(state)\n @cells = Array.new(state[:board_rows]) { Array.new(state[:board_columns], nil) }\n @layout = Gtk::FlowBox.new\n @layout.valign = :start\n @layout.max_children_per_line = 1\n @layout.selection_mode = :none\n @layout.set_row_spacing(10)\n\n @turn_indicator = Gtk::Label.new\n @layout.add(@turn_indicator)\n\n @fixed_layout = Gtk::Fixed.new\n @layout.add(@fixed_layout)\n\n cell_grid = Gtk::Grid.new\n @fixed_layout.put(cell_grid, 0, 0)\n\n (0..(state[:board_columns] - 1)).each do |col|\n (0..(state[:board_rows] - 1)).each do |row|\n cell = Gtk::Button.new\n cell.set_size_request(100, 100)\n @cells[row][col] = cell\n cell_grid.attach(cell, col, row, 1, 1)\n end\n end\n\n column_grid = Gtk::Grid.new\n @fixed_layout.put(column_grid, 0, 0)\n\n (0..(state[:board_columns] - 1)).each do |column_index|\n column = Gtk::Button.new\n column.set_size_request(100, 100 * state[:board_rows])\n column.style_context.add_provider(@column_style, Gtk::StyleProvider::PRIORITY_USER)\n column.signal_connect('clicked') do |_|\n changed\n notify_observers('column_clicked', column_index)\n end\n column_grid.attach(column, column_index, 0, 1, 1)\n end\n\n @tokens_indicator = Gtk::Label.new\n\n @t_button = Gtk::Button.new\n @t_button.set_size_request(100, 100)\n @t_button.signal_connect('clicked') do |_, _|\n changed\n notify_observers('t_clicked')\n end\n\n @o_button = Gtk::Button.new\n @o_button.set_size_request(100, 100)\n @o_button.signal_connect('clicked') do |_, _|\n changed\n notify_observers('o_clicked')\n end\n\n @winner = Gtk::Label.new\n @main_menu_button = Gtk::Button.new(label: 'Back to Main Menu')\n @main_menu_button.signal_connect('clicked') do |_, _|\n changed\n notify_observers('main_menu_clicked')\n end\n\n if state[:type] == AppModel::TOOT_AND_OTTO\n @token_button_box = Gtk::Box.new(:horizontal, 10)\n @layout.add(@tokens_indicator)\n @token_button_box.add(@t_button)\n @token_button_box.add(@o_button)\n @layout.add(@token_button_box)\n end\n\n @mask = Gtk::Button.new(label: 'Please wait for your turn...')\n @mask.set_size_request(100 * state[:board_columns], 100 * state[:board_rows])\n @mask.style_context.add_provider(@mask_style, Gtk::StyleProvider::PRIORITY_USER)\n\n @window.add(@layout)\n end",
"title": ""
},
{
"docid": "f5a9f6e21988b8d027677bacf7af5090",
"score": "0.49665388",
"text": "def create_graphics\n create_viewport\n create_base\n create_ui\n end",
"title": ""
},
{
"docid": "39c2121cd2bb19ea3be39e56da85b370",
"score": "0.49647582",
"text": "def set_pad_dimensions(t, l, h, w )\n @pad_h = h\n @pad_w = w\n @top = @orig_top = t\n @left = @orig_left = l\n create_pad\n end",
"title": ""
},
{
"docid": "bf32a40e87376c87dbfcec7f8687d951",
"score": "0.49644607",
"text": "def create_graphics\n super()\n create_background\n create_type_background\n create_pokemon_battler_stack\n create_pokemon_text_boxes\n create_congratulation_text_boxes\n create_pokemon_stars_animation\n create_graveyard_anim\n create_turning_ball\n create_party_battler_stack\n create_league_champion_text_box\n create_trainer_infos_text_box\n create_end_stars\n end",
"title": ""
},
{
"docid": "539f8ea172b4e58f7df72aef61605d2b",
"score": "0.49639863",
"text": "def construct_board_graphics_overlay(window)\n\t\tdark = false\t\t\t\t\t\t\t\t# this boolean controls the checkerboarding\n\t\tdark_hex = 0xff3f3333\n\t\tlight_hex = 0xff9e9fad\n\t\tself.board.each_with_index do |column, c|\n\t\t\tcolumn.size.times do |r|\n\t\t\t\tx = c*@cell_size\n\t\t\t\ty = r*@cell_size\n\t\t\t\tboard_cell = GraphicsLibrary::Rectangle.new(window, x, y, @cell_size, @cell_size, dark_hex, 0) if dark\n\t\t\t\tboard_cell = GraphicsLibrary::Rectangle.new(window, x, y, @cell_size, @cell_size, light_hex, 0) if !dark\n\t\t\t\tdark = !dark\n\t\t\t\t@board_graphics_overlay << board_cell\t\t\t\t\t# append the cells to the array of cells.\n\t\t\tend\n\t\t\tdark = !dark if (@stagger_cell_color_value % 2 == 0)\t\t# stagger the cell color for even sized boards so that it checkerboards properly.\n\t\t\t\t \n\t\tend\n\tend",
"title": ""
},
{
"docid": "8974c34ca633a8a6a49dfe105dda28c3",
"score": "0.49638042",
"text": "def pad(fill_value = -1, data = @raw.clone)\n data = _pad data, 0, fill_value, 0\n _pad data, -1, fill_value, 6\n end",
"title": ""
},
{
"docid": "3bcee306c33760950ab4677121d4e7af",
"score": "0.49629813",
"text": "def setup_display\n gameboard.build_display\n build_white_side\n build_black_side\n end",
"title": ""
},
{
"docid": "0d6bf9e3178e74eb91cb9b0e6e6a57e9",
"score": "0.4960611",
"text": "def space\n canvas = (1..@height).to_a.collect {|_| [:empty] * @width}\n @crates.each do |sc|\n range_y = (sc.min_y..sc.max_y)\n range_x = (sc.min_x..sc.max_x)\n sc.fill_coordinates.each do |x, y|\n canvas[y][x] = :filled\n end\n end\n canvas\n end",
"title": ""
},
{
"docid": "95da77c498700a3faf75a210759fff2f",
"score": "0.49537763",
"text": "def fill_field\n SHIPS.each { |size| put_ship(size) }\n end",
"title": ""
},
{
"docid": "31a00edc2e12e5f23cb6d61fec44c31b",
"score": "0.49326038",
"text": "def create_graphics\n create_viewport\n create_background\n create_pokemon_sprite\n create_egg_sprite\n end",
"title": ""
},
{
"docid": "2ba61c496c789460ab2522f7ca56ffbd",
"score": "0.4930116",
"text": "def place_pawn_first_rows\n 8.times { |col| self[[1, col]] = Pawn.new(self, :black, [1, col]) }\n 8.times { |col| self[[6, col]] = Pawn.new(self, :white, [6, col]) }\n end",
"title": ""
},
{
"docid": "e1d8130298a72d7d1bce6f8472e370fd",
"score": "0.49282604",
"text": "def fill\n \t@fill\n end",
"title": ""
},
{
"docid": "7ff4a1985d7ef8e67ff82ea59ddffdd4",
"score": "0.4927309",
"text": "def initialize_board\n # Non-pawns for black player:\n Rook.create(x_position: 1, y_position: 1, game_id: id, color: \"black\", player_id: black_player_id)\n Knight.create(x_position: 2, y_position: 1, game_id: id, color: \"black\", player_id: black_player_id)\n Bishop.create(x_position: 3, y_position: 1, game_id: id, color: \"black\", player_id: black_player_id)\n Queen.create(x_position: 4, y_position: 1, game_id: id, color: \"black\", player_id: black_player_id)\n King.create(x_position: 5, y_position: 1, game_id: id, color: \"black\", player_id: black_player_id)\n Bishop.create(x_position: 6, y_position: 1, game_id: id, color: \"black\", player_id: black_player_id)\n Knight.create(x_position: 7, y_position: 1, game_id: id, color: \"black\", player_id: black_player_id)\n Rook.create(x_position: 8, y_position: 1, game_id: id, color: \"black\", player_id: black_player_id)\n\n # Non-pawns for white player:\n Rook.create(x_position: 1, y_position: 8, game_id: id, color: \"white\", player_id: white_player_id)\n Knight.create(x_position: 2, y_position: 8, game_id: id, color: \"white\", player_id: white_player_id)\n Bishop.create(x_position: 3, y_position: 8, game_id: id, color: \"white\", player_id: white_player_id)\n Queen.create(x_position: 4, y_position: 8, game_id: id, color: \"white\", player_id: white_player_id)\n King.create(x_position: 5, y_position: 8, game_id: id, color: \"white\", player_id: white_player_id)\n Bishop.create(x_position: 6, y_position: 8, game_id: id, color: \"white\", player_id: white_player_id)\n Knight.create(x_position: 7, y_position: 8, game_id: id, color: \"white\", player_id: white_player_id)\n Rook.create(x_position: 8, y_position: 8, game_id: id, color: \"white\", player_id: white_player_id)\n\n # Pawns for both players:\n for i in 1..8\n Pawn.create(color: \"black\", x_position: i, y_position: 2, game_id: id, player_id: black_player_id)\n Pawn.create(color: \"white\", x_position: i, y_position: 7, game_id: id, player_id: white_player_id)\n end\n\n self.counter = 0\n # Saves the counter to the database.\n self.save\n end",
"title": ""
},
{
"docid": "9234be956dca2cc882172ad8f4f5bc80",
"score": "0.49244758",
"text": "def build_ships\n 5.times do\n ship = self.ships.build\n ship.populate\n end\n end",
"title": ""
},
{
"docid": "72b53baf2e1e7483fd27bfd9a84026e6",
"score": "0.49242923",
"text": "def fire_dimension_changed _method=nil\n # recreate pad since width or ht has changed (row count or col width changed)\n @_populate_needed = true\n @repaint_required = true\n @repaint_all = true\n fire_handler :DIMENSION_CHANGED, _method\n @__first_time = nil\n end",
"title": ""
},
{
"docid": "d308232a5d98cb7d5862883c16d2d753",
"score": "0.4921738",
"text": "def fill_setup(_gc)\n end",
"title": ""
},
{
"docid": "9ab8b1c64554dfc081edb2eb6b190568",
"score": "0.49213442",
"text": "def initialize\n x = 0\n y = 0\n space_array = []\n 42.times do\n space = instance_variable_set(\"@space#{x}#{y}\", Space.new)\n space_array.push(space)\n self.class.send(:attr_accessor, \"space#{x}#{y}\")\n y += 1\n if y == 6\n y = 0\n x += 1\n end\n end\n @space_array = space_array\n @display = \"------------------------------------\\n| #{space05.occupied} | #{space15.occupied} | #{space25.occupied} |\"\\\n \" #{space35.occupied} | #{space45.occupied} | #{space55.occupied} | #{space65.occupied} |\\n\"\\\n \"------------------------------------\\n| #{space04.occupied} | #{space14.occupied} | #{space24.occupied} |\"\\\n \" #{space34.occupied} | #{space44.occupied} | #{space54.occupied} | #{space64.occupied} |\\n\" \\\n \"------------------------------------\\n| #{space03.occupied} | #{space13.occupied} | #{space23.occupied} |\"\\\n \" #{space33.occupied} | #{space43.occupied} | #{space53.occupied} | #{space63.occupied} |\\n\"\\\n \"------------------------------------\\n| #{space02.occupied} | #{space12.occupied} | #{space22.occupied} |\"\\\n \" #{space32.occupied} | #{space42.occupied} | #{space52.occupied} | #{space62.occupied} |\\n\"\\\n \"------------------------------------\\n| #{space01.occupied} | #{space11.occupied} | #{space21.occupied} |\"\\\n \" #{space31.occupied} | #{space41.occupied} | #{space51.occupied} | #{space61.occupied} |\\n\"\\\n \"------------------------------------\\n| #{space00.occupied} | #{space10.occupied} | #{space20.occupied} |\"\\\n \" #{space30.occupied} | #{space40.occupied} | #{space50.occupied} | #{space60.occupied} |\\n\"\\\n \"------------------------------------\\n 1 2 3 4 5 6 7\" \n end",
"title": ""
},
{
"docid": "9e8f7c0cdacfa115bfdca89180bdbd67",
"score": "0.48876193",
"text": "def initialize(fill_board = true)\n @grid = Array.new(8) { Array.new(8) }\n\n setup_grid if fill_board\n end",
"title": ""
},
{
"docid": "fe1f97323b8312eac8d2e58d808d4879",
"score": "0.4874089",
"text": "def populate_board\n black = \"black\"\n white = \"white\"\n\n white_pawns = [\"A2\", \"B2\", \"C2\", \"D2\", \"E2\", \"F2\", \"G2\", \"H2\"]\n black_pawns = [\"A7\", \"B7\", \"C7\", \"D7\", \"E7\", \"F7\", \"G7\", \"H7\"]\n\n # create white pawns\n white_pawns.each do |pos|\n @board.nodes[pos].piece = create_pawn(white, pos)\n end\n\n # create white pieces\n @board.nodes[\"E1\"].piece = create_king(white, \"E1\")\n @board.nodes[\"D1\"].piece = create_queen(white, \"D1\")\n @board.nodes[\"C1\"].piece = create_bishop(white, \"C1\")\n @board.nodes[\"F1\"].piece = create_bishop(white, \"F1\")\n @board.nodes[\"B1\"].piece = create_knight(white, \"B1\")\n @board.nodes[\"G1\"].piece = create_knight(white, \"G1\")\n @board.nodes[\"A1\"].piece = create_rook(white, \"A1\")\n @board.nodes[\"H1\"].piece = create_rook(white, \"H1\")\n\n # create black pawns\n black_pawns.each do |pos|\n @board.nodes[pos].piece = create_pawn(black, pos)\n end\n\n # create black pieces\n @board.nodes[\"E8\"].piece = create_king(black, \"E8\")\n @board.nodes[\"D8\"].piece = create_queen(black, \"D8\")\n @board.nodes[\"C8\"].piece = create_bishop(black, \"C8\")\n @board.nodes[\"F8\"].piece = create_bishop(black, \"F8\")\n @board.nodes[\"B8\"].piece = create_knight(black, \"B8\")\n @board.nodes[\"G8\"].piece = create_knight(black, \"G8\")\n @board.nodes[\"A8\"].piece = create_rook(black, \"A8\")\n @board.nodes[\"H8\"].piece = create_rook(black, \"H8\")\n\n end",
"title": ""
},
{
"docid": "e1807db19e7e3acb5d76075cde2f255e",
"score": "0.48720482",
"text": "def create_shape\n id = rand 7\n @cur_y = 0\n @cur_x = 5\n @shape = SHAPES[id].dup\n end",
"title": ""
},
{
"docid": "d05493523d7b3822f8f3492034d54d2e",
"score": "0.4869925",
"text": "def build_grid\n x = 0\n 10.times do\n row = []\n y = 0\n 10.times do\n row.push({display: \"~~\", ship: false, coord: [x, y]})\n y += 1\n end\n self.grid << row\n x += 1\n end\n p self.grid\n end",
"title": ""
},
{
"docid": "37811998f1ca8214385ef355be25e850",
"score": "0.4866225",
"text": "def pad\n if pad_id\n @pad ||= Pad.new(instance, pad_id)\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "450912e4122cdb6b0c72f7a06c0b8eb9",
"score": "0.4862014",
"text": "def create_pad(id, options={})\n Pad.create instance, id, options\n end",
"title": ""
},
{
"docid": "cbbe7ca65a3455596254409647342d66",
"score": "0.48619336",
"text": "def fill_train(train)\n 120.times { train.board(active_passenger, station) }\n end",
"title": ""
},
{
"docid": "f5f4d206939301403cc763521ee4deca",
"score": "0.4852602",
"text": "def create_list\n @list = Array.new(6) { |i| DexButton.new(@viewport, i) }\n end",
"title": ""
},
{
"docid": "5b683b506c3a68bdb912a8891e4f2dfc",
"score": "0.48462597",
"text": "def add_pawn\r\n #White pawns\r\n (0..7).each do |col|\r\n pos = [6, col]\r\n \r\n self[pos] = Pawn.new(:white,rows,pos,:Wpawn)\r\n end\r\n\r\n #Black pawns\r\n (0..7).each do |col|\r\n pos = [1, col]\r\n \r\n self[pos] = Pawn.new(:black,rows,pos,:Bpawn)\r\n end\r\n\r\n end",
"title": ""
},
{
"docid": "cde399e349e07d52ea4d35cda1b50d37",
"score": "0.4842125",
"text": "def _init_layout\n # when user gives a negative value, we recalc and overwrite so the need to save, for a redraw.\n @saved_width ||= @width\n @saved_height ||= @height\n\n lines = Ncurses.LINES - 1\n columns = Ncurses.COLS - 1\n if @height_pc\n @height = ((lines - @top_margin - @bottom_margin) * @height_pc).floor\n elsif @saved_height <= 0\n @height = lines - @saved_height - @top_margin - @bottom_margin\n end\n $log.debug \" layout height = #{@height} \"\n if @width_pc\n @width = ((columns - @left_margin - @right_margin) * width_pc).floor\n elsif @saved_width <= 0\n # if width was -1 we have overwritten it so now we cannot recalc it. it remains the same\n @width = columns - @saved_width - @left_margin - @right_margin\n end\n $log.debug \" layout wid = #{@width} \"\n # if user has not specified, then get all the objects\n @components ||= @form.widgets.select do |w| w.visible != false && !@ignore_list.include?(w.class.to_s.downcase); end\n $log.debug \" components #{@components.count} \"\n end",
"title": ""
},
{
"docid": "f831c0672677a681a2820347cfcb0f41",
"score": "0.48417678",
"text": "def populate_board\n back_row = [Rook, Knight, Bishop, Queen, King, Bishop, Knight, Rook]\n\n black_back_row = []\n back_row.each_with_index do |piece_class, j|\n black_back_row << piece_class.new(self, :black, [0, j])\n end\n board[0] = black_back_row\n \n black_front_row = []\n (0..7).each {|idx| black_front_row << Pawn.new(self, :black, [1, idx])}\n board[1] = black_front_row\n \n (2..5).each do |row|\n board[row] = Array.new(8) {NullPiece.instance} \n end\n \n white_front_row = []\n 8.times {|idx| white_front_row << Pawn.new(self, :white, [6, idx])}\n board[6] = white_front_row\n \n white_back_row = []\n back_row.each_with_index do |piece_class, j|\n white_back_row << piece_class.new(self, :white, [7, j])\n end\n board[7] = white_back_row\n end",
"title": ""
},
{
"docid": "bee93650bbfeb453f8873768f570cddd",
"score": "0.48265225",
"text": "def create_graphics\n create_viewport\n @all_window = UI::SpriteStack.new(@viewport)\n create_background\n create_windows\n @all_window.each { |window| window.visible = false } if @delete_game\n @max_index = @all_window.size - 1\n Graphics.sort_z\n refresh\n end",
"title": ""
},
{
"docid": "528891db7e78486552a34642a833a2a5",
"score": "0.48245883",
"text": "def create_positions\n (1..GAME_BOARD_LENGTH).each do |y|\n (1..GAME_BOARD_LENGTH).each do |x|\n self.positions.new(x: x, y: y)\n end\n end\n set_ships\n save\n end",
"title": ""
},
{
"docid": "3ba9ef9a8476dddd506ed17b271f20c8",
"score": "0.4823777",
"text": "def repaint\n return unless @repaint_required # 2010-11-20 13:13 its writing over a window i think TESTING\n if @label_unattached\n alert \"came here unattachd\"\n @label.set_form(@form)\n @label_unattached = nil\n end\n if @label_unplaced\n alert \"came here unplaced\"\n position_label\n @label_unplaced = nil\n end\n #@bgcolor ||= $def_bg_color\n #@color ||= $def_fg_color\n _color = color()\n _bgcolor = bgcolor()\n $log.debug(\"repaint FIELD: #{id}, #{name}, #{row} #{col},pcol:#{@pcol}, #{focusable} st: #{@state} \")\n @width = 1 if width == 0\n printval = getvalue_for_paint().to_s # added 2009-01-06 23:27 \n printval = mask()*printval.length unless @mask.nil?\n if !printval.nil? \n if printval.length > width # only show maxlen\n printval = printval[@pcol..@pcol+width-1] \n else\n printval = printval[@pcol..-1]\n end\n end\n \n acolor = @color_pair || get_color($datacolor, _color, _bgcolor)\n if @state == :HIGHLIGHTED\n _bgcolor = @highlight_bgcolor || _bgcolor\n _color = @highlight_color || _color\n acolor = get_color(acolor, _color, _bgcolor)\n end\n @graphic = @form.window if @graphic.nil? ## cell editor listbox hack \n #$log.debug \" Field g:#{@graphic}. r,c,displen:#{@row}, #{@col}, #{@width} c:#{@color} bg:#{@bgcolor} a:#{@attr} :#{@name} \"\n r = row\n c = col\n @graphic.printstring r, c, sprintf(\"%-*s\", width, printval), acolor, attr()\n @field_col = c\n @repaint_required = false\n end",
"title": ""
},
{
"docid": "6298b0508e009fba16d18051c58a5634",
"score": "0.482278",
"text": "def create_graphics\n create_viewport\n create_base_ui\n create_pocket_ui\n create_scroll_bar\n create_bag_sprite\n create_item_list\n create_arrow\n create_info\n create_shadow\n create_search\n create_frame # Should always be last\n end",
"title": ""
},
{
"docid": "4ef7c0ad570cc5560208a6e732cd92fa",
"score": "0.4813558",
"text": "def create_graphics\n create_character_sprite\n create_phrase\n create_inputs\n refresh_chars\n end",
"title": ""
},
{
"docid": "0cb0845e0c0340e39c45e588c63ecb44",
"score": "0.47953802",
"text": "def setup_grid(skip_render, skip_set_pieces)\n @grid = Array.new(8) { Array.new(8) { EmptySquare.new } }\n unless skip_set_pieces\n set_major_minor\n set_pawns\n end\n\n render unless skip_render\n end",
"title": ""
},
{
"docid": "c35e6fb5beade6dcb0b7942dcfea0ff3",
"score": "0.47944987",
"text": "def create_graphics\n create_viewport\n end",
"title": ""
},
{
"docid": "9abe005b057aec9dce3ffb75c51802cf",
"score": "0.47877404",
"text": "def default_grid\n array = Array.new(8) { Array.new(8) }\n\n array[0][0] = Rook.new('white', [0,0], 'slide')\n array[1][0] = Knight.new('white', [1,0], 'step')\n array[2][0] = Bishop.new('white', [2,0], 'slide')\n array[3][0] = Queen.new('white', [3,0], 'slide')\n array[4][0] = King.new('white', [4,0], 'step')\n array[5][0] = Bishop.new('white', [5,0], 'slide')\n array[6][0] = Knight.new('white', [6,0], 'step')\n array[7][0] = Rook.new('white', [7,0], 'slide')\n array[0..7].each_with_index { |column, index| \n column[1] = Pawn.new('white', [index,1], 'step') }\n\n array[0][7] = Rook.new('black', [0,7], 'slide')\n array[1][7] = Knight.new('black', [1,7], 'step')\n array[2][7] = Bishop.new('black', [2,7], 'slide')\n array[3][7] = Queen.new('black', [3,7], 'slide')\n array[4][7] = King.new('black', [4,7], 'step')\n array[5][7] = Bishop.new('black', [5,7], 'slide')\n array[6][7] = Knight.new('black', [6,7], 'step')\n array[7][7] = Rook.new('black', [7,7], 'slide')\n array[0..7].each_with_index { |column, index| \n column[6] = Pawn.new('black', [index,6], 'step') }\n\n array\n end",
"title": ""
},
{
"docid": "e6862d59cbf15166fafd3e8c1b4cd7fb",
"score": "0.47834244",
"text": "def initialize(pop = true)\n @board = Array.new(8) { Array.new(8) }\n populate_board if pop\n end",
"title": ""
},
{
"docid": "a873dbdcc0a073f57126624dad759ca9",
"score": "0.4781707",
"text": "def build\n\t\t@hills = []\n\t\tif @anthills.length == 10 && @field\n\t\t\tx = (0...@rows).to_a.shuffle.take(10)\n\t\t\ty = (0...@columns).to_a.shuffle.take(10)\n\t\t\t@anthills.each_with_index do |hill, i|\n\t\t\t\thill_type = rand(0..1)\n\t\t\t\tif hill_type == 0\n\t\t\t\t\t@hills << WarriorAnthill.new(hill,x[i],y[i])\n\t\t\t\telse\n\t\t\t\t\t@hills << ForagerAnthill.new(hill,x[i],y[i])\n\t\t\t\tend\n\t\t\t\t@field[x[i]][y[i]] = Cell.new(@hills[i])\n\t\t\tend\n\t\t\t@meadow = Meadow.instance.create(@field, @hills, @rows, @columns)\n\t\telse \n\t\t\tputs \"Not enough hills or field not created\"\n\t\tend\n\t\t@meadow\n\tend",
"title": ""
},
{
"docid": "dccdd97cd998da9da4e9e50bc44c1ad8",
"score": "0.47785586",
"text": "def draw_new\n\t @board=Array.new(@y) {Array.new(@x){'*'}}\n\t \n end",
"title": ""
},
{
"docid": "bc0aaadead14f03e5c3a6dbf2966c2d0",
"score": "0.4767122",
"text": "def determine_rects(rect, spacing, right_pad)\n rects = []\n \n # Rects Initialization\n rects[0] = [Rect.new(rect.x,rect.y,90,24),\n Rect.new(rect.x,rect.y,100,24)]\n rects[1] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,25,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[2] = Rect.new(rect.x,rect.y,rect.width,rect.height)\n rects[3] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,25,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[4] = Rect.new(rect.x,rect.y,rect.width,rect.height)\n rects[5] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,50,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[6] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,50,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[7] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,50,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[8] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,50,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[9] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,50,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[10] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,50,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[11] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,50,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n \n gauge_value_width = rect.width - 24 - 25 - right_pad\n stats_value_width = rect.width - 24 - 50 - right_pad\n gauge_y = 16\n \n # Rects Adjustments\n \n # ucActStates\n rects[0][1].x += rects[0][0].width\n \n # ucHpStat\n rects[1][0].y += spacing\n rects[1][1].x += rects[1][0].width\n rects[1][1].y = rects[1][0].y\n rects[1][2].x = rects[1][1].x + rects[1][1].width\n rects[1][2].y = rects[1][0].y\n rects[1][2].width = gauge_value_width\n \n # cHpStatGauge\n rects[2].y += rects[1][0].y+gauge_y\n rects[2].height = rects[1][0].height-gauge_y\n \n # ucMpStat\n rects[3][0].y += spacing*2\n rects[3][1].x += rects[3][0].width\n rects[3][1].y = rects[3][0].y\n rects[3][2].x = rects[3][1].x + rects[3][1].width\n rects[3][2].y = rects[3][0].y\n rects[3][2].width = gauge_value_width\n \n # cMpStatGauge\n rects[4].y += rects[3][0].y+gauge_y\n rects[4].height = rects[3][0].height-gauge_y\n \n # ucAtkStat\n rects[5][0].y += spacing*3\n rects[5][1].x += rects[5][0].width\n rects[5][1].y = rects[5][0].y\n rects[5][2].x = rects[5][1].x + rects[5][1].width\n rects[5][2].y = rects[5][0].y\n rects[5][2].width = stats_value_width\n \n # ucDefStat\n rects[6][0].y += spacing*4\n rects[6][1].x += rects[6][0].width\n rects[6][1].y = rects[6][0].y\n rects[6][2].x = rects[6][1].x + rects[6][1].width\n rects[6][2].y = rects[6][0].y\n rects[6][2].width = stats_value_width\n \n # ucSpiStat\n rects[7][0].y += spacing*5\n rects[7][1].x += rects[7][0].width\n rects[7][1].y = rects[7][0].y\n rects[7][2].x = rects[7][1].x + rects[7][1].width\n rects[7][2].y = rects[7][0].y\n rects[7][2].width = stats_value_width\n \n # ucAgiStat\n rects[8][0].y += spacing*6\n rects[8][1].x += rects[8][0].width\n rects[8][1].y = rects[8][0].y\n rects[8][2].x = rects[8][1].x + rects[8][1].width\n rects[8][2].y = rects[8][0].y\n rects[8][2].width = stats_value_width\n \n # ucEvaStat\n rects[9][0].y += spacing*7\n rects[9][1].x += rects[9][0].width\n rects[9][1].y = rects[9][0].y\n rects[9][2].x = rects[9][1].x + rects[9][1].width\n rects[9][2].y = rects[9][0].y\n rects[9][2].width = stats_value_width\n \n # ucHitStat\n rects[10][0].y += spacing*8\n rects[10][1].x += rects[10][0].width\n rects[10][1].y = rects[10][0].y\n rects[10][2].x = rects[10][1].x + rects[10][1].width\n rects[10][2].y = rects[10][0].y\n rects[10][2].width = stats_value_width\n \n # ucCriStat\n rects[11][0].y += spacing*9\n rects[11][1].x += rects[11][0].width\n rects[11][1].y = rects[11][0].y\n rects[11][2].x = rects[11][1].x + rects[11][1].width\n rects[11][2].y = rects[11][0].y\n rects[11][2].width = stats_value_width\n \n return rects\n end",
"title": ""
},
{
"docid": "f9d92f2f95791e4c1240548cc2ed1e71",
"score": "0.4763191",
"text": "def create_graphics\n create_viewport\n create_base_ui\n create_credit_payout\n create_bands\n end",
"title": ""
},
{
"docid": "b5a6c5cbf0b08c0249ed8a97e2190f6d",
"score": "0.47616068",
"text": "def update!(**args)\n @border = args[:border] if args.key?(:border)\n @fill = args[:fill] if args.key?(:fill)\n @shape = args[:shape] if args.key?(:shape)\n end",
"title": ""
},
{
"docid": "ec2a3a90bfd277bb0794bdfbda25ff77",
"score": "0.47599113",
"text": "def initialize(phone_pad)\n super(phone_pad)\n @cycle = ['*']\n end",
"title": ""
},
{
"docid": "bd4610052107a67529a8fcd504ff51c9",
"score": "0.47535914",
"text": "def createPad(padID, text=nil)\n params = {:padID => padID}\n params[:text] = text unless text.nil?\n call :createPad, params\n end",
"title": ""
},
{
"docid": "62e96ac7f905e4394ffea22d480e76da",
"score": "0.47531694",
"text": "def new_round\n init_board()\n end",
"title": ""
},
{
"docid": "a9f63ced2d374c325bb7e9ad52d6e8cf",
"score": "0.47508544",
"text": "def repack\n @widths = Array.new(@rows.empty? ? 0 : @rows[0].size, 0)\n @heights = Array.new(@rows.size, 0)\n\n filled_columns = []\n filled_rows = []\n\n # Calculate the maximum widths of each column and the maximum height of each row.\n @rows.each_with_index do |row, row_num|\n row.each_with_index do |element, column_num|\n fills = (element.align_h == :fill)\n @widths[column_num] = [fills ? element.min_width : element.outer_width, @widths[column_num]].max\n filled_columns.push fills\n\n fills = (element.align_v == :fill)\n @heights[row_num] = [fills ? element.min_width : element.outer_height, @heights[row_num]].max\n filled_rows.push fills\n end\n end\n\n # Expand the size of each filled column to make the minimum size required.\n unless @widths.empty?\n num_filled_columns = filled_columns.select {|value| value }.count\n total_width = @widths.inject(0, :+) + (padding_left + padding_right) + ((@num_columns - 1) * spacing_h)\n extra_width = min_width - total_width\n if extra_width > 0\n if num_filled_columns > 0\n @widths[filled_columns.index true] += extra_width\n else\n @widths[-1] += extra_width\n end\n end\n end\n\n # Expand the size of each filled row to make the minimum size required.\n unless @heights.empty?\n num_filled_rows = filled_rows.select {|value| value }.count\n total_height = @heights.inject(0, :+) + (padding_left + padding_right) + ((@num_rows - 1) * spacing_v)\n extra_height = min_height - total_height\n if extra_height > 0\n if num_filled_rows > 0\n @heights[filled_rows.index true] += extra_height\n else\n @heights[-1] += extra_height\n end\n end\n end\n\n # Actually place all the elements into the grid positions, modified by valign and align.\n current_y = y + padding_top\n @rows.each_with_index do |row, row_num|\n current_x = x + padding_left\n\n row.each_with_index do |element, column_num|\n element.x = current_x + element.border_thickness\n\n case element.align_h # Take horizontal alignment into consideration.\n when :fill\n if element.width < @widths[column_num]\n element.width = @widths[column_num]\n element.send :repack if element.is_a? Grid\n end\n when :center\n element.x += (@widths[column_num] - element.width) / 2\n when :right\n element.x += @widths[column_num] - element.width\n end\n\n current_x += @widths[column_num]\n current_x += spacing_h unless column_num == @num_columns - 1\n\n element.y = current_y + element.border_thickness\n\n case element.align_v # Take horizontal alignment into consideration.\n when :fill\n if element.height < @heights[row_num]\n element.height = @heights[row_num]\n element.send :repack if element.is_a? Grid\n end\n when :center\n element.y += (@heights[row_num] - element.height) / 2\n when :bottom\n element.y += @heights[row_num] - element.height\n else\n end\n end\n\n self.width = current_x - x + padding_left if row_num == 0\n\n current_y += @heights[row_num] unless row.empty?\n current_y += spacing_h unless row_num == num_rows - 1\n end\n\n self.height = current_y - y + padding_top\n\n nil\n end",
"title": ""
},
{
"docid": "771cdbb859ac995da163bbc6cb94f625",
"score": "0.47472304",
"text": "def reset(cols, rows)\n\n\t@cols = cols.to_i.abs\n\t@rows = rows.to_i.abs\n\t@created = true\n\n\tx = 0\n\tuntil x > @rows\n\t y = 0\n\t until y > @cols\n\t\tset_pixel(\"#{y}-#{x}\", COLOR_WHITE)\n\t\ty = y+1\n\t end\n\t x = x+1\n\tend\n\n end",
"title": ""
},
{
"docid": "68bbc0821a4dd77e87245f48fdcacdcc",
"score": "0.47457954",
"text": "def prepare_fills # :nodoc:\n fills = {}\n index = 2 # Start from 2. See above.\n\n # Add the default fills.\n fills['0:0:0'] = 0\n fills['17:0:0'] = 1\n\n # Store the DXF colors separately since them may be reversed below.\n @dxf_formats.each do |format|\n next unless format.pattern != 0 || format.bg_color != 0 || format.fg_color != 0\n\n format.has_dxf_fill(true)\n format.dxf_bg_color = format.bg_color\n format.dxf_fg_color = format.fg_color\n end\n\n @xf_formats.each do |format|\n # The following logical statements jointly take care of special cases\n # in relation to cell colours and patterns:\n # 1. For a solid fill (_pattern == 1) Excel reverses the role of\n # foreground and background colours, and\n # 2. If the user specifies a foreground or background colour without\n # a pattern they probably wanted a solid fill, so we fill in the\n # defaults.\n #\n if format.pattern == 1 && ne_0?(format.bg_color) && ne_0?(format.fg_color)\n format.fg_color, format.bg_color = format.bg_color, format.fg_color\n elsif format.pattern <= 1 && ne_0?(format.bg_color) && eq_0?(format.fg_color)\n format.fg_color = format.bg_color\n format.bg_color = 0\n format.pattern = 1\n elsif format.pattern <= 1 && eq_0?(format.bg_color) && ne_0?(format.fg_color)\n format.bg_color = 0\n format.pattern = 1\n end\n\n key = format.get_fill_key\n\n if fills[key]\n # Fill has already been used.\n format.fill_index = fills[key]\n format.has_fill(false)\n else\n # This is a new fill.\n fills[key] = index\n format.fill_index = index\n format.has_fill(true)\n index += 1\n end\n end\n\n @fill_count = index\n end",
"title": ""
},
{
"docid": "2b1e68568ea2175ab7c214b2d737d770",
"score": "0.474241",
"text": "def create_graphics\n create_viewport\n create_base_ui\n create_sub_background\n create_trainer_sprite\n create_badge_sprites\n create_texts\n end",
"title": ""
},
{
"docid": "b45aa76368444fd9e411230b846e6c31",
"score": "0.4736717",
"text": "def make_draw(round, format)\n\t\t\t@num_rooms_assigned = 0;\n\t\t\tround.tournament.update(progress: 0.0); #reset progress to 0\n\t allocate_rooms(sort_teams_and_adjs(round), round, format); #make rooms\n\t\tend",
"title": ""
},
{
"docid": "f227093ce9a8f8ccff1a5335c3cead6e",
"score": "0.4734875",
"text": "def draw_board\n @board = stack do\n fill rgb(210,105,30)\n rect BOARD_SQUARE_POS[:board_start], BOARD_SQUARE_POS[:board_start], BLOCK_DIMENTION*CHECKERS_WIDTH , BLOCK_DIMENTION*CHECKERS_HEIGHT\n fill rgb(245,222,179)\n CHECKERS_HEIGHT.times do |x|\n CHECKERS_WIDTH.times do |y|\n rect BOARD_SQUARE_POS[:board_start] + BLOCK_DIMENTION*x, BOARD_SQUARE_POS[:board_start] + BLOCK_DIMENTION*y, BLOCK_DIMENTION,BLOCK_DIMENTION if x.even? && y.even?\n rect BOARD_SQUARE_POS[:board_start] + BLOCK_DIMENTION*x, BOARD_SQUARE_POS[:board_start] + BLOCK_DIMENTION*y, BLOCK_DIMENTION,BLOCK_DIMENTION if !x.even? && !y.even?\n end\n end\n end\nend",
"title": ""
},
{
"docid": "e307f38a6b6e928e44eef65c8d8a59cb",
"score": "0.4730583",
"text": "def fillrect(*)\n super\n end",
"title": ""
},
{
"docid": "c1a9d8b3a4a966e6ce27840ba26b4cfe",
"score": "0.4728284",
"text": "def pad!(min_size, value = nil)\n spaces = min_size - self.length\n spaces.times do \n self.push(value)\n end\n self\nend",
"title": ""
},
{
"docid": "5108ae7db52b93a7f09fab34ae290256",
"score": "0.47219005",
"text": "def initialize_board\n # Building out white pieces\n (0..7).each do |x|\n Pawn.create(is_black: false, x_position: x, y_position: 1, game_id: id, user_id: user_id_white, status: 'active')\n end\n\n Rook.create(is_black: false, x_position: 0, y_position: 0, game_id: id, user_id: user_id_white, status: 'active')\n Rook.create(is_black: false, x_position: 7, y_position: 0, game_id: id, user_id: user_id_white, status: 'active')\n\n Knight.create(is_black: false, x_position: 1, y_position: 0, game_id: id, user_id: user_id_white, status: 'active')\n Knight.create(is_black: false, x_position: 6, y_position: 0, game_id: id, user_id: user_id_white, status: 'active')\n\n Bishop.create(is_black: false, x_position: 2, y_position: 0, game_id: id, user_id: user_id_white, status: 'active')\n Bishop.create(is_black: false, x_position: 5, y_position: 0, game_id: id, user_id: user_id_white, status: 'active')\n\n King.create(is_black: false, x_position: 4, y_position: 0, game_id: id, user_id: user_id_white, status: 'active')\n Queen.create(is_black: false, x_position: 3, y_position: 0, game_id: id, user_id: user_id_white, status: 'active')\n\n # Building out the black pieces\n (0..7).each do |x|\n Pawn.create(is_black: true, x_position: x, y_position: 6, game_id: id, user_id: user_id_black, status: 'active')\n end\n\n Rook.create(is_black: true, x_position: 0, y_position: 7, game_id: id, user_id: user_id_black, status: 'active')\n Rook.create(is_black: true, x_position: 7, y_position: 7, game_id: id, user_id: user_id_black, status: 'active')\n\n Knight.create(is_black: true, x_position: 1, y_position: 7, game_id: id, user_id: user_id_black, status: 'active')\n Knight.create(is_black: true, x_position: 6, y_position: 7, game_id: id, user_id: user_id_black, status: 'active')\n\n Bishop.create(is_black: true, x_position: 2, y_position: 7, game_id: id, user_id: user_id_black, status: 'active')\n Bishop.create(is_black: true, x_position: 5, y_position: 7, game_id: id, user_id: user_id_black, status: 'active')\n\n King.create(is_black: true, x_position: 4, y_position: 7, game_id: id, user_id: user_id_black, status: 'active')\n Queen.create(is_black: true, x_position: 3, y_position: 7, game_id: id, user_id: user_id_black, status: 'active')\n end",
"title": ""
},
{
"docid": "48d8f940e71d7aa2dc5bd873a715f51e",
"score": "0.471937",
"text": "def create_new_rep\n @rep = []\n end",
"title": ""
},
{
"docid": "1772ade82f1d86c1e5e3f01aa1fb1055",
"score": "0.47135365",
"text": "def autogenerate_elements\n to_auto_generate_elements = self.layout_description[\"autogenerate\"]\n unless (to_auto_generate_elements.blank?)\n to_auto_generate_elements.each do |element|\n element = Element.create_from_scratch({'page_id' => self.id, 'name' => element})\n element.move_to_bottom\n end\n end\n end",
"title": ""
},
{
"docid": "f074da81b1063ca3915614d9155d933f",
"score": "0.47112316",
"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": "63042508b34e63dea65310ffb120188f",
"score": "0.47045293",
"text": "def paint\n if $render_from_base\n\t @app.nostroke\n\t checkSrepIntersection\n\n\t $sreps.each.with_index do |srep, i|\n\t render_srep(srep, @shifts[i] , @shifts[i] , 1.5, true)\n\t end\n\n\t #render extended spokes \n\t $sreps.each.with_index do |srep, i|\n\t \n\t if (srep.getExtendInterpolatedSpokesEnd()).length > 0 and srep.show_extend_spokes\n\t\tspoke_begin = srep.interpolated_spokes_begin \n\t\tspoke_end = srep.getExtendInterpolatedSpokesEnd()\n\n\t\tif ($show_subsetof_extended_spokes) \n\t\t render_subset_extend_interp_spokes(@shifts[i],@shifts[i], srep.color, spoke_begin, spoke_end, srep.index)\n\t\telse\n\t\t render_extend_interp_spokes(@shifts[i],@shifts[i], srep.color, spoke_begin, spoke_end)\n\t\tend\n\t end\n\t #render_extended_interp_spokes(srep, @shifts[i] , @shifts[i] , 1.5, true)\n\t end\n\t \n\t if $show_linking_structure \n\t if $dilateCount != 22\n\t\t render_linking_structure(@shifts)\n\t else \n\t\t refine_fake_linking_structure()\n\t\t render_fake_linkingPts(@shifts)\n\t end\n\t end\n\n\t # render refining windows\n\t if $refine_linking_structure\n\t render_refine_windows()\n\t end\n else\n \n @app.stroke Color.black\n # read stdev 2 data and render \n shift = 300\n data_vector_reader = File.open('data_vector.txt','r')\n\t data_vector = []\n while line = data_vector_reader.gets\n data_vector << line.strip.to_f\n end\n data_vector_reader.close \n \n base_pts = data_vector[0..101*2*3-1]\n base_pts_xy = []\n (base_pts.size / 2).times do |i|\n\t base_pts_xy << [base_pts[i*2], base_pts[i*2+1]] \n end\n base_pts_xy.each do |p|\n @app.oval(p[0]+shift,p[1]+shift,3)\n end\n\n\t offset1 = 101*2*3\n spoke_dir = data_vector[offset1 .. 278*2*3+offset1-1]\n spoke_dir_xy = []\n (spoke_dir.size/2).times do |i|\n spoke_dir_xy << [ spoke_dir[i*2], spoke_dir[i*2+1] ] \n end\n \n offset2 = 278*2*3+offset1\n spoke_len = data_vector[offset2 .. 278*3+offset2-1]\n\n offset3 = 278*3+offset2\n extended_lens = data_vector[offset3 .. 278*3+offset3-1]\n # alert(offset3)\n 99.times do |i|\n @app.stroke Color.black\n extended_len = extended_lens[i]\n spoke = [ spoke_dir_xy[i][0], spoke_dir_xy[i][1] ]\n spoke_len = Math.sqrt(spoke[0]**2 + spoke[1]**2)\n extended = [ spoke[0].to_f * extended_len / spoke_len, spoke[1].to_f * extended_len / spoke_len ]\n if i != 0 \n \t @app.line base_pts_xy[i+1][0]+shift, base_pts_xy[i+1][1]+shift, base_pts_xy[i+1][0] +shift+ spoke_dir_xy[i][0] + extended[0], base_pts_xy[i+1][1]+shift + spoke_dir_xy[i][1] + extended[1]\n\t end\n extended_len = extended_lens[i+139]\n spoke = [ spoke_dir_xy[i+139][0], spoke_dir_xy[i+139][1] ]\n spoke_len = Math.sqrt(spoke[0]**2 + spoke[1]**2)\n extended = [ spoke[0].to_f * extended_len / spoke_len, spoke[1].to_f * extended_len / spoke_len ]\n\t if i != 48 and i != 73 and i != 24 \n \t @app.line base_pts_xy[i+1][0]+shift, base_pts_xy[i+1][1]+shift, base_pts_xy[i+1][0] +shift+ spoke_dir_xy[i+139][0]+extended[0], base_pts_xy[i+1][1]+shift + spoke_dir_xy[i+139][1] + extended[1]\n end\n\t# @app.stroke Color.green\n @app.stroke rgb(0,51,0,1)\n \n @app.line base_pts_xy[i+1+101][0]+shift, base_pts_xy[i+1+101][1]+shift, base_pts_xy[i+1+101][0] +shift+ spoke_dir_xy[i+278][0], base_pts_xy[i+1+101][1]+shift + spoke_dir_xy[i+278][1]\n \n @app.line base_pts_xy[i+1+101][0]+shift, base_pts_xy[i+1+101][1]+shift, base_pts_xy[i+1+101][0] +shift+ spoke_dir_xy[i+139+278][0], base_pts_xy[i+1+101][1]+shift + spoke_dir_xy[i+139+278][1]\n\n @app.stroke Color.red\n \n @app.line base_pts_xy[i+1+202][0]+shift, base_pts_xy[i+1+202][1]+shift, base_pts_xy[i+1+202][0] +shift+ spoke_dir_xy[i+556][0] , base_pts_xy[i+1+202][1]+shift + spoke_dir_xy[i+556][1] \n @app.line base_pts_xy[i+1+202][0]+shift, base_pts_xy[i+1+202][1]+shift, base_pts_xy[i+1+202][0] +shift+ spoke_dir_xy[i+139+556][0], base_pts_xy[i+1+202][1]+shift + spoke_dir_xy[i+139+556][1]\n end\n\n 40.times do |i|\n @app.stroke Color.black\n if i != 0\n @app.line base_pts_xy[1][0]+shift, base_pts_xy[1][1]+shift, base_pts_xy[1][0] +shift+ spoke_dir_xy[i+238][0], base_pts_xy[1][1]+shift + spoke_dir_xy[i+238][1] \n end\n @app.line base_pts_xy[99][0]+shift, base_pts_xy[99][1]+shift, base_pts_xy[99][0] +shift+ spoke_dir_xy[i+99][0], base_pts_xy[99][1]+shift + spoke_dir_xy[i+99][1]\n\n # @app.stroke Color.green\n @app.stroke rgb(0,51,0,1)\n @app.line base_pts_xy[1+101][0]+shift, base_pts_xy[1+101][1]+shift, base_pts_xy[1+101][0] +shift+ spoke_dir_xy[i+238+278][0], base_pts_xy[1+101][1]+shift + spoke_dir_xy[i+238+278][1] \n @app.line base_pts_xy[99+101][0]+shift, base_pts_xy[99+101][1]+shift, base_pts_xy[99+101][0] +shift+ spoke_dir_xy[i+99+278][0], base_pts_xy[99+101][1]+shift + spoke_dir_xy[i+99+278][1]\n \n @app.stroke Color.red\n @app.line base_pts_xy[1+202][0]+shift, base_pts_xy[1+202][1]+shift, base_pts_xy[1+202][0] +shift+ spoke_dir_xy[i+238+556][0], base_pts_xy[1+202][1]+shift + spoke_dir_xy[i+238+556][1] \n @app.line base_pts_xy[99+202][0]+shift, base_pts_xy[99+202][1]+shift, base_pts_xy[99+202][0] +shift+ spoke_dir_xy[i+99+556][0], base_pts_xy[99+202][1]+shift + spoke_dir_xy[i+99+556][1]\n end\n \n \n\n\n end\n end",
"title": ""
},
{
"docid": "8717e582cfb022afdb725a8a0d0a4787",
"score": "0.4700419",
"text": "def setup_board\r\n place_pawns\r\n place_bishops\r\n place_rooks\r\n place_knights\r\n place_queens\r\n place_kings\r\n end",
"title": ""
}
] |
fb1bb47d10b1b2494c909c3d1ef2af78
|
Returns a logger like interface to log errors and warnings to.
|
[
{
"docid": "dc141122cc43edc8ce291b964574a481",
"score": "0.0",
"text": "def log\n return @logger if @logger\n @logger = Logger.new(LogFile)\n @logger.level = Logger::INFO\n @logger\n end",
"title": ""
}
] |
[
{
"docid": "b2c923ba3d26331cae88116a1b67451e",
"score": "0.6861398",
"text": "def logger\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "2527d08d953a5d4bf968d5bb078adb97",
"score": "0.6726743",
"text": "def logger\n return @logger if @logger\n\n self.logger = Logger.new($stderr)\n end",
"title": ""
},
{
"docid": "8f62104eec6073bd35c1c3d1cd259486",
"score": "0.65601933",
"text": "def logger\n @logger ||= create_logger\n end",
"title": ""
},
{
"docid": "8f62104eec6073bd35c1c3d1cd259486",
"score": "0.65601933",
"text": "def logger\n @logger ||= create_logger\n end",
"title": ""
},
{
"docid": "ca34cf89fa56ae239545e86b91140d83",
"score": "0.65248775",
"text": "def logger\n @logger ||= build_logger\n end",
"title": ""
},
{
"docid": "f839ab84f5f81b6887f22d4361a2f49f",
"score": "0.6494149",
"text": "def logger\n if @logger.nil?\n @logger = Logger.new($stdout)\n @logger.level = Logger::WARN\n @logger.formatter = proc do |severity, datetime, m_progname, msg|\n \"[#{datetime.strftime('%F %H:%M:%S')} #{severity.red}] #{msg}\\n\"\n end\n end\n @logger\n end",
"title": ""
},
{
"docid": "feba85530767b4359d0e9f47ee20ef60",
"score": "0.64699835",
"text": "def logger\n l = ::Logger.new($stderr)\n\n if mode == :debug\n format_debug(l)\n else\n format_standard(l)\n end\n\n l.level = case mode\n when :debug\n ::Logger::DEBUG\n when :silent\n 9_999\n else\n ::Logger::INFO\n end\n\n l\n end",
"title": ""
},
{
"docid": "f44ea9819c99a03b16f0004e4af9503e",
"score": "0.6396012",
"text": "def logger\n @logger ||= _new_logger\n end",
"title": ""
},
{
"docid": "6dcbd61d57b8ec0475b162dbd7422ee0",
"score": "0.6394118",
"text": "def create_logger\n\n logger_level = settings[\"log.level\"] || \"info\"\n\n # log everything to STDERR or specified logfile\n logger = Yell::Logger.new(:null)\n logger.format = logger_format\n logger.level = logger_level\n\n logger_destination = settings[\"log.file\"] || \"STDERR\"\n # We intentionally repeat the logger_level\n # on the adapter, so it will stay there if overall level\n # is changed.\n case logger_destination\n when \"STDERR\"\n logger.adapter :stderr, level: logger_level, format: logger_format\n when \"STDOUT\"\n logger.adapter :stdout, level: logger_level, format: logger_format\n else\n logger.adapter :file, logger_destination, level: logger_level, format: logger_format\n end\n\n\n # ADDITIONALLY log error and higher to....\n if settings[\"log.error_file\"]\n logger.adapter :file, settings[\"log.error_file\"], :level => 'gte.error'\n end\n\n return logger\n end",
"title": ""
},
{
"docid": "6dcbd61d57b8ec0475b162dbd7422ee0",
"score": "0.6394118",
"text": "def create_logger\n\n logger_level = settings[\"log.level\"] || \"info\"\n\n # log everything to STDERR or specified logfile\n logger = Yell::Logger.new(:null)\n logger.format = logger_format\n logger.level = logger_level\n\n logger_destination = settings[\"log.file\"] || \"STDERR\"\n # We intentionally repeat the logger_level\n # on the adapter, so it will stay there if overall level\n # is changed.\n case logger_destination\n when \"STDERR\"\n logger.adapter :stderr, level: logger_level, format: logger_format\n when \"STDOUT\"\n logger.adapter :stdout, level: logger_level, format: logger_format\n else\n logger.adapter :file, logger_destination, level: logger_level, format: logger_format\n end\n\n\n # ADDITIONALLY log error and higher to....\n if settings[\"log.error_file\"]\n logger.adapter :file, settings[\"log.error_file\"], :level => 'gte.error'\n end\n\n return logger\n end",
"title": ""
},
{
"docid": "cacb66f527611631429acf4fed11c239",
"score": "0.63795745",
"text": "def logger\n return @logger ||= default_logger\n end",
"title": ""
},
{
"docid": "247819abb90d5293d9343a6b1cc10a1f",
"score": "0.6342047",
"text": "def logger\n unless @logger\n if defined?(Rails) && ::Rails.logger\n @logger = ::Rails.logger\n else\n @logger = ::Logger.new(STDERR)\n end\n end\n @logger\n end",
"title": ""
},
{
"docid": "5b943bab5daa8c0a049fe22a47cb951c",
"score": "0.63037574",
"text": "def logger(name = self.class.name)\n Logger.new(name)\n end",
"title": ""
},
{
"docid": "9f7c3b1e77f0cf1e13dd9c0757f3629b",
"score": "0.629897",
"text": "def logger\n @logger ||= default_logger\n end",
"title": ""
},
{
"docid": "c86cf961d172e7b4f48b2392a8ed1389",
"score": "0.6288204",
"text": "def logger log_name, resource, labels = {}\n Logger.new self, log_name, resource, labels\n end",
"title": ""
},
{
"docid": "0756cb3ff1ad1263a0fa03cabc8e4168",
"score": "0.6265922",
"text": "def logger(level = Logger::WARN)\n @logger ||= ::Logger.new(STDERR).tap{ |l| l.level = level }\n end",
"title": ""
},
{
"docid": "5bf5ce0261b9198f9407182a87dd3dab",
"score": "0.62604517",
"text": "def logger\n return @logger if defined?(@logger) && !@logger.nil?\n path = log_path\n FileUtils.mkdir_p(File.dirname(path))\n prepare_logger(path)\n rescue\n prepare_logger(STDOUT)\n end",
"title": ""
},
{
"docid": "5bbc789826c649433709bc779d9d2341",
"score": "0.6254398",
"text": "def logger\n @logger ||= NilLogger.new\n end",
"title": ""
},
{
"docid": "be78eb3a609d1941398cd25cb04c17b3",
"score": "0.62425977",
"text": "def logger\n @logger ||= default_logger\n end",
"title": ""
},
{
"docid": "4bf0b736dd170ebc0d78849eb5f75e94",
"score": "0.6237651",
"text": "def create_logger\n raise \"You should create your own `create_logger` method\"\n end",
"title": ""
},
{
"docid": "4bf0b736dd170ebc0d78849eb5f75e94",
"score": "0.6237651",
"text": "def create_logger\n raise \"You should create your own `create_logger` method\"\n end",
"title": ""
},
{
"docid": "601ebf47617a66283d1bc1920a3dc5ca",
"score": "0.62206715",
"text": "def logger\n @logger ||= set_logger\n end",
"title": ""
},
{
"docid": "a8cd463ade4a410212753745bd127d1e",
"score": "0.62077266",
"text": "def logger\n @logger || default_logger\n end",
"title": ""
},
{
"docid": "a8cd463ade4a410212753745bd127d1e",
"score": "0.62077266",
"text": "def logger\n @logger || default_logger\n end",
"title": ""
},
{
"docid": "f359ac93b0842bae9d29ae73412fa34b",
"score": "0.62076086",
"text": "def logger\n ::Logger.new($stdout).tap do |log|\n log.formatter = proc do |severity, _datetime, _progname, msg|\n prep = ' ' * (severity.size + 3)\n message = msg.lines.map.with_index do |str, i|\n next str if i.zero?\n\n str.strip.empty? ? str : prep + str\n end\n color = severity.downcase.to_sym\n msg = +\"[#{SeccompTools::Util.colorize(severity, t: color)}] #{message.join}\"\n msg << \"\\n\" unless msg.end_with?(\"\\n\")\n msg\n end\n end\n end",
"title": ""
},
{
"docid": "96d801a1468a67050ba169d3aa1bf07b",
"score": "0.6159762",
"text": "def logger\n initialize_logger unless @logger\n @logger\n end",
"title": ""
},
{
"docid": "c4fb0ccfd0c3b7aa38fb339ed8842424",
"score": "0.6155608",
"text": "def logger\n @logger ||= Logger.get_logger(config.robot.log_level, config.robot.log_formatter)\n end",
"title": ""
},
{
"docid": "2237d3acead0819fd78890985b29d486",
"score": "0.61479974",
"text": "def logger\n @logger ||= Esi.config.logger || Logger.new(Esi.config.log_target).tap do |l|\n l.level = Logger.const_get(Esi.config.log_level.upcase)\n end\n end",
"title": ""
},
{
"docid": "65c1a4232a9d248df465da928e82f63e",
"score": "0.6145515",
"text": "def logger\n init unless @initialized\n logger = @logger\n end",
"title": ""
},
{
"docid": "9e5fa1dcb905a348714418dfe30b5a38",
"score": "0.6140277",
"text": "def logger\n @logger ||= Testable::Logger.new.create\n end",
"title": ""
},
{
"docid": "9e5fa1dcb905a348714418dfe30b5a38",
"score": "0.6140277",
"text": "def logger\n @logger ||= Testable::Logger.new.create\n end",
"title": ""
},
{
"docid": "d42fa491a15736d4660203fc6369602d",
"score": "0.6131217",
"text": "def logger\n @logger ||= defined?(Rails) ? Rails.logger || Logger.new(STDERR) : Logger.new(STDERR)\n end",
"title": ""
},
{
"docid": "cd866a654edd4668d841b8c6fc6fdf8f",
"score": "0.61270124",
"text": "def logger\n classname = (self.is_a? Module) ? self : self.class.name\n @logger ||= Loggable.logger_for(classname)\n end",
"title": ""
},
{
"docid": "de896e3a26245eda586d2cdf5193179e",
"score": "0.61017483",
"text": "def logger\n return @local_logger if @local_logger\n FileUtils.mkdir_p(File.dirname(log_path)) unless File.exists?(File.dirname(log_path))\n\n if API_KEYS[\"logentries\"]\n token = API_KEYS[\"logentries\"][Rails.env][\"nsc\"]\n @local_logger = Le.new(token, :debug => false, :local => log_path, :ssl => true, :tag => true)\n else\n @local_logger = Logger.new(log_path)\n end\n @local_logger\n end",
"title": ""
},
{
"docid": "50d24ec616d3a2692f5ed0fb0e110532",
"score": "0.6101146",
"text": "def log\n unless self.class._slflogger\n self.class.createlogger\n end\n return self.class._slflogger\n end",
"title": ""
},
{
"docid": "ea6fe27e4fbb797a928962e900afb15c",
"score": "0.607976",
"text": "def logger\n @logger ||= ::Logger.new STDOUT\n end",
"title": ""
},
{
"docid": "ea6fe27e4fbb797a928962e900afb15c",
"score": "0.607976",
"text": "def logger\n @logger ||= ::Logger.new STDOUT\n end",
"title": ""
},
{
"docid": "ea6fe27e4fbb797a928962e900afb15c",
"score": "0.607976",
"text": "def logger\n @logger ||= ::Logger.new STDOUT\n end",
"title": ""
},
{
"docid": "ca3d610b5ad3e7c82f8a0a620919591e",
"score": "0.60766923",
"text": "def logger\n Logger.new(files[:logfile], 10, 1024000)\n end",
"title": ""
},
{
"docid": "2c06cf826f6ce386eaf550e45ac12c07",
"score": "0.6072634",
"text": "def logger\n return @logger if @logger\n\n # Figure out where the output should go to.\n output = nil\n if ENV[\"MELISSADATA_LOG\"] == \"STDOUT\"\n output = STDOUT\n elsif ENV[\"MELISSADATA_LOG\"] == \"NULL\"\n output = nil\n elsif ENV[\"MELISSADATA_LOG\"]\n output = ENV[\"MELISSADATA_LOG\"]\n else\n output = nil #log_path.join(\"#{Time.now.to_i}.log\")\n end\n\n # Create the logger and custom formatter\n @logger = Logger.new(output)\n @logger.formatter = Proc.new do |severity, datetime, progname, msg|\n \"#{datetime} - #{progname} - [#{resource}] #{msg}\\n\"\n end\n\n @logger\n end",
"title": ""
},
{
"docid": "8fb71fa7d681fe95d3f9ffa018a1a3e0",
"score": "0.6072059",
"text": "def logger\n @logger\n end",
"title": ""
},
{
"docid": "8fb71fa7d681fe95d3f9ffa018a1a3e0",
"score": "0.6072059",
"text": "def logger\n @logger\n end",
"title": ""
},
{
"docid": "7be8ed045ea10a26ff82cb2acbfc3628",
"score": "0.60700846",
"text": "def get_logger; @logger; end",
"title": ""
},
{
"docid": "e17c360f2245ffc5eecb8274002e952a",
"score": "0.6065116",
"text": "def logger\n @logger ||= Logger.new(StringIO.new)\n end",
"title": ""
},
{
"docid": "645e18bc7513dc33261f2b7f3c1513a5",
"score": "0.60617226",
"text": "def logger\n if !Rails.nil?\n return Rails.logger\n else\n return Logger.new( STDOUT )\n end\n end",
"title": ""
},
{
"docid": "c021af0a710386a3946868d83d7f3ebf",
"score": "0.6023441",
"text": "def error(msg); @logger.error(msg); end",
"title": ""
},
{
"docid": "88756ac800acc86991deeb38cd37d97c",
"score": "0.6020264",
"text": "def logger\n @logger ||= Logger.new($stderr).tap do |l|\n formatter = Logger::Formatter.new\n\n l.level = Logger::DEBUG\n l.formatter = lambda { |*args| \"[#{Module.nesting.first}] #{formatter.call(*args)}\" }\n end\n end",
"title": ""
},
{
"docid": "e442954aa9107dba5333c609f0977709",
"score": "0.60166335",
"text": "def logger( object = nil )\n name = logger_name object\n provider.logger name\n end",
"title": ""
},
{
"docid": "83a5e2141ff8770708f471a91785da82",
"score": "0.6013018",
"text": "def logger!(_output)\n @logger = Logger.new(_output)\n end",
"title": ""
},
{
"docid": "96539b43432f26acc8e6a8fc64017020",
"score": "0.599946",
"text": "def logger \n klass = self.class\n klass.logger\n end",
"title": ""
},
{
"docid": "ec53f8386640002456be55c19fa1b592",
"score": "0.5994849",
"text": "def logger\n if logger = super\n return logger\n end\n\n @__utilrb_hierarchy__default_logger =\n if kind_of?(Module)\n m = self\n while m\n if m.name && !m.spacename.empty?\n parent_module =\n begin\n constant(m.spacename)\n rescue NameError\n end\n if parent_module.respond_to?(:logger)\n break\n end\n end\n\n if m.respond_to?(:superclass)\n m = m.superclass\n if m.respond_to?(:logger)\n parent_module = m\n break\n end\n else\n m = nil; break\n end\n end\n\n if !m\n raise NoParentLogger, \"cannot find a logger for #{self}\"\n end\n if parent_module.respond_to? :register_log_child\n @parent_module = parent_module\n parent_module.register_log_child(self)\n end\n parent_module.logger\n else\n self.class.logger\n end\n end",
"title": ""
},
{
"docid": "09f671447a4de6ad142714967f9e1335",
"score": "0.59915936",
"text": "def logger\n Logging.logger\n end",
"title": ""
},
{
"docid": "87499a3b2cda430fa281bb10dcddd7d4",
"score": "0.5984718",
"text": "def logger\n @log\n end",
"title": ""
},
{
"docid": "87499a3b2cda430fa281bb10dcddd7d4",
"score": "0.5984718",
"text": "def logger\n @log\n end",
"title": ""
},
{
"docid": "ba745685c8c49951c25d56c7a4ba9a3d",
"score": "0.59841484",
"text": "def logger(obj)\n %w(debug info warn error fatal level).each do |m|\n next if obj.respond_to?(m)\n raise ArgumentError, \"logger #{obj} does not respond to method #{m}\"\n end\n map[:logger] = obj\n end",
"title": ""
},
{
"docid": "285ee16f9490ceaafa22fee893c152a1",
"score": "0.5974834",
"text": "def logger\n reset_logger! unless defined? @@logger\n @@logger\n end",
"title": ""
},
{
"docid": "1b365a884163dd561ab76ddffb35045c",
"score": "0.59603864",
"text": "def get_logger\n stream = STDOUT\n if @opts[:quiet]\n stream = '/dev/null'\n end\n logger = Logger.new(stream)\n logger.level = Logger::INFO\n logger.formatter = proc do |severity, datetime, progname, msg|\n \"#{msg}\\n\"\n end\n logger\n end",
"title": ""
},
{
"docid": "cc9c70740441229221b3924c87d6f371",
"score": "0.5958393",
"text": "def logger\n unless defined? @logger\n logger = Logging.logger[self]\n @logger = Kernel.const_defined?('Rails') ? Rails.logger : logger\n end\n @logger\n end",
"title": ""
},
{
"docid": "a542b41c0bd517b91b47b8bc7d54556d",
"score": "0.5957169",
"text": "def logger\n @logger ||= Logging.logger_for(self.class.name)\n end",
"title": ""
},
{
"docid": "0785c63c9382e324868a3e36734c80b5",
"score": "0.59540576",
"text": "def logger\n @logger ||= self.class.logger\n end",
"title": ""
},
{
"docid": "7baf49bdbf6b82c3cba2543a04c987b5",
"score": "0.59517395",
"text": "def logger\n @logger ||= Logger.new(@log_file_name)\n\n @logger.formatter = proc do |severity, datetime, progname, msg|\n \"%s, [%s #%d] (%s) %5s -- %s: %s\\n\" % [severity[0..0], datetime, $$, Conf.global_conf[:hostname], severity, progname, msg]\n end\n\n if Conf.global_conf[:debug]\n @logger.level = Logger::DEBUG\n else\n @logger.level = Logger::INFO\n end\n @logger\n end",
"title": ""
},
{
"docid": "afada7e52c98dbaada04033fdbcb7a4b",
"score": "0.5950963",
"text": "def logger\n @logger || Rcal::Util::Loggable.default_logger\n end",
"title": ""
},
{
"docid": "52d436d6b3709b3a899ad50e8bc72b7f",
"score": "0.5948663",
"text": "def define_logger(logger)\n return logger if logger.kind_of?(Logger)\n\n Logger.new(logger)\n end",
"title": ""
},
{
"docid": "52d436d6b3709b3a899ad50e8bc72b7f",
"score": "0.5948663",
"text": "def define_logger(logger)\n return logger if logger.kind_of?(Logger)\n\n Logger.new(logger)\n end",
"title": ""
},
{
"docid": "41f3308e033fbfae2b7d6068ee5e4e9d",
"score": "0.59448606",
"text": "def logger\n @logger ||= (defined?(Rails) ? Rails.logger : Logger.new('monocle.log'))\n end",
"title": ""
},
{
"docid": "0e2d0f262cdb90b87a3bb89091c5f39b",
"score": "0.5944242",
"text": "def logger\n @logger ||= Logger.new(self)\n end",
"title": ""
},
{
"docid": "3e260d3ab5342c43c8ed9f452898eb18",
"score": "0.5943447",
"text": "def logger(method_name)\n LoggingWrapper.new(\"#{self.class.name}.#{method_name}\")\n end",
"title": ""
},
{
"docid": "bc966d28da20888246e7d445b91d986c",
"score": "0.59286565",
"text": "def logger=(logr); @logger = logr end",
"title": ""
},
{
"docid": "cfc98936e98d8aea0678700793beea41",
"score": "0.5923463",
"text": "def logger\n if self.is_a? Grape::API\n API.logger\n else\n @logger ||= Logger.new\n end\n end",
"title": ""
},
{
"docid": "547d71d9f03af5ec66210652fc83951b",
"score": "0.5916605",
"text": "def build_logger\n path = Hanami.root.join(\"log\", [\"emergency_log.\", Hanami.env].join)\n Logger.new(path)\n end",
"title": ""
},
{
"docid": "ed3d05f5ecf272db46c25319ce1a6473",
"score": "0.5914804",
"text": "def logger\n Logging.logger\n end",
"title": ""
},
{
"docid": "dc03adc3d52f10f048c3169215a1bbac",
"score": "0.59083885",
"text": "def log\n @logger ||= Logger.new(nil)\n @logger\n end",
"title": ""
},
{
"docid": "6dd2eea4a7e502f599c985d7ba945e44",
"score": "0.59072024",
"text": "def logger\n @_logger ||= Logger.new(self)\n end",
"title": ""
},
{
"docid": "54c452f31bd72bb6a8df2e580116b0ba",
"score": "0.59049547",
"text": "def logger\n adapter.logger if adapter\n end",
"title": ""
},
{
"docid": "87a2f3110427738891139bf0c4879345",
"score": "0.5900401",
"text": "def logger\n @_logger ||= ::Logger.new(log_file)\n end",
"title": ""
},
{
"docid": "4cbba863800145ff6e445ea90250f22a",
"score": "0.589903",
"text": "def logger\n\t\treturn Loggability[ self ]\n\tend",
"title": ""
},
{
"docid": "b9de11e414ba2a62357e7656f70bbc70",
"score": "0.5890666",
"text": "def logger\n @logger ||= options[:logger] || if defined?(Rails)\n Rails.logger\n else\n default_logger\n end\n end",
"title": ""
},
{
"docid": "b9de11e414ba2a62357e7656f70bbc70",
"score": "0.5890666",
"text": "def logger\n @logger ||= options[:logger] || if defined?(Rails)\n Rails.logger\n else\n default_logger\n end\n end",
"title": ""
},
{
"docid": "ef41db4ec5857a9c92aca49a7d03a8d1",
"score": "0.5889361",
"text": "def logger\n @logger ||= LogAdapter.new(Stevenson.new, (ENV[\"JEKYLL_LOG_LEVEL\"] || :info).to_sym)\n end",
"title": ""
},
{
"docid": "e00e7581e225f2fd7f7c4ffa89743129",
"score": "0.58668983",
"text": "def logger\n @logger ||= Logger.get_logger(config.robot.log_level)\n end",
"title": ""
},
{
"docid": "02c0bdf88b19d473c6b86fb95906a61a",
"score": "0.58602214",
"text": "def logger\n @logger ||=\n begin\n logger = SemanticLogger::Processor.logger.clone\n logger.name = self.class.name\n logger\n end\n end",
"title": ""
},
{
"docid": "251047e6cf9a7e1af0bea34c5874b9e5",
"score": "0.58599323",
"text": "def logger; LOGGER; end",
"title": ""
},
{
"docid": "cad599128505e2b2da79577d75f93844",
"score": "0.58571637",
"text": "def logger\n @logger ||= ::Logger.new(STDOUT)\n end",
"title": ""
},
{
"docid": "18674393959d46cd7c2db7e91cdfb87a",
"score": "0.58355737",
"text": "def logger(out=STDOUT)\n @@logger ||= Logger.new(out)\n @@logger\n end",
"title": ""
},
{
"docid": "975c8a5ff379dbb47768a52481c06619",
"score": "0.58351225",
"text": "def logger\n @__logger\n end",
"title": ""
},
{
"docid": "1ee7c4661f727d94de550e92255498d3",
"score": "0.5825666",
"text": "def logger\n logger = Logger.new(STDOUT)\nend",
"title": ""
},
{
"docid": "4a736ce4e94fd2db04016658b7956584",
"score": "0.58169925",
"text": "def logger\n @logger ||= configuration.logger\n end",
"title": ""
},
{
"docid": "a4a21ac679e6717233e66a2d138f844e",
"score": "0.5816282",
"text": "def logger\n\t\t\tunless CLILogging.class_variable_defined?(:@@logger)\n\t\t\t\t@@logger = CLILogger.new\n\t\t\t\t@@logger.progname=$0\n\t\t\tend\n\t\t\t@@logger\n\t\tend",
"title": ""
},
{
"docid": "a4a21ac679e6717233e66a2d138f844e",
"score": "0.5816282",
"text": "def logger\n\t\t\tunless CLILogging.class_variable_defined?(:@@logger)\n\t\t\t\t@@logger = CLILogger.new\n\t\t\t\t@@logger.progname=$0\n\t\t\tend\n\t\t\t@@logger\n\t\tend",
"title": ""
},
{
"docid": "8c0268ba39e061e926ce30e6d237fd0c",
"score": "0.581031",
"text": "def logger\n if @logger.nil?\n @logger = Logger::new(STDOUT)\n \n # formatter\n default = Logger::Formatter::new\n @logger.formatter = proc do |severity, datetime, progname, msg|\n progname = @targets.from\n msg = \"##{Thread.current.object_id} \" + msg \n default.call(severity, datetime, progname, msg)\n end\n end\n \n return @logger\n end",
"title": ""
},
{
"docid": "1b623709e74e01f7b4c0c671d0f437b2",
"score": "0.58087987",
"text": "def logger\n @logger ||= case environment\n when 'development'\n Logger.new(STDERR, Logger::DEBUG)\n when 'test'\n Logger.new(STDERR, Logger::WARN)\n else\n Logger.new(STDERR, Logger::INFO)\n end\n end",
"title": ""
},
{
"docid": "b81f930739436ab896ac655fd4a0b167",
"score": "0.57946116",
"text": "def initialize_logger\n return if @logger.blank?\n log = @logger\n log = log.to_s if log.is_a?(Pathname)\n if log.is_a?(String)\n log = File.join(TMP_ROOT_DIR, log) unless log.start_with?('/')\n @logger =\n Logger.new(log).tap { |l| l.level = Logger.const_get(@log_level) }\n end\n unless @logger.is_a?(Logger)\n raise \"expected String, got #{log.class} #{log.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "dd6f4c221ccd2265856f0d0677763238",
"score": "0.5790635",
"text": "def logger\n @logger ||= Logging.get_logger(self)\n end",
"title": ""
},
{
"docid": "c7b50c3b33fffb6815ed9c70529ffbe6",
"score": "0.5786685",
"text": "def logger\n backend.logger\n end",
"title": ""
},
{
"docid": "ed6101ef3adb7019d8a054c2623c3d5c",
"score": "0.57781446",
"text": "def logger\n @logger ||= Rails.logger\n end",
"title": ""
},
{
"docid": "ed6101ef3adb7019d8a054c2623c3d5c",
"score": "0.57781446",
"text": "def logger\n @logger ||= Rails.logger\n end",
"title": ""
},
{
"docid": "b320aa0334656d213c6fe2aca5978a4c",
"score": "0.57745296",
"text": "def logger\n\n return @logger\n\n end",
"title": ""
},
{
"docid": "d047c5a5ca00fea72ad8713815398fb0",
"score": "0.5771062",
"text": "def logger\n @logger ||= Logger.new(STDOUT)\n end",
"title": ""
},
{
"docid": "76c3add470b39224d22a33f3bf22486f",
"score": "0.575693",
"text": "def logger\n adapter.logger\n end",
"title": ""
},
{
"docid": "76c3add470b39224d22a33f3bf22486f",
"score": "0.575693",
"text": "def logger\n adapter.logger\n end",
"title": ""
},
{
"docid": "768c7a46b211905426d6c8d2b43e4e2b",
"score": "0.5753937",
"text": "def error(*args, &block)\n logger_instance.error(args, &block)\n end",
"title": ""
}
] |
040bb104526f80a82ea202464171415f
|
will simplify the type passed if it a numeric type, otherwise returns the type passed will first check against integer, if it is not it checks numeric. Returns first matched type
|
[
{
"docid": "be522ef7d90b756204fbc0ad64843aa2",
"score": "0.7727501",
"text": "def simplify_numerics(type)\n # begin\n # return \"Integer\" if Object.const_get(type) <= Integer\n # return \"Numeric\" if Object.const_get(type) <= Numeric\n # return type\n # rescue TypeError,ArgumentError\n # return Integer if type <= Integer\n # return Numeric if type <= Numeric\n # return type\n # rescue NameError,ArgumentError\n # return type\n # end\n begin\n if type.class != Class then\n return \"Integer\" if Object.const_get(type) <= Integer\n return \"Numeric\" if Object.const_get(type) <= Numeric\n return type\n else\n return Integer if type <= Integer\n return Numeric if type <= Numeric\n return type\n end\n rescue NameError, TypeError, ArgumentError\n return type\n end\nend",
"title": ""
}
] |
[
{
"docid": "c1c0e2572ae79f5a9bb174ac202ac4dd",
"score": "0.6083222",
"text": "def simplified_type(field_type)\n case field_type\n # Numeric and monetary types\n when /^(?:real|double precision)$/\n :float\n # Monetary types\n when /^money$/\n :decimal\n # Character types\n when /^(?:character varying|bpchar)(?:\\(\\d+\\))?$/\n :string\n # Binary data types\n when /^bytea$/\n :binary\n # Date/time types\n when /^timestamp with(?:out)? time zone$/\n :datetime\n when /^interval$/\n :string\n # Geometric types\n when /^(?:point|line|lseg|box|\"?path\"?|polygon|circle)$/\n :string\n # Network address types\n when /^(?:cidr|inet|macaddr)$/\n :string\n # Bit strings\n when /^bit(?: varying)?(?:\\(\\d+\\))?$/\n :string\n # XML type\n when /^xml$/\n :xml\n # Arrays\n when /^\\D+\\[\\]$/\n :string\n # Object identifier types\n when /^oid$/\n :integer\n # Pass through all types that are not specific to PostgreSQL.\n else\n super\n end\n end",
"title": ""
},
{
"docid": "e610800b8b56215de39e543dd7058b24",
"score": "0.60613275",
"text": "def simplified_type(field_type)\n case field_type\n # Numeric and monetary types\n when /^(?:real|double precision)$/\n :float\n # Monetary types\n when 'money'\n :decimal\n # Character types\n when /^(?:character varying|bpchar)(?:\\(\\d+\\))?$/\n :string\n # Binary data types\n when 'bytea'\n :binary\n # Date/time types\n when /^timestamp with(?:out)? time zone$/\n :datetime\n when 'interval'\n :string\n # Geometric types\n when /^(?:point|line|lseg|box|\"?path\"?|polygon|circle)$/\n :string\n # Network address types\n when /^(?:cidr|inet|macaddr)$/\n :string\n # Bit strings\n when /^bit(?: varying)?(?:\\(\\d+\\))?$/\n :string\n # XML type\n when 'xml'\n :xml\n # tsvector type\n when 'tsvector'\n :tsvector\n # Arrays\n when /^\\D+\\[\\]$/\n :string\n # Object identifier types\n when 'oid'\n :integer\n # UUID type\n when 'uuid'\n :string\n # Small and big integer types\n when /^(?:small|big)int$/\n :integer\n # Pass through all types that are not specific to PostgreSQL.\n else\n super\n end\n end",
"title": ""
},
{
"docid": "9e53fea131ef31612b2630e54fd826a0",
"score": "0.59216636",
"text": "def _sanitize_for_type value\n case type\n when :boolean\n if value.is_a?(String)\n return ActiveRecord::Base::sanitize(true) if value == 't' || value.downcase == 'true'\n else #Number. Nothing more can come from json?\n return ActiveRecord::Base::sanitize(value.to_i!=0)\n end\n when :number\n value.to_i\n when :float\n value.to_f\n else\n ActiveRecord::Base::sanitize(value)\n end\n end",
"title": ""
},
{
"docid": "bbe04a24796a05b47a14756448e90088",
"score": "0.59186596",
"text": "def simplified_type(field_type)\n case field_type\n # Numeric and monetary types\n when /^(?:real|double precision)$/ then :float\n # Monetary types\n when 'money' then :decimal\n # Character types\n when /^(?:character varying|bpchar)(?:\\(\\d+\\))?$/ then :string\n # Binary data types\n when 'bytea' then :binary\n # Date/time types\n when /^timestamp with(?:out)? time zone$/ then :datetime\n when 'interval' then :string\n # Geometric types\n when /^(?:point|line|lseg|box|\"?path\"?|polygon|circle)$/ then :string\n # Network address types\n when /^(?:cidr|inet|macaddr)$/ then :string\n # Bit strings\n when /^bit(?: varying)?(?:\\(\\d+\\))?$/ then :string\n # XML type\n when 'xml' then :xml\n # tsvector type\n when 'tsvector' then :tsvector\n # Arrays\n when /^\\D+\\[\\]$/ then :string\n # Object identifier types\n when 'oid' then :integer\n # UUID type\n when 'uuid' then :string\n # Small and big integer types\n when /^(?:small|big)int$/ then :integer\n # AR-JDBC added :\n when 'bool' then :boolean\n when 'char' then :string\n when 'serial' then :integer\n # Pass through all types that are not specific to PostgreSQL.\n else\n super\n end\n end",
"title": ""
},
{
"docid": "68cda40d90a07b4d38d4e61c2f5475ec",
"score": "0.58571315",
"text": "def convert_if_needed(value) #:nodoc:\n if value =~ /^[+-]?\\d+\\.?\\d*$/ # float\n value = value.to_f\n elsif value =~ /^[+-]?\\d+$/ # int\n value = value.to_i\n else\n value\n end\n end",
"title": ""
},
{
"docid": "1e5a04e549f796c56867be05916a4800",
"score": "0.5851477",
"text": "def simple_type text\n Integer(text) rescue Float(text) rescue text\n end",
"title": ""
},
{
"docid": "b797c574497e9eb319c9563705734acf",
"score": "0.58491546",
"text": "def convert_value_by_type\n case self.value_type\n when 'Numeric'\n unless self.multiplier.nil? || self.multiplier.blank?\n val = self.value.include?('.') ? self.value.to_f : self.value.to_i\n return val.send(self.multiplier.to_sym)\n else\n return self.value.to_f\n end\n when 'Boolean'\n return self.value == '1'\n else\n return self.value\n end\n end",
"title": ""
},
{
"docid": "b797c574497e9eb319c9563705734acf",
"score": "0.58491546",
"text": "def convert_value_by_type\n case self.value_type\n when 'Numeric'\n unless self.multiplier.nil? || self.multiplier.blank?\n val = self.value.include?('.') ? self.value.to_f : self.value.to_i\n return val.send(self.multiplier.to_sym)\n else\n return self.value.to_f\n end\n when 'Boolean'\n return self.value == '1'\n else\n return self.value\n end\n end",
"title": ""
},
{
"docid": "47a483914c3dfe960a70ccac35b980a3",
"score": "0.58381826",
"text": "def convert_to_number_type(input)\n if float?(input)\n input.to_f\n else\n input.to_i\n end\nend",
"title": ""
},
{
"docid": "6f49843bf5dea19a039b2c76937e1339",
"score": "0.5801769",
"text": "def type_prior(ta, tb)\n\tif ta == String or tb == String\n\t\treturn String\n\tend\n\tif ta == Float or tb == Float\n\t\treturn Float\n\tend\n\treturn Integer\nend",
"title": ""
},
{
"docid": "5ab686b72acb3cb7f80fa6a7a33b41c4",
"score": "0.5799885",
"text": "def _type(obj, has_invisible=true)\n\n obj = obj.strip_invisible if obj.kind_of?(String) and has_invisible\n\n if obj.nil?\n return NilClass\n elsif obj.kind_of?(Fixnum) or obj.int?\n return Fixnum\n elsif obj.kind_of?(Float) or obj.number?\n return Float\n else\n return String\n end\n end",
"title": ""
},
{
"docid": "feb01c8488ac03256b4fdb4ba22d89fa",
"score": "0.5724172",
"text": "def simplified_type(field_type)\n puts_log \"simplified_type\"\n case field_type\n # if +field_type+ contains 'for bit data' handle it as a binary\n when /for bit data/i\n :binary\n when /smallint/i\n :boolean\n when /int|serial/i\n :integer\n when /decimal|numeric|decfloat/i\n :decimal\n when /float|double|real/i\n :float\n when /timestamp|datetime/i\n :datetime\n when /time/i\n :time\n when /date/i\n :date\n when /vargraphic/i\n :vargraphic\n when /graphic/i\n :graphic\n when /clob|text/i\n :text\n when /xml/i\n :xml\n when /blob|binary/i\n :binary\n when /char/i\n :string\n when /boolean/i\n :boolean\n when /rowid/i # rowid is a supported datatype on z/OS and i/5\n :rowid\n end\n end",
"title": ""
},
{
"docid": "8f32fc0e7efd4849a8aca581b63fb053",
"score": "0.5697182",
"text": "def simplified_type(field_type)\n return :boolean if field_type =~ /tinyint/i\n return :string if field_type =~ /varchar/i\n return :binary if field_type =~ /long binary/i\n return :datetime if field_type =~ /timestamp/i\n return :integer if field_type =~ /smallint|bigint/i\n super\n end",
"title": ""
},
{
"docid": "6abc6f20678b6c3b4de6b31f6d784731",
"score": "0.56654304",
"text": "def convert_value_by_type\n case self.value_type\n when 'Numeric'\n self.value.include?('.') ? self.value.to_f : self.value.to_i\n when 'Boolean'\n return self.value == '1'\n else\n return self.value\n end\n end",
"title": ""
},
{
"docid": "ac61294a86ec2105e23d142f50ad9796",
"score": "0.5662329",
"text": "def check_type(value)\n if value =~ /^\\d+(\\.\\d+)?$/ \n return value.to_f\n elsif SNMP::Integer === value\n return value.to_i\n else\n return value.to_s\n end\n rescue => ex\n $log.error \"snmp failed to check_type\", :error=>ex.message\n $log.warn_backtrace ex.backtrace\n end",
"title": ""
},
{
"docid": "faf728970f5da507c90d118248b1ad49",
"score": "0.56511754",
"text": "def is_number(other)\n other.is_a?(Numeric) || other.is_a?(Integer) || other.is_a?(Float)\nend",
"title": ""
},
{
"docid": "7fd0eaee3b04b8af30669ac5cee2584a",
"score": "0.5650578",
"text": "def get_basic_type(input)\n\n (Float(input) && Float(input) %1.0 == 0 ? \"integer\":\"float\") rescue \"string\"\n end",
"title": ""
},
{
"docid": "2888c1040c5fb83eef5d183137eae808",
"score": "0.5641692",
"text": "def is_numeric?(i)\n i.to_i.to_s == i || i.to_f.to_s == i\nend",
"title": ""
},
{
"docid": "e7634875bab4833791b6aae624ef29f0",
"score": "0.5597383",
"text": "def num_check num, number_type\n until num.class == Integer || num.class == Float\n puts \"I'm sorry that doesn't seem to be a number.\"\n puts \"Do you have some else in mind?\"\n num = float_or_integer(number_type)\n spacing\n end\n return num\nend",
"title": ""
},
{
"docid": "562c34dd12fc17cde49fb6e8bcc405bd",
"score": "0.5562647",
"text": "def fix_type(value, type)\r\n case type\r\n when :integer\r\n return value.to_i\r\n when :date\r\n return Date.parse(value).to_s\r\n when :string\r\n return value\r\n when :string_decimal\r\n # converting Brazilian money format to international format, as in:\r\n # 1.234,56 => 1234.56\r\n return ((BigDecimal.new(value.delete(\".\").gsub(\",\", \".\")))*100).to_i.to_s\r\n when :decimal\r\n # converting Brazilian money format to international format, as in:\r\n # 1.234,56 => 1234.56\r\n return (BigDecimal.new(value.delete(\".\").gsub(\",\", \".\"))).to_f\r\n end\r\n end",
"title": ""
},
{
"docid": "34ee01f25ac54de06c9d8cef914a0897",
"score": "0.5561104",
"text": "def float_or_integer value\n if value.to_f.to_s == value\n value = value.to_f\n elsif value.to_i.to_s == value\n value = value.to_i\n else\n value = false\n end\n return value\nend",
"title": ""
},
{
"docid": "ca58939532e8300616ef7495fe6e13d5",
"score": "0.5555623",
"text": "def simple_type? item\n item.kind_of?(String) || item.kind_of?(Numeric)\n end",
"title": ""
},
{
"docid": "f9a576a58e51bfddcd66a3aed2b70c35",
"score": "0.55458933",
"text": "def int_or_float(number)\n if number % 1 == 0\n number = number.to_i\n end\n number\nend",
"title": ""
},
{
"docid": "a2805f07f4303300675a733c056b5385",
"score": "0.5532609",
"text": "def num_type(x)\n if hasDot(x)\n x.to_f\n else\n x.to_i\n end\nend",
"title": ""
},
{
"docid": "f9da89fe7530e6609fab868385cf12fc",
"score": "0.5520493",
"text": "def normalize_item(type_name, item)\n return (item.nil?) ? item :\n case type_name\n when 'long', 'int' then Integer(item)\n when 'double' then Float(item)\n when 'boolean' then item.kind_of?(String) ?\n item.casecmp('true') == 0 : item\n else item\n end\n end",
"title": ""
},
{
"docid": "14c283899d588011f539905745096c0f",
"score": "0.55113816",
"text": "def float_or_int(number)\n if number.to_s[-1] == \"0\"\n number = number.to_i\n end\n return number\nend",
"title": ""
},
{
"docid": "274c5982d20855d41c3094301fcf335d",
"score": "0.55079126",
"text": "def convert_to_num(val)\n if val.class == String\n if val.include?(\".\")\n val.to_f\n else\n val.to_i\n end\n else\n # if it's not a string assume it's already a num\n # and just return it\n val\n end\nend",
"title": ""
},
{
"docid": "ae415898e8f797a1e0eafc8644004312",
"score": "0.549882",
"text": "def number?\n type == :integer || type == :float || type == :decimal\n end",
"title": ""
},
{
"docid": "b2a08babe958aeb9f4500023942aac14",
"score": "0.5479958",
"text": "def object_type_test(object)\n if object.is_a? Numeric\n puts true\n else\n puts false\n end\nend",
"title": ""
},
{
"docid": "085abc6760c61cb592d07041bdf1315b",
"score": "0.54719234",
"text": "def try_convert_value(value)\n if value.class == String\n if /^[0-9]+$/.match(value) #int\n return value.to_i\n elsif /^[0-9]+(\\.)[0-9]*$/.match(value) #float\n return value.to_f\n elsif (value.downcase == \"true\") #boolean\n return true\n elsif (value.downcase == \"false\") #boolean\n return false\n else\n return value # can't parse, return String\n end\n else # value is not String, return it as is\n return value\n end\n end",
"title": ""
},
{
"docid": "253c4a0ec55220a14e9c25c348ed7126",
"score": "0.54616505",
"text": "def numerical?\n [:integer, :double, :float, :decimal].include?(type)\n end",
"title": ""
},
{
"docid": "253c4a0ec55220a14e9c25c348ed7126",
"score": "0.54616505",
"text": "def numerical?\n [:integer, :double, :float, :decimal].include?(type)\n end",
"title": ""
},
{
"docid": "253c4a0ec55220a14e9c25c348ed7126",
"score": "0.54616505",
"text": "def numerical?\n [:integer, :double, :float, :decimal].include?(type)\n end",
"title": ""
},
{
"docid": "f5de3f301e386c51097c3d7c022b31f9",
"score": "0.5456258",
"text": "def number?\n type == :integer || type == :float\n end",
"title": ""
},
{
"docid": "db29ca1a7a3594ec3dc1aff95adb88a9",
"score": "0.54125893",
"text": "def is_numeric?(s)\r\n !!Float(s) rescue false\r\nend",
"title": ""
},
{
"docid": "5d16d29135e967e6f660e0c8b8fd2766",
"score": "0.5388763",
"text": "def simplified_type2(field_type)\n puts_log \"simplified_type2\"\n case field_type\n # if +field_type+ contains 'for bit data' handle it as a binary\n when /for bit data/i\n \"binary\"\n when /smallint/i\n \"boolean\"\n when /int|serial/i\n \"integer\"\n when /decimal|numeric|decfloat/i\n \"decimal\"\n when /float|double|real/i\n \"float\"\n when /timestamp|datetime/i\n \"timestamp\"\n when /time/i\n \"time\"\n when /date/i\n \"date\"\n when /vargraphic/i\n \"vargraphic\"\n when /graphic/i\n \"graphic\"\n when /clob|text/i\n \"text\"\n when /xml/i\n \"xml\"\n when /blob|binary/i\n \"binary\"\n when /char/i\n \"string\"\n when /boolean/i\n \"boolean\"\n when /rowid/i # rowid is a supported datatype on z/OS and i/5\n \"rowid\"\n end\n end",
"title": ""
},
{
"docid": "01b40e83256c4cbc341b56eb030f236f",
"score": "0.5374086",
"text": "def type_of(value)\n case value\n when Integer then :number\n else value.class.to_s.downcase.to_sym\n end\n end",
"title": ""
},
{
"docid": "68b41ac34e2d9c9610ab06b1618f29bc",
"score": "0.5359077",
"text": "def try_convert_value(value)\n if value.class == String\n if /^[0-9]+$/.match(value) #int\n value.to_i\n elsif /^[0-9]+(\\.)[0-9]*$/.match(value) #float\n value.to_f\n elsif (value.downcase == 'true') #boolean\n true\n elsif (value.downcase == 'false') #boolean\n false\n elsif /^:(.+)$/.match(value)\n $1.to_sym\n else\n value # can't parse, return String\n end\n else # value is not String, return it as is\n value\n end\n end",
"title": ""
},
{
"docid": "6a04025c589381a3e1af56f5ace6fd3c",
"score": "0.5350916",
"text": "def is_numeric?(i)\n i.to_i.to_s == i\n end",
"title": ""
},
{
"docid": "69fea2919f0c8aebf65ac2ea84ac66eb",
"score": "0.5350823",
"text": "def is_number string\r\n 1 if Float(string) rescue 0\r\nend",
"title": ""
},
{
"docid": "1f1061a3bfadf821749e011e80fce3a9",
"score": "0.53373826",
"text": "def is_numeric?\n !!FFI::C_NUMERICS.index(FFI::TYPES[type])\n end",
"title": ""
},
{
"docid": "18fcbb2d3436aeb2f110c04697476521",
"score": "0.5325034",
"text": "def is_number(num)\n true if Float(num) rescue false\nend",
"title": ""
},
{
"docid": "c0f47383d45a3a34284ed957d605a172",
"score": "0.5321726",
"text": "def scanAsNumber(str)\n if(str =~ /^[0-9]*$/)\n return str.to_i ;\n else\n return str.to_f ;\n end\n end",
"title": ""
},
{
"docid": "a1e3edd57feefc09fec60a59dec71e60",
"score": "0.5315648",
"text": "def is_num?(string)\n true if Float(string) rescue false\nend",
"title": ""
},
{
"docid": "a1e3edd57feefc09fec60a59dec71e60",
"score": "0.5315648",
"text": "def is_num?(string)\n true if Float(string) rescue false\nend",
"title": ""
},
{
"docid": "32a536489ec02506b6bc6bfd8e481917",
"score": "0.5314011",
"text": "def trim(num)\n integer, float = num.to_i, num.to_f\n integer == float ? integer : float\n end",
"title": ""
},
{
"docid": "39f0ffcf5d3f6bc2a667238d4c4b48dd",
"score": "0.53052944",
"text": "def filter_type(value)\n case value.class.name\n when 'Fixnum' then :numeric\n when ('String' || 'Symbol') then :varchar\n when ('Time' || 'Date') then :datetime\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "c2bd9866f6ed22859ea73f8a6df20439",
"score": "0.5298344",
"text": "def cast_to_num(num)\n ([convert(:int, num), convert(:float, num)] - [Const::Undefined]).first ||\n Const::Undefined\n end",
"title": ""
},
{
"docid": "5b2810e0e40e0282557f4dd6a7007f55",
"score": "0.52981716",
"text": "def number?\n type == :integer || type == :float || type == :decimal\n end",
"title": ""
},
{
"docid": "5b2810e0e40e0282557f4dd6a7007f55",
"score": "0.52981716",
"text": "def number?\n type == :integer || type == :float || type == :decimal\n end",
"title": ""
},
{
"docid": "2e72d0e369469bd283669f36ce8fa651",
"score": "0.529743",
"text": "def is_a_number?(num)\n # num.to_f.to_s == num.to_s || num.to_i.to_s == num.to_s\n # Even better check!\n Integer(num) rescue false\nend",
"title": ""
},
{
"docid": "3d7c4cb40efad76b410a2b290ecda611",
"score": "0.5295846",
"text": "def is_number? string\n true if Integer(string) rescue false\nend",
"title": ""
},
{
"docid": "3ee6eef346977c31253d524a0cb22d9a",
"score": "0.5289557",
"text": "def is_number?(object)\n true if Float(object) rescue false\nend",
"title": ""
},
{
"docid": "7a4ab000f1693daf80667967fe8d49b6",
"score": "0.528777",
"text": "def convert_type(value, index)\n\t\treturn nil if \"NULL\" == value.upcase\n\t\treturn case type_fields.values[index]\n\t\t\t when \"int\", \"tinyint\", \"smallint\", \"bigint\", \"hugeint\" then value.to_i\n\t\t\t when \"double\", \"real\", \"decimal\" then value.to_f\n\t\t\t when \"boolean\" then value.downcase == true\n\t\t\t when \"date\" then Date.parse(value)\n\t\t\t when \"time\" then Time.parse(value, Time.new(\"2000-01-01\"))\n\t\t\t when \"timestamp\" then DateTime.parse(value)\n\t\t\t when \"timestamptz\" then DateTime.parse(value)\n\t\t\t else value.gsub(/\\\\/, '').gsub(/^\"/,'').gsub(/\"$/,'').gsub(/\\\"/, '')\n\t\t\t end\n\tend",
"title": ""
},
{
"docid": "641e70a0dc88dfc908092e14afd42f07",
"score": "0.5284879",
"text": "def is_number? object\n\ttrue if Float(object) rescue false\nend",
"title": ""
},
{
"docid": "b8a594842ef544a37b48d7d87e8fa53f",
"score": "0.52790594",
"text": "def isitnumber(input)\n Float(input) rescue false\nend",
"title": ""
},
{
"docid": "f4ac0c7e1c723c84416f04fc8d19addd",
"score": "0.52787334",
"text": "def number?(integer)\n integer.class == 'Float' || integer.class == 'Fixnum'\nend",
"title": ""
},
{
"docid": "577686f102593d4baae17c10672d737a",
"score": "0.5269255",
"text": "def is_number? string\n true if Float(string) rescue false\nend",
"title": ""
},
{
"docid": "8942a29f4c9b96a6c4596391a885d1fb",
"score": "0.52664435",
"text": "def coerce(value, type)\n return value unless dry_type?(type)\n return value if type.try(value).input == value\n\n type[value]\n end",
"title": ""
},
{
"docid": "30843d0a72554b12bde56d08c8f79db8",
"score": "0.5264304",
"text": "def sanitize_to_int(num)\n sanitize_to_float(num).to_i\n end",
"title": ""
},
{
"docid": "e07de80a8661318c05653fc642a4d745",
"score": "0.5254911",
"text": "def number?(input)\n input.is_a?(Numeric)\nend",
"title": ""
},
{
"docid": "fd5fab5cfe24058cfaf3319d55224b81",
"score": "0.5237883",
"text": "def type_of_type(value)\n if value.is_a?(Range) || value.is_a?(Array) || value.is_a?(Hash)\n :complex\n else\n :simple\n end\nend",
"title": ""
},
{
"docid": "76551ed3d25c1570a4dd813b7fe1ced1",
"score": "0.5237072",
"text": "def inferred_type(value)\n case value\n when Array then :array\n when Hash then :dict\n when %r{^\\d+$} then :integer\n when %r{^\\d*\\.\\d+$} then :real # Doesnt really catch all valid real numbers.\n when true || false then :bool\n when %r{^\\d{4}-\\d{2}-\\d{2}} then :date # Not currently supported, requires munging to native Date type\n else :string\n end\n end",
"title": ""
},
{
"docid": "cd247cfcd78e753249e0330da24ba92d",
"score": "0.52368784",
"text": "def isNumeric(number) \n true if Integer(number) rescue false\nend",
"title": ""
},
{
"docid": "abb0329676636e2d59bd6ecfbaf2652f",
"score": "0.52294743",
"text": "def is_string_or_integer(str)\n if [String, Integer, Array].include?(str.class)\n str.class.to_s\n else\n \"Something Else\"\n end\nend",
"title": ""
},
{
"docid": "196c77bbdd81d5d9fdfb3c0f1e0dfc40",
"score": "0.5227452",
"text": "def numeric_check(first_num)\n Float(first_num) != nil rescue false\nend",
"title": ""
},
{
"docid": "8b7a4fa70cbf435a8c960492f372227e",
"score": "0.5227334",
"text": "def coercible_types type1, type2\n if DATE_TYPES.include?(type1) && DATE_TYPES.include?(type2)\n DATE_TYPES.first\n elsif NUMBER_TYPES.include?(type1) && NUMBER_TYPES.include?(type2)\n NUMBER_TYPES.first\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "09a495e7194f649a1a64f06ba4399de8",
"score": "0.5216653",
"text": "def collapse(types)\n return types.first if types.size == 1\n return nil if types.empty?\n return String if string?(types)\n return Float if float?(types)\n String\n end",
"title": ""
},
{
"docid": "e2051dfb28b86cb01574dff08502c0cc",
"score": "0.5212272",
"text": "def convert_type(s, argument_type)\n case argument_type\n when ARG_INT then s.to_i\n when ARG_FLOAT then BigDecimal(s)\n when ARG_STRING then s\n else nil\n end\n end",
"title": ""
},
{
"docid": "dae08439784c0663790e21decbd08747",
"score": "0.5212015",
"text": "def convert_type(s, argument_type)\n case argument_type\n when DATA_TYPE_INTEGER then return s.to_i\n when DATA_TYPE_FLOAT then return s.to_f\n when DATA_TYPE_STRING then return s\n else return nil\n end\n end",
"title": ""
},
{
"docid": "1520cd56fdc62c15fca96e8c2422ae8f",
"score": "0.5210925",
"text": "def num_or_sym(str)\n IS_NUMBER =~ str ? str.to_i : str.to_sym\n end",
"title": ""
},
{
"docid": "c3eb89698bed94101f8096e092ad66f6",
"score": "0.5206029",
"text": "def is_number? string\r\n true if Float(string) rescue false\r\nend",
"title": ""
},
{
"docid": "c3eb89698bed94101f8096e092ad66f6",
"score": "0.5206029",
"text": "def is_number? string\r\n true if Float(string) rescue false\r\nend",
"title": ""
},
{
"docid": "b21da3f02f5d35378f607f83774076a7",
"score": "0.52039605",
"text": "def is_number(string)\n true if Float(string) rescue false\nend",
"title": ""
},
{
"docid": "b06f2a6003df076428e7c9b26d4a563f",
"score": "0.5195229",
"text": "def value_to_type?(value)\n if @options[:type] == :integer\n /\\d+/ =~ value\n elsif @options[:type] == :float\n /\\d+(\\.\\d+)?/ =~ value\n else\n true\n end\n end",
"title": ""
},
{
"docid": "b32538a6254b17c8bd986e0130c12725",
"score": "0.51925313",
"text": "def to_numeric\n return Integer(self) if is_integer?\n return Float(self) if is_float?\n end",
"title": ""
},
{
"docid": "574554c06f6b183390a848a43c4b9625",
"score": "0.51925254",
"text": "def is_numeric?(obj) \n obj.to_s.match(/\\A[+-]?\\d+?(\\.\\d+)?\\Z/) == nil ? false : true\nend",
"title": ""
},
{
"docid": "10da0422547ada5d644ab0d17758e744",
"score": "0.51854813",
"text": "def number?(num)\n integer?(num) || float?(num)\nend",
"title": ""
},
{
"docid": "10da0422547ada5d644ab0d17758e744",
"score": "0.51854813",
"text": "def number?(num)\n integer?(num) || float?(num)\nend",
"title": ""
},
{
"docid": "10da0422547ada5d644ab0d17758e744",
"score": "0.51854813",
"text": "def number?(num)\n integer?(num) || float?(num)\nend",
"title": ""
},
{
"docid": "5a0961801c37816d4346197cd0e4c526",
"score": "0.5185158",
"text": "def is_numeric?(obj)\n\t#Expresion regular que hace match con numeros enteros\n\t#Se utiliza un if ternario para regresar el resultado\n\tobj.to_s.match(/\\A[+-]?\\d+?(\\.\\d+)?\\Z/) == nil ? false : true\nend",
"title": ""
},
{
"docid": "11843066b7c65b07e0ef090ae734fe03",
"score": "0.518481",
"text": "def trynumber(obj)\n if numeric?(obj)\n obj.to_i\n else\n obj\n end\n end",
"title": ""
},
{
"docid": "c12b55a7c6364c847d8c3c10d33cedbb",
"score": "0.51696765",
"text": "def is_numeric?(obj)\n obj.to_s.match(/\\A[+-]?\\d+?(\\.\\d+)?\\Z/) != nil ? true : false\nend",
"title": ""
},
{
"docid": "1d5868ea604dc01be916569de9be6f29",
"score": "0.51690155",
"text": "def is_numerical?(val)\n val.to_i.to_s == val.to_s\nend",
"title": ""
},
{
"docid": "87b95a79b19841a439b4e5ab529bf695",
"score": "0.5168188",
"text": "def my_isinteger(n) \n return n.is_a?(Integer) ? 1 : 0\nend",
"title": ""
},
{
"docid": "aa54342fd9d3c9563abda999f74d7fd4",
"score": "0.51594204",
"text": "def is_number?(num)\n true if Float(num) rescue false\nend",
"title": ""
},
{
"docid": "aa54342fd9d3c9563abda999f74d7fd4",
"score": "0.51594204",
"text": "def is_number?(num)\n true if Float(num) rescue false\nend",
"title": ""
},
{
"docid": "8e557b973d37a6510db18870d57f94fe",
"score": "0.5158683",
"text": "def is_number? i\n true if Float(i) rescue false\n end",
"title": ""
},
{
"docid": "604074410b856204ed3b807291c7c5df",
"score": "0.51559246",
"text": "def try_convert_value(value)\n return value.to_i if integer?(value)\n return value.to_f if float?(value)\n return true if boolean_true?(value)\n return false if boolean_false?(value)\n return convert_to_sym(value) if symbol?(value)\n value # can't parse, return String\n end",
"title": ""
},
{
"docid": "c00abf83b2714c0ea3ef5951d91f3a5d",
"score": "0.5154761",
"text": "def type_conversion( value )\n res = nil\n case value.strip\n when /^\\d+$/\n res = value.to_i\n when /^true$/i\n res = true\n when /^false$/i\n res = false\n else\n # don't stip, because user may want the blank space.\n res = value\n end\n res\n end",
"title": ""
},
{
"docid": "0bc8af2c255571843c38369cebf004da",
"score": "0.5152702",
"text": "def is_numeric?(obj) \n obj.to_s.match(/\\A[+-]?\\d+?(\\.\\d+)?\\Z/) == nil ? false : true\n end",
"title": ""
},
{
"docid": "6a9cc5b596174c8fa6945a690323de79",
"score": "0.5146526",
"text": "def isNumber(s)\n begin\n Float(s)\n rescue\n false # not numeric\n else\n true # numeric\n end\nend",
"title": ""
},
{
"docid": "4f5454d0edbb28a75b036dee6b821dbe",
"score": "0.51453084",
"text": "def convert_key_to_type(value, type)\n return value if type.nil?\n Rails.logger.debug \"Convert `#{value}` to a #{type}\"\n\n # Booleans\n return (value.casecmp('true') >= 0) if type == 'boolean'\n\n # Numbers\n return UmmUtilities.convert_to_number(value) if type == 'number'\n\n # Integers\n return UmmUtilities.convert_to_integer(value) if type == 'integer'\n\n # Anything else, return untouched\n value\n rescue => e\n Rails.logger.debug \"Error converting `#{value}` to a #{type}: #{e.message}\"\n\n # On any failure, just return the provided value\n value\n end",
"title": ""
},
{
"docid": "d21418c478e88f43e71f8d37a97ac741",
"score": "0.5143888",
"text": "def is_numeric?\n return true if self =~ /\\A\\d+\\Z/\n true if Float(self) rescue false # rubocop:disable Style/RescueModifier\n end",
"title": ""
},
{
"docid": "b2107bf6ed1c194e1079a7836b9fda5c",
"score": "0.5141294",
"text": "def normalize_item(item, field_def)\n return case field_def[:type]\n when 'long', 'int' then Integer(item)\n when 'double', 'float' then Float(item)\n when 'boolean' then item.kind_of?(String) ?\n item.casecmp('true') == 0 : item\n else item\n end\n end",
"title": ""
},
{
"docid": "f6b464289f237a0d8fc5087cf7457fe6",
"score": "0.51289195",
"text": "def is_numeric?(word)\n true if Float(word) rescue false\n end",
"title": ""
},
{
"docid": "a7e817a3b36d9e107f621260dc03f502",
"score": "0.51279366",
"text": "def is_number?(char)\n true if Float(char) rescue false\nend",
"title": ""
},
{
"docid": "00256b1ce85b28d3ba13c662142327db",
"score": "0.51268893",
"text": "def is_numeric?(obj) \n obj.to_s.match(/\\A[+-]?\\d+?(\\.\\d+)?\\Z/) == nil ? false : true\n end",
"title": ""
},
{
"docid": "eb3c223d5a764b88aa78c18336e0ab2a",
"score": "0.5126485",
"text": "def is_number?(string)\n true if Float(string) rescue false\nend",
"title": ""
},
{
"docid": "eb3c223d5a764b88aa78c18336e0ab2a",
"score": "0.5126485",
"text": "def is_number?(string)\n true if Float(string) rescue false\nend",
"title": ""
}
] |
531d6b89386fc504b7186fadc4df9e01
|
added by RMC on June 13, 2011
|
[
{
"docid": "7ac8e101f6402aa1e371e555527ac0f9",
"score": "0.0",
"text": "def display_question_text question_id, question_text\n display = question_text\n @WebInsertion = QuestionInsert.find(:all, :conditions => ['question_id = ?', question_id], :order => 'insert_number')\n if @WebInsertion.blank? then \n if question_text.blank? then\n question_text = \"why question text Blank in Questions helper\"\n else\n question_text\n end\n else\n insert_text(question_text, @WebInsertion) \n end \n \n end",
"title": ""
}
] |
[
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6263589",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6263589",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6263589",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6263589",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6263589",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6263589",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.60287863",
"text": "def used; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.60287863",
"text": "def used; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.5987121",
"text": "def pos; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.5987121",
"text": "def pos; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.5987121",
"text": "def pos; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.5987121",
"text": "def pos; end",
"title": ""
},
{
"docid": "a3c677de4120a6b1a1688fb1c77520ce",
"score": "0.5987121",
"text": "def pos; end",
"title": ""
},
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.59844387",
"text": "def desired; end",
"title": ""
},
{
"docid": "3ae137b1a40ff3aae4f3cbb2b6082797",
"score": "0.5947902",
"text": "def reaper; end",
"title": ""
},
{
"docid": "a9dd648a5d0d2e7d56223e7c753f5e2e",
"score": "0.5888174",
"text": "def telegraphical()\n end",
"title": ""
},
{
"docid": "1151221aa9457e5cad317e4fec922758",
"score": "0.58571017",
"text": "def adjugate; end",
"title": ""
},
{
"docid": "7ec57c3874853e50086febdbdd3221bf",
"score": "0.58444023",
"text": "def wedding; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "7c4e6912cde56a7ef38385e785b83259",
"score": "0.5842837",
"text": "def position; end",
"title": ""
},
{
"docid": "3caf4c824a6d6a4a5616c13fcab418da",
"score": "0.5839135",
"text": "def applied; end",
"title": ""
},
{
"docid": "26da328e8cf814fdc197fd2d301c3d2b",
"score": "0.58037233",
"text": "def flipx\r\n end",
"title": ""
},
{
"docid": "4fe655da88e61d28e8b9a9ed964af838",
"score": "0.5792324",
"text": "def imprensa\n\t\t\n\tend",
"title": ""
},
{
"docid": "794a198d95cf296afde54486d8c4e262",
"score": "0.57762325",
"text": "def avail_out=(*) end",
"title": ""
},
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.5691305",
"text": "def anchored; end",
"title": ""
},
{
"docid": "dff37ea0d68b9c86bab1ceb2dfb658a9",
"score": "0.5687617",
"text": "def rc; end",
"title": ""
},
{
"docid": "a747cf4388fb3d14718cf9dda73c555f",
"score": "0.5676019",
"text": "def initalize; end",
"title": ""
},
{
"docid": "a747cf4388fb3d14718cf9dda73c555f",
"score": "0.5676019",
"text": "def initalize; end",
"title": ""
},
{
"docid": "bfc59ba4069006df84cd4e7d17c175e6",
"score": "0.5661405",
"text": "def first_fixed; end",
"title": ""
},
{
"docid": "baabe5bb658b17a85353fb66fdbbf873",
"score": "0.56293267",
"text": "def extended; end",
"title": ""
},
{
"docid": "99837c89d79de120580d8c11ec1a227a",
"score": "0.56163627",
"text": "def m214; 14; end",
"title": ""
},
{
"docid": "3bbf27ef43a6153115f56b59566fb7da",
"score": "0.5610544",
"text": "def last_fixed; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.558118",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.558118",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.558118",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.558118",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.558118",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.558118",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.558118",
"text": "def loc; end",
"title": ""
},
{
"docid": "5cdb4d7bb82aec52a912b8f68a6c157b",
"score": "0.5576504",
"text": "def getc(*) end",
"title": ""
},
{
"docid": "1690d7019ed9eb85aea51fa33fd9ee40",
"score": "0.5568275",
"text": "def pn; end",
"title": ""
},
{
"docid": "1690d7019ed9eb85aea51fa33fd9ee40",
"score": "0.5568275",
"text": "def pn; end",
"title": ""
},
{
"docid": "1690d7019ed9eb85aea51fa33fd9ee40",
"score": "0.5568275",
"text": "def pn; end",
"title": ""
},
{
"docid": "1690d7019ed9eb85aea51fa33fd9ee40",
"score": "0.5568275",
"text": "def pn; end",
"title": ""
},
{
"docid": "1690d7019ed9eb85aea51fa33fd9ee40",
"score": "0.5568275",
"text": "def pn; end",
"title": ""
},
{
"docid": "1690d7019ed9eb85aea51fa33fd9ee40",
"score": "0.5568275",
"text": "def pn; end",
"title": ""
},
{
"docid": "1690d7019ed9eb85aea51fa33fd9ee40",
"score": "0.5568275",
"text": "def pn; end",
"title": ""
},
{
"docid": "1690d7019ed9eb85aea51fa33fd9ee40",
"score": "0.5568275",
"text": "def pn; end",
"title": ""
},
{
"docid": "1690d7019ed9eb85aea51fa33fd9ee40",
"score": "0.5568275",
"text": "def pn; end",
"title": ""
},
{
"docid": "310e8f8dbc5aaa9179075e3dd745c0d3",
"score": "0.55624974",
"text": "def _data0; end",
"title": ""
},
{
"docid": "58e2e07d11b107b6864a328f2187e248",
"score": "0.55518997",
"text": "def apop?; end",
"title": ""
},
{
"docid": "456acb6fbbfa8d19490feed3f145af4e",
"score": "0.55476904",
"text": "def deco_pos; end",
"title": ""
},
{
"docid": "3db157d82460cb0632778815b62dbc35",
"score": "0.5533545",
"text": "def dh; end",
"title": ""
},
{
"docid": "0939406b2108b4dcfeb32a0ce912e9dd",
"score": "0.5532854",
"text": "def\thustle \t \t\r\n\t\tend",
"title": ""
},
{
"docid": "b7567a2a68cade31f2360723a4c42dc7",
"score": "0.55304104",
"text": "def used_by; end",
"title": ""
},
{
"docid": "5ad7e5c7a147626a2b0a2c5956411be5",
"score": "0.55273896",
"text": "def r; end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.55241966",
"text": "def operations; end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.55241966",
"text": "def operations; end",
"title": ""
},
{
"docid": "67081eb3c98dc9ab87bd978f73a10e81",
"score": "0.5521261",
"text": "def advanced; end",
"title": ""
},
{
"docid": "67081eb3c98dc9ab87bd978f73a10e81",
"score": "0.5521261",
"text": "def advanced; end",
"title": ""
},
{
"docid": "3193c407a52e85393bb9fdcda99cdc18",
"score": "0.551895",
"text": "def ptr; end",
"title": ""
},
{
"docid": "48412710c08492591f41ec0553b303ce",
"score": "0.5514955",
"text": "def starting_position; end",
"title": ""
},
{
"docid": "04e074efc99de627ea58633a58870ec3",
"score": "0.5512863",
"text": "def stpreason\n end",
"title": ""
},
{
"docid": "da32862891e2ebc3c8d71f65524bb4c1",
"score": "0.5509085",
"text": "def prosa\n end",
"title": ""
},
{
"docid": "da32862891e2ebc3c8d71f65524bb4c1",
"score": "0.5509085",
"text": "def prosa\n end",
"title": ""
},
{
"docid": "b22b55ac75784dc3a9bcb40c0529af5d",
"score": "0.54996014",
"text": "def ss; end",
"title": ""
},
{
"docid": "b22b55ac75784dc3a9bcb40c0529af5d",
"score": "0.54996014",
"text": "def ss; end",
"title": ""
},
{
"docid": "2290804b238fc95bfd6b38f87c6d2895",
"score": "0.5494971",
"text": "def override; end",
"title": ""
},
{
"docid": "752e2844a9f276ee5cfa6836def131a9",
"score": "0.5484914",
"text": "def tld; end",
"title": ""
},
{
"docid": "752e2844a9f276ee5cfa6836def131a9",
"score": "0.5484914",
"text": "def tld; end",
"title": ""
},
{
"docid": "9bfd51b9a7c804c6ddb33e35e1b7dbd9",
"score": "0.5470172",
"text": "def offset; end",
"title": ""
},
{
"docid": "9bfd51b9a7c804c6ddb33e35e1b7dbd9",
"score": "0.5470172",
"text": "def offset; end",
"title": ""
},
{
"docid": "9bfd51b9a7c804c6ddb33e35e1b7dbd9",
"score": "0.5470172",
"text": "def offset; end",
"title": ""
},
{
"docid": "9bfd51b9a7c804c6ddb33e35e1b7dbd9",
"score": "0.5470172",
"text": "def offset; end",
"title": ""
},
{
"docid": "9bfd51b9a7c804c6ddb33e35e1b7dbd9",
"score": "0.5470172",
"text": "def offset; end",
"title": ""
},
{
"docid": "9bfd51b9a7c804c6ddb33e35e1b7dbd9",
"score": "0.5470172",
"text": "def offset; end",
"title": ""
},
{
"docid": "9bfd51b9a7c804c6ddb33e35e1b7dbd9",
"score": "0.5470172",
"text": "def offset; end",
"title": ""
},
{
"docid": "9bfd51b9a7c804c6ddb33e35e1b7dbd9",
"score": "0.5470172",
"text": "def offset; end",
"title": ""
},
{
"docid": "9bfd51b9a7c804c6ddb33e35e1b7dbd9",
"score": "0.5470172",
"text": "def offset; end",
"title": ""
},
{
"docid": "9bfd51b9a7c804c6ddb33e35e1b7dbd9",
"score": "0.5470172",
"text": "def offset; end",
"title": ""
},
{
"docid": "9bfd51b9a7c804c6ddb33e35e1b7dbd9",
"score": "0.5470172",
"text": "def offset; end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "dd3d99063432234d2150f054be35e77d",
"score": "0.0",
"text": "def set_store\n @store = Store.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60320485",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6013371",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.5922535",
"text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.59156126",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.59156126",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.589823",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.5890472",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890387",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890387",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890387",
"text": "def actions; end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.58775556",
"text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "a80b33627067efa06c6204bee0f5890e",
"score": "0.5863097",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.5810218",
"text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end",
"title": ""
},
{
"docid": "33ff963edc7c4c98d1b90e341e7c5d61",
"score": "0.5741132",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.57315207",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.571736",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.56991524",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.56929684",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.5667968",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.5652351",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.5649619",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.5637822",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.56270146",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.56099445",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.5595848",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.5595191",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.5588875",
"text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.55566645",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.55566645",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.55095106",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.55039996",
"text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end",
"title": ""
},
{
"docid": "dcf95c552669536111d95309d8f4aafd",
"score": "0.5466593",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.54660857",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.5449364",
"text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend",
"title": ""
},
{
"docid": "e3aadf41537d03bd18cf63a3653e05aa",
"score": "0.54439306",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.5439483",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.54181427",
"text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.54119074",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.54119074",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.53994405",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.53937256",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.53937256",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.5391617",
"text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end",
"title": ""
},
{
"docid": "a468b256a999961df3957e843fd9bdf4",
"score": "0.5387492",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53801376",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5358599",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.5349504",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.53479505",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.5346732",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.53440404",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.5342186",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.53266597",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.53030294",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.5285732",
"text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end",
"title": ""
},
{
"docid": "1e1e48767a7ac23eb33df770784fec61",
"score": "0.5284358",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.52565944",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.52556264",
"text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end",
"title": ""
},
{
"docid": "fc88422a7a885bac1df28883547362a7",
"score": "0.5250511",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.52470475",
"text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52388334",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52388334",
"text": "def action; end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.5237919",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.5233395",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.52305096",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.5224124",
"text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.5220735",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.52206117",
"text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end",
"title": ""
},
{
"docid": "8d7ed2ff3920c2016c75f4f9d8b5a870",
"score": "0.5215545",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.52138394",
"text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end",
"title": ""
},
{
"docid": "78ecc6a2dfbf08166a7a1360bc9c35ef",
"score": "0.5210016",
"text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end",
"title": ""
},
{
"docid": "2aba2d3187e01346918a6557230603c7",
"score": "0.5207759",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.52053165",
"text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end",
"title": ""
},
{
"docid": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.52050936",
"text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end",
"title": ""
},
{
"docid": "d56f4ec734e3f3bc1ad913b36ff86130",
"score": "0.52028465",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "691d5a5bcefbef8c08db61094691627c",
"score": "0.5201899",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51971984",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51971984",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "7fca702f2da4dbdc9b39e5107a2ab87d",
"score": "0.5189866",
"text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end",
"title": ""
},
{
"docid": "063b82c93b47d702ef6bddadb6f0c76e",
"score": "0.5180898",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.5179142",
"text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5173538",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5173538",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5173538",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.51641655",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.5151931",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "c594a0d7b6ae00511d223b0533636c9c",
"score": "0.5142854",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.51420087",
"text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.5141399",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "2fcff037e3c18a5eb8d964f8f0a62ebe",
"score": "0.51397336",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "111fd47abd953b35a427ff0b098a800a",
"score": "0.5134713",
"text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end",
"title": ""
},
{
"docid": "f2ac709e70364fce188bb24e414340ea",
"score": "0.51165104",
"text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5114052",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.5111094",
"text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110216",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110216",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110216",
"text": "def action\n end",
"title": ""
},
{
"docid": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.5107504",
"text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend",
"title": ""
},
{
"docid": "f04fd745d027fc758dac7a4ca6440871",
"score": "0.51062083",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.5099243",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.50964487",
"text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end",
"title": ""
},
{
"docid": "35b302dd857a031b95bc0072e3daa707",
"score": "0.50935394",
"text": "def config(action, *args); end",
"title": ""
}
] |
fd69ecacac27bae42cfdf368ea24736b
|
Exceptionraising version of `authenticate`. Raise if not authenticated.
|
[
{
"docid": "5fcd71d4e0e21e7874441d51fd99d91d",
"score": "0.0",
"text": "def authenticate!\n raise Zilch::Authorisation::NotAuthorisedException unless adapter.authenticate!\n adapter.current_user\n end",
"title": ""
}
] |
[
{
"docid": "0640d6150011370d228164729f12238f",
"score": "0.7718017",
"text": "def authenticate(*args)\n authenticate!(*args)\n rescue\n nil\n end",
"title": ""
},
{
"docid": "0640d6150011370d228164729f12238f",
"score": "0.7718017",
"text": "def authenticate(*args)\n authenticate!(*args)\n rescue\n nil\n end",
"title": ""
},
{
"docid": "fba2b68e1d52ef497033627961b13df0",
"score": "0.75509626",
"text": "def authenticate_user!\n unathorized_error unless authenticated?\n end",
"title": ""
},
{
"docid": "9c55ce70188a4e6c708e3f87818f1d30",
"score": "0.74088496",
"text": "def authenticate_user!\n unauthorized_error unless authenticated?\n end",
"title": ""
},
{
"docid": "cce1d8b5c5ba8dd8385dc54d87a9c848",
"score": "0.73372865",
"text": "def authenticate!\n auth_needed? or raise \"Authentication not needed for this request.\"\n authenticate or raise payload.errors.last\n end",
"title": ""
},
{
"docid": "8f13743a02413ea02c4be247425625f7",
"score": "0.7288819",
"text": "def authenticate!\n error!('Unauthorized. Invalid or expired token.', 401) unless authenticated_user\n end",
"title": ""
},
{
"docid": "0a0a3c1c60ff6320382bc5a4275f0765",
"score": "0.7283368",
"text": "def attempt_authenticate\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "50de6b00a8285002e1f41a7c514bc5e7",
"score": "0.7237444",
"text": "def authenticate!\n render_unauthorized unless current_user\n end",
"title": ""
},
{
"docid": "cc8da29c63dcf21942facb3ace26b7ed",
"score": "0.7214886",
"text": "def authenticate!(*args)\n user = authenticate(*args)\n raise AccessDeniedException unless user\n user\n end",
"title": ""
},
{
"docid": "3b8006480c896374ae4cfc9af3e8cd4b",
"score": "0.72087306",
"text": "def authenticate_user!\n raise \"`authenticate_user!` was called.\"\n end",
"title": ""
},
{
"docid": "e1f47d83e6f263d2dc06bce19cfe2154",
"score": "0.71933526",
"text": "def authenticate!\n error!('401 Unauthorized', 401) unless current_user\n end",
"title": ""
},
{
"docid": "2c93cc32aa064441a9a5fca7ec792969",
"score": "0.7188407",
"text": "def authenticate\n render_unauthorized unless authenticated?\n end",
"title": ""
},
{
"docid": "b3b426d4be6502b8d5e8b16cf502b3b9",
"score": "0.71464825",
"text": "def authenticate\n raise \"Implement me!\"\n end",
"title": ""
},
{
"docid": "9f94e357f63b21387d760f531f5b1fb4",
"score": "0.71095353",
"text": "def authenticate!\n current_user || render_unauthorized\n end",
"title": ""
},
{
"docid": "0a8d1bd02c15b641849ea80aa20ee48d",
"score": "0.7082073",
"text": "def authenticate\n # raise ActiveRecord::RecordInvalid if !logged_in?\n raise AuthorizationError if !logged_in?\n end",
"title": ""
},
{
"docid": "0d216bbdbfaeed7430516bb6f954aa86",
"score": "0.7038764",
"text": "def authenticate_user!\n return nil if current_user\n\n error_response(message: 'Invalid Credentials.', status: 401) and return\n end",
"title": ""
},
{
"docid": "3e84e83e3e85036f823e8eea67435b42",
"score": "0.7031325",
"text": "def authenticate\n deny_access unless signed_in?\n end",
"title": ""
},
{
"docid": "baa5682198edfcfc8597523bece06053",
"score": "0.7014534",
"text": "def authenticate\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "baa5682198edfcfc8597523bece06053",
"score": "0.7014534",
"text": "def authenticate\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "c96ff6a25e94a1c0bbd80b86e4fbc82e",
"score": "0.6953329",
"text": "def authenticate\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "470bbb326a79f95e735f0ad1c0005f24",
"score": "0.69483745",
"text": "def authenticate\n deny_access unless signed_in?\n end",
"title": ""
},
{
"docid": "470bbb326a79f95e735f0ad1c0005f24",
"score": "0.69483745",
"text": "def authenticate\n deny_access unless signed_in?\n end",
"title": ""
},
{
"docid": "470bbb326a79f95e735f0ad1c0005f24",
"score": "0.69483745",
"text": "def authenticate\n deny_access unless signed_in?\n end",
"title": ""
},
{
"docid": "470bbb326a79f95e735f0ad1c0005f24",
"score": "0.69483745",
"text": "def authenticate\n deny_access unless signed_in?\n end",
"title": ""
},
{
"docid": "470bbb326a79f95e735f0ad1c0005f24",
"score": "0.69483745",
"text": "def authenticate\n deny_access unless signed_in?\n end",
"title": ""
},
{
"docid": "470bbb326a79f95e735f0ad1c0005f24",
"score": "0.69483745",
"text": "def authenticate\n deny_access unless signed_in?\n end",
"title": ""
},
{
"docid": "470bbb326a79f95e735f0ad1c0005f24",
"score": "0.69483745",
"text": "def authenticate\n deny_access unless signed_in?\n end",
"title": ""
},
{
"docid": "2566816ff83b43fee7e11066e6dac65a",
"score": "0.6915968",
"text": "def authenticate!\n error!({error: 'Unauthorized',\n detail: \"Not authorized for route '#{request.request_method} #{request.path}'\",\n status: '401'},\n 401) unless current_user\n\n end",
"title": ""
},
{
"docid": "60230ac2abcfab1ff0c10e2256a79276",
"score": "0.69086665",
"text": "def authenticate\n logged_in? || access_denied\n end",
"title": ""
},
{
"docid": "60230ac2abcfab1ff0c10e2256a79276",
"score": "0.69086665",
"text": "def authenticate\n logged_in? || access_denied\n end",
"title": ""
},
{
"docid": "60230ac2abcfab1ff0c10e2256a79276",
"score": "0.69086665",
"text": "def authenticate\n logged_in? || access_denied\n end",
"title": ""
},
{
"docid": "11fba74cdea6aaa329f8b3d0a1f5d415",
"score": "0.6882693",
"text": "def authenticate!(*args)\n scope, opts = _perform_authentication(*args)\n throw(:warden, opts.merge(:action => :unauthenticated)) if !user(scope)\n user(scope)\n end",
"title": ""
},
{
"docid": "d3fee3b2c05bd1dd6a7dd5fcd1b5ebde",
"score": "0.68522024",
"text": "def authenticate!\n raise UnauthorizedAccess, 'invalid access token' unless current_user\n end",
"title": ""
},
{
"docid": "d92080932eee88b1927cab071dc3adf6",
"score": "0.6843932",
"text": "def authenticate\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "d92080932eee88b1927cab071dc3adf6",
"score": "0.6843932",
"text": "def authenticate\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "d92080932eee88b1927cab071dc3adf6",
"score": "0.6843932",
"text": "def authenticate\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "d92080932eee88b1927cab071dc3adf6",
"score": "0.6843932",
"text": "def authenticate\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "d92080932eee88b1927cab071dc3adf6",
"score": "0.6843932",
"text": "def authenticate\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "d92080932eee88b1927cab071dc3adf6",
"score": "0.6843932",
"text": "def authenticate\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "d92080932eee88b1927cab071dc3adf6",
"score": "0.6843932",
"text": "def authenticate\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "a8b149db3a954ac1cfc019e7f2afdc19",
"score": "0.68435585",
"text": "def authenticate!\n return if authenticated?\n warden.authenticate!\n end",
"title": ""
},
{
"docid": "aab89af927c8a8704cfb54584ceb8ff1",
"score": "0.6836535",
"text": "def authenticate_request\n\t\t\t\tif auth_token_expired?\n\t\t\t\t\tfail Exceptions::AuthenticationTimeoutError\n\t\t\t\telsif !@current_user\n\t\t\t\t\tfail Exceptions::NotAuthenticatedError\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "5fb7f0d1df71d8b200adde99e0b1a7a4",
"score": "0.6834437",
"text": "def handle_authentication_failure(message = nil)\n raise Authenticate::AuthenticationError, message\n end",
"title": ""
},
{
"docid": "c9e8da24b3da3a8747c623143ac259bd",
"score": "0.6833651",
"text": "def authenticate!\n head :unauthorized unless current_user\n end",
"title": ""
},
{
"docid": "0e3059a2f4550a1081a775edf0b316a7",
"score": "0.68132514",
"text": "def authenticate\n unauthorized if current_user.nil?\n end",
"title": ""
},
{
"docid": "0e3059a2f4550a1081a775edf0b316a7",
"score": "0.68132514",
"text": "def authenticate\n unauthorized if current_user.nil?\n end",
"title": ""
},
{
"docid": "591241f781d18a19d168e101dc6439da",
"score": "0.6813241",
"text": "def authenticate!\n error! :unauthorized and return false unless current_user\n end",
"title": ""
},
{
"docid": "29eaec8b7201fa23c629e3c91f625ca9",
"score": "0.6788816",
"text": "def authenticate\n head :unauthorized unless current_user\n end",
"title": ""
},
{
"docid": "8b7c18641a1351bc47d5086509c889d4",
"score": "0.67814195",
"text": "def authenticate!\n @@authenticator.authenticate!\n end",
"title": ""
},
{
"docid": "f7076e3bfdefd067f18e4dc1234c73e0",
"score": "0.6774346",
"text": "def authenticate_user!\n throw(:abort)\n end",
"title": ""
},
{
"docid": "fa5edacd9159e658945aedbe35879435",
"score": "0.675809",
"text": "def authenticate!(*args)\n user, opts = _perform_authentication(*args)\n throw(:warden, opts) unless user\n user\n end",
"title": ""
},
{
"docid": "c7286fa51ff5527baa26f5bf7d98273a",
"score": "0.6756625",
"text": "def authenticate_request\n\t\tif auth_token_expired?\n\t\t\tfail Exceptions::AuthenticationTimeoutError\n\t\telsif !@current_user\n\t\t\tfail Exceptions::NotAuthenticatedError\n\t\tend\n\tend",
"title": ""
},
{
"docid": "bea398407c817ccc1e49b63f6fc76b17",
"score": "0.6743799",
"text": "def authenticate!\n\t\terror!('Unauthorized', 401) if !is_authenticated\n @request_user\n\tend",
"title": ""
},
{
"docid": "736f0c00e0ffe6a9fbe0aeca59f3105f",
"score": "0.67356",
"text": "def authenticate\n logged_in? || access_denied\n end",
"title": ""
},
{
"docid": "ab7d86463162b69ed0e3017799a751cc",
"score": "0.6732912",
"text": "def authenticate\n if signed_in? == false\n flash.now[:error] = \"User not logged in.\"\n respond_with(flash)\n end\n end",
"title": ""
},
{
"docid": "02c7f6c196f0e10315dde1f616b308df",
"score": "0.67264086",
"text": "def authenticate(_method, req, call)\n fail!(req, call, :unauthenticated) unless Authentication.verify(call)\n end",
"title": ""
},
{
"docid": "57cd4b913023f043be325034b7324587",
"score": "0.67008245",
"text": "def authenticate_user!\n authenticate_token || render_unauthorized(\"Access denied\")\n end",
"title": ""
},
{
"docid": "57f5cb4e238a985a5830c4420dd54f61",
"score": "0.6687862",
"text": "def authenticate\n deny_access unless signed_in?\n end",
"title": ""
},
{
"docid": "57f5cb4e238a985a5830c4420dd54f61",
"score": "0.6687862",
"text": "def authenticate\n deny_access unless signed_in?\n end",
"title": ""
},
{
"docid": "57f5cb4e238a985a5830c4420dd54f61",
"score": "0.6687862",
"text": "def authenticate\n deny_access unless signed_in?\n end",
"title": ""
},
{
"docid": "57f5cb4e238a985a5830c4420dd54f61",
"score": "0.6687862",
"text": "def authenticate\n deny_access unless signed_in?\n end",
"title": ""
},
{
"docid": "57f5cb4e238a985a5830c4420dd54f61",
"score": "0.6687862",
"text": "def authenticate\n deny_access unless signed_in?\n end",
"title": ""
},
{
"docid": "57f5cb4e238a985a5830c4420dd54f61",
"score": "0.6687862",
"text": "def authenticate\n deny_access unless signed_in?\n end",
"title": ""
},
{
"docid": "57f5cb4e238a985a5830c4420dd54f61",
"score": "0.6687862",
"text": "def authenticate\n deny_access unless signed_in?\n end",
"title": ""
},
{
"docid": "3515b2d160de7a29a2f827a8a173c563",
"score": "0.66727746",
"text": "def authenticate_request!\n # already authenticated in soft authentication\n return true if @current_user\n extract_user_from_auth_token\n rescue JWT::ExpiredSignature, JWT::ImmatureSignature\n raise AuthenticationTimeoutError\n rescue JWT::VerificationError\n raise_auth_error('JWT Verification')\n rescue JWT::DecodeError\n raise_auth_error('JWT Decode')\n rescue ActiveRecord::RecordNotFound\n raise_auth_error('Record Not Found')\n end",
"title": ""
},
{
"docid": "4a1515b3cd508da5e710b1d60eac186a",
"score": "0.66676915",
"text": "def authenticate\n\tauthenticate_header || authenticate_params || render_unauthorized\n end",
"title": ""
},
{
"docid": "68889b9efc871f68be15326fac2f90d7",
"score": "0.66052943",
"text": "def authenticate\n if signed_in? == false\n flash.now[:error] = \"User not logged in.\"\n respond_with(flash)\n end\n end",
"title": ""
},
{
"docid": "2b2101df7188d73fba7bd2aa5841d1d5",
"score": "0.6596857",
"text": "def authenticate\n if signed_in? == false\n flash.now[:error] = \"User not logged in.\"\n respond_with(flash)\n end\n end",
"title": ""
},
{
"docid": "55e2444adeee93304f82d56c836f7572",
"score": "0.65963954",
"text": "def authenticate\n deny_access unless logged_in?\n end",
"title": ""
},
{
"docid": "54b280921d49c9bdb72895c09d417b65",
"score": "0.65950876",
"text": "def render_authenticate_error(message:)\n render_error(401, message: message)\n end",
"title": ""
},
{
"docid": "03b60c25d043a899f36efd3cf1584b7e",
"score": "0.6566188",
"text": "def render_authenticate_error\n return render_error!(compose_msg(:unauthorized), 401)\n end",
"title": ""
},
{
"docid": "7cb934c8d54e31772737485062d9989a",
"score": "0.6553398",
"text": "def authenticated!\n error(401) unless current_user\n end",
"title": ""
},
{
"docid": "e0ab3f477ea44298b50be7ba549bef02",
"score": "0.6548868",
"text": "def authenticate \n deny_access unless signed_in?\n end",
"title": ""
},
{
"docid": "4928754b427ecfbea84843ca03abcba9",
"score": "0.65470356",
"text": "def invalid_authentication\n render_unauthorized_response\n end",
"title": ""
},
{
"docid": "7e32474c670f4d658a3d7b15b33e6aaf",
"score": "0.6545994",
"text": "def authenticate\n result = run_callbacks(:before_authenticate) {|cb_res,| cb_res == false } \n return result if result == false # skip authentication \n \n User.current = authenticate_user\n failed_authentication! if User.current.blank?\n\n run_callbacks(:after_authenticate)\n end",
"title": ""
},
{
"docid": "11b3ee28c69b62e87b623580d15c1aa6",
"score": "0.653101",
"text": "def user_authenticate\n if user_logged_in?\n # do nothing\n else\n user_access_denied\n end\n end",
"title": ""
},
{
"docid": "89e38e00feb2e78817bff8aa540f9851",
"score": "0.6515297",
"text": "def authenticate!\n unless logged_in?\n redirect_to login_url, alert: \"You must be logged in to continue.\"\n end\n end",
"title": ""
},
{
"docid": "f424d9ba38f75b31f8226908a97bb91e",
"score": "0.650003",
"text": "def authenticate!\n # just check, that something exists in sub :-)\n raise AuthError.new if current_user.nil?\n end",
"title": ""
},
{
"docid": "c344deb2a864a85e5d8456b7e64ffb79",
"score": "0.6466302",
"text": "def authenticate_user!\n catch(:warden) do\n super\n end\n\n render_unauthorized unless user_signed_in?\n end",
"title": ""
},
{
"docid": "565bc3aeb421f2e6a242bf0bde1a1d6c",
"score": "0.6459822",
"text": "def authenticate\n return authenticate_backend if backend_request?\n return authenticate_api if api_request? \n deny_access # otherwise\n end",
"title": ""
},
{
"docid": "f78dce38f0b306586e8fc89afeaf831b",
"score": "0.6457069",
"text": "def authenticate\n logged_in? ? true : access_denied\n end",
"title": ""
},
{
"docid": "f78dce38f0b306586e8fc89afeaf831b",
"score": "0.6457069",
"text": "def authenticate\n logged_in? ? true : access_denied\n end",
"title": ""
},
{
"docid": "f78dce38f0b306586e8fc89afeaf831b",
"score": "0.6457069",
"text": "def authenticate\n logged_in? ? true : access_denied\n end",
"title": ""
},
{
"docid": "bcf6700c4ff00843a5df18c037f4a2e1",
"score": "0.6411702",
"text": "def authenticate\n if !logged_in? || current_user.nil?\n redirect '/login'\n end\n end",
"title": ""
},
{
"docid": "73e73dfc33d783d0eecd5c9cfb51ed47",
"score": "0.64090455",
"text": "def authenticate(*args)\n warden.authenticate!(*args)\n end",
"title": ""
},
{
"docid": "73e73dfc33d783d0eecd5c9cfb51ed47",
"score": "0.64090455",
"text": "def authenticate(*args)\n warden.authenticate!(*args)\n end",
"title": ""
},
{
"docid": "73e73dfc33d783d0eecd5c9cfb51ed47",
"score": "0.64090455",
"text": "def authenticate(*args)\n warden.authenticate!(*args)\n end",
"title": ""
},
{
"docid": "fdb806605c86e1c8d01cebf4a005d20e",
"score": "0.6402132",
"text": "def authenticate(*args)\n raise NotImplementedError, \"#{self.class} should implement this method\"\n end",
"title": ""
},
{
"docid": "c5bc98d194aacda6ab6bb4ad1ea1a3ef",
"score": "0.64008415",
"text": "def authenticate(*args)\n @access = @auth.authenticate(*args)\n end",
"title": ""
},
{
"docid": "7cc8ba97536dd396c04bedc4340da081",
"score": "0.6398363",
"text": "def authenticate\n render plain: 'login required.' unless login?\n end",
"title": ""
},
{
"docid": "3473ec127d5a6418940f5a9a442e9220",
"score": "0.63944966",
"text": "def authenticate(_password)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "6b643996de9c816a109e9e1117017f8e",
"score": "0.6390868",
"text": "def authenticate(*args)\n warden.authenticate(*args)\n end",
"title": ""
},
{
"docid": "6b643996de9c816a109e9e1117017f8e",
"score": "0.6390868",
"text": "def authenticate(*args)\n warden.authenticate(*args)\n end",
"title": ""
},
{
"docid": "72b7975494fa40365ba5b83d316b1016",
"score": "0.63849586",
"text": "def authenticate\n authenticate_token || render_unauthorized\n end",
"title": ""
},
{
"docid": "6a0caf6e5716b130a7f34b9ef1da1730",
"score": "0.63845116",
"text": "def authenticate\n if !logged_in? || current_user.nil?\n flash[:error] = \"You must be logged in.\"\n redirect_to login_path\n end\n end",
"title": ""
},
{
"docid": "6f0e3c5d096d325db72de6b8386ce393",
"score": "0.63749",
"text": "def require_authentication\n d 'Controller::require_authentication'\n unless authenticated?\n unauthorized\n end\n\n message = catch(:failure) do\n current_user = authenticate_session.current_user\n Authenticate.lifecycle.run_callbacks(:after_set_user, current_user, authenticate_session, {event: :set_user })\n end\n unauthorized(message) if message\n end",
"title": ""
},
{
"docid": "e718ea21e9d8bef0404baf3c8a1d42ab",
"score": "0.6353505",
"text": "def authenticate(*args)\n warden.authenticate(*args)\n end",
"title": ""
},
{
"docid": "446599bb44a288c231c814fe967bc6a4",
"score": "0.6351613",
"text": "def authenticate\n\tlogged_in? || access_denied\nend",
"title": ""
},
{
"docid": "2c5d391720283468d28acaae3b144ec2",
"score": "0.63463014",
"text": "def authenticate\n pattern = /^Bearer /\n header = request.headers['Authorization']\n if header && header.match(pattern)\n token = header.gsub(pattern, '')\n @current_user = User.find_by_token token\n raise ForbiddenError, error_messages[:unverified_login] unless @current_user.verified?\n raise ForbiddenError, error_messages[:unverified_login] unless !@current_user.teacher? || @current_user.verified_teacher?\n else\n raise AuthenticationError\n end\n rescue ActiveRecord::RecordNotFound\n raise AuthenticationError\n end",
"title": ""
},
{
"docid": "9e81ee7140ec68c3f7e6e7c96f158c81",
"score": "0.6336718",
"text": "def authenticate_rejector!(request)\n if request.self_actioned?\n raise NotAuthenticatedError.new(\"you cannot reject the request by yourself\")\n end\n end",
"title": ""
},
{
"docid": "09ea410ce09d051830b19d57d18c910d",
"score": "0.6333403",
"text": "def authenticate\n if !logged_in || current_user.nil?\n redirect '/login'\n end\n end",
"title": ""
}
] |
1eccb9f11785b4063a46ba1f9781fa2b
|
PUT /contact_groups/1 PUT /contact_groups/1.xml
|
[
{
"docid": "970f7ef90746d803769c2391dc9fafac",
"score": "0.7069712",
"text": "def update\n @contact_group = ContactGroup.find(params[:id])\n\n respond_to do |format|\n if @contact_group.update_attributes(params[:contact_group])\n format.html { redirect_to(@contact_group, :notice => 'Contact group was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @contact_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "410e2336d9ccebf32a84602a5f47425f",
"score": "0.6951636",
"text": "def update\n \n \n @contact_group = ContactGroup.find(params[:id])\n contacts = params[:contacts]\n @contact_group.contact_lists.clear\n respond_to do |format|\n if @contact_group.update_attributes(params[:group])\n \tunless contacts.nil?\n \tcontacts.each do |contact|\n \t\t @contact_group.contact_lists << ContactList.find(contact)\n \tend\n end\n flash[:notice] = \"#{@contact_group.name} was successfully updated.\"\n format.html { redirect_to(admin_contact_groups_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @contact_group.errors, :status => :unprocessable_entity }\n end\n end\n\n\n\n end",
"title": ""
},
{
"docid": "e96e8dde3cfc4bdc99938af43fc93261",
"score": "0.6829642",
"text": "def update\n if @contact_group.update(contact_group_params)\n render json: @contact_group, status: :ok\n else\n render json: @contact_group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "cb4e3b1bbe8f47f8b49d48d2d892f836",
"score": "0.6612826",
"text": "def update\n check_member_or_admin_of_group?\n @contact = @group.contacts.friendly.find(params[:id])\n respond_to do |format|\n if @contact.update(contact_params)\n format.html { redirect_to group_contact_path(@group, @contact), notice: 'Contact was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @contact.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c9823ae0a86d2d932bf882249308ea1c",
"score": "0.64673877",
"text": "def update\n \n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to(@group, :notice => 'Group was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "abf052fc13f8d7014f4a4fcbb8ba2922",
"score": "0.6414864",
"text": "def update\n\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "abf052fc13f8d7014f4a4fcbb8ba2922",
"score": "0.6414864",
"text": "def update\n\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36e931e845f8a6bea7a019d69c7912a2",
"score": "0.64058924",
"text": "def update\n @group = Group.find(params[:id])\n \n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9c95f53e00ca6285e93066eb0954df17",
"score": "0.6401097",
"text": "def update_contact_group(group_name, project_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'PUT'\n\t\targs[:path]['GroupName'] = group_name\n\t\targs[:path]['ProjectName'] = project_name\n\t\targs[:pattern] = '/projects/[ProjectName]/groups/[GroupName]'\n\t\targs[:query]['Action'] = 'UpdateContactGroup'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :contact_group\n\t\t\targs[:body]['ContactGroup'] = optional[:contact_group]\n\t\tend\n\t\tself.run(args)\n\tend",
"title": ""
},
{
"docid": "9a810a8294b0c46f5085031cad3d1103",
"score": "0.63982445",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9a810a8294b0c46f5085031cad3d1103",
"score": "0.63982445",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9a810a8294b0c46f5085031cad3d1103",
"score": "0.63982445",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9a810a8294b0c46f5085031cad3d1103",
"score": "0.63982445",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9a810a8294b0c46f5085031cad3d1103",
"score": "0.63982445",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9a810a8294b0c46f5085031cad3d1103",
"score": "0.63982445",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "41159dde9b1ee18636e2d4bdc2ab7ef4",
"score": "0.6379294",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to( view_group_path(@group.label), :notice => 'Group was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9c8de2078908a6ff810abe52a191928",
"score": "0.6371914",
"text": "def update\n logger.info \"Put parameters: #{params.to_json}\"\n @group = Group.find(params[:id])\n\n if @group.update_attributes(params[:group])\n head :no_content\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "a0ef58d039c3319046af9c6fc798a6e4",
"score": "0.6362082",
"text": "def update\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = '{object} was successfully {action}.'[:object_action_notice, \"Group\"[], \"updated\"[]]\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d475daf0897fde7012389e2b11fa7c91",
"score": "0.63402164",
"text": "def update\n Group.rebuild! if nil.|Group.find(:first).rgt\n\t @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "205d7e64cdaa5845e525e5a8057ab9c7",
"score": "0.6334805",
"text": "def update\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to groups_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cef1eba26dbd83e47f19654db7b34ec8",
"score": "0.63260955",
"text": "def update\n @group = Group.find(params[:id])\n\n if @group.update_attributes(params[:group])\n flash[:notice] = t('flash_msg47')\n @groups = Group.all\n # format.html { redirect_to(@group) }\n # format.xml { head :ok }\n else\n # format.html { render :action => \"edit\" }\n # format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end",
"title": ""
},
{
"docid": "ab83680aca672d145959a116d2fe4e77",
"score": "0.63240045",
"text": "def update\n @group = Group.find(params[:id])\n \n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(admin_groups_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78edb7f471f1f57d63005692f1fb1b46",
"score": "0.63042146",
"text": "def update\n @add_to_group = AddToGroup.find(params[:id])\n\n respond_to do |format|\n if @add_to_group.update_attributes(params[:add_to_group])\n format.html { redirect_to(@add_to_group, :notice => 'Add to group was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @add_to_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5ecbfceeae1ca00ef1bdf4c0f4d34a5b",
"score": "0.629662",
"text": "def set_contact_group\n @contact_group = ContactGroup.find(params[:id])\n end",
"title": ""
},
{
"docid": "da7b23a50d4c64d3f81800a2f6b5846f",
"score": "0.6276024",
"text": "def update\n @marketing_campaign = MarketingCampaign.find(params[:id])\n \n if(params[:contact_groups] != nil)\n \t@marketing_campaign.contact_groups = Array.new\n \t\n\t\t params[:contact_groups].each do |id|\n\t\t \t@marketing_campaign.contact_groups << ContactGroup.find(id[0])\n\t\t\tend\n\t\tend\n\n respond_to do |format|\n if @marketing_campaign.update_attributes(params[:marketing_campaign])\n \tif(@marketing_campaign.status == 4)\n\t\t\t\t\t@marketing_campaign.next_status\n\t\t\t\t\t@marketing_campaign.save\n\t\t\t\tend\n format.html { redirect_to @marketing_campaign, notice: 'Marketing campaign was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @marketing_campaign.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ced94ebb30de7392a4a2b57f2eb3886a",
"score": "0.625893",
"text": "def update\n @group = SuperSimpleCms::Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to super_simple_group_path(@group) } \n format.js { redirect_to formatted_super_simple_group_path(@group, :js) }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.js { render :action => \"new\", :layout=>false}\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bc07532f1f27eb69006d34b15668626a",
"score": "0.6242276",
"text": "def UpdateGroup params = {}\n \n APICall(path: 'groups.json',method: 'PUT',payload: params.to_json)\n \n end",
"title": ""
},
{
"docid": "cef4d0da8a669a411b2ff6b17bcf2c12",
"score": "0.622571",
"text": "def update\n @group = Group.find_by_param(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to(@group, :notice => 'Group was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "20d8c291ca9a1ccfc3e42ab1623153d2",
"score": "0.620377",
"text": "def update\n if @group.update_attributes(params[:group])\n respond_with(@group, only: [:id, :name, :creator_id, :admin_id])\n else\n render_error(404, request.path, 20103, \"Failed to update group info\")\n end\n end",
"title": ""
},
{
"docid": "aa48549b5ae0bd9b5a73c44ae5ae34ae",
"score": "0.61669445",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, :notice => 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9a334853f55e82644fe4be5be92f1c33",
"score": "0.61604124",
"text": "def update\n @attribute_group = AttributeGroup.find(params[:id])\n\n respond_to do |format|\n if @attribute_group.update_attributes(params[:attribute_group])\n format.html { redirect_to(@attribute_group, :notice => 'Attribute group was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @attribute_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e454534589658a72f7422f962591a374",
"score": "0.61602664",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, :notice => 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9a36b92f3b5024d240f07f385ad8d3d",
"score": "0.6145182",
"text": "def update\n @outgoing_sms_content_group = OutgoingSmsContentGroup.find(params[:id])\n\n respond_to do |format|\n if @outgoing_sms_content_group.update_attributes(params[:outgoing_sms_content_group])\n flash[:notice] = 'OutgoingSmsContentGroup was successfully updated.'\n format.html { redirect_to(@outgoing_sms_content_group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @outgoing_sms_content_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74d052b45c99ef64de0ff3f82fb84189",
"score": "0.6135193",
"text": "def add_contacts_to_group_with_http_info(group_id, update_group_contacts, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: GroupControllerApi.add_contacts_to_group ...'\n end\n # verify the required parameter 'group_id' is set\n if @api_client.config.client_side_validation && group_id.nil?\n fail ArgumentError, \"Missing the required parameter 'group_id' when calling GroupControllerApi.add_contacts_to_group\"\n end\n # verify the required parameter 'update_group_contacts' is set\n if @api_client.config.client_side_validation && update_group_contacts.nil?\n fail ArgumentError, \"Missing the required parameter 'update_group_contacts' when calling GroupControllerApi.add_contacts_to_group\"\n end\n # resource path\n local_var_path = '/groups/{groupId}/contacts'.sub('{' + 'groupId' + '}', CGI.escape(group_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(update_group_contacts) \n\n # return_type\n return_type = opts[:return_type] || 'GroupContactsDto' \n\n # auth_names\n auth_names = opts[:auth_names] || ['API_KEY']\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(:PUT, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GroupControllerApi#add_contacts_to_group\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "3a4f7c99f0d260872f438a86644be13b",
"score": "0.6131242",
"text": "def update\n @group.update(group_params)\n respond_with(@group)\n end",
"title": ""
},
{
"docid": "e4e41766d2c601b5ad23c7e5eae451bf",
"score": "0.6121713",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e4e41766d2c601b5ad23c7e5eae451bf",
"score": "0.6121713",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.61172426",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.61172426",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6af817eeb64ce563c0448971bb779cf4",
"score": "0.61172426",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9467665c2e7d49fc00c1984ae4f4a3f6",
"score": "0.61060697",
"text": "def update\n respond_to do |format|\n if @group.update_attributes(params[:group])\n @group.invite params[:invite_emails].split(',')\n\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "492504365d8947351187a99d823eb722",
"score": "0.60931754",
"text": "def update\n @user_group = UserGroup.find(params[:id])\n\n respond_to do |format|\n if @user_group.update_attributes(params[:user_group])\n flash[:notice] = \"User group <em>#{@user_group.name}</em> updated.\"\n format.html { redirect_to(@user_group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d7a9a31d50e629d5346a23ca1ce2529e",
"score": "0.60782444",
"text": "def update\n respond_to do |format|\n if @api_v1_group_update.update(api_v1_group_update_params)\n format.html { redirect_to @api_v1_group_update, notice: 'Group update was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_group_update }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_group_update.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "53c4cd637a5675ba26fede978abb2449",
"score": "0.6071853",
"text": "def update\n @contact = @current_affiliate_group.contacts.find(params[:id])\n\n respond_to do |format|\n if @contact.update_attributes(params[:contact])\n flash[:notice] = 'Contact was successfully updated.'\n format.html { redirect_to(@contact) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @contact.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c27c47b079ab040c8d75580e9b3a9970",
"score": "0.6058454",
"text": "def update #:nodoc:\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = I18n.t(\"{{value}} was successfully updated.\", :default => \"{{value}} was successfully updated.\", :value => I18n.t(\"Group\", :default => \"Group\"))\n format.html { redirect_to groups_url }\n # format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n # format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9930f381ec3917ccff82b3c2d52e0aab",
"score": "0.6057994",
"text": "def remove_contacts_from_group_with_http_info(group_id, update_group_contacts, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: GroupControllerApi.remove_contacts_from_group ...'\n end\n # verify the required parameter 'group_id' is set\n if @api_client.config.client_side_validation && group_id.nil?\n fail ArgumentError, \"Missing the required parameter 'group_id' when calling GroupControllerApi.remove_contacts_from_group\"\n end\n # verify the required parameter 'update_group_contacts' is set\n if @api_client.config.client_side_validation && update_group_contacts.nil?\n fail ArgumentError, \"Missing the required parameter 'update_group_contacts' when calling GroupControllerApi.remove_contacts_from_group\"\n end\n # resource path\n local_var_path = '/groups/{groupId}/contacts'.sub('{' + 'groupId' + '}', CGI.escape(group_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(update_group_contacts) \n\n # return_type\n return_type = opts[:return_type] || 'GroupContactsDto' \n\n # auth_names\n auth_names = opts[:auth_names] || ['API_KEY']\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(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GroupControllerApi#remove_contacts_from_group\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "687f82aecff29c643dec2fbac8e7b6d3",
"score": "0.605747",
"text": "def update\n\n if @group.update(group_params)\n head :no_content\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "97907e90e4a388cb7cb2cc7a9339eda3",
"score": "0.6053542",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n invite_members\n format.html { redirect_to @group, notice: t('flash.notice.groups.successfully_updated') }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "efd6acfa2cc5b8e9667130778bbab76b",
"score": "0.60441756",
"text": "def update\n group = Group.find(params[:id])\n if group.update(group_params)\n render json: group\n else\n render json: group.errors.full_messages, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "dfb23f74024c23b2d9ba3bf6856790e5",
"score": "0.6039331",
"text": "def update\n @objectgrouptoobjectgroup = Objectgrouptoobjectgroup.find(params[:id])\n\n respond_to do |format|\n if @objectgrouptoobjectgroup.update_attributes(params[:objectgrouptoobjectgroup])\n flash[:notice] = 'Objectgrouptoobjectgroup was successfully updated.'\n format.html { redirect_to(@objectgrouptoobjectgroup) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @objectgrouptoobjectgroup.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3ba8ac662a5d8dbab1a013c2e4b7df09",
"score": "0.60300756",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = t('flash.notice.group_update') # 'Group was successfully updated.'\n format.any(:html,:iphone) { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.any(:html,:iphone) { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fc407815ab59eed51fe689240c787d7",
"score": "0.6028124",
"text": "def update\n @agent_group = AgentGroup.find(params[:id])\n\n respond_to do |format|\n if @agent_group.update_attributes(params[:agent_group])\n format.html { redirect_to @agent_group, notice: 'Agent group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @agent_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5df7caf410d2ffb5db6eae7280724e04",
"score": "0.60275733",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to params[:back_to], notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d2e8c7e82648d1d15289dd933d9f4cb",
"score": "0.6025356",
"text": "def addGroupToServer(group)\n path = \"/user/\" + @@conf[\"username\"] + \"/group/\" + group.strip\n res = HttpRequest.new(:put, path).send(@@host)\n puts res\n puts \"CODE: \" + res.code\n\nend",
"title": ""
},
{
"docid": "ab31e76bdefd018da575c992da68a1f9",
"score": "0.60225946",
"text": "def update_contacts(contacts)\n b = Builder::XmlMarkup.new\n request_xml = b.Contacts {\n contacts.each do | contact |\n contact.to_xml(b)\n end\n }\n\n response_xml = http_post(@client, \"#{@xero_url}/Contacts\", request_xml, {})\n\n response = parse_response(response_xml, {:request_xml => request_xml}, {:request_signature => 'POST/contacts'})\n response.contacts.each_with_index do | response_contact, index |\n contacts[index].contact_id = response_contact.contact_id if response_contact && response_contact.contact_id\n end\n response\n end",
"title": ""
},
{
"docid": "331c502dcb323628a68d70f1ad2f448d",
"score": "0.6018673",
"text": "def update\n @group.name = params['name']\n @group.save\n respond_to do |format|\n format.json { render :show, status: :ok, location: @group }\n end\n end",
"title": ""
},
{
"docid": "997ddc35e9a7f5606b5e678e503faaed",
"score": "0.6008373",
"text": "def update_group\n if @ok\n @mailing_list_group.name = params[:name]\n @ok = @mailing_list_group.save\n @mailing_list_group = MailingListGroup.find @mailing_list_group_id if !@ok\n end\n end",
"title": ""
},
{
"docid": "8937194ffef8886922cd228b4e324703",
"score": "0.5998884",
"text": "def put(obj, which=:groups)\n path = \"/#{which}\"\n path += \"/#{obj['ID']}\" unless obj['ID'].nil? \n resp = self.class.post(path, { :body => obj })\n check_errors resp\n res = resp.parsed_response['Response']['Entry']\n rebuild_groups! res\n res\n end",
"title": ""
},
{
"docid": "7d0d5d255fb021da7ffd613e1e6c9a8c",
"score": "0.599003",
"text": "def update\n @esol_group = EsolGroup.find(params[:id])\n\n respond_to do |format|\n if @esol_group.update_attributes(params[:esol_group])\n format.html { redirect_to @esol_group, notice: 'Esol group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @esol_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b0723199b4a4e58cf934a5beb136c686",
"score": "0.59823465",
"text": "def update\n @outgoing_sms_number_group = OutgoingSmsNumberGroup.find(params[:id])\n\n respond_to do |format|\n if @outgoing_sms_number_group.update_attributes(params[:outgoing_sms_number_group])\n flash[:notice] = 'OutgoingSmsNumberGroup was successfully updated.'\n format.html { redirect_to(@outgoing_sms_number_group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @outgoing_sms_number_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6e5fe6f1cec1f69a97a9aad69838e05b",
"score": "0.5976434",
"text": "def update\n pars = contact_params\n pars[:uid] = current_user.id\n\n group_ids = []\n unless pars[:contact_group_attributes].nil?\n pars[:contact_group_attributes].each do |group|\n group_ids << BSON::ObjectId.from_string(group[:_id])\n end\n end\n pars.delete(:contact_group_attributes)\n\n if group_ids.blank?\n @contact.unset(:contact_group_ids)\n else\n @contact.set(contact_group_ids: group_ids)\n end\n\n respond_to do |format|\n begin\n if @contact.update(pars)\n expire_fragment contact_url(@contact)\n if pars[:contact_profile_attributes][:last_name] != @contact.contact_profile[:last_name] or\n pars[:contact_profile_attributes][:first_name] != @contact.contact_profile[:first_name]\n Cashier.expire \"contacts-filter-#{current_user.id}\"\n end\n\n format.html { redirect_to @contact, notice: 'Contact was successfully updated.' }\n format.json { render :show, status: :ok, location: @contact }\n else\n create_profile\n format.html { render :edit }\n format.json { render json: @contact.errors, status: :unprocessable_entity }\n end\n rescue Mongo::Error::OperationFailure => exception\n create_profile\n contact = duplicate_contact\n error = (t 'mongoid.errors.contact.duplicate_val')\n .gsub('%phone%', \"#{contact_params[:prefix]} #{contact_params[:mobile]}\")\n @contact.errors[t 'mongoid.errors.contact.duplicate_key'] =\n \"#{error} <a href=\\\"#{contact_path contact}\\\">#{t 'view_contact'}</a>\"\n\n format.html { render :edit }\n format.json { render json: @contact.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0e6eb868110eef67f0771c367fc2e0c7",
"score": "0.5975064",
"text": "def update\n respond_to do |format|\n if @request_group.update(request_group_params)\n format.html { redirect_to @request_group, \n\t\t\t\t\t\t\t\t\t\t\tnotice: 'Request group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @request_group.errors, \n\t\t\t\t\t\t\t\t\t\t\tstatus: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c6facc6950b697ff32787ad8215e5c85",
"score": "0.5967256",
"text": "def update\n @group = WorkGroup.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e673c7ca555a76c6bb35277c67d1787f",
"score": "0.5952584",
"text": "def create\n @contact_group = ContactGroup.new(params[:contact_group])\n contacts = params[:contacts]\n respond_to do |format|\n if @contact_group.save\n \tunless contacts.blank?\n contacts.each do |contact|\n @contact_group.contact_lists << ContactList.find(contact)\n end\n end\n flash[:notice] = \"#{@contact_group.name} was successfully created.\"\n format.html { redirect_to(admin_contact_groups_url) }\n format.xml { render :xml => @contact_group, :status => :created, :location => @contact_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @contact_group.errors, :status => :unprocessable_entity }\n end\n end\n \n end",
"title": ""
},
{
"docid": "7efb29462de4352f12e118aa3b556dd1",
"score": "0.59503436",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n# format.json { head :no_content }\nformat.json { render :json=>{'statusCode'=>'200','message'=>'Edit Group Success!','navTableId'=>'','rel'=>'','callbackType'=>'','forwardUrl'=>'','confirmMsg'=>''} }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e61acd3a18cd1ef18c454863093b995",
"score": "0.5950317",
"text": "def update_nodegroup(nodegroup_json, nodegroup_id)\n nodemgr_rest_call(\"POST\", \"classifier\", \"groups\", $credentials, id=nodegroup_id, nodegroup_json)\nend",
"title": ""
},
{
"docid": "56f01b7f63d4f24b71b4469da164a226",
"score": "0.5948485",
"text": "def update\n @group = Group.find(params[:id])\n @users = @group.users\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to edit_user_registration_path, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e3c8351067f9df1b17bdee599c5f7acf",
"score": "0.5946705",
"text": "def update\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to((current_user and current_user.is_site_admin? and current_user != @group.users.owners.first) ? by_user_groups_path(:user_id => @group.users.owners.first.id) : groups_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a7940931c5d013698bb5e1be3b343cd4",
"score": "0.5945338",
"text": "def update\n @group = Group.find(params[:id])\n @group.name = params[:group][:name]\n @group.set_members(params[:member])\n\n if @group.save\n redirect_to root_path\n else\n render 'edit'\n end\n end",
"title": ""
},
{
"docid": "e8607f4663705025e7915a4d086bda48",
"score": "0.59439033",
"text": "def create\n @contact_group = Admin::ContactGroup.new(contact_group_params)\n\n if @contact_group.save\n render json: @contact_group, status: :created\n else\n render json: @contact_group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e3ca6c4316568f27b3fb374f0eefe995",
"score": "0.5934775",
"text": "def destroy\n @contact_group = ContactGroup.find(params[:id])\n @contact_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_contact_groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "403ef09a0c93f4e7b9a9ded2cbd785ab",
"score": "0.5931846",
"text": "def update\n @field_group = FieldGroup.find(params[:id])\n @field_group.update_attributes(field_group_params)\n\n respond_with(@field_group)\n end",
"title": ""
},
{
"docid": "4e18d57222942568ffc5cd2747732ea0",
"score": "0.5928979",
"text": "def update\n @competence_group = CompetenceGroup.find(params[:id])\n\n respond_to do |format|\n if @competence_group.update_attributes(cg_params)\n flash[:notice] = t('competencegroup_updated_success') \n format.html { redirect_to(@competence_group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @competence_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "704a6fd08d16afc04b860456050b3277",
"score": "0.59220785",
"text": "def update\n\n respond_to do |format|\n if @group.update_attributes(group_params)\n format.html { redirect_to @group.becomes(Group), notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "81d7a808dd141c11aa757805c84b1e3d",
"score": "0.5917868",
"text": "def destroy\n @contact_group = ContactGroup.find(params[:id])\n @contact_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(contact_groups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e77b6f1c4ad735596c63ad63deab2ade",
"score": "0.5902526",
"text": "def update\n if request.post?\n if @group.update_attributes(params[:group])\n redirect_to :action => 'list'\n else\n render :action => 'rename'\n end\n end\n end",
"title": ""
},
{
"docid": "b5a77dc26f23c7eae0be3c598be515f2",
"score": "0.59001154",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.json { head :no_content }\n else\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "476fde05efb4ca9063e7496d25851120",
"score": "0.5897722",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Le groupe a été modifié.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dc20af0bfc0c3ef724f40f35c0fc6add",
"score": "0.58905303",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:success] = \"Группа успешно отредактирована.\"\n format.html { redirect_to @group }\n format.json { head :no_content }\n else\n flash.now[:error] = \"Введены некорректные данные!\"\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "375d240b286f8bcc3a3d4d1fb9d20c65",
"score": "0.58842766",
"text": "def update\n respond_to do |format|\n if @collection_group.update(collection_group_params)\n format.html { redirect_to @collection_group, notice: 'Collection group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @collection_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "965c72f7d45112a9c186ba448c376652",
"score": "0.58817536",
"text": "def update\n @group = Course.groups.new(group_params)\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93ab4c7639d0a44788005f79739f649d",
"score": "0.5880293",
"text": "def update\n @group = Group.find(params[:id])\n params[:group][:member_ids] = (params[:group][:member_ids] << @group.member_ids).flatten\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to root_path }\n format.js\n # format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n # format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "92029dd12965edb5bbe7cf3d44644f24",
"score": "0.5876005",
"text": "def update\n\t\tparams[:group][:member_ids] = (params[:group][:member_ids] << @group.member_ids).flatten\n\t\t#special method update_attribute only updates explicitly stated attribute\n\t\tif @group.update_attributes(params[:group])\n\t\t\tredirect_to @group\n\t\t\tflash[:success] = \"group updated\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "eaf1f18c3ffe1416b2a634038b0fb28d",
"score": "0.58613235",
"text": "def update\n @group = Group.find(params[:id])\n authorize @group, :update?\n respond_to do |format|\n if @group.update_attributes(permitted_params)\n format.html { redirect_to(@group, :notice => 'Group was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa582358bdc3c3330cf49a2b8c8800bb",
"score": "0.58610725",
"text": "def update\n respond_to do |format|\n if @group.update(params[:group])\n format.html { redirect_to [@hub, @group], :notice => 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e6509863666f26355d977302dc7f4553",
"score": "0.5858974",
"text": "def update\n @lab_group = LabGroup.find(params[:id])\n\n respond_to do |format|\n if @lab_group.update_attributes(params[:lab_group])\n flash[:notice] = 'LabGroup was successfully updated.'\n format.html { redirect_to(@lab_group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @lab_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "237eeb97a8880ac43e4178e0f1bfe343",
"score": "0.58546036",
"text": "def update\n respond_to do |format|\n if @api_v1_group_field.update(api_v1_group_field_params)\n format.html { redirect_to @api_v1_group_field, notice: 'Group field was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_group_field }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_group_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cc989f0e2dc889411e8742a9810917d",
"score": "0.58540875",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cc989f0e2dc889411e8742a9810917d",
"score": "0.58540875",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cc989f0e2dc889411e8742a9810917d",
"score": "0.58540875",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6cc989f0e2dc889411e8742a9810917d",
"score": "0.58540875",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "faa5bff02b1e73e9ebfbf6c240827f8e",
"score": "0.585246",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Группа обновлена!' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c44ee92f47f2d8ec82717a9887f8bc75",
"score": "0.58510846",
"text": "def update\r\n respond_to do |format|\r\n if @agroup.update(agroup_params)\r\n format.html { redirect_to @agroup, notice: 'Agroup 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: @agroup.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "2f1c0174a6727ff317b60ca1e199700e",
"score": "0.5848131",
"text": "def update\n @group = Group.find_by_guid(params[:id])\n respond_to do |format|\n if @group.update_attributes(update_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render json: @group }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5de927cec9341c607c432592dc3c038f",
"score": "0.5841647",
"text": "def update\n @user_group = UserGroup.find(params[:id])\n\n respond_to do |format|\n if @user_group.update_attributes(params[:user_group])\n format.html { redirect_to @user_group, notice: 'User group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64c6664c12fb77620f230cd8d3b10b00",
"score": "0.5833166",
"text": "def update\n @user_group = UserGroup.find(params[:id])\n\n respond_to do |format|\n if @user_group.update_attributes(params[:user_group])\n format.html { redirect_to @user_group, notice: 'User group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.5828344",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.5828344",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.5828344",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.5828344",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "711d7c6181dd37c4567f2d1ce60932ed",
"score": "0.5828344",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
fbc883f1288501a417ee99085f3b93fb
|
Update game state from input
|
[
{
"docid": "9c89f2f4b0e612b17b30af1c14b5734a",
"score": "0.6805901",
"text": "def update_game_state(action)\n case action\n when \"UP\"\n @game = rotate_clockwise(@game)\n merge_numbers\n push_numbers\n @game = rotate_counter_clockwise(@game)\n when \"DOWN\"\n @game = rotate_counter_clockwise(@game)\n merge_numbers\n push_numbers\n @game = rotate_clockwise(@game)\n when \"RIGHT\"\n merge_numbers\n push_numbers\n when \"LEFT\"\n @game = rotate_counter_clockwise(rotate_counter_clockwise(@game))\n merge_numbers\n push_numbers\n @game = rotate_counter_clockwise(rotate_counter_clockwise(@game))\n when \"QUIT\"\n puts action\n exit 0\n end\n spawn_number\n empty_tile_count = @game.select { |num| num == 0 }.count\n if empty_tile_count == 0\n print_game_state\n puts 'GAME OVER'\n exit 0\n end\n end",
"title": ""
}
] |
[
{
"docid": "10d6837fb88199a8b4f6cd8dbb19b4c5",
"score": "0.7539301",
"text": "def update\n case @state\n when MENU\n menu\n when GAME\n game_logic\n when SCORE\n score\n when SCOREBOARD\n scoreboard\n end\n end",
"title": ""
},
{
"docid": "e7461193d765c8075c95bd84f61e9c68",
"score": "0.71313137",
"text": "def play_game args\n args.state.played_game_previously = 1\n render_game args\n game_input args\n finished_level args\nend",
"title": ""
},
{
"docid": "5bf3342112468a2c834125c354d8c098",
"score": "0.71114135",
"text": "def update\n @time = Time.now.to_f\n @play.update if play?\n if win?\n if state_changed?\n @win.difficulty = @play.difficulty\n @win.announce!\n end\n if button_down? Gosu::KbSpace\n # Increase difficulty\n @play.add_snake!\n @play.start_level!\n end\n elsif fail?\n @fail.announce! if state_changed?\n # Restart same difficulty\n @play.start_level! if button_down? Gosu::KbSpace\n end\n @last_state = @play.state\n end",
"title": ""
},
{
"docid": "99bef6c12b7e0482b255fdaf5299ecc9",
"score": "0.7084967",
"text": "def update(options = {})\r\n puts current_game_state.to_s if options[:debug]\r\n current_game_state.update_trait if current_game_state\r\n current_game_state.update if current_game_state\r\n end",
"title": ""
},
{
"docid": "73da3dd0044cddaaf35900cc05dde4bb",
"score": "0.6969132",
"text": "def update_game_state(state)\n if draw?(state)\n raise 'in draw'\n state.phase = GameState::DRAW\n elsif win?(state)\n raise 'in win'\n state.phase = GameState::WIN\n else\n state.phase = GameState::IN_PROGRESS\n\n state.player_turn = if state.player_turn == GameState::PLAYER_ONE\n GameState::PLAYER_TWO\n else\n GameState::PLAYER_ONE\n end\n end\n end",
"title": ""
},
{
"docid": "b4876dc740509044afab13d80393af47",
"score": "0.6961978",
"text": "def update_game_state\n @game_state[:paddle_left_y] = @paddle_left.y\n @game_state[:paddle_right_y] = @paddle_right.y\n @game_state[:ball_x] = @ball.x\n @game_state[:ball_y] = @ball.y\n @game_state[:score_left] = @score_left\n @game_state[:score_right] = @score_right\n end",
"title": ""
},
{
"docid": "eb46c48951e7d48d81288e34afad06ff",
"score": "0.693408",
"text": "def input\r\n state.next_scene = :pause if inputs.keyboard.key_down.p\r\n # save\r\n if args.inputs.keyboard.key_down.t\r\n $gtk.save_state\r\n end\r\n # load\r\n if args.inputs.keyboard.key_down.r\r\n $gtk.load_state\r\n end\r\n end",
"title": ""
},
{
"docid": "c074e5fe7bb23529ef1eeb3224e6d51a",
"score": "0.69284093",
"text": "def handle_input\n case @game_state\n when :title, :game_over\n @input_manager.handle_down_init do\n reset_game\n @game_state = :game\n end\n when :game\n @input_manager.handle_held_left do\n @player.move_left\n end\n @input_manager.handle_held_right do\n @player.move_right\n end\n @input_manager.handle_held_down do\n @starfield.direction = 0\n end\n @input_manager.handle_down_space do\n @player.firing = true\n @player.fire_bullet\n end\n @input_manager.handle_up_space do\n @player.firing = false\n end\n @input_manager.handle_up_down do\n @starfield.direction = -1\n end\n end\n end",
"title": ""
},
{
"docid": "bca964c81121d79023ff63b6fa91aaf8",
"score": "0.69176835",
"text": "def update\n\n #Show level select if player has already cleared any levels\n if @state == :starting then\n if @profile_level > 0 then\n max_level = @profile_level < @end_level ? @profile_level + 1 : @end_level\n push_game_state(Level_Choice.new(:max_level => max_level))\n else\n @current_level, @state = 1, :idle\n end\n end\n\n #Show next level start screen\n if @state == :idle then\n push_game_state(Level_Intro.new(:level_number => @current_level))\n end\n\n #Start next level\n if @state == :screen_shown then\n push_game_state(PlayLevel.new(:file => sprintf(\"levels/Level_%03d.yml\", @current_level),\n :return_state => LevelShell,\n :callback => method(:next_level)))\n end\n\n #Arcade levels done --- show finish screen\n if @state == :finished then\n switch_game_state(ArcadeFinished)\n end\n\n end",
"title": ""
},
{
"docid": "169b98387d34ecf1955907c248190365",
"score": "0.68606937",
"text": "def update\n # Move game logic forward\n @game.update\n end",
"title": ""
},
{
"docid": "3dff33d69a0ddbac167097213890afbb",
"score": "0.685023",
"text": "def update\n # update choice sprite\n @choice.update\n # update skill window\n @skill_window.update\n # update item window\n @item_window.update\n # update hotkey assignment display if existing\n @hotkeys.update if @hotkeys != nil\n # move by 2 or 1 whether active in direction depending on @up_mode\n @choice.oy += (@up_mode ? (@active ? 2 : 1) : (@active ? -2 : -1))\n # set new @up_mode if necesseray depending on @up_mode\n @up_mode = (@up_mode ? (@choice.oy < 8) : (@choice.oy <= -8))\n # if select button pressed\n if $game_system.select_button && Input.trigger?(Input::Select)\n # play sound\n $game_system.se_play($data_system.cursor_se)\n # switch to next actor\n $BlizzABS.player.switch_leader\n # switch to next actor\n @skill_window.switch_actor\n # update HUD if existing\n @hud.update if @hud != nil\n # update hotkey assignment display if existing\n @hotkeys.update if @hotkeys != nil\n # if active\n elsif @active\n # set choice offset always to a number divisable with 2\n @choice.oy = @choice.oy / 2 * 2\n # update hotkey selection\n update_choice\n # if skill window is active\n elsif @skill_window.active\n # update skill selection\n update_skill\n # if item window is active\n elsif @item_window.active\n # update item selection\n update_item\n end\n end",
"title": ""
},
{
"docid": "6bbb892b8148ca3acb362b4b1e67d7ce",
"score": "0.6836999",
"text": "def update\n case @phase\n when 0 then update_command_choice\n when 1 then update_host_game\n when 2 then update_join_game\n when 3 then update_lobby\n end\n end",
"title": ""
},
{
"docid": "deff5294f8dab12e6747b5e90e85f9c1",
"score": "0.6795996",
"text": "def update_state\n state.update\n end",
"title": ""
},
{
"docid": "83ae66b64b57c24e94ca229b251e8ce2",
"score": "0.6783067",
"text": "def update\n\t\t@game.step!\n\tend",
"title": ""
},
{
"docid": "bb3a9890d83c740972df96925dc9ad7d",
"score": "0.67489755",
"text": "def update_game_state(player, position)\n @game_state[position] = player.to_sym\n check_for_winner\n @game_board.update @game_state\n end",
"title": ""
},
{
"docid": "ad3f36cdfcb8f3ce693449e4f546c0a2",
"score": "0.67304766",
"text": "def update\r\n @state.update\r\n end",
"title": ""
},
{
"docid": "99d70475561c5443de910034e850b8c6",
"score": "0.6725718",
"text": "def update\n # update choice sprite\n @choice.update\n # update skill window\n @skill_window.update\n # update item window\n @item_window.update\n # move by 2 or 1 whether active in direction depending on @up_mode\n @choice.oy += (@up_mode ? (@active ? 2 : 1) : (@active ? -2 : -1))\n # set new @up_mode if necesseray depending on @up_mode\n @up_mode = (@up_mode ? (@choice.oy < 8) : (@choice.oy <= -8))\n # if select button pressed\n if Input.trigger?(Input::Select)\n # switch to next actor\n @skill_window.switch_actor\n # if active\n elsif @active\n # set choice offset always to a number dividable with 2\n @choice.oy = @choice.oy / 2 * 2\n # update hotkey selection\n update_choice\n # if skill window is active\n elsif @skill_window.active\n # update skill selection\n update_skill\n # if item window is active\n elsif @item_window.active\n # update item selection\n update_item\n end\n end",
"title": ""
},
{
"docid": "99d70475561c5443de910034e850b8c6",
"score": "0.6725718",
"text": "def update\n # update choice sprite\n @choice.update\n # update skill window\n @skill_window.update\n # update item window\n @item_window.update\n # move by 2 or 1 whether active in direction depending on @up_mode\n @choice.oy += (@up_mode ? (@active ? 2 : 1) : (@active ? -2 : -1))\n # set new @up_mode if necesseray depending on @up_mode\n @up_mode = (@up_mode ? (@choice.oy < 8) : (@choice.oy <= -8))\n # if select button pressed\n if Input.trigger?(Input::Select)\n # switch to next actor\n @skill_window.switch_actor\n # if active\n elsif @active\n # set choice offset always to a number dividable with 2\n @choice.oy = @choice.oy / 2 * 2\n # update hotkey selection\n update_choice\n # if skill window is active\n elsif @skill_window.active\n # update skill selection\n update_skill\n # if item window is active\n elsif @item_window.active\n # update item selection\n update_item\n end\n end",
"title": ""
},
{
"docid": "43fb671a52082bd4d6921d12ce1a8c94",
"score": "0.667673",
"text": "def update\n @state.update\n end",
"title": ""
},
{
"docid": "66c453978b2837343dd46cf6210621e7",
"score": "0.66763437",
"text": "def update_state\n return (@running = false) if @state == 999\n\n case (@state / 100)\n when 0 # Menu\n return update_state_menu\n when 1 # Play\n return update_state_play\n when 2\n return update_state_win\n when 3\n return update_state_fail\n when 4\n return update_suspens\n end\n return false\n end",
"title": ""
},
{
"docid": "d91461bd3c8cbc3a689fde496399997a",
"score": "0.665328",
"text": "def update\n display_victory if @mode == :game_won\n display_game_end if @mode == :game_end\n end",
"title": ""
},
{
"docid": "bd73cc14324f234af2746e08ce5bb6ed",
"score": "0.6653131",
"text": "def update_state(action)\n \n @current_action = action\n @actor = action.actor if action.actor\n \n case action.type\n when :start_game\n # TODO change this by red config\n pais = (0...4).map() do |i|\n [\"m\", \"p\", \"s\"].map(){ |t| (1..9).map(){ |n| Pai.new(t, n, n == 5 && i == 0) } } +\n (1..7).map(){ |n| Pai.new(\"t\", n) }\n end\n @all_pais = pais.flatten().sort()\n when :start_kyoku\n @bakaze = action.bakaze\n @kyoku_num = action.kyoku\n @honba = action.honba\n @oya = action.oya\n @chicha ||= @oya\n @dora_markers = [action.dora_marker]\n @num_pipais = @num_initial_pipais = @all_pais.size - 13 * 4 - 14\n @first_turn = true\n when :tsumo\n @num_pipais -= 1\n if @num_initial_pipais - @num_pipais > 4\n @first_turn = false\n end\n when :chi, :pon, :daiminkan, :kakan, :ankan\n @first_turn = false\n when :dora\n @dora_markers.push(action.dora_marker)\n end\n \n for i in 0...4\n @players[i].update_state(action_in_view(action, i, false))\n end\n \n end",
"title": ""
},
{
"docid": "05326e9d8fff4b0f396f62f413d37a04",
"score": "0.664316",
"text": "def update_from_game_state\n @paddle_left.y = @game_state[:paddle_left_y]\n @paddle_right.y = @game_state[:paddle_right_y]\n @ball.x = @game_state[:ball_x]\n @ball.y = @game_state[:ball_y]\n @score_left = @game_state[:score_left]\n @score_right = @game_state[:score_right]\n end",
"title": ""
},
{
"docid": "175f02d417bfc7cfb715d591206af6eb",
"score": "0.6639605",
"text": "def update(args)\n # --- State Machine :\n #@last_state = @machine.update(args)\n @machine.update(args)\n\n\n # --- Horizontal movement :\n #@dx = 0\n #case @machine.current_state\n #when :walking, :running, :jumping_up, :jumping_down\n # if args.inputs.keyboard.key_held.right then\n # @facing_right = true\n # @dx = 1\n # elsif args.inputs.keyboard.key_held.left then\n # @facing_right = false\n # @dx = -1\n # end\n\n #when :hit\n # @recovery_timer -= 1\n # @dx = @facing_right ? -PUSH_BACK_SPEED : PUSH_BACK_SPEED\n\n #end\n case @machine.current_state\n when :hit\n @recovery_timer -= 1\n @dx = @facing_right ? -PUSH_BACK_SPEED : PUSH_BACK_SPEED\n\n when :swing_sword, :swing_axe\n @dx = 0\n\n when :shifting, :dying\n @dx = 0\n\n @character_animation.update\n @weapon_animation.update\n\n return\n\n when :shoot\n @dx = RECOIL\n\n else\n @dx = RUNNING_SPEED\n\n end\n\n\n # --- Vertical movement :\n @dy += GRAVITY\n\n\n # --- Door collisions :\n if hit_box.intersect_rect? args.state.door.hit_box(args.state.ground.position) then\n if args.inputs.keyboard.key_held.up || args.inputs.controller_one.key_held.up then\n @machine.set_current_state :shifting\n end\n end\n\n\n # --- Enemies collisions :\n was_hit = false\n args.state.monsters.each do |monster|\n unless [ :dying, :dead ].include? monster.current_state then\n was_hit = true if hit_box.intersect_rect? monster.hit_box(args.state.ground.position)\n\n monster.limbs.each do |limb|\n was_hit = true if hit_box.intersect_rect? limb.hit_box(monster,args.state.ground.position)\n end\n end\n\n break if was_hit\n end\n\n if was_hit then\n @health -= 1 if @machine.current_state != :hit\n @machine.set_current_state :hit\n @recovery_timer = RECOVERY_TIME\n end\n\n\n # --- Props collisions :\n args.state.props.each do |prop|\n if hit_box.intersect_rect? prop.hit_box(args.state.ground.position) then\n prop.use\n instance_exec nil, &prop.action\n\n args.outputs.sounds << 'sounds/hotdog2.wav' if prop.type == :hotdog\n end\n end\n\n\n #--- Ground collisions :\n bottom_left_new_position = [ @x - ( @width >> 1 ) + @dx, @y + @dy ]\n bottom_right_new_position = [ @x + ( @width >> 1 ) + @dx, @y + @dy ]\n\n tiles_offset = ( args.state.ground.position + @x ).div 8\n center_tile_index = ( @x % 8 ) + tiles_offset\n collision_range = ( center_tile_index - GROUND_COLLISION_WIDTH )..( center_tile_index + GROUND_COLLISION_WIDTH )\n collision_range.map do |x|\n ground_box_x = x * 8 - args.state.ground.position\n ground_box_y = args.state.ground.collision_tiles[x % args.state.ground.collision_tiles.length] * 8\n ground_box = [ ground_box_x,\n ground_box_y,\n 8,\n 8 ]\n\n Debug::draw_box ground_box, [ 255, 0, 255, 255 ] if args.state.debug_mode == 1\n\n # Checking collisions for the bottom left corner :\n @dx = ground_box_x + 8 - ( @x - ( @width >> 1 ) - 1) if point_in_rect( [ @x - ( @width >> 1 ) + @dx, @y + 1 ], ground_box )\n @dy = ground_box_y + 8 - @y if point_in_rect( [ @x - ( @width >> 1 ), @y + @dy ], ground_box )\n\n # Checking collisions for the bottom right corner :\n @dx = ground_box_x - ( @x + ( @width >> 1 ) + 1 ) if point_in_rect( [ @x + ( @width >> 1 ) + @dx, @y + 1 ], ground_box )\n @dy = ground_box_y + 8 - @y if point_in_rect( [ @x + ( @width >> 1 ), @y + @dy ], ground_box )\n end\n\n\n #### DIRTY HACK !!! ###\n if @machine.current_state == :running then\n if @dx == 0 then\n if @was_running == true\n @character_animation.set_clip :idle\n @weapon_animation.set_clip :idle\n @weapon_animation.path = @weapons[@current_weapon][:path]\n @was_running = false\n end\n else\n if @was_running == false\n @character_animation.set_clip :run\n @weapon_animation.set_clip :run\n @weapon_animation.path = @weapons[@current_weapon][:path]\n @was_running = true\n end\n end\n end\n\n\n # --- Weapons collisions :\n if [ :swing_sword, :swing_axe ].include? @machine.current_state then\n collision_index = @weapon_animation.frame_index\n weapon_collision = @weapons[@current_weapon][:collisions][collision_index]\n unless weapon_collision[0].nil? then\n weapon_hit_box_x = weapon_collision[0] - ( weapon_collision[2] >> 1 ) + @x + @animation_offset[@facing_right][0]\n weapon_hit_box_y = weapon_collision[1] - ( weapon_collision[2] >> 1 ) + @y\n weapon_hit_box_size = weapon_collision[2]\n weapon_hit_box = [ weapon_hit_box_x, weapon_hit_box_y, weapon_hit_box_size, weapon_hit_box_size ]\n \n Debug::draw_box weapon_hit_box, [ 255, 0, 0, 255 ] if args.state.debug_mode == 1\n\n args.state.monsters.each do |monster|\n unless [:hit, :dying, :dead].include? monster.current_state then\n if weapon_hit_box.intersect_rect? monster.hit_box(args.state.ground.position) then\n monster.current_state = :hit \n monster.hit @weapons[@current_weapon][:damage]\n args.outputs.sounds << 'sounds/monster_hit3_shorter.wav'\n end\n end\n end\n end\n\n elsif @machine.current_state == :shoot && @done_shooting == false then\n bullet_x = 2 \n while bullet_x <= 8 do\n # Testing monsters first... :\n bullet_hit_box = [ bullet_x * 8, @y, 8, 12 ]\n args.state.monsters.each do |monster|\n if bullet_hit_box.intersect_rect? monster.hit_box(args.state.ground.position) then\n monster.current_state = :stun\n args.state.effects << Effect::player_bullet_impact( monster.x - ( monster.width >> 1 ), @y )\n @done_shooting = true\n break\n end\n end\n\n break if @done_shooting\n\n # ... then testing tiles :\n tile_x = args.state.ground.position.div(8) + bullet_x\n tile_y = args.state.ground.collision_tiles[tile_x % args.state.ground.collision_tiles.length]\n\n if @y == tile_y * 8 then\n args.state.effects << Effect::player_bullet_impact( bullet_x * 8 + args.state.ground.position - ( args.state.ground.position % 8 ), tile_y * 8 )\n @done_shooting = true\n break\n end\n\n bullet_x += 1\n end\n\n else\n @done_shooting = false if @machine.current_state != :shoot\n\n end\n\n\n # --- Updates :\n @y += @dy\n \n @character_animation.update\n @weapon_animation.update\n end",
"title": ""
},
{
"docid": "86b3c51f03c60844b9150ff8826846d9",
"score": "0.66300374",
"text": "def update_current_game\n set_current_game @current_game\n end",
"title": ""
},
{
"docid": "fbfa4651f6a2a5e1d56a266c79f6c51a",
"score": "0.659358",
"text": "def update_()\n @state[:left] = @gosu.button_down?(Gosu::KbLeft)\n @state[:right] = @gosu.button_down?(Gosu::KbRight)\n @state[:up] = @gosu.button_down?(Gosu::KbUp)\n @state[:down] = @gosu.button_down?(Gosu::KbDown)\n @state[:space] = @gosu.button_down?(Gosu::KbSpace)\n @state[:enter] = @gosu.button_down?(Gosu::KbEnter)\n end",
"title": ""
},
{
"docid": "6583fb908289969fc154bfd5b374477f",
"score": "0.6554766",
"text": "def update\n # only run game when gameState == 1, else its menu pages\n if @gameState == 1\n # detect it rotating\n rotating = 0\n rotating -= 1 if Gosu.button_down? Gosu::KB_LEFT\n rotating += 1 if Gosu.button_down? Gosu::KB_RIGHT\n\n #detect if rockets are used\n if Gosu.button_down? Gosu::KB_UP \n player_rocket(@ute)\n imageState = 0 # set image for rocket\n else\n @ute.rocketSound.stop\n imageState = 1 # set image for floating\n end\n \n # if fuel and reset are true, then go back to main menu\n # else reset back to position\n # 150 gives the game some time to wait so user can read, this can be shorted or extended \n if @ute.reset > 0\n @ute.reset += 1\n if @ute.fuel == 0 && @ute.reset == 150 \n store_result(@ute, @scoreBoard) \n @gameState = 0 # main menu\n elsif @ute.reset == 150\n @ute.reset = 0 \n reset_player(@ute, 400, 100, false)\n end \n end\n\n update_player(@ute, rotating, imageState)\n # Scrolling follows player\n @camera_x = [[@ute.x - WIDTH / 2, 0].max, @game_map.width * 50 - WIDTH].min\n @camera_y = [[@ute.y - HEIGHT / 2, 0].max, @game_map.height * 50 - HEIGHT].min\n end\n end",
"title": ""
},
{
"docid": "6402ed42dda0c652d76947f5c4240bb4",
"score": "0.65490806",
"text": "def update(input, player)\n # binding.pry\n @cells[input.to_i - 1] = player.token\n self.position(input)\n end",
"title": ""
},
{
"docid": "2d05c2ed86d7d546d36283b08e0d8794",
"score": "0.6542637",
"text": "def load_game_state(input)\n\n if (File.exist?(input))\n input = File.open(input).read\n end\n\n # get the six fields of the FEN code\n fields = input.split(' ')\n\n # set the board state\n board.set_data(fields[0])\n\n # set current player turn\n active_player = :white if fields[1] == \"w\"\n active_player = :black if fields[1] == \"b\"\n\n # TODO: add other game state variables ie castling possibility\n @castling = fields[2]\n\n end",
"title": ""
},
{
"docid": "aeef8d23ef67b3805221bf439db15aed",
"score": "0.65198535",
"text": "def update(input, player)\n # binding.pry\n input = input.to_i - 1\n self.cells[input] = player.token\n end",
"title": ""
},
{
"docid": "449f2f3612d184e4a6f5ef75ba490727",
"score": "0.65053046",
"text": "def tick\n handle_input\n\n case @game_state\n when :title\n render_title\n when :game\n if @player.health <= 0\n @game_state = :game_over\n else\n render\n end\n when :game_over\n render_game_over\n else\n exit(0)\n end\n end",
"title": ""
},
{
"docid": "4b84b5cff9a3a5b20b17292f7e1b8a52",
"score": "0.64796734",
"text": "def update\n # update fading\n Game.end_fade! if Gosu::milliseconds >= @@end_fade and Game.fading?\n\n #update changing between game states\n if @@change_game_state and not Game.fading?\n @@game_state = @@change_game_state\n @@change_game_state = nil\n Game.fade_on(FadingTime)\n end\n\n return unless defined? @@game_state.update\n @@game_state.update unless Game.fading?\n end",
"title": ""
},
{
"docid": "79fdaa6fdbc2ab4df969a3b9ad68ee11",
"score": "0.6474258",
"text": "def update\n if @game.input_check(params[:commit])\n return_notice = \"Your guess was incorrect...\"\n else\n return_notice = \"Your guess was correct!\"\n end\n\n if run_end_turn_checker\n @game.save\n return\n elsif @game.update(game_params)\n if @game.save\n redirect_to @game, notice: return_notice\n return\n else\n render :edit\n return\n end\n end\n end",
"title": ""
},
{
"docid": "244c86ffcb11e0b2f86f8bcf77ee398c",
"score": "0.6457163",
"text": "def update\n @game_on ? move_game(2) : start_game_if_space_pressed\n end",
"title": ""
},
{
"docid": "f04c152af473721d1b4ff8b89615e4b0",
"score": "0.63991773",
"text": "def update_host_game\n if @name_input_textbox.active\n @name_input_textbox.update\n if Input.trigger?(Input::DOWN) || @port_textbox.clicked_on?\n @port_textbox.active = true\n @name_input_textbox.active = false\n end\n else\n @port_textbox.update\n if Input.trigger?(Input::UP) || @name_input_textbox.clicked_on?\n @name_input_textbox.active = true\n @port_textbox.active = false\n end\n end\n \n if Input.trigger?(Input::Key['Enter'])\n @phase = 3\n @user_logger.visible = true\n @name_input_textbox.active = false\n @port_textbox.active = false\n \n @name_input_textbox.visible = false\n @name_input_label.visible = false\n @port_textbox.visible = false\n @port_label.visible = false\n end\n end",
"title": ""
},
{
"docid": "e8088e51231da6040c3a751df65455f2",
"score": "0.6398188",
"text": "def update(input, player)\n @cells[input.to_i - 1] = player.token\n end",
"title": ""
},
{
"docid": "678d46993f9d565c70f1ad75bca81624",
"score": "0.63904244",
"text": "def inputs_game_over(args)\n return unless args.inputs.mouse.click\n\n # start again\n defaults(args)\n args.state.status = :in_progress\nend",
"title": ""
},
{
"docid": "c9401a9471ccbec90273d8d18b56bd03",
"score": "0.6388563",
"text": "def intermediate_update\r\n #\r\n # Dispatch inputmap for main window\r\n #\r\n dispatch_input_for(self)\r\n \r\n #\r\n # Dispatch input for all input-clients handled by to main window (game objects with input created in main win)\r\n #\r\n @input_clients.each { |game_object| dispatch_input_for(game_object) unless game_object.paused? }\r\n \r\n \r\n #\r\n # Call update() on all game objects belonging to the main window.\r\n #\r\n @game_objects.update\r\n \r\n #\r\n # Call update() on all game objects belonging to the current game state.\r\n #\r\n\r\n #\r\n # Call update() on our game_state_manger\r\n # -> call update on active states\r\n # -> call update on all game objects in that state\r\n #\r\n @game_state_manager.update\r\n end",
"title": ""
},
{
"docid": "d7b56df416c6505bb32836172e2c9abd",
"score": "0.6385604",
"text": "def handle_event\n draw_game_state\n end",
"title": ""
},
{
"docid": "692af61d5a5e79cbc854510d7345488e",
"score": "0.63738716",
"text": "def update inputs, state\n\n # Clear any completed lines from the board. Done here so the user\n # gets a fleeting glimpse of the full lines!\n (0..BOARD_HEIGHT-1).each do |row|\n\n # Look for any spaces in the row\n spaces = false\n (0..BOARD_WIDTH-1).each do |column|\n if @board[row][column] == :none\n spaces = true\n end\n end\n\n # If we didn't find any, move everything above down\n if !spaces\n\n @score += 10\n @sound = \"clearline\"\n (row+1..BOARD_HEIGHT-1).each do |above|\n (0..BOARD_WIDTH-1).each do |column| \n @board[above-1][column] = @board[above][column]\n end\n end\n\n # And of course, blank the top row\n (0..BOARD_WIDTH-1).each do |column| \n @board[BOARD_HEIGHT-1][column] = :none\n end\n\n end\n end\n\n # Check for user input before anything\n if inputs.keyboard.key_down.up || inputs.keyboard.key_down.w\n if @current.rotate? true\n @sound = \"spin\"\n end\n end\n\n if inputs.keyboard.key_down.down || inputs.keyboard.key_down.s\n if @current.rotate? false\n @sound = \"spin\"\n end\n end\n\n if inputs.keyboard.key_down.left || inputs.keyboard.key_down.a\n if @current.shift? -1\n @sound = \"move\"\n end\n end\n\n if inputs.keyboard.key_down.right || inputs.keyboard.key_down.d\n if @current.shift? 1\n @sound = \"move\"\n end\n end\n\n if inputs.keyboard.key_down.space\n @sound = \"drop\"\n @current.dropping = true\n end\n\n # See if the piece is currently dropping\n if @current.dropping \n\n # Obviously it depends a bit on being able to\n if !@current.descend?\n\n # Then we've hit bottom. Time to copy this to the board,\n # and then spawn a new piece\n land\n\n end\n\n else\n\n # Then see if it's time for the current piece to drop another row\n if @level == MAX_LEVEL || state.tick_count % ( 50 - ( 3 * @level ) ) == 0\n\n # Obviously it depends a bit on being able to\n if !@current.descend?\n\n # Then we've hit bottom. Time to copy this to the board,\n # and then spawn a new piece\n land\n\n end\n\n end\n\n end\n\n end",
"title": ""
},
{
"docid": "614d8f3302f5c2f97d6c2df0f7b1b9c4",
"score": "0.6372764",
"text": "def update(input, player)\n @cells[input.to_i - 1] = player.token;\n end",
"title": ""
},
{
"docid": "07d12e29210cbf6bda9a6f611dedb9f9",
"score": "0.6359188",
"text": "def update\n respond_to do |format|\n if @gamestate.update(gamestate_params)\n @gamestate.turns += 1\n @gamestate.save\n format.html { redirect_to @gamestate, notice: 'Gamestate was successfully updated.' }\n format.json { render :show, status: :ok, location: @gamestate }\n else\n format.html { render :edit }\n format.json { render json: @gamestate.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c61eeb0472200967d77a287f7f36cfe",
"score": "0.63461614",
"text": "def update_choice\n # set x position\n @choice.x = 160 + @index * 32\n # if pressed B\n if Input.trigger?(Input::B)\n # play cancel sound\n $game_system.se_play($data_system.cancel_se)\n # create map scene\n $scene = Scene_Map.new\n # if C is pressed\n elsif Input.trigger?(Input::C)\n # play sound\n $game_system.se_play($data_system.decision_se)\n # not active\n @active = false\n # the one that was active the last time is now active\n @skill_window.active = @last_active\n @item_window.active = (!@last_active)\n # if RIGHT is being pressed\n elsif Input.repeat?(Input::RIGHT)\n # if RIGHT is pressed or index is less than 9\n if Input.trigger?(Input::RIGHT) || @index < 9\n # play sound\n $game_system.se_play($data_system.cursor_se)\n # set new index\n @index = (@index + 1) % 10\n end\n # if LEFT is being pressed\n elsif Input.repeat?(Input::LEFT)\n # if LEFT is pressed or index is equal or greater than 1\n if Input.trigger?(Input::LEFT) || @index >= 1\n # play sound\n $game_system.se_play($data_system.cursor_se)\n # set new index\n @index = (@index + 9) % 10\n end\n end\n end",
"title": ""
},
{
"docid": "3c61eeb0472200967d77a287f7f36cfe",
"score": "0.63461614",
"text": "def update_choice\n # set x position\n @choice.x = 160 + @index * 32\n # if pressed B\n if Input.trigger?(Input::B)\n # play cancel sound\n $game_system.se_play($data_system.cancel_se)\n # create map scene\n $scene = Scene_Map.new\n # if C is pressed\n elsif Input.trigger?(Input::C)\n # play sound\n $game_system.se_play($data_system.decision_se)\n # not active\n @active = false\n # the one that was active the last time is now active\n @skill_window.active = @last_active\n @item_window.active = (!@last_active)\n # if RIGHT is being pressed\n elsif Input.repeat?(Input::RIGHT)\n # if RIGHT is pressed or index is less than 9\n if Input.trigger?(Input::RIGHT) || @index < 9\n # play sound\n $game_system.se_play($data_system.cursor_se)\n # set new index\n @index = (@index + 1) % 10\n end\n # if LEFT is being pressed\n elsif Input.repeat?(Input::LEFT)\n # if LEFT is pressed or index is equal or greater than 1\n if Input.trigger?(Input::LEFT) || @index >= 1\n # play sound\n $game_system.se_play($data_system.cursor_se)\n # set new index\n @index = (@index + 9) % 10\n end\n end\n end",
"title": ""
},
{
"docid": "3c61eeb0472200967d77a287f7f36cfe",
"score": "0.63461614",
"text": "def update_choice\n # set x position\n @choice.x = 160 + @index * 32\n # if pressed B\n if Input.trigger?(Input::B)\n # play cancel sound\n $game_system.se_play($data_system.cancel_se)\n # create map scene\n $scene = Scene_Map.new\n # if C is pressed\n elsif Input.trigger?(Input::C)\n # play sound\n $game_system.se_play($data_system.decision_se)\n # not active\n @active = false\n # the one that was active the last time is now active\n @skill_window.active = @last_active\n @item_window.active = (!@last_active)\n # if RIGHT is being pressed\n elsif Input.repeat?(Input::RIGHT)\n # if RIGHT is pressed or index is less than 9\n if Input.trigger?(Input::RIGHT) || @index < 9\n # play sound\n $game_system.se_play($data_system.cursor_se)\n # set new index\n @index = (@index + 1) % 10\n end\n # if LEFT is being pressed\n elsif Input.repeat?(Input::LEFT)\n # if LEFT is pressed or index is equal or greater than 1\n if Input.trigger?(Input::LEFT) || @index >= 1\n # play sound\n $game_system.se_play($data_system.cursor_se)\n # set new index\n @index = (@index + 9) % 10\n end\n end\n end",
"title": ""
},
{
"docid": "1f10e8cad1233e1b91281656d9aed3e5",
"score": "0.63389134",
"text": "def update_game_state\n self.game_state = obfuscate(self.word)\n end",
"title": ""
},
{
"docid": "ce7f4fb125c0ded12748b7fd71e734a7",
"score": "0.6335479",
"text": "def input args\r\n\r\n if args.state.inputlist.length > 5\r\n args.state.inputlist.pop\r\n end\r\n\r\n if (args.inputs.keyboard.key_down.j || args.inputs.keyboard.key_down.k || args.inputs.keyboard.key_down.a || args.inputs.keyboard.key_down.d || args.inputs.keyboard.key_down.s || args.inputs.controller_one.key_down.left || args.inputs.controller_one.key_down.y || args.inputs.controller_one.key_down.x || args.inputs.controller_one.key_down.right || args.inputs.controller_one.key_down.down || (args.state.inputlist[0] == \"v>\" && !(args.inputs.keyboard.s || args.inputs.controller_one.down)))\r\n \r\n \r\n\r\n\r\n if (args.inputs.keyboard.key_down.j && args.inputs.keyboard.key_down.k) || (args.inputs.controller_one.key_down.x && args.inputs.controller_one.key_down.y)\r\n args.state.inputlist.unshift(\"jk\")\r\n elsif (args.inputs.keyboard.key_down.j || args.inputs.controller_one.key_down.x) && (args.state.inputlist[0] == \"v>*\") && ((args.state.tick_count - args.state.lastpush) <= 15)\r\n args.state.inputlist.unshift(\"v>j\")\r\n args.state.player.dx = 20\r\n args.state.player.dy = 10\r\n elsif (args.inputs.keyboard.key_down.k || args.inputs.controller_one.key_down.y) && (args.state.inputlist[0] == \"j\") && ((args.state.tick_count - args.state.lastpush) <= 15)\r\n args.state.inputlist.unshift(\"j+k\")\r\n args.state.player.dx = 20\r\n elsif (args.inputs.keyboard.key_down.j && args.inputs.keyboard.a) || (args.inputs.controller_one.key_down.x && args.inputs.controller_one.key_down.left)\r\n args.state.inputlist.unshift(\"<j\")\r\n elsif ( args.inputs.controller_one.key_down.x || args.inputs.keyboard.key_down.j)\r\n args.state.inputlist.unshift(\"j\")\r\n \r\n elsif (args.inputs.keyboard.key_down.k || args.inputs.controller_one.key_down.y) && (args.state.player.y > 128)\r\n args.state.inputlist.unshift(\"kair\")\r\n elsif (args.inputs.keyboard.key_down.k || args.inputs.controller_one.key_down.y)\r\n args.state.inputlist.unshift(\"k\")\r\n elsif (args.inputs.controller_one.key_down.left || args.inputs.keyboard.key_down.a) && (args.state.inputlist[0] == \"<\") && ((args.state.tick_count - args.state.lastpush) <= 10)\r\n args.state.inputlist.unshift(\"<<\")\r\n args.state.player.dx = -10\r\n \r\n elsif (args.inputs.controller_one.key_down.left || args.inputs.keyboard.key_down.a)\r\n args.state.inputlist.unshift(\"<\")\r\n args.state.timeleft = args.state.tick_count\r\n\r\n \r\n\r\n elsif (args.inputs.keyboard.d || args.inputs.controller_one.right) && !(args.inputs.keyboard.s || args.inputs.controller_one.down)&& (args.state.inputlist[0] == \"v>\") && ((args.state.tick_count - args.state.lastpush) <= 15)\r\n args.state.inputlist.unshift(\"v>*\")\r\n elsif (args.inputs.keyboard.key_down.d || args.inputs.controller_one.key_down.right) && (args.inputs.keyboard.s || args.inputs.controller_one.down) && (args.state.inputlist[0] == \"v\") && ((args.state.tick_count - args.state.lastpush) <= 15)\r\n args.state.inputlist.unshift(\"v>\")\r\n elsif (args.inputs.keyboard.key_down.s || args.inputs.controller_one.key_down.down)\r\n args.state.inputlist.unshift(\"v\")\r\n elsif (args.inputs.controller_one.key_down.right || args.inputs.keyboard.key_down.d)\r\n args.state.inputlist.unshift(\">\")\r\n \r\n end\r\n args.state.lastpush = args.state.tick_count\r\n end\r\n\r\n\r\n\r\n if args.inputs.keyboard.space || args.inputs.controller_one.r2 # if the user presses the space bar\r\n args.state.player.jumped_at ||= args.state.tick_count # jumped_at is set to current frame\r\n\r\n # if the time that has passed since the jump is less than the player's jump duration and\r\n # the player is not falling\r\n if args.state.player.jumped_at.elapsed_time < args.state.player_jump_power_duration && !args.state.player.falling\r\n args.state.player.dy = args.state.player_jump_power # change in y is set to power of player's jump\r\n end\r\n end\r\n\r\n # if the space bar is in the \"up\" state (or not being pressed down)\r\n if args.inputs.keyboard.key_up.space || args.inputs.controller_one.key_up.r2\r\n args.state.player.jumped_at = nil # jumped_at is empty\r\n args.state.player.falling = true # the player is falling\r\n end\r\n\r\n \r\n if args.inputs.left # if left key is pressed\r\n if args.state.player.dx < -3\r\n args.state.player.dx = args.state.player.dx\r\n else\r\n args.state.player.dx = -3\r\n end\r\n \r\n elsif args.inputs.right # if right key is pressed\r\n if args.state.player.dx > 3\r\n args.state.player.dx = args.state.player.dx\r\n else\r\n args.state.player.dx = 3\r\n end\r\n else\r\n args.state.player.dx *= args.state.player_speed_slowdown_rate # dx is scaled down\r\n \r\n \r\n \r\n end\r\n\r\n if ((args.state.player.dx).abs > 3) #&& ((args.state.tick_count - args.state.lastpush) <= 10)\r\n args.state.player.dx *= 0.95\r\n end\r\n \r\n\r\n \r\n\r\nend",
"title": ""
},
{
"docid": "b9ccd6c7e61f60601478867930ba55e4",
"score": "0.63339794",
"text": "def update\n\n # Converts state hash into state array\n box_objects = []\n params[:state].each do |state_obj|\n box_objects.push(state_obj.permit!.to_h)\n end\n\n serialized_state = YAML.dump(box_objects)\n\n # Updates some specific game parameters\n @game.state = serialized_state\n @game.mines_flagged = params[:game][:mines_flagged]\n @game.used_flags = params[:game][:used_flags]\n @game.time_ellapsed = params[:game][:time_ellapsed]\n\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "34510a39319704b27f90ef8e7cb17383",
"score": "0.6333695",
"text": "def update(user_input, player)\n @cells[user_input.to_i-1] = player.token\n end",
"title": ""
},
{
"docid": "346eb527f4158e3bdb720e78eb7502bf",
"score": "0.63264877",
"text": "def update!(**args)\n @state = args[:state] if args.key?(:state)\n end",
"title": ""
},
{
"docid": "346eb527f4158e3bdb720e78eb7502bf",
"score": "0.63264877",
"text": "def update!(**args)\n @state = args[:state] if args.key?(:state)\n end",
"title": ""
},
{
"docid": "346eb527f4158e3bdb720e78eb7502bf",
"score": "0.63264877",
"text": "def update!(**args)\n @state = args[:state] if args.key?(:state)\n end",
"title": ""
},
{
"docid": "346eb527f4158e3bdb720e78eb7502bf",
"score": "0.63264877",
"text": "def update!(**args)\n @state = args[:state] if args.key?(:state)\n end",
"title": ""
},
{
"docid": "47a7c5c1a296e8b08441a5f9d2f81b5d",
"score": "0.63260424",
"text": "def update_command\n # If B button was pressed\n if Input.trigger?(Input::B)\n # Play cancel SE\n $game_system.se_play($data_system.cancel_se)\n # Switch to map screen\n $scene = Scene_Map.new\n return\n end\n # If C button was pressed\n if Input.trigger?(Input::C)\n # If command other than save or end game, and party members = 0\n if $game_party.actors.size == 0 and @command_window.index < 4\n # Play buzzer SE\n $game_system.se_play($data_system.buzzer_se)\n return\n end\n # Branch by command window cursor position\n case @command_window.index\n when 0 # item\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to item screen\n $scene = Scene_Item.new\n when 1 # skill\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Make status window active\n @command_window.active = false\n @status_window.active = true\n @status_window.index = 0\n when 2 # equipment\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Make status window active\n @command_window.active = false\n @status_window.active = true\n @status_window.index = 0\n when 3 # status\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Make status window active\n @command_window.active = false\n @status_window.active = true\n @status_window.index = 0\n when 4 # save\n # If saving is forbidden\n if $game_system.save_disabled\n # Play buzzer SE\n $game_system.se_play($data_system.buzzer_se)\n return\n end\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to save screen\n $scene = Scene_Save.new\n when 5 # end game\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to end game screen\n $scene = Scene_End.new\n end\n return\n end\n end",
"title": ""
},
{
"docid": "74ea5095798e841df8557297d1db7fb5",
"score": "0.63260335",
"text": "def update(user_input, player_token)\n @cells[(user_input.to_i - 1)] = player_token.token\n end",
"title": ""
},
{
"docid": "3feff2bd3718b9e16624c302616978f8",
"score": "0.6320679",
"text": "def update_status\n # If B button was pressed\n if Input.trigger?(Input::B)\n # Play cancel SE\n $game_system.se_play($data_system.cancel_se)\n # Make command window active\n @command_window.active = true\n @status_window.active = false\n @status_window.index = -1\n return\n end\n # If C button was pressed\n if Input.trigger?(Input::C)\n # Branch by command window cursor position\n case @command_window.index\n when 1 # skill\n # If this actor's action limit is 2 or more\n if $game_party.actors[@status_window.index].restriction >= 2\n # Play buzzer SE\n $game_system.se_play($data_system.buzzer_se)\n return\n end\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to skill screen\n $scene = Scene_Skill.new(@status_window.index)\n when 2 # equipment\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to equipment screen\n $scene = Scene_Equip.new(@status_window.index)\n when 3 # status\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to status screen\n $scene = Scene_Status.new(@status_window.index)\n end\n return\n end\n end",
"title": ""
},
{
"docid": "05c93483f66f04beb59bcfc67be1fe95",
"score": "0.6316786",
"text": "def update(event, iGameState)\r\n game_values = $game_values\r\n fFound = false;\r\n -1.upto(3) do |iPlayer|\r\n \t\r\n #inputControl;\r\n #outputControl;\r\n iPlayerID = iPlayer;\r\n iDeviceID = DEVICE_KEYBOARD;\r\n \r\n #Allow keyboard input from player 1 at all times (even when he is configured to use joystick)\r\n if(iPlayer == -1)\r\n if(iGameState == 1 && inputControls[0].iDevice != DEVICE_KEYBOARD) \r\n inputControl = game_values.inputConfiguration[0][0].inputGameControls[1];\r\n outputControl = @outputControls[0];\r\n iPlayerID = 0;\r\n iDeviceID = game_values.inputConfiguration[0][0].iDevice;\r\n else\r\n next;\r\n end\r\n else\r\n inputControl = @inputControls[iPlayer].inputGameControls[iGameState];\r\n outputControl = @outputControls[iPlayer];\r\n iDeviceID = inputControls[iPlayerID].iDevice;\r\n end\r\n \t\t\r\n if iDeviceID == DEVICE_KEYBOARD\r\n if event.class == KeyDownEvent\r\n \t\t \r\n key = inputControl.keys.index(event.key)\r\n if key\r\n key = outputControl.keys[key]\r\n if(!key.fDown)\r\n key.fPressed = true \r\n end\r\n key.fDown = true\r\n end\r\n \t\t \r\n @iPressedKey = event.key\r\n end\r\n if event.class == KeyUpEvent\r\n key = inputControl.keys.index(event.key)\r\n if key\r\n key = outputControl.keys[key]\r\n key.fDown = false;\r\n end\r\n end\r\n else #use joy stick\r\n \t\t\r\n end\r\n \t\t\r\n end\r\n end",
"title": ""
},
{
"docid": "2b7b614cd810efb8bd3d56dc8fba5817",
"score": "0.63103175",
"text": "def update\n \tcase @scene\n \twhen :game\n update_game\n \twhen :end\n \t\tupdate_end\n \tend\n end",
"title": ""
},
{
"docid": "1022cd7c163cc9ee0f59c573df60ee57",
"score": "0.6303321",
"text": "def input(user_input)\n user_input = user_input.chomp\n case @state\n when :choosing_players\n choose_player(user_input)\n else\n play_user_turn(user_input)\n if (verdict = game_over?)\n draw_board\n if verdict == :draw\n @output << \"\\nIt's a draw!\\n\"\n else\n @output << \"\\nYou have won!\\n\"\n end\n return GameOver\n end\n\n play_computer_turn\n if (verdict = game_over?)\n draw_board\n if verdict == :draw\n @output << \"\\nIt's a draw!\\n\"\n else\n @output << \"\\nI have won!\\n\"\n end\n return GameOver\n end\n\n draw_board\n prompt_for_turn\n end\n end",
"title": ""
},
{
"docid": "4e3f3e2ff470933a40d5101745649da1",
"score": "0.62987334",
"text": "def update(input, player)\n cells[input.to_i - 1] = player.token\n end",
"title": ""
},
{
"docid": "6d478f206d0cf9b135c7f9251d3ad9f5",
"score": "0.6293871",
"text": "def update(input, player) # Player class object\n @cells[input_index(input)] = player.token\n end",
"title": ""
},
{
"docid": "f22ccc36d46293dd3e8d389acf243622",
"score": "0.62923753",
"text": "def update()\n\t\tprint 'Show number: '\n\t\tshow_number = $stdin.gets.chomp.to_i\n\t\treturn unless checked_show_number(show_number)\n\n\t\tprint 'New {s}eason, {e}pisode, show {n}ame or {f}inish (toggle) show: '\n\t\tupdate = $stdin.gets.chomp.downcase\n\t\treturn unless checked_update(update)\n\n\t\tshow_name = find_show_name(show_number)\n\n\t\tcase update\n\t\t\twhen 'season', 's'\n\t\t\t\tupdate_season(show_name)\n\n\t\t\twhen 'episode', 'e'\n\t\t\t\tupdate_episode(show_name)\n\n\t\t\twhen 'finish', 'f'\n\t\t\t\tfinish(show_name)\n\n\t\t\twhen 'name', 'n'\n\t\t\t\tupdate_name(show_name)\n\n\t\t\telse\n\t\t\t\tputs 'Try again!'\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0ebcbf9ed155c4bc7c11aa409e482ebf",
"score": "0.6290695",
"text": "def update_command_choice\n @command_choice.update\n if Input.trigger?(Input::C)\n case @command_choice.index\n when 0 # Host Game\n @phase = 1\n #system('run CServer.exe')\n @name_input_textbox.visible = true\n @name_input_label.visible = true\n @name_input_textbox.active = true\n @port_textbox.visible = true\n @port_label.visible = true\n when 1 # Join Game\n @phase = 2\n @name_input_textbox.visible = true\n @name_input_textbox.active = true\n @name_input_label.visible = true\n @ipaddress_textbox.visible = true\n @ipaddress_label.visible = true\n @port_textbox.visible = true\n @port_label.visible = true\n when 2\n $scene = Scene_Title.new\n end\n @command_choice.active = false\n @command_choice.visible = false\n elsif Input.trigger?(Input::B)\n $scene = Scene_Title.new\n end\n end",
"title": ""
},
{
"docid": "f06187a945d9616398d5929f5162cf09",
"score": "0.6290383",
"text": "def game_inputs\n @current_input = gets.strip.to_i\n end",
"title": ""
},
{
"docid": "eaa39df71d540d8e9dd45cefb4f57e9a",
"score": "0.628705",
"text": "def update\n\t\t@state.update\n\t\tclear_text_input_assign\n\tend",
"title": ""
},
{
"docid": "638ddba7fdb9f5602d65193e0511d681",
"score": "0.6276258",
"text": "def update\n\n # Get input from the player\n move_player(:up) if button_down?(Gosu::KbUp)\n move_player(:down) if button_down?(Gosu::KbDown)\n move_player(:left) if button_down?(Gosu::KbLeft)\n move_player(:right) if button_down?(Gosu::KbRight)\n\n # Update player and NPCs\n\n @player.update\n @exit.update\n\n # Check for player/room collisions \n # reduce points on collision with walls\n @rooms.each { |room|\n if room.collides_with_rect?(@player.Rect)\n @@points -= 1\n end\n }\n\n # Check for win condition\n # spawn a new level if you've found the exit point\n if @player.Rect.collides_with_rect?(@exit.Rect)\n generate_next_level\n end\n\n end",
"title": ""
},
{
"docid": "f86f852c27b776c0ccd9ca6812e296a1",
"score": "0.62615156",
"text": "def update_game_state\n king = get_kings.select { |k| k.colour == @turn }[0]\n\n case king.in_check?\n when true\n king_is_alone = @available_pieces.length == 0\n king_can_move = !all_kings_moves(king).empty?\n\n if king_can_move\n return\n elsif king_is_alone\n @checkmate = true\n return\n end\n\n attacker = get_attackers_of_position(king.position, @turn)\n\n unless attacker.length > 1\n attacker = attacker[0]\n return if attacker_can_be_captured_or_blocked?(attacker, king.position)\n end\n\n @checkmate = true\n\n when false\n @stalemate = true if all_kings_moves(king).empty? && all_valid_moves(king).empty?\n end\n end",
"title": ""
},
{
"docid": "08e2ca9d550df881f8c89f7a4e954a85",
"score": "0.62599605",
"text": "def handle_user_input(input)\n\t\t@player_move = nil\n\n\t\tif @@options[:exit].include? input\n\t\t\tputs \"Terminating game..\"\n\t\t\t@exit_game = true\n\n\t\telsif @@options[:new_game].include? input\n\t\t\tnew_game\n\n\t\telsif @@options[:moves].include? input.to_i and !is_game_end\n\t\t\tint_input = input.to_i\n\t\t\tif @board.is_open(int_input)\n\t\t\t\t@board.set_cell(int_input, @player_symbol)\n\t\t\t\t@player_move = true\n\t\t\telse\n\t\t\t\t@error_message = \"You cannot move to <#{int_input}>, choose again.\"\n\t\t\tend\n\n\t\telse\n\t\t\t@error_message = \"Invalid input '#{input}'\"\n\n\t\tend\n\n\tend",
"title": ""
},
{
"docid": "56b8ca9a4981e643231bf995cd538e26",
"score": "0.6252671",
"text": "def update\n unless moving?\n # Tile/event interaction\n if Input.confirm?\n newx, newy = facing_coordinates(@x, @y, @direction)\n $game.map.tile_interaction(newx, newy)\n end\n # Pause Menu\n if Input.start?\n PauseMenuUI.start\n end\n end\n @fake_move = false\n #@fake_move = true if $visuals.player.fake_anim\n oldrun = @running\n if Input.press_cancel?\n @runcount = 7 if !moving? && !@wasmoving && @runcount == 0\n @runcount += 1\n else\n @runcount = 0\n end\n @running = @runcount > 7 && moving?\n @speed = @running ? PLAYERRUNSPEED : PLAYERWALKSPEED\n if oldrun != @running # Walking to running or running to walking\n @graphic_name = @running ? \"boy_run\" : \"boy\"\n end\n if input_possible?\n case input = Input.dir4\n when 2\n move_down\n when 4\n move_left\n when 6\n move_right\n when 8\n move_up\n end\n @lastdir4 = input\n end\n @wasmoving = moving?\n end",
"title": ""
},
{
"docid": "609e3f97f1c09372f3b7cb88514472f5",
"score": "0.62441206",
"text": "def input\n # If the mouse was lifted this tick\n if inputs.mouse.up\n # Set current input to none\n state.user_input = :none\n end\n\n # If the mouse was clicked this tick\n if inputs.mouse.down\n # Determine what the user is editing and appropriately edit the state.user_input variable\n determine_input\n end\n\n # Process user input based on user_input variable and current mouse position\n process_input\n end",
"title": ""
},
{
"docid": "fb903f15e2a4281665da5db062b32b8b",
"score": "0.62323934",
"text": "def update\n\n if !$WINDOW.kb_locked && @changed_command_stack && @event_tiks <= 0\n #================================== WHEN COMMAND HAS CHANGED, NEW EVENT IS SET ==================================\n # If command_stack has changed, eg. if a button has been pressed or released, then enters in this condition\n if @command_stack.last == nil\n # If command_stack is empty, then there is no input that must be accounted for\n @vect_acc = -0.3\n @max_v = 0\n change_state(GameStates::States::IDLE)\n else\n if @command_stack.last[0] == :WALK\n # If command_stack's last entry is a walking entry, then walking pattern is set.\n set_walking_pattern\n elsif @command_stack.last[0] == :SHEATHE_ACTION\n # If command_stack's last entry is a sheathe action entry, then sheathing action is called.\n set_sheathe_action\n elsif @command_stack.last[0] == :ATTACKORITEM\n # If command_stack's last entry is a attack action entry, then attack action is called.\n set_attacking_action\n elsif @command_stack.last[0] == :ROLLORBLOCK\n # If command_stack's last entry is a roll or shield action entry, then roll or shield action is called.\n @command_stack.last[1] == :ROLL ? set_roll_action : set_shield_action\n end\n end\n # Once command_stack's latest entry has been performed, changed_command_stack flag is set to false.\n @changed_command_stack = false\n #=================================================================================================================\n\n\n elsif @event_tiks > 0 && @event_tiks -1 <= 0\n #================================== WHEN EVENT HAS ENDED =========================================================\n # If event tiks reaches 0 this update, change from last action\n if sheathing?\n # If sheathing or unsheathing, action is taken from command_stack, uns_tiks is set to 15 and keyboard is\n # unlocked\n @uns_tiks = 15\n $WINDOW.kb_locked = false\n end\n\n if attacking?\n # If sheathing or unsheathing, action is taken from command_stack, uns_tiks is set to 15 and keyboard is\n # unlocked\n @una_tiks = 7\n @sword = nil\n $WINDOW.kb_locked = false\n end\n\n if rolling?\n # If sheathing or unsheathing, action is taken from command_stack, uns_tiks is set to 15 and keyboard is\n # unlocked\n @unr_tiks = 15\n $WINDOW.kb_locked = false\n end\n\n if recoiling?\n $WINDOW.kb_locked = false\n end\n #once an event ends, command stack change flag is set to true, so that next action or event is called\n @changed_command_stack = true\n #=================================================================================================================\n end\n\n #=================================== SPECIAL MID-EVENT SETTINGS ====================================================\n\n if rolling?\n if @event_tiks == 20\n @inv_frames = 15\n elsif @event_tiks == 4\n @vect_acc = -0.5\n @max_v = 0\n end\n end\n\n #===================================================================================================================\n\n super\n\n #============================== REST OFF TIKS AND CLEAN UP =========================================================\n @sword.update unless @sword.nil?\n @uns_tiks -= 1 unless @uns_tiks <= 0\n @una_tiks -= 1 unless @una_tiks <= 0\n @unr_tiks -= 1 unless @unr_tiks <= 0\n @inv_frames -= 1 unless @inv_frames <= 0\n #===================================================================================================================\n end",
"title": ""
},
{
"docid": "3ba4e1a1f3b1d8c126d88e48ddbd965e",
"score": "0.6232375",
"text": "def input args\r\n if args.inputs.keyboard.space # if the user presses the space bar\r\n args.state.player.jumped_at ||= args.state.tick_count # jumped_at is set to current frame\r\n\r\n # if the time that has passed since the jump is less than the player's jump duration and\r\n # the player is not falling\r\n if args.state.player.jumped_at.elapsed_time < args.state.player_jump_power_duration && !args.state.player.falling\r\n args.state.player.dy = args.state.player_jump_power # change in y is set to power of player's jump\r\n end\r\n end\r\n\r\n # if the space bar is in the \"up\" state (or not being pressed down)\r\n if args.inputs.keyboard.key_up.space\r\n args.state.player.jumped_at = nil # jumped_at is empty\r\n args.state.player.falling = true # the player is falling\r\n end\r\n\r\n \r\n if args.inputs.keyboard.left # if left key is pressed\r\n args.state.player.dx -= args.state.player_acceleration # dx decreases by acceleration (player goes left)\r\n # dx is either set to current dx or the negative max run speed (which would be -10),\r\n # whichever has a greater value\r\n args.state.player.dx = args.state.player.dx.greater(-args.state.player_max_run_speed)\r\n elsif args.inputs.keyboard.right # if right key is pressed\r\n args.state.player.dx += args.state.player_acceleration # dx increases by acceleration (player goes right)\r\n # dx is either set to current dx or max run speed (which would be 10),\r\n # whichever has a lesser value\r\n args.state.player.dx = args.state.player.dx.lesser(args.state.player_max_run_speed)\r\n else\r\n args.state.player.dx *= args.state.player_speed_slowdown_rate # dx is scaled down\r\n end\r\n\r\n \r\n\r\nend",
"title": ""
},
{
"docid": "821b6e5de77eff709ac573b606d36ef4",
"score": "0.62307554",
"text": "def update_from_game_data; end",
"title": ""
},
{
"docid": "9b7a208208363aba6e670188e09a7b20",
"score": "0.6227907",
"text": "def input\n # Check and handle button input\n input_buttons\n\n # If the mouse was lifted this tick\n if inputs.mouse.up\n # Set current input to none\n state.user_input = :none\n end\n\n # If the mouse was clicked this tick\n if inputs.mouse.down\n # Determine what the user is editing and appropriately edit the state.user_input variable\n determine_input\n end\n\n # Process user input based on user_input variable and current mouse position\n process_input\n end",
"title": ""
},
{
"docid": "bc6fe6804770ebb574981a98d179ed29",
"score": "0.62214315",
"text": "def update(arg)\n if arg.is_a? Player\n puts \"#{arg.to_s} has won!\"\n # CMDController.instance.handle_event(['record_winner', arg.to_s])\n CMDController.instance.handle_event(['reset', arg.to_s])\n elsif arg.is_a? Board\n self.pretty_print(arg)\n elsif arg.is_a? String and arg.include? \"Message\"\n puts (arg)\n elsif arg.is_a? String and arg.include? \"name\"\n puts \"What is the player's name?\"\n # http://stackoverflow.com/questions/6085518/what-is-the-easiest-way-to-push-an-element-to-the-beginning-of-the-array\n parse_command(get_command().unshift(\"name\"))\n elsif arg.is_a? String and arg.include? \"continue\"\n puts \"Saved game found. Continue saved game? (y/n)\"\n # http://stackoverflow.com/questions/6085518/what-is-the-easiest-way-to-push-an-element-to-the-beginning-of-the-array\n parse_command(get_command().unshift(\"name\"))\n elsif arg.is_a? String and arg.include? \"tied\"\n puts \"Game Tied!\"\n CMDController.instance.handle_event(['reset', 'tie'])\n else\n puts \"#{arg} not recognized.\"\n end\n nil\n end",
"title": ""
},
{
"docid": "6465983cd87bbf48d7aed30b2519d92a",
"score": "0.62130237",
"text": "def update\n\t\t@game.play\n\tend",
"title": ""
},
{
"docid": "28531b7a269a4ea6dc9c3babdf1510cd",
"score": "0.6211696",
"text": "def process_input\n input_detected = true\n if mouse_down_list.include? :lmb\n profile('process_mouse_down') {process_mouse_down}\n elsif stable_state.holding_cards && mouse_held_list.include?(:lmb)\n profile('drop_cards') {drag_cards}\n elsif stable_state.holding_cards && mouse_up_list.include?(:lmb)\n profile('drop_cards') {drop_cards}\n profile('dim_buttons') {dim_buttons}\n profile('light_buttons') {light_buttons}\n elsif inputs.keyboard.key_down.space\n # Reset the game\n stable_state.screen_dirty = true\n new_game\n else\n input_detected = false\n end\n stable_state.auto_move_cooldown = 10 if input_detected\n input_detected\n end",
"title": ""
},
{
"docid": "8b833253e3b30fdbeb0f64103d00baa2",
"score": "0.621164",
"text": "def update\n @@game_state.update unless Game.fading? \n \n # update fading\n Game.end_fade! if Gosu::milliseconds >= @@end_fade and Game.fading?\n \n #update changing between game states\n if @@change_game_state and not Game.fading?\n @@game_state = @@change_game_state\n @@change_game_state = nil\n Game.fade_on(FadingTime)\n end\n end",
"title": ""
},
{
"docid": "79f4e375276c782e34a277ff2587935a",
"score": "0.6211261",
"text": "def main_loop\n @game = GameController.new\n @display = CliDisplay.new(board: @game.board_state)\n @input_state = :select_piece # select_piece\n @active_tile = nil\n\n while true\n @display.update(@game.board_state)\n exit if @game.state == :checkmate\n prompt_for @input_state\n input = gets.chomp\n parse input\n end # while true\nend",
"title": ""
},
{
"docid": "2e3feac4d66a07d2ecc06a61e1e520b9",
"score": "0.6207697",
"text": "def update_command\n # If B button was pressed\n if Input.trigger?(Input::B)\n # Play cancel SE\n $game_system.se_play($data_system.cancel_se)\n # Switch to map screen\n $scene = Scene_Map.new\n return\n end\n # If C button was pressed\n if Input.trigger?(Input::C)\n # If command other than save or end game, and party members = 0\n if $game_party.actors.size == 0 and @command_window.index < 4\n # Play buzzer SE\n $game_system.se_play($data_system.buzzer_se)\n return\n end\n # Branch by command window cursor position\n case @command_window.index\n when 0 # item\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to item screen\n $scene = Scene_Item.new\n when 1 # skill\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Make status window active\n @command_window.active = false\n @status_window.active = true\n @status_window.index = 0\n when 2 # equipment\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Make status window active\n @command_window.active = false\n @status_window.active = true\n @status_window.index = 0\n when 3 # status\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Make status window active\n @command_window.active = false\n @status_window.active = true\n @status_window.index = 0\n when 4 # save\n # If saving is forbidden\n if $game_system.save_disabled\n # Play buzzer SE\n $game_system.se_play($data_system.buzzer_se)\n return\n end\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to save screen\n $scene = Scene_Save.new\n when 5 # end game\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to end game screen\n $scene = Scene_End.new\n end\n return\n end\n end",
"title": ""
},
{
"docid": "2e3feac4d66a07d2ecc06a61e1e520b9",
"score": "0.6207697",
"text": "def update_command\n # If B button was pressed\n if Input.trigger?(Input::B)\n # Play cancel SE\n $game_system.se_play($data_system.cancel_se)\n # Switch to map screen\n $scene = Scene_Map.new\n return\n end\n # If C button was pressed\n if Input.trigger?(Input::C)\n # If command other than save or end game, and party members = 0\n if $game_party.actors.size == 0 and @command_window.index < 4\n # Play buzzer SE\n $game_system.se_play($data_system.buzzer_se)\n return\n end\n # Branch by command window cursor position\n case @command_window.index\n when 0 # item\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to item screen\n $scene = Scene_Item.new\n when 1 # skill\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Make status window active\n @command_window.active = false\n @status_window.active = true\n @status_window.index = 0\n when 2 # equipment\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Make status window active\n @command_window.active = false\n @status_window.active = true\n @status_window.index = 0\n when 3 # status\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Make status window active\n @command_window.active = false\n @status_window.active = true\n @status_window.index = 0\n when 4 # save\n # If saving is forbidden\n if $game_system.save_disabled\n # Play buzzer SE\n $game_system.se_play($data_system.buzzer_se)\n return\n end\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to save screen\n $scene = Scene_Save.new\n when 5 # end game\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to end game screen\n $scene = Scene_End.new\n end\n return\n end\n end",
"title": ""
},
{
"docid": "d25fde4ea71bbface2e70f05abdf494a",
"score": "0.62046486",
"text": "def tick\n init_new_game\n render_board\n input_board\n end",
"title": ""
},
{
"docid": "446d8450bde7078ccfa16a8998d902d9",
"score": "0.6204474",
"text": "def update\n @game = Game.find(params[:id])\n @game.update(state: params[\"game\"][\"state\"])\n render json: @game, status: 201\n end",
"title": ""
},
{
"docid": "615b647e4344213bb2eae4bfce40aded",
"score": "0.6204209",
"text": "def update\n self.caption = \"Darwin's Odyssey - #{Gosu::fps} FPS#{\" - 'God' Mode\" if @cheat_mode}\"\n @state_manager.current.update\n exit if button_down?(Gosu::KbEscape)\n end",
"title": ""
},
{
"docid": "022d23ca104ba64dbb8acb04a0b4a9ea",
"score": "0.6202574",
"text": "def update_basic\n Graphics.update\n Input.update\n end",
"title": ""
},
{
"docid": "0a46ea0c3fdcb5c1f89c19c371158dfa",
"score": "0.6197475",
"text": "def update_status\n # If B button was pressed\n if Input.trigger?(Input::B)\n # Play cancel SE\n $game_system.se_play($data_system.cancel_se)\n # Make command window active\n @command_window.active = true\n @status_window.active = false\n @status_window.index = -1\n return\n end\n # If C button was pressed\n if Input.trigger?(Input::C)\n # Branch by command window cursor position\n case @command_window.index\n when 1 # skill\n # If this actor's action limit is 2 or more\n if $game_party.actors[@status_window.index].restriction >= 2\n # Play buzzer SE\n $game_system.se_play($data_system.buzzer_se)\n return\n end\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to skill screen\n $scene = Scene_Skill.new(@status_window.index)\n when 2 # equipment\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to equipment screen\n $scene = Scene_Equip.new(@status_window.index)\n when 3 # status\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to status screen\n $scene = Scene_Status.new(@status_window.index)\n when 4 # pos\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to status screen\n $scene = Scene_Position.new(@status_window.index)\n end\n\n return\n end\n end",
"title": ""
},
{
"docid": "a5199d1c0f67f437c6e3ce4182d41499",
"score": "0.6196091",
"text": "def update_input_number\r\n if @input_number_window\r\n @input_number_window.update\r\n #>Validation\r\n if Input.trigger?(:A)\r\n $game_system.se_play($data_system.decision_se)\r\n $game_variables[$game_temp.num_input_variable_id] =\r\n @input_number_window.number\r\n $game_map.need_refresh = true\r\n @input_number_window.dispose\r\n @input_number_window = nil\r\n terminate_message\r\n end\r\n return true\r\n end\r\n return false\r\n end",
"title": ""
},
{
"docid": "fe6a7f1e590135945523573c57789cab",
"score": "0.61873025",
"text": "def handle_in_game_get_input\n input = @display_window.get_input\n @total_taps += 1\n\n if input == @text[@chars_completed]\n @state = :in_game_valid_input\n else\n @state = :in_game_invalid_input\n end\n\n calculate_stats\n\n self\n end",
"title": ""
},
{
"docid": "28424d956b8724c7d708e8daf3185e0e",
"score": "0.6180962",
"text": "def update_status\n # If B button was pressed\n if Input.trigger?(Input::B)\n # Play cancel SE\n $game_system.se_play($data_system.cancel_se)\n # Make command window active\n @command_window.active = true\n @status_window.active = false\n @status_window.index = -1\n return\n end\n # If C button was pressed\n if Input.trigger?(Input::C)\n # Branch by command window cursor position\n case @command_window.index\n when 1 # skill\n # If this actor's action limit is 2 or more\n if $game_party.actors[@status_window.index].restriction >= 2\n # Play buzzer SE\n $game_system.se_play($data_system.buzzer_se)\n return\n end\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to skill screen\n $scene = Scene_Skill.new(@status_window.index)\n when 2 # equipment\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to equipment screen\n $scene = Scene_Equip.new(@status_window.index)\n when 3 # status\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to status screen\n $scene = Scene_Status.new(@status_window.index)\n end\n return\n end\n end",
"title": ""
},
{
"docid": "28424d956b8724c7d708e8daf3185e0e",
"score": "0.6180962",
"text": "def update_status\n # If B button was pressed\n if Input.trigger?(Input::B)\n # Play cancel SE\n $game_system.se_play($data_system.cancel_se)\n # Make command window active\n @command_window.active = true\n @status_window.active = false\n @status_window.index = -1\n return\n end\n # If C button was pressed\n if Input.trigger?(Input::C)\n # Branch by command window cursor position\n case @command_window.index\n when 1 # skill\n # If this actor's action limit is 2 or more\n if $game_party.actors[@status_window.index].restriction >= 2\n # Play buzzer SE\n $game_system.se_play($data_system.buzzer_se)\n return\n end\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to skill screen\n $scene = Scene_Skill.new(@status_window.index)\n when 2 # equipment\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to equipment screen\n $scene = Scene_Equip.new(@status_window.index)\n when 3 # status\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to status screen\n $scene = Scene_Status.new(@status_window.index)\n end\n return\n end\n end",
"title": ""
},
{
"docid": "0f64d47ca93e137e84f4d7e186fc6bba",
"score": "0.6178667",
"text": "def update_inputs_skill\n update_inputs_move_index\n if Input.trigger?(:A)\n $game_system.se_play($data_system.decision_se)\n update_inputs_skills_validation\n elsif Input.trigger?(:B)\n $game_system.se_play($data_system.cancel_se)\n @skill_selected = -1\n @running = false\n end\n return true\n end",
"title": ""
},
{
"docid": "b892c15ef4e2f52aab64efb945654cf1",
"score": "0.61774945",
"text": "def update_status\n # If B button was pressed\n if Input.trigger?(Input::B)\n # Play cancel SE\n $game_system.se_play($data_system.cancel_se)\n # Make command window active\n @command_window.active = true\n @status_window.active = false\n @status_window.index = -1\n return\n end\n # If C button was pressed\n if Input.trigger?(Input::C)\n # Branch by command window cursor position\n case @command_window.index\n when 1 # skill\n # If this actor's action limit is 2 or more\n if $game_party.actors[@status_window.index].restriction >= 2\n # Play buzzer SE\n $game_system.se_play($data_system.buzzer_se)\n return\n end\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to skill screen\n $scene = Scene_Skill.new(@status_window.index)\n when 2 # equipment\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to equipment screen\n $scene = Scene_Equip.new(@status_window.index)\n when 3 # status\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to status screen\n $scene = Scene_Status.new(@status_window.index)\n end\n\n return\n end\n end",
"title": ""
},
{
"docid": "d4097964691a4937e1f4975d6f69d7ae",
"score": "0.617506",
"text": "def update\n Gamework::App.update\n end",
"title": ""
},
{
"docid": "8bfaecf5402b3a70f07a40fa2dafa47b",
"score": "0.6170568",
"text": "def update_command\n # update command window\n @command_window.update\n # if B is pressed\n if Input.trigger?(Input::B)\n # play cancel sound\n $game_system.se_play($data_system.cancel_se)\n # create map scene\n $scene = Scene_Map.new\n # if C is pressed\n elsif Input.trigger?(Input::C)\n # which option\n case @command_window.index\n when 0\n # play sound\n $game_system.se_play($data_system.decision_se)\n # deactivate command window\n @command_window.active = false\n # activate behavior window\n @behavior_window.active = true\n when 1\n # play sound\n $game_system.se_play($data_system.decision_se)\n # get all AI actors\n battlers = $BlizzABS.battlers\n # set next index\n @index = (@index + 1) % battlers.size\n # if battler not valid\n while battlers[@index].battler == nil\n # try to find one that is\n @index = (@index + 1) % battlers.size\n end\n # create hotkey assignment scene with the current screen tint\n $scene = Scene_AI_Behavior.new(@view.tone, @index, @command_window.index)\n when 2\n # play sound\n $game_system.se_play($data_system.decision_se)\n # get all AI actors\n battlers = $BlizzABS.battlers\n # set previous index\n @index = (@index + battlers.size - 1) % battlers.size\n # if battler not valid\n while battlers[@index].battler == nil\n # try to find one that is\n @index = (@index + battlers.size - 1) % battlers.size\n end\n # create hotkey assignment scene with the current screen tint\n $scene = Scene_AI_Behavior.new(@view.tone, @index, @command_window.index)\n when 3\n # play sound\n $game_system.se_play($data_system.decision_se)\n # create map scene\n $scene = Scene_Map.new\n end\n # if R is pressed\n elsif Input.trigger?(Input::R)\n # play sound\n $game_system.se_play($data_system.decision_se)\n # get all AI actors\n battlers = $BlizzABS.battlers\n # set next index\n @index = (@index + 1) % battlers.size\n # if battler not valid\n while battlers[@index].battler == nil\n # try to find one that is\n @index = (@index + 1) % battlers.size\n end\n # create hotkey assignment scene with the current screen tint\n $scene = Scene_AI_Behavior.new(@view.tone, @index, @command_window.index)\n # if L is pressed\n elsif Input.trigger?(Input::L)\n # play sound\n $game_system.se_play($data_system.decision_se)\n # get all AI actors\n battlers = $BlizzABS.battlers\n # set previous index\n @index = (@index + battlers.size - 1) % battlers.size\n # if battler not valid\n while battlers[@index].battler == nil\n # try to find one that is\n @index = (@index + battlers.size - 1) % battlers.size\n end\n # create hotkey assignment scene with the current screen tint\n $scene = Scene_AI_Behavior.new(@view.tone, @index, @command_window.index)\n end\n end",
"title": ""
},
{
"docid": "ec4a53db777afafd5be420119d41acc8",
"score": "0.6169681",
"text": "def update(input,player)\n @cells[input.to_i-1] = player.token\n end",
"title": ""
},
{
"docid": "b1c5f37bf4d74b78b67d15aeaecda168",
"score": "0.6169213",
"text": "def update_command\n # If B button was pressed\n if Input.trigger?(Input::B)\n # Play cancel SE\n $game_system.se_play($data_system.cancel_se)\n # Switch to map screen\n $scene = Scene_Map.new\n return\n end\n # If C button was pressed\n if Input.trigger?(Input::C)\n # If command other than save or end game, and party members = 0\n if $game_party.actors.size == 0 and @command_window.index < 4\n # Play buzzer SE\n $game_system.se_play($data_system.buzzer_se)\n return\n end\n\n # Branch by command window cursor position\n case @command_window.index\n when 0 # item\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to item screen\n $scene = Scene_Item.new\n when 1 # skill\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Make status window active\n @command_window.active = false\n @status_window.active = true\n @status_window.index = 0\n when 2 # equipment\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Make status window active\n @command_window.active = false\n @status_window.active = true\n @status_window.index = 0\n when 3 # status\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Make status window active\n @command_window.active = false\n @status_window.active = true\n @status_window.index = 0\n when 4 # pos\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Make status window active\n @command_window.active = false\n @status_window.active = true\n @status_window.index = 0\n when 5 # save\n # If saving is forbidden\n if $game_system.save_disabled\n # Play buzzer SE\n $game_system.se_play($data_system.buzzer_se)\n return\n end\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to save screen\n $scene = Scene_Save.new\n when 6 # end game\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Switch to end game screen\n $scene = Scene_End.new\n end\n return\n end\n end",
"title": ""
},
{
"docid": "70b32af06d094fdbf943945aad31f543",
"score": "0.6166148",
"text": "def update_button_input\n # Quit map if B triggered\n return @running = false if Input.trigger?(:B)\n # Toggle zoom if allowed\n on_toggle_zoom if ZoomEnabled && Input.trigger?(:X)\n # No more input if wall view\n return if @mode == :view_wall\n # Load the next worldmap\n on_next_worldmap if Input.trigger?(:Y)\n return on_fly_attempt if @mode == :fly && Input.trigger?(:A)\n end",
"title": ""
},
{
"docid": "631d9f13d4c5b6c54b4985f8a537e151",
"score": "0.6163127",
"text": "def update_before_main\n # update window\n @window.update\n # if window is active\n if @window.active\n # if B is pressed\n if Input.trigger?(Input::B)\n # play cancel sound\n $game_system.se_play($data_system.cancel_se)\n # create map scene\n $scene = Scene_Map.new\n # exit this scene\n return true\n # if C is pressed\n elsif Input.trigger?(Input::C)\n # which option\n case @window.index\n when 0\n # play sound\n $game_system.se_play($data_system.decision_se)\n # set in_battle flag\n $game_temp.in_battle = false\n when 1\n # play buzzer sound effect\n $game_system.se_play($data_system.buzzer_se)\n # don't exit this scene\n return false\n when 2\n # play sound\n $game_system.se_play($data_system.decision_se)\n # create hotkey assignment scene with the current screen tint\n $scene = Scene_Controls.new(@view.tone)\n when 3\n # play sound\n $game_system.se_play($data_system.decision_se)\n # create map scene\n $scene = Scene_Map.new\n end\n # exit this scene\n return true\n end\n end\n # don't exit this scene\n return false\n end",
"title": ""
},
{
"docid": "631d9f13d4c5b6c54b4985f8a537e151",
"score": "0.6163127",
"text": "def update_before_main\n # update window\n @window.update\n # if window is active\n if @window.active\n # if B is pressed\n if Input.trigger?(Input::B)\n # play cancel sound\n $game_system.se_play($data_system.cancel_se)\n # create map scene\n $scene = Scene_Map.new\n # exit this scene\n return true\n # if C is pressed\n elsif Input.trigger?(Input::C)\n # which option\n case @window.index\n when 0\n # play sound\n $game_system.se_play($data_system.decision_se)\n # set in_battle flag\n $game_temp.in_battle = false\n when 1\n # play buzzer sound effect\n $game_system.se_play($data_system.buzzer_se)\n # don't exit this scene\n return false\n when 2\n # play sound\n $game_system.se_play($data_system.decision_se)\n # create hotkey assignment scene with the current screen tint\n $scene = Scene_Controls.new(@view.tone)\n when 3\n # play sound\n $game_system.se_play($data_system.decision_se)\n # create map scene\n $scene = Scene_Map.new\n end\n # exit this scene\n return true\n end\n end\n # don't exit this scene\n return false\n end",
"title": ""
},
{
"docid": "7dbe268dd6d4d0b7e4f5b32559dee00d",
"score": "0.6160513",
"text": "def update\n @state.update if @state.respond_to? :update\n end",
"title": ""
}
] |
d71ec1e2b205a56008eb351bc3529dd1
|
Returns a PathSet containing all libraries in this module (this subtree, plus any subtrees it's dependent upon) that should be included if the given variant_name is set equal to the given variant_value.
|
[
{
"docid": "61206906ca09c9ce5afba5284b391956",
"score": "0.8361424",
"text": "def module_only_variant_libraries(variant_name, variant_value)\n out = PathSet.new\n out << subtree_only_variant_libraries(variant_name, variant_value)\n @internal_dependencies.each do |internal_dependency|\n out << build_module.subtree(internal_dependency).subtree_only_variant_libraries(variant_name, variant_value)\n end\n out\n end",
"title": ""
}
] |
[
{
"docid": "cb584af734c582d254d6931a51c44bc3",
"score": "0.8342641",
"text": "def full_variant_libraries(variant_name, variant_value)\n out = PathSet.new\n out << module_only_variant_libraries(variant_name, variant_value)\n dependent_subtrees do |the_subtree|\n out << the_subtree.module_only_variant_libraries(variant_name, variant_value)\n end\n out\n end",
"title": ""
},
{
"docid": "ec37fced619d85a0a5829f01951778bc",
"score": "0.8241312",
"text": "def subtree_only_variant_libraries(variant_name, variant_value)\n out = PathSet.new\n dir = FilePath.new(build_module.root, \"lib\" + lib_suffix + \".variants.\" + variant_name + \".\" + variant_value)\n out << JarDirectory.new(dir).to_classpath if dir.directory?\n out\n end",
"title": ""
},
{
"docid": "9ccc702ea137c5374afb3367f99f6ae2",
"score": "0.6087576",
"text": "def add_subtree_only_all_variants(out={})\n Dir.new(build_module.root.to_s).each do |entry|\n if entry =~ /lib#{lib_suffix}\\.variants\\.([^\\.]+)\\.([^\\.]+)/\n out[$1] ||= []\n out[$1] = out[$1] | [ $2 ]\n end\n end\n\n out\n end",
"title": ""
},
{
"docid": "141c15321c9c56f033d241ad08fd48af",
"score": "0.57288605",
"text": "def lib_paths\n # start with library search paths resulting from direct dependencies\n lib_paths = ::Set.new(recipes.inject([]) { |list, rcp| list.concat(rcp.mpc_file[project_type].lib_paths) })\n # now add library search paths resulting from indirect dependencies\n dependencies.each do |idep|\n lib_paths.merge(idep.lib_paths)\n end\n lib_paths\n end",
"title": ""
},
{
"docid": "9a8162d43f537c293ef23574dec2acc5",
"score": "0.57186556",
"text": "def variant_paths\n paths.select { |path| variant?(path) }\n end",
"title": ""
},
{
"docid": "81484573dd06617dcd4cb13e355b46c6",
"score": "0.57016796",
"text": "def includes\n # start with includes resulting from direct dependencies\n incs = ::Set.new(recipes.inject([]) { |list, rcp| list.concat(rcp.mpc_file[project_type].include_dependencies) })\n # now add includes resulting from indirect dependencies\n dependencies.each do |idep|\n incs.merge(idep.includes)\n end\n incs\n end",
"title": ""
},
{
"docid": "fa8e2f5893723e01572bce87644bdb62",
"score": "0.55870116",
"text": "def include_set\n Set.new(flay_includes.map(&method(:Pathname)))\n end",
"title": ""
},
{
"docid": "d5548479e6b4c1382d354602fbd6a72b",
"score": "0.54978436",
"text": "def show_variants\n depends :init\n\n @module_set.each do |build_module|\n build_module.each do |subtree|\n variants = subtree.full_all_variants\n\n unless variants.empty?\n puts \"Available variants for #{build_module.name}/#{subtree.name}:\"\n variants.each do |variant_name, variant_values|\n variant_values.each do |variant_value|\n puts \" %s: %s: %s\" % [ variant_name, variant_value, subtree.full_variant_libraries(variant_name, variant_value) ]\n end\n end\n puts \"\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "7fd7c46005b1eed558d13d2d65e72745",
"score": "0.5487535",
"text": "def libs\n # return link libraries resulting from indirect dependencies\n llibs = ::Set.new\n dependencies.each do |idep|\n llibs.merge(idep.libs)\n end\n llibs\n end",
"title": ""
},
{
"docid": "debedba7a44517618792558b0e67e3ed",
"score": "0.5476397",
"text": "def lib_paths\n # return all library search paths resulting from indirect dependencies\n libpaths = ::Set.new\n dependencies.each do |idep|\n libpaths.merge(idep.lib_paths)\n end\n libpaths\n end",
"title": ""
},
{
"docid": "6a71b7bac65ec352107f236a5c57b5ad",
"score": "0.5426261",
"text": "def _SetDependencyValues(vsConf)\n # add the include directories for the project itself\n # this is the complete tree under the include directories\n includePaths = []\n @projectInstance.SourceUnits.each() do |su|\n su.IncludeFileSet.RootDirectories.each() do |rootDir|\n includePaths |= GetDirectoryTree(rootDir)\n end \n end\n vsConf.AdditionalIncludeDirectories |= includePaths\n \n # add the project path to include paths if any idl files were found\n if(@vsProjectInstance != nil)\n if(@vsProjectInstance.IdlFileSet.FilePaths.length > 0)\n #puts \"Adding #{@vsProjectDescription.ProjectFilePath.DirectoryPath()} to includes\"\n vsConf.AdditionalIncludeDirectories.push(@vsProjectDescription.ProjectFilePath.DirectoryPath())\n end\n end\n \n #puts \"Libraries in project configuration #{vsConf.PlatformName} of project #{@projectDescription.Name}: #{@projectInstance.Libraries}\"\n \n # write the lib name, path and include directories for all libs in this project\n @projectInstance.Libraries.each() do |library|\n libInstance = library.GetInstance(vsConf.Platform)\n if(!libInstance)\n next\n end\n \n #puts \"Pushing root directories of library #{library.Name} into additional include directories #{[libInstance.FileSet.IncludeFileSet]}\"\n libInstance.FileSet.IncludeFileSet.RootDirectories.each() do |rootDir|\n vsConf.AdditionalIncludeDirectories.push(rootDir) \n end\n \n libInstance.FileSet.LibraryFileSet.FilePaths.each() do |filePath|\n if(libInstance.FileSet.LibraryFileSet.RootDirectories.length > 0)\n vsConf.AdditionalLibraryDirectories.push(filePath.DirectoryPath())\n end \n vsConf.AdditionalDependencies.push(filePath.FileName)\n end\n end\n \n # add the library include paths and set defaults for the usage criteria depending on the current project\n @vsProjects.each() do |vsProj|\n vsProjConfiguration = vsProj.GetConfiguration(vsConf.Platform)\n \n # if the user defined a special usage behaviour take it\n vsProjUsage = _GetProjectUsage(vsProj.Guid) \n if(vsProjUsage)\n #puts \"Adopting new project usage for #{vsProj.Name}\"\n vsProj.Usage = Clone(vsProjUsage)\n #else\n # puts \"Could not find usage pattern for project #{vsProj.Name} with guid #{vsProj.Guid}\"\n # puts \"Available usages are #{VsProjectUsages()}\"\n end\n \n \n #outDir = vsProjConfiguration.OutputDirectory\n #targetName = vsProjConfiguration.TargetName\n targetExt = vsProjConfiguration.TargetExt\n \n if(targetExt != Vs::Configuration::TargetExt::APPLICATION)\n #binaryName = targetName.gsub(\"$(PlatformName)\", @projectDescription.Name) + Vs::Configuration::TargetExt::STATIC # add always the lib file\n \n vsConf.AdditionalIncludeDirectories |= (vsProj.IncludePaths)\n # use dependencies instead\n #vsConf.AdditionalLibraryDirectories.push(outDir)\n #vsConf.AdditionalDependencies.push(binaryName)\n \n vsProj.Libraries.each() do |lib|\n libInstance = lib.GetInstance(vsConf.Platform)\n if(libInstance)\n vsConf.AdditionalIncludeDirectories |= libInstance.FileSet.IncludeFileSet.RootDirectories\n end\n end\n \n vsProj.Dependencies.each() do |dep|\n vsConf.AdditionalIncludeDirectories |= dep.IncludePaths\n end\n end\n end\n \n vsConf.AdditionalIncludeDirectories = vsConf.AdditionalIncludeDirectories.uniq\n vsConf.AdditionalLibraryDirectories = vsConf.AdditionalLibraryDirectories.uniq\n vsConf.AdditionalDependencies = vsConf.AdditionalDependencies.uniq\n end",
"title": ""
},
{
"docid": "a37be896f613f3f268754f90b0e36274",
"score": "0.5393834",
"text": "def includes\n # return includes resulting from indirect dependencies\n incs = ::Set.new\n dependencies.each do |idep|\n incs.merge(idep.includes)\n end\n incs\n end",
"title": ""
},
{
"docid": "0ec8f365e5e0377c3410b0eea63f457b",
"score": "0.5364009",
"text": "def full_all_variants\n out = { }\n add_module_only_all_variants(out)\n dependent_subtrees do |the_subtree|\n the_subtree.add_module_only_all_variants(out)\n end\n out\n end",
"title": ""
},
{
"docid": "e102d2ef7ab6afbd9493df71cb7359cc",
"score": "0.5318668",
"text": "def add_module_only_all_variants(out={})\n add_subtree_only_all_variants(out)\n @internal_dependencies.each do |internal_dependency|\n build_module.subtree(internal_dependency).add_subtree_only_all_variants(out)\n end\n out\n end",
"title": ""
},
{
"docid": "0d6eca13eeaa5da101a1d76da7ae3901",
"score": "0.50272256",
"text": "def core_dependants_of(name)\n dependencies = {}\n Dir['src/tikzlibrarykodi.*.code.tex'].each do |filename|\n code = File.read filename\n sublibrary_name = filename[/kodi\\.(.*)\\.code/, 1]\n usetikzlibrary = /\\\\usetikzlibrary[\\[{]kodi\\.(\\w+)[\\]}]/\n dependencies[sublibrary_name] = code.scan(usetikzlibrary).map(&:first)\n end\n dependants = []\n upper_level = [name]\n until upper_level.empty?\n dependants.concat upper_level\n upper_level = []\n dependants.each do |d|\n upper_level.concat dependencies.select { |_, ds| ds.include? d }.keys\n end\n upper_level.reject! { |x| dependants.include? x }\n end\n dependants\nend",
"title": ""
},
{
"docid": "10d0ff907e68303eb2961130bc1528e3",
"score": "0.50087297",
"text": "def subtree_only_native_library_path(build_results, build_environment)\n out = PathSet.new\n subtree_only_native_library_roots(build_environment).each { |root| out << root }\n out\n end",
"title": ""
},
{
"docid": "7940fdb9963fb0efeec44b5d8183a2ab",
"score": "0.50027514",
"text": "def subtree_only_libraries(type)\n out = dependencies_libraries(type)\n roots = subtree_only_library_roots(type)\n roots.each { |root| out << JarDirectory.new(root).to_classpath }\n out\n end",
"title": ""
},
{
"docid": "fc49116ef1c1866a293f83ef2738b926",
"score": "0.4986571",
"text": "def IncludePaths\n @IncludeFileSet.FileDirectories()\n end",
"title": ""
},
{
"docid": "1a487ca260dd63bcac75d8e7c98bd061",
"score": "0.49536932",
"text": "def variant_collection_by_type variant_type\n variants.joins(:variant_type).where(variant_types: { name: variant_type })\n end",
"title": ""
},
{
"docid": "2497f74e95deac7991d65f650e316d64",
"score": "0.4908888",
"text": "def pick_sets # :nodoc:\n @sources.each_source do |source|\n @sets << source.dependency_resolver_set\n end\n end",
"title": ""
},
{
"docid": "b6d972f3f18930487f9e7d01f2dc96fa",
"score": "0.488062",
"text": "def get_clients(libnames)\n result = Set.new\n libnames.each do |lib|\n if graph.has_vertex?(lib)\n result.merge(traverse_sub_tree(graph, lib))\n else\n Pod::UI.puts \"Warning: cannot find lib: #{lib}\"\n end\n end\n result\n end",
"title": ""
},
{
"docid": "7b33a29ac7c3765db973075f3bc1a921",
"score": "0.48701844",
"text": "def included_lib_dirs\n []\n end",
"title": ""
},
{
"docid": "87347d4212be25894e1ed3a0c6912ca5",
"score": "0.4865756",
"text": "def module_pathname_set\n concern_paths = Dir.glob(glob)\n\n concern_paths.each_with_object(Set.new) { |concern_path, module_pathname_set|\n concern_pathname = Pathname.new(concern_path)\n module_pathname = concern_pathname.parent\n\n module_pathname_set.add module_pathname\n }\n end",
"title": ""
},
{
"docid": "87347d4212be25894e1ed3a0c6912ca5",
"score": "0.4865756",
"text": "def module_pathname_set\n concern_paths = Dir.glob(glob)\n\n concern_paths.each_with_object(Set.new) { |concern_path, module_pathname_set|\n concern_pathname = Pathname.new(concern_path)\n module_pathname = concern_pathname.parent\n\n module_pathname_set.add module_pathname\n }\n end",
"title": ""
},
{
"docid": "22815a37ee8037c7401139682342723b",
"score": "0.48413703",
"text": "def variants\n return @variants if @variants\n variants = {}\n variant_paths.each { |path| variants[path.mime_type] = path }\n @variants = variants.freeze\n end",
"title": ""
},
{
"docid": "bd7f6a4febaef44f3bf242adb3552fdf",
"score": "0.48279664",
"text": "def all_rubies(root_path=@root_path)\n @all_rubies_gemsets ||= all_rubies_gemsets(root_path)\n @all_rubies = @all_rubies_gemsets.keys\n end",
"title": ""
},
{
"docid": "182c05c5bb25c1890e674244854171e9",
"score": "0.48128203",
"text": "def get_libraries_recursive_list\n\t\tlibraries = get_libraries_recursive_string.split\n\t\treturn libraries\n\tend",
"title": ""
},
{
"docid": "0c4f335ecb73f544bb727f9c10d76314",
"score": "0.47992977",
"text": "def variantgroups\n @variantgroups ||= begin\n [].tap do |arr|\n fetch_paginated(\"variantgroups\", include: :variants) do |group|\n arr << group if group['siteId'].to_s == site_id.to_s\n end\n end\n end\n end",
"title": ""
},
{
"docid": "eabe10cc13fccfb2e48e631b1aed0a6a",
"score": "0.47919708",
"text": "def all_libraries\n Boson.repos.map {|e| e.all_libraries }.flatten.uniq\n end",
"title": ""
},
{
"docid": "547048ef0783bc37908b503924eda03f",
"score": "0.47784778",
"text": "def search(path, options={})\n options = options.merge(:main=>true)\n\n latest = options[:latest]\n\n matches = []\n\n # TODO: Perhaps the selected and unselected should be kept in separate lists?\n unselected, selected = *partition{ |name, libs| Array === libs }\n\n # broad search of pre-selected libraries\n selected.each do |(name, lib)|\n if ftr = lib.find(path, options)\n next if Library.load_stack.last == ftr\n matches << ftr\n end\n end\n\n # finally a broad search on unselected libraries\n unselected.each do |(name, libs)|\n libs = [libs.sort.first] if latest\n libs.each do |lib|\n ftr = lib.find(path, options)\n matches << ftr if ftr\n end\n end\n\n matches.uniq\n end",
"title": ""
},
{
"docid": "547048ef0783bc37908b503924eda03f",
"score": "0.47784778",
"text": "def search(path, options={})\n options = options.merge(:main=>true)\n\n latest = options[:latest]\n\n matches = []\n\n # TODO: Perhaps the selected and unselected should be kept in separate lists?\n unselected, selected = *partition{ |name, libs| Array === libs }\n\n # broad search of pre-selected libraries\n selected.each do |(name, lib)|\n if ftr = lib.find(path, options)\n next if Library.load_stack.last == ftr\n matches << ftr\n end\n end\n\n # finally a broad search on unselected libraries\n unselected.each do |(name, libs)|\n libs = [libs.sort.first] if latest\n libs.each do |lib|\n ftr = lib.find(path, options)\n matches << ftr if ftr\n end\n end\n\n matches.uniq\n end",
"title": ""
},
{
"docid": "54d393ad348f6c54a8cfebab1b90d8df",
"score": "0.47589058",
"text": "def libs\n all_enabled = @setup.enabled\n if all_enabled.empty?\n return []\n else\n en = all_enabled.join(\",\")\n return FileList[@path / \"{#{en}}\" / \"**\" / \"*.a\"]\n end\n end",
"title": ""
},
{
"docid": "15cc4a7c1bfec39fb774136b7fc3cf34",
"score": "0.4719277",
"text": "def all_rubies_gemsets(root_path=@root_path)\n @all_rubies_gemsets = Hash.new([])\n arry=find_rvmrc_paths(root_path)\n arry.each do |dir|\n Dir.glob(dir + '/*.gems').each do |fn|\n gsn = File.basename(fn,'.gems').to_s\n rvmrc_read(dir + '/.rvmrc')\n rube = rvmrc_ruby_name\n egsn = rvmrc_gemset_name\n @all_rubies_gemsets[rube] = [] unless @all_rubies_gemsets.key? rube\n if gsn == egsn\n @all_rubies_gemsets[rube] << {:ruby_alias => \"cuken_#{rube}\",:gemset_alias => \"cuken_#{gsn}\", :gemset_name => gsn, :gemset_path => fn}\n end\n end\n end\n @all_rubies_gemsets\n end",
"title": ""
},
{
"docid": "cb3625a5d0ee7d60feaf828a6047ce44",
"score": "0.47144473",
"text": "def excludes\n unless @excludes\n @excludes = []\n @options[:gem_excludes].map do |libname|\n libpath = libraries[libname]\n @excludes << libpath.dirname + libname if libpath\n end\n end\n \n @excludes\n end",
"title": ""
},
{
"docid": "124986a0cd7665d71ec20eb7e0786b45",
"score": "0.47132158",
"text": "def configured_dependencies\n @configured_dependencies ||= begin\n dependencies = config.dig(\"manifest\", \"dependencies\")&.dup || {}\n\n dependencies.each_with_object({}) do |(name, patterns), hsh|\n # map glob pattern(s) listed for the dependency to a listing\n # of files that match the patterns and are not excluded\n hsh[name] = files_from_pattern_list(patterns) & included_files\n end\n end\n end",
"title": ""
},
{
"docid": "a8b79234f6e923d4ca38aa537f023255",
"score": "0.47046456",
"text": "def module_only_native_library_path(build_results, build_environment)\n out = PathSet.new\n @internal_dependencies.each do |internal_dependency|\n out << build_module.subtree(internal_dependency).subtree_only_native_library_path(build_results, build_environment)\n end\n\n out << subtree_only_native_library_path(build_results, build_environment)\n out\n end",
"title": ""
},
{
"docid": "9a48ca35df7715b4e4672ebb6a46c7c1",
"score": "0.46792606",
"text": "def libraries\n unless @libraries\n @libraries = {}\n paths = Processor.expand_paths($LOAD_PATH, @options[:gem_libraries])\n paths.each do |path|\n lib = Processor.library_name(path)\n if @libraries[lib]\n @logger.warn \"Multiple libraries for <#{lib}>, using #{ Processor.pretty_path @libraries[lib] } (other is #{ Processor.pretty_path path })\" \n end\n @libraries[lib] ||= path\n end\n end\n \n @libraries\n end",
"title": ""
},
{
"docid": "9feb06a03d950f8c3ce9f2d4f1281e80",
"score": "0.46784556",
"text": "def expand_included(uri, composer)\n result = []\n if config_exist?(uri, composer)\n result << uri unless is_ignored_hiera_version?(uri, composer)\n else\n result << uri unless is_optional?(uri)\n end\n result\n end",
"title": ""
},
{
"docid": "2a1f98239ef298cda04326132a087526",
"score": "0.46692768",
"text": "def representative_set(name)\n representative_source = nil\n highest_version = nil\n sources.each do |source|\n source_versions = source.versions(name)\n if source_versions\n source_version = source_versions.first\n if highest_version.nil? || (highest_version < source_version)\n highest_version = source_version\n representative_source = source\n end\n end\n end\n representative_source ? Specification::Set.new(name, representative_source) : nil\n end",
"title": ""
},
{
"docid": "8e33f6fb23e3b0409586f5f48b332c03",
"score": "0.4665624",
"text": "def depends_on\n @dependent_libs ||= {:core => [], :gem => []}\n end",
"title": ""
},
{
"docid": "d0bba7b83d67985f25844849e6bd1366",
"score": "0.46513847",
"text": "def source_paths=(value)\n @source_paths = value.to_a.\n collect { |glob| Pathname.glob(glob.to_s) }.\n flatten.\n uniq.\n collect(&:expand_path)\n end",
"title": ""
},
{
"docid": "5066dc16c9780fbe29302c2864a38d97",
"score": "0.46353322",
"text": "def depend_on(*globs)\n @dependencies = globs\n end",
"title": ""
},
{
"docid": "cc531b53d66a4c050772d36f6795d2b1",
"score": "0.4606079",
"text": "def group_for_file_reference_path(path)\n group = variant_group_for_path(path)\n group ||= group_for_path(path)\n group\n end",
"title": ""
},
{
"docid": "86183e38944bb9c8db6dcea535da763c",
"score": "0.4594512",
"text": "def all_gemsets(root_path=@root_path)\n default = Hash.new{|hsh,ky| hsh[ky] = {:ruby_alias => \"cuken_#{ky}\"}}\n @all_rubies_gemsets ||= all_rubies_gemsets(root_path)\n @all_gemsets = @all_rubies_gemsets.inject(default){|h,(k,v)| h[k]; h[k][:gemsets]=v; h }\n end",
"title": ""
},
{
"docid": "770a6e2bcc9020433693417baeddafd2",
"score": "0.45932838",
"text": "def load_path(match, options={})\n return [] unless defined?(::Library)\n options = valid_load_options(options)\n\n if from = options[:from]\n libs = ::Library.ledger[from.to_s]\n if libs\n case libs\n when ::Array\n ledger = libs.empty? ? {} : {from.to_s => libs}\n else\n ledger = {from.to_s => libs}\n end\n else\n ledger = {}\n end\n else\n ledger = ::Library.ledger\n end\n\n criteria = [options[:version]].compact\n matches = []\n\n ledger.each do |name, lib|\n list = []\n if Array===lib\n lib = lib.select do |l|\n criteria.all?{ |c| l.version.satisfy?(c) }\n end\n lib = lib.sort.first\n else\n next unless criteria.all?{ |c| lib.version.satisfy?(c) }\n end\n lib.loadpath.each do |path|\n find = File.join(lib.location, path, match)\n list = Dir.glob(find)\n list = list.map{ |d| d.chomp('/') }\n # return relative load path unless absolute flag\n if options[:relative]\n # the extra '' in File.join adds a '/' to the end of the path\n list = list.map{ |f| f.sub(File.join(lib.location, path, ''), '') }\n end\n matches.concat(list)\n end\n # activate the library if activate flag\n lib.activate if options[:activate] && !list.empty?\n end\n\n matches\n end",
"title": ""
},
{
"docid": "dabdfb607f1732f3b544e3f39488920e",
"score": "0.45913622",
"text": "def dependencies\n return [] if libraries_group.nil?\n\n dependency_paths.map do |path|\n # Map each path to a Pathname, expanding $(SRCROOT) or ${SRCROOT}\n # SRCROOT = location of the app project: ./ios\n Pathname.new path.gsub(/\\$(\\(SRCROOT\\)|{SRCROOT})/, 'ios')\n end.select do |pathname|\n # Valid if any path component named node_modules\n pathname.each_filename do |path_component|\n break true if path_component == 'node_modules'\n\n false\n end\n end.map do |pathname|\n # Map each selected Pathname to the root immediately under node_modules\n node_modules_found = false\n pathname.each_filename do |path_component|\n break path_component if node_modules_found\n\n node_modules_found = path_component == 'node_modules'\n '' # In case node_modules is the last component\n # TODO: Then what? Shouldn't happen, of course....\n end\n end\n end",
"title": ""
},
{
"docid": "d8be7602c952a412574049c21cae7923",
"score": "0.45736957",
"text": "def dependency_tree(keg_name, recursive=true, args:)\n deps_for_formula(as_formula(keg_name), args: args\n ).map{ |x| as_formula(x) }\n .reject{ |x| x.nil? }\n .select(&:any_version_installed?\n )\n end",
"title": ""
},
{
"docid": "8f462cd455c8917f5b1d8c8548b031e1",
"score": "0.45662546",
"text": "def gemsets\n @gemsets ||= Dir[File.join(ENV['rvm_gems_path'], \"#{current_ruby}#{ENV['rvm_gemset_separator']}*\")].map do |r|\n File.basename(r).split(ENV['rvm_gemset_separator']).last\n end\n end",
"title": ""
},
{
"docid": "649dad02f69ce7a91a63708935e5180d",
"score": "0.45400566",
"text": "def libraries\n modules = YARD::Registry.all(:module)\n modules.select { |lib| !lib.parent.root? && lib.file =~ /#{@name}/ }\n end",
"title": ""
},
{
"docid": "c51555d1172e7793ef0078b87555c3b0",
"score": "0.45192298",
"text": "def set_IncludeVariations(value)\n set_input(\"IncludeVariations\", value)\n end",
"title": ""
},
{
"docid": "0b8f01c88a1a3cfd2c6638c1824f656e",
"score": "0.45117626",
"text": "def include_paths\n incs = directories\n incs += interface_paths\n incs += external_includes\n dependencies.each { |dep| incs += dep.interface_paths }\n return incs.uniq\n end",
"title": ""
},
{
"docid": "5fb5bf86f829ca4fd42f857d29c87902",
"score": "0.4509715",
"text": "def getVariants(xpathObj)\n \n @variantArr = Array.new\n @variantArr1 = Array.new\n \n @file.xpath(xpathObj).each do |node| \n @variantArr = recursive_child(node) \n if !node.next_sibling.nil? && !node.next_sibling.blank?\n recursive_child(node.next_sibling)\n end \n return @variantArr\n end\n end",
"title": ""
},
{
"docid": "fd014311ce588c20b97f84bcb52cfc5a",
"score": "0.44930395",
"text": "def path(match, options={})\n return [] unless defined?(::Library)\n\n if from = options[:from]\n ledger = {from.to_s => ::Library.ledger[from.to_s]}\n else\n ledger = ::Library.ledger\n end\n\n criteria = [options[:version]].compact\n matches = []\n\n ledger.each do |name, lib|\n if Array === lib\n lib = lib.select do |l|\n criteria.all?{ |c| l.version.satisfy?(c) }\n end\n lib = lib.sort.first\n else\n next unless criteria.all?{ |c| lib.version.satisfy?(c) }\n end\n find = File.join(lib.location, match)\n list = Dir.glob(find)\n list = list.map{ |d| d.chomp('/') }\n matches.concat(list)\n end\n\n matches\n end",
"title": ""
},
{
"docid": "f3ee3968aea8aa126679774c30a91b78",
"score": "0.44898543",
"text": "def included\n return [] if workspace.nil?\n @included ||= process_globs(@raw_data['include'])\n end",
"title": ""
},
{
"docid": "e2e531d94ca85894a7cd039c1d1bd35a",
"score": "0.44843894",
"text": "def libs\n @libs ||= lib_info_elements.map {|el| JsLibrary.new(extract_lib_info(el)) }\n end",
"title": ""
},
{
"docid": "8f0181efe0d9765e507462e0bb973f6d",
"score": "0.44764817",
"text": "def dependent_subtrees(&the_proc)\n build_module.dependent_modules.each do |dependent_module|\n the_proc.call(dependent_module.subtree(@external_dependencies_like))\n end\n end",
"title": ""
},
{
"docid": "b43e6e47ca3cd664c2fbb4c80197d1a5",
"score": "0.44676918",
"text": "def get_libraries\n self.sorted_libs.each do |lib|\n library = QEDProject::Libraries::Base.libs[lib]\n l = library.new(self)\n l.generate!\n end\n end",
"title": ""
},
{
"docid": "c207d5cc49cad04223e21a741980825a",
"score": "0.4467175",
"text": "def packages_to_rebuild\n @packages_to_rebuild ||= Set.new\n end",
"title": ""
},
{
"docid": "f94c8c98b364d02fb68728e834751716",
"score": "0.4464788",
"text": "def generate_vagrant_set\n sets = [generate_builtin_set, generate_plugin_set]\n if env_plugin_gem_path && env_plugin_gem_path.exist?\n sets << generate_plugin_set(env_plugin_gem_path)\n end\n Gem::Resolver.compose_sets(*sets)\n end",
"title": ""
},
{
"docid": "8d71955c652985bfe2d92a54cdc37ef2",
"score": "0.44632623",
"text": "def initialize\n @package_roots = Set.new\n end",
"title": ""
},
{
"docid": "a44ebc1cf3868060c282c162be17471c",
"score": "0.44630617",
"text": "def extract_includes(filepath)\n to_process = [filepath]\n ignore_list = []\n list = []\n all_mocks = []\n\n include_paths = @configurator.project_config_hash[:collection_paths_include]\n include_paths = [] if include_paths.nil?\n include_paths.map! {|path| File.expand_path(path)}\n\n while to_process.length > 0\n target = to_process.shift()\n ignore_list << target\n new_deps, new_to_process, all_mocks = extract_includes_helper(target, include_paths, ignore_list, all_mocks)\n list += new_deps\n to_process += new_to_process\n if !@configurator.project_config_hash[:project_auto_link_deep_dependencies]\n break\n else\n list = list.uniq()\n to_process = to_process.uniq()\n end\n end\n\n return list\n end",
"title": ""
},
{
"docid": "471076e0d302915d3a44f7eab8d5e870",
"score": "0.4462888",
"text": "def subtree_only_library_roots(type)\n out = [ ]\n add_if_directory(out, FilePath.new(build_module.root, \"lib\" + lib_suffix + \".\" + type.to_s))\n add_if_directory(out, FilePath.new(build_module.root, \"lib\" + lib_suffix))\n out\n end",
"title": ""
},
{
"docid": "a1f3ee2452f6467980713feb75e305c6",
"score": "0.44622076",
"text": "def find_libs( at, os )\n libs = []\n FileList[ \"#{at}/lib/#{os}/*\" ].each do | l |\n libs.push l\n end\n return libs\nend",
"title": ""
},
{
"docid": "7619f0fc003c8b0bfb7af0200f630876",
"score": "0.4458395",
"text": "def dependencies(_ctx)\n Set.new\n end",
"title": ""
},
{
"docid": "0bd6f6ae51166cfdc2c171e17a74bf1d",
"score": "0.44524786",
"text": "def external_includes\n @system_config.external_includes(@platform) + @configuration.external_includes\n end",
"title": ""
},
{
"docid": "fa592694a4c8681915e0240a6838356e",
"score": "0.4449444",
"text": "def variants_and_option_values(current_currency = nil)\n variants.includes(:option_values).active(current_currency).select do |variant|\n variant.option_values.any?\n end\n end",
"title": ""
},
{
"docid": "511206bcfcca83456e12c545a8e37dfe",
"score": "0.4439755",
"text": "def libraries\n @libraries ||= []\n end",
"title": ""
},
{
"docid": "47699ed85ab2bfedd4f45f1078949f0c",
"score": "0.44385073",
"text": "def bin_paths\n path.children.reject{ |child| child.basename.to_s =~ /^lib/ }\n end",
"title": ""
},
{
"docid": "9760a949026fa4e09c549b61a0e07476",
"score": "0.4436993",
"text": "def vendored\n vendored_file_paths.inject({}) do |v, fp|\n vendored_file = fp.split('/')\n vendor_index = vendored_file.index('vendor')\n\n # only process vendor'd dirs:\n next v if vendor_index + 2 == vendored_file.size\n\n vname = vendored_file[vendor_index + 1]\n vversion = nil\n # TODO: set vversion from version.rb:\n # vf.last.downcase == 'version.rb'\n v[vname] = vversion\n v\n end\n end",
"title": ""
},
{
"docid": "478e84e40bf13caa4113dde13d635910",
"score": "0.44346616",
"text": "def build_products(installer, path)\n dlext = RbConfig::CONFIG[\"DLEXT\"]\n lib_dirs = installer.spec.require_paths.join(',')\n Dir.glob(\"#{path}/{#{lib_dirs}}/**/*.#{dlext}\")\n end",
"title": ""
},
{
"docid": "49d20ead4945580b5e7e9e312a34b8bd",
"score": "0.44331047",
"text": "def all_selected_source_packages(manifest)\n names = Set.new\n roots = each_source_package_name.to_set\n roots.each do |pkg_name|\n manifest.find_autobuild_package(pkg_name).all_dependencies(names)\n end\n names.merge(roots).map do |pkg_name|\n manifest.find_package_definition(pkg_name)\n end\n end",
"title": ""
},
{
"docid": "e7078d73a74d820d35901802642c85a1",
"score": "0.44227308",
"text": "def included_dirs\n @included_dirs ||= []\n end",
"title": ""
},
{
"docid": "8c08d3a5e9ab5d58f2271ec4a28904e6",
"score": "0.44154155",
"text": "def _rg_invariants # :nodoc:\n @_rg_invariants ||= []\n end",
"title": ""
},
{
"docid": "72d978d795e1530e42b3bb3f0adacecb",
"score": "0.43953562",
"text": "def paths() = @paths ||= Set.new",
"title": ""
},
{
"docid": "ea734f48068c0da23a25965a71717d79",
"score": "0.4390498",
"text": "def IncludeFiles\n @IncludeFileSet.FilePaths()\n end",
"title": ""
},
{
"docid": "3d07a34d1686c95e0277953d6a6e2050",
"score": "0.4384566",
"text": "def required_gemset\n @required_gemset ||= GemSet.new(self.class.canonical_gem_hash_array)\n end",
"title": ""
},
{
"docid": "706c08e312ab260b2c052681d8c7bb47",
"score": "0.43789163",
"text": "def getDeps(name,version)\n #If it's just a bare version number assume it should be explicit requirement\n if !(version.include? ' ') then\n version = \"= \" + version\n end\n\n #Returns an array of hashes one for each possible version for that name\n gem_versions = Gems.dependencies [name]\n\n #If no explicit version is set or a beta version, find a better version\n if version == \">= 0\" or version == \"= 0\" or version =~ /[[:alpha:]]/ then\n gem_versions.each do |gem_version|\n if gem_version[:number] !~ /[[:alpha:]]/ then\n if (Gem::Version.new(gem_version[:number]) < Gem::Version.new(version.split(' ')[1])) or version.split(' ')[1] == \"0\" then\n version = \">= \" + gem_version[:number]\n end\n end\n end\n end\n\n #Add the current gem if the hash key has no value\n if $dependencies[name] == nil then\n $dependencies[name] = Array.new [version]\n else #Otherwise append\n $dependencies[name].push(version)\n end\n \n #Loop through hash array looking for right version\n gem_versions.each do |gem_version|\n\n if gem_version[:number] == version.split(' ')[1] then\n #Loop through the depenencies for a given version\n gem_version[:dependencies].each do |dep|\n dep_name = dep[0]\n dep_version = dep[1]\n exists = false\n\n #If a value exists append to existing key otherwise make a new array\n if $dependencies[dep_name] != nil then\n #Check if that version is already in the hash\n #Only check on versions that haven't been checked yet\n #Should fix endless recursion on circular dependencies\n $dependencies[dep_name].each do |other_version|\n if dep_version == other_version then\n exists = true\n end\n end\n #else\n # $dependencies[dep_name] = Array.new\n end\n\n if exists == false then\n\t #If it's a comma separated list of deps check one at a time\n if dep_version.include? ',' then\n dep_version.split(',').each do |comma_dep|\n getDeps(dep_name,comma_dep)\n end\n\t else #Look for subdependencies\n getDeps(dep_name,dep_version)\n\t end \n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "9ed6590cb078f334281174f9ca0638bb",
"score": "0.43775514",
"text": "def find_any(path, options={})\n options = options.merge(:main=>true)\n\n latest = options[:latest]\n\n # TODO: Perhaps the selected and unselected should be kept in separate lists?\n unselected, selected = *partition{ |name, libs| Array === libs }\n\n # broad search of pre-selected libraries\n selected.each do |(name, lib)|\n if ftr = lib.find(path, options)\n next if Library.load_stack.last == ftr\n return ftr\n end\n end\n\n # finally a broad search on unselected libraries\n unselected.each do |(name, libs)|\n libs = libs.sort\n libs = [libs.first] if latest\n libs.each do |lib|\n ftr = lib.find(path, options)\n return ftr if ftr\n end\n end\n\n nil\n end",
"title": ""
},
{
"docid": "9ed6590cb078f334281174f9ca0638bb",
"score": "0.43775514",
"text": "def find_any(path, options={})\n options = options.merge(:main=>true)\n\n latest = options[:latest]\n\n # TODO: Perhaps the selected and unselected should be kept in separate lists?\n unselected, selected = *partition{ |name, libs| Array === libs }\n\n # broad search of pre-selected libraries\n selected.each do |(name, lib)|\n if ftr = lib.find(path, options)\n next if Library.load_stack.last == ftr\n return ftr\n end\n end\n\n # finally a broad search on unselected libraries\n unselected.each do |(name, libs)|\n libs = libs.sort\n libs = [libs.first] if latest\n libs.each do |lib|\n ftr = lib.find(path, options)\n return ftr if ftr\n end\n end\n\n nil\n end",
"title": ""
},
{
"docid": "c2fd69c75cad2699f8cb4eab15ed0462",
"score": "0.4376471",
"text": "def variants_and_option_values(current_currency = nil)\n variants.includes(:option_values).active(current_currency).select do |variant|\n variant.option_values.any?\n end\n end",
"title": ""
},
{
"docid": "56592a0606d8496471b0a577ab3972d4",
"score": "0.43710336",
"text": "def libraries\n collector &:library\n end",
"title": ""
},
{
"docid": "fb882594c8bdecef647ce5d312dfed93",
"score": "0.4365391",
"text": "def collection\n @deleted = params.key?(:deleted) && params[:deleted] == \"on\" ? \"checked\" : \"\"\n\n if @deleted.blank?\n # We need to get variants_including_master\n @collection ||= parent.variants_including_master\n else\n @collection ||= Spree::Variant.only_deleted.where(product_id: parent.id)\n end\n\n params[:q] ||= {}\n\n # @search needs to be defined as this is passed to search_form_for\n @search = @collection.ransack(params[:q])\n @collection = @search.result.includes(variant_includes).page(params[:page]).per(Spree::Config[:admin_variants_per_page])\n end",
"title": ""
},
{
"docid": "cec80d6657444ae4a0924bb74c064f9d",
"score": "0.43625832",
"text": "def include_constants\n @_include_constants ||= Set.new\n end",
"title": ""
},
{
"docid": "16810b86c82834a1eccf79221f585843",
"score": "0.43620253",
"text": "def full_native_library_path(build_results, build_environment)\n out = PathSet.new\n dependent_subtrees do |dependent_subtree|\n out << dependent_subtree.module_only_native_library_path(build_results, build_environment)\n end\n out << module_only_native_library_path(build_results, build_environment)\n out\n end",
"title": ""
},
{
"docid": "22381661da133587d08476965c8ad285",
"score": "0.43602887",
"text": "def get_libraries_recursive_string\n\t\tlibraries = \"\"\n\t\t@subdirs.each do |subdir|\n\t\t\tif subdir.has_library then\n\t\t\t\tlibraries += \"#{subdir.name}/lib#{subdir.name}.la \"\n\t\t\tend\n\t\t\tsubdir_libraries = subdir.get_libraries_recursive_string.split\n\t\t\tsubdir_libraries.each do |subdirlib|\n\t\t\t\tlibraries += \"#{subdir.name}/#{subdirlib} \"\n\t\t\tend\n\t\tend\n\t\treturn libraries.strip\n\tend",
"title": ""
},
{
"docid": "2de417954a3e8e2d0761b92f402e23a1",
"score": "0.43583265",
"text": "def dependencies\n ensure_is_subclass\n @dependencies ||= Set.new\n @dependencies\n end",
"title": ""
},
{
"docid": "c4e3e798cb15b35ea72c6984fb166ab0",
"score": "0.43521556",
"text": "def dependent_gems\n out = []\n Gem.source_index.each do |name,gem|\n gem.dependencies.each do |dep|\n if self.satisfies_requirement?(dep) then\n sats = []\n find_all_satisfiers(dep) do |sat|\n sats << sat\n end\n out << [gem, dep, sats]\n end\n end\n end\n out\n end",
"title": ""
},
{
"docid": "ef2cea89546e62c156c39fa244102f91",
"score": "0.43515992",
"text": "def require_tree(path)\n path = File.expand_path(path)\n\n %x{\n for (var name in Opal.modules) {\n if (#{`name`.start_with?(path)}) {\n Opal.require(name);\n }\n }\n }\n\n nil\n end",
"title": ""
},
{
"docid": "d27606a9578f8acedcf600b98b1b83d2",
"score": "0.43466657",
"text": "def require_tree(path)\n path = File.expand_path(path)\n path = '' if path == '.'\n\n %x{\n for (var name in Opal.modules) {\n if (#{`name`.start_with?(path)}) {\n Opal.require(name);\n }\n }\n }\n\n nil\n end",
"title": ""
},
{
"docid": "0f36ccbd630526a9c1fb3c6a3135e14e",
"score": "0.43413645",
"text": "def sources\n [Bundler::DirectorySource.new(:location => 'vendor'), Bundler::SystemGemSource.instance]\n end",
"title": ""
},
{
"docid": "0764dab381db447005f3e8ef2364dd62",
"score": "0.4337642",
"text": "def sublibrary_names\n prov_fvs = FieldValue.includes(:child_sample)\n .where(parent_id: prov_op_ids, parent_class: \"Operation\")\n prov_sample_names = prov_fvs.map { |fv| fv.sample.try(:name) }\n prov_sample_names.append(sample.name)\n all_sublib_names = oligo_pools.map { |ogp| ogp.names }.flatten\n all_sublib_names.select { |s| prov_sample_names.select { |p| p =~ /#{s}/i }.any? }\n end",
"title": ""
},
{
"docid": "f18adcb76ffdef70858ed658c9cf4474",
"score": "0.4333922",
"text": "def tag_includes_dirs(context)\n [context.registers[:site].source].freeze\n end",
"title": ""
},
{
"docid": "c509101d43dcae0e7141399d0f3dc9b1",
"score": "0.43308747",
"text": "def include_contained_files(solr_parameters)\n solr_parameters[:fq] ||= []\n solr_parameters[:fq] << \"{!join from=file_set_ids_ssim to=id}{!join from=child_object_ids_ssim to=id}id:#{collection_id}\"\n end",
"title": ""
},
{
"docid": "7dfdc6930b2dc6d96d4705fc8aa1e920",
"score": "0.43294054",
"text": "def site_show_all_variants\n variants = Array.new\n # Find all active products in the system\n Product.active.each do |product|\n # Check if it has variants other than the master\n if product.variants.any?\n # Check if this product should be groups\n if !product.display_variants_by_option.blank? &&\n (option_type = OptionType.find_by_name(product.display_variants_by_option))\n # Find all variants and group by specified option type value\n product.variants.group_by_option_type(option_type).each {|v| variants << v}\n else\n # Not grouped so find all variants\n product.variants.each {|v| variants << v}\n end\n else\n # Product only has a master\n variants << product.master\n end\n end\n \n # Paginate variants\n @variants = variants.paginate(\n :per_page => Spree::Config[:admin_products_per_page],\n :page => params[:page])\n \n render :template => 'products/variants_by_option'\n end",
"title": ""
},
{
"docid": "0283e60921f744b48d70401fbc72f4b1",
"score": "0.432225",
"text": "def pdc_variants\n variants.all!.map{ |v| PdcVariant.get_by_release_and_variant(pdc_id, v.uid) }\n end",
"title": ""
},
{
"docid": "96d1457bbe12dd260ee19430f2d3a340",
"score": "0.4321329",
"text": "def find_installs matches\n directories = []\n glob_dir = File.join(@config[:vhost_folders], \"\")\n Find.find(glob_dir) do |path|\n if FileTest.directory?(path)\n begin\n if (Dir.entries(path) & matches).size == matches.size\n folder = path.gsub(glob_dir, \"\")\n add_directory(directories, folder)\n Find.prune\n else\n next\n end\n rescue Errno::EACCES\n next\n end\n end\n end\n directories\n end",
"title": ""
},
{
"docid": "8725401a0ac718ea315f83dba3334053",
"score": "0.43212157",
"text": "def all_selected_packages(validate = true)\n result = Set.new\n root = default_packages(validate).source_packages.to_set\n root.each do |pkg_name|\n find_autobuild_package(pkg_name).all_dependencies(result)\n end\n result | root\n end",
"title": ""
},
{
"docid": "2b1c7524cd5350a26d99064e5f2877ef",
"score": "0.43192422",
"text": "def load_from_gems(name = nil)\n paths = gem_directories.map do |gem_path|\n # we don't exactly know if the provider name matches the main file name that should be loaded\n # so we use globs to get everything like the name\n # this could mean that vsphere5 and vsphere6 are loaded when only vsphere5 is used\n Dir.glob(File.join(gem_path, \"*#{name}*.rb\")).sort.each do |file|\n require file\n end\n end\n paths.flatten\n end",
"title": ""
},
{
"docid": "1126344f56ab98d5ccd52e687fdb2e67",
"score": "0.43149582",
"text": "def select opts\n opts = _prepare_opts opts\n if name = opts.name\n s = set_for_name name\n s = s.select opts\n else\n s = Cabar::Version::Set.new\n each do | name, version_set |\n x = opts.dup\n x.name = name\n r = select x\n s.push(*r.to_a)\n end\n s\n end\n s\n end",
"title": ""
},
{
"docid": "56264f41ad605f58d7c21a5542fc759c",
"score": "0.43137917",
"text": "def recursive_deps\n Formula.expand_deps(self).flatten.uniq\n end",
"title": ""
}
] |
5ac8bc534b59e0d2a07f22b524258870
|
DELETE /wishlists/1 DELETE /wishlists/1.json
|
[
{
"docid": "5194da928added89840a07297a41a43a",
"score": "0.72616506",
"text": "def destroy\n @wishlist.destroy\n respond_to do |format|\n format.html { redirect_to wishlists_url, notice: 'Záznam vo wishliste bol úspešne zmazaný.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "4d02c2afb51ac4b2eb081702b80aea11",
"score": "0.7833978",
"text": "def destroy\n @wish_list = WishList.find(params[:id])\n @wish_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_wish_lists_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d45e56d2dc613b7c0ddd7b33291d8791",
"score": "0.7771679",
"text": "def destroy\n @wishlistitem = Wishlistitem.find(params[:id])\n @wishlistitem.destroy\n\n respond_to do |format|\n format.html { redirect_to wishlistitems_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8153cc13f03d49be420279fb0a7e187d",
"score": "0.7669258",
"text": "def destroy\n @wish_list_item = WishListItem.find(params[:id])\n @wish_list_item.destroy\n\n respond_to do |format|\n format.html { redirect_to wish_list_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5d8f3c00b7f05fb449d7a5fb7f31008f",
"score": "0.7592718",
"text": "def destroy\n @wish_list_item.destroy\n respond_to do |format|\n format.html { redirect_to wish_list_url(@wish_list_item.wish_list), notice: 'Wish list item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cdecbdf95c7424b25cfcf8288f2d0413",
"score": "0.75922793",
"text": "def destroy\n @wishlist = Wishlist.find(params[:id])\n @wishlist.destroy\n\n respond_to do |format|\n format.html { redirect_to wishlists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cdecbdf95c7424b25cfcf8288f2d0413",
"score": "0.75922793",
"text": "def destroy\n @wishlist = Wishlist.find(params[:id])\n @wishlist.destroy\n\n respond_to do |format|\n format.html { redirect_to wishlists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9b5631e7acfc6948150c2d456146986e",
"score": "0.75890505",
"text": "def destroy\n @wish_list.destroy\n respond_to do |format|\n format.html { redirect_to controller: \"account\", action: \"wishlist\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "12d0b6c5a1e3a9add6fafb4cbe8c1a40",
"score": "0.750397",
"text": "def destroy\n @wish_list_item = WishListItem.find(params[:id])\n @wish_list_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(wish_list_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b8a53d557c398491ecad596ddb2dd2ca",
"score": "0.7312257",
"text": "def destroy\n @wishlist.destroy\n respond_to do |format|\n format.html { redirect_to wishlists_url, notice: 'Wishlist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8a53d557c398491ecad596ddb2dd2ca",
"score": "0.7312257",
"text": "def destroy\n @wishlist.destroy\n respond_to do |format|\n format.html { redirect_to wishlists_url, notice: 'Wishlist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7891e6428c9179fed3412bc825b0f2e5",
"score": "0.73056066",
"text": "def destroy\n @college_wish_list = CollegeWishList.find(params[:id])\n @college_wish_list.destroy\n\n respond_to do |format|\n format.html { redirect_to college_wish_lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "41cd6491a969fe58aaf84b56356f37e1",
"score": "0.7258055",
"text": "def destroy\n @wish.destroy\n respond_to do |format|\n format.html { redirect_to wishes_url, notice: 'Wish was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0b8f0425480f63e1bf91dad60270f490",
"score": "0.7245096",
"text": "def destroy\n if @wish.user_id == current_user.id\n @wish = Wish.find(params[:id])\n @wish.destroy\n render json: {}, status: :no_content\n end\n end",
"title": ""
},
{
"docid": "3980b7a1ebeae354d5fd9cd332d74275",
"score": "0.71704745",
"text": "def destroy\n @wish.destroy\n redirect_to wishlist_path(@wish.wishlist_id)\n end",
"title": ""
},
{
"docid": "0c5e3b235028faaf825cab77522f7b96",
"score": "0.7147965",
"text": "def destroy\n LocationsWish.where('wish_id = ?', @wish.id).all.each do |wish|\n wish.destroy\n end\n WishLog.where('wish_by_id= ?', @wish.id).all.each do |wish|\n wish.destroy\n end\n @wish.destroy\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dbc3867d41a707ee41dd04495ecdc8f4",
"score": "0.71236885",
"text": "def delete_list(user, list)\n delete(\"/#{user}/lists/#{list}.json\")\n end",
"title": ""
},
{
"docid": "c134bbd483717bd2c0bd2ed79e93ab50",
"score": "0.70822215",
"text": "def delete_list(list_id)\n rest(\"delete\", \"lists/#{list_id}\")\n\n return true\n end",
"title": ""
},
{
"docid": "f6ebc20c5f28aafaa63540a024cec5b2",
"score": "0.70727193",
"text": "def destroy\n @wishlist = Wishlist.find(params[:id])\n @wishlist.destroy\n redirect_to welcome_homepage_url\n end",
"title": ""
},
{
"docid": "c85d0ef09327e11ba8daa4e6fd9d5268",
"score": "0.70481956",
"text": "def destroy\n @wish.destroy\n redirect_to root_url\n end",
"title": ""
},
{
"docid": "1a3a986fb699d8e63e92cd3205adf233",
"score": "0.7042997",
"text": "def destroy\n @wishlist_item = WishlistItem.find(params[:id])\n @wishlist_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(store_path, :notice => 'Item has been removed from your wishlist.') }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "24eb8fbf3458b88c3a8e96ab79160c52",
"score": "0.69999874",
"text": "def destroy\n @fwlist = Fwlist.find(params[:id])\n @fwlist.destroy\n\t\n respond_to do |format|\n format.html { redirect_to fwlists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "147abb9f383bbb20b1136f2542929c52",
"score": "0.6946307",
"text": "def destroy\n @coffeeshoplist.destroy\n respond_to do |format|\n format.html { redirect_to coffeeshoplists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7d642e0aebec0d2e4d27528aa466aaef",
"score": "0.6896837",
"text": "def destroy\n user = current_user\n item_id = Sneaker.find(params[:id])\n Wishlist.where(sneaker_id: params[:id]).destroy_all\n item_id.destroy\n redirect_to user_path(user)\n end",
"title": ""
},
{
"docid": "95143bcc2d01f1049f03f73837d8ea91",
"score": "0.685979",
"text": "def delete_list(id)\n record \"/todos/delete_list/#{id}\"\n end",
"title": ""
},
{
"docid": "d919ef68c9f78d8e6eba1b9f3ebbae86",
"score": "0.68333113",
"text": "def destroy\n @checklist = Checklist.find(params[:id])\n @checklist.destroy\n\n respond_to do |format|\n format.html { redirect_to checklists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "825ef5789a5ed0ee6e54c653eabf3136",
"score": "0.6809709",
"text": "def destroy\n \t@list = current_user.lists.find params[:list_id]\n @item = @list.items.find(params[:id])\n @item.destroy\n respond_to do |format|\n format.html { redirect_to list_items_path(@list), notice: 'Item was successfully removed.' }\n #format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9b9d81b4be0de12dd170d1f58dd70ea6",
"score": "0.68086785",
"text": "def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to list_types_url, notice: \"Check ya later list.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "95b08c559bd36398f69f4e2f5e722e48",
"score": "0.6804836",
"text": "def destroy\n @todoit_list.destroy\n respond_to do |format|\n format.html { redirect_to todoit_lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a6c8a1293d654f0c910aceb49b1729d8",
"score": "0.6798892",
"text": "def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a6c8a1293d654f0c910aceb49b1729d8",
"score": "0.6798892",
"text": "def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a6c8a1293d654f0c910aceb49b1729d8",
"score": "0.6798892",
"text": "def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8cbe1191c93aa1d85c5255a35234557f",
"score": "0.6793525",
"text": "def destroy\n @mustdo_list.destroy\n respond_to do |format|\n format.html { redirect_to mustdo_lists_url, notice: 'Mustdo list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "32c929981b3696912230723c9ca21b0e",
"score": "0.67919934",
"text": "def destroy\n @list_item = ListItem.find(params[:id])\n @list_item.destroy\n\n respond_to do |format|\n format.html { render :nothing => true}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bebdd4f217c65ec70244b66d4728e0b2",
"score": "0.6771775",
"text": "def delete_list(id)\n query(\"DELETE FROM todos WHERE list_id = $1\", id)\n query(\"DELETE FROM lists WHERE id = $1\", id)\n end",
"title": ""
},
{
"docid": "f9badd85eb2eae5a8564c0586a768dc4",
"score": "0.6763858",
"text": "def destroy\n @invite_list = InviteList.find(params[:id])\n @invite_list.destroy\n\n respond_to do |format|\n format.html { redirect_to invite_lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a70c653c4acc8b380b01eca99d90f58e",
"score": "0.6761606",
"text": "def destroy\n @list = List.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3973b2b4437205f799e164883a906576",
"score": "0.6760039",
"text": "def destroy\n @api_v1_shopping_list.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_shopping_lists_url, notice: 'Shopping list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dea9e08c1c50c4c73e325cf61686ab33",
"score": "0.6758065",
"text": "def destroy\n @mylist = Mylist.find(params[:id])\n @mylist.destroy\n\n respond_to do |format|\n format.html { redirect_to(mylists_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a6101e0667cc0545307f94841e2b3152",
"score": "0.6755026",
"text": "def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to my_lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5b25e42ae05eecafcc844d09097c7152",
"score": "0.6745833",
"text": "def destroy\n @list = List.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5b25e42ae05eecafcc844d09097c7152",
"score": "0.6745833",
"text": "def destroy\n @list = List.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5b25e42ae05eecafcc844d09097c7152",
"score": "0.6745833",
"text": "def destroy\n @list = List.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e0bfcf015981b8027738bb2fd06cc9db",
"score": "0.67202955",
"text": "def destroy\n @gift_list = GiftList.find(params[:id])\n @gift_list.destroy\n\n respond_to do |format|\n format.html { redirect_to gift_lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9d73a471b27d822db574cb770bcc1a55",
"score": "0.6716509",
"text": "def destroy\n @todo_list = TodoList.find(params[:id])\n @todo_list.destroy\n\n respond_to do |format|\n format.html { redirect_to todo_lists_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8c9418278e69316bdfad504cae327f35",
"score": "0.6716176",
"text": "def destroy\n @twitter_list = TwitterList.find(params[:id])\n @twitter_list.destroy\n\n respond_to do |format|\n format.html { redirect_to twitter_lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9d73a471b27d822db574cb770bcc1a55",
"score": "0.6716107",
"text": "def destroy\n @todo_list = TodoList.find(params[:id])\n @todo_list.destroy\n\n respond_to do |format|\n format.html { redirect_to todo_lists_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "93c35cb15d5add89e1bc0605ffb85a10",
"score": "0.67074883",
"text": "def destroy\n @wishlist_project.destroy\n authorize! :destroy, @wishlist_project\n respond_to do |format|\n format.html { redirect_to wishlists_url, notice: 'Wishlist project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4eb1efac2a0a7e6c3841130b5b97bcdd",
"score": "0.67050153",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to lists_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "50e4f116304e6fa000f6d943c3c9fd1f",
"score": "0.669729",
"text": "def destroy\n @mydo_list.destroy\n respond_to do |format|\n format.html { redirect_to mydo_lists_url, notice: 'Mydo list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3d0a3895cf5888fb0f21739c63d7477a",
"score": "0.6688264",
"text": "def destroy\n @check_list.destroy\n respond_to do |format|\n format.html { redirect_to check_lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "946babaf857010488e1007fb69ce0ea2",
"score": "0.6680488",
"text": "def delete(list_id)\n Iterable.request(conf, \"/lists/#{list_id}\").delete\n end",
"title": ""
},
{
"docid": "50cbaccee46f6ba7ced48b177707f96c",
"score": "0.66780615",
"text": "def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to management_lists_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "84c9145cbbe8ae3826e96235bfa27254",
"score": "0.6673011",
"text": "def destroy\n @checklist_item = ChecklistItem.find(params[:id])\n @checklist_item.destroy\n\n respond_to do |format|\n format.html { redirect_to checklist_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "51c9bf6b68bafeb4a53c60897d28468d",
"score": "0.66665983",
"text": "def destroy\n @shoppinglist = Shoppinglist.find(params[:id])\n @shoppinglist.destroy\n\n respond_to do |format|\n format.html { redirect_to shoppinglists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8adbd5ff0e745ea188de1acd7645ae8c",
"score": "0.6663684",
"text": "def destroy\n @friendslist = Friendslist.find(params[:id])\n @friendslist.destroy\n\n respond_to do |format|\n format.html { redirect_to friendslists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "07ea02b6b91249e383d9ba2102548c2a",
"score": "0.66603917",
"text": "def destroy\n @like_list.destroy\n respond_to do |format|\n format.html { redirect_to like_lists_url, notice: 'Like list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0d1eb79c84c07384bf44c1b01bb673c6",
"score": "0.6658265",
"text": "def destroy\n @listed.destroy\n respond_to do |format|\n format.html { redirect_to session[:previous_url] }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e76f0df620662979e44baf8d891fc333",
"score": "0.66501147",
"text": "def destroy\n # @list=List.find(params[:list_id])\n @list_item=@list.list_items.find(params[:id])\n @list_item.destroy\n respond_to do |format|\n format.html { redirect_to @list, notice: 'List item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9ba354341dbb3be5dadb6fe2bb71984d",
"score": "0.6649092",
"text": "def destroy\n @item_list.destroy\n respond_to do |format|\n format.html { redirect_to item_lists_url, notice: 'Item list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d9adda0a63739f3743575398065d9548",
"score": "0.66408885",
"text": "def destroy\n @applist.destroy\n respond_to do |format|\n format.html { redirect_to applists_url, notice: 'Applist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "236799cf101b5fca9628e82226fbda2a",
"score": "0.6638556",
"text": "def destroy\n return if new_record?\n \n @api.delete \"/items/#{shortcode_url}.json\"\n end",
"title": ""
},
{
"docid": "f724a93eae3a1135736a55a1ff506e81",
"score": "0.6633781",
"text": "def destroy\n @list = current_user.lists.find(params[:id])\n @list.destroy\n respond_with(@list, :location => my_lists_url)\n end",
"title": ""
},
{
"docid": "e5139e32b461e206b6575571b157aebf",
"score": "0.6628649",
"text": "def destroy\n @word_list = WordList.find(params[:id])\n @word_list.destroy\n\n respond_to do |format|\n format.html { redirect_to word_lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b3db5a621a645b0c90ac75c1bafc1fb5",
"score": "0.6618453",
"text": "def destroy\n if @item.container_type == 'Wishlist'\n @wishlist = Wishlist.find(@item.container_id)\n @wishlist.items.delete_if{|o| o.id == @item.id}\n @wishlist.save\n elsif @item.container_type == 'Store'\n @store = Store.find(@item.container_id)\n @store.items.delete_if{|o| o.id == @item.id}\n @store.save\n end\n\n @item.destroy\n respond_to do |format|\n @wishlist = Wishlist.find(session[:wishlist_id])\n format.html { redirect_to edit_wishlist_url(@wishlist) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "69bd4d8fe48022b51ac7cff1b932d81d",
"score": "0.6600948",
"text": "def destroy\n @list = @project.lists.find(params[:id])\n @list.destroy\n\n respond_to do |format|\n format.html { redirect_to project_lists_url(@project) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ddc3d79a9c98e7078017a64e79df91cb",
"score": "0.66000557",
"text": "def destroy\n @biachecklist = Biachecklist.find(params[:id])\n @biachecklist.destroy\n\n respond_to do |format|\n format.html { redirect_to biachecklists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f921275631723f6b55738fa02647ecb5",
"score": "0.6595358",
"text": "def destroy\n @shopping_list = ShoppingList.find(params[:id])\n @shopping_list.destroy\n\n respond_to do |format|\n format.html { redirect_to shopping_lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "584e5965f07b28a057fc4153bc98cd3d",
"score": "0.6589709",
"text": "def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "584e5965f07b28a057fc4153bc98cd3d",
"score": "0.6589709",
"text": "def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "584e5965f07b28a057fc4153bc98cd3d",
"score": "0.6589709",
"text": "def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "584e5965f07b28a057fc4153bc98cd3d",
"score": "0.6589709",
"text": "def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "584e5965f07b28a057fc4153bc98cd3d",
"score": "0.6589709",
"text": "def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "584e5965f07b28a057fc4153bc98cd3d",
"score": "0.6589709",
"text": "def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "584e5965f07b28a057fc4153bc98cd3d",
"score": "0.6589709",
"text": "def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1f2dd19f38873a63959bd7ff2707e683",
"score": "0.65856314",
"text": "def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: \"List was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "689d5a07a403c4b765ba178e4aff08a3",
"score": "0.65778697",
"text": "def delete\n client.delete(\"/#{id}\")\n end",
"title": ""
},
{
"docid": "22c567269f930b035038e809167235ee",
"score": "0.6570625",
"text": "def destroy\n @list_item.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "26f4faa02012b8fa03c41377f375e765",
"score": "0.6568373",
"text": "def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'Funcionario deletado com sucesso.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7fe2c2c6aac2335e52d616a5f82f62f8",
"score": "0.65656227",
"text": "def destroy\n @backlog_item.destroy\n respond_to do |format|\n format.html { redirect_to backlog_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "43025c607829fb44191a61d324890040",
"score": "0.6558917",
"text": "def destroy\n @thing_list = ThingList.find(params[:id])\n @thing_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(thing_lists_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "02adf43f043b6eb7f0496508c4a4b2a2",
"score": "0.6549913",
"text": "def destroy\n @list_item.destroy\n respond_to do |format|\n format.html { redirect_to list_path(@list), notice: 'List item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a92ed01b54ee1137eddd816d2f40285c",
"score": "0.6548749",
"text": "def destroy\n @item = TodoItem.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to todo_lists_url }\n format.json {render json: {\n success: true,\n data: [],\n message: \"TodoItem was successfully deleted.\"\n }}\n end\n end",
"title": ""
},
{
"docid": "f6b5b46d75fc102de1ddcbb86817c81f",
"score": "0.6544904",
"text": "def destroy\n @wish_list = WishList.find(params[:wish_list_id])\n @item = @wish_list.items.find(params[:item_id])\n\n if @item.purchased_by == current_user\n @item.purchased_by = nil\n @item.save\n else\n flash[:alert] = \"You do not have permission to unpurchase this Item.\"\n end\n head 200\n end",
"title": ""
},
{
"docid": "ffa3b405d042c5a3b30c1f2544f992ad",
"score": "0.6543673",
"text": "def destroy\n @wellist.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "ee46766766ba7c9330c8e1bbcdd3ae2b",
"score": "0.65434045",
"text": "def destroy\n @keylist.destroy\n respond_to do |format|\n format.html { redirect_to keylists_url, notice: 'Keylist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c8a2cd7f4a597f0596d0087f4dd1c3c8",
"score": "0.6534803",
"text": "def delete_list(params={})\n @obj.delete('delete', @auth.merge(params))\n end",
"title": ""
},
{
"docid": "19a5c1d0e0d643b0580ff1b1cf315505",
"score": "0.65324754",
"text": "def destroy\n @chore_list.destroy\n respond_to do |format|\n format.html { redirect_to chore_lists_url, notice: 'Chore list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3af426f5e14d50b7ae872f3da2d48c41",
"score": "0.65318584",
"text": "def destroy\n @watch_list = WatchList.find(params[:id])\n @watch_list.destroy\n\n respond_to do |format|\n format.html { redirect_to watch_lists_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "80a1668de261058a93c245ce96af54a4",
"score": "0.6527058",
"text": "def destroy\n @whiskey = Whiskey.find(params[:id])\n @whiskey.destroy\n\n respond_to do |format|\n format.html { redirect_to whiskeys_url }\n format.json { head :no_content }\n format.xml { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c2c57c1232895210c869ca1a59959011",
"score": "0.6523771",
"text": "def destroy\n @checklist = Checklist.find(params[:id])\n @checklist.destroy\n\n respond_to do |format|\n format.html { redirect_to(checklists_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "22278054131e199288e88ae5da2b7ae3",
"score": "0.6523263",
"text": "def destroy\n @check_list.destroy\n respond_to do |format|\n format.html { redirect_to check_lists_url, notice: \"Check list was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee838ef29b79f2795b4d65eff189f863",
"score": "0.651709",
"text": "def destroy\n @get_restaurant_list = GetRestaurantList.find(params[:id])\n @get_restaurant_list.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "69521be1f3dbe28b3e15fde1c9e3ae9d",
"score": "0.65165734",
"text": "def destroy\n @list.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: 'The List was destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b542f48463a93c549fa8cf4f042341a0",
"score": "0.6515724",
"text": "def destroy\n @shoppinglist.destroy\n respond_to do |format|\n format.html { redirect_to shoppinglists_url, notice: 'Shoppinglist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "88633e89c4bbd5f1a558c95b3845cd92",
"score": "0.6510861",
"text": "def destroy\n @list_item.destroy\n respond_to do |format|\n format.html { redirect_to list_items_url, notice: 'List item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a87c13d60aa25d400aa3bc6f4bd23923",
"score": "0.6509301",
"text": "def destroy\n @grocery_list = GroceryList.find(params[:id])\n if @grocery_list.destroy\n render status: :ok # 200\n else\n render json: {\n errors: @grocery_list.errors.full_messages\n },\n status: 404\n end\n end",
"title": ""
},
{
"docid": "86faa8c555419d7144a0c7003f760dff",
"score": "0.6504902",
"text": "def delete\n render json: Item.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "93f374ef894a7dd41d27807a47ae9825",
"score": "0.65042526",
"text": "def destroy\n @waiting_list = WaitingList.find(params[:id])\n @waiting_list.destroy\n\n respond_to do |format|\n format.html { redirect_to waiting_lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2798a455fbffaa9d63e0155e663eb532",
"score": "0.65024424",
"text": "def destroy\n @learnwordlist.destroy\n respond_to do |format|\n format.html { redirect_to learnwordlists_url, notice: 'Learnwordlist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "67f5683c82eaa5b6413f5f908f1a39a6",
"score": "0.64952964",
"text": "def destroy\n @bolog_list.destroy\n respond_to do |format|\n format.html { redirect_to bolog_lists_url, notice: 'Bolog list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
5aba93bc385da9a273e0198bffbbe79d
|
numberical form of the fiven number
|
[
{
"docid": "e675d0dc00fe176cc52354889db3b2be",
"score": "0.0",
"text": "def numerize word\n numberized_array = word.split('').map{|alpha| NUMBER[alpha.to_sym]}\n numberized_array.join(',').gsub(',', '')\n end",
"title": ""
}
] |
[
{
"docid": "e37d4f45904a91c41272e3dea88507f9",
"score": "0.7089375",
"text": "def f_number\n return @f_number\n end",
"title": ""
},
{
"docid": "e6ecfc8466e4d5d0bd95d58cb6d67710",
"score": "0.70877635",
"text": "def fnd(n, number)\n\t\t\"%0#{n}d\" % number\n\tend",
"title": ""
},
{
"docid": "1f6702a5ef34913fc066ea858e3bcb51",
"score": "0.6885365",
"text": "def number(n)\n n.to_f\n end",
"title": ""
},
{
"docid": "b4498ba610b0ccc20f88acc4711a8417",
"score": "0.67508304",
"text": "def eft(n); \"#{dft(n)}/#{n}\"; end",
"title": ""
},
{
"docid": "05c7f19a6f681e69396a84f2856ef42b",
"score": "0.67461866",
"text": "def ftoc(num)\n (num - 32) * 5 / 9\nend",
"title": ""
},
{
"docid": "f69ef0d0309a44e0d0c3c6e6c9b3a58f",
"score": "0.6699752",
"text": "def ftoc(f)\n ((f - 32) * (5.0/9.0)).to_i\nend",
"title": ""
},
{
"docid": "8006b63bab4ae275654c865a2c39ef79",
"score": "0.6674525",
"text": "def ftoc(n)\n\t(n - 32)* 5/9.0\nend",
"title": ""
},
{
"docid": "84d31c8d691c35fbf22e8b04622dc167",
"score": "0.6604997",
"text": "def ftoc(num)\n\tf = (num - 32) / 1.8\n\tf.round\nend",
"title": ""
},
{
"docid": "e4614a025461acdc352f7d783cbd3971",
"score": "0.65892786",
"text": "def f(n);x=0;n.to_s.each_char{|c|x+=c.to_i**2};x<=1||x==4?x%4:f(x)end",
"title": ""
},
{
"docid": "0c059362efdff61090c45f6ef752a40c",
"score": "0.6572851",
"text": "def ctof(num)\n\t(num * 9.0 / 5.0) + 32 \nend",
"title": ""
},
{
"docid": "801af737c4d3ac324ac01434ad8227ca",
"score": "0.65382874",
"text": "def ctof(num)\n\t(num * 9.0 / 5) + 32\nend",
"title": ""
},
{
"docid": "43d21af56070d8000749c3f037e71a96",
"score": "0.6534139",
"text": "def ftoc(fahren)\n (5.0/9)* (fahren-32) \nend",
"title": ""
},
{
"docid": "38075b4aec837a8a74041fcb2119a869",
"score": "0.64926374",
"text": "def number n\n fak = 1\n res = 0\n xor = (n > 2) ? peek : 0\n consume(n).reverse.each do |b|\n b ^= xor\n res += fak * b\n# printf \"fak %02x b %02x res %f\\n\", fak, b, res if n == 2\n fak *= 0x80\n end\n res\n end",
"title": ""
},
{
"docid": "43c0dadd6ae3ad4d070f167d52886a12",
"score": "0.6483476",
"text": "def ftoc(temp_in_f)\n (temp_in_f - 32) * 5.0/9.0\nend",
"title": ""
},
{
"docid": "062ba53f99e61e0e837957a8559933ce",
"score": "0.6475997",
"text": "def ftoc(fheit)\n return (fheit.to_f - 32) * 5 / 9\nend",
"title": ""
},
{
"docid": "b48fae34f99a7e84d841e0f850d39ad1",
"score": "0.64464337",
"text": "def %(fraccion)\n re = @num * fraccion.den % @den * fraccion.num\n end",
"title": ""
},
{
"docid": "fd208640d6b987bee29cb38b27388185",
"score": "0.643562",
"text": "def ftoc(temp_f)\n\t (temp_f - 32)*(5/9.0)\n\t\t\n\tend",
"title": ""
},
{
"docid": "f7bcf4edf13127b8fcf1308b2ee14c65",
"score": "0.6413392",
"text": "def\tftoc(f)\n\treturn (f - 32)*5/9\nend",
"title": ""
},
{
"docid": "9d04c00aa179aaa9bae4f2909452c535",
"score": "0.64119655",
"text": "def to_f\n f = self.to_int.to_f\n puts \" Initial f is: #{f}\" if $DEBUG\n puts \" self.raw is: #{self.raw}\" if $DEBUG\n x = self.raw\n (0 .. (@binpt -1)).each {|i|\n puts \"... is is: #{i} \" if $DEBUG\n delta = x[i]*(1.0/(2**(@binpt-i)))\n puts \"... delta is: #{delta} x[#{i}] is #{x[i]}\" if $DEBUG\n f += delta\n }\n puts \"@sign is #{@sign}\" if $DEBUG\n f *@sign\n end",
"title": ""
},
{
"docid": "9d04c00aa179aaa9bae4f2909452c535",
"score": "0.64119655",
"text": "def to_f\n f = self.to_int.to_f\n puts \" Initial f is: #{f}\" if $DEBUG\n puts \" self.raw is: #{self.raw}\" if $DEBUG\n x = self.raw\n (0 .. (@binpt -1)).each {|i|\n puts \"... is is: #{i} \" if $DEBUG\n delta = x[i]*(1.0/(2**(@binpt-i)))\n puts \"... delta is: #{delta} x[#{i}] is #{x[i]}\" if $DEBUG\n f += delta\n }\n puts \"@sign is #{@sign}\" if $DEBUG\n f *@sign\n end",
"title": ""
},
{
"docid": "f2f91c6765948f3dd951b8f268e88750",
"score": "0.6406826",
"text": "def m2_to_ft2(n)\n n * 10.7639\nend",
"title": ""
},
{
"docid": "014f792b9a45d77706350170aeddc171",
"score": "0.6405847",
"text": "def ftoc(f)\n (f - 32) * 5/9.0\nend",
"title": ""
},
{
"docid": "3c53b897c302e6997fb365a3e505aa10",
"score": "0.6371688",
"text": "def ftoc (fahrenheit)\n (fahrenheit-32.0) * 5.0/9.0\nend",
"title": ""
},
{
"docid": "ac4fd9677344afcd888ab8d08d98bdfd",
"score": "0.63624996",
"text": "def ctof(n)\n ((n.to_f * 9) / 5) + 32\nend",
"title": ""
},
{
"docid": "b547efb8112f10be4352b91144e272da",
"score": "0.6350876",
"text": "def conversion(f)\n (f - 32) * 5/9\nend",
"title": ""
},
{
"docid": "f5865992882b1992b25ce04ad0084c4f",
"score": "0.63359976",
"text": "def ftoc( temp )\n\n ( (temp.to_i - 32.0) * 5 / 9 ).ceil\n\nend",
"title": ""
},
{
"docid": "aa6e2513015db00d76fc1ce62e4890c5",
"score": "0.6334738",
"text": "def to_foorth_r\r\n self.to_foorth_n.to_foorth_r\r\n end",
"title": ""
},
{
"docid": "2879e4bdab73d99b1b932f837c54dc07",
"score": "0.6331562",
"text": "def lff_onlyfives1 (n)\r\n fact = 1.0\r\n f = n/5 # f = number of fives rounded down\r\n (1..f).each do |num|\r\n fact *= (5 * num)\r\n fact = zeroshift(fact)\r\n end\r\n fact\r\nend",
"title": ""
},
{
"docid": "a712eb880952536530413faca3974171",
"score": "0.632945",
"text": "def convertToFarenheit(c)\n return c * 9 / 5 + 32\nend",
"title": ""
},
{
"docid": "168d1b2eee7f6a92e83dd7f85c63ce60",
"score": "0.6311007",
"text": "def fatt_r( num )\n if num == 1\n return 1\n else\n return num * fatt_r( num - 1 )\n end\nend",
"title": ""
},
{
"docid": "24c1e811a6b6c44f74995a79c4fb9aaf",
"score": "0.6267545",
"text": "def ftoc(fahrenheit)\n\t(farenheit -32) * 5/9\nend",
"title": ""
},
{
"docid": "df1ab3c8d27358fab7053438f7b989a9",
"score": "0.6265987",
"text": "def ftoc(f_degree)\n\n\t(f_degree - 32.0) * 5.0 / 9.0\n\nend",
"title": ""
},
{
"docid": "2a864a5185e644cfde4bc3b3a851780f",
"score": "0.625159",
"text": "def ctof(num)\n return (num*1.8) + 32\n end",
"title": ""
},
{
"docid": "c7000f3233d521c94a9e0c5b2daa932b",
"score": "0.62454677",
"text": "def ftoc(f)\n((f.to_f - 32)/ 1.8).round(1)\nend",
"title": ""
},
{
"docid": "eab54ef65749a78532a042007ea96a06",
"score": "0.624495",
"text": "def %(fraccion)\n ((@num * fraccion.den) % (@den * fraccion.num))\n end",
"title": ""
},
{
"docid": "5bcaf015123eeebbe6c093a3c4090adf",
"score": "0.622295",
"text": "def n(num)\n wrap(num).abs.strip.to_val\n end",
"title": ""
},
{
"docid": "248a3bf679dfe2c446f7660f446a560a",
"score": "0.62185895",
"text": "def f(num)\n s = 0\n num.to_s.chars{|c|\n s += c.to_i\n }\n return num / s.to_f\nend",
"title": ""
},
{
"docid": "d17c2bc6718cee0fb3ab32c18d7cfeb1",
"score": "0.62100023",
"text": "def ftoc(fahrenheit)\n (fahrenheit - 32) * (5.0/9.0)\nend",
"title": ""
},
{
"docid": "71027424b125bce27b6f969bbffb09b0",
"score": "0.62083757",
"text": "def ftoc (farrenheit)\n return ((farrenheit - 32) * 5.00 / 9.00)\nend",
"title": ""
},
{
"docid": "fb20766cc3d35a7f1a10350b7100d957",
"score": "0.619558",
"text": "def ftoc(ftemp)\n\treturn (ftemp-32) * 5.0/9.0 \nend",
"title": ""
},
{
"docid": "d2b1ab7fad478d08c45551f652e806af",
"score": "0.61932206",
"text": "def ftoc(temp_f)\n #formula\n (temp_f-32) * (5/9.0)\nend",
"title": ""
},
{
"docid": "11ff60d90706875401ac1439eb5c5fe1",
"score": "0.61804605",
"text": "def celsius_to_fahrenheit(n)\n ((n * (9.0 / 5.0)) + 32.0).round(1)\nend",
"title": ""
},
{
"docid": "648a055f5a7118189792967c56b80abd",
"score": "0.61800593",
"text": "def idf\n model.plain_idf('b') / Math.log(10)\n end",
"title": ""
},
{
"docid": "ef7e7b43b1a4ac686dfa681cada80e9e",
"score": "0.6164506",
"text": "def ctof(num)\n num * 9.0 / 5.0 + 32.0\nend",
"title": ""
},
{
"docid": "540e06dff8f56c419c7e7b2d52a261d6",
"score": "0.616428",
"text": "def ftoc(fahrenheit)\n\t(fahrenheit - 32.0) * 5.0 / 9.0\nend",
"title": ""
},
{
"docid": "35400bc7ecdb80fe1f60093b942abb4f",
"score": "0.6155298",
"text": "def calc(temp_f)\n\t\n\ttemp_f.to_i\n\t\n\t(temp_f - 32)* 5/9\n\nend",
"title": ""
},
{
"docid": "fff584e3082c8602c7d0b9743449492a",
"score": "0.615415",
"text": "def temp_f(f)\n (f-32) * (5/9) #formula for converting F to C\nend",
"title": ""
},
{
"docid": "1ef96a2ae74aa66487db95c860d628df",
"score": "0.6147397",
"text": "def to_foorth_n\r\n if /\\di$/ =~ self #Check for a trailing '<digit>i'.\r\n #Check for the internal '+' or '-'sign.\r\n if /(?<=\\d)[+-]/ =~ self\r\n Complex(($PREMATCH).to_foorth_n, ($MATCH + $POSTMATCH).chop.to_foorth_n)\r\n else\r\n Complex(0, self.chop.to_foorth_n)\r\n end\r\n elsif /\\d\\/\\d/ =~ self #Check for an embedded '<digit>/<digit>'.\r\n Rational(self)\r\n elsif /\\d\\.\\d/ =~ self #Check for an embedded '<digit>.<digit>'.\r\n Float(self)\r\n else #For the rest, assume an integer.\r\n Integer(self)\r\n end\r\n rescue\r\n nil\r\n end",
"title": ""
},
{
"docid": "18f6578314cd86ca272bc31530c79a77",
"score": "0.6144864",
"text": "def convert(f)\n (f.to_f - 32) * 5/9\nend",
"title": ""
},
{
"docid": "39e411a05bc556d876c77aadf5f1180c",
"score": "0.61420774",
"text": "def ftoc(tempInF)\n tempInC = (tempInF - 32) / 1.8\n return tempInC.round\nend",
"title": ""
},
{
"docid": "0e78488539de5d7f1b019983f68a8730",
"score": "0.6137521",
"text": "def to_f\n 2**((@value-69)/12.0) * 440\n end",
"title": ""
},
{
"docid": "818d994115dd2254f5aa2f3193376ea8",
"score": "0.612928",
"text": "def pf(f,d=2)\n s = sprintf(\"%.#{d}f\",f)\n s.gsub!(/(\\.0+|(\\.\\d*[1-9])0+)$/, '\\2')\n s\n end",
"title": ""
},
{
"docid": "3b61169be4145ddfe46952ff7d43506e",
"score": "0.610507",
"text": "def mfloat\n\t\t\"#{@num/@den}\"\n\tend",
"title": ""
},
{
"docid": "3b61169be4145ddfe46952ff7d43506e",
"score": "0.610507",
"text": "def mfloat\n\t\t\"#{@num/@den}\"\n\tend",
"title": ""
},
{
"docid": "c2e593b7273dc20ade9766d092835ebe",
"score": "0.6103101",
"text": "def fatorial(n)\n if(n > 1)\n n * fatorial(n-1)\n else\n 1\n end\nend",
"title": ""
},
{
"docid": "5ccdd3392a1f508cbce354814ed27f5f",
"score": "0.6089277",
"text": "def ftoc(temp)\n (temp-32) / 9 * 5.0\n end",
"title": ""
},
{
"docid": "8c35b2f44bf7fbdf954515a26528baf6",
"score": "0.60826695",
"text": "def ftoc temp \n (temp - 32) * (5/9r)\nend",
"title": ""
},
{
"docid": "f61415ac23f085541e4f4e7ad75a97d2",
"score": "0.6071325",
"text": "def f_number=(value)\n @f_number = value\n end",
"title": ""
},
{
"docid": "67b0fa98173b542218762b880a226e05",
"score": "0.6061565",
"text": "def f(x)\n x / 2 - x**2 / 8 + x**3 / 16 - 5 * x**4 / 128\nend",
"title": ""
},
{
"docid": "79d6f9e2bc14260443e136c06ebcdd7c",
"score": "0.60612863",
"text": "def ftoc(temp)\r\n (temp.to_f - 32.0) * (5.0/9.0)\r\nend",
"title": ""
},
{
"docid": "fd21db2c25f09ba7ba8ec0dd333cf394",
"score": "0.60483557",
"text": "def s(n)\n n.digits.reverse.map{|d|d*d}.join.to_i\nend",
"title": ""
},
{
"docid": "0f4352c5973944f77a5e80d9f378c8b5",
"score": "0.6042889",
"text": "def ftoc(temp)\n (temp - 32) * 5.0/9.0\nend",
"title": ""
},
{
"docid": "c2cb14e5c3f6aebf63d67f61fdf5e580",
"score": "0.6040494",
"text": "def ftoc(degF)\n\treturn (degF - 32) * (5.0/9.0) \nend",
"title": ""
},
{
"docid": "6ef2c2604ed7b50f13fbe128d4ea9335",
"score": "0.60306835",
"text": "def ftoc( temp )\n ( temp * 9.0 / 5.0 ) + 32.0\n end",
"title": ""
},
{
"docid": "456233f53f5e72a3dcd1420dd2a5f9b2",
"score": "0.6029224",
"text": "def numFmt; end",
"title": ""
},
{
"docid": "09bbb16691ec23cd7304ae70e00a96cf",
"score": "0.60282385",
"text": "def series_num(n)\n next_number = 1\n sum = 0\n for i in 1..n\n if n == 1\n return \"1.00\"\n else\n puts sum\n sum = sum +(1/next_number.to_f)\n next_number = next_number + 3\n end\n end\n\n output = sum.round(2).to_s\n if output.length < 4\n output = output + \"0\"\n return output\n end\n return output\nend",
"title": ""
},
{
"docid": "ba46c01140f0e72615802360a9f7cba0",
"score": "0.60267067",
"text": "def celcius_to_farenheit(celcius)\n celcius * 1.8 + 32\nend",
"title": ""
},
{
"docid": "02816b5b913bd0eff038761a4adbf23f",
"score": "0.60218143",
"text": "def fatt(n)\n if n < 1 then\n return 1 ;\n else\n return n*fatt(n-1) ;\n end\nend",
"title": ""
},
{
"docid": "1a35ecf99a748dd48304c0e4846b2892",
"score": "0.60163486",
"text": "def fermat_factor(n)\n a = Math.sqrt(n).ceil\n bsq = a**2 - n\n while not square?(bsq)\n # puts \"a: #{a} b: #{bsq}\"\n a += 1\n bsq = a**2 - n\n end\n b = Math.sqrt(bsq)\n [(a+b).to_i, (a-b).to_i]\nend",
"title": ""
},
{
"docid": "1caa60c291c9de295454591f8b8e8fb3",
"score": "0.60061395",
"text": "def dibromobenzene_fifty()\n end",
"title": ""
},
{
"docid": "82b97feae245ca4c98c56e44de5a390a",
"score": "0.6001891",
"text": "def convert_F_to_C(farenheit)\n\t ((farenheit -32.0)/1.8).to_f\nend",
"title": ""
},
{
"docid": "58efdd5d7a656fa6b5a8268806e5c534",
"score": "0.59973025",
"text": "def ftoc fahrenheit\n\t(fahrenheit - 32) * (5.0 / 9)\nend",
"title": ""
},
{
"docid": "b7562eaa9a9da0c96d09263c9022f9cf",
"score": "0.59905124",
"text": "def number\n\t\tdigit\n\t\tnumber_tail\n\tend",
"title": ""
},
{
"docid": "cd358cf26af301021382c58f68d32d1f",
"score": "0.5989207",
"text": "def ftoc(degrees)\n\treturn (degrees - 32) * 5/9 \nend",
"title": ""
},
{
"docid": "8700b3c8cef98caa98cbe6bff9ad72f0",
"score": "0.59874254",
"text": "def ftoc\n ( @fahrenheit - 32 ) * ( 5.0 / 9.0 )\n end",
"title": ""
},
{
"docid": "89d56d3a7c8ade64834494b5a2a3cc52",
"score": "0.5977867",
"text": "def f_to_c(f)\n ((f-32)*5/9).floor\nend",
"title": ""
},
{
"docid": "4ef83f34d8c471c5455bf3e4051d78f1",
"score": "0.5973967",
"text": "def number_of_zero_for_f(n)\n\t# n が奇数なら必ず 0.\n\treturn 0 if n.odd?\n\n\tnumber_of_five = 0\n\t# n が偶数の場合, 2, 4, ..., n の中の約数5の個数を数える.\n\tnumber_to_divide = 5\n\twhile (number_to_divide * 2 <= n)\n\t\tnumber_of_five += n / 2 / number_to_divide\n\t\tnumber_to_divide *= 5\n\tend\n\tnumber_of_five\nend",
"title": ""
},
{
"docid": "dab96a2c1c2fa91064a1c0942dadba62",
"score": "0.5962726",
"text": "def f!() to_s.scan(/[\\d\\.]+/).join.to_f end",
"title": ""
},
{
"docid": "7ca38f9aff0b92756b6549080668aead",
"score": "0.59595215",
"text": "def convert(f)\n (f - 32.0) * 5 / 9\nend",
"title": ""
},
{
"docid": "d0a9a61e88fd58443140411508406adb",
"score": "0.59559596",
"text": "def f ( x )\n return (1 * (x**3)) + ((-16) * (x**2)) + (73 * x) + (-90)\nend",
"title": ""
},
{
"docid": "6d1c7e70cf20eb10328cf2d577f7389c",
"score": "0.5943489",
"text": "def ftoc(temp)\n\t( temp - 32 ) * ( 5.0 / 9.0 )\nend",
"title": ""
},
{
"docid": "374faca74f00faebbb47c2a527991832",
"score": "0.5938204",
"text": "def c_to_f (input)\n\t#output = input*(9.0/5)+32\n\t#return output\n\tinput*(9.0/5)+32\nend",
"title": ""
},
{
"docid": "dee8e5e08b7cef9f43fcedcd146bddb2",
"score": "0.5929035",
"text": "def to_fahrenheit\n\t\t(@temp * 1.8) + 32\n\tend",
"title": ""
},
{
"docid": "85ff0e50a024535a2337f75181118035",
"score": "0.59269124",
"text": "def ftoc(temp)\n c = (temp.to_f - 32) * 5/9\nend",
"title": ""
},
{
"docid": "871aed10255869f59fe3fb26d61eb31d",
"score": "0.59268135",
"text": "def ftoc(faren)\n\n\t( faren - 32 ) * ( 5.0 / 9.0 )\n\nend",
"title": ""
},
{
"docid": "166a80968b53d8e81ebede14b7d691c9",
"score": "0.592542",
"text": "def expanded_form(num)\n operand = 0\n numbers = num.digits.map do|x| \n operand = (operand == 0 ? 1 : operand * 10)\n (x * operand).to_s\n end\n numbers.reverse.reduce {|final, num| final + \" + \" + num }\n\nend",
"title": ""
},
{
"docid": "91e4421247ec5216799f192cc447a0d3",
"score": "0.5923557",
"text": "def expanded_form(num)\n num.digits.map.with_index do |value, index|\n value*(10**index) if value > 0\n end.compact.reverse.join(\" + \")\nend",
"title": ""
},
{
"docid": "0cfbaafb3209914d76b28b98e2eba05b",
"score": "0.59188396",
"text": "def to_f; @int.to_f + @frac.to_f/(2**32); end",
"title": ""
},
{
"docid": "300e6753f9daf1ed06284371cf2d3eba",
"score": "0.5918152",
"text": "def f2c(x)\n ((x-32) * 5)/9\nend",
"title": ""
},
{
"docid": "eed9b416636c8ccf5e6455f6a1dc738b",
"score": "0.59168464",
"text": "def expanded_form(num)\n digits_column = 1\n expanded_version = []\n\n num.to_s.reverse.chars.each do |digit|\n if digit != \"0\"\n expanded_version << digit.to_i * digits_column\n end\n digits_column *= 10\n end\n\n expanded_version.reverse.join(\" + \")\nend",
"title": ""
},
{
"docid": "7e73932b5a4e5d388fb811a84af25f1c",
"score": "0.5909228",
"text": "def ftoc(temp)\n\t(temp - 32) * 5.0 / 9.0\nend",
"title": ""
},
{
"docid": "b875a15b78334d429f4e2265d2dd65ea",
"score": "0.5908857",
"text": "def ftoc(temp_in_celsius)\n\t(temp_in_celsius - 32) * (5.0/9.0)\nend",
"title": ""
},
{
"docid": "6954bbb4b6d69e33ccf15f5863fb3935",
"score": "0.59060496",
"text": "def ctof (farrenheit)\nconvert = (farrenheit * 1.8) + 32\nreturn convert\nend",
"title": ""
},
{
"docid": "5f3d437eb672e50df4621499ab480b73",
"score": "0.5898381",
"text": "def round_1_sig_fig n \n get_first_digit(n) * 10**length(n)\nend",
"title": ""
},
{
"docid": "66d3b6a4971262dd57e42a0a5ce2961c",
"score": "0.58929986",
"text": "def number; end",
"title": ""
},
{
"docid": "66d3b6a4971262dd57e42a0a5ce2961c",
"score": "0.58929986",
"text": "def number; end",
"title": ""
},
{
"docid": "66d3b6a4971262dd57e42a0a5ce2961c",
"score": "0.58929986",
"text": "def number; end",
"title": ""
},
{
"docid": "66d3b6a4971262dd57e42a0a5ce2961c",
"score": "0.58929986",
"text": "def number; end",
"title": ""
},
{
"docid": "66d3b6a4971262dd57e42a0a5ce2961c",
"score": "0.58929986",
"text": "def number; end",
"title": ""
},
{
"docid": "66d3b6a4971262dd57e42a0a5ce2961c",
"score": "0.58929986",
"text": "def number; end",
"title": ""
},
{
"docid": "66d3b6a4971262dd57e42a0a5ce2961c",
"score": "0.58929986",
"text": "def number; end",
"title": ""
}
] |
9a42e5f33c42f61a14d7f2ce4d24ea0f
|
DELETE /pack_items/1 DELETE /pack_items/1.xml
|
[
{
"docid": "2813759801a33180a2d1fd052a5233c7",
"score": "0.7459959",
"text": "def destroy\n @pack_item = PackItem.find(params[:id])\n @pack_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(pack_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] |
[
{
"docid": "80fd17e13e72300c2dbe99380d651497",
"score": "0.72381145",
"text": "def destroy\n @pack_item_subitem = PackItemSubitem.find(params[:id])\n @pack_item_subitem.destroy\n\n respond_to do |format|\n format.html { redirect_to(pack_item_subitems_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7b54b89fd89556b75ac9e9ce4cb06178",
"score": "0.6776598",
"text": "def destroy\n @pack = Pack.find(params[:id])\n @pack.destroy\n\n respond_to do |format|\n format.html { redirect_to(packs_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c15861db68361345d0f6ad3ddbbad813",
"score": "0.67385006",
"text": "def destroy\n @item_pack.destroy\n respond_to do |format|\n format.html { redirect_to item_path(@item_pack.item), notice: 'Item pack was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "aa87577c41551597e276bb7e78afdc78",
"score": "0.67093414",
"text": "def destroy\n @pack = Pack.find(params[:id])\n @pack.destroy\n\n respond_to do |format|\n format.html { redirect_to(scaffold_packs_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6d3d5c2903da04e5086694ef9dd1249d",
"score": "0.66879",
"text": "def delete\n api_xml(category(target),:delete) if options.data or options.category\n if options.itemdef\n parse_itemdef\n uid=find_definition_uid_by_name(itemdef.name)\n response=admin_xml(\"/itemDefinitions/#{uid}\")\n verbose \"About to delete: #{REXML::XPath.first(response,'//Name/text()').value} item definition.\\n\"\n admin_xml(\"/itemDefinitions/#{uid}\",\n :delete) if itemdef.name\n end\n end",
"title": ""
},
{
"docid": "4bd0bb2e50845550e54587a057b77341",
"score": "0.6530122",
"text": "def destroy\n @bpack = Bpack.find(params[:id])\n @bpack.destroy\n\n respond_to do |format|\n format.html { redirect_to(bpacks_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f4fa184dbf2c82111957831b75ef063e",
"score": "0.6440595",
"text": "def destroy\n @items = Item.find(params[:id])\n @items.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "df26116eb86dbadafed7137f9e3c2f9e",
"score": "0.6416811",
"text": "def delete!\r\n return nil unless exists? \r\n xml = xml_at_top\r\n par = xml.instance_variable_get(:@parent) \r\n par['delete'] = 'delete'\r\n xml_on_delete( xml )\r\n rsp = write_xml_config!( xml.doc.root )\r\n @has[:_exist] = false\r\n true # rsp ... don't return XML, but let's hear from the community...\r\n end",
"title": ""
},
{
"docid": "e51f2b7d7a487e377012f0ebf2d3f9dc",
"score": "0.64149004",
"text": "def destroy\n @pack = Pack.find(params[:id])\n @pack.destroy\n\n head :no_pack\n end",
"title": ""
},
{
"docid": "d496e8714709f1e014ad13f7504c98c9",
"score": "0.6400625",
"text": "def delete(item); end",
"title": ""
},
{
"docid": "d496e8714709f1e014ad13f7504c98c9",
"score": "0.6400625",
"text": "def delete(item); end",
"title": ""
},
{
"docid": "c5aa57c943de7fad00d8adf263856cb9",
"score": "0.63629794",
"text": "def delete_item(id)\n delete_request configure_payload(\"/items/#{id}\")\n end",
"title": ""
},
{
"docid": "395c8a5a4f87606c63b357a6c6b35797",
"score": "0.6355058",
"text": "def destroy\n @item = @project.items.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(project_items_path(@project)) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fcf0fa86db2cf222b4b7017c7a2d0a1a",
"score": "0.6341416",
"text": "def folder_delete(path)\n make_request(:delete,\"#{folders_url(path)}.xml\")\n end",
"title": ""
},
{
"docid": "5f57ad1fb2c009e3edf6662932844754",
"score": "0.6334378",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n \n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "963d86bdc6b43abe19b8b8a4115fb553",
"score": "0.6331997",
"text": "def delete(item, type = ROOM_ITEMS, list = false)\n case type\n when ROOM_ITEMS:\n when TEMPLATE_ITEMS:\n else\n raise RTC::Error, \"invalid-type\"\n end\n\n durl = \"#{contentURL}/#{type}/#{item}\"\n\n\tif list\n\t limitCount = \"\"\n\telse\n\t limitCount = \"&count=0\"\n\tend\n\n data = \"action=delete&response=inline#{limitCount}&#{@authToken}\"\n res = RTC::http_post(durl, data, @authHeaders)\n\tputs res if RTC::DEBUG\n\n response = REXML::Document.new(res).root\n return response\n end",
"title": ""
},
{
"docid": "1e8e19ff3578e932db9a80843a48d336",
"score": "0.6329061",
"text": "def destroy\n @pack.destroy\n respond_to do |format|\n format.html { redirect_to item_packs_path, notice: \"Pack was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4dad9e2f6768aa0c22844d5dcf86da78",
"score": "0.6327181",
"text": "def destroy\n @pack = Pack.find(params[:id])\n @pack.destroy\n\n respond_to do |format|\n format.html { redirect_to packs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4dad9e2f6768aa0c22844d5dcf86da78",
"score": "0.6327181",
"text": "def destroy\n @pack = Pack.find(params[:id])\n @pack.destroy\n\n respond_to do |format|\n format.html { redirect_to packs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ac6c2c917f4013ce39a802eba1d6c5b2",
"score": "0.6319535",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "65713f5473d3dd92e4dc04f531e4d88b",
"score": "0.63174576",
"text": "def destroy\n @item = Item.get(params[:id])\n if @item\n container_id = @item.parent.id\n @item.destroy\n else\n container_id = Container.root_id\n end\n respond_to do |format|\n flash[:notice] = 'item was successfully deleted.'\n format.html { redirect_to(container_url(container_id)) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1dfd807c3461d691cc42abf79f73bb62",
"score": "0.630856",
"text": "def purge(item)\n end",
"title": ""
},
{
"docid": "ca372d4b88c569db9e73213d15115bf5",
"score": "0.6288851",
"text": "def delete_item(item)\n \t@items.delete(item)\n end",
"title": ""
},
{
"docid": "7fe89c6f7bb0f8216685a95225a5f8de",
"score": "0.62866455",
"text": "def destroy\r\n @item = Item.find(params[:id])\r\n\r\n @item.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(items_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"title": ""
},
{
"docid": "5527bc72a4dffd08cb79e49b6b56a5f0",
"score": "0.6284513",
"text": "def destroy\n @item_fabric = ItemFabric.find(params[:id])\n @item_fabric.destroy\n\n respond_to do |format|\n format.html { redirect_to(item_fabrics_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "710adb529d91075f6bdb66c8ea00efa8",
"score": "0.6277917",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e245bab1d82984fdc590b386b1514b9d",
"score": "0.6274569",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e245bab1d82984fdc590b386b1514b9d",
"score": "0.6274569",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e245bab1d82984fdc590b386b1514b9d",
"score": "0.6274569",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e245bab1d82984fdc590b386b1514b9d",
"score": "0.6274569",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e245bab1d82984fdc590b386b1514b9d",
"score": "0.6274569",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e245bab1d82984fdc590b386b1514b9d",
"score": "0.6274569",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e245bab1d82984fdc590b386b1514b9d",
"score": "0.6274569",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e245bab1d82984fdc590b386b1514b9d",
"score": "0.6274569",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e245bab1d82984fdc590b386b1514b9d",
"score": "0.6274569",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e245bab1d82984fdc590b386b1514b9d",
"score": "0.6274569",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e245bab1d82984fdc590b386b1514b9d",
"score": "0.6274569",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e245bab1d82984fdc590b386b1514b9d",
"score": "0.6274569",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e245bab1d82984fdc590b386b1514b9d",
"score": "0.6274569",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e245bab1d82984fdc590b386b1514b9d",
"score": "0.6274569",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5e42276a010d63e1512f82e81ecffa1a",
"score": "0.6268085",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(homes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "045d637d57ef73d144cab34aa71a6ec0",
"score": "0.6266586",
"text": "def delete(item)\n end",
"title": ""
},
{
"docid": "5db28defc5db9e0ab954ab9fd61aa51e",
"score": "0.62485015",
"text": "def destroy_rest\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "960d4e90789b343b763882d17612270e",
"score": "0.62448764",
"text": "def destroy\n @catalog_item = CatalogItem.find(params[:id])\n @catalog_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(catalog_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "879982a7efd69b07301a6ff459b5bcd3",
"score": "0.62224406",
"text": "def destroy\n @item_boni = ItemBoni.find(params[:id])\n @item_boni.destroy\n\n respond_to do |format|\n format.html { redirect_to(item_bonis_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5b9427e4b1f2b5b80ea388a14941dc50",
"score": "0.6217843",
"text": "def destroy\n @Item = Item.find(params[:id])\n @Item.destroy\n\n respond_to do |format|\n format.html { redirect_to(:controller => :items) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "78830f9307d1aee14fa073b857afd64c",
"score": "0.6204411",
"text": "def destroy\n @itemcontent = Itemcontent.find(params[:id])\n @itemcontent.destroy\n\n respond_to do |format|\n format.html { redirect_to(itemcontents_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "98b0c3c8a0737f499234ef9786df751e",
"score": "0.62039447",
"text": "def destroy\n @transaction_goods_item = Transaction::Goods::Item.find(params[:id])\n @transaction_goods_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(transaction_goods_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0143a989b5628073b5c7657a958e6d1f",
"score": "0.6203433",
"text": "def delete_item(x)\n\t\t@get_items.delete(x)\n\tend",
"title": ""
},
{
"docid": "1baff10a01af999694e37ebcced09e64",
"score": "0.6192586",
"text": "def destroy\n @item = @package.items.find(params[:id])\n @item.destroy\n render :json => true\n #respond_to do |format|\n # format.html { redirect_to @package }\n # format.json { head :no_content }\n #end\n end",
"title": ""
},
{
"docid": "9fe2641ee8bd0aeb2736d9365447c5e9",
"score": "0.61887544",
"text": "def destroy\n @master_item = Master::Item.find(params[:id])\n @master_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(master_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "93986282179c56e2156ae4a6ad359a66",
"score": "0.6154924",
"text": "def destroy\n @item = @group.items.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to group_items_path(@group) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "20ec5155d440e780c2935a0b2d013896",
"score": "0.61467177",
"text": "def destroy\n @item_api = ItemApi.find(params[:id])\n @item_api.destroy\n\n respond_to do |format|\n format.html { redirect_to(item_apis_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "03c7f9d592a0148c35cc89089c91d8d8",
"score": "0.6143562",
"text": "def destroy\n @content_item = ContentItem.find(params[:id])\n @content_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(content_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "646ba22af0786da45d855d5db756750b",
"score": "0.6140127",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(itens_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e6033d53a6cef526d0c87c41c4922563",
"score": "0.61399925",
"text": "def destroy\n @items_ordered = ItemsOrdered.find(params[:id])\n @items_ordered.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_ordereds_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0a998c8fd02fce38b158a7e6ad3276d1",
"score": "0.613135",
"text": "def destroy\n @packing = Packing.find(params[:id])\n @packing.destroy\n\n respond_to do |format|\n format.html { redirect_to(packings_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ca59f7d3136edc8410a571add3f80122",
"score": "0.6126671",
"text": "def destroy\n @item_definition = ItemDefinition.find(params[:id])\n @item_definition.destroy\n\n respond_to do |format|\n format.html { redirect_to(item_definitions_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9681069774c25ffd8e3885db0d8531b6",
"score": "0.61174387",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.item_attachments.all.find(params[:attachment_id]).destroy\n end",
"title": ""
},
{
"docid": "ff62df4107e02e1729282d83543a064e",
"score": "0.6116604",
"text": "def destroy\n @item.destroy\n @item.item_image.purge\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Le matériel a été supprimé' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "30c9b08257499257deea75a1823f0335",
"score": "0.6105627",
"text": "def package_delete\n load_content_package(Package.delete(params[:id]))\n end",
"title": ""
},
{
"docid": "7db1304da47c1a9a411039146c06efa6",
"score": "0.60965496",
"text": "def destroy\n chef_server_rest.delete_rest(\"packs/#{@name}\")\n end",
"title": ""
},
{
"docid": "6908a24c8f6b7fe3f786729ccb73fb0e",
"score": "0.60907066",
"text": "def destroy\n @request_item = RequestItem.find(params[:id])\n @request_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(request_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9d1d53a9c3b314220d42056868fdc128",
"score": "0.6086515",
"text": "def destroy \n @trans_item = TransItem.find(params[:id])\n @trans_item.destroy\n\n respond_to do |format|\n flash[:notice] = 'Item telah dihapus'\n format.html { redirect_to(trans_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f646e13ebb1b7fd109a147d96ec95a07",
"score": "0.6085657",
"text": "def destroy\n @broken_item = BrokenItem.scopied.find(params[:id])\n @broken_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(broken_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "85a8f9f4a78375cdf794cb10cde5ced4",
"score": "0.60840744",
"text": "def delete(name)\r\n id = name_to_id(name)\r\n self.class.delete(\"/cards/#{id}.xml\")\r\n end",
"title": ""
},
{
"docid": "53f726edb49ea41e0ac73c994854a2b1",
"score": "0.607283",
"text": "def destroy_rest\n @entry_item = EntryItem.find(params[:id])\n @entry_item.destroy\n\n respond_to do |format|\n #format.html { redirect_to(entry_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c5ec785fae7224238fae5dfa3578a2f8",
"score": "0.6071877",
"text": "def delitem\n Equipment.delete(params['id']);\n end",
"title": ""
},
{
"docid": "a7996909219def4089eb89e8d1f2b84a",
"score": "0.60710967",
"text": "def destroy\n @package_item = PackageItem.find(params[:id])\n @package_item.destroy\n\n respond_to do |format|\n format.html { redirect_to package_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "714504497b5b4fdbe39b81ce307f9b0a",
"score": "0.6068413",
"text": "def destroy\n @itemmodo.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "d1dbb713630b5b93c2ff1fbdf3ba01b0",
"score": "0.6047134",
"text": "def delete_item token, item_id\n uri = URI.parse \"https://#{get_hostname(token)}/sf/v3/Items(#{item_id})\"\n puts uri\n \n http = Net::HTTP.new uri.host, uri.port\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n \n request = Net::HTTP::Delete.new(uri.request_uri)\n request[\"Authorization\"] = get_authorization_header(token)\n \n response = http.request request\n puts \"#{response.code} #{response.message}\"\n if response.kind_of? Net::HTTPNoContent\n puts \"Deleted Item\"\n end\nend",
"title": ""
},
{
"docid": "f8ec8cfbf35af3ea39960aba684b1a3e",
"score": "0.6047042",
"text": "def destroy\n url = @item.block.page.get_page_path\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to url }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9e68abaadc1a9b2b433e606e8123cf1f",
"score": "0.60402715",
"text": "def destroy\n @item.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "1d871b1a54c73d6ac98109b5bb317202",
"score": "0.6034589",
"text": "def delete(path)\n abs_path = full_path(path)\n item_id = get_item_id(abs_path)\n return false if item_id.nil?\n delete_by_id(item_id)\n end",
"title": ""
},
{
"docid": "77d98f6ee0d2cd7f2405f9bfe532d529",
"score": "0.6034574",
"text": "def destroy\n @item = Item.find(params[:id])\n hash_id = @item.list.hash_id\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to('/list/' + hash_id) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "371fb3da2478224496d000c727077075",
"score": "0.6032893",
"text": "def destroy\n @inventory_item = user_default_branch.inventory_items.find(params[:id])\n @inventory_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(inventory_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "bc2c5066558ffc43ac8a2c729f2f71b8",
"score": "0.60322654",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.archive = true\n @item.save!\n\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Destroyed item.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0419e32bd11f8c5a3f34434a0c61500a",
"score": "0.60320765",
"text": "def destroy\n @pantry_item = PantryItem.find(params[:id])\n @pantry_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(pantry_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "33c92f5ad3a5359ccf8ee08e36a9ad8e",
"score": "0.6030202",
"text": "def del_item(item_name)\n\t$grocery_list.delete(item_name)\n\tp $grocery_list\nend",
"title": ""
},
{
"docid": "711d1a097c1222dbafdc8949f05cd821",
"score": "0.6027346",
"text": "def destroy\n @yamato_packing_item_code.destroy\n end",
"title": ""
},
{
"docid": "192674e5250fb5d3c53f847aa2bc4efc",
"score": "0.60269326",
"text": "def destroy\n @food_item = @food.food_items.find(params[:id])\n @food_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(food_food_items_url(@food)) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "58d29d1f69d988b495dbb517f9320938",
"score": "0.60265946",
"text": "def delete_item(path)\n # note: @db.delete uses exec {} so there is no need to here.\n @db.delete(path)\n end",
"title": ""
},
{
"docid": "b9d1a5dc5c944dfdef016c342183e812",
"score": "0.6025236",
"text": "def destroy\n @scrap_xml = ScrapXml.find(params[:id])\n @scrap_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(scrap_xmls_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0a2bbcf8c74e5c7a76fcb5e09ba9dfc0",
"score": "0.6023994",
"text": "def destroy\n @rss_item = RssItem.find(params[:id])\n @rss_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(rss_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a63dd5a576f4b017ebe4ab27319e5ffc",
"score": "0.6023954",
"text": "def destroy\n @warehouse_item = WarehouseItem.find(params[:id])\n @warehouse_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(warehouse_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a78e42eb228df04deec2750ff5fa91f7",
"score": "0.60159826",
"text": "def destroy\n @itemcatalog = Itemcatalog.find(params[:id])\n @itemcatalog.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_itemcatalogs_url) }\n end\n end",
"title": ""
},
{
"docid": "5ce82102262ece90c02447648a26a560",
"score": "0.601319",
"text": "def destroy\n @pack_type = PackType.find(params[:id])\n @pack_type.destroy\n\n respond_to do |format|\n format.html { redirect_to pack_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9f88953eb389e032fbbbaa08ccdbd794",
"score": "0.60121053",
"text": "def perform(id)\n FullItem.find(id).destroy\n end",
"title": ""
},
{
"docid": "c5f70f36bf2ffc6623d74c0d57755fb4",
"score": "0.6011654",
"text": "def destroy\n @item.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "fdb5222e60f67418931a74e6eb7c9a1d",
"score": "0.6010545",
"text": "def delete\n GoodData.delete(uri)\n end",
"title": ""
},
{
"docid": "135563294d7967b3b38eca471442becb",
"score": "0.6005157",
"text": "def delete_resource_item(doc_refno)\n resource_item = @resource_items.select { |u| u.doc_refno == doc_refno }\n delete_attachment(resource_item[0].file_name)\n @resource_items.delete(resource_item[0])\n end",
"title": ""
},
{
"docid": "32dfe59d7e3e98ba49ea09536a7f0dbf",
"score": "0.60028297",
"text": "def destroy\n @itemmaster = Itemmaster.find(params[:id])\n @itemmaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(itemmasters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "32dfe59d7e3e98ba49ea09536a7f0dbf",
"score": "0.60028297",
"text": "def destroy\n @itemmaster = Itemmaster.find(params[:id])\n @itemmaster.destroy\n\n respond_to do |format|\n format.html { redirect_to(itemmasters_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "68bf4e6e665d6d27072f5d342edd71d1",
"score": "0.60016704",
"text": "def destroy\n @item_subtype = ItemSubtype.find(params[:id])\n @item_subtype.destroy\n\n respond_to do |format|\n format.html { redirect_to(item_subtypes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0ed4e36baa4dae6803ba330b1a8cefe8",
"score": "0.5999594",
"text": "def destroy\n @items_product = ItemsProduct.find(params[:id])\n @items_product.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_products_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2ceab74221a43befcfe0de08052134d7",
"score": "0.5994478",
"text": "def destroy\n @tipo_item = TipoItem.find(params[:id])\n @tipo_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(tipo_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "02eb154dffba1bb9cb385c94253b1ad4",
"score": "0.5991053",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to edit_entry_path @item.entry }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d7ba9fee654811a98d147cd4bc32fc25",
"score": "0.5988459",
"text": "def destroy\n @cleaning_item = CleaningItem.find(params[:id])\n \n @cleaning_item.destroy\n \n respond_to do |format|\n format.html { redirect_to(cleaning_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c162232f39db0abbdf726fd8ae57ac51",
"score": "0.59863687",
"text": "def destroy\n @scrap_order_item = @scrap_order.items.find(params[:id])\n @scrap_order_item.destroy\n\n respond_to do |format|\n format.html { redirect_to scrap_order_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d2f8e308e7b618d50444d97e2651a73b",
"score": "0.5981163",
"text": "def destroy\n @item_type.destroy\n\n head :no_content\n end",
"title": ""
}
] |
5cedfbf380b4ddc994b12f8ba6bf8129
|
Action is called by the Graphing main panel method initFormComponent. Method returns a set of option values that are used to build the drop down boxes in the Graphing main panel. POST /rollcall/query_options
|
[
{
"docid": "259e7af3703ed9b1334ee03bbea4faca",
"score": "0.533099",
"text": "def get_options\n default_options = get_default_options\n zipcodes = current_user.rollcall_zip_codes\n\n school_types = current_user\n .schools\n .select(\"rollcall_schools.school_type\")\n .where(\"rollcall_schools.school_type is not null\")\n .reorder(\"rollcall_schools.school_type\")\n .uniq\n .pluck(\"rollcall_schools.school_type\")\n\n @options = {:schools => current_user.schools.all, :school_districts => current_user.school_districts.all, :default_options => default_options, :zipcodes => zipcodes, :school_types => school_types, :grades => (0..12).to_a }\n end",
"title": ""
}
] |
[
{
"docid": "82e05eeb64f26068f3e319dde51446c8",
"score": "0.6347852",
"text": "def set_options\n\n\t\tchoices = params[:choices_str].split(\"\")\n\t\tchoices.each_with_index do |choice, index|\n\t\t\tif not choice.in?([\"A\",\"B\",\"C\",\"D\"])\n\t\t\t\tchoices[index] = choice.to_i\n\t\t\telse\n\t\t\t\tchoices[index] = choice\n\t\t\tend\n\t\tend\n\n\t\toptions = []\n\t\tchoices.each_with_index do |choice, index|\n\t\t\toptions.push({:choicelevel => choice, :choicenumber => index})\n\t\tend\n\n\t\tdata = Calculator.set_values(choices)\n\n\t\trender json: {data: data}\n\n\tend",
"title": ""
},
{
"docid": "1881bad1f4fd2ef43ce0ef85043758d8",
"score": "0.6294095",
"text": "def contact_search_options\n {\n :gender_id =>\n {\n :field => :gender_id,\n :title => \"Gender\",\n :options => contact_options_lists[:gender_id].insert(0, [\"All\", 9]),\n :type => :select,\n :default => 9\n },\n :priority =>\n {\n :field => :priority,\n :title => \"Priority\",\n :options => [\"All\", \"Hot\", \"Medium\", \"Mild\", \"Not Interested\"],\n :type => :select,\n :default => \"All\"\n },\n :status =>\n {\n :field => :status,\n :title => \"Status\",\n :options => contact_options_lists[:status].insert(0, [\"All\", 9]),\n :type => :select,\n :default => 9\n },\n :result =>\n {\n :field => :result,\n :title => \"Result\",\n :options => contact_options_lists[:result].insert(0, [\"All\", 9]),\n :type => :select,\n :default => 9\n },\n :assigned_to =>\n {\n :field => :assigned_to,\n :title => \"Assignee\",\n :options => people_available_for_search,\n :type => :select,\n :default => -1\n },\n :international =>\n {\n :field => :international,\n :title => \"International\",\n :options => contact_options_lists[:international].insert(0, [\"All\", 9]),\n :type => :select,\n :default => 9\n },\n :degree =>\n {\n :field => :degree,\n :title => \"Degree / Faculty\",\n :type => :text,\n :default => \"\"\n },\n :interest =>\n {\n :field => :interest,\n :title => \"Interest\",\n :options => contact_options_lists[:interest].insert(0, [\"All\", 9]),\n :type => :select,\n :default => 9\n },\n :magazine =>\n {\n :field => :magazine,\n :title => \"Magazine\",\n :options => contact_options_lists[:magazine].insert(0, [\"All\", 9]),\n :type => :select,\n :default => 9\n },\n :journey =>\n {\n :field => :journey,\n :title => \"Journey\",\n :options => contact_options_lists[:journey].insert(0, [\"All\", 9]),\n :type => :select,\n :default => 9\n },\n :data_input_notes =>\n {\n :field => :data_input_notes,\n :title => \"Data Input Notes\",\n :type => :text,\n :default => \"\"\n },\n :created_at =>\n {\n :field => :created_at,\n :title => 'Added',\n :type => :select,\n :options => contact_options_lists[:created_at].insert(0, ['Any time', -1]),\n :default => -1,\n :single_select => true\n }\n }\n end",
"title": ""
},
{
"docid": "1b03720ce75e8993fd6eb9a897620d61",
"score": "0.6183206",
"text": "def select_options; end",
"title": ""
},
{
"docid": "aee3d6702204db35254f65c4654b228f",
"score": "0.6166789",
"text": "def configuration_panel__fields__get_combobox_options(params)\n query = params[:query]\n {:data => (default_columns.map{ |c| c[:name].to_s }).grep(/^#{query}/).map{ |n| [n] }}.to_nifty_json\n end",
"title": ""
},
{
"docid": "76bea99da9c551a9868a0bf8e022f04e",
"score": "0.6153188",
"text": "def options\n granule_params = request.request_parameters\n catalog_response = echo_client.get_granules(granule_params_for_request(request), token)\n\n if catalog_response.success?\n collection = Array.wrap(granule_params[:echo_collection_id]).first\n if collection\n dqs = echo_client.get_data_quality_summary(collection, token)\n end\n\n defaults = AccessConfiguration.get_default_access_config(current_user, collection)\n\n # If the user provides a spatial search for their project, those params\n # will be saved in their default AccessConfiguration.\n # If the user retrieves that collection again the original spatial params\n # will be included in their form.\n # If the user has a different spatial search those values will overwrite\n # the original params, but if the user doesn't have any spatial applied\n # they will still have the original spatial values applied in their echoform.\n #\n # This code removes any spatial params from the user's form, if they don't\n # have a bounding_box param on their project page.\n if params['bounding_box'].blank? && defaults.present?\n model = defaults.service_options['accessMethod'][0]['model']\n if model.present?\n doc = Nokogiri::XML(model)\n # reset spatial_subset_flag\n flag = doc.at_xpath('//ecs:spatial_subset_flag')\n if flag && flag.content == 'true'\n flag.content = 'false'\n defaults.service_options['accessMethod'][0]['model'] = doc.to_html\n end\n\n # update rawModel\n raw_model = defaults.service_options['accessMethod'][0]['rawModel']\n if raw_model.present?\n doc = Nokogiri::XML(raw_model)\n # reset spatial_subset_flag\n flag = doc.at_xpath('//ecs:spatial_subset_flag')\n if flag && flag.content == 'true'\n flag.content = 'false'\n # reset default values in rawModel\n doc.at_xpath('//ecs:ullat').content = '90' unless doc.at_xpath('//ecs:ullat').nil?\n doc.at_xpath('//ecs:ullon').content = '-180' unless doc.at_xpath('//ecs:ullon').nil?\n doc.at_xpath('//ecs:lrlat').content = '-90' unless doc.at_xpath('//ecs:lrlat').nil?\n doc.at_xpath('//ecs:lrlon').content = '180' unless doc.at_xpath('//ecs:lrlon').nil?\n defaults.service_options['accessMethod'][0]['rawModel'] = doc.to_html\n end\n end\n end\n end\n\n granules = catalog_response.body['feed']['entry']\n\n result = {}\n if !granules.empty?\n hits = catalog_response.headers['cmr-hits'].to_i\n\n sizeMB = granules.reduce(0) { |size, granule| size + granule['granule_size'].to_f }\n size = (1024 * 1024 * sizeMB / granules.size) * hits\n\n units = %w(Bytes Kilobytes Megabytes Gigabytes Terabytes Petabytes Exabytes)\n while size > 1024 && units.size > 1\n size = size.to_f / 1024\n units.shift\n end\n\n methods = get_downloadable_access_methods(collection, granules, granule_params, hits) + get_order_access_methods(collection, granules, hits) + get_service_access_methods(collection, granules, hits) + get_opendap_access_methods(collection, granules, granule_params, hits)\n\n defaults = { service_options: nil } if echo_form_outdated?(defaults, methods)\n\n # If there are no defaults (no AccessConfigurations) and only 1 accessMethod,\n # then set the default to that access method. NOTE: If there defaults then the\n # `defaults` variable will be an AccessConfigration, if there are no defaults\n # it is a Hash.\n if defaults.is_a?(Hash) && defaults.compact.blank?\n if methods.length == 1\n only_method = methods[0]\n\n # When a collection as been previously ordered we store the information the\n # user selected in an AccessConfiguration object, since we don't have all of\n # that information at this point we'll just set the necessary values for the\n # UI to load correctly and select the only option avaialble.\n defaults[:service_options] = {\n accessMethod: [{\n method: only_method[:name],\n type: only_method[:type],\n id: only_method[:id]\n }]\n }\n end\n end\n\n result = {\n hits: hits,\n dqs: dqs,\n size: size.round(1),\n sizeUnit: units.first,\n methods: methods,\n defaults: defaults[:service_options]\n }\n else\n result = {\n hits: 0,\n methods: [],\n defaults: defaults.nil? ? nil : defaults[:service_options]\n }\n end\n\n catalog_response.headers.each do |key, value|\n response.headers[key] = value if key.start_with?('cmr-')\n end\n\n respond_with(result, status: catalog_response.status, location: nil)\n else\n respond_with(catalog_response.body, status: catalog_response.status, location: nil)\n end\n end",
"title": ""
},
{
"docid": "055fc5d72852384eb9c331ad83407096",
"score": "0.61052644",
"text": "def field_options\n @options = begin\n case params[:field_name]\n\n # Template#frequency string\n #\n # This string is used to determine the due dates for Review and its tasks\n #\n when 'frequency'\n [['Annual', 'Annual'],['Quarterly', 'Quaterly'],['Monthly', 'Monthly'],['Weekly', 'Weekly']]\n\n # Template#agency\n #\n # A list of agencies which are relevant to the organization.\n # TODO: Make it relevant just to the user's organization and not pull all of them.\n #\n when 'agency_name'\n Agency.all.map do |agency|\n [\"%s (%s)\" % [agency.name, agency.acronym], agency.id]\n end\n\n # Review#owner\n #\n # List of users within an organization who can own/manage reviews\n # TODO: Make it list only users with the power to own/manage reviews\n #\n when 'responsible_party'\n current_user.organization.users.map { |u| [u.eponym, u.id] }\n\n # Task#reviewer\n #\n # List of users who can execute a task\n # TODO: Make it list only users with the power to execute tasks\n #\n when 'reviewer'\n current_user.organization.users.map { |u| [u.eponym, u.id] }\n\n else\n [[]]\n end\n end\n\n render :json => @options\n end",
"title": ""
},
{
"docid": "bd05089e3cfc678ca5ebeba29a17958e",
"score": "0.61032784",
"text": "def get_options; end",
"title": ""
},
{
"docid": "1a3be3454d546d5f34208e7415dc49c0",
"score": "0.609574",
"text": "def cr_load_form_dropdowns\n # OCO\n init_oco if !session[:organization]\n # _o = session[:office] != '0' ? session[:office].to_i : nil\n _o = current_offices_ids\n towns_by_office = current_offices.group(:town_id).pluck('offices.town_id')\n empty_array = []\n\n @json_data = { \"subscribers\" => empty_array, \"service_points\" => empty_array,\n # \"subscribers\" => subscribers_raw_array(_o), \"service_points\" => service_points_raw_array(_o),\n \"service_point_types\" => service_point_types_array, \"service_point_locations\" => service_point_locations_array,\n \"service_point_purposes\" => service_point_purposes_array, \"centers\" => centers_by_town_array(towns_by_office),\n \"street_types\" => street_types_array, \"street_directories_by_town\" => street_directories_by_town_array(towns_by_office),\n # \"street_directories\" => street_directories_array(_o), \"street_types\" => street_types_array,\n \"towns_by_office\" => towns_by_office_array(towns_by_office), \"reading_routes\" => reading_routes_raw_array(_o),\n \"towns\" => towns_array, \"provinces\" => provinces_array, \"zipcodes\" => zipcodes_array,\n \"regions\" => regions_array, \"countries\" => country_array,\n # \"banks\" => banks_array, \"bank_offices\" => bank_offices_array\n }\n render json: @json_data\n end",
"title": ""
},
{
"docid": "f3c63bad7269c3d427ad0465a759caa6",
"score": "0.60711735",
"text": "def chooser_options\n { \"choices\" => get_departments,\n \"required\" => true }\n end",
"title": ""
},
{
"docid": "9de2561a64355302d288e7949de1c090",
"score": "0.5944367",
"text": "def fire_populate_drop_down\n if ui_object = UiObject.find(params[:ui_object_id])\n if rule = ui_object.rules.find(params[:rule_id])\n return render :json => {\"options\" => rule.get_options(params[:object_ids])}.to_json\n end\n end\n render :json => {:error => \"Could not find rule\"}.to_json\n end",
"title": ""
},
{
"docid": "1838d3fabd3f66bb733f5796df318a17",
"score": "0.59284794",
"text": "def capture_drop_down_options\n if params[\"search_collection\"] and params[\"search_collection\"] != \"combined\"\n params[:f] = {\"collection_ssi\" => [params[\"search_collection\"]]}\n end\n end",
"title": ""
},
{
"docid": "7f7bff472dd94cc9cebcd46a549c4f1b",
"score": "0.58519447",
"text": "def prepare_and_render_form\n @options = Option.accessible_by(current_ability).all\n render(:form)\n end",
"title": ""
},
{
"docid": "f764bed6c7450982f1be1ec917880c1c",
"score": "0.58440423",
"text": "def select_options\n marital_status=MaritalStatus.all.select(:id,:name)\n relationship=Relationship.all.select(:id,:name)\n education=Education.all.select(:id,:name)\n region=Region.all.select(:id,:name,:continent).order(\"id\")\n diet=Diet.all.select(:id,:name)\n nakshatra=Nakshatra.all.select(:id,:name)\n value=Value.all.select(:id,:name)\n income=Income.all.select(:id,:name)\n occupation=Occupation.all.select(:id,:name,:title)\n education_concentration=EducationConcentration.all.select(:id,:name)\n community=Community.all.select(:id,:name)\n country= CountryByRegion.all.map{|x|{id:x.id,name:x.country}}\n admins=User.get_admin()\n render:json=>{data:{countryOption:country,nakshatraOption:nakshatra,\n regionOption:region,occupationOption:occupation,\n incomeOption:income,educationConcentrationOption:education_concentration,\n maritalOption:marital_status,relationOption:relationship,\n educationOption:education,valueOption:value,\n admins:admins,communityOption:community,\n dietOption:diet}}\n \n end",
"title": ""
},
{
"docid": "054b8b6b06d93bdcb12109d1e6ef3924",
"score": "0.58063215",
"text": "def option_collection\n list_option\n end",
"title": ""
},
{
"docid": "59492caa2b785136fdbd41a0defa8291",
"score": "0.58019537",
"text": "def select_all_options()\n end",
"title": ""
},
{
"docid": "a3541b26ad41989b4df6080dbe36f0d5",
"score": "0.5793323",
"text": "def options\n data = {\n brands: Brand.order(name: :asc).as_api_response(:options),\n colors: Color.order(name: :asc).as_api_response(:options),\n categories: Category.order(name: :asc).as_api_response(:options)\n }\n\n render_success(data: data)\n end",
"title": ""
},
{
"docid": "6f7f9c404d633729878f9cd5207fcd72",
"score": "0.5780053",
"text": "def drop_down_options\n\n options = @setup.options\n options = Hash[options.zip options] if options.is_a?(Array)\n unless options.is_a?(Hash)\n raise ':options should be an Array or an Hash, %s given' % options.class\n end\n return options unless @setup.remote_model\n\n filters = (@setup.remote_proc && self.instance_exec(&@setup.remote_proc)) || {}\n\n @depends_on.select { |f, v| v }.each_pair do |f, v|\n v = [f.logic_prefix, v, f.logic_suffix].compact.join\n filters.update(f.remote_orm.send(f.logic, f.column, v))\n end\n\n # if current filter depends on some up filter,\n # and neither of up or current filter has an value,\n # build drop-down with empty options\n return {} if @setup.depends_on.size > 0 && filters.size == 0\n\n options = Hash.new\n order = @setup.remote_orm.order(@setup.remote_order)\n remote_items, @errors = @setup.remote_orm.filter(filters.merge(order))\n if @errors.size > 0\n @errors << 'ORM Filters: %s' % @setup.controller.http.escape_html(filters.inspect)\n return saint_view.render_view('error')\n end\n remote_items.each do |remote_item|\n value = @setup.remote_label.map do |c|\n val = Saint::Utils.column_format c, remote_item\n val.size > 0 ? val : nil\n end.compact.join(', ')\n options[remote_item.send(@setup.remote_pkey)] = value\n end\n options\n end",
"title": ""
},
{
"docid": "4ceadf958c5c87ac7f911df5d6242023",
"score": "0.57699096",
"text": "def options\n {\n :filter => self.filter_options,\n :paging => self.paging_options,\n :select => self.select_options,\n :sorting => self.sorting_options,\n :values => @values,\n }\n end",
"title": ""
},
{
"docid": "df24fe1b55091cde919796a496242186",
"score": "0.57625604",
"text": "def set_option_list\n @location_status_opts = ordered_list(grap_item_list(\"location_status\"))\n @sts_geo_crm_opts = ordered_list(grap_item_list(\"sts_geo_crm\"))\n @sts_url_opts = ordered_list(grap_item_list(\"sts_url\"))\n @sts_acct_opts = ordered_list(grap_item_list(\"sts_acct\"))\n @sts_addr_opts = ordered_list(grap_item_list(\"sts_addr\"))\n @sts_ph_opts = ordered_list(grap_item_list(\"sts_ph\"))\n @crm_source_opts = ordered_list(grap_item_list(\"crm_source\"))\n @tier_opts = ordered_list(grap_item_list(\"tier\"))\n @sales_person_opts = ordered_list(grap_item_list(\"sales_person\"))\n @acct_type_opts = ordered_list(grap_item_list(\"acct_type\"))\n # @state_opts = ordered_list(grap_item_list(\"state\"))\n @state_opts = ordered_list(list_of_states)\n end",
"title": ""
},
{
"docid": "a408221e3930a8ed812a58f1757c4f5f",
"score": "0.57372004",
"text": "def query_options\n options = JSON.parse(connection.get(\"/Contact/QueryOptions\").body )\n end",
"title": ""
},
{
"docid": "5c0dcc74b6baaece8db53b7e93a30b69",
"score": "0.5724764",
"text": "def registration_options\n administrative = Repository.find(params[:id]).administrative\n\n # workflow_list\n @workflows = ([params[:workflow_id]] + [Settings.apo.default_workflow_option] + Array(administrative.registrationWorkflow)).compact.uniq\n\n access_template = administrative.accessTemplate.new({\n view: params[:view_access],\n download: params[:download_access],\n location: params[:access_location],\n controlledDigitalLending: params[:controlled_digital_lending] == \"true\"\n }.compact)\n @access_template = AccessTemplate.new(access_template:, apo_defaults_template: administrative.accessTemplate)\n\n @collections = Array(administrative.collectionsForRegistration).filter_map do |col_id|\n name = CollectionNameService.find(col_id)\n unless name\n Honeybadger.notify(\"The APO #{params[:id]} asserts that #{col_id} is a collection for registration, but we don't find that collection in solr\")\n next\n end\n\n [\"#{name.truncate(60, separator: /\\s/)} (#{col_id.delete_prefix(\"druid:\")})\", col_id]\n end.sort_by(&:first) # before returning the list, sort by collection name\n end",
"title": ""
},
{
"docid": "b9afef1c12413f52a11a63029cf380a9",
"score": "0.5722583",
"text": "def show_input_options\n value = params[\"selected\"]\n @is_select = false\n @row_id = 1\n @page_name = params[\"page_name\"] + \"_choices\"\n @model = params[\"page_name\"]\n if value == \"select\"\n \t@is_select = true\n end\n\n if value == \"yesno\"\n @div_name = \"type_selector_\" + @page_name\n @partial_name = \"question_builder/show_yes_no_inputs\"\n \t@selection_field_id = \"#\" + @page_name + \"_field_type\"\n render 'question_builder/yesno_entry.js.erb'\n elsif value == \"text\"\n \t\trender 'question_builder/remove_choices_entry.js.erb'\n elsif value.match(\"matrix\") != nil\n @matrix_type = value.split(\"_\")[1]\n render 'question_builder/matrix_questions/show_matrix_form.js.erb'\n else\n render 'question_builder/show_choices_entry.js.erb'\n end\n end",
"title": ""
},
{
"docid": "2021804bd0aea7bcd4d5d2a997e17608",
"score": "0.56780416",
"text": "def form_options\n { \n 'origenDDL' => @from, \n 'destinoDDL' => @to,\n '__EVENTVALIDATION' => @eventvalidation, \n '__VIEWSTATE' => @viewstate,\n 'btnCalcular.x' =>\t'48',\n 'btnCalcular.y' =>'5'\n }\n end",
"title": ""
},
{
"docid": "c64e56a0e4eeffa8bdf1cda173233c31",
"score": "0.567557",
"text": "def prepare_form(type)\n\t\toptions_list = Kernel.const_get(\"ApplicationHelper::#{ type }\").clone\n\t\toptions_list = options_list.unshift('Select All')\n\t\toptions_list\n\tend",
"title": ""
},
{
"docid": "09aeb8d5be46c7986b99abac62365be9",
"score": "0.56753224",
"text": "def options_for_column\n [[nil, 'all']].concat self.optionable.report.report_queries.collect {\n |rq| [rq.query_select_group, rq.query_select_group] }.uniq\n end",
"title": ""
},
{
"docid": "09aeb8d5be46c7986b99abac62365be9",
"score": "0.56753224",
"text": "def options_for_column\n [[nil, 'all']].concat self.optionable.report.report_queries.collect {\n |rq| [rq.query_select_group, rq.query_select_group] }.uniq\n end",
"title": ""
},
{
"docid": "bc9eaeee324923868ab48cfbcacb2143",
"score": "0.5663801",
"text": "def selected_options; end",
"title": ""
},
{
"docid": "c48cfc20d68f80afd40ea679945fb4bc",
"score": "0.5646237",
"text": "def set_option_list\n @alt_source_opts = ordered_list(grap_item_list(\"alt_source\"))\n @sfdc_type_opts = ordered_list(grap_item_list(\"sfdc_type\"))\n @sfdc_tier_opts = ordered_list(grap_item_list(\"sfdc_tier\"))\n @sfdc_sales_person_opts = ordered_list(grap_item_list(\"sfdc_sales_person\"))\n # @state_opts = ordered_list(grap_item_list(\"sfdc_state\"))\n @franch_cons_opts = ordered_list(grap_item_list(\"sfdc_franch_cons\"))\n @franch_cat_opts = ordered_list(grap_item_list(\"sfdc_franch_cat\"))\n @template_opts = ordered_list(grap_item_list(\"template\"))\n @bds_status_opts = ordered_list(grap_item_list(\"bds_status\"))\n @staffer_sts_opts = ordered_list(grap_item_list(\"staffer_sts\"))\n @acct_merge_sts_opts = ordered_list(grap_item_list(\"acct_merge_sts\"))\n @match_score_opts = ordered_list(grap_item_list(\"match_score\"))\n @acct_match_sts_opts = ordered_list(grap_item_list(\"acct_match_sts\"))\n @pin_match_sts_opts = ordered_list(grap_item_list(\"pin_match_sts\"))\n @url_match_sts_opts = ordered_list(grap_item_list(\"url_match_sts\"))\n @ph_match_sts_opts = ordered_list(grap_item_list(\"ph_match_sts\"))\n # @state_opts = ordered_list(grap_item_list(\"state\"))\n @state_opts = ordered_list(list_of_states)\n end",
"title": ""
},
{
"docid": "552eb6ba9e2b9e74c487fef1513b0c6b",
"score": "0.56291413",
"text": "def prepare_drop_down_data\n @user_filters = UserErrataFilter.for_user(@user).order('name ASC')\n @system_filters = SystemErrataFilter.in_display_order\n\n # Note that we don't show checkboxes for the Pdc types\n @errata_types = ErrataType.legacy.map { |t| [ t.name, t.short_desc ] }\n\n @errata_states = State.all_states.map { |s| [ s.to_s, State.nice_label(s, :short => true) ] }\n\n @products = Product.active_products\n @batches = Batch.active\n @all_batches = Batch.all\n\n @content_types = ['None', 'rpm', 'docker', BrewArchiveType.pluck(:name)].flatten\n\n # If the release in the filter isn't current then it won't be visible in the drop down, causing\n # confusion. Here's a hack to get around this.\n @filter_releases = Release.where('id in (?)',@errata_filter.selected_releases).includes(:product)\n @current_releases = Release.current.includes(:product)\n @current_and_filter_releases = (@current_releases + @filter_releases).uniq\n\n @all_releases = Release.includes(:product)\n\n @sort_options = ErrataFilter.sort_options_for_select\n @format_options = ErrataFilter.format_options_for_select\n @pagination_options = @errata_filter.pagination_options_for_select\n @group_by_options = ErrataFilter.group_by_options_for_select\n @doc_status_options = ErrataFilter.docs_status_options_for_select\n @security_approval_options = ErrataFilter.security_approval_options_for_select\n @open_closed_options = ErrataFilter.open_closed_options_for_select\n @text_only_options = ErrataFilter.text_only_options_for_select\n\n prepare_qe_dropdowns\n\n @devel_groups = UserOrganization.devel_groups\n\n @reporters = User.all_reporters\n\n #\n # Eek. confusing..! it is for the grouped select..\n # Should look something like this:\n # [\n # 'RHEL', [\n # ['RHEL-6.3.z', 123],\n # ['RHEL-6.2', 232],\n # ],\n # 'Cloudforms, [\n # ['Cloudforms 1.2.3', 343],\n # ['Cloudforms 1.2.4', 654],\n # ],\n # etc..\n # ]\n #\n @all_releases_grouped = @all_releases.\n group_by { |r| r.try(:product).try(:short_name)||'(No Product)' }.\n map { |k,v| [k, v.sort_by{ |r| r.name }.map{ |r| [r.name_with_inactive, r.id] }] }.\n sort_by { |r| r[0] }\n\n @current_releases_grouped = (@current_and_filter_releases).uniq.\n group_by { |r| r.try(:product).try(:short_name)||'(No Product)' }.\n map { |k,v| [k, v.sort_by{ |r| r.name }.map{ |r| [r.name_with_inactive, r.id] }] }.\n sort_by { |r| r[0] }\n\n end",
"title": ""
},
{
"docid": "a069bb43185f21b49d8ab3ba1c26e339",
"score": "0.5617693",
"text": "def build_shift_search_form(shift,action,caption,is_flat_search = nil)\n\n\n session[:shift_form]= Hash.new\n\n # -----------------------------------------\n # define fields to build drop_down_fields\n # -----------------------------------------\n line_codes = Shift.find_by_sql('select distinct line_code from shifts').map{|s| s.line_code}\n line_codes.unshift(\"<empty>\")\n\n users = User.find_by_sql('select distinct user_name from users').map{|s| s.user_name }\n users.unshift(\"<empty>\")\n\n shift_types = ShiftType.find_by_sql('select distinct shift_type_code from shift_types').map{|s| s.shift_type_code }\n\n shift_type_codes = ShiftType.find_by_sql('select distinct shift_type_code from shift_types').map{|s| s.shift_type_code}\n shift_type_codes.unshift(\"<empty>\")\n\n field_configs = Array.new\n\n field_configs[field_configs.length()] = {:field_type => 'DropDownField',\n :field_name => 'user',\n :settings => {:list => users}}\n\n field_configs[field_configs.length()] = {:field_type => 'PopupDateRangeSelector',\n :field_name => 'start_date_time'}\n\n field_configs[field_configs.length()] = {:field_type => 'PopupDateRangeSelector',\n :field_name => 'end_date_time'}\n\n field_configs[field_configs.length()] = {:field_type => 'DropDownField',\n :field_name => 'line_code',\n :settings => {:list => line_codes}}\n\n field_configs[field_configs.length()] = {:field_type => 'DropDownField',\n :field_name => 'shift_type_code',\n :settings => {:list => shift_types}}\n \n \n\tbuild_form(shift,field_configs,action,'shift',caption,false)\n\nend",
"title": ""
},
{
"docid": "cdc99667aba24211393554ff6d18346d",
"score": "0.56129557",
"text": "def index\n @option_values = OptionValue.all\n end",
"title": ""
},
{
"docid": "9cd8a2d576712394a18f96420c22a96d",
"score": "0.560634",
"text": "def set_option_list\n # ordered_list\n @indexer_status_opts = ordered_list(grap_item_list(\"indexer_status\"))\n @redirect_status_opts = ordered_list(grap_item_list(\"redirect_status\"))\n @who_status_opts = ordered_list(grap_item_list(\"who_status\"))\n @template_opts = ordered_list(grap_item_list(\"template\"))\n @rt_sts_opts = ordered_list(grap_item_list(\"rt_sts\"))\n @stf_status_opts = ordered_list(grap_item_list(\"stf_status\"))\n @loc_status_opts = ordered_list(grap_item_list(\"loc_status\"))\n @contact_status_opts = ordered_list(grap_item_list(\"contact_status\"))\n @cont_sts_opts = ordered_list(grap_item_list(\"cont_sts\"))\n # @state_opts = ordered_list(grap_item_list(\"state\"))\n @state_opts = ordered_list(list_of_states)\n end",
"title": ""
},
{
"docid": "9eadf3f574c3689307ac041c31517863",
"score": "0.5604455",
"text": "def select_options=(_arg0); end",
"title": ""
},
{
"docid": "f1fc56ed825ac6d7769f196659967665",
"score": "0.56019956",
"text": "def prefill_select_menus\n @categories = Category.all\n @manufacturers = Manufacturer.all\n @conditions = Condition.all\n @colors = Color.all\n @materials = Material.all\n @fingerboards = Fingerboard.all\n @bridges = Bridge.all\n @countries = Country.all\n @cases = Case.all\n @deliveries = Delivery.all\n end",
"title": ""
},
{
"docid": "9897aa339f0204c602985e0bb3ba5c78",
"score": "0.55567455",
"text": "def build_list_options\n conditions = []\n conditions_str = []\n \n @search_titles = []\n \n search_filters = get_search_filters\n\n if search_filters[:parent_id] then \n filter_instance = Department.find_by_id(search_filters[:parent_id])\n if filter_instance then\n conditions_str << \"departments.parent_id = ?\"\n conditions << search_filters[:parent_id]\n filter_display_name = filter_instance.respond_to?(:display_name) ? filter_instance.display_name : filter_instance.id\n @search_titles << [print_words('parent').capitalize_words, filter_display_name]\n end\n end\n if search_filters[:search_text] then\n search_text = \"%#{search_filters[:search_text]}%\"\n search_fields = ['name']\n unless search_fields.empty? then\n conditions_str << '(' + search_fields.map{ |c| \"`departments`.`#{c}` LIKE ?\" }.join(' OR ') + ')'\n search_fields.size.times { conditions << search_text }\n end \n @search_titles << [print_words('text').capitalize_words, search_filters[:search_text]] \n end\n \n conditions.unshift( conditions_str.join(' AND ') ) unless conditions.empty? \n end",
"title": ""
},
{
"docid": "c58a0c7036f289634f8c51dbf00d6f90",
"score": "0.55545354",
"text": "def choices(params={})\n hash = build_action('choices', params)\n \n if @ask_hash\n @ask_hash[:ask].merge!(hash)\n elsif @nested_hash\n @nested_hash[@nested_name.to_sym].merge!(hash)\n else\n @response[:tropo] << hash\n render_response if @building.nil?\n end\n end",
"title": ""
},
{
"docid": "eb3b026c7a3a9d80cfa5d8562b212465",
"score": "0.55478233",
"text": "def get_selects_info\n @nuage_versions = NuageVersion.all\n @ha_models = HaModel.all\n @verticals = Vertical.all\n @qty_ranges = QtyRange.all\n @revenues = Revenue.all\n @regions = Region.all\n @cmss = CloudManagementSystem.all\n end",
"title": ""
},
{
"docid": "0394121218200722eb0ba50d92050f0c",
"score": "0.5545793",
"text": "def _forme_form_options(options)\n options\n end",
"title": ""
},
{
"docid": "825ed1997b94f12d32bb744a7c091af7",
"score": "0.5532935",
"text": "def screen_collection_select_tag(options)\n\t\tname = options[:name]\n\t\tvalue_method = options[:value_method]\n\t\ttext_method = options[:text_method]\n\t\tassinged_option = ''\n assinged_option = options[:assigned_options][0][value_method] || '' unless options[:assigned_options].empty?\n\t\tavailable_collection = options[:all_options]\n available_collection = available_collection.select{|o| \n txt = o.send(text_method).to_s\n\n !txt.empty? && txt !~ /missing_implementation/\n } unless Rails.env =~ /development/\n\t\tinclude_blank = options[:include_blank]\n # related_from = options[:related_from] || ''\n relate_to = options[:relate_to] || ''\n from_cf_id = options[:from_cf_id] || ''\n on_change = options[:on_change] || ''\n\t\t\n\t\toption_tag = ''\n option_tag << '<option value=\"\"></option>' if include_blank\n \n if options[:group_method]\n options[:group_label_method] ||= options[:text_method]\n option_tag << option_groups_from_collection_for_select( available_collection, options[:group_method], options[:group_label_method], value_method, text_method, assinged_option )\n else\n option_tag << options_from_collection_for_select( available_collection, value_method, text_method, assinged_option )\n end\n \n\t\tif relate_to == '' || relate_to == 0\n select_tag(name, option_tag,:onchange=>on_change, :class => 'seach_input_full')\n else\n select_tag(name, option_tag, :onchange=>\"fncReloadComboRef('#{relate_to}', this, '#{from_cf_id}');\" + on_change, :class => 'seach_input_full')\n end\n\t\t\n\tend",
"title": ""
},
{
"docid": "2f33a6bf59c9ab49c18429cf1b0731c8",
"score": "0.5531331",
"text": "def build_pdt_error_search_form\n\n\n session[:pdt_error_form]= Hash.new\n\n users = User.find_by_sql(\"select distinct user_name from users\").map { |n|[n.user_name] }\n users.unshift(\"<empty>\")\n \n\n field_configs = Array.new\n\n field_configs[field_configs.length()] = {:field_type => 'DropDownField',\n\t\t\t\t\t\t:field_name => 'user_name',\n\t\t\t\t\t\t:settings => {:list => users}}\n\t\t\t\t\t\n field_configs[field_configs.length()] = {:field_type => 'PopupDateTimeSelector',\n\t :field_name => 'created_on_from',\n\t :settings => {:date_textfield_id=>'created_date_from'}}\n\n\tfield_configs[field_configs.length()] = {:field_type => 'PopupDateTimeSelector',\n\t :field_name => 'created_on_to',\n\t :settings => {:date_textfield_id=>'created_date_to'}}\n\n field_configs[field_configs.length()] = {:field_type => 'TextField',\n\t\t\t\t\t\t:field_name => 'ip'}\n\n field_configs[field_configs.length()] = {:field_type => 'TextField',\n\t\t\t\t\t\t:field_name => 'menu_item'}\n\n field_configs[field_configs.length()] = {:field_type => 'TextField', :field_name => 'input_xml' }\n\n\n field_configs[field_configs.length()] = {:field_type=>'link_window_field',\n :field_name =>'lookup_menu_items',\n :settings =>\n {\n :target_action => 'look_up_menu_items',\n :link_text => \"Lookup menu items\",:id_value => 'id'}}\n\n build_form(@pdt_errors,field_configs,\"pdt_errors_submit\",'pdt_errors','submit search')\n end",
"title": ""
},
{
"docid": "bc4cb84c57e27a97b8907e889f02e0e9",
"score": "0.55292886",
"text": "def build_set_type_form(action = nil)\n \n action = 'submit_create_pack_material_step1' if !action\n \n pack_material_type_codes = PackMaterialType.find_by_sql('select distinct pack_material_type_code from pack_material_types').map{|g|[g.pack_material_type_code]}\n #pack_material_type_codes.unshift(\"<empty>\")\n \n combos_js = gen_combos_clear_js_for_combos([\"pack_material_type_pack_material_type_code\",\"pack_material_type_pack_material_type_code\"])\n \n pack_type_observer = {:updated_field_id => \"pack_material_sub_type_code_cell\",\n\t\t\t\t\t :remote_method => 'pack_material_type_code_changed',\n\t\t\t\t\t :on_completed_js => combos_js[\"pack_material_type_pack_material_type_code\"]}\n\t\t\t\t\t \n field_configs = Array.new\n \n\tfield_configs[field_configs.length()] = {:field_type => 'DropDownField',\n\t\t\t\t\t\t:field_name => 'pack_material_type_code',\n\t\t\t\t\t\t:settings => {:list => pack_material_type_codes},\n\t\t\t\t\t\t:observer => pack_type_observer}\n\t\n\tfield_configs[field_configs.length()] = {:field_type => 'DropDownField',\n\t\t\t\t\t\t:field_name => 'pack_material_sub_type_code',\n\t\t\t\t\t\t:settings => {:list => [\"select a value from pack material type\"]}}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\n build_form(nil,field_configs,action,'pack_material_type','select type')\n \n \n end",
"title": ""
},
{
"docid": "be08f8dfe2c6a064a05d0502c418aa0e",
"score": "0.5523257",
"text": "def get_options_for_interact_view\n res = RealEstate.where block_id: params[:id]\n\n options = []\n res.each do |re|\n options << {\n id: re.id,\n name: re.short_label,\n group_id: re.block_real_estate_group_id,\n floor_id: re.block_floor_id\n }\n end\n\n render json: { status: 0, result: options }\n end",
"title": ""
},
{
"docid": "670e78f3357027e97759051f633036e2",
"score": "0.5512868",
"text": "def index\n @category_option_selections = CategoryOptionSelection.all\n end",
"title": ""
},
{
"docid": "9e90493a0b47614a82bc65c76545afb9",
"score": "0.5509413",
"text": "def term_options\n\t return if find_first_parent.is_a?(Period)\n\t @term_options ||= unless controller_model == Student\n \t other_options = [['All Terms', 'All']]\n \t if controller_model == Period\n terms = options_scope.uniq.pluck(\"#{controller_name}.term\")\n elsif [Student, User].include?(controller_model)\n other_options << 'With No Period'\n terms = options_scope.joins(:periods).uniq.pluck('periods.term')\n elsif controller_model == TestScore\n terms = options_scope.uniq.pluck('test_scores.term')\n end\n selected = if !params[:term]\n 'All'\n else\n terms << params[:term] unless terms.include? params[:term]\n params[:selected]\n end\n \n options_for_select(other_options) <<\n options_for_select(terms.sort, selected)\n end\n\tend",
"title": ""
},
{
"docid": "5665272c62c41b11fa7b434b8a9a58a1",
"score": "0.55023324",
"text": "def select_options\n @select.options\n end",
"title": ""
},
{
"docid": "168658590daa6006b6831346c7aaa45e",
"score": "0.54944766",
"text": "def build_list_options\n conditions = []\n conditions_str = []\n @search_titles = []\n @search_filters ||= {}\n # convert, from k-params to k-fields\n params_keys = {}\n params.delete_if { |kp,v|\n unless (kf = ParamToField[kp.to_sym]).nil? then\n @search_filters[ kf ] = v\n params_keys[ kf ] = kp\n true\n end\n }\n\n if @search_filters[:department_id] then \n filter_instance = Department.find_by_id(@search_filters[:department_id])\n if filter_instance then\n conditions_str << \"users.department_id = ?\"\n conditions << @search_filters[:department_id]\n @search_titles << ['department', filter_instance]\n end\n end\n if @search_filters[:search_text] then\n search_fields = ['login', 'email', 'crypted_password', 'salt', 'created_at', 'updated_at', 'last_login_at', 'last_ip', 'activation_code', 'activated_at', 'remember_token', 'remember_token_expires_at', 'first_name', 'last_name', 'birthday', 'bio', 'website', 'address', 'city', 'country', 'userimage']\n unless search_fields.empty? then\n conditions_str << '(' + search_fields.map{ |c| \"`users`.`#{c}` LIKE ?\" }.join(' OR ') + ')'\n search_fields.size.times { conditions << \"%#{@search_filters[:search_text]}%\" }\n end \n @search_titles << ['text', @search_filters[:search_text]] \n end\n \n # store again to params (for next link)\n @search_filters.each_pair { |kf,v| params[ params_keys[kf] ] = v }\n \n conditions.unshift( conditions_str.join(' AND ') ) unless conditions.empty? \n end",
"title": ""
},
{
"docid": "1bb75ae7f6853a99f76e7f0932a0916f",
"score": "0.5483602",
"text": "def process_options\n\t\t# set the scope names\n\t\t@slot_scope = @options.delete(:slot_scope) || SLOT_SCOPE\n\t\t@parent_scope = @options.delete(:parent_scope)\n\n\t\t# this is a step if it says it is or the form is a wizard\n\t\t@is_step = @options.has_key?(:is_step) ? @options[:is_step] : @form_builder.options[:wizard]\n\t\t@in_step = @options.has_key?(:in_step) ? @options[:in_step] : @form_builder.options[:in_wizard]\n\n\t\t# get the after method information\n\t\t@after_method = @options.delete(:after_method) || @options.delete(:after_content)\n\t\t@after_method_args = @options.delete(:after_method_args)\n\n\t\t#merge in place because this is the options object that's given to the input\n\t\t@input_options.reverse_merge!(input_options)\n\t\t#get the options for the other parts of the field\n\t\t@error_wrapper_options = error_wrapper_options\n\t\t@error_inner_options = error_inner_options\n\t\t@label_options = label_options\n\tend",
"title": ""
},
{
"docid": "b28444fb9e714313b69003f124438b6a",
"score": "0.5468872",
"text": "def get_combobox_options(params)\n column = params[:column]\n query = params[:query]\n \n column = fields.detect{ |c| c[:name] == params[:column] }.try(:to_options!)\n scopes = column.to_options[:scopes]\n query = params[:query]\n\n {:data => combobox_options_for_column(column, :query => query, :scopes => scopes)}\n end",
"title": ""
},
{
"docid": "0fa1399a4d96c592ee390b807bc674b0",
"score": "0.54688036",
"text": "def initialize_for_selects\n @deliverable_types = RailblazersXmlParser.get_deliverable_type(RailblazersXmlParser.identify_deliverable_type(session[:phase]))\n @deliverable_types << @@ADHOC\n @complexities = RailblazersXmlParser.get_common_values\n @estimated_sizes = RailblazersXmlParser.get_common_values\n @production_rates = RailblazersXmlParser.get_common_values\n @efforts = RailblazersXmlParser.get_common_values\n end",
"title": ""
},
{
"docid": "54b519bcd9a871f6cdeada8104c94a97",
"score": "0.54556406",
"text": "def get_form_vars\n @edit[:new][:cbshow_typ] = params[:cbshow_typ] if params[:cbshow_typ]\n @edit[:new][:cbtag_cat] = nil if params[:cbshow_typ] # Reset categories pull down if assign to selection is changed\n @edit[:new][:cbtag_cat] = params[:cbtag_cat].to_s if params[:cbtag_cat]\n @edit[:new][:cblabel_key] = nil if params[:cbshow_typ]\n @edit[:new][:cblabel_key] = params[:cblabel_key].to_s if params[:cblabel_key]\n\n if @edit[:new][:cbshow_typ].ends_with?(\"-tags\")\n get_categories_all\n get_tags_all\n elsif @edit[:new][:cbshow_typ].ends_with?(\"-labels\")\n get_docker_labels_all_keys\n get_docker_labels_all_values(@edit[:new][:cblabel_key])\n else\n get_cis_all\n end\n\n params_to_edit(:cis)\n params_to_edit(:tags, @edit[:new][:cbtag_cat].try(:to_i))\n params_to_edit(:docker_label_values)\n end",
"title": ""
},
{
"docid": "ea6dbac63483810e8d1859581730a1c4",
"score": "0.5447033",
"text": "def build_get_combo_lists(table_name,index_fields)\n begin\n puts \"in build get como lists\"\n lines = Array.new\n lines.push \"#\\tcombo lists for table: \" + table_name + \"\\n\"\n index_fields.each do |field|\n lines.push \"\\t\" + Inflector.pluralize(field) + \" = nil \" \n end\n \n lines.push \" \"\n \n model = Inflector.camelize(Inflector.singularize(table_name)) \n var_name = @model_settings.model_var_name\n lines.push \"\\t\" + Inflector.pluralize(index_fields[0]) + \" = \" + @model_settings.model_name + \".get_all_\" + Inflector.pluralize(index_fields[0]) \n \n lines.push \"\\tif \" + var_name + \" == nil||is_create_retry\"\n for i in 1..index_fields.length() -1\n lines.push \"\\t\\t \" + Inflector.pluralize(index_fields[i]) + \" = [\\\"Select a value from \" + index_fields[i -1] + \"\\\"]\" \n end \n \n lines.push \"\\telse\"\n \n #build the set of lists queries\n for i in 1..index_fields.length() -1\n lists_code = build_interactive_combo_list_query(index_fields,i,table_name)\n lines.concat(lists_code)\n end\n \n lines.push \"\\tend\"\n return lines\n rescue\n raise \"method: build_get_combo_lists failed. Reported exception: \\n\" + $! \n end\n \n end",
"title": ""
},
{
"docid": "23c9cf34de643e07f80c4b01d142a556",
"score": "0.5446904",
"text": "def choices(params={})\n hash = build_action('choices', params)\n \n if @nested_hash\n @nested_hash[@nested_name.to_sym].merge!(hash)\n else\n @response[:tropo] << hash\n render_response if @building.nil?\n end\n end",
"title": ""
},
{
"docid": "cf14e85f13438b2a0b8d4c45fd841d33",
"score": "0.544402",
"text": "def initialize(params={})\n @parent ||= params[:parent]\n params.delete(:parent)\n if !params[:options] then # TODO: This used to be if !params[:value] -> check why\n params[:option_values] = [ '0' ]\n params[:option_labels] = [ tl(:select_additional_category) ]\n cats = Category.all_with(Category.is_private == 'f').sort_by(:category_name, :asc).to_a\n dec = Hierarchy_Map_Iterator.new(cats)\n dec.each_with_level { |cat, level|\n cat_label = ''\n level.times { cat_label << ' ' }\n cat_label << cat.category_name\n params[:option_values] << cat.category_id\n params[:option_labels] << cat_label \n }\n end\n\n if params[:name].empty? then\n params[:name] ||= Category.category_id.to_s\n end\n if @parent then\n params[:onchange] = \"Aurita.Main.selection_list_add({ select_field:'#{params[:id]}', \n name: '#{@parent.options_name}' });\" \n end\n\n super(params)\n end",
"title": ""
},
{
"docid": "2208f83f9d51b10e0d2ba93f267ad36c",
"score": "0.5440583",
"text": "def option_fields\n self.checkboxes.to_a + self.radios.to_a\n end",
"title": ""
},
{
"docid": "1f59b98036177e5d828e008daf5e6315",
"score": "0.5438824",
"text": "def index\n @opts = Opt.all\n end",
"title": ""
},
{
"docid": "484a97011cd60984a90afcb6f219104b",
"score": "0.54381186",
"text": "def set_option_list\n @who_status_opts = ordered_list(grap_item_list(\"who_status\"))\n @url_status_opts = ordered_list(grap_item_list(\"url_status\"))\n # @state_opts = ordered_list(grap_item_list(\"state\"))\n @state_opts = ordered_list(list_of_states)\n end",
"title": ""
},
{
"docid": "63fed744225a5d3d1a1b91ed45b46597",
"score": "0.543713",
"text": "def build_dropdown_lists\n @type = ['Broard line', 'Food', 'Meat', 'Custom cut']\n @uom = ['LB', 'Each', 'Case']\n @source = ['Vendor', 'Invoice', 'Verbal']\n @delivery = ['Driver', 'Overnight']\n @grade = ['Prime', 'Choice plus', 'Choice', 'Select', 'Grade A', 'Grade B']\n end",
"title": ""
},
{
"docid": "dba47a2f22f9ba2afb23389bbaa1e905",
"score": "0.5433249",
"text": "def assign_all_options_array\n @start_rest_options_array = 0.step(3600,5).collect{ |x| [(x > 0 ? sprintf(\"%2s\\'%02.0f\\\"\",x/60, x%60) : '-'), x] }\n @pause_options_array = 0.step(1800,5).collect{ |x| [(x > 0 ? sprintf(\"%2s\\'%02.0f\\\"\",x/60, x%60) : '-'), x] }\n @exercise_options_array = [[nil,nil]] + Exercise.to_dropdown()\n @step_type_options_array = TrainingStepType.to_unsorted_dropdown( nil, :id, :i18n_description )\n @arm_aux_options_array = ArmAuxType.to_dropdown( nil, :id, :i18n_description )\n @kick_aux_options_array = KickAuxType.to_dropdown( nil, :id, :i18n_description )\n @body_aux_options_array = BodyAuxType.to_dropdown( nil, :id, :i18n_description )\n @breath_aux_options_array = BreathAuxType.to_dropdown( nil, :id, :i18n_description )\n end",
"title": ""
},
{
"docid": "05ab76d5b4d8eaae76cb49a7d53689b2",
"score": "0.5432238",
"text": "def search_fields\n search_field_options_for_select\n end",
"title": ""
},
{
"docid": "05ab76d5b4d8eaae76cb49a7d53689b2",
"score": "0.5432238",
"text": "def search_fields\n search_field_options_for_select\n end",
"title": ""
},
{
"docid": "bf33def417cf2ae99c3d998870581fbf",
"score": "0.54261184",
"text": "def widget_get_form_vars\n @widget = @edit[:widget_id] ? MiqWidget.find(@edit[:widget_id]) : MiqWidget.new\n\n copy_params_if_set(@edit[:new], params, %i[title description])\n @edit[:new][:filter] = params[:filter_typ] if params[:filter_typ]\n @edit[:new][:enabled] = (params[:enabled] == \"1\") if params[:enabled]\n\n # report/chart/menu options box\n @edit[:new][:row_count] = @widget.row_count(params[:row_count]) if params[:row_count]\n if @sb[:wtype] == \"r\"\n if params[:filter_typ] || params[:subfilter_typ] || params[:repfilter_typ]\n # reset columns if report has changed\n @pivot = @edit[:new][:pivot] = ReportController::PivotOptions.new\n end\n @edit[:new][:subfilter] = params[:subfilter_typ] if params[:subfilter_typ]\n if params[:repfilter_typ] && params[:repfilter_typ] != \"<Choose>\"\n @edit[:rpt] = MiqReport.for_user(current_user).find(params[:repfilter_typ].to_i)\n @edit[:new][:repfilter] = @edit[:rpt].id\n elsif params[:repfilter_typ] && params[:repfilter_typ] == \"<Choose>\"\n @edit[:new][:repfilter] = nil\n end\n @edit[:new][:filter] = \"\" if @edit[:new][:filter] == \"<Choose>\"\n @edit[:new][:subfilter] = \"\" if @edit[:new][:subfilter] == \"<Choose>\"\n elsif @sb[:wtype] == \"c\"\n if params[:repfilter_typ] && params[:repfilter_typ] != \"<Choose>\"\n @edit[:rpt] = MiqReport.for_user(current_user).find(params[:repfilter_typ].to_i)\n @edit[:new][:repfilter] = @edit[:rpt].id\n end\n @edit[:new][:repfilter] = \"\" if params[:repfilter_typ] == \"<Choose>\"\n elsif @sb[:wtype] == \"m\"\n if params[:add_shortcut]\n s = MiqShortcut.find(params[:add_shortcut].to_i)\n @edit[:avail_shortcuts].delete_if { |as| as.last == s.id }\n @edit[:new][:shortcuts][s.id] = s.description\n @edit[:new][:shortcut_keys] = @edit[:new][:shortcuts].keys # Save the keys array so we can compare the hash order\n @replace_filter_div = true\n end\n params.each do |k, v|\n if k.to_s.starts_with?(\"shortcut_desc_\")\n sc_id = k.split(\"_\").last.to_i\n @edit[:new][:shortcuts][sc_id] = v\n end\n end\n end\n\n # Schedule settings box\n @edit[:new][:timer] ||= ReportHelper::Timer.new\n @edit[:new][:timer].update_from_hash(params)\n\n if params[:time_zone]\n @edit[:tz] = params[:time_zone]\n @timezone_abbr = Time.now.in_time_zone(@edit[:tz]).strftime(\"%Z\")\n end\n\n if @sb[:wtype] == \"r\"\n # Look at the pivot group field selectors\n @edit[:new][:pivot].update(params)\n\n if @edit[:new][:filter]\n @folders ||= []\n report_selection_menus # to build sub folders\n rpt = if @edit[:new][:repfilter]\n @edit[:new][:repfilter]\n elsif @widget.resource_id && @widget.resource_type == \"MiqReport\"\n @widget.resource_id\n end\n widget_set_column_vars(rpt)\n end\n @edit[:new][:pivot].options = @edit[:new][:fields].dup\n @pivot = @edit[:new][:pivot]\n elsif @sb[:wtype] == \"c\"\n widget_graph_menus # to build report pulldown with only reports with graphs\n end\n\n visibility_box_edit\n end",
"title": ""
},
{
"docid": "a0fa3ca4ab5c4d3dd1ca3e7ba7644bf6",
"score": "0.5418921",
"text": "def ajax_forms options={}\n default_options = {\n quick_new_partial: nil,\n quick_create_partial: nil,\n model: config.resource_class,\n search_fields: ['name'],\n display_column: 'name',\n search_condition: 'cont_all'\n }\n options = default_options.deep_merge(options)\n\n @ajax_form_enabled = true\n\n # XXX: usar reflect on association para definir los collection_actions en los modelos\n # relacionados donde se quieren buscar los datos\n # Por ejemplo, si product belongs_to invoice_line, y quiero crear dinámicamente un producto\n # solo hace falta definir en invoice_line que se quiere usar ajax_forms. Automáticamente\n # se crean los collection_actions en products para realizar las búsquedas.\n\n #todo: Posibilidad de especificar los atributos a devolver en el método find. Si no se especifica nada devolver todas las columnas\n collection_action :find, :method => :get do\n model = resource_class\n search_term = params[:q]\n groupping_condition = params[:q][:g] rescue nil\n ransack_search = options[:search_fields].join('_or_').concat('_').concat(options[:search_condition]).to_sym\n\n if params[:q_id].present?\n params[:q]={:id_equals => params[:q_id]} #selected element\n elsif groupping_condition.nil?\n params[:q]={\n :g=>{\n \"0\"=>{ransack_search=>search_term.split(\" \")}\n }\n }\n\n # if this search depends on the result of another select box\n # we need to add the filter to the existing ransack options\n if params[:dependentSelect] and !params[:dependentSelect][:selectorValue].empty?\n params[:q][:g][\"1\"]={params[:dependentSelect][:ransackFilter].to_sym=>params[:dependentSelect][:selectorValue]}\n end\n end\n\n q = model.search(params[:q])\n @items = q.result.order('id asc', 'name asc').limit(100).map { |item| {:id => item.id, :text => item.to_s} }\n respond_to do |format|\n format.json { render :json => @items }\n end\n end\n\n collection_action :quick_new, :method => :get do\n @model = resource_class.new(:name => Base64.decode64(params[:name]))\n options[:selector]=params[:selectorid]\n #crea una variable de instancia con el nombre del recurso para compatibilidad con partials normales\n instance_variable_set(\"@#{resource_instance_name.to_s}\", @model)\n @remote = true\n @form_url = eval \"quick_create_admin_#{resource_collection_name.to_s}_path\"\n\n @id=\"#{Time.now.to_i.to_s}_#{resource_instance_name.to_s}\"\n options[:id]=@id\n\n #todo: tiene que renderizar un formulario por defecto\n if options.fetch(:quick_new_partial).nil?\n render :nothing => true\n else\n render partial: options.fetch(:quick_new_partial), layout: 'application'\n end\n end\n\n collection_action :quick_create, :method => :post do\n @model = resource_class.new(params[resource_instance_name])\n @selector=options[:selector]\n @model.save\n @id=options[:id]\n render file: 'quick_response', layout: false\n end\n end",
"title": ""
},
{
"docid": "617374529af4501105776a14b1b256ce",
"score": "0.54150665",
"text": "def options\n unfiltered_options.select { |o| o.count < @query.count }\n end",
"title": ""
},
{
"docid": "85d52343bb80ea8fa3cbb9de5529500c",
"score": "0.5413444",
"text": "def config\r\n\t\t\tr = \"<table class=\\\"option-gui\\\"><tr><td>\"\r\n\t\t\tr += \"<select name=\\\"values[]\\\" multiple=\\\"multiple\\\" size=\\\"7\\\">\"\r\n\t\t\tr += values.collect { |v| \"<option value=\\\"#{v.id}\\\">#{v.value}</option>\" }.join\r\n\t\t\tr += \"</select><br />\"\r\n\t\t\tr += \"</td><td>\"\r\n\t\t\tr += \"<input class=\\\"button\\\" type=\\\"submit\\\" name=\\\"up\\\" value=\\\"Move Up\\\" onclick=\\\"$('do-#{id}').value='up'\\\" /><br />\"\r\n\t\t\tr += \"<input class=\\\"button\\\" type=\\\"submit\\\" name=\\\"down\\\" value=\\\"Move Down\\\" onclick=\\\"$('do-#{id}').value='down'\\\" /><br />\"\r\n\t\t\tr += \"<input class=\\\"button\\\" type=\\\"submit\\\" name=\\\"delete\\\" value=\\\"Delete\\\" onclick=\\\"$('do-#{id}').value='delete_value'\\\" />\"\r\n\t\t\tr += \"</td></tr><tr><td colspan=\\\"2\\\">\"\r\n\t\t\tr += \"<input class=\\\"text\\\" type=\\\"text\\\" name=\\\"new_value\\\" />\"\r\n\t\t\tr += \"<input class=\\\"button\\\" type=\\\"submit\\\" name=\\\"add\\\" value=\\\"Add\\\" onclick=\\\"$('do-#{id}').value='add'\\\" />\"\r\n\t\t\tr += \"</td></tr></table>\"\r\n\t\tend",
"title": ""
},
{
"docid": "c9972e7131712657a505bb4e485268e6",
"score": "0.54046494",
"text": "def opt_list\n self.class.opt_list\n end",
"title": ""
},
{
"docid": "c2d0487d302c9db1ce98a29109a0e7a5",
"score": "0.5398524",
"text": "def get_choices(*)\n {}\n end",
"title": ""
},
{
"docid": "7603b1f444e536259fc8d1dcc2eb54fe",
"score": "0.5384621",
"text": "def index\n @event_parameter_choices = EventParameterChoice.all\n end",
"title": ""
},
{
"docid": "6d2be19779ec4db31e7c2dfa6c399b1c",
"score": "0.538448",
"text": "def options_for_action_select\n source_array = []\n self.questions.each do |q|\n if q.class == MatrixQuestion\n q.choice_questions.each { |cq|\n source_array << [\n \"#{q.question_content.statement}: #{cq.question_content.statement} response\",\n \"#{cq.question_content.id}\"\n ]\n }\n else\n source_array << [\n \"#{q.question_content.statement} response\",\n \"#{q.question_content.id}\"\n ]\n end\n end\n source_array\n end",
"title": ""
},
{
"docid": "388b95dd7c7351bfbf4cb868e35e787f",
"score": "0.5383871",
"text": "def select_options(type, request)\n all_rows_for(type, request).map{|obj| [object_display_name(type, request, obj), primary_key_value(obj)]}\n end",
"title": ""
},
{
"docid": "09695aa8a6d044fbdeba3f2a1966ddf7",
"score": "0.53824824",
"text": "def fetch_all_combinations(category)\n c = Curl::Easy.new(\"http://www.starbucks.com/retail/nutrition_comparison_popup.asp?category={#{category}}\")\n\n c.perform\n\n doc = Hpricot( c.body_str )\n\n category = nil\n subcategory = nil\n # have to run through a number of options\n (doc/\"input\").each do|input|\n case input['name']\n when 'category' then category = input['value']\n when 'subcategory' then subcategory = input['value']\n end\n end\n\n milks = []\n sizes = []\n\n (doc/\"select\").each do|select|\n optvalues = [] \n (select/\"option\").each do|opt|\n optvalues << {:value => opt['value'], :name => opt.inner_text}\n end\n case select['name']\n when 'milk'\n milks = optvalues\n when 'size'\n sizes = optvalues\n end\n end\n\n {\n :category => category,\n :subcategory => subcategory,\n :milks => milks,\n :sizes => sizes\n }\nend",
"title": ""
},
{
"docid": "d35bc1d2029cba629e022dc64bb3c2b3",
"score": "0.53708416",
"text": "def set_options\n @options = []\n @options << { menu_id: 1, menu_title: 'Areas count', method: :how_many }\n @options << { menu_id: 2, menu_title: 'Smallest Population (non 0)', method: :smallest_pop }\n @options << { menu_id: 3, menu_title: 'Largest Population', method: :largest_pop }\n @options << { menu_id: 4, menu_title: 'How many zips in California?', method: :california_zip }\n @options << { menu_id: 5, menu_title: 'Information for a given zip', method: :zip_info }\n @options << { menu_id: 6, menu_title: 'Exit', method: :exit }\n end",
"title": ""
},
{
"docid": "e5bd4739583d4e31a7c3832fb77f1778",
"score": "0.5362851",
"text": "def query_params\n @params.clear\n add_defaults\n add_data\n add_legends if @legends and show_legend?\n add_labels if @labels and show_labels?\n add_colors if @colors\n add_fills if @fills\n add_axes if @axes\n add_grid if @grid\n add_markers if @markers\n add_bar_width_and_spacing if respond_to?(:add_bar_width_and_spacing)\n add_map_parameters if respond_to?(:add_map_parameters)\n add_additional_parameters if respond_to?(:add_additional_parameters)\n return @params\n end",
"title": ""
},
{
"docid": "aeeb48e84987d159d213f097649822b0",
"score": "0.53540236",
"text": "def to_form_values()\n values = []\n\n # We create an individual fq_n HTML form value for each\n # fq value because Rails does not like the same value on the form.\n @fq.each_with_index do |filter, i|\n values << {name: \"fq_#{i}\", value: filter.form_value}\n end\n\n values << {name: \"rows\", value: @page_size} if @page_size != DEFAULT_PAGE_SIZE\n values << {name: \"page\", value: @page} if @page != 1\n # Don't surface this to the UI for now\n # (since we don't let the user change the sorting)\n # values << {name: \"sort\", value: @sort} if sort != \"\"\n values\n end",
"title": ""
},
{
"docid": "82e63b1b9c9f341d3b797b535dec670f",
"score": "0.5350701",
"text": "def get_drop_down_options_tea_bases\n val = params[:id]\n #Use val to find records\n @tea_bases = ServingStyle.find(val).tea_bases\n options = @tea_bases.collect{|x| \"'#{x.id}' : '#{x.name}'\"} \n render :text => \"{#{options.join(\",\")}}\" \n end",
"title": ""
},
{
"docid": "31876dffad445e4b9a1d1e582f939462",
"score": "0.534565",
"text": "def set_options\n\n @options = []\n @options << { menu_id: 1, menu_title: 'Areas count', method: :how_many }\n @options << { menu_id: 2, menu_title: 'Smallest Population (non 0)', method: :smallest_pop }\n @options << { menu_id: 3, menu_title: 'Largest Population', method: :largest_pop }\n @options << { menu_id: 4, menu_title: 'How many zips in California?', method: :california_zips}\n @options << { menu_id: 5, menu_title: 'Information for a given zip', method: :zip_info }\n @options << { menu_id: 6, menu_title: 'Exit', method: :exit}\n\n end",
"title": ""
},
{
"docid": "20c6db04dae11a70e8ebceea34a92bc9",
"score": "0.5343532",
"text": "def build_query(buttons = [])\n query = []\n @mech.log.info(\"form encoding: #{encoding}\") if @mech && @mech.log\n\n save_hash_field_order\n\n successful_controls = []\n\n (fields + checkboxes).reject do |f|\n f.node[\"disabled\"] || f.node[\"name\"] == \"\"\n end.sort.each do |f|\n case f\n when Mechanize::Form::CheckBox\n if f.checked\n successful_controls << f\n end\n when Mechanize::Form::Field\n successful_controls << f\n end\n end\n\n radio_groups = {}\n radiobuttons.each do |f|\n fname = from_native_charset(f.name)\n radio_groups[fname] ||= []\n radio_groups[fname] << f\n end\n\n # take one radio button from each group\n radio_groups.each_value do |g|\n checked = g.select(&:checked)\n\n if checked.uniq.size > 1 then\n values = checked.map(&:value).join(', ').inspect\n name = checked.first.name.inspect\n raise Mechanize::Error,\n \"radiobuttons #{values} are checked in the #{name} group, \" \\\n \"only one is allowed\"\n else\n successful_controls << checked.first unless checked.empty?\n end\n end\n\n @clicked_buttons.each { |b|\n successful_controls << b\n }\n\n successful_controls.sort.each do |ctrl| # DOM order\n qval = proc_query(ctrl)\n query.push(*qval)\n end\n\n query\n end",
"title": ""
},
{
"docid": "8e7b8293f1d0c7cde23b065625618453",
"score": "0.5343306",
"text": "def uf_options_for_select\n @uf_options_for_select = Uf.order(:sigla)\n end",
"title": ""
},
{
"docid": "cd5bc54802cbb684b4bce571a2d8b784",
"score": "0.533682",
"text": "def build_list_options\n conditions = []\n conditions_str = []\n @search_titles = []\n @search_filters ||= {}\n # convert, from k-params to k-fields\n params_keys = {}\n params.delete_if { |kp,v|\n unless (kf = ParamToField[kp.to_sym]).nil? then\n @search_filters[ kf ] = v\n params_keys[ kf ] = kp\n true\n end\n }\n\n if @search_filters[:search_text] then\n search_fields = ['function', 'action', 'message', 'tags', 'help_info', 'active']\n unless search_fields.empty? then\n conditions_str << '(' + search_fields.map{ |c| \"`sms_replies`.`#{c}` LIKE ?\" }.join(' OR ') + ')'\n search_fields.size.times { conditions << \"%#{@search_filters[:search_text]}%\" }\n end \n @search_titles << ['text', @search_filters[:search_text]] \n end\n \n # store again to params (for next link)\n @search_filters.each_pair { |kf,v| params[ params_keys[kf] ] = v }\n \n # return conditions array\n conditions.unshift( conditions_str.join(' AND ') ) unless conditions_str.empty?\n conditions unless conditions.empty?\n end",
"title": ""
},
{
"docid": "9d91c9e6c7e29b94466a6923aac33400",
"score": "0.5333456",
"text": "def search_fields\n Blacklight.search_field_options_for_select\n end",
"title": ""
},
{
"docid": "944ccb28849689f7eb78e095eab2e890",
"score": "0.53318787",
"text": "def show\n get_options\n end",
"title": ""
},
{
"docid": "8cff46a069f88291361e1ac8a72de861",
"score": "0.53276825",
"text": "def search_opts\n search_opts = Array.new\n search_opts << ['query-1', @search_field_code + ':' + @q.gsub(/[[:punct:]]/, '')] # remove punctuation, because EDS responds poorly to it (particularly : and ,)\n search_opts << ['limiter', 'FT:y']\n search_opts << ['resultsperpage', '10']\n search_opts << ['view', 'detailed']\n i = 1\n @requested_facets.each do |facet|\n search_opts << ['facetfilter', (i.to_s + ', ' + facet)]\n i = i + 1\n end\n search_opts << ['pagenumber', @page.to_s]\n search_opts << ['highlight', 'n']\n return search_opts\n end",
"title": ""
},
{
"docid": "4ee3e5c539624eefe8d73464c7636c77",
"score": "0.53216046",
"text": "def filter_select_opts\n [{:text => '', :value => 'none', :id => 'opt-none', :visible => true}] + \n VwcAllCombined.filterables.map{|fld| \n {:text => \"Filter on #{fld.humanize.titlecase}\", \n :value => fld, \n :id => \"opt-#{fld}\", \n :visible => true} \n }\n end",
"title": ""
},
{
"docid": "408402bcd66b2cc097d6809dc38082aa",
"score": "0.53211683",
"text": "def set_form_vars\n @categories = Category.all\n @measurements = Measurement.all\n @locations = Location.all\n end",
"title": ""
},
{
"docid": "40891d8ac53062575af36129fe61fac4",
"score": "0.5316406",
"text": "def html_form(*)\n super do |field|\n [ field.text_area(:query, rows: 3, mandatory: true),\n field.select(:category_id, Category.all, size: 3),\n field.check_box_inline(:active),\n field.date(:expires_on),\n field.submit\n ]\n end\n end",
"title": ""
},
{
"docid": "ad21210470434203d5f8941599614ccf",
"score": "0.530907",
"text": "def build_list_options\n conditions = []\n conditions_str = []\n @search_titles = []\n @search_filters ||= {}\n # convert, from k-params to k-fields\n params_keys = {}\n params.delete_if { |kp,v|\n unless (kf = @@param_to_field[kp.to_sym]).nil? then\n @search_filters[ kf ] = v\n params_keys[ kf ] = kp\n true\n end\n }\n\n if @search_filters[:search_text] then\n search_fields = ['plugins', 'name', 'value', 'language']\n unless search_fields.empty? then\n conditions_str << '(' + search_fields.map{ |c| \"`languages`.`#{c}` LIKE ?\" }.join(' OR ') + ')'\n search_fields.size.times { conditions << \"%#{@search_filters[:search_text]}%\" }\n end \n @search_titles << ['text', @search_filters[:search_text]] \n end\n \n # store again to params (for next link)\n @search_filters.each_pair { |kf,v| params[ params_keys[kf] ] = v }\n \n conditions.unshift( conditions_str.join(' AND ') ) unless conditions.empty? \n end",
"title": ""
},
{
"docid": "5548699a6f46f97b5d84995f6132d104",
"score": "0.52956617",
"text": "def floors_get_options_for_interact_view\n re_floors = FloorRealEstate.where real_estate_id: params[:id]\n\n options = []\n re_floors.each do |re_floor|\n options << {\n id: re_floor.id,\n name: re_floor.display_name\n }\n end\n\n render json: { status: 0, result: options }\n end",
"title": ""
},
{
"docid": "291b99d346abebbe95fe87e363b9acf9",
"score": "0.5285126",
"text": "def search_field_options_for_select(lens = nil)\n search_fields(lens)\n end",
"title": ""
},
{
"docid": "796541f671d9e569d6574790dbd656c8",
"score": "0.52801543",
"text": "def options\n option_hash = {}\n my_labels = option_names\n my_inputs = option_fields\n\n my_labels.count.times do |index|\n option_hash[my_labels[index]] = my_inputs[index]\n end\n option_hash\n end",
"title": ""
},
{
"docid": "d2e8d2154a38f7ed2d743922b0e0ae90",
"score": "0.527583",
"text": "def select_options\n self.vehicle_check.select_options\n end",
"title": ""
},
{
"docid": "ddcd7d1dc5c1cb004c18edd97a1729ea",
"score": "0.52720654",
"text": "def record_select_conditions_from_controller; end",
"title": ""
},
{
"docid": "ddcd7d1dc5c1cb004c18edd97a1729ea",
"score": "0.52720654",
"text": "def record_select_conditions_from_controller; end",
"title": ""
},
{
"docid": "f7e579b61ee694800d3a7c8c6892de0d",
"score": "0.52690184",
"text": "def report_criteria_use_dropdown_options(config, value)\n classification_class = Classification.get_classification_type_by name: config.type\n\n if classification_class.respond_to?(:all_name_value_enable_flagged)\n if config.item_type == 'all'\n type_filter = nil\n elsif config.item_type\n type_filter = { item_type: config.item_type }\n elsif config.conditions\n type_filter = config.conditions\n end\n\n if config.disabled || !@report_page\n type_filter ||= {}\n type_filter[:disabled] = false\n end\n\n options_for_select(classification_class.all_name_value_enable_flagged(type_filter), value)\n elsif config.type == 'defined_selector'\n item_type, field_name = config.defined_selector.split('/')\n opts = Classification::GeneralSelection.selector_with_config_overrides item_type: item_type,\n field_name: field_name\n opts = opts.map { |r| [r[:name], r[:value]] }\n options_for_select(opts || [], value)\n elsif config.type == 'config_selector'\n options_for_select(config.selections || [], value)\n elsif config.type == 'select_from_model'\n # Get the model by the configured resource name\n def_value = value\n resource_name = config.resource_name\n res = Resources::Models.find_by(resource_name: resource_name) if resource_name\n raise FphsException, \"No resource matches resource_name: #{resource_name}\" unless res\n\n # Use the configuration of selections to define which fields to pull as the options\n # The selections configuration is \"<label field>: <value field>\"\n # For example, for a data dictionary variable, this might be \"study: study\"\n fields = (config.selections || { id: :id })\n model = res[:model]\n\n label = fields.keys.first\n value = fields.values.first\n\n # Make sure we can't call any arbitrary method on the model\n valid_attrs = model.attribute_names + ['data']\n unless label.to_s.in?(valid_attrs) && value.to_s.in?(valid_attrs)\n raise FphsException,\n \"Invalid attribute requested #{label}: #{value}\"\n end\n\n selections = model\n selections = selections.active if selections.attribute_names.include? 'disabled'\n\n selections = if label.to_s == 'data' || value.to_s == 'data'\n # Map rather than pluck so we can get the data attribute successfully\n selections.distinct.reorder('')\n .map do |r|\n [r.send(label), r.send(value)]\n end\n else\n selections.distinct.reorder('').pluck(label, value)\n end\n\n # NOTE: #uniq is called twice below on purpose, first to hugely limit large tables,\n # then second to merge what were previously nils that have become empty strings,\n # with the values that were actually empty strings\n selections = selections.uniq\n\n # Handle pluck returning only a single value for each result if the same\n # attribute for label and value are specified\n selections = selections.map { |a| [a, a] } unless selections.first.is_a?(Array)\n selections = selections.map { |a| [a.first.to_s, a.last.to_s] }\n .uniq\n .sort { |x, y| x.first <=> y.first }\n\n got_bar = selections.find { |s| s.first.include?('|') }\n return grouped_options_for_select(record_results_grouping(selections, '|'), def_value) if got_bar\n\n options_for_select(selections, def_value)\n end\n end",
"title": ""
},
{
"docid": "82b362544b4c3970c16c7d56f38810fe",
"score": "0.52610576",
"text": "def choices\n\n @question = SurveyQuestion.find(params[:id])\n @options = SurveyQuestionOption.where(survey_question_id: params[:id]) rescue nil\n end",
"title": ""
},
{
"docid": "82b362544b4c3970c16c7d56f38810fe",
"score": "0.52591634",
"text": "def choices\n\n @question = SurveyQuestion.find(params[:id])\n @options = SurveyQuestionOption.where(survey_question_id: params[:id]) rescue nil\n end",
"title": ""
},
{
"docid": "33a2c66ff06e52308789848eb8cf9e2c",
"score": "0.5252343",
"text": "def build_list_options\n conditions = []\n conditions_str = []\n @search_titles = []\n @search_filters ||= {}\n # convert, from k-params to k-fields\n params_keys = {}\n params.delete_if { |kp,v|\n unless (kf = ParamToField[kp.to_sym]).nil? then\n @search_filters[ kf ] = v\n params_keys[ kf ] = kp\n true\n end\n }\n\n #if @search_filters[:user_id] then \n # filter_instance = User.find_by_id(@search_filters[:user_id])\n # if filter_instance then\n # conditions_str << \"addressbook_groups.user_id = ?\"\n # conditions << self.current_user.id #@search_filters[:user_id]\n # @search_titles << ['user', filter_instance]\n # else\n # @search_filters.delete(:user_id)\n # end\n #end\n \n if @search_filters[:search_text] then\n search_fields = ['name']\n unless search_fields.empty? then\n conditions_str << '(' + search_fields.map{ |c| \"`addressbook_groups`.`#{c}` LIKE ?\" }.join(' OR ') + ')'\n search_fields.size.times { conditions << \"%#{@search_filters[:search_text]}%\" }\n end \n @search_titles << ['text', @search_filters[:search_text]] \n end\n \n #conditions_str << \"addressbook_groups.public = ?\"\n #conditions << params[:public]\n \n #if !params[:public] then\n # conditions_str << \"addressbook_groups.user_id = ? \"\n # conditions << self.current_user.id\n #else\n # if !permit?('superadmin') then\n # conditions_str << \"(addressbook_groups.department_id IS ? OR addressbook_groups.department_id = ?)\"\n # conditions << nil\n # conditions << self.current_user.department_id\n # end\n #end\n \n # store again to params (for next link)\n @search_filters.each_pair { |kf,v| params[ params_keys[kf] ] = v }\n \n # return conditions array\n conditions.unshift( conditions_str.join(' AND ') ) unless conditions_str.empty?\n conditions unless conditions.empty?\n end",
"title": ""
},
{
"docid": "9f52389d61663cdbf9eddfee4261bca9",
"score": "0.5247272",
"text": "def index\n @options = Option.all\n end",
"title": ""
},
{
"docid": "9f52389d61663cdbf9eddfee4261bca9",
"score": "0.5247272",
"text": "def index\n @options = Option.all\n end",
"title": ""
},
{
"docid": "9f52389d61663cdbf9eddfee4261bca9",
"score": "0.5247272",
"text": "def index\n @options = Option.all\n end",
"title": ""
},
{
"docid": "9f52389d61663cdbf9eddfee4261bca9",
"score": "0.5247272",
"text": "def index\n @options = Option.all\n end",
"title": ""
},
{
"docid": "5fe65c950c9bf8a4046c8db7787509e1",
"score": "0.5247098",
"text": "def options_call; end",
"title": ""
}
] |
80a79da7b6083cf4738ce905b112e5a7
|
Methods for conditional serialization.
|
[
{
"docid": "9a9836ec3e66731938dcb41379b723e9",
"score": "0.0",
"text": "def has_history?\n !object.history.nil?\n end",
"title": ""
}
] |
[
{
"docid": "19a2797f5ec2cbc6bde04faf10dba814",
"score": "0.7652727",
"text": "def serialized?; end",
"title": ""
},
{
"docid": "19a2797f5ec2cbc6bde04faf10dba814",
"score": "0.7652727",
"text": "def serialized?; end",
"title": ""
},
{
"docid": "19a2797f5ec2cbc6bde04faf10dba814",
"score": "0.7652727",
"text": "def serialized?; end",
"title": ""
},
{
"docid": "19a2797f5ec2cbc6bde04faf10dba814",
"score": "0.7652727",
"text": "def serialized?; end",
"title": ""
},
{
"docid": "28e1ca2204967bcb3b3b33fe5ff968e4",
"score": "0.694005",
"text": "def serialize!; end",
"title": ""
},
{
"docid": "022f035c98c1ed6a5c190a356cdc24a4",
"score": "0.6885943",
"text": "def serialize?(argument); end",
"title": ""
},
{
"docid": "7126205d5f0dae97450160c0f2c522a7",
"score": "0.6875617",
"text": "def prepare_serialization!; end",
"title": ""
},
{
"docid": "7126205d5f0dae97450160c0f2c522a7",
"score": "0.6875617",
"text": "def prepare_serialization!; end",
"title": ""
},
{
"docid": "f474c3ed5cbcf84e6764b56aece75a7f",
"score": "0.67678005",
"text": "def is_serialized?()\n @serialized\n end",
"title": ""
},
{
"docid": "ecb467bd57d28dce500c68df3de78447",
"score": "0.6716963",
"text": "def serializable?(value); end",
"title": ""
},
{
"docid": "ecb467bd57d28dce500c68df3de78447",
"score": "0.6716963",
"text": "def serializable?(value); end",
"title": ""
},
{
"docid": "28ee2da6840feee9562af047de23ca8b",
"score": "0.6675934",
"text": "def serialize!\n end",
"title": ""
},
{
"docid": "a126e681346630c4ec31fd99d7ebfee1",
"score": "0.6645506",
"text": "def serialize; end",
"title": ""
},
{
"docid": "a126e681346630c4ec31fd99d7ebfee1",
"score": "0.6645506",
"text": "def serialize; end",
"title": ""
},
{
"docid": "a126e681346630c4ec31fd99d7ebfee1",
"score": "0.6645506",
"text": "def serialize; end",
"title": ""
},
{
"docid": "a126e681346630c4ec31fd99d7ebfee1",
"score": "0.6645506",
"text": "def serialize; end",
"title": ""
},
{
"docid": "a126e681346630c4ec31fd99d7ebfee1",
"score": "0.6645506",
"text": "def serialize; end",
"title": ""
},
{
"docid": "a126e681346630c4ec31fd99d7ebfee1",
"score": "0.6645506",
"text": "def serialize; end",
"title": ""
},
{
"docid": "a126e681346630c4ec31fd99d7ebfee1",
"score": "0.6645506",
"text": "def serialize; end",
"title": ""
},
{
"docid": "a126e681346630c4ec31fd99d7ebfee1",
"score": "0.6645506",
"text": "def serialize; end",
"title": ""
},
{
"docid": "a126e681346630c4ec31fd99d7ebfee1",
"score": "0.6645506",
"text": "def serialize; end",
"title": ""
},
{
"docid": "185a0d09a1c524f5036189b12c2aa6d3",
"score": "0.65682423",
"text": "def serialize_as; end",
"title": ""
},
{
"docid": "2ad276cac13006130a229e6e52743bcb",
"score": "0.6553141",
"text": "def ignore_on_serialization\n []\n end",
"title": ""
},
{
"docid": "673b5630c4e497fa98a7029e3abc448c",
"score": "0.64779085",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"boolean\", @boolean)\n writer.write_object_value(\"calculated\", @calculated)\n writer.write_object_value(\"choice\", @choice)\n writer.write_string_value(\"columnGroup\", @column_group)\n writer.write_object_value(\"contentApprovalStatus\", @content_approval_status)\n writer.write_object_value(\"currency\", @currency)\n writer.write_object_value(\"dateTime\", @date_time)\n writer.write_object_value(\"defaultValue\", @default_value)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_boolean_value(\"enforceUniqueValues\", @enforce_unique_values)\n writer.write_object_value(\"geolocation\", @geolocation)\n writer.write_boolean_value(\"hidden\", @hidden)\n writer.write_object_value(\"hyperlinkOrPicture\", @hyperlink_or_picture)\n writer.write_boolean_value(\"indexed\", @indexed)\n writer.write_boolean_value(\"isDeletable\", @is_deletable)\n writer.write_boolean_value(\"isReorderable\", @is_reorderable)\n writer.write_boolean_value(\"isSealed\", @is_sealed)\n writer.write_object_value(\"lookup\", @lookup)\n writer.write_string_value(\"name\", @name)\n writer.write_object_value(\"number\", @number)\n writer.write_object_value(\"personOrGroup\", @person_or_group)\n writer.write_boolean_value(\"propagateChanges\", @propagate_changes)\n writer.write_boolean_value(\"readOnly\", @read_only)\n writer.write_boolean_value(\"required\", @required)\n writer.write_object_value(\"sourceColumn\", @source_column)\n writer.write_object_value(\"sourceContentType\", @source_content_type)\n writer.write_object_value(\"term\", @term)\n writer.write_object_value(\"text\", @text)\n writer.write_object_value(\"thumbnail\", @thumbnail)\n writer.write_enum_value(\"type\", @type)\n writer.write_object_value(\"validation\", @validation)\n end",
"title": ""
},
{
"docid": "89ff1e169802b16458f4350e61595c4b",
"score": "0.64733183",
"text": "def serialize_data\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "9930f9712e19e44b4a7835560caa4c64",
"score": "0.63982564",
"text": "def serialize(_value, _strict)\n raise \"#{__method__} must be overridden by #{self.class.name}\"\n end",
"title": ""
},
{
"docid": "3afcf31804fb6a3ff5f45d8440c40af7",
"score": "0.6350234",
"text": "def serialize(_instance)\n raise NotImplementedError.new('Must override in included class')\n end",
"title": ""
},
{
"docid": "36e3447f8b54f14e544ef9b18d2821b2",
"score": "0.63473976",
"text": "def final_serialize_attrs\n if being_included?\n self.class.include_attrs | serialize_attrs\n else\n self.class.default_attrs | serialize_attrs\n end\n end",
"title": ""
},
{
"docid": "826728f526eaa84396c552e3a0dbe9f7",
"score": "0.634458",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"appsBlockCopyPaste\", @apps_block_copy_paste)\n writer.write_boolean_value(\"bluetoothBlocked\", @bluetooth_blocked)\n writer.write_boolean_value(\"cameraBlocked\", @camera_blocked)\n writer.write_boolean_value(\"cellularBlockWifiTethering\", @cellular_block_wifi_tethering)\n writer.write_enum_value(\"compliantAppListType\", @compliant_app_list_type)\n writer.write_collection_of_object_values(\"compliantAppsList\", @compliant_apps_list)\n writer.write_boolean_value(\"diagnosticDataBlockSubmission\", @diagnostic_data_block_submission)\n writer.write_boolean_value(\"emailBlockAddingAccounts\", @email_block_adding_accounts)\n writer.write_boolean_value(\"locationServicesBlocked\", @location_services_blocked)\n writer.write_boolean_value(\"microsoftAccountBlocked\", @microsoft_account_blocked)\n writer.write_boolean_value(\"nfcBlocked\", @nfc_blocked)\n writer.write_boolean_value(\"passwordBlockSimple\", @password_block_simple)\n writer.write_number_value(\"passwordExpirationDays\", @password_expiration_days)\n writer.write_number_value(\"passwordMinimumCharacterSetCount\", @password_minimum_character_set_count)\n writer.write_number_value(\"passwordMinimumLength\", @password_minimum_length)\n writer.write_number_value(\"passwordMinutesOfInactivityBeforeScreenTimeout\", @password_minutes_of_inactivity_before_screen_timeout)\n writer.write_number_value(\"passwordPreviousPasswordBlockCount\", @password_previous_password_block_count)\n writer.write_boolean_value(\"passwordRequired\", @password_required)\n writer.write_enum_value(\"passwordRequiredType\", @password_required_type)\n writer.write_number_value(\"passwordSignInFailureCountBeforeFactoryReset\", @password_sign_in_failure_count_before_factory_reset)\n writer.write_boolean_value(\"screenCaptureBlocked\", @screen_capture_blocked)\n writer.write_boolean_value(\"storageBlockRemovableStorage\", @storage_block_removable_storage)\n writer.write_boolean_value(\"storageRequireEncryption\", @storage_require_encryption)\n writer.write_boolean_value(\"webBrowserBlocked\", @web_browser_blocked)\n writer.write_boolean_value(\"wifiBlockAutomaticConnectHotspots\", @wifi_block_automatic_connect_hotspots)\n writer.write_boolean_value(\"wifiBlockHotspotReporting\", @wifi_block_hotspot_reporting)\n writer.write_boolean_value(\"wifiBlocked\", @wifi_blocked)\n writer.write_boolean_value(\"windowsStoreBlocked\", @windows_store_blocked)\n end",
"title": ""
},
{
"docid": "3df80d231a5e7caf30844c17e73f1621",
"score": "0.6338033",
"text": "def serializers; end",
"title": ""
},
{
"docid": "9706d67da33a0e95a5f2df925094987c",
"score": "0.6333414",
"text": "def serialize_normal_empty\n type.serialize if type.respond_to? :serialize\n end",
"title": ""
},
{
"docid": "45cf75f87c6c76d9ba9e13a38b7e3391",
"score": "0.63299435",
"text": "def encode_with_trick_serial_serializer!\n end",
"title": ""
},
{
"docid": "e51c3f3fb551263f7b7a1718c659409a",
"score": "0.63111955",
"text": "def apply_serialization\n klass_name = self.field_group.try(:klass_name)\n return if klass_name.blank?\n klass = klass_name.constantize\n\n serialized_attributes = klass.column_names.select{|col| klass.type_for_attribute(col).class == ::ActiveRecord::Type::Serialized }\n if !serialized_attributes.include?(self.name)\n Rails.logger.debug(\"#{Time.now.to_s(:db)} FfcrmMailchimp: Serializing #{self.name} as Hash for #{klass}.\")\n klass.serialize(self.name, Hash)\n end\n end",
"title": ""
},
{
"docid": "5c6b7da1a6a5e38834cf89210d0aa299",
"score": "0.62970173",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"autoPilotProfileAssigned\", @auto_pilot_profile_assigned)\n writer.write_boolean_value(\"autoPilotRegistered\", @auto_pilot_registered)\n writer.write_string_value(\"azureAdDeviceId\", @azure_ad_device_id)\n writer.write_string_value(\"azureAdJoinType\", @azure_ad_join_type)\n writer.write_boolean_value(\"azureAdRegistered\", @azure_ad_registered)\n writer.write_object_value(\"cloudIdentityScore\", @cloud_identity_score)\n writer.write_object_value(\"cloudManagementScore\", @cloud_management_score)\n writer.write_object_value(\"cloudProvisioningScore\", @cloud_provisioning_score)\n writer.write_boolean_value(\"compliancePolicySetToIntune\", @compliance_policy_set_to_intune)\n writer.write_string_value(\"deviceId\", @device_id)\n writer.write_string_value(\"deviceName\", @device_name)\n writer.write_enum_value(\"healthStatus\", @health_status)\n writer.write_boolean_value(\"isCloudManagedGatewayEnabled\", @is_cloud_managed_gateway_enabled)\n writer.write_string_value(\"managedBy\", @managed_by)\n writer.write_string_value(\"manufacturer\", @manufacturer)\n writer.write_string_value(\"model\", @model)\n writer.write_boolean_value(\"osCheckFailed\", @os_check_failed)\n writer.write_string_value(\"osDescription\", @os_description)\n writer.write_string_value(\"osVersion\", @os_version)\n writer.write_boolean_value(\"otherWorkloadsSetToIntune\", @other_workloads_set_to_intune)\n writer.write_string_value(\"ownership\", @ownership)\n writer.write_boolean_value(\"processorCoreCountCheckFailed\", @processor_core_count_check_failed)\n writer.write_boolean_value(\"processorFamilyCheckFailed\", @processor_family_check_failed)\n writer.write_boolean_value(\"processorSpeedCheckFailed\", @processor_speed_check_failed)\n writer.write_boolean_value(\"processor64BitCheckFailed\", @processor64_bit_check_failed)\n writer.write_boolean_value(\"ramCheckFailed\", @ram_check_failed)\n writer.write_boolean_value(\"secureBootCheckFailed\", @secure_boot_check_failed)\n writer.write_string_value(\"serialNumber\", @serial_number)\n writer.write_boolean_value(\"storageCheckFailed\", @storage_check_failed)\n writer.write_boolean_value(\"tenantAttached\", @tenant_attached)\n writer.write_boolean_value(\"tpmCheckFailed\", @tpm_check_failed)\n writer.write_enum_value(\"upgradeEligibility\", @upgrade_eligibility)\n writer.write_object_value(\"windowsScore\", @windows_score)\n writer.write_object_value(\"workFromAnywhereScore\", @work_from_anywhere_score)\n end",
"title": ""
},
{
"docid": "bb9d40491955b369ec8a7956a3b9758e",
"score": "0.62934864",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_boolean_value(\"blockCloudObjectTakeoverThroughHardMatchEnabled\", @block_cloud_object_takeover_through_hard_match_enabled)\n writer.write_boolean_value(\"blockSoftMatchEnabled\", @block_soft_match_enabled)\n writer.write_boolean_value(\"bypassDirSyncOverridesEnabled\", @bypass_dir_sync_overrides_enabled)\n writer.write_boolean_value(\"cloudPasswordPolicyForPasswordSyncedUsersEnabled\", @cloud_password_policy_for_password_synced_users_enabled)\n writer.write_boolean_value(\"concurrentCredentialUpdateEnabled\", @concurrent_credential_update_enabled)\n writer.write_boolean_value(\"concurrentOrgIdProvisioningEnabled\", @concurrent_org_id_provisioning_enabled)\n writer.write_boolean_value(\"deviceWritebackEnabled\", @device_writeback_enabled)\n writer.write_boolean_value(\"directoryExtensionsEnabled\", @directory_extensions_enabled)\n writer.write_boolean_value(\"fopeConflictResolutionEnabled\", @fope_conflict_resolution_enabled)\n writer.write_boolean_value(\"groupWriteBackEnabled\", @group_write_back_enabled)\n writer.write_string_value(\"@odata.type\", @odata_type)\n writer.write_boolean_value(\"passwordSyncEnabled\", @password_sync_enabled)\n writer.write_boolean_value(\"passwordWritebackEnabled\", @password_writeback_enabled)\n writer.write_boolean_value(\"quarantineUponProxyAddressesConflictEnabled\", @quarantine_upon_proxy_addresses_conflict_enabled)\n writer.write_boolean_value(\"quarantineUponUpnConflictEnabled\", @quarantine_upon_upn_conflict_enabled)\n writer.write_boolean_value(\"softMatchOnUpnEnabled\", @soft_match_on_upn_enabled)\n writer.write_boolean_value(\"synchronizeUpnForManagedUsersEnabled\", @synchronize_upn_for_managed_users_enabled)\n writer.write_boolean_value(\"unifiedGroupWritebackEnabled\", @unified_group_writeback_enabled)\n writer.write_boolean_value(\"userForcePasswordChangeOnLogonEnabled\", @user_force_password_change_on_logon_enabled)\n writer.write_boolean_value(\"userWritebackEnabled\", @user_writeback_enabled)\n writer.write_additional_data(@additional_data)\n end",
"title": ""
},
{
"docid": "ad75a298d7cc9868bf7bbd4ca2f42cd1",
"score": "0.62896603",
"text": "def serializer; end",
"title": ""
},
{
"docid": "ad75a298d7cc9868bf7bbd4ca2f42cd1",
"score": "0.62896603",
"text": "def serializer; end",
"title": ""
},
{
"docid": "ad75a298d7cc9868bf7bbd4ca2f42cd1",
"score": "0.62896603",
"text": "def serializer; end",
"title": ""
},
{
"docid": "72d0c5f9d3f412668c6e92b78553b7ab",
"score": "0.62742525",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"accountsBlockAddingNonMicrosoftAccountEmail\", @accounts_block_adding_non_microsoft_account_email)\n writer.write_boolean_value(\"antiTheftModeBlocked\", @anti_theft_mode_blocked)\n writer.write_enum_value(\"appsAllowTrustedAppsSideloading\", @apps_allow_trusted_apps_sideloading)\n writer.write_boolean_value(\"appsBlockWindowsStoreOriginatedApps\", @apps_block_windows_store_originated_apps)\n writer.write_collection_of_primitive_values(\"bluetoothAllowedServices\", @bluetooth_allowed_services)\n writer.write_boolean_value(\"bluetoothBlockAdvertising\", @bluetooth_block_advertising)\n writer.write_boolean_value(\"bluetoothBlockDiscoverableMode\", @bluetooth_block_discoverable_mode)\n writer.write_boolean_value(\"bluetoothBlockPrePairing\", @bluetooth_block_pre_pairing)\n writer.write_boolean_value(\"bluetoothBlocked\", @bluetooth_blocked)\n writer.write_boolean_value(\"cameraBlocked\", @camera_blocked)\n writer.write_boolean_value(\"cellularBlockDataWhenRoaming\", @cellular_block_data_when_roaming)\n writer.write_boolean_value(\"cellularBlockVpn\", @cellular_block_vpn)\n writer.write_boolean_value(\"cellularBlockVpnWhenRoaming\", @cellular_block_vpn_when_roaming)\n writer.write_boolean_value(\"certificatesBlockManualRootCertificateInstallation\", @certificates_block_manual_root_certificate_installation)\n writer.write_boolean_value(\"connectedDevicesServiceBlocked\", @connected_devices_service_blocked)\n writer.write_boolean_value(\"copyPasteBlocked\", @copy_paste_blocked)\n writer.write_boolean_value(\"cortanaBlocked\", @cortana_blocked)\n writer.write_boolean_value(\"defenderBlockEndUserAccess\", @defender_block_end_user_access)\n writer.write_enum_value(\"defenderCloudBlockLevel\", @defender_cloud_block_level)\n writer.write_number_value(\"defenderDaysBeforeDeletingQuarantinedMalware\", @defender_days_before_deleting_quarantined_malware)\n writer.write_object_value(\"defenderDetectedMalwareActions\", @defender_detected_malware_actions)\n writer.write_collection_of_primitive_values(\"defenderFileExtensionsToExclude\", @defender_file_extensions_to_exclude)\n writer.write_collection_of_primitive_values(\"defenderFilesAndFoldersToExclude\", @defender_files_and_folders_to_exclude)\n writer.write_enum_value(\"defenderMonitorFileActivity\", @defender_monitor_file_activity)\n writer.write_collection_of_primitive_values(\"defenderProcessesToExclude\", @defender_processes_to_exclude)\n writer.write_enum_value(\"defenderPromptForSampleSubmission\", @defender_prompt_for_sample_submission)\n writer.write_boolean_value(\"defenderRequireBehaviorMonitoring\", @defender_require_behavior_monitoring)\n writer.write_boolean_value(\"defenderRequireCloudProtection\", @defender_require_cloud_protection)\n writer.write_boolean_value(\"defenderRequireNetworkInspectionSystem\", @defender_require_network_inspection_system)\n writer.write_boolean_value(\"defenderRequireRealTimeMonitoring\", @defender_require_real_time_monitoring)\n writer.write_boolean_value(\"defenderScanArchiveFiles\", @defender_scan_archive_files)\n writer.write_boolean_value(\"defenderScanDownloads\", @defender_scan_downloads)\n writer.write_boolean_value(\"defenderScanIncomingMail\", @defender_scan_incoming_mail)\n writer.write_boolean_value(\"defenderScanMappedNetworkDrivesDuringFullScan\", @defender_scan_mapped_network_drives_during_full_scan)\n writer.write_number_value(\"defenderScanMaxCpu\", @defender_scan_max_cpu)\n writer.write_boolean_value(\"defenderScanNetworkFiles\", @defender_scan_network_files)\n writer.write_boolean_value(\"defenderScanRemovableDrivesDuringFullScan\", @defender_scan_removable_drives_during_full_scan)\n writer.write_boolean_value(\"defenderScanScriptsLoadedInInternetExplorer\", @defender_scan_scripts_loaded_in_internet_explorer)\n writer.write_enum_value(\"defenderScanType\", @defender_scan_type)\n writer.write_time_value(\"defenderScheduledQuickScanTime\", @defender_scheduled_quick_scan_time)\n writer.write_time_value(\"defenderScheduledScanTime\", @defender_scheduled_scan_time)\n writer.write_number_value(\"defenderSignatureUpdateIntervalInHours\", @defender_signature_update_interval_in_hours)\n writer.write_enum_value(\"defenderSystemScanSchedule\", @defender_system_scan_schedule)\n writer.write_enum_value(\"developerUnlockSetting\", @developer_unlock_setting)\n writer.write_boolean_value(\"deviceManagementBlockFactoryResetOnMobile\", @device_management_block_factory_reset_on_mobile)\n writer.write_boolean_value(\"deviceManagementBlockManualUnenroll\", @device_management_block_manual_unenroll)\n writer.write_enum_value(\"diagnosticsDataSubmissionMode\", @diagnostics_data_submission_mode)\n writer.write_boolean_value(\"edgeAllowStartPagesModification\", @edge_allow_start_pages_modification)\n writer.write_boolean_value(\"edgeBlockAccessToAboutFlags\", @edge_block_access_to_about_flags)\n writer.write_boolean_value(\"edgeBlockAddressBarDropdown\", @edge_block_address_bar_dropdown)\n writer.write_boolean_value(\"edgeBlockAutofill\", @edge_block_autofill)\n writer.write_boolean_value(\"edgeBlockCompatibilityList\", @edge_block_compatibility_list)\n writer.write_boolean_value(\"edgeBlockDeveloperTools\", @edge_block_developer_tools)\n writer.write_boolean_value(\"edgeBlockExtensions\", @edge_block_extensions)\n writer.write_boolean_value(\"edgeBlockInPrivateBrowsing\", @edge_block_in_private_browsing)\n writer.write_boolean_value(\"edgeBlockJavaScript\", @edge_block_java_script)\n writer.write_boolean_value(\"edgeBlockLiveTileDataCollection\", @edge_block_live_tile_data_collection)\n writer.write_boolean_value(\"edgeBlockPasswordManager\", @edge_block_password_manager)\n writer.write_boolean_value(\"edgeBlockPopups\", @edge_block_popups)\n writer.write_boolean_value(\"edgeBlockSearchSuggestions\", @edge_block_search_suggestions)\n writer.write_boolean_value(\"edgeBlockSendingDoNotTrackHeader\", @edge_block_sending_do_not_track_header)\n writer.write_boolean_value(\"edgeBlockSendingIntranetTrafficToInternetExplorer\", @edge_block_sending_intranet_traffic_to_internet_explorer)\n writer.write_boolean_value(\"edgeBlocked\", @edge_blocked)\n writer.write_boolean_value(\"edgeClearBrowsingDataOnExit\", @edge_clear_browsing_data_on_exit)\n writer.write_enum_value(\"edgeCookiePolicy\", @edge_cookie_policy)\n writer.write_boolean_value(\"edgeDisableFirstRunPage\", @edge_disable_first_run_page)\n writer.write_string_value(\"edgeEnterpriseModeSiteListLocation\", @edge_enterprise_mode_site_list_location)\n writer.write_string_value(\"edgeFirstRunUrl\", @edge_first_run_url)\n writer.write_collection_of_primitive_values(\"edgeHomepageUrls\", @edge_homepage_urls)\n writer.write_boolean_value(\"edgeRequireSmartScreen\", @edge_require_smart_screen)\n writer.write_object_value(\"edgeSearchEngine\", @edge_search_engine)\n writer.write_boolean_value(\"edgeSendIntranetTrafficToInternetExplorer\", @edge_send_intranet_traffic_to_internet_explorer)\n writer.write_boolean_value(\"edgeSyncFavoritesWithInternetExplorer\", @edge_sync_favorites_with_internet_explorer)\n writer.write_string_value(\"enterpriseCloudPrintDiscoveryEndPoint\", @enterprise_cloud_print_discovery_end_point)\n writer.write_number_value(\"enterpriseCloudPrintDiscoveryMaxLimit\", @enterprise_cloud_print_discovery_max_limit)\n writer.write_string_value(\"enterpriseCloudPrintMopriaDiscoveryResourceIdentifier\", @enterprise_cloud_print_mopria_discovery_resource_identifier)\n writer.write_string_value(\"enterpriseCloudPrintOAuthAuthority\", @enterprise_cloud_print_o_auth_authority)\n writer.write_string_value(\"enterpriseCloudPrintOAuthClientIdentifier\", @enterprise_cloud_print_o_auth_client_identifier)\n writer.write_string_value(\"enterpriseCloudPrintResourceIdentifier\", @enterprise_cloud_print_resource_identifier)\n writer.write_boolean_value(\"experienceBlockDeviceDiscovery\", @experience_block_device_discovery)\n writer.write_boolean_value(\"experienceBlockErrorDialogWhenNoSIM\", @experience_block_error_dialog_when_no_s_i_m)\n writer.write_boolean_value(\"experienceBlockTaskSwitcher\", @experience_block_task_switcher)\n writer.write_boolean_value(\"gameDvrBlocked\", @game_dvr_blocked)\n writer.write_boolean_value(\"internetSharingBlocked\", @internet_sharing_blocked)\n writer.write_boolean_value(\"locationServicesBlocked\", @location_services_blocked)\n writer.write_boolean_value(\"lockScreenAllowTimeoutConfiguration\", @lock_screen_allow_timeout_configuration)\n writer.write_boolean_value(\"lockScreenBlockActionCenterNotifications\", @lock_screen_block_action_center_notifications)\n writer.write_boolean_value(\"lockScreenBlockCortana\", @lock_screen_block_cortana)\n writer.write_boolean_value(\"lockScreenBlockToastNotifications\", @lock_screen_block_toast_notifications)\n writer.write_number_value(\"lockScreenTimeoutInSeconds\", @lock_screen_timeout_in_seconds)\n writer.write_boolean_value(\"logonBlockFastUserSwitching\", @logon_block_fast_user_switching)\n writer.write_boolean_value(\"microsoftAccountBlockSettingsSync\", @microsoft_account_block_settings_sync)\n writer.write_boolean_value(\"microsoftAccountBlocked\", @microsoft_account_blocked)\n writer.write_boolean_value(\"networkProxyApplySettingsDeviceWide\", @network_proxy_apply_settings_device_wide)\n writer.write_string_value(\"networkProxyAutomaticConfigurationUrl\", @network_proxy_automatic_configuration_url)\n writer.write_boolean_value(\"networkProxyDisableAutoDetect\", @network_proxy_disable_auto_detect)\n writer.write_object_value(\"networkProxyServer\", @network_proxy_server)\n writer.write_boolean_value(\"nfcBlocked\", @nfc_blocked)\n writer.write_boolean_value(\"oneDriveDisableFileSync\", @one_drive_disable_file_sync)\n writer.write_boolean_value(\"passwordBlockSimple\", @password_block_simple)\n writer.write_number_value(\"passwordExpirationDays\", @password_expiration_days)\n writer.write_number_value(\"passwordMinimumCharacterSetCount\", @password_minimum_character_set_count)\n writer.write_number_value(\"passwordMinimumLength\", @password_minimum_length)\n writer.write_number_value(\"passwordMinutesOfInactivityBeforeScreenTimeout\", @password_minutes_of_inactivity_before_screen_timeout)\n writer.write_number_value(\"passwordPreviousPasswordBlockCount\", @password_previous_password_block_count)\n writer.write_boolean_value(\"passwordRequireWhenResumeFromIdleState\", @password_require_when_resume_from_idle_state)\n writer.write_boolean_value(\"passwordRequired\", @password_required)\n writer.write_enum_value(\"passwordRequiredType\", @password_required_type)\n writer.write_number_value(\"passwordSignInFailureCountBeforeFactoryReset\", @password_sign_in_failure_count_before_factory_reset)\n writer.write_string_value(\"personalizationDesktopImageUrl\", @personalization_desktop_image_url)\n writer.write_string_value(\"personalizationLockScreenImageUrl\", @personalization_lock_screen_image_url)\n writer.write_enum_value(\"privacyAdvertisingId\", @privacy_advertising_id)\n writer.write_boolean_value(\"privacyAutoAcceptPairingAndConsentPrompts\", @privacy_auto_accept_pairing_and_consent_prompts)\n writer.write_boolean_value(\"privacyBlockInputPersonalization\", @privacy_block_input_personalization)\n writer.write_boolean_value(\"resetProtectionModeBlocked\", @reset_protection_mode_blocked)\n writer.write_enum_value(\"safeSearchFilter\", @safe_search_filter)\n writer.write_boolean_value(\"screenCaptureBlocked\", @screen_capture_blocked)\n writer.write_boolean_value(\"searchBlockDiacritics\", @search_block_diacritics)\n writer.write_boolean_value(\"searchDisableAutoLanguageDetection\", @search_disable_auto_language_detection)\n writer.write_boolean_value(\"searchDisableIndexerBackoff\", @search_disable_indexer_backoff)\n writer.write_boolean_value(\"searchDisableIndexingEncryptedItems\", @search_disable_indexing_encrypted_items)\n writer.write_boolean_value(\"searchDisableIndexingRemovableDrive\", @search_disable_indexing_removable_drive)\n writer.write_boolean_value(\"searchEnableAutomaticIndexSizeManangement\", @search_enable_automatic_index_size_manangement)\n writer.write_boolean_value(\"searchEnableRemoteQueries\", @search_enable_remote_queries)\n writer.write_boolean_value(\"settingsBlockAccountsPage\", @settings_block_accounts_page)\n writer.write_boolean_value(\"settingsBlockAddProvisioningPackage\", @settings_block_add_provisioning_package)\n writer.write_boolean_value(\"settingsBlockAppsPage\", @settings_block_apps_page)\n writer.write_boolean_value(\"settingsBlockChangeLanguage\", @settings_block_change_language)\n writer.write_boolean_value(\"settingsBlockChangePowerSleep\", @settings_block_change_power_sleep)\n writer.write_boolean_value(\"settingsBlockChangeRegion\", @settings_block_change_region)\n writer.write_boolean_value(\"settingsBlockChangeSystemTime\", @settings_block_change_system_time)\n writer.write_boolean_value(\"settingsBlockDevicesPage\", @settings_block_devices_page)\n writer.write_boolean_value(\"settingsBlockEaseOfAccessPage\", @settings_block_ease_of_access_page)\n writer.write_boolean_value(\"settingsBlockEditDeviceName\", @settings_block_edit_device_name)\n writer.write_boolean_value(\"settingsBlockGamingPage\", @settings_block_gaming_page)\n writer.write_boolean_value(\"settingsBlockNetworkInternetPage\", @settings_block_network_internet_page)\n writer.write_boolean_value(\"settingsBlockPersonalizationPage\", @settings_block_personalization_page)\n writer.write_boolean_value(\"settingsBlockPrivacyPage\", @settings_block_privacy_page)\n writer.write_boolean_value(\"settingsBlockRemoveProvisioningPackage\", @settings_block_remove_provisioning_package)\n writer.write_boolean_value(\"settingsBlockSettingsApp\", @settings_block_settings_app)\n writer.write_boolean_value(\"settingsBlockSystemPage\", @settings_block_system_page)\n writer.write_boolean_value(\"settingsBlockTimeLanguagePage\", @settings_block_time_language_page)\n writer.write_boolean_value(\"settingsBlockUpdateSecurityPage\", @settings_block_update_security_page)\n writer.write_boolean_value(\"sharedUserAppDataAllowed\", @shared_user_app_data_allowed)\n writer.write_boolean_value(\"smartScreenBlockPromptOverride\", @smart_screen_block_prompt_override)\n writer.write_boolean_value(\"smartScreenBlockPromptOverrideForFiles\", @smart_screen_block_prompt_override_for_files)\n writer.write_boolean_value(\"smartScreenEnableAppInstallControl\", @smart_screen_enable_app_install_control)\n writer.write_boolean_value(\"startBlockUnpinningAppsFromTaskbar\", @start_block_unpinning_apps_from_taskbar)\n writer.write_enum_value(\"startMenuAppListVisibility\", @start_menu_app_list_visibility)\n writer.write_boolean_value(\"startMenuHideChangeAccountSettings\", @start_menu_hide_change_account_settings)\n writer.write_boolean_value(\"startMenuHideFrequentlyUsedApps\", @start_menu_hide_frequently_used_apps)\n writer.write_boolean_value(\"startMenuHideHibernate\", @start_menu_hide_hibernate)\n writer.write_boolean_value(\"startMenuHideLock\", @start_menu_hide_lock)\n writer.write_boolean_value(\"startMenuHidePowerButton\", @start_menu_hide_power_button)\n writer.write_boolean_value(\"startMenuHideRecentJumpLists\", @start_menu_hide_recent_jump_lists)\n writer.write_boolean_value(\"startMenuHideRecentlyAddedApps\", @start_menu_hide_recently_added_apps)\n writer.write_boolean_value(\"startMenuHideRestartOptions\", @start_menu_hide_restart_options)\n writer.write_boolean_value(\"startMenuHideShutDown\", @start_menu_hide_shut_down)\n writer.write_boolean_value(\"startMenuHideSignOut\", @start_menu_hide_sign_out)\n writer.write_boolean_value(\"startMenuHideSleep\", @start_menu_hide_sleep)\n writer.write_boolean_value(\"startMenuHideSwitchAccount\", @start_menu_hide_switch_account)\n writer.write_boolean_value(\"startMenuHideUserTile\", @start_menu_hide_user_tile)\n writer.write_object_value(\"startMenuLayoutEdgeAssetsXml\", @start_menu_layout_edge_assets_xml)\n writer.write_object_value(\"startMenuLayoutXml\", @start_menu_layout_xml)\n writer.write_enum_value(\"startMenuMode\", @start_menu_mode)\n writer.write_enum_value(\"startMenuPinnedFolderDocuments\", @start_menu_pinned_folder_documents)\n writer.write_enum_value(\"startMenuPinnedFolderDownloads\", @start_menu_pinned_folder_downloads)\n writer.write_enum_value(\"startMenuPinnedFolderFileExplorer\", @start_menu_pinned_folder_file_explorer)\n writer.write_enum_value(\"startMenuPinnedFolderHomeGroup\", @start_menu_pinned_folder_home_group)\n writer.write_enum_value(\"startMenuPinnedFolderMusic\", @start_menu_pinned_folder_music)\n writer.write_enum_value(\"startMenuPinnedFolderNetwork\", @start_menu_pinned_folder_network)\n writer.write_enum_value(\"startMenuPinnedFolderPersonalFolder\", @start_menu_pinned_folder_personal_folder)\n writer.write_enum_value(\"startMenuPinnedFolderPictures\", @start_menu_pinned_folder_pictures)\n writer.write_enum_value(\"startMenuPinnedFolderSettings\", @start_menu_pinned_folder_settings)\n writer.write_enum_value(\"startMenuPinnedFolderVideos\", @start_menu_pinned_folder_videos)\n writer.write_boolean_value(\"storageBlockRemovableStorage\", @storage_block_removable_storage)\n writer.write_boolean_value(\"storageRequireMobileDeviceEncryption\", @storage_require_mobile_device_encryption)\n writer.write_boolean_value(\"storageRestrictAppDataToSystemVolume\", @storage_restrict_app_data_to_system_volume)\n writer.write_boolean_value(\"storageRestrictAppInstallToSystemVolume\", @storage_restrict_app_install_to_system_volume)\n writer.write_boolean_value(\"tenantLockdownRequireNetworkDuringOutOfBoxExperience\", @tenant_lockdown_require_network_during_out_of_box_experience)\n writer.write_boolean_value(\"usbBlocked\", @usb_blocked)\n writer.write_boolean_value(\"voiceRecordingBlocked\", @voice_recording_blocked)\n writer.write_boolean_value(\"webRtcBlockLocalhostIpAddress\", @web_rtc_block_localhost_ip_address)\n writer.write_boolean_value(\"wiFiBlockAutomaticConnectHotspots\", @wi_fi_block_automatic_connect_hotspots)\n writer.write_boolean_value(\"wiFiBlockManualConfiguration\", @wi_fi_block_manual_configuration)\n writer.write_boolean_value(\"wiFiBlocked\", @wi_fi_blocked)\n writer.write_number_value(\"wiFiScanInterval\", @wi_fi_scan_interval)\n writer.write_boolean_value(\"windowsSpotlightBlockConsumerSpecificFeatures\", @windows_spotlight_block_consumer_specific_features)\n writer.write_boolean_value(\"windowsSpotlightBlockOnActionCenter\", @windows_spotlight_block_on_action_center)\n writer.write_boolean_value(\"windowsSpotlightBlockTailoredExperiences\", @windows_spotlight_block_tailored_experiences)\n writer.write_boolean_value(\"windowsSpotlightBlockThirdPartyNotifications\", @windows_spotlight_block_third_party_notifications)\n writer.write_boolean_value(\"windowsSpotlightBlockWelcomeExperience\", @windows_spotlight_block_welcome_experience)\n writer.write_boolean_value(\"windowsSpotlightBlockWindowsTips\", @windows_spotlight_block_windows_tips)\n writer.write_boolean_value(\"windowsSpotlightBlocked\", @windows_spotlight_blocked)\n writer.write_enum_value(\"windowsSpotlightConfigureOnLockScreen\", @windows_spotlight_configure_on_lock_screen)\n writer.write_boolean_value(\"windowsStoreBlockAutoUpdate\", @windows_store_block_auto_update)\n writer.write_boolean_value(\"windowsStoreBlocked\", @windows_store_blocked)\n writer.write_boolean_value(\"windowsStoreEnablePrivateStoreOnly\", @windows_store_enable_private_store_only)\n writer.write_boolean_value(\"wirelessDisplayBlockProjectionToThisDevice\", @wireless_display_block_projection_to_this_device)\n writer.write_boolean_value(\"wirelessDisplayBlockUserInputFromReceiver\", @wireless_display_block_user_input_from_receiver)\n writer.write_boolean_value(\"wirelessDisplayRequirePinForPairing\", @wireless_display_require_pin_for_pairing)\n end",
"title": ""
},
{
"docid": "dece2703e4e9aecae195beed123fc6d7",
"score": "0.6258359",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_boolean_value(\"isArchived\", @is_archived)\n writer.write_boolean_value(\"isFavorited\", @is_favorited)\n writer.write_boolean_value(\"isRead\", @is_read)\n writer.write_string_value(\"@odata.type\", @odata_type)\n writer.write_additional_data(@additional_data)\n end",
"title": ""
},
{
"docid": "234fedee3e9b4e00af791076efa93999",
"score": "0.62094414",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"allowAttendeeToEnableCamera\", @allow_attendee_to_enable_camera)\n writer.write_boolean_value(\"allowAttendeeToEnableMic\", @allow_attendee_to_enable_mic)\n writer.write_enum_value(\"allowMeetingChat\", @allow_meeting_chat)\n writer.write_boolean_value(\"allowParticipantsToChangeName\", @allow_participants_to_change_name)\n writer.write_boolean_value(\"allowTeamworkReactions\", @allow_teamwork_reactions)\n writer.write_enum_value(\"allowedPresenters\", @allowed_presenters)\n writer.write_collection_of_object_values(\"attendanceReports\", @attendance_reports)\n writer.write_object_value(\"attendeeReport\", @attendee_report)\n writer.write_object_value(\"audioConferencing\", @audio_conferencing)\n writer.write_object_value(\"broadcastSettings\", @broadcast_settings)\n writer.write_object_value(\"chatInfo\", @chat_info)\n writer.write_date_time_value(\"creationDateTime\", @creation_date_time)\n writer.write_date_time_value(\"endDateTime\", @end_date_time)\n writer.write_string_value(\"externalId\", @external_id)\n writer.write_boolean_value(\"isBroadcast\", @is_broadcast)\n writer.write_boolean_value(\"isEntryExitAnnounced\", @is_entry_exit_announced)\n writer.write_object_value(\"joinInformation\", @join_information)\n writer.write_object_value(\"joinMeetingIdSettings\", @join_meeting_id_settings)\n writer.write_string_value(\"joinWebUrl\", @join_web_url)\n writer.write_object_value(\"lobbyBypassSettings\", @lobby_bypass_settings)\n writer.write_object_value(\"participants\", @participants)\n writer.write_boolean_value(\"recordAutomatically\", @record_automatically)\n writer.write_enum_value(\"shareMeetingChatHistoryDefault\", @share_meeting_chat_history_default)\n writer.write_date_time_value(\"startDateTime\", @start_date_time)\n writer.write_string_value(\"subject\", @subject)\n writer.write_string_value(\"videoTeleconferenceId\", @video_teleconference_id)\n writer.write_object_value(\"watermarkProtection\", @watermark_protection)\n end",
"title": ""
},
{
"docid": "02f15cd844bcc4f7c35159fdb8c87c38",
"score": "0.6207376",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"accountEnabled\", @account_enabled)\n writer.write_collection_of_object_values(\"alternativeSecurityIds\", @alternative_security_ids)\n writer.write_date_time_value(\"approximateLastSignInDateTime\", @approximate_last_sign_in_date_time)\n writer.write_date_time_value(\"complianceExpirationDateTime\", @compliance_expiration_date_time)\n writer.write_string_value(\"deviceCategory\", @device_category)\n writer.write_string_value(\"deviceId\", @device_id)\n writer.write_string_value(\"deviceMetadata\", @device_metadata)\n writer.write_string_value(\"deviceOwnership\", @device_ownership)\n writer.write_number_value(\"deviceVersion\", @device_version)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_string_value(\"enrollmentProfileName\", @enrollment_profile_name)\n writer.write_collection_of_object_values(\"extensions\", @extensions)\n writer.write_boolean_value(\"isCompliant\", @is_compliant)\n writer.write_boolean_value(\"isManaged\", @is_managed)\n writer.write_string_value(\"mdmAppId\", @mdm_app_id)\n writer.write_collection_of_object_values(\"memberOf\", @member_of)\n writer.write_date_time_value(\"onPremisesLastSyncDateTime\", @on_premises_last_sync_date_time)\n writer.write_boolean_value(\"onPremisesSyncEnabled\", @on_premises_sync_enabled)\n writer.write_string_value(\"operatingSystem\", @operating_system)\n writer.write_string_value(\"operatingSystemVersion\", @operating_system_version)\n writer.write_collection_of_primitive_values(\"physicalIds\", @physical_ids)\n writer.write_string_value(\"profileType\", @profile_type)\n writer.write_collection_of_object_values(\"registeredOwners\", @registered_owners)\n writer.write_collection_of_object_values(\"registeredUsers\", @registered_users)\n writer.write_date_time_value(\"registrationDateTime\", @registration_date_time)\n writer.write_collection_of_primitive_values(\"systemLabels\", @system_labels)\n writer.write_collection_of_object_values(\"transitiveMemberOf\", @transitive_member_of)\n writer.write_string_value(\"trustType\", @trust_type)\n end",
"title": ""
},
{
"docid": "762bca0e2db3ff19d91cc4521bb1e1d9",
"score": "0.6201243",
"text": "def serialize(object) end",
"title": ""
},
{
"docid": "762bca0e2db3ff19d91cc4521bb1e1d9",
"score": "0.6201243",
"text": "def serialize(object) end",
"title": ""
},
{
"docid": "496b2c9c73ce4303d535c51ace60b8c2",
"score": "0.62007993",
"text": "def serialize(src = nil)\n super(src || self)\n end",
"title": ""
},
{
"docid": "29ae893395f48276125cc7041afcf457",
"score": "0.6193683",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_boolean_value(\"isActive\", @is_active)\n writer.write_object_value(\"notAfter\", @not_after)\n writer.write_object_value(\"notBefore\", @not_before)\n writer.write_string_value(\"@odata.type\", @odata_type)\n writer.write_string_value(\"thumbprint\", @thumbprint)\n writer.write_additional_data(@additional_data)\n end",
"title": ""
},
{
"docid": "e95d9d38803d042833a0c90eba1c9f6d",
"score": "0.6160865",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"acceptedSenders\", @accepted_senders)\n writer.write_boolean_value(\"allowExternalSenders\", @allow_external_senders)\n writer.write_collection_of_object_values(\"appRoleAssignments\", @app_role_assignments)\n writer.write_collection_of_object_values(\"assignedLabels\", @assigned_labels)\n writer.write_collection_of_object_values(\"assignedLicenses\", @assigned_licenses)\n writer.write_boolean_value(\"autoSubscribeNewMembers\", @auto_subscribe_new_members)\n writer.write_object_value(\"calendar\", @calendar)\n writer.write_collection_of_object_values(\"calendarView\", @calendar_view)\n writer.write_string_value(\"classification\", @classification)\n writer.write_collection_of_object_values(\"conversations\", @conversations)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_object_value(\"createdOnBehalfOf\", @created_on_behalf_of)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_object_value(\"drive\", @drive)\n writer.write_collection_of_object_values(\"drives\", @drives)\n writer.write_collection_of_object_values(\"events\", @events)\n writer.write_date_time_value(\"expirationDateTime\", @expiration_date_time)\n writer.write_collection_of_object_values(\"extensions\", @extensions)\n writer.write_collection_of_object_values(\"groupLifecyclePolicies\", @group_lifecycle_policies)\n writer.write_collection_of_primitive_values(\"groupTypes\", @group_types)\n writer.write_boolean_value(\"hasMembersWithLicenseErrors\", @has_members_with_license_errors)\n writer.write_boolean_value(\"hideFromAddressLists\", @hide_from_address_lists)\n writer.write_boolean_value(\"hideFromOutlookClients\", @hide_from_outlook_clients)\n writer.write_boolean_value(\"isArchived\", @is_archived)\n writer.write_boolean_value(\"isAssignableToRole\", @is_assignable_to_role)\n writer.write_boolean_value(\"isSubscribedByMail\", @is_subscribed_by_mail)\n writer.write_object_value(\"licenseProcessingState\", @license_processing_state)\n writer.write_string_value(\"mail\", @mail)\n writer.write_boolean_value(\"mailEnabled\", @mail_enabled)\n writer.write_string_value(\"mailNickname\", @mail_nickname)\n writer.write_collection_of_object_values(\"memberOf\", @member_of)\n writer.write_collection_of_object_values(\"members\", @members)\n writer.write_collection_of_object_values(\"membersWithLicenseErrors\", @members_with_license_errors)\n writer.write_string_value(\"membershipRule\", @membership_rule)\n writer.write_string_value(\"membershipRuleProcessingState\", @membership_rule_processing_state)\n writer.write_string_value(\"onPremisesDomainName\", @on_premises_domain_name)\n writer.write_date_time_value(\"onPremisesLastSyncDateTime\", @on_premises_last_sync_date_time)\n writer.write_string_value(\"onPremisesNetBiosName\", @on_premises_net_bios_name)\n writer.write_collection_of_object_values(\"onPremisesProvisioningErrors\", @on_premises_provisioning_errors)\n writer.write_string_value(\"onPremisesSamAccountName\", @on_premises_sam_account_name)\n writer.write_string_value(\"onPremisesSecurityIdentifier\", @on_premises_security_identifier)\n writer.write_boolean_value(\"onPremisesSyncEnabled\", @on_premises_sync_enabled)\n writer.write_object_value(\"onenote\", @onenote)\n writer.write_collection_of_object_values(\"owners\", @owners)\n writer.write_collection_of_object_values(\"permissionGrants\", @permission_grants)\n writer.write_object_value(\"photo\", @photo)\n writer.write_collection_of_object_values(\"photos\", @photos)\n writer.write_object_value(\"planner\", @planner)\n writer.write_string_value(\"preferredDataLocation\", @preferred_data_location)\n writer.write_string_value(\"preferredLanguage\", @preferred_language)\n writer.write_collection_of_primitive_values(\"proxyAddresses\", @proxy_addresses)\n writer.write_collection_of_object_values(\"rejectedSenders\", @rejected_senders)\n writer.write_date_time_value(\"renewedDateTime\", @renewed_date_time)\n writer.write_boolean_value(\"securityEnabled\", @security_enabled)\n writer.write_string_value(\"securityIdentifier\", @security_identifier)\n writer.write_collection_of_object_values(\"settings\", @settings)\n writer.write_collection_of_object_values(\"sites\", @sites)\n writer.write_object_value(\"team\", @team)\n writer.write_string_value(\"theme\", @theme)\n writer.write_collection_of_object_values(\"threads\", @threads)\n writer.write_collection_of_object_values(\"transitiveMemberOf\", @transitive_member_of)\n writer.write_collection_of_object_values(\"transitiveMembers\", @transitive_members)\n writer.write_number_value(\"unseenCount\", @unseen_count)\n writer.write_string_value(\"visibility\", @visibility)\n end",
"title": ""
},
{
"docid": "e0d40e4caf5a85705bbabc9e2f1d7631",
"score": "0.6156583",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"check32BitOn64System\", @check32_bit_on64_system)\n writer.write_string_value(\"comparisonValue\", @comparison_value)\n writer.write_string_value(\"keyPath\", @key_path)\n writer.write_enum_value(\"operationType\", @operation_type)\n writer.write_enum_value(\"operator\", @operator)\n writer.write_string_value(\"valueName\", @value_name)\n end",
"title": ""
},
{
"docid": "b303209babdcae86cbe0190ee0799cbc",
"score": "0.61559874",
"text": "def should_serialize?\n ENV['SERIALIZE'] || debug || environments.serialize?\n end",
"title": ""
},
{
"docid": "8bf333a7ada13ae84638a73776375feb",
"score": "0.61513925",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"info\", @info)\n writer.write_boolean_value(\"isInLobby\", @is_in_lobby)\n writer.write_boolean_value(\"isMuted\", @is_muted)\n writer.write_collection_of_object_values(\"mediaStreams\", @media_streams)\n writer.write_string_value(\"metadata\", @metadata)\n writer.write_object_value(\"recordingInfo\", @recording_info)\n writer.write_object_value(\"restrictedExperience\", @restricted_experience)\n end",
"title": ""
},
{
"docid": "cc76566e7821d0acc1dd676317582d52",
"score": "0.61413795",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"isEnabled\", @is_enabled)\n writer.write_boolean_value(\"notifyReviewers\", @notify_reviewers)\n writer.write_boolean_value(\"remindersEnabled\", @reminders_enabled)\n writer.write_number_value(\"requestDurationInDays\", @request_duration_in_days)\n writer.write_collection_of_object_values(\"reviewers\", @reviewers)\n writer.write_number_value(\"version\", @version)\n end",
"title": ""
},
{
"docid": "7f36394d7bd99deb5064ada4bede092c",
"score": "0.61388963",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"allowedDataStorageLocations\", @allowed_data_storage_locations)\n writer.write_enum_value(\"allowedInboundDataTransferSources\", @allowed_inbound_data_transfer_sources)\n writer.write_enum_value(\"allowedOutboundClipboardSharingLevel\", @allowed_outbound_clipboard_sharing_level)\n writer.write_enum_value(\"allowedOutboundDataTransferDestinations\", @allowed_outbound_data_transfer_destinations)\n writer.write_boolean_value(\"contactSyncBlocked\", @contact_sync_blocked)\n writer.write_boolean_value(\"dataBackupBlocked\", @data_backup_blocked)\n writer.write_boolean_value(\"deviceComplianceRequired\", @device_compliance_required)\n writer.write_boolean_value(\"disableAppPinIfDevicePinIsSet\", @disable_app_pin_if_device_pin_is_set)\n writer.write_boolean_value(\"fingerprintBlocked\", @fingerprint_blocked)\n writer.write_enum_value(\"managedBrowser\", @managed_browser)\n writer.write_boolean_value(\"managedBrowserToOpenLinksRequired\", @managed_browser_to_open_links_required)\n writer.write_number_value(\"maximumPinRetries\", @maximum_pin_retries)\n writer.write_number_value(\"minimumPinLength\", @minimum_pin_length)\n writer.write_string_value(\"minimumRequiredAppVersion\", @minimum_required_app_version)\n writer.write_string_value(\"minimumRequiredOsVersion\", @minimum_required_os_version)\n writer.write_string_value(\"minimumWarningAppVersion\", @minimum_warning_app_version)\n writer.write_string_value(\"minimumWarningOsVersion\", @minimum_warning_os_version)\n writer.write_boolean_value(\"organizationalCredentialsRequired\", @organizational_credentials_required)\n writer.write_duration_value(\"periodBeforePinReset\", @period_before_pin_reset)\n writer.write_duration_value(\"periodOfflineBeforeAccessCheck\", @period_offline_before_access_check)\n writer.write_duration_value(\"periodOfflineBeforeWipeIsEnforced\", @period_offline_before_wipe_is_enforced)\n writer.write_duration_value(\"periodOnlineBeforeAccessCheck\", @period_online_before_access_check)\n writer.write_enum_value(\"pinCharacterSet\", @pin_character_set)\n writer.write_boolean_value(\"pinRequired\", @pin_required)\n writer.write_boolean_value(\"printBlocked\", @print_blocked)\n writer.write_boolean_value(\"saveAsBlocked\", @save_as_blocked)\n writer.write_boolean_value(\"simplePinBlocked\", @simple_pin_blocked)\n end",
"title": ""
},
{
"docid": "2721379f5c581b8fb7b4e361250775b3",
"score": "0.61346257",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"enabled\", @enabled)\n writer.write_collection_of_object_values(\"offerShiftRequests\", @offer_shift_requests)\n writer.write_boolean_value(\"offerShiftRequestsEnabled\", @offer_shift_requests_enabled)\n writer.write_collection_of_object_values(\"openShiftChangeRequests\", @open_shift_change_requests)\n writer.write_collection_of_object_values(\"openShifts\", @open_shifts)\n writer.write_boolean_value(\"openShiftsEnabled\", @open_shifts_enabled)\n writer.write_collection_of_object_values(\"schedulingGroups\", @scheduling_groups)\n writer.write_collection_of_object_values(\"shifts\", @shifts)\n writer.write_collection_of_object_values(\"swapShiftsChangeRequests\", @swap_shifts_change_requests)\n writer.write_boolean_value(\"swapShiftsRequestsEnabled\", @swap_shifts_requests_enabled)\n writer.write_boolean_value(\"timeClockEnabled\", @time_clock_enabled)\n writer.write_collection_of_object_values(\"timeOffReasons\", @time_off_reasons)\n writer.write_collection_of_object_values(\"timeOffRequests\", @time_off_requests)\n writer.write_boolean_value(\"timeOffRequestsEnabled\", @time_off_requests_enabled)\n writer.write_string_value(\"timeZone\", @time_zone)\n writer.write_collection_of_object_values(\"timesOff\", @times_off)\n writer.write_collection_of_primitive_values(\"workforceIntegrationIds\", @workforce_integration_ids)\n end",
"title": ""
},
{
"docid": "99fde250d57dc48258abf9259ae97903",
"score": "0.6130223",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"isDefault\", @is_default)\n writer.write_boolean_value(\"isShared\", @is_shared)\n writer.write_object_value(\"links\", @links)\n writer.write_collection_of_object_values(\"sectionGroups\", @section_groups)\n writer.write_string_value(\"sectionGroupsUrl\", @section_groups_url)\n writer.write_collection_of_object_values(\"sections\", @sections)\n writer.write_string_value(\"sectionsUrl\", @sections_url)\n writer.write_enum_value(\"userRole\", @user_role)\n end",
"title": ""
},
{
"docid": "39b422fa04b30add3c8ca12e51295d48",
"score": "0.61289",
"text": "def serialize(obj)\n case obj\n when String, Numeric, TrueClass, FalseClass then obj\n else obj.to_s end\n end",
"title": ""
},
{
"docid": "74a9e5bf7c0976ec5f68341d66cfd332",
"score": "0.6110771",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"additionalInformation\", @additional_information)\n writer.write_collection_of_object_values(\"customQuestions\", @custom_questions)\n writer.write_duration_value(\"defaultDuration\", @default_duration)\n writer.write_object_value(\"defaultLocation\", @default_location)\n writer.write_object_value(\"defaultPrice\", @default_price)\n writer.write_enum_value(\"defaultPriceType\", @default_price_type)\n writer.write_collection_of_object_values(\"defaultReminders\", @default_reminders)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_boolean_value(\"isAnonymousJoinEnabled\", @is_anonymous_join_enabled)\n writer.write_boolean_value(\"isHiddenFromCustomers\", @is_hidden_from_customers)\n writer.write_boolean_value(\"isLocationOnline\", @is_location_online)\n writer.write_string_value(\"languageTag\", @language_tag)\n writer.write_number_value(\"maximumAttendeesCount\", @maximum_attendees_count)\n writer.write_string_value(\"notes\", @notes)\n writer.write_duration_value(\"postBuffer\", @post_buffer)\n writer.write_duration_value(\"preBuffer\", @pre_buffer)\n writer.write_object_value(\"schedulingPolicy\", @scheduling_policy)\n writer.write_boolean_value(\"smsNotificationsEnabled\", @sms_notifications_enabled)\n writer.write_collection_of_primitive_values(\"staffMemberIds\", @staff_member_ids)\n end",
"title": ""
},
{
"docid": "f62cd3c1ea7331802a60ddbfa78d42dc",
"score": "0.61028975",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"accountEnabled\", @account_enabled)\n writer.write_collection_of_object_values(\"assignedLicenses\", @assigned_licenses)\n writer.write_collection_of_object_values(\"assignedPlans\", @assigned_plans)\n writer.write_collection_of_object_values(\"assignments\", @assignments)\n writer.write_collection_of_primitive_values(\"businessPhones\", @business_phones)\n writer.write_collection_of_object_values(\"classes\", @classes)\n writer.write_object_value(\"createdBy\", @created_by)\n writer.write_string_value(\"department\", @department)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_enum_value(\"externalSource\", @external_source)\n writer.write_string_value(\"externalSourceDetail\", @external_source_detail)\n writer.write_string_value(\"givenName\", @given_name)\n writer.write_string_value(\"mail\", @mail)\n writer.write_string_value(\"mailNickname\", @mail_nickname)\n writer.write_object_value(\"mailingAddress\", @mailing_address)\n writer.write_string_value(\"middleName\", @middle_name)\n writer.write_string_value(\"mobilePhone\", @mobile_phone)\n writer.write_string_value(\"officeLocation\", @office_location)\n writer.write_object_value(\"onPremisesInfo\", @on_premises_info)\n writer.write_string_value(\"passwordPolicies\", @password_policies)\n writer.write_object_value(\"passwordProfile\", @password_profile)\n writer.write_string_value(\"preferredLanguage\", @preferred_language)\n writer.write_enum_value(\"primaryRole\", @primary_role)\n writer.write_collection_of_object_values(\"provisionedPlans\", @provisioned_plans)\n writer.write_date_time_value(\"refreshTokensValidFromDateTime\", @refresh_tokens_valid_from_date_time)\n writer.write_collection_of_object_values(\"relatedContacts\", @related_contacts)\n writer.write_object_value(\"residenceAddress\", @residence_address)\n writer.write_collection_of_object_values(\"rubrics\", @rubrics)\n writer.write_collection_of_object_values(\"schools\", @schools)\n writer.write_boolean_value(\"showInAddressList\", @show_in_address_list)\n writer.write_object_value(\"student\", @student)\n writer.write_string_value(\"surname\", @surname)\n writer.write_collection_of_object_values(\"taughtClasses\", @taught_classes)\n writer.write_object_value(\"teacher\", @teacher)\n writer.write_string_value(\"usageLocation\", @usage_location)\n writer.write_object_value(\"user\", @user)\n writer.write_string_value(\"userPrincipalName\", @user_principal_name)\n writer.write_string_value(\"userType\", @user_type)\n end",
"title": ""
},
{
"docid": "108ad0f286c656637cfbc5d5c6dd7038",
"score": "0.60950166",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"autonomousSystem\", @autonomous_system)\n writer.write_string_value(\"countryOrRegion\", @country_or_region)\n writer.write_string_value(\"hostingProvider\", @hosting_provider)\n writer.write_string_value(\"netblock\", @netblock)\n end",
"title": ""
},
{
"docid": "78ef3443e85382c41060084dfac2080a",
"score": "0.60786617",
"text": "def object_serialization_options\n {}\n end",
"title": ""
},
{
"docid": "07eeac93985afc85a074a8840a7b6b15",
"score": "0.6071203",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"bitLockerEnabled\", @bit_locker_enabled)\n writer.write_boolean_value(\"codeIntegrityEnabled\", @code_integrity_enabled)\n writer.write_boolean_value(\"earlyLaunchAntiMalwareDriverEnabled\", @early_launch_anti_malware_driver_enabled)\n writer.write_string_value(\"mobileOsMaximumVersion\", @mobile_os_maximum_version)\n writer.write_string_value(\"mobileOsMinimumVersion\", @mobile_os_minimum_version)\n writer.write_string_value(\"osMaximumVersion\", @os_maximum_version)\n writer.write_string_value(\"osMinimumVersion\", @os_minimum_version)\n writer.write_boolean_value(\"passwordBlockSimple\", @password_block_simple)\n writer.write_number_value(\"passwordExpirationDays\", @password_expiration_days)\n writer.write_number_value(\"passwordMinimumCharacterSetCount\", @password_minimum_character_set_count)\n writer.write_number_value(\"passwordMinimumLength\", @password_minimum_length)\n writer.write_number_value(\"passwordMinutesOfInactivityBeforeLock\", @password_minutes_of_inactivity_before_lock)\n writer.write_number_value(\"passwordPreviousPasswordBlockCount\", @password_previous_password_block_count)\n writer.write_boolean_value(\"passwordRequired\", @password_required)\n writer.write_boolean_value(\"passwordRequiredToUnlockFromIdle\", @password_required_to_unlock_from_idle)\n writer.write_enum_value(\"passwordRequiredType\", @password_required_type)\n writer.write_boolean_value(\"requireHealthyDeviceReport\", @require_healthy_device_report)\n writer.write_boolean_value(\"secureBootEnabled\", @secure_boot_enabled)\n writer.write_boolean_value(\"storageRequireEncryption\", @storage_require_encryption)\n end",
"title": ""
},
{
"docid": "8e0b4a0449b2d9bb77400585ed077784",
"score": "0.6066576",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"isRemovable\", @is_removable)\n writer.write_boolean_value(\"uninstallOnDeviceRemoval\", @uninstall_on_device_removal)\n writer.write_string_value(\"vpnConfigurationId\", @vpn_configuration_id)\n end",
"title": ""
},
{
"docid": "de65cd28b857fe7120704648fdd90f5c",
"score": "0.606273",
"text": "def before_serialize(options={})\n options[:links] ||= false\n\n super(options)\n end",
"title": ""
},
{
"docid": "76328cbf11ed2ba77f6f84be9678083d",
"score": "0.6041642",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"isAdmin\", @is_admin)\n writer.write_boolean_value(\"isMfaCapable\", @is_mfa_capable)\n writer.write_boolean_value(\"isMfaRegistered\", @is_mfa_registered)\n writer.write_boolean_value(\"isPasswordlessCapable\", @is_passwordless_capable)\n writer.write_boolean_value(\"isSsprCapable\", @is_sspr_capable)\n writer.write_boolean_value(\"isSsprEnabled\", @is_sspr_enabled)\n writer.write_boolean_value(\"isSsprRegistered\", @is_sspr_registered)\n writer.write_boolean_value(\"isSystemPreferredAuthenticationMethodEnabled\", @is_system_preferred_authentication_method_enabled)\n writer.write_date_time_value(\"lastUpdatedDateTime\", @last_updated_date_time)\n writer.write_collection_of_primitive_values(\"methodsRegistered\", @methods_registered)\n writer.write_collection_of_primitive_values(\"systemPreferredAuthenticationMethods\", @system_preferred_authentication_methods)\n writer.write_string_value(\"userDisplayName\", @user_display_name)\n writer.write_enum_value(\"userPreferredMethodForSecondaryAuthentication\", @user_preferred_method_for_secondary_authentication)\n writer.write_string_value(\"userPrincipalName\", @user_principal_name)\n writer.write_enum_value(\"userType\", @user_type)\n end",
"title": ""
},
{
"docid": "1c04e53ab964eec84b8d7aa7dc920815",
"score": "0.6039929",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"aboutMe\", @about_me)\n writer.write_boolean_value(\"accountEnabled\", @account_enabled)\n writer.write_collection_of_object_values(\"activities\", @activities)\n writer.write_string_value(\"ageGroup\", @age_group)\n writer.write_collection_of_object_values(\"agreementAcceptances\", @agreement_acceptances)\n writer.write_collection_of_object_values(\"appRoleAssignments\", @app_role_assignments)\n writer.write_collection_of_object_values(\"assignedLicenses\", @assigned_licenses)\n writer.write_collection_of_object_values(\"assignedPlans\", @assigned_plans)\n writer.write_object_value(\"authentication\", @authentication)\n writer.write_object_value(\"authorizationInfo\", @authorization_info)\n writer.write_date_time_value(\"birthday\", @birthday)\n writer.write_collection_of_primitive_values(\"businessPhones\", @business_phones)\n writer.write_object_value(\"calendar\", @calendar)\n writer.write_collection_of_object_values(\"calendarGroups\", @calendar_groups)\n writer.write_collection_of_object_values(\"calendarView\", @calendar_view)\n writer.write_collection_of_object_values(\"calendars\", @calendars)\n writer.write_collection_of_object_values(\"chats\", @chats)\n writer.write_string_value(\"city\", @city)\n writer.write_string_value(\"companyName\", @company_name)\n writer.write_string_value(\"consentProvidedForMinor\", @consent_provided_for_minor)\n writer.write_collection_of_object_values(\"contactFolders\", @contact_folders)\n writer.write_collection_of_object_values(\"contacts\", @contacts)\n writer.write_string_value(\"country\", @country)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_collection_of_object_values(\"createdObjects\", @created_objects)\n writer.write_string_value(\"creationType\", @creation_type)\n writer.write_object_value(\"customSecurityAttributes\", @custom_security_attributes)\n writer.write_string_value(\"department\", @department)\n writer.write_number_value(\"deviceEnrollmentLimit\", @device_enrollment_limit)\n writer.write_collection_of_object_values(\"deviceManagementTroubleshootingEvents\", @device_management_troubleshooting_events)\n writer.write_collection_of_object_values(\"directReports\", @direct_reports)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_object_value(\"drive\", @drive)\n writer.write_collection_of_object_values(\"drives\", @drives)\n writer.write_object_value(\"employeeExperience\", @employee_experience)\n writer.write_date_time_value(\"employeeHireDate\", @employee_hire_date)\n writer.write_string_value(\"employeeId\", @employee_id)\n writer.write_date_time_value(\"employeeLeaveDateTime\", @employee_leave_date_time)\n writer.write_object_value(\"employeeOrgData\", @employee_org_data)\n writer.write_string_value(\"employeeType\", @employee_type)\n writer.write_collection_of_object_values(\"events\", @events)\n writer.write_collection_of_object_values(\"extensions\", @extensions)\n writer.write_string_value(\"externalUserState\", @external_user_state)\n writer.write_date_time_value(\"externalUserStateChangeDateTime\", @external_user_state_change_date_time)\n writer.write_string_value(\"faxNumber\", @fax_number)\n writer.write_collection_of_object_values(\"followedSites\", @followed_sites)\n writer.write_string_value(\"givenName\", @given_name)\n writer.write_date_time_value(\"hireDate\", @hire_date)\n writer.write_collection_of_object_values(\"identities\", @identities)\n writer.write_collection_of_primitive_values(\"imAddresses\", @im_addresses)\n writer.write_object_value(\"inferenceClassification\", @inference_classification)\n writer.write_object_value(\"insights\", @insights)\n writer.write_collection_of_primitive_values(\"interests\", @interests)\n writer.write_boolean_value(\"isResourceAccount\", @is_resource_account)\n writer.write_string_value(\"jobTitle\", @job_title)\n writer.write_collection_of_object_values(\"joinedTeams\", @joined_teams)\n writer.write_date_time_value(\"lastPasswordChangeDateTime\", @last_password_change_date_time)\n writer.write_string_value(\"legalAgeGroupClassification\", @legal_age_group_classification)\n writer.write_collection_of_object_values(\"licenseAssignmentStates\", @license_assignment_states)\n writer.write_collection_of_object_values(\"licenseDetails\", @license_details)\n writer.write_string_value(\"mail\", @mail)\n writer.write_collection_of_object_values(\"mailFolders\", @mail_folders)\n writer.write_string_value(\"mailNickname\", @mail_nickname)\n writer.write_object_value(\"mailboxSettings\", @mailbox_settings)\n writer.write_collection_of_object_values(\"managedAppRegistrations\", @managed_app_registrations)\n writer.write_collection_of_object_values(\"managedDevices\", @managed_devices)\n writer.write_object_value(\"manager\", @manager)\n writer.write_collection_of_object_values(\"memberOf\", @member_of)\n writer.write_collection_of_object_values(\"messages\", @messages)\n writer.write_string_value(\"mobilePhone\", @mobile_phone)\n writer.write_string_value(\"mySite\", @my_site)\n writer.write_collection_of_object_values(\"oauth2PermissionGrants\", @oauth2_permission_grants)\n writer.write_string_value(\"officeLocation\", @office_location)\n writer.write_string_value(\"onPremisesDistinguishedName\", @on_premises_distinguished_name)\n writer.write_string_value(\"onPremisesDomainName\", @on_premises_domain_name)\n writer.write_object_value(\"onPremisesExtensionAttributes\", @on_premises_extension_attributes)\n writer.write_string_value(\"onPremisesImmutableId\", @on_premises_immutable_id)\n writer.write_date_time_value(\"onPremisesLastSyncDateTime\", @on_premises_last_sync_date_time)\n writer.write_collection_of_object_values(\"onPremisesProvisioningErrors\", @on_premises_provisioning_errors)\n writer.write_string_value(\"onPremisesSamAccountName\", @on_premises_sam_account_name)\n writer.write_string_value(\"onPremisesSecurityIdentifier\", @on_premises_security_identifier)\n writer.write_boolean_value(\"onPremisesSyncEnabled\", @on_premises_sync_enabled)\n writer.write_string_value(\"onPremisesUserPrincipalName\", @on_premises_user_principal_name)\n writer.write_object_value(\"onenote\", @onenote)\n writer.write_collection_of_object_values(\"onlineMeetings\", @online_meetings)\n writer.write_collection_of_primitive_values(\"otherMails\", @other_mails)\n writer.write_object_value(\"outlook\", @outlook)\n writer.write_collection_of_object_values(\"ownedDevices\", @owned_devices)\n writer.write_collection_of_object_values(\"ownedObjects\", @owned_objects)\n writer.write_string_value(\"passwordPolicies\", @password_policies)\n writer.write_object_value(\"passwordProfile\", @password_profile)\n writer.write_collection_of_primitive_values(\"pastProjects\", @past_projects)\n writer.write_collection_of_object_values(\"people\", @people)\n writer.write_object_value(\"photo\", @photo)\n writer.write_collection_of_object_values(\"photos\", @photos)\n writer.write_object_value(\"planner\", @planner)\n writer.write_string_value(\"postalCode\", @postal_code)\n writer.write_string_value(\"preferredDataLocation\", @preferred_data_location)\n writer.write_string_value(\"preferredLanguage\", @preferred_language)\n writer.write_string_value(\"preferredName\", @preferred_name)\n writer.write_object_value(\"presence\", @presence)\n writer.write_object_value(\"print\", @print)\n writer.write_collection_of_object_values(\"provisionedPlans\", @provisioned_plans)\n writer.write_collection_of_primitive_values(\"proxyAddresses\", @proxy_addresses)\n writer.write_collection_of_object_values(\"registeredDevices\", @registered_devices)\n writer.write_collection_of_primitive_values(\"responsibilities\", @responsibilities)\n writer.write_collection_of_primitive_values(\"schools\", @schools)\n writer.write_collection_of_object_values(\"scopedRoleMemberOf\", @scoped_role_member_of)\n writer.write_string_value(\"securityIdentifier\", @security_identifier)\n writer.write_object_value(\"settings\", @settings)\n writer.write_boolean_value(\"showInAddressList\", @show_in_address_list)\n writer.write_object_value(\"signInActivity\", @sign_in_activity)\n writer.write_date_time_value(\"signInSessionsValidFromDateTime\", @sign_in_sessions_valid_from_date_time)\n writer.write_collection_of_primitive_values(\"skills\", @skills)\n writer.write_string_value(\"state\", @state)\n writer.write_string_value(\"streetAddress\", @street_address)\n writer.write_string_value(\"surname\", @surname)\n writer.write_object_value(\"teamwork\", @teamwork)\n writer.write_object_value(\"todo\", @todo)\n writer.write_collection_of_object_values(\"transitiveMemberOf\", @transitive_member_of)\n writer.write_string_value(\"usageLocation\", @usage_location)\n writer.write_string_value(\"userPrincipalName\", @user_principal_name)\n writer.write_string_value(\"userType\", @user_type)\n end",
"title": ""
},
{
"docid": "3c98f2fa1d845f79955b0929c53ab18b",
"score": "0.602882",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"format\", @format)\n writer.write_string_value(\"text\", @text)\n writer.write_boolean_value(\"visible\", @visible)\n end",
"title": ""
},
{
"docid": "88a466a96303ed60f17502314e61ab63",
"score": "0.6026981",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"claimValue\", @claim_value)\n writer.write_boolean_value(\"isEnabled\", @is_enabled)\n end",
"title": ""
},
{
"docid": "e2eac1483dc0a443f9c9b14ed43c61ec",
"score": "0.6023101",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"antiMalwareVersion\", @anti_malware_version)\n writer.write_collection_of_object_values(\"detectedMalwareState\", @detected_malware_state)\n writer.write_enum_value(\"deviceState\", @device_state)\n writer.write_string_value(\"engineVersion\", @engine_version)\n writer.write_boolean_value(\"fullScanOverdue\", @full_scan_overdue)\n writer.write_boolean_value(\"fullScanRequired\", @full_scan_required)\n writer.write_boolean_value(\"isVirtualMachine\", @is_virtual_machine)\n writer.write_date_time_value(\"lastFullScanDateTime\", @last_full_scan_date_time)\n writer.write_string_value(\"lastFullScanSignatureVersion\", @last_full_scan_signature_version)\n writer.write_date_time_value(\"lastQuickScanDateTime\", @last_quick_scan_date_time)\n writer.write_string_value(\"lastQuickScanSignatureVersion\", @last_quick_scan_signature_version)\n writer.write_date_time_value(\"lastReportedDateTime\", @last_reported_date_time)\n writer.write_boolean_value(\"malwareProtectionEnabled\", @malware_protection_enabled)\n writer.write_boolean_value(\"networkInspectionSystemEnabled\", @network_inspection_system_enabled)\n writer.write_enum_value(\"productStatus\", @product_status)\n writer.write_boolean_value(\"quickScanOverdue\", @quick_scan_overdue)\n writer.write_boolean_value(\"realTimeProtectionEnabled\", @real_time_protection_enabled)\n writer.write_boolean_value(\"rebootRequired\", @reboot_required)\n writer.write_boolean_value(\"signatureUpdateOverdue\", @signature_update_overdue)\n writer.write_string_value(\"signatureVersion\", @signature_version)\n writer.write_boolean_value(\"tamperProtectionEnabled\", @tamper_protection_enabled)\n end",
"title": ""
},
{
"docid": "46cd27d359b93ca5d801294128a34fef",
"score": "0.60126024",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"allowNewTimeProposals\", @allow_new_time_proposals)\n writer.write_collection_of_object_values(\"attachments\", @attachments)\n writer.write_collection_of_object_values(\"attendees\", @attendees)\n writer.write_object_value(\"body\", @body)\n writer.write_string_value(\"bodyPreview\", @body_preview)\n writer.write_object_value(\"calendar\", @calendar)\n writer.write_object_value(\"end\", @end_escaped)\n writer.write_collection_of_object_values(\"extensions\", @extensions)\n writer.write_boolean_value(\"hasAttachments\", @has_attachments)\n writer.write_boolean_value(\"hideAttendees\", @hide_attendees)\n writer.write_string_value(\"iCalUId\", @i_cal_u_id)\n writer.write_enum_value(\"importance\", @importance)\n writer.write_collection_of_object_values(\"instances\", @instances)\n writer.write_boolean_value(\"isAllDay\", @is_all_day)\n writer.write_boolean_value(\"isCancelled\", @is_cancelled)\n writer.write_boolean_value(\"isDraft\", @is_draft)\n writer.write_boolean_value(\"isOnlineMeeting\", @is_online_meeting)\n writer.write_boolean_value(\"isOrganizer\", @is_organizer)\n writer.write_boolean_value(\"isReminderOn\", @is_reminder_on)\n writer.write_object_value(\"location\", @location)\n writer.write_collection_of_object_values(\"locations\", @locations)\n writer.write_collection_of_object_values(\"multiValueExtendedProperties\", @multi_value_extended_properties)\n writer.write_object_value(\"onlineMeeting\", @online_meeting)\n writer.write_enum_value(\"onlineMeetingProvider\", @online_meeting_provider)\n writer.write_string_value(\"onlineMeetingUrl\", @online_meeting_url)\n writer.write_object_value(\"organizer\", @organizer)\n writer.write_string_value(\"originalEndTimeZone\", @original_end_time_zone)\n writer.write_date_time_value(\"originalStart\", @original_start)\n writer.write_string_value(\"originalStartTimeZone\", @original_start_time_zone)\n writer.write_object_value(\"recurrence\", @recurrence)\n writer.write_number_value(\"reminderMinutesBeforeStart\", @reminder_minutes_before_start)\n writer.write_boolean_value(\"responseRequested\", @response_requested)\n writer.write_object_value(\"responseStatus\", @response_status)\n writer.write_enum_value(\"sensitivity\", @sensitivity)\n writer.write_string_value(\"seriesMasterId\", @series_master_id)\n writer.write_enum_value(\"showAs\", @show_as)\n writer.write_collection_of_object_values(\"singleValueExtendedProperties\", @single_value_extended_properties)\n writer.write_object_value(\"start\", @start)\n writer.write_string_value(\"subject\", @subject)\n writer.write_string_value(\"transactionId\", @transaction_id)\n writer.write_enum_value(\"type\", @type)\n writer.write_string_value(\"webLink\", @web_link)\n end",
"title": ""
},
{
"docid": "043e9b8247d497834921dfe137ef2ffb",
"score": "0.6004408",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"analytics\", @analytics)\n writer.write_object_value(\"audio\", @audio)\n writer.write_object_value(\"bundle\", @bundle)\n writer.write_string_value(\"cTag\", @c_tag)\n writer.write_collection_of_object_values(\"children\", @children)\n writer.write_object_value(\"content\", @content)\n writer.write_object_value(\"deleted\", @deleted)\n writer.write_object_value(\"file\", @file)\n writer.write_object_value(\"fileSystemInfo\", @file_system_info)\n writer.write_object_value(\"folder\", @folder)\n writer.write_object_value(\"image\", @image)\n writer.write_object_value(\"listItem\", @list_item)\n writer.write_object_value(\"location\", @location)\n writer.write_object_value(\"malware\", @malware)\n writer.write_object_value(\"package\", @package)\n writer.write_object_value(\"pendingOperations\", @pending_operations)\n writer.write_collection_of_object_values(\"permissions\", @permissions)\n writer.write_object_value(\"photo\", @photo)\n writer.write_object_value(\"publication\", @publication)\n writer.write_object_value(\"remoteItem\", @remote_item)\n writer.write_object_value(\"root\", @root)\n writer.write_object_value(\"searchResult\", @search_result)\n writer.write_object_value(\"shared\", @shared)\n writer.write_object_value(\"sharepointIds\", @sharepoint_ids)\n writer.write_object_value(\"size\", @size)\n writer.write_object_value(\"specialFolder\", @special_folder)\n writer.write_collection_of_object_values(\"subscriptions\", @subscriptions)\n writer.write_collection_of_object_values(\"thumbnails\", @thumbnails)\n writer.write_collection_of_object_values(\"versions\", @versions)\n writer.write_object_value(\"video\", @video)\n writer.write_string_value(\"webDavUrl\", @web_dav_url)\n writer.write_object_value(\"workbook\", @workbook)\n end",
"title": ""
},
{
"docid": "488726fd38d32442f6cabdb51f49e619",
"score": "0.59991485",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"enabled\", @enabled)\n writer.write_collection_of_primitive_values(\"excludedGroups\", @excluded_groups)\n writer.write_collection_of_primitive_values(\"includedGroups\", @included_groups)\n writer.write_boolean_value(\"overrideDefaultRule\", @override_default_rule)\n end",
"title": ""
},
{
"docid": "e08369fd35e91f2d60bd1780297c51fe",
"score": "0.59860206",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_string_value(\"@odata.type\", @odata_type)\n writer.write_boolean_value(\"v10_0\", @v10_0)\n writer.write_boolean_value(\"v11_0\", @v11_0)\n writer.write_boolean_value(\"v12_0\", @v12_0)\n writer.write_boolean_value(\"v13_0\", @v13_0)\n writer.write_boolean_value(\"v14_0\", @v14_0)\n writer.write_boolean_value(\"v15_0\", @v15_0)\n writer.write_boolean_value(\"v8_0\", @v8_0)\n writer.write_boolean_value(\"v9_0\", @v9_0)\n writer.write_additional_data(@additional_data)\n end",
"title": ""
},
{
"docid": "650142b3fdf589633088905b422ae5af",
"score": "0.59808993",
"text": "def serialize(object, data); end",
"title": ""
},
{
"docid": "01cb5757f4a14f809aad5d2fa12db562",
"score": "0.5979",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"format\", @format)\n writer.write_boolean_value(\"overlay\", @overlay)\n writer.write_string_value(\"position\", @position)\n writer.write_boolean_value(\"visible\", @visible)\n end",
"title": ""
},
{
"docid": "37a2b2356cfb96bb0508c47d6bc51f51",
"score": "0.59732234",
"text": "def serialize?\n yaml_enabled || global_id_enabled\n end",
"title": ""
},
{
"docid": "627d3c56c9691765d674229b208a02ff",
"score": "0.5967096",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"checkedDateTime\", @checked_date_time)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_boolean_value(\"isChecked\", @is_checked)\n end",
"title": ""
},
{
"docid": "7fd2b95f1c0bbc93e208fdc8bb61bace",
"score": "0.5966245",
"text": "def serialize(value); end",
"title": ""
},
{
"docid": "7fd2b95f1c0bbc93e208fdc8bb61bace",
"score": "0.5966245",
"text": "def serialize(value); end",
"title": ""
},
{
"docid": "7b78a248608bb2eb48988efb7140825d",
"score": "0.5958169",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"binaryName\", @binary_name)\n writer.write_string_value(\"binaryVersionHigh\", @binary_version_high)\n writer.write_string_value(\"binaryVersionLow\", @binary_version_low)\n end",
"title": ""
},
{
"docid": "7574f793d0ebc95b66c32bf0a788bc8e",
"score": "0.5957598",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"accountEnabled\", @account_enabled)\n writer.write_collection_of_object_values(\"addIns\", @add_ins)\n writer.write_collection_of_primitive_values(\"alternativeNames\", @alternative_names)\n writer.write_string_value(\"appDescription\", @app_description)\n writer.write_string_value(\"appDisplayName\", @app_display_name)\n writer.write_string_value(\"appId\", @app_id)\n writer.write_collection_of_object_values(\"appManagementPolicies\", @app_management_policies)\n writer.write_guid_value(\"appOwnerOrganizationId\", @app_owner_organization_id)\n writer.write_collection_of_object_values(\"appRoleAssignedTo\", @app_role_assigned_to)\n writer.write_boolean_value(\"appRoleAssignmentRequired\", @app_role_assignment_required)\n writer.write_collection_of_object_values(\"appRoleAssignments\", @app_role_assignments)\n writer.write_collection_of_object_values(\"appRoles\", @app_roles)\n writer.write_string_value(\"applicationTemplateId\", @application_template_id)\n writer.write_collection_of_object_values(\"claimsMappingPolicies\", @claims_mapping_policies)\n writer.write_collection_of_object_values(\"createdObjects\", @created_objects)\n writer.write_object_value(\"customSecurityAttributes\", @custom_security_attributes)\n writer.write_collection_of_object_values(\"delegatedPermissionClassifications\", @delegated_permission_classifications)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"disabledByMicrosoftStatus\", @disabled_by_microsoft_status)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"endpoints\", @endpoints)\n writer.write_collection_of_object_values(\"federatedIdentityCredentials\", @federated_identity_credentials)\n writer.write_collection_of_object_values(\"homeRealmDiscoveryPolicies\", @home_realm_discovery_policies)\n writer.write_string_value(\"homepage\", @homepage)\n writer.write_object_value(\"info\", @info)\n writer.write_collection_of_object_values(\"keyCredentials\", @key_credentials)\n writer.write_string_value(\"loginUrl\", @login_url)\n writer.write_string_value(\"logoutUrl\", @logout_url)\n writer.write_collection_of_object_values(\"memberOf\", @member_of)\n writer.write_string_value(\"notes\", @notes)\n writer.write_collection_of_primitive_values(\"notificationEmailAddresses\", @notification_email_addresses)\n writer.write_collection_of_object_values(\"oauth2PermissionGrants\", @oauth2_permission_grants)\n writer.write_collection_of_object_values(\"oauth2PermissionScopes\", @oauth2_permission_scopes)\n writer.write_collection_of_object_values(\"ownedObjects\", @owned_objects)\n writer.write_collection_of_object_values(\"owners\", @owners)\n writer.write_collection_of_object_values(\"passwordCredentials\", @password_credentials)\n writer.write_string_value(\"preferredSingleSignOnMode\", @preferred_single_sign_on_mode)\n writer.write_string_value(\"preferredTokenSigningKeyThumbprint\", @preferred_token_signing_key_thumbprint)\n writer.write_collection_of_primitive_values(\"replyUrls\", @reply_urls)\n writer.write_collection_of_object_values(\"resourceSpecificApplicationPermissions\", @resource_specific_application_permissions)\n writer.write_object_value(\"samlSingleSignOnSettings\", @saml_single_sign_on_settings)\n writer.write_collection_of_primitive_values(\"servicePrincipalNames\", @service_principal_names)\n writer.write_string_value(\"servicePrincipalType\", @service_principal_type)\n writer.write_string_value(\"signInAudience\", @sign_in_audience)\n writer.write_object_value(\"synchronization\", @synchronization)\n writer.write_collection_of_primitive_values(\"tags\", @tags)\n writer.write_guid_value(\"tokenEncryptionKeyId\", @token_encryption_key_id)\n writer.write_collection_of_object_values(\"tokenIssuancePolicies\", @token_issuance_policies)\n writer.write_collection_of_object_values(\"tokenLifetimePolicies\", @token_lifetime_policies)\n writer.write_collection_of_object_values(\"transitiveMemberOf\", @transitive_member_of)\n writer.write_object_value(\"verifiedPublisher\", @verified_publisher)\n end",
"title": ""
},
{
"docid": "c185d31534d702108e976e3a298c1929",
"score": "0.5953703",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"allowWindows11Upgrade\", @allow_windows11_upgrade)\n writer.write_enum_value(\"autoRestartNotificationDismissal\", @auto_restart_notification_dismissal)\n writer.write_enum_value(\"automaticUpdateMode\", @automatic_update_mode)\n writer.write_enum_value(\"businessReadyUpdatesOnly\", @business_ready_updates_only)\n writer.write_number_value(\"deadlineForFeatureUpdatesInDays\", @deadline_for_feature_updates_in_days)\n writer.write_number_value(\"deadlineForQualityUpdatesInDays\", @deadline_for_quality_updates_in_days)\n writer.write_number_value(\"deadlineGracePeriodInDays\", @deadline_grace_period_in_days)\n writer.write_enum_value(\"deliveryOptimizationMode\", @delivery_optimization_mode)\n writer.write_boolean_value(\"driversExcluded\", @drivers_excluded)\n writer.write_number_value(\"engagedRestartDeadlineInDays\", @engaged_restart_deadline_in_days)\n writer.write_number_value(\"engagedRestartSnoozeScheduleInDays\", @engaged_restart_snooze_schedule_in_days)\n writer.write_number_value(\"engagedRestartTransitionScheduleInDays\", @engaged_restart_transition_schedule_in_days)\n writer.write_number_value(\"featureUpdatesDeferralPeriodInDays\", @feature_updates_deferral_period_in_days)\n writer.write_date_time_value(\"featureUpdatesPauseExpiryDateTime\", @feature_updates_pause_expiry_date_time)\n writer.write_boolean_value(\"featureUpdatesPaused\", @feature_updates_paused)\n writer.write_date_time_value(\"featureUpdatesRollbackStartDateTime\", @feature_updates_rollback_start_date_time)\n writer.write_number_value(\"featureUpdatesRollbackWindowInDays\", @feature_updates_rollback_window_in_days)\n writer.write_boolean_value(\"featureUpdatesWillBeRolledBack\", @feature_updates_will_be_rolled_back)\n writer.write_object_value(\"installationSchedule\", @installation_schedule)\n writer.write_boolean_value(\"microsoftUpdateServiceAllowed\", @microsoft_update_service_allowed)\n writer.write_boolean_value(\"postponeRebootUntilAfterDeadline\", @postpone_reboot_until_after_deadline)\n writer.write_enum_value(\"prereleaseFeatures\", @prerelease_features)\n writer.write_number_value(\"qualityUpdatesDeferralPeriodInDays\", @quality_updates_deferral_period_in_days)\n writer.write_date_time_value(\"qualityUpdatesPauseExpiryDateTime\", @quality_updates_pause_expiry_date_time)\n writer.write_boolean_value(\"qualityUpdatesPaused\", @quality_updates_paused)\n writer.write_date_time_value(\"qualityUpdatesRollbackStartDateTime\", @quality_updates_rollback_start_date_time)\n writer.write_boolean_value(\"qualityUpdatesWillBeRolledBack\", @quality_updates_will_be_rolled_back)\n writer.write_number_value(\"scheduleImminentRestartWarningInMinutes\", @schedule_imminent_restart_warning_in_minutes)\n writer.write_number_value(\"scheduleRestartWarningInHours\", @schedule_restart_warning_in_hours)\n writer.write_boolean_value(\"skipChecksBeforeRestart\", @skip_checks_before_restart)\n writer.write_enum_value(\"updateNotificationLevel\", @update_notification_level)\n writer.write_enum_value(\"updateWeeks\", @update_weeks)\n writer.write_enum_value(\"userPauseAccess\", @user_pause_access)\n writer.write_enum_value(\"userWindowsUpdateScanAccess\", @user_windows_update_scan_access)\n end",
"title": ""
},
{
"docid": "5cc814833b07316b50b2e7dba72c848d",
"score": "0.5951982",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"isOptional\", @is_optional)\n writer.write_string_value(\"label\", @label)\n writer.write_string_value(\"recordType\", @record_type)\n writer.write_string_value(\"supportedService\", @supported_service)\n writer.write_number_value(\"ttl\", @ttl)\n end",
"title": ""
},
{
"docid": "8d649607e1293eaf73e5dc899e558f5a",
"score": "0.59518135",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"assignedPlans\", @assigned_plans)\n writer.write_object_value(\"branding\", @branding)\n writer.write_collection_of_primitive_values(\"businessPhones\", @business_phones)\n writer.write_collection_of_object_values(\"certificateBasedAuthConfiguration\", @certificate_based_auth_configuration)\n writer.write_string_value(\"city\", @city)\n writer.write_string_value(\"country\", @country)\n writer.write_string_value(\"countryLetterCode\", @country_letter_code)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"defaultUsageLocation\", @default_usage_location)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"extensions\", @extensions)\n writer.write_collection_of_primitive_values(\"marketingNotificationEmails\", @marketing_notification_emails)\n writer.write_enum_value(\"mobileDeviceManagementAuthority\", @mobile_device_management_authority)\n writer.write_date_time_value(\"onPremisesLastSyncDateTime\", @on_premises_last_sync_date_time)\n writer.write_boolean_value(\"onPremisesSyncEnabled\", @on_premises_sync_enabled)\n writer.write_enum_value(\"partnerTenantType\", @partner_tenant_type)\n writer.write_string_value(\"postalCode\", @postal_code)\n writer.write_string_value(\"preferredLanguage\", @preferred_language)\n writer.write_object_value(\"privacyProfile\", @privacy_profile)\n writer.write_collection_of_object_values(\"provisionedPlans\", @provisioned_plans)\n writer.write_collection_of_primitive_values(\"securityComplianceNotificationMails\", @security_compliance_notification_mails)\n writer.write_collection_of_primitive_values(\"securityComplianceNotificationPhones\", @security_compliance_notification_phones)\n writer.write_string_value(\"state\", @state)\n writer.write_string_value(\"street\", @street)\n writer.write_collection_of_primitive_values(\"technicalNotificationMails\", @technical_notification_mails)\n writer.write_string_value(\"tenantType\", @tenant_type)\n writer.write_collection_of_object_values(\"verifiedDomains\", @verified_domains)\n end",
"title": ""
},
{
"docid": "3c9ef1161394fda35e1c74a5d928ee85",
"score": "0.59393895",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"appAvailability\", @app_availability)\n writer.write_string_value(\"version\", @version)\n end",
"title": ""
},
{
"docid": "cc3aa3e53ca4beadeca6ebcaceaea9f9",
"score": "0.5933404",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"isRegistrationRequired\", @is_registration_required)\n writer.write_enum_value(\"targetType\", @target_type)\n end",
"title": ""
},
{
"docid": "291b9e5685aec041fcb14fead93d1c2a",
"score": "0.59312576",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"activityGroupName\", @activity_group_name)\n writer.write_collection_of_object_values(\"alertDetections\", @alert_detections)\n writer.write_string_value(\"assignedTo\", @assigned_to)\n writer.write_string_value(\"azureSubscriptionId\", @azure_subscription_id)\n writer.write_string_value(\"azureTenantId\", @azure_tenant_id)\n writer.write_string_value(\"category\", @category)\n writer.write_date_time_value(\"closedDateTime\", @closed_date_time)\n writer.write_collection_of_object_values(\"cloudAppStates\", @cloud_app_states)\n writer.write_collection_of_primitive_values(\"comments\", @comments)\n writer.write_number_value(\"confidence\", @confidence)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"description\", @description)\n writer.write_collection_of_primitive_values(\"detectionIds\", @detection_ids)\n writer.write_date_time_value(\"eventDateTime\", @event_date_time)\n writer.write_enum_value(\"feedback\", @feedback)\n writer.write_collection_of_object_values(\"fileStates\", @file_states)\n writer.write_collection_of_object_values(\"historyStates\", @history_states)\n writer.write_collection_of_object_values(\"hostStates\", @host_states)\n writer.write_collection_of_primitive_values(\"incidentIds\", @incident_ids)\n writer.write_collection_of_object_values(\"investigationSecurityStates\", @investigation_security_states)\n writer.write_date_time_value(\"lastEventDateTime\", @last_event_date_time)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_collection_of_object_values(\"malwareStates\", @malware_states)\n writer.write_collection_of_object_values(\"messageSecurityStates\", @message_security_states)\n writer.write_collection_of_object_values(\"networkConnections\", @network_connections)\n writer.write_collection_of_object_values(\"processes\", @processes)\n writer.write_collection_of_primitive_values(\"recommendedActions\", @recommended_actions)\n writer.write_collection_of_object_values(\"registryKeyStates\", @registry_key_states)\n writer.write_collection_of_object_values(\"securityResources\", @security_resources)\n writer.write_enum_value(\"severity\", @severity)\n writer.write_collection_of_primitive_values(\"sourceMaterials\", @source_materials)\n writer.write_enum_value(\"status\", @status)\n writer.write_collection_of_primitive_values(\"tags\", @tags)\n writer.write_string_value(\"title\", @title)\n writer.write_collection_of_object_values(\"triggers\", @triggers)\n writer.write_collection_of_object_values(\"uriClickSecurityStates\", @uri_click_security_states)\n writer.write_collection_of_object_values(\"userStates\", @user_states)\n writer.write_object_value(\"vendorInformation\", @vendor_information)\n writer.write_collection_of_object_values(\"vulnerabilityStates\", @vulnerability_states)\n end",
"title": ""
},
{
"docid": "f55a3cc0bb82ad06dedac42a04f34fd2",
"score": "0.5930231",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_boolean_value(\"isCompliantDeviceAccepted\", @is_compliant_device_accepted)\n writer.write_boolean_value(\"isHybridAzureADJoinedDeviceAccepted\", @is_hybrid_azure_a_d_joined_device_accepted)\n writer.write_boolean_value(\"isMfaAccepted\", @is_mfa_accepted)\n writer.write_string_value(\"@odata.type\", @odata_type)\n writer.write_additional_data(@additional_data)\n end",
"title": ""
},
{
"docid": "c31d91ee52000ce4b227c97e735c3aaf",
"score": "0.5928945",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"allowPrinting\", @allow_printing)\n writer.write_boolean_value(\"allowScreenCapture\", @allow_screen_capture)\n writer.write_boolean_value(\"allowTextSuggestion\", @allow_text_suggestion)\n writer.write_string_value(\"configurationAccount\", @configuration_account)\n writer.write_string_value(\"launchUri\", @launch_uri)\n end",
"title": ""
},
{
"docid": "be2f4dab4a6d243a49c0646dfdeb9345",
"score": "0.59280527",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"hasAttachments\", @has_attachments)\n writer.write_date_time_value(\"lastDeliveredDateTime\", @last_delivered_date_time)\n writer.write_string_value(\"preview\", @preview)\n writer.write_collection_of_object_values(\"threads\", @threads)\n writer.write_string_value(\"topic\", @topic)\n writer.write_collection_of_primitive_values(\"uniqueSenders\", @unique_senders)\n end",
"title": ""
},
{
"docid": "d9aabe9cbbebb021084279a2b501d153",
"score": "0.5921578",
"text": "def serialize(_object, data); end",
"title": ""
},
{
"docid": "d9aabe9cbbebb021084279a2b501d153",
"score": "0.5921578",
"text": "def serialize(_object, data); end",
"title": ""
},
{
"docid": "6622b187c19fe5b0dd6b7ec7080a309e",
"score": "0.59159255",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_guid_value(\"applicationId\", @application_id)\n writer.write_boolean_value(\"default\", @default)\n writer.write_string_value(\"description\", @description)\n writer.write_boolean_value(\"discoverable\", @discoverable)\n writer.write_string_value(\"factoryTag\", @factory_tag)\n writer.write_collection_of_object_values(\"metadata\", @metadata)\n writer.write_object_value(\"schema\", @schema)\n end",
"title": ""
},
{
"docid": "23150e8114db5a3a3801bccfd2ea2a15",
"score": "0.59094614",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"catalog\", @catalog)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_enum_value(\"requestType\", @request_type)\n writer.write_object_value(\"resource\", @resource)\n writer.write_enum_value(\"state\", @state)\n end",
"title": ""
},
{
"docid": "4ff575ecf70023e38dea7e474f64350b",
"score": "0.5909212",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"appDataEncryptionType\", @app_data_encryption_type)\n writer.write_collection_of_object_values(\"apps\", @apps)\n writer.write_collection_of_object_values(\"customSettings\", @custom_settings)\n writer.write_number_value(\"deployedAppCount\", @deployed_app_count)\n writer.write_object_value(\"deploymentSummary\", @deployment_summary)\n writer.write_boolean_value(\"disableAppEncryptionIfDeviceEncryptionIsEnabled\", @disable_app_encryption_if_device_encryption_is_enabled)\n writer.write_boolean_value(\"encryptAppData\", @encrypt_app_data)\n writer.write_boolean_value(\"faceIdBlocked\", @face_id_blocked)\n writer.write_string_value(\"minimumRequiredPatchVersion\", @minimum_required_patch_version)\n writer.write_string_value(\"minimumRequiredSdkVersion\", @minimum_required_sdk_version)\n writer.write_string_value(\"minimumWarningPatchVersion\", @minimum_warning_patch_version)\n writer.write_boolean_value(\"screenCaptureBlocked\", @screen_capture_blocked)\n end",
"title": ""
},
{
"docid": "bb641c6b0ecc10f94e7b4fd5dba9d459",
"score": "0.5907252",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"appDisplayName\", @app_display_name)\n writer.write_string_value(\"appId\", @app_id)\n writer.write_collection_of_object_values(\"appliedConditionalAccessPolicies\", @applied_conditional_access_policies)\n writer.write_string_value(\"clientAppUsed\", @client_app_used)\n writer.write_enum_value(\"conditionalAccessStatus\", @conditional_access_status)\n writer.write_string_value(\"correlationId\", @correlation_id)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_object_value(\"deviceDetail\", @device_detail)\n writer.write_string_value(\"ipAddress\", @ip_address)\n writer.write_boolean_value(\"isInteractive\", @is_interactive)\n writer.write_object_value(\"location\", @location)\n writer.write_string_value(\"resourceDisplayName\", @resource_display_name)\n writer.write_string_value(\"resourceId\", @resource_id)\n writer.write_enum_value(\"riskDetail\", @risk_detail)\n writer.write_collection_of_object_values(\"riskEventTypes\", @risk_event_types)\n writer.write_collection_of_primitive_values(\"riskEventTypes_v2\", @risk_event_types_v2)\n writer.write_enum_value(\"riskLevelAggregated\", @risk_level_aggregated)\n writer.write_enum_value(\"riskLevelDuringSignIn\", @risk_level_during_sign_in)\n writer.write_enum_value(\"riskState\", @risk_state)\n writer.write_object_value(\"status\", @status)\n writer.write_string_value(\"userDisplayName\", @user_display_name)\n writer.write_string_value(\"userId\", @user_id)\n writer.write_string_value(\"userPrincipalName\", @user_principal_name)\n end",
"title": ""
},
{
"docid": "6c5dc0658977196a66988663ebf00d63",
"score": "0.59044874",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_boolean_value(\"allowSampleSharing\", @allow_sample_sharing)\n writer.write_boolean_value(\"enableExpeditedTelemetryReporting\", @enable_expedited_telemetry_reporting)\n end",
"title": ""
},
{
"docid": "a659ad7bc6cb28a00be8a4811ca865d3",
"score": "0.58958924",
"text": "def serialize\n {}\n end",
"title": ""
},
{
"docid": "2778000537cd2d2df053dbd648844fb2",
"score": "0.5894744",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"contentType\", @content_type)\n writer.write_boolean_value(\"isInline\", @is_inline)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_string_value(\"name\", @name)\n writer.write_number_value(\"size\", @size)\n end",
"title": ""
},
{
"docid": "a79f7707c94c97700ec8e8060e9a60c1",
"score": "0.58946913",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"assistantName\", @assistant_name)\n writer.write_date_time_value(\"birthday\", @birthday)\n writer.write_object_value(\"businessAddress\", @business_address)\n writer.write_string_value(\"businessHomePage\", @business_home_page)\n writer.write_collection_of_primitive_values(\"businessPhones\", @business_phones)\n writer.write_collection_of_primitive_values(\"children\", @children)\n writer.write_string_value(\"companyName\", @company_name)\n writer.write_string_value(\"department\", @department)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"emailAddresses\", @email_addresses)\n writer.write_collection_of_object_values(\"extensions\", @extensions)\n writer.write_string_value(\"fileAs\", @file_as)\n writer.write_string_value(\"generation\", @generation)\n writer.write_string_value(\"givenName\", @given_name)\n writer.write_object_value(\"homeAddress\", @home_address)\n writer.write_collection_of_primitive_values(\"homePhones\", @home_phones)\n writer.write_collection_of_primitive_values(\"imAddresses\", @im_addresses)\n writer.write_string_value(\"initials\", @initials)\n writer.write_string_value(\"jobTitle\", @job_title)\n writer.write_string_value(\"manager\", @manager)\n writer.write_string_value(\"middleName\", @middle_name)\n writer.write_string_value(\"mobilePhone\", @mobile_phone)\n writer.write_collection_of_object_values(\"multiValueExtendedProperties\", @multi_value_extended_properties)\n writer.write_string_value(\"nickName\", @nick_name)\n writer.write_string_value(\"officeLocation\", @office_location)\n writer.write_object_value(\"otherAddress\", @other_address)\n writer.write_string_value(\"parentFolderId\", @parent_folder_id)\n writer.write_string_value(\"personalNotes\", @personal_notes)\n writer.write_object_value(\"photo\", @photo)\n writer.write_string_value(\"profession\", @profession)\n writer.write_collection_of_object_values(\"singleValueExtendedProperties\", @single_value_extended_properties)\n writer.write_string_value(\"spouseName\", @spouse_name)\n writer.write_string_value(\"surname\", @surname)\n writer.write_string_value(\"title\", @title)\n writer.write_string_value(\"yomiCompanyName\", @yomi_company_name)\n writer.write_string_value(\"yomiGivenName\", @yomi_given_name)\n writer.write_string_value(\"yomiSurname\", @yomi_surname)\n end",
"title": ""
},
{
"docid": "70f7d8fa0af6d55365005b289c9e9440",
"score": "0.58935875",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_boolean_value(\"isEnabledForContentSharing\", @is_enabled_for_content_sharing)\n writer.write_boolean_value(\"isEnabledForVideo\", @is_enabled_for_video)\n writer.write_string_value(\"@odata.type\", @odata_type)\n writer.write_additional_data(@additional_data)\n end",
"title": ""
},
{
"docid": "30b03fc2a51c62882460997e3df900ea",
"score": "0.5893393",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"deliveryOptimizationPriority\", @delivery_optimization_priority)\n writer.write_object_value(\"installTimeSettings\", @install_time_settings)\n writer.write_enum_value(\"notifications\", @notifications)\n writer.write_object_value(\"restartSettings\", @restart_settings)\n end",
"title": ""
},
{
"docid": "0e97e58b5a50fd626b80f33e21b92bb2",
"score": "0.58925027",
"text": "def use_ox\n @serializer_type = Serialization::OxSerializer\n end",
"title": ""
}
] |
98546e5aadaccbb055cc4d52aa95ab3e
|
method to use in cook gives ingredients' display_options the condiments parameter
|
[
{
"docid": "6a94893c2c4d748855eaf1dcd76932af",
"score": "0.6621381",
"text": "def show_condiments\n display_options(condiments)\n end",
"title": ""
}
] |
[
{
"docid": "f358e464ec91209916de4824e86068c9",
"score": "0.5781093",
"text": "def display_all_recipes\n array_of_choices = $default_recipe.all_recipes.keys << 'Previous Page'\n recipe_selection = display_choices('Raid my Kitchen! Recipes : ',array_of_choices)\n if recipe_selection == 'Previous Page'\n level_2_option_2\n else\n display_ing_and_method(recipe_selection)\n end\nend",
"title": ""
},
{
"docid": "eb17814a7d5a5b46a144eb358d608e4c",
"score": "0.5745926",
"text": "def variant_options(v, allow_back_orders = Spree::Config[:allow_backorders], include_style = true)\n list = v.option_values.map { |ov| \"#{ov.option_type.presentation}: #{ov.presentation}\" }.to_sentence({:words_connector => \", \", :two_words_connector => \", \"})\n list = include_style ? \"<span class =\\\"out-of-stock\\\">(\" + t(\"out_of_stock\") + \") #{list}</span>\" : \"#{t(\"out_of_stock\")} #{list}\" unless (v.in_stock or allow_back_orders)\n list\n end",
"title": ""
},
{
"docid": "c425810e72b402974c2b0061806debae",
"score": "0.57351404",
"text": "def print_adoption_list()\n puts \"\\n\"\n puts \"Available for adoption:\"\n animals.each {|animal| puts animal.name if animal.available_to_adopt == true}\n clients.each {|client| client.animals.each {|animal|\n puts animal.name if animal.available_to_adopt == true}}\n end",
"title": ""
},
{
"docid": "f6feca2b13b0ed6778c6d840c814041b",
"score": "0.56484777",
"text": "def display_recipe_options\n $prompt.select(\"Please select a category:\") do |menu|\n menu.choice 'Show all Recipes', 1\n menu.choice 'Add a Recipe', 2\n #edit a recipe?\n menu.choice 'Delete a Recipe', 3\n menu.choice 'Previous page', 0\n end\nend",
"title": ""
},
{
"docid": "88f4da1db65ed53fa3b6105a7f069ca8",
"score": "0.56454253",
"text": "def variant_options(v, allow_back_orders = Spree::Config[:allow_backorders])\n list = v.option_values.map { |ov| \"#{ov.option_type.presentation}: #{ov.presentation}\" }.to_sentence({:connector => \",\"})\n list = \"<span class =\\\"out-of-stock\\\">(OUT OF STOCK) #{list}</span>\" unless (v.in_stock or allow_back_orders)\n list\n end",
"title": ""
},
{
"docid": "b583facc035aad22d5821bd1e52fe71f",
"score": "0.56382966",
"text": "def display_options(options_hash)\n # Guard Clause: Check if no product options are available\n if options_hash.empty?\n message = 'No options available for specified Product Type / Option(s)'\n puts message\n return message\n end\n\n options_hash.each do |key, value|\n # Guard Clause: Check if set value is empty\n puts \"#{key.capitalize}: #{value.to_a.join(', ')}\" unless value.empty?\n end\n end",
"title": ""
},
{
"docid": "1122de5e6f88be14b30ebcce27065db5",
"score": "0.56343114",
"text": "def brand_and_flavor \n \"#{brand.name} - #{flavor}\" \n end",
"title": ""
},
{
"docid": "606bb374281eec51a4a8aec636f14407",
"score": "0.556914",
"text": "def print_ingredients\n pastel = Pastel.new\n puts pastel.red.underline(\"Ingredient(s) needed for #{self.name}\")\n self.ingredient_recipes.each do |recipe_ingredient|\n if recipe_ingredient.ingredient == nil\n ingredient = \"Any #{recipe_ingredient.category.name}\"\n else\n ingredient = recipe_ingredient.ingredient.name\n end\n puts ingredient\n end\n end",
"title": ""
},
{
"docid": "8760fac3b96a0383546ebd9d8a548a12",
"score": "0.5563738",
"text": "def ingredients_and_amounts(any_recipe)\n \nend",
"title": ""
},
{
"docid": "aedbb324bf0c59ad65354c2f6605621a",
"score": "0.5562147",
"text": "def print\n %w[option term value].each do |condition|\n puts \"#{condition}: #{self[condition]}\"\n end\n end",
"title": ""
},
{
"docid": "a080bb1ce763bf570baf1e2a69f947e0",
"score": "0.5554668",
"text": "def provide_meal_recipe(meal)\n \n puts \" \"\n puts \"-----------#{meal.name}-----------\"\n puts \" \"\n puts \"Picture Link: #{meal.picture}\"\n puts \" \"\n puts \"Category: #{meal.category}\"\n puts \" \"\n puts \"Ingredients and their Quantities\"\n meal.ingredients.each_with_index do |ingredient, index|\n puts \"#{ingredient} - #{meal.measures[index]}\"\n end \n puts \" \"\n puts \"Instructions: #{meal.instructions}\"\n puts \" \" \n puts \"Video: #{meal.video}\" if meal.video\n puts \" \" if meal.video\n puts \"------------------------------------------------------\"\n\n end",
"title": ""
},
{
"docid": "4cf5296caa3f121ca2afd4a3d53d3a92",
"score": "0.5524689",
"text": "def customize\n new_drink = Drink.create({is_menu_item?: false})\n selection = $prompt.multi_select(\"Please select ingredients\", Ingredient.grouped_by_type.map {|instance| instance.name})\n selection.each {|ingredient_name| RecipeItem.create({drink_id: new_drink.id, ingredient_id: Ingredient.find_by(name: ingredient_name).id})}\n new_drink.update(price: selection.count.to_i)\n order(new_drink)\nend",
"title": ""
},
{
"docid": "e706ef93af3c2de30f33eaf0ee01d069",
"score": "0.55202115",
"text": "def display_ingredients(ingredients)\n\t# \"eval\" turns the hash string back into a proper hash\n\tingredients = eval(ingredients)\n\t# Push the ingredients into a table that will go into the recipe page\n\tingredients.map do |key, value|\n\t\t\"<tr><td>#{value[1]}</td> <td>#{value[2]}</td> <td>#{key}#{(\", \" + value[3]) if value[3] != nil}</td></tr>\"\n\tend\nend",
"title": ""
},
{
"docid": "8a8ab1816b3edca6a6fd38d3b02493b1",
"score": "0.5498162",
"text": "def get_selection_options(dwarf_planets)\n return \"\\nPLANETS#{dwarf_planets.list_planets}\n #{dwarf_planets.number_of_planets + 1}. ADD\n #{dwarf_planets.number_of_planets + 2}. EXIT\\n\"\nend",
"title": ""
},
{
"docid": "ca6740c3e569b71e31cbbd9758b5195f",
"score": "0.54976344",
"text": "def name_price_ingredient(drink_instance)\n \"#{drink_instance.name} | $#{drink_instance.price} | #{(drink_instance.ingredients.map {|ingredient| ingredient.name}).join(\", \")}\\n\"\nend",
"title": ""
},
{
"docid": "310baa0d4c0787e0133c45c272a4256d",
"score": "0.54957116",
"text": "def ingredients(any_recipe)\n \nend",
"title": ""
},
{
"docid": "7d8132d1250adfa9132c73ea4bd13cfe",
"score": "0.5492077",
"text": "def option_select\n ret = \"#{self.name} - £#{sprintf(\"%.2f\", self.price)}\"\n ret.concat ' (Sold Out)' if self.stock == 0\n return ret\n end",
"title": ""
},
{
"docid": "2c51c93ab37159052f60fb2ac754db71",
"score": "0.54637915",
"text": "def options\n @options ||= super.merge({\n loans: DEFAULT_SHOW_LOANS_VALUE,\n cash: DEFAULT_SHOW_CASH_VALUE,\n hold: DEFAULT_SHOW_HOLD_VALUE,\n filter_cash: DEFAULT_SHOW_FILTER_CASH_VALUE\n })\n end",
"title": ""
},
{
"docid": "62d03c80a69662829178f45fca662939",
"score": "0.5444756",
"text": "def available_variations\n self.product_variations.find(:all, :conditions => [\"visible = ? AND qty_on_hand >= ?\", true, 1])\n end",
"title": ""
},
{
"docid": "80286e0516f673ca2e77d282af968316",
"score": "0.54381",
"text": "def show\n @ing_quant_pairs = get_recipe_ingredients(@recipe)\n end",
"title": ""
},
{
"docid": "d26f23b7d7bd73c0327b5243b2a11be4",
"score": "0.54182",
"text": "def meal_choice (options = \"meat\")\n options\nend",
"title": ""
},
{
"docid": "5e5c3121a0c709beb96a98b7dcf07ceb",
"score": "0.5386177",
"text": "def condiment_params\n params.require(:condiment).permit(:survey_food_code, :display_name, :portion_size, :portion_code, :grains, :whole_grains, :vegetables, :dkgreen, :orange, :starchy_vegetables, :other_vegetables, :fruits, :milk, :meat, :soy, :drybeans_peas, :oils, :solid_fats, :added_sugars, :alcohol, :calories, :saturated_fats)\n end",
"title": ""
},
{
"docid": "4d6e6cecc47395dd929193ef30b2685e",
"score": "0.537654",
"text": "def variant_options(v, allow_back_orders = Spree::Config[:allow_backorders], include_style = true)\n list = v.options_text\n list = include_style ? \"<span class =\\\"out-of-stock\\\">(\" + t(\"out_of_stock\") + \") #{list}</span>\" : \"#{t(\"out_of_stock\")} #{list}\" unless (allow_back_orders || v.in_stock?)\n list\n end",
"title": ""
},
{
"docid": "4ee3e5c539624eefe8d73464c7636c77",
"score": "0.53730565",
"text": "def filter_select_opts\n [{:text => '', :value => 'none', :id => 'opt-none', :visible => true}] + \n VwcAllCombined.filterables.map{|fld| \n {:text => \"Filter on #{fld.humanize.titlecase}\", \n :value => fld, \n :id => \"opt-#{fld}\", \n :visible => true} \n }\n end",
"title": ""
},
{
"docid": "88c7e163b309a1a1858a81a7503ce5b7",
"score": "0.5354513",
"text": "def render_option()\n @opts\n end",
"title": ""
},
{
"docid": "930ce300a25248d8c007328002c8aa85",
"score": "0.5352554",
"text": "def options_text\n #self.option_values.sort { |ov1, ov2| ov1.option_type.position <=> ov2.option_type.position }.map { |ov| \"#{ov.option_type.presentation}: #{ov.presentation}\" }.to_sentence({ :words_connector => \", \", :two_words_connector => \", \" })\n self.option_values.sort { |ov1, ov2| ov1.option_type.position <=> ov2.option_type.position }.map { |ov| \"#{ov.option_type.presentation} #{ov.presentation}\" }.to_sentence({ :words_connector => \", \", :two_words_connector => \", \" })\n end",
"title": ""
},
{
"docid": "930ce300a25248d8c007328002c8aa85",
"score": "0.5352554",
"text": "def options_text\n #self.option_values.sort { |ov1, ov2| ov1.option_type.position <=> ov2.option_type.position }.map { |ov| \"#{ov.option_type.presentation}: #{ov.presentation}\" }.to_sentence({ :words_connector => \", \", :two_words_connector => \", \" })\n self.option_values.sort { |ov1, ov2| ov1.option_type.position <=> ov2.option_type.position }.map { |ov| \"#{ov.option_type.presentation} #{ov.presentation}\" }.to_sentence({ :words_connector => \", \", :two_words_connector => \", \" })\n end",
"title": ""
},
{
"docid": "caea923c939f59f97c3cb0a42c78e070",
"score": "0.5352393",
"text": "def category_options(reimbursement)\n {}\n end",
"title": ""
},
{
"docid": "e7d70507d52a5030e4309209ca041bb6",
"score": "0.5351762",
"text": "def display_choices\n puts <<-END\n What do you want to do?\n Options: #{yield}\n END\n end",
"title": ""
},
{
"docid": "228b60dcecf8ccaec44ef3cc4ba4577b",
"score": "0.5344159",
"text": "def show\n ensure_ingredient_present; return if performed?\n\n @cpu_constraint = @ingredient.cpu_constraint\n @ram_constraint = @ingredient.ram_constraint\n @region_constraint = @ingredient.preferred_region_area_constraint\n @dependency_constraints = @ingredient.all_dependency_constraints\n @provider_constraint = @ingredient.provider_constraint\n @scaling_constraint = @ingredient.scaling_constraint\n @deployment_recommendation = @ingredient.deployment_recommendations.last.embed_ingredients unless @ingredient.deployment_recommendations.empty?\n respond_to do |format|\n format.html\n format.json {render json: @ingredient}\n end\n end",
"title": ""
},
{
"docid": "6f82a4478f9cc6a7c0a41528f7509457",
"score": "0.53293544",
"text": "def getOptions(nbDays, deductibleOption)\n # deductible reduction option\n deductibleReduction = 0;\n if (deductibleOption)\n deductibleReduction = (nbDays * 400); \n end\n \n # aggregation of options\n options = {\"deductible_reduction\" => deductibleReduction}\nend",
"title": ""
},
{
"docid": "57bde82d0451332dbd67f6f84462863c",
"score": "0.532298",
"text": "def display_options\n @show.each_with_index do |option, index|\n puts \"#{index+1}. #{option}\"\n end\n end",
"title": ""
},
{
"docid": "950d10b4579e699cfdc4ce4ea87470f7",
"score": "0.5319679",
"text": "def show_filters\n if options[:filter_specs]\n options[:filter_specs] = [options[:filter_specs]] unless options[:filter_specs].is_a? Array\n output \"Spec filter: #{options[:filter_specs].join(', ').colorize :green}\"\n end\n if options[:filter_facts]\n options[:filter_facts] = [options[:filter_facts]] unless options[:filter_facts].is_a? Array\n output \"Facts filter: #{options[:filter_facts].join(', ').colorize :green}\"\n end\n if options[:filter_hiera]\n options[:filter_hiera] = [options[:filter_hiera]] unless options[:filter_hiera].is_a? Array\n output \"Hiera filter: #{options[:filter_hiera].join(', ').colorize :green}\"\n end\n if options[:filter_examples]\n options[:filter_examples] = [options[:filter_examples]] unless options[:filter_examples].is_a? Array\n output \"Examples filter: #{options[:filter_examples].join(', ').colorize :green}\"\n end\n end",
"title": ""
},
{
"docid": "dc4638e07ca5db128a3966f4616a1d80",
"score": "0.5319273",
"text": "def show_pizza_ingredients\n @name.each do |pizzaType|\n puts \"- #{pizzaType.ingredients}\"\n end\n end",
"title": ""
},
{
"docid": "37ccd460e4cbf95a03ec31d17df13dc6",
"score": "0.53132844",
"text": "def concept_options\n\t\tconcept_name = params[:search_string]\n\t\toptions = concept_set(concept_name).flatten.uniq\n\n\t\trender plain: (\"<li></li><li>\" + options.join(\"</li><li>\") + \"</li>\").html_safe\n\tend",
"title": ""
},
{
"docid": "7e8d1a8f7aca8e098ebfbbb5e769ab71",
"score": "0.531159",
"text": "def recipe_ingredients(mac_and_cheese_recipe)\n return mac_and_cheese_recipe\nend",
"title": ""
},
{
"docid": "7e8d1a8f7aca8e098ebfbbb5e769ab71",
"score": "0.531159",
"text": "def recipe_ingredients(mac_and_cheese_recipe)\n return mac_and_cheese_recipe\nend",
"title": ""
},
{
"docid": "f63f9fd7307c295532e44c43f70191a8",
"score": "0.53097355",
"text": "def recipe_detail_menu(recipe)\n command = gets.downcase.strip\ncase command\n when 'ingredients'\n puts list_test\n # binding.pry\n # puts \"Ingredients needed: #{recipe.ingredients.name}\"\n # puts Ingredients.all.map {|ingredient| ingredient.name} \n help\n when 'calories'\n puts \"Calories #{recipe.calories}\"\n help\n when 'servings'\n puts \"Servings #{recipe.servings}\"\n help\n when 'both'\n puts \"Calories #{recipe.calories}\"\n puts \"Servings #{recipe.servings}\"\n help\n when 'main menu'\n help\n when 'exit'\n exit_app\n else\n options\n end\nend",
"title": ""
},
{
"docid": "c51555d1172e7793ef0078b87555c3b0",
"score": "0.5292443",
"text": "def set_IncludeVariations(value)\n set_input(\"IncludeVariations\", value)\n end",
"title": ""
},
{
"docid": "61e50dcbbdb64e588abecdb90b1bdc50",
"score": "0.5284765",
"text": "def format_options\n return \"\" if @parameters.options.empty?\n\n longest_option = @parameters.options.map(&:long)\n .compact.max_by(&:length).length\n any_short = @parameters.options.map(&:short).compact.any?\n ordered_options = @order.(@parameters.options)\n\n ordered_options.reduce([]) do |acc, option|\n next acc if option.hidden?\n acc << format_option(option, longest_option, any_short)\n end.join(NEWLINE)\n end",
"title": ""
},
{
"docid": "313cd247caaf2c071964bc84148245d5",
"score": "0.52767813",
"text": "def filters_description\n if filters[:boot].to_s == \"-1\"\n desc_boot = _(\"from previous boot\")\n else\n desc_boot = _(\"since system's boot\")\n end\n\n strings = [\n [:unit, _(\"unit (%s)\")],\n [:match, _(\"file (%s)\")],\n [:priority, _(\"priority (%s)\")]\n ]\n others = []\n\n strings.each do |filter, string|\n if value = filters[filter]\n others << string % value\n end\n end\n\n if others.empty?\n desc_others = _(\"with no additional conditions\")\n else\n desc_others = _(\"filtering by %s\") % others.join(\", \")\n end\n\n \"#{desc_boot} #{desc_others}\"\n end",
"title": ""
},
{
"docid": "2840a7fa14725c00f54d20a7be96713e",
"score": "0.527361",
"text": "def meal_choice(carrots, broccoli, chicken = \"tofu\")\n puts \"What a nutritious meal!\"\n puts \"A plate of #{chicken} with #{carrots} and #{broccoli}.\"\n \"A plate of #{chicken} with #{carrots} and #{broccoli}.\"\nend",
"title": ""
},
{
"docid": "ff66529cbe9b90d522c216abf2b3a51d",
"score": "0.5270168",
"text": "def extractChoices\n end",
"title": ""
},
{
"docid": "838f5a1cb0f6ea890d9b5a112caee0bc",
"score": "0.52632535",
"text": "def inspect\n current_find_options = {}\n (AR_OPTIONS - [:conditions]).each do |option|\n value = send(option)\n next if value.nil?\n current_find_options[option] = value\n end\n conditions_value = conditions.conditions\n current_find_options[:conditions] = conditions_value unless conditions_value.blank?\n current_find_options[:scope] = scope unless scope.blank?\n \"#<#{klass}Search #{current_find_options.inspect}>\"\n end",
"title": ""
},
{
"docid": "838f5a1cb0f6ea890d9b5a112caee0bc",
"score": "0.52632535",
"text": "def inspect\n current_find_options = {}\n (AR_OPTIONS - [:conditions]).each do |option|\n value = send(option)\n next if value.nil?\n current_find_options[option] = value\n end\n conditions_value = conditions.conditions\n current_find_options[:conditions] = conditions_value unless conditions_value.blank?\n current_find_options[:scope] = scope unless scope.blank?\n \"#<#{klass}Search #{current_find_options.inspect}>\"\n end",
"title": ""
},
{
"docid": "838f5a1cb0f6ea890d9b5a112caee0bc",
"score": "0.52632535",
"text": "def inspect\n current_find_options = {}\n (AR_OPTIONS - [:conditions]).each do |option|\n value = send(option)\n next if value.nil?\n current_find_options[option] = value\n end\n conditions_value = conditions.conditions\n current_find_options[:conditions] = conditions_value unless conditions_value.blank?\n current_find_options[:scope] = scope unless scope.blank?\n \"#<#{klass}Search #{current_find_options.inspect}>\"\n end",
"title": ""
},
{
"docid": "6b222ce5c12dbb8ccfee208687371319",
"score": "0.52575535",
"text": "def meal_choice(vegetables, meat )\n meal choice = true\n meal choice =\"Do you want #{vegetables= veg1,veg2} or #{meat = protein}\n puts meal_choice\nend\n\ndef nutritious_meal(protein, vegetables)\nnutritious_meal = true\nnutitious_meal = \"what a nutritious meal!n\\A plate of #{protein + vegetables = veg1,veg2} so that you can also see what you've ordered.\"\nputs nutitious_meal\nend",
"title": ""
},
{
"docid": "431287a3a89265b47eca53a7a45b418c",
"score": "0.524727",
"text": "def make_options(flag, items)\n items.map { |item| \"#{flag}#{item}\" }.join(\" \")\nend",
"title": ""
},
{
"docid": "3d8349fa4456412e49004781baa802c0",
"score": "0.52346045",
"text": "def view_recipe\n PROMPT.select('want to see the recipe?') do |menu|\n menu.choice({name:'yes', value:'1'})\n menu.choice({name:'no, search again', value:'2'})\n menu.choice({name:'no, quit', value:'3'})\n end\n end",
"title": ""
},
{
"docid": "3aa9f4b232c53bcd0a980eed0cb3a0ae",
"score": "0.5224961",
"text": "def description(options={})\n @filter_set.description(options)\n end",
"title": ""
},
{
"docid": "ffb2233ea5762ae94ca4f35da26acb79",
"score": "0.52195746",
"text": "def condition_choices\n [\n [\"Excellent\", 5],\n [\"Very Good\", 4],\n [\"Good\", 3],\n [\"Poor\", 2],\n [\"Very Poor\", 1]\n ]\n end",
"title": ""
},
{
"docid": "d31ed4c27991cb29a22c725d270696dc",
"score": "0.52156687",
"text": "def order_soda(flavor, size = \"medium\", quantity = 1)\n if quantity == 1\n plural = \"soda\"\n else \n plural = \"sodas\"\n end\n puts \"#{quantity} #{size} #{flavor} #{plural}, coming right up!\"\nend",
"title": ""
},
{
"docid": "cecfd321e76a1234d3ad2587885ca0da",
"score": "0.52145576",
"text": "def show\n if params[:inline]\n render(@ingredient)\n end\n end",
"title": ""
},
{
"docid": "bca2b0094daf845b746139a84d9b6ec9",
"score": "0.5205904",
"text": "def order_soda(flavor, size = \"medium\", quantity = 1)\r\n\r\n if quantity ==1\r\n plural = \"soda\"\r\n else\r\n plural = \"sodas\"\r\n end\r\n puts \"#{quantity} #{size} #{flavor} #{plural}, coming right up!\"\r\n\r\nend",
"title": ""
},
{
"docid": "8d67069064a30e3b58f60e95cd37b3b4",
"score": "0.52054006",
"text": "def print_options\n puts \"1.Lattes sell for $4,\"\n puts \"2.Scones sell for $5,\"\n puts \"3.Tea sells for $3.\"\nend",
"title": ""
},
{
"docid": "30a41ca4223d4a27f1bf33d080dc6d31",
"score": "0.51961094",
"text": "def price_explain( quantity, markup=1.0, opts={} )\n\t\traise \"Invalid options for Product\" unless options_valid?( opts )\n\t output = \"\"\n \n # Calculate Area\n\t\tarea = self.height * self.width\n\t\toutput += \"<p>Area: #{self.height} (Height) x #{self.width} (Width) = #{area}</p>\"\n \n # Calculate Setup Price\n\t\tcost = self.setup_price * area\n\t\toutput += \"<p>Setup price: #{self.setup_price} (Base) x #{area} (Area) = #{cost}</p>\"\n\t\t\n\t\t# Price each option\n\t\trawopts = raw_options_map.merge( soft_options_set_to_raw_set(opts) )\n\t\trawopts.each_pair do |option, value|\n\t\t\tvalue = value.first if value.kind_of? Array\n\t\t\topt_output = \"<b>Option: #{option.title}[#{value.label}]</b><br>\"\n\t\t\t\n\t\t\t#Calculate Option Setup\n\t\t\topt_setup_cost = 0\n\t\t\tif !option.setup_price.nil? && option.setup_price > 0\n\t\t\t opt_setup_cost = option.setup_price\n\t\t\t\topt_output += \"Option Setup: #{option.setup_price}<br />\"\n\t\t\tend\n\t\t\n\t\t\t\t\t\n\t\t\tif value.price_per_unit\n # Calculate ajusted cost\n\t\t\t\tadjusted_cost = ((value.price_per_unit.to_f) / value.unit_quantity.to_f)\n\t\t\t\topt_output += \"Cost Adjusted for Quantity Break: #{value.price_per_unit} (Price) / #{value.unit_quantity} (Qty) = #{adjusted_cost}<br />\"\t\t \n\n # Calculate cost\n\t\t\t\toption_cost = opt_setup_cost + (adjusted_cost * quantity)\n\t\t\t\topt_output += \"Option Cost: #{adjusted_cost} (Price) x #{quantity} (Qty) = #{option_cost}<br />\"\n\n # Calculate running total\n\t\t\t\tcost += option_cost\n\t\t\t\topt_output += \"Running Subtotal: #{cost}\"\n\t\t\telse\n # Calculate ajusted cost\n\t\t\t\tadjusted_cost = (value.price_per_sqin / value.unit_quantity)\n\t\t\t\topt_output += \"Cost Adjusted for Quantity Break: #{value.price_per_sqin} (Price) / #{value.unit_quantity} (Qty) = #{adjusted_cost}<br />\"\t \n\n # Calculate cost\n\t\t\t\toption_cost = adjusted_cost * area * quantity\n\t\t\t\topt_output += \"Option Cost: #{adjusted_cost} (Cost) x #{area} (Area) x #{quantity} (Qty) = #{option_cost}<br />\"\n\n # Calculate running total\n\t\t\t cost += option_cost\n\t\t\t\topt_output += \"Running Subtotal: #{cost}\"\n\t\t\tend\n\t\t\toutput += \"<p>#{opt_output}</p>\"\n\t\tend\n\t\t\n\t\t# Calculate price\n\t\tprice = cost * markup\n\t\toutput += \"<p><b>Total:</b> #{cost} (Base) x #{markup} (Markup) = #{price}</p>\"\n\t\t\n\t\treturn output\n\tend",
"title": ""
},
{
"docid": "0391a28f2ac3cbec4871c6c1d595cbb0",
"score": "0.5175088",
"text": "def description\n # if range is 0 or the option isn't used for descriptions\n if BlizzABS::Items.range(@id) == 0 ||\n BlizzABS::Config::ITEM_DATA_MODE.all? {|v| v != 2}\n # return normal description\n return @description\n end\n # set up result\n text = @description\n # iterate through configuration\n BlizzABS::Config::ITEM_DATA_MODE.each_index {|i|\n # if current option was set up for descriptions\n if BlizzABS::Config::ITEM_DATA_MODE[i] == 2\n # add extra information to result text\n case i\n when 0\n next if [0, 7].include?(@scope)\n text += case BlizzABS::Items.type(@id)[0]\n when 0 then [1, 3, 5].include?(@scope) ? ' (Shooter)' : ' (Thruster)'\n when 1 then [1, 3, 5].include?(@scope) ? ' (Homing)' : ' (S. Homing)'\n when 2 then [1, 3, 5].include?(@scope) ? ' (Selecter)' : ' (Shockwave)'\n when 3 then [1, 3, 5].include?(@scope) ? ' (Beam)' : ' (Fullscreen)'\n when 4 then ' (Summoner)'\n end\n when 1 then text += ' (explodes)' if BlizzABS::Items.type(@id)[1] > 0\n when 2 then text += \" R: #{[BlizzABS::Items.range(@id), 1].max}\"\n end\n end}\n # return result text\n return text\n end",
"title": ""
},
{
"docid": "0391a28f2ac3cbec4871c6c1d595cbb0",
"score": "0.5175088",
"text": "def description\n # if range is 0 or the option isn't used for descriptions\n if BlizzABS::Items.range(@id) == 0 ||\n BlizzABS::Config::ITEM_DATA_MODE.all? {|v| v != 2}\n # return normal description\n return @description\n end\n # set up result\n text = @description\n # iterate through configuration\n BlizzABS::Config::ITEM_DATA_MODE.each_index {|i|\n # if current option was set up for descriptions\n if BlizzABS::Config::ITEM_DATA_MODE[i] == 2\n # add extra information to result text\n case i\n when 0\n next if [0, 7].include?(@scope)\n text += case BlizzABS::Items.type(@id)[0]\n when 0 then [1, 3, 5].include?(@scope) ? ' (Shooter)' : ' (Thruster)'\n when 1 then [1, 3, 5].include?(@scope) ? ' (Homing)' : ' (S. Homing)'\n when 2 then [1, 3, 5].include?(@scope) ? ' (Selecter)' : ' (Shockwave)'\n when 3 then [1, 3, 5].include?(@scope) ? ' (Beam)' : ' (Fullscreen)'\n when 4 then ' (Summoner)'\n end\n when 1 then text += ' (explodes)' if BlizzABS::Items.type(@id)[1] > 0\n when 2 then text += \" R: #{[BlizzABS::Items.range(@id), 1].max}\"\n end\n end}\n # return result text\n return text\n end",
"title": ""
},
{
"docid": "326f5eee0d015b41e37c43dd36c23dc4",
"score": "0.5159074",
"text": "def allergens\n self.ingredients.select do |ingredient|\n binding.pry\n end\nend",
"title": ""
},
{
"docid": "0a7dd8342928c492b63594d23d5528ef",
"score": "0.5156729",
"text": "def order_soda(flavor, size = \"medium\", quantity = 1)\n if quantity == 1\n plural = \"soda\"\n else\n plural = \"sodas\"\n end\n puts \"#{quantity} #{size} #{flavor} #{plural}, coming right up!\"\nend",
"title": ""
},
{
"docid": "0a7dd8342928c492b63594d23d5528ef",
"score": "0.5156729",
"text": "def order_soda(flavor, size = \"medium\", quantity = 1)\n if quantity == 1\n plural = \"soda\"\n else\n plural = \"sodas\"\n end\n puts \"#{quantity} #{size} #{flavor} #{plural}, coming right up!\"\nend",
"title": ""
},
{
"docid": "cb77a271795b1a4afe5d5f2e4f5e0500",
"score": "0.5152925",
"text": "def helper\n \"Display all available options on the selected analysis module.\"\n end",
"title": ""
},
{
"docid": "bb5c7368fdfc7b41994adf7718951b64",
"score": "0.51528263",
"text": "def display\n options = [\n '********Welcome to BikeInfo********',\n '1. Add Bike',\n '2. Compare Bikes',\n '3. Change Bike Details',\n '4. List Bikes',\n '5. Find Bike with Max Milege',\n '6. Find Bike with Max Top Speed',\n '7. Quit',\n '***********************************'\n ]\n puts options.join(\"\\n\")\n puts 'Enter Your choice'\nend",
"title": ""
},
{
"docid": "6a9d0022238bbce80cd664f3ff4023a7",
"score": "0.51469433",
"text": "def option_types_presentation\n option_types.order(position: :asc).pluck(:presentation).compact.map(&:pluralize).uniq.to_sentence\n end",
"title": ""
},
{
"docid": "2075837b683fd5e269248d6d27543cf6",
"score": "0.51455253",
"text": "def price_for( quantity, opts={}, validate_options = true )\n\t\tif opts.keys.first and opts.keys.first.kind_of? String\n\t\t rawopts = raw_options_map.merge( soft_options_set_to_raw_set(opts) )\n\t\telsif opts.keys.first and opts.keys.first.kind_of? ProductOption \n\t\t rawopts = opts\n\t\t soft = HashWithIndifferentAccess.new\n\t\t opts.each_key { |key|\n\t\t this_title = key.title.downcase\n\t\t this_label = opts[key].label \n\t\t \n\t\t soft[this_title] = this_label }\n\t\t opts = soft\n\t\tend\n\t\t\n\t\traise \"Invalid options for Product\" if validate_options and not options_valid?( opts )\n\t\t@price_explanations = []\n\t\t\n\t\t@price_explanations << opts.to_yaml\n\t\toption_multiplier = 1.0\n\t\tarea = self.height * self.width\n\t\t@price_explanations << \"Area is #{area}\"\n\t\t\n\t\tink = ProductOptionValue.find(:first, :conditions => ['label = ?', opts[:ink]])\n\t\t@price_explanations << \"<b> INK POV IS NULL!!! #{opts[:ink]} </b>\" if ink.nil?\n\t\tif ink and make_ready = self.make_readies.find(:first, :conditions => \"product_option_value_id = #{ink.id}\") and make_ready.price\n\t\t cost = make_ready.price * area\n\t\t @price_explanations << \"MakeReady exists for this ink(#{opts[:ink]}): #{make_ready.price} * #{area} = #{cost}\"\n\t\telsif opts[:ink] == \"4/0\"\n\t\t cost = ( self.setup_price / 2 ) * area\n\t\t @price_explanations << \"Product Setup Price (half for one-sidedness): #{self.setup_price} / 2 * #{area} = #{cost}\"\n\t\telse\n\t\t cost = self.setup_price.to_f * area\n\t\t @price_explanations << \"Product Setup Price: #{self.setup_price} * #{area} = #{cost}\"\n\t\tend\n\t\t\n\t\tpost_markup = 0.0\n\t\t\n\t\trawopts.each_pair do |option, value|\n\t\t next if option.title.downcase == \"mailing\"\n\t\t option_cost = 0.0\n\t\t \n\t\t\tvalue = (value.first or value.find { |x| x }) if value.kind_of? Array\n\t\t\tnext if value.nil?\n\t\t\t@price_explanations << \"<b>\" + option.title + \":\" + value.label + \"</b>\"\t\t \n\t\t\t\n\t\t\tif option.setup_price and not ( value.label.downcase == \"none\" )\n\t\t\t option_cost += option.setup_price \n\t\t\t @price_explanations << \"Option Setup Price: #{option.setup_price}\"\n end\n \n\t\t\tcase value.kind\n\t\t\twhen \"Fixed\"\n\t\t\t if value.price_per_sqin and value.price_per_sqin > 0\n\t\t\t option_cost += (value.price_per_sqin.to_f * area.to_f)\n\t\t\t @price_explanations << \"Option One-Time Area Charge: #{value.price_per_sqin} * #{area}sqin: #{option_cost}\"\n\t\t\t end\n\t\t\t if value.price_per_unit and value.price_per_unit > 0\n\t\t\t option_cost += value.price_per_unit \n\t\t\t @price_explanations << \"Option One-Time Charge: #{value.price_per_unit}\"\n\t\t\t end\n\t\t\twhen \"Quantity\"\n\t\t\t option_cost += value.price_per_unit.to_f * (quantity.to_f / value.unit_quantity.to_f )\n\t\t\t @price_explanations << \"Option Per-Qty Charge: #{value.price_per_unit} * #{quantity} / #{value.unit_quantity}:\" +\n\t\t\t (value.price_per_unit.to_f * (quantity.to_f / value.unit_quantity.to_f )).to_s\n\t\t\twhen \"Area\"\n\t\t\t option_cost += (value.price_per_sqin.to_f * area.to_f) * ( quantity.to_f / value.unit_quantity.to_f )\n\t\t\t @price_explanations << \"Option Area*Qty Charge: #{value.price_per_sqin} * #{area} * #{quantity} / #{value.unit_quantity}: \" +\n\t\t\t ((value.price_per_sqin.to_f * area.to_f) * ( quantity.to_f / value.unit_quantity.to_f )).to_s\n\t\t\twhen \"Multiplier\"\n\t\t\t option_multiplier = option_multiplier.to_f * value.price_per_unit.to_f\n\t\t\t @price_explanations << \"Multiplier: #{value.price_per_unit}, Total Multiplier Now: \" + \n\t\t\t (option_multiplier.to_f * value.price_per_unit.to_f).to_s\n\t\t\tend\n\t\t \n\t\t @price_explanations << \"This Option Cost: \" + option_cost.to_s\n\t\t if value.post_markup\n\t\t post_markup += option_cost\n\t\t else\n\t\t cost += option_cost\n\t\t end\n\t\tend\n \n @price_explanations << \"Total Cost: \" + cost.to_s\n unrounded_cost = (( cost * markup( quantity ) ) + cost )\n @price_explanations << \"Cost After Markup: \" + unrounded_cost.to_s\n\t\tmultiplied_cost = unrounded_cost.to_f * option_multiplier.to_f\n\t\t@price_explanations << \"Cost After Multiplier: \" + multiplied_cost.to_s\n\t\tpost_markup_cost = multiplied_cost + post_markup\n\t\t@price_explanations << \"Cost After Post-Markup Options: \" + post_markup_cost.to_s\n\t\t## trickyness to round up to the next $5 step\t\n\t\t\n\t\tif post_markup_cost.divmod(5)[1] == 0\n\t\t rounded_cost = post_markup_cost\n\t\telse\n\t\t rounded_cost = (post_markup_cost.divmod( 5 )[0] + 1 ) * 5\n\t\tend\n\t\t@price_explanations << \"Rounded Cost: \" + rounded_cost.to_s\n\t\treturn rounded_cost\n\tend",
"title": ""
},
{
"docid": "fb8688ade422905643b28534a096eb3b",
"score": "0.51403993",
"text": "def realness_choices\n\t\t[\"Actual Place\", \"Fictitious Place\"]\n\tend",
"title": ""
},
{
"docid": "f42ea47257e5e966423fb97e65c735a1",
"score": "0.5136777",
"text": "def index\n @filter = MealFilter.new(meal_filter_params)\n if params[:show_ingredients] == 'true'\n @ingredients = ingredients_by_filter\n else\n @meals = meals_by_filter\n end\n end",
"title": ""
},
{
"docid": "33ebdb3094a083858448648e096c654f",
"score": "0.51344126",
"text": "def meal_choice (ingredient_1,ingredient_2,protein = \"meat\")\n puts \"What a nutritious meal!\"\n puts \"A plate of #{protein} with #{ingredient_1} and #{ingredient_2}.\"\n return \"A plate of #{protein} with #{ingredient_1} and #{ingredient_2}.\"\nend",
"title": ""
},
{
"docid": "6043af3b5bb009a607910357704f8854",
"score": "0.5133519",
"text": "def serving_size_calc(food, total_ingredients)\n\n #number of ingredients per food type\n library = {\"cookie\" => 1, \"cake\" => 5, \"pie\" => 7}\n\n #if food is not in library, raise exception\n raise ArgumentError.new(\"#{food} is not a known food.\") if !library.include?(food)\n\n serving_size = library[food] #serving size: # ingredients per food\n leftover_ingredients = total_ingredients % serving_size\n total_servings = total_ingredients / serving_size\n pluralizer = total_servings != 1 ? \"s\" : \"\" #add one or no \"s\"es\n result_string = \"Ingredients yield #{total_servings} #{food}#{pluralizer}\"\n\n if leftover_ingredients == 0\n result_string << \".\" #if no leftovers, then end sentence with a period\n else #suggest foods(keys) whose value is <= leftover_ingredients\n suggestions = library.select{|k,v| v <= leftover_ingredients}.keys\n pluralizer = leftover_ingredients != 1 ? \"s\": \"\"\n result_string << \", with #{leftover_ingredients} leftover ingredient#{pluralizer}. Suggested baking items: #{suggestions.join(\", \").chomp(\", \")}.\"\n end\nend",
"title": ""
},
{
"docid": "9d1bf0039bdd1c681255793048d0ec3b",
"score": "0.5132731",
"text": "def meal_choice (meal_choice=\"meat\")\n meal_choice\nend",
"title": ""
},
{
"docid": "18eebe832ffefe45c34f6b05b30c167c",
"score": "0.51182324",
"text": "def recipe_ingredients\n return $perfect_10_recipe\nend",
"title": ""
},
{
"docid": "bbe8b124366d2c2b732552942102f201",
"score": "0.51163936",
"text": "def show_pasta_ingredients\n @name.each do |pastaType|\n puts \"- #{pastaType.ingredients}\"\n end\n end",
"title": ""
},
{
"docid": "9755359741472beeeb4e040d82894b45",
"score": "0.51124513",
"text": "def description\n if cream == 'yes'\n \"You have a #{size} #{roast} roast coffee with cream and #{sugar} sugar. Your total is #{price}\"\n else\n \"You have a #{size} #{roast} roast coffee with #{cream} cream and #{sugar} sugar. Your total is #{price}.\"\n end\n end",
"title": ""
},
{
"docid": "5e7460359e1b9c5d318b080ee2404667",
"score": "0.5108187",
"text": "def meal_choice (food = meat)\n puts \"#{food}\"\nend",
"title": ""
},
{
"docid": "acdcbd0fea69bd815d1cd418fdbcbb60",
"score": "0.5106817",
"text": "def order1\n system \"clear\"\n order_graphic\n $prompt.select(\"Please choose from one of the following drink options:\\n\") do |menu|\n Drink.menu_items.each{|drink_instance| menu.choice name_price_ingredient(drink_instance), -> { order(drink_instance)}}\n menu.choice \"Create your own\\n\", -> { customize }\n menu.choice \"Go Back\", -> { welcome }\n end \nend",
"title": ""
},
{
"docid": "e5e915ab7d0e33f70660cb514aba2431",
"score": "0.5105167",
"text": "def ingredients_to_string\n ingredients.to_sentence\n end",
"title": ""
},
{
"docid": "b854e449ae4094114a3291a7e3c901ea",
"score": "0.5100096",
"text": "def list_options\n puts <<-DOC.gsub /^\\s*/, ''\n\n 1. Local AQI Information\n 2. Top 5 Nationwide AQI Rankings\n 3. General AQI Information\n 4. View Previously Searched Cities\n\n DOC\n end",
"title": ""
},
{
"docid": "766610610c3e383338c4fe155cc00d96",
"score": "0.5099602",
"text": "def add_recipe_options\n prompt_options = [\n {name: \"Add ingredient\", value: 1 },\n {name: \"Finish and save to Recipe Book\", value: 2}\n ]\n choice = $prompt.select(\"What would you like to do?\", prompt_options)\nend",
"title": ""
},
{
"docid": "88c071882b4ebe1d8692a8bd05138ab5",
"score": "0.50938654",
"text": "def display_options(state = $state)\n puts \"[\"\n options = fetch_options state\n options.each_index do |i|\n puts \" [#{i}] #{options[i]}\"\n end\n puts \"]\"\nend",
"title": ""
},
{
"docid": "840ca79715a799cb14f43490e7e00e1f",
"score": "0.5093238",
"text": "def show_choices(choices, cancel_option)\n @choices = choices\n add_command(102, [choices, cancel_option])\n end",
"title": ""
},
{
"docid": "ccf12650bf10978c9dfec016c4f33dd8",
"score": "0.5093009",
"text": "def dishes_display\n @dish_chosen = @prompt.select(\"DISHES\") do |menu|\n Dish.all.each do |dish|\n menu.choice dish.name \n end #when chosen assign to the customer\n end\n size_choice\n confirm_dish\nend",
"title": ""
},
{
"docid": "028f147d4e5a62a3bbfcc6019b6d8d8c",
"score": "0.50902647",
"text": "def ingredient\n self.ingredient_O\n end",
"title": ""
},
{
"docid": "a570bb573d72148f9e4627bcc91b8ff1",
"score": "0.5089157",
"text": "def options_text\n options\n end",
"title": ""
},
{
"docid": "c6bcb376d58742355728bdba9edb0d0b",
"score": "0.508836",
"text": "def order2\n system \"clear\"\n $prompt.select(\"Please choose from one of the following drink options:\\n\") do |menu|\n order_graphic\n Drink.menu_items.each{|drink_instance| menu.choice name_price_ingredient(drink_instance), -> { order(drink_instance)}}\n all_favorites.select{|favorite_instance| favorite_instance.drink.is_menu_item? == false}.each{|favorite_instance| menu.choice name_price_ingredient(favorite_instance.drink), -> { order(favorite_instance.drink)}}\n menu.choice \"Create your own\\n\", -> { customize }\n menu.choice \"Go Back\", -> { welcome }\n end \nend",
"title": ""
},
{
"docid": "bf9f31d4814cb91644441ec879b893b5",
"score": "0.5086132",
"text": "def ingredients(mac_and_cheese_recipe)\n mac_and_cheese_recipe.each {|key,value| puts \"#{key}\\n\"}\nend",
"title": ""
},
{
"docid": "db96baf5ade1988164caad1ea5892a19",
"score": "0.5081989",
"text": "def details\n \"sugar: #{sugar} and flour: #{flour}\"\n end",
"title": ""
},
{
"docid": "286e945d0ee88fbd1d729868808466a0",
"score": "0.50581473",
"text": "def display_string\n long_str = \"\"\n @options.each_with_index do |option, index|\n if option == @default_option\n long_str << option.as_default\n else\n long_str << option.as_non_default\n end\n long_str << \"/\" if index < (@options.size-1)\n end\n \"#{@prompt} [#{long_str}] \"\n end",
"title": ""
},
{
"docid": "649e48964f1979416d0780390bff9aa0",
"score": "0.5049915",
"text": "def ingredient_name\n @ingredient_name\n end",
"title": ""
},
{
"docid": "f70b5696f50c8c51f17902ac0c61827d",
"score": "0.5048787",
"text": "def format_output(remaining_options)\n remaining_options.each do |category, values|\n puts category.capitalize + \": \" + values.to_a.join(\", \")\n end\n end",
"title": ""
},
{
"docid": "7b739530391449b27eabe4666abd4856",
"score": "0.5047782",
"text": "def recipe_ingredients(perfect_10_recipe)\n perfect_10_recipe\n\nend",
"title": ""
},
{
"docid": "ee69d5530e3efe02ca761bb455854762",
"score": "0.50380033",
"text": "def meal_choice(option= \"vegan\", food = \"meat\")\n print \"This is my favorite #{food}\"\n return #{option}\nend",
"title": ""
},
{
"docid": "1b8260b02eb3ca05832f2c344d934a06",
"score": "0.50324064",
"text": "def cookable_recipes(recipes, stock)\n recipes.select do |name, ingredients|\n enough_ingredients?(ingredients, stock)\n end.keys.sort\nend",
"title": ""
},
{
"docid": "119f9bb02d4832bf67a33c7b90775f4e",
"score": "0.50308967",
"text": "def approve_of(food)\n is_pizza?(food) ? puts(\"#{pizza}\") : puts(\"#{burger}\")\n end",
"title": ""
},
{
"docid": "05f4770b085b8f23d8c8701211c814bd",
"score": "0.5030826",
"text": "def print_options\n return unless self[:verbose]\n\n Helper.log.info \"Using these options:\"\n # For ruby 2.5.0+\n censored_values.each do |key, value|\n print(key.inspect, \"=>\", value.inspect)\n puts \"\"\n end\n puts \"\"\n end",
"title": ""
},
{
"docid": "7827b4b70db12efc8d8d06a237a5c603",
"score": "0.50296265",
"text": "def to_s\n different_ingredients = Hash.new(0)\n ingredients.each do |ingredient|\n different_ingredients[ingredient] += 1\n end\n out = \"#{name} #{get_calories}\\n\"\n different_ingredients.each do |ingredient, times|\n if times > 1\n out += \" (#{times}) #{ingredient.to_s}\"\n else\n out += \" #{ingredient}\"\n end\n end\n out\n end",
"title": ""
},
{
"docid": "76186e5bc925e46c497ec1c0f0cce873",
"score": "0.5025631",
"text": "def ingredient_name\n ingredient && ingredient.name\n end",
"title": ""
},
{
"docid": "ddb58d3d78b51c95030313dd40322dde",
"score": "0.5025167",
"text": "def sandwich(ingredients)\n puts \"#{ingredients['bread']} bread\"\n puts \"#{ingredients['cheese']} cheese\"\n puts ingredients['protein']\n puts ingredients['condiment']\n puts \"#{ingredients['bread']} bread\"\nend",
"title": ""
},
{
"docid": "940557710c375d5d04fd72489295691f",
"score": "0.50238544",
"text": "def display_individual_ingredients\n ingredients = self.ingredients.map{|ingredient| ingredient.name}\n ingredients.uniq\n end",
"title": ""
},
{
"docid": "7fca77c801a76914427ec5b607efc8a1",
"score": "0.50178957",
"text": "def meal_choice(meal_choice = \"meat\")\n\tmeal_choice\nend",
"title": ""
},
{
"docid": "725e5e299bdfefc03ecc801576295be4",
"score": "0.50085545",
"text": "def prettyPrint\n\t\tputs \"'#{@name}' : #{@ingredient.length} ingredients\"\n\n\t\tfor i in 0..@ingredient.length-1\n\t\t\tputs \" #{@ingredient[i].amount} #{@ingredient[i].units} #{@ingredient[i].name}\"\n\t\tend\n\n\t\tif @garnish\n\t\t\tputs \" Garnish with #{@garnish}\"\n\t\tend\n\tend",
"title": ""
}
] |
6435ef7cc14c21e1176d338814670a10
|
Introducimos los atributos al bloque Get y Set para cada atributo de la Bibilioteca Bib
|
[
{
"docid": "c25c727f7b0881397f01384f23902e32",
"score": "0.0",
"text": "def authors(*args)\n\t\t args.length == 1 ? self.autores = args[0].split(\", \") : self.autores \n\t\t end",
"title": ""
}
] |
[
{
"docid": "e4922bd182779dd1fc0ffa1438f1d4b3",
"score": "0.5909936",
"text": "def set_atributo\n @atributo = Atributo.find(params[:id])\n end",
"title": ""
},
{
"docid": "ee204e15f49529dad43afcfb274a7b0d",
"score": "0.5662042",
"text": "def inicializar_atributos\n self.class.atributos_persistibles_totales.each do |atributo|\n if atributo.is_a?(AtributoMultiple)\n send(pasar_a_setter(atributo.nombre), [])\n send(pasar_a_setter(atributo.nombre), [atributo.default]) unless atributo.default.nil?\n else\n send(pasar_a_setter(atributo.nombre), atributo.default) unless atributo.default.nil?\n end\n end\n self\n end",
"title": ""
},
{
"docid": "6e2751e1c4281d9c9e1b5b245cf35f66",
"score": "0.5656359",
"text": "def set_awarded_attributes\n end",
"title": ""
},
{
"docid": "191b3c7fcadbb3854b639675eede711b",
"score": "0.565495",
"text": "def set_biblio\n @biblio = Biblio.find(params[:id])\n end",
"title": ""
},
{
"docid": "894a989a7a0d81a7e8c5bd3c252ebc4b",
"score": "0.56437707",
"text": "def itens_attributes=(attributes)\n\t\t end",
"title": ""
},
{
"docid": "a557c4fc0b915b90e392147523b4fc89",
"score": "0.56268233",
"text": "def resource_params\n params.require(\"biblio_#{type.demodulize.underscore}\".to_sym).permit(\n :year, \n :month, \n :title,\n :publisher_id,\n :edition,\n :serie,\n :howpublished,\n :journal,\n :book_id,\n :collection_id,\n :proceeding_id,\n :volume,\n :number,\n :subtype,\n :pages, \n :chapter,\n :organization_id,\n :institution_id,\n :school_id,\n :print_isbn,\n :note, \n :key, \n :url, \n :doi, \n :abstract, \n :tag_list,\n :author_ids => [],\n :editor_ids => [],\n :place_ids => [],\n referencations_attributes: [:id, :repository_id, :creator_id, :_destroy],\n referenceables_attributes: [:id, :referenceable_gid, :referencor_id, :_destroy]\n )\n\n end",
"title": ""
},
{
"docid": "a45be499180778707ecaa43aa340d520",
"score": "0.5612549",
"text": "def set_biblioteca\n @nueva_biblioteca = Biblioteca.find(params[:id])\n end",
"title": ""
},
{
"docid": "e71fad5f50cfeec02773142ddfb5fad8",
"score": "0.55511284",
"text": "def set_attrs(atrs)\n atrs.each { |key, value| send(:\"#{key}=\", value) }\n end",
"title": ""
},
{
"docid": "6bc4097efe2f9912928c630cf533a197",
"score": "0.55467844",
"text": "def set_attri\r\n @attri = Attri.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "33bd336a496e99f35510ae2ce07fa677",
"score": "0.55397815",
"text": "def set_biblio_set\n @biblio_set = BiblioSet.find(params[:id])\n end",
"title": ""
},
{
"docid": "59b86c5870ea674d2dd60a89a63991ce",
"score": "0.5534337",
"text": "def attributes(*) end",
"title": ""
},
{
"docid": "26f3f7e14cc64786e7c7a1e99b40072f",
"score": "0.55083513",
"text": "def set(set_attributes); end",
"title": ""
},
{
"docid": "83104da2f0049325d482a8dfd4807963",
"score": "0.54924446",
"text": "def setBKattr(attrib)\n @entry_field.setBKattr(attrib)\n @scroll_field.setBKattr(attrib)\n end",
"title": ""
},
{
"docid": "68a1c38281aa3a39001e9fe31bedc5fd",
"score": "0.54657304",
"text": "def set_biblioentry\n @biblioentry = Biblioentry.find(params[:id])\n end",
"title": ""
},
{
"docid": "3cf1adc2cfcc15dc36c2a2a7d4289787",
"score": "0.5460655",
"text": "def attributes=(data)\n end",
"title": ""
},
{
"docid": "cafdf9b087f86c0ca3fcd96c99ca93c0",
"score": "0.5439073",
"text": "def set_bibliographic\n @bibliographic = Bibliographic.find(params[:id])\n end",
"title": ""
},
{
"docid": "8ad795c0179a872e53c6c324e845a9fa",
"score": "0.5434716",
"text": "def update_convenience_accessors\n return if !soa? || self.content.blank?\n\n soa_fields = self.content.split(/\\s+/)\n raise Exception.new(\"Invalid SOA Record content attribute: #{self.content}\") unless soa_fields.size == SOA::SOA_FIELDS.size\n\n soa_fields.each_with_index do |field_value, index|\n field_name = SOA::SOA_FIELDS[index]\n field_value = field_value.try(:to_i) unless field_name == 'primary_ns' || field_name == 'contact'\n instance_variable_set(\"@#{field_name}\", field_value)\n instance_variable_set(\"@#{field_name}_was\", field_value)\n end\n end",
"title": ""
},
{
"docid": "2b591dbc0f404d5e5474da3e3cd8232f",
"score": "0.5431759",
"text": "def update_convenience_accessors\n return unless self.record_type == 'SOA'\n\n # Setup our convenience values\n @primary_ns, @contact, @serial, @refresh, @retry, @expire, @minimum =\n self[:content].split(/\\s+/) unless self[:content].blank?\n %w{ serial refresh retry expire minimum }.each do |i|\n value = instance_variable_get(\"@#{i}\")\n value = value.to_i unless value.nil?\n send(\"#{i}=\", value )\n end\n end",
"title": ""
},
{
"docid": "e6413c2fec23645498448a660e8335d3",
"score": "0.54299754",
"text": "def set_attri\n @attri = Attri.find(params[:id])\n end",
"title": ""
},
{
"docid": "9545cca672fc8c0137343d2d66fa617e",
"score": "0.53944916",
"text": "def preenchimento \n nome.set 'tomas'\n lastname.set 'rocha'\n email.set 'tomasrocha@gmail.com'\n end",
"title": ""
},
{
"docid": "33c858a74afa838b234375872e164b94",
"score": "0.5392378",
"text": "def set_attr_accessors\n @format.each do |key, _|\n define_method(key) {@data[key]}\n define_method(\"%s=\" % key) {|val| @data[key] = val}\n end\n end",
"title": ""
},
{
"docid": "88e11bdcf4ff3427fcb8cbf09a755040",
"score": "0.5368504",
"text": "def set_atribuicao\n @atribuicao = Atribuicao.find(params[:id])\n end",
"title": ""
},
{
"docid": "5b281e34ad77161192f1dba8db0ad2cf",
"score": "0.53675455",
"text": "def set_db_attrs_from_attrs()\n @cur_db_attrs = self.attributes()\n end",
"title": ""
},
{
"docid": "9d679c80e366a81a4836546f29e0ea4d",
"score": "0.53568065",
"text": "def set_biblioteca_livro\n @biblioteca_livro = Biblioteca::Livro.find(params[:id])\n end",
"title": ""
},
{
"docid": "7a37c4788f6a173db3dc9a9c6f39645a",
"score": "0.5352427",
"text": "def attributes=(p0) end",
"title": ""
},
{
"docid": "3794cba5eef57e41e75b3f365120a3cb",
"score": "0.53432924",
"text": "def set_campos\n\t\t@bhaskara.set_a\n\t\t@bhaskara.set_b\n\t\t@bhaskara.set_c\n\tend",
"title": ""
},
{
"docid": "3389a7f3c08ef6d9f126dd2d473c1139",
"score": "0.5336192",
"text": "def establish_attributes\n @uonObject.getConnections.each { |c|\n if (item = c.getItem( UONPrimitive)) != nil then\n self.addAttribute RAttribute.new( c.getText, item.getText) #( name, type) \n end\n }\n end",
"title": ""
},
{
"docid": "23aa99cca38178bb894f323238914143",
"score": "0.5329249",
"text": "def set_my_attributes\n get_my_mentor_id\n get_my_enrollment_id\n end",
"title": ""
},
{
"docid": "90b2703ce9ccb96f3826f6494b8a6922",
"score": "0.53179413",
"text": "def attributes()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "90b2703ce9ccb96f3826f6494b8a6922",
"score": "0.53179413",
"text": "def attributes()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "3ee8498edcdd7dd0f2e1d7c15fe220a6",
"score": "0.53116465",
"text": "def set_owner_attributes(record); end",
"title": ""
},
{
"docid": "b749f4c8d48efcea5046fd465ee81619",
"score": "0.5307861",
"text": "def set_a_attributes\n Kernel.raise NotImplementedError\n end",
"title": ""
},
{
"docid": "1828e1d373c2b572293825474c2d47ad",
"score": "0.5305644",
"text": "def attributes!; end",
"title": ""
},
{
"docid": "c0275fda6513fee068b643b0e7d79da8",
"score": "0.53055954",
"text": "def []=(indice, atributo)\n\n # Verificamos si es un indice de acceso a arreglo\n indice = self[indice.direccion_de_indice_de_arreglo] if indice.class == String and indice.acceso_arreglo?\n\n lim_inf = 100 # Limite inferior de las direcciones de Clase\n lim_sup = 149 # Limite superior de las direcciones de Clase\n case indice\n when lim_inf..lim_sup # Si el indice es una direccion de Clase\n self[50][indice - lim_inf] = atributo # Guardamos el atributo en el Objeto\n else\n super(indice, atributo) # Si no es una dir de clase, asigna el valor del registro normal\n end\n end",
"title": ""
},
{
"docid": "a0e1c4443217e6b3bae3a2f51bcef0b3",
"score": "0.53018224",
"text": "def attributes\n FFWD.merge_hashes fixed_attr, external_attr\n end",
"title": ""
},
{
"docid": "e81187b34b6d4640a80dd8de7830d320",
"score": "0.52973896",
"text": "def _sets\n if changed? && !new_record?\n setters\n else\n embedded_one? && new_record? ? { _path => raw_attributes } : {}\n end\n end",
"title": ""
},
{
"docid": "c8898b47bd0e4a9e899236c20ca10664",
"score": "0.5295629",
"text": "def attributes_in_database; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.527524",
"text": "def attributes; end",
"title": ""
}
] |
98670975f7a51c5d5063f72310e696d8
|
dias de retraso segun progreso actual
|
[
{
"docid": "84d7eab816bc29d76d1de66bcf6aeebf",
"score": "0.0",
"text": "def delayed_or_advanced_days(in_resources)\n\t\t# El indicador que posee un avance real más cercano al actual\n\t\taux_progress = real_progress_function(Date.today, in_resources)\n\n\t\tif !in_resources\n\t\t\ti = indicators.min_by { |x| (x.expected_days_progress - aux_progress).abs }\n\t\telse\n\t\t\ti = indicators.min_by { |x| (x.expected_resources_progress - aux_progress).abs }\n\t\tend\n\t\t# devolvemos la diferencia en dias de la fecha del indicador con la de hoy\n\t\tif i\n\t\t\treturn (i.date.to_date - Date.today).to_i\n\t\telse\n\t\t\treturn 0\n\t\tend\n\tend",
"title": ""
}
] |
[
{
"docid": "ae0599c8d64cc4c7702b1034d37bb021",
"score": "0.65476745",
"text": "def extraer_detras\n if(@tam == 0)\n puts \"La Lista está vacía\"\n else\n aux = @cola\n @cola = @cola[:prev]\n @cola[:Next_] = nil\n @tam = @tam - 1\n return aux[:value]\n end\n end",
"title": ""
},
{
"docid": "da9a83bae386fb5a22dae2bf4fafc39a",
"score": "0.650458",
"text": "def devolver_azucar \n\t\treturn @azucares\n\tend",
"title": ""
},
{
"docid": "22bb2a4bdcadf602439e6f38b7ba62dc",
"score": "0.64214075",
"text": "def terrenos\r\n terreno = 0\r\n @lista_alimentos.each do |i|\r\n terreno += i.terreno\r\n end\r\n return terreno\r\n end",
"title": ""
},
{
"docid": "bf0cd9ff8de1f47a98c329423b9c8f22",
"score": "0.63660026",
"text": "def lipidos\n\t\treturn @lipidos*@cantidad\n\tend",
"title": ""
},
{
"docid": "f10102e721130135047ffe775f779195",
"score": "0.6309909",
"text": "def reune_dados\n crs = []\n @dados_aluno.each do |k, v|\n crs << (Aluno.new(k, v).retorna_dados)\n end\n cursos = []\n @dados_cursos_matricula.each do |k, v|\n #usei o flatten e o uniq para remover as matriculas repetidas para que cada CR fosse unico\n cursos << (Curso.new(k, v.flatten.uniq).retorna_dados)\n end\n formata_dados(crs, cursos)\n end",
"title": ""
},
{
"docid": "b1773bd34f7fbe476fbc652201e2b659",
"score": "0.6224403",
"text": "def posti_disponibili\n self.vehicle.posti - self.n_passeggeri\n end",
"title": ""
},
{
"docid": "c4227be8e5e059e5331c03e0d76d838d",
"score": "0.6198362",
"text": "def actualiza_atributos_diariodets \n sum_debe = 0\n sum_haber = 0\n sum_debe_sec = 0\n sum_haber_sec = 0\n item_max = 0\n idcuenta_ajuste_dif_cambio = 709 #Catalogo.find_by(id: Catalogo::ID_CTA_AJUSTE_DIF_CAMBIO)\n\n set_datos_segun_conf\n\n if self.origenasiento_id == 1 # si es manual actualiza columnas debe, haber...\n diariodets.each do |child| \n if child.ajuste.blank? or child.ajuste == '0'\n cod_moneda_trasac = Moneda.find_by(id:child.moneda_id).codigo \n child.tcori = self.tc\n child.ajuste = '0' \n if cod_moneda_trasac == Moneda::CODIGO_SYS[:nal]\n child.debe = (child.debeori).round(2) \n child.haber = (child.haberori).round(2) \n child.debesec = (child.debeori/Conta::TCV_CONST).round(2) \n child.habersec = (child.haberori/Conta::TCV_CONST).round(2) \n child.tcsec = child.tcori\n else\n if cod_moneda_trasac == Moneda::CODIGO_SYS[:sec]\n tc_transac = 0\n if Conta::TCV_CONST != child.tcori\n tc_transac = child.tcori\n else\n tc_transac = Conta::TCV_CONST\n end\n child.tcsec = tc_transac\n\n child.debe = (child.debeori*tc_transac).round(2) \n child.haber = (child.haberori*tc_transac).round(2) \n\n child.debesec = (child.debeori).round(2) \n child.habersec = (child.haberori).round(2) \n end #cod_moneda_trasac = Moneda::CODIGO_SYS[:sec]\n end #cod_moneda_trasac = Moneda::CODIGO_SYS[:nal]\n if item_max < child.item\n item_max = child.item\n end \n sum_debe = sum_debe + child.debe\n sum_haber = sum_haber + child.haber\n sum_debe_sec = sum_debe_sec + child.debesec\n sum_haber_sec = sum_haber_sec + child.habersec\n end #if child.ajuste.blank? or child.ajuste == '0'\n end #end diariodets.each do |child|\n\n ###\n ###cuadre global\n if (sum_debe != sum_haber) or (sum_debe_sec != sum_haber_sec)\n ajuste = 0\n ajuste_sec = 0 \n ajuste = sum_debe - sum_haber\n ajuste_sec = sum_debe_sec - sum_haber_sec \n if ajuste != 0 \n if ajuste > 0\n item_max = item_max + 1\n diariodets.build(:item => item_max, :catalogo_id => idcuenta_ajuste_dif_cambio, :tlaux1 => \"0\", :tlaux2 => \"0\", :codtlaux1 => \"\", :codtlaux2 => \"\", :debe => 0, :haber => ajuste, :debesec => 0, :habersec => 0, :debeori => 0, :haberori => ajuste, :tcori => self.tc, :glosa => 'AJUSTE AUTOMATICO POR CUADRE', :esdebito => false, :monto => ajuste, :ajuste => \"1\", :oficina_id => Oficina.id_oficina_nacional, :libauxdet_id => 0, :moneda_id => 1)\n else\n ajuste = ajuste * (-1)\n item_max = item_max + 1\n diariodets.build(:item => item_max, :catalogo_id => idcuenta_ajuste_dif_cambio, :tlaux1 => \"0\", :tlaux2 => \"0\", :codtlaux1 => \"\", :codtlaux2 => \"\", :debe => ajuste, :haber => 0, :debesec => 0, :habersec => 0, :debeori => ajuste, :haberori => 0, :tcori => self.tc, :glosa => 'AJUSTE AUTOMATICO POR CUADRE', :esdebito => false, :monto => ajuste_sec, :ajuste => \"1\", :oficina_id => Oficina.id_oficina_nacional, :libauxdet_id => 0, :moneda_id => 1)\n end#end ajuste > 0\n end# end ajuste != 0 \n if ajuste_sec != 0\n if ajuste_sec > 0\n item_max = item_max + 1\n diariodets.build(:item => item_max, :catalogo_id => idcuenta_ajuste_dif_cambio, :tlaux1 => \"0\", :tlaux2 => \"0\", :codtlaux1 => \"\", :codtlaux2 => \"\", :debe => 0, :haber =>0 , :debesec => 0, :habersec => ajuste_sec, :debeori => 0, :haberori => ajuste_sec, :tcori => self.tc, :glosa => 'AJUSTE AUTOMATICO POR CUADRE', :esdebito => false, :monto => ajuste_sec, :ajuste => \"1\", :oficina_id => Oficina.id_oficina_nacional, :libauxdet_id => 0, :moneda_id => 2)\n else\n ajuste_sec = ajuste_sec * (-1)\n item_max = item_max + 1\n diariodets.build(:item => item_max, :catalogo_id => idcuenta_ajuste_dif_cambio, :tlaux1 => \"0\", :tlaux2 => \"0\", :codtlaux1 => \"\", :codtlaux2 => \"\", :debe => 0, :haber => 0, :debesec => ajuste_sec, :habersec => 0, :debeori => ajuste_sec, :haberori => 0, :tcori => self.tc, :glosa => 'AJUSTE AUTOMATICO POR CUADRE', :esdebito => false, :monto => ajuste_sec, :ajuste => \"1\", :oficina_id => Oficina.id_oficina_nacional, :libauxdet_id => 0, :moneda_id => 2) \n end#end ajuste_sec > 0\n end# end ajuste_sec != 0 \n end #(sum_debe != sum_haber) or (sum_debe_sec != sum_haber_sec)\n end#if self.tipocomprobante_id != 5 # si es automatico no aplica lo siguiente \n end",
"title": ""
},
{
"docid": "fc6cca8515c061e85300e136a7c89ff8",
"score": "0.61982095",
"text": "def simulacion\n @ordenes = Orden.where(:estado => \"Recolectada\")\n end",
"title": ""
},
{
"docid": "aa4d06bf010118f966e91626eee666f6",
"score": "0.61423385",
"text": "def terreno\n\t\treturn @terreno*@cantidad\n\tend",
"title": ""
},
{
"docid": "1395d7de1c3c35e5490a13304675f9c6",
"score": "0.6129099",
"text": "def carbohidratos\n\t\treturn @carbohidratos*@cantidad\n\tend",
"title": ""
},
{
"docid": "0570c713d15e3c2c3c08b565e09a689e",
"score": "0.6127124",
"text": "def get_usoterreno\n aux = 0.0\n @contenido.each do |alimento|\n aux += alimento.ground\n end\n @usoterreno = aux\n end",
"title": ""
},
{
"docid": "b5372528b3f0196104272909376bd1aa",
"score": "0.61029273",
"text": "def mostra_tudo\n apius.mostra_resumo\n apide.mostra_resumo\n apifr.mostra_resumo\n apimt.mostra_resumo\n apies.mostra_resumo\n apigm.mostra_resumo\n apibc.mostra_resumo\n end",
"title": ""
},
{
"docid": "76620b5d21d0788aa12d1b3986630a4c",
"score": "0.6076539",
"text": "def desplegarProceso\n\t\tputs \"id=#{@id} cantBytes=#{@cantBytes} cantPaginas=#{@cantPaginas}\"\n\t\tputs \"marcosRealAsig=#{@marcosRealAsig} marcosSwapAsig=#{@marcosSwapAsig}\"\n\tend",
"title": ""
},
{
"docid": "120dec4f0d34f70f37611a4483815a88",
"score": "0.6071802",
"text": "def uno_mas\n\t\t@edad += 1\n\t\tif @edad < EDAD_MAXIMA\n\t\t\t@altura += @inc_alt\n\t\t\t@contador += prod_nar if @edad >= @ini_fru\n\t\telse\n\t\t\tmuere\n\t\tend\n\t\t@edad\n\tend",
"title": ""
},
{
"docid": "233e964eb22c044c8135689d2d741b16",
"score": "0.6069089",
"text": "def buscar_cruces_pendientes\n cruces = Marca.all(:select => \"id\", :conditions => [\n \"marcas.importacion_id = ? AND marcas.propia = ? AND marcas.tipo_signo_id NOT IN (?)\", \n self.id, false, TipoSigno.descartadas_cruce\n ]).size\n\n cruces - self.consultas.size\n end",
"title": ""
},
{
"docid": "26561ec9f7bbd8024b2dc5799bbce755",
"score": "0.60612756",
"text": "def hidratos_carbono\r\n hc = 0\r\n @lista_alimentos.each do |i|\r\n hc += i.carbohidratos\r\n end\r\n return hc\r\n end",
"title": ""
},
{
"docid": "86ddcc963fc820e6d7b3bd0fdc44ab6a",
"score": "0.6026938",
"text": "def titulares_serial\n Representante.find(self.titular_ids_serial).map(&:nombre)\n end",
"title": ""
},
{
"docid": "735440f95a0954b73bd6f3078da829c5",
"score": "0.60196817",
"text": "def hidratos \n\t\t@hidratos = @azucares + @polialcoles + @almidon\n\t\treturn @hidratos\n\tend",
"title": ""
},
{
"docid": "c05368d33dfa4ad05a60c40223d59868",
"score": "0.6016585",
"text": "def ValorRetirado(billetes_retiro,valor_solicitado , tipo_cuenta)\n \tsalida = []\n \tsum = 0\n billetes_retiro.each { |a| sum+=a }\n \n\t puts \"total de esta\"\n\t puts sum == valor_solicitado.to_i\n retiro = Atm.new\n retiro.fecha_retiro = Time.now.strftime(\"%Y-%m-%d %H:%M:%S %Z\")\n retiro.valor_retiro = sum\n retiro.save\n if sum == valor_solicitado.to_i\n \tsalida = sum # Si el valor es exacto lo retorna\n else\t\n #Buscamos la diferencia de la cantidad\t\n valor_sobra = sum - valor_solicitado.to_i\n puts valor_sobra\n #Buscamos si un solo billete esta dando la diferencia\n if billetes_retiro.include?(valor_sobra)\n nuevo_array = billetes_retiro.delete(20)\n nuevo_array.each { |a| sum+=a } #relizamos la suma de nuevo\n salida = [nuevo_array, sum] # retornamos array con nuevos valores\n \t else\n \t \tsalida = sum\n end \n end \t\n\n end",
"title": ""
},
{
"docid": "d2a3e76dace1d20847c7305d0a07c365",
"score": "0.59924054",
"text": "def calculo \n self.minutos_reales = 5 * 480 #cantidad de OPERARIOS * Jornada de Trabajo(Turnos)\n self.costo_minuto = 89 #Costo Real por minuto\n self.otros_costos = 540 * 89 #Tiempo Total(Minutos) * Costo Real por Minutos\n self.costo_mano_obra = 420 * 5 * 89 # Jornada Minutos * Cantidad Operarios * Costo Real por minutos \n self.manoObraPlaneada = 650.000 * 5 # Salario Total * Cantidad de operarios \n end",
"title": ""
},
{
"docid": "d71cd4b2f191d13ccd21848b41e508b8",
"score": "0.595116",
"text": "def calcula_tramos(proyecto_id)\n proyecto = Proyecto.find(params[:proyecto_id].to_i) \n dretmax = proyecto.dretmax\n vanomax = proyecto.vanomax\n pant = nil\n tant = nil\n \n Tramo.where(:proyecto_id => proyecto_id).each {|t|\n t.reltramovanos.destroy_all\n if (t.dimgeom!=nil )\n t.dimgeom.destroy\n end \n t.destroy\n } \n Vano.where(:proyecto_id => proyecto_id).destroy_all\n \n \n puntos = Punto.where(:proyecto_id => proyecto_id).order(:secuencia)\n n = 0\n m = puntos.count-1\n \n puntos.each {|p|\n if (n==0)\n tramo = Tramo.new\n tramo.ttramo_id = 1 #arranque\n tramo.cantidad = 1\n tramo.angulo = 0\n tramo.hlibre = proyecto.hlibre\n tramo.secuencia = Tramo.where(:proyecto_id =>proyecto_id).maximum(:secuencia).to_i+10\n tramo.nombre = \"Arranque en \" + p.punto\n tramo.proyecto_id = proyecto_id\n tramo.save\n tant = tramo\n \n elsif (n<m) #desvios intermedios\n vano = Vano.new\n vano.nombre = \"Vanos entre \" + pant.punto + ' y ' + p.punto\n if (p.distancia < vanomax)\n vano.vano = p.distancia\n else\n vano.vano = p.distancia / (( p.distancia/vanomax).to_i + 1 )\n end \n vano.proyecto_id = proyecto_id\n vano.cond_e_id = proyecto.cond_e_id\n vano.cond_g_id = proyecto.cond_g_id\n vano.save\n vano.calcvano\n vant = vano\n \n if (p.distancia > dretmax)\n tramo = Tramo.new\n tramo.ttramo_id = 4 #retension\n tramo.cantidad = (p.distancia/dretmax).to_i\n tramo.angulo = 0\n tramo.hlibre = proyecto.hlibre\n tramo.secuencia = Tramo.where(:proyecto_id =>proyecto_id).maximum(:secuencia).to_i+10\n tramo.nombre = \"Retensiones entre \" + pant.punto + ' y ' + p.punto\n tramo.proyecto_id = proyecto_id\n tramo.save\n rel = Reltramovano.new\n rel.vano_id = vano.id\n rel.tramo_id = tramo.id\n rel.angulo = 0\n rel.save\n end\n if (p.distancia > vanomax)\n tramo = Tramo.new\n tramo.ttramo_id = 5 #alineacion\n tramo.cantidad =(p.distancia/vanomax).to_i - (p.distancia/dretmax).to_i\n tramo.angulo = 0\n tramo.hlibre = proyecto.hlibre\n tramo.secuencia = Tramo.where(:proyecto_id =>proyecto_id).maximum(:secuencia).to_i+10\n tramo.nombre = \"Alineaciones entre \" + pant.punto + ' y ' + p.punto\n tramo.proyecto_id = proyecto_id\n tramo.save\n rel = Reltramovano.new\n rel.vano_id = vano.id\n rel.tramo_id = tramo.id\n rel.angulo = 0\n rel.save\n end\n tramo = Tramo.new\n tramo.ttramo_id = 2 #desvio\n tramo.cantidad = 1\n tramo.angulo = p.angulo\n tramo.hlibre = proyecto.hlibre\n tramo.secuencia = Tramo.where(:proyecto_id =>proyecto_id).maximum(:secuencia).to_i+10\n tramo.nombre = \"Desvio de \" + p.angulo.to_i.to_s + \"° en \" + p.punto\n tramo.proyecto_id = proyecto_id\n tramo.save\n rel = Reltramovano.new\n rel.vano_id = vano.id\n rel.tramo_id = tramo.id\n rel.angulo = 0\n rel.save\n rel = Reltramovano.new\n rel.vano_id = vano.id\n rel.tramo_id = tant.id\n rel.angulo = pant.angulo\n rel.save\n tant = tramo\n \n else #terminal\n vano = Vano.new\n vano.nombre = \"Vanos entre \" + pant.punto + ' y ' + p.punto \n if (p.distancia < vanomax)\n vano.vano = p.distancia\n else\n vano.vano = p.distancia / (( p.distancia/vanomax).to_i + 1 )\n end \n vano.proyecto_id = proyecto_id\n vano.cond_e_id = proyecto.cond_e_id\n vano.cond_g_id = proyecto.cond_g_id\n vano.save\n vano.calcvano\n\n if (p.distancia > dretmax)\n tramo = Tramo.new\n tramo.ttramo_id = 4 #retension\n tramo.cantidad = (p.distancia/dretmax).to_i\n tramo.angulo = 0\n tramo.hlibre = proyecto.hlibre\n tramo.secuencia = Tramo.where(:proyecto_id =>proyecto_id).maximum(:secuencia).to_i+10\n tramo.nombre = \"Retensiones entre \" + pant.punto + ' y ' + p.punto\n tramo.proyecto_id = proyecto_id\n tramo.save\n rel = Reltramovano.new\n rel.vano_id = vano.id\n rel.tramo_id = tramo.id\n rel.angulo = 0\n rel.save\n end\n if (p.distancia > vanomax)\n tramo = Tramo.new\n tramo.ttramo_id = 5 #alineacion\n tramo.cantidad =(p.distancia/vanomax).to_i - (p.distancia/dretmax).to_i\n tramo.angulo = 0\n tramo.hlibre = proyecto.hlibre\n tramo.secuencia = Tramo.where(:proyecto_id =>proyecto_id).maximum(:secuencia).to_i+10\n tramo.nombre = \"Alineaciones entre \" + pant.punto + ' y ' + p.punto\n tramo.proyecto_id = proyecto_id\n tramo.save\n rel = Reltramovano.new\n rel.vano_id = vano.id\n rel.tramo_id = tramo.id\n rel.angulo = 0\n rel.save\n end\n tramo = Tramo.new\n tramo.ttramo_id = 3 #terminal\n tramo.cantidad = 1\n tramo.angulo = 0\n tramo.hlibre = proyecto.hlibre\n tramo.secuencia = Tramo.where(:proyecto_id =>proyecto_id).maximum(:secuencia).to_i+10\n tramo.nombre = \"Terminal en \" + p.punto\n tramo.proyecto_id = proyecto_id\n tramo.save\n rel = Reltramovano.new\n rel.vano_id = vano.id\n rel.tramo_id = tramo.id\n rel.angulo = p.angulo\n rel.save\n rel = Reltramovano.new\n rel.vano_id = vano.id\n rel.tramo_id = tant.id\n rel.angulo = pant.angulo\n rel.save\n \n end\n \n n+=1\n pant = p\n }\n \n Tramo.where(:proyecto_id=>proyecto_id).each { |t|\n t.calcabezal\n }\n end",
"title": ""
},
{
"docid": "ddc6c187d6395c4c1ff0b46cca2b778d",
"score": "0.59420633",
"text": "def rescatar\n self.estado_id = 1 #salida si lo creo, entrada/foliado si lo redirijo\n self.estado_id = 3 if self.trazas.count(:conditions => 'movimiento_id in (2,7,8)') > 0\n if self.origen.externo\n RAILS_DEFAULT_LOGGER.info \"devolviendo de origen externo #{self.origen.to_label} a #{self.documento.buzon}\"\n self.buzon_id = self.documento.buzon_id\n else\n self.buzon_id = self.origen_id\n end\n self.add_traza(current_user.id, 14, current_user.puesto.buzon_id)\n self.save!\n end",
"title": ""
},
{
"docid": "0ad9e48be11be0a62e600d4389b4b4c8",
"score": "0.59264416",
"text": "def adeudos\n sumas = suma_valores\n resp = {cuentas_con_deuda: 0} # cuenta si alguna cuenta cuenta con deuda\n EmpCuentab.monedas.each do |moneda, id_moneda|\n total_compra = sumas[moneda][:total]\n total_deuda = total_compra - com_pagos.joins(:emp_cuentab).where('emp_cuentabs.moneda = ?', id_moneda).sum(:monto)\n resp[moneda] = {\n total: total_compra,\n deuda: total_deuda}\n if total_deuda > 0\n resp[:cuentas_con_deuda] += 1\n end\n end\n\n resp\n end",
"title": ""
},
{
"docid": "3315a2b23b250221ddb0f831dcc5bda2",
"score": "0.5914444",
"text": "def revisa_deuda\n if com_compra.adeudos[:cuentas_con_deuda] == 0\n com_compra.pagado!\n else\n com_compra.pendiente!\n end\n end",
"title": ""
},
{
"docid": "48f178c3a20e1941acbddc3f6423365f",
"score": "0.5911648",
"text": "def asignaturas_peda_por(profe)\n # per = Horario.where('professor_id = ?', profe.id).joins(:asignatura).where('lectiva=true')\n per = Horario.where('professor_id = ?', profe.id).joins(:asignatura)\n .where('asignaturas.lectiva=TRUE').order('asignaturas.orden')\n a = per.map do |h|\n [\"#{h.asignatura.name} #{h.curso.name} \", \"#{h.horas}\"]\n end\n\n end",
"title": ""
},
{
"docid": "1b32dbfb5c4033670c1e7a8aed770154",
"score": "0.5908702",
"text": "def mi_carrera\n\n\tend",
"title": ""
},
{
"docid": "6209610b1477912ede2ba3b0c5a7e8db",
"score": "0.5893184",
"text": "def qtd_tarefas_concluidas(args)\n\t\targs[:estoria_id] ||= 0\n\t\t@tarefas_concluidas = Tarefa.count(:conditions => \"estoria_id = #{args[:estoria_id]} AND andamento_id = '4'\")\n\t\treturn @tarefas_concluidas\n\tend",
"title": ""
},
{
"docid": "0e4707111f4f0ef74b7c45ed3bb0ddcd",
"score": "0.5881019",
"text": "def det\n\t\t\t@frecuencias['determinantes']\n\t\tend",
"title": ""
},
{
"docid": "13d84eccfe8b0c0c2fd7ba0b63fc946c",
"score": "0.58802676",
"text": "def cartas_por_valor\n @valores = []\n @valores = @mi_mano.group_by{|k, v| v[:valor]}.map{|k, v| [k, v.count]}\n end",
"title": ""
},
{
"docid": "422d918b2c8aedd6578a0dc9d5650d9e",
"score": "0.58578753",
"text": "def estados\n\t\tdevuelto = Array.new\n\t\t@renglones_reporte.each do |renglon|\n\t\t\tdevuelto << renglon.estado\n\t\tend\n\t\tdevuelto\n\tend",
"title": ""
},
{
"docid": "1c060c81bbf33b02bf6701ffa082d6f2",
"score": "0.58541787",
"text": "def consumo\n estado_actual - estado_anterior\n end",
"title": ""
},
{
"docid": "30fe74bc11e23418a71c5d62bee5cb1d",
"score": "0.5845063",
"text": "def horas_porasignar(asig_id,solucion)\n # horas requeridas de esta materia en este curso\n req = self.horas_por_semanas.where(:asignatura_id => asig_id).last.horasporsemana\n #horas ya agendadas en esta materia\n agend = solucion.sol_cursos.where(:curso_id => self.id, :asignatura_id => asig_id).count\n return(req-agend) \n end",
"title": ""
},
{
"docid": "1e1588fa9e29625e0532b668ced2961d",
"score": "0.5837288",
"text": "def valor_energetico\n (@proteinas * 4) + (@glucidos * 4) + (@grasas * 9)\n end",
"title": ""
},
{
"docid": "bfa7de2f02ca754524d854f26b02c9e2",
"score": "0.58331203",
"text": "def cantidad_casas_hoteles\n aux = 0\n \n @propiedades.each do |i|\n aux += i.cantidad_casas_hoteles\n end\n \n return aux\n end",
"title": ""
},
{
"docid": "aab44b24d8dc977c8dab9c6a35af085f",
"score": "0.58320546",
"text": "def relatorios\n end",
"title": ""
},
{
"docid": "52687b8fa28d08059d6f6ace18dc4190",
"score": "0.58238935",
"text": "def bc_movimiento\r\n\t\t\tself.fecha = Time.now\r\n\t\t\tif self.monto_cheque == 0 \r\n\t\t\t\tmonto_cheque = 0\r\n\t\t\t\tself.cheque_recibidos.each do |cheque|\r\n\t\t\t\t\tmonto_cheque = monto_cheque + cheque.monto\r\n\t\t\t\tend\r\n\t\t\t\tself.monto_cheque = monto_cheque \r\n\t\t\tend\r\n\t\tend",
"title": ""
},
{
"docid": "c3687bc5ecfeb814c3a22183f1007353",
"score": "0.58223087",
"text": "def cargar_resultados\n preguntas.each do |pregunta|\n pregunta.respuestas.each do |respuesta|\n # resultados = ResultadoPregunta.where(recorrido: recorrido.id, pregunta: pregunta, respuesta: respuesta).count\n sql = \"select count(1)\n from resultado_preguntas r_preg join resultado_recorridos r_rec on r_preg.resultado_recorrido_id = r_rec.id join\n recorridos recorrido on r_rec.recorrido_id = recorrido.id\n where recorrido.id = #{recorrido.id} and r_preg.pregunta_id = #{pregunta.id} and r_preg.respuesta_id = #{respuesta.id}\"\n respuesta.cantidad_elegida = ActiveRecord::Base.connection.execute(sql)[0][\"count\"].to_i\n # respuesta.cantidad_elegida = resultados\n end\n end\n end",
"title": ""
},
{
"docid": "874d91de6826343f4b288e98e856143a",
"score": "0.58033395",
"text": "def preenche_parcelas_recorrencia\n return unless recorrencia\n \n if recorrencia.tipo == 'por'\n recorrencia.data_inicial = data\n recorrencia.parcelas = recorrencia.descobre_parcelas\n else\n recorrencia.parcelas = nil\n end\n end",
"title": ""
},
{
"docid": "f24922d8a596403c55c0bb78c73f0c0b",
"score": "0.5784926",
"text": "def contenido_de_la_posicion(posicion)\n @tablero.contenido_de_la_posicion posicion\n end",
"title": ""
},
{
"docid": "456acb6fbbfa8d19490feed3f145af4e",
"score": "0.5783729",
"text": "def deco_pos; end",
"title": ""
},
{
"docid": "17586af1b5990e85ce1460873b1a18cd",
"score": "0.57777965",
"text": "def objetivos_y_carga_diaria\n mes = params[:mes].to_i\n anio = params[:anio].to_i\n vendedor_id = params[:vendedor_id].to_i\n vendedor = Vendedor.find(vendedor_id)\n totales = Hash.new\n total_ob_op = ObjetivoMensual.total_objetivos_punto_venta(anio, mes, vendedor, 7)\n total_ob_pm = ObjetivoMensual.total_objetivos_punto_venta(anio, mes, vendedor, 4)\n total_ob_v = ObjetivoMensual.total_objetivos_punto_venta(anio, mes, vendedor, 5)\n total_ob_csi = ObjetivoMensual.total_objetivos_punto_venta(anio, mes, vendedor, 3)\n total_ob_fin = ObjetivoMensual.total_objetivos_punto_venta(anio, mes, vendedor, 8)\n total_op = ObjetivoMensual.asignado_o_proyeccion(anio, mes, vendedor, 7)\n total_pm = ObjetivoMensual.asignado_o_proyeccion(anio, mes, vendedor, 4)\n total_v = ObjetivoMensual.asignado_o_proyeccion(anio, mes, vendedor, 5)\n total_csi = ObjetivoMensual.asignado_o_proyeccion(anio, mes, vendedor, 3)\n total_fin = ObjetivoMensual.asignado_o_proyeccion(anio, mes, vendedor, 8)\n totales[:ob_oportunidades] = total_ob_op\n totales[:ob_pruebas_manejo] = total_ob_pm\n totales[:ob_ventas] = total_ob_v\n totales[:ob_csi] = total_ob_csi\n totales[:ob_fin] = total_ob_fin\n totales[:oportunidades] = total_op\n totales[:pruebas_manejo] = total_pm\n totales[:ventas] = total_v\n totales[:calidad] = total_csi\n totales[:financiaciones] = total_fin\n render json: totales.to_json\n end",
"title": ""
},
{
"docid": "5833ba346929ee6ff3a39f716d5d2c1f",
"score": "0.57770026",
"text": "def calculo_valor_energetico\n\t\t\t(@carbohidratos*4) + (@lipidos*9) + (@proteinas*4)\n\t\tend",
"title": ""
},
{
"docid": "eba97e4ccc9404094b074472c12d9a5e",
"score": "0.5773521",
"text": "def moverPrimasADespacho(cantidad_lotes)\n\t\n\nend",
"title": ""
},
{
"docid": "2548d2040400880063fa9ea06ee66641",
"score": "0.5761037",
"text": "def renglon_a_grafica\n\t\tgenera_renglon_total\n\t\tdevuelto = Hash.new\n\t\t@renglones_reporte[0].id_columnas.each do |key|\n\t\t\tdevuelto[key] = @total[key][:promedio]\n\t\tend\n\t\tdevuelto\n\tend",
"title": ""
},
{
"docid": "13f7d657b315a10f5ae06c7c39d7612c",
"score": "0.57532424",
"text": "def excede_control_de_pago_global()\n @sumatoria_posible_pago_todos_tickets_de_hoy_todos_parlay_global = 0 # inicializacionn de variable sumatoria en cero ok\n #La idea aqui es verificar si la sumatoria de posible pago de todas las jugadas de todos los tipos de tickets activos de hoy no excede el limite globar de riesgo del sistema ok\n \n #limite GLOBAL = 1 ADMINISTRATIVO OK Y TIPOJUGADA TAMBIEN MANUAL = GLOBAL OK TED. POPULATE IT IN DATABASE PRODUCTION OK:\n control_monto_max_pago_global = Controldepagogt.where(:tipojugada => \"global\" ).first.limiteglobal.to_i || 1 # setear un valor default ok \n\n t_ids = Ticket.today.where(:activo => \"si\").ids # todos los ticket actio de hoy con ese parlay ok\n \n @listado_sumatoria_posible_pago = Jugadalot.where(:ticket_id => t_ids)# postrges casting erro string ok .sum(:posiblepago).to_i\n \n if not @listado_sumatoria_posible_pago.nil?\n @listado_sumatoria_posible_pago.each do |jugada|\n @sumatoria_posible_pago_todos_tickets_de_hoy_todos_parlay_global += jugada.posiblepago.to_i\n end\n \n end\n \n \n #Sumar posible pago de esas jugadas de cada ticket parlay ok.\n# @sumatoria_posible_pago_todos_tickets_de_hoy_todos_parlay_global = 0\n# t.each do |ticket|\n# @sumatoria_posible_pago_todos_tickets_de_hoy_todos_parlay_global += Jugadalot.where(:ticket_id => ticket.id).last.posiblepago.to_i\n# end\n\n if @sumatoria_posible_pago_todos_tickets_de_hoy_todos_parlay_global.to_i <= control_monto_max_pago_global.to_i\n # si es menor todo ok\n false # no excede\n else\n true #si excede \n end\n\n\n end",
"title": ""
},
{
"docid": "9b2f99958933e0592ee94277767855ae",
"score": "0.57484436",
"text": "def pontosanunciante\n\n\t\tUsuario.find(self.id_usuario).meuspontos\n\n\tend",
"title": ""
},
{
"docid": "4f2255320b251fe3bc01b868a8a27ac6",
"score": "0.5747281",
"text": "def calculo_emisiones_diarias\n recorrido = lista_alimentos.head\n cantidad = lista_cantidades.head\n\n while (recorrido != nil && cantidad != nil)\n @emisiones_diarias = @emisiones_diarias + ((recorrido.value.gei * cantidad.value)/1000)\n\n recorrido = recorrido.next\n cantidad = cantidad.next\n end\n\n @emisiones_diarias\n end",
"title": ""
},
{
"docid": "84108412c45d1b2b8591d532aeb4a50c",
"score": "0.574313",
"text": "def dieta_terreno(gramos)\n\n aux = @head\n suma_terreno = 0\n i = 0\n while (!aux.nil?)\n suma_terreno += aux[:value].auxiliar2(gramos[i])\n aux = aux[:next]\n i = i+1\n end\n return suma_terreno.round(2)\n\n end",
"title": ""
},
{
"docid": "54c533c361e514692781a3d0f59fb2b8",
"score": "0.57398844",
"text": "def calculo_metros_terreno\n recorrido = lista_alimentos.head\n cantidad = lista_cantidades.head\n\n while (recorrido != nil && cantidad != nil)\n @metros_terreno = @emisiones_diarias + ((recorrido.value.terreno * cantidad.value)/1000)\n\n recorrido = recorrido.next\n cantidad = cantidad.next\n end\n\n @metros_terreno\n end",
"title": ""
},
{
"docid": "4f1615cef543b07b37ea51a8bbc30f0d",
"score": "0.5739259",
"text": "def disponibles\n total = []\n heros.each do |h|\n next unless h.tesoro\n next unless h.tesoro[item + 's']\n h.tesoro[item + 's'].each do |e|\n (total << h.id) if e == id\n end\n end\n total\n end",
"title": ""
},
{
"docid": "3ce3f97e508788ed3bc45a5f856da24f",
"score": "0.57366127",
"text": "def consumo_promedio\n medidor_id = MedidorEstadoMedidor.where(estado_medidor_id: self.id).take.medidor_id\n estado_medidor_id = MedidorEstadoMedidor.where(medidor_id: medidor_id).map(&:estado_medidor_id)\n periodo = \"#{self.fecha_medicion.month}/#{self.fecha_medicion.year}\"\n estados = EstadoMedidor.where(id: estado_medidor_id).where.not(periodo: periodo)\n aux = 0\n estados.each do |estado|\n aux = aux + estado.consumo\n end\n aux = aux + self.estado_actual\n promedio = aux / (estados.count + 1)\n end",
"title": ""
},
{
"docid": "be757b85845de38460358a4c968fd264",
"score": "0.57334816",
"text": "def extraer_delante\n if(@tam == 0)\n puts \"La Lista está vacía\"\n else\n aux = @cabeza\n @cabeza = @cabeza[:Next_]\n @cabeza[:prev] = nil\n @tam = @tam - 1\n return aux[:value]\n end\n end",
"title": ""
},
{
"docid": "0b16be9c94f819600f388bd3f43e1c5d",
"score": "0.57298255",
"text": "def atributos\n p \"El Modelo del carro es: #{@modelo}, la Marca es: #{@marca} y el Color es: #{@color}\"\n end",
"title": ""
},
{
"docid": "970494429dd5d85e4ba7a46af37c123b",
"score": "0.5725018",
"text": "def tecnicos_postulados\n coleccion = []\n self.request.each do |request|\n info = {}\n info[:id] = request.id\n info[:article] = request.article\n info[:servicio] = request.service.description\n info[:tecnicos] = request.proposal\n coleccion.append(info)\n end\n coleccion\n end",
"title": ""
},
{
"docid": "f25ad7520247d4451a65dcfd2197f16e",
"score": "0.572273",
"text": "def tratar_datos(tipo_cuenta, total_retito)\n\n \t billete = ContarBilletes(total_retito)\n devuelve = ValorRetirado(billete ,total_retito , tipo_cuenta)\n [billete, devuelve]\n end",
"title": ""
},
{
"docid": "6efb644bf3a7efe0919ceb4244fc15b7",
"score": "0.5711077",
"text": "def calcular_dias_trabajados_hasta(fecha_ejecucion)\n dia_que_empezo_a_trabajar = 1\n dias_trabajados = (fecha_ejecucion - @fecha_inicio_contrato) + dia_que_empezo_a_trabajar\n end",
"title": ""
},
{
"docid": "ed81e7465931a7f20349312d17f53aac",
"score": "0.56964326",
"text": "def reset \n\t\t@resultado[\"rondas\"] = 0\n\t\t@resultado[\"1\"] = 0\n\t\t@resultado[\"2\"] = 0\n\t\t@s1 = \"\"\n\t\t@s2 = \"\"\n\t\t@j1 = \"\"\n\t\t@j2 = \"\"\n\t\t@puntos = \"\"\n\t\t@rondas = \"\"\n\tend",
"title": ""
},
{
"docid": "335a27b5371984fff1ce16d8d18c4f6d",
"score": "0.5694963",
"text": "def calcula_consecutivos\n if new_record?\n lastRecord = MovMovimiento.last\n if lastRecord\n self.hoja = lastRecord.hoja\n #self.ciclo = lastRecord.ciclo\n end\n end\n end",
"title": ""
},
{
"docid": "eb0a1103ebfb6f5797230b838217af33",
"score": "0.56948924",
"text": "def set_controles\n @controles= Control.where(area_id: @consulta.ficha_nutricional_adulto.area_id, paciente_id: @consulta.ficha_nutricional_adulto.paciente_id).limit(9).order(id: :desc)\n end",
"title": ""
},
{
"docid": "0e6d539238d9bbb247821dbfd43d8d4b",
"score": "0.56901145",
"text": "def porcentaje_lipidos\n recorrido = lista_alimentos.head\n acumulador = 0\n porcentaje = 0\n\n while recorrido != nil\n acumulador = acumulador + recorrido.value.proteinas + recorrido.value.carbohidratos + recorrido.value.lipidos\n porcentaje = porcentaje + recorrido.value.lipidos\n\n recorrido = recorrido.next\n end\n\n ((porcentaje * 100)/acumulador).round(2)\n end",
"title": ""
},
{
"docid": "30f0ab87aad95986fa550eed7a16d4eb",
"score": "0.5686584",
"text": "def povuci_mrezu\n return @mreza\n end",
"title": ""
},
{
"docid": "c4e865f08c1a05213e0bcd60152fd896",
"score": "0.56717074",
"text": "def suma_gramos\n\t\t\t@proteinas + @carbohidratos + @lipidos\n\t\tend",
"title": ""
},
{
"docid": "d60926d30a052259017b60ef9b6afe5e",
"score": "0.5671494",
"text": "def valor\n\t\t@valor = 0\n\t\tself.parts.each do |p|\n\t\t\t@valor += p.valor\n\t\tend\n\t\t@valor\n\tend",
"title": ""
},
{
"docid": "27da807579da5b73f37f4f74308ef7b2",
"score": "0.56699085",
"text": "def terreno\n grtotal = 0\n sum = 0\n\t\t#recorre las dos listas a la vez para sacar el terreno\n #usado de cada ingrediente segun el peso de este\n @lista.zip(@listagr).each do |normal, gr|\n cant = gr/1000.0\n sum += normal.terreno*cant\n end\n @terreno = sum\n\n end",
"title": ""
},
{
"docid": "0ef6c70c0ddb6f2091243a0c6e5d703a",
"score": "0.5668096",
"text": "def deudas_por_comprobante\n valores = com_compra.totales_por_comprobante\n valores.each do |k, v|\n valores[k] = \"#{k} - $#{v[0]} #{v[1]}, #{v[2]}\"\n end\n valores.invert\n end",
"title": ""
},
{
"docid": "989a82ed61341ab7f853a7ef3867a375",
"score": "0.56605726",
"text": "def infosSauvegardes\n\t\n return requete(\"SELECT nompartie, nomgrille, taillegrille, jokersRestants, grillejouee.datemaj FROM grillejouee INNER JOIN grilleediter ON grillejouee.idGrille=grilleediter.id WHERE joueur = #{@profil.getStats[\"id\"]}\")\n\tend",
"title": ""
},
{
"docid": "4ad671e6bc59b8d9550e2d1989b5070b",
"score": "0.5657917",
"text": "def valor_energetico\n @proteinas * 4.0 + @carbohidratos * 4.0 + @lipidos * 9.0\n end",
"title": ""
},
{
"docid": "518d1ee54b3ec36ca7173433a65d7a2a",
"score": "0.5651499",
"text": "def descontar_medicamentos\n\t \tself.medicamento.cantidad -= self.cantidad\n\t \tself.medicamento.save\n\t end",
"title": ""
},
{
"docid": "daf8ac93f80f67a148e4ff955e50b256",
"score": "0.56361145",
"text": "def pantallaPuntosRondas\n\t\tpuntos = \"\"\n\t\trondas = \"\"\n\n\t\t# Limpiamos pantalla\n\t\t@app.clear\n\t\t@app.background \"fondo.jpg\"\n\n\t\t@boxes = @app.stack :top => \"180\", :left => \"330\"\n\t\t@boxes.para \"Rondas\"\n\t\t@r = @boxes.edit_line\n \t@boxes.para \"Puntos\"\n \t@pu = @boxes.edit_line\n \t@enviar = @boxes.button \"OK\"\n \t@enviar.click do\n\t \t@rondas = @r.text\n\t\t\t@puntos = @pu.text\n\t\t\tif (@rondas == \"\" and @puntos == \"\")\n\t\t\t\t@boxes.append \"Debe indicar un numero de rondas o puntos.\"\n\t\t\telse\n\t\t\t\tpantallaJuego\n\t\t\tend\n\t\tend\n \t\n\tend",
"title": ""
},
{
"docid": "4b155bb04ece1e48ace44223cd5ac811",
"score": "0.56199",
"text": "def huella\n\t\tindice1 = 0\n\t\t#dependiendo del vct de cada ingrediente, se le pone un indice\n\t\tif vct < 670\n\t\t\tindice1 = 1\n\t\t\t\n\t\telsif vct > 830\n\t\t\tindice1 = 3\n\t\telse \n\t\t\tindice1 = 2\n\t\tend \n\t\tindice2 = 0\n\t\t#dependiendo de los gases emitidos de cada ingrediente, \n\t\t#se le pone un indice\n\t\tif emisiones < 800\n\t\t\tindice2 = 1\n\t\telsif emisiones > 1200\n\t\t\tindice2 = 3\n\t\telse \n\t\t\tindice2 = 2\n\t\tend\n\t\t#hace la media de los indices sacados\n\t\tindiceres = (indice1+indice2)/2\n\t\t\n\n\tend",
"title": ""
},
{
"docid": "e06476045786cbe4fcb2bcd3c180723b",
"score": "0.561834",
"text": "def datos_default\n if new_record?\n lastRecord = MovMovimiento.last\n if lastRecord\n self.hoja = lastRecord.hoja\n end\n\n num_abonos = ComPago.where(com_compra: com_compra).count + 1\n self.concepto = \"Abono #{num_abonos} a compra \\\"#{com_compra.title}\\\"\"\n end\n end",
"title": ""
},
{
"docid": "c2203ec6bf9e96247fbe68828c06ee6f",
"score": "0.5603542",
"text": "def modelo_carne_build_data_right(doc, boleto, colunas, linhas)\n # LOGOTIPO do BANCO\n doc.image boleto.logotipo, x: (colunas[2] - 0.11), y: linhas[0]\n\n # Numero do banco\n doc.moveto x: colunas[4], y: linhas[0]\n doc.show \"#{boleto.banco}-#{boleto.banco_dv}\", tag: :grande\n\n # linha digitavel\n doc.moveto x: colunas[6], y: linhas[0]\n doc.show boleto.codigo_barras.linha_digitavel, tag: :media\n\n # local de pagamento\n doc.moveto x: colunas[2], y: linhas[1]\n doc.show boleto.local_pagamento\n\n # vencimento\n doc.moveto x: colunas[11], y: linhas[1]\n doc.show boleto.data_vencimento.to_s_br\n\n # cedente\n doc.moveto x: colunas[2], y: linhas[2]\n doc.show boleto.cedente\n\n # agencia/codigo cedente\n doc.moveto x: colunas[11], y: linhas[2]\n doc.show boleto.agencia_conta_boleto\n\n # data do documento\n doc.moveto x: colunas[2], y: linhas[3]\n doc.show boleto.data_documento.to_s_br if boleto.data_documento\n\n # numero documento\n doc.moveto x: colunas[3], y: linhas[3]\n doc.show boleto.documento_numero\n\n # especie doc.\n doc.moveto x: colunas[8], y: linhas[3]\n doc.show boleto.especie_documento\n\n # aceite\n doc.moveto x: colunas[9], y: linhas[3]\n doc.show boleto.aceite\n\n # dt processamento\n doc.moveto x: colunas[10], y: linhas[3]\n doc.show boleto.data_processamento.to_s_br if boleto.data_processamento\n\n # nosso numero\n doc.moveto x: colunas[11], y: linhas[3]\n doc.show boleto.nosso_numero_boleto\n\n # uso do banco\n ## nada...\n\n # carteira\n doc.moveto x: colunas[3], y: linhas[4]\n doc.show boleto.carteira\n\n # especie\n doc.moveto x: colunas[5], y: linhas[4]\n doc.show boleto.especie\n\n # quantidade\n doc.moveto x: colunas[7], y: linhas[4]\n doc.show boleto.quantidade\n\n # valor documento\n doc.moveto x: colunas[8], y: linhas[4]\n doc.show boleto.valor_documento.to_currency\n\n # valor do documento\n doc.moveto x: colunas[11], y: linhas[4]\n doc.show boleto.valor_documento.to_currency\n\n # Instruções\n doc.moveto x: colunas[2], y: linhas[5]\n doc.show boleto.instrucao1\n doc.moveto x: colunas[2], y: linhas[6]\n doc.show boleto.instrucao2\n doc.moveto x: colunas[2], y: linhas[7]\n doc.show boleto.instrucao3\n doc.moveto x: colunas[2], y: linhas[8]\n doc.show boleto.instrucao4\n doc.moveto x: colunas[2], y: linhas[9]\n doc.show boleto.instrucao5\n doc.moveto x: colunas[2], y: linhas[10]\n doc.show boleto.instrucao6\n\n # Sacado\n doc.moveto x: colunas[2], y: linhas[11]\n if boleto.sacado && boleto.sacado_documento\n doc.show \"#{boleto.sacado} - #{boleto.sacado_documento.formata_documento}\"\n end\n\n # Sacado endereço\n doc.moveto x: colunas[2], y: linhas[12]\n doc.show boleto.sacado_endereco.to_s\n\n # codigo de barras\n # Gerando codigo de barra com rghost_barcode\n if boleto.codigo_barras\n doc.barcode_interleaved2of5(boleto.codigo_barras, width: '10.3 cm', height: '1.2 cm', x: colunas[2],\n y: linhas[14])\n end\n end",
"title": ""
},
{
"docid": "137fe25942164135d465f68fcc2ca792",
"score": "0.5601484",
"text": "def tas_poser_1_carte joueur\n # Examine tous les tas déjà posés un par un\n self.ta12s.each do |tas|\n # Abandonne l'examen des différents tas quand plus qu'une carte\n break if joueur.cartes.size == 1\n # Evite de compléter la tierce franche lors de la 1° pose\n unless joueur.a_atteint_51?\n next if tas.nom_joueur == joueur.nom + \"_tf\"\n end\n # Regarde si on peut ajouter une carte au tas\n joueur.cartes.each do |carte|\n # Regarde si la carte peut aller sur le tas\n if tas.complete_le_tas? carte\n type = tas.combinaison.type\n # Pose la carte\n self.traces << \" tas <= #{tas.to_s} + [ #{carte.to_s} ]\"\n poser_sur_tas joueur, tas, carte\n # On ne peut plus compléter le tas si c'est une série de plus de 3 cartes\n break if tas.cartes.size > 3\n # on ne peut plus compléter le tas si ce n'est pas une série\n break if type != :serie\n end\n end\n end\n end",
"title": ""
},
{
"docid": "30a03ac80711a7544d1e738aa54529cb",
"score": "0.55897385",
"text": "def relatorio\n @users = User.all\n @total_por_usuario = []\n\n @users.each do |user| \n @pontos = Ponto.where(\"user_id = ?\", user.id)\n .by_month(Time.now.strftime(\"%B\"), field: :created_at)\n .order(\"created_at asc\")\n\n @segundos = 0\n\n @pontos.each do |ponto|\n if ponto.situacao == \"Entrada\"\n @entrada = ponto.data_hora\n else\n @saida = ponto.data_hora\n @segundos += TimeDifference.between(@entrada, @saida).in_seconds.to_i if (@entrada && @saida )\n end\n end\n\n @total_por_usuario.push ({user => (@segundos/3600).to_i.to_s.rjust(2,'0') + \":\"+Time.at(@segundos).utc.strftime(\"%M:%S\") })\n end\n end",
"title": ""
},
{
"docid": "3b4fa6f879cbf4808e25751670517dea",
"score": "0.55836755",
"text": "def comisiones_asignadas\n asunto.comisiones if asunto\n end",
"title": ""
},
{
"docid": "46230d0f10af3028e58336369e7cfa6f",
"score": "0.5574145",
"text": "def comer\r\n # @image = Image[\"pez2.png\"]\r\n # Al comer, un pez tendrá x segundos mas de vida, y queda libre para buscar mas comida\r\n @vida_inicio += 2\r\n @libre = true\r\n end",
"title": ""
},
{
"docid": "7fe1cc3d6e578c7f78817af4bf0c9042",
"score": "0.55728275",
"text": "def renglones\n\t\t@renglones_reporte\n\tend",
"title": ""
},
{
"docid": "89e3934c6f062dd67b33aa1ba9d4f0cf",
"score": "0.55721146",
"text": "def valorenergetico\n acumulador1 = 0\n nodo = @head\n while nodo != @tail\n acumulador1 = acumulador1 + nodo.value.valor_energetico\n nodo = nodo.next\n end\n acumulador1\n end",
"title": ""
},
{
"docid": "8f60ac0da148fd92e0ae36074764fb36",
"score": "0.5566761",
"text": "def index\n @detalle_orden_trabajos = DetalleOrdenTrabajo.all\n @detalle_orden_trabajos.repuesto_servicio = RepuestoServicio.first\n end",
"title": ""
},
{
"docid": "4399e6179802079e434841cb31b7d27e",
"score": "0.5565697",
"text": "def porcentaje_carbohidratos\n recorrido = lista_alimentos.head\n acumulador = 0\n porcentaje = 0\n\n while recorrido != nil\n acumulador = acumulador + recorrido.value.proteinas + recorrido.value.carbohidratos + recorrido.value.lipidos\n porcentaje = porcentaje + recorrido.value.carbohidratos\n\n recorrido = recorrido.next\n end\n\n ((porcentaje * 100)/acumulador).round(2)\n end",
"title": ""
},
{
"docid": "9356f4bb8090abec863928d54e1492f3",
"score": "0.5564297",
"text": "def secuenciasugerida \n #recupera los hijos del padre de la cuenta a crear \n\t\thijos = Catalogo.where(\"padre_id = ? AND activo = ?\", idcuenta, true)\n\n #configuracion del nivel a crear\n\t\tidnivel = Catalogo.find_by(id: idcuenta).nivel_id\n\t\tnivelh = Nivel.find_by(id: idnivel).numnivel + 1\n\n nivel = Nivel.find_by(numnivel: nivelh)\n nrodigitos = nivel.nrodigitos\n nrodigitostotal = nivel.nrodigitostotal\n digito = 0\n aux = 0\n\n hijos.each do |e|\n \taux = e.codigo.last(nrodigitos).to_i\n \t\tif digito < aux\n\t\t\t\tdigito = aux\n \t\tend\n \tend\n \tdigito = digito + 1\n \tc =\"\"\n \tnrodigitos.times { c = c + \"0\" }\n \tc = c.to_s + digito.to_s \t\n \t\t\n #codigo sugerido\n \treturn c.last(nrodigitos).to_s\n\tend",
"title": ""
},
{
"docid": "382eec8d108d3081fcb2411ea5136cd4",
"score": "0.5559077",
"text": "def valor_deducao\n deducoes.reduce(0) do |total,deducao|\n total += deducao.valor\n end\n end",
"title": ""
},
{
"docid": "1c5117b502ecebe0fd7d2de0dfe2467f",
"score": "0.55556256",
"text": "def totalHidratos\n\t\thidr = 0\n\t\ttotal = 0\n\t\t@platos.each do |alimento|\n\t\t\thidr += alimento.carbohidratos\n\t\tend\n\t\treturn hidr.round(2)\n\tend",
"title": ""
},
{
"docid": "3c73b67832c54b0bd5725f993ec08f00",
"score": "0.5548768",
"text": "def get_energia_lipidos\n\t\t\t\t@lipidos * 9\n\t\t\tend",
"title": ""
},
{
"docid": "66ba893ea6b43cccac04c67411a65013",
"score": "0.55437976",
"text": "def valor_total(estado)\n\t\t@valor = 0\n\t\tself.parts.each do |p|\n\t\t\tif(p.confirmacao == estado)\n\t\t\t\t@valor += p.valor\n\t\t\tend\n\t\tend\n\t\t@valor\n\tend",
"title": ""
},
{
"docid": "7f71534cec45302d7d9ca46f87a74b4d",
"score": "0.55434316",
"text": "def totalLipidos\n\t\tlip = 0\n\t\ttotal = 0\n\t\t@platos.each do |alimento|\n\t\t\tlip += alimento.lipidos\n\t\tend\n\t\treturn lip.round(2)\n\t\n\tend",
"title": ""
},
{
"docid": "6a5b138a070a73d2cb8838cf414c94a8",
"score": "0.55414855",
"text": "def index\n @anios = Ordenanza.select(:anio).uniq.map do | ord | ord.anio end\n\n @temas = Ordenanza.select(:tema).uniq.map do | ord | ord.tema end\n\n #TODO: Borrar\n @ordenanzas = Ordenanza.limit(10)\n end",
"title": ""
},
{
"docid": "874653a2798d161ae44e5dd0abbf4089",
"score": "0.5541309",
"text": "def calc_horas(ramo_id)\n ret = 0 \n self.asignaturas.where(:ramo_id => ramo_id).each do |asig|\n \n aux1=0\n \n self.horas_por_semanas.where(:asignatura_id => asig.id).each do |horas|\n aux1= aux1+horas.horasporsemana\n end\n ret= ret+aux1 \n end\n\n return(ret)\n end",
"title": ""
},
{
"docid": "51675bfa906269fba7755677fbdb90cd",
"score": "0.5529151",
"text": "def medir_indicador_otro_tipo_33(mind, fini, ffin)\n datosint = []\n base = ::Productopf.\n where( 'proyectofinanciero_id IN (SELECT id ' +\n 'FROM cor1440_gen_proyectofinanciero ' +\n 'WHERE respgp_id IS NOT NULL ' +\n 'AND estado IN (?))', \n ::ApplicationHelper::ESTADOS_APROBADO).\n where('fechaplaneada>=?', fini).\n where('fechaplaneada<=?', ffin).\n where('fechareal<=(fechaplaneada + 7)')\n d1 = base.count\n idp1 = base.pluck(:proyectofinanciero_id)\n rutaev1 = d1 == 0 ? '#' :\n cor1440_gen.proyectosfinancieros_url + '?filtro[busid]=' + \n idp1.uniq.join(',')\n datosint << { valor: d1, rutaevidencia: rutaev1 }\n\n base3 = ::Productopf.\n where( 'proyectofinanciero_id IN (SELECT id ' +\n 'FROM cor1440_gen_proyectofinanciero ' +\n 'WHERE respgp_id IS NOT NULL '+\n 'AND estado IN (?))', \n ::ApplicationHelper::ESTADOS_APROBADO).\n where('fechaplaneada>=?', fini).\n where('fechaplaneada<=?', ffin)\n d2 = base3.count\n idp2 = base3.pluck(:proyectofinanciero_id)\n rutaev2 = d2 == 0 ? '#' :\n cor1440_gen.proyectosfinancieros_url + '?filtro[busid]=' + \n idp2.uniq.join(',')\n datosint << { valor: d2, rutaevidencia: rutaev2 }\n\n resind = d2.to_f > 0 ? 100*d1.to_f/d2.to_f : nil\n return {resind: resind, datosint: datosint, rutaevidencia: rutaev1}\n end",
"title": ""
},
{
"docid": "9470122b8d4e9e9edd3503871bcf9705",
"score": "0.55196995",
"text": "def ahorrodinero(año)\n\n i = 0\n final = Array.new \n final1 = Array.new \n final2 = Array.new \n \n\n datos = Valore.where(:año => año)\n \n datos.each do |datos|\n \n \n final[i] = datos.read_attribute(\"es\")\n final1[i] = datos.read_attribute(\"tarifa\")\n final2[i] = final1[i]*final[i]\n \n i = i +1\n \n \n end\n \n return final2\n\n\n\n end",
"title": ""
},
{
"docid": "dfe4ae751ad56ae3a9298fa9a2fa6d04",
"score": "0.55180067",
"text": "def initialized_ingredientes_recetas\n [].tap do |ing_rec|\n Ingrediente.all.sort_by{|i| i.nombre}.each do |ingrediente|\n if i = ingredientes_recetas.find{|ir| ir.ingrediente_id == ingrediente.id}\n ing_rec << i.tap {|ir| ir.pertenece ||= true}\n else\n ing_rec << IngredientesReceta.new(ingrediente: ingrediente)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "7974f1e14a7ef28ac1f8b55b1b968116",
"score": "0.55130386",
"text": "def por_lipidos\n\t\taux_lipidos = 0.0\n\t\ti = 1\n\t\twhile i < @lista_alimentos.size do\n\t\t\taux_lipidos += @lista_alimentos[i].lipidos * @lista_cantidades[i]\n\t\t\ti+=1\n\t\tend\n\t\treturn ((aux_lipidos/total_nutrientes)*100.0).round(2)\n\tend",
"title": ""
},
{
"docid": "be17789db7943738941b1b6756e0b9ae",
"score": "0.5508165",
"text": "def especies_filtros\n return unless tiene_filtros?\n self.taxones = Especie.select(:id).select(\"#{Scat.attribute_alias(:catalogo_id)} AS catalogo_id\").joins(:scat).distinct\n por_especie_id\n por_nombre\n #estatus\n #solo_publicos\n estado_conservacion\n tipo_distribucion\n uso\n formas_crecimiento\n ambiente\n\n #return unless por_id_o_nombre\n #categoria_por_nivel\n end",
"title": ""
},
{
"docid": "48a621b64c0948dc52a9a7ff35819377",
"score": "0.55076003",
"text": "def verTodasVentasCarrito(ventas)\n \n totalVentas=0\n for i in(0..ventas.size-1)\n totalVentas+=ventas[i][3]\n print \"ID: #{ventas[i][0]} Cantidad: #{ventas[i][1]} Valor: #{ventas[i][2]}, Valor Total: #{ventas[i][3]} \\n\"\n end\n print \"Total de ventas: #{totalVentas} \\n\"\nend",
"title": ""
},
{
"docid": "c1f010db873fc43e4daf10c37cb66f49",
"score": "0.55057144",
"text": "def medir_indicador_otro_tipo_23(mind, fini, ffin)\n datosint = []\n eap = ::ApplicationHelper::ESTADOS_APROBADO.map { |l| \"'#{l}'\" }\n eap = eap.join(', ')\n base = Cor1440Gen::Proyectofinanciero.\n where('fechaformulacion >= ?', fini).\n where('fechaformulacion <= ?', ffin).\n where('respgp_id IS NOT NULL')\n cd1 = base.clone.where('estado IN (?)', \n ::ApplicationHelper::ESTADOS_APROBADO) \n d1 = cd1.count\n evd1 = cd1.pluck('id')\n rutaev1 = d1 == 0 ? '#' :\n cor1440_gen.proyectosfinancieros_url + '?filtro[busid]=' + \n evd1.join(',')\n datosint << {valor: d1, rutaevidencia: rutaev1 }\n cd2 = base.clone\n d2 = cd2.count\n evd2 = cd2.pluck('id')\n datosint << {valor: d2, rutaevidencia: d2 == 0 ? '#' :\n cor1440_gen.proyectosfinancieros_url + '?filtro[busid]=' + \n evd2.join(',')}\n resind = d2.to_f > 0 ? 100*d1.to_f/d2.to_f : nil;\n\n return {resind: resind, datosint: datosint, rutaevidencia: rutaev1}\n end",
"title": ""
},
{
"docid": "7a99658759b0aa5d28f618d452884fb3",
"score": "0.55020684",
"text": "def totalSimplificado\n @biblioteca.livrosComoLista.map(&:preco).inject(0){|total, preco| total += preco}\n end",
"title": ""
},
{
"docid": "30b0a00ce5d2e670a39c5d21a420f10f",
"score": "0.5500991",
"text": "def show\n @ultimos_recibos = @usuario.recibos.order(data: :desc)\n end",
"title": ""
},
{
"docid": "86200dd0f18f43d9d8ef426ed3abc2ca",
"score": "0.5497363",
"text": "def how_many\n return @@total_samurais\n end",
"title": ""
},
{
"docid": "18c9450db6a875a33b6a166a797a56b4",
"score": "0.5496916",
"text": "def prepara_form\n @enderecos = Endereco.order :rua\n end",
"title": ""
},
{
"docid": "add77d2b1bb35eb66c82dca5e9e95deb",
"score": "0.54942495",
"text": "def actualizar_intermedio\n quedan = @registro.caracterizacionpersona.where(\n \"respuestafor_id IN (SELECT id \" +\n \"FROM mr519_gen_respuestafor AS rf \" +\n \"JOIN cor1440_gen_caracterizacionpf AS cpf ON \" +\n \"rf.formulario_id=cpf.formulario_id JOIN \" +\n \"cor1440_gen_beneficiariopf AS bpf ON \" +\n \"bpf.proyectofinanciero_id=cpf.proyectofinanciero_id \" +\n \"WHERE bpf.persona_id=?)\",\n @registro.id,\n ).pluck(:id)\n elim = @registro.caracterizacionpersona_ids - quedan\n if elim != []\n Cor1440Gen::Caracterizacionpersona.where(id: elim).delete_all\n end\n true\n end",
"title": ""
},
{
"docid": "95d8b7393609d2b08cea3ef083d349d7",
"score": "0.54917395",
"text": "def items_cesta()\n @total_cesta_cables = 0\n @items_cesta = 0\n CestaCable.all.each{|c| t=TipoMaterial.find_by_id(c.tipo_material_id);c.cantidad =1 unless !c.cantidad.blank?; suma= t.costo * c.cantidad unless t.nil?; @total_cesta_cables += suma unless t.nil?; @items_cesta += 1 unless t.nil?}\n\n return @items_cesta\nend",
"title": ""
}
] |
bbbd01361bd748e0df839fdeed7dbd37
|
usage new :file=>'my file.rb', :with_contents=>'some stuff'
|
[
{
"docid": "c61e0090c7a0b07524954b4fe86160a6",
"score": "0.0",
"text": "def new(options)\n if options.has_key? :directory\n dir = self[options.delete(:directory)]\n FileUtils.mkdir_p dir.path\n else\n file = self[options.delete(:file)]\n if (binary_content = options.delete(:with_binary_content) || options.delete(:with_binary_contents))\n file.binary_content = binary_content\n else\n file.content = (options.delete(:with_content) || options.delete(:with_contents) || '')\n end\n end\n\n raise \"unexpected keys '#{options.keys.join(', ')}'\" unless options.empty?\n\n dir || file\n end",
"title": ""
}
] |
[
{
"docid": "3f5672f34414af087d5704069fd3e0e5",
"score": "0.6673925",
"text": "def newWith( stuff )\n @rawContents = stuff\n end",
"title": ""
},
{
"docid": "efc1ed444b4c798e1fb3b5aa69cb2353",
"score": "0.65882677",
"text": "def initialize(contents = nil)\n self.contents = contents\n end",
"title": ""
},
{
"docid": "170d5858a7df6b895e818d977d4cb8ea",
"score": "0.6578487",
"text": "def initialize(filename, opts = {})\n @filename = filename\n @content = opts[:content] || random_content(opts[:length] || 100)\n end",
"title": ""
},
{
"docid": "4117fba0ad1098f187b34cf67ccc6878",
"score": "0.65405405",
"text": "def file(*args)\r\n args.each do |arg|\r\n add_formatted arg\r\n end\r\n self\r\n end",
"title": ""
},
{
"docid": "2d47250332e52da8f71b71287dfe0aef",
"score": "0.6491551",
"text": "def initialize(file)\n @file = file\n end",
"title": ""
},
{
"docid": "2d47250332e52da8f71b71287dfe0aef",
"score": "0.6491551",
"text": "def initialize(file)\n @file = file\n end",
"title": ""
},
{
"docid": "6a193c56b4c453756b7ec17df72f1dd0",
"score": "0.64298487",
"text": "def initialize(file_name, file_contents, log_lines = false, parse_signatures = false)\n\n # set up basic options and defaults\n self.file_name = file_name\n self.file_contents = file_contents\n self.file_ext = File.extname(file_name)\n self.parts = []\n self.lines = 0\n @@log_lines = log_lines\n @@parse_signatures = parse_signatures\n\n # set the doc type based on extension\n case self.file_ext\n when '.rb'\n self.type = :RUBY\n when '.md', '.txt', '.markdown', '.mdown'\n self.type = :MARKDOWN\n end\n\n # set parser with file type\n self.parser = Rain::Parser.new(self.type)\n\n # set the default title to the proper-case file name\n # without the extension and underscores/dashes\n self.title = self.file_name.sub(self.file_ext, '')\n self.title.gsub!(/_|-/, ' ')\n\n # very simple proper-caser\n self.title.gsub!(/\\w+/) { |word| word.capitalize }\n end",
"title": ""
},
{
"docid": "c65a3e1cd31b2ccd8143fff9c0f70de2",
"score": "0.64023536",
"text": "def initialize(file, indent=nil)\n self.file = file\n self.indent = indent\n end",
"title": ""
},
{
"docid": "521c1e03252155c2d60ebb803131d079",
"score": "0.6336815",
"text": "def create(filename, text); end",
"title": ""
},
{
"docid": "62ea45406f7e60506c2b3772aa9ea6be",
"score": "0.6301461",
"text": "def initialize(file = nil, *args, &block)\n unless block_given? or args[0].respond_to?(:to_str)\n block = Proc.new {}\n end\n super file, *args, &block\n end",
"title": ""
},
{
"docid": "925895e3b571773c92a59fe2bc33ba02",
"score": "0.62923074",
"text": "def initialize(file,settings={})\n\t\t@file = file\n\t\t@settings = settings\n\tend",
"title": ""
},
{
"docid": "183ce3ecaf58287b29657cd8a689b138",
"score": "0.62595266",
"text": "def open!(file, *args, &block); end",
"title": ""
},
{
"docid": "800104d91449eddc9d43fdb37e80c938",
"score": "0.61886466",
"text": "def initialize(file_path)\n\t\tbegin\n\t\t\t@file_desc = File.open(file_path)\n\t\trescue\n\t\t\traise \"File not found\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b3a06748a326b286f3ddc4597e120dd2",
"score": "0.6187189",
"text": "def initialize(file)\n @file = file.is_a?(String) ? File.open(file) : file\n end",
"title": ""
},
{
"docid": "b3a06748a326b286f3ddc4597e120dd2",
"score": "0.6187189",
"text": "def initialize(file)\n @file = file.is_a?(String) ? File.open(file) : file\n end",
"title": ""
},
{
"docid": "b3a06748a326b286f3ddc4597e120dd2",
"score": "0.6187189",
"text": "def initialize(file)\n @file = file.is_a?(String) ? File.open(file) : file\n end",
"title": ""
},
{
"docid": "c27283e54090d0565abbca24cbe2cbf9",
"score": "0.6147241",
"text": "def initialize(options)\n options.each { |k, v| self.send :\"#{k}=\", v }\n self.file = File.expand_path file\n end",
"title": ""
},
{
"docid": "c71ec88bab642980e354e89be5f08825",
"score": "0.6143619",
"text": "def initialize(file_name)\n create(file_name)\n end",
"title": ""
},
{
"docid": "f26aaece15184e127ab1e2811354c55c",
"score": "0.6142473",
"text": "def initialize(filename)\n @fname = filename\n end",
"title": ""
},
{
"docid": "7229a92272e8ff060853ba927442380e",
"score": "0.6130505",
"text": "def initialize(contents = [], open = true)\n\t\t@contents = contents\n\t\t@open = open\n\tend",
"title": ""
},
{
"docid": "2dc4d39597e7cb19eaab7cf26c3be941",
"score": "0.6122588",
"text": "def call(options = {})\n options.tap do |opts|\n opts[:contents] = File.open(opts[:file]).read\n end\n end",
"title": ""
},
{
"docid": "003a8cbeb55613df86ffaff5dcd04650",
"score": "0.6101737",
"text": "def initialize(contents, file_path = \"\")\n @file_path = file_path\n @locations = {}\n if contents.to_s.size.zero?\n mf_log \"NON PARSEABLE INPUT: File is empty at path #{file_path.inspect}\\n\\t#{caller.join(\"\\n\\t\")}\"\n else\n parse_code(contents)\n end\n end",
"title": ""
},
{
"docid": "bd61898a0e84d07982a33007ffbb804e",
"score": "0.6087722",
"text": "def initialize filename, mode='r', *args, &block\n @filename = filename\n @mode = mode\n end",
"title": ""
},
{
"docid": "8720467f4b38a5b72b7c03e0759664a1",
"score": "0.6065671",
"text": "def build_from_file(*args, file)\n build_from_block(*args) do\n instance_eval File.read(file), file\n end\n self\n end",
"title": ""
},
{
"docid": "a0ede291089d5fbba702090668b32414",
"score": "0.6043741",
"text": "def initialize(file)\n @file = file\n end",
"title": ""
},
{
"docid": "a0ede291089d5fbba702090668b32414",
"score": "0.6043741",
"text": "def initialize(file)\n @file = file\n end",
"title": ""
},
{
"docid": "a0ede291089d5fbba702090668b32414",
"score": "0.6043741",
"text": "def initialize(file)\n @file = file\n end",
"title": ""
},
{
"docid": "bd33b945298d67a967ac477ce606b070",
"score": "0.60229975",
"text": "def create_from_file\n end",
"title": ""
},
{
"docid": "066cc38826f0c12036bf8f97de17c10d",
"score": "0.60192513",
"text": "def initialize(filename)\n @filename = filename\n end",
"title": ""
},
{
"docid": "066cc38826f0c12036bf8f97de17c10d",
"score": "0.60192513",
"text": "def initialize(filename)\n @filename = filename\n end",
"title": ""
},
{
"docid": "066cc38826f0c12036bf8f97de17c10d",
"score": "0.60192513",
"text": "def initialize(filename)\n @filename = filename\n end",
"title": ""
},
{
"docid": "ec48aabe0044e714c747333e9756ed08",
"score": "0.60165286",
"text": "def initialize(params = {})\n @file = params.delete(:filecontents)\n super\n if @file\n self.filename = sanitize_filename(@file.original_filename)\n self.filetype = @file.content_type\n self.filecontents = @file.read\n end\n end",
"title": ""
},
{
"docid": "00e09f1e9944dc8a449f955f5a67024c",
"score": "0.59959525",
"text": "def build_from_file(*args, file)\n build_from_block(*args) do\n include_file(file)\n end\n end",
"title": ""
},
{
"docid": "beec9d9664cf152a741a7ffaf8a8b5e8",
"score": "0.59936196",
"text": "def initialize(file)\r\n raise IOError, \"Cannot read #{file}\" unless File.readable? file\r\n @file = file\r\n @filename = File.basename file\r\n @name = File.basename file\r\n @keywords = @name.split\r\n @category = 'experimental uploader'\r\n @description = \"A video about #{@name}\"\r\n end",
"title": ""
},
{
"docid": "d7b96541b00e753eea5e97c9f9b14292",
"score": "0.5987342",
"text": "def load(file); end",
"title": ""
},
{
"docid": "115ffe59603b37d00e188e34a3276e61",
"score": "0.598481",
"text": "def initialize(in_file)\n @file = File.new(in_file, \"a+\")\n @filename = in_file\n end",
"title": ""
},
{
"docid": "b1943bcdad7eb93a1dddd5ab47088792",
"score": "0.5980057",
"text": "def file=(_arg0); end",
"title": ""
},
{
"docid": "b1943bcdad7eb93a1dddd5ab47088792",
"score": "0.5980057",
"text": "def file=(_arg0); end",
"title": ""
},
{
"docid": "b1943bcdad7eb93a1dddd5ab47088792",
"score": "0.5980057",
"text": "def file=(_arg0); end",
"title": ""
},
{
"docid": "f36948f9b1190109a9ef33a609771701",
"score": "0.5971037",
"text": "def initialize(path, format=:markdown)\n raise ArgumentError, \"File [#{path}] does not exist!\" unless File.exists?(path)\n raise ArgumentError, \"File required!\" unless File.file?(path)\n @path = path\n @format = detect_format(path)\n @content = \"\"\n end",
"title": ""
},
{
"docid": "9d48b74f785034296570f26b8b0dea30",
"score": "0.5969005",
"text": "def initialize( contents, summary='', full='', mime=nil, format=nil )\n @contents = contents.to_s.downcase.to_sym\n raise \"Invalid contents '#{contents}'\" if not CONTENTS.include? @contents\n @summary = summary ? summary : ''\n @full = full ? full : ''\n @mime = mime ? mime : MIME_UNKNOWN\n @format = format ? format : FORMAT_UNKNOWN\n end",
"title": ""
},
{
"docid": "e355e85ee151ec0d05d73e153b54781e",
"score": "0.59685504",
"text": "def initialize(args = {})\n @file = args[:file] if args[:file]\n @dictionary = args[:dictionary] if args[:dictionary]\n end",
"title": ""
},
{
"docid": "11cc92a87cb9b16fe0c4801090e75e48",
"score": "0.59672177",
"text": "def initialize(filename: DEFAULT_README)\n client = Octokit::Client.new\n @filename = filename\n @developers = read_developer_yaml.merge(read_temp_file)\n @user = client.user 'bdougie'\n end",
"title": ""
},
{
"docid": "b40079211b441e43a4df8f716780e336",
"score": "0.5965511",
"text": "def initialize(args={})\n @file = args[:file]\n filepath = args[:filepath]\n unless @file || !filepath\n @file = ::File.open(filepath)\n end\n string = args[:string]\n unless @file || !string\n @file = StringIO.new(string, 'r')\n end\n post_initialize(args)\n end",
"title": ""
},
{
"docid": "aa9afff18672daa9bb8c541cb5f1b9bb",
"score": "0.5952388",
"text": "def initialize(file)\n @file = file\n\n case ext = File.extname(file)\n when '.till', '.til'\n fname = file.chomp(ext)\n else\n fname = file\n end\n\n #@format = File.extname(fname)\n @location = File.dirname(File.expand_path(file))\n\n text = File.read(file).rstrip\n\n # front matter indicator\n if text =~ /\\A---/\n text = text.sub(/---.*?\\n/, '')\n meta, body = *text.split(/^---/)\n else\n meta = nil\n body = text\n end\n\n @content = body\n\n fm = meta ? YAML.load(meta) : {}\n\n self.filters = fm['filter'] || ['erb']\n\n self.format = fm['format'] || File.extname(fname)\n\n if fm['output']\n self.output = fm['output']\n else\n self.output = fname #.chomp(extension) #+ DEFAULT_CONVERSIONS[filters.last]\n end\n\n\n\n #@context = Context.new(@location) # prime context/scope\n end",
"title": ""
},
{
"docid": "3073d9ef8b67c1644a69833a10e06c8c",
"score": "0.5931778",
"text": "def initialize(options = {})\n @file = options[:file]\n @text = options[:text]\n @url = options[:url]\n end",
"title": ""
},
{
"docid": "4db0e2874b36271921d081acb0ff4c95",
"score": "0.5929245",
"text": "def initialize(nod, c)\n\t\t\t\t\n\t\tsplitDirectory(nod)\n\t\t\n\t\tself.content = c\n\t\tself.description = \"-Creating a file: '#{name_of_subject}'\"\n\n\tend",
"title": ""
},
{
"docid": "bfb022fff74a8e168ba0776852f61063",
"score": "0.5895079",
"text": "def load_file(file); end",
"title": ""
},
{
"docid": "66c26517142a79b12f190c85317d0791",
"score": "0.58941853",
"text": "def initialize(filename)\n super(filename, EXT)\n end",
"title": ""
},
{
"docid": "66c26517142a79b12f190c85317d0791",
"score": "0.58941853",
"text": "def initialize(filename)\n super(filename, EXT)\n end",
"title": ""
},
{
"docid": "b3100820053f0d0402f9b3096a00fe93",
"score": "0.5893814",
"text": "def initialize(*args, &task_block)\n @name = args.shift || :readme\n\n define(args, &task_block)\n end",
"title": ""
},
{
"docid": "89b32037ce57cebe458f5c9ea332e2a9",
"score": "0.5888713",
"text": "def init_file=(_arg0); end",
"title": ""
},
{
"docid": "6a67421f54da01b5d213f7773a940b77",
"score": "0.5881049",
"text": "def initialize(filename, mode=\"r\", perm=0) end",
"title": ""
},
{
"docid": "3a4799ad32e6dbf1e8f0c4947173ade0",
"score": "0.5880827",
"text": "def initialize filename\n\t\t@filename = filename\n\tend",
"title": ""
},
{
"docid": "eed5f9c0c3511fbb4deaa28b413367d2",
"score": "0.5878814",
"text": "def test(cmd, file1, file2=\"foo\") end",
"title": ""
},
{
"docid": "4e3de5a29216dddd9ebc2c0de9e14cde",
"score": "0.58773875",
"text": "def initialize(filename)\n @filename = filename\n parse()\n end",
"title": ""
},
{
"docid": "d24de802cb09a0fd37c835ae852a67ef",
"score": "0.58761317",
"text": "def create_file\n\tfile = File.new\"hello_from_ruby.txt\",\"w\"\n\tputs \"-------------------------------------------\"\n\tputs \"Successfully created 'hello_from_ruby.txt'!\"\n\tputs \"-------------------------------------------\"\nend",
"title": ""
},
{
"docid": "1fd1c24055261eb2856390f84f104a11",
"score": "0.5871616",
"text": "def initialize( contents, opts = {} )\n @contents = contents\n\n @fn = opts[:fn]\n @comment = opts.fetch(:comment, ';#')\n @param = opts.fetch(:parameter, '=')\n @encoding = opts.fetch(:encoding, nil)\n @escape = opts.fetch(:escape, true)\n @default = opts.fetch(:default, 'global')\n @ini = Hash.new {|h,k| h[k] = Hash.new}\n\n @rgxp_comment = %r/\\A\\s*\\z|\\A\\s*[#{@comment}]/\n @rgxp_section = %r/\\A\\s*\\[([^\\]]+)\\]/\n @rgxp_param = %r/[^\\\\]#{@param}/\n\n parse\n end",
"title": ""
},
{
"docid": "d496b89a1d715fbcf40d5320899dd284",
"score": "0.58694243",
"text": "def parse_file_contents(filename, file_contents, args)\n return file_contents\n end",
"title": ""
},
{
"docid": "6ee09d02224380956092ba8746d5c367",
"score": "0.58686805",
"text": "def initialize(file_path, workspace, desc_path)\n\n @file_path = File.expand_path(file_path)\n @workspace = workspace\n\n # File name, with and without extension.\n @file_base = File.basename(@file_path, \".*\")\n @file_name = File.basename(@file_path)\n\n # Parse the markdown metadata.\n @description = Description.new(desc_path)\n\n # Set a workspace-prefixed uuid.\n @uuid = \"#{@workspace}_#{@file_base}\"\n\n end",
"title": ""
},
{
"docid": "1a870150448cdff61966b25b9af92168",
"score": "0.5865505",
"text": "def in_file(filename); end",
"title": ""
},
{
"docid": "31975c67fbafb1907414f84d17c9496d",
"score": "0.58634675",
"text": "def initialize(file)\n @file = file\n end",
"title": ""
},
{
"docid": "e46e488e799358fab4748c5c02f84a41",
"score": "0.5862346",
"text": "def loadFile _args\n \"loadFile _args;\" \n end",
"title": ""
},
{
"docid": "029e237c0e28e4069461249b90512f07",
"score": "0.5860181",
"text": "def source(filename); end",
"title": ""
},
{
"docid": "30f4534d61b33850d2dd02daf8d2ece7",
"score": "0.5857848",
"text": "def initialize(name, content)\n @name = name\n @content = content\n end",
"title": ""
},
{
"docid": "30f4534d61b33850d2dd02daf8d2ece7",
"score": "0.5857848",
"text": "def initialize(name, content)\n @name = name\n @content = content\n end",
"title": ""
},
{
"docid": "8cfdcc9746144d7ca35a908995effa05",
"score": "0.5848336",
"text": "def initialize(fp, **ctx)\n @ctx = ctx\n @fp = fp.chop.chop\n\n open(fp) {|f|\n @content = f.read\n }\n\n extract_info\n end",
"title": ""
},
{
"docid": "31a09d9cfdd95bcaa6c12d0be97a97de",
"score": "0.5839301",
"text": "def chef_init(file)\n self.file = file\n self.source = IO.read(File.expand_path(file))\n self.header = find_header_in(source)\n self.docstring = find_description_in(header)\n end",
"title": ""
},
{
"docid": "8b1eb1a2ce74df56e74f40522cec6a09",
"score": "0.5824653",
"text": "def initialize(file, game)\n @file = file\n @game = game\n end",
"title": ""
},
{
"docid": "56a97c5edbe30c0cc18f4e3adb68cd59",
"score": "0.581966",
"text": "def initialize(name, contents, mime_type = nil)\n @name = name\n @contents = contents\n @mime_type = mime_type\n end",
"title": ""
},
{
"docid": "92eda1974cab6078d8996a3238abddf0",
"score": "0.581203",
"text": "def initialize(file)\n @file = file\n\n @@default_tags ||= {}\n @@defined_tags ||= {}\n\n @@contants ||= {}\n\n instance_eval(::File.read(file), file)\n end",
"title": ""
},
{
"docid": "814e63634b620124b4e2bc0abcadfd71",
"score": "0.58090234",
"text": "def initialize(path = nil, attributes = {}, &block)\n @path = path\n @basename = path.to_s =~ /^-?$/ ? nil : File.basename(path)\n @reader = block ||\n lambda do |f|\n if ['-', nil].include?(f)\n $stdin.read\n else\n File.read(f, encoding: @encoding)\n end\n end\n @data = @reader.call(path)\n @name, @section, @tagline = sniff\n\n @styles = %w[man]\n @manual, @organization, @date = nil\n @markdown, @input_html, @html = nil\n @index = Ronn::Index[path || '.']\n @index.add_manual(self) if path && name\n\n attributes.each { |attr_name, value| send(\"#{attr_name}=\", value) }\n end",
"title": ""
},
{
"docid": "5bcf2dfae75e9c2a195a8f1385162adc",
"score": "0.57988155",
"text": "def file(*args, &block)\n Rake::FileTask.define_task(*args, &block)\nend",
"title": ""
},
{
"docid": "49df955802ac5c28d6da1ba8c25e9d8d",
"score": "0.57841223",
"text": "def file; end",
"title": ""
},
{
"docid": "49df955802ac5c28d6da1ba8c25e9d8d",
"score": "0.57841223",
"text": "def file; end",
"title": ""
},
{
"docid": "49df955802ac5c28d6da1ba8c25e9d8d",
"score": "0.57841223",
"text": "def file; end",
"title": ""
},
{
"docid": "49df955802ac5c28d6da1ba8c25e9d8d",
"score": "0.57841223",
"text": "def file; end",
"title": ""
},
{
"docid": "49df955802ac5c28d6da1ba8c25e9d8d",
"score": "0.57841223",
"text": "def file; end",
"title": ""
},
{
"docid": "49df955802ac5c28d6da1ba8c25e9d8d",
"score": "0.57841223",
"text": "def file; end",
"title": ""
},
{
"docid": "49df955802ac5c28d6da1ba8c25e9d8d",
"score": "0.57841223",
"text": "def file; end",
"title": ""
},
{
"docid": "49df955802ac5c28d6da1ba8c25e9d8d",
"score": "0.57841223",
"text": "def file; end",
"title": ""
},
{
"docid": "49df955802ac5c28d6da1ba8c25e9d8d",
"score": "0.57841223",
"text": "def file; end",
"title": ""
},
{
"docid": "49df955802ac5c28d6da1ba8c25e9d8d",
"score": "0.57841223",
"text": "def file; end",
"title": ""
},
{
"docid": "49df955802ac5c28d6da1ba8c25e9d8d",
"score": "0.57841223",
"text": "def file; end",
"title": ""
},
{
"docid": "057bc83c5f49b385497eb2e77b18037d",
"score": "0.5780477",
"text": "def markup_file_contents(contents); end",
"title": ""
},
{
"docid": "f3691dbbbdd2dc26f64d8a6adcf8f7fc",
"score": "0.57780224",
"text": "def file(*args)\n if args.empty?\n return @file\n else\n @file = args[0]\n return self\n end\n end",
"title": ""
},
{
"docid": "3fb8c732956fb9f06f3f05aee861e9b3",
"score": "0.5767347",
"text": "def initialize(filename)\n File.open(filename, \"r\") do |f|\n @body = f.read\n end\n @commands = []\n @s_obj = Gondola::Tester::SELENIUM_OBJECT\n @file = filename\n ruby\n end",
"title": ""
},
{
"docid": "7a90e999582dc21f74ea241270a82f05",
"score": "0.5759129",
"text": "def init_file; end",
"title": ""
},
{
"docid": "cf96692c109f362e87729080244ebe80",
"score": "0.5745372",
"text": "def initialize f\n unless f.instance_of? IO\n f = File.new(f)\n end\n @source = f\n @elements = []\n parse_header f\n parse_body f\n end",
"title": ""
},
{
"docid": "1fd99fe4bd98fd8d2a07462769c422d9",
"score": "0.5733693",
"text": "def initialize(args={})\n @cfg = {\n :path => \"/Users/cremes/dev/mygit/proto-rina/README.md\", \n :id => 25,\n :len => 1024,\n :mode => Shared::IPC_CREAT, \n :access => Shared::IPC_W | Shared::IPC_R\n }\n @cfg.merge! args\n @key = Shared::try(\"ftok\") {Shared::ftok(@cfg[:path], @cfg[:id])}\n @id = Shared::try(\"shmget\") {Shared::shmget(@key, @cfg[:len], 0666 | @cfg[:mode])}\n p @id, @key, @cfg[:len], (0666 | @cfg[:mode])\n @mem = Shared::shmat(@id, 0, @cfg[:access])\n p @mem, @id\n end",
"title": ""
},
{
"docid": "ee89f77f89f2e73b3b17338ef5295367",
"score": "0.5727694",
"text": "def initialize(lines:, dir: 'tmp/example_files')\n @lines = lines\n @dir = dir\n end",
"title": ""
},
{
"docid": "82acdad56064a5886b2d35f8a77e04e4",
"score": "0.57259446",
"text": "def initialize(file)\n @file = file\n\n @inspectables = [:@length, :@index_count, :@data_length]\n @tags = []\n end",
"title": ""
},
{
"docid": "4509333c800440cc9c73d52e60723247",
"score": "0.5725248",
"text": "def initialize file, include_path\n @file = file\n @include_path = include_path\n end",
"title": ""
},
{
"docid": "232dc750ca2d941f1e234104ce4fef15",
"score": "0.5723375",
"text": "def initialize\n @params = {}\n @path = \"/tmp/example/config.yaml\"\n @file = inspec.file(@path)\n\n unless @file.file?\n raise Inspec::Exceptions::ResourceSkipped, \"Can't find file `#{@path}`\"\n end\n\n # Protect from invalid YAML content\n begin\n @params = YAML.load(@file.content)\n # Add two extra matchers\n @params[\"file_size\"] = @file.size\n @params[\"file_path\"] = @path\n @params[\"ruby\"] = \"RUBY IS HERE TO HELP ME!\"\n rescue StandardError => e\n raise Inspec::Exceptions::ResourceSkipped, \"#{@file}: #{e.message}\"\n end\n end",
"title": ""
},
{
"docid": "466ed0174c675ef084f06c50c439a810",
"score": "0.57204455",
"text": "def file(*args, &block)\n Rake::FileTask.define_task(*args, &block)\n end",
"title": ""
},
{
"docid": "c6bbdb88d07a6f9599f8aa823db0737f",
"score": "0.57129514",
"text": "def initialize(key, filename, content)\n @key = key\n @filename = filename\n @content = content\n end",
"title": ""
},
{
"docid": "9838f0f2924430646ed4ec8148627264",
"score": "0.5711492",
"text": "def initialize(file)\n @uri = nil\n @path = ::File.expand_path(file)\n\n @package = Gem::Package.new @path\n @spec = @package.spec\n @name = @spec.name_tuple\n end",
"title": ""
},
{
"docid": "d72289b476c2356fcd21d843eee3cbc0",
"score": "0.571117",
"text": "def initialize(lines, options = {})\n if lines.is_a?(String)\n lines = lines.split(\"\\n\")\n end\n self.meta = {}\n in_meta = true\n while in_meta and line = lines.shift do\n line.strip!\n matches = line.match /^([^:]+):\\s+(.+)/\n if matches\n if matches[1] =~ /(Chapter|Number|Position)/i and matches[2] =~ /\\d+/ and number.nil?\n self.number = matches[2].strip.to_i\n end\n self.meta[matches[1].downcase.to_sym] = matches[2]\n else\n lines = [line] + lines if line\n in_meta = false \n end\n end\n self.meta.merge!(options)\n self.file_name = self.meta[:file_name]\n self.content = lines.join\n end",
"title": ""
},
{
"docid": "d9982e901280c8c6585365b45d1780ce",
"score": "0.57038224",
"text": "def initialize(input_file)\n @input_file = input_file\n @source = File.new(input_file)\n end",
"title": ""
},
{
"docid": "852e1fbd285add97037907f611981a73",
"score": "0.57017386",
"text": "def initialize(method=nil, *args)\n case method\n when :file then create_from_file(*args)\n when :parts then create_from_parts(*args)\n when :string then create_from_string(*args) # unused\n # if no method, do no intialization\n end\n end",
"title": ""
},
{
"docid": "370ef561df2a5dea34d2abe6e5212ce1",
"score": "0.56990194",
"text": "def initialize(filename)\n @name = ''\n @desc = ''\n @diagram = ''\n \n file = File.open(filename)\n \n while(line = file.gets)\n line.chomp!\n if(line == 'NAME')\n @name = file.gets.chomp!\n elsif(line == 'DESC')\n while((line = file.gets) && line != \"END\\n\")\n @desc += line\n end\n elsif(line == 'DIAGRAM')\n while((line = file.gets) && line != \"END\\n\")\n @diagram += line\n end \n end\n end\n file.close()\n end",
"title": ""
}
] |
63bdfe9bc8e4d7e85f42c28b8aa56beb
|
the resource should have otp turned on, but it isn't
|
[
{
"docid": "273e2ed2eed77c98cd5f1f0acd88bbf0",
"score": "0.746029",
"text": "def otp_mandatory_on?(resource)\n return true if resource.class.otp_mandatory && !resource.otp_enabled\n return false unless resource.respond_to?(:otp_mandatory)\n\n resource.otp_mandatory && !resource.otp_enabled\n end",
"title": ""
}
] |
[
{
"docid": "919c2c8badf59647a65aec93e6834fbd",
"score": "0.70638806",
"text": "def otp_challenge_required_on?(resource)\n return false unless resource.respond_to?(:otp_enabled) && resource.respond_to?(:otp_auth_secret)\n\n resource.otp_enabled && !is_otp_trusted_browser_for?(resource)\n end",
"title": ""
},
{
"docid": "e5046a89ff1b102ba7b4cc0408646018",
"score": "0.6153711",
"text": "def anonymous_vpn?; end",
"title": ""
},
{
"docid": "e5046a89ff1b102ba7b4cc0408646018",
"score": "0.6153711",
"text": "def anonymous_vpn?; end",
"title": ""
},
{
"docid": "c1c58c246782d04d0fb78807a50b41ad",
"score": "0.60651565",
"text": "def has_otp_device?\n !yubico_identity.nil?\n end",
"title": ""
},
{
"docid": "3806a0f076a8930f2c9e824deae91a37",
"score": "0.5624146",
"text": "def enable_otp\n current_user.otp_secret = User.generate_otp_secret\n current_user.otp_required_for_login = true\n current_user.save!\n redirect_back(fallback_location: '/')\n end",
"title": ""
},
{
"docid": "6a0bf02ab9e2161c0c2e61e2291f87a5",
"score": "0.5610074",
"text": "def authorization_mode; end",
"title": ""
},
{
"docid": "18ce9fc182d3d70be1be3e5070f1bca3",
"score": "0.5546058",
"text": "def admin_enable_otp\n user = User.find(params[:id])\n authorize! :edit, @user #prevent other users from enabling OTP on another user.\n user.otp_secret = User.generate_otp_secret\n user.otp_required_for_login = true\n user.save!\n redirect_back(fallback_location: '/')\n end",
"title": ""
},
{
"docid": "43ccaa45b0b847ab186f8db60a284aff",
"score": "0.55399835",
"text": "def is_ntp_enabled(handle:)\n mo = _get_mo(handle: handle, dn: NTP_DN)\n return ([\"true\", \"yes\"].include? mo.ntp_enable.downcase)\nend",
"title": ""
},
{
"docid": "a4692c32515939d7075867694c4e8b44",
"score": "0.55035037",
"text": "def valid_otp?\n Redis.current.get(current_user.id) == otp_params[:otp]\n end",
"title": ""
},
{
"docid": "1e1c76fceb9774e375abbe4a4587c50e",
"score": "0.549904",
"text": "def service_ppp?()\n return true if (@service == TAC_PLUS_AUTHEN_SVC_PPP)\n return false\n end",
"title": ""
},
{
"docid": "e6c1a9bad1f685097e45061b7acc2956",
"score": "0.54896724",
"text": "def set_otp\n @otp = Otp.find(params[:id])\n end",
"title": ""
},
{
"docid": "fc787c0850ffac3d362fb1cf54513e1f",
"score": "0.54863286",
"text": "def auto_renewable?\n return false unless grid_service\n\n case authorization_type\n when 'dns-01'\n false\n when 'http-01'\n true\n when 'tls-sni-01'\n true\n end\n end",
"title": ""
},
{
"docid": "90bc7a19c81fbc741e9db8c37d8a4f7b",
"score": "0.5477649",
"text": "def remotely_useful?\n plan&.remotely_useful? || super\n end",
"title": ""
},
{
"docid": "a53528a680642774c888ae7bcff9ddb3",
"score": "0.5452781",
"text": "def http_auth?; end",
"title": ""
},
{
"docid": "67f4d02156dc2eb110091816d5f9f40e",
"score": "0.54288656",
"text": "def tls?; end",
"title": ""
},
{
"docid": "6863a414843b48cd72130c5697a21901",
"score": "0.54253113",
"text": "def deliver_otp\n return unless persisted?\n sms_otp || email_otp || raise(NotImplementedError, self)\n end",
"title": ""
},
{
"docid": "736f913b0cfc1167365959bad32db1bd",
"score": "0.5382136",
"text": "def resident_credential?; end",
"title": ""
},
{
"docid": "2fbcd0ba38bb29d0a9e5d74cbeab9349",
"score": "0.5367083",
"text": "def capable_plain_auth?; end",
"title": ""
},
{
"docid": "efb7f2855d2766515283dc8bde100d88",
"score": "0.5362391",
"text": "def resource_active_for_authentication?\n !@resource.respond_to?(:active_for_authentication?) || @resource.active_for_authentication?\n end",
"title": ""
},
{
"docid": "7bb96e8f6ce98ce1be4ebfe147565dc6",
"score": "0.5347436",
"text": "def preserve_tp?\r\n special_flag(FLAG_ID_PRESERVE_TP)\r\n end",
"title": ""
},
{
"docid": "4559e1690c36ee1ad2e1f83542a31a05",
"score": "0.5346357",
"text": "def privileged_access?\n connected? || PrismicService.access_token\n end",
"title": ""
},
{
"docid": "d09bc1fb9689c8822d8bfb4cacedd170",
"score": "0.53181046",
"text": "def can_activate?\n if custom?\n unless server.blank? || port.blank? || username.blank? || password.blank? || from_address.blank?\n true\n else\n false\n end\n elsif wundercoach_standard?\n unless replyto_address.blank?\n true\n else\n false\n end\n end\n end",
"title": ""
},
{
"docid": "7850dc01444fd7da024b60186dc2da07",
"score": "0.5312067",
"text": "def setup_otp\n self.otp_secret ||= ROTP::Base32.random_base32\n self.otp_counter ||= 0\n end",
"title": ""
},
{
"docid": "1b4c616674aaa3e64f92cb90f39c252e",
"score": "0.53070444",
"text": "def required_capabilities?(tcp)\n (ToolProxy::ENABLED_CAPABILITY - tcp['capability_offered']).blank?\n end",
"title": ""
},
{
"docid": "d280b7a2cbbfba8fcbce8921eff8f0b4",
"score": "0.5301239",
"text": "def service_ppp!()\n @service = TAC_PLUS_AUTHEN_SVC_PPP\n end",
"title": ""
},
{
"docid": "0fbe247c6c5785ffdddec3736cfb6573",
"score": "0.52925813",
"text": "def oauth?; stripe_account_type == 'oauth'; end",
"title": ""
},
{
"docid": "0880c563e91bae7d20fc92de0d1f1b7d",
"score": "0.529143",
"text": "def build_resource(hash=nil)\n super(hash)\n self.resource.auto_approve = true if self.resource && session[:auto_approve_account] == true\n end",
"title": ""
},
{
"docid": "b875acbb873b9675e587d847e6e84ce3",
"score": "0.52881616",
"text": "def require_http_auth\n if `hostname` =~ /soykaf|lanpartei/i \n if auth = APP_CONFIG['http_auth']\n authenticate_or_request_with_http_basic do |user_name, password|\n user_name == auth['name'] && password == auth['password']\n end \n end\n end\n end",
"title": ""
},
{
"docid": "c48b21ae994b259ef944eb9fcf3dc409",
"score": "0.52827644",
"text": "def smart?; self.permission_level = 2; end",
"title": ""
},
{
"docid": "bacc91a3dc6fd73972c2466f308d6569",
"score": "0.5277829",
"text": "def authority?\n false\n end",
"title": ""
},
{
"docid": "18cd5107ed2e8611db9b122df2ca4418",
"score": "0.52734053",
"text": "def using_remoter?\n !@remote_base.nil?\n end",
"title": ""
},
{
"docid": "8d827cc936dccf5919008491201d8454",
"score": "0.52680016",
"text": "def check_tcs_required?\n user_is_signed_ta_cs != 'Y'\n end",
"title": ""
},
{
"docid": "1b1b6fbbd533aa997310a2f8cafa6cc9",
"score": "0.5251718",
"text": "def otr_api_call?\n current_user.present? && request.headers['X-0-Hub'] == '1'\n end",
"title": ""
},
{
"docid": "080da2e1d0327540ef75a44d8d70f550",
"score": "0.52456903",
"text": "def haveStolen\n @canISteal = false\n\n end",
"title": ""
},
{
"docid": "a6ff93ed87d2879f2fa48af4b6165f20",
"score": "0.52453494",
"text": "def retrievable?\n !ftp_password.blank? && !retrieved? && !closed?\n end",
"title": ""
},
{
"docid": "1031c2da55684b13803af3ff7ad208ad",
"score": "0.524097",
"text": "def passwordy?\n # puts \"*****************----------------> Handling user as PASSWORDY.\"\n !self.has_oauth?\n end",
"title": ""
},
{
"docid": "1c8ad038c91c2f20b558dedee7c05eac",
"score": "0.5236013",
"text": "def active?\n !expired? && !revoked?\n end",
"title": ""
},
{
"docid": "ab3180329c82877f6b8d1111597d0623",
"score": "0.5229585",
"text": "def is_enable_direct_url\n return @direct_url != nil && @direct_url == \"true\"\n end",
"title": ""
},
{
"docid": "feefb1edc1d67af196f9621762733d75",
"score": "0.52249575",
"text": "def requires_transport_security\n to_bool description['RequiresTransportSecurity']\n end",
"title": ""
},
{
"docid": "6b6fc509101625e70a663c6a3cd06670",
"score": "0.5222966",
"text": "def capable_starttls?; end",
"title": ""
},
{
"docid": "75c85b1b073cf59fc437245b328916d3",
"score": "0.521942",
"text": "def action_sendauth?()\n return true if (@action == TAC_PLUS_AUTHEN_SENDAUTH)\n return false\n end",
"title": ""
},
{
"docid": "feae2c3393401351ef9e9d8313506f5c",
"score": "0.5218901",
"text": "def provider\n false\n end",
"title": ""
},
{
"docid": "e6333b60ea2fde396ec8bb02a21795e3",
"score": "0.52106047",
"text": "def action_sendpass?()\n return true if (@action == TAC_PLUS_AUTHEN_SENDPASS)\n return false\n end",
"title": ""
},
{
"docid": "fbb058e58deaece1007ee7dca7704bdf",
"score": "0.5208424",
"text": "def active_for_authentication?\n super && !disabled_at\n end",
"title": ""
},
{
"docid": "50ceed3bcb4035110014a5e439c9ab32",
"score": "0.52076566",
"text": "def status_getpass?()\n return true if (@status == TAC_PLUS_AUTHEN_STATUS_GETPASS)\n return false\n end",
"title": ""
},
{
"docid": "684a097e4a932631a5dba50b92504801",
"score": "0.5206606",
"text": "def test?\n OffsitePayments.mode == :test\n end",
"title": ""
},
{
"docid": "9881c377993267e3e8f6119531f5cf1f",
"score": "0.5193331",
"text": "def can_open?\n\t\treturn true\n\tend",
"title": ""
},
{
"docid": "80594238a2befed7178da7933ccd0e4f",
"score": "0.51896274",
"text": "def active_for_authentication? \n \tsuper && approved?\n \t\n\tend",
"title": ""
},
{
"docid": "c3020a105f5c7a612fcc37291025f2e3",
"score": "0.51863164",
"text": "def stored_offsite?\n (@trustee == true || (! billing_key.blank? && !changed?))\n end",
"title": ""
},
{
"docid": "4068d62524413688c2751361d579ef20",
"score": "0.5183597",
"text": "def host_authorization; end",
"title": ""
},
{
"docid": "4068d62524413688c2751361d579ef20",
"score": "0.5183597",
"text": "def host_authorization; end",
"title": ""
},
{
"docid": "e1849c5860884418f9c249661e015b2c",
"score": "0.5175381",
"text": "def enabled?; end",
"title": ""
},
{
"docid": "e1849c5860884418f9c249661e015b2c",
"score": "0.5175381",
"text": "def enabled?; end",
"title": ""
},
{
"docid": "6fb2ab922e6266f28e040454af36e4d0",
"score": "0.51734954",
"text": "def service_none!()\n @service = TAC_PLUS_AUTHEN_SVC_NONE\n end",
"title": ""
},
{
"docid": "1f7837367ee26e5aa481809b4bd9fb75",
"score": "0.51661986",
"text": "def active_for_authentication? \n super && (self.is_disabled == 0)\n end",
"title": ""
},
{
"docid": "d2bd123b12f769cfefb18f9881a43a99",
"score": "0.51650447",
"text": "def http_authenticatable?; end",
"title": ""
},
{
"docid": "3c26bd2801a72f7532c1ffbd7464ea30",
"score": "0.516446",
"text": "def credential_check\n %w(partner req_id service v).all? { |k|\n # AlipayWap.logger.debug \"#{k}: #{@protocol_fields[k]}<->#{@request.protocol_fields[k]}\"\n @protocol_fields[k] == @request.protocol_fields[k].to_s\n } || raise(\"Response is not for this request\")\n end",
"title": ""
},
{
"docid": "5afbb4fe01f9fa207077f09585dc0930",
"score": "0.5162066",
"text": "def sso_enabled?\n sso_enabled\n end",
"title": ""
},
{
"docid": "67cd35d5c8e7988440a65d089465133e",
"score": "0.5159238",
"text": "def insync?(is)\n if is == :true && resource[:authorization_services_enabled] == :true\n true\n elsif is == :absent && resource[:authorization_services_enabled] == :false\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "6b7c6c38b699cbb18276ad55077d047f",
"score": "0.51586133",
"text": "def secure?\n false\n end",
"title": ""
},
{
"docid": "1d0c50a547ba41355d998b96da2c2a5a",
"score": "0.5154278",
"text": "def active_for_authentication?; end",
"title": ""
},
{
"docid": "1d0c50a547ba41355d998b96da2c2a5a",
"score": "0.5154278",
"text": "def active_for_authentication?; end",
"title": ""
},
{
"docid": "0f58522e774138e573777b313eb7722e",
"score": "0.5153669",
"text": "def enable_ssh_without_token_2(s1_ip)\n client=RestClient::Resource.new(\"https://#{s1_ip}/protected/enableSsh.cgi\",:user=>\"Nemuadmin\",:password=>\"nemuuser\",:verify_ssl => OpenSSL::SSL::VERIFY_NONE)\n begin\n # Timeout.timeout(5){\n response=client.get\n # }\n\n if response.body.match(\"SSH Service Enabled Successfully\")\n # puts \"#{s1_ip} enable ssh succ(no token)!\"\n return true \n else\n #puts \"enable ssh for #{s1_ip} fail!(no token)\"\n\n return false\n end\n\n rescue\n #puts $@\n #puts \"enable ssh for #{s1_ip} exception!(no token)\"\n return false\n end\nend",
"title": ""
},
{
"docid": "0f094413a39c41e839189365957a341e",
"score": "0.5153329",
"text": "def xml_authorized?\n self.documento.digital == true\n end",
"title": ""
},
{
"docid": "d60a2b3f4170f78a9cf27f5e36106491",
"score": "0.5151815",
"text": "def service_pt?()\n return true if (@service == TAC_PLUS_AUTHEN_SVC_PT)\n return false\n end",
"title": ""
},
{
"docid": "50fbe71fe7a84868fac664bc44ef75a9",
"score": "0.51465505",
"text": "def authorize_pot\n authorize @pot, :contribute?\n end",
"title": ""
},
{
"docid": "28e8cb94c29fbc592862f87995397cf3",
"score": "0.5145436",
"text": "def provision?\n true\n end",
"title": ""
},
{
"docid": "b1e5d2dabb651303e9f2c07b74d4dde6",
"score": "0.5133488",
"text": "def is_potential_user?\n\t\ttrue\n\tend",
"title": ""
},
{
"docid": "386e01a9bce14c53adaac33cf983f490",
"score": "0.5125833",
"text": "def towerserver?\n physical_type == \"TOWER\"\n end",
"title": ""
},
{
"docid": "63d29ddabc9e563d8d09cef3acac2abe",
"score": "0.512446",
"text": "def enabled?\n !host.nil?\n end",
"title": ""
},
{
"docid": "1af93283998bc44a72ff117e9171dc27",
"score": "0.51232153",
"text": "def can_change_tom?\n self.active? or self.provisional?\n end",
"title": ""
},
{
"docid": "eab0eac375845b2530793adc7ce2fc6b",
"score": "0.51205605",
"text": "def authen_method_none?()\n return true if (@authen_method == TAC_PLUS_AUTHEN_METH_NONE)\n return false\n end",
"title": ""
},
{
"docid": "a855634ffbf1c9f4f1debd4c731b7a2e",
"score": "0.5118642",
"text": "def valid_for_http_auth?; end",
"title": ""
},
{
"docid": "4cbc6d808c5080130b898e05e25dea7d",
"score": "0.5114598",
"text": "def can_edit_stp?\n ticket_params = params[:ticket] \n (ticket_params[:status].nil? and ticket_params[:ticket_type].nil? and ticket_params[:priority].nil?) or \n is_team_member?(current_user.id)\n end",
"title": ""
},
{
"docid": "e8e0b51553a4b91e40c30cbc69710088",
"score": "0.51126266",
"text": "def consigned?\n false\n end",
"title": ""
},
{
"docid": "d55279d2062970d2225332894097c1a0",
"score": "0.5112302",
"text": "def pending?\n !hashed_password && !reviewer?\n end",
"title": ""
},
{
"docid": "24a921f95177f9774ed2a19f2887ab35",
"score": "0.5109134",
"text": "def enable_two_factor!\n update!(otp_required_for_login: true)\n end",
"title": ""
},
{
"docid": "815b049ce42189c796a03d8b77d4594a",
"score": "0.51073503",
"text": "def service_none?()\n return true if (@service == TAC_PLUS_AUTHEN_SVC_NONE)\n return false\n end",
"title": ""
},
{
"docid": "d64c2df3169b11bb349fb6dd06ac6088",
"score": "0.5103462",
"text": "def release_on_approval\n super == 'true'\n end",
"title": ""
},
{
"docid": "72fe1f907f0a79a4eb672863edc62d4e",
"score": "0.510318",
"text": "def active_for_authentication?\n super and self.locked != 1\n end",
"title": ""
},
{
"docid": "ac32e23ed254387dd8ba583025f7e8b0",
"score": "0.5101587",
"text": "def att_register_enabled?\n Figaro.env.respond_to?(:att_client_id) && Figaro.env.respond_to?(:att_client_secret)\n end",
"title": ""
},
{
"docid": "56162ab3fbe53c4254c7f0cccda6891a",
"score": "0.5097863",
"text": "def email_otp\n end",
"title": ""
},
{
"docid": "e15e7d892a87be1c36d6bc589ffc2160",
"score": "0.50921166",
"text": "def stp_enabled_state\n super\n end",
"title": ""
},
{
"docid": "2aa92b326f38bd59c274d978e8fb704c",
"score": "0.50897",
"text": "def unlockable?(resource)\n \tresource.respond_to?(:unlock_access!) &&\n \tresource.respond_to?(:unlock_strategy_enabled?) &&\n \tresource.unlock_strategy_enabled?(:email)\n\tend",
"title": ""
},
{
"docid": "ccbf95b1003798ea90716e4101199353",
"score": "0.5086778",
"text": "def xml_authorized?\n self.firma == true \n end",
"title": ""
},
{
"docid": "fd87602d72966a75fe6c6878f1164200",
"score": "0.50860554",
"text": "def chargeable?; true; end",
"title": ""
},
{
"docid": "288cdd80b3be2a456f9f4a4e634d2d65",
"score": "0.50846934",
"text": "def force_authn?\n force_authn == true\n end",
"title": ""
},
{
"docid": "699e0c018ac8c7822a1d32cbead767bb",
"score": "0.50846446",
"text": "def authorization_mode=(mode); end",
"title": ""
},
{
"docid": "05edbfb48a14f43610da2311d8fb771b",
"score": "0.5075624",
"text": "def basicauth_enabled?\n true\n end",
"title": ""
},
{
"docid": "0468cfa8a991a4b936c59c87fe6c0e62",
"score": "0.5074264",
"text": "def check_paid_status\n # FIXME: we can't use pluot, as it's too out of date\n # re-implement this with our own Wild Apricot REST wrapper?\n return true\n # api_key = ENV['WILD_APRICOT_API_KEY']\n # aid = 66796\n # # Pluot.api_key = api_key\n # # Pluot.account_id = aid\n # logger.warn(\"e-Mail eq #{self.email}\")\n # begin\n # response = Pluot.contacts.filter(\"e-Mail eq #{self.email}\")\n # rescue Faraday::ConnectionFailed => e\n # print e\n # return false\n # end\n # logger.warn(response)\n # if response.blank?\n # # probably an issue where we were unable to connect with wild apricot at all\n # return true\n # end\n # contact = response[:Contacts]\n # logger.warn(contact)\n # if !contact.blank?\n # contact = contact[0]\n # logger.warn(contact)\n # if contact[:Status] && contact[:Status] == \"Active\"\n # logger.warn(\"active\")\n # return true\n # else\n # logger.warn(\"not active\")\n # return false\n # end\n # else\n # logger.warn(\"no user found\")\n # return false\n # end\n end",
"title": ""
},
{
"docid": "6647d7257df9bcbdda482f149f4c0e67",
"score": "0.5067937",
"text": "def pending?\n (status == ConfigCenter::User::PENDING)\n end",
"title": ""
},
{
"docid": "93b4c94515fd8e344e76efd56bdc09b3",
"score": "0.50657",
"text": "def test_does_not_add_via_header\n response = Typhoeus.get(\"http://127.0.0.1:9080/api/info/\", http_options)\n assert_response_code(200, response)\n data = MultiJson.load(response.body)\n refute(data[\"headers\"][\"via\"])\n end",
"title": ""
},
{
"docid": "244d9471769c03082b5810ca188ea22e",
"score": "0.5064367",
"text": "def pingable?\n true\n end",
"title": ""
},
{
"docid": "1a14c4a6ad21e23caf1ec99f773d3967",
"score": "0.5064342",
"text": "def secure?\n false\n end",
"title": ""
},
{
"docid": "b5307bde3f5368810a5614acce9d368e",
"score": "0.5063672",
"text": "def esmtp?\n false\n end",
"title": ""
},
{
"docid": "60f62966b0d767ca5a30420155725cfd",
"score": "0.50594175",
"text": "def action_allowed?\n current_user_has_ta_privileges?\n end",
"title": ""
},
{
"docid": "60f62966b0d767ca5a30420155725cfd",
"score": "0.50594175",
"text": "def action_allowed?\n current_user_has_ta_privileges?\n end",
"title": ""
},
{
"docid": "f6e098fbaa40675779cef82ecdb4273e",
"score": "0.5054852",
"text": "def capable_login_auth?; end",
"title": ""
},
{
"docid": "6400a5a84477e663acf9b7e94b3a8cfa",
"score": "0.50519687",
"text": "def private?\n self.privacy == PASSWORD\n end",
"title": ""
},
{
"docid": "a3f6256181795ff0d752821d4e15afab",
"score": "0.50502706",
"text": "def supports_required_capabilities?(tcp)\n (ToolProxy::ENABLED_CAPABILITY - tcp['capability_offered']).blank?\n end",
"title": ""
}
] |
93c6a0f2273cd072412da56261fbe675
|
Use ERB to render templates
|
[
{
"docid": "e5a3cb773190b799a8e86b28aa2a0218",
"score": "0.7234634",
"text": "def render(data)\n ERB.new(data, trim_mode: '-').result(binding)\n end",
"title": ""
}
] |
[
{
"docid": "27fd9ace277ebb6df907282a5ae77a9b",
"score": "0.820768",
"text": "def render() ERB.new(@template, nil, '-').result( binding ) end",
"title": ""
},
{
"docid": "190ecaeac44dba134807d07937bc4d3b",
"score": "0.79941493",
"text": "def render(template)\n ERB.new(template).result(binding)\n end",
"title": ""
},
{
"docid": "a2040615a98c5e3c3c6dbc1a6e7cf282",
"score": "0.7907324",
"text": "def process_template(content)\n ERB.new(content, 0, \"%<>\").result(binding)\n end",
"title": ""
},
{
"docid": "c18af95b6df65e20000f3cb7cb8c69ed",
"score": "0.78649086",
"text": "def render\n require 'erb'\n ERB.new(@template).result(binding)\n end",
"title": ""
},
{
"docid": "8bb9a4c0d8dfd756cb8b43ddf7d02a97",
"score": "0.7850949",
"text": "def render(template)\n Erubis::Eruby.new(File.read(\"#{TEMPLATES_PATH}/#{template}.html.erb\")).result(binding)\n end",
"title": ""
},
{
"docid": "8bb9a4c0d8dfd756cb8b43ddf7d02a97",
"score": "0.7850949",
"text": "def render(template)\n Erubis::Eruby.new(File.read(\"#{TEMPLATES_PATH}/#{template}.html.erb\")).result(binding)\n end",
"title": ""
},
{
"docid": "c6fedaf36ce28deefa948fcea4516afa",
"score": "0.783047",
"text": "def erb(template)\n t = File.open(template).read\n template = t.to_s \n html = ERB.new(template).result(binding)\n \n self.write(html)\n end",
"title": ""
},
{
"docid": "6350e5f0408d111222b0acb1b66690fd",
"score": "0.77947587",
"text": "def render(template_path)\n template = File.open(template_path, 'r').read\n erb = ERB.new(template)\n erb.result(binding)\nend",
"title": ""
},
{
"docid": "cd0d4004176a36597db55921503f9c6c",
"score": "0.77773434",
"text": "def process_erb(template)\n # puts \"View process_erb\"\n ERB.new(template, 0, \"%<>\").result(binding)\n end",
"title": ""
},
{
"docid": "0c668318a777d7bea246357b2c135cb3",
"score": "0.77643263",
"text": "def render(template)\n ERB.new(template).result(binding)\n end",
"title": ""
},
{
"docid": "027a0859ba92f8506fe778bbda0be9fc",
"score": "0.77214307",
"text": "def render\n\t\treturn ERB.new(@template).result(binding())\n\tend",
"title": ""
},
{
"docid": "7ab8cb6d703e9f64a1e2bb2d8818c443",
"score": "0.77082264",
"text": "def render\n ERB.new(File.read(@path_to_template)).result(@binding)\n end",
"title": ""
},
{
"docid": "5f84c8ad14ba6cf6ee08c9e3246210b8",
"score": "0.7703651",
"text": "def render(filename, eoutvar)\n content = File.read(filename)\n erb = ERB.new(content, nil, '<>', eoutvar = eoutvar)\n erb.result\nend",
"title": ""
},
{
"docid": "7619b37af1801d7eb84d6e2e3790c126",
"score": "0.76659036",
"text": "def __render__(locals = {})\n @locals = OpenStruct.new(locals)\n ERB.new(@content, nil, nil, \"@erbout\").result(binding)\n rescue TemplateError => ex\n raise ex\n rescue StandardError => ex\n raise TemplateError.new(self, ex.message, ex)\n end",
"title": ""
},
{
"docid": "259e60a1625f90aa3b5ce0d680a3c61d",
"score": "0.766238",
"text": "def erb(filename, local = {}, template)\n message = local[:message]\n\n content = template\n ERB.new(content).result(binding)\nend",
"title": ""
},
{
"docid": "9e07bcacecf69ab8b173e97fb1c5a819",
"score": "0.7655932",
"text": "def render(templatename)\n content = File.read(File.join(@template_dir, templatename))\n t = ERB.new(content, nil, '-')\n t.result(binding)\n end",
"title": ""
},
{
"docid": "c598100307aabb17e359820a620f6ca4",
"score": "0.76162046",
"text": "def erb(filename)\n path = File.expand_path(\"../views/#{filename}.erb\", __FILE__)\n content = File.read(path)\n ERB.new(content).result # this returns our ERB object with HTML rendered\nend",
"title": ""
},
{
"docid": "d7c030e957ba9ba4eb36b11599ea322e",
"score": "0.7605218",
"text": "def erb_render(template_path, data)\n template = File.read(template_path).untaint\n ERB.new(template, render_safe).result(binding)\n end",
"title": ""
},
{
"docid": "f52945263c4ddc2602cc990689ba3500",
"score": "0.7575104",
"text": "def render(template, params={})\n path, tname = File.split(template)\n template = File.read(root + \"app/views\" + path + \"_#{tname}.html.erb\")\n Erubis::Eruby.new(template).result(hash_to_binding params)\n end",
"title": ""
},
{
"docid": "34d97d39d625e7b8fe53c8295fcf0056",
"score": "0.7558475",
"text": "def erb_render(fixture_content)\r\n b = binding\r\n ERB.new(fixture_content).result b \r\n end",
"title": ""
},
{
"docid": "353d5594cfc5b251d4969cfce6b0a170",
"score": "0.7556773",
"text": "def erb(template, vars)\n ERB.new(template).result(OpenStruct.new(vars).instance_eval { binding })\nend",
"title": ""
},
{
"docid": "2878a5ce7a9c1af146b75b5c98af568d",
"score": "0.7520865",
"text": "def erb(template)\n \t\ttemplate_file = File.open(\"tuit.html.erb\", 'r')\n \t\tERB.new(File.read(template_file)).result(binding)\n\tend",
"title": ""
},
{
"docid": "2e08ca39d6175480881f91bde68b8942",
"score": "0.7493109",
"text": "def render_erb_template(filename)\n template = File.read(filename)\n result = ERB.new(template).result(binding)\n end",
"title": ""
},
{
"docid": "2e08ca39d6175480881f91bde68b8942",
"score": "0.7493109",
"text": "def render_erb_template(filename)\n template = File.read(filename)\n result = ERB.new(template).result(binding)\n end",
"title": ""
},
{
"docid": "2e08ca39d6175480881f91bde68b8942",
"score": "0.7493109",
"text": "def render_erb_template(filename)\n template = File.read(filename)\n result = ERB.new(template).result(binding)\n end",
"title": ""
},
{
"docid": "2e08ca39d6175480881f91bde68b8942",
"score": "0.7493109",
"text": "def render_erb_template(filename)\n template = File.read(filename)\n result = ERB.new(template).result(binding)\n end",
"title": ""
},
{
"docid": "2e08ca39d6175480881f91bde68b8942",
"score": "0.7493109",
"text": "def render_erb_template(filename)\n template = File.read(filename)\n result = ERB.new(template).result(binding)\n end",
"title": ""
},
{
"docid": "2e08ca39d6175480881f91bde68b8942",
"score": "0.7493109",
"text": "def render_erb_template(filename)\n template = File.read(filename)\n result = ERB.new(template).result(binding)\n end",
"title": ""
},
{
"docid": "cc2427da5d8aa0ba19450657dbb575da",
"score": "0.7461647",
"text": "def erb_render(fixture_content)\n b = binding\n ERB.new(fixture_content).result b \n end",
"title": ""
},
{
"docid": "cc2427da5d8aa0ba19450657dbb575da",
"score": "0.7461647",
"text": "def erb_render(fixture_content)\n b = binding\n ERB.new(fixture_content).result b \n end",
"title": ""
},
{
"docid": "f174c97af83313a418049604cf48783f",
"score": "0.741368",
"text": "def erb_template(filename, params = {})\n ERB.new(file(filename), nil, '-').result(Namespace.new(params).get_binding)\nend",
"title": ""
},
{
"docid": "c59da81e84d827303af41e3f576f81b4",
"score": "0.7402748",
"text": "def render_erb(string,b)\n render_response execute_template(string,b)\n end",
"title": ""
},
{
"docid": "aeca55403dc9115e55b499696313269f",
"score": "0.73797095",
"text": "def execute_template(string, b)\n ERB.new(string).result b\n end",
"title": ""
},
{
"docid": "30346e18bcb856b03027d58fa438af23",
"score": "0.7362927",
"text": "def render(template)\n\n\t\t\tpath=File.expand_path(\"../app/view/#{template}.html.erb\",__FILE__)\n\t\t\tERB.new(File.read(path)).result(binding)\n\n\t\tend",
"title": ""
},
{
"docid": "94a00073df99257168bcb0f0709278be",
"score": "0.7338518",
"text": "def erb(template)\n \t\ttemplate_file = File.open(\"twitter.html.erb\", 'r')\n \t\tERB.new(File.read(template_file)).result(binding)\n\tend",
"title": ""
},
{
"docid": "7d0ef7ac55fa76df41b6ffc4039b3fbb",
"score": "0.73171175",
"text": "def render(source)\n template = ERB.new(source)\n template.result(binding)\n end",
"title": ""
},
{
"docid": "d6b036b8523e4a9a0fb113d76039a9f7",
"score": "0.7275627",
"text": "def render(template_name)\n #Use controller & template_name to construct path\n directory_path = Dir.pwd\n # dir_path = File.dirname(__FILE__)\n path = directory_path + '/views/' + self.class.to_s.underscore + '/' + template_name.to_s + '.html.erb'\n f = File.read(path) #Use File.red to read template file\n #Create new ERB template from contents\n #Evaluate ERB template using binding to capture controller's instance vaiarlbes\n content = ERB.new(f).result(binding)\n #result(binding) - allows you to pull out/use anything in ERB tag\n #Pass result ot render_content with a content_type='text/html'\n render_content(content, 'text/html')\n end",
"title": ""
},
{
"docid": "b378aa6a9470d488f4c1946ee177c6e2",
"score": "0.7275267",
"text": "def resolve_template content\n require 'erb'\n ERB.new(content, nil, '>').result(binding)\n end",
"title": ""
},
{
"docid": "e120b739766586502bda28c232addfdc",
"score": "0.72736037",
"text": "def render_view(template, locals)\n page = erb template, locals: locals\n settings.renderer.call page\n end",
"title": ""
},
{
"docid": "5b6f65eb92b2f31ce4f16042fb3880f9",
"score": "0.72688997",
"text": "def render\n # Now we can determine the view, *.html.erb, file path\n template = File.read(view_filename)\n\n # Pass the contents of the view to erubis\n eruby = Erubis::Eruby.new(template)\n\n # binding() - make all the variables in this object available\n # inside the view template\n # result - Generate HTML from the view.\n eruby.result(binding)\n end",
"title": ""
},
{
"docid": "f6921774d6ba1e2629b657ce8f54590e",
"score": "0.7268336",
"text": "def render(template)\n\t\tpath = File.expand_path(\"../views/#{template}\", __FILE__)\n\t\tERB.new(File.read(path)).result(binding)\n\tend",
"title": ""
},
{
"docid": "233027c02931ba217831fd15adf13637",
"score": "0.726706",
"text": "def render(template); end",
"title": ""
},
{
"docid": "4a8b6b8af206247485757ddeeeb4a8b2",
"score": "0.72597784",
"text": "def erbify(file)\n ERB.new(File.read(file)).result(binding)\nend",
"title": ""
},
{
"docid": "f02d07c6371367abd14a97b574f93ff7",
"score": "0.7241716",
"text": "def render(b = binding)\n res = ERB.new(File.read(self.path)).result(b)\n res\n end",
"title": ""
},
{
"docid": "cb64330fe400f5ccc32eda0aa220759f",
"score": "0.72346705",
"text": "def render(template, environment)\n vars = OpenStruct.new(@template_vars[environment]).instance_eval { binding }\n ERB.new(File.read(template)).result(vars)\n end",
"title": ""
},
{
"docid": "43a1a9fe4edb48fa726b6ac7d2af7cd2",
"score": "0.72282284",
"text": "def erb(str)\n ERB.new(str).result(@erb_config.get_binding)\n end",
"title": ""
},
{
"docid": "10d7ff197db830a1ec348fba9887a907",
"score": "0.72017384",
"text": "def html(entry,erb_template=DEFAULT_TEMPLATE,caller_binding=binding) \n if erb_template.kind_of?(ERB)\n template=erb_template\n else\n template=ERB.new(erb_template,nil,'<>')\n end \n template.result(binding)\n end",
"title": ""
},
{
"docid": "897782da252db24eb0c873f69338696b",
"score": "0.7200847",
"text": "def erb_render(file, obj, options={})\n ERB.new(File.read(file)).result(obj.send(:binding))\n end",
"title": ""
},
{
"docid": "19b529f46cb9408ac465631c301e0fe3",
"score": "0.7196359",
"text": "def render_template(template, context)\n begin\n eruby = Erubis::Eruby.new(template)\n output = eruby.evaluate(context)\n rescue Object => e\n raise TemplateError.new(e, template, context)\n end\n Tempfile.open(\"chef-rendered-template\") do |tempfile|\n tempfile.print(output)\n tempfile.close\n yield tempfile\n end\n end",
"title": ""
},
{
"docid": "54bac3aada202e4995dcfab0de7d52f7",
"score": "0.719574",
"text": "def render(template, context = nil)\r\n template_path = File.expand_path(\r\n \"#{File.dirname(__FILE__)}/#{template}.xml.erb\"\r\n )\r\n template = File.read(template_path)\r\n Erubis::Eruby.new(template).result(context)\r\n end",
"title": ""
},
{
"docid": "aa36f50ac3f81c30cc267879ce134e09",
"score": "0.7191373",
"text": "def load_erb(filename)\n template_file = File.new(filename).read\n ERB.new(template_file, nil, '<>')\nend",
"title": ""
},
{
"docid": "f80660c28a65196f9a25875915b983c0",
"score": "0.7190392",
"text": "def erb(file)\n scope = Context.new(script).to_binding\n text = File.read(file)\n ERB.new(text).result(scope)\n end",
"title": ""
},
{
"docid": "6ace64518f1b32f571cd99faa1eb475d",
"score": "0.7181916",
"text": "def render_erb (path = @file_path)\n content = \"\"\n # need to make sure we are only the main index and not sub page\n base_dir = @file_path\n base_dir = \"/\" if @file_path==(\"/index.md\")\n begin\n content = File.read(@root + base_dir + path)\n t = ERB.new(content)\n content = t.result(binding)\n rescue StandardError => e\n #content = e.message\n #content = \"<!--#{e.message}-->\"\n content = \"\"\n end\n content\n end",
"title": ""
},
{
"docid": "4de8698fc9da2745068eb7e22d727513",
"score": "0.7181701",
"text": "def render_erb(&code)\n template, layout, locals = ErbRenderHelper.new.render &code\n\n erb template,\n :layout => layout,\n :locals => locals\n end",
"title": ""
},
{
"docid": "6795a15bd8f934b486521809313cca14",
"score": "0.71643543",
"text": "def render(template_name)\n #use template name to build path to file\n path = File.join(\"views\", self.class.to_s.underscore, template_name.to_s)\n res.write(File.read(path + \".html.erb\"))\n # create a single html file by evaling the erb\n #File.read(data)\n end",
"title": ""
},
{
"docid": "f2c51402f0d85d93e78ec4c7e566da3e",
"score": "0.7147326",
"text": "def protected_erb(template)\n error MissingTemplateError, \"Can't find template file #{template}\" unless File.exists?(template)\n source = File.read(template)\n @stdout.puts ERB.new(source, @safety, @trim_mode).result(@binding)\n end",
"title": ""
},
{
"docid": "10445ced4cf03e57468a2512b20407bf",
"score": "0.7143826",
"text": "def render_template(template, filename = template)\n html = File.read(\"./app/views/#{template}.erb\")\n doc = ERB.new(html)\n\n yield if block_given?\n\n File.open(\"#{@rendered_path}/#{filename}\", \"w+\") do |f|\n f << doc.result(binding)\n end\n end",
"title": ""
},
{
"docid": "c438ba46b5f0de11ec4458e013e89ad2",
"score": "0.71367633",
"text": "def display_erb(template)\n template = Erubis::Eruby.new(File.read(\"#{ATHENRY_ROOT}/lib/athenry/templates/#{template}\"))\n puts template.result(binding())\n end",
"title": ""
},
{
"docid": "ef4e2578411902daa2f3904e0b6c622e",
"score": "0.7113846",
"text": "def content\n ERB.new(template).result(binding)\n end",
"title": ""
},
{
"docid": "caf4bb03fe048733af84c4cb0aeb1187",
"score": "0.7110957",
"text": "def evaluate_erb; end",
"title": ""
},
{
"docid": "427d827ed562ffde44f0eebc4b43ab2c",
"score": "0.71102315",
"text": "def _render_template(options); end",
"title": ""
},
{
"docid": "5cf47724f9f39ed42184a91df2c9588b",
"score": "0.7108341",
"text": "def erb_result(template, data)\n ERB.new(template, nil, \"%<>\").result(data.get_binding)\n end",
"title": ""
},
{
"docid": "bc658294214eb9ebf56ee92b0e33d383",
"score": "0.7095597",
"text": "def erb(filename, local = {})\n b = binding\n message = local[:message]\n path = File.expand_path(\"../views/#{filename}.erb\", __FILE__)\n content = File.read(path)\n ERB.new(content).result(b)\nend",
"title": ""
},
{
"docid": "105e3da44f9396f6a172fd63c1db1004",
"score": "0.7089417",
"text": "def render(str)\n ERB.new(str, trim_mode: \"-\").result(binding)\n end",
"title": ""
},
{
"docid": "8c4a00f60e2ddd82f61a44dc8103b62a",
"score": "0.7084437",
"text": "def cli_helper_process_erb(file_contents)\n erb_contents = ERB.new(file_contents).result\n return erb_contents\n end",
"title": ""
},
{
"docid": "6dbaba16c45ec2a89d777946809bd5bc",
"score": "0.7080338",
"text": "def render_erb(template, options={}, filename=nil)\n # assign locals to the render binding\n # this almost surely may be optimized...\n locals = options[:locals]\n binding = render_erb_binding\n\n locals.each_pair do |key, value|\n @assignment_value = value\n eval(\"#{key} = remove_instance_variable(:@assignment_value)\", binding)\n end if locals\n\n erb = ERB.new(template, nil, \"<>\")\n erb.filename = filename\n erb.result(binding)\n end",
"title": ""
},
{
"docid": "b5a026a7d3d6c3eec987738fd03a6ec2",
"score": "0.7075277",
"text": "def render(template_name)\n dir_name = File.dirname(File.dirname(__FILE__))\n path = File.join(dir_name, 'views', snake_case, \n \"#{template_name}.html.erb\")\n stuff = File.read(path)\n render_content(ERB.new(stuff).result(binding))\n end",
"title": ""
},
{
"docid": "f5018fe09a18da34d6c30fc006462d08",
"score": "0.7074796",
"text": "def generate\n b = crate.get_binding\n renderer = ERB.new(template)\n renderer.result(b)\n end",
"title": ""
},
{
"docid": "7beec930a3338eef012a12f5bda86f69",
"score": "0.70722336",
"text": "def render(template_name)\n template = File.readlines(\"views/#{self.class.name.underscore}/#{template_name}.html.erb\")\n render_content(ERB.new(\"<%= template %>\").result(binding), \"text/html\")\n end",
"title": ""
},
{
"docid": "24d97d4636944d11ac81d95aaf5845d1",
"score": "0.70608264",
"text": "def run_erb(in_binding = binding)\n require 'erb'\n ERB.new(self.to_s, nil, '>').result(in_binding)\n end",
"title": ""
},
{
"docid": "71118660cf4dddff9eeca926aa8becd3",
"score": "0.7059533",
"text": "def render_template(template, object)\n renderer = ERB.new(File.read(File.dirname(__FILE__) + template))\n return renderer.result(object.instance_eval {binding})\n end",
"title": ""
},
{
"docid": "181b0c7ac7443029e37eb3daa906e0c2",
"score": "0.704211",
"text": "def render_erb_file(path:, contents:, binding:)\n erb = ERB.new(contents, trim_mode: \"-\")\n erb.filename = path.to_s\n erb.result(binding)\n end",
"title": ""
},
{
"docid": "50b35910b84813c38aafb1ef1e8fcd95",
"score": "0.7039673",
"text": "def render_template(opts={})\n template_file_path = File.expand_path(TEMPLATE_PATH, __FILE__)\n template_file = File.read(template_file_path)\n erb_template = ERB.new(template_file)\n last_bootstrap_line = LAST_BOOTSTRAP_LINE\n generated_template = erb_template.result(binding)\n @log.debug \"genereated template is #{generated_template}\"\n return generated_template\n end",
"title": ""
},
{
"docid": "50b35910b84813c38aafb1ef1e8fcd95",
"score": "0.7038973",
"text": "def render_template(opts={})\n template_file_path = File.expand_path(TEMPLATE_PATH, __FILE__)\n template_file = File.read(template_file_path)\n erb_template = ERB.new(template_file)\n last_bootstrap_line = LAST_BOOTSTRAP_LINE\n generated_template = erb_template.result(binding)\n @log.debug \"genereated template is #{generated_template}\"\n return generated_template\n end",
"title": ""
},
{
"docid": "50b35910b84813c38aafb1ef1e8fcd95",
"score": "0.7038973",
"text": "def render_template(opts={})\n template_file_path = File.expand_path(TEMPLATE_PATH, __FILE__)\n template_file = File.read(template_file_path)\n erb_template = ERB.new(template_file)\n last_bootstrap_line = LAST_BOOTSTRAP_LINE\n generated_template = erb_template.result(binding)\n @log.debug \"genereated template is #{generated_template}\"\n return generated_template\n end",
"title": ""
},
{
"docid": "e96665f132387efeb524178252094d67",
"score": "0.7036876",
"text": "def render_template\n _render(:template)\n end",
"title": ""
},
{
"docid": "ece17fd969fd418f6e1a40ef7c03ee84",
"score": "0.7033739",
"text": "def to_html\n @rendered ||= ERB.new(template).result(binding)\n end",
"title": ""
},
{
"docid": "65ee0fd8c627d75019bc13b8d2504665",
"score": "0.70185345",
"text": "def render\n self.create_storage_dir()\n @template = template_path('erb')\n @contents = erb.result(binding)\n end",
"title": ""
},
{
"docid": "2bbf68cc7714c9f8a5d5c20a0dfd420c",
"score": "0.7009212",
"text": "def template(from, to)\n erb = File.read(from)\n put ERB.new(erb).result(binding), to\nend",
"title": ""
},
{
"docid": "cf18bfd506b5fc4065c54b6ae37b023c",
"score": "0.70061076",
"text": "def template(src, context=binding)\n eruby = Erubis::Eruby.new(src)\n eruby.result(context)\n rescue Object => e\n raise Sprinkle::Errors::TemplateError.new(e, src, context)\n end",
"title": ""
},
{
"docid": "4a6f6af8c30c09b083b0b70bf0b32fa1",
"score": "0.6993876",
"text": "def render_f(path)\n ERB.new(File.read(path)).result(binding)\n end",
"title": ""
},
{
"docid": "71135d73ed3f598c8ad4a084e859698c",
"score": "0.6988113",
"text": "def render(template, output = nil)\n result = ERB.new(File.read(template), 0, '-').result(binding)\n if !output.nil?\n File.open(output, \"w\") do |file|\n file.write(result)\n end\n else\n puts result\n end\n end",
"title": ""
},
{
"docid": "d395a2a3928d354a3a42b60efa98603d",
"score": "0.69820577",
"text": "def render(template_name)\n # @res.File.read\n path = File.dirname(__FILE__)\n template_path = File.join(path, \"..\", \"views\", self.class.name.underscore, \"#{template_name}.html.erb\")\n\n read_template = File.read(template_path)\n\n render_content(ERB.new(read_template).result(binding),'text/html')\n end",
"title": ""
},
{
"docid": "723ea774afca49f9336331d739d25654",
"score": "0.6972793",
"text": "def process_template(file_path, options)\n\t\ttemplate_data = File.read(file_path)\n\n\t\tERB.new(template_data).result binding\n\tend",
"title": ""
},
{
"docid": "0008439d9f650ecc52ea59437fb7e66a",
"score": "0.6971347",
"text": "def render(file, locals = {})\n erb_context = binding\n locals.each { |key, value| erb_context.local_variable_set(key, value) }\n ERB.new(File.read(\"build/text/#{file}.tex.erb\"), nil, nil, '_sub01').result(erb_context)\nend",
"title": ""
},
{
"docid": "b54685c193a9d519525afae32ca63821",
"score": "0.69636863",
"text": "def process_with_erb(text, context)\n begin\n ERB.new( text ).result( context.get_binding )\n rescue\n raise \"ERB Error: #{$!}\"\n end\n end",
"title": ""
},
{
"docid": "de217874881b1826547b5791bed7d24d",
"score": "0.6961968",
"text": "def render_template\n template = File.join(File.dirname(__FILE__), 'templates', \"#{format}.erb\")\n raise \"No such format - #{format}\" unless File.exist?(template)\n result = erb(template)\n publish(result) \n end",
"title": ""
},
{
"docid": "1660e580dddfb869ab216d3ace0d4ba2",
"score": "0.6943271",
"text": "def generate(context)\n ERB.new(TEMPLATE).result(context)\n end",
"title": ""
},
{
"docid": "3ad48c1f66a3972302635112debb5a69",
"score": "0.6925596",
"text": "def render_custom\n #raise ArgumentError unless File.exist?(template)\n result = erb(template)\n publish(result) \n end",
"title": ""
},
{
"docid": "dde787c3ba59de5950b54406ef559174",
"score": "0.6924501",
"text": "def render(template_name)\n t_path = \"views/#{self.class.to_s.underscore}/#{template_name}.html.erb\"\n t_content = File.read(t_path)\n \n erb = ERB.new(t_content)\n render_content(erb.result(binding), 'text/html')\n end",
"title": ""
},
{
"docid": "ecc8b83df0014480ce0469d847c83a53",
"score": "0.6919015",
"text": "def render_erb( bind = nil )\n raise \"No data to render!\" if (! data)\n @_erbout = \"\"\n self.rendered = ERB.new(data, nil, nil, '@_erbout').result( bind )\n end",
"title": ""
},
{
"docid": "bb67cb6b57932c5f4374decc85c4915d",
"score": "0.6913442",
"text": "def render\n @templates.reverse.inject(nil) do |previous, template|\n context = vars.binding do |*args|\n what = args.first\n what ? vars.content_for(what) : previous\n end\n \n case template\n when Haml::Engine\n self.class.silence_warnings do\n template.to_html(context)\n end\n when Sass::Engine\n self.class.silence_warnings do\n template.to_css\n end\n when String\n ERB.new(template).result(context)\n else\n raise \"don't know how to handle templates of class #{template.class.name.inspect}\"\n end\n end\n end",
"title": ""
},
{
"docid": "5789b65da729e0e73eb2d8a1a2ebc3e4",
"score": "0.6908683",
"text": "def render()\n ERB.new(File.read(\"webroot/tmp_resp.rhtml\")).result(binding)\n end",
"title": ""
},
{
"docid": "ce5958fb951ee36a9a115ca33d47c9d0",
"score": "0.6906413",
"text": "def render(template)\n path = File.join(File.dirname(__FILE__), \"exacttarget/templates/#{template.to_s}.xml.erb\")\n file = File.open(path, 'r').read\n ERB.new(file, 0, '<>').result(binding)\n end",
"title": ""
},
{
"docid": "ac92ff2804cf592aaa3ae10d5d9000e1",
"score": "0.69011027",
"text": "def render\n raise \"unable to find template file: #{template}\" unless File.exists?(template)\n\n extension = File.extname(template)\n extension = extension.downcase if extension\n\n case extension\n when '.erb'\n contents = File.open(template, \"r\") {|f| f.read}\n ERB.new(contents, nil, '-').result(self.get_binding)\n when '.slim'\n Slim::Template.new(template, {:pretty => true}).render(self)\n else\n raise \"unsupported template type based on file extension #{extension}\"\n end\n end",
"title": ""
},
{
"docid": "3cc770b6c3547f096b1355524e56fd3b",
"score": "0.6898938",
"text": "def render(template)\n template.result(binding { yield })\n end",
"title": ""
},
{
"docid": "4c1bd6a23ab683ae64984533fa2efaf6",
"score": "0.6894233",
"text": "def erb(file, b=binding)\n require 'erb'\n ERB.new(File.read(file), nil, '-').result(b)\n end",
"title": ""
},
{
"docid": "1e1eaadb92b8bc6822d029f1f52dfadd",
"score": "0.689012",
"text": "def build\n template_file = File.join(File.dirname(__FILE__), @template_file)\n erb = ERB.new(File.read(template_file))\n erb.result binding\n end",
"title": ""
},
{
"docid": "8838ba3472c5c7031dd64e95e8bc0710",
"score": "0.6883032",
"text": "def render(file, locals)\n erb = ERB.new(read(file))\n erb.filename = file\n erb.result(CIAT::TemplateBinder.new(locals).get_binding)\n end",
"title": ""
},
{
"docid": "d446bf4e4feabdfdeb145df7f729acc1",
"score": "0.68808883",
"text": "def render_template(path, &block)\n Tilt.new(file(path)).render(self, &block)\n end",
"title": ""
}
] |
1606a2e87a43b62f8a9505896e920dd3
|
def scrape_student_tag_line(scrape_result) "This is a tag line" end
|
[
{
"docid": "ec746ecaa5cc06789f116dd57380f7b1",
"score": "0.6382751",
"text": "def scrape_student_quote(scrape_result)\n scrape_result.css(\"div.textwidget h3\").children.to_s.strip.gsub(/\\s+/, \" \")\n end",
"title": ""
}
] |
[
{
"docid": "255e712036e0b2074fd0371db680f63e",
"score": "0.6300728",
"text": "def tagline\n document.xpath(\"//h4[text()='Taglines:']\").first.next_sibling.text.imdb_unescape_html rescue nil\n end",
"title": ""
},
{
"docid": "ab14e6233a9e912a427b0d6105dd1a1a",
"score": "0.6236407",
"text": "def return_tag(text); end",
"title": ""
},
{
"docid": "43df72cb0c9a37ebaffcb5e6cb164122",
"score": "0.58701193",
"text": "def showResultSubTag(tag_name)\n print \"@@#{tag_name}@@\"\nend",
"title": ""
},
{
"docid": "3b6e7f7845d3cee55a8d1ffb009c51ad",
"score": "0.58476985",
"text": "def second_scrape(string) #Format output nd improvement\n comb_str = @base_url + string\n html = open(comb_str)\n trail_parsed_to_html = Nokogiri::HTML(html)\n trail_parsed_to_html.css('p').text #returns summary & parking paragraphs\n end",
"title": ""
},
{
"docid": "908cedaf97603f4612cb742c3a473444",
"score": "0.5842569",
"text": "def scrape\n @doc.xpath(\"//a[@class='textlink']\").each do |link|\n stuff = /http:\\/\\/ssrn\\.com\\/abstract=([0-9]+)/.match(link['href'])\n @abstractlist.push stuff[1] if stuff\n end\n # get author name information\n namestring = @doc.xpath(\"//h1\")[0].inner_text\n @lastName, @firstName = namestring.split\n @lastName.gsub!(/,$/, '')\n end",
"title": ""
},
{
"docid": "a9c7f9938dc9b5b5cfe99fd47254035a",
"score": "0.5824228",
"text": "def example_tag(text); end",
"title": ""
},
{
"docid": "5860a84c76b9cd6177ea68bb744a0d6d",
"score": "0.579469",
"text": "def scrape_tag_text tag\n index = 0\n html_tags = @data.css(tag)[index]\n if @data.css(tag).count > 0 && html_tags != nil\n html_tags.each do |i|\n puts html_tags.text\n end\n else\n puts 'no ' + tag + ' tags found'\n end\n end",
"title": ""
},
{
"docid": "1af8fceb1967598b1cd6ebc6cd52db8d",
"score": "0.5774291",
"text": "def get_tagline(doc)\n father = nil\n tagline = ''\n doc.xpath('//h4[@class=\"inline\"]').each do|v|\n father = v unless v.content != 'Taglines:'\n end\n\n if(!father.nil?)\n father = father.parent\n tagline = father.children[2].content.strip\n end\n tagline\n end",
"title": ""
},
{
"docid": "db6015582e6779ec198c7a651da47a8e",
"score": "0.5755053",
"text": "def see_tag(text); end",
"title": ""
},
{
"docid": "20b27087e4bda39041fcf7194929da16",
"score": "0.5754092",
"text": "def return_student_urls(doc)\n url_array = []\n doc.search(\"h3 a\").each do |item|\n unless item.values[0] == \"#\"\n url_array << \"http://students.flatironschool.com/\" + \"#{item.values[0].downcase}\"\n puts \"http://students.flatironschool.com/\" + \"#{item.values[0].downcase}\"\n end\n end\n url_array\nend",
"title": ""
},
{
"docid": "1297b5c2bb91249e2962140b4cd39450",
"score": "0.57491666",
"text": "def scrape_into(page, product_information, product); end",
"title": ""
},
{
"docid": "33b1269881e2838c8c15b334bd1c70f3",
"score": "0.57210535",
"text": "def scrape_students(index_html)\n # Loop through each student profile URL in @students\n @students_html_array.each_with_index do |student_html, index|\n begin\n puts\n student_page = Nokogiri::HTML(open(\"#{index_html}/#{student_html}\"))\n\n # Get student's name\n name_css_selector = \"h4.ib_main_header\"\n html_tag_for_name = student_page.css(name_css_selector).first # will return nil if the ib_main_header css selector is not found\n # puts html_tag_for_name.class => Nokogiri::XML::Element\n\n # only scrape the rest of page if html_tag_for_name is found (to make sure that only correctly formatted pages are scraped)\n if html_tag_for_name\n puts \"...scraping: #{student_html}\"\n\n info = {}\n info[:name] = html_tag_for_name.content\n\n prof_pic_selector = \"div .student_pic\"\n info[:prof_pic] = student_page.css(prof_pic_selector).attr(\"src\").to_s\n\n social_media_selector = \"div.social-icons a\"\n info[:twitter] = student_page.css(social_media_selector)[0].attr(\"href\")\n info[:linkedin] = student_page.css(social_media_selector)[1].attr(\"href\")\n info[:github] = student_page.css(social_media_selector)[2].attr(\"href\")\n info[:blog] = student_page.css(social_media_selector)[3].attr(\"href\")\n\n quote_selector = \"div.section-testimonials-curriculum div.textwidget\"\n info[:quote] = student_page.css(quote_selector).text\n\n # section_title_selector = \"div.section-title span.actual-title\"\n # info[:section_titles] = student_page.css(section_title_selector).collect{|x| x.text}\n\n # services_selector = \"div.ok-text-column\"\n # info[:services] = student_page.css(services_selector).collect{|x| x.inner_html}\n \n # section_selector = \"div.this-div-is-just-a-helpful-container\"\n # section_htmls = student_page.css(section_selector).collect{|x| x.inner_html}\n # section_htmls.each_with_index do |section, index|\n # info[\"section_html_#{index+1}\".to_sym] = section\n # end\n \n student = {(index+1) => info}\n p student\n\n # merge into existing hash\n @students.merge!(student) do |id, oldinfo, newinfo|\n oldinfo.merge!(newinfo) do |attribute, oldvalue, newvalue|\n puts \"in index: #{oldvalue}; in profile: #{newvalue}\" if oldvalue != newvalue\n newvalue\n end\n end\n\n else\n puts \"#{student_html} isn't the correct template. Page will not be scraped.\"\n end\n\n rescue OpenURI::HTTPError => e\n puts \"No profile found at \" + student_html\n puts e\n end\n end\n end",
"title": ""
},
{
"docid": "7dfefc47ca9291643f77d0879245cf17",
"score": "0.5702941",
"text": "def tagline\n sample(taglines)\n end",
"title": ""
},
{
"docid": "1a32c68f451627f7a9e0a82e3a384baa",
"score": "0.5693078",
"text": "def crawl_page(student_page)\n url = Nokogiri::HTML(open(student_page))\n\n #Add things in here that you want to find\n #All paths should have a url.css() call in them to work properly\n\n #get name, image, quote\n name = url.css('.ib_main_header').children[0].text\n image = url.css('.student_pic').first.attributes[\"src\"].value\n quote = url.css('.textwidget h3')[0].children.text\n\n #RETURN VALUE, FOR TESTING PURPOSES\n [name,image,quote]\n\nend",
"title": ""
},
{
"docid": "735d665ad3893aa90d4949e3987af638",
"score": "0.5666198",
"text": "def section_header(headline)\n \"<header><div class='line-container'><h2><span>#{headline}</span></h2></div></header>\"\nend",
"title": ""
},
{
"docid": "a52b0d76f2dc836b738f3a9676754f94",
"score": "0.5653216",
"text": "def scrape_event(url)\n description=\"\"\n page = Nokogiri::HTML(open(url))\n description=page.css('p#bodytext').inner_text\n description+=' '+page.css('div#listing-details').inner_text.gsub('Details','')\n #linkVenue=page.css('div#listingheader p.nextevent a')[0]['href']\n #puts description\n yield description\nend",
"title": ""
},
{
"docid": "a52b0d76f2dc836b738f3a9676754f94",
"score": "0.5653216",
"text": "def scrape_event(url)\n description=\"\"\n page = Nokogiri::HTML(open(url))\n description=page.css('p#bodytext').inner_text\n description+=' '+page.css('div#listing-details').inner_text.gsub('Details','')\n #linkVenue=page.css('div#listingheader p.nextevent a')[0]['href']\n #puts description\n yield description\nend",
"title": ""
},
{
"docid": "d556038059992f4fd7bc4caeb8bb0414",
"score": "0.5624962",
"text": "def scrape_name(scrape_result)\n scrape_result.css(\"div.page-title h4\").text\n end",
"title": ""
},
{
"docid": "d556038059992f4fd7bc4caeb8bb0414",
"score": "0.5624962",
"text": "def scrape_name(scrape_result)\n scrape_result.css(\"div.page-title h4\").text\n end",
"title": ""
},
{
"docid": "819b1688701983e22b617f151755fd90",
"score": "0.561837",
"text": "def yieldreturn_tag(text); end",
"title": ""
},
{
"docid": "15c5302d89e1347ac3a71beae637f11b",
"score": "0.55671364",
"text": "def tagline\n get_node(\"//tr[td[contains(@class, 'label') and text()='Taglines']]/td[2]/text()\")\n end",
"title": ""
},
{
"docid": "aaa541652df932768f5a5bdf40240a25",
"score": "0.5516978",
"text": "def parse_summary(row)\n result = {}\n\n result['title'] = row.css('.titleColumn a').text.strip\n result['imdb_uri'] = IMDB + row.css('.titleColumn a').attribute('href').value.strip\n\n rating_element = row.css('.imdbRating strong')\n unless rating_element.empty?\n rating_match = rating_element.attribute('title').value.match /^(.*) based on (.*) user ratings$/\n if rating_match\n result['imdb_rating'] = rating_match[1].to_i\n result['imdb_rating_count'] = rating_match[2].to_i\n end\n end\n\n #puts result\n result\nend",
"title": ""
},
{
"docid": "3afe4dc205755341011ee7bccd306c3c",
"score": "0.5502274",
"text": "def paragraph_line(line)\n \"<p>#{line}</p>\"\nend",
"title": ""
},
{
"docid": "e0c61076d875ac2a9a12239b6acf34f6",
"score": "0.54494864",
"text": "def note_result(student, note)\n note_link(note).when_visible Utils.short_wait\n sid_el = h3_element(xpath: \"//div[@id='advising-note-search-result-#{note.id}']/h3\")\n snippet_el = div_element(id: \"advising-note-search-result-snippet-#{note.id}\")\n advisor_el = span_element(id: \"advising-note-search-result-advisor-#{note.id}\")\n footer_el = div_element(xpath: \"//div[@id='advising-note-search-result-#{note.id}']/div[@class='advising-note-search-result-footer']\")\n {\n :student_name => (note_link( note).text.strip if note_link(note).exists?),\n :student_sid => (sid_el.text.gsub(\"#{student.full_name}\", '').delete('()').strip if sid_el.exists?),\n :snippet => (snippet_el.text if snippet_el.exists?),\n :advisor_name => (advisor_el.text.delete('-').strip if advisor_el.exists?),\n :date => (footer_el.text.split('-').last.strip if footer_el.exists?)\n }\n end",
"title": ""
},
{
"docid": "ac229f2b1b8a61169799fa11548e1f07",
"score": "0.54433477",
"text": "def parse_page(page_content, scraper)\r\n\tresult = []\r\n\tpage_content.parser.css('.searchhitdiv').each do |item|\r\n\t\ttitle_tag = item.search('.searchhit > a')[0];\r\n\t\ttitle = title_tag.text.strip;\r\n\t\turl = title_tag.attributes['href'].value\r\n\r\n\t\tdescription = \"\"\r\n\t\tscraper.get(url) do |subpage|\r\n\t\t\tsubpage.parser.css('body').each do |subpage_body| \r\n\t\t\t\tdescription += subpage_body.search('.serc-content').text.strip.gsub(/ |\\t/, \" \")\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t\t# Add result to array\r\n\t\tresult << {\"url\": url, \"title\": title, \"scenario-description\": description}\r\n\tend\r\n\treturn result\r\nend",
"title": ""
},
{
"docid": "5a1b0d7627b6df3704a490f99625ef46",
"score": "0.54365283",
"text": "def tagline(object)\n content_tag(:p, object.tagline, :class=>\"tagline\")\n end",
"title": ""
},
{
"docid": "9ca37d9071d68a6db3d3226d8f660f1f",
"score": "0.54139",
"text": "def get_student_names\t\n\t\tstudents = html.search(\"h3\").collect do |h3|\n\t\t\th3.text\n\t\tend\n\t\t# ALTERNATE METHOD USING REGEX: ?<= is look behind and ?= is look ahead. it splits in between these\n\t\t# students = html.search(\"h3\").text.split(/(?<=[a-z.])(?=[A-Z])/) \n\tend",
"title": ""
},
{
"docid": "17567fcee68c4d169100a5adcd8a4232",
"score": "0.5384431",
"text": "def scrape(url)\r\n end",
"title": ""
},
{
"docid": "4c2c4d0acb5091f361cd53fe89729b49",
"score": "0.5380739",
"text": "def identify_result\nearliest_date = get_earliest_date_stamp\nputs \"<Identify>\n <repositoryName>NYU Libraries Union Catalog</repositoryName> \n <baseURL>http://dev-dl-pa.home.nyu.edu/uc-oai-demo/oai/</baseURL>\n <protocolVersion>2.0</protocolVersion>\n <adminEmail>esha@nyu.edu</adminEmail>\n <earliestDatestamp>#{earliest_date}</earliestDatestamp>\n <deletedRecord>no</deletedRecord>\n <granularity>YYYY-MM-DDThh:mm:ssZ</granularity>\n </Identify>\"\nend",
"title": ""
},
{
"docid": "01df9606bfd2da79c17b1281293a8f13",
"score": "0.5376285",
"text": "def create_seach_field(item_location)\n \n extract = ''\n \n doc = Nokogiri::HTML(open(File.open(item_location)))\n doc.css('script').remove\n doc.css('p').each do |paragraph|\n extract << paragraph.text.gsub(' ','').gsub(\"\\n\\n\",'')\n end\n \n return extract\nend",
"title": ""
},
{
"docid": "4d8c7e19f2987b03b37420b9b29b6677",
"score": "0.5348789",
"text": "def get_source_code sub_id, contest_id\n url = get_source_url sub_id, contest_id\n page = Nokogiri::HTML(open(url))\n source_code = page.css('div').css('pre[class=\"prettyprint\"]').text\nend",
"title": ""
},
{
"docid": "cfe7d60004ecae1a328cbdd4ecc94e82",
"score": "0.5337783",
"text": "def element_line(element); end",
"title": ""
},
{
"docid": "0c2673c59df14b098b444d998018116c",
"score": "0.532251",
"text": "def get_info search_result\n # Split off each search result, which contains course\n # info and section info.\n info = search_result.css 'div.courseInfo'\n title = info.css('span.courseTitle').text\n # Shorten some commonly-seen super-long titles\n if title =~ /PhD Directed Reading/\n title = 'PhD Directed Reading'\n elsif title =~ /TGR Dissertation/\n title = 'TGR Dissertation'\n elsif title =~ /PhD Dissertation Research/\n title = 'PhD Dissertation Research'\n end\n code = info.css('span.courseNumber').text.sub(':', '')\n get_sections_info search_result, {\n code: {\n full: code\n },\n title: title\n }\nend",
"title": ""
},
{
"docid": "d7cd51657b52a1d49dc7ff7208edfe20",
"score": "0.5303927",
"text": "def scrape_name\n self.name = @doc.css(\"h1\").inner_text\n end",
"title": ""
},
{
"docid": "88b81f82a2063ae4b42ff06d8060ba4c",
"score": "0.528458",
"text": "def get_relevent_user_info(string)\n doc = Nokogiri::HTML(string)\n # initial hash\n result = { handle: doc.at_css(\"div.ProfileCardMini-screenname span\").text,\n profile_name: doc.at(\"h1.ProfileHeaderCard-name a\").text }\n\n # add respective information if it's obtainable\n # needs to be checked every so often to ensure that it's finding the right elements\n if location = doc.at_css(\"span.ProfileHeaderCard-locationText\")\n result[:location] = location.text.strip if location.text =~ /\\w/\n end\n\n if joined = doc.at_css(\"span.ProfileHeaderCard-joinDateText\")\n result[:joined] = joined.text\n end\n\n if url = doc.at_css(\"span.ProfileHeaderCard-urlText a\")\n result[:url] = url.attributes[\"title\"].value if url.attributes[\"title\"]\n end\n\n # the following will have format # description\n if tweets = doc.at_css(\"li.ProfileNav-item--tweets a\")\n tweets = tweets.attributes[\"title\"].value.split()\n result[tweets.last.downcase.to_sym] = tweets.first\n end\n\n if following = doc.at_css(\"li.ProfileNav-item--following a\")\n following = following.attributes[\"title\"].value.split()\n result[following.last.downcase.to_sym] = following.first\n end\n \n if followers = doc.at_css(\"li.ProfileNav-item--followers a\")\n followers = followers.attributes[\"title\"].value.split()\n result[followers.last.downcase.to_sym] = followers.first\n end\n\n if likes = doc.at_css(\"li.ProfileNav-item--favorites a\")\n likes = likes.attributes[\"title\"].value.split()\n result[likes.last.downcase.to_sym] = likes.first\n end\n\n # found a protected profile, can't display first tweet, \n if first_tweet = doc.at_css(\"p.ProtectedTimeline-explanation\")\n result[:tweet_title] = doc.at_css(\"h2.ProtectedTimeline-heading\").text\n result[:tweet_text] = first_tweet.text.strip\n # get the first tweet\n elsif first_tweet = doc.at_css(\"p.TweetTextSize\")\n name = doc.at_css(\"div.stream-item-header strong\").text\n user = doc.at_css(\"div.stream-item-header span.username b\").text\n timestamp = doc.at_css(\"div.stream-item-header span._timestamp\").text\n result[:tweet_title] = \"#{name} @#{user} * #{timestamp}\"\n result[:tweet_text] = first_tweet.text.strip\n # found a profile with no tweets\n elsif first_tweet = doc.at_css(\"p.empty-text\")\n result[:tweet_title] = \"Still waiting on #{result[:handle]}'s Tweets!\"\n result[:tweet_text] = first_tweet.text.strip\n end\n\n # return result hash\n result\nend",
"title": ""
},
{
"docid": "115c66bd365d61c58703ecd06d2f295f",
"score": "0.5276382",
"text": "def scrape\n pull_results\n end",
"title": ""
},
{
"docid": "186cb2be5201083600b078072e7f0726",
"score": "0.52762955",
"text": "def run(html)\n @scanner = StringScanner.new(html)\n inter_tag\n end",
"title": ""
},
{
"docid": "ace56b3d68b33f9bb84ffd7f695d1526",
"score": "0.52711487",
"text": "def scrape (url_string, tag_pattern)\n\n #scrapes entire HTML document and places it in a Nokogiri object (requires 'nokogiri' and 'open-uri')\n scraped_object = Nokogiri::HTML(open(url_string))\n\n #filters the scraped_object and stores it into a node set\n #tag_patterns are ideally specified to pull multiple items (e.g. multiple <p></p> that match the same condition) which result in an array of many items\n parsed_node_set = scraped_object.css(tag_pattern)\n\n # parsed_array = []\n # #converts nodeset to array of strings\n # parsed_node_set.each do |element|\n # parsed_array << element.to_s\n # end\n #\n # parsed_array\n\n\n text_array = []\n parsed_node_set.map do |item|\n text_array.push(item)\n end\n\n #push the array into the csv file\n CSV.open('results.csv', 'w') do |csv|\n csv << text_array\n end\n\n\nend",
"title": ""
},
{
"docid": "a5dd5b5478295354158d51be75051e97",
"score": "0.52537125",
"text": "def details_line(cgi, label, value, type)\n id = \"#{type}-value\"\n cgi.div('class' => 'details-line') do\n cgi.span('class' => 'details-label') do\n label\n end +\n cgi.span('class' => \"details-value #{id}\") do\n value\n end\n end\nend",
"title": ""
},
{
"docid": "ac3626911e35f6dd727798d224a7a1d4",
"score": "0.525111",
"text": "def bold_item_example(str_line, str_token)\n str_ret_line = str_line.gsub(/<.*?>/i, '')\n str_ret_line = str_ret_line.gsub(/([\\s|,|;|:]+)(#{str_token})(\\s+)/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/(^#{str_token}\\s+)/i, '<span class=\"concordance_bold_span\">\\1</span>\\2')\n str_ret_line = str_ret_line.gsub(/([\\s|,|;|:]+)(#{str_token}$)/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/([\\s|,|;|:]+)(#{str_token})(\\.)/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/([\\s|,|;|:]+)(#{str_token})(\\?)/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/([\\s|,|;|:]+)(#{str_token})(,)/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/([\\s|,|;|:]+)(#{str_token})(\\!)/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/([\\s|,|;|:]+)(#{str_token})(\\))/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/(\\(#{str_token})(\\))/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/(\\(#{str_token})(\\s+)/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/([\\s|,|;|:]+)(#{str_token})(\\})/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/(\\{#{str_token})(\\s+)/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/(\\{#{str_token})(\\})/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/([\\s|,|;|:]+)(#{str_token})(\\])/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/(\\[#{str_token})(\\s+)/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/(\\[#{str_token})(\\])/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/([\\s|,|;|:]+)(#{str_token})(~)/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/([\\s|,|;|:]+)(#{str_token})(\\\")/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/(\\\"#{str_token})(\\s+)/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/(\\\"#{str_token})(\\\")/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/([\\s|,|;|:]+)(#{str_token})(:)/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/([\\s|,|;|:]+)(#{str_token})(;)/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n str_ret_line = str_ret_line.gsub(/([\\s|,|;|:]+)(#{str_token})(\\*)/i, '\\1<span class=\"concordance_bold_span\">\\2</span>\\3')\n\n\n return str_ret_line\n end",
"title": ""
},
{
"docid": "50eb56e23289fb75c39543d93117b6d4",
"score": "0.5246285",
"text": "def scrape_report(url)\n puts \"REPORT\"\nend",
"title": ""
},
{
"docid": "50eb56e23289fb75c39543d93117b6d4",
"score": "0.5246285",
"text": "def scrape_report(url)\n puts \"REPORT\"\nend",
"title": ""
},
{
"docid": "50eb56e23289fb75c39543d93117b6d4",
"score": "0.5246285",
"text": "def scrape_report(url)\n puts \"REPORT\"\nend",
"title": ""
},
{
"docid": "e68253220b5b02e7dc35cf76b28d8d62",
"score": "0.5241603",
"text": "def tag(tag)\n print \"<#{tag}>\"\n print yield\n print \"</#{tag}>\"\nend",
"title": ""
},
{
"docid": "5973ad5cd08873ecff4751223608953f",
"score": "0.5230241",
"text": "def tagline(text)\n # returns Shoes::Tagline\n throw NotImplementedError\n end",
"title": ""
},
{
"docid": "6a3c825f2c45591bf5e49338d95507fd",
"score": "0.52224255",
"text": "def api_tag(text); end",
"title": ""
},
{
"docid": "76be1d324cf9bacd029b27d042a09aa3",
"score": "0.52194023",
"text": "def tag_value(tag, results)\n if results\n results = results.join(\"\\n\")\n match = results.match(/#{ tag }: ([\\w\\-\\. &]+)/i)\n return match[1].strip if match\n\n line = results.detect { |l| l.index(tag) }\n puts results\n puts line\n puts tag\n if line\n fields = line.split(\":\")\n return fields[1, fields.length].join(\":\").strip\n end\n end\n end",
"title": ""
},
{
"docid": "e23737d105ba108935ef0c65c6a57c36",
"score": "0.52158564",
"text": "def render(item)\nitem.render({}, @site.site_payload)\ndoc = Nokogiri::HTML(item.output)\nparagraphs = doc.search('//text()').map {|t| t.content }\nparagraphs = paragraphs.join(\" \").gsub(\"\\r\", \" \").gsub(\"\\n\", \" \").gsub(\"\\t\", \" \").gsub(/\\s+/, \" \")\nend",
"title": ""
},
{
"docid": "d4b543bd039d7f706b30e7ce7d2eeda8",
"score": "0.5203668",
"text": "def get_tag_text(data, tag)\n data =~ Regexp.new(\"<#{tag}>\")\n $' =~ Regexp.new(\"</#{tag}>\")\n $`\n if $`\n $`.gsub(/<ref\\s+tag=[\"']([^\"']+)[\"']>|<\\/ref>| /, '').gsub(/<BR>/, \"\\n\").gsub(/@/){'@@'}\n end\nend",
"title": ""
},
{
"docid": "ec23ff8a511333f1dbb9e5406bba0b8d",
"score": "0.5196227",
"text": "def what_to_call_it(element_url)\n get_response_body(element_url).find do |info, value|\n # binding.pry\n if info == \"title\" or info == \"name\"\n puts \"\\t#{value}\"\n end\n end\nend",
"title": ""
},
{
"docid": "78a79528692a1b15c19d23b0397f0367",
"score": "0.51954526",
"text": "def cucumber_tags(&block); end",
"title": ""
},
{
"docid": "9a761f7b6e09ff6cc6092a5314c39bf3",
"score": "0.5188536",
"text": "def phc_title_tagline(phc_page_title_tagline)\n content_for :phc_title_tagline, phc_page_title_tagline.to_s\n end",
"title": ""
},
{
"docid": "9e3d89c67b2f0ba514c8f56613e3f5b0",
"score": "0.5187726",
"text": "def parse_html(html); end",
"title": ""
},
{
"docid": "48c3ac48933accf61fa21afadf63723e",
"score": "0.5167392",
"text": "def get_tags()\n # Url\n url = \"http://headlines.yahoo.co.jp/hl?c=soci&t=l\"\n \n doc = get_html_doc(url)\n \n tags = doc.css(\"div ul li a\")\n \n # # Get new tags\n # url = \"http://headlines.yahoo.co.jp/hl?c=soci&t=l&p=1\"\n # doc = get_html_doc(url)\n # tags_2 = doc.css(\"div ul li a\")\n# \n # # Append the new tags => 2\n # tags_2.each do |tag|\n # tags.push(tag)\n # end\n# \n # # Get new tags\n # url = \"http://headlines.yahoo.co.jp/hl?c=soci&t=l&p=2\"\n # doc = get_html_doc(url)\n # tags_2 = doc.css(\"div ul li a\")\n# \n # # Append the new tags\n # tags_2.each do |tag|\n # tags.push(tag)\n # end\n# \n # # Get new tags => 3\n # url = \"http://headlines.yahoo.co.jp/hl?c=soci&t=l&p=3\"\n # doc = get_html_doc(url)\n # tags_2 = doc.css(\"div ul li a\")\n# \n # # Append the new tags\n # tags_2.each do |tag|\n # tags.push(tag)\n # end\n \n return tags \n end",
"title": ""
},
{
"docid": "e6110c76d145aa51a47c77000a2434bf",
"score": "0.51591116",
"text": "def scrape_students\n student_lesson_forks_url = \"https://github.com/learn-co-students/#{$lesson_name}-#{$class_id}/network/members\"\n $browser.goto(student_lesson_forks_url)\n divs = $browser.divs(class: 'repo')\n divs.collect do |div|\n div.text.split(\" / \")[0]\n end\n end",
"title": ""
},
{
"docid": "f6fb8e40948d71165b5199a884b71e4a",
"score": "0.51557934",
"text": "def parse_tags\n poss_tags = @html.css(\"p\").select{|ele| ele.text.include?(\"Tagged\")}\n poss_tags.first.text.gsub(\"Tagged: \", \"\").split(\", \") if poss_tags && !poss_tags.empty? \n end",
"title": ""
},
{
"docid": "2cf128d29da1dd99ee7858bf47bef849",
"score": "0.5135924",
"text": "def parse_tag(line)\n raise SyntaxError.new(\"Invalid tag: \\\"#{line}\\\".\") unless match = line.scan(/%([-:\\w]+)([-:\\w\\.\\#]*)(.*)/)[0]\n\n tag_name, attributes, rest = match\n raise SyntaxError.new(\"Illegal element: classes and ids must have values.\") if attributes =~ /[\\.#](\\.|#|\\z)/\n\n new_attributes_hash = old_attributes_hash = last_line = nil\n object_ref = \"nil\"\n attributes_hashes = {}\n while rest\n case rest[0]\n when ?{\n break if old_attributes_hash\n old_attributes_hash, rest, last_line = parse_old_attributes(rest)\n attributes_hashes[:old] = old_attributes_hash\n when ?(\n break if new_attributes_hash\n new_attributes_hash, rest, last_line = parse_new_attributes(rest)\n attributes_hashes[:new] = new_attributes_hash\n when ?[\n break unless object_ref == \"nil\"\n object_ref, rest = balance(rest, ?[, ?])\n else; break\n end\n end\n\n if rest\n nuke_whitespace, action, value = rest.scan(/(<>|><|[><])?([=\\/\\~&!])?(.*)?/)[0]\n nuke_whitespace ||= ''\n nuke_outer_whitespace = nuke_whitespace.include? '>'\n nuke_inner_whitespace = nuke_whitespace.include? '<'\n end\n\n value = value.to_s.strip\n [tag_name, attributes, attributes_hashes, object_ref, nuke_outer_whitespace,\n nuke_inner_whitespace, action, value, last_line || @index]\nend",
"title": ""
},
{
"docid": "51ee805b7cae0e3dcaa4877fdb281c6b",
"score": "0.5131815",
"text": "def tags_to_html tags\n #for connections md element\n if tags == /,\\s\"none\"/\n return \"\"\n end\n\n tag_list = tags.split(/,\\s/)\n tag_html = tag_list.reduce(\" \") {|ls, tag| ls + \"<p>#{tag}</p>\"}\n return tag_html\nend",
"title": ""
},
{
"docid": "3cafa56326028fc9024f5028a6c633e9",
"score": "0.512574",
"text": "def get_articles_by_tagname dom, tagName\n\n accumulator = []\n\n articles = get_by_tagname dom, tagName\n\n articles.each do | raw |\n \n accumulator.push raw.inner_text\n \n end\n \n accumulator\n\n end",
"title": ""
},
{
"docid": "b4849658016f307502199f9e3e5809c7",
"score": "0.51179576",
"text": "def scrape_page\n scrape = ScraperService.new(url).call\n if scrape.success?\n attrs = scrape.data.map do |headline|\n {expert: self, text: headline}\n end\n Headline.create(attrs)\n end\n end",
"title": ""
},
{
"docid": "ea6b48f832f41f5c6874988ce203e57f",
"score": "0.51102525",
"text": "def extract_string(node); end",
"title": ""
},
{
"docid": "03bc6c7d519a9d0607c2a0a633ad74c9",
"score": "0.5109441",
"text": "def extract_output(doc)\n doc.css('li.education h3.org').each do |el|\n puts \"University = [#{el.content.strip}]\"\n end\n \n doc.xpath('//strong[@class=\"connection-count\"]').each do |count|\n puts \"Count [#{count.content.strip.to_i}]\"\n end \n end",
"title": ""
},
{
"docid": "37d3cb2f1e1a8c43fdf2d86784cb9c0b",
"score": "0.51077735",
"text": "def parse_prod url, csv\n prod_page = Curl.get(url)\n html = Nokogiri::HTML(prod_page.body_str)\n\n name = html.at(\"//h1[@itemprop='name']\").to_s.split(/<\\/.*>/)[2].strip\n info_node = html.css(\".attribute_labels_lists li\")\n\n info_node.each do |li| \n csv << [ name+\"-\"+li.css(\".attribute_name\").text.strip,\n li.css(\".attribute_price\").text.strip,\n html.at(\"//span[@id='view_full_size']/img[@id='bigpic']/@src\") ]\n end\nend",
"title": ""
},
{
"docid": "55b49a1a29b4db23c5ebf233e252ff16",
"score": "0.5101265",
"text": "def tag(tag)\n \"<#{tag}>#{yield}</#{tag}>\"\nend",
"title": ""
},
{
"docid": "aff4067a25a000e027330e097a8457ea",
"score": "0.5100703",
"text": "def tag\n \"<span class=\\\"username #{colour}\\\">#{name}</span>\"\n end",
"title": ""
},
{
"docid": "85475dac209d9b0643e584ae21bffd02",
"score": "0.5098633",
"text": "def scrape_and_insert(url)\n begin\n @doc = Nokogiri::HTML(open(url))\n self.scrape_name\n self.scrape_tagline\n self.scrape_student_intro_paragraph\n self.scrape_social_links\n self.scrape_work\n self.scrape_education\n self.scrape_coder_cred\n self.scrape_blog_link\n self.scrape_fav_companies\n self.scrape_fav_websites\n self.scrape_quotes\n self.save\n\n rescue => ex\n puts \"except #{ex} on #{url}\"\n yield ex\n end\n end",
"title": ""
},
{
"docid": "5318af5ea4879b6c960847955414abce",
"score": "0.5090919",
"text": "def scraper(search)\n # 1. We get the HTML page content thanks to open-uri\n html_content = open(\"https://www.etsy.com/search?q=#{search}\").read\n\n # 2. We build a Nokogiri document from this file\n doc = Nokogiri::HTML(html_content)\n\n # 3. We search for the correct elements containing the items' title in our HTML doc\n\n doc.search('.v2-listing-card .v2-listing-card__info .text-body').first(10).map do |element|\n # 4. For each item found, we extract its title and print it\n # element.text.strip\n title = element.text.strip\n title.split.slice(0, 4).join(\" \")\n end\nend",
"title": ""
},
{
"docid": "c3f3afdb0b2923253b9070583619dc88",
"score": "0.5089321",
"text": "def scrape_statement\n raise \"You must override the instance method scrape_statement in your scraper!\"\n end",
"title": ""
},
{
"docid": "1b939894ae3af1ef3c1e073b81e36f0c",
"score": "0.5088776",
"text": "def tag(tag='div')\n text = yield\n \"<#{tag}>#{text}</#{tag}>\"\nend",
"title": ""
},
{
"docid": "67b06fd6776c8734e82350eb8d4a76a8",
"score": "0.50874394",
"text": "def parse\n\t\tself.tagged = @tgr.add_tags(self.sentence)\n\tend",
"title": ""
},
{
"docid": "a0561a87522a604fb0848bf15516ed54",
"score": "0.5082246",
"text": "def scrape_content\n @@unformatted_comments.each do |unformatted_comment|\n @@formatted_comments << unformatted_comment.inner_text\n #@@formatted_comments << \"-------------\"\n end\n return @@formatted_comments\nend",
"title": ""
},
{
"docid": "5f170b4a576f3ab5e9169c8db57a65f8",
"score": "0.5077331",
"text": "def info_detail_line(include_html = false, reference_quarter = nil)\n reference_quarter ||= Quarter.find_by_date(offering.deadline)\n info = []\n fp = \"<span class=\\\"student_name\\\">\" if include_html\n fs = \"</span>\" if include_html\n info << \"#{fp}#{firstname_first}#{fs}\"\n info << person.class_standing_description(:recent_graduate_placeholder => \"Recent Graduate\", :reference_quarter => reference_quarter) unless person.nil?\n mp = \"<span class=\\\"student_major\\\">\" if include_html\n ms = \"</span>\" if include_html\n info << \"#{mp}#{person.majors_list(true, \", \", reference_quarter)}#{ms}\" unless person.nil?\n info << person.institution_name if person && !person.institution.blank?\n info.compact.join(\", \")\n end",
"title": ""
},
{
"docid": "7805f5a1eee2cb9aaed71faf4852ecca",
"score": "0.50737715",
"text": "def scrape_venue(url,date,eventId)\n latitude=longitude=address=tel=venueInfo=starts=ends=\"\"\n page = Nokogiri::HTML(open(url))\n #puts 'name : '+page.css('div#listingheader h2')[0].inner_text\n scriptMap = page.css('div.venue-map script').inner_text\n scriptMapArray = scriptMap.split(/\\n/)\n scriptMapArray.each {|line|\n line=line.split(/\"/)\n #puts \"latitude : \"+line[3] if line[1]=='latitude'\n latitude=line[3] if line[1]=='latitude'\n #puts \"longitude : \"+line[3] if line[1]=='longitude'\n longitude=line[3] if line[1]=='longitude'\n }\n details = page.css('div#listing-details li').each { |detail|\n detailSplit = detail.inner_text.split(/:/)\n detail=detail.inner_text\n detail.strip!\n detailSplit[0].strip!\n if(detailSplit[0]=='Address')\n #puts \"Venue address: \"+detail.gsub('Address: ','')\n address=detail.gsub('Address: ','')\n elsif(detailSplit[0]=='Tel')\n #puts \"Venue phone number: \"+detail.gsub('Tel: ','')\n tel=detail.gsub('Tel: ','')\n else\n #puts \"Other info: \"+detail\n venueInfo+=detail\n end\n }\n \n allEvents = page.css('table.event-table tr').each {|rowEvent|\n if((rowEvent.css('td')[0].inner_text == date) && (rowEvent.css('td')[3].css('a')[0]['href'].include? eventId.to_s))\n #puts \"Start time: \"+rowEvent.css('td')[1].inner_text.gsub('Starts ','')\n starts=rowEvent.css('td')[1].inner_text.gsub('Starts ','')\n #puts \"End time: \"+rowEvent.css('td')[2].inner_text.gsub('Ends ','')\n ends=rowEvent.css('td')[2].inner_text.gsub('Ends ','')\n break\n end\n }\n\n yield latitude,longitude,address,tel,venueInfo,starts,ends\nend",
"title": ""
},
{
"docid": "7805f5a1eee2cb9aaed71faf4852ecca",
"score": "0.50737715",
"text": "def scrape_venue(url,date,eventId)\n latitude=longitude=address=tel=venueInfo=starts=ends=\"\"\n page = Nokogiri::HTML(open(url))\n #puts 'name : '+page.css('div#listingheader h2')[0].inner_text\n scriptMap = page.css('div.venue-map script').inner_text\n scriptMapArray = scriptMap.split(/\\n/)\n scriptMapArray.each {|line|\n line=line.split(/\"/)\n #puts \"latitude : \"+line[3] if line[1]=='latitude'\n latitude=line[3] if line[1]=='latitude'\n #puts \"longitude : \"+line[3] if line[1]=='longitude'\n longitude=line[3] if line[1]=='longitude'\n }\n details = page.css('div#listing-details li').each { |detail|\n detailSplit = detail.inner_text.split(/:/)\n detail=detail.inner_text\n detail.strip!\n detailSplit[0].strip!\n if(detailSplit[0]=='Address')\n #puts \"Venue address: \"+detail.gsub('Address: ','')\n address=detail.gsub('Address: ','')\n elsif(detailSplit[0]=='Tel')\n #puts \"Venue phone number: \"+detail.gsub('Tel: ','')\n tel=detail.gsub('Tel: ','')\n else\n #puts \"Other info: \"+detail\n venueInfo+=detail\n end\n }\n \n allEvents = page.css('table.event-table tr').each {|rowEvent|\n if((rowEvent.css('td')[0].inner_text == date) && (rowEvent.css('td')[3].css('a')[0]['href'].include? eventId.to_s))\n #puts \"Start time: \"+rowEvent.css('td')[1].inner_text.gsub('Starts ','')\n starts=rowEvent.css('td')[1].inner_text.gsub('Starts ','')\n #puts \"End time: \"+rowEvent.css('td')[2].inner_text.gsub('Ends ','')\n ends=rowEvent.css('td')[2].inner_text.gsub('Ends ','')\n break\n end\n }\n\n yield latitude,longitude,address,tel,venueInfo,starts,ends\nend",
"title": ""
},
{
"docid": "234d9243bb868dfe5f498edbb216a212",
"score": "0.50710243",
"text": "def parse_response_line; end",
"title": ""
},
{
"docid": "9de6be2289f5ce661b7934db5dab9130",
"score": "0.5070812",
"text": "def get_the_email_of_a_townhal_from_its_webpage(page_url)\n page = Nokogiri::HTML(open(page_url))\n elements = page.css('.txt-primary')[3].text.split(\" \")[2]\n puts elements\n \nend",
"title": ""
},
{
"docid": "79af29d8bace206a1938f20e37e90948",
"score": "0.5069001",
"text": "def get_name\n puts \"... Buscando informações do desafio\"\n # Busca e faz um parser das matatags da url\n #ogp = Ogpr.fetch(@url)\n ogp = Ogpr.parse(@html_page)\n titulo = ogp.title.gsub(/(\\s\\|\\sHackerRank)$|\\s/, '')\n puts \"OK \\n\\n\"\n return titulo\nend",
"title": ""
},
{
"docid": "bd84000e834310aef99521cbe2c51448",
"score": "0.50582016",
"text": "def extract_song_info(link)\n parsed_html = Nokogiri::HTML(open(link))\n lyrics = parsed_html.css(\"[class = lyrics]\").inner_text.strip.split(\"\\n\")\n lyrics = lyrics.select do |line|\n line != nil && line != \"\" && !line.include?(\"[\") \n end\n artist_name = parsed_html.css(\"[class = header_with_cover_art-primary_info-primary_artist]\").inner_text\n song_name = parsed_html.css(\"[class = header_with_cover_art-primary_info_container]\").xpath(\"//h1\").inner_text\n result = {:artist_name => artist_name, :song_name => song_name, :lyrics => lyrics}\n return result\nend",
"title": ""
},
{
"docid": "6075f0d413c79b351ae87bb9c515a94e",
"score": "0.5057045",
"text": "def formatted_result(result)\n link = result.css(\"a.large\")\n return if link_is_ad?(link)\n description = result.css(\"div.snippet\").text\n\n {\n url: link.attr('href').to_s, \n title: link.text,\n description: description \n }\n end",
"title": ""
},
{
"docid": "a84bba01ce879fe798548bcaf993ea08",
"score": "0.5044763",
"text": "def extract_username\n #guarda el nombre de usuario en una variable\n profile_name = @doc.search(\".ProfileHeaderCard-name > a\")#.first.inner_text\n #imprime el nombre de usuario\n puts \"Username: #{profile_name.first.inner_text}\"\n end",
"title": ""
},
{
"docid": "9719919fd0902aef25e76c7ba3a10302",
"score": "0.5044735",
"text": "def AlphabetSoup(str)\n\n # code goes here\n return str \n \nend",
"title": ""
},
{
"docid": "5fcc2f260d288904bc8e06b7999088bd",
"score": "0.503802",
"text": "def author_tag(text); end",
"title": ""
},
{
"docid": "723bbd9141385bb95753b0b0fddcabfb",
"score": "0.5036664",
"text": "def scrape_tag_link tag\n links = @data.css(tag)\n if @data.css('a/@href').count > 0 && links != nil\n links.each do |i|\n puts links.css('a/@href')\n end\n else\n puts 'no ' + tag + ' tags with links found'\n end\n end",
"title": ""
},
{
"docid": "b2282420efbb4dfb447b0905eb7eaab2",
"score": "0.50352335",
"text": "def test_line(line, line_number)\n @line = line\n @line_number = line_number\n # Parse file and search tags exists\n parse_and_search_open_tag\n # If file contains tag <?php or <?= search close tags\n parse_and_search_close_tag\n end",
"title": ""
},
{
"docid": "ff71c634f6b92dedc557a77bdfa95b5a",
"score": "0.5023456",
"text": "def parse_bill(url)\n page = Nokogiri::HTML(ScraperWiki.scrape(url))\n title = page.search(\"title\")\n name = title[0].content.sub(/ - Tithe an Oireachtais$/, \"\").strip if title[0]\n \n meta = page.search(\"//meta[@name='Abstract']\")\n abstract = meta[0]['content'].strip if meta[0]\n print abstract\n \n # update the description with full description, since it could be cut off\n # doesn't work right yet, we might have to dive into the hr tags again\n # description = page.search(\"div.column-center-inner p\").map { |p|\n # p.content.include?(description) ? p.content : nil }.compact[0]\n \n ScraperWiki.save(['name', 'abstract', 'url'], {\n 'name' => name,\n 'abstract' => abstract,\n\n 'url' => url\n })\n [name, abstract, url]\n=begin\n # OLD METHOD\n # take all the text between the first two <hr> tags\n # for now, don't get the rest, because you'd have to parse word, pdf, etc\n # a lot of it is the debate information\n \n # between first two is name\n # between second and third is description\n node = page.search(\"hr\")[0]\n # need to collect all the nodes until the next hr\n name_nodes = []\n while node = node.next\n break if node.name == \"hr\"\n name_nodes << node\n end\n \n name = nil\n name_nodes.each do |nn|\n # search for \"strong\" because that's the markup they use for the name\n if nn.name == \"strong\" && nn.content && nn.content.strip != \"\"\n name = nn.content\n else\n strong = nn.search(\"strong\")\n name = strong[0].content.strip if strong[0]\n end\n break if name\n end\n \n node = page.search(\"hr\")[1]\n # collect all nodes until end of description\n desc_nodes = []\n while node = node.next\n break if node.name == \"hr\"\n desc_nodes << node\n end\n # parse the description into a string of some sort?\n # we could just keep the HTML for now.\n=end\nend",
"title": ""
},
{
"docid": "9a8ac3b1252ebdf4874a2bb071529f8e",
"score": "0.5020663",
"text": "def print_first_result(css)\n obj = get_object(css)\n res = obj.text.split(\"\\n\")\n puts res[0]\n puts res[1]\n end",
"title": ""
},
{
"docid": "3bbea4fa63f54b6d41975a517498ebde",
"score": "0.5018256",
"text": "def get_merchant_info(merchant_container, page)\n # merchant_container is expected to be with ??? piece of information\n\n # 0. info_url\n # 1. \n # 2. \n # 3. \n # 4. \n # 5. \n\n # Todo: Put your code to process the merchant_container to get the merchant_info here\n \n container = merchant_container.search('.desc-container')[0]\n company_name = container.at('h2').inner_text\n domain = container.at('span').inner_text\n description = container.search('.description')[0]\n if description.search('.truncate').size > 0\n description = description.inner_text.gsub('... More','')\n else\n description = description.inner_text\n end\n \n detail_url = \"/siteinfo/\" + domain\n \n detail_page = page.link_with(:href => detail_url).click\n global_rank_container = detail_page.search('#siteStats tbody td')[0]\n if global_rank_container.nil? \n detail_url = @url + detail_url \n detail_page = @agent.get(detail_url )\n global_rank_container = detail_page.search('#siteStats tbody td')[0]\n end\n \n puts detail_page.body\n\n global_rank = clean_whitespace(global_rank_container.at('div').inner_text)\n \n us_rank_container = detail_page.search('#siteStats tbody td')[1]\n if us_rank_container.at('div').nil? \n us_rank_container = detail_page.search('#siteStats tbody td')[2]\n end\n us_rank = clean_whitespace(us_rank_container.at('div').inner_text)\n record = {\n 'global_rank' => global_rank,\n 'us_rank' => us_rank,\n 'company_name' => company_name,\n 'domain' => domain,\n 'description' => description\n }\n \n return record \nend",
"title": ""
},
{
"docid": "3bbea4fa63f54b6d41975a517498ebde",
"score": "0.5018256",
"text": "def get_merchant_info(merchant_container, page)\n # merchant_container is expected to be with ??? piece of information\n\n # 0. info_url\n # 1. \n # 2. \n # 3. \n # 4. \n # 5. \n\n # Todo: Put your code to process the merchant_container to get the merchant_info here\n \n container = merchant_container.search('.desc-container')[0]\n company_name = container.at('h2').inner_text\n domain = container.at('span').inner_text\n description = container.search('.description')[0]\n if description.search('.truncate').size > 0\n description = description.inner_text.gsub('... More','')\n else\n description = description.inner_text\n end\n \n detail_url = \"/siteinfo/\" + domain\n \n detail_page = page.link_with(:href => detail_url).click\n global_rank_container = detail_page.search('#siteStats tbody td')[0]\n if global_rank_container.nil? \n detail_url = @url + detail_url \n detail_page = @agent.get(detail_url )\n global_rank_container = detail_page.search('#siteStats tbody td')[0]\n end\n \n puts detail_page.body\n\n global_rank = clean_whitespace(global_rank_container.at('div').inner_text)\n \n us_rank_container = detail_page.search('#siteStats tbody td')[1]\n if us_rank_container.at('div').nil? \n us_rank_container = detail_page.search('#siteStats tbody td')[2]\n end\n us_rank = clean_whitespace(us_rank_container.at('div').inner_text)\n record = {\n 'global_rank' => global_rank,\n 'us_rank' => us_rank,\n 'company_name' => company_name,\n 'domain' => domain,\n 'description' => description\n }\n \n return record \nend",
"title": ""
},
{
"docid": "73df85b286aebec621fd0439445faf24",
"score": "0.5015202",
"text": "def scrape_show\n\n end",
"title": ""
},
{
"docid": "feaed39c21cbdb99ab0f2c556b45119d",
"score": "0.50106096",
"text": "def name_link\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.h2.with.className(\"results_title\").find.a, format_method(__method__))\n end",
"title": ""
},
{
"docid": "6508ed912464d07a495b6e2983013ad1",
"score": "0.50067204",
"text": "def summary\n text = self.content[0,400]\nend",
"title": ""
},
{
"docid": "008bb8a28e94d74b9e43879843b63f77",
"score": "0.5006274",
"text": "def extract_semester_lessons_data(page)\n lessons_schedule_for_semester = []\n lesson_lines = page.css(\"#myTable0 tbody tr\")\n # Validate\n if lesson_lines.length.to_i == 0\n @scrape_logger.warn(\"method #{__method__} - less than 1 line in lessons table\")\n return lessons_schedule_for_semester\n end\n\n lesson_lines.each do |line|\n lesson_cells = line.css(\"td\")\n lessons_schedule_for_semester << {:semester => get_trimmed_cell_data(lesson_cells[0]),\n :short_code => get_trimmed_cell_data(lesson_cells[1]),\n :name => get_trimmed_cell_data(lesson_cells[2]),\n :type => get_trimmed_cell_data(lesson_cells[3]),\n :teacher => get_trimmed_cell_data(lesson_cells[4]),\n :points => get_trimmed_cell_data(lesson_cells[5]),\n :weekly_hours => get_trimmed_cell_data(lesson_cells[6]),\n :time => get_trimmed_cell_data(lesson_cells[7]),\n :room => get_trimmed_cell_data(lesson_cells[8]),\n :full_code => get_trimmed_cell_data(lesson_cells[9]),\n :school => get_trimmed_cell_data(lesson_cells[10]),\n :site => get_trimmed_cell_data(lesson_cells[11])}\n end\n\n return lessons_schedule_for_semester\n end",
"title": ""
},
{
"docid": "baba53ac51ee5e2cb3b0e053f799740f",
"score": "0.5000959",
"text": "def scrape_name(page)\n page.css('div.lister-item').css('h3.lister-item-header').css('a').text.split(\"\\n\").map { |name| name[1..-1]}\nend",
"title": ""
},
{
"docid": "79433afd6b7b4674473d656cdd898966",
"score": "0.49989074",
"text": "def cleaner(res)\n\t\tfind1= (res.body =~ /Surname:/)\n\t\tfind2= (res.body =~ /<\\/pre>/)\n\t\tfind1=find1+9\n\t\tlen= find2-find1\n\t\tdata=res.body[find1,len]\n\t\treturn data\n\tend",
"title": ""
},
{
"docid": "b4dd5fc2df4b1f9629f0e6197b820e4e",
"score": "0.49939102",
"text": "def getSummary\n @parsePage.css('span.summary-high-low')\n end",
"title": ""
},
{
"docid": "2e4fa832133ac45da2439fd34c01b8e0",
"score": "0.4990076",
"text": "def get_name()\n\npage = Nokogiri::HTML(open(PAGE_URL))\nputs page.css(\"a[class='lientxt']\").text # Afficher tous les titres d'urls\n\nend",
"title": ""
},
{
"docid": "a456837f584c661847de9c4e84a09c29",
"score": "0.49864182",
"text": "def node_from_item(item)\n result_node = Result.new\n title = '' \n\n link = item.at('h3.r a')\n meta = item.search('div.slp span.f').inner_html\n \n link.children.each do |c|\n title += c\n end\n \n description = item.search('.st').inner_html\n description = ActionView::Base.full_sanitizer.sanitize(description)\n \n\n result_node.title = title\n result_node.source = meta.split('-')[0]\n result_node.date = meta.split('-')[1]\n result_node.link = link['href'].gsub!(/\\/url\\?q\\=/, '').gsub!(/\\&sa\\=.*/,'')\n result_node.description = description\n\n return result_node\n end",
"title": ""
},
{
"docid": "9c14790740fc1961e3777416718e9faa",
"score": "0.49843428",
"text": "def add_student_attributes(return_value_of_scraped_student_pages)\n return_value_of_scraped_student_pages.each {|key, value| self.send((\"#{key}=\"), value)}\n end",
"title": ""
},
{
"docid": "dfbf120f4a28d498e8c5a3ab82fb40c0",
"score": "0.49839672",
"text": "def scrape(page)\n self.fetch_doc(page)\n # Search for <p> tags by xpath\n paragraphs = []\n @document.xpath('//p').each_with_index do |a_tag, i|\n paragraphs << a_tag.content\n end\n # take paragraphs and remove refrences ([n]) and \\\" characters\n first_paragraph = paragraphs[0].gsub(/[\\\\\"]|\\[\\d*\\]/,'')\n second_paragraph = paragraphs[1].gsub(/[\\\\\"]|\\[\\d*\\]/,'')\n \n return first_paragraph, second_paragraph\n end",
"title": ""
},
{
"docid": "21ce1e2806f8b6868a172e6164091519",
"score": "0.49835494",
"text": "def process_line(line)\n case line.text[0]\n when DIV_CLASS; push div(line)\n when DIV_ID\n return push plain(line) if %w[{ @ $].include?(line.text[1])\n push div(line)\n when ELEMENT; push tag(line)\n when COMMENT; push comment(line.text[1..-1].lstrip)\n when SANITIZE\n return push plain(line.strip!(3), :escape_html) if line.text[1, 2] == '=='\n return push script(line.strip!(2), :escape_html) if line.text[1] == SCRIPT\n return push flat_script(line.strip!(2), :escape_html) if line.text[1] == FLAT_SCRIPT\n return push plain(line.strip!(1), :escape_html) if line.text[1] == ?\\s || line.text[1..2] == '#{'\n push plain(line)\n when SCRIPT\n return push plain(line.strip!(2)) if line.text[1] == SCRIPT\n line.text = line.text[1..-1]\n push script(line)\n when FLAT_SCRIPT; push flat_script(line.strip!(1))\n when SILENT_SCRIPT\n return push haml_comment(line.text[2..-1]) if line.text[1] == SILENT_COMMENT\n push silent_script(line)\n when FILTER; push filter(line.text[1..-1].downcase)\n when DOCTYPE\n return push doctype(line.text) if line.text[0, 3] == '!!!'\n return push plain(line.strip!(3), false) if line.text[1, 2] == '=='\n return push script(line.strip!(2), false) if line.text[1] == SCRIPT\n return push flat_script(line.strip!(2), false) if line.text[1] == FLAT_SCRIPT\n return push plain(line.strip!(1), false) if line.text[1] == ?\\s || line.text[1..2] == '#{'\n push plain(line)\n when ESCAPE\n line.text = line.text[1..-1]\n push plain(line)\n else; push plain(line)\n end\n end",
"title": ""
}
] |
5e72f1dd3f2ef8cdb71617d2a3b2b13a
|
generates instructions to control FPGA to hash the given data
|
[
{
"docid": "2c55ae0822d1a222b7fdafa3fa8bfb89",
"score": "0.5606612",
"text": "def hash_block(data)\n chunk_num = data.length>>6\n frame_num = ( chunk_num.to_f / @max_chunk_per_frame ).ceil \n byte_per_frame = @bytes_per_chunk*@max_chunk_per_frame\n padding_chunks = [0].pack('C')*@bytes_per_chunk*@padding_chunk_num\n \n if frame_num == 1 #single frame\n command = [ @frame_header[:last], frame_info(chunk_num, 1), data].join\n @connector.send command\n else\n @connector.send [ @frame_header[:first], frame_info(@max_chunk_per_frame, 1),\n data[0, byte_per_frame], padding_chunks ].join\n byte_offset = byte_per_frame\n (2...frame_num).each do\n @connector.send [ @frame_header[:middle], frame_info(@max_chunk_per_frame, 1),\n data[byte_offset, byte_per_frame], padding_chunks].join\n byte_offset += byte_per_frame\n end\n last_chunk_num = chunk_num % @max_chunk_per_frame\n last_chunk_num += @max_chunk_per_frame if last_chunk_num == 0\n @connector.send [ @frame_header[:last], frame_info(last_chunk_num, 1),\n data[byte_offset, @bytes_per_chunk*last_chunk_num] ].join\n end \n #hash_value = nil\n #Timeout::timeout(5) { hash_value = @connector.receive[1,@byte_in_hash] }\n #hash_value\n @connector.receive[1,@byte_in_hash]\n end",
"title": ""
}
] |
[
{
"docid": "6fa25b4f00e6a6bb426b3643f5d98f44",
"score": "0.6410089",
"text": "def hash(data)\n @cipher.update Digest::SHA2.digest(data)\n end",
"title": ""
},
{
"docid": "818dfb991535496155f05f3aaf2ee71f",
"score": "0.638648",
"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": "cf68239029ef42cfc8b050127cf2950b",
"score": "0.632478",
"text": "def generate_key\n @fpga_key = Crypto.sk_key\n @puf = @fpga_key[0...-1]\n @syndrome = Crypto.sk_encrypt(@fpga_key, (0..32).to_a.pack('C*'))\n @efuses = Crypto.crypto_hash @syndrome\n end",
"title": ""
},
{
"docid": "f4c66b9065f000803c048fe177ae9f68",
"score": "0.62353975",
"text": "def generate_digest(data)\n Digest::SHA512.hexdigest \"#{data}#{Session.trait[:secret]}\"\n end",
"title": ""
},
{
"docid": "f79c838a47cf3fe0e4a46abc710c11d4",
"score": "0.62317276",
"text": "def generate(data)\n generate_digest(data)\n end",
"title": ""
},
{
"docid": "27a979a095ad4d2ea547e0f70ee523b8",
"score": "0.6196857",
"text": "def hash(data)\n return @cryptoHlpr.hash(data);\n end",
"title": ""
},
{
"docid": "d205da6f948f6562bea4796d2a314ce4",
"score": "0.6195808",
"text": "def hex_and_hash(data)\n Digest::SHA256.hexdigest(data)\n end",
"title": ""
},
{
"docid": "1ee9beb3ba139554c5f43d67db7c9fca",
"score": "0.6180927",
"text": "def process(data, op = :encrypt)\n ans = []\n ans1 = []\n e_block = newkey(@rand)\n data.each_index do |i|\n if (i % 16 == 0) && (i > 15)\n e_block = if (op == :encrypt)\n newkey(array2pack(16.downto(1).collect { |j| ans[i - j] }))\n else\n newkey(array2pack(16.downto(1).collect { |j| data[i - j] }))\n end\n end\n ans[i] = e_block[i % 16] ^ data[i]\n ans1[i] = ans[i].chr\n end\n ans1.join('')\n end",
"title": ""
},
{
"docid": "b10413637cf2aa3abb42d54959525351",
"score": "0.60863584",
"text": "def p2sh_script\n Script.new << OP_HASH160 << BTC.hash160(self.data) << OP_EQUAL\n end",
"title": ""
},
{
"docid": "a4087e2c7a6831614a40c4ce2877d0bd",
"score": "0.6070047",
"text": "def hexdigest(data); end",
"title": ""
},
{
"docid": "9b12dc079c560aa86486c8b0352214e6",
"score": "0.6036644",
"text": "def hash\n generate_data.hash\n end",
"title": ""
},
{
"docid": "962628b2af903dbb2084b5d330802c45",
"score": "0.60360545",
"text": "def insert(data)\n @hash_funcs.times do |i|\n set_bit(hash(i * 0xfba4c795 + @tweak, data) % (@filter.length * 8))\n end\n end",
"title": ""
},
{
"docid": "6bcc3bd48de4b6932288519b0f9f8020",
"score": "0.6002184",
"text": "def hash\n Digest::SHA256.hexdigest( \"#{nonce}#{time}#{difficulty}#{prev}#{data}\" )\n end",
"title": ""
},
{
"docid": "5aa093289345cf01ad79970a389c07fe",
"score": "0.5997287",
"text": "def generate_digest(data)\n Digest::SHA512.hexdigest(\"#{data}#{Session.secret}\")\n end",
"title": ""
},
{
"docid": "8ea13a7f09a2e3ae8dd1b95095669a91",
"score": "0.59506816",
"text": "def create_checksum(hrp, data)\n values = expand_hrp(hrp) + data\n polymod = polymod(values + [0, 0, 0, 0, 0, 0]) ^ 1\n (0..5).map { |i| (polymod >> 5 * (5 - i)) & 31 }\n end",
"title": ""
},
{
"docid": "cf1c8d67b1b68794d6c4b324ab8f9817",
"score": "0.5942677",
"text": "def sighash_for_legacy(index, script_code, hash_type)\n ins =\n inputs.map.with_index do |i, idx|\n if idx == index\n i.to_payload(script_code.delete_opcode(Tapyrus::Opcodes::OP_CODESEPARATOR))\n else\n case hash_type & 0x1f\n when SIGHASH_TYPE[:none], SIGHASH_TYPE[:single]\n i.to_payload(Tapyrus::Script.new, 0)\n else\n i.to_payload(Tapyrus::Script.new)\n end\n end\n end\n\n outs = outputs.map(&:to_payload)\n out_size = Tapyrus.pack_var_int(outputs.size)\n\n case hash_type & 0x1f\n when SIGHASH_TYPE[:none]\n outs = ''\n out_size = Tapyrus.pack_var_int(0)\n when SIGHASH_TYPE[:single]\n return \"\\x01\".ljust(32, \"\\x00\") if index >= outputs.size\n outs =\n outputs[0...(index + 1)].map.with_index { |o, idx| (idx == index) ? o.to_payload : o.to_empty_payload }.join\n out_size = Tapyrus.pack_var_int(index + 1)\n end\n\n ins = [ins[index]] if hash_type & SIGHASH_TYPE[:anyonecanpay] != 0\n\n buf = [\n [features].pack('V'),\n Tapyrus.pack_var_int(ins.size),\n ins,\n out_size,\n outs,\n [lock_time, hash_type].pack('VV')\n ].join\n\n Tapyrus.double_sha256(buf)\n end",
"title": ""
},
{
"docid": "df4bd43e1c5a7e9b27677f251e2af061",
"score": "0.5930101",
"text": "def create_checksum(hrp, data, spec)\n values = expand_hrp(hrp) + data\n const = (spec == Bech32::Encoding::BECH32M ? Bech32::BECH32M_CONST : 1)\n polymod = polymod(values + [0, 0, 0, 0, 0, 0]) ^ const\n (0..5).map{|i|(polymod >> 5 * (5 - i)) & 31}\n end",
"title": ""
},
{
"docid": "f66b6c27c0bf0c62f146e8f4285fdf44",
"score": "0.5927574",
"text": "def hash # :nodoc: \n instructions.hash\n end",
"title": ""
},
{
"docid": "e98bd0c0bc6df43ebff6152796342586",
"score": "0.59237134",
"text": "def create_control_code(*args)\n Digest::SHA1.hexdigest(args.join(''))\n end",
"title": ""
},
{
"docid": "84df00caf661b8998ea62a5d712aa618",
"score": "0.5893414",
"text": "def generate_digest(data)\n db = YAML.load_file('config/database.yml')\n OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new('SHA1'), db[RAILS_ENV]['secret'], data)\n end",
"title": ""
},
{
"docid": "89958bedc4a714eebde8887eddbe473d",
"score": "0.5878927",
"text": "def generate_shikata_block(state, length, cutoff)\n\t\t# Declare logical registers\n\t\tkey_reg = Rex::Poly::LogicalRegister::X86.new('key', 'eax')\n\t\tcount_reg = Rex::Poly::LogicalRegister::X86.new('count', 'ecx')\n\t\taddr_reg = Rex::Poly::LogicalRegister::X86.new('addr')\n\n\t\t# Declare individual blocks\n\t\tendb = Rex::Poly::SymbolicBlock::End.new\n\n\t\t# FPU blocks\n\t\tfpu = Rex::Poly::LogicalBlock.new('fpu', *fpu_instructions)\n\t\tfnstenv = Rex::Poly::LogicalBlock.new('fnstenv', \"\\xd9\\x74\\x24\\xf4\")\n\n\t\t# Get EIP off the stack\n\t\tpopeip = Rex::Poly::LogicalBlock.new('popeip',\n\t\t\tProc.new { |b| (0x58 + b.regnum_of(addr_reg)).chr })\n\n\t\t# Clear the counter register\n\t\tclear_register = Rex::Poly::LogicalBlock.new('clear_register',\n\t\t\t\"\\x31\\xc9\",\n\t\t\t\"\\x29\\xc9\",\n\t\t\t\"\\x33\\xc9\",\n\t\t\t\"\\x2b\\xc9\")\n\n\t\t# Initialize the counter after zeroing it\n\t\tinit_counter = Rex::Poly::LogicalBlock.new('init_counter')\n\n\t\t# Divide the length by four but ensure that it aligns on a block size\n\t\t# boundary (4 byte).\n\t\tlength += 4 + (4 - (length & 3)) & 3\n\t\tlength /= 4\n\n\t\tif (length <= 255)\n\t\t\tinit_counter.add_perm(\"\\xb1\" + [ length ].pack('C'))\n\t\telse\n\t\t\tinit_counter.add_perm(\"\\x66\\xb9\" + [ length ].pack('v'))\n\t\tend\n\n\t\t# Key initialization block\n\n\t\t# Decoder loop block\n\t\tloop_block = Rex::Poly::LogicalBlock.new('loop_block')\n\n\t\txor = Proc.new { |b| \"\\x31\" + (0x40 + b.regnum_of(addr_reg) + (8 * b.regnum_of(key_reg))).chr }\n\t\txor1 = Proc.new { |b| xor.call(b) + [ (b.offset_of(endb) - b.offset_of(fpu) - cutoff) ].pack('c') }\n\t\txor2 = Proc.new { |b| xor.call(b) + [ (b.offset_of(endb) - b.offset_of(fpu) - 4 - cutoff) ].pack('c') }\n\t\tadd = Proc.new { |b| \"\\x03\" + (0x40 + b.regnum_of(addr_reg) + (8 * b.regnum_of(key_reg))).chr }\n\t\tadd1 = Proc.new { |b| add.call(b) + [ (b.offset_of(endb) - b.offset_of(fpu) - cutoff) ].pack('c') }\n\t\tadd2 = Proc.new { |b| add.call(b) + [ (b.offset_of(endb) - b.offset_of(fpu) - 4 - cutoff) ].pack('c') }\n\t\tsub4 = Proc.new { |b| \"\\x83\" + (0xe8 + b.regnum_of(addr_reg)).chr + \"\\xfc\" }\n\t\tadd4 = Proc.new { |b| \"\\x83\" + (0xc0 + b.regnum_of(addr_reg)).chr + \"\\x04\" }\n\n\t\tloop_block.add_perm(\n\t\t\tProc.new { |b| xor1.call(b) + add1.call(b) + sub4.call(b) },\n\t\t\tProc.new { |b| xor1.call(b) + sub4.call(b) + add2.call(b) },\n\t\t\tProc.new { |b| sub4.call(b) + xor2.call(b) + add2.call(b) },\n\t\t\tProc.new { |b| xor1.call(b) + add1.call(b) + add4.call(b) },\n\t\t\tProc.new { |b| xor1.call(b) + add4.call(b) + add2.call(b) },\n\t\t\tProc.new { |b| add4.call(b) + xor2.call(b) + add2.call(b) })\n\n\t\t# Loop instruction block\n\t\tloop_inst = Rex::Poly::LogicalBlock.new('loop_inst',\n\t\t\t\"\\xe2\\xf5\")\n\n\t\t# Define block dependencies\n\t\tfnstenv.depends_on(fpu)\n\t\tpopeip.depends_on(fnstenv)\n\t\tinit_counter.depends_on(clear_register)\n\t\tloop_block.depends_on(popeip, init_counter)\n\t\tloop_inst.depends_on(loop_block)\n\n\t\t# Generate a permutation saving the EAX, ECX and ESP registers\n\t\tloop_inst.generate([\n\t\t\tRex::Arch::X86::EAX,\n\t\t\tRex::Arch::X86::ESP,\n\t\t\tRex::Arch::X86::ECX ], nil, state.badchars)\n\tend",
"title": ""
},
{
"docid": "f995e1105f7206c081ce1b6b722f4c5f",
"score": "0.5875685",
"text": "def hash(seed, data)\n mask = 0xffffffff\n\n h1 = seed & mask\n c1 = 0xcc9e2d51\n c2 = 0x1b873593\n\n data.unpack('V*').each do |k1|\n k1 = (k1 * c1) & mask\n k1 = rotate_left_32(k1, 15)\n k1 = (k1 * c2) & mask\n\n h1 = h1 ^ k1\n h1 = rotate_left_32(h1, 13)\n h1 = (h1 * 5 + 0xe6546b64) & mask\n end\n\n padded_remaining_bytes = data[(data.length & (mask ^ 3))..-1] + \"\\0\" * (4 - (data.length & 3))\n\n k1 = padded_remaining_bytes.unpack('V').first\n k1 = (k1 * c1) & mask\n k1 = rotate_left_32(k1, 15)\n k1 = (k1 * c2) & mask\n h1 = h1 ^ k1\n\n h1 = (h1 ^ data.length) & mask\n h1 = h1 ^ (h1 >> 16)\n h1 = (h1 * 0x85ebca6b) & mask\n h1 = h1 ^ (h1 >> 13)\n h1 = (h1 * 0xc2b2ae35) & mask\n h1 = h1 ^ (h1 >> 16)\n\n h1\n end",
"title": ""
},
{
"docid": "9184f01257242481135b578a4ade1c72",
"score": "0.5845182",
"text": "def generate_binary\n generate.to_a.pack('H*')\n end",
"title": ""
},
{
"docid": "a4e02373e766881204a59e8498b5ad36",
"score": "0.5824776",
"text": "def calc_hash( data )\n sha = Digest::SHA256.new\n sha.update( data )\n sha.hexdigest\nend",
"title": ""
},
{
"docid": "f7403ed60e53bb7569dc0ad188afe5d0",
"score": "0.5819073",
"text": "def elfhash( key, len=key.length )\n state = 0\n x = 0\n len.times{ |i|\n state = (state << 4) + key[i]\n if (x = state & 0xF0000000) != 0\n state ^= (x >> 24)\n state &= ~x\n end\n }\n return state\nend",
"title": ""
},
{
"docid": "53b66f31eb1b0c8fca11a9ef4cde2899",
"score": "0.58181477",
"text": "def hash expr, algo = 'SHA1'\n Expression.new(\"CONVERT(BINARY(32), HASHBYTES('#{algo}', #{expr}), 2)\", MM::DataType::TYPE_Binary, expr.is_mandatory)\n end",
"title": ""
},
{
"docid": "ff8d4672c81bba063ff8298c10b40445",
"score": "0.57949984",
"text": "def generate_code\n\n self.code = Digest::SHA1.hexdigest( Time.now.to_s.split(//).sort_by {rand}.join )\n\n end",
"title": ""
},
{
"docid": "d367e47d3948337dd7d9277b0883f040",
"score": "0.57927877",
"text": "def generate_hash\n 5.times.map { BASE62.sample }.join\n end",
"title": ""
},
{
"docid": "d3b720c0b7af64d4bf666435ff7bb4f3",
"score": "0.5786208",
"text": "def hash_block\n hash_string = [index,timestamp,data,prev_hash].join\n sha = Digest::SHA256.new\n sha.update(hash_string)\n sha.hexdigest\n end",
"title": ""
},
{
"docid": "b9ad0210b86d9f175d5ac23572c82396",
"score": "0.5761802",
"text": "def generate_hash\n LiabilityProof.sha256_base64 \"#{user}|#{sum_string}|#{nonce}\"\n end",
"title": ""
},
{
"docid": "e64a5d3349cb9ad40ad2ce5ecf9f2c21",
"score": "0.5761799",
"text": "def generate_hash\n ActiveSupport::SecureRandom.hex(8) # Generates 16 character hexdecimal string.\n end",
"title": ""
},
{
"docid": "cd0625d51ee1bdb3186c65a1106d3903",
"score": "0.5761122",
"text": "def generate_digest(data)\n OpenSSL::HMAC.hexdigest(DIGEST, @secret, data)\n end",
"title": ""
},
{
"docid": "c2671506e2eba5550fb69fb68255b58c",
"score": "0.5752538",
"text": "def sha1(string)\n# functions and constants\nmask = 0xffffffff\ns = proc{|n, x| ((x << n) & mask) | (x >> (32 - n))}\nf = [\n proc {|b, c, d| (b & c) | (b.^(mask) & d)},\n proc {|b, c, d| b ^ c ^ d},\n proc {|b, c, d| (b & c) | (b & d) | (c & d)},\n proc {|b, c, d| b ^ c ^ d},\n].freeze\nk = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6].freeze\n\n# initial hash\nh = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]\n\nbit_len = string.size << 3\nstring += \"\\x80\"\nwhile (string.size % 64) != 56\n string += \"\\0\"\nend\nstring = string.force_encoding('ascii-8bit') + [bit_len >> 32, bit_len & mask].pack(\"N2\")\n\nif string.size % 64 != 0\n fail \"failed to pad to correct length\"\nend\n\np string.unpack(\"C*\")\n\nio = StringIO.new(string)\nblock = \"\"\n\nwhile io.read(64, block)\n w = block.unpack(\"N16\")\n\n # Process block.\n (16..79).each {|t| w[t] = s[1, w[t-3] ^ w[t-8] ^ w[t-14] ^ w[t-16]]}\n\n a, b, c, d, e = h\n t = 0\n 4.times do |i|\n 20.times do\n temp = (s[5, a] + f[i][b, c, d] + e + w[t] + k[i]) & mask\n a, b, c, d, e = temp, a, s[30, b], c, d\n t += 1\n end\n end\n\n [a,b,c,d,e].each_with_index {|x,i| h[i] = (h[i] + x) & mask}\nend\n\nh.pack(\"N5\")\nend",
"title": ""
},
{
"docid": "e8be5d532f64a39dbda80bdd1e629b10",
"score": "0.57308614",
"text": "def fingerprint\n @fingerprint ||= Digest::SHA1.hexdigest \"#{bin_extract_hash}-#{bin_prepare_hash}-#{bin_routed_hash}-#{profile_hash}-#{lua_lib_hash}-#{osm_hash}\"\nend",
"title": ""
},
{
"docid": "5379da235251a0df319f64249ce04402",
"score": "0.5724815",
"text": "def run_generate(checksums); end",
"title": ""
},
{
"docid": "0f2d0ca6a0560c9cdeb6e77daafcedda",
"score": "0.57154775",
"text": "def hash_for(key)\n (key.crc32_ITU_T >> 16) & 0x7fff\n end",
"title": ""
},
{
"docid": "ecfea893727901bfaacc794de990b3bd",
"score": "0.5707651",
"text": "def rdp_final_hash(k, clientRandom_bytes, serverRandom_bytes)\n md5 = Digest::MD5.new\n\n md5 << k\n md5 << clientRandom_bytes\n md5 << serverRandom_bytes\n\n [md5.hexdigest].pack(\"H*\")\n end",
"title": ""
},
{
"docid": "3b886d2d005ab5061f8a78b7dcf921a8",
"score": "0.56928605",
"text": "def generate(*args)\n # Call the real generator to get the payload\n buf = super(*args)\n pre = ''\n app = ''\n\n test_arch = [ *(self.arch) ]\n\n # Handle all x86 code here\n if (test_arch.include?(ARCH_X86))\n\n # Syscall code\n sc = \"\\x68\\xff\\xd8\\xff\\x3c\" + # pushl $0x3cffd8ff #\n \"\\x6a\\x65\" + # pushl $0x65 #\n \"\\x89\\xe6\" + # movl %esp,%esi #\n \"\\xf7\\x56\\x04\" + # notl 0x04(%esi) #\n \"\\xf6\\x16\" # notb (%esi) #\n\n # Prepend\n\n if (datastore['PrependSetreuid'])\n # setreuid(0, 0)\n pre << \"\\x31\\xc0\" + # xorl %eax,%eax #\n \"\\x50\" + # pushl %eax #\n \"\\x50\" + # pushl %eax #\n \"\\xb0\\xca\" + # movb $0xca,%al #\n \"\\xff\\xd6\" # call *%esi #\n end\n\n if (datastore['PrependSetuid'])\n # setuid(0)\n pre << \"\\x31\\xc0\" + # xorl %eax,%eax #\n \"\\x50\" + # pushl %eax #\n \"\\xb0\\x17\" + # movb $0x17,%al #\n \"\\xff\\xd6\" # call *%esi #\n end\n\n if (datastore['PrependSetregid'])\n # setregid(0, 0)\n pre << \"\\x31\\xc0\" + # xorl %eax,%eax #\n \"\\x50\" + # pushl %eax #\n \"\\x50\" + # pushl %eax #\n \"\\xb0\\xcb\" + # movb $0xcb,%al #\n \"\\xff\\xd6\" # call *%esi #\n end\n\n if (datastore['PrependSetgid'])\n # setgid(0)\n pre << \"\\x31\\xc0\" + # xorl %eax,%eax #\n \"\\x50\" + # pushl %eax #\n \"\\xb0\\x2e\" + # movb $0x2e,%al #\n \"\\xff\\xd6\" # call *%esi #\n end\n # Append\n\n if (datastore['AppendExit'])\n # exit(0)\n app << \"\\x31\\xc0\" + # xorl %eax,%eax #\n \"\\x50\" + # pushl %eax #\n \"\\xb0\\x01\" + # movb $0x01,%al #\n \"\\xff\\xd6\" # call *%esi #\n end\n\n # Prepend syscall code to prepend block\n if !(pre.empty?)\n pre = sc + pre\n end\n\n # Prepend syscall code to append block\n if !(app.empty?)\n app = sc + app\n end\n\n end\n\n return (pre + buf + app)\n end",
"title": ""
},
{
"docid": "19a5797119b1ff8e46865c7ec1cfb2aa",
"score": "0.56816185",
"text": "def compile_encrypted\n bytes = input.unpack('C*')\n\n instructions = []\n\n bytes.each_slice(4 * 8).each do |register_group|\n random_instructions = []\n register_instructions = []\n\n # xor_instructions = []\n random_values = []\n random_value_ints = []\n\n variable_value = 42\n\n # Shuffle values\n integer_values = register_group.each_slice(4).map do |byte_group|\n byte_group << 0 while byte_group.size < 4\n byte_group.pack('C*').unpack1('N')\n end\n integer_values << 0 while integer_values.size < 8\n\n # Generates the sort operations needed to shuffle the registers\n # We replay these in reverse before printing the output\n shuffle_order = (0..7).to_a.shuffle\n # puts shuffle_order.inspect\n shuffle_register_operations = RegisterSorter.sort_and_generate_operations(\n values: integer_values,\n order: shuffle_order,\n # Pick a random temporary register each time\n temp_register: (8..15).to_a.sample\n )\n\n # Now XOR all the registers together in a sequence\n # These XOR operations needs to happen before we unshuffle the registers.\n xor_instructions = []\n xor_sequence = (0..7).to_a.shuffle\n\n # Also we throw in another random value in the middle.\n # Make sure we keep 0f (15) zero so we can do the divide by zero trick.\n random_register_int = (8..14).to_a.sample\n random_register = random_register_int.to_hex\n random_value = SecureRandom.hex(4)\n random_int = random_value.scan(/../).map(&:hex).pack('C*').unpack1('N')\n\n xor_sequence.each_with_index do |xor_index, index|\n next if index.zero?\n\n to_index = xor_sequence[index - 1]\n from_index = xor_index\n integer_values[to_index] ^= integer_values[from_index]\n\n to_register = to_index.to_hex\n from_register = from_index.to_hex\n xor_instructions.unshift(\"0c#{to_register}#{from_register}\")\n\n if index == 2\n integer_values[to_index] -= 1\n integer_values[to_index] %= Solver::MOD_INT\n xor_instructions.unshift(\"02#{to_register}\")\n elsif index == 6\n integer_values[to_index] += 1\n integer_values[to_index] %= Solver::MOD_INT\n xor_instructions.unshift(\"03#{to_register}\")\n end\n\n next unless index == 4\n\n # We add a random number to this index, so then we need to\n # subtract it. (Operations unshifted in reverse order)\n # This random value is un-shifted into the register below\n # (which puts it at the beginning of the array)\n integer_values[to_index] += random_int\n integer_values[to_index] %= Solver::MOD_INT\n xor_instructions.unshift \"07#{to_register}#{random_register}\"\n end\n\n # Set the random value in the temp register before running the XOR operations.\n xor_instructions.unshift \"00#{random_register}#{random_value}\"\n\n bitshift_registers = (0..7).to_a.sample(3)\n\n integer_values.each_with_index do |integer, register_index|\n if register_index.zero?\n # Initialize the random values and load them into spare registers\n random_values = Array.new(4) { SecureRandom.hex(4) }\n random_values.each_with_index do |val, i|\n register = (i + 8).to_hex\n random_instructions << \"00#{register}#{val}\"\n end\n random_value_ints = random_values.map do |val|\n val.scan(/../).map(&:hex).pack('C*').unpack1('N')\n end\n\n # Set 42 in register 5. This is incremented,\n # subtract, decrement, added, xored, multiplied, xored,\n # then divided by 10.\n # (in a loop)\n variable_hex = variable_value.to_hex\n random_instructions << \"000c000000#{variable_hex}\"\n\n # Shuffle all the random constants\n random_instructions.shuffle!\n end\n\n # The current register\n register = register_index.to_hex\n\n # byte_group << 0 while byte_group.size < 4\n\n # Just use 4 registers for random data\n random_value_index = (7 - register_index) % 4\n # random_hex = random_values[random_value_index]\n # random_bytes = random_hex.scan(/../).map(&:hex)\n random_int = random_value_ints[random_value_index]\n\n # XOR with random byte\n integer ^= random_int\n random_register = (random_value_index + 8).to_hex\n xor_random_instruction = \"0c#{register}#{random_register}\"\n\n # Adjust the variable, and perform the same operation in bytecode\n case register_index % 8\n when 0 # inc\n variable_value += 1\n variable_instruction = '020c'\n when 1 # sub\n # The previous register is now decrypted, so we can use this value.\n previous_register_index = register_index - 1\n previous_value = integer_values[previous_register_index]\n previous_register = previous_register_index.to_hex\n\n variable_value -= previous_value\n variable_instruction = \"070c#{previous_register}\"\n when 2 # dec\n variable_value -= 1\n variable_instruction = '030c'\n when 3 # add\n variable_value += random_int\n variable_instruction = \"060c#{random_register}\"\n when 4 # xor previous\n previous_register_index = register_index - 1\n previous_value = integer_values[previous_register_index]\n previous_register = previous_register_index.to_hex\n variable_value ^= previous_value\n variable_instruction = \"0c0c#{previous_register}\"\n when 5 # mul\n previous_register_index = register_index - 1\n previous_value = integer_values[previous_register_index]\n previous_register = previous_register_index.to_hex\n\n variable_value *= previous_value\n variable_instruction = \"080c#{previous_register}\"\n when 6 # div\n # We need to set up another small constant in another register,\n # otherwise the result will often be zero\n variable_value /= 7\n variable_instruction = \"000d00000007#{command_sep}090c0d\"\n when 7\n # xor the actual integer with\n # some random previous registers (not including itself)\n variable_instructions = []\n\n # Also NOT the variable\n variable_value = ~variable_value\n variable_instructions << '0d0c'\n\n value_and_index = integer_values[0...-1].each_with_index.to_a\n\n value_and_index.sample(4).each do |(int, reg_index)|\n integer ^= int\n previous_register = reg_index.to_hex\n variable_instructions << \"0c#{register}#{previous_register}\"\n end\n\n variable_instruction = variable_instructions.shuffle.join(command_sep)\n end\n\n variable_value = variable_value % Solver::MOD_INT\n\n # XOR with the variable\n integer ^= variable_value\n xor_variable_instruction = \"0c#{register}0c\"\n\n extra_instructions = []\n if register_index == bitshift_registers[0]\n # Right shift the integer value to zero out the last bit\n # - Divide zero by zero to get ffffffff (0f register is zero by default)\n # - Left shift to get fffffffe\n # - NOT to get 00000001\n # - Left shift the integer to restore the bits (apart from the last one)\n # - OR 00000001 with the integer to set the last bit (if necessary)\n last_bit = integer & 1\n integer >>= 1\n extra_instructions << \"0f#{register}\"\n\n extra_instructions << '090f0f'\n extra_instructions << '0f0f' if last_bit == 1\n extra_instructions << '0d0f'\n extra_instructions << \"0b#{register}0f\"\n # Right shift to reset 0f to 00000000 if needed\n extra_instructions << '0e0f' if last_bit == 1\n\n elsif register_index == bitshift_registers[1]\n # This time use a left shift instead of a right shift.\n first_bit = integer >> ((8 * 4) - 1) & 1\n integer <<= 1\n extra_instructions << \"0e#{register}\"\n\n extra_instructions << '090f0f'\n extra_instructions << '0e0f' if first_bit == 1\n extra_instructions << '0d0f'\n extra_instructions << \"0b#{register}0f\"\n # Left shift to reset 0f to 00000000 if needed\n extra_instructions << '0f0f' if first_bit == 1\n\n elsif register_index == bitshift_registers[2]\n # This time use AND instead of NOT + OR\n last_bit = integer & 1\n\n # 0 & 1 is always 0, so we can't do any shifting,\n # but at least we can make the 0f bytes end in 0.\n # (So we will always do 0 & 0 = 0)\n\n # if last_bit.zero?\n # integer >>= 1\n # extra_instructions << \"0f#{register}\"\n # end\n\n extra_instructions << '090f0f'\n extra_instructions << '0f0f' if last_bit.zero?\n\n extra_instructions << \"0a#{register}0f\"\n\n # NOT to reset to 00000000 or 00000001\n extra_instructions << '0d0f'\n # Right shift to reset to 00000000\n extra_instructions << '0e0f' if last_bit.zero?\n end\n\n integer %= Solver::MOD_INT\n\n # Repack into hex string\n hex_group = [integer].pack('N').unpack1('H*')\n\n # Store the current integer into the register\n mov_instruction = \"00#{register}#{hex_group}\"\n\n register_instructions << [\n mov_instruction,\n extra_instructions.join(command_sep),\n variable_instruction,\n xor_random_instruction,\n xor_variable_instruction\n ].compact\n end\n\n # Add all the random value instructions in a random order.\n random_instructions.shuffle.each { |i| instructions << i }\n\n # Important - We can't shuffle these, because the\n # variable instructions depend on the order of operations.\n register_instructions.each do |instruction_group|\n instruction_group.each { |i| instructions << i }\n end\n\n # Now that we've loaded all of the encrypted bytes, run the code\n # that decrypts them.\n\n # # Start by setting 42 in the last register\n # instructions << '000f0000002a'\n\n # Run all the XOR instructions\n xor_instructions.each { |i| instructions << i }\n\n # Now take all of the sort instructions from the beginning,\n # and replay them in reverse. This unshuffles the registers\n # into the original order.\n shuffle_register_operations.reverse_each do |(to, from)|\n to_reg = to.to_hex\n from_reg = from.to_hex\n instructions << \"01#{from_reg}#{to_reg}\"\n end\n\n # We only have 8 registers that can print to output.\n # Set output format to ascii, print output, reset state.\n instructions << flush_instruction\n end\n\n # Make sure format is set to ASCII if required\n instructions << flush_instruction if as_ascii && instructions.last != flush_instruction\n\n instructions.join(command_sep)\n end",
"title": ""
},
{
"docid": "9fd2d99d29ee224ad1f4b247011bbed0",
"score": "0.56681496",
"text": "def rdp_final_hash(k, client_random_bytes, server_random_bytes)\n md5 = Digest::MD5.new\n\n md5 << k\n md5 << client_random_bytes\n md5 << server_random_bytes\n\n [md5.hexdigest].pack(\"H*\")\n end",
"title": ""
},
{
"docid": "0dbe2a68299399de67be9d62005975d7",
"score": "0.5667282",
"text": "def hash;0;end",
"title": ""
},
{
"docid": "99188b8470caa41d932ee03b72e098e5",
"score": "0.5662495",
"text": "def pack_hexdigest(bin); end",
"title": ""
},
{
"docid": "99188b8470caa41d932ee03b72e098e5",
"score": "0.5662495",
"text": "def pack_hexdigest(bin); end",
"title": ""
},
{
"docid": "2794c2d7f524cf2061720edffed6d0b6",
"score": "0.5660363",
"text": "def block_hash\n SecureRandom.hex[0..11]\nend",
"title": ""
},
{
"docid": "1fd99625d956c14179cfaa50b7f989f3",
"score": "0.5656685",
"text": "def generate\n\t\tcmd = datastore['CMD'] || ''\n\t\tpayload =\n\t\t\t\"\\x31\\xc0\\x50\"+\n\t\t\tRex::Arch::X86.call(cmd.length + 1) + cmd +\n\t\t\t\"\\x00\\x5e\\x89\\xe7\\xb9\\x1e\\x00\" +\n\t\t\t\"\\x00\\x00\\xfc\\xf2\\xa4\\x89\\xe3\\x50\" +\n\t\t\t\"\\x50\\x53\\xb0\\x3b\\x50\\xcd\\x80\"\n\tend",
"title": ""
},
{
"docid": "53554bc30d49f92f2571943cd479d5cb",
"score": "0.56544125",
"text": "def evalsha(*args); end",
"title": ""
},
{
"docid": "53554bc30d49f92f2571943cd479d5cb",
"score": "0.56544125",
"text": "def evalsha(*args); end",
"title": ""
},
{
"docid": "874eab8c43978e5c45cd8fc6adf0e6b7",
"score": "0.56483436",
"text": "def generate_digest(data)\n key = @secret.respond_to?(:call) ? @secret.call(@session) : @secret\n OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new(@digest), key, data)\n end",
"title": ""
},
{
"docid": "d1b3558f967bdf06ff4983ae47b28a48",
"score": "0.5640337",
"text": "def generate_sp_challenge\n generate_unique_hex(20)\n end",
"title": ""
},
{
"docid": "220705d043f4b1e059725ea56b0c79f4",
"score": "0.5636577",
"text": "def generate_hash\n return self.to_i % 0x3fffffff\n end",
"title": ""
},
{
"docid": "738800cbce4173eb5ed23941bd5a6df3",
"score": "0.5631895",
"text": "def hash_from_target(target)\n bytes = []\n while target > 0\n bytes << (target % 256)\n target /= 256\n end\n BTC::Data.data_from_bytes(bytes).ljust(32, \"\\x00\".b)\n end",
"title": ""
},
{
"docid": "ea580ab8a0c79154f9c2f0c1e860d4c7",
"score": "0.56299585",
"text": "def hashValue()\n n = data.length\n sum = 0\n p_base = 31\n exponent = 1\n data.each_byte do |c|\n sum += c*(p_base**(n-exponent))\n exponent += 1\n end\n return sum\n end",
"title": ""
},
{
"docid": "26f6d8ec2c773f8b5fe87e46edcc158f",
"score": "0.5612782",
"text": "def hash_block(block)\n chars = block.unpack('U*') # Get array of UTF-8 values of each char in block\n hash_calc = 0\n chars.each do |c|\n temp_char_hashes = $char_hashes\n temp_char_hashes[c] = (((c**3000) + (c**c) - (3**c)) * (7**c)) % 65_536 if temp_char_hashes[c].nil?\n hash_calc += temp_char_hashes[c]\n $char_hashes = temp_char_hashes\n end\n hash_calc %= 65_536 # Modulo\n hash_calc.to_s(16) # Convert to string of hexadecimal representation\nend",
"title": ""
},
{
"docid": "f413edca582f71b688114e663fc94081",
"score": "0.55966145",
"text": "def generate_pcode\n self.pcode = Digest::SHA1.hexdigest(Time.now.to_s.split(//).sort_by {rand}.join )\n self.save\n end",
"title": ""
},
{
"docid": "058b7411165e1c3ec2d620eea21d19ea",
"score": "0.5596544",
"text": "def update(data)\n new_block = Digest::SHA512.digest(@state + data.to_s)\n @state[64 * @mix_block_id, 64] = new_block\n @mix_block_id = (@mix_block_id + 1) % @size\n nil\n end",
"title": ""
},
{
"docid": "b78a8c3fbbda0dc6b3ed59f810316f24",
"score": "0.55922055",
"text": "def hash(*) end",
"title": ""
},
{
"docid": "12c9b7ea14d43172f0d7d1c6ca08e359",
"score": "0.5586694",
"text": "def hash_function key\r\n\t\treturn (key[1].ord + key[3].ord + key[5].ord)%20\r\n\tend",
"title": ""
},
{
"docid": "4e06d2760f146b1d832f9c2f34764bd5",
"score": "0.5574119",
"text": "def knot_hash(input)\n result = 0\n \n # Add elements as specified in the description\n ascii = input.bytes + [17, 31, 73, 47, 23]\n \n # Twist it 64 times\n numbers = twist(ascii, 64)\n \n # Xor groups of 16 elements\n dense_hash = Array.new\n numbers.each_slice(16) do |slice|\n dense_hash << slice.reduce(&:^)\n end\n \n # Convert to hexadecimal\n hexa = Array.new\n dense_hash.each do |d|\n hexa << d.to_s(16).rjust(2, '0')\n end\n \n return hexa.join(\"\")\nend",
"title": ""
},
{
"docid": "29c461a4b30c9e7e92727191f1066b77",
"score": "0.55732197",
"text": "def generate_digest(data)\n key = @secret.respond_to?(:call) ? @secret.call(@session) : @secret\n OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new(@digest), key, data)\n end",
"title": ""
},
{
"docid": "1e5de151127d3408a94e3385d355b921",
"score": "0.5569773",
"text": "def verification_code\n raise ArgumentError, 'Hash is not set' if @hash.nil?\n\n binary = @hash.unpack1('B*').split //\n [*binary.last(16)].join.to_i(2).to_s.split(//).last(4).join.to_i\n end",
"title": ""
},
{
"docid": "6938cc34537e4457ae5dd123375a97d6",
"score": "0.55667865",
"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": "f40d067f095889749fa42a040ea2f247",
"score": "0.5565574",
"text": "def set_hash()\n @hash = 0\n 64.times{|i|\n if (@color[i] != EMPTY)\n @hash ^= @hash_piece[@color[i]][@piece[i]][i];\n end\n }\n \n @hash ^= @hash_side if (@side == DARK)\n @hash ^= @hash_ep[@ep] if (@ep != -1)\n end",
"title": ""
},
{
"docid": "361b4a8b680dae2d0cf8b9b2940bbfae",
"score": "0.55639935",
"text": "def hash expr, algo = nil\n Expression.new(\"UNHEX(SHA1(#{expr}))\", MM::DataType::TYPE_Binary, expr.is_mandatory)\n end",
"title": ""
},
{
"docid": "74a84c8b08d68a05c6a9a401ee9bad2d",
"score": "0.5560142",
"text": "def hash(msg)\r\n\r\n #initialising SHA1 variables\r\n h = [0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]\r\n \r\n #Pre-processing:\r\n #append 1 bit\r\n #append 0 bits until message length = 448 mod(512)\r\n #append length of message in binary as 64 bit big endian\r\n msg_bits = 8*msg.length\r\n msg << 0x80\r\n msg << 0x00 while((msg.length & 63) != 56)\r\n msg << [(\"%016X\" % msg_bits)].pack(\"H*\")\r\n\r\n msg = Encoder.to_32_bits(msg)\r\n \r\n #message is processed in 512bit chunks\r\n #input[0] is w[0], input[1] is w[1]\r\n #Attempting to use low storage requirement algorithm\r\n #S^i(X) = (X << i) OR (X >> 32-i)\r\n \r\n #16 = blocksize/wordsize since wordsize = 32, blocksize = 512\r\n numBlocks = msg.length/16 \r\n w = Array.new\r\n numBlocks.times do |block|\r\n \r\n 16.times do |i|\r\n w[i] = msg[block*16+i]\r\n end\r\n \r\n a = h[0]; b = h[1]; c = h[2]; d = h[3]; e = h[4]\r\n \r\n 80.times do |i|\r\n s = i&15 #MASK = 15\r\n if(i >= 16)\r\n holder = (w[(s+13)&15]^w[(s+8)&15]^w[(s+2)&15]^w[s])\r\n w[s] = left_c_shift(holder, 1)\r\n end\r\n \r\n if(i < 20)\r\n temp = left_c_shift(a,5) + sha1_f1(b,c,d) + e + w[s] + 0x5A827999\r\n elsif (i < 40)\r\n temp = left_c_shift(a,5) + sha1_f2(b,c,d) + e + w[s] + 0x6ED9EBA1\r\n elsif (i < 60)\r\n temp = left_c_shift(a,5) + sha1_f3(b,c,d) + e + w[s] + 0x8F1BBCDC\r\n else\r\n temp = left_c_shift(a,5) + sha1_f4(b,c,d) + e + w[s] + 0xCA62C1D6\r\n end\r\n \r\n e = d\r\n d = c\r\n c = left_c_shift(b, 30)\r\n b = a\r\n a = temp\r\n end\r\n \r\n h[0] = (h[0]+a)&0xFFFFFFFF \r\n h[1] = (h[1]+b)&0xFFFFFFFF\r\n h[2] = (h[2]+c)&0xFFFFFFFF\r\n h[3] = (h[3]+d)&0xFFFFFFFF\r\n h[4] = (h[4]+e)&0xFFFFFFFF\r\n end\r\n\r\n #Returning in hex\r\n #output = \"\"\r\n #h.each do |i|\r\n # output << (\"%08X\" % i)\r\n #end\r\n #return output\r\n \r\n #Returning in ascii\r\n Encoder.from_32_bits(h)\r\n end",
"title": ""
},
{
"docid": "fc462084f71fb77e5520cade24d58f63",
"score": "0.55318344",
"text": "def hexhmac(key, data)\n OpenSSL::HMAC.hexdigest(HMAC_CIPHER, key, data)\n end",
"title": ""
},
{
"docid": "db4343907f5f9364737341c7466a0c4c",
"score": "0.5527236",
"text": "def rdp_final_hash(k, client_random_bytes, server_random_bytes)\n md5 = Digest::MD5.new\n\n md5 << k\n md5 << client_random_bytes\n md5 << server_random_bytes\n\n return([md5.hexdigest].pack(\"H*\"))\n end",
"title": ""
},
{
"docid": "d5572c3fbb9fd2e05754e9007957ca87",
"score": "0.5515815",
"text": "def hash_block(data)\n \n end",
"title": ""
},
{
"docid": "ed35ed776b2b9a329bf2112b8e5c439d",
"score": "0.55146825",
"text": "def trans_hash_gen\n\n self.send_components = {:formatted_dob => formatted_dob, :access_code => self.user_access_code_gen}\n\n return Digest::SHA256.hexdigest(self.send_components.values.join(\"\")) # hashes in ruby >= 1.9 are ordered in the order keys are added\n end",
"title": ""
},
{
"docid": "10191fbe5cead9636592643060611dfa",
"score": "0.5506238",
"text": "def rdp_hmac(mac_salt_key, data_content)\n sha1 = Digest::SHA1.new\n md5 = Digest::MD5.new\n\n pad1 = \"\\x36\" * 40\n pad2 = \"\\x5c\" * 48\n\n sha1 << mac_salt_key\n sha1 << pad1\n sha1 << [data_content.length].pack('<L')\n sha1 << data_content\n\n md5 << mac_salt_key\n md5 << pad2\n md5 << [sha1.hexdigest].pack(\"H*\")\n\n [md5.hexdigest].pack(\"H*\")\n end",
"title": ""
},
{
"docid": "10191fbe5cead9636592643060611dfa",
"score": "0.5506238",
"text": "def rdp_hmac(mac_salt_key, data_content)\n sha1 = Digest::SHA1.new\n md5 = Digest::MD5.new\n\n pad1 = \"\\x36\" * 40\n pad2 = \"\\x5c\" * 48\n\n sha1 << mac_salt_key\n sha1 << pad1\n sha1 << [data_content.length].pack('<L')\n sha1 << data_content\n\n md5 << mac_salt_key\n md5 << pad2\n md5 << [sha1.hexdigest].pack(\"H*\")\n\n [md5.hexdigest].pack(\"H*\")\n end",
"title": ""
},
{
"docid": "6eb16826da500de4ce49ebe6ae680930",
"score": "0.5504942",
"text": "def generate_code\n self.code = SecureRandom.hex\n end",
"title": ""
},
{
"docid": "fa32e7ddca70f97f26f92ddc8d01baa6",
"score": "0.5499264",
"text": "def hasher(string)\n puts\n puts \"[\".light_blue + \"*\".white + \"]\".light_blue + \" Hash Generator Results for: #{string}\".white\n puts \"############################################################\".light_blue\n puts \"Rot13\".light_blue + \": #{string.rot13}\".white\n puts \"Base64\".light_blue + \": #{string.b64e.chomp}\".white\n puts \"Hex\".light_blue + \": #{string.hexme}\".white\n puts \"0xHex\".light_blue + \": #{string.mysqlhex}\".white\n puts \"DES\".light_blue + \": #{des_crypt(string)}\".white\n puts \"ASCII\".light_blue + \": #{string.asciime}\".white\n puts \"MD4\".light_blue + \": #{md4(string)}\".white\n puts \"MD5\".light_blue + \": #{md5(string)}\".white\n begin\n puts \"LM\".light_blue + \": #{lm(string)}\".white\n puts \"NTLM\".light_blue + \": #{ntlm(string)}\".white\n rescue Iconv::IllegalSequence\n puts \"Skipping LM|NTLM Hashing of #{entry} due to issues with encoding, sorry.....\"\n end\n puts \"SHA1\".light_blue + \": #{sha1(string)}\".white\n puts \"MySQL5\".light_blue + \": #{mysql5_hash(string)}\".white\n puts \"Unicode\".light_blue + \": #{string.unicode}\".white\n puts \"Bcrypt\".light_blue + \": #{bcrypt(string)}\".white\n puts \"Joomla!\".light_blue + \": #{joomla_hash(string)}\".white\n begin\n puts \"LM:NTLM\".light_blue + \": #{ntlm_gen(string)}\".white\n rescue Iconv::IllegalSequence\n puts \"Skipping LM:NTLM Hashing of #{entry} due to issues with encoding, sorry.....\"\n end\n puts \"SHA256\".light_blue + \": #{sha256(string)}\".white\n puts \"SHA512\".light_blue + \": #{sha512(string)}\".white\n puts \"############################################################\\n\".light_blue\nend",
"title": ""
},
{
"docid": "8835bdfbb85acb9065895340afc7adc4",
"score": "0.54960555",
"text": "def hash_record(data)\n\n # %u %s=%s\\n\n # len name=hash\n\n hash = Digest::SHA1.hexdigest(data)\n name = \"APK-TOOLS.checksum.SHA1\"\n\n ret = \"#{name}=#{hash}\\n\"\n\n # the length requirement needs to know its own length too, because the length\n # is the entire length of the line, not just the contents.\n length = ret.length\n line_length = length.to_s\n length += line_length.length\n candidate_ret = \"#{line_length} #{ret}\"\n\n if(candidate_ret.length != length)\n length += 1\n candidate_ret = \"#{length.to_s} #{ret}\"\n end\n\n ret = candidate_ret\n\n # pad out the result\n ret = pad_string_to(ret, TAR_CHUNK_SIZE)\n return ret\n end",
"title": ""
},
{
"docid": "e6b30b37d512c76ee498bdad8c6f9e8e",
"score": "0.5495105",
"text": "def prf(data)\n @hash_func ||= OpenSSL::Digest.new('sha256')\n OpenSSL::HMAC.digest(@hash_func, @password, data)\n end",
"title": ""
},
{
"docid": "e514034d325fcdc65683714ae4afac59",
"score": "0.5493361",
"text": "def generate_hmac(data, secret)\n OpenSSL::HMAC.hexdigest(OpenSSL::Digest::SHA1.new, secret, data)\nend",
"title": ""
},
{
"docid": "06146b3517e15df4629105410dad491c",
"score": "0.5486979",
"text": "def hexdigest(*) end",
"title": ""
},
{
"docid": "06146b3517e15df4629105410dad491c",
"score": "0.5486979",
"text": "def hexdigest(*) end",
"title": ""
},
{
"docid": "06146b3517e15df4629105410dad491c",
"score": "0.5486979",
"text": "def hexdigest(*) end",
"title": ""
},
{
"docid": "de2f1a4b89e71b7161eb2f8bcb6bd591",
"score": "0.5478908",
"text": "def compute_hmac_sha1(data)\n PaiementCic.hmac_sha1(usable_key, data).downcase\n end",
"title": ""
},
{
"docid": "52c1947ebb4468b818af7a9c55b45dc4",
"score": "0.54731125",
"text": "def hexdigest(data)\n OpenSSL::Digest::SHA256.new(data).hexdigest\n end",
"title": ""
},
{
"docid": "756cd8a31967defaf52fca3d35404b49",
"score": "0.5472224",
"text": "def execute\n @emulator.program_counter = nil\n @emulator.instruction_register.update_with(\"0\" * 16)\n end",
"title": ""
},
{
"docid": "fe31ea9fc6ca9842b4a395569c650532",
"score": "0.5469283",
"text": "def hexdigest!\n Aux.hexdigest(state, get_crc_model.bitsize)\n end",
"title": ""
},
{
"docid": "66e7ebdc345bf94c9569cd44ad395546",
"score": "0.5467157",
"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": "e18b1a0f470ffe158ecb8ca4c44128b2",
"score": "0.5461053",
"text": "def generate_hash\n salt = OpenSSL::Random.random_bytes(new_resource.salt_length).unpack('H*')[0]\n iterations = new_resource.iterations\n hash = OpenSSL::PKCS5.pbkdf2_hmac_sha1(new_resource.password,\n salt,\n iterations, \n new_resource.key_length).unpack('H*')[0]\n \"-pbkdf2-#{hash},#{salt},#{iterations}\"\nend",
"title": ""
},
{
"docid": "b08e441fb7f082bfb1bb02c749271442",
"score": "0.54421854",
"text": "def checksum(data)\n\t\tsum = 0\n\t\tdata.each_char do |c|\n\t\t\tsum += c.ord\n\t\tend\n\t\tsum += STX.ord + ETX.ord\n\t\tsum = sum % 65535\n\t\treturn (sprintf \"%04x\", sum).upcase\n\tend",
"title": ""
},
{
"docid": "e8e2a21bb892d753e385d2017ab090cf",
"score": "0.54403913",
"text": "def recover_key\n 0.upto(255).each do |ch|\n @fpga_key = [@puf, [ch].pack('C')].join\n if @syndrome == Crypto.sk_encrypt(@fpga_key, (0..32).to_a.pack('C*'))\n break \n end\n end\n end",
"title": ""
},
{
"docid": "13d24e3fbbd37c230f7e1e24b11b0d02",
"score": "0.5438663",
"text": "def add(data, n = 100_000)\n string = @hash + data\n n.times { string = Digest::SHA2.hexdigest(string) }\n @hash = string\n end",
"title": ""
},
{
"docid": "dab4a22f49c995b44f2e3a3dd480299b",
"score": "0.5431024",
"text": "def hexdigest; end",
"title": ""
},
{
"docid": "dab4a22f49c995b44f2e3a3dd480299b",
"score": "0.5431024",
"text": "def hexdigest; end",
"title": ""
},
{
"docid": "38a69119669b19dd40cd5e7f65cf38a8",
"score": "0.54304737",
"text": "def sha1(string,oldh=nil,offset=0)\n # functions and constants\n mask = 0xffffffff\n s = proc{|n, x| ((x << n) & mask) | (x >> (32 - n))}\n f = [\n proc {|b, c, d| (b & c) | (b.^(mask) & d)},\n proc {|b, c, d| b ^ c ^ d},\n proc {|b, c, d| (b & c) | (b & d) | (c & d)},\n proc {|b, c, d| b ^ c ^ d},\n ].freeze\n k = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6].freeze\n \n # initial hash\n h = (oldh)?oldh[0..-1] : [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]\n \n bit_len = (string.size+offset) << 3\n string += \"\\x80\".force_encoding('ascii-8bit')\n while (string.size % 64) != 56\n string += \"\\0\"\n end\n string = string.force_encoding('ascii-8bit') + [bit_len >> 32, bit_len & mask].pack(\"N2\")\n if string.size % 64 != 0\n fail \"failed to pad to correct length\"\n end\n \n io = StringIO.new(string)\n block = \"\"\n \n while io.read(64, block)\n w = block.unpack(\"N16\")\n \n # Process block.\n (16..79).each {|t| w[t] = s[1, w[t-3] ^ w[t-8] ^ w[t-14] ^ w[t-16]]}\n \n a, b, c, d, e = h\n t = 0\n 4.times do |i|\n 20.times do\n temp = (s[5, a] + f[i][b, c, d] + e + w[t] + k[i]) & mask\n a, b, c, d, e = temp, a, s[30, b], c, d\n t += 1\n end\n end\n [a,b,c,d,e].each_with_index {|x,i| h[i] = (h[i] + x) & mask}\n end\n h.pack(\"N5\")\nend",
"title": ""
},
{
"docid": "6370f5439a72fe5a5a269cd6c71865a6",
"score": "0.54268074",
"text": "def rdp_hmac(mac_salt_key, data_content)\n sha1 = Digest::SHA1.new\n md5 = Digest::MD5.new\n\n pad1 = \"\\x36\" * 40\n pad2 = \"\\x5c\" * 48\n\n sha1 << mac_salt_key\n sha1 << pad1\n sha1 << [data_content.length].pack('<L')\n sha1 << data_content\n\n md5 << mac_salt_key\n md5 << pad2\n md5 << [sha1.hexdigest].pack(\"H*\")\n\n return([md5.hexdigest].pack(\"H*\"))\n end",
"title": ""
},
{
"docid": "035718af1519e76d23e3c4aa58938adb",
"score": "0.5426623",
"text": "def calc_M(username, xsalt, xaa, xbb, xkk, n, g)\n hn = sha1_hex('%x' % n).hex\n hg = sha1_hex(g).hex\n hxor = '%x' % (hn ^ hg)\n hi = sha1_str(username)\n\n hashin = [hxor, hi, xsalt, xaa, xbb, xkk].join\n sha1_hex(hashin).hex % n\n end",
"title": ""
},
{
"docid": "8f97e73317cd71f4efbc229f285343ba",
"score": "0.5422454",
"text": "def hash_function\n @hash_function ||= 'sha256'\n end",
"title": ""
},
{
"docid": "727edcfba5109cd0465d3592d9576509",
"score": "0.5421063",
"text": "def generate_hash(input)\n list_size = 256\n list = (0..(list_size - 1)).to_a\n position = 0\n skip_size = 0\n\n 64.times do\n input.each do |length|\n list = twist_knot(list, position, length)\n\n position = calculate_new_position(position, length, list_size, skip_size)\n skip_size += 1\n end\n end\n\n list.each_slice(16).map { |block| block.reduce(&:^).to_s(16).rjust(2, '0') }.join\nend",
"title": ""
},
{
"docid": "19f33ba92f239e22e1aca662a1d64ae4",
"score": "0.54181427",
"text": "def hmac_for data\n HMAC::SHA256.digest(KEY, data)\n end",
"title": ""
},
{
"docid": "226867762a59c5f604e4958d3c1a974d",
"score": "0.54179937",
"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": "d8a4e4ea3ac9dff185507a499bf0f4f1",
"score": "0.54153717",
"text": "def computeHMACSHA1(data)\n\t\thmac(data)\n\tend",
"title": ""
},
{
"docid": "c192bf4b0ff243f38b8e72d8723e7c1f",
"score": "0.5414469",
"text": "def generate\n mac(qop, uid, timestamp)\n end",
"title": ""
},
{
"docid": "c582ba77db4d881f010f475380817c54",
"score": "0.5409528",
"text": "def rdp_salted_hash(s_bytes, i_bytes, clientRandom_bytes, serverRandom_bytes)\n sha1 = Digest::SHA1.new\n md5 = Digest::MD5.new\n\n sha1 << i_bytes\n sha1 << s_bytes\n sha1 << clientRandom_bytes\n sha1 << serverRandom_bytes\n\n md5 << s_bytes\n md5 << [sha1.hexdigest].pack(\"H*\")\n\n [md5.hexdigest].pack(\"H*\")\n end",
"title": ""
},
{
"docid": "9849a076914dfdefeca13f3faca15928",
"score": "0.5404144",
"text": "def digest_h(data)\n ::Digest::MD5.hexdigest data\n end",
"title": ""
}
] |
5583bd49927411b31b095682ac5d0287
|
Get the total play count of all the songs added up for this artist
|
[
{
"docid": "fa88178fd77d06b8d808e8bc9bde6fbe",
"score": "0.68658715",
"text": "def playcount\n\t\t\tsearch_xml(\"//artist/stats/playcount\").inner_html rescue \"\"\n\t\tend",
"title": ""
}
] |
[
{
"docid": "d4d1e1e770ffaaa27019859221497781",
"score": "0.7620478",
"text": "def song_count\n songs.size\n end",
"title": ""
},
{
"docid": "7139f9d1653edd29bcaa930341ca499c",
"score": "0.7560905",
"text": "def total_songs\n \tself.songs.size\n end",
"title": ""
},
{
"docid": "3c0edda392690e8f3b653768ac4a6caa",
"score": "0.75596106",
"text": "def singles_total_plays\n singles_results.count\n end",
"title": ""
},
{
"docid": "7dd9985987425c8405dd11b1fe63e139",
"score": "0.7523034",
"text": "def songs_count\n songs.count\n end",
"title": ""
},
{
"docid": "4e40b4c4847efbc8c03b60d564485038",
"score": "0.7324503",
"text": "def track_count\n\t\t@result['Tracks'].each do\n\t\t\t@song_count +=1\n\t\tend\n\t\t@song_count\n\tend",
"title": ""
},
{
"docid": "c655ebcbc7e34f4d56bf54336289429e",
"score": "0.73238796",
"text": "def songs_count\n\t\tsongs.length\n\tend",
"title": ""
},
{
"docid": "c655ebcbc7e34f4d56bf54336289429e",
"score": "0.7323357",
"text": "def songs_count\n\t\tsongs.length\n\tend",
"title": ""
},
{
"docid": "971fa36bbfec1720e5675e7e863b7bf0",
"score": "0.7291028",
"text": "def doubles_total_plays\n total_plays = 0\n get_teams.each {|team| total_plays += team.doubles_results.count}\n total_plays\n end",
"title": ""
},
{
"docid": "3f3750309b4e431fd7c0e74a75d47d2e",
"score": "0.7284341",
"text": "def song_count\n @songs.count\n end",
"title": ""
},
{
"docid": "731d7840b3bf051d589405e8fb5723ef",
"score": "0.7234658",
"text": "def songs_count\n self.lib.songs.count\n end",
"title": ""
},
{
"docid": "a2095b8ce0776fc0d2dbcee93d4ea347",
"score": "0.7218251",
"text": "def song_count\n self.songs.size\n end",
"title": ""
},
{
"docid": "7109dda9fdeb4d145f5bdf24c698d852",
"score": "0.7133933",
"text": "def song_count\n self.songs.count # maybe can replace .count with .size or .length\n end",
"title": ""
},
{
"docid": "cfd7fcb439cbb53ff79dcfb2154c4689",
"score": "0.70986766",
"text": "def team_total_plays\n doubles_results.count\n end",
"title": ""
},
{
"docid": "8e19a64d6a564d623467393f08b90cf0",
"score": "0.70759416",
"text": "def number_of_songs()\n return @songs.length()\n end",
"title": ""
},
{
"docid": "3f08fdda417636e079e7c4493129ad52",
"score": "0.70671594",
"text": "def song_count\n self.songs.length\n end",
"title": ""
},
{
"docid": "94e2ae6d90262f954098d53ebcd7cecc",
"score": "0.7029781",
"text": "def artist_count\n\t\t@music_collection.each do |track|\n\t\t\tentry = /(.*) \\-/.match(track)\n\t\t\tnext unless entry\n\t\t\t@artists << entry[1]\n\t\tend\n\t\t@artists.each do |artist| \n\t\t\t@counts[artist] += 1 \n\t\t\tend\n\t\t@counts\n\tend",
"title": ""
},
{
"docid": "12cd0be80aeeaf1b2dbbf30ff16cc34b",
"score": "0.6991972",
"text": "def song_count\n self.songs.count\n end",
"title": ""
},
{
"docid": "ae079dd3e8a5071f8445e81041089772",
"score": "0.69664454",
"text": "def total_duration\n\t\tinject(0) {|memo, song| memo + song.duration }\n\tend",
"title": ""
},
{
"docid": "c765c926e57d053e221fa7d30c92c595",
"score": "0.69521457",
"text": "def number_of_songs\n\t\treturn @songs.length\n\tend",
"title": ""
},
{
"docid": "2961cc772b5b8931d192ad0fc1746044",
"score": "0.6945967",
"text": "def played_count\n if @_itunes_api == :win32ole\n @_itunes_object.playedcount\n elsif @_itunes_api == :appscript\n @_itunes_object.played_count.get\n else\n @_itunes_object.played_count\n end\n end",
"title": ""
},
{
"docid": "3721a9844f739112cb0d7a753d456015",
"score": "0.6853142",
"text": "def counter\n @song_count = Song.all.count\n @playlist_count = Playlist.all.count\n end",
"title": ""
},
{
"docid": "6dcb3a3adc28442ec44817776ac5c691",
"score": "0.6847906",
"text": "def total_tracks\n total = 0\n tracking_info[2..-1].chop!.each(',') { |track| total += track.to_i }\n total.to_s\n end",
"title": ""
},
{
"docid": "27ee905e0fa7ab0d8979c383969bbdf9",
"score": "0.684468",
"text": "def number_of_songs\n\t\t@songs.length\n\tend",
"title": ""
},
{
"docid": "7b0bf2ebb7b3b6a798ebed0b69b3dfe8",
"score": "0.68337905",
"text": "def band_count\n\t\t@music_collection.each {|track|\n\t\t\tentry = /(.*) \\-/.match(track)\n\t\t\tnext unless entry\n\t\t\t@artist_count << entry[1]}\n\t\t\tartists = @artist_count.uniq\n\t\t\tartists.count\n\t\t\t#total = artists.count\n\t\t\t# p \"there are #{total} artists in this queue\"\n\n\tend",
"title": ""
},
{
"docid": "dfce6b6c7face2eb5c50a4d82253fe61",
"score": "0.68008906",
"text": "def playlist_count\n return @playlist.count\n end",
"title": ""
},
{
"docid": "d6f16c5233dc49dacb37905b38634b64",
"score": "0.6754592",
"text": "def duration\n\t\tdur_total = 0\n\t\t@playlist.each do |song|\n\t\t\tdur_total += song.duration\n\t\tend\n\t\treturn dur_total\n\tend",
"title": ""
},
{
"docid": "8160eec3cbcb715f773a8de5a97d5bba",
"score": "0.67437744",
"text": "def get_total_games_played\n return games.size\n end",
"title": ""
},
{
"docid": "ff1e2e8740b562ca212b98c3ab3da257",
"score": "0.668006",
"text": "def song_count\n @song_count = 0 if @song_count.nil?\n @song_count\n end",
"title": ""
},
{
"docid": "ff03e7d787028955461fe811edd2bd6c",
"score": "0.66308844",
"text": "def song_count\n #pluralize could be placed in here.\n self.songs.length\n end",
"title": ""
},
{
"docid": "589e65244a6b34f2188cc8e1dae59fdd",
"score": "0.6591953",
"text": "def artist_count\n self.artists.size\n end",
"title": ""
},
{
"docid": "b1328767cdcbc9b75c214b91314a100b",
"score": "0.6498805",
"text": "def total_count\n results.total\n end",
"title": ""
},
{
"docid": "0391d332dcb00a97cd1caacd2b8baaa6",
"score": "0.64404035",
"text": "def size\n tracks.size\n end",
"title": ""
},
{
"docid": "be9a8d40ecaec91c39de25163b011e2a",
"score": "0.64207244",
"text": "def total_score\n score = 0\n @plays.each do |word|\n score += Scrabble::Scoring.score(word)\n end\n return score\n end",
"title": ""
},
{
"docid": "8b059baebdd1c4f5165e4d295fb0f30a",
"score": "0.64178175",
"text": "def items_count\n @entries.sum(&:quantity)\n end",
"title": ""
},
{
"docid": "27e6c7b19e4f09ff9fe147a3690fa450",
"score": "0.6410432",
"text": "def total_count\n results.total\n end",
"title": ""
},
{
"docid": "27e6c7b19e4f09ff9fe147a3690fa450",
"score": "0.6410432",
"text": "def total_count\n results.total\n end",
"title": ""
},
{
"docid": "27e6c7b19e4f09ff9fe147a3690fa450",
"score": "0.6410432",
"text": "def total_count\n results.total\n end",
"title": ""
},
{
"docid": "c7ebbfc96a1b84a7ff7e82b4646ad5e2",
"score": "0.6408979",
"text": "def total_score\n tot_score = 0\n @plays.each do |word|\n tot_score += Scrabble::Scoring.score(word)\n end\n return tot_score\n end",
"title": ""
},
{
"docid": "5e67f4bbfcc22a8614885c0a1e9cf132",
"score": "0.64045495",
"text": "def track_info\n @conference = Conference.find_by_acronym('jct2018')\n @tracks = @conference.tracks\n s = \"\"\n total_count = 0\n @tracks.each do |t|\n track_count = @conference.events.accepted.find_all_by_track_id(t.id).count\n s << \"Track: #{t.name}, accepted: #{track_count} \\n\"\n total_count += track_count\n end\n puts s\n puts \"total_count #{total_count}\"\n end",
"title": ""
},
{
"docid": "67fedbd21b46e96904bc282e37e21f6b",
"score": "0.6391363",
"text": "def total_score\n total_so_far = 0\n @plays.each do |i|\n total_so_far += Scrabble::Score.score(i)\n end\n return total_so_far\n end",
"title": ""
},
{
"docid": "99439359118830df2e27e43a3266c39c",
"score": "0.6356977",
"text": "def total_entries\n @watched_cursor.rewind!\n @watched_cursor.map {|w| w['movie_id'] }.uniq.size\n end",
"title": ""
},
{
"docid": "287e8d6a7c254a9390c324b0165c9c56",
"score": "0.6344277",
"text": "def to_playcount\n count = playcount || 0\n \"Played #{count} time#{'s' if count != 1}\"\n end",
"title": ""
},
{
"docid": "14f8d550307fa7af1fddc70d391a7260",
"score": "0.63279814",
"text": "def num_of_tracks\t# method for checking # of tracks\n\t\t@playlist.length # length of array holding playlist\n\tend",
"title": ""
},
{
"docid": "bede4fa175a93c426805bd128c3ae8e5",
"score": "0.6327068",
"text": "def total_playtime_ms\n self[:total_playtime_ms] || SegmentHistory.where(segment: segments).sum(:realtime_duration_ms)\n end",
"title": ""
},
{
"docid": "f676ae3372da7edb3743fc0cd6f43952",
"score": "0.6321182",
"text": "def total_score\n total = 0\n plays.each do |word|\n total += Scrabble::Scoring.score(word)\n end\n return total\n end",
"title": ""
},
{
"docid": "394a4798046450a5f403a35f714b7e5f",
"score": "0.63103664",
"text": "def total_count\n result_media.total_count\n end",
"title": ""
},
{
"docid": "398ab07258cf2a44266856e69a7b0d32",
"score": "0.63075745",
"text": "def total_count\n result_media[:nbHits]\n end",
"title": ""
},
{
"docid": "2f185e10fd78ced1fcf901fc3276b52f",
"score": "0.62757045",
"text": "def total_years\n total_years = 0\n self.all_artists.each do |artist|\n total_years += artist.years_active\n end\n total_years\n end",
"title": ""
},
{
"docid": "b225a92d02964f67bf13da7bc243d4a8",
"score": "0.62726545",
"text": "def count\n\t\tartists.length\n\tend",
"title": ""
},
{
"docid": "3fa3bbff054627033608466dd0a99247",
"score": "0.6271827",
"text": "def total_items_sold\n trackers.map(&:current_value).sum\n end",
"title": ""
},
{
"docid": "a13fe88bc17ad025a750b5b41eca0407",
"score": "0.62467855",
"text": "def all_song_rating_average\n\t\ttrack_count\n\t\t@result['Tracks'].each do |key, value|\n\t\t\t@rating_count += value['Rating'] \n\t\tend\n\t\t@rating_count\n\tend",
"title": ""
},
{
"docid": "e81b992c0c4c8284bd3635135c5a7e54",
"score": "0.62219906",
"text": "def count_tracks(id)\r\n file = File.read('artist_list.json')\r\n artists = JSON.parse(file)\r\n count = 0\r\n if artists.has_key?(id)\r\n artists[id][\"songs\"].each do |song|\r\n count += 1\r\n end\r\n puts \"The artist with id '#{id}' has #{count} songs on this IMS.\"\r\n else\r\n puts \"The artist with id '#{id}' does not exist on this IMS.\"\r\n end\r\n #puts id\r\n end",
"title": ""
},
{
"docid": "333ad82d32a975d21539e54002ad68d8",
"score": "0.62052447",
"text": "def album_count()\n sql = \"SELECT COUNT (title) FROM albums WHERE artist_id = $1\"\n values = [@id]\n return SqlRunner.run(sql, values)[0][\"count\"].to_i\n end",
"title": ""
},
{
"docid": "8283eb6003fea44db6ef103189e95f17",
"score": "0.6178844",
"text": "def count_tracks(artist_id)\n\t\t#display the number of tracks know by the specified artist\n\t\tif is_artist_id(artist_id)\n\t\t\tif @storage.has_artist(artist_id)\n\t\t tracks = @storage.get_tracks_by(artist_id)\n\t\t puts \"Artist #{artist_id} has #{tracks.size} track(s).\"\n\t\t else\n\t\t \tputs \"Error: Unrecognized artist ID\"\n\t\t end\n\t\tend\n\tend",
"title": ""
},
{
"docid": "106ca853783772c86da660357d6cce59",
"score": "0.6168854",
"text": "def total_count\n @entries.size\n end",
"title": ""
},
{
"docid": "d1109b2ea0df76028a1358afcd7e32d9",
"score": "0.6160731",
"text": "def play\n if Artist.where(id: params[:id]).exists?\n albums = Album.where(artist_id: params[:id])\n albums.each do |album|\n tracks = Track.where(album_id: album.id)\n tracks.each do |track|\n track.times_played += 1\n track.save\n end\n end \n return render status: 200\n else\n return render status: 404\n end\n end",
"title": ""
},
{
"docid": "55bfb01bda1ea211d3cf1a4087ccb0e1",
"score": "0.6148355",
"text": "def total_score\n # COMMENTED CODE IS PRE-ENUMERABLE VERSION\n # player_total_score = 0\n # @words_played.each do |word|\n # player_total_score += Scrabble::Scoring.score(word)\n # end\n\n all_scores = @words_played.map do |word|\n Scrabble::Scoring.score(word)\n end\n player_total_score = all_scores.reduce(:+)\n\n return player_total_score\n end",
"title": ""
},
{
"docid": "ab3ac4d994e45b57347bdfa265d1d9fd",
"score": "0.6128239",
"text": "def get_total_item_count\n self.initialize_cart unless @cart\n item_count = 0\n @cart.items.map { |item|\n item_count += item.fetch(\"table\").fetch(\"count\")\n }\n return item_count\n end",
"title": ""
},
{
"docid": "bfb884da5f0f1715fafefb53b5b4132c",
"score": "0.61233497",
"text": "def total_tracks\n track_number_string = @file_metadata.track.to_s\n if (index = track_number_string.index('/'))\n track_number_string[index + 1, track_number_string.length]\n else\n track_number_string\n end\n end",
"title": ""
},
{
"docid": "1dcb0af025852daf82ed59b441d41fc3",
"score": "0.6105157",
"text": "def duration\n @tracks.map(&:duration).compact.inject(:+)\n end",
"title": ""
},
{
"docid": "002769fcf842272df28adb4499543a88",
"score": "0.61030227",
"text": "def count\n if artist_info = (@input.match /count tracks by (?<artist_id>.+)/) \n @processor.display_track_count(artist_info[:artist_id])\n else @error_msg = \"[ERROR] Please input valid artist id!\" end\n end",
"title": ""
},
{
"docid": "37de9ca6872313d95dd03d6d3cb0a24a",
"score": "0.60986316",
"text": "def total_playtime\n Duration.new(self[:total_playtime_ms] || SegmentHistory.where(segment: segments).sum(:realtime_duration_ms))\n end",
"title": ""
},
{
"docid": "afe429377e84760250e580e5ec38eee6",
"score": "0.6092989",
"text": "def total_results\n total_entries\n end",
"title": ""
},
{
"docid": "bcdfec01a3a2747a345e7512b1f9ef01",
"score": "0.60810953",
"text": "def impression_total_count\n $redis.get( counter_key ).to_i\n end",
"title": ""
},
{
"docid": "01a09a0c47901e00016e511ee4804ec7",
"score": "0.60779583",
"text": "def total_entries\n results.total\n end",
"title": ""
},
{
"docid": "01a09a0c47901e00016e511ee4804ec7",
"score": "0.60779583",
"text": "def total_entries\n results.total\n end",
"title": ""
},
{
"docid": "01a09a0c47901e00016e511ee4804ec7",
"score": "0.60779583",
"text": "def total_entries\n results.total\n end",
"title": ""
},
{
"docid": "55f2f311ed2663b4231799cdea7844c1",
"score": "0.60673326",
"text": "def total_upvotes\r\n self.user.master_songs.sum(:song_up_votes_count)\r\n end",
"title": ""
},
{
"docid": "3546a1acda1d080d189589da83ed81ed",
"score": "0.6059215",
"text": "def player_score()\n total = 0\n player.each do |count|\n total += count\n end\n total\nend",
"title": ""
},
{
"docid": "70e71b0fa8df992c6edce11a1aa61a5c",
"score": "0.6050672",
"text": "def total_tests\n Stats.test_results.values.reduce(0) { |memo, obj| memo += obj.length }\n end",
"title": ""
},
{
"docid": "84e337260408840d7a344a47d51d3931",
"score": "0.60393775",
"text": "def count\n if loaded?\n @results.total_entries\n else\n limit(1).to_a.total_entries\n end\n end",
"title": ""
},
{
"docid": "a41202e7a259f475e4fe1e9f7315d446",
"score": "0.60345757",
"text": "def song_count=(value)\n @song_count = 0 if @song_count.nil?\n @song_count = value\n end",
"title": ""
},
{
"docid": "def8939dee90db4f90d5f8506a2b1587",
"score": "0.6012278",
"text": "def total_playtime(app_id)\n @total_playtimes[app_id]\n end",
"title": ""
},
{
"docid": "119d51f6def1802b3611079ef95ef3fe",
"score": "0.6007391",
"text": "def songs_in_room()\n return @songs.length()\n end",
"title": ""
},
{
"docid": "eb38e08fb060a5b02d97c1d7bbbba6a6",
"score": "0.60056716",
"text": "def total_count\n test_suites.values.sum(&:total_count)\n end",
"title": ""
},
{
"docid": "52b5ed59483b5765bded85b341d6d663",
"score": "0.6001557",
"text": "def total_beats\n self.chords.count\n end",
"title": ""
},
{
"docid": "7764ad5b5f0b8255f403c9e6230a36e2",
"score": "0.59972894",
"text": "def player_count\n players.length\n end",
"title": ""
},
{
"docid": "87d0a1a26e7d14be693c9c12e937d5b3",
"score": "0.59872806",
"text": "def total_count\n query_results.total_count\n end",
"title": ""
},
{
"docid": "df67e2e6fab845ed73fdc80f61760a22",
"score": "0.59789336",
"text": "def get_total_count\n daily_hashtag_counts.map(&:count).inject(0) { |sum, c| sum += c }\n end",
"title": ""
},
{
"docid": "48b991e3c3859d38944fe33bcf12d3f1",
"score": "0.59759474",
"text": "def seasons_played\n teams.count\n end",
"title": ""
},
{
"docid": "28224132831dea35716491640b6ab3ae",
"score": "0.5949026",
"text": "def count\n @cart.values.inject(:+)\n end",
"title": ""
},
{
"docid": "7d258017d4e60eeefaacfca56db70485",
"score": "0.5943684",
"text": "def calc_total_length\n sum = 0\n @talks.each { |talk| sum += talk.length.to_i }\n puts \"-- Total length: #{sum} min\"\n end",
"title": ""
},
{
"docid": "12b494882ef17553571e69ef14b8ac84",
"score": "0.5940974",
"text": "def numPlayedPieces()\n return @playedPieces.length()\n end",
"title": ""
},
{
"docid": "514b16ab878dc91bc3f138ba44d273d0",
"score": "0.5935418",
"text": "def answer_total\n count = 0\n self.list_answers.each {|a| count +=a.to_i }\n count\n end",
"title": ""
},
{
"docid": "45cc0a9e088407967e16ff735a550d39",
"score": "0.59318876",
"text": "def finished_player_rounds\n player_rounds.finished.count.to_f\n end",
"title": ""
},
{
"docid": "bf3b2c52e7ad7786fae04dd826b63c91",
"score": "0.59262687",
"text": "def total_stock\n stocks.reduce(0) { |sum, st| sum += st.quantity }\n end",
"title": ""
},
{
"docid": "bf3b2c52e7ad7786fae04dd826b63c91",
"score": "0.59262687",
"text": "def total_stock\n stocks.reduce(0) { |sum, st| sum += st.quantity }\n end",
"title": ""
},
{
"docid": "00da2db0d69887d93e621a960c4e9e2f",
"score": "0.59151804",
"text": "def total_item_count\n items.count\n end",
"title": ""
},
{
"docid": "be4f1a4f24e30c36dc4cab7b55dec5a6",
"score": "0.5910637",
"text": "def total_questions\n\t\t@question_groups = Rapidfire::QuestionGroup.all\n\t\tn = 0\n\t\t\t@question_groups.each do |group| \n\t\t\t\tn += group.questions.size\n\t\t\tend\n\t\t\n\t\treturn n.to_f\n\tend",
"title": ""
},
{
"docid": "aaa00da0d8e4b17bfd7a1ba682dc4ec6",
"score": "0.5903984",
"text": "def count\n @count.sum\n end",
"title": ""
},
{
"docid": "d63824e4419a26600780f7d9a6a722c7",
"score": "0.59013516",
"text": "def games_played\n Play.where({:player_id => self._id}).distinct(:game_id).length\n end",
"title": ""
},
{
"docid": "2a425239e96071c35e78f26f67e78936",
"score": "0.58998156",
"text": "def what_songs_does_he_own(songs)\n\t\ti = 0\n\t\tsongs.each do |song| \n\t\t\tsong.owners.each do |owner|\n\t\t\t\towner.include?(@name) ? i+= 1 : i\n\t\t\tend\n\t\tend\n\t\ti\n\tend",
"title": ""
},
{
"docid": "cf93c0f43345296f6d0d36fa38ab92ee",
"score": "0.5889779",
"text": "def songs_time_components\n total_songs_time = 0\n self.lib.songs.each_value do |song|\n total_songs_time += (song.metadata['total_time'].to_f / 1000.0)\n end\n seconds_to_time_components(total_songs_time) \n end",
"title": ""
},
{
"docid": "a3e7c4526d93a87022d992e0377e948d",
"score": "0.5878594",
"text": "def total_count\n @posts.count + @quotes.count\n end",
"title": ""
},
{
"docid": "2674cbc02cbf6e4f92ecfb3dcd0b7479",
"score": "0.58785254",
"text": "def total_score\n player_score = 0\n\n # player_score = @player_words.map do |word|\n # Scrabble::Scoring.score(word)\n # end\n #\n # return player_score.inject(:+)\n\n @player_words.each do |word|\n player_score += Scrabble::Scoring.score(word)\n end\n\n return player_score\n end",
"title": ""
},
{
"docid": "63a21dc076bc736e77b83911948ee013",
"score": "0.5878055",
"text": "def total_results\n @results['totalItems'].to_i\n end",
"title": ""
},
{
"docid": "d0848aaa94b0265f29d1c74d5d7d8396",
"score": "0.58743674",
"text": "def count_media_sold\n user_stats['nb_media_sold']\n end",
"title": ""
},
{
"docid": "02a3dc96ea45246b5dbaf7c670472eb9",
"score": "0.587073",
"text": "def total_num_assignment_teams\n assignment_team_counts.inject(:+)\n end",
"title": ""
},
{
"docid": "c95aa9da2b7b0042cba043c93a139f9b",
"score": "0.5866481",
"text": "def alsquiz_count\n self.titles.available.inject(0) {|sum, title| sum + title.alsquiz_count}\n end",
"title": ""
},
{
"docid": "d5eb51ee3f5353ce0609562044ec92ce",
"score": "0.586325",
"text": "def total_putts\n total_putts = 0\n scorecards.each { |score| total_putts += score.putts unless score.putts.nil? }\n return total_putts\n end",
"title": ""
}
] |
744872987d0f2d3190bf866b69017a89
|
we used strong parameters for the validation of params
|
[
{
"docid": "5fae70f5388e3b7720703c5d03c7df84",
"score": "0.0",
"text": "def shift \n params.require(:shift).permit(:user_id, :start, :finish, :break_length) \n end",
"title": ""
}
] |
[
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.8067315",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.7677371",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "d8b02fce801fc219417d86d0ca117836",
"score": "0.76315457",
"text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end",
"title": ""
},
{
"docid": "d8b02fce801fc219417d86d0ca117836",
"score": "0.76315457",
"text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.727652",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "bab8020c6cd5173e740d759d7cc320d5",
"score": "0.7255685",
"text": "def validate_params\n validate_attributes(self.class.params, coerce: true)\n end",
"title": ""
},
{
"docid": "8e54eaded22dd280d836e96375fed9a4",
"score": "0.7237286",
"text": "def paramun_params\n params.require(:parametre).permit!\n end",
"title": ""
},
{
"docid": "8e519fbf8b7f524a91ac5c7f842a6121",
"score": "0.719034",
"text": "def validate_params_present!; end",
"title": ""
},
{
"docid": "b29cf4bc4a27d4b199de5b6034f9f8a0",
"score": "0.71757597",
"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": "ef4d79af1f22951bead40f5fb905475f",
"score": "0.7151133",
"text": "def valid_params(params)\n params.permit(:date_time, :user_id, :photo_id, :comment)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.713669",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.71043545",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "660d8dc9dfccc79613624beb6c3c516c",
"score": "0.70881444",
"text": "def validate_params?\n true # TODO: add validation\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.70708716",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.70708716",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.70203227",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.70203227",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.69979906",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.69894",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.6950552",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "69e58fdee13b0a02a6f7cde0d9a0d257",
"score": "0.69448274",
"text": "def user_params_validator\n \t\tparams.require(:user).permit(:name, :email,:password,:password_confirmation)\n \tend",
"title": ""
},
{
"docid": "79d527b588d73e92d805d17cbaf432ad",
"score": "0.6934611",
"text": "def validation_params\n params.require(:object).permit!\n end",
"title": ""
},
{
"docid": "55aa899fab0dfa44916f71c499998ca8",
"score": "0.69069827",
"text": "def parameter_params\n params.require(:parameter).permit(:key, :value)\n end",
"title": ""
},
{
"docid": "53da61ef6148eafa7018dc6293dea902",
"score": "0.6900204",
"text": "def validate params\n fail ParamsValidationError.new(params.count,0) unless params.empty?\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.6878404",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "2e70947f467cb6b1fda5cddcd6dc6304",
"score": "0.68768764",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "796f95fb380a49d3433700895c679bc5",
"score": "0.6867545",
"text": "def validate_params(resource_params)\n resource_params\n end",
"title": ""
},
{
"docid": "032773b3a12aee5407b5bbe968819b3e",
"score": "0.68574613",
"text": "def user_parameters\n params.require(:user).permit(:name,:email)\nend",
"title": ""
},
{
"docid": "764ce7438009c1a3dc117eb0092673b7",
"score": "0.68459636",
"text": "def safe_params\n converted_params.permit(:sales => [:date, :code, :value, :hashed_password])\n end",
"title": ""
},
{
"docid": "ea00b668336826b5d4c3eb0c5a33cb4a",
"score": "0.6835382",
"text": "def transferencia_params \n #params.require(:transferencia).permit(:fecha, :area_id, :deposito_id)\n params.require(:transferencia).permit! \n end",
"title": ""
},
{
"docid": "60a2f5c104787cc14308a6251fe5abc6",
"score": "0.68344945",
"text": "def integrante_de_elenco_en_gira_params \n #params.require(:transferencia).permit(:fecha, :area_id, :deposito_id)\n params.require(:integrante_de_elenco_en_gira).permit! \n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.6832848",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6818515",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6818515",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "5160fee889c598af2517090389a7402c",
"score": "0.681727",
"text": "def parse_params(permitted_params)\n require_params = {}\n permitted_params.each_with_index do |(key, value), index|\n require_params[key] = if !index.zero?\n relationship_params(key, value)\n else\n params.require(:attributes).permit(*value)\n end\n end\n require_params\n end",
"title": ""
},
{
"docid": "ab76ba841b5611b7c2fe3803fce59ce6",
"score": "0.68011385",
"text": "def person_params\n\t params.require(:person).permit(:name, :age)\n\t end",
"title": ""
},
{
"docid": "d7b4753824806eca76b548a30e3351b6",
"score": "0.68000007",
"text": "def model_params\n params.require(variable_symbol).permit(*permitted_parameters)\n end",
"title": ""
},
{
"docid": "2c2328fed3e9765c5e4350149651ae67",
"score": "0.6793445",
"text": "def contr_params\n params.require(:contr).permit(:a1, :a2)\n end",
"title": ""
},
{
"docid": "28bd714f0d790bda0a4b0777c5bfce0c",
"score": "0.67880416",
"text": "def user_params\n params.require(:user).permit(STRONG_PARAMETERS)\n end",
"title": ""
},
{
"docid": "b453d9a67af21a3c28a62e1848094a41",
"score": "0.6778694",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "819ce8887b507ca56b787826ab6b2f94",
"score": "0.6771673",
"text": "def good_params\n params.require(:good).permit(:receiver_name, :receiver_address, :receiver_phone, :sender_name, :sender_address, :sender_phone, :mass, :pay_id, :pay_type, :who_pay,:status)\n end",
"title": ""
},
{
"docid": "1c1ee6cc45fd852cab3c1e192bec902b",
"score": "0.6767015",
"text": "def parametro_params\r\n params.require(:parametro).tap do |whitelisted|\r\n whitelisted[:clave] = params[:parametro][:clave]\r\n whitelisted[:valor] = params[:parametro][:valor]\r\n whitelisted[:bloqueado] = params[:parametro][:bloqueado]\r\n\r\n for i in 0..params[:parametro].count do\r\n whitelisted[\"valor#{i}\".to_sym] = params[:parametro][\"valor#{i}\".to_sym]\r\n end\r\n end\r\n # params.require(:parametro).permit(:clave, :valor)\r\n end",
"title": ""
},
{
"docid": "efbca73fd7b0b61163ad1709af1bb3cb",
"score": "0.6761816",
"text": "def valid_request_params\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "0ca6957c483d76ea4bf451da4abb625c",
"score": "0.67587477",
"text": "def safe_params\n obj_name = self.class.model_class.name.underscore.to_sym\n params = wrap_parent_param(self.params, obj_name)\n params[obj_name] = shim_construct_type(params[obj_name])\n params.require( obj_name )\n .permit( [:label, :parent_id, :parent_type, :position, :branch, :instrument_id] + self.class.params_list )\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.675061",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "d8fd2af2d422d5959a21b499f834ad52",
"score": "0.67457044",
"text": "def validate_params\n if process_object && process_object[\"required_params\"]\n process_object[\"required_params\"].each do |param|\n if !params_hash.has_key?(param)\n errors.add(:params, \"Missing mandatory param #{param}\")\n end\n end\n end\n end",
"title": ""
},
{
"docid": "d15047d67f35ca3723d9da403956c596",
"score": "0.6744018",
"text": "def parametrizacao_params\n params.require(:parametrizacao).permit(:objeto_id, :parametro_id)\n end",
"title": ""
},
{
"docid": "371f1b76a5914e73e913359620e13aed",
"score": "0.6738996",
"text": "def Person_params\n params.require(:Person).permit(:name, :age, :birthdate)\nend",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.6738305",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "fed6e5f6581fc3a6bc945330c40b3526",
"score": "0.67265975",
"text": "def strong_params(*args)\n #byebug\n params.require(controller_name.singularize.to_sym).permit(*args)\n end",
"title": ""
},
{
"docid": "72a2722e4f1c007566e58059864c41f3",
"score": "0.6722428",
"text": "def permit_params\n params.require(:permit).permit(:permit_number, :permit_expiration_date, :training_completion_date, :status, :valid, :beacon_id)\n end",
"title": ""
},
{
"docid": "72a2722e4f1c007566e58059864c41f3",
"score": "0.6722428",
"text": "def permit_params\n params.require(:permit).permit(:permit_number, :permit_expiration_date, :training_completion_date, :status, :valid, :beacon_id)\n end",
"title": ""
},
{
"docid": "64ea65f903dbe0c9c0cc0e9a20ed2e7f",
"score": "0.67144066",
"text": "def good_option_params\n permit_params\n end",
"title": ""
},
{
"docid": "492e87c9f8034b72ea444050bf451ba9",
"score": "0.6707333",
"text": "def validation_params\n params.require(:validation).permit( :valid, :user_id, :post_id)\n end",
"title": ""
},
{
"docid": "749e69306781962735e486f374ec6c4a",
"score": "0.6705967",
"text": "def credit_checker_params\n # params.fetch(:credit_checker, {})\n params.require(:credit_checker).permit(:id,:user_id,:project_id,:balance, :amount,:account_status) \n end",
"title": ""
},
{
"docid": "dc8a5802ce318b24d6795810be6cfcf3",
"score": "0.67022884",
"text": "def safe_params\n params.require(:med).permit(:med_name, :dosage, :time_of_day, :prescriber, :email, :phone, :user_id)\n end",
"title": ""
},
{
"docid": "ab49b0baeea5bf6f204adca9e864094e",
"score": "0.66963035",
"text": "def secure_params(require_param, permit_keys)\n params.require(require_param).permit(*permit_keys)\n end",
"title": ""
},
{
"docid": "514fd6954fb8da03393e0ba5e34b7c1a",
"score": "0.66887885",
"text": "def require_valid_params\n params\n .require(:share)\n .require([:birth_record_id, :recipient_id])\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.66847545",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "4632c7949842c8534d66b50254032add",
"score": "0.66845584",
"text": "def parameterization_params\n params.permit(:name, :user_id, :number_value, :money_value)\n end",
"title": ""
},
{
"docid": "8b893daa22418bdb2cb4564a329ce5c1",
"score": "0.66667545",
"text": "def user_params\n raw_parameters = { :mobile_no => \"#{params[:mobile_no]}\", :office_phone => \"#{params[:office_phone]}\", :home_phone => \"#{params[:home_phone]}\", :profile_photo => \"#{params[:profile_photo]}\",:active => \"#{params[:active]}\", :branch_id => \"#{params[:branch_id]}\", :company_id => \"#{params[:company_id]}\", :role_master_id => \"#{params[:role_master_id]}\", :name => \"#{params[:name]}\", :email => \"#{params[:email]}\", :password => \"#{params[:password]}\",:team_id => \"#{params[:team_id]}\", :prior_experience => \"#{params[:prior_experience]}\", :doj => \"#{params[:doj]}\", :dob => \"#{params[:dob]}\", :avatar => \"#{params[:avatar]}\", :last_name => \"#{params[:last_name]}\", :created_by_user => \"#{params[:created_by_user]}\", :reporting_to => \"#{params[:reporting_to]}\", :employee_no => \"#{params[:employee_no]}\", :reporting_id => \"#{params[:reporting_id]}\", :reporting_to_id => \"#{params[:reporting_to_id]}\" }\n\n parameters = ActionController::Parameters.new(raw_parameters)\n parameters.permit(:mobile_no,\n :office_phone,\n :home_phone,\n :profile_photo,\n :active,\n :branch_id,\n :company_id,\n :role_master_id,\n :name, \n :password,\n :email,\n :team_id,\n :prior_experience,\n :doj,\n :dob,\n :avatar,\n :last_name,\n :created_by_user,\n :reporting_to,\n :employee_no,\n :reporting_id,\n :reporting_to_id)\n end",
"title": ""
},
{
"docid": "2f86022f4e475cc9e07b2ed0b23936e5",
"score": "0.6666662",
"text": "def safe_params\n safe_attributes = %i[name assignable_id]\n params.require(:lead).permit(safe_attributes)\n end",
"title": ""
},
{
"docid": "8e935216f7c763601cd5538c3ce1a6c6",
"score": "0.6658809",
"text": "def usuario_params\n #params.require(:usuario)\n #params.require(:nombre)\n params.permit(:usuario, :nombre, :apellido, :twitter)\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.6648598",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "fb772fef1fc34fb6eb81ee32d9635b1b",
"score": "0.66438115",
"text": "def user_params\n ActionController::Parameters.new(params).permit :user_id, :email, :password, :firstname, :lastname, :school, :lend_num, :borrow_num, :comment, :invitation_code\n end",
"title": ""
},
{
"docid": "ff6f55caa994e4876f1d0797af27a8a4",
"score": "0.6642927",
"text": "def user_params\n \n #Note:This code returns a version of the params \n #hash with only the permitted attributes (while raising \n #an error if the :user attribute is missing).\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n end",
"title": ""
},
{
"docid": "34773e6ef2065d9864a9959c2ed54ff6",
"score": "0.6641376",
"text": "def valid_params_request?\n true\n end",
"title": ""
},
{
"docid": "ce187fa6dece125b48b43dd64397cdb6",
"score": "0.6640154",
"text": "def field_params\n params.permit(:id, :name, :data_type, :default_value, :auto_increment, :allow_null, :table_id, \n :validate_on,\n :acceptance,\n :format,\n :format_type,\n :presence,\n :uniqueness,\n :case_sensitive,\n :confirmation,\n :length,\n :length_min,\n :length_max,\n :length_is,\n )\n end",
"title": ""
},
{
"docid": "c8c77859df9e3d2e0f69df8eb3a82191",
"score": "0.6639831",
"text": "def user_params\n params.require(:user).permit(:id)\n end",
"title": ""
},
{
"docid": "f308ecaa3f664c979638702aed843717",
"score": "0.66375643",
"text": "def parametro_params\n params.require(:parametro).permit(:tipo, :nombre, :pertenece, :activo)\n end",
"title": ""
},
{
"docid": "ea8045ec73590f251186ec40e9898c64",
"score": "0.6629846",
"text": "def user_params # private method returns sanitized, strong params\n params.require(:user).permit(\n :name,\n :password,\n :height,\n :happiness,\n :nausea,\n :tickets,\n :admin\n )\n end",
"title": ""
},
{
"docid": "cfd33eebddc64500b944557414449fe9",
"score": "0.6629447",
"text": "def user_params\n #params.fetch(:user, {})\n params.require(:user).permit!\n end",
"title": ""
},
{
"docid": "754f1af35c07d8e4a1f0c7f734b668b0",
"score": "0.6625126",
"text": "def good_params\n params.fetch(:good, {})\n end",
"title": ""
},
{
"docid": "bc17ec1a98bff401ea44cd9d47829ab1",
"score": "0.6622015",
"text": "def safe_params\n params.require(:lead).permit(:name, :assignable_id)\n end",
"title": ""
},
{
"docid": "06b954bfafd8ff54a81c3c0f94b83858",
"score": "0.6620794",
"text": "def stud_params\r\n\t\t# the parameters require obj student to exist and allowing all which are written to be save to the obj later on\r\n\t\tparams.require(:student).permit(:name, :email, :password, :password_confirmation)\r\n\tend",
"title": ""
},
{
"docid": "b8a33b47ddcf139e2e21052ccaece611",
"score": "0.6619416",
"text": "def enforce_post_params(params)\n params = params.permit(:id, :title,:content,links: [:users,:comments,:images])\n if params[:links].present?\n if params[:links][:users].present?\n params[:user_id] = params[:links][:users]\n end\n if params[:links][:comments].present?\n params[:comment_ids] = params[:links][:comments]\n end\n if params[:links][:images].present?\n params[:image_ids] = params[:links][:images]\n end\n end\n params.delete(:links)\n return params\n end",
"title": ""
},
{
"docid": "f5e3a87909b3e5022047b4b0a64ca154",
"score": "0.6618389",
"text": "def parameter_params\n params.require(:parameter).permit(:name, :code, :description, :user_id, :value, :cargapp_model_id, :active)\n end",
"title": ""
},
{
"docid": "9693636a65e9029c3495069a64953aa5",
"score": "0.661658",
"text": "def entrada_params\n \n\t params.require(:entrada).permit(:proyecto_id, :fecha_creacion,:persona_id,:tipo_entrada_id,:comentario,:tiempo)\n end",
"title": ""
},
{
"docid": "28c0e6b163a1e191acfa12cbe85ab29a",
"score": "0.6610022",
"text": "def person_params # Filtra somente os atributos que eu quero, medida de segurança, exemplo do 'mester'\n params.require(:person).permit(:name, :email, :password, :born_at, :admin) # sql injection\n end",
"title": ""
},
{
"docid": "af08b17e8f0b14e71344c8c066ccfa5c",
"score": "0.6608992",
"text": "def validate\n fail ParamsValidationError.new(params.count,0) unless params.empty?\n end",
"title": ""
},
{
"docid": "82bc64938486f39bb220d16cd1d03355",
"score": "0.6605592",
"text": "def valid_params\n params.select{ |x| x.valid? }\n end",
"title": ""
},
{
"docid": "42f480ba96ee6fe85054473e14d9508b",
"score": "0.66031706",
"text": "def person_params\n params[:person].permit!\n end",
"title": ""
},
{
"docid": "94f001f97898ad70ef655c43023f2b3f",
"score": "0.6595903",
"text": "def person_params\n params.require(:zhengzhao).permit(:namecompany, :jianjiecompany, :another, :zizhicertification, :anquancertification, :chenbaocertification, :zhanchen, :santixicertification, :shuiwucertification, :dengjicertification, :cwbaobiao, :orgcertification, :wsszhenming,:wpczhenming, :licence)\n end",
"title": ""
},
{
"docid": "229c3dd3e8e45ba8e1627ffa39a3c863",
"score": "0.6594005",
"text": "def encuestausuario_params\n params.require(:encuestausuario).permit(lista_params)\n end",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.6593141",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "8c24addb7d1357e7f8344dac68428204",
"score": "0.6589028",
"text": "def user_params\n #params.require(:user).permit(:email, :password)\n params.require(:user).permit(:name, :password)\n end",
"title": ""
},
{
"docid": "5089ac2d0383f2b76a13c0d3c8fe7c3a",
"score": "0.6582584",
"text": "def admuser_params\n #params.require(:aluno).permit!\n #params.require(:user).permit(:name, :email)\n #params[:user].permit(:first_name, :last_name, :address)\n params.require(:user).permit!\n end",
"title": ""
},
{
"docid": "19ae929435b5eeccd5854386e02098e0",
"score": "0.6582569",
"text": "def user_params\n \tparams.require(:user).permit(:name,:dob,:avatar,:role,:password,:password_confirmation,:university_id,:email,hobbies_attributes:[:hobby,:_destroy,:id],qualifications_attributes:[:stream,:subject,:completed,:_destroy,:id])\n end",
"title": ""
},
{
"docid": "a83bc4d11697ba3c866a5eaae3be7e05",
"score": "0.65816206",
"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": "940bdb2ac9eff6cf9db4fd59e66f34d7",
"score": "0.6576843",
"text": "def usuario_params\n params.require(:usuario).permit!\n end",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.6571474",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "f896d3857fd09ef58b90bece1d3c8dd8",
"score": "0.6565233",
"text": "def article_params #dito idedeclare yung params na valid lang sa article\n params.require(:article).permit(:name, :body)\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.65630925",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2707862d7adddbb19d513e93a6daf28d",
"score": "0.65630126",
"text": "def user_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.6561688",
"text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend",
"title": ""
},
{
"docid": "63805708ab5ddf8a22e1835a9b0f71d3",
"score": "0.656155",
"text": "def good_params\n params[:good]\n end",
"title": ""
},
{
"docid": "5abe0e852bc6bb644a47f39cb706470d",
"score": "0.65594125",
"text": "def good_params\n params.fetch(:good, {}).permit(:quantity, :color, :color_code)\n end",
"title": ""
},
{
"docid": "08e801fa87fcffdbf9c652d8e5fe6b9b",
"score": "0.6559374",
"text": "def user_params\n params.require(:user).permit(:email , :password, :password_confirmation, :name) #from the params hash, require the user key which has a value of a hash and only permit the keys email, password, and password_confirmation\n end",
"title": ""
},
{
"docid": "7014b2897f3379602e7018074d2a8241",
"score": "0.6558968",
"text": "def set_params\n \tparams.require(:user).permit(:name, :surname, :email, :phone, :active, :document, :token_pass, :rol_id, :device_id, :semester_id)\n end",
"title": ""
},
{
"docid": "d864cc65d27ca333948f8bcca6e653d9",
"score": "0.65576386",
"text": "def person_params\n params.require(:person).permit(:name, :age)\n end",
"title": ""
},
{
"docid": "8bbb609f383b5c67c72a664691cafcff",
"score": "0.65576005",
"text": "def model_params\n\t\tparams.require(:volunteer).permit(\n\t\t\t:msu_id,\n :first_name,\n :last_name,\n :email,\n :phone,\n \t\t:ref_instructor,\n :task_id\n\t\t\t)\n\tend",
"title": ""
}
] |
52bff149c43daee1be07ea4edbfca514
|
Get posts by tags === Returns Array:: Hashes of found posts
|
[
{
"docid": "718604023a28b8cc477aabe833a31dbe",
"score": "0.69080496",
"text": "def posts_by_tags(tags, page = 1, limit = options[:limits][:per_page])\n tags = clean_tags(tags)\n posts_url = self.class::OLD_API ? 'post.json' : 'posts.json'\n do_request(posts_url, tags: tags, page: page, limit: limit)\n end",
"title": ""
}
] |
[
{
"docid": "5caf6ca47905bf18f1bbb5a15fca4db2",
"score": "0.7551293",
"text": "def posts\n Post.filter(:tag_id => self.tag_id)\n end",
"title": ""
},
{
"docid": "f991e4fcd0971c59a5622dce4f60e1aa",
"score": "0.73028696",
"text": "def tags(params)\n if validate_tags(params)\n db = connect_to_db()\n db.results_as_hash = true\n result = db.execute('SELECT posts.* FROM tags INNER JOIN posts_tags ON posts_tags.tagId = tags.id INNER JOIN posts ON posts.id = posts_tags.postId WHERE tags.id=?', params[\"id\"])\n return {posts: result}\n else\n return {error: \"There is no such tag!\"}\n end\n end",
"title": ""
},
{
"docid": "7e9f97f04dded294a2c70fdd6d83f107",
"score": "0.710472",
"text": "def search_by_tags\n tag_ids = params[:term].present? ? Tag.search(params[:term]).select(:id) : []\n posts = PostsQuery.new.by_tags(tag_ids)\n related_posts = PostsQuery.new(posts).related_posts\n posts = posts.merge(related_posts.distinct)\n posts = posts.where.not(id: User.unscoped.find(@user_id).blocking_posts) if @user_id.present?\n posts = posts.paginate(pagination_params)\n render json: posts, user_id: @user_id, meta: pagination_dict(posts)\n end",
"title": ""
},
{
"docid": "a7b09e8511b9f058c2997a4e10437080",
"score": "0.69346017",
"text": "def find_tags\n @tags = BlogPost.tag_counts_on(:tags)\n end",
"title": ""
},
{
"docid": "84b90534c88a0976ea2c276f0b9fa979",
"score": "0.6755455",
"text": "def all_by_tag(*tags)\n find(:all).by_tag(*tags)\n end",
"title": ""
},
{
"docid": "84b90534c88a0976ea2c276f0b9fa979",
"score": "0.6755455",
"text": "def all_by_tag(*tags)\n find(:all).by_tag(*tags)\n end",
"title": ""
},
{
"docid": "1a5247c8b2ae84deb31712b4e2119622",
"score": "0.6733407",
"text": "def get_tag_tree_posts(tag_tree, tags)\n tag_walk = generate_tag_walk(tags)\n if tag_walk.nil?\n return nil\n end\n\n posts = Array.new\n\n # Typical breadth-first search using the\n # existence of a branch in the tag_walk to\n # determine whether a node is traversed.\n\n queue = [tag_tree]\n\n # Consulted with @thatwasawesome for this efficient algorithm.\n while queue.length > 0\n node = queue.shift\n\n # We return every touched node's post, if\n # it has one.\n if node.has_key?(TAG_TREE_POST_KEY)\n posts.push(node[TAG_TREE_POST_KEY])\n end\n\n tag_walk.each do |tag|\n if node.has_key?(tag)\n queue.push(node[tag])\n end\n end\n\n end\n\n return posts\n end",
"title": ""
},
{
"docid": "d4da0ed77de3fc8ad35ffdae0b1eae1e",
"score": "0.67021334",
"text": "def index\n @tags_posts = TagsPost.all\n end",
"title": ""
},
{
"docid": "5e0c835dcd0067ef8104a343eb2907b2",
"score": "0.66857356",
"text": "def index\n if params[:tag]\n @posts = Post.tagged_with(params[:tag])\n elsif params[:search]\n @posts = Post.search(params[:search])\n else\n @posts = Post.all.newest\n end\n end",
"title": ""
},
{
"docid": "d7e15a7cd5d7bf9b8b07126f3d5d142a",
"score": "0.6609275",
"text": "def find_with_tags(*tags)\n options = tags.extract_options!\n self.all(options.merge(:tags => tags))\n end",
"title": ""
},
{
"docid": "aff3c4814563603dd487b3ae56114a1f",
"score": "0.6589476",
"text": "def get_posts_for_year_and_tags\n posts = get_posts_for_year\n posts = get_posts_for_tags posts\n posts\n end",
"title": ""
},
{
"docid": "13ce4580285f7f26b0a44c24489a5746",
"score": "0.6582487",
"text": "def index\n if params[:tag]\n @posts = Post.tagged_with(params[:tag]).includes(:tags)\n elsif params[:category]\n @posts = Post.includes(:tags).where(category: params[:category])\n else\n #@posts = Post.all\n @posts = Post.includes(:tags)\n end\n respond_with @posts, methods: [:tag_list, :tag_ary]\n end",
"title": ""
},
{
"docid": "871900d3df27bf990bb04563fe4f1f68",
"score": "0.65784",
"text": "def index \n if params[:tag]\n @posts = Post.tagged_with(params[:tag])\n else\n @posts = Post.all.paginate(page: params[:page], per_page: 20)\n end\n end",
"title": ""
},
{
"docid": "6a17913db8d2cb4f12829f27da352025",
"score": "0.6514608",
"text": "def related_posts\n if @_related_posts.nil?\n @_related_posts = []\n \n if @headers[:related] && @headers[:related] == 'none'\n return @_related_posts\n \n elsif @headers[:related] && @headers[:related].is_a?(Array)\n @_related_posts = @headers[:related].map{ |slug| Post.find(slug) }\n \n else\n @_related_posts = Post.find_tagged_with(tags.first).delete_if{ |post| post.slug == self.slug }[0...5]\n \n end\n end\n\n @_related_posts\n end",
"title": ""
},
{
"docid": "0a5ce8be5143381fdc4c709265f1cbfe",
"score": "0.647701",
"text": "def show\n\t @tags = @posts.tags\n end",
"title": ""
},
{
"docid": "c5bd119ad15466397c055d0ec4e57bf0",
"score": "0.64609814",
"text": "def find_from(tags)\n result = []\n\n # Create a tag list from the parameter. If the parameter already contains\n # tag objects, sort them out.\n case tags\n when Array\n result, not_tags = tags.partition { |t| t.is_a?(Tag) and not t.new_record? }\n not_tags.map!(&:to_s)\n tags = TagList.from(not_tags)\n when Tag\n return [ tags ]\n else\n tags = TagList.from(tags)\n end\n\n return result if tags.empty?\n\n tags_result = find(:all, :conditions => tags_condition(tags))\n return result + tags_result\n end",
"title": ""
},
{
"docid": "f87ca5e4a4687aa37218b401aa48e75e",
"score": "0.64487505",
"text": "def index\n if params[:tag]\n @posts = Post.most_recent.published.paginate(:page => params[:page], per_page: 6).tagged_with(params[:tag])\n else\n @posts = Post.most_recent.published.paginate(:page => params[:page], per_page: 6)\n end\n end",
"title": ""
},
{
"docid": "7953f4014f899626e9c61b1758ea1bbe",
"score": "0.64309776",
"text": "def index\n @post_tags = PostTag.all\n end",
"title": ""
},
{
"docid": "fb4fa7e05c0ef17574213bd92b7dc848",
"score": "0.64009833",
"text": "def posts\n\t\tif params[:query] && params[:query].empty?\n\t\t\t@search_results = Post.where(guest: false).includes(:taggings).page(params[:page])\n\t\telse\n\t\t\t@search_results = Post.where(guest: false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.includes(:taggings)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.search_by_tags(params[:query]).page(params[:page])\n\t\tend\n\t\t\n\t\trender 'single_search'\n\tend",
"title": ""
},
{
"docid": "f3a80b95e5bae7fcd6375f39b0ecbbf1",
"score": "0.63865745",
"text": "def index\n if params[:tag]\n @posts = Post.tagged_with(params[:tag])\n else\n @posts = Post.order(\"created_at desc\")\n end\n @posts = @posts.page params[:page]\n\nend",
"title": ""
},
{
"docid": "63bee1b308fc76ab46e8cc1c55915322",
"score": "0.63837844",
"text": "def find_by_tags(tags)\n load_pets.select do |pet|\n tags.all? do |tag|\n pet.tagged_with?(tag)\n end\n end\n end",
"title": ""
},
{
"docid": "b8f6cbc54d669a64524cd2d75a6b7b91",
"score": "0.63705826",
"text": "def index\n @questions = Question.preload(:user, :post).order('created_at DESC').page(params[:page]).per(10)\n\n @questions = @questions.tagged_with(params[:tag]) if params[:tag]\n end",
"title": ""
},
{
"docid": "c5dc597ed5e27f96e93b3134a842f706",
"score": "0.63042825",
"text": "def posts_all(options = {})\n params = prepare_posts_params(options.clone, [:tag])\n response = request(API_PATH_POSTS_ALL, params)\n parse_post_collection(response.body)\n end",
"title": ""
},
{
"docid": "a4c902158460bd0aafe1809d49f62c36",
"score": "0.628597",
"text": "def index\n options = {:page => params[:page] || 1, :per_page => 2}\n @posts = (params[:tag].blank? ? Post.published.search(params[:search], options) : Post.published.paginate_tagged_with(params[:tag], options))\n respond_to do |format|\n format.html{}\n format.xml{ render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "88258bd1078115d31844f3891602c7f3",
"score": "0.62851995",
"text": "def get_all_posts\n @posts = []\n results = Post.all\n results.each do |post|\n @posts << post.to_hash\n end\n end",
"title": ""
},
{
"docid": "4701ebee839c6c24f520531d96222c99",
"score": "0.62836164",
"text": "def post_tags\n posts.map do |e|\n yaml = YAML::load_file(e)\n [e, yaml['tags']]\n end\n end",
"title": ""
},
{
"docid": "5a6bbcc58ebc3b06f41da3ba055d0ac7",
"score": "0.62735707",
"text": "def get_tags\n\ttags = Set.new\n\t@site.articles.each do |post|\n\t\tif(post[:tags].nil?) \n\t\t\tpost[:tags] = Array.new\n\t\t\tpost[:tags] << \"(none)\"\n\t\t\ttags << \"(none)\"\n\t\telse\n\t\t\tpost[:tags].each do |tag|\n\t\t\t\ttags << tag\n\t\t\tend\n\t\tend\n\tend\n\ttags.to_a\nend",
"title": ""
},
{
"docid": "14a9630f58e227421b9f3a4926ac1c75",
"score": "0.6268886",
"text": "def show \n @tag = Tag.find params[:id]\n @posts = Post.search_by_tag_id(params[:id], params[:page])\n end",
"title": ""
},
{
"docid": "bd617b99d1ae7b70862845ec9a7e4825",
"score": "0.6267912",
"text": "def posts(options={})\n tags = self.self_and_descendants\n post_ids = Tagging.filter([[:tag_id, tags.collect(&:id)]]).select(:post_id).collect(&:post_id).uniq\n query = Post.filter([[:id, post_ids]]).filter(:is_draft => false).reverse_order(:created_at)\n if options[:non_sticky] && sticky = self.sticky_post\n query = query.filter(\"posts.id <> ?\", sticky.id)\n end \n if options[:page] \n query = query.paginate(options[:page], options[:per_page] || 10)\n end\n query\n end",
"title": ""
},
{
"docid": "5171e48ac21de047dfea0cea02f3c25c",
"score": "0.62327427",
"text": "def get_all_posts\n @posts = []\n\n Post.all.each do|post|\n @posts << post.to_hash\n end\n end",
"title": ""
},
{
"docid": "5a52e82564e2db07ded025950caca594",
"score": "0.6218876",
"text": "def posts_list\n posts = Post.all.published.order(score: :desc, created_at: :desc)\n post_tags = Post.published.order(score: :desc, created_at: :desc).map { |post| Post.includes(:tags, :taggings).find_by(id: post.id).tags }\n categories = Category.all\n tags = Tag.all\n\n render_json(posts: posts, categories: categories, tags: tags, post_tags: post_tags)\n end",
"title": ""
},
{
"docid": "13cd06d633cfd39b72180cf00566bc23",
"score": "0.61600256",
"text": "def index\n pagination_params = {:page => params[:page], :per_page => 10, :order => \"created_at DESC\"}\n if params[:tag]\n @blog_posts = BlogPost.tagged_with(params[:tag]).paginate(pagination_params)\n else\n @blog_posts = BlogPost.paginate(pagination_params)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blog_posts }\n end\n end",
"title": ""
},
{
"docid": "15f3fa210c025bfc5d5f20956f025811",
"score": "0.61326015",
"text": "def index\n @posts = Post.includes(:tags).all.page(params[:page]).per(PER).order(id:\"DESC\")\n end",
"title": ""
},
{
"docid": "443d082165d72d25a2102ff0f30b7fb4",
"score": "0.6118799",
"text": "def get(options = EMPTY_HASH)\n parameters = Specification.new(\n tag: Types::Tags,\n dt: Types::Time,\n url: Types::URL,\n meta: Types::Boolean\n ).parameters(options)\n posts_from client.get(\"/posts/get\", parameters)\n end",
"title": ""
},
{
"docid": "629361b207031070dd5f76c7f641f063",
"score": "0.60968554",
"text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts, :include => :tags }\n end\n end",
"title": ""
},
{
"docid": "bc4fa835e52c4bff415bc5c5784aa049",
"score": "0.607938",
"text": "def fetch(hashtags = Mingle::Hashtag.all, since = nil)\n unless since\n if Post.any?\n since = Post.ordered.last.created_at\n else\n since = Mingle.config.since\n end\n end\n\n hashtags = Array(hashtags)\n\n posts = []\n hashtags.each do |hashtag|\n posts += posts_through_search hashtag, since\n end\n\n posts.collect do |data|\n create_post_from_data(data, hashtags)\n end\n end",
"title": ""
},
{
"docid": "c4d2cce813f0262c9d75ad0c63821960",
"score": "0.6070014",
"text": "def items(tag = nil)\n if tag.nil?\n @items\n else\n @items.select { |item| item['tags'].include? tag }\n end\n end",
"title": ""
},
{
"docid": "3bbcb93d43ef6b4b84b9f842c16fd9cc",
"score": "0.60667247",
"text": "def get_posts(name)\n posts = []\n blog(name).articles.each do |post|\n posts.push(post)\n end\n return posts\n end",
"title": ""
},
{
"docid": "4e376a4d1c5ff545589732dede068a09",
"score": "0.606595",
"text": "def index\n @posts = PostQueryBuilder.new.build_query(params)\n @tags = Tag.joins(:posts).where(posts: {id: @posts.ids}).limit(30).group([:id,:name]).order(:name)\n \n #respond_to :html, :js\n end",
"title": ""
},
{
"docid": "36bad259975f7c314f564d272bf70da1",
"score": "0.6065273",
"text": "def tags\n query = params[:q]\n if query[-1,1] == \" \"\n query = query.gsub(\" \", \"\")\n Tag.find_or_create_by_name(query)\n end\n\n #Do the search in memory for better performance\n\n @tags = ActsAsTaggableOn::Tag.all\n @tags = @tags.select { |v| v.name =~ /#{query}/i }\n respond_to do |format|\n format.json{ render :json => @tags.map(&:attributes) }\n end\n end",
"title": ""
},
{
"docid": "c3f5670ce065a67b48ceccdb330103df",
"score": "0.6056546",
"text": "def find_all_tagged_with(*args)\n find_tagged_with(*args)\n end",
"title": ""
},
{
"docid": "2d0136456d3cfcfc25404eac99b9cc8a",
"score": "0.60503614",
"text": "def posts\n return @posts\n end",
"title": ""
},
{
"docid": "2d0136456d3cfcfc25404eac99b9cc8a",
"score": "0.60503614",
"text": "def posts\n return @posts\n end",
"title": ""
},
{
"docid": "dc41754effabde1745ac2e3efbdf589b",
"score": "0.6042262",
"text": "def tags\n @tags = ActsAsTaggableOn::Tag.where(\"tags.name LIKE ?\", \"%#{params[:q]}%\") \n #@tags = Node.tag_counts(:limit => 50, :order => \"count desc\")\n #@tags = Node.tag_counts_on(:tag, :limit => 50, :order => \"count desc\")\n @out = @tags.map{|b| {:id => b.id, :name => b.name }}\n \n\n \n respond_to do |format|\n format.json { render :json => @out }\n end\n\n end",
"title": ""
},
{
"docid": "9d177f96bf2a2dd934c13b30278ded70",
"score": "0.6021639",
"text": "def tags\n get('tags')\n end",
"title": ""
},
{
"docid": "c72fe92d4e4f2876d2cb31091badc709",
"score": "0.6016494",
"text": "def posts\n @posts ||= retrieve_posts\n end",
"title": ""
},
{
"docid": "bb2680d4cffefb72db00af09bbe3ddd7",
"score": "0.6007974",
"text": "def tags\n\t\tresponse = self.server.run_with_json_template( :tags )\n\t\treturn response.flatten.map {|tag| Hglib::Repo::Tag.new(self, **tag) }\n\tend",
"title": ""
},
{
"docid": "1812bca7b05e1e4a51c305a129a5849d",
"score": "0.59960157",
"text": "def related_posts\n return [] unless docs.count > 1\n\n highest_freq = tag_freq.values.max\n related_scores = Hash.new(0)\n\n docs.each do |doc|\n doc.data[\"tags\"].each do |tag|\n if self.data[\"tags\"].include?(tag) && doc != self\n cat_freq = tag_freq[tag]\n related_scores[doc] += (1 + highest_freq - cat_freq)\n end\n end\n end\n\n sort_related_posts(related_scores)\n end",
"title": ""
},
{
"docid": "4349fbfae226481270339b807df24513",
"score": "0.5994415",
"text": "def posts_count_by_tag(tags)\n tags = clean_tags(tags)\n if self.class::OLD_API\n do_request('post/index.xml', { tags: tags, limit: 1 }, :get, nil, :xml).root['count'].to_i\n else\n do_request('counts/posts.json', tags: tags)['counts']['posts']\n end\n end",
"title": ""
},
{
"docid": "37e84eea325c64d39155ab5f11762961",
"score": "0.59907824",
"text": "def posts\n posts = @client.entries(content_type: 'post').items\n posts || []\n end",
"title": ""
},
{
"docid": "fe7b15ea95f393a048f0c24f7ec971df",
"score": "0.5987643",
"text": "def tags\n return false if params[:q] and params[:q].size < 3\n @tags = ActsAsTaggableOn::Tag.where(\"tags.name LIKE ?\", \"%#{params[:q]}%\") \n respond_to do |format|\n format.json { render :json => @tags.map{|t| {:id => t.name, :name => t.name }}}\n end\n end",
"title": ""
},
{
"docid": "60773203db8df995981b809046a023d6",
"score": "0.5978407",
"text": "def get_posts(initial_scope, tag, order, filter, running = true)\n if initial_scope.nil?\n posts = Post.all\n else\n posts = initial_scope\n end\n\n unless tag.blank?\n posts = posts.tagged_with(tag)\n end\n\n # apply scopes for ordering\n posts = posts.popular if order == \"popular\"\n posts = posts.newest if order == \"newest\"\n posts = posts.liked if order == \"liked\"\n\n # apply scopes for filtering\n posts = posts.last_week if filter == \"week\"\n posts = posts.last_month if filter == \"month\"\n\n # only return running videos\n if running\n #posts = posts.running\n end\n\n return posts\n end",
"title": ""
},
{
"docid": "fe50922360c77a441adc1f81bcad2501",
"score": "0.5934589",
"text": "def tagged_with(_tags)\n _tags = convert_string_tags_to_array(_tags) if _tags.is_a? String\n criteria.all_in(tags_field => _tags)\n end",
"title": ""
},
{
"docid": "40faf47524a905000b67ab9a2067bfc1",
"score": "0.59329623",
"text": "def all_related_tags\n (all_posts + all_archived_posts).reject do |post|\n (post.tags & current_post.tags).empty?\n end.map{ |post| post.tags }.flatten.uniq.sort\n end",
"title": ""
},
{
"docid": "6ca70bb1a1dddd4d344e91d00e46a93d",
"score": "0.5911865",
"text": "def related_tags_in(folder = :posts)\n (related_posts_in(folder) << current_post).map{ |post| post.tags }.flatten.uniq.sort\n end",
"title": ""
},
{
"docid": "2a361420f04fd3cc22b2d7b6fd0c715e",
"score": "0.5901141",
"text": "def index\n @page_title = \"Posts\"\n # if params[:tag]\n # @posts = Post.order(created_at: :desc).tagged_with(params[:tag]).paginate(:page => params[:page], :per_page => 3)\n # @firstLetter = ActsAsTaggableOn::Tag.all.order(\"name\").group_by{|letter| letter.name[0]}\n # @tags = ActsAsTaggableOn::Tagging.limit(8).includes(:tag).where(context: 'tags').map { |tagging| tagging.tag.name }.uniq\n # else\n # @posts = Post.order(created_at: :desc).paginate(:page => params[:page], :per_page => 6)\n # end\n @posts = Post.order(created_at: :desc).paginate(:page => params[:page], :per_page => 6)\n @posts_with_tag = Post.order(created_at: :desc).tagged_with(params[:tag]).paginate(:page => params[:page], :per_page => 3)\n respond_to do |format|\n format.html {}\n format.js {}\n end\n end",
"title": ""
},
{
"docid": "43e74560b870af4de528e032ecba4d05",
"score": "0.5900004",
"text": "def posts\n return [] unless valid?\n\n @posts ||=\n Course::Discussion::Post.forum_posts.from_course(@course).\n includes(topic: { actable: :forum }).\n calculated(:upvotes, :downvotes).\n where(created_at: start_time..end_time).\n where(creator_id: @user)\n end",
"title": ""
},
{
"docid": "3f0e5de5757a8aa48545445313f78942",
"score": "0.5892326",
"text": "def tags\n object.tags.pluck(:title).sort\n end",
"title": ""
},
{
"docid": "fd41cdbf7602ad301b89835d0566e101",
"score": "0.5890603",
"text": "def index\n\n if params[:tag]\n @posts = Post.tagged_with(params[:tag])\nelsif params[:category]\n @category_id = Category.find_by(name: params[:category]).id\n @posts = Post.where(category_id: @category_id).order(\"created_at DESC\")\nelsif params[:subcategory]\n @subcategory_id = Subcategory.find_by(name: params[:subcategory]).id\n @posts = Post.where(subcategory_id: @subcategory_id).order(\"created_at DESC\")\nelse\n @posts = Post.all.order(\"created_at DESC\")\nend\n\n\n @posts = @posts.page params[:page]\nend",
"title": ""
},
{
"docid": "d84cb1aee38b0869a77237329bbb688a",
"score": "0.5883823",
"text": "def tags\n @obj['tags']\n end",
"title": ""
},
{
"docid": "a39fdec9a7659a6f8bcb9dcd11f9ead9",
"score": "0.5860757",
"text": "def user_posts(user, tag = nil)\n was_subscribed = true\n ret = []\n\n # unless we already subscribed, subscribe to user\n unless subs.keys.include?(user)\n sub(user)\n was_subscribed = false\n end\n \n # grab list of user's posts\n inbox_dates.keys.each do |date|\n ret += inbox(date).find_all do |post| \n post['user'] == user && (tag == nil || post['tags'].include?(tag))\n end\n end\n\n # unsubscribe from user unless we were already subscribed\n unsub(user) unless was_subscribed\n\n # return list of user's posts\n ret\n end",
"title": ""
},
{
"docid": "118540c2eaab1a1475b83fcdb3d30f44",
"score": "0.58586967",
"text": "def tags\n get.tagGuids\n end",
"title": ""
},
{
"docid": "15627c6d15bb1a3295b2a1cc16ed2532",
"score": "0.5853819",
"text": "def tags\n @tags = ActsAsTaggableOn::Tag.where(\"tags.name LIKE ?\", \"%#{params[:q]}%\") \n #@tags = Video.tag_counts(:limit => 50, :order => \"count desc\")\n #@tags = Video.tag_counts_on(:tag, :limit => 50, :order => \"count desc\")\n @out = @tags.map{|b| {:id => b.id, :name => b.name }}\n \n\n \n respond_to do |format|\n format.json { render :json => @out }\n end\n\n end",
"title": ""
},
{
"docid": "23ba52d11b0c72c3ace99d2a2a6c626d",
"score": "0.58529997",
"text": "def posts_through_search hashtag, since\n warn \"DEPRECATION WARNING: Facebook has deprecated searching for posts. It is no \" +\n \"longer available for new applications and will cease to work for existing \" +\n \"applications in April 2015.\"\n\n posts = FbGraph::Post.search(hashtag.tag_name_with_hash, since: since.to_i, return_ssl_resources: 1, access_token: config.access_token)\n\n # Facebook search is fairly unpredictable, so ensure the query is actually mentioned\n posts.select { |post| matches? post, hashtag.tag_name }\n end",
"title": ""
},
{
"docid": "4d1e2cbdc95c5051def718b610bff677",
"score": "0.5849566",
"text": "def tags\n data[:tags]\n end",
"title": ""
},
{
"docid": "4d1e2cbdc95c5051def718b610bff677",
"score": "0.5849566",
"text": "def tags\n data[:tags]\n end",
"title": ""
},
{
"docid": "4d1e2cbdc95c5051def718b610bff677",
"score": "0.5849566",
"text": "def tags\n data[:tags]\n end",
"title": ""
},
{
"docid": "4d1e2cbdc95c5051def718b610bff677",
"score": "0.5849566",
"text": "def tags\n data[:tags]\n end",
"title": ""
},
{
"docid": "4d1e2cbdc95c5051def718b610bff677",
"score": "0.5849566",
"text": "def tags\n data[:tags]\n end",
"title": ""
},
{
"docid": "cdc438e566384c58a3eb4330f55e792b",
"score": "0.58404654",
"text": "def blogfeed\n if params[:tag]\n @blogposts = current_user.blog_feed.tagged_with(params[:tag]).paginate(page: params[:page], :per_page => 10)\n else\n @blogposts = current_user.blog_feed.paginate(page: params[:page], :per_page => 10)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blogposts }\n end\n end",
"title": ""
},
{
"docid": "f5238c9ea20989a0a17dec12e469693b",
"score": "0.5837463",
"text": "def search\n terms = params[:query].split\n query = terms.map { |term| \"title like '%#{term}%' OR body like '%#{term}%' OR tags like '%#{term}%'\" }.join(\" OR \")\n \n @posts = Post.where(query).order(\"created_at DESC\").first(10)\n end",
"title": ""
},
{
"docid": "c4c89312ab8e3aa496a82eac73d0b712",
"score": "0.5836728",
"text": "def user_posts(user, tag = nil)\n was_subscribed = true\n ret = []\n\n # unless we already subscribed, subscribe to user\n unless subs.keys.include?(user)\n sub(user)\n was_subscribed = false\n end\n \n # grab list of user's posts\n inbox_dates.keys.each do |date|\n ret += inbox(date).find_all do |post| \n post['user'] == user && (tag == nil || post['tags'].include?(tag))\n end\n end\n\n # unsubscribe from user unless we were already subscribed\n unsub(user) unless was_subscribed\n\n # return list of user's posts\n ret\n end",
"title": ""
},
{
"docid": "d2cc65ac4a98137241e7909260779f38",
"score": "0.5836286",
"text": "def index\n if params[:tag]\n @articles = Article.tagged_with(params[:tag], on: 'tags')\n elsif params[:category]\n @articles = Article.tagged_with(params[:category], on: 'categories')\n else\n @articles = Article.all\n end\n end",
"title": ""
},
{
"docid": "5766e7d195a671c5f85190f40403efa5",
"score": "0.5835498",
"text": "def tags\n @data['tags']\n end",
"title": ""
},
{
"docid": "a3d642660abf6efb8c81ea72e164a3a1",
"score": "0.58300185",
"text": "def index\n @posts_in_pages = cache(\"post_index\", tag: params[:tag] || \"none\") do\n posts = PostArchive.list_published_order_by_id_desc(tag: params[:tag])\n\n posts.in_groups_of(POSTS_PER_PAGE, false)\n end\n\n @pagination = {\n curr_page: params[:page].try(:to_i) || 1,\n total_pages: @posts_in_pages.count,\n }\n\n expires_in(10.minutes, public: true)\n end",
"title": ""
},
{
"docid": "47aee2c779d1495c072c29784ac3025d",
"score": "0.58299875",
"text": "def retrieve_posts\n # Get posts\n rss = RSS::Parser.parse(AWL_RSS_URL)\n\n # Grab shortened URLs\n links = rss.items.map(&:guid).map(&:content)\n\n @articles = []\n\n links.each do |link|\n @articles << Article.new(link)\n end\n\n # TODO: Only grab the tags for articles that haven't already be tweeted\n @articles.map(&:retrieve_tags)\n end",
"title": ""
},
{
"docid": "2866f35defdfa7b506253e7ea052db87",
"score": "0.58272976",
"text": "def find_tagged_with(*args)\n options = find_options_for_find_tagged_with(*args)\n options.blank? ? [] : find(:all, options)\n end",
"title": ""
},
{
"docid": "d4e31b7e9ed32073c52fc16ca71487c0",
"score": "0.58218044",
"text": "def find_all_tagged_objs\n Tagging.where(tagger: self).map{|tagging| tagging.tagged_obj}.uniq\n end",
"title": ""
},
{
"docid": "ca7d85a666b3819f69adfad26ca29b59",
"score": "0.5818613",
"text": "def elements_with_all_tags(tags)\n return InfoNode.elements_with_all_tags(session['domain'],tags)\n end",
"title": ""
},
{
"docid": "28d84b5ae4877929663fd49f04c308ed",
"score": "0.58182424",
"text": "def render_posts_for_tag(tag, page)\n raise if !tag.instance_of?(String)\n raise if !page.instance_of?(Fixnum)\n\n posts_per_page = 5\n @logged_in = is_logged_in\n @tag = Tag.where(:name => tag).first\n if !@tag\n return render_404\n end\n posts = if @logged_in then @tag.posts else @tag.posts.where(:is_public => true) end\n @pages = (posts.size + posts_per_page - 1) / posts_per_page\n @page = page\n if @page < 1 || @page > @pages\n return render_404\n end\n @posts = posts.order(\"sort_id DESC\").limit(posts_per_page).offset((@page - 1) * posts_per_page)\n return render_404 if !@posts || @posts.size == 0 || (@tag.name == \"sidebar\" && !@logged_in)\n return render \"index\"\n end",
"title": ""
},
{
"docid": "51cf27630d3d3f8b80074b57581de405",
"score": "0.5802414",
"text": "def index\n console\n @posts = Post.order(updated_at: :desc)\n @tags = sorted_tags.reverse\n end",
"title": ""
},
{
"docid": "d21c9fe4a319b36b39dff1728d86e7c8",
"score": "0.5792826",
"text": "def getPosts()\n\t\tself.post\n\tend",
"title": ""
},
{
"docid": "95266cc87d7e619293a6a302e065406c",
"score": "0.5779173",
"text": "def tagwise(tag_css_class, post_css_class)\n html = \" \"\n Rails.cache.fetch(\"posts_by_tags\") do\n Post.where.not(tag: nil).pluck(:tag).uniq.each do |tag|\n html += %Q[<p class=\"#{tag_css_class}\">#{tag}</p>]\n Post.where(tag: tag).each do |post|\n html+= %Q[\n <div class=\"#{post_css_class}\">\n <ul>\n <li><a href=\"#{post_path(post)}\">#{post.title}</a></li>\n </ul>\n </div>\n ]\n end\n end\n html\n end\n end",
"title": ""
},
{
"docid": "faf58f59a761ae12dfc64328fc939212",
"score": "0.5777024",
"text": "def fetch_tags(url, tags)\n doc = Nokogiri::HTML(open(url))\n aux = []\n doc.xpath(tags).each do |f|\n aux << f.text\n end\n return aux\n end",
"title": ""
},
{
"docid": "1ff36f48ee1fc3febe264f529f3e9276",
"score": "0.5775477",
"text": "def query_tags(*tags)\n if tags.last.respond_to?(:keys)\n tags = tags[0..-2]\n options = tags.last\n else\n options = {}\n end\n\n do_query(tags, nil, options) { |result| yield result }\n end",
"title": ""
},
{
"docid": "4c8cbdb0e89f8676ff8f71bca995c733",
"score": "0.5773667",
"text": "def where(options = {})\n _, _, root = @client.get(\"/tags\", options)\n\n root[:items].map{ |item| Tag.new(item[:data]) }\n end",
"title": ""
},
{
"docid": "2a221405c9134f647fbdf10b90cda6bc",
"score": "0.5770895",
"text": "def show\n if params[:tag]\n @posts = @post.tagged_with(params[:tag])\n @tags = related_tags(@posts)\n @tagsHash = related_tags_hash(@posts)\n @relatedPostsCalendar = post_calendar(@posts)\n \n # @posts = Post.tagged_with_paginate(params[:tag], params[:page])\n else\n @posts = [@post]\n @tags = related_tags(@posts)\n @tagsHash = related_tags_hash(@posts)\n @relatedPostsCalendar = post_calendar(@posts)\n end\n @postsCalendar = post_calendar(Post.all)\n end",
"title": ""
},
{
"docid": "2813583b605718ad83948708c2225536",
"score": "0.57618004",
"text": "def search_by_tags(tags,page,per_page)\n begin\n\t args = { 'dev_id'=>@api_key, \n\t 'tag' => tags,\n\t 'per_page' => per_page,\n 'page' => page }\n videos = xmlrpc_get_xml('youtube.videos.list_by_tag',args,'//video') \n rvideos = []\n for video in videos\n html = html_code(video.elements[\"id\"].text,\n video.elements[\"thumbnail_url\"].text ) \n v = { :title => video.elements[\"title\"].text,\n :thumb => video.elements[\"thumbnail_url\"].text,\n :thumb_width => 80,\n :thumb_height => 60,\n :creator => video.elements[\"author\"].text,\n\t :html => html }\t \n\t rvideos << v\n\t end\n\t return rvideos\n \t rescue Exception\n return nil\n\t end \t \t \n\tend",
"title": ""
},
{
"docid": "2c534481d7c5ec98665769504cf377f4",
"score": "0.57602334",
"text": "def count_tags\n tags = []\n @posts = Kobayashi::Post.grab_current_posts\n @posts.each do |post|\n tags << post[:tags]\n end\n @tag_counts = tags.flatten.frequency\n @tag_counts = Hash[@tag_counts.sort]\n return @tag_counts\n end",
"title": ""
},
{
"docid": "97a3e740a279e9deac838217d868ae20",
"score": "0.5757924",
"text": "def index\n @posts = Post\n if user_session[:tags].present?\n @posts = @posts.tagged_with(user_session[:tags])\n end\n @posts = @posts.by_creation.decorate\n\n respond_to do |format|\n format.html\n format.json { render json: @posts }\n format.js\n end\n end",
"title": ""
},
{
"docid": "3aa5c6b75b18ad2e2d59ecd723ee255f",
"score": "0.5754039",
"text": "def all_tags context = :tags\n ActsAsTaggableOn::Tagging.where(context: context).select(:tag_id).distinct.includes(:tag).map(&:tag)\n end",
"title": ""
},
{
"docid": "fb47ed7bff4dd684771ae8550d12d6d0",
"score": "0.5752558",
"text": "def index\n @posts = Post.search(params[:type], params[:search])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n format.json { render json: @tags }\n end\n end",
"title": ""
},
{
"docid": "23e9c1d6433c1845858b9e66afb0395e",
"score": "0.5750184",
"text": "def search_posts\n @id = current_user.id\n limit = 15\n offset = params[:offset]\n @posts = Post.fetch_multi(Tag.search(params[:q]).offset(offset).limit(limit).pluck(:post_id)).uniq {|p| p.id}\n @posts.to_a.delete_if do |post|\n current_user.reported_posts.include?(post)\n end\n if @posts.any?\n @current_user = current_user\n render :index_posts, status: 200\n else\n render json: nil, status: 404\n end\n end",
"title": ""
},
{
"docid": "8f4fc58712aee6c6c08b477b5a4fa76d",
"score": "0.574746",
"text": "def find_pets_by_tags(tags, opts = {})\n data, _status_code, _headers = find_pets_by_tags_with_http_info(tags, opts)\n data\n end",
"title": ""
},
{
"docid": "03aeb29507af7cb95a1709d8096a0c27",
"score": "0.5735504",
"text": "def find_tagged_with(*args)\n options = find_options_for_find_tagged_with(*args)\n options.blank? ? [] : find(:all, options)\n end",
"title": ""
},
{
"docid": "5f577c6333b7913172cc1c0d116741c7",
"score": "0.5727981",
"text": "def show\n @post = Post.find_by(id: params[:id])\n @user = @post.user\n @tags = Tag.where(post_id: @post.id)\n end",
"title": ""
},
{
"docid": "660ecbb46172bdfe4e0e716d2c5fb5cb",
"score": "0.57163167",
"text": "def get_tags()\n db = connect_to_database()\n return db.execute(\"SELECT * FROM tags\")\n end",
"title": ""
},
{
"docid": "a45b84a04a54548a9e46605ee1c35dfa",
"score": "0.5712341",
"text": "def tags\n _get(\"/query/image/tags\") { |json| json }\n end",
"title": ""
},
{
"docid": "6d52e766db7120a4ed9409970fd7e07d",
"score": "0.57061297",
"text": "def tagged\n @articles = Article.tagged_by(params[:tag], params[:page])\n @tag = params[:tag]\n end",
"title": ""
},
{
"docid": "3cab2bae5e00d3b0e51c6b412ef8fdb7",
"score": "0.56754696",
"text": "def index\n @posts = if params[:tag]\n Post.tagged_with(params[:tag])\n else\n Post.scoped\n end\n @posts = @posts.where(:published => true).order(\"created_at DESC\")\n @posts = @posts.paginate(:page => params[:page], :per_page => 4) unless params[:count] == \"all\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.rss { render :layout => false }\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
}
] |
620931acfd1a89a00e1482378541e55f
|
Outputs nonarray value in the form of hash For object, use to_hash. Otherwise, just return the value
|
[
{
"docid": "f0ff79d474b4d3d5b9687d897ed56ca8",
"score": "0.0",
"text": "def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map{ |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"title": ""
}
] |
[
{
"docid": "a34f3dad821ba9744bc8d807b65489ad",
"score": "0.6719518",
"text": "def hash\n [value].hash\n end",
"title": ""
},
{
"docid": "a34f3dad821ba9744bc8d807b65489ad",
"score": "0.6719518",
"text": "def hash\n [value].hash\n end",
"title": ""
},
{
"docid": "4510677a0898812399dd3733bd61e5e7",
"score": "0.66955966",
"text": "def hash\n @value.hash\n end",
"title": ""
},
{
"docid": "4510677a0898812399dd3733bd61e5e7",
"score": "0.66955966",
"text": "def hash\n @value.hash\n end",
"title": ""
},
{
"docid": "4510677a0898812399dd3733bd61e5e7",
"score": "0.66955966",
"text": "def hash\n @value.hash\n end",
"title": ""
},
{
"docid": "af32cacd1bc91e56f54c6c23b4cd1c94",
"score": "0.66565555",
"text": "def hash\n value.hash\n end",
"title": ""
},
{
"docid": "f6c2dcf722bb5e8125235e73a2162592",
"score": "0.65784436",
"text": "def hash\n value.hash\n end",
"title": ""
},
{
"docid": "f6c2dcf722bb5e8125235e73a2162592",
"score": "0.65784436",
"text": "def hash\n value.hash\n end",
"title": ""
},
{
"docid": "b59c3fe5d09fe1a4d9f369ed41b57c06",
"score": "0.65615726",
"text": "def hash\n @value.hash\n end",
"title": ""
},
{
"docid": "8b19643f156a5f255b9a1265ea55a3a3",
"score": "0.6556336",
"text": "def to_hash_value\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "01f7a3e54adcfa63f7b0b18d471f10d2",
"score": "0.6442863",
"text": "def to_s; @hash end",
"title": ""
},
{
"docid": "6615c4a372019932052213eb2f755bed",
"score": "0.64235014",
"text": "def hashValue()\n return @data\n end",
"title": ""
},
{
"docid": "18d6482be18f38732cf290ef4a37b2e9",
"score": "0.6414911",
"text": "def to_hash\n @value\n end",
"title": ""
},
{
"docid": "18d6482be18f38732cf290ef4a37b2e9",
"score": "0.6414911",
"text": "def to_hash\n @value\n end",
"title": ""
},
{
"docid": "3e48d78391045e8a0e2eb05680f1bcb2",
"score": "0.64009845",
"text": "def hash\n @hash_value\n end",
"title": ""
},
{
"docid": "390638b7515e6f208558156adef7faba",
"score": "0.6398838",
"text": "def hash()\n # IMPROVE: This is a really really poor implementation of hash for an array, but\n # it does work. It should be replaced with something much better, but I'm not sure\n # what level it belongs at.\n str = \"\"\n each { |item| str << item.hash.to_s }\n str.hash\n end",
"title": ""
},
{
"docid": "26b7e39779d9f792f02d7d4c5f925c78",
"score": "0.6368789",
"text": "def to_hash\n @value\n end",
"title": ""
},
{
"docid": "939f2c909301d24cdd0c38ec2f5bedbe",
"score": "0.6367171",
"text": "def hash\r\n to_s.hash\r\n end",
"title": ""
},
{
"docid": "7b80a5cd34b3ff10c045a4c7d8274bff",
"score": "0.6346188",
"text": "def output_hash; end",
"title": ""
},
{
"docid": "7b80a5cd34b3ff10c045a4c7d8274bff",
"score": "0.6346188",
"text": "def output_hash; end",
"title": ""
},
{
"docid": "58ee8a2e870d3d88ed05c46b02361796",
"score": "0.63259256",
"text": "def to_hash_value\n map do |value|\n value.respond_to?(:to_hash_value) ? value.to_hash_value : value\n end\n end",
"title": ""
},
{
"docid": "8a0e7a713b52a45ff590a5fe570f1a31",
"score": "0.63050926",
"text": "def hash\r\n to_s.hash\r\n end",
"title": ""
},
{
"docid": "a1793224bebc92517e922a6cc77b4cc8",
"score": "0.6301932",
"text": "def hash\n values[:hash]\n end",
"title": ""
},
{
"docid": "5e52eaaebb827b973aa7b6be5d7bcc6e",
"score": "0.62975895",
"text": "def hash\n \n return @internal_array.hash\n \n end",
"title": ""
},
{
"docid": "467e776610c2cdba26cbf76a15da2c9f",
"score": "0.6295994",
"text": "def hash\n [@value,self.class].hash\n end",
"title": ""
},
{
"docid": "46a4355407e6e0221b29b2e3e7693d8d",
"score": "0.6235648",
"text": "def value_hash\n @value_hash ||= value.hash\n end",
"title": ""
},
{
"docid": "76c82ba2d29e1890ce89c3f856787242",
"score": "0.62237245",
"text": "def hash\n return to_s.hash\n end",
"title": ""
},
{
"docid": "76c82ba2d29e1890ce89c3f856787242",
"score": "0.62237245",
"text": "def hash\n return to_s.hash\n end",
"title": ""
},
{
"docid": "76c82ba2d29e1890ce89c3f856787242",
"score": "0.62237245",
"text": "def hash\n return to_s.hash\n end",
"title": ""
},
{
"docid": "277d5e8925aec6d35ba7e568ff1a3149",
"score": "0.61795664",
"text": "def to_hash_value\n each_with_object({}) do |(key, value), hash|\n hash[key] = value.respond_to?(:to_hash_value) ? value.to_hash_value : value\n end\n end",
"title": ""
},
{
"docid": "ef3ba5122690dadc105c2947c3d9c9b6",
"score": "0.6166516",
"text": "def hash\n self.to_s.hash\n end",
"title": ""
},
{
"docid": "de2331760f8e096c654490830c523446",
"score": "0.61175996",
"text": "def as_plain_hash\n if @as_plain_hash_cache.include?(self.hash)\n @as_plain_hash_cache[self.hash]\n else\n result = {}.merge(self)\n\n result.each do |key, values|\n if values.size == 1 then\n result[key] = values.first\n end\n end\n\n if not @value.nil? then\n result[:value] = @value\n end\n\n @as_plain_hash_cache[self.hash] = result\n end\n end",
"title": ""
},
{
"docid": "c99e1d0fad6c674e18db6fddbdb0503b",
"score": "0.6114153",
"text": "def hash\n self.to_s.hash\n end",
"title": ""
},
{
"docid": "1c0bbd17a565eb5d1204367e8ecc3ff2",
"score": "0.6111105",
"text": "def to_s\n\t\thash_string\n\tend",
"title": ""
},
{
"docid": "f89592d6f974631cb0c5150a4e38dca5",
"score": "0.6106724",
"text": "def to_s()\n\t\t\treturn real_hash.to_s\n\t\tend",
"title": ""
},
{
"docid": "7827fb84a96c0425f77a7ed6dcafb01a",
"score": "0.6102334",
"text": "def hash\n number_value.hash\n end",
"title": ""
},
{
"docid": "9922c86e00df1d83d26e960df7c29874",
"score": "0.6101756",
"text": "def to_hash\n call\n @hash = @value\n @hash\n end",
"title": ""
},
{
"docid": "e198d186eb305f49942891c8d3f1647a",
"score": "0.6096847",
"text": "def to_hash\n\t\t\treturn @real_hash\n\t\tend",
"title": ""
},
{
"docid": "6e99613544e37e0f923dbc81ab96abf4",
"score": "0.60795677",
"text": "def hash\n to_s.hash\n end",
"title": ""
},
{
"docid": "6e99613544e37e0f923dbc81ab96abf4",
"score": "0.60795677",
"text": "def hash\n to_s.hash\n end",
"title": ""
},
{
"docid": "0beec143c2fe15a789fbc7b8f5242ddb",
"score": "0.60695773",
"text": "def hashvalue\r\n return @key.hashvalue\r\n end",
"title": ""
},
{
"docid": "cd2abbc958e2d6fba0930d47208fd20f",
"score": "0.6035991",
"text": "def hash\n to_s.hash\n end",
"title": ""
},
{
"docid": "cd2abbc958e2d6fba0930d47208fd20f",
"score": "0.6035991",
"text": "def hash\n to_s.hash\n end",
"title": ""
},
{
"docid": "cd2abbc958e2d6fba0930d47208fd20f",
"score": "0.6035991",
"text": "def hash\n to_s.hash\n end",
"title": ""
},
{
"docid": "0af4250ecb4f36ade127e8d006cd284f",
"score": "0.60267127",
"text": "def hash\n @hash ||= to_s.hash * -1\n end",
"title": ""
},
{
"docid": "a5e857a0177cd55ca1204dc66656a1fd",
"score": "0.601013",
"text": "def value_hash(value)\n value\n end",
"title": ""
},
{
"docid": "27383cd2e878102f90a6d0408833164a",
"score": "0.599736",
"text": "def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map { |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"title": ""
},
{
"docid": "27383cd2e878102f90a6d0408833164a",
"score": "0.599736",
"text": "def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map { |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"title": ""
},
{
"docid": "1f8ba352410953e2c9f110235a109999",
"score": "0.5971997",
"text": "def _to_hash(value)\n if value.respond_to? :to_h\n value.to_h\n else\n value\n end\n end",
"title": ""
},
{
"docid": "362dd6d6937a42c4f29f785ba34bb36d",
"score": "0.5971778",
"text": "def hash\n [self.class, value].hash\n end",
"title": ""
},
{
"docid": "c9066188a663cea9e73dbbbbf61f8fe5",
"score": "0.5955104",
"text": "def hash\n return (self.normalize.to_s.hash * -1)\n end",
"title": ""
},
{
"docid": "229d830907c61e6c8257e0154e8cdeee",
"score": "0.59443676",
"text": "def hash\n @hash ||= to_a.map(&:to_s).hash\n end",
"title": ""
},
{
"docid": "f9936d5e6bf8befb94230ab5e16e8657",
"score": "0.59361047",
"text": "def to_hash(value)\n return if value.nil?\n _deserialize(value)\n end",
"title": ""
},
{
"docid": "4227810480ab619ba919700cc7e25f20",
"score": "0.5921783",
"text": "def hash\n super +\n @value.hash\n end",
"title": ""
},
{
"docid": "4227810480ab619ba919700cc7e25f20",
"score": "0.5921459",
"text": "def hash\n super +\n @value.hash\n end",
"title": ""
},
{
"docid": "fc7fd464cc0ce67172e3d5ca25e72ca5",
"score": "0.590655",
"text": "def hash\n # let's assume a nil value for @value or @tag is not different from the empty value\n \"v:#{@value},t:#{@tag}\".hash\n end",
"title": ""
},
{
"docid": "f617d065efd2b101ba2d92e16401604b",
"score": "0.5890367",
"text": "def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map { |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"title": ""
},
{
"docid": "f617d065efd2b101ba2d92e16401604b",
"score": "0.5890367",
"text": "def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map { |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"title": ""
},
{
"docid": "f617d065efd2b101ba2d92e16401604b",
"score": "0.5890367",
"text": "def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map { |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"title": ""
},
{
"docid": "f617d065efd2b101ba2d92e16401604b",
"score": "0.5890367",
"text": "def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map { |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"title": ""
},
{
"docid": "f617d065efd2b101ba2d92e16401604b",
"score": "0.5890367",
"text": "def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map { |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"title": ""
},
{
"docid": "f617d065efd2b101ba2d92e16401604b",
"score": "0.5890367",
"text": "def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map { |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"title": ""
},
{
"docid": "3978b80c5b2238a81f47c40db746f6d4",
"score": "0.58882135",
"text": "def hashValue()\n return @key.hashValue()\n end",
"title": ""
},
{
"docid": "51266b11e46d322725ddc8234558c28b",
"score": "0.5886793",
"text": "def hash\n [a, b, value].hash\n end",
"title": ""
},
{
"docid": "0fcae7c15f9b8a425ef04f6271412e04",
"score": "0.5884459",
"text": "def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map { |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"title": ""
},
{
"docid": "0fcae7c15f9b8a425ef04f6271412e04",
"score": "0.5884459",
"text": "def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map { |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"title": ""
},
{
"docid": "0fcae7c15f9b8a425ef04f6271412e04",
"score": "0.5884459",
"text": "def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map { |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"title": ""
},
{
"docid": "0fcae7c15f9b8a425ef04f6271412e04",
"score": "0.5884459",
"text": "def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map { |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsif value.respond_to? :to_hash\n value.to_hash\n else\n value\n end\n end",
"title": ""
},
{
"docid": "fec7805191a4770d142d624c5b92a77f",
"score": "0.58817077",
"text": "def to_s\n to_hash.to_s\n end",
"title": ""
},
{
"docid": "fec7805191a4770d142d624c5b92a77f",
"score": "0.58817077",
"text": "def to_s\n to_hash.to_s\n end",
"title": ""
},
{
"docid": "d1bcb891360620fdc218eb384c1d63df",
"score": "0.5880905",
"text": "def to_hash\n nil\n end",
"title": ""
},
{
"docid": "e7f7bad3cc1802837ef48988d7fde9e8",
"score": "0.5871947",
"text": "def getHashValue\n\treturn @hashValue\n end",
"title": ""
},
{
"docid": "3c6ae9bd83b763bc793709c4abefd3b5",
"score": "0.58666605",
"text": "def form_value\n if array?\n [ *value ].map{ |x| format_value( x ) }\n elsif hash?\n Hash[ [ *value ].map{ |k, v| [ k.to_s, format_value( v ) ] } ]\n else\n format_value( value )\n end\n end",
"title": ""
},
{
"docid": "7066cdfb30746f08ac2e36effeb1dcea",
"score": "0.58611846",
"text": "def to_hash\n ::Hash[to_a]\n end",
"title": ""
},
{
"docid": "4c8705b5c0fa3db82aef65ac86c44445",
"score": "0.5859289",
"text": "def hash\n to_s.hash ^ self.class.hash\n end",
"title": ""
},
{
"docid": "64f5e127362a6c4b9c8d6fc62e94e603",
"score": "0.5852324",
"text": "def to_hash\n if map?\n return emit\n end\n raise SlawTypeNoMethodError,\n \"to_hash can only be called on a hash slaw\"\n end",
"title": ""
},
{
"docid": "95b9eba17c1cda7778ef188acfacb2db",
"score": "0.58522743",
"text": "def hash\n @source_val.hash\n end",
"title": ""
},
{
"docid": "5708c0ffdec5e1555c0c4c8732b27325",
"score": "0.58476925",
"text": "def prepare_value(value)\n unless value.is_a?(Hash) || value.is_a?(Array)\n return simple_value?(value) ? value : value.inspect\n end\n\n cloned_value = ::Rollbar::Util.deep_copy(value)\n ::Rollbar::Util.iterate_and_update_with_block(cloned_value) do |v|\n simple_value?(v) ? v : v.inspect\n end\n\n cloned_value\n end",
"title": ""
},
{
"docid": "b8d2d379df641a39e37e96d5b3170060",
"score": "0.58286506",
"text": "def to_json_hash_value\n if field.respond_to?(:json_encode)\n map do |value|\n field.json_encode(value)\n end\n else\n map do |value|\n value.respond_to?(:to_json_hash_value) ? value.to_json_hash_value : value\n end\n end\n end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.58215266",
"text": "def hash; end",
"title": ""
}
] |
eb6c7360af184897f4c59ea7115bef24
|
Joins the given channels.
|
[
{
"docid": "cd08883ee4f8f365dc612b777017c372",
"score": "0.6790032",
"text": "def join(context, channels)\n raise ClientError.new(\"Can't join any channel. Not connected to a server.\") \n end",
"title": ""
}
] |
[
{
"docid": "35c8c30df206057216735ae8159fa927",
"score": "0.79928374",
"text": "def join *channels\n send \"JOIN #{channels.join(',')}\"\n end",
"title": ""
},
{
"docid": "d5464fb7ed192276d5087c82fed37b44",
"score": "0.7827094",
"text": "def join(*channels)\n channels.each {|channel| raw(\"JOIN #{channel}\")}\n end",
"title": ""
},
{
"docid": "fb04ec966efabf673486a1215ecbe929",
"score": "0.7691533",
"text": "def join(channels)\n @context.join(channels)\n end",
"title": ""
},
{
"docid": "83fd5cac4e1df20bb254672a7c6532cd",
"score": "0.7491994",
"text": "def join(channels)\n state.join(self, channels)\n end",
"title": ""
},
{
"docid": "8e912e092c0ba6207eb23399121e1bf6",
"score": "0.7410301",
"text": "def join(context, channels)\n end",
"title": ""
},
{
"docid": "a661a725b668f17f1f709e2b0b0c37af",
"score": "0.722872",
"text": "def join(*channels_to_join)\n channels_to_join = channels_to_join.flatten.map { |c| util.channel_name(c) }\n # If you're joining multiple channels at once, we join them together\n command :JOIN, channels_to_join.join(\",\")\n channels_to_join.each { |channel| dispatch :outgoing_join, :target => channel }\n logger.info \"Sent JOIN for channels #{channels_to_join.join(\", \")}\"\n end",
"title": ""
},
{
"docid": "69ca29a2f1c3edfc569eeaa1bf609a10",
"score": "0.69419754",
"text": "def join(context, channels)\n IRC::Commands::JoinCommand.new(channels).execute(context)\n end",
"title": ""
},
{
"docid": "985ce32ef9890cdf4f025e297f075acb",
"score": "0.674326",
"text": "def join(context, channels)\n raise ClientError.new(\"Can't join any channel. The connection is not yet registered.\")\n end",
"title": ""
},
{
"docid": "a7ea0e482ae6d06bc415a76850c47dd3",
"score": "0.6712006",
"text": "def join(params)\n channel_name = get_param(params, :channel)\n get_channel_internal(channel_name)\n end",
"title": ""
},
{
"docid": "8920fb2504b0407264ca0cba73b10d0d",
"score": "0.66255707",
"text": "def join! channels, keys=[]\n $bot.send_line \"JOIN #{channels.join ','} #{keys.join ','}\"\nend",
"title": ""
},
{
"docid": "59ce27ce1498242e6bb6fe9ddfbcc531",
"score": "0.6534462",
"text": "def autojoin_channels\n []\n end",
"title": ""
},
{
"docid": "9f40ea4af4b2369d214176a075214f5d",
"score": "0.65179706",
"text": "def send_join channel\n if channel.is_a? Array\n buf = []\n\n channel.each do |c|\n next if channels.include? c\n\n buf << c\n\n if buf.length == 4\n send_join channel.join(',')\n buf.clear\n end\n end\n\n send_join buf.join(',') unless buf.empty?\n elsif channel.is_a? Hash\n buf, keys = [], []\n\n channel.each do |c, k|\n next if channels.include? c\n\n buf << c\n keys << (k.empty? ? k : 'x')\n\n if buf.length == 4\n send_join \"#{buf.join(',')} #{keys.join(',')}\"\n buf.clear\n keys.clear\n end\n end\n send_join \"#{buf.join(',')} #{keys.join(',')}\" unless buf.empty?\n else\n send_command 'JOIN', channel\n end\n end",
"title": ""
},
{
"docid": "edc7a33748d406dc5c067e511ceda515",
"score": "0.64571816",
"text": "def join\n Mattermost.post(\"/channels/#{self.id}/join\")\n end",
"title": ""
},
{
"docid": "76e9fd0a325ce493ae9e16cec5cca612",
"score": "0.64247483",
"text": "def connect_channels(in_chan, out_chan)\n raise \"Already connected\" if @in_chan\n @in_chan = in_chan\n @out_chan = out_chan\n start_receive_loop\n end",
"title": ""
},
{
"docid": "86401616ce96398708d5fd16f125f7f0",
"score": "0.63842493",
"text": "def subscribe(*channels, &block); end",
"title": ""
},
{
"docid": "8db165420ff315f1833c08fb3645f36a",
"score": "0.63298887",
"text": "def channels_join(options={})\n throw ArgumentError.new(\"Required arguments :name missing\") if options[:name].nil?\n post(\"channels.join\", options)\n end",
"title": ""
},
{
"docid": "d089a43517700c02e2c549c71f41ca48",
"score": "0.630712",
"text": "def psubscribe(*channels, &block); end",
"title": ""
},
{
"docid": "d089a43517700c02e2c549c71f41ca48",
"score": "0.630712",
"text": "def psubscribe(*channels, &block); end",
"title": ""
},
{
"docid": "c04a42d6ce789fec844e00d55761d893",
"score": "0.6170065",
"text": "def channels_join(params = {})\n fail ArgumentError, \"Required arguments 'name' missing\" if params['name'].nil?\n response = @session.do_post \"#{SCOPE}.join\", params\n Slack.parse_response(response)\n end",
"title": ""
},
{
"docid": "aaceb615581c44176d2be05935eafece",
"score": "0.59805334",
"text": "def join(channel)\n send \"JOIN #{channel}\"\n end",
"title": ""
},
{
"docid": "df922a24921c35d4f54a0d9411ad0fb9",
"score": "0.59199613",
"text": "def subscribe(*channels)\n delegate.subscribe(\n @app.socket_digest(@app.socket_connection_id),\n *channels\n )\n end",
"title": ""
},
{
"docid": "8a5d84c8b779d55b1abb1e818606f4c0",
"score": "0.5904789",
"text": "def channels\n default_channels.tap do |list|\n\n end.flatten\n end",
"title": ""
},
{
"docid": "0472271e52d178c4d6a39d8eaf7bbeb1",
"score": "0.588183",
"text": "def subscribe(channel, *channels, &block); end",
"title": ""
},
{
"docid": "f5fea5aec30d70c1aa0dedf60e62b30c",
"score": "0.5852346",
"text": "def joined_channels\n return @joined_channels.values\n end",
"title": ""
},
{
"docid": "f786ee98c7adbe9ddc9e5a9b0e89fe38",
"score": "0.5832665",
"text": "def joined_channels\n @context.joined_channels\n end",
"title": ""
},
{
"docid": "4b33ad93fdecccd744fb678fcf7ba013",
"score": "0.57907593",
"text": "def surround_channels(prefix = '', *channels)\n channels = CHANNELS if channels.empty?\n channels.map(&:to_s).map(&:upcase).map { |c| \"#{prefix}#{c}\" }\n end",
"title": ""
},
{
"docid": "3c0ee5146a4b590545bfb88377e8da43",
"score": "0.5746905",
"text": "def dispatch( *names )\n names = channels.keys if names.empty?\n\n names.each do |name|\n dispatch_channel( fetch_channel( name ) )\n end\n end",
"title": ""
},
{
"docid": "9b50be1b0db02f7e94735d1d8fb7b099",
"score": "0.5701725",
"text": "def channels\n @channels ||= Channel.new(self)\n end",
"title": ""
},
{
"docid": "e123bd23ec3c2ceeebf974d850e75fe0",
"score": "0.5675091",
"text": "def joinChannel(idUser,idChannel)\n \n end",
"title": ""
},
{
"docid": "435e6964870f06075c029319f98230cf",
"score": "0.566175",
"text": "def join_on_connect(bot)\n @config[:channels].each{|chan|\n join_channel( bot, chan )\n }\n \n # If we are not required to do anything else, unhook\n if @config[:connect_only] then\n unregister_all(0.5) # Give my hooks half a second to disconnect\n # or unregister_hooks(0.5, :chanman_connect)\n end\n end",
"title": ""
},
{
"docid": "35d006d8e6f501436025794ebbdd289c",
"score": "0.5646134",
"text": "def joins(*args)\n check_if_method_has_arguments!(__callee__, args)\n spawn.joins!(*args)\n end",
"title": ""
},
{
"docid": "e4b758fec134592a80759f2f6261763a",
"score": "0.5644764",
"text": "def join(channel, password = '')\n @irc.join(channel, password)\n end",
"title": ""
},
{
"docid": "92ec6333170d79e02bc7d67dc8394180",
"score": "0.5643805",
"text": "def subscribe(*channels)\n channels = Array.ensure(channels).flatten\n raise ArgumentError if channels.empty?\n delegate.subscribe(@app.socket_digest(@app.socket_connection_id), channels)\n end",
"title": ""
},
{
"docid": "cc2259bcae362bb6ca694fa07f630d85",
"score": "0.5642841",
"text": "def tweet_channels(tweets)\r\n @channels.each do |channel_name|\r\n channel = Channel(channel_name)\r\n tweets.each do |tweet|\r\n channel.msg(format_tweet(tweet))\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "a30dae2850aaaa8323d0395a12726904",
"score": "0.5633134",
"text": "def add_channel channel\n join(channel)\n self\n end",
"title": ""
},
{
"docid": "3949bb76dbe210d5f661038f53ca293f",
"score": "0.5624806",
"text": "def define_channel(subscribers, channels = [])\n subscribers.each do |subscriber|\n channels << subscriber.crypted_hash if subscriber.online?\n end\n channels\n end",
"title": ""
},
{
"docid": "da42429d5c28bcbb1e1e29dcb712b452",
"score": "0.56111777",
"text": "def channels=(params)\n @channels ||= []\n params.each do |hash|\n @channels << Channel.build_from_uri(hash)\n end\n end",
"title": ""
},
{
"docid": "03eefbedf0280625e5fc925654657ebf",
"score": "0.5604586",
"text": "def channels=(v)\n # TODO: fire events about channels updating?\n @channels = v\n end",
"title": ""
},
{
"docid": "e58cc81f621542d2ab1f1d85996e5ecf",
"score": "0.55929047",
"text": "def fan_in(input1, input2)\n chan = make_chan()\n go do\n loop do\n Concurrent::Channel.select do |s|\n s.take(input1) { |msg| chan << msg }\n s.take(input2) { |msg| chan << msg }\n end\n end \n end \n chan\nend",
"title": ""
},
{
"docid": "8e755c9c1777878ea9760c0fb090ae81",
"score": "0.5587685",
"text": "def join(channel, password=nil)\n write_optional(\"JOIN #{channel}\", password)\n end",
"title": ""
},
{
"docid": "5a986dd53b89809c9e9b2a1724ae291d",
"score": "0.55582964",
"text": "def setup\n join @connection.channels\n self\n end",
"title": ""
},
{
"docid": "b4b86e4ef6ea8ff3e260d193c23cff16",
"score": "0.55546564",
"text": "def join_actions(irc, real_nick, bot_join = false)\n chan = irc.channel\n nick = irc.from.nick\n real_nick = nick unless real_nick\n serv_name = irc.server.name\n user_map = $config[\"servers/#{serv_name}/users/#{IRC::Address.normalize(real_nick)}\"]\n chan_map = $config[\"servers/#{serv_name}/channels/#{chan.name}\"]\n channel_actions(irc, user_map, chan_map, bot_join)\n end",
"title": ""
},
{
"docid": "b4b86e4ef6ea8ff3e260d193c23cff16",
"score": "0.55546564",
"text": "def join_actions(irc, real_nick, bot_join = false)\n chan = irc.channel\n nick = irc.from.nick\n real_nick = nick unless real_nick\n serv_name = irc.server.name\n user_map = $config[\"servers/#{serv_name}/users/#{IRC::Address.normalize(real_nick)}\"]\n chan_map = $config[\"servers/#{serv_name}/channels/#{chan.name}\"]\n channel_actions(irc, user_map, chan_map, bot_join)\n end",
"title": ""
},
{
"docid": "e30ee020882e074e6bcfb36ea1ae2c08",
"score": "0.5543247",
"text": "def channels\n @channels ||= []\n end",
"title": ""
},
{
"docid": "f987f2b368d05f251abc4fc23642be92",
"score": "0.5517959",
"text": "def join\n if room.locked?\n client.numeric_reply :err_inviteonlychan, \"Cannot join #{channel} (locked)\"\n return false\n\n elsif room.full?\n client.numeric_reply :err_channelisfull, \"Cannot join #{channel} (full)\"\n return false\n\n else\n update_users do\n # join channel\n client.user_reply :join, \":#{channel}\"\n\n # current topic\n client.numeric_reply :rpl_topic, channel, ':' + (room.topic || \"\")\n\n # List the current users, which must always include myself\n # (race condition, server may not realize the user has joined yet)\n nicks = users.values.map { |u| u.nick }\n nicks.unshift client.nick unless nicks.include? client.nick\n\n nicks.each_slice(10) do |list|\n client.numeric_reply :rpl_namereply, \"=\", channel, \":#{list.join ' '}\"\n end\n client.numeric_reply :rpl_endofnames, channel, \"End of /NAMES list.\"\n\n # begin streaming the channel events (joins room implicitly)\n stream_campfire_to_channel\n end\n end\n\n true\n end",
"title": ""
},
{
"docid": "38fdc5c263aaf8bbfd2d6f55de75cec6",
"score": "0.55073404",
"text": "def join(channel_name, player, dispatch_to_self=true)\n @channels[channel_name] ||= Chat::Channel.new(\n channel_name, @dispatcher_actor_name\n )\n @channels[channel_name].join(player, dispatch_to_self)\n @channels_cache[player.id] ||= Set.new\n @channels_cache[player.id].add(channel_name)\n end",
"title": ""
},
{
"docid": "3976ebdaa77131f73b9f69ceab2622dd",
"score": "0.5478086",
"text": "def channels\n @channels ||= Hash.new {|h,k| h[k] = []} # Default hash empty hash values with an array (instead of nil)\n end",
"title": ""
},
{
"docid": "7b2c6fa2880a0095867b7b435687267a",
"score": "0.54546136",
"text": "def channels\n @channels ||= {}\n end",
"title": ""
},
{
"docid": "ed91dab62ce5d2493439b751462877d7",
"score": "0.5444355",
"text": "def subscribe_many(channels=nil)\n if channels.class == Array && block_given?\n @j_del.java_method(:subscribeMany, [Java::JavaUtil::List.java_class,Java::IoVertxCore::Handler.java_class]).call(channels.map { |element| element },(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) }))\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling subscribe_many(channels)\"\n end",
"title": ""
},
{
"docid": "239930d69801505575f04dab2a266e33",
"score": "0.54419404",
"text": "def handle_subscribe_to_channels(origin_client_id, params)\n channel_symbols = params[:channels]\n options = {}\n options[:bounce] = (params[:bounce] == 'true')\n options[:create_lazy] = (params[:create_lazy] == 'true')\n @qsif[:channel_manager].subscribe(origin_client_id, channel_symbols, options)\n end",
"title": ""
},
{
"docid": "6d0a1f028567bfd6ae2284af8b3f4817",
"score": "0.5435519",
"text": "def join(channel)\n if (IRCConnection.send_to_server(\"JOIN #{channel}\"))\n @channels.push(IRCChannel.new(channel));\n end\n end",
"title": ""
},
{
"docid": "37fe594944051458ade454c7f2c0bc81",
"score": "0.5434631",
"text": "def joins(*args)\n check_if_method_has_arguments!(:joins, args)\n spawn.joins!(*args)\n end",
"title": ""
},
{
"docid": "0a9b1561e89c6277562ba0ee86bfef27",
"score": "0.54264647",
"text": "def subscribe(*channels, &block)\n raise ArgumentError if channels.empty?\n \n Subscription.new(channels, &block).tap do |subscription|\n channels.each do |channel|\n @subscriptions_by_channel[channel] << subscription\n end\n end\n end",
"title": ""
},
{
"docid": "9b05d8012a518e8b39613b0d0da20d06",
"score": "0.5422767",
"text": "def channels=(channels)\n SideJob.redis.multi do |multi|\n if channels && channels.length > 0\n multi.hset \"#{@job.redis_key}:#{type}ports:channels\", @name, channels.to_json\n else\n multi.hdel \"#{@job.redis_key}:#{type}ports:channels\", @name\n end\n\n if type == :in\n channels.each do |chan|\n multi.sadd \"channel:#{chan}\", @job.id\n end\n end\n end\n end",
"title": ""
},
{
"docid": "2bf440e5fef7a330d662c1358b7785ba",
"score": "0.54151297",
"text": "def join\n @servers.each { |s| s.join }\n end",
"title": ""
},
{
"docid": "2bf440e5fef7a330d662c1358b7785ba",
"score": "0.54151297",
"text": "def join\n @servers.each { |s| s.join }\n end",
"title": ""
},
{
"docid": "aa9e27a6dca2043bcf22d39d4a57de9e",
"score": "0.5409535",
"text": "def _out_join(target, pass)\n key = @channels[target]\n pass.replace(key) unless key.to_s.empty?\n end",
"title": ""
},
{
"docid": "cd278ba88c3be7bd5f0118be35575824",
"score": "0.53762686",
"text": "def select(*channels)\n future do\n # noinspection RubyArgCount\n Channel.select do |s|\n channels.each do |ch|\n s.take(ch) { |value| [value, ch] }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "779234a73e1409dc4a95a807a4688718",
"score": "0.5375428",
"text": "def unsubscribe(*channels); end",
"title": ""
},
{
"docid": "779234a73e1409dc4a95a807a4688718",
"score": "0.5375428",
"text": "def unsubscribe(*channels); end",
"title": ""
},
{
"docid": "b98f20fa28afca59f88a088c9c771398",
"score": "0.5367227",
"text": "def join(chan, key=nil)\n write \"JOIN \"+chan+(key ? \" \"+key : '')\n end",
"title": ""
},
{
"docid": "9b0b7596e4ab2e6f30cf4e6a3dff5cb8",
"score": "0.53463197",
"text": "def handle_incoming_join(opts = {})\n if opts[:nick] == @nickname\n channels << opts[:target]\n logger.info \"Successfully joined channel #{opts[:target]}\"\n end\n end",
"title": ""
},
{
"docid": "6c14f304aa0e5deb2bd2251787bdbaab",
"score": "0.5331246",
"text": "def list(*channels)\n @connection.list *channels\n end",
"title": ""
},
{
"docid": "adb7e11fe5e2ec99d033f91df3792a0a",
"score": "0.5330492",
"text": "def welcome(event)\n @options[:channels].each {|channel| @irc.join(channel) }\n end",
"title": ""
},
{
"docid": "f0ea32d13310ababd79a07a576ea9569",
"score": "0.5328984",
"text": "def join(m, chan, key = nil)\n chan = '#' + chan unless chan.start_with? '#'\n key.lstrip! unless key.nil?\n Channel(chan).join(key)\n m.reply \"Joining #{chan}.\"\n end",
"title": ""
},
{
"docid": "652643991ac7814033a3a50e471bee70",
"score": "0.5328825",
"text": "def join(*args)\n return old_join(*args) # HACK\n end",
"title": ""
},
{
"docid": "02368c030a7c079f068b05d9deb3fb3b",
"score": "0.53280705",
"text": "def join(chan, pass = '')\n write(\"JOIN #{chan} #{pass}\")\n self\n end",
"title": ""
},
{
"docid": "eeed1d90b29e944331db8b0a70604b81",
"score": "0.53257096",
"text": "def join(*args)\n connect unless @connection\n \n id = jid_from_args(*args)\n @room_clients[id] = Jabber::MUC::SimpleMUCClient.new(@connection)\n assign_bot_callback_procs(@room_clients[id])\n @room_clients[id].join(id)\n end",
"title": ""
},
{
"docid": "dad2bac4ff00485b7c82402f34ce125b",
"score": "0.5324363",
"text": "def channels\n @channel_subscriptions\n end",
"title": ""
},
{
"docid": "cafb98bfe00c5f0b5d78bb1bf4194bba",
"score": "0.5322504",
"text": "def channels(options = {})\n body['channels'].map { |c| Channel.new(c, name, organisation_name, options) }\n end",
"title": ""
},
{
"docid": "f3fa40abd4c1327e49f4ce46146f3c25",
"score": "0.5316882",
"text": "def subscription(channels, options = {}, &block)\n one_or_more_channels = Array(channels)\n one_or_more_channels.each do |channel|\n replay_handlers[channel] = options[:replay]\n end\n faye.subscribe(one_or_more_channels, &block)\n end",
"title": ""
},
{
"docid": "493832fbf443c0c35898bd3c3f0874c0",
"score": "0.53045136",
"text": "def join_channel( bot, chan )\n # Join the channel\n bot.join( chan )\n\n return if @config[:connect_only]\n me = self\n\n # Hook for when we have successfully joined\n register_hook(\"chan_join_#{chan}\".to_sym, lambda{|m| m.channel == chan}, /join/){\n me.join( chan ) if nick == bot_nick # Ensure we only fire if the bot has joined, not other people\n }\n end",
"title": ""
},
{
"docid": "2341b4b3b11a60f9d545f1c8f0c74a77",
"score": "0.52800673",
"text": "def channel_combine(r, g, b)\n return image if r.width != g.width or r.height != b.height or \\\n r.width != g.width or r.width != b.width or \\\n r.type != :pgm or b.type != :pgm or g.type != :pgm\n\n mixed = []\n r.pixels.size.times do |y|\n mixed[y] = []\n r.pixels[0].size.times do |x|\n mixed[y][x] = [r.pixels[y][x], g.pixels[y][x], b.pixels[y][x]]\n end\n end\n\n PNM.create(mixed, {:type => :ppm, :maxgray => [r.maxgray, g.maxgray, b.maxgray].max })\n end",
"title": ""
},
{
"docid": "230b47a791275a21f94e88379ae37840",
"score": "0.52792346",
"text": "def populate_channels(options = {})\n request = options[:channels] || options[:channel]\n if request.nil?\n @num_channels = @output.num_channels\n true\n else\n populate_requested_channels(request)\n end\n end",
"title": ""
},
{
"docid": "51b5ffe783e555d5088bb5b54a1d9293",
"score": "0.52781683",
"text": "def join\n @sucker.join\n end",
"title": ""
},
{
"docid": "afabfb3846974ae117d8a31abec5e5cb",
"score": "0.5268569",
"text": "def join(chan)\n # First, stop listening for this event\n unregister_hooks(\"chan_join_#{chan}\".to_sym)\n\n # Then notice the channel\n @channels << chan\n\n # And hook for when we leave it\n me = self\n register_hook(\"chan_part_#{chan}\".to_sym, lambda{|m| m.channel == chan}, /part/){\n me.part( bot, channel ) if nick == bot_nick # Ensure we only fire if the bot has parted, not other people\n }\n register_hook(\"chan_quit_#{chan}\".to_sym, lambda{|m| m.channel == chan}, /kick/){\n me.part( bot, channel ) \n }\n end",
"title": ""
},
{
"docid": "8dac9996542be1262c5bf094610c9dbf",
"score": "0.5266513",
"text": "def each_channel &block\n Enumerator.new {\n |channel|\n self.channels.times do\n |c|\n channel << self.get_channel(c)\n end\n self\n }.each(&block)\n end",
"title": ""
},
{
"docid": "aa57f35e337ecb117c60ec7a2e6ab0e0",
"score": "0.5265509",
"text": "def each_channel(&block)\n channels.dup.each(&block)\n end",
"title": ""
},
{
"docid": "c6883c751520cd012e02d58a3d2ccd56",
"score": "0.5263548",
"text": "def subscribe(channels, &block)\n connect {\n channels = [channels].flatten\n validate_channels(channels)\n \n @transport.send({\n 'channel' => Channel::SUBSCRIBE,\n 'clientId' => @client_id,\n 'subscription' => channels\n \n }) do |response|\n if response['successful']\n channels = [response['subscription']].flatten\n channels.each { |channel| @channels[channel] = block }\n end\n end\n }\n end",
"title": ""
},
{
"docid": "54555f0ee92bb25fe0ad344d287b70aa",
"score": "0.52615434",
"text": "def channels\n client.channels\n end",
"title": ""
},
{
"docid": "82ac8dcbcbc76f2b458ba6bfe450bc7a",
"score": "0.5254079",
"text": "def active_channels\n channels.select { |c| c.active }\n end",
"title": ""
},
{
"docid": "e1f4433ecf195587795606b59bd8e2ca",
"score": "0.52354777",
"text": "def channels\n if self.data_source.channels.count != 0\n @logger.info \"Already found channels for this data source. If you want to update, run reload_channels\"\n return\n end\n get_channels\n end",
"title": ""
},
{
"docid": "499f92dbcc068e180c5687e7df82c610",
"score": "0.5233112",
"text": "def conversations_join(options = {})\n raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?\n options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]\n post('conversations.join', options)\n end",
"title": ""
},
{
"docid": "ada67d79bf10e3cca19a69897c07d93a",
"score": "0.5227192",
"text": "def inject_channels(channel_container)\n @consumers.each do |co|\n channel = channel_container.find_by_id(co.id)\n next unless channel\n co.channel = channel\n end\n end",
"title": ""
},
{
"docid": "f3789d559f3b556f66b50d669e00bc12",
"score": "0.52081203",
"text": "def broadcast(players = state.players.players, &block)\n players.each do |player|\n yield self.to(player.connection)\n end\n end",
"title": ""
},
{
"docid": "05fd94b7e5752b94f9c9a9430331400b",
"score": "0.52067345",
"text": "def each\n @channels.each { |channel| yield channel }\n end",
"title": ""
},
{
"docid": "e87ca58029f56e0cedc56866655163c5",
"score": "0.520593",
"text": "def part(channels)\n @context.part(channels)\n end",
"title": ""
},
{
"docid": "1f067154ee581517cf73b95a8234491a",
"score": "0.5190924",
"text": "def handle_join!(message, channel_name)\n @kernel.join_channel channel_name\n end",
"title": ""
},
{
"docid": "aa12e3c663b2b4989d6d24093e2eb540",
"score": "0.5190239",
"text": "def joined?(channel)\n return @joined_channels.include?(channel)\n end",
"title": ""
},
{
"docid": "670692c25bc9e08336aec02632c56ea2",
"score": "0.5183262",
"text": "def join(inputs, outputs)\n @inputs.each do |input|\n input.joins.delete_if do |join|\n join.kind_of?(Callback) && join.join == self\n end\n end if @inputs\n\n @inputs = inputs\n\n index = 0\n inputs.each do |input|\n input.joins << Callback.new(self, index)\n index += 1\n end if inputs\n reset\n \n @outputs = outputs\n self\n end",
"title": ""
},
{
"docid": "afa997a2561366c22e6b5a499c4ef287",
"score": "0.5180345",
"text": "def channels(options = [], cache: true)\n return @channels if cache && !@channels.nil?\n channels = @slack.channels_list\n @channels = begin\n channels[\"channels\"].map do |channel|\n add_params = options.empty? ? {} : options_to_hash(options, channel)\n { id: channel[\"id\"], name: channel[\"name\"] }.merge(add_params)\n end.sort_by {|ch| ch[:name] }\n end\n end",
"title": ""
},
{
"docid": "0c52ec8dbc1c5f4ed965897588a8c67e",
"score": "0.51753336",
"text": "def subscribed_to(separate_wildcard = false)\n if separate_wildcard\n {\n channel: @subscriber.channels,\n group: @subscriber.groups,\n wildcard_channel: @subscriber.wildcard_channels\n }\n else\n {\n channel: @subscriber.channels + @subscriber.wildcard_channels,\n group: @subscriber.groups\n }\n end\n end",
"title": ""
},
{
"docid": "35af54ea71b7a7e45046753cb4d620e7",
"score": "0.51674104",
"text": "def channels\n @channels\n end",
"title": ""
},
{
"docid": "35af54ea71b7a7e45046753cb4d620e7",
"score": "0.51674104",
"text": "def channels\n @channels\n end",
"title": ""
},
{
"docid": "e78e69725eee54af42e822d520de06d3",
"score": "0.5167031",
"text": "def notify_channels\n channels.each do |channel|\n self.class.connection.execute('NOTIFY %s, %s' % [channel, payload])\n end\n end",
"title": ""
},
{
"docid": "824ceaaec4b478dfe722565bc0609f54",
"score": "0.51523304",
"text": "def join(*args)\r\n args.uniq.each do |user|\r\n conversation_members.where(:user_id => user.id).update_all :parted => true\r\n\r\n conversation_members.build :user_id => user.id rescue nil\r\n\r\n broadcast_save user\r\n end\r\n end",
"title": ""
},
{
"docid": "8a9668eb80b729dcfea38b554652b40e",
"score": "0.51470643",
"text": "def say_joined(channel)\n say Box::Join(cmd: 'JOIN', target: \"#{@nick}!#{@user}@#{@host}\", channel: channel)\n end",
"title": ""
},
{
"docid": "66072801d3cbfc8ee2a364308a0e78d7",
"score": "0.51368546",
"text": "def join *args\n to_a.join(*args)\n end",
"title": ""
},
{
"docid": "15d7b6365ae1e54a6efd8c25896a5fd1",
"score": "0.512703",
"text": "def cmd_set_channels argv\n setup argv\n roles = @hash['roles']\n names = @hash['names']\n\n if names.include?(\",\")\n names_array = names.split(\",\")\n else\n names_array = Array.new\n names_array << names\n end\n\n if roles.include?(\",\")\n roles_array = roles.split(\",\")\n else\n roles_array = Array.new\n roles_array << roles\n end\n\n response = @api.set_channels(roles_array, names_array)\n msg response\n return response\n end",
"title": ""
},
{
"docid": "812a0471149451397afcc7a440c30c53",
"score": "0.51133865",
"text": "def join(player, dispatch_to_self=true)\n synchronize do\n @players[player.id] = player\n\n params = {'channel' => @name, 'player' => player}\n @players.each do |target_id, target|\n # Dispatch other players which are already joined to the channel to the\n # player which is joining.\n if dispatch_to_self && target_id != player.id\n typesig_bindless [[\"player.id\", player.id]], Fixnum\n dispatcher.push_to_player!(\n player.id, ChatController::ACTION_JOIN,\n {'channel' => @name, 'player' => target}\n )\n end\n\n # Dispatch joining player to other players who are already in the channel.\n unless ! dispatch_to_self && player.id == target_id\n typesig_bindless [[\"target_id\", target_id]], Fixnum\n dispatcher.push_to_player!(\n target_id, ChatController::ACTION_JOIN, params\n )\n end\n end\n end\n end",
"title": ""
}
] |
0700e5fddc4a0ee9a2ecbf79aac80c46
|
GET /atms/1 GET /atms/1.json
|
[
{
"docid": "84edddbdded0dfb446185ea1555f3def",
"score": "0.5881038",
"text": "def show\n @atm = Atm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.js { render layout: false } # show.html.erb\n format.json { render json: @atm }\n end\n end",
"title": ""
}
] |
[
{
"docid": "34ca8b59802c0ed0b43aa5dc51b19a87",
"score": "0.6908876",
"text": "def show\n @atm = Atm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @atm }\n end\n end",
"title": ""
},
{
"docid": "86cb5eb9e469b35ca111319d60bfd394",
"score": "0.66140884",
"text": "def show\n @atum = Atum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @atum }\n end\n end",
"title": ""
},
{
"docid": "a5143e10ccb72df32b008726c472b4ba",
"score": "0.62747157",
"text": "def locate_atm(**options)\n params = VALID_QUERY_PARAMS.map do |p|\n options[p] ? \"#{p}=#{options[p]}\" : nil\n end.compact\n\n path = \"/nodes/atms?\"\n path += params.join('&') if params.any?\n atms = client.get(path)\n atms\n end",
"title": ""
},
{
"docid": "956a52e4df12d8bff8a0260cf9530379",
"score": "0.62667495",
"text": "def index\n @lokasi_atms = LokasiAtm.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lokasi_atms }\n end\n end",
"title": ""
},
{
"docid": "4b396ca07cbce6b0feb1e4d58a61ba33",
"score": "0.62202173",
"text": "def show\n @atleta = Atleta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @atleta }\n end\n end",
"title": ""
},
{
"docid": "4b396ca07cbce6b0feb1e4d58a61ba33",
"score": "0.62202173",
"text": "def show\n @atleta = Atleta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @atleta }\n end\n end",
"title": ""
},
{
"docid": "5c5ebc6d091535279f24096dad898224",
"score": "0.62192965",
"text": "def show\n @timetableap = Timetableap.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @timetableap }\n end\n end",
"title": ""
},
{
"docid": "68f35bc41c7e56c27d151941d2c7eda5",
"score": "0.6208467",
"text": "def index\n @automounts = Automount.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @automounts }\n end\n end",
"title": ""
},
{
"docid": "bd38137af008716b235013e599188f8b",
"score": "0.61686105",
"text": "def index\n @atm_maches = AtmMach.all\n end",
"title": ""
},
{
"docid": "0814848b476915efe72c044619d043ec",
"score": "0.6162239",
"text": "def index\n @am_observations = AmObservation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @am_observations }\n end\n end",
"title": ""
},
{
"docid": "2e7f9f3ce435f506ddd4490260a63f78",
"score": "0.6121048",
"text": "def show\n @ainit = Ainit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ainit }\n end\n end",
"title": ""
},
{
"docid": "b43d27c182157fba492ef3a0c9843dfe",
"score": "0.6073521",
"text": "def show\n @attri = Attri.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @attri }\n end\n end",
"title": ""
},
{
"docid": "10e670b6bd5930b051e67965f76af933",
"score": "0.6030856",
"text": "def index\n @atleta = Atletum.all\n end",
"title": ""
},
{
"docid": "bf9ff13f388ca6315465b713d09c6fc3",
"score": "0.602147",
"text": "def get_amis\n @header = 'EC2 AMIs'\n @title = 'EC2 AMIs'\n #@amis = NodeType.get_active_ec2_node_types\n @amis = ec2_get_amis\n logger.debug(\"get_amis : #{@amis.inspect}\")\n respond_to do |format|\n format.xml { render :xml => @amis.to_xml }\n format.json { render :json => @amis.to_json }\n format.html { }\n end\n end",
"title": ""
},
{
"docid": "0db6ef918fb3d8b17d87555de51b20a9",
"score": "0.5994932",
"text": "def show\n @am_observation = AmObservation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @am_observation }\n end\n end",
"title": ""
},
{
"docid": "53374866efe1d18b41247dfada5a7685",
"score": "0.5986962",
"text": "def show\n @tum = Ta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tum }\n end\n end",
"title": ""
},
{
"docid": "c6c6417ec37ed1d2e2db0d2ac045262e",
"score": "0.5984275",
"text": "def get_appoitment\n\t\tid = params[:id]\n\t\t#user_token = params[:user_token]\n\t\turl = \"https://sdpm-appointment-service.herokuapp.com/appointment/#{id}\"\n\n\t\tresponse = RestClient::Request.execute(\n \t\tmethod: :get, \n\t\t\t\turl: url,\n\t\t\t)\n\n\t\trender :json => response\n\tend",
"title": ""
},
{
"docid": "339591b372598fcbfa7eb7fdc222f509",
"score": "0.59803724",
"text": "def index\n @missions = Mission.all\n\n render json: @missions, include: :astronauts\n end",
"title": ""
},
{
"docid": "6789e0722408f9f04d408d0b4bf92017",
"score": "0.5974083",
"text": "def show\n @ttramo = Ttramo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ttramo }\n end\n end",
"title": ""
},
{
"docid": "2f0f61b8782e98b3bf31357da6eeae06",
"score": "0.59724504",
"text": "def show\n\t\t\t\tatleta = Atleta.find(params[:id])\n\t\t\t\trender json: {status: 'SUCCESS', message:'Loaded atleta', data:atleta},status: :ok\n end",
"title": ""
},
{
"docid": "4151cccfcce7ab3375be399e1951021f",
"score": "0.59720045",
"text": "def show\n @lokasi_atm = LokasiAtm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lokasi_atm }\n end\n end",
"title": ""
},
{
"docid": "91e8f31e2818840f05b08ee57a11dd14",
"score": "0.5970994",
"text": "def show \n ammonia=Ammoni.find(params[:id])\n render json:{status: 'SUCCESS', message: 'Loaded Data Ammonia', data:ammonia},status: :ok\n end",
"title": ""
},
{
"docid": "3c46d75819e2e1c53d02843514486e58",
"score": "0.59531265",
"text": "def show\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render json: @aims }\n end\n end",
"title": ""
},
{
"docid": "070d90cb3a51bce4c52fb9c6a93ae1d7",
"score": "0.5942229",
"text": "def index\n @amcs = Amc.all\n end",
"title": ""
},
{
"docid": "4dffb4b1aacd23360a77d6e8594b26be",
"score": "0.5940007",
"text": "def show\n @automaton = Automaton.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @automaton }\n end\n end",
"title": ""
},
{
"docid": "23fd73fb84e417102cd47c8c79a3a07e",
"score": "0.5928812",
"text": "def show\n @automount = Automount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @automount }\n end\n end",
"title": ""
},
{
"docid": "87f6d0582dc369269d0e80b67cfa7812",
"score": "0.59258455",
"text": "def show\n render json: @alarm\n end",
"title": ""
},
{
"docid": "3810d0eb7cfe3140e4a3d0522482d3c2",
"score": "0.59230244",
"text": "def index\n render json: Alarm.all\n end",
"title": ""
},
{
"docid": "f775c48e1b2eb008355bedd4353064de",
"score": "0.5917635",
"text": "def new\n @atm = Atm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @atm }\n end\n end",
"title": ""
},
{
"docid": "4e2b2903e3909d6081e11d3961d3e204",
"score": "0.5914178",
"text": "def show\n @antagonism = Antagonism.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @antagonism }\n end\n end",
"title": ""
},
{
"docid": "c93353d38f508d0ec75df9543e778be7",
"score": "0.5907684",
"text": "def index\r\n @tmts = TmtResult.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @tmts }\r\n end\r\n end",
"title": ""
},
{
"docid": "38f85f02c51226f6a4fc50fe99c07393",
"score": "0.5899189",
"text": "def index\n @moments = Moment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @moments }\n end\n end",
"title": ""
},
{
"docid": "38f85f02c51226f6a4fc50fe99c07393",
"score": "0.5899189",
"text": "def index\n @moments = Moment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @moments }\n end\n end",
"title": ""
},
{
"docid": "43ae02a8dc51cfe454c51711fe35a3ea",
"score": "0.58971334",
"text": "def show\n @thermostat = Thermostat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @thermostat }\n end\n end",
"title": ""
},
{
"docid": "fc4eb128388443c2499593ec387be593",
"score": "0.58915895",
"text": "def index\n @ata = Atum.all\n end",
"title": ""
},
{
"docid": "a4bacfd89f4d2eb18dcb049f8afbcb86",
"score": "0.588571",
"text": "def show\n @apuestum = Apuestum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @apuestum }\n end\n end",
"title": ""
},
{
"docid": "34825c6a9ed09e6572733cbff421ad2a",
"score": "0.5885061",
"text": "def show\n @mactab = Mactab.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mactab }\n end\n end",
"title": ""
},
{
"docid": "08c334be9fbf90ec62e12e264b1137be",
"score": "0.5880627",
"text": "def show\n respond_to do |format|\n format.json { render :json => @activitat.as_json }\n end\n end",
"title": ""
},
{
"docid": "12affb45658dd5ef203da290de947dea",
"score": "0.5870641",
"text": "def index\n @musics = current_api_user.musics.select(:title,:id)\n render json: @musics\n end",
"title": ""
},
{
"docid": "f1f05177d44e429648974ab9df310a9b",
"score": "0.58642644",
"text": "def get_all_appoitments\n\n\t\tid = params[:id]\n\t\t#id = 18\n\t\tresponse = RestClient.get 'https://sdpm-appointment-service.herokuapp.com/appointment', {params: {doctor_id: id}}\n \trender json: response\n\tend",
"title": ""
},
{
"docid": "9b6f4743c05087854fc58803b3f61440",
"score": "0.5859595",
"text": "def show\n @musica = Musica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @musica }\n end\n end",
"title": ""
},
{
"docid": "c1fe4aecc8c6512632d89a3709eb96ca",
"score": "0.58579236",
"text": "def index\n @awon_stations = AwonStation.all\n respond_to do |format|\n format.html\n format.json {render json: @awon_stations}\n end\n end",
"title": ""
},
{
"docid": "3b44a7096489dfa917a3c5911412ac96",
"score": "0.5854646",
"text": "def index\n @masts = Mast.all\n end",
"title": ""
},
{
"docid": "90678d44dee8ada48c4cfb5ab382def2",
"score": "0.5847743",
"text": "def index\n @astronauts = Astronaut.all\n\n render json: @astronauts\n end",
"title": ""
},
{
"docid": "0d1e2c2eeddd773dabf3d39dae33d117",
"score": "0.5843401",
"text": "def show\n @ate = Ate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @ate }\n end\n end",
"title": ""
},
{
"docid": "f01d65d1ec57a176191cbe6bcf5aa13b",
"score": "0.58388954",
"text": "def show\n @mak = Mak.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mak }\n end\n end",
"title": ""
},
{
"docid": "8661b2578dd85891ddb9e743bcd463f1",
"score": "0.58381885",
"text": "def index\n @medicaments = Medicament.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @medicaments }\n end\n end",
"title": ""
},
{
"docid": "a69c13315ef9f6a52fe4a7d444326e47",
"score": "0.5838074",
"text": "def index\n @medicaments = Medicament.all\n\n render json: @medicaments\n end",
"title": ""
},
{
"docid": "60c55bda47dca47af3a1b630cfcb7c2d",
"score": "0.58319986",
"text": "def show\n @amnesty = Amnesty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @amnesty }\n end\n end",
"title": ""
},
{
"docid": "c6354f6f8453387fee7736e92ea95317",
"score": "0.58286226",
"text": "def show\n @spatt = Spatt.find(params[:id])\n\n render json: @spatt\n end",
"title": ""
},
{
"docid": "4f09fa7bc3388c4b49801520dc741e1d",
"score": "0.58272344",
"text": "def index\n @timetable_u = TimetableUnit.where timetable_id:params['timetable_id']\n\n respond_to do |format|\n format.html\n format.json { render :json => @timetable_u }\n end\n end",
"title": ""
},
{
"docid": "d01d44b3f8872dc8a71e26a581e82faf",
"score": "0.58259225",
"text": "def index\n @tacos = Taco.all\n\n render json: @tacos\n end",
"title": ""
},
{
"docid": "f1ed514f6aac9c93a6195fc02415fed3",
"score": "0.58243036",
"text": "def show\n @annonce = Annonce.find(params[:id])\n respond_to do |format|\n format.html\n # format.json { render json: @annonce.as_json(only: [:id]) }\n format.json { render json: @annonce.as_json }\n\n end\n end",
"title": ""
},
{
"docid": "152bfe8b1582692e07ee735a04aa1582",
"score": "0.58148396",
"text": "def index\n @atletas = Atleta.all\n end",
"title": ""
},
{
"docid": "b95717e1030da9aef71ba77412c312fc",
"score": "0.5812319",
"text": "def index\n @acs = Ac.all\n\n render json: @acs\n end",
"title": ""
},
{
"docid": "c4cac41455c52ca8c6840a21e773f4bb",
"score": "0.58091533",
"text": "def show\n render json: @mission, include: :astronauts\n end",
"title": ""
},
{
"docid": "a27b2e8967060c8e85295c762313d526",
"score": "0.5806562",
"text": "def index\n @anime_shows = AnimeShow.order('created_at DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @anime_shows }\n end\n end",
"title": ""
},
{
"docid": "8f770b5198fc303d79dbc926dab78ee2",
"score": "0.5803941",
"text": "def show\n @attraction = Attraction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @attraction }\n end\n end",
"title": ""
},
{
"docid": "55ea4971d4b2e45faee39de19cc51b99",
"score": "0.5777993",
"text": "def show\n @alarm = Alarm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @alarm }\n end\n end",
"title": ""
},
{
"docid": "2303d326f5cc518039c4b6d697be6d5b",
"score": "0.57768697",
"text": "def index\n @ambitos = Ambito.all\n end",
"title": ""
},
{
"docid": "a67fdba262e4bfc54d5ecdb8fe748203",
"score": "0.5774343",
"text": "def show\n @amc = Amc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @amc }\n end\n end",
"title": ""
},
{
"docid": "bee2a492fb89cc3ddf957c2be739d10c",
"score": "0.5773666",
"text": "def show\n @alrt = Alrt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @alrt }\n end\n end",
"title": ""
},
{
"docid": "bee2a492fb89cc3ddf957c2be739d10c",
"score": "0.5773666",
"text": "def show\n @alrt = Alrt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @alrt }\n end\n end",
"title": ""
},
{
"docid": "4a2a29d84695a03a11718ddc21baa35b",
"score": "0.57711494",
"text": "def index\n @title = \"Препараты\"\n @medicaments = Medicament.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @medicaments }\n end\n end",
"title": ""
},
{
"docid": "ad145716f79ae115d2aca5f55147a586",
"score": "0.5769741",
"text": "def show\n @anime_show = AnimeShow.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @anime_show }\n end\n end",
"title": ""
},
{
"docid": "b93c7ca9668de72b88f4ee3e1184ca65",
"score": "0.57696813",
"text": "def index\n @ams = Am.all\n end",
"title": ""
},
{
"docid": "64d2e183d1d6ab6dce7ca33416ed7b6e",
"score": "0.576642",
"text": "def index\n @mosaics = Mosaic.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mosaics }\n end\n end",
"title": ""
},
{
"docid": "44cd4a702641a6ac7f44ddbef3d9c850",
"score": "0.5764772",
"text": "def index\n @maestras = Maestra.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @maestras }\n end\n end",
"title": ""
},
{
"docid": "2c3ef994e58fe3ad4f4cdc23b66df2a9",
"score": "0.5763178",
"text": "def index\n @aimes = Aime.all\n end",
"title": ""
},
{
"docid": "f85778e1b4c092b9cf34b6bde81071c2",
"score": "0.5757686",
"text": "def index\n @ais = Ai.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ais }\n end\n end",
"title": ""
},
{
"docid": "42d7502e7d31b466ca0d131c896a313c",
"score": "0.57565653",
"text": "def show\n @api_wmall_activity = Wmall::Activity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @api_wmall_activity }\n end\n end",
"title": ""
},
{
"docid": "bba79b4cb020503dc0ed4a449b19dd77",
"score": "0.574666",
"text": "def index\n @talismans = Talisman.where(\"user_id = ?\", current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @talismans }\n end\n end",
"title": ""
},
{
"docid": "be3552e9de22fe24ffb723cc25ff5b55",
"score": "0.57401687",
"text": "def show\n @moretinymobbattle = Moretinymobbattle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @moretinymobbattle }\n end\n end",
"title": ""
},
{
"docid": "01bff7a16ca299ae6f33b0f8685a554c",
"score": "0.5733142",
"text": "def index\n @am_configurations = AmConfiguration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @am_configurations }\n end\n end",
"title": ""
},
{
"docid": "d324efb70e2476ae6c3276c894b4e713",
"score": "0.5729549",
"text": "def index\n @tattoos = Tattoo.order('created_at DESC')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tattoos }\n end\n end",
"title": ""
},
{
"docid": "3b6b206ddf625dc0fa3391e508cfa483",
"score": "0.5723441",
"text": "def index\n # if current_user.user_role_id == 1\n @atms = Atm.filtering(filter_atm).paginate(:per_page => 5, :page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @atms }\n end\n # else\n # redirect_to home_path, alert: \"Tidak bisa mengakses halaman ini.\"\n # flash.now[:alert] = \"Tidak bisa mengakses halaman ini.\"\n # end\n end",
"title": ""
},
{
"docid": "8b30a3767d1ae2e412e0adeacded4efc",
"score": "0.57195276",
"text": "def index\n @assuntos = Assunto.all\n\n render json: @assuntos\n end",
"title": ""
},
{
"docid": "f9f6d397bb75cce47812be9792fe4dbc",
"score": "0.5719117",
"text": "def show\n @metadatum = Metadatum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @metadatum }\n end\n end",
"title": ""
},
{
"docid": "6febdf384c08fe481048d32c10b025ee",
"score": "0.5713164",
"text": "def show\n @ambulance = Ambulance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ambulance }\n end\n end",
"title": ""
},
{
"docid": "ee538a3614ee5c7fd46c7923a03cc724",
"score": "0.57018656",
"text": "def get(url)\n response = open(url, 'Accept' => 'application/activity+json').read\n JSON.parse(response, symbolize_names: true)\n end",
"title": ""
},
{
"docid": "65b94c8a12bb5413bc39381089ab5af7",
"score": "0.5698978",
"text": "def index\n @alarms = Alarm.all\n render json: @alarms.to_json\n end",
"title": ""
},
{
"docid": "fdd46b75894ef1c67a91a95d929242cb",
"score": "0.56949663",
"text": "def index\n @goats = Goat.all\n\n render json: @goats\n end",
"title": ""
},
{
"docid": "cc84328f406a9552431d8fe0ce59253e",
"score": "0.5694203",
"text": "def show\n @atr_hst = AtrHst.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @atr_hst }\n end\n end",
"title": ""
},
{
"docid": "af714c504c64a1990805ce64a11785af",
"score": "0.5690163",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ai }\n end\n end",
"title": ""
},
{
"docid": "59c658b8e7498ce2974e6ad3572e0d2f",
"score": "0.5689714",
"text": "def index\n @atm_machines = AtmMachine.all\n end",
"title": ""
},
{
"docid": "a32f9d2a0ce1576676ccb0437a534369",
"score": "0.56847376",
"text": "def show\n @goat = Goat.find(params[:id])\n\n render json: @goat\n end",
"title": ""
},
{
"docid": "06053bc2714773c1bed0e98b4c9ff1a2",
"score": "0.5677471",
"text": "def index\n @response = JSON.parse(current_user.access_token.token.get('/api/v0/aspects'))\n @activities = @response\n respond_to do |format|\n format.html\n format.json {render json: @response}\n end\n end",
"title": ""
},
{
"docid": "9e675ca141f2c4ed86fa7244b2b19ccc",
"score": "0.56746703",
"text": "def show\n @moresmalltrialstatus = Moresmalltrialstatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @moresmalltrialstatus }\n end\n end",
"title": ""
},
{
"docid": "530f434e5a0f1e4222a4de5fe4e48325",
"score": "0.56716204",
"text": "def accl_data\n @response = HTTParty.get(\"http://192.168.20.30/machine/data\")\n render json: @response\n end",
"title": ""
},
{
"docid": "aa02ac5658326ac5abba6f06f360d780",
"score": "0.5668906",
"text": "def show\n @schmatta = Schmatta.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schmatta }\n end\n end",
"title": ""
},
{
"docid": "7a2d0d842cdb5d8b2564f9affd2469bc",
"score": "0.5666772",
"text": "def show\n @temporal_management = TemporalManagement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @temporal_management }\n end\n end",
"title": ""
},
{
"docid": "d9857547492795539f75f1a8c712c41e",
"score": "0.56666034",
"text": "def index\n @atm_machines = AtmMachine.all\n end",
"title": ""
},
{
"docid": "86017e5a2621eeaed208cf5adc3fcea3",
"score": "0.5665269",
"text": "def show\r\n @tmt = TmtResult.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @tmt }\r\n end\r\n end",
"title": ""
},
{
"docid": "4aeecc8dad109ffc3816ccece393d660",
"score": "0.5664791",
"text": "def index\n @mars = Mar.all\n render json: @mars\n end",
"title": ""
},
{
"docid": "ddeada895c33ee8d984bf4548f142870",
"score": "0.56630087",
"text": "def index\n @activities = Activity.all\n render json: @activities\n end",
"title": ""
},
{
"docid": "f25640a48176e269392fb4196a8c32ed",
"score": "0.56610656",
"text": "def index\n screen_name(\"Admin-Indice-OTs\")\n @ots = Ot.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ots }\n end\n end",
"title": ""
},
{
"docid": "7ecdd5960879b6a7266eecebea40819b",
"score": "0.5659371",
"text": "def index\n @iacs = Iac.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @iacs }\n end\n end",
"title": ""
},
{
"docid": "fbc0e92149ffde482cac2cf0625d291f",
"score": "0.5647514",
"text": "def show\n @ankenstatus = Ankenstatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ankenstatus }\n end\n end",
"title": ""
},
{
"docid": "957c14feae8627e2e6307790ad9939a4",
"score": "0.5645885",
"text": "def show\n @mcr_atr = McrAtr.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mcr_atr }\n end\n end",
"title": ""
},
{
"docid": "7e93b332cdabcfad7bf44e3458f45a5f",
"score": "0.56451976",
"text": "def index\n @anketa = Anketum.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @anketa }\n end\n end",
"title": ""
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.