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 |
|---|---|---|---|---|---|---|
Returns the parent of the given node
|
def parent_of node
return is_valid(node) ? node.parent : nil
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def parent_node(node)\n return node.respond_to?(:parent) ? node.parent : node\n end",
"def parent_node(node)\n node.find(:xpath, '..', wait: 0, visible: false)\n end",
"def parent(node)\n parent = adjacent(node, :direction => :in)\n raise JumokuError, \"Inconsistent directed tree (more than one parent for the node!)\" if parent.size > 1\n parent.empty? ? nil : parent.first\n end",
"def parent(node)\n value = node.value\n parent_node = nil\n current_node = @root\n while (current_node)\n if value > current_node.value\n parent_node = current_node #always keep a pointer to the parent\n #before traversing down\n current_node = current_node.right\n elsif value < current_node.value\n parent_node = current_node\n current_node = current_node.left\n else\n return parent_node\n end\n end\n nil\n end",
"def parent\n unless @node.send(@parent).nil?\n @node = @node.send(@parent)\n end\n end",
"def parent\n\t\treturn parent_of @current_node\n\tend",
"def parent(node_id)\n node_id >> 1 # node_id / 2\n end",
"def parent(of_node, level = 1)\n ancestor = of_node\n until level.zero?\n ancestor = ancestor.parent\n level -= 1\n end\n return ancestor\n end",
"def parent\n tree.parent_for(parent_id).first\n end",
"def parent(node, root = nil)\n root ||= @root\n raise IndexError, 'can not get parent for unrooted tree' unless root\n unless ret = _get_cached_parent(node, root) then\n ret = self.path(root, node)[-2]\n _cache_parent(node, ret, root)\n end\n ret\n end",
"def parent\n\n h.parent_id ?\n Ruote::Exp::FlowExpression.fetch(@context, h.parent_id) :\n nil\n end",
"def get_parent\n return nil\n end",
"def parentNode\n nil\n end",
"def find_parent_node\n @parent_node ||= Node.find(params[:parent_node_id]) if params[:parent_node_id]\n end",
"def parent\n self.node && self.node.parent && self.node.parent.content\n end",
"def parent\n if parent_id.blank? then nil else unscoped_find(parent_id) end\n end",
"def parent\n parents.empty? ? nil : parents[0]\n end",
"def parent\n return nil unless catalog\n\n unless defined?(@parent)\n if parents = catalog.adjacent(self, :direction => :in)\n # We should never have more than one parent, so let's just ignore\n # it if we happen to.\n @parent = parents.shift\n else\n @parent = nil\n end\n end\n @parent\n end",
"def parent_of(post)\n posts.find { |t| t.id == post.parent_post }\n end",
"def parent(path)\n return nil if (path.strip.empty?) or (path == '/')\n p_path = File.dirname(path)\n nodes = lookup(p_path, nil, false, false, true)\n pair = nodes.select{ |p| p[0] == :document }.first\n pair ||= nodes.first\n pair.last\n end",
"def find_parent(key, node = root)\n return nil if node.nil?\n key = find(key) if !key.is_a? Node\n if node.left == key || node.right == key\n return node\n else\n find_parent(key, left_right(key.data, node))\n end\n end",
"def parent\n @parent ||= new_or_create? ? find_parent_by_id : lookup_parent_from_child\n end",
"def get_parent_tagname\n self.parent_tagname.present? ? self.parent_tagname : nil\n end",
"def get_parent_tagname\n self.parent_tagname.present? ? self.parent_tagname : nil\n end",
"def parent_id\n\n h.parent_id ?\n Ruote::FlowExpressionId.new(h.parent_id) :\n nil\n end",
"def get_pointer_from_parent(tree_node)\n parent = tree_node.parent\n return nil unless parent\n pointer = tree_node.value > parent.value ? :@right : :@left\n end",
"def get_parent\n note = self\n return Note.first(:id=>note.parent)\n end",
"def ultimate_parent # note: ultimate parent is self, not nil, if self has no parent...\n if parent_id.blank?\n self\n else\n parent.ultimate_parent\n end\n end",
"def the_parent(content=nil)\n if node = content || @content || Content.get(params[:id])\n node.parent\n else\n \"<strong>Error:</strong> No parent information could be found\" unless ENV['RACK_ENV'] == 'production'\n end\n end",
"def parent\n ltree_scope.find_by \"#{self.class.table_name}.#{ltree_path_column} = SUBPATH(?, 0, NLEVEL(?) - 1)\", ltree_path,\n ltree_path\n end",
"def parent\n self.class.find_by_id(self.parent_id) unless self.parent_id.nil?\n end",
"def parent\n nil\n end",
"def parent\n return @links[:parent]\n end",
"def node\r\n\t\t\tparent\r\n\t\tend",
"def find_element_parent(el_depth, index, ordering)\n\t\ti = index - 1\n\t\twhile i >= 0 #until the beginning\n\t\t\tif ordering[i].model == \"Node\" #if it's a node, not just a note\n\t\t\t\tcurr_node = Node.find(ordering[i].id)\n\t\t\t\tif el_depth > curr_node.depth #if curr_node has a lesser depth, it's its parent\n\t\t\t\t\treturn curr_node\n\t\t\t\tend\n\t\t\tend\n\t\t\ti = i-1\n\t\tend\n\t\treturn nil #if no parent found\n\tend",
"def node_heading_parent(node, level = 'h7')\n # If initially called on a heading, we only accept stronger headings\n level = node.name if level == 'h7' && node_heading?(node)\n\n previous = node.previous_element\n\n # No previous element, we go up to the parent\n unless previous\n parent = node.parent\n # No more parent, then no heading found\n return nil if parent.name == 'body'\n return node_heading_parent(parent, level)\n end\n\n # This is a heading, we return it\n return previous if node_heading?(previous) && previous.name < level\n\n node_heading_parent(previous, level)\n end",
"def tree_parent_node\n tree_parent + \".adoc\"\n end",
"def parent\n return @parent unless @parent.nil?\n return Message.find(parent_id) unless parent_id.nil?\n end",
"def parent\n if self.rep_parent.nil?\n if self.parent_id.nil?\n return nil\n else\n return Activity.find(self.parent_id)\n end\n\n else\n return self.rep_parent.parent\n end\n end",
"def find_parent_node(value, parent = @root)\n return parent if parent.children.map {|n| n.value }.include?(value)\n\n if value <= parent.value\n return parent.left.nil? ?\n nil :\n find_parent_node(value, parent.left)\n else\n return parent.right.nil? ?\n nil :\n find_parent_node(value, parent.right)\n end\n end",
"def parent(node_index)\n return -1 if (node_index < 0) || (node_index > @count)\n return (node_index - 1)/2\n end",
"def parent\n return @parent\n end",
"def get_parent\n\n get_expression_pool.fetch_expression(@parent_id)\n end",
"def fetch_parent(stack, node)\n stack_2 = []\n while !stack.empty?\n potential_parent = stack.pop\n potential_structure_marker = potential_parent.structure_marker.to_s.strip\n if is_parent?(potential_structure_marker, node.indentation, potential_parent.indentation)\n parent = potential_parent\n stack_2.push(parent)\n while !stack_2.empty?\n elem = stack_2.pop\n stack.push(elem)\n end\n return parent\n else\n stack_2.push(potential_parent)\n end\n end\n end",
"def fetch_parent(stack, node)\n stack_2 = []\n while !stack.empty?\n potential_parent = stack.pop\n potential_structure_marker = potential_parent.structure_marker.to_s.strip\n if is_parent?(potential_structure_marker, node.indentation, potential_parent.indentation)\n parent = potential_parent\n stack_2.push(parent)\n while !stack_2.empty?\n elem = stack_2.pop\n stack.push(elem)\n end\n return parent\n else\n stack_2.push(potential_parent)\n end\n end\n end",
"def parent\n \tif self.parent_id == -1\n \t\treturn nil\n \telse\n \t\treturn Category.find(self.parent_id)\n \tend\n end",
"def parent\n\t\tpardn = self.parent_dn or return nil\n\t\treturn self.class.new( self.directory, pardn )\n\tend",
"def find_parent(current_node, key)\n return nil if current_node.nil?\n\n if current_node.left && (current_node.left.key == key) || current_node.right && (current_node.right.key == key)\n return current_node\n end\n\n if key < current_node.key\n current_node = find_parent(current_node.left, key)\n else\n current_node = find_parent(current_node.right, key)\n end\n end",
"def previous_node\n peer = nil\n if !parent.nil? and parent.respond_to?(:children)\n index = parent.children.index(self)\n peer = index > 0 ? parent.children[index - 1] : nil\n end\n peer\n end",
"def parent=(parent_node); end",
"def parent=(parent_node); end",
"def get_parent(path)\n parent = @root\n path[1..path.length-1].each do |path_item|\n if parent.child_exists?(path_item)\n parent = parent.get_child(path_item)\n end\n end\n\n return parent\n end",
"def parent\n if @resource[:parent] =~ /^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$/\n gindex = $ngs.index { |i| i['id'] == @resource[:parent] }\n $ngs[gindex]['id']\n else\n @property_hash[:parent]\n end\n end",
"def parent\n @parent\n end",
"def parent\n @parent\n end",
"def parent\n @parent\n end",
"def parent\n @parent\n end",
"def find_min_node(node, parent = nil)\n #require 'pry'\n #binding.pry\n if node.left.nil?\n return node, parent\n else\n find_min_node(node.left, node)\n end\n end",
"def parent\n nil\n end",
"def parent_for_new(tree_node, value)\n return tree_node if !tree_node.left && value < tree_node.value\n return tree_node if !tree_node.right && value > tree_node.value\n\n if value > tree_node.value\n return parent_for_new(tree_node.right, value)\n else\n return parent_for_new(tree_node.left, value)\n end\n end",
"def TreeView_GetParent(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TreeViewGetNextItem[:PARENT]) end",
"def parent_rel(*args)\n rels = parent_rels(*args).take(2)\n raise _(\"Multiple parents found.\") if rels.length > 1\n rels.first\n end",
"def tree_parent\n return @tree_parent if @tree_parent\n @tree_parent = File.dirname tree\n @tree_parent = '' if @tree_parent == '.'\n tree_parent\n end",
"def parent\n ancestors.last\n end",
"def find_parent(person)\n cohort = traverse(person)\n raise Family::Tree::PersonNotFoundError if cohort.nil?\n\n cohort&.\n generation&.\n find { |elem| elem&.name == person }&.\n parent\n end",
"def parent\n @parent ||= Object.module_eval(self.source_xml.parent.name).new(:source_xml => self.source_xml.parent)\n rescue\n nil\n end",
"def parent\n _parent\n end",
"def parent\n parent_path = @path.cotta_parent\n return nil unless parent_path\n candidate = CottaDir.new(factory, parent_path)\n if (block_given?)\n candidate = candidate.parent until candidate.nil? or yield candidate\n end\n candidate\n end",
"def parent\n @parent ||= begin\n parent_id = data[\"parentId\"]\n client.categories.find(parent_id) if parent_id\n end\n end",
"def parent parent\n @menu.parent parent\n end",
"def parent\n return @parent if defined?(@parent)\n\n @parent = nil\n\n @parent = issue.parent if issue\n end",
"def get_parent(generation_level)\n return self if root? || generation_level <= 0\n parent.get_parent(generation_level-1)\n end",
"def _get_cached_parent(node, root)\n @cache_parent[root] ||= Hash.new\n cache = @cache_parent[root]\n if node == root then\n unless cache.has_key?(root) then\n self.adjacent_nodes(root).each do |n|\n cache[n] ||= root if n != root\n end\n cache[root] = nil\n end\n parent = nil\n else\n unless parent = cache[node] then\n parent = self.adjacent_nodes(node).find { |n|\n (m = cache[n]) && (m != node)\n }\n _cache_parent(node, parent, root) if parent\n end\n parent\n end\n end",
"def parent_id\n data[:parent_id]\n end",
"def parent_notebook\n return @parent_notebook\n end",
"def parent_notebook\n return @parent_notebook\n end",
"def parent_notebook\n return @parent_notebook\n end",
"def parent(*args)\n return call_ancestry_method(:parent) if use_ancestry?\n\n rels = parent_rels(*args).take(2)\n raise _(\"Multiple parents found.\") if rels.length > 1\n rels.first.try(:resource)\n end",
"def parent\n @parent\n end",
"def parent\n @parent\n end",
"def parent\n self.parents.where('forestify_level = ?', self.forestify_level - 1).first\n end",
"def parent_id\n object[\"parent_id\"]\n end",
"def parent_document\n pi = parent_item\n return if pi == nil\n pi_id = pi.id\n return if pi_id == nil\n DocumentRepository.find(pi_id)\n end",
"def parent\n @parent ||= @parent_id ? @book.find_account_by_id(@parent_id) : nil\n end",
"def parent\n has_parent? and history.first\n end",
"def parent\n o = Object.const_get(parent_model) rescue nil\n o && o.get(parent_id)\n end",
"def parent_name\n parent_info && parent_info.name\n end",
"def find_parent_comment_id\n comment = Comment.find_by_id(self.likeable_id)\n comment.parent_comment_id\n end",
"def parent_relative_left\n left - (parent.try(:left) || 0)\n end",
"def findParent(root, data, parent=true)\n if root.title == data\n # base case, data matches\n return parent\n else\n if root.left\n left = findParent(root.left, data, root)\n end\n if root.right\n right = findParent(root.right, data, root)\n end\n if left\n return left\n elsif right\n return right\n else\n # no match found toward the left or the right\n return nil\n end\n end\n end",
"def parent_cell(child_cell)\n if @cells_visited.empty?\n return nil\n else\n @cells_visited.select { |cell| child_cell.connected_cells.include?(cell.cell) }.first\n end\n end",
"def predecessor\n siblings.previous(self) || parent\n end",
"def parent_id(*args)\n return call_ancestry_method(:parent_id) if use_ancestry?\n\n rels = parent_ids(*args).take(2)\n raise _(\"Multiple parents found.\") if rels.length > 1\n rels.first\n end",
"def parent\n @parent ||= resource.decorate.parent\n end",
"def parent\n return nil if @path == '/'\n unless @path.to_s.empty?\n new_for_path ::File.split(@path).first\n end\n end",
"def parent_tag\n return nil unless within_open_tag?\n\n @tags_list.last\n end",
"def find_parent_by\n self.class.find_parent_by || :id\n end",
"def container_parent\n parent_id = data.at_xpath(\"/c/did/container/@parent\")\n return unless parent_id\n parent = data.at_xpath(\"//c[@id='#{parent_id}']/did/container\")\n \"#{parent.attribute('type').value.capitalize} #{parent.content}\"\n end",
"def polymorph_parent(parent=nil)\n\t\t@parent ||= parent\n\t\treturn @parent\n\tend",
"def parent\n unless @parent\n @parent = search(:base => dn.parent, :scope => :base, :limit => true)\n @parent.instance_variable_get(:@children)[rdn] = self\n end\n @parent\n end"
] |
[
"0.87993264",
"0.82078636",
"0.8191509",
"0.80812955",
"0.804595",
"0.7976806",
"0.7803221",
"0.775602",
"0.7676837",
"0.7553943",
"0.7402786",
"0.7358889",
"0.73332936",
"0.7318839",
"0.73108757",
"0.71889436",
"0.7099725",
"0.70975626",
"0.69850814",
"0.6962282",
"0.6937197",
"0.69321847",
"0.6926336",
"0.6926336",
"0.69259053",
"0.6870048",
"0.685179",
"0.6831586",
"0.6795703",
"0.6781836",
"0.6760105",
"0.67578316",
"0.6751881",
"0.6738779",
"0.6738441",
"0.6726883",
"0.6721934",
"0.67208606",
"0.670344",
"0.6686517",
"0.66813046",
"0.66787493",
"0.66700137",
"0.6666308",
"0.6666308",
"0.66655844",
"0.66250837",
"0.6614509",
"0.66125846",
"0.6599701",
"0.6599701",
"0.65993434",
"0.6583294",
"0.65676355",
"0.65676355",
"0.65676355",
"0.65676355",
"0.6556559",
"0.65484875",
"0.65341794",
"0.6507738",
"0.65075773",
"0.6505321",
"0.6483333",
"0.64794207",
"0.64655954",
"0.64530104",
"0.64485157",
"0.6437326",
"0.64373004",
"0.6434338",
"0.64274997",
"0.6423302",
"0.6420626",
"0.64041436",
"0.64041436",
"0.64041436",
"0.6401398",
"0.63957965",
"0.63957965",
"0.63931024",
"0.63693595",
"0.6363482",
"0.6358431",
"0.6357408",
"0.6356155",
"0.6344239",
"0.63319194",
"0.6331733",
"0.63301057",
"0.6309223",
"0.6297951",
"0.6295691",
"0.6295466",
"0.6285882",
"0.6285261",
"0.62806714",
"0.62377214",
"0.6236438",
"0.6235616"
] |
0.85704195
|
1
|
Returns the previous element of the current node
|
def prev_element
return prev_element_of @current_node
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_prev()\n return @prev_node\n end",
"def prev_element_of(node)\n\t\treturn valid(node) ? node.previous_element : nil\n\tend",
"def previous\n DOM::Element.from_node `#{@el}.previousElementSibling || Opal.nil`\n end",
"def prev_sibling\n\t\treturn prev_sibling_of @current_node\n\tend",
"def previous_element; end",
"def previous_element_sibling\n n = self.previous_sibling\n while n do\n if n.node_type == ELEMENT_NODE then\n break\n end\n n = n.previous_sibling\n end\n return n\n end",
"def previous\n at(position - 1)\n end",
"def prev_sibling_of(node)\n\t\treturn valid(node) ? node.previous_sibling : nil\n\tend",
"def prev\n prev? ? @current - 1 : nil\n end",
"def previous_node\n peer = nil\n if !parent.nil? and parent.respond_to?(:children)\n index = parent.children.index(self)\n peer = index > 0 ? parent.children[index - 1] : nil\n end\n peer\n end",
"def get_prev()\n\t\t\treturn @prev\n\t\tend",
"def previous_node\n return nil if @traversal_position.previousNode.nil?\n Neo4j.load(@traversal_position.previousNode.getId)\n end",
"def previous_sibling\n return nil if parent.nil? # self is root\n return nil if 1 == parent.children.size # self is parent's only child\n if 0 == own_child_index\n return nil # self is first child\n else\n # return previous sibling\n parent.children[own_child_index - 1]\n end\n end",
"def previous(node)\n priors(node).last\n end",
"def previous_sibling\n return @links[:previous_sibling]\n end",
"def previous\n self.offset(-1)\n end",
"def previous\n\t first? ? nil : locate - 1\n\tend",
"def previous\n tokens[@current - 1]\n end",
"def prev(current)\n l = current\n l = l[0,1] if (l.length > 0 and l[0,1] == '\\n')\n l = l[-1,1] if (l.length > 0 and l[-1,1] == '\\n')\n if (@position > 0)\n if (@position == (@history.length - 1))\n @history[@history.length - 1] = l\n end\n @position = @position - 1\n return @history[@position]\n end\n return current\n end",
"def prev(object)\n return nil if elements.index(object) == 0\n elements[elements.index(object) - 1]\n end",
"def prev\n unless self.tll_prev.nil?\n return self.class.unscoped.where(_id: self.tll_prev).first\n end\n\n nil\n end",
"def previous\n first? ? nil : @collection[index - 1]\n end",
"def prev(name = nil)\n previous_or_next('<', name)\n end",
"def previous_segment\n return nil if sibling_segments.empty?\n index = sibling_segments.sort_by(&:index).index(self)\n if index && index >= 1\n sibling_segments[index - 1]\n else\n nil\n end\n end",
"def prev(name = nil)\n elements = self.class.all_siblings(self)\n elements = elements.where(:name => name) if name\n elements.where(\"position < ?\", self.position).order(\"position ASC\").limit(1)\n end",
"def previous\n @tokens.at(@current - 1)\n end",
"def prev\n\t\t@prev\n\tend",
"def previous_item\n index = self.simple_acts_as_list_scope.index(self)\n index == 0 ? nil : self.simple_acts_as_list_scope[index - 1]\n end",
"def prev\n\t\tself - 1\n\tend",
"def get_previous_node(item)\n raise ArgumentError, 'Previous node does not exist' if @length < 2\n\n previous_node = @front_node\n\n until previous_node.next_node.nil? || previous_node.next_node.item == item\n previous_node = previous_node.next_node\n end\n\n unless previous_node.next_node.item == item\n raise ArgumentError, 'Item is not present'\n end\n\n previous_node\n end",
"def prev\n @prev ||= node_cache.fetch(prev_uri) if prev_uri\n end",
"def previous\n @pointer -= 1\n end",
"def previous\n master_files_sorted = self.sorted_set\n if master_files_sorted.find_index(self) > 0\n return master_files_sorted[master_files_sorted.find_index(self)-1]\n else\n return nil\n end\n end",
"def prev_item\n @current -= 1 if @current > 0\n\n items\n end",
"def previous\n return nil if self.position == self.sentence.segments.count - 1\n self.sentence.segments[self.position+1]\n end",
"def previous\n validates_possibility_of :previous\n self.index -= 1\n self.current\n end",
"def previous\n master_files_sorted = self.sorted_set\n if master_files_sorted.find_index(self) > 0\n return master_files_sorted[master_files_sorted.find_index(self)-1]\n else\n return nil\n end\n end",
"def predecessor\n siblings.previous(self) || parent\n end",
"def prev\n @history_idx += 1 if @history_idx < @history.length - 1\n current\n end",
"def previous\n before.ascending.last\n end",
"def previous\n layout.rows[number-1] unless first?\n end",
"def previous\n return nil unless fund_item && previous_perspective\n fund_item.fund_editions.previous_to( self )\n end",
"def prev\n post_comments = self.post.comments #in order of id\n index = post_comments.index(self)\n new_index = index - 1\n if new_index < 0\n return nil\n else\n return post_comments[new_index]\n end\n end",
"def add_previous_sibling_and_get(node, html)\n\t\tresult = node.add_previous_sibling(make_node(html, node.document))\n\t\tresult = result[0] if result.is_a?(Array)\n\t\treturn result\n\tend",
"def previous(query)\n unless query.nil?\n index = query.find_index(self.id)\n if index\n prev_id = query[index-1] unless index.zero?\n self.class.find_by_id(prev_id)\n end\n end\n end",
"def previous\n end",
"def previous\n end",
"def prev\n perform_get(links.prev, self.class)\n end",
"def previous=(node_or_tags); end",
"def prev(element_id)\n prev(element_id, from: target)\n end",
"def previous\n if (r = @lastresult[\"queries\"][\"previousPage\"])\n return search_by_query_hash(r.first)\n else\n return nil\n end\n end",
"def TreeView_GetPrevSibling(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TreeViewGetNextItem[:PREVIOUS]) end",
"def prev\n\t\t\t\t@index -= 1\n\t\t\t\tself._update\n\t\t\t\tself\n\t\t\tend",
"def previous_sibling\n if siblings.where(project_id: project_id).any?\n sibs = self_and_siblings.order(:cached).pluck(:id)\n\n s = sibs.index(id)\n TaxonName.find(sibs[s - 1]) if s != 0\n else\n nil\n end\n end",
"def previous\n Expression.where('id < ? AND collection_id = ?', self.id, self.collection_id).order('id DESC').limit(1).first\n end",
"def previous\n connection.write(\"prev\")\n end",
"def prev node_or_key\n key = String.new\n case node_or_key\n when Node\n key = node_or_key.key\n when String\n key = node_or_key\n else\n p \"only accept String or Node type\"\n end\n\n prev = node = @head\n while node.next_ != nil && node.key != key\n prev = node\n node = node.next_\n end\n prev == node ? nil : prev\n end",
"def get_Previous()\n \t return @outputs[\"Previous\"]\n \tend",
"def get_Previous()\n \t return @outputs[\"Previous\"]\n \tend",
"def get_Previous()\n \t return @outputs[\"Previous\"]\n \tend",
"def get_Previous()\n \t return @outputs[\"Previous\"]\n \tend",
"def get_Previous()\n \t return @outputs[\"Previous\"]\n \tend",
"def previous\n\t\t@result = nil\n\t\t@skip = (@skip || 0) - get_resultcount\n\t\t@skip = [0, @skip].max\n\t\treturn self\n\tend",
"def previous(n=1)\n self - n\n end",
"def set_prev(node)\n\t\t\t@prev = node\n\t\tend",
"def set_prev(node)\n @prev_node = node\n end",
"def previous\n self.new_record? ? nil : Slide.where(:lesson_id => self.lesson_id, :position => (self.position - 1)).first\n end",
"def prev(name = nil)\n elements = page.elements.published.where(Element.arel_table[:position].lt(position))\n elements = elements.named(name) if name.present?\n elements.reorder(\"position DESC\").limit(1).first\n end",
"def prev_note\n Note.new(self).prev.to_s\n end",
"def previous_history()\r\n @history_offset!=0 ? @the_history[@history_offset-=1] : nil\r\n end",
"def prev_address\n list_entry[:prev]\n end",
"def previous_rank()\n return PREVIOUS_RANK[self]\n end",
"def find_previous(xml, leaf_name, order)\n order.reduce(nil) do |res, curr_name|\n break res if curr_name == leaf_name\n xml.at(curr_name.include?(':') ? \"./#{curr_name}\" : \"./xmlns:#{curr_name}\") || res\n end\n end",
"def prev_id\n self[:prev_id]\n end",
"def prev\n if self[:prev_id]\n Likewise::Link.find_by_id self[:prev_id]\n end\n end",
"def get_prev_block\n @store.get_block(@prev_block.reverse_hth)\n end",
"def previous\n return @page - 1\n end",
"def prev\n\t\tTask.order(:position).where(\"position < ?\", position).last\n\tend",
"def fragment_previous(fragment)\n\t\t\t\tidx = @fragments.index(fragment)\n\t\t\t\tidx.zero? ? nil : @fragments.at(idx-1)\n\t\t\tend",
"def distance_to_previous\n @attrs['DistanceToPrev']\n end",
"def previous_sibling(num = 1, scope = {})\n scope[:limit] = num\n siblings = previous_siblings(scope)\n num == 1 ? siblings.first : siblings\n end",
"def previous_page\n @current_page > 1 ? (@current_page - 1) : nil\n end",
"def previous_item(column=nil)\n column = column || default_orderable_column\n orderable_scoped(column).where(orderable_column(column) => send(column) - 1).first\n end",
"def previous_node_name(node)\n previous_node = node.previous_sibling\n while !previous_node.nil?\n break if previous_node.element?\n\n previous_node = previous_node.previous_sibling\n end\n\n previous_node&.name&.downcase if previous_node&.element?\n end",
"def previous_offset\n @previous_offset ||= if after\n offset_from_cursor(after)\n elsif before\n offset_from_cursor(before) - (last ? last : 0) - 1\n else\n 0\n end\n end",
"def prev_page\n current_page > 1 ? (current_page - 1) : nil\n end",
"def find_prev(*args)\n find(:prev, *args)\n end",
"def find_prev(*args)\n find(:prev, *args)\n end",
"def previous\n raise NameError, \"Already at the start of the series\" if start?\n @count -= 1\n self\n end",
"def prev\n fil_header[:prev]\n end",
"def prev\n connection.write(\"prev\")\n end",
"def previous_page\n current_page > 1 ? (current_page - 1) : nil\n end",
"def previous_page\n current_page > 1 ? (current_page - 1) : nil\n end",
"def previous_page\n current_page > 1 ? (current_page - 1) : nil\n end",
"def previous\n ptr = C.LLVMGetPreviousInstruction(self)\n LLVM::Instruction.from_ptr(ptr) unless ptr.null?\n end",
"def intend_previous\n intend_with :last, :previous\n end",
"def intend_previous\n intend_with :last, :previous\n end",
"def previous_page\n current_page > 1 ? (current_page - 1) : nil\n end",
"def previous_page\n current_page > 1 ? (current_page - 1) : nil\n end",
"def previous_cursor\n @result[:previous_cursor]\n end"
] |
[
"0.89247125",
"0.86669534",
"0.86544216",
"0.84210217",
"0.83924085",
"0.83458596",
"0.8042985",
"0.7991289",
"0.79548264",
"0.79286736",
"0.79207647",
"0.7859692",
"0.7843736",
"0.78401285",
"0.777309",
"0.77520114",
"0.773126",
"0.7729394",
"0.76284647",
"0.7594287",
"0.7536843",
"0.7530397",
"0.75272804",
"0.7514002",
"0.7513469",
"0.75118166",
"0.7456615",
"0.7454189",
"0.7453687",
"0.7443911",
"0.7440979",
"0.7275483",
"0.7262994",
"0.72325116",
"0.7231601",
"0.72045314",
"0.71814716",
"0.7168945",
"0.7162833",
"0.7130077",
"0.7111134",
"0.7089642",
"0.7040227",
"0.7037215",
"0.7029007",
"0.70171195",
"0.70171195",
"0.6963149",
"0.6952",
"0.6939926",
"0.69363624",
"0.69317716",
"0.6920803",
"0.68999",
"0.6882982",
"0.68758446",
"0.68604624",
"0.6843038",
"0.6843038",
"0.6843038",
"0.6843038",
"0.6843038",
"0.6827292",
"0.6822501",
"0.6820238",
"0.6819731",
"0.68065965",
"0.6802097",
"0.67958933",
"0.67937326",
"0.67755514",
"0.6766799",
"0.6761884",
"0.6751975",
"0.67469704",
"0.6745535",
"0.67408246",
"0.67343104",
"0.6733001",
"0.66760695",
"0.66744065",
"0.66727805",
"0.6668188",
"0.6666717",
"0.6658265",
"0.6654965",
"0.66535854",
"0.66535854",
"0.6623105",
"0.66188776",
"0.6607056",
"0.6601879",
"0.6601594",
"0.6601594",
"0.6597235",
"0.65962493",
"0.65962493",
"0.6591231",
"0.6591231",
"0.65878636"
] |
0.91436607
|
0
|
Returns the previous element of the given node
|
def prev_element_of(node)
return valid(node) ? node.previous_element : nil
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_prev()\n return @prev_node\n end",
"def prev_element\n\t\treturn prev_element_of @current_node\n\tend",
"def previous\n DOM::Element.from_node `#{@el}.previousElementSibling || Opal.nil`\n end",
"def prev_sibling_of(node)\n\t\treturn valid(node) ? node.previous_sibling : nil\n\tend",
"def previous_element_sibling\n n = self.previous_sibling\n while n do\n if n.node_type == ELEMENT_NODE then\n break\n end\n n = n.previous_sibling\n end\n return n\n end",
"def previous_element; end",
"def previous(node)\n priors(node).last\n end",
"def prev_sibling\n\t\treturn prev_sibling_of @current_node\n\tend",
"def previous_node\n return nil if @traversal_position.previousNode.nil?\n Neo4j.load(@traversal_position.previousNode.getId)\n end",
"def previous_node\n peer = nil\n if !parent.nil? and parent.respond_to?(:children)\n index = parent.children.index(self)\n peer = index > 0 ? parent.children[index - 1] : nil\n end\n peer\n end",
"def get_previous_node(item)\n raise ArgumentError, 'Previous node does not exist' if @length < 2\n\n previous_node = @front_node\n\n until previous_node.next_node.nil? || previous_node.next_node.item == item\n previous_node = previous_node.next_node\n end\n\n unless previous_node.next_node.item == item\n raise ArgumentError, 'Item is not present'\n end\n\n previous_node\n end",
"def previous_sibling\n return nil if parent.nil? # self is root\n return nil if 1 == parent.children.size # self is parent's only child\n if 0 == own_child_index\n return nil # self is first child\n else\n # return previous sibling\n parent.children[own_child_index - 1]\n end\n end",
"def previous\n at(position - 1)\n end",
"def previous_sibling\n return @links[:previous_sibling]\n end",
"def prev(object)\n return nil if elements.index(object) == 0\n elements[elements.index(object) - 1]\n end",
"def get_prev()\n\t\t\treturn @prev\n\t\tend",
"def previous\n\t first? ? nil : locate - 1\n\tend",
"def prev(name = nil)\n previous_or_next('<', name)\n end",
"def add_previous_sibling_and_get(node, html)\n\t\tresult = node.add_previous_sibling(make_node(html, node.document))\n\t\tresult = result[0] if result.is_a?(Array)\n\t\treturn result\n\tend",
"def prev(name = nil)\n elements = self.class.all_siblings(self)\n elements = elements.where(:name => name) if name\n elements.where(\"position < ?\", self.position).order(\"position ASC\").limit(1)\n end",
"def prev\n prev? ? @current - 1 : nil\n end",
"def previous_segment\n return nil if sibling_segments.empty?\n index = sibling_segments.sort_by(&:index).index(self)\n if index && index >= 1\n sibling_segments[index - 1]\n else\n nil\n end\n end",
"def prev\n @prev ||= node_cache.fetch(prev_uri) if prev_uri\n end",
"def prev\n unless self.tll_prev.nil?\n return self.class.unscoped.where(_id: self.tll_prev).first\n end\n\n nil\n end",
"def prev node_or_key\n key = String.new\n case node_or_key\n when Node\n key = node_or_key.key\n when String\n key = node_or_key\n else\n p \"only accept String or Node type\"\n end\n\n prev = node = @head\n while node.next_ != nil && node.key != key\n prev = node\n node = node.next_\n end\n prev == node ? nil : prev\n end",
"def previous\n self.offset(-1)\n end",
"def previous_item\n index = self.simple_acts_as_list_scope.index(self)\n index == 0 ? nil : self.simple_acts_as_list_scope[index - 1]\n end",
"def previous\n first? ? nil : @collection[index - 1]\n end",
"def previous\n tokens[@current - 1]\n end",
"def set_prev(node)\n @prev_node = node\n end",
"def previous=(node_or_tags); end",
"def prev(current)\n l = current\n l = l[0,1] if (l.length > 0 and l[0,1] == '\\n')\n l = l[-1,1] if (l.length > 0 and l[-1,1] == '\\n')\n if (@position > 0)\n if (@position == (@history.length - 1))\n @history[@history.length - 1] = l\n end\n @position = @position - 1\n return @history[@position]\n end\n return current\n end",
"def prev(element_id)\n prev(element_id, from: target)\n end",
"def prev\n\t\t@prev\n\tend",
"def previous_node_name(node)\n previous_node = node.previous_sibling\n while !previous_node.nil?\n break if previous_node.element?\n\n previous_node = previous_node.previous_sibling\n end\n\n previous_node&.name&.downcase if previous_node&.element?\n end",
"def previous(query)\n unless query.nil?\n index = query.find_index(self.id)\n if index\n prev_id = query[index-1] unless index.zero?\n self.class.find_by_id(prev_id)\n end\n end\n end",
"def set_prev(node)\n\t\t\t@prev = node\n\t\tend",
"def predecessor\n siblings.previous(self) || parent\n end",
"def prev\n\t\tself - 1\n\tend",
"def previous\n @pointer -= 1\n end",
"def previous\n @tokens.at(@current - 1)\n end",
"def TreeView_GetPrevSibling(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TreeViewGetNextItem[:PREVIOUS]) end",
"def prev\n post_comments = self.post.comments #in order of id\n index = post_comments.index(self)\n new_index = index - 1\n if new_index < 0\n return nil\n else\n return post_comments[new_index]\n end\n end",
"def previous\n before.ascending.last\n end",
"def previous\n return nil if self.position == self.sentence.segments.count - 1\n self.sentence.segments[self.position+1]\n end",
"def previous_sibling\n if siblings.where(project_id: project_id).any?\n sibs = self_and_siblings.order(:cached).pluck(:id)\n\n s = sibs.index(id)\n TaxonName.find(sibs[s - 1]) if s != 0\n else\n nil\n end\n end",
"def find_prev(*args)\n find(:prev, *args)\n end",
"def find_prev(*args)\n find(:prev, *args)\n end",
"def prev(name = nil)\n elements = page.elements.published.where(Element.arel_table[:position].lt(position))\n elements = elements.named(name) if name.present?\n elements.reorder(\"position DESC\").limit(1).first\n end",
"def previous\n master_files_sorted = self.sorted_set\n if master_files_sorted.find_index(self) > 0\n return master_files_sorted[master_files_sorted.find_index(self)-1]\n else\n return nil\n end\n end",
"def previous\n if (r = @lastresult[\"queries\"][\"previousPage\"])\n return search_by_query_hash(r.first)\n else\n return nil\n end\n end",
"def preceding(node)\n ancestors = []\n parent = node.parent\n while parent\n ancestors << parent\n parent = parent.parent\n end\n\n precedings = []\n preceding_node = preceding_node_of(node)\n while preceding_node\n if ancestors.include?(preceding_node)\n ancestors.delete(preceding_node)\n else\n precedings << XPathNode.new(preceding_node,\n position: precedings.size + 1)\n end\n preceding_node = preceding_node_of(preceding_node)\n end\n precedings\n end",
"def previous(n=1)\n self - n\n end",
"def previous\n master_files_sorted = self.sorted_set\n if master_files_sorted.find_index(self) > 0\n return master_files_sorted[master_files_sorted.find_index(self)-1]\n else\n return nil\n end\n end",
"def fragment_previous(fragment)\n\t\t\t\tidx = @fragments.index(fragment)\n\t\t\t\tidx.zero? ? nil : @fragments.at(idx-1)\n\t\t\tend",
"def prev_item\n @current -= 1 if @current > 0\n\n items\n end",
"def find_previous(xml, leaf_name, order)\n order.reduce(nil) do |res, curr_name|\n break res if curr_name == leaf_name\n xml.at(curr_name.include?(':') ? \"./#{curr_name}\" : \"./xmlns:#{curr_name}\") || res\n end\n end",
"def previous\n return nil unless fund_item && previous_perspective\n fund_item.fund_editions.previous_to( self )\n end",
"def previous_item(column=nil)\n column = column || default_orderable_column\n orderable_scoped(column).where(orderable_column(column) => send(column) - 1).first\n end",
"def previous\n validates_possibility_of :previous\n self.index -= 1\n self.current\n end",
"def previous\n end",
"def previous\n end",
"def prev_address\n list_entry[:prev]\n end",
"def prev\n\t\tTask.order(:position).where(\"position < ?\", position).last\n\tend",
"def previous_post_id(post_id)\n return nil if first_post?(post_id) || !contains?(post_id)\n\n n = post_ids.index(post_id) - 1\n post_ids[n]\n end",
"def previous_sibling(num = 1, scope = {})\n scope[:limit] = num\n siblings = previous_siblings(scope)\n num == 1 ? siblings.first : siblings\n end",
"def prev\n @history_idx += 1 if @history_idx < @history.length - 1\n current\n end",
"def previous_article(from)\n sync {\n current = from - 1\n while current >= @first\n break if @articles[current - 1]\n current -= 1\n end\n (current < @first) ? nil : current\n }\n end",
"def prev\n perform_get(links.prev, self.class)\n end",
"def preceding(node); end",
"def add_previous_sibling(node_or_tags); end",
"def previous_history()\r\n @history_offset!=0 ? @the_history[@history_offset-=1] : nil\r\n end",
"def get_Previous()\n \t return @outputs[\"Previous\"]\n \tend",
"def get_Previous()\n \t return @outputs[\"Previous\"]\n \tend",
"def get_Previous()\n \t return @outputs[\"Previous\"]\n \tend",
"def get_Previous()\n \t return @outputs[\"Previous\"]\n \tend",
"def get_Previous()\n \t return @outputs[\"Previous\"]\n \tend",
"def previous\n layout.rows[number-1] unless first?\n end",
"def has_prev?()\n if @prev_node\n return true\n else\n return false\n end\n end",
"def previous\n Expression.where('id < ? AND collection_id = ?', self.id, self.collection_id).order('id DESC').limit(1).first\n end",
"def get_prev_block\n @store.get_block(@prev_block.reverse_hth)\n end",
"def previous_page\n return nil if total_pages < 1\n return nil if page == 1\n return page - 1\n end",
"def previous_rank()\n return PREVIOUS_RANK[self]\n end",
"def previous\n\t\t@result = nil\n\t\t@skip = (@skip || 0) - get_resultcount\n\t\t@skip = [0, @skip].max\n\t\treturn self\n\tend",
"def distance_to_previous\n @attrs['DistanceToPrev']\n end",
"def previous\n return @page - 1\n end",
"def prev_note\n Note.new(self).prev.to_s\n end",
"def previous\n self.new_record? ? nil : Slide.where(:lesson_id => self.lesson_id, :position => (self.position - 1)).first\n end",
"def previous_offset\n @previous_offset ||= if after\n offset_from_cursor(after)\n elsif before\n offset_from_cursor(before) - (last ? last : 0) - 1\n else\n 0\n end\n end",
"def prev\n if self[:prev_id]\n Likewise::Link.find_by_id self[:prev_id]\n end\n end",
"def prev\n ret = nil\n # If we're not the first valid value, look for the previous one\n if (@index && (@index > 0))\n # Check the cache first for the predecessor\n if (@@STEAK_CACHE[@index - 1])\n ret = @@STEAK_CACHE[@index - 1]\n # If it wasn't in the cache, create and return a new instance\n else\n ret = Steak.new(@index - 1)\n end\n end\n ret\nend",
"def previous\n connection.write(\"prev\")\n end",
"def previous(options = {})\n pages = self_and_siblings.where(\"lft < ?\", lft)\n select_page(pages, options.merge(order: :desc))\n end",
"def previous_step\n self.step_flow.previous_step if can_decrement_step\n end",
"def previous_page\n return if page == 1\n page - 1\n end",
"def previous\n self.class.where(\"id < ?\", id).where(:punto_venta_id => self.punto_venta_id).last\n end",
"def getLastNode #not counting the sentinel node\n\tunless (@size == 0)\n\t\treturn @last.prev\n\telse\n\t\treturn nil\n\tend\nend",
"def previous_station\n return @current_station if @current_station == @route.first\n\n @route.stations[@route.stations.index(@current_station) - 1]\n end",
"def previous_number(number)\n return number - 1\nend",
"def previous_number(number)\n return number - 1\nend"
] |
[
"0.8735777",
"0.86872214",
"0.83443296",
"0.833913",
"0.8275222",
"0.8080957",
"0.8059967",
"0.8054861",
"0.7836243",
"0.78321314",
"0.7765692",
"0.7731378",
"0.7603952",
"0.7550879",
"0.75392854",
"0.7463779",
"0.7438966",
"0.7435683",
"0.74280757",
"0.7348391",
"0.73206437",
"0.73012745",
"0.7280529",
"0.7177957",
"0.71547776",
"0.7118895",
"0.70816594",
"0.70530343",
"0.7039493",
"0.7011618",
"0.6988999",
"0.6973595",
"0.6950609",
"0.6940933",
"0.6940381",
"0.69303596",
"0.69015396",
"0.68471706",
"0.68437684",
"0.6840652",
"0.68341047",
"0.68306345",
"0.6815241",
"0.68089026",
"0.6802288",
"0.67896146",
"0.67848396",
"0.67848396",
"0.6731024",
"0.6728127",
"0.6720963",
"0.6710905",
"0.6695557",
"0.66897094",
"0.6685301",
"0.66717607",
"0.6665933",
"0.66311157",
"0.6602622",
"0.66011316",
"0.659501",
"0.659501",
"0.6590844",
"0.656479",
"0.6558203",
"0.6557574",
"0.6550885",
"0.6545705",
"0.65369654",
"0.6534813",
"0.6524607",
"0.65240204",
"0.6501507",
"0.6501507",
"0.6501507",
"0.6501507",
"0.6501507",
"0.64878416",
"0.6447846",
"0.6446257",
"0.64460635",
"0.64289266",
"0.641897",
"0.6414203",
"0.63842845",
"0.63822234",
"0.6364849",
"0.63583565",
"0.6352249",
"0.635138",
"0.6343077",
"0.63184345",
"0.63008726",
"0.6299057",
"0.629885",
"0.62762314",
"0.6271042",
"0.626929",
"0.6264386",
"0.6264386"
] |
0.8985553
|
0
|
Returns the previous sibling of the current node
|
def prev_sibling
return prev_sibling_of @current_node
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def prev_sibling_of(node)\n\t\treturn valid(node) ? node.previous_sibling : nil\n\tend",
"def previous_sibling\n return nil if parent.nil? # self is root\n return nil if 1 == parent.children.size # self is parent's only child\n if 0 == own_child_index\n return nil # self is first child\n else\n # return previous sibling\n parent.children[own_child_index - 1]\n end\n end",
"def previous_element_sibling\n n = self.previous_sibling\n while n do\n if n.node_type == ELEMENT_NODE then\n break\n end\n n = n.previous_sibling\n end\n return n\n end",
"def get_prev()\n return @prev_node\n end",
"def previous_sibling\n return @links[:previous_sibling]\n end",
"def previous\n DOM::Element.from_node `#{@el}.previousElementSibling || Opal.nil`\n end",
"def prev_element\n\t\treturn prev_element_of @current_node\n\tend",
"def prev_element_of(node)\n\t\treturn valid(node) ? node.previous_element : nil\n\tend",
"def predecessor\n siblings.previous(self) || parent\n end",
"def previous_segment\n return nil if sibling_segments.empty?\n index = sibling_segments.sort_by(&:index).index(self)\n if index && index >= 1\n sibling_segments[index - 1]\n else\n nil\n end\n end",
"def previous_node\n peer = nil\n if !parent.nil? and parent.respond_to?(:children)\n index = parent.children.index(self)\n peer = index > 0 ? parent.children[index - 1] : nil\n end\n peer\n end",
"def previous_node\n return nil if @traversal_position.previousNode.nil?\n Neo4j.load(@traversal_position.previousNode.getId)\n end",
"def previous_sibling\n if siblings.where(project_id: project_id).any?\n sibs = self_and_siblings.order(:cached).pluck(:id)\n\n s = sibs.index(id)\n TaxonName.find(sibs[s - 1]) if s != 0\n else\n nil\n end\n end",
"def TreeView_GetPrevSibling(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TreeViewGetNextItem[:PREVIOUS]) end",
"def prev(name = nil)\n elements = self.class.all_siblings(self)\n elements = elements.where(:name => name) if name\n elements.where(\"position < ?\", self.position).order(\"position ASC\").limit(1)\n end",
"def previous(node)\n priors(node).last\n end",
"def prev\n prev? ? @current - 1 : nil\n end",
"def add_previous_sibling_and_get(node, html)\n\t\tresult = node.add_previous_sibling(make_node(html, node.document))\n\t\tresult = result[0] if result.is_a?(Array)\n\t\treturn result\n\tend",
"def prev(name = nil)\n previous_or_next('<', name)\n end",
"def previous_element; end",
"def get_prev()\n\t\t\treturn @prev\n\t\tend",
"def prev\n unless self.tll_prev.nil?\n return self.class.unscoped.where(_id: self.tll_prev).first\n end\n\n nil\n end",
"def prev(current)\n l = current\n l = l[0,1] if (l.length > 0 and l[0,1] == '\\n')\n l = l[-1,1] if (l.length > 0 and l[-1,1] == '\\n')\n if (@position > 0)\n if (@position == (@history.length - 1))\n @history[@history.length - 1] = l\n end\n @position = @position - 1\n return @history[@position]\n end\n return current\n end",
"def get_previous_node(item)\n raise ArgumentError, 'Previous node does not exist' if @length < 2\n\n previous_node = @front_node\n\n until previous_node.next_node.nil? || previous_node.next_node.item == item\n previous_node = previous_node.next_node\n end\n\n unless previous_node.next_node.item == item\n raise ArgumentError, 'Item is not present'\n end\n\n previous_node\n end",
"def previous\n at(position - 1)\n end",
"def previous_sibling(num = 1, scope = {})\n scope[:limit] = num\n siblings = previous_siblings(scope)\n num == 1 ? siblings.first : siblings\n end",
"def previous_siblings(scope = {})\n self.class.find_in_nested_set(:all, \n { :conditions => [\"#{scope_condition} AND #{sibling_condition} AND #{self.class.table_name}.id != ? AND #{prefixed_right_col_name} < ?\", self.id, self[left_col_name]], :order => \"#{prefixed_left_col_name} DESC\" }, scope)\n end",
"def add_previous_sibling(node_or_tags); end",
"def previous\n\t first? ? nil : locate - 1\n\tend",
"def previous_sibling=(other); end",
"def first_sibling\n node = self\n while node.previous_sibling\n node = node.previous_sibling\n end\n return node\n end",
"def next_sibling\n\t\treturn next_sibling_of @current_node\n\tend",
"def prev\n\t\tself - 1\n\tend",
"def previous_sibling_by_date\n siblings_by_date.where(\"starts_at < ?\", starts_at)&.last\n end",
"def previous_node_name(node)\n previous_node = node.previous_sibling\n while !previous_node.nil?\n break if previous_node.element?\n\n previous_node = previous_node.previous_sibling\n end\n\n previous_node&.name&.downcase if previous_node&.element?\n end",
"def left_sibling\n higher_items.last\n end",
"def previous\n self.offset(-1)\n end",
"def previous\n return nil if self.position == self.sentence.segments.count - 1\n self.sentence.segments[self.position+1]\n end",
"def previous\n tokens[@current - 1]\n end",
"def left_sibling\n list.reverse.first(:position.lt => position)\n end",
"def prev\n\t\t@prev\n\tend",
"def previous\n master_files_sorted = self.sorted_set\n if master_files_sorted.find_index(self) > 0\n return master_files_sorted[master_files_sorted.find_index(self)-1]\n else\n return nil\n end\n end",
"def prev node_or_key\n key = String.new\n case node_or_key\n when Node\n key = node_or_key.key\n when String\n key = node_or_key\n else\n p \"only accept String or Node type\"\n end\n\n prev = node = @head\n while node.next_ != nil && node.key != key\n prev = node\n node = node.next_\n end\n prev == node ? nil : prev\n end",
"def prev\n @prev ||= node_cache.fetch(prev_uri) if prev_uri\n end",
"def previous\n master_files_sorted = self.sorted_set\n if master_files_sorted.find_index(self) > 0\n return master_files_sorted[master_files_sorted.find_index(self)-1]\n else\n return nil\n end\n end",
"def prev(object)\n return nil if elements.index(object) == 0\n elements[elements.index(object) - 1]\n end",
"def prev\n perform_get(links.prev, self.class)\n end",
"def prev\n if self[:prev_id]\n Likewise::Link.find_by_id self[:prev_id]\n end\n end",
"def test_previous_sibling\n setup_test_tree\n\n assert_nil(@root.previous_sibling, \"Root does not have any previous sibling\")\n assert_nil(@child1.previous_sibling, \"Child1 does not have previous sibling\")\n assert_equal(@child1, @child2.previous_sibling, \"Child2's previous sibling is Child1\")\n assert_equal(@child2, @child3.previous_sibling, \"Child3's previous sibling is Child2\")\n assert_nil(@child4.previous_sibling, \"Child4 does not have a previous sibling\")\n end",
"def left_sibling\n siblings.\n where( arel[position_column].lt(self[position_column]) ).\n reorder( arel[position_column].desc ).\n first\n end",
"def set_prev(node)\n @prev_node = node\n end",
"def previous\n @tokens.at(@current - 1)\n end",
"def previous(query)\n unless query.nil?\n index = query.find_index(self.id)\n if index\n prev_id = query[index-1] unless index.zero?\n self.class.find_by_id(prev_id)\n end\n end\n end",
"def prev_note\n Note.new(self).prev.to_s\n end",
"def previous_item\n index = self.simple_acts_as_list_scope.index(self)\n index == 0 ? nil : self.simple_acts_as_list_scope[index - 1]\n end",
"def add_previous_sibling(node_or_tags)\n raise ArgumentError.new(\"A document may not have multiple root nodes.\") if (parent && parent.document?) && !(node_or_tags.comment? || node_or_tags.processing_instruction?)\n\n add_sibling :previous, node_or_tags\n end",
"def preceding(node)\n ancestors = []\n parent = node.parent\n while parent\n ancestors << parent\n parent = parent.parent\n end\n\n precedings = []\n preceding_node = preceding_node_of(node)\n while preceding_node\n if ancestors.include?(preceding_node)\n ancestors.delete(preceding_node)\n else\n precedings << XPathNode.new(preceding_node,\n position: precedings.size + 1)\n end\n preceding_node = preceding_node_of(preceding_node)\n end\n precedings\n end",
"def set_prev(node)\n\t\t\t@prev = node\n\t\tend",
"def previous=(node_or_tags); end",
"def prev\n post_comments = self.post.comments #in order of id\n index = post_comments.index(self)\n new_index = index - 1\n if new_index < 0\n return nil\n else\n return post_comments[new_index]\n end\n end",
"def previous\n before.ascending.last\n end",
"def previous\n first? ? nil : @collection[index - 1]\n end",
"def previous\n @pointer -= 1\n end",
"def preceding(node); end",
"def previous_step\n self.step_flow.previous_step if can_decrement_step\n end",
"def previous(options = {})\n pages = self_and_siblings.where(\"lft < ?\", lft)\n select_page(pages, options.merge(order: :desc))\n end",
"def prev(element_id)\n prev(element_id, from: target)\n end",
"def previous\n layout.rows[number-1] unless first?\n end",
"def previous\n validates_possibility_of :previous\n self.index -= 1\n self.current\n end",
"def previous\n self.new_record? ? nil : Slide.where(:lesson_id => self.lesson_id, :position => (self.position - 1)).first\n end",
"def previous\n return nil unless fund_item && previous_perspective\n fund_item.fund_editions.previous_to( self )\n end",
"def has_prev?()\n if @prev_node\n return true\n else\n return false\n end\n end",
"def previous_rank()\n return PREVIOUS_RANK[self]\n end",
"def move_lower\n next_sib = next_sibling\n move_to_right_of(next_sib) if next_sib\n end",
"def previous\n if (r = @lastresult[\"queries\"][\"previousPage\"])\n return search_by_query_hash(r.first)\n else\n return nil\n end\n end",
"def previous\n connection.write(\"prev\")\n end",
"def previous\n end",
"def previous\n end",
"def previous_lesson\n lesson = section.lessons.where(\"row_order < ?\", self.row_order).rank(:row_order).last\n if lesson.blank? && section.previous_section\n return section.previous_section.lessons.rank(:row_order).last\n end\n return lesson\n end",
"def prev\n @history_idx += 1 if @history_idx < @history.length - 1\n current\n end",
"def get_previous_post( in_same_term = false, excluded_terms = '', taxonomy = 'category' )\n get_adjacent_post( in_same_term, excluded_terms, true, taxonomy );\n end",
"def previous\n ptr = C.LLVMGetPreviousInstruction(self)\n LLVM::Instruction.from_ptr(ptr) unless ptr.null?\n end",
"def left_sibling\n siblings.filter(self.class.qualified_left_column < left).order(self.class.qualified_left_column.desc).first\n end",
"def find_previous(xml, leaf_name, order)\n order.reduce(nil) do |res, curr_name|\n break res if curr_name == leaf_name\n xml.at(curr_name.include?(':') ? \"./#{curr_name}\" : \"./xmlns:#{curr_name}\") || res\n end\n end",
"def get_prev_block\n @store.get_block(@prev_block.reverse_hth)\n end",
"def prev\n\t\tTask.order(:position).where(\"position < ?\", position).last\n\tend",
"def next_sibling\n return @links[:next_sibling]\n end",
"def previous\n\t\t@result = nil\n\t\t@skip = (@skip || 0) - get_resultcount\n\t\t@skip = [0, @skip].max\n\t\treturn self\n\tend",
"def previous(n=1)\n self - n\n end",
"def predecessor\n Algorithm.where(next: self).first\n end",
"def prev_item\n @current -= 1 if @current > 0\n\n items\n end",
"def distance_to_previous\n @attrs['DistanceToPrev']\n end",
"def left_sibling\n base_class.first scoped(parent_column_name => _parent_id, left_column_name => { '$lt' => left }, :order => \"#{left_column_name} DESC\")\n end",
"def previous\n return @page - 1\n end",
"def prev_page\n current_page > 1 ? (current_page - 1) : nil\n end",
"def prev\n connection.write(\"prev\")\n end",
"def previous_page\n @current_page > 1 ? (@current_page - 1) : nil\n end",
"def previous_screen\n # print \"previous_screen: \" + id.to_s + \" - \" + title + \"\\n\"\n if !has_siblings? || !higher_item\n return nil if is_root?\n return parent.parent_last_screen\n end\n higher_item.last_screen\n end",
"def sibling(node_id)\n node_id ^ 1\n end",
"def prev_id\n self[:prev_id]\n end"
] |
[
"0.87419695",
"0.8696707",
"0.8630646",
"0.85605544",
"0.84713054",
"0.84206885",
"0.83649904",
"0.7981851",
"0.7932079",
"0.7851961",
"0.78427726",
"0.77472585",
"0.7678344",
"0.7561046",
"0.74988776",
"0.74839747",
"0.7367846",
"0.7330575",
"0.7320181",
"0.72175026",
"0.71991986",
"0.7160712",
"0.71426916",
"0.7142121",
"0.7122134",
"0.7118559",
"0.70990705",
"0.708105",
"0.70328194",
"0.7030532",
"0.6983702",
"0.6932748",
"0.6923056",
"0.69023216",
"0.68871343",
"0.6882307",
"0.68743485",
"0.6871198",
"0.68675715",
"0.6844275",
"0.68072116",
"0.6771104",
"0.6749124",
"0.6736233",
"0.6722859",
"0.67068696",
"0.6705318",
"0.6681855",
"0.66647464",
"0.6643287",
"0.6642325",
"0.66360027",
"0.66017956",
"0.65863276",
"0.657745",
"0.65736395",
"0.6555453",
"0.6552582",
"0.6549362",
"0.6526166",
"0.65244776",
"0.650236",
"0.65019274",
"0.6488975",
"0.6470205",
"0.6462744",
"0.6456254",
"0.6455194",
"0.64324355",
"0.64195776",
"0.64155626",
"0.6410665",
"0.6401162",
"0.6398953",
"0.637156",
"0.63699913",
"0.6365213",
"0.6365213",
"0.63526535",
"0.63082874",
"0.63065594",
"0.6306312",
"0.6306064",
"0.6302096",
"0.6301787",
"0.6291335",
"0.62884253",
"0.62840146",
"0.62773365",
"0.62694085",
"0.6260996",
"0.6242532",
"0.6223721",
"0.6185434",
"0.6183044",
"0.6171429",
"0.616978",
"0.61692154",
"0.6163601",
"0.61589336"
] |
0.911287
|
0
|
Returns the previous sibling of the given node
|
def prev_sibling_of(node)
return valid(node) ? node.previous_sibling : nil
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def prev_sibling\n\t\treturn prev_sibling_of @current_node\n\tend",
"def previous_sibling\n return nil if parent.nil? # self is root\n return nil if 1 == parent.children.size # self is parent's only child\n if 0 == own_child_index\n return nil # self is first child\n else\n # return previous sibling\n parent.children[own_child_index - 1]\n end\n end",
"def previous_element_sibling\n n = self.previous_sibling\n while n do\n if n.node_type == ELEMENT_NODE then\n break\n end\n n = n.previous_sibling\n end\n return n\n end",
"def get_prev()\n return @prev_node\n end",
"def prev_element_of(node)\n\t\treturn valid(node) ? node.previous_element : nil\n\tend",
"def previous_sibling\n return @links[:previous_sibling]\n end",
"def previous\n DOM::Element.from_node `#{@el}.previousElementSibling || Opal.nil`\n end",
"def prev_element\n\t\treturn prev_element_of @current_node\n\tend",
"def previous_node\n peer = nil\n if !parent.nil? and parent.respond_to?(:children)\n index = parent.children.index(self)\n peer = index > 0 ? parent.children[index - 1] : nil\n end\n peer\n end",
"def previous_node\n return nil if @traversal_position.previousNode.nil?\n Neo4j.load(@traversal_position.previousNode.getId)\n end",
"def previous(node)\n priors(node).last\n end",
"def previous_segment\n return nil if sibling_segments.empty?\n index = sibling_segments.sort_by(&:index).index(self)\n if index && index >= 1\n sibling_segments[index - 1]\n else\n nil\n end\n end",
"def predecessor\n siblings.previous(self) || parent\n end",
"def add_previous_sibling_and_get(node, html)\n\t\tresult = node.add_previous_sibling(make_node(html, node.document))\n\t\tresult = result[0] if result.is_a?(Array)\n\t\treturn result\n\tend",
"def previous_sibling\n if siblings.where(project_id: project_id).any?\n sibs = self_and_siblings.order(:cached).pluck(:id)\n\n s = sibs.index(id)\n TaxonName.find(sibs[s - 1]) if s != 0\n else\n nil\n end\n end",
"def TreeView_GetPrevSibling(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TreeViewGetNextItem[:PREVIOUS]) end",
"def get_previous_node(item)\n raise ArgumentError, 'Previous node does not exist' if @length < 2\n\n previous_node = @front_node\n\n until previous_node.next_node.nil? || previous_node.next_node.item == item\n previous_node = previous_node.next_node\n end\n\n unless previous_node.next_node.item == item\n raise ArgumentError, 'Item is not present'\n end\n\n previous_node\n end",
"def prev(name = nil)\n elements = self.class.all_siblings(self)\n elements = elements.where(:name => name) if name\n elements.where(\"position < ?\", self.position).order(\"position ASC\").limit(1)\n end",
"def add_previous_sibling(node_or_tags); end",
"def prev(name = nil)\n previous_or_next('<', name)\n end",
"def previous_node_name(node)\n previous_node = node.previous_sibling\n while !previous_node.nil?\n break if previous_node.element?\n\n previous_node = previous_node.previous_sibling\n end\n\n previous_node&.name&.downcase if previous_node&.element?\n end",
"def preceding(node)\n ancestors = []\n parent = node.parent\n while parent\n ancestors << parent\n parent = parent.parent\n end\n\n precedings = []\n preceding_node = preceding_node_of(node)\n while preceding_node\n if ancestors.include?(preceding_node)\n ancestors.delete(preceding_node)\n else\n precedings << XPathNode.new(preceding_node,\n position: precedings.size + 1)\n end\n preceding_node = preceding_node_of(preceding_node)\n end\n precedings\n end",
"def prev node_or_key\n key = String.new\n case node_or_key\n when Node\n key = node_or_key.key\n when String\n key = node_or_key\n else\n p \"only accept String or Node type\"\n end\n\n prev = node = @head\n while node.next_ != nil && node.key != key\n prev = node\n node = node.next_\n end\n prev == node ? nil : prev\n end",
"def previous_sibling(num = 1, scope = {})\n scope[:limit] = num\n siblings = previous_siblings(scope)\n num == 1 ? siblings.first : siblings\n end",
"def previous_element; end",
"def previous_siblings(scope = {})\n self.class.find_in_nested_set(:all, \n { :conditions => [\"#{scope_condition} AND #{sibling_condition} AND #{self.class.table_name}.id != ? AND #{prefixed_right_col_name} < ?\", self.id, self[left_col_name]], :order => \"#{prefixed_left_col_name} DESC\" }, scope)\n end",
"def add_previous_sibling(node_or_tags)\n raise ArgumentError.new(\"A document may not have multiple root nodes.\") if (parent && parent.document?) && !(node_or_tags.comment? || node_or_tags.processing_instruction?)\n\n add_sibling :previous, node_or_tags\n end",
"def first_sibling\n node = self\n while node.previous_sibling\n node = node.previous_sibling\n end\n return node\n end",
"def set_prev(node)\n @prev_node = node\n end",
"def prev\n unless self.tll_prev.nil?\n return self.class.unscoped.where(_id: self.tll_prev).first\n end\n\n nil\n end",
"def previous_sibling=(other); end",
"def get_prev()\n\t\t\treturn @prev\n\t\tend",
"def previous_sibling_by_date\n siblings_by_date.where(\"starts_at < ?\", starts_at)&.last\n end",
"def previous\n\t first? ? nil : locate - 1\n\tend",
"def prev\n prev? ? @current - 1 : nil\n end",
"def previous\n at(position - 1)\n end",
"def prev(object)\n return nil if elements.index(object) == 0\n elements[elements.index(object) - 1]\n end",
"def preceding(node); end",
"def set_prev(node)\n\t\t\t@prev = node\n\t\tend",
"def test_previous_sibling\n setup_test_tree\n\n assert_nil(@root.previous_sibling, \"Root does not have any previous sibling\")\n assert_nil(@child1.previous_sibling, \"Child1 does not have previous sibling\")\n assert_equal(@child1, @child2.previous_sibling, \"Child2's previous sibling is Child1\")\n assert_equal(@child2, @child3.previous_sibling, \"Child3's previous sibling is Child2\")\n assert_nil(@child4.previous_sibling, \"Child4 does not have a previous sibling\")\n end",
"def left_sibling\n list.reverse.first(:position.lt => position)\n end",
"def previous=(node_or_tags); end",
"def prev\n @prev ||= node_cache.fetch(prev_uri) if prev_uri\n end",
"def previous(query)\n unless query.nil?\n index = query.find_index(self.id)\n if index\n prev_id = query[index-1] unless index.zero?\n self.class.find_by_id(prev_id)\n end\n end\n end",
"def next_sibling\n\t\treturn next_sibling_of @current_node\n\tend",
"def prev(current)\n l = current\n l = l[0,1] if (l.length > 0 and l[0,1] == '\\n')\n l = l[-1,1] if (l.length > 0 and l[-1,1] == '\\n')\n if (@position > 0)\n if (@position == (@history.length - 1))\n @history[@history.length - 1] = l\n end\n @position = @position - 1\n return @history[@position]\n end\n return current\n end",
"def sibling(node_id)\n node_id ^ 1\n end",
"def left_sibling\n higher_items.last\n end",
"def left_sibling\n siblings.\n where( arel[position_column].lt(self[position_column]) ).\n reorder( arel[position_column].desc ).\n first\n end",
"def previous\n return nil if self.position == self.sentence.segments.count - 1\n self.sentence.segments[self.position+1]\n end",
"def prev(element_id)\n prev(element_id, from: target)\n end",
"def get_previous_post( in_same_term = false, excluded_terms = '', taxonomy = 'category' )\n get_adjacent_post( in_same_term, excluded_terms, true, taxonomy );\n end",
"def find_predecessor(id)\n if self == successor\n self\n else\n pred = self\n while !between_left_inclusive(id, pred.nodeid, pred.successor.nodeid) # RPC\n pred = pred.closest_preceding_node(id) # RPC\n end\n pred\n end\n end",
"def prev\n\t\tself - 1\n\tend",
"def prev\n\t\t@prev\n\tend",
"def next_sibling_of(node)\n\t\treturn valid(node) ? node.next_sibling : nil\n\tend",
"def prev\n if self[:prev_id]\n Likewise::Link.find_by_id self[:prev_id]\n end\n end",
"def previous\n self.offset(-1)\n end",
"def prev\n post_comments = self.post.comments #in order of id\n index = post_comments.index(self)\n new_index = index - 1\n if new_index < 0\n return nil\n else\n return post_comments[new_index]\n end\n end",
"def remove_before(node, stop_node)\n # Stopping condition\n return if node == stop_node\n\n # Get parent\n parent = node.parent\n\n # Get siblings\n siblings = parent.children\n\n # Get node's index\n index = siblings.index(node)\n\n # Remove siblings before node\n parent.children = siblings.slice(index..-1)\n\n # Remove nodes after the parent\n remove_before(parent, stop_node)\n end",
"def previous\n master_files_sorted = self.sorted_set\n if master_files_sorted.find_index(self) > 0\n return master_files_sorted[master_files_sorted.find_index(self)-1]\n else\n return nil\n end\n end",
"def previous\n master_files_sorted = self.sorted_set\n if master_files_sorted.find_index(self) > 0\n return master_files_sorted[master_files_sorted.find_index(self)-1]\n else\n return nil\n end\n end",
"def prev\n perform_get(links.prev, self.class)\n end",
"def previous_item\n index = self.simple_acts_as_list_scope.index(self)\n index == 0 ? nil : self.simple_acts_as_list_scope[index - 1]\n end",
"def has_prev?()\n if @prev_node\n return true\n else\n return false\n end\n end",
"def previous\n before.ascending.last\n end",
"def previous\n tokens[@current - 1]\n end",
"def find_prev(*args)\n find(:prev, *args)\n end",
"def find_prev(*args)\n find(:prev, *args)\n end",
"def previous_step\n self.step_flow.previous_step if can_decrement_step\n end",
"def previous(options = {})\n pages = self_and_siblings.where(\"lft < ?\", lft)\n select_page(pages, options.merge(order: :desc))\n end",
"def move_lower\n next_sib = next_sibling\n move_to_right_of(next_sib) if next_sib\n end",
"def prev_note\n Note.new(self).prev.to_s\n end",
"def previous_post_id(post_id)\n return nil if first_post?(post_id) || !contains?(post_id)\n\n n = post_ids.index(post_id) - 1\n post_ids[n]\n end",
"def sibling(name)\n parent && parent.find(name)\n end",
"def previous\n if (r = @lastresult[\"queries\"][\"previousPage\"])\n return search_by_query_hash(r.first)\n else\n return nil\n end\n end",
"def previous(n=1)\n self - n\n end",
"def find_previous(xml, leaf_name, order)\n order.reduce(nil) do |res, curr_name|\n break res if curr_name == leaf_name\n xml.at(curr_name.include?(':') ? \"./#{curr_name}\" : \"./xmlns:#{curr_name}\") || res\n end\n end",
"def predecessor\n Algorithm.where(next: self).first\n end",
"def previous_rank()\n return PREVIOUS_RANK[self]\n end",
"def prev\n\t\tTask.order(:position).where(\"position < ?\", position).last\n\tend",
"def left_sibling\n siblings.filter(self.class.qualified_left_column < left).order(self.class.qualified_left_column.desc).first\n end",
"def previous\n @pointer -= 1\n end",
"def previous\n first? ? nil : @collection[index - 1]\n end",
"def prev(name = nil)\n elements = page.elements.published.where(Element.arel_table[:position].lt(position))\n elements = elements.named(name) if name.present?\n elements.reorder(\"position DESC\").limit(1).first\n end",
"def get_prev_block\n @store.get_block(@prev_block.reverse_hth)\n end",
"def previous_node_is_text?(node)\n !node.previous_sibling.nil? && node.previous_sibling.text? && !node.previous_sibling.text.strip.empty?\n end",
"def fragment_previous(fragment)\n\t\t\t\tidx = @fragments.index(fragment)\n\t\t\t\tidx.zero? ? nil : @fragments.at(idx-1)\n\t\t\tend",
"def add_before(node)\n raise \"Can't add #{self} before a node with no parent\" if node.parent.nil?\n raise \"#{node.parent.class} cannot contain nodes of type #{self.class}\" unless node.parent.can_contain?(self.class)\n raise \"Can't add an node before itself\" if node == self\n raise \"#{self} cannot be its own ancestor\" if node.ancestors.include? self\n\n @__parent__.remove(self) if @__parent__\n @__parent__ = node.parent\n @__parent__.first_child = self if @__parent__.first_child == node\n @__next__ = node\n @__prev__ = node.prev\n node.prev = self\n @__prev__.next = self if @__prev__\n end",
"def previous_item(column=nil)\n column = column || default_orderable_column\n orderable_scoped(column).where(orderable_column(column) => send(column) - 1).first\n end",
"def previous_lesson\n lesson = section.lessons.where(\"row_order < ?\", self.row_order).rank(:row_order).last\n if lesson.blank? && section.previous_section\n return section.previous_section.lessons.rank(:row_order).last\n end\n return lesson\n end",
"def previous_subsection(subsection)\n\n section = self.checklist.sections.detect { |s| s.id == subsection.section_id}\n i = section.subsections.index(subsection)\n if i > 0\n return section.subsections[i-1]\n else\n j = self.checklist.sections.index(section)\n if j > 0\n return self.checklist.sections[j-1].subsections.last\n else\n return nil\n end\n end\n end",
"def previous\n return nil unless fund_item && previous_perspective\n fund_item.fund_editions.previous_to( self )\n end",
"def next_sibling\n return @links[:next_sibling]\n end",
"def previous\n self.new_record? ? nil : Slide.where(:lesson_id => self.lesson_id, :position => (self.position - 1)).first\n end",
"def left_sibling\n base_class.first scoped(parent_column_name => _parent_id, left_column_name => { '$lt' => left }, :order => \"#{left_column_name} DESC\")\n end",
"def previous_page\n return nil if total_pages < 1\n return nil if page == 1\n return page - 1\n end",
"def previous\n @tokens.at(@current - 1)\n end",
"def previous\n end",
"def previous\n end"
] |
[
"0.86686254",
"0.8503803",
"0.85004866",
"0.8299519",
"0.82088727",
"0.8158872",
"0.80423623",
"0.78661317",
"0.7691367",
"0.766529",
"0.76146114",
"0.76119834",
"0.76002145",
"0.7580425",
"0.7485071",
"0.74039453",
"0.7376988",
"0.7258424",
"0.71953845",
"0.7175583",
"0.70640576",
"0.69870925",
"0.6940325",
"0.69391245",
"0.6883587",
"0.68380237",
"0.6819536",
"0.6775878",
"0.6766514",
"0.6757368",
"0.67463464",
"0.67264736",
"0.67202413",
"0.6702137",
"0.6690268",
"0.6687922",
"0.66159683",
"0.6571449",
"0.6563712",
"0.6560714",
"0.65604615",
"0.6509015",
"0.64958626",
"0.6459933",
"0.64513123",
"0.64411867",
"0.6437868",
"0.6434252",
"0.64163977",
"0.64121044",
"0.64038897",
"0.632108",
"0.63139796",
"0.6297694",
"0.6270409",
"0.6256306",
"0.6255948",
"0.62491906",
"0.6249067",
"0.6244957",
"0.6243963",
"0.6232474",
"0.62265766",
"0.6212283",
"0.6175782",
"0.6163378",
"0.616218",
"0.61570567",
"0.61570567",
"0.6152946",
"0.61431277",
"0.6139788",
"0.6138925",
"0.61283463",
"0.6125466",
"0.6107737",
"0.609836",
"0.6095795",
"0.6073153",
"0.60552186",
"0.60510075",
"0.60500395",
"0.6047842",
"0.6036476",
"0.600343",
"0.59957486",
"0.5992993",
"0.5991474",
"0.5990941",
"0.59868866",
"0.597466",
"0.5967095",
"0.59567076",
"0.59528977",
"0.5950249",
"0.5935355",
"0.5933824",
"0.5926158",
"0.59205216",
"0.59205216"
] |
0.89993024
|
0
|
Returns the next element of the current node
|
def next_element
return next_element_of @current_node
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_next()\n return @next_node\n end",
"def next\n DOM::Element.from_node `#{@el}.nextElementSibling || Opal.nil`\n end",
"def next_node\n @current_node = @current_node.children[0]\n end",
"def next_node\n @current_node = @current_node.children[0]\n end",
"def next\n value = `#{@el}.nextElementSibling || false`\n value ? DOM::Element.fromNode(value) : nil\n end",
"def next_element_of(node)\n\t\treturn valid(node) ? node.next_element : nil\n\tend",
"def next()\n result = current\n @index += 1\n @got_next_element = false\n @next_element = nil\n result\n end",
"def next_sibling\n\t\treturn next_sibling_of @current_node\n\tend",
"def next_element; end",
"def next\n if has_next?\n node = @stack.pop\n # keep next ready\n look_left node.right if node.right\n node.data\n end\n end",
"def next\n return nil unless @node\n @node = @node.next\n while @index < @table.size and @node == nil\n @index += 1\n @node = @table[@index]\n end\n return @node == nil ? nil : @node.item\n end",
"def next\n return @tree_iterator.next\n end",
"def get_next\n\n if (@local_iterator)\n @local_iterator.get_next\n else\n raise \"No iterator defined! Cannot get next element\"\n end\n\n end",
"def next\n parent[parent.place(self) + 1]\n end",
"def next\n @next ||=\n if next_uri\n node_cache.fetch(next_uri) do\n node = self.class.new(node_cache, next_uri, adapter, graph)\n node.prev = self\n node\n end\n end\n end",
"def next\n @next && @next.value\n end",
"def next_element_sibling\n n = self.next_sibling\n while n do\n if n.node_type == ELEMENT_NODE then\n break\n end\n n = n.next_sibling\n end\n return n\n end",
"def next\n next? ? @current + 1 : nil\n end",
"def current()\n raise EOFError, \"no more elements available\" if end?\n _next_element\n end",
"def next_node\n children.first || successor\n end",
"def next\n if @elements and not @elements.empty?\n @index = (@index + 1) % @elements.length\n element = @elements[@index]\n value = value_of(element)\n @element, @value = element, value\n end\n @value\n end",
"def get_next()\n\t\t\treturn @next\n\t\tend",
"def next_element\n validates_possibility_of :next\n self.index += 1\n self.current\n end",
"def next\n\n if (@local_iterator && @local_iterator.has_next?)\n @local_iterator.get_next\n else\n nil\n end\n\n end",
"def next(node)\n @path[@path.index(node) + 1]\n end",
"def next_node\n peer = nil\n if !parent.nil? and parent.respond_to?(:children)\n index = parent.children.index(self)\n peer = parent.children[index + 1]\n end\n peer\n end",
"def current\n return nil unless @node\n @node.item\n end",
"def next_sibling\n return @links[:next_sibling]\n end",
"def next\n at(position + 1)\n end",
"def next\n return nil unless @node\n @node = @node.next\n while @index < @table.size and @node == nil\n @index += 1\n @node = @table[@index]\n end\n @node == nil ? nil : (@is_value ? @node.value : @node.key)\n end",
"def get_next_node(node)\n i = node.number + 1\n i = 0 if i >= nodes.size\n get_node(i)\n end",
"def next\n self.offset(1)\n end",
"def next_item\n return nil if @link == nil\n link.kernel.select {|item| item.rule == @rule}.first\n end",
"def next_node\n body_has_more_nodes? ? @body_enumerator.next : nil\n end",
"def next\r\n # if the path is empty attempt create the first path element \r\n if @path.empty?\r\n ords = get_data @base\r\n if ords.empty?\r\n # if the base ordering has no related orderings to traverse\r\n # return false \r\n return nil\r\n else\r\n #otherwise create the path element \r\n @path << IteratorPathElement.new(ords[0])\r\n return ords[0] \r\n end \r\n else\r\n # The path is not empty, we have to advance to the next element\r\n cur_elem = @path[-1]\r\n # We use the depth-first algorithm, check whether we can deepen first\r\n ords = get_data(cur_elem.cur_ordering)\r\n unless ords.empty?\r\n # deepen the path\r\n @path << IteratorPathElement.new(ords[0])\r\n return ords[0]\r\n else\r\n # move to next element\r\n \r\n # remove path elements which have enumerated already all their children \r\n until cur_elem.has_more?\r\n @path.pop\r\n if @path.empty?\r\n return nil\r\n end\r\n cur_elem = @path[-1]\r\n end\r\n \r\n #actually move to the next sibling element\r\n return cur_element.next\r\n end\r\n end\r\n end",
"def next\n return nil if @struct.next.null?\n self.class.new(@struct.next)\n end",
"def next(object)\n elements[elements.index(object) + 1]\n end",
"def next_sibling_of(node)\n\t\treturn valid(node) ? node.next_sibling : nil\n\tend",
"def next\n @next||=after.first\n end",
"def next_token\r\n if !@token.following.nil?\r\n\t\t\t@token = @token.following\r\n\t\t\treturn @token.value\r\n\t\tend\r\n\r\n\t\tscan(@token)\r\n\t\treturn @token.value\r\n end",
"def next\n @tok ||= read_token\n @tok, tok = nil, @tok\n @prev = tok\n return tok\n end",
"def next_node(current, key)\n return nil, nil unless current[:key_length]\n next_key = key[0...current[:key_length]]\n if current[:nodes].has_key?(next_key)\n return current[:nodes][next_key], key[next_key.length..-1]\n else\n return nil, nil\n end\n end",
"def next(name = nil)\n elements = self.class.all_siblings(self)\n elements = elements.where(:name => name) if name\n elements.where(\"position > ?\", self.position).order(\"position ASC\").limit(1)\n end",
"def next\r\n next_values[0]\r\n end",
"def getnext(oid)\n roid=[]\n roid=self.oid2roid(oid) if (oid<=>self.oid) >= 0\n roid_first = roid.first\n return nil if roid_first and roid_first > @nodes.size-1\n @nodes.each_index do\n |index|\n next if roid_first and roid_first > index\n node = @nodes[index]\n node = node.getnext(oid) if node\n # I have some nil elements, but not the last\n next if not node\n return node\n end\n # It is not expected to get here\n return nil\n end",
"def next\n\t\tif @next_token\n\t\t\ttoken = @next_token\n\t\t\t@next_token = nil\n\t\t\treturn token\n\t\telse\n\t\t\ttoken = read_token\n\t\t\treturn token\n\t\tend\n\tend",
"def find_next node\r\n return if node == nil\r\n\r\n if node.left != nil\r\n return node.left\r\n end\r\n\r\n node.right\r\nend",
"def next\n if @stack.empty?\n node = nil\n return\n end\n node, which = @stack.pop\n @stack.push([node,2]) if node.type == 3 && which == 1\n node = which == 1 ? node.mid : node.right\n while node\n @stack.push([node,1])\n node = node.left\n end\n end",
"def next\n token = next_token\n token = next_token while token&.empty?\n token\n end",
"def next\n last? ? nil : @collection[index + 1]\n end",
"def next\n @next\n end",
"def item_at_head\n\t\t\t@head.next\n\t\tend",
"def next\n block.instructions[index+1] || (block.next ? block.next.instructions.first : nil)\n end",
"def getNextNodeElementName\n if (@nodeValues.size > @INDEX)\n if (@nodeAt < @nodeElements.size)\n retStr = @nodeElements[@nodeAt]\n return retStr.strip\n end\n return \"\"\n else\n return \"\"\n end\n end",
"def _next_element\n unless @got_next_element\n unless @thread\n if @enum\n @thread = @queue._run_enum(@enum.each)\n else\n @thread = @queue._run(&@block)\n end\n end\n @next_element = @queue.pop\n if Exception === @next_element\n raise @next_element\n end\n @got_next_element = true\n end\n @next_element\n end",
"def next_node(html_node)\n # Hack to prevent reading empty text nodes\n next_node = html_node.next\n is_empty = ( !next_node.nil? ) && next_node.text? && next_node.text.gsub(/[\\r\\n\\s]/, '').empty?\n while is_empty\n next_node = next_node.next\n is_empty = ( !next_node.nil? ) && next_node.text? && next_node.text.gsub(/[\\r\\n\\s]/, '').empty?\n end\n next_node\n end",
"def next(name = nil)\n previous_or_next('>', name)\n end",
"def nextSibling\n native_node.next_sibling && Browser.wrap_node(native_node.next_sibling)\n end",
"def next\n if @next.is_a? TokenSource\n @next = @next.next\n return @next \n end\n @next\n end",
"def next_key\n @next && @next.key\n end",
"def next\n unless @push.nil?\n t = @push\n @push = nil\n return t\n end\n return nil if @input.nil?\n return nil if @input.size == 0\n return nil if @index >= @input.size\n\n t = @input[@index]\n @index += 1\n t\n end",
"def next_node\n @SuccessorReference.value\n end",
"def next\n if @entry and @entry.next\n return @entry = @entry.next\n end\n\n while (@index += 1) < @capacity\n if @entry = @entries[@index]\n return @entry\n end\n end\n end",
"def next_node(example)\n if example[@feature].to_s == @value\n self.left\n else\n self.right\n end\n end",
"def next\n if self.last?\n first_in_section\n else lower_item\n end\n end",
"def next(pointer); end",
"def next(pointer); end",
"def next\n units_sorted = self.order.units.sort_by {|unit| unit.id}\n if units_sorted.find_index(self) < units_sorted.length\n return units_sorted[units_sorted.find_index(self)+1]\n else\n return nil\n end\n end",
"def next_item\n index = self.simple_acts_as_list_scope.index(self)\n self.simple_acts_as_list_scope[index + 1]\n end",
"def next\n @pointer += 1\n end",
"def next\n update_current(list_index_of(@current))\n end",
"def next\n index = @@list.index(self)\n if (!index)\n raise \"ERROR: Can't find given player\"\n end\n\n return index + 1 < @@list.length ? @@list[index + 1] : @@list[0]\n end",
"def next\n next_tuple = @next_node.next()\n return nil if next_tuple.nil?\n @map_fn.call(next_tuple)\n end",
"def next_is? &block\n last? ? nil : yield(element, self.next)\n end",
"def next\n if @state == :start && @scanner.eos?\n return nil\n else\n scan_next_token\n end\n end",
"def next\n head = If.new(left, HeadCallable.new(left), ReturnNull.new)\n .result\n .call\n @left = If.new(left, TailCallable.new(left), ReturnNull.new)\n .result\n .call\n head\n end",
"def next\n\t\tself + 1\n\tend",
"def next\n if self[:next_ptr] == FFI::Pointer::NULL\n nil\n else\n BigBedInterval.new(self[:next_ptr])\n end\n end",
"def current\n @node == nil ? nil : (@is_value ? @node.value : @node.key)\n end",
"def next_node(example)\n if example[@feature] <= @value || (example[@feature] - @value).abs < EPSI\n self.left\n else\n self.right\n end\n end",
"def peek_next(token)\r\n\t\tif !token.following.nil?\r\n\t\t return token.following\r\n\t\tend\r\n\r\n\t\tpeekToken = Token.new\r\n\t\tscan(peekToken)\r\n\t\ttoken.following = peekToken\r\n\t\treturn peekToken\r\n\tend",
"def next\n begin\n self.band.levels[band.levels.index(self) + 1]\n rescue\n return nil\n end\n end",
"def next\n next_row = @next_node.next()\n while next_row != nil\n # return row if it matches predicate\n return next_row if @predicate.call(next_row)\n # otherwise, keep calling next\n next_row = @next_node.next()\n end\n return nil\n end",
"def get_next\n\t\t\n\tend",
"def next\n if @tuple\n while (@tuple_index += 1) < @tuple_capacity\n if entry = @tuple[@tuple_index]\n return entry\n end\n end\n end\n\n while (@index += 1) < @capacity\n if @tuple = @entries[@index]\n @tuple_index = -1\n @tuple_capacity = @tuple.size\n return self.next\n end\n end\n\n @tuple = nil\n end",
"def next\n last? ? nil : locate + 1\n end",
"def next\n master_files_sorted = self.sorted_set\n if master_files_sorted.find_index(self) < master_files_sorted.length\n return master_files_sorted[master_files_sorted.find_index(self)+1]\n else\n return nil\n end\n end",
"def next\n peek.tap { @position += 1 }\n end",
"def next_token\n\t\tif ((tok = @tokensList.shift) != nil)\n\t\t\t@tokensAux << tok\n\t\t\treturn tok.idAndValue\n\t\telse\n\t\t\treturn nil\n\t\tend\n\tend",
"def get_next\n while next_item = @queue.peek\n if next_item.cancelled?\n @queue.shift\n else\n return next_item\n end\n end\n\n return nil\n end",
"def get_next_entry; end",
"def next(pointer)\n super\n \n raise 'Not implemented'\n end",
"def next\n perform_get(links.next, self.class)\n end",
"def next_item\n @current += 1 if @current < last\n\n items\n end",
"def next(element_id)\n self.next(element_id, from: target)\n end",
"def has_next\n return !(self.next_node.nil?)\n end",
"def peek_next()\n return nil if @at_end\n\n begin\n @reader.peek\n rescue StopIteration\n nil\n end\n end",
"def next_sibling\n # Raise error in case we are root\n raise RationalNumberIsRootNoSiblingsError if root?\n\n _parent = self.parent # Get parent already to avoid duplicate calculations\n _position = ((@nv - _parent.nv) / _parent.snv) + 1\n value_from_parent_and_position(_parent, _position)\n end",
"def next\n\t\tend",
"def has_next?()\n if @next_node\n return true\n else\n return false\n end\n end"
] |
[
"0.8395456",
"0.7913779",
"0.78747284",
"0.7857217",
"0.77050483",
"0.768974",
"0.7527583",
"0.75050586",
"0.7442074",
"0.739274",
"0.7337858",
"0.7234564",
"0.7219672",
"0.71539634",
"0.71497303",
"0.71329665",
"0.7107348",
"0.7075512",
"0.70687616",
"0.7050191",
"0.69945884",
"0.6961932",
"0.6960851",
"0.69515944",
"0.69329333",
"0.69107294",
"0.6874806",
"0.6871549",
"0.68443954",
"0.6804646",
"0.68039125",
"0.6748612",
"0.6717225",
"0.6684013",
"0.66555583",
"0.66356647",
"0.6596242",
"0.6588415",
"0.65841913",
"0.65807676",
"0.6572791",
"0.65355784",
"0.6521513",
"0.6518758",
"0.64788115",
"0.64411646",
"0.6435337",
"0.6434844",
"0.6424089",
"0.64169246",
"0.6406793",
"0.63925314",
"0.6381513",
"0.63803476",
"0.6372667",
"0.63383174",
"0.63271767",
"0.63237125",
"0.63208425",
"0.6310189",
"0.6299456",
"0.6285503",
"0.6255615",
"0.6237495",
"0.6220058",
"0.6213659",
"0.6213659",
"0.62121654",
"0.6201438",
"0.61825824",
"0.61719334",
"0.616931",
"0.6133722",
"0.61069417",
"0.6091545",
"0.60871935",
"0.6084204",
"0.6070228",
"0.6052413",
"0.60522884",
"0.6048674",
"0.6048543",
"0.6037821",
"0.60316503",
"0.60259926",
"0.60172266",
"0.601627",
"0.6004463",
"0.5993429",
"0.5987243",
"0.5984046",
"0.5981983",
"0.5978971",
"0.5972184",
"0.596671",
"0.59594756",
"0.5945006",
"0.59366244",
"0.59332645",
"0.5928943"
] |
0.8747819
|
0
|
Returns the next element of the given node
|
def next_element_of(node)
return valid(node) ? node.next_element : nil
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def next_element\n\t\treturn next_element_of @current_node\n\tend",
"def get_next()\n return @next_node\n end",
"def next\n DOM::Element.from_node `#{@el}.nextElementSibling || Opal.nil`\n end",
"def get_next_node(node)\n i = node.number + 1\n i = 0 if i >= nodes.size\n get_node(i)\n end",
"def next_node\n @current_node = @current_node.children[0]\n end",
"def next_node\n @current_node = @current_node.children[0]\n end",
"def next\n value = `#{@el}.nextElementSibling || false`\n value ? DOM::Element.fromNode(value) : nil\n end",
"def next\n return nil unless @node\n @node = @node.next\n while @index < @table.size and @node == nil\n @index += 1\n @node = @table[@index]\n end\n return @node == nil ? nil : @node.item\n end",
"def next(node)\n @path[@path.index(node) + 1]\n end",
"def next_sibling_of(node)\n\t\treturn valid(node) ? node.next_sibling : nil\n\tend",
"def next_element_sibling\n n = self.next_sibling\n while n do\n if n.node_type == ELEMENT_NODE then\n break\n end\n n = n.next_sibling\n end\n return n\n end",
"def next_element; end",
"def next_node\n children.first || successor\n end",
"def find_next node\r\n return if node == nil\r\n\r\n if node.left != nil\r\n return node.left\r\n end\r\n\r\n node.right\r\nend",
"def next_sibling\n\t\treturn next_sibling_of @current_node\n\tend",
"def next_node\n peer = nil\n if !parent.nil? and parent.respond_to?(:children)\n index = parent.children.index(self)\n peer = parent.children[index + 1]\n end\n peer\n end",
"def next\n @next ||=\n if next_uri\n node_cache.fetch(next_uri) do\n node = self.class.new(node_cache, next_uri, adapter, graph)\n node.prev = self\n node\n end\n end\n end",
"def next\n if has_next?\n node = @stack.pop\n # keep next ready\n look_left node.right if node.right\n node.data\n end\n end",
"def next()\n result = current\n @index += 1\n @got_next_element = false\n @next_element = nil\n result\n end",
"def next_node(html_node)\n # Hack to prevent reading empty text nodes\n next_node = html_node.next\n is_empty = ( !next_node.nil? ) && next_node.text? && next_node.text.gsub(/[\\r\\n\\s]/, '').empty?\n while is_empty\n next_node = next_node.next\n is_empty = ( !next_node.nil? ) && next_node.text? && next_node.text.gsub(/[\\r\\n\\s]/, '').empty?\n end\n next_node\n end",
"def next\n return nil unless @node\n @node = @node.next\n while @index < @table.size and @node == nil\n @index += 1\n @node = @table[@index]\n end\n @node == nil ? nil : (@is_value ? @node.value : @node.key)\n end",
"def next_item\n return nil if @link == nil\n link.kernel.select {|item| item.rule == @rule}.first\n end",
"def get_next\n\n if (@local_iterator)\n @local_iterator.get_next\n else\n raise \"No iterator defined! Cannot get next element\"\n end\n\n end",
"def getnext(oid)\n roid=[]\n roid=self.oid2roid(oid) if (oid<=>self.oid) >= 0\n roid_first = roid.first\n return nil if roid_first and roid_first > @nodes.size-1\n @nodes.each_index do\n |index|\n next if roid_first and roid_first > index\n node = @nodes[index]\n node = node.getnext(oid) if node\n # I have some nil elements, but not the last\n next if not node\n return node\n end\n # It is not expected to get here\n return nil\n end",
"def next\n if @elements and not @elements.empty?\n @index = (@index + 1) % @elements.length\n element = @elements[@index]\n value = value_of(element)\n @element, @value = element, value\n end\n @value\n end",
"def next_node\n body_has_more_nodes? ? @body_enumerator.next : nil\n end",
"def next\n return @tree_iterator.next\n end",
"def next\n @next && @next.value\n end",
"def next_node(current, key)\n return nil, nil unless current[:key_length]\n next_key = key[0...current[:key_length]]\n if current[:nodes].has_key?(next_key)\n return current[:nodes][next_key], key[next_key.length..-1]\n else\n return nil, nil\n end\n end",
"def next_sibling\n return @links[:next_sibling]\n end",
"def next(object)\n elements[elements.index(object) + 1]\n end",
"def next_element\n validates_possibility_of :next\n self.index += 1\n self.current\n end",
"def nextSibling\n native_node.next_sibling && Browser.wrap_node(native_node.next_sibling)\n end",
"def get_next()\n\t\t\treturn @next\n\t\tend",
"def next\n parent[parent.place(self) + 1]\n end",
"def next\n next? ? @current + 1 : nil\n end",
"def next\n at(position + 1)\n end",
"def next\n if @stack.empty?\n node = nil\n return\n end\n node, which = @stack.pop\n @stack.push([node,2]) if node.type == 3 && which == 1\n node = which == 1 ? node.mid : node.right\n while node\n @stack.push([node,1])\n node = node.left\n end\n end",
"def next\n\n if (@local_iterator && @local_iterator.has_next?)\n @local_iterator.get_next\n else\n nil\n end\n\n end",
"def next_node(example)\n if example[@feature].to_s == @value\n self.left\n else\n self.right\n end\n end",
"def next(name = nil)\n elements = self.class.all_siblings(self)\n elements = elements.where(:name => name) if name\n elements.where(\"position > ?\", self.position).order(\"position ASC\").limit(1)\n end",
"def next\r\n # if the path is empty attempt create the first path element \r\n if @path.empty?\r\n ords = get_data @base\r\n if ords.empty?\r\n # if the base ordering has no related orderings to traverse\r\n # return false \r\n return nil\r\n else\r\n #otherwise create the path element \r\n @path << IteratorPathElement.new(ords[0])\r\n return ords[0] \r\n end \r\n else\r\n # The path is not empty, we have to advance to the next element\r\n cur_elem = @path[-1]\r\n # We use the depth-first algorithm, check whether we can deepen first\r\n ords = get_data(cur_elem.cur_ordering)\r\n unless ords.empty?\r\n # deepen the path\r\n @path << IteratorPathElement.new(ords[0])\r\n return ords[0]\r\n else\r\n # move to next element\r\n \r\n # remove path elements which have enumerated already all their children \r\n until cur_elem.has_more?\r\n @path.pop\r\n if @path.empty?\r\n return nil\r\n end\r\n cur_elem = @path[-1]\r\n end\r\n \r\n #actually move to the next sibling element\r\n return cur_element.next\r\n end\r\n end\r\n end",
"def next_token\r\n if !@token.following.nil?\r\n\t\t\t@token = @token.following\r\n\t\t\treturn @token.value\r\n\t\tend\r\n\r\n\t\tscan(@token)\r\n\t\treturn @token.value\r\n end",
"def next(pointer); end",
"def next(pointer); end",
"def next(name = nil)\n previous_or_next('>', name)\n end",
"def next\n return nil if @struct.next.null?\n self.class.new(@struct.next)\n end",
"def getNextNodeElementName\n if (@nodeValues.size > @INDEX)\n if (@nodeAt < @nodeElements.size)\n retStr = @nodeElements[@nodeAt]\n return retStr.strip\n end\n return \"\"\n else\n return \"\"\n end\n end",
"def next\n next_tuple = @next_node.next()\n return nil if next_tuple.nil?\n @map_fn.call(next_tuple)\n end",
"def next(element_id)\n self.next(element_id, from: target)\n end",
"def next\n @tok ||= read_token\n @tok, tok = nil, @tok\n @prev = tok\n return tok\n end",
"def next\n @next||=after.first\n end",
"def next\n if @entry and @entry.next\n return @entry = @entry.next\n end\n\n while (@index += 1) < @capacity\n if @entry = @entries[@index]\n return @entry\n end\n end\n end",
"def next\n\t\tif @next_token\n\t\t\ttoken = @next_token\n\t\t\t@next_token = nil\n\t\t\treturn token\n\t\telse\n\t\t\ttoken = read_token\n\t\t\treturn token\n\t\tend\n\tend",
"def next(entry)\n if entry and entry = entry.next\n return entry\n end\n\n while (@index += 1) < @capacity\n if entry = @entries[@index]\n return entry\n end\n end\n end",
"def next_node\n @SuccessorReference.value\n end",
"def add_next_sibling(node_or_tags); end",
"def next_node(example)\n if example[@feature] <= @value || (example[@feature] - @value).abs < EPSI\n self.left\n else\n self.right\n end\n end",
"def _next_element\n unless @got_next_element\n unless @thread\n if @enum\n @thread = @queue._run_enum(@enum.each)\n else\n @thread = @queue._run(&@block)\n end\n end\n @next_element = @queue.pop\n if Exception === @next_element\n raise @next_element\n end\n @got_next_element = true\n end\n @next_element\n end",
"def next\n self.offset(1)\n end",
"def next\n next_row = @next_node.next()\n while next_row != nil\n # return row if it matches predicate\n return next_row if @predicate.call(next_row)\n # otherwise, keep calling next\n next_row = @next_node.next()\n end\n return nil\n end",
"def next\n token = next_token\n token = next_token while token&.empty?\n token\n end",
"def next_node(node)\n return nil if @weights.nil? || @weights.empty?\n\n w = @weights[node]\n return nil if w.nil? || w.empty?\n\n index = 0\n wmax = w[-1][1]\n beta = @random.rand(2 * wmax)\n while w[index][1] < beta\n beta -= w[index][1]\n index = (index + 1) % w.length\n end\n w[index][0]\n end",
"def next=(node_or_tags); end",
"def item_at_head\n\t\t\t@head.next\n\t\tend",
"def next\r\n next_values[0]\r\n end",
"def next\n block.instructions[index+1] || (block.next ? block.next.instructions.first : nil)\n end",
"def node_at(index)\n node = head\n index.times { node = node.next_node }\n node\n end",
"def next_node_name(node)\n next_node = node.next_sibling\n while next_node != nil\n break if next_node.element?\n next_node = next_node.next_sibling\n end\n\n if next_node && next_node.element?\n next_node.name.downcase\n end\n end",
"def next\n head = If.new(left, HeadCallable.new(left), ReturnNull.new)\n .result\n .call\n @left = If.new(left, TailCallable.new(left), ReturnNull.new)\n .result\n .call\n head\n end",
"def current()\n raise EOFError, \"no more elements available\" if end?\n _next_element\n end",
"def next=(node)\n @next = node\n end",
"def item_at(index)\n\t\t\telement = self.head\n\t\t\tcount = 0\n\t\t\twhile count < index\n\t\t\t\treturn nil if element.nil?\n\t\t\t\telement = element.next\n\t\t\t\tcount += 1\n\t\t\tend\n\t\t\telement\n\t\tend",
"def test_next_node\n list = LinkedList.new\n assert_equal nil, list.next_node\n end",
"def next\n if @tuple\n while (@tuple_index += 1) < @tuple_capacity\n if entry = @tuple[@tuple_index]\n return entry\n end\n end\n end\n\n while (@index += 1) < @capacity\n if @tuple = @entries[@index]\n @tuple_index = -1\n @tuple_capacity = @tuple.size\n return self.next\n end\n end\n\n @tuple = nil\n end",
"def next\n unless @push.nil?\n t = @push\n @push = nil\n return t\n end\n return nil if @input.nil?\n return nil if @input.size == 0\n return nil if @index >= @input.size\n\n t = @input[@index]\n @index += 1\n t\n end",
"def next_is? &block\n last? ? nil : yield(element, self.next)\n end",
"def each(node=@head)\n until node.nil?\n result = yield(node)\n node = node.next_node\n end\n result\n end",
"def peek_next(token)\r\n\t\tif !token.following.nil?\r\n\t\t return token.following\r\n\t\tend\r\n\r\n\t\tpeekToken = Token.new\r\n\t\tscan(peekToken)\r\n\t\ttoken.following = peekToken\r\n\t\treturn peekToken\r\n\tend",
"def next(pointer)\n super\n \n raise 'Not implemented'\n end",
"def at(index)\n node = @head\n index.times do\n node = node.next_node\n return nil if node.nil?\n end\n node\n end",
"def next\n @next\n end",
"def current\n return nil unless @node\n @node.item\n end",
"def find_next(*args)\n find(:next, *args)\n end",
"def find_next(*args)\n find(:next, *args)\n end",
"def next\n index = @@list.index(self)\n if (!index)\n raise \"ERROR: Can't find given player\"\n end\n\n return index + 1 < @@list.length ? @@list[index + 1] : @@list[0]\n end",
"def next_key\n @next && @next.key\n end",
"def set_next(node)\n @next_node = node\n end",
"def next\n last? ? nil : @collection[index + 1]\n end",
"def get_next_entry; end",
"def next_address\n list_entry[:next]\n end",
"def tag_list_next_at(index)\n @tags ||= []\n\n if index < @tags.size\n return @tags[index]\n elsif @next_tag_uri == nil\n # We're at the end of the list and there's nothing left to fetc\n return nil\n else\n tag_list_fetch_next\n\n # Try again\n return tag_list_next_at(index)\n end\n end",
"def next_item\n index = self.simple_acts_as_list_scope.index(self)\n self.simple_acts_as_list_scope[index + 1]\n end",
"def next\n @pointer += 1\n end",
"def get(pos)\n raise \"Error la posicion la debe indicar un entero\" unless ( pos.instance_of? Integer)\n raise \"Error posicion inadecuada\" unless ( pos <= @nodos )\n raise \"Error posicion inadecuada\" unless ( pos >= 0 )\n i = 0\n a = @head\n while i < pos\n i = i+1\n a = a.next\n end\n return a\n end",
"def next_token\n\t\tif ((tok = @tokensList.shift) != nil)\n\t\t\t@tokensAux << tok\n\t\t\treturn tok.idAndValue\n\t\telse\n\t\t\treturn nil\n\t\tend\n\tend",
"def has_next?()\n if @next_node\n return true\n else\n return false\n end\n end",
"def value_given_node_no_support(node_num)\n met_resp = analyze_head_support\n return nil if met_resp[:node].nil?\n\n node, counter = self.head.next_node, 1\n until node.nil? || counter == node_num\n counter += 1\n node = node.next_node\n end\n\n node\n end",
"def next\n if @next.is_a? TokenSource\n @next = @next.next\n return @next \n end\n @next\n end",
"def next\n units_sorted = self.order.units.sort_by {|unit| unit.id}\n if units_sorted.find_index(self) < units_sorted.length\n return units_sorted[units_sorted.find_index(self)+1]\n else\n return nil\n end\n end"
] |
[
"0.794192",
"0.77441555",
"0.7472502",
"0.74486667",
"0.73922247",
"0.7379621",
"0.729231",
"0.7101187",
"0.7099507",
"0.7029849",
"0.69311917",
"0.6923216",
"0.6899006",
"0.6849636",
"0.6727263",
"0.669937",
"0.66752076",
"0.6628868",
"0.6565717",
"0.65427136",
"0.6518837",
"0.64273643",
"0.64181846",
"0.63875973",
"0.6380319",
"0.6349856",
"0.63422203",
"0.6338392",
"0.63022065",
"0.6280342",
"0.6254753",
"0.6252595",
"0.6112059",
"0.61004865",
"0.60982716",
"0.60830134",
"0.6062917",
"0.60626525",
"0.60625184",
"0.6052383",
"0.60516787",
"0.60513765",
"0.60297453",
"0.600321",
"0.600321",
"0.5985017",
"0.5984836",
"0.59650004",
"0.5943365",
"0.5929061",
"0.59189177",
"0.5909015",
"0.589444",
"0.58942866",
"0.58882886",
"0.587855",
"0.58655876",
"0.58629555",
"0.5841312",
"0.5817909",
"0.58160156",
"0.5809913",
"0.58086574",
"0.58064735",
"0.58034945",
"0.57906836",
"0.5788623",
"0.57500565",
"0.5749124",
"0.57310146",
"0.57195514",
"0.56837875",
"0.56729597",
"0.56492096",
"0.5642684",
"0.56373614",
"0.56304526",
"0.5630369",
"0.5629178",
"0.5621732",
"0.5615284",
"0.5602548",
"0.56011844",
"0.5594314",
"0.5594314",
"0.55919385",
"0.55890995",
"0.55726546",
"0.5567584",
"0.5565125",
"0.5564958",
"0.55547976",
"0.55542004",
"0.5547619",
"0.5541789",
"0.5540465",
"0.5538816",
"0.55333453",
"0.55222374",
"0.55151474"
] |
0.8305558
|
0
|
Returns the next sibling of the current node
|
def next_sibling
return next_sibling_of @current_node
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def next_sibling\n return @links[:next_sibling]\n end",
"def next_sibling_of(node)\n\t\treturn valid(node) ? node.next_sibling : nil\n\tend",
"def nextSibling\n native_node.next_sibling && Browser.wrap_node(native_node.next_sibling)\n end",
"def next_element_sibling\n n = self.next_sibling\n while n do\n if n.node_type == ELEMENT_NODE then\n break\n end\n n = n.next_sibling\n end\n return n\n end",
"def get_next()\n return @next_node\n end",
"def next\n DOM::Element.from_node `#{@el}.nextElementSibling || Opal.nil`\n end",
"def next_node\n @current_node = @current_node.children[0]\n end",
"def next_sibling\n # Raise error in case we are root\n raise RationalNumberIsRootNoSiblingsError if root?\n\n _parent = self.parent # Get parent already to avoid duplicate calculations\n _position = ((@nv - _parent.nv) / _parent.snv) + 1\n value_from_parent_and_position(_parent, _position)\n end",
"def next_node\n @current_node = @current_node.children[0]\n end",
"def next\n value = `#{@el}.nextElementSibling || false`\n value ? DOM::Element.fromNode(value) : nil\n end",
"def next_sibling\n if siblings.where(project_id: project_id).any?\n sibs = self_and_siblings.order(:cached).pluck(:id)\n s = sibs.index(id)\n TaxonName.find(sibs[ s + 1] ) if s < sibs.length - 1\n else\n nil\n end\n end",
"def prev_sibling\n\t\treturn prev_sibling_of @current_node\n\tend",
"def next_node\n children.first || successor\n end",
"def next_element\n\t\treturn next_element_of @current_node\n\tend",
"def next_segment\n return nil if sibling_segments.empty?\n sibling_segments[sibling_segments.sort_by(&:index).index(self) + 1]\n end",
"def right_sibling\n right_siblings.first\n end",
"def sibling(name)\n parent && parent.find(name)\n end",
"def next_node\n peer = nil\n if !parent.nil? and parent.respond_to?(:children)\n index = parent.children.index(self)\n peer = parent.children[index + 1]\n end\n peer\n end",
"def sibling(node_id)\n node_id ^ 1\n end",
"def last_sibling\n node = self\n while node.next_sibling\n node = node.next_sibling\n end\n return node\n end",
"def add_next_sibling(node_or_tags); end",
"def first_sibling\n node = self\n while node.previous_sibling\n node = node.previous_sibling\n end\n return node\n end",
"def previous_sibling\n return @links[:previous_sibling]\n end",
"def next\n parent[parent.place(self) + 1]\n end",
"def next(name = nil)\n elements = self.class.all_siblings(self)\n elements = elements.where(:name => name) if name\n elements.where(\"position > ?\", self.position).order(\"position ASC\").limit(1)\n end",
"def next\n if has_next?\n node = @stack.pop\n # keep next ready\n look_left node.right if node.right\n node.data\n end\n end",
"def next_sibling=(other); end",
"def next(node)\n @path[@path.index(node) + 1]\n end",
"def prev_sibling_of(node)\n\t\treturn valid(node) ? node.previous_sibling : nil\n\tend",
"def find_next node\r\n return if node == nil\r\n\r\n if node.left != nil\r\n return node.left\r\n end\r\n\r\n node.right\r\nend",
"def next_node\n @SuccessorReference.value\n end",
"def next\n @next ||=\n if next_uri\n node_cache.fetch(next_uri) do\n node = self.class.new(node_cache, next_uri, adapter, graph)\n node.prev = self\n node\n end\n end\n end",
"def next_sibling(num = 1, scope = {})\n scope[:limit] = num\n siblings = next_siblings(scope)\n num == 1 ? siblings.first : siblings\n end",
"def previous_sibling\n return nil if parent.nil? # self is root\n return nil if 1 == parent.children.size # self is parent's only child\n if 0 == own_child_index\n return nil # self is first child\n else\n # return previous sibling\n parent.children[own_child_index - 1]\n end\n end",
"def right_sibling\n siblings.filter(self.class.qualified_left_column > left).first\n end",
"def left_sibling\n higher_items.last\n end",
"def right_sibling\n list.first(:position.gt => position)\n end",
"def next_siblings(scope = {})\n self.class.find_in_nested_set(:all, \n { :conditions => [\"#{scope_condition} AND #{sibling_condition} AND #{self.class.table_name}.id != ? AND #{prefixed_left_col_name} > ?\", self.id, self[right_col_name]], :order => \"#{prefixed_left_col_name} ASC\"}, scope)\n end",
"def TreeView_GetNextSibling(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TreeViewGetNextItem[:NEXT]) end",
"def get_next_node(node)\n i = node.number + 1\n i = 0 if i >= nodes.size\n get_node(i)\n end",
"def right_sibling\n siblings.\n where( arel[position_column].gt(self[position_column]) ).\n reorder( arel[position_column].asc ).\n first\n end",
"def next\n return nil unless @node\n @node = @node.next\n while @index < @table.size and @node == nil\n @index += 1\n @node = @table[@index]\n end\n return @node == nil ? nil : @node.item\n end",
"def previous_element_sibling\n n = self.previous_sibling\n while n do\n if n.node_type == ELEMENT_NODE then\n break\n end\n n = n.previous_sibling\n end\n return n\n end",
"def next_sibling_by_date\n siblings_by_date.where(\"starts_at >= ?\", starts_at)&.first\n end",
"def next\n return @tree_iterator.next\n end",
"def next_node(example)\n if example[@feature].to_s == @value\n self.left\n else\n self.right\n end\n end",
"def next_node(html_node)\n # Hack to prevent reading empty text nodes\n next_node = html_node.next\n is_empty = ( !next_node.nil? ) && next_node.text? && next_node.text.gsub(/[\\r\\n\\s]/, '').empty?\n while is_empty\n next_node = next_node.next\n is_empty = ( !next_node.nil? ) && next_node.text? && next_node.text.gsub(/[\\r\\n\\s]/, '').empty?\n end\n next_node\n end",
"def test_next_sibling\n setup_test_tree\n\n assert_nil(@root.next_sibling, \"Root does not have any next sibling\")\n assert_equal(@child2, @child1.next_sibling, \"Child1's next sibling is Child2\")\n assert_equal(@child3, @child2.next_sibling, \"Child2's next sibling is Child3\")\n assert_nil(@child3.next_sibling, \"Child3 does not have a next sibling\")\n assert_nil(@child4.next_sibling, \"Child4 does not have a next sibling\")\n end",
"def next\n next? ? @current + 1 : nil\n end",
"def right_sibling\n siblings.where(arel_table[numv_column_name].eq(snumv)).\n where(arel_table[denv_column_name].eq(sdenv)).first\n end",
"def next_element_of(node)\n\t\treturn valid(node) ? node.next_element : nil\n\tend",
"def add_previous_sibling(node_or_tags); end",
"def succ\n @nxt || self\n end",
"def sibling; end",
"def TreeView_GetPrevSibling(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TreeViewGetNextItem[:PREVIOUS]) end",
"def add_next_sibling(node_or_tags)\n raise ArgumentError.new(\"A document may not have multiple root nodes.\") if (parent && parent.document?) && !(node_or_tags.comment? || node_or_tags.processing_instruction?)\n\n add_sibling :next, node_or_tags\n end",
"def next\n @next && @next.value\n end",
"def left_sibling\n list.reverse.first(:position.lt => position)\n end",
"def parse_sibling(scanner)\n parse(scanner)\n end",
"def next(name = nil)\n previous_or_next('>', name)\n end",
"def next_token\r\n if !@token.following.nil?\r\n\t\t\t@token = @token.following\r\n\t\t\treturn @token.value\r\n\t\tend\r\n\r\n\t\tscan(@token)\r\n\t\treturn @token.value\r\n end",
"def next\r\n # if the path is empty attempt create the first path element \r\n if @path.empty?\r\n ords = get_data @base\r\n if ords.empty?\r\n # if the base ordering has no related orderings to traverse\r\n # return false \r\n return nil\r\n else\r\n #otherwise create the path element \r\n @path << IteratorPathElement.new(ords[0])\r\n return ords[0] \r\n end \r\n else\r\n # The path is not empty, we have to advance to the next element\r\n cur_elem = @path[-1]\r\n # We use the depth-first algorithm, check whether we can deepen first\r\n ords = get_data(cur_elem.cur_ordering)\r\n unless ords.empty?\r\n # deepen the path\r\n @path << IteratorPathElement.new(ords[0])\r\n return ords[0]\r\n else\r\n # move to next element\r\n \r\n # remove path elements which have enumerated already all their children \r\n until cur_elem.has_more?\r\n @path.pop\r\n if @path.empty?\r\n return nil\r\n end\r\n cur_elem = @path[-1]\r\n end\r\n \r\n #actually move to the next sibling element\r\n return cur_element.next\r\n end\r\n end\r\n end",
"def next\n if @stack.empty?\n node = nil\n return\n end\n node, which = @stack.pop\n @stack.push([node,2]) if node.type == 3 && which == 1\n node = which == 1 ? node.mid : node.right\n while node\n @stack.push([node,1])\n node = node.left\n end\n end",
"def get_prev()\n return @prev_node\n end",
"def add_sibling(other)\n if self.next_sibling\n old_sibling = self.next_sibling\n old_sibling.link(:previous_sibling, other)\n other.link(:next_sibling, old_sibling)\n end\n self.link(:next_sibling, other)\n other.link(:previous_sibling, self)\n end",
"def next()\n result = current\n @index += 1\n @got_next_element = false\n @next_element = nil\n result\n end",
"def next\n @tok ||= read_token\n @tok, tok = nil, @tok\n @prev = tok\n return tok\n end",
"def next_item\n return nil if @link == nil\n link.kernel.select {|item| item.rule == @rule}.first\n end",
"def adjacent(u)#node is the struct \n\t\ttemp = @adjacencylist.select {|list| list.first == u.node } \n\t\ttemp.first.shift\n\n\t\treturn temp.first\n\tend",
"def next_node(example)\n if example[@feature] <= @value || (example[@feature] - @value).abs < EPSI\n self.left\n else\n self.right\n end\n end",
"def previous_sibling\n if siblings.where(project_id: project_id).any?\n sibs = self_and_siblings.order(:cached).pluck(:id)\n\n s = sibs.index(id)\n TaxonName.find(sibs[s - 1]) if s != 0\n else\n nil\n end\n end",
"def next\n @next||=after.first\n end",
"def get_next()\n\t\t\treturn @next\n\t\tend",
"def next_node_name(node)\n next_node = node.next_sibling\n while next_node != nil\n break if next_node.element?\n next_node = next_node.next_sibling\n end\n\n if next_node && next_node.element?\n next_node.name.downcase\n end\n end",
"def predecessor\n siblings.previous(self) || parent\n end",
"def next_node(current, key)\n return nil, nil unless current[:key_length]\n next_key = key[0...current[:key_length]]\n if current[:nodes].has_key?(next_key)\n return current[:nodes][next_key], key[next_key.length..-1]\n else\n return nil, nil\n end\n end",
"def sibling_from_position(_position)\n raise RationalNumberIsRootNoSiblingsError if root?\n _parent = self.parent\n value_from_parent_and_position(_parent, _position)\n end",
"def find_subsequent()\n curr = self\n while !curr.next.nil?\n curr = curr.next \n return curr if yield curr\n end\n\n return nil\n end",
"def move_next\n\t\tself.current = self.current&.next\n\tend",
"def move_next\n\t\tself.current = self.current&.next\n\tend",
"def previous_sibling=(other); end",
"def next_element\n validates_possibility_of :next\n self.index += 1\n self.current\n end",
"def next\n if @next.is_a? TokenSource\n @next = @next.next\n return @next \n end\n @next\n end",
"def left_sibling\n siblings.\n where( arel[position_column].lt(self[position_column]) ).\n reorder( arel[position_column].desc ).\n first\n end",
"def assert_next_sibling(id, expected_sibling_id)\n wait_for(:message => \"id '#{id}' should be next to '#{expected_sibling_id}'\") do\n actual_sibling_id = get_eval(\"this.page().findElement('#{id}').nextSibling.id\")\n expected_sibling_id == actual_sibling_id\n end\n end",
"def left_sibling\n siblings.filter(self.class.qualified_left_column < left).order(self.class.qualified_left_column.desc).first\n end",
"def get_next\n\n if (@local_iterator)\n @local_iterator.get_next\n else\n raise \"No iterator defined! Cannot get next element\"\n end\n\n end",
"def current\n return nil unless @node\n @node.item\n end",
"def prev_element\n\t\treturn prev_element_of @current_node\n\tend",
"def has_next\n return !(self.next_node.nil?)\n end",
"def sibling_of?(node)\n self.read_attribute(self.ancestry_base_class.ancestry_column) == node.read_attribute(self.ancestry_base_class.ancestry_column)\n end",
"def next\n return nil unless @node\n @node = @node.next\n while @index < @table.size and @node == nil\n @index += 1\n @node = @table[@index]\n end\n @node == nil ? nil : (@is_value ? @node.value : @node.key)\n end",
"def next\n head = If.new(left, HeadCallable.new(left), ReturnNull.new)\n .result\n .call\n @left = If.new(left, TailCallable.new(left), ReturnNull.new)\n .result\n .call\n head\n end",
"def next_screen\n # print \"nxt: \" + id.to_s + \" - \" + title + \"\\n\"\n return children.all(:order => :position).first.first_screen if has_children?\n sibling_screen\n end",
"def left_sibling\n siblings.where(arel_table[snumv_column_name].eq(numv)).\n where(arel_table[sdenv_column_name].eq(denv)).first\n end",
"def has_next?()\n if @next_node\n return true\n else\n return false\n end\n end",
"def move_lower\n next_sib = next_sibling\n move_to_right_of(next_sib) if next_sib\n end",
"def next\n\n if (@local_iterator && @local_iterator.has_next?)\n @local_iterator.get_next\n else\n nil\n end\n\n end",
"def previous\n DOM::Element.from_node `#{@el}.previousElementSibling || Opal.nil`\n end",
"def right_sibling=(node)\n to = validate_sibling!(node)\n\n self.position = higher_than?(node) ? to.position - 1 : to.position\n self.parent_id = to.parent_id\n\n node\n end"
] |
[
"0.81352",
"0.80332613",
"0.77566147",
"0.75963545",
"0.7527461",
"0.75008225",
"0.7399003",
"0.7388899",
"0.7334685",
"0.7251409",
"0.72411394",
"0.7180755",
"0.71534973",
"0.7129781",
"0.69619197",
"0.6934453",
"0.68840724",
"0.68248236",
"0.6730522",
"0.6714905",
"0.6664826",
"0.6647676",
"0.66235393",
"0.65472156",
"0.6526229",
"0.64940536",
"0.6492012",
"0.64819443",
"0.64786845",
"0.6459297",
"0.6444874",
"0.64353585",
"0.6434316",
"0.63915384",
"0.63695973",
"0.6362095",
"0.6302006",
"0.62909114",
"0.62868977",
"0.6284818",
"0.6267259",
"0.62015146",
"0.6194849",
"0.61762613",
"0.6135737",
"0.6125205",
"0.61080885",
"0.61009914",
"0.60711753",
"0.6070542",
"0.60601664",
"0.6056191",
"0.6032649",
"0.6027069",
"0.6020108",
"0.59930927",
"0.5991075",
"0.5983734",
"0.59613544",
"0.5935134",
"0.5930538",
"0.59275186",
"0.59200805",
"0.59191304",
"0.59158355",
"0.5913124",
"0.59015477",
"0.58988637",
"0.58943623",
"0.58870345",
"0.5879324",
"0.587316",
"0.5851072",
"0.58416235",
"0.58320534",
"0.58184797",
"0.58125746",
"0.5810565",
"0.58021474",
"0.58021474",
"0.5778741",
"0.57648534",
"0.5734357",
"0.57287574",
"0.5722965",
"0.5711897",
"0.5696909",
"0.5688598",
"0.5652294",
"0.5643578",
"0.56320435",
"0.56300336",
"0.5611521",
"0.56099206",
"0.5564044",
"0.55494523",
"0.5545062",
"0.55442685",
"0.55419767",
"0.5530458"
] |
0.88003904
|
0
|
Returns the next sibling of the current node.
|
def next_sibling_of(node)
return valid(node) ? node.next_sibling : nil
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def next_sibling\n\t\treturn next_sibling_of @current_node\n\tend",
"def next_sibling\n return @links[:next_sibling]\n end",
"def nextSibling\n native_node.next_sibling && Browser.wrap_node(native_node.next_sibling)\n end",
"def next_element_sibling\n n = self.next_sibling\n while n do\n if n.node_type == ELEMENT_NODE then\n break\n end\n n = n.next_sibling\n end\n return n\n end",
"def get_next()\n return @next_node\n end",
"def next\n DOM::Element.from_node `#{@el}.nextElementSibling || Opal.nil`\n end",
"def next_sibling\n # Raise error in case we are root\n raise RationalNumberIsRootNoSiblingsError if root?\n\n _parent = self.parent # Get parent already to avoid duplicate calculations\n _position = ((@nv - _parent.nv) / _parent.snv) + 1\n value_from_parent_and_position(_parent, _position)\n end",
"def next_node\n @current_node = @current_node.children[0]\n end",
"def next_node\n @current_node = @current_node.children[0]\n end",
"def next_sibling\n if siblings.where(project_id: project_id).any?\n sibs = self_and_siblings.order(:cached).pluck(:id)\n s = sibs.index(id)\n TaxonName.find(sibs[ s + 1] ) if s < sibs.length - 1\n else\n nil\n end\n end",
"def next\n value = `#{@el}.nextElementSibling || false`\n value ? DOM::Element.fromNode(value) : nil\n end",
"def prev_sibling\n\t\treturn prev_sibling_of @current_node\n\tend",
"def next_segment\n return nil if sibling_segments.empty?\n sibling_segments[sibling_segments.sort_by(&:index).index(self) + 1]\n end",
"def next_node\n children.first || successor\n end",
"def next_element\n\t\treturn next_element_of @current_node\n\tend",
"def sibling(name)\n parent && parent.find(name)\n end",
"def right_sibling\n right_siblings.first\n end",
"def next_node\n peer = nil\n if !parent.nil? and parent.respond_to?(:children)\n index = parent.children.index(self)\n peer = parent.children[index + 1]\n end\n peer\n end",
"def last_sibling\n node = self\n while node.next_sibling\n node = node.next_sibling\n end\n return node\n end",
"def first_sibling\n node = self\n while node.previous_sibling\n node = node.previous_sibling\n end\n return node\n end",
"def sibling(node_id)\n node_id ^ 1\n end",
"def previous_sibling\n return @links[:previous_sibling]\n end",
"def next\n if has_next?\n node = @stack.pop\n # keep next ready\n look_left node.right if node.right\n node.data\n end\n end",
"def next\n @next ||=\n if next_uri\n node_cache.fetch(next_uri) do\n node = self.class.new(node_cache, next_uri, adapter, graph)\n node.prev = self\n node\n end\n end\n end",
"def find_next node\r\n return if node == nil\r\n\r\n if node.left != nil\r\n return node.left\r\n end\r\n\r\n node.right\r\nend",
"def previous_sibling\n return nil if parent.nil? # self is root\n return nil if 1 == parent.children.size # self is parent's only child\n if 0 == own_child_index\n return nil # self is first child\n else\n # return previous sibling\n parent.children[own_child_index - 1]\n end\n end",
"def next(node)\n @path[@path.index(node) + 1]\n end",
"def next_sibling(num = 1, scope = {})\n scope[:limit] = num\n siblings = next_siblings(scope)\n num == 1 ? siblings.first : siblings\n end",
"def next\n parent[parent.place(self) + 1]\n end",
"def prev_sibling_of(node)\n\t\treturn valid(node) ? node.previous_sibling : nil\n\tend",
"def next(name = nil)\n elements = self.class.all_siblings(self)\n elements = elements.where(:name => name) if name\n elements.where(\"position > ?\", self.position).order(\"position ASC\").limit(1)\n end",
"def right_sibling\n siblings.filter(self.class.qualified_left_column > left).first\n end",
"def get_next_node(node)\n i = node.number + 1\n i = 0 if i >= nodes.size\n get_node(i)\n end",
"def add_next_sibling(node_or_tags); end",
"def next\n return nil unless @node\n @node = @node.next\n while @index < @table.size and @node == nil\n @index += 1\n @node = @table[@index]\n end\n return @node == nil ? nil : @node.item\n end",
"def next_sibling=(other); end",
"def left_sibling\n higher_items.last\n end",
"def next_node\n @SuccessorReference.value\n end",
"def next_siblings(scope = {})\n self.class.find_in_nested_set(:all, \n { :conditions => [\"#{scope_condition} AND #{sibling_condition} AND #{self.class.table_name}.id != ? AND #{prefixed_left_col_name} > ?\", self.id, self[right_col_name]], :order => \"#{prefixed_left_col_name} ASC\"}, scope)\n end",
"def previous_element_sibling\n n = self.previous_sibling\n while n do\n if n.node_type == ELEMENT_NODE then\n break\n end\n n = n.previous_sibling\n end\n return n\n end",
"def next\n next? ? @current + 1 : nil\n end",
"def right_sibling\n siblings.\n where( arel[position_column].gt(self[position_column]) ).\n reorder( arel[position_column].asc ).\n first\n end",
"def TreeView_GetNextSibling(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TreeViewGetNextItem[:NEXT]) end",
"def right_sibling\n list.first(:position.gt => position)\n end",
"def next_token\r\n if !@token.following.nil?\r\n\t\t\t@token = @token.following\r\n\t\t\treturn @token.value\r\n\t\tend\r\n\r\n\t\tscan(@token)\r\n\t\treturn @token.value\r\n end",
"def next\n @tok ||= read_token\n @tok, tok = nil, @tok\n @prev = tok\n return tok\n end",
"def next_element_of(node)\n\t\treturn valid(node) ? node.next_element : nil\n\tend",
"def next(name = nil)\n previous_or_next('>', name)\n end",
"def next_sibling_by_date\n siblings_by_date.where(\"starts_at >= ?\", starts_at)&.first\n end",
"def next\n return @tree_iterator.next\n end",
"def test_next_sibling\n setup_test_tree\n\n assert_nil(@root.next_sibling, \"Root does not have any next sibling\")\n assert_equal(@child2, @child1.next_sibling, \"Child1's next sibling is Child2\")\n assert_equal(@child3, @child2.next_sibling, \"Child2's next sibling is Child3\")\n assert_nil(@child3.next_sibling, \"Child3 does not have a next sibling\")\n assert_nil(@child4.next_sibling, \"Child4 does not have a next sibling\")\n end",
"def add_next_sibling(node_or_tags)\n raise ArgumentError.new(\"A document may not have multiple root nodes.\") if (parent && parent.document?) && !(node_or_tags.comment? || node_or_tags.processing_instruction?)\n\n add_sibling :next, node_or_tags\n end",
"def right_sibling\n siblings.where(arel_table[numv_column_name].eq(snumv)).\n where(arel_table[denv_column_name].eq(sdenv)).first\n end",
"def succ\n @nxt || self\n end",
"def next()\n result = current\n @index += 1\n @got_next_element = false\n @next_element = nil\n result\n end",
"def next_node(html_node)\n # Hack to prevent reading empty text nodes\n next_node = html_node.next\n is_empty = ( !next_node.nil? ) && next_node.text? && next_node.text.gsub(/[\\r\\n\\s]/, '').empty?\n while is_empty\n next_node = next_node.next\n is_empty = ( !next_node.nil? ) && next_node.text? && next_node.text.gsub(/[\\r\\n\\s]/, '').empty?\n end\n next_node\n end",
"def next\n @next && @next.value\n end",
"def add_sibling(other)\n if self.next_sibling\n old_sibling = self.next_sibling\n old_sibling.link(:previous_sibling, other)\n other.link(:next_sibling, old_sibling)\n end\n self.link(:next_sibling, other)\n other.link(:previous_sibling, self)\n end",
"def next_node(example)\n if example[@feature].to_s == @value\n self.left\n else\n self.right\n end\n end",
"def next\n if @stack.empty?\n node = nil\n return\n end\n node, which = @stack.pop\n @stack.push([node,2]) if node.type == 3 && which == 1\n node = which == 1 ? node.mid : node.right\n while node\n @stack.push([node,1])\n node = node.left\n end\n end",
"def predecessor\n siblings.previous(self) || parent\n end",
"def next_node_name(node)\n next_node = node.next_sibling\n while next_node != nil\n break if next_node.element?\n next_node = next_node.next_sibling\n end\n\n if next_node && next_node.element?\n next_node.name.downcase\n end\n end",
"def next_node(current, key)\n return nil, nil unless current[:key_length]\n next_key = key[0...current[:key_length]]\n if current[:nodes].has_key?(next_key)\n return current[:nodes][next_key], key[next_key.length..-1]\n else\n return nil, nil\n end\n end",
"def TreeView_GetPrevSibling(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TreeViewGetNextItem[:PREVIOUS]) end",
"def previous_sibling\n if siblings.where(project_id: project_id).any?\n sibs = self_and_siblings.order(:cached).pluck(:id)\n\n s = sibs.index(id)\n TaxonName.find(sibs[s - 1]) if s != 0\n else\n nil\n end\n end",
"def next_item\n return nil if @link == nil\n link.kernel.select {|item| item.rule == @rule}.first\n end",
"def sibling_from_position(_position)\n raise RationalNumberIsRootNoSiblingsError if root?\n _parent = self.parent\n value_from_parent_and_position(_parent, _position)\n end",
"def left_sibling\n list.reverse.first(:position.lt => position)\n end",
"def get_next()\n\t\t\treturn @next\n\t\tend",
"def get_next\n\n if (@local_iterator)\n @local_iterator.get_next\n else\n raise \"No iterator defined! Cannot get next element\"\n end\n\n end",
"def next\r\n # if the path is empty attempt create the first path element \r\n if @path.empty?\r\n ords = get_data @base\r\n if ords.empty?\r\n # if the base ordering has no related orderings to traverse\r\n # return false \r\n return nil\r\n else\r\n #otherwise create the path element \r\n @path << IteratorPathElement.new(ords[0])\r\n return ords[0] \r\n end \r\n else\r\n # The path is not empty, we have to advance to the next element\r\n cur_elem = @path[-1]\r\n # We use the depth-first algorithm, check whether we can deepen first\r\n ords = get_data(cur_elem.cur_ordering)\r\n unless ords.empty?\r\n # deepen the path\r\n @path << IteratorPathElement.new(ords[0])\r\n return ords[0]\r\n else\r\n # move to next element\r\n \r\n # remove path elements which have enumerated already all their children \r\n until cur_elem.has_more?\r\n @path.pop\r\n if @path.empty?\r\n return nil\r\n end\r\n cur_elem = @path[-1]\r\n end\r\n \r\n #actually move to the next sibling element\r\n return cur_element.next\r\n end\r\n end\r\n end",
"def move_next\n\t\tself.current = self.current&.next\n\tend",
"def move_next\n\t\tself.current = self.current&.next\n\tend",
"def get_prev()\n return @prev_node\n end",
"def next\n if @next.is_a? TokenSource\n @next = @next.next\n return @next \n end\n @next\n end",
"def parse_sibling(scanner)\n parse(scanner)\n end",
"def current\n return nil unless @node\n @node.item\n end",
"def next\n @next||=after.first\n end",
"def left_sibling\n siblings.filter(self.class.qualified_left_column < left).order(self.class.qualified_left_column.desc).first\n end",
"def right_sibling=(node)\n to = validate_sibling!(node)\n\n self.position = higher_than?(node) ? to.position - 1 : to.position\n self.parent_id = to.parent_id\n\n node\n end",
"def next_node(example)\n if example[@feature] <= @value || (example[@feature] - @value).abs < EPSI\n self.left\n else\n self.right\n end\n end",
"def find_subsequent()\n curr = self\n while !curr.next.nil?\n curr = curr.next \n return curr if yield curr\n end\n\n return nil\n end",
"def adjacent(u)#node is the struct \n\t\ttemp = @adjacencylist.select {|list| list.first == u.node } \n\t\ttemp.first.shift\n\n\t\treturn temp.first\n\tend",
"def next\n return nil unless @node\n @node = @node.next\n while @index < @table.size and @node == nil\n @index += 1\n @node = @table[@index]\n end\n @node == nil ? nil : (@is_value ? @node.value : @node.key)\n end",
"def add_previous_sibling(node_or_tags); end",
"def next\n index = @@list.index(self)\n if (!index)\n raise \"ERROR: Can't find given player\"\n end\n\n return index + 1 < @@list.length ? @@list[index + 1] : @@list[0]\n end",
"def sibling; end",
"def sibling_of?(node)\n self.read_attribute(self.ancestry_base_class.ancestry_column) == node.read_attribute(self.ancestry_base_class.ancestry_column)\n end",
"def next_element\n validates_possibility_of :next\n self.index += 1\n self.current\n end",
"def next\n\n if (@local_iterator && @local_iterator.has_next?)\n @local_iterator.get_next\n else\n nil\n end\n\n end",
"def left_sibling\n siblings.\n where( arel[position_column].lt(self[position_column]) ).\n reorder( arel[position_column].desc ).\n first\n end",
"def assert_next_sibling(id, expected_sibling_id)\n wait_for(:message => \"id '#{id}' should be next to '#{expected_sibling_id}'\") do\n actual_sibling_id = get_eval(\"this.page().findElement('#{id}').nextSibling.id\")\n expected_sibling_id == actual_sibling_id\n end\n end",
"def next\n head = If.new(left, HeadCallable.new(left), ReturnNull.new)\n .result\n .call\n @left = If.new(left, TailCallable.new(left), ReturnNull.new)\n .result\n .call\n head\n end",
"def next_item\n index = self.simple_acts_as_list_scope.index(self)\n self.simple_acts_as_list_scope[index + 1]\n end",
"def has_next\n return !(self.next_node.nil?)\n end",
"def next_key\n @next && @next.key\n end",
"def next\n\t\tif @next_token\n\t\t\ttoken = @next_token\n\t\t\t@next_token = nil\n\t\t\treturn token\n\t\telse\n\t\t\ttoken = read_token\n\t\t\treturn token\n\t\tend\n\tend",
"def next\n block.instructions[index+1] || (block.next ? block.next.instructions.first : nil)\n end",
"def previous_sibling=(other); end",
"def sibling_on(peer)\n\t if sibling = remote_siblings[peer] then sibling\n\t elsif Roby::Distributed == peer then self\n\t else \n\t\traise RemotePeerMismatch, \"#{self} has no known sibling on #{peer}\"\n\t end\n\tend"
] |
[
"0.859301",
"0.7917772",
"0.7579492",
"0.7487571",
"0.7276858",
"0.7193409",
"0.7192539",
"0.7075441",
"0.7037588",
"0.6996282",
"0.69843125",
"0.6909993",
"0.69076943",
"0.6900498",
"0.6832504",
"0.670869",
"0.6684521",
"0.6634229",
"0.66265196",
"0.6524457",
"0.6457342",
"0.63770777",
"0.6374118",
"0.63048273",
"0.62832177",
"0.6281403",
"0.6253344",
"0.6252747",
"0.6243001",
"0.62401414",
"0.6225091",
"0.61674833",
"0.6099158",
"0.60930645",
"0.6082992",
"0.604783",
"0.6044651",
"0.60262257",
"0.59800637",
"0.5963521",
"0.5936832",
"0.5922912",
"0.5890128",
"0.587725",
"0.58733433",
"0.586427",
"0.58553064",
"0.58308595",
"0.5824711",
"0.5811085",
"0.58021814",
"0.57604873",
"0.5724013",
"0.5723405",
"0.5711168",
"0.5710657",
"0.5699109",
"0.5690206",
"0.5688352",
"0.5661046",
"0.5650425",
"0.5643951",
"0.5626322",
"0.5625899",
"0.561886",
"0.5612944",
"0.55984575",
"0.5594603",
"0.55720335",
"0.5571228",
"0.5553571",
"0.55449796",
"0.55449796",
"0.5542454",
"0.55400485",
"0.55108166",
"0.5502747",
"0.55005497",
"0.54839075",
"0.5482471",
"0.5467694",
"0.54524285",
"0.5446953",
"0.5443409",
"0.54331225",
"0.54330456",
"0.54298073",
"0.54279315",
"0.54062164",
"0.5394249",
"0.53885084",
"0.5379173",
"0.53655267",
"0.53562915",
"0.53382844",
"0.53153515",
"0.53124917",
"0.53085685",
"0.5298537",
"0.52794456"
] |
0.7919493
|
1
|
Yields current node and all children of the current node to block.
|
def traverse(&block)
traverse(@current_node, &block)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def each_node(&block)\n c = children # save children before yield\n yield(self)\n c.each do |n|\n n.each_node(&block)\n end\n end",
"def each\n self.traverse_down { |node| yield(node) }\n end",
"def each(&block)\n yield self\n children.each {|c| c.each(&block)}\n end",
"def each\n @children.each { |child| yield child }\n end",
"def each\n @children.each {|child| yield child}\n end",
"def each_child(&block) # :yields: child_node\n children.each(&block)\n nil\n end",
"def each\n yield self\n children.each {|c| c.each {|n| yield n}}\n end",
"def each_child(&_block)\n @children.each { |child| yield child }\n end",
"def each\n @node_set.each do |c|\n yield NodeProxy.new(c, parent)\n end\n end",
"def each\n @node_set.each do |c|\n yield NodeProxy.new(c, parent)\n end\n end",
"def walk(&blk)\n yield self\n self.each_child do |child|\n child.walk(&blk)\n end\n end",
"def each\n queue = [@root]\n until queue.empty?\n node = queue.shift\n queue += node.children\n yield node\n end\n end",
"def walk &blk\n self.children.each do |child|\n yield child\n end\n self.children.each do |child|\n child.walk &blk\n end\n end",
"def each_child\n @children.each { |child| yield child }\n end",
"def each_child\n @children.each { |child| yield child }\n end",
"def each_node(&block)\n nodes.each_node &block\n end",
"def each_node(&block)\n nodes.each_node &block\n end",
"def each(&block)\n tree.each(&block)\n end",
"def each(node, &block)\n visit(node, &block)\n end",
"def visit_all(&block)\n visit &block\n children.each {|c| c.visit_all &block}\n end",
"def visit(node, &block)\n before = current.dup\n enter(node)\n yield node, current, before\n node.children.each do |child|\n if child.kind_of?(Parser::AST::Node)\n visit(child, &block)\n end\n end\n leave(node)\n end",
"def traverse(&block)\n children.each{|j| j.traverse(&block) }\n block.call(self)\n end",
"def traverse(&block)\n children.each { |j| j.traverse(&block) }\n block.call(self)\n end",
"def each_node(&block)\n nodes.each(&block)\n end",
"def each(&block)\n return enum_for(:each) unless block_given?\n visit { |node| yield node }\n self\n end",
"def each_node(&block)\n\t\t\tnodes.each(&block)\n\t\tend",
"def each_node\n list_nodes.each do |node|\n yield node\n end\n end",
"def process_self_and_descendants\n yield self\n descendants.each { |item| yield(item) }\n end",
"def each(&block)\n block.call(self)\n @child_array.each do |node|\n node.each(&block)\n end\n end",
"def each_child\n childptr = CMark.node_first_child(@pointer)\n while not childptr.null? do\n nextptr = CMark.node_next(childptr)\n yield Node.new(nil, childptr)\n childptr = nextptr\n end\n end",
"def each_node(&block)\r\n @nodes.each { |node| block.call(node) }\r\n end",
"def traverse\n nodes = [self]\n until nodes.empty?\n node = nodes.pop\n yield node\n nodes += node.children.reverse unless node.children.empty?\n end\n end",
"def each_child\n @children.each_pair { |_, child| yield child }\n end",
"def each(node, &block); end",
"def each_recursive(&block)\n tree.each_recursive(&block)\n end",
"def each_node(&block)\n @nodes.each &block\n end",
"def each_node(&block)\n @nodes.each &block\n end",
"def each\n queue = [@root]\n until queue.empty?\n kids = queue.shift.children\n kids.each do |x| yield x end\n queue.concat kids\n end\n end",
"def traverse(parent, &block)\n\n end",
"def each\n return to_enum(__callee__) unless block_given?\n\n node = self\n loop do\n yield node\n break unless (node = node.next_node)\n end\n end",
"def each_child(&block)\n children.each do | child |\n yield(child)\n child.each_child &block unless child.leaf?\n end\n end",
"def each(&block)\n root.each(&block)\n end",
"def each_descendant(include_self=false)\n if include_self\n node_queue=[self]\n else\n node_queue=self.children.values\n end\n until node_queue.empty? do\n node_queue.concat node_queue.first.children.values\n yield node_queue.shift\n end\n end",
"def each(&block)\n node = first\n\n while node\n if block\n block.yield(node)\n end\n\n if node.next\n node = node.next\n else\n break\n end\n end\n\n return node\n end",
"def each(&block)\n sorted_children.each do |name, child|\n yield(name, child)\n end\n end",
"def traverse(parent, &block)\n @source_elements.traverse(self, &block)\n yield parent, self\n end",
"def each_node(&block)\n nodes.each_value(&block)\n end",
"def each(&block)\n each_node([], @root, block)\n end",
"def process_descendants_and_self\n descendants.reverse.each { |item| yield(item) }\n yield self\n end",
"def each(&block)\n root.each(&block)\n end",
"def each(&block)\n node = top\n\n while node\n if block\n block.yield(node)\n end\n\n if node.previous\n node = node.previous\n else\n break\n end\n end\n\n return node\n end",
"def all_children\n\n yielded_self = if block_given?\n yield self\n end\n\n return ( yielded_self || self ) if self.children.empty?\n _child = self.children.map do |child|\n _name = (yield child if block_given?) || self\n if child.children.empty?\n _name\n else\n [_name, child.all_children{ |this_child| yield this_child if block_given? }]\n end\n end\n return _child\n end",
"def iterate_children(ts, block, new_model)\n ts.children.each do |cs|\n # assumes there is only one element - could iterate instead but what case would that be?\n element = block.css(cs.selector).first\n\n handle_element(cs, element, new_model)\n end # end top selector children iteration\n end",
"def each_parent\n code_object = self\n\n while code_object = code_object.parent do\n yield code_object\n end\n\n self\n end",
"def traverse(parent, &block)\n _self = self\n @statement_list.each do|st|\n st.traverse(self, &block)\n end\n yield parent, self\n end",
"def each &block\n @root.each(&block)\n end",
"def iterate\n return unless block_given?\n\n current_node = @head\n\n until current_node.nil?\n yield current_node\n\n current_node = current_node.next\n end\n end",
"def traverse_down(&block)\n block.call(self)\n if(!children.nil?)\n children.each{ |child| child.traverse_down(&block) }\n end\n end",
"def traverse(&block); end",
"def traverse(&block); end",
"def each_leaf!\n raise \"Method not yet written.\"\n\n self.each do |leaf|\n yield(leaf)\n end\n end",
"def each &block\n return enum_for(:each) unless block_given?\n return if !@root\n @root.each &block\n end",
"def yields\n parsed {\n @yields\n }\n end",
"def each\n node = @head\n while node\n yield node\n node = node.next_node\n end\n end",
"def each\n root.each do |node, mode, stack|\n if mode == :on_enter\n yield(node.blob_address, node.size)\n end\n end\n end",
"def each(&block)\n axis_iterator(:child).each(&block)\n end",
"def eachNode(&block)\n @nodeSets.each { |s|\n s.eachNode &block\n }\n end",
"def each(&block)\n # get the first\n node=getnext([])\n $DEBUG.puts \"each: first node is #{node}\"\n while node\n block.call node\n oldnode=node\n node=getnext(node.oid)\n $DEBUG.puts \"each: next of #{oldnode} is #{node}\"\n end\n end",
"def block_node; end",
"def block_node; end",
"def each &block\n collection = self.collection\n if prefix = prefix_with_delim\n collection = collection.with_prefix(prefix)\n end\n collection.each(:delimiter => delimiter) do |member|\n case\n when member.respond_to?(:key)\n yield LeafNode.new(parent, member)\n when member.respond_to?(:prefix)\n yield BranchNode.new(parent, member,\n :delimiter => delimiter,\n :append => append?)\n end\n end\n nil\n end",
"def map_nodes!(&ruby_block)\n @child = ruby_block.call(@child)\n @child.parent = self unless @child.parent\n end",
"def each\n\t\treturn nil unless block_given?\n\n\t\tcurrent = self.head\n\t\twhile current\n\t\t\tyield current\n\t\t\tcurrent = current.next\n\t\tend\n\tend",
"def each(&block)\n node = @Node.new(nil,nil,nil)\n node = @head\n\n while !(node.nil?)\n yield node.value\n\n node = node.next\n end\n end",
"def each_with_level &block\n # @todo A bit of a hack that I would like to fix one day...\n @root.children.each do |element|\n recursive_each_with_level element, 1, block\n end\n end",
"def each_node(&block)\n block.call(@value)\n @left.each_node(&block) if @left\n @right.each_node(&block) if @right\n end",
"def bft(&block)\n queue = Queue.new\n \n # Set all nodes to not enqueued\n self.each do |node|\n node.enqueued = false\n end\n\n queue.push(self) \n self.enqueued = true\n\n while(queue.size > 0)\n # Get next node in the queue\n node = queue.pop\n \n # Pass node off to block\n block.call(node)\n\n # Enqueue all children nodes\n node.child_array.each do |child|\n if !child.enqueued\n queue.push(child)\n child.enqueued = true\n end\n end\n\n end #while\n end",
"def each\n\n this_node = @head\n\n size.times do |i|\n yield this_node.value\n this_node = this_node.child\n end\n\n return self\n end",
"def block_children(options = {})\n throw ArgumentError.new('Required arguments :block_id missing') if options[:block_id].nil?\n if block_given?\n Pagination::Cursor.new(self, :block_children, options).each do |page|\n yield page\n end\n else\n get(\"blocks/#{options[:block_id]}/children\", options.except(:block_id))\n end\n end",
"def traverse(include_self = false, &block)\n return enum_for(__method__, include_self) unless block_given?\n\n block.call(:enter, self, 0) if include_self\n\n each_with_index do |exp, index|\n if exp.terminal?\n block.call(:visit, exp, index)\n else\n block.call(:enter, exp, index)\n exp.traverse(&block)\n block.call(:exit, exp, index)\n end\n end\n\n block.call(:exit, self, 0) if include_self\n\n self\n end",
"def each\n each_node do |node|\n yield(node_key(node), node_value(node))\n end \n end",
"def each\n each_node do |node|\n yield(node_key(node), node_value(node))\n end \n end",
"def each\n Directory.all.each do |node_id|\n yield find node_id\n end\n end",
"def each\n if @cypher_block || @cypher_query_hash\n query(@cypher_query_hash, &@cypher_block).each { |i| yield i }\n else\n @decl_rel.each_node(@node) { |n| yield n } # Should use yield here as passing &block through doesn't always work (why?)\n end\n end",
"def each\n return enum_for(__method__) unless block_given?\n return if @head.nil?\n\n traverser = @head\n\n until traverser.nil?\n yield traverser\n traverser = traverser.next_node\n end\n end",
"def each\n return enum_for(__method__) unless block_given?\n return if @head.nil?\n\n traverser = @head\n\n until traverser.nil?\n yield traverser\n traverser = traverser.next_node\n end\n end",
"def traverse obj=self, &block\n case\n when obj.respond_to?(:parent?) && obj.respond_to?(:child?)\n block.call obj\n obj.children.each { |c| traverse(c, &block) }\n when obj.respond_to?(:parent?)\n obj.children.each { |c| traverse(c, &block) }\n when obj.respond_to?(:child?)\n block.call obj\n end\n end",
"def traverse(&blk)\n while value = @generator.resume\n blk.call(value)\n end\n end",
"def each_sequence_member()\n node = self\n container_type = type()\n \n done = false\n until done\n done = true\n node.component_nodes.each do |child_node|\n if child_node.type == container_type then\n node = child_node\n done = false\n else\n yield( child_node )\n end\n end\n end\n end",
"def each_sequence_member()\n node = self\n container_type = type()\n \n done = false\n until done\n done = true\n node.component_nodes.each do |child_node|\n if child_node.type == container_type then\n node = child_node\n done = false\n else\n yield( child_node )\n end\n end\n end\n end",
"def iterating_block?(node); end",
"def process_child_nodes(node); end",
"def each\n @descendants.each { |model| yield model }\n self\n end",
"def traverse_bfs\n q = Queue.new\n q.push @tree\n \n loop do\n break if q.empty?\n node = q.shift\n if block_given?\n yield node\n else\n @visited << node.data\n end\n node.children.each{ |n| q.push n } if node.children\n end\n end",
"def traverse(node, &block)\n\t\tif valid(node)\tthen\n\t\t\tnode.traverse(&block)\n\t\tend\n\tend",
"def each_child\n self.class.child_references.each do |child_attr|\n children = Array(self.send(child_attr)).clone\n children.each do |child|\n yield(child)\n end\n end\n end",
"def apply_to_children(&block)\n self.entities.each do |entity|\n block.call(entity)\n entity.apply_to_children(&block)\n end\n end",
"def each_child\n \n end",
"def map_nodes!(&ruby_block)\n # A block? Apply it on each child.\n @value = ruby_block.call(@value)\n map_whens!(&ruby_block)\n if @default then\n @default = ruby_block.call(@default)\n @default.parent = self unless @default.parent\n end\n end",
"def block\n (@blocks ||= Array.new) << Block.new\n @in_block = @blocks.last\n yield\n @in_block = nil\n end"
] |
[
"0.79474133",
"0.7762521",
"0.7440448",
"0.735163",
"0.7344119",
"0.73345834",
"0.72829",
"0.72754395",
"0.7275258",
"0.72581697",
"0.7170762",
"0.71493",
"0.71463215",
"0.7119479",
"0.7107122",
"0.7079481",
"0.7079481",
"0.7048346",
"0.70361125",
"0.701071",
"0.70075876",
"0.70040315",
"0.6998574",
"0.6988517",
"0.69850373",
"0.69656646",
"0.69474214",
"0.6908918",
"0.6903049",
"0.6901569",
"0.6865175",
"0.68554723",
"0.67902404",
"0.6780647",
"0.6775862",
"0.6773411",
"0.6773411",
"0.6765652",
"0.6759305",
"0.67575616",
"0.67539847",
"0.6746214",
"0.6730213",
"0.66986674",
"0.6697554",
"0.6689273",
"0.6682333",
"0.6665438",
"0.66518307",
"0.66263187",
"0.66250503",
"0.6587136",
"0.65596527",
"0.6534899",
"0.65222394",
"0.65170074",
"0.6506688",
"0.65003747",
"0.6479088",
"0.6479088",
"0.6476427",
"0.64389384",
"0.64243513",
"0.64092124",
"0.6403104",
"0.6389629",
"0.6385234",
"0.637867",
"0.6364499",
"0.6364499",
"0.6354877",
"0.6354739",
"0.63464767",
"0.63456416",
"0.6338737",
"0.6330205",
"0.63161486",
"0.6314277",
"0.62888056",
"0.6240044",
"0.6238147",
"0.6238147",
"0.62361145",
"0.6231733",
"0.62313014",
"0.62313014",
"0.6217806",
"0.62119126",
"0.6207385",
"0.6207385",
"0.6203638",
"0.61754483",
"0.61726964",
"0.61707145",
"0.616892",
"0.6167262",
"0.6166907",
"0.61618",
"0.616011",
"0.6148617"
] |
0.7158805
|
11
|
Yields current node and all children of the current node to block.
|
def traverse(node, &block)
if valid(node) then
node.traverse(&block)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def each_node(&block)\n c = children # save children before yield\n yield(self)\n c.each do |n|\n n.each_node(&block)\n end\n end",
"def each\n self.traverse_down { |node| yield(node) }\n end",
"def each(&block)\n yield self\n children.each {|c| c.each(&block)}\n end",
"def each\n @children.each { |child| yield child }\n end",
"def each\n @children.each {|child| yield child}\n end",
"def each_child(&block) # :yields: child_node\n children.each(&block)\n nil\n end",
"def each\n yield self\n children.each {|c| c.each {|n| yield n}}\n end",
"def each_child(&_block)\n @children.each { |child| yield child }\n end",
"def each\n @node_set.each do |c|\n yield NodeProxy.new(c, parent)\n end\n end",
"def each\n @node_set.each do |c|\n yield NodeProxy.new(c, parent)\n end\n end",
"def walk(&blk)\n yield self\n self.each_child do |child|\n child.walk(&blk)\n end\n end",
"def traverse(&block)\n\t\ttraverse(@current_node, &block)\n\tend",
"def each\n queue = [@root]\n until queue.empty?\n node = queue.shift\n queue += node.children\n yield node\n end\n end",
"def walk &blk\n self.children.each do |child|\n yield child\n end\n self.children.each do |child|\n child.walk &blk\n end\n end",
"def each_child\n @children.each { |child| yield child }\n end",
"def each_child\n @children.each { |child| yield child }\n end",
"def each_node(&block)\n nodes.each_node &block\n end",
"def each_node(&block)\n nodes.each_node &block\n end",
"def each(&block)\n tree.each(&block)\n end",
"def each(node, &block)\n visit(node, &block)\n end",
"def visit_all(&block)\n visit &block\n children.each {|c| c.visit_all &block}\n end",
"def visit(node, &block)\n before = current.dup\n enter(node)\n yield node, current, before\n node.children.each do |child|\n if child.kind_of?(Parser::AST::Node)\n visit(child, &block)\n end\n end\n leave(node)\n end",
"def traverse(&block)\n children.each{|j| j.traverse(&block) }\n block.call(self)\n end",
"def traverse(&block)\n children.each { |j| j.traverse(&block) }\n block.call(self)\n end",
"def each_node(&block)\n nodes.each(&block)\n end",
"def each(&block)\n return enum_for(:each) unless block_given?\n visit { |node| yield node }\n self\n end",
"def each_node(&block)\n\t\t\tnodes.each(&block)\n\t\tend",
"def each_node\n list_nodes.each do |node|\n yield node\n end\n end",
"def process_self_and_descendants\n yield self\n descendants.each { |item| yield(item) }\n end",
"def each(&block)\n block.call(self)\n @child_array.each do |node|\n node.each(&block)\n end\n end",
"def each_child\n childptr = CMark.node_first_child(@pointer)\n while not childptr.null? do\n nextptr = CMark.node_next(childptr)\n yield Node.new(nil, childptr)\n childptr = nextptr\n end\n end",
"def each_node(&block)\r\n @nodes.each { |node| block.call(node) }\r\n end",
"def traverse\n nodes = [self]\n until nodes.empty?\n node = nodes.pop\n yield node\n nodes += node.children.reverse unless node.children.empty?\n end\n end",
"def each_child\n @children.each_pair { |_, child| yield child }\n end",
"def each(node, &block); end",
"def each_recursive(&block)\n tree.each_recursive(&block)\n end",
"def each_node(&block)\n @nodes.each &block\n end",
"def each_node(&block)\n @nodes.each &block\n end",
"def each\n queue = [@root]\n until queue.empty?\n kids = queue.shift.children\n kids.each do |x| yield x end\n queue.concat kids\n end\n end",
"def traverse(parent, &block)\n\n end",
"def each\n return to_enum(__callee__) unless block_given?\n\n node = self\n loop do\n yield node\n break unless (node = node.next_node)\n end\n end",
"def each_child(&block)\n children.each do | child |\n yield(child)\n child.each_child &block unless child.leaf?\n end\n end",
"def each(&block)\n root.each(&block)\n end",
"def each_descendant(include_self=false)\n if include_self\n node_queue=[self]\n else\n node_queue=self.children.values\n end\n until node_queue.empty? do\n node_queue.concat node_queue.first.children.values\n yield node_queue.shift\n end\n end",
"def each(&block)\n node = first\n\n while node\n if block\n block.yield(node)\n end\n\n if node.next\n node = node.next\n else\n break\n end\n end\n\n return node\n end",
"def each(&block)\n sorted_children.each do |name, child|\n yield(name, child)\n end\n end",
"def traverse(parent, &block)\n @source_elements.traverse(self, &block)\n yield parent, self\n end",
"def each_node(&block)\n nodes.each_value(&block)\n end",
"def each(&block)\n each_node([], @root, block)\n end",
"def process_descendants_and_self\n descendants.reverse.each { |item| yield(item) }\n yield self\n end",
"def each(&block)\n root.each(&block)\n end",
"def each(&block)\n node = top\n\n while node\n if block\n block.yield(node)\n end\n\n if node.previous\n node = node.previous\n else\n break\n end\n end\n\n return node\n end",
"def all_children\n\n yielded_self = if block_given?\n yield self\n end\n\n return ( yielded_self || self ) if self.children.empty?\n _child = self.children.map do |child|\n _name = (yield child if block_given?) || self\n if child.children.empty?\n _name\n else\n [_name, child.all_children{ |this_child| yield this_child if block_given? }]\n end\n end\n return _child\n end",
"def iterate_children(ts, block, new_model)\n ts.children.each do |cs|\n # assumes there is only one element - could iterate instead but what case would that be?\n element = block.css(cs.selector).first\n\n handle_element(cs, element, new_model)\n end # end top selector children iteration\n end",
"def each_parent\n code_object = self\n\n while code_object = code_object.parent do\n yield code_object\n end\n\n self\n end",
"def traverse(parent, &block)\n _self = self\n @statement_list.each do|st|\n st.traverse(self, &block)\n end\n yield parent, self\n end",
"def each &block\n @root.each(&block)\n end",
"def iterate\n return unless block_given?\n\n current_node = @head\n\n until current_node.nil?\n yield current_node\n\n current_node = current_node.next\n end\n end",
"def traverse_down(&block)\n block.call(self)\n if(!children.nil?)\n children.each{ |child| child.traverse_down(&block) }\n end\n end",
"def traverse(&block); end",
"def traverse(&block); end",
"def each_leaf!\n raise \"Method not yet written.\"\n\n self.each do |leaf|\n yield(leaf)\n end\n end",
"def each &block\n return enum_for(:each) unless block_given?\n return if !@root\n @root.each &block\n end",
"def yields\n parsed {\n @yields\n }\n end",
"def each\n node = @head\n while node\n yield node\n node = node.next_node\n end\n end",
"def each\n root.each do |node, mode, stack|\n if mode == :on_enter\n yield(node.blob_address, node.size)\n end\n end\n end",
"def each(&block)\n axis_iterator(:child).each(&block)\n end",
"def eachNode(&block)\n @nodeSets.each { |s|\n s.eachNode &block\n }\n end",
"def each(&block)\n # get the first\n node=getnext([])\n $DEBUG.puts \"each: first node is #{node}\"\n while node\n block.call node\n oldnode=node\n node=getnext(node.oid)\n $DEBUG.puts \"each: next of #{oldnode} is #{node}\"\n end\n end",
"def block_node; end",
"def block_node; end",
"def each &block\n collection = self.collection\n if prefix = prefix_with_delim\n collection = collection.with_prefix(prefix)\n end\n collection.each(:delimiter => delimiter) do |member|\n case\n when member.respond_to?(:key)\n yield LeafNode.new(parent, member)\n when member.respond_to?(:prefix)\n yield BranchNode.new(parent, member,\n :delimiter => delimiter,\n :append => append?)\n end\n end\n nil\n end",
"def map_nodes!(&ruby_block)\n @child = ruby_block.call(@child)\n @child.parent = self unless @child.parent\n end",
"def each\n\t\treturn nil unless block_given?\n\n\t\tcurrent = self.head\n\t\twhile current\n\t\t\tyield current\n\t\t\tcurrent = current.next\n\t\tend\n\tend",
"def each(&block)\n node = @Node.new(nil,nil,nil)\n node = @head\n\n while !(node.nil?)\n yield node.value\n\n node = node.next\n end\n end",
"def each_with_level &block\n # @todo A bit of a hack that I would like to fix one day...\n @root.children.each do |element|\n recursive_each_with_level element, 1, block\n end\n end",
"def each_node(&block)\n block.call(@value)\n @left.each_node(&block) if @left\n @right.each_node(&block) if @right\n end",
"def bft(&block)\n queue = Queue.new\n \n # Set all nodes to not enqueued\n self.each do |node|\n node.enqueued = false\n end\n\n queue.push(self) \n self.enqueued = true\n\n while(queue.size > 0)\n # Get next node in the queue\n node = queue.pop\n \n # Pass node off to block\n block.call(node)\n\n # Enqueue all children nodes\n node.child_array.each do |child|\n if !child.enqueued\n queue.push(child)\n child.enqueued = true\n end\n end\n\n end #while\n end",
"def each\n\n this_node = @head\n\n size.times do |i|\n yield this_node.value\n this_node = this_node.child\n end\n\n return self\n end",
"def block_children(options = {})\n throw ArgumentError.new('Required arguments :block_id missing') if options[:block_id].nil?\n if block_given?\n Pagination::Cursor.new(self, :block_children, options).each do |page|\n yield page\n end\n else\n get(\"blocks/#{options[:block_id]}/children\", options.except(:block_id))\n end\n end",
"def traverse(include_self = false, &block)\n return enum_for(__method__, include_self) unless block_given?\n\n block.call(:enter, self, 0) if include_self\n\n each_with_index do |exp, index|\n if exp.terminal?\n block.call(:visit, exp, index)\n else\n block.call(:enter, exp, index)\n exp.traverse(&block)\n block.call(:exit, exp, index)\n end\n end\n\n block.call(:exit, self, 0) if include_self\n\n self\n end",
"def each\n each_node do |node|\n yield(node_key(node), node_value(node))\n end \n end",
"def each\n each_node do |node|\n yield(node_key(node), node_value(node))\n end \n end",
"def each\n Directory.all.each do |node_id|\n yield find node_id\n end\n end",
"def each\n if @cypher_block || @cypher_query_hash\n query(@cypher_query_hash, &@cypher_block).each { |i| yield i }\n else\n @decl_rel.each_node(@node) { |n| yield n } # Should use yield here as passing &block through doesn't always work (why?)\n end\n end",
"def each\n return enum_for(__method__) unless block_given?\n return if @head.nil?\n\n traverser = @head\n\n until traverser.nil?\n yield traverser\n traverser = traverser.next_node\n end\n end",
"def each\n return enum_for(__method__) unless block_given?\n return if @head.nil?\n\n traverser = @head\n\n until traverser.nil?\n yield traverser\n traverser = traverser.next_node\n end\n end",
"def traverse obj=self, &block\n case\n when obj.respond_to?(:parent?) && obj.respond_to?(:child?)\n block.call obj\n obj.children.each { |c| traverse(c, &block) }\n when obj.respond_to?(:parent?)\n obj.children.each { |c| traverse(c, &block) }\n when obj.respond_to?(:child?)\n block.call obj\n end\n end",
"def traverse(&blk)\n while value = @generator.resume\n blk.call(value)\n end\n end",
"def each_sequence_member()\n node = self\n container_type = type()\n \n done = false\n until done\n done = true\n node.component_nodes.each do |child_node|\n if child_node.type == container_type then\n node = child_node\n done = false\n else\n yield( child_node )\n end\n end\n end\n end",
"def each_sequence_member()\n node = self\n container_type = type()\n \n done = false\n until done\n done = true\n node.component_nodes.each do |child_node|\n if child_node.type == container_type then\n node = child_node\n done = false\n else\n yield( child_node )\n end\n end\n end\n end",
"def iterating_block?(node); end",
"def process_child_nodes(node); end",
"def each\n @descendants.each { |model| yield model }\n self\n end",
"def traverse_bfs\n q = Queue.new\n q.push @tree\n \n loop do\n break if q.empty?\n node = q.shift\n if block_given?\n yield node\n else\n @visited << node.data\n end\n node.children.each{ |n| q.push n } if node.children\n end\n end",
"def each_child\n self.class.child_references.each do |child_attr|\n children = Array(self.send(child_attr)).clone\n children.each do |child|\n yield(child)\n end\n end\n end",
"def apply_to_children(&block)\n self.entities.each do |entity|\n block.call(entity)\n entity.apply_to_children(&block)\n end\n end",
"def each_child\n \n end",
"def map_nodes!(&ruby_block)\n # A block? Apply it on each child.\n @value = ruby_block.call(@value)\n map_whens!(&ruby_block)\n if @default then\n @default = ruby_block.call(@default)\n @default.parent = self unless @default.parent\n end\n end",
"def block\n (@blocks ||= Array.new) << Block.new\n @in_block = @blocks.last\n yield\n @in_block = nil\n end"
] |
[
"0.79474133",
"0.7762521",
"0.7440448",
"0.735163",
"0.7344119",
"0.73345834",
"0.72829",
"0.72754395",
"0.7275258",
"0.72581697",
"0.7170762",
"0.7158805",
"0.71493",
"0.71463215",
"0.7119479",
"0.7107122",
"0.7079481",
"0.7079481",
"0.7048346",
"0.70361125",
"0.701071",
"0.70075876",
"0.70040315",
"0.6998574",
"0.6988517",
"0.69850373",
"0.69656646",
"0.69474214",
"0.6908918",
"0.6903049",
"0.6901569",
"0.6865175",
"0.68554723",
"0.67902404",
"0.6780647",
"0.6775862",
"0.6773411",
"0.6773411",
"0.6765652",
"0.6759305",
"0.67575616",
"0.67539847",
"0.6746214",
"0.6730213",
"0.66986674",
"0.6697554",
"0.6689273",
"0.6682333",
"0.6665438",
"0.66518307",
"0.66263187",
"0.66250503",
"0.6587136",
"0.65596527",
"0.6534899",
"0.65222394",
"0.65170074",
"0.6506688",
"0.65003747",
"0.6479088",
"0.6479088",
"0.6476427",
"0.64389384",
"0.64243513",
"0.64092124",
"0.6403104",
"0.6389629",
"0.6385234",
"0.637867",
"0.6364499",
"0.6364499",
"0.6354877",
"0.6354739",
"0.63464767",
"0.63456416",
"0.6338737",
"0.6330205",
"0.63161486",
"0.6314277",
"0.62888056",
"0.6240044",
"0.6238147",
"0.6238147",
"0.62361145",
"0.6231733",
"0.62313014",
"0.62313014",
"0.6217806",
"0.62119126",
"0.6207385",
"0.6207385",
"0.6203638",
"0.61754483",
"0.61726964",
"0.61707145",
"0.6167262",
"0.6166907",
"0.61618",
"0.616011",
"0.6148617"
] |
0.616892
|
95
|
Returns set of elements by type
|
def elements_by_type(type)
return xpath('//' + type)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def by_type\n return @by_type if @by_type\n\n @by_type = {}\n self.all.each do |set|\n next unless set[:types].count > 0\n\n set[:types].each do |t|\n @by_type[t] ||= []\n @by_type[t] << set\n end\n end\n\n @by_type\n end",
"def elements\n return @types.dup\n end",
"def all_group_or_elems(type)\n if type == :group\n self.elements_groups\n elsif type == :elem\n self.elements\n end\n end",
"def by_type(*types)\n select { |attribute| types.include?(attribute.class) }\n end",
"def find_by_type(types); end",
"def find_by_type(types); end",
"def get_data_elements_by_type(patient, type)\n matches = []\n patient.dataElements.each do |data_element|\n matches << data_element if data_element[:_type] == type\n end\n matches\n end",
"def filtered_sets(type)\n self.class.get(sets).select{|set| set['set_type'] == type}\n end",
"def fields_for_type(type)\n return @field_mapping[type] || Set.new\n end",
"def elements_with_type(type, element_type = N::URI)\n return unless(rdf_active? && is_iri?)\n qry = ActiveRDF::Query.new(element_type).distinct.select(:s)\n qry.where(:s, RDF.type, type)\n qry.regexp(:s, \"^#{@uri_s}\")\n qry.execute\n end",
"def find_type_elements(type, nested = T.unsafe(nil), elements = T.unsafe(nil)); end",
"def all\n all_by_type.values.flatten\n end",
"def find_by_type(types)\n matches = []\n matches << self if to_type == types\n @value.each do |v|\n matches += v.find_by_type(types) if v.respond_to?(:find_by_type)\n end\n matches\n end",
"def types(types)\n select { |node| types.include?(node.type) }\n end",
"def types(types)\n select { |node| types.include?(node.type) }\n end",
"def proper_types\n Page.distinct(:_type).reject { |type| type.constantize.new.entry? }\n end",
"def items_for_type(type)\n all_ids = []\n valid_ids = []\n AllItems.get.each do |item_code, values|\n _item_name, item_type, item_valid = values\n next unless item_type == type\n all_ids << item_code\n valid_ids << item_code if item_valid\n end\n\n [all_ids, valid_ids]\n end",
"def all_by_name_and_type(name, type)\n where(name: name, array_type: type).order_by(&:array_index).to_a\n end",
"def id_types\n identifiers.map(&:type).uniq\n end",
"def all(*types); end",
"def get_by_type(type)\r\n facts2typerule = {:methodcall => [:cant_access, :can_access],\r\n :inheritance => [:cant_extend, :can_extend],\r\n :objcreation => [:cant_create, :can_create]}\r\n\r\n find_all { |x| facts2typerule[type].index(x.type_interaction) != nil }\r\n end",
"def types(pattern = nil)\n @types ||= @doc.xpath(\"//*\").map { |e| e.name }.uniq\n\n pattern ?\n @types.select { |t| t =~ Regexp.new(pattern) } :\n @types\n end",
"def types(pattern = nil)\n @types ||= @doc.xpath(\"//*\").map { |e| e.name }.uniq\n\n pattern ?\n @types.select { |t| t =~ Regexp.new(pattern) } :\n @types\n end",
"def visit_set(binding_type)\n orig_input = self.input # save\n out_set = Set.new\n et = binding_type.element_type\n for ev in orig_input.value\n candidate = visit_list_element(ev, et)\n if out_set.include? candidate\n report_error('vapi.bindings.typeconverter.set.duplicate.element', candidate)\n end\n out_set << candidate\n end\n self.input = orig_input # restore\n self.result = out_set\n end",
"def types(types); end",
"def types\n @types ||= []\n end",
"def matching_sets(path, type); end",
"def type(type)\n select { |node| node.type.equal?(type) }\n end",
"def types\n @types.dup\n end",
"def types\n @types.dup\n end",
"def objects_of_type(name)\n find_all { |r| name === r['type'] }\n end",
"def type(type)\n select { |node| node.type == type }\n end",
"def get_by_type( klass )\r\n @types[ klass ] ||= {}\r\n @types[ klass ].keys\r\n end",
"def find_type_elements_except(type, nested_except = T.unsafe(nil), elements = T.unsafe(nil)); end",
"def glean(types, attribs)\n result = []\n send(types).each do |el|\n subresult = {}\n attribs.each do |key|\n v = el.attribute_value key.to_s\n subresult.update key => v\n end\n result << subresult\n end\n return result\n end",
"def add_types(type, arr)\n lst = @shared[type]\n arr.each{ |t| lst.push(t) if !lst.include?(t) }\n end",
"def get_types(type)\n result = []\n types = TYPE_CONVERSION_TREE[type]\n if types\n result += types\n types.each do |t|\n result |= get_types(t)\n end\n end\n result\n end",
"def matching_types(&matcher)\n yield(self) ? [self] : []\n end",
"def get_unique_values types, lines=nil, strip_duplicates=false\n lines ||= @lines\n if lines.nil?\n raise ArgumentError, \"No value for lines, and no value previously set\", caller\n else \n @lines = lines\n end\n #make sure to return array if only one type\n #otherwise return hash of arrays\n single_item =false \n unless types.class == Array\n types = [types]\n single_item =true\n end\n\n hash_types={}\n #create a dictionary for each type\n types.each {|type|hash_types[type]={}}\n\n #for each line get the elements of each type\n #add to dictionary for that type\n lines.each do |line|\n types.each do |type|\n #add the element(s) to the hash\n #puts \"hash_types:#{hash_types}\"\n dict = hash_types[type]\n hash_types[type] = add_elements(line, type, dict, strip_duplicates)\n end\n\n end\n if single_item\n #e.g. hash = {:kanji => {\"木\"=>1,\"子\"=>1},:onyomi=>{\"コウ\"=>1}}\n return hash_types.values[0].keys\n end\n\n #e.g. hash = {:kanji => {\"木\"=>1,\"子\"=>1},:onyomi=>{\"コウ\"=>1}}\n #gets changed to {:kanji => [\"木\",\"子\"], :onyomi => [\"コウ\"]}\n hash_types.keys.each do |k|\n hash_types[k] =hash_types[k].keys\n end\n\n return hash_types\n end",
"def components_with_type(type)\n array = []\n @components.each_value do |c|\n array << c.proxy.name if c.proxy.respond_to?(:has_type?) &&\n c.proxy.has_type?(type)\n end\n array\n end",
"def ids(type)\n Document.where(:typ => type).select(:ide).collect { |d| d[:ide] }.uniq.sort\n end",
"def array_of(*kinds, &block)\n lambda do |node|\n result = NodeFilters.filter(node, kinds)\n block ? result.map(&block) : result\n end\n end",
"def all(item_type)\n @items.fetch(item_type.to_sym)\n end",
"def test_cases_by_type\n test_cases.group_by(&:test_case_type)\n end",
"def patterns_for_type(type_)\n @mutex.synchronize do\n typedata_ = @types[type_]\n typedata_ ? typedata_.dup : []\n end\n end",
"def by_t(type)\n return self.find_all{|slot| slot.type == type}[0]\n end",
"def children_by_type(type)\n children = YARD::Registry.all(type)\n children.select { |child| child.parent == self }\n end",
"def type(types)\n types = [types] unless types.is_a?(Array)\n any_in(:_type => types)\n end",
"def extract_types(doc)\n types = []\n @raw_types.each do |raw_type|\n doc.each_element_with_attribute('name', raw_type, 0,\n '//schema/complexType') do |type_node|\n type = {:name => raw_type, :fields => []}\n ext_node = REXML::XPath.first(type_node, 'complexContent/extension')\n if ext_node\n base_type = ext_node.attribute('base').to_s.gsub(/^.+:/, '')\n type[:base] = base_type\n @raw_types << base_type unless @raw_types.include?(base_type)\n seq_node = REXML::XPath.first(ext_node, 'sequence')\n fields = get_element_fields(seq_node)\n process_method_field_types(fields)\n type[:fields] += fields\n end\n seq_node = REXML::XPath.first(type_node, 'sequence')\n if seq_node\n fields = get_element_fields(seq_node)\n process_method_field_types(fields)\n type[:fields] += fields\n end\n types << type\n end\n end\n return types\n end",
"def types\n types = Question.distinct.pluck(:type)\n render json: types.to_a\n end",
"def possible_types\n @data.flat_map { |iso2, data| data[:possible] }.uniq\n end",
"def resources_by_type(ast)\n raise_unless_xpath!(ast)\n result = Hash.new{|hash, key| hash[key] = Array.new}\n find_resources(ast).each do |resource|\n result[resource_type(resource)] << resource\n end\n result\n end",
"def files_of_type(*types)\n result = []\n return result if types.size == 0\n types.each do |type|\n unless files_by_type[type.to_s].nil?\n files_by_type[type.to_s].each {|file| result << file}\n break\n end\n end\n result\n end",
"def entities_of_type(type)\n @entities.select { |entity| entity['type'] == type }.map { |entity| Entity.new entity }\n end",
"def types\n get_metadata unless @types\n return @types\n end",
"def questionnaire_types\n questionnaire_type_list = Array.new\n self.questionnaires.each do |questionnaire|\n if !self.questionnaires.include?(questionnaire.type)\n questionnaire_type_list << questionnaire.type\n end\n end\n questionnaire_type_list\n end",
"def all_of_type\n Resource::AllOfType.new(type)\n end",
"def filter(type)\n list = @items.select { |item| item.class.class_name == type }\n if list.empty?\n fail UdaciListErrors::NoItems, \"No items of type: #{type}\"\n else\n list\n end\n end",
"def element_set\n return []\n end",
"def types\n @data.keys & TYPES\n end",
"def return_trains_by_type(type)\n (@trains_list.map { |a| a if a.type == type }).compact\n end",
"def products_by_type(type)\n all_products.select { |product| filter_item_by_type(product, TARGET_PRODUCT_FIELD, type) }\nend",
"def instances(type)\n @instances[type]\n end",
"def groups_by_asset_type(type)\n arr = []\n groups.each do |group|\n arr << group if !@bundles[group.to_s].assets(type.to_sym).empty?\n end\n return arr\n end",
"def get_entities(type)\n @entities[type.name]\n end",
"def load_selectors(value_type)\n selectors.active.where(value_type: value_type).to_a\n end",
"def filter(type)\n print_items @items.select { |item| item.type.casecmp(type).zero? }\n end",
"def each_type\n types.values.each do |type|\n yield(type)\n end\n end",
"def get_sets\n result = []\n (0..(TAILLE_TAPIS + TAILLE_EXT*self.etendu - 3)).each do |a|\n ((a + 1)..(TAILLE_TAPIS + TAILLE_EXT*self.etendu - 2)).each do |b|\n ((b + 1)..(TAILLE_TAPIS + TAILLE_EXT*self.etendu - 1)).each do |c|\n if (is_a_set?([self.talon[self.tapis[a]], self.talon[self.tapis[b]], self.talon[self.tapis[c]]]))[0]\n result << [a, b, c]\n end\n end\n end\n end\n result\n end",
"def all_items(type = nil)\n if type\n @api_items.select {|k, v| v.kind_of?(TYPE_MAP[type])}.keys\n else\n @api_items.keys\n end\n end",
"def content_types\n type.children.select { |child| child.class == ContentType }\n end",
"def category_types\n @category_types.each\n end",
"def joined_by_type(type)\n\t\tArray(self.joined.find_all_by_joinable_type(type))\n\tend",
"def tags_for type\n tag_ids = ActsAsTaggableOn::Tagging\n .where(taggable_type: type.camelize, context: :tags)\n .collect(&:tag_id)\n .uniq\n ActsAsTaggableOn::Tag\n .where(id: tag_ids)\n end",
"def proper_pages\n Page.where(:_type.in => proper_types)\n end",
"def types\n @@types ||= Hash.new\n end",
"def sets\n return [EscholSet.new({name: \"everything\", spec: \"everything\"})]\n end",
"def contents_by_type(essence_type)\n contents.select do |content|\n content.essence_type == Content.normalize_essence_type(essence_type)\n end\n end",
"def course_types\n @course_types ||= Course.where(department_id: self.department_id)\n .where(course_num: self.course_num)\n .where(term_id: self.search.term_id)\n .select(:type)\n .map(&:type)\n .uniq\n end",
"def get_record_types\n get_records_with_filter {|records, record_type, offset, ptr| records.push(ptr[0])}\n end",
"def contentByType( type )\n\t\tcontent = nil\n\t\t@content.each_index { |i|\n\t\t\tif @content[i].type == type\n\t\t\t\tcontent = @content[i]\n\t\t\tend\n\t\t}\n\t\tcontent\n\tend",
"def get_all_types\n types = Hash.new()\n @packages.each do |key, value|\n types[key] = value.stringpool_typestrings.values\n end\n\n return types\n end",
"def possible_node_types(type)\n possible_types(type) & node_types\n end",
"def externals(type)\n @externals ||= []\n\n type = type.to_sym\n parent_externals = if superclass.respond_to?(:externals)\n superclass.externals(type)\n else\n []\n end\n\n my_externals = @externals.select do |external|\n external.type == type\n end\n\n (parent_externals + my_externals).uniq\n end",
"def by_type\n filter(:type) do |post, type|\n post.post_type.casecmp(type).zero?\n end\n end",
"def resources_by_type(ast)\n result = Hash.new{|hash, key| hash[key] = Array.new}\n find_resources(ast).each{|resource| result[resource_type(resource)] << resource}\n result\n end",
"def resources_by_type(ast)\n result = Hash.new{|hash, key| hash[key] = Array.new}\n find_resources(ast).each{|resource| result[resource_type(resource)] << resource}\n result\n end",
"def each_type(&block)\n if block_given?\n @types.each_value(&block)\n self\n else\n @types.values\n end\n end",
"def find_candidates(elements)\n\n candidates = []\n\n # run DFS to check each element\n Helper.dfs(elements) do |element|\n # only add matching types (if type is :element thats all elements)\n if element.type == @type || @type == :element\n candidate = ValidationItem.new(self)\n candidate.add_valid_element(element)\n candidates << candidate\n end\n end\n\n return candidates\n end",
"def types\n @data.flat_map { |iso2, data| data[:valid] }.uniq\n end",
"def by_type(type)\n processors.values.detect { |v| v.prefix == type&.upcase }\n end",
"def loaded_instances(type)\n @instances[type].keys\n end",
"def select\n a = []\n @set.each do |e,_|\n if yield(e)\n a << e\n end\n end\n a\n end",
"def on_type_test_node(ast_node, context)\n nodes = XML::NodeSet.new\n\n context.each do |node|\n if node.is_a?(XML::Node) or node.is_a?(XML::Document)\n nodes << node\n end\n end\n\n return nodes\n end",
"def types\n list = Array.new\n\n if @db != nil\n is_ok = false\n\n begin\n stm = @db.prepare( 'SELECT qType FROM qryResults GROUP BY qType ORDER BY qType')\n rs = stm.execute\n\n rs.each do |row|\n list.push row['qType']\n end\n\n stm.close\n is_ok = true\n rescue ::SQLite3::Exception => e\n Maadi::post_message(:Warn, \"Repository (#{@type}:#{@instance_name}) encountered an SELECT Types error (#{e.message}).\")\n end\n end\n\n return list\n end",
"def content_types\n self.values.collect do |hash|\n (hash || {})['type']\n end.compact\n end",
"def types\n if @@types.nil? || (@@last_type_check + (4 * 60 * 60)) < Time.now\n @@last_type_check = Time.now\n @@types = _make_request(:types)['results']\n end\n @@types\n end",
"def instances(return_type)\n return nil unless(active_rdf? && is_iri?)\n qry = ActiveRDF::Query.new(URI).distinct.select(:s)\n qry.where(:s, RDF.type, self)\n qry.execute\n end",
"def each_set\n \n end",
"def to_set\n require 'set' unless defined?(::Set)\n each.to_set\n end"
] |
[
"0.7372266",
"0.71640664",
"0.6970619",
"0.69129604",
"0.67684513",
"0.67684513",
"0.6729588",
"0.6680755",
"0.6673888",
"0.6650561",
"0.65323806",
"0.64995325",
"0.646765",
"0.64671856",
"0.64671856",
"0.627714",
"0.6265765",
"0.6245004",
"0.617194",
"0.61620355",
"0.60667706",
"0.6039343",
"0.6039343",
"0.5987257",
"0.59344316",
"0.58875793",
"0.58441526",
"0.5818702",
"0.58168346",
"0.58168346",
"0.58056915",
"0.5766949",
"0.5763287",
"0.5737793",
"0.5730179",
"0.5721682",
"0.5716858",
"0.56956685",
"0.5686417",
"0.5683235",
"0.56794935",
"0.5677822",
"0.5672287",
"0.56649166",
"0.5643571",
"0.56404644",
"0.56278163",
"0.56258535",
"0.5621532",
"0.56165594",
"0.56135106",
"0.5598993",
"0.5585803",
"0.5582695",
"0.5578632",
"0.5575141",
"0.55514866",
"0.5547222",
"0.554646",
"0.5539716",
"0.55364406",
"0.550694",
"0.5481698",
"0.54788274",
"0.54696393",
"0.5462695",
"0.5448757",
"0.5448197",
"0.54354507",
"0.5433451",
"0.5427113",
"0.54073656",
"0.5406881",
"0.5406797",
"0.5405913",
"0.5399828",
"0.5390195",
"0.53888834",
"0.5376164",
"0.5374513",
"0.5370839",
"0.535896",
"0.5354901",
"0.53503674",
"0.5345718",
"0.5344971",
"0.5344971",
"0.5343376",
"0.5337137",
"0.5300506",
"0.5273738",
"0.52731955",
"0.52650493",
"0.52583957",
"0.52490425",
"0.5243083",
"0.52428013",
"0.5239964",
"0.5227819",
"0.5227392"
] |
0.7425538
|
0
|
Returns set of attributes by name
|
def attributes_by_name(name)
return xpath('//@' + name)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def find_attributes(name)\n\t\t\tr=[]\n\t\t\tp=self\n\t\t\twhile(p)\n\t\t\t\tif(p.respond_to?(name))\n\t\t\t\t\tv=p.send(name)\n\t\t\t\t\tr << v if(v)\n\t\t\t\tend\n\t\t\t\tbreak if(!p.respond_to?(\"container\"))\n\t\t\t\tp=p.container\n\t\t\tend\n\t\t\tr\n\t\tend",
"def attributes *attr_names\n @attribute_names ||= Set.new\n\n attr_names.each { |attr_name| @attribute_names << attr_name.intern }\n end",
"def attribute(name)\n @attributes ||= {}\n @attributes[name]\n end",
"def attribute(name)\n attributes[name]\n end",
"def with(name)\r\n @attributes.find { |attr| attr.name == name }\r\n end",
"def find_attribute_named(name)\n @attributes.find { |m| m.name == name }\n end",
"def attribute(name)\n return attributes[name]\n end",
"def find_attributes_starting_with(name)\n @attributes.select { |key| key.to_s.start_with?(name) }\n end",
"def attribute_methods(name)\n attribute_method_matchers.map { |matcher| matcher.method_name name }\n end",
"def attributes(*names)\n names.each { |n| attribute n }\n @attributes + @qualified_attributes.keys\n end",
"def [](name)\n attributes[canonical_name(name)]\n end",
"def [](name)\n attributes[canonical_name(name)]\n end",
"def attribute(name)\n @attributes[name.to_sym]\n end",
"def [](name)\n attributes.fetch(name)\n end",
"def attribute(name)\n attributes.each { |a| return a if a.property.id == name }\n nil\n end",
"def attribute_names\n @name_to_definition.keys\n end",
"def a(name)\n self.attributes[name]\n end",
"def attributes\n @attributes ||= attribute_names.inject({}) do |hash, name|\n attribute_values = saml.xpath(\"//saml:Attribute[@Name='#{name}']/saml:AttributeValue/text()\")\n hash[name] = attribute_values.length > 1 ? attribute_values.collect(&:to_s) : attribute_values.to_s\n hash\n end\n end",
"def get_attribute(name)\n return @attrs[name] if attrs.key?(name)\n end",
"def attribute_names\n names = []\n @attributes.each {|values| names << values.keys if values}\n names.flatten.uniq\n end",
"def attributes\n @attributes = Hash[attrs.map { |a| [a.to_sym, send(\"#{a}\")] }]\n end",
"def each\n getAttributeNames.each { |name| yield(name, getAttribute(name)) }\n end",
"def each\n getAttributeNames.each { |name| yield(name, getAttribute(name)) }\n end",
"def each\n getAttributeNames.each { |name| yield(name, getAttribute(name)) }\n end",
"def attributes\n ATTRIBUTE_NAMES\n end",
"def attrs(*names)\n names.each { |name| attr(name) }\n end",
"def get_attribute(name); end",
"def get_attribute(name); end",
"def attribute_names\n self.class.attributes.map { |a| a[:name] }\n end",
"def find_attribute_named(name)\n case name\n when /\\A#/ then\n find_attribute name[1..-1], false\n when /\\A::/ then\n find_attribute name[2..-1], true\n else\n @attributes.find { |a| a.name == name }\n end\n end",
"def attribute_names\n @attributes.map(&:name)\n end",
"def _pick_attribute(names)\n [names].flatten.each do |name|\n return self.send(name) if self.respond_to?(name)\n end\n return nil\n end",
"def attribute(name)\n @allowed_attributes[name]\n end",
"def get_attribute(name)\n @attributes[name.to_s]\n end",
"def attribute(name); end",
"def attributes\n @attrs.keys\n end",
"def get_attribute(name)\n @attributes[name]\n end",
"def attributes_in(mod)\n result = Set.new\n mod.local_nodes(:call) do |call_node|\n if ATTRIBUTE_METHODS.include?(call_node.method_name)\n call_node.arg_names.each {|arg| result << arg }\n end\n end\n result\n end",
"def attributes\n hash = HashWithIndifferentAccess.new\n\n self.class.attribute_names.each_with_object(hash) do |name, attrs|\n attrs[name] = read_attribute(name)\n end\n end",
"def attribute_names\n @attributes.keys\n end",
"def attribute_names\n @attributes.keys\n end",
"def attribute_names\n @attributes.keys\n end",
"def attribute_names\n @attributes.keys\n end",
"def [](name)\n @attributes[name]\n end",
"def attribute(name)\n attributes << name\n\n if !method_defined?(name) || name == :id\n attr_accessor name\n end\n end",
"def [](name)\n @attributes[name]\n end",
"def [](name)\n @attributes[name]\n end",
"def attributs()\n if block_given?\n rados_getxattrs.each { |key,value| \n yield key,value\n }\n else\n return rados_getxattrs\n end\n \n end",
"def keys\n getAttributeNames.to_a\n end",
"def keys\n getAttributeNames.to_a\n end",
"def keys\n getAttributeNames.to_a\n end",
"def attributes\n {}.tap do |attributes|\n attribute_names.each do |key|\n attributes[key] = send(key)\n end\n end\n end",
"def attributes\n @attr_statements ||= begin\n result = {}\n\n stmt_element = REXML::XPath.first(document, \"/p:Response/a:Assertion/a:AttributeStatement\", { \"p\" => PROTOCOL, \"a\" => ASSERTION })\n stmt_element.elements.each do |attr_element|\n name = attr_element.attributes[\"Name\"]\n value = attr_element.elements.first.text\n\n result[name] = value\n end\n\n result.keys.each do |key|\n result[key.intern] = result[key]\n end\n\n result\n end\n end",
"def attribute_names\n @attribute_names ||= attributes.keys\n end",
"def attributes(*names)\n names.each { |name| attribute(name) }\n state\n end",
"def attribute_names\n @attributes.keys\n end",
"def attributes_get\n h = {}\n self.class.attributes.each do |a|\n h[a] = attribute_get(a)\n end\n h\n end",
"def attributes_get\n h = {}\n self.class.attributes.each do |a|\n h[a] = attribute_get(a)\n end\n h\n end",
"def attr(name); end",
"def attributes\n attrs = Hash.new\n attribute_list.each do |attribute|\n value = self.send(attribute)\n attrs[attribute] = value unless value.nil?\n end\n attrs\n end",
"def attribute_names\n @attribute_names ||= attribute_definitions.keys.collect {|a|a.to_s}\n end",
"def [](attr_name)\n @attributes[attr_name.to_s]\n end",
"def attribute_sets\n return @attribute_sets\n end",
"def [](name)\n key = name.to_s\n if attributes.key?(key)\n attributes[key]\n elsif index = underscored_column_names.index(key)\n attributes[@columns[index].name]\n end\n end",
"def attributes\n ret = {}\n attribute_names.each do |attribute_name|\n ret[attribute_name] = self.class._decl_props[attribute_name.to_sym] ? send(attribute_name) : send(:[], attribute_name)\n end\n ret\n end",
"def attribute?(name)\n @attrs.has_key(name)\n end",
"def attribute_names\n attributes.keys.sort\n end",
"def attribute_names\n attributes.keys.sort\n end",
"def attributes\n self.attribute_keys.inject({}) do |hash, key|\n hash[key] = self.__send__(key) if self.__send__(key)\n hash\n end\n end",
"def attribute_names\n @attribute_names ||= attribute_definitions.keys.map(&:to_s)\n end",
"def attributes\n @attr_statements ||= begin\n result = {}\n\n stmt_element = REXML::XPath.first(document, \"/p:Response/a:Assertion/a:AttributeStatement\", { \"p\" => PROTOCOL, \"a\" => ASSERTION })\n return {} if stmt_element.nil?\n\n stmt_element.elements.each do |attr_element|\n name = attr_element.attributes[\"Name\"]\n value = attr_element.elements.first.text\n\n result[name] = value\n end\n\n result.keys.each do |key|\n result[key.intern] = result[key]\n end\n\n result\n end\n end",
"def attribute_names\n Array.new\n end",
"def attribute_names\n @attribute_names ||= if !abstract_class?\n attribute_types.keys\n else\n []\n end\n end",
"def nextTagAttributes(typeName, name)\n\t attrs = Hash.new()\n\t skipSpaces()\n\t c = peekChar()\n\t while !c.nil? && c =~ /[a-zA-Z_:]/ # next legal attrib name char\n\t\tkey = nextName()\n\t\tskipSpaces()\n\t\tif peekMatches?('=')\n\t\t skipChar()\n\t\t skipSpaces()\n\t\t val = nextQuotedLiteral(name)\n\t\t val = normalizeAttributeValue(val)\n\t\telse\n\t\t val = ''\n\t\tend\n\n\t\t# Well-formedness constraint: attribute names may appear\n\t\t# only once.\n\t\tif !attrs[key].nil?\n\t\t str = \"malformed #{typeName} '#{name}': attribute name\" +\n\t\t\t\" '#{key}' appears more than once\"\n\t\t raise ParserError.new(str, self)\n\t\tend\n\n\t\tattrs[key] = val\n\n\t\tskipSpaces()\n\t\tc = peekChar()\n\t end\n\t return attrs\n\tend",
"def attributes\n @attributes ||= Set.new\n end",
"def attribute_names\n @attributes.keys.sort\n end",
"def attributes\n @attribute_ids.collect { |idx| BAttribute.store[idx] }\n end",
"def attribute?(name)\n self.attribute_names.include?(name.to_sym)\n end",
"def attributes\n ATTRIBUTES.inject({}) do |hash, attribute|\n hash[attribute] = self.send(attribute)\n hash\n end\n end",
"def attributes\n ATTRIBUTES.inject({}) do |hash, attribute|\n hash[attribute] = self.send(attribute)\n hash\n end\n end",
"def find_attribute(qualified_name, namespace, name)\n if qname = @qualified_attributes[qualified_name]\n return qname\n end\n names = []\n plural = collection?(qualified_name)\n if plural\n if namespace\n names << \"#{ namespace }_#{ name.pluralize }\"\n end\n names << name.pluralize\n end\n if namespace\n names << \"#{ namespace }_#{ name }\"\n end\n names << name\n names.map { |n| n.underscore }.find do |n|\n @attributes.include? n.underscore\n end\n end",
"def attribute(name)\n @attribute_names << name\n attr_reader(name)\n end",
"def attributes(*attrs)\n attrs.each { |attr_name| @_attributes[attr_name.to_sym] = attr_name.to_sym }\n end",
"def attributes\n self._attributes.inject({}) do |hash, attr|\n hash[attr.to_s] = send(attr)\n hash\n end\n end",
"def attribute(name)\n attr = nc.att(name)\n get(attr)\n end",
"def keys(name)\n key_schema(name).each_with_object({}) do |s, h|\n h[s.key_type.downcase.to_sym] = s.attribute_name\n end\n end",
"def attribute_for sym\n @@array = attributes\n val = @@const_map[sym]\n val if attributes.include? val\n end",
"def [](attr_name)\n attr_name = attr_name.to_sym\n unless @attributes.key?(attr_name)\n raise NameError, \"undefined attribute #{attr_name.inspect}\"\n end\n @attributes[attr_name]\n end",
"def kwattr_values(attribute_name); end",
"def has_attribute?(name)\n attribute_names.include?(name.to_str)\n end",
"def attribute_names\n @attributes.keys.sort\n end",
"def attr(name, params = {})\n defaults = {\n :columns => [],\n :associations => [],\n :default => false,\n :include => false,\n :order => nil,\n :proc => nil\n }\n if self.columns.include? name\n defaults[:columns] = [name]\n end\n\n params = defaults.merge params\n\n setup_attrs\n\n # Make sure columns are absolutely qualified, in case we do wacky\n # joins\n params[:columns].map! do |column|\n \"#{self.table_name}__#{column}\".to_sym\n end\n\n @attrs << name unless @attrs.include? name\n @attr_strings << name.to_s unless @attr_strings.include? name.to_s\n @attr_columns[name.to_s] = params[:columns]\n @attr_associations[name.to_s] = params[:associations]\n @default_attrs << name if params[:default] unless @default_attrs.include? name\n @include_attrs << name if params[:include] unless @include_attrs.include? name\n @procs[name] = params[:proc] if params[:proc]\n \n if params[:order]\n @attr_orders << name\n end\n end",
"def attribute(name)\n current_attributes[name]\n end",
"def attributes(path)\n raise \"`attributes' method does not support Windows systems\" if session.platform == 'windows'\n\n cmd_exec(\"lsattr -l '#{path}'\").to_s.scan(/^#{path}\\s+(.+)$/).flatten.first.to_s.split(', ')\n end",
"def [](name) \n self.attributes[name]\n end",
"def attribute_values\n @columns.map do |column|\n @attributes[column.to_sym]\n end\n end",
"def [](attr_name)\n @attributes.fetch_value(attr_name.to_s)\n end",
"def attributes\n query[ model_name ]\n end",
"def list_attributes\n if @attributes.empty?\n fetch_configuration()\n end\n return @attributes.keys\n end",
"def attribute_keys\n return [] unless self[:attributes]\n self[:attributes].keys\n end"
] |
[
"0.7383498",
"0.7121259",
"0.7099978",
"0.69748557",
"0.6967677",
"0.69662964",
"0.6949781",
"0.6877779",
"0.6862206",
"0.6844416",
"0.6825001",
"0.6825001",
"0.68173236",
"0.6683584",
"0.6650696",
"0.65907425",
"0.6556645",
"0.65203613",
"0.65089077",
"0.6500382",
"0.6468757",
"0.6460147",
"0.6460147",
"0.6460147",
"0.64487433",
"0.64462364",
"0.64401263",
"0.64401263",
"0.6430924",
"0.64264584",
"0.64259505",
"0.64245516",
"0.6413628",
"0.6408223",
"0.6377005",
"0.6370062",
"0.6368724",
"0.63600063",
"0.63445336",
"0.63410324",
"0.63410324",
"0.63410324",
"0.63410324",
"0.63185805",
"0.6304887",
"0.6303065",
"0.6303065",
"0.6299279",
"0.6297664",
"0.6297664",
"0.6297664",
"0.6284452",
"0.62744784",
"0.6270005",
"0.6257656",
"0.6242095",
"0.62370414",
"0.62370414",
"0.6226885",
"0.62043107",
"0.6200721",
"0.6175586",
"0.61637026",
"0.61438495",
"0.6142433",
"0.61384743",
"0.61383885",
"0.61383885",
"0.6133354",
"0.61318237",
"0.6125391",
"0.61221105",
"0.61056215",
"0.60979676",
"0.60715973",
"0.60705906",
"0.60575676",
"0.605356",
"0.6035794",
"0.6035794",
"0.6033178",
"0.60317487",
"0.6027684",
"0.6027134",
"0.6024995",
"0.6024068",
"0.60012776",
"0.5989103",
"0.5977227",
"0.59687406",
"0.5967461",
"0.5965505",
"0.59565526",
"0.59561497",
"0.594343",
"0.5942343",
"0.5941025",
"0.5925547",
"0.59172827",
"0.5914054"
] |
0.6876673
|
8
|
Tests all of the data for the current node
|
def print_debug
print_divider
puts "Root Node: \n" + root.to_s
print_divider
puts "Current Node: \n" + @current_node.to_s
print_divider
puts "Attributes: \n" + attributes.to_s
print_divider
puts "Children: \n" + children.to_xml
print_divider
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def test(data)\n if @nominal\n @children.each_with_index do |child, ind|\n child.test(data) if data.vals[@att] == @@nom_choices[@att][ind]\n end\n else # continuous\n if data.vals[@att].to_f < @thresh # > on one side, <= on oter\n @children.first.test(data)\n else\n @children[1].test(data)\n end\n end\n end",
"def test_each\n setup_test_tree\n\n assert(@root.has_children?, \"Should have children\")\n assert_equal(5, @root.size, \"Should have five nodes\")\n assert(@child3.has_children?, \"Should have children\")\n\n nodes = []\n @root.each { |node| nodes << node }\n\n assert_equal(5, nodes.length, \"Should have FIVE NODES\")\n assert(nodes.include?(@root), \"Should have root\")\n assert(nodes.include?(@child1), \"Should have child 1\")\n assert(nodes.include?(@child2), \"Should have child 2\")\n assert(nodes.include?(@child3), \"Should have child 3\")\n assert(nodes.include?(@child4), \"Should have child 4\")\n end",
"def testDataReceived\n $data.each { \n |operation|\n if(operation.operation != \"C\")\n if(!$nodos.any?{|node| node.operationId == operation.operationId})\n $nodos.push(Node.new(operation.operationId,Array.new,Array.new))\n end\n \n $opHash[operation.operation + operation.operationElement].push(operation.operationId)\n end\n switchDefinition(operation)\n \n }\nend",
"def assert_data?\n @operation.assert['data']\n end",
"def match_all(data, &block)\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 yield Item.new(i, true, node)\n i += node.length\n else\n i += 1\n end\n end\n end",
"def test_node_can_take_in_data_and_next_node_data\n node = Node.new(\"pizza\", \"link\" )\n assert_equal \"pizza\", node.data\n assert_equal \"link\", node.next_node\n end",
"def test_for_node\n raise \"Failing test #{@name} for #{@node}\" if Node.fail_for.key?(@name) && Node.fail_for[@name].include?(@node)\n\n sleep_time = Node.sleeps.dig(@name, @node)\n sleep sleep_time unless sleep_time.nil?\n Node.runs << [@name, @node]\n end",
"def check(node); end",
"def scanned_node?(node); end",
"def checkData(iUserID, iComment)\n # Nothing to test\n end",
"def iterating_block?(node); end",
"def consider(data)\n Interpreter.examine(data)\n end",
"def test_nodes_is_empty\n\t\tassert_equal [], @location.nodes\n\tend",
"def test_each_file_returns_data\n files = NutrientDataSet::META_DATA.keys\n files.each do |name|\n parser = data[\"nutr_def\"]\n row = parser.take(1)\n \n assert !row.empty?, \"Expected data for #{name} to exist.\"\n end\n end",
"def process_all_nodes\n debug 'Start processing all nodes'\n hook 'pre_all'\n each_node do |node|\n process_node node\n end\n hook 'post_all'\n end",
"def test_collect\n setup_test_tree\n collect_array = @root.collect do |node|\n node.content = \"abc\"\n node\n end\n collect_array.each {|node| assert_equal(\"abc\", node.content, \"Should be 'abc'\")}\n end",
"def relevant_data?\n @relevant_data\n end",
"def on_test_result(node)\n id, passed, *nodes = *node\n if (passed && !failed_test_ids.include?(id)) ||\n (!passed && failed_test_ids.include?(id))\n process_all(nodes)\n end\n end",
"def check_node(node)\n\t\t\t@node = node\n\t\t\tself.class.get_callbacks(\"check_#{node.type}\".to_sym).each do |block|\n\t\t\t\tself.instance_exec(node, &block)\n\t\t\tend\n\t\tend",
"def test_each_leaf\n setup_test_tree\n\n nodes = []\n @root.each_leaf { |node| nodes << node }\n\n assert_equal(3, nodes.length, \"Should have THREE LEAF NODES\")\n assert(!nodes.include?(@root), \"Should not have root\")\n assert(nodes.include?(@child1), \"Should have child 1\")\n assert(nodes.include?(@child2), \"Should have child 2\")\n assert(!nodes.include?(@child3), \"Should not have child 3\")\n assert(nodes.include?(@child4), \"Should have child 4\")\n end",
"def each(&block)\n Placeholder.each(node_data, &block)\n end",
"def given?\n return true unless @data.nil? || @data.empty?\n\n false\n end",
"def all_data\n @data\n end",
"def process_loaded_data(_result)\n true\n end",
"def contains?(data)\n\t\t@current_node = @head\n\t\t\n\t\twhile @current_node.next_node != nil\n\t\t\tif @current_node.data == data \n\t\t\t\treturn true\n\t\t\telse @current_node = @current_node.next_node\n\t\t\tend\n\t\tend\n\n\t\tif @current_node.data == data #Checks the current tail node\n\t\t\treturn true\n\t\telse \n\t\t\treturn false\n\t\tend\n\tend",
"def process_all_nodes\n debug 'Start processing all nodes'\n each_node do |node|\n process_node node\n end\n end",
"def data?\n dis_data.any?\n end",
"def test_has_content_eh\n a_node = Tree::TreeNode.new(\"A Node\")\n assert_nil(a_node.content , \"The node should not have content\")\n assert(!a_node.has_content? , \"The node should not have content\")\n\n a_node.content = \"Something\"\n assert_not_nil(a_node.content, \"The node should now have content\")\n assert(a_node.has_content?, \"The node should now have content\")\n end",
"def data?\n self.runner.parameters[:data] || false\n end",
"def assert_no_data_at data, path, msg=nil\n msg ||= \"Data found at #{path.inspect} for #{data.inspect}\"\n found = false\n\n Path.find path, data do |d,k,p|\n found = true\n break\n end\n\n assert !found, msg\n end",
"def test_node_change_log3\r\n Model.node_changes_to_log([:evidence, :doesnotexist])\r\n @mymodel = Model.new(1, \"rubylicious\") \r\n node_list = @mymodel.node_list \r\n\r\n node1 = node_list.add_node('autonum', 'node one', NODE);\r\n perfind2 = node_list.add_node('autonum', 'pi two', PERFIND); \r\n process3 = node_list.add_node('autonum', 'process three', PROCESS);\r\n process4 = node_list.add_node('autonum', 'process four', PROCESS); \r\n \r\n perfind2.evidence = 0.12\r\n process3.evidence = 0.34 \r\n process4.evidence = 0.56 \r\n \r\n i = 0\r\n while(ar = @mymodel.consume_next_node_change)\r\n assert_equal([0.12,0.12], ar[0].send(ar[1][0])) if ar[0] == perfind2\r\n assert_equal([0.34,0.34], ar[0].send(ar[1][0])) if ar[0] == process3 \r\n assert_equal([0.56,0.56], ar[0].send(ar[1][0])) if ar[0] == process4\r\n i += 1\r\n end\r\n \r\n assert_equal(3, i, 'Incorrect number of node changes were logged')\r\n end",
"def test_node_change_log1\r\n @mymodel = Model.new(1, \"rubylicious\") \r\n node_list = @mymodel.node_list\r\n\r\n node1 = node_list.add_node('autonum', 'node one', NODE);\r\n perfind2 = node_list.add_node('autonum', 'pi two', PERFIND); \r\n process3 = node_list.add_node('autonum', 'process three', PROCESS);\r\n process4 = node_list.add_node('autonum', 'process four', PROCESS); \r\n\r\n process3.evidence = [0.2, 0.3]\r\n process4.evidence = [0.54, 0.777]\r\n \r\n assert(@mymodel.consume_next_node_change.nil?)\r\n end",
"def get_node_data()\n return @node_data\n end",
"def parse_children\n worked = false\n worked = true while parse_element or parse_comment or parse_cdata or parse_data\n worked\n end",
"def test_load_data\n\n @node = Node.find_key params[:id]\n # get the file\n file = File.join \"test\", \"data\", (params[:source] || \"node_discovery\") + \".json\"\n raw = File.read file\n # cleanup\n mac = 6.times.map{ |i| rand(256).to_s(16) }.join(\":\")\n raw = raw.gsub /00:00:00:00:00:00/, mac\n # update the node\n json = JSON.load raw\n @node.discovery = json\n @node.save!\n render api_show @node\n\n end",
"def compare_profile_data\n puts \"Step 11: Comparing Freelancer Profile data\"\n parent = $freelancers_card_data[@index]\n child = @profile_data\n puts \"for freelancer #{parent[:name]}, comparing results page fields with internal page fields:\"\n [:description, :title, :skills].each do |field|\n verify_details(parent, child, field, parent[:name])\n end\n puts \"All results are printed successfully\"\n\n end",
"def test_count_nodes_of_fourth_ave\n\t\tassert_equal 1, @location2.nodes.count\n\tend",
"def pre_testdata\n RVTEST_DATA_BEGIN()\n TEST_DATA()\n RVTEST_DATA_END()\n end",
"def all_nodes_ready?\n if current_platform_spec.nodes.nil?\n false\n else\n true\n end\n end",
"def check\n each { |m| m.check }\n end",
"def check_all_here\n end",
"def get_true_node_objects get_all_nodes=false\r\n nodes, all_nodes, names, iter_arr, file_cache_nodes, h = [],[],[],[],[],{}\r\n\r\n @config['chef_nodes'] = @config['ridley'].node.all\r\n\r\n @config['helper'].completion_rate? 0, __method__\r\n\r\n file_cache_nodes = @config['filesystem'].check_nodes_file_cache if @config['filesystem'].compare_file_node_cache_against_chef_nodes('equal')\r\n\r\n @config['chef_nodes'].each do |n|\r\n true_obj = if !file_cache_nodes.empty? && @config['parser'].array_of_nodes_contains_node_name?(file_cache_nodes, n.name)\r\n file_cache_nodes[@config['parser'].index_of_node_name_in_array_of_nodes(file_cache_nodes, n.name)]\r\n else\r\n @config['filesystem'].cleanup_file_caches('current-nodes')\r\n\r\n @config['ridley'].node.find(n.name)\r\n end\r\n\r\n iter_arr << n.name\r\n\r\n progress_value = (( iter_arr.length.to_f/@config['chef_nodes'].length.to_f )*100 ).floor\r\n\r\n @config['helper'].completion_rate? progress_value, __method__\r\n\r\n all_nodes << true_obj\r\n\r\n next if !get_all_nodes && true_obj.chef_environment != @options['env'] && true_obj.chef_environment != '_default'\r\n\r\n if get_all_nodes\r\n h[n.name] = true_obj\r\n names << n.name\r\n\r\n next\r\n end\r\n\r\n if @options['role'] == 'all'\r\n next if true_obj.chef_environment == '_default'\r\n\r\n h[n.name] = true_obj\r\n names << n.name\r\n\r\n next\r\n end\r\n\r\n if @options['node_name'] && true_obj.name == @options['node_name']\r\n h[n.name] = true_obj\r\n names << n.name\r\n\r\n next\r\n end\r\n\r\n if @options['address'] && true_obj.public_ipaddress == @options['address']\r\n h[n.name] = true_obj\r\n names << n.name\r\n\r\n next\r\n end\r\n\r\n unless ( @options['address'] || @options['node_name'] )\r\n if true_obj.run_list.include?(\"role[#{ @options['role'] }]\")\r\n h[n.name] = true_obj\r\n names << n.name\r\n\r\n next #not needed here but good to keep in mind\r\n end\r\n end\r\n end\r\n\r\n names.sort.each { |name| nodes << h[name] }\r\n\r\n @config['filesystem'].write_nodes_file_cache(all_nodes) unless @config['filesystem'].compare_file_node_cache_against_chef_nodes('equal')\r\n\r\n puts(\"\") unless @options['quiet']\r\n \r\n nodes\r\n end",
"def check_values\n assert_equal 'foo', @test.name\n assert_equal 1, TestModel.count\n assert_equal 1, self.class.block_calls\n end",
"def rspec_test(nodes)\n node_manager.assert_known(nodes)\n for node in nodes\n node_manager.find(node).rspec_test\n end\n end",
"def infoTest data\n failure = RubyUnit::AssertionFailure.new(data)\n data.each do |index, value|\n assertMatch /#{index}/, failure.info, \"Missing index for #{index}\"\n assertMatch /#{value}/, failure.info, \"Missing value for #{index}\"\n end\n end",
"def node_match?(other_node, self_node)\n keys_with_expected_diffs = ['facts_timestamp', 'catalog_timestamp']\n same_num_elements?(other_node, self_node) && same_contents?(other_node, self_node, keys_with_expected_diffs)\n end",
"def verify_object_info_data(data_set)\n logger.debug \"Checking object number #{data_set[CoreObjectData::OBJECT_NUM.name]}\"\n object_data_errors = []\n text_values_match?(data_set[CoreObjectData::OBJECT_NUM.name], element_value(object_num_input), object_data_errors)\n\n other_nums = data_set[CoreObjectData::OTHER_NUM.name]\n other_nums && other_nums.each do |num|\n index = other_nums.index num\n text_values_match?(num[CoreObjectData::NUM_VALUE.name], element_value(other_num_num_input index), object_data_errors)\n text_values_match?(num[CoreObjectData::NUM_TYPE.name], element_value(other_num_type_input index), object_data_errors)\n end\n\n num_objects = data_set[CoreObjectData::NUM_OBJECTS.name]\n num_objects && text_values_match?(num_objects.to_s, element_value(num_objects_input), object_data_errors)\n\n collection = data_set[CoreObjectData::COLLECTION.name]\n collection && text_values_match?(collection, element_value(collection_input), object_data_errors)\n\n resp_depts = data_set[CoreObjectData::RESPONSIBLE_DEPTS.name]\n resp_depts && resp_depts.each { |dept| text_values_match?(dept[CoreObjectData::RESPONSIBLE_DEPT.name], element_value(resp_dept_input resp_depts.index(dept)), object_data_errors) }\n\n pub_to_list = data_set[CoreObjectData::PUBLISH_TO_LIST.name]\n pub_to_list && pub_to_list.each { |pub| text_values_match?(pub[CoreObjectData::PUBLISH_TO.name], element_value(publish_to_input pub_to_list.index(pub)), object_data_errors) }\n\n status = data_set[CoreObjectData::RECORD_STATUS.name]\n status && text_values_match?(status, element_value(record_status_input), object_data_errors)\n\n inv_statuses = data_set[CoreObjectData::INVENTORY_STATUS_LIST.name]\n inv_statuses && inv_statuses.each { |stat| text_values_match?(stat[CoreObjectData::INVENTORY_STATUS.name], element_value(inventory_status_input inv_statuses.index(stat)), object_data_errors) }\n\n brief_descrips = data_set[CoreObjectData::BRIEF_DESCRIPS.name]\n brief_descrips && brief_descrips.each { |descrip| text_values_match?(descrip[CoreObjectData::BRIEF_DESCRIP.name], element_value(brief_desc_text_area brief_descrips.index(descrip)), object_data_errors) }\n\n dist_feat = data_set[CoreObjectData::DISTINGUISHING_FEATURES.name]\n dist_feat && text_values_match?(dist_feat, element_value(dist_features_text_area), object_data_errors)\n\n comments = data_set[CoreObjectData::COMMENTS.name]\n comments && comments.each { |comment| text_values_match?(comment[CoreObjectData::COMMENT.name], element_value(comment_text_area comments.index(comment)), object_data_errors) }\n\n titles = data_set[CoreObjectData::TITLE_GRP.name]\n titles && titles.each do |title|\n index = titles.index title\n text_values_match?(title[CoreObjectData::TITLE.name], element_value(title_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_TYPE.name], element_value(title_type_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_LANG.name], element_value(title_lang_input index), object_data_errors)\n\n translations = title[CoreObjectData::TITLE_TRANSLATION_SUB_GRP.name]\n translations && translations.each do |trans|\n sub_index = translations.index trans\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION.name], element_value(title_translation_input [index, sub_index]), object_data_errors)\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION_LANG.name], element_value(title_translation_lang_input [index, sub_index]), object_data_errors)\n end\n end\n\n obj_names = data_set[CoreObjectData::OBJ_NAME_GRP.name]\n obj_names && obj_names.each do |name|\n index = obj_names.index name\n text_values_match?(name[CoreObjectData::OBJ_NAME_NAME.name], element_value(object_name_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_CURRENCY.name], element_value(object_name_currency_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LEVEL.name], element_value(object_name_level_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_SYSTEM.name], element_value(object_name_system_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_TYPE.name], element_value(object_name_type_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LANG.name], element_value(object_name_lang_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_NOTE.name], element_value(object_name_note_input index), object_data_errors)\n end\n\n object_data_errors\n end",
"def read_testing_data\n File.open(@testing_file) {|file|\n file.each do |line|\n next if line.strip == ''\n data_id, *snp_list = line.strip.split\n raise Nimbus::InputFileError, \"There are individuals with no ID, please check data in Testing file.\" unless (!data_id.nil? && data_id.strip != '')\n raise Nimbus::InputFileError, \"Individual ##{data_id} from testing set has no value for all #{@tree_SNP_total_count} SNPs.\" unless snp_list.size == @tree_SNP_total_count\n individual_test = Nimbus::Individual.new(data_id.to_i, nil, snp_list.map{|snp| snp.to_i})\n yield individual_test\n end\n }\n end",
"def all_nodes_are_successful?\n all? do |node|\n node.successful?\n end\n end",
"def all_nodes_are_successful?\n all? do |node|\n node.successful?\n end\n end",
"def node(node)\n true\n end",
"def check(flat_file = nil)\n sync\n return false unless @nodes.check\n root.check(flat_file, @nodes.total_entries)\n end",
"def handle_node(exp)\n @wheels.each{ |wheel| wheel.test_node(exp) }\n @wheels = @wheels + @new_wheels\n @new_wheels = []\n end",
"def check\n \n end",
"def check\n \n end",
"def visitIfActions(elem, data)\r\n @@log.debug(\"XmlVisitor::visitIfActions\")\r\n @@log.debug(elem.inspect)\r\n\r\n if (elem.elements.size < 1)\r\n @@log.error(\"*** IfActions element has no children.\")\r\n end\r\n\r\n elem.each_element do |child|\r\n data = visit(child, data)\r\n end\r\n\r\n return data\r\n end",
"def check_node(node)\n\t\t\tif node.instance_of?(Parser::AST::Node) then\n\t\t\t\tchecks = @node_checks[node.type] \n\t\t\t\tif checks then\n\t\t\t\t\tchecks.each do |check|\n\t\t\t\t\t\tcheck.check_node(node) \n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\tnode.children.each do |child_node|\n\t\t\t\t\tif child_node.instance_of?(Parser::AST::Node) then\n\t\t\t\t\t\tchild_node.check(self)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"def content_check\n begin\n raise CompulsoryElementMissingException.new('location', source_name) if @doc.root.nil? \n raise CompulsoryElementMissingException.new('blocks', source_name) if @doc.root.elements['blocks'].nil?\n rescue => ex\n @log.error \"Incomplete location data found in datafile #{source_name}.\" + \"(\" + ex.message + \")\"\n raise\n end\n end",
"def test_truth\n assert nodes(:draft_1)\n end",
"def check_single_data(data:, message:)\n crit_msg(message) if data\n end",
"def test_data_load_and_reset\n @test = CinePassion.new\n assert_equal(@test.xml_data, \"\")\n \n @test.DataLoadFromFile(\"test/data/cinepassion-scraper-test-01-one-response.xml\")\n assert_not_equal(@test.xml_data, \"\")\n \n @test.DataReset()\n assert_equal(@test.xml_data, \"\")\n end",
"def test_perfind_callbacks\r\n nodelist = @mymodel.node_list\r\n \r\n node1 = nodelist.add_node(1, 'measure node', MEASUREMENT);\r\n\r\n assert(node1.callbacks.size == 1) \r\n assert(node1.callbacks.include?('measurement_changed'))\r\n end",
"def data\n @root.data\n end",
"def full?\r\n\t\tif nodes?\r\n\t\t\tnodes.each { |node|\r\n\t\t\t\tif node == nil\r\n\t\t\t\t\treturn false\r\n\t\t\t\tend\r\n\t\t\t}\r\n\t\tend\r\n\t\t\r\n\t\treturn true\r\n\tend",
"def child_check(level, child_data, local_nesting, expected, match_value)\n matched = child_data.select do |item|\n nest_match_attributes(item, local_nesting, expected, match_value)\n end\n level[:comparison].compare(matched.count)\nend",
"def dataVerification(accounts)\r\n @insuredName = (account[\"accountName\"] + \"_\" + $accountID)\r\n \r\n accounts.each do |account| \r\n if account[\"accountName\"] != \"\" \r\n \r\n #run tests for individual tables, in this case, just the AccountInfo table\r\n accountInfo(account)\r\n\r\n puts \"\"\r\n puts \"Data Compare tests complete for account: \" + @insuredName + \".\"\r\n puts \"\"\r\n end\r\n end\r\nend",
"def countNodeStatus(domain)\r\n nON = 0\r\n nOFF = 0\r\n nKO = 0\r\n d = (domain == \"default\") ? OConfig.GRID_NAME : domain\r\n url = \"#{OConfig[:tb_config][:default][:cmc_url]}/allStatus?domain=#{d}\"\r\n response = NodeHandler.service_call(url, \"Can't get node status from CMC\")\r\n doc = REXML::Document.new(response.body)\r\n doc.root.elements.each('//detail/*') { |e|\r\n attr = e.attributes\r\n state = attr['state']\r\n nON = (state.match(/^POWERON/)) ? nON + 1 : nON\r\n nOFF = (state.match(/^POWEROFF/)) ? nOFF + 1 : nOFF\r\n nKO = (state.match(/^NODE/)) ? nKO + 1 : nKO\r\n }\r\n puts \"-----------------------------------------------\"\r\n puts \"Testbed : #{d}\"\r\n puts \"Number of nodes in 'Power ON' state : #{nON}\"\r\n puts \"Number of nodes in 'Power OFF' state : #{nOFF}\"\r\n puts \"Number of nodes in 'Not Available' state : #{nKO}\"\r\n puts \"-----------------------------------------------\"\r\nend",
"def all\n data\n end",
"def test_node_change_log2\r\n Model.node_changes_to_log([:evidence])\r\n @mymodel = Model.new(1, \"rubylicious\") \r\n node_list = @mymodel.node_list \r\n\r\n node1 = node_list.add_node('autonum', 'node one', NODE);\r\n perfind2 = node_list.add_node('autonum', 'pi two', PERFIND); \r\n process3 = node_list.add_node('autonum', 'process three', PROCESS);\r\n process4 = node_list.add_node('autonum', 'process four', PROCESS); \r\n \r\n perfind2.evidence = 0.12\r\n process3.evidence = 0.34 \r\n process4.evidence = 0.56 \r\n \r\n i = 0\r\n while(ar = @mymodel.consume_next_node_change)\r\n assert_equal([0.12,0.12], ar[0].send(ar[1][0])) if ar[0] == perfind2\r\n assert_equal([0.34,0.34], ar[0].send(ar[1][0])) if ar[0] == process3 \r\n assert_equal([0.56,0.56], ar[0].send(ar[1][0])) if ar[0] == process4\r\n i += 1\r\n end\r\n \r\n assert_equal(3, i, 'Incorrect number of node changes were logged')\r\n \r\n end",
"def all_nodes_succeeded?\n @results['succeeded'] && @results['succeeded'].length == @nodes.length\n end",
"def all_nodes_succeeded?\n @results['succeeded'] && @results['succeeded'].length == @nodes.length\n end",
"def all\n @data\n end",
"def printStatus()\n puts \"matriks_data: #{@matriks_data}\"\n puts \"jumlah node sebanyak: #{@jumlah_node}\"\n end",
"def verifyCicle\n $nodos.each { \n |node|\n if(node.entradas.length > 0)\n if(findCicle(node, node.operationId ,Array.new))\n return true\n end\n end\n }\n return false\nend",
"def run( nodes )\n\t\t\tself.log.debug \"Got %d nodes to check with %p\" % [ nodes.length, self ]\n\t\t\tlookups = self.create_lookups( nodes )\n\t\t\treturn self.wait_for_responses( lookups, nodes )\n\t\tend",
"def visit_success\n visit(TestResult, object.value)\n end",
"def check_data_values(data)\n data.each do |id, values|\n out, back = values[values.keys[0]], values[values.keys[1]]\n if back > out\n puts \"+%s+\" % [\"-\" * 57]\n puts \"|%32s%26s\" % [\"WARNING\", \"|\"]\n puts \"+%s+\" % [\"-\" * 57]\n puts \"%s%21s\" % [\"| Bad data record! -- sample #{id}\", \"|\"]\n puts \"%s%15s%22s\" % [\"| PDE in #{values.keys[0]} --\", \"#{dose_unit_text(values[values.keys[0]])}/day,\", \"|\"]\n puts \"%s%15s%22s\" % [\"| PDE in #{values.keys[1]} --\", \"#{dose_unit_text(values[values.keys[1]])}/day.\", \"|\"]\n puts \"%s%7s\" % [\"| Sample #{id} will not include in the analysis!\", \"|\"]\n puts \"+%s+\" % [\"-\" * 57]\n data.delete(id)\n end\n end\n data\n end",
"def for_node; end",
"def process_child_nodes(node); end",
"def test_xml_load_data\n @test = CinePassion.new\n \n # Test no response\n @test.DataLoadFromFile(\"test/data/cinepassion-scraper-test-00-no-response.xml\")\n assert_not_equal(@test.xml_data, \"\")\n assert_equal(@test.result_nb, 0)\n \n # Extract all data in one result\n @test.DataLoadFromFile(\"test/data/cinepassion-scraper-test-01-one-response.xml\")\n assert_not_equal(@test.xml_data, \"\")\n assert_equal(@test.result_nb, 1)\n assert_equal(@test.movies_info[0]['id'], \"136356\")\n assert_equal(@test.movies_info[0]['id_allocine'], \"136356\")\n assert_equal(@test.movies_info[0]['id_imdb'], \"1234548\")\n assert_equal(@test.movies_info[0]['last_change'], \"1279466676\")\n assert_equal(@test.movies_info[0]['url'], \"http://passion-xbmc.org/scraper/index2.php?Page=ViewMovie&ID=136356\")\n assert_equal(@test.movies_info[0]['title'], \"Les Chèvres du Pentagone\")\n assert_equal(@test.movies_info[0]['originaltitle'], \"The Men Who Stare at Goats\")\n assert_equal(@test.movies_info[0]['year'], \"2009\")\n assert_equal(@test.movies_info[0]['runtime'], \"90\")\n assert_equal(@test.movies_info[0]['plot'], \"Bob Wilton, un journaliste désespéré fait l'heureuse rencontre de Lyn Cassady, un soldat aux pouvoirs paranormaux combattant le terrorisme. Ils se rendent ensemble en Irak ou ils rencontrent Bill Django, le fondateur de l'unité, et Larry Hooper, soldat de l'unité qui dirige une prison.\")\n \n assert_equal(@test.movies_info[0]['images']['311335']['type'], \"Poster\")\n assert_equal(@test.movies_info[0]['images']['311335']['original']['height'], \"2716\")\n assert_equal(@test.movies_info[0]['images']['311335']['original']['width'], \"2000\")\n assert_equal(@test.movies_info[0]['images']['311335']['original']['url'], \"http://passion-xbmc.org/scraper/Gallery/main/Poster_LesChvresduPentagone-311335.jpg\")\n assert_equal(@test.movies_info[0]['images']['311335']['preview']['url'], \"http://passion-xbmc.org/scraper/Gallery/preview/Poster_LesChvresduPentagone-311335.jpg\")\n assert_equal(@test.movies_info[0]['images']['311335']['thumb']['url'], \"http://passion-xbmc.org/scraper/Gallery/thumb/Poster_LesChvresduPentagone-311335.jpg\")\n \n assert_equal(@test.movies_info[0]['images']['316672']['type'], \"Fanart\")\n assert_equal(@test.movies_info[0]['images']['316672']['original']['height'], \"1080\")\n assert_equal(@test.movies_info[0]['images']['316672']['original']['width'], \"1920\")\n assert_equal(@test.movies_info[0]['images']['316672']['original']['url'], \"http://passion-xbmc.org/scraper/Gallery/main/Fanart_LesChvresduPentagone-316672.jpg\")\n assert_equal(@test.movies_info[0]['images']['316672']['preview']['url'], \"http://passion-xbmc.org/scraper/Gallery/preview/Fanart_LesChvresduPentagone-316672.jpg\")\n assert_equal(@test.movies_info[0]['images']['316672']['thumb']['url'], \"http://passion-xbmc.org/scraper/Gallery/thumb/Fanart_LesChvresduPentagone-316672.jpg\")\n \n assert_equal(@test.movies_info[0]['ratings']['cinepassion']['votes'], \"1\")\n assert_equal(@test.movies_info[0]['ratings']['cinepassion']['value'], \"7\")\n assert_equal(@test.movies_info[0]['ratings']['allocine']['votes'], \"1603\")\n assert_equal(@test.movies_info[0]['ratings']['allocine']['value'], \"2,5\")\n assert_equal(@test.movies_info[0]['ratings']['imdb']['votes'], \"30695\")\n assert_equal(@test.movies_info[0]['ratings']['imdb']['value'], \"6,4\")\n \n assert_equal(@test.movies_info[0]['nfo']['Babylon']['fr'], \"http://scraper-cine-passion-demo.ledez.net/scraper/index.php?id=136356&Download=1&Version=0&Lang=fr&OK=1\")\n assert_equal(@test.movies_info[0]['nfo']['Babylon']['en'], \"http://scraper-cine-passion-demo.ledez.net/scraper/index.php?id=136356&Download=1&Version=0&Lang=en&OK=1\") \n assert_equal(@test.movies_info[0]['nfo']['Camelot']['fr'], \"http://scraper-cine-passion-demo.ledez.net/scraper/index.php?id=136356&Download=1&Version=1&Lang=fr&OK=1\")\n assert_equal(@test.movies_info[0]['nfo']['Camelot']['en'], \"http://scraper-cine-passion-demo.ledez.net/scraper/index.php?id=136356&Download=1&Version=1&Lang=en&OK=1\")\n \n # Quota extraction\n assert_equal(@test.quota['authorize'], \"300\")\n assert_equal(@test.quota['use'], \"1\")\n assert_equal(@test.quota['reset_date'], \"2010-08-04 12:45:26\")\n end",
"def setNode(node)\n #puts \"----setNode --1 #{node}\"\n if (@XML != nil)\n #puts \"----setNode --2\"\n @node = node\n tokens = node.split(\"/\")\n #puts \"setNode... tokens : #{tokens}\"\n working = @XML\n #puts \"Working ----- #{@nodeValues}\"\n #puts \"\\n\\n\\n------->>>xmlStore count:#{@xmlStore.size}\"\n #if (@xmlStoreMap != nil && @xmlStoreMap != \"\")\n # working = @xmlStore[@xmlStoreMap]\n #puts \"\\n\\n\\n1------->>>working:#{working}\"\n #elsif (@nodeValues.size > 0 && @store)\n # working = @nodeValues[@INDEX]\n #puts \"\\n\\n\\n2------->>>working:#{@nodeValues}\"\n #end\n\n @nodeValues.clear\n localIndex = 0\n localNode = \"\"\n #localHashNode = nil\n #puts \"Working : #{tokens[0]} ------\\n#{working}\"\n localHashNode = @xmlTool.getHashForNameAtPos(working, tokens[0], localIndex)\n #puts \"LocalHash :#{localIndex} :: #{tokens[0]}:\\n--------------\\n#{localHashNode}\\n--------------------------\\n\"\n @xmlTool.setCountToZero\n while ((localHashNode = @xmlTool.getHashForNameAtPos(working, tokens[0], localIndex)) != nil)\n localIndex = localIndex.next\n @xmlTool.setCountToZero\n @nodeValues << localHashNode\n #localHashNode = @xmlTool.getHashForNameAtPos(working, tokens[0], localIndex)\n #puts \"LocalHash :#{localIndex} :: #{tokens[0]}:\\n--------------\\n#{localHashNode}\\n--------------------------\\n\"\n end\n #puts \"Tokens: #{tokens} #{@nodeValues}\"\n if (tokens.size != 1 && @nodeValues.size > 0)\n for i in 0..(tokens.size-1)\n #puts \"About to traverseNodes... #{i} #{tokens[i]}\"\n tmpNodes = traverseNodes(@nodeValues, tokens[i])\n #puts \"TMP Nodes : #{tmpNodes}\"\n #if(tmpNodes != nil && tmpNodes.size > 0)\n @nodeValues = tmpNodes\n #end\n #puts \"Found Nodes : #{@nodeValues}\"\n end\n end\n @node = tokens[tokens.size - 1]\n #puts \"Finished Node : #{@nodeValues}\"\n end\n end",
"def load_data\n raise \"Data is temporarily disabled\" unless EolConfig.data?\n EOL.log_call\n # Sad that we need to load all of this for the about and glossary tabs, but\n # TODO - we can cache this, later:\n @taxon_data = []\n @range_data = []\n @data_point_uris = []\n @categories = []\n @include_other_category = @data_point_uris &&\n @data_point_uris.detect { |d| d.predicate_known_uri.nil? ||\n d.predicate_known_uri.toc_items.blank? }\n @units_for_select = []\n end",
"def hasData\n sql = ActiveRecord::Base.connection();\n #dataCount, dummy = sql.execute(\"SELECT count(*), 0 FROM enclavecontrols WHERE enclavequarter_id = #{self.id}\").fetch_row\n dataCount = sql.select_value(\"SELECT count(*) FROM enclavecontrols WHERE enclavequarter_id = #{self.id}\")\n if dataCount.to_i > 0 then\n hasData = true\n else\n hasData = false\n end\n #hasData = dataCount\n hasData\n end",
"def test_0100_allq\n @@log.debug \"test_0100_allq starts\" if @@log.debug?\n assert_respond_to(@list, :all?, \"test_0100_allq_respond\")\n # No members are false or nil\n assert(@list.all?,\"test_0100_allq_basic\")\n # Block never returns false or nil\n result = @list.all? {|obj| true}\n assert(result, \"test_0100_allq_block_01\")\n # Any member has .last == \"ZZTop\"\n result = @list.all? {|obj| obj.last == \"ZZTop\" }\n assert(result == false, \"test_0100_allq_block_02\")\n #\n @@log.debug \"test_0100_allq ends\" if @@log.debug?\n end",
"def contains?(data)\n if @head == nil \n puts \"error: empty list\" \n end\n in_list = false\n current_node = @head\n while current_node != nil\n if current_node.value == data\n in_list = true\n end\n current_node = current_node.next_node\n end\n in_list\n end",
"def data_nil?\n raise 'You must use the parse method to populate the data attribute first' if @data.nil?\n end",
"def isDummyNode?(node) \n return node.name == Tag_Dummy ;\n end",
"def gatherNode(id)\n @nodes.bsearch { |n| n.data == data}\n end",
"def print\n if self.length == 0\n puts \"empty\"\n else\n self.each { |node| puts node.data }\n end\n end",
"def test_nodes_of_museum\n\t\tassert_equal @location, @location2.nodes[0]\n\tend",
"def on_if_failed(node)\n id, *children = *node\n if tester.literal_flags\n node.updated(nil, [id] + process_all(children))\n else\n node.updated(nil, [clean(id)] + process_all(children))\n end\n end",
"def get_data times=nil\n puts \"Getting getting data...\"\n if (times)\n times.times { check_data }\n else\n loop { check_data }\n end\n end",
"def update_data\n @store.get_data true\n end",
"def process_acceptence \n @forest_operations.forest_tree_roots_arr.each{|node|\n if ForestOperations.is_element_present_in_node?(node, line_content[:sent_or_accepted_by])\n ForestOperations.update_tree_score(\n node,\n line_content[:sent_or_accepted_by]\n )\n end\n }\n end",
"def check1()\n project_id = 1\n puts \"# check 1 : test les features niveau 3 qui n'ont pas de feature parents\"\n count = 0\n features3 = Feature.all_by_level(3,project_id)\n features3.each do |f|\n if f.parent_feature == nil then\n puts \" la feature niveau 3 #{f.id} n'a pas de feature parent #{f.subject}\"\n count +=1\n end\n end\n\n puts \"# check1 : done ... => #{count} errors\"\n return count==0\nend",
"def on_test(ast_node, context)\n nodes = XML::NodeSet.new\n\n context.each do |xml_node|\n nodes << xml_node if node_matches?(xml_node, ast_node)\n end\n\n return nodes\n end",
"def test_connected_nodes_with_method1\r\n link1 = @linklist.add_link(@node4, @node3, false)\r\n \r\n #process node has one child but doesn't have method \r\n assert(@linklist.connected_nodes_with_method(@node3, :measurement).size == 0)\r\n #perfind node has no children\r\n assert(@linklist.connected_nodes_with_method(@node4, :measurement).size == 0)\r\n end",
"def are_node_basic_fields_valid?(node)\n err = []\n err << \"Node uid is not provided\" unless node['uid']\n\n err.any? ? fail_validation(node, err) : true\n end",
"def assert_data_at_equal data, path, match, msg=nil\n last_data = nil\n found = false\n\n Path.find path, data do |d,k,p|\n found = true\n last_data = d[k]\n break if d[k] == match\n end\n\n assert found,\n msg || \"No data found at #{path.inspect} for #{data.inspect}\"\n\n assert_equal match, last_data, msg\n end",
"def my_all?\n\t\t#if any element is false return false\n\t\tmy_each do | element |\n\t\t\tif yield( element )\n\t\t\t\tnext\n\t\t\telse\n\t\t\t\treturn false\n\t\t\tend\n\t\tend\n\n\t\t# returns true when all iterations pass\n\t\treturn true\n\n\tend",
"def empty?\n @data.empty?\n end"
] |
[
"0.6053136",
"0.59973353",
"0.59430426",
"0.57525593",
"0.5610898",
"0.5559573",
"0.5549556",
"0.5524015",
"0.55099815",
"0.5429856",
"0.536739",
"0.5362716",
"0.5348401",
"0.53454703",
"0.53054553",
"0.5304379",
"0.52848417",
"0.52740085",
"0.52465475",
"0.52420294",
"0.52341056",
"0.5226718",
"0.520736",
"0.5207348",
"0.5197016",
"0.5184309",
"0.5174677",
"0.5173282",
"0.51684886",
"0.5162637",
"0.5151236",
"0.51463944",
"0.5137622",
"0.51313376",
"0.5112153",
"0.5098922",
"0.50828534",
"0.50778997",
"0.5076884",
"0.506877",
"0.50477463",
"0.5034562",
"0.50312686",
"0.50153774",
"0.5013315",
"0.49991375",
"0.4993859",
"0.49921733",
"0.49913722",
"0.49913722",
"0.49885088",
"0.4988436",
"0.49876603",
"0.49869365",
"0.49869365",
"0.4984373",
"0.49802253",
"0.4978095",
"0.49777436",
"0.49760816",
"0.4972298",
"0.49677804",
"0.4961034",
"0.49536002",
"0.49470547",
"0.4945727",
"0.49443245",
"0.49428603",
"0.49385104",
"0.49347034",
"0.49347034",
"0.49221867",
"0.4921953",
"0.4907376",
"0.48918152",
"0.4891377",
"0.48888734",
"0.488485",
"0.48792243",
"0.48776758",
"0.4876841",
"0.48750547",
"0.48721316",
"0.4870183",
"0.48681292",
"0.48643315",
"0.4861271",
"0.48598877",
"0.48596662",
"0.48579907",
"0.48553342",
"0.48516598",
"0.48479497",
"0.4838128",
"0.48364136",
"0.48354107",
"0.4830181",
"0.48289514",
"0.48277014",
"0.48260424",
"0.48219842"
] |
0.0
|
-1
|
Prints a horizontal line of '' characters
|
def print_divider
puts "------------------------------------------------------------"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def print_horizontal_line(length)\n print '+'\n (length - 2).times do |index|\n print '-'\n end\n print '+'\n print \"\\n\"\n end",
"def print_empty_line\n print_in_same_line(\" \")\n end",
"def render_spacer\n puts \"\\n\"\n end",
"def draw_line\n print H_SEP * columns\n end",
"def hor_line\n\tfor i in 1..40\n\t\tprint \"-\"\n\tend\n\tputs ''\nend",
"def empty_line\r\n puts \"\\n\"\r\n end",
"def empty_line\n puts\" \" * 70\nend",
"def print_in_box(str)\n str_length = str.length\n puts first_horizontal_line = \"+ #{\"-\" * str_length} +\"\n puts second_horizontal_line = \"| #{\" \" * str_length} |\"\n puts third_horizontal_line = \"| #{str} |\"\n puts fourth_horizontal_line = \"| #{\" \" * str_length} |\"\n puts fifth_horizontal_line = \"+ #{\"-\" * str_length} +\"\nend",
"def blank_line\n output \"\"\n end",
"def print_separator_line\nline = \"\"\n3.times do\n3.times { line << SEPARATOR[:horizontal] }\nline << SEPARATOR[:cross]\nend\nputs line[0...line.length - 1]\nprint \"\\t\"\nend",
"def line(length)\r\n puts '-'*length\r\n end",
"def h_line\n puts \"-\" * 50\n nil\nend",
"def h_line\n puts \"-\" * 80\n nil\nend",
"def print_in_box(string)\n horizontal_rule = \"+#{'-' * (string.length + 2)}+\"\n empty_line = \"|#{' ' * (string.length + 2)}|\"\n puts horizontal_rule\n puts empty_line\n puts \"| #{string} |\"\n puts empty_line\n puts horizontal_rule\nend",
"def clear_line\n print \"\\r%s\\r\" % ' ' * columns\n end",
"def line_sep(title=nil); print \"\\n#{title} ----\\n\\n\"; end",
"def line_sep(title=nil); print \"\\n#{title} ----\\n\\n\"; end",
"def put_a_line\n puts \"\\n\"\n puts \"/\\\\\" * 40\n puts \"\\n\"\n end",
"def spacer\n puts \"\\n----------------------------\\n\"\nend",
"def p_blankline\n p do\n nbsp\n end\n end",
"def display(line, column=0)\n result = \"\\e[s\"\n result << \"\\e[#{line.to_i};#{column.to_i}H\"\n result << to_s\n result << \"\\e[u\"\n result\n end",
"def print_line(line_elements)\n str = \"| \"\n \n line_elements.each_with_index do |element, index|\n if index == 0\n str += element.to_s.ljust(title_width) + \" | \"\n else\n str += element.to_s.rjust(column_width) + \" | \"\n end\n end\n\n puts str\n end",
"def horizontalSpacer(n , text)\n n.times {print \" \"}\n puts text\nend",
"def draw_eol\n print \"\\r\\e[#{columns - 1}C#{V_SEP}\\n\"\n end",
"def print_in_box(message)\n horizontal_rule = \"+#{'-' * (message.size + 2)}+\"\n empty_line = \"|#{' ' * (message.size + 2)}|\"\n\n puts horizontal_rule\n puts empty_line\n puts \"| #{message} |\"\n puts empty_line\n puts horizontal_rule\nend",
"def print_in_box(message)\n horizontal_rule = \"+#{'-' * (message.size + 2)}+\"\n empty_line = \"|#{' ' * (message.size + 2)}|\"\n\n puts horizontal_rule\n puts empty_line\n puts \"| #{message} |\"\n puts empty_line\n puts horizontal_rule\nend",
"def begin_of_line\n write_raw \"\\r\"\n end",
"def line\n\tputs \"-\" * 100\nend",
"def print_line(nlen, n, clen, c)\n puts \"%-#{nlen}s | %-#{clen}s \" % [n, c]\n end",
"def draw_blank\n puts \"[ o ] [ o ] [ o ] [ o ]\\n\\n\"\n end",
"def print_head\n system \"clear\"\n puts $line_break\n puts \"## ___ ___ ______________ __________ _________ ##\"\n puts \"## / _ )/ _ /_ __/_ __/ / / __/ __/ // / _/ _ \\\\ ##\"\n puts \"## / _ / __ |/ / / / / /__/ _/_\\\\ \\\\/ _ // // ___/ ##\"\n puts \"##/____/_/ |_/_/ /_/ /____/___/___/_//_/___/_/ ##\"\n puts \"## ##\"\n end",
"def print_in_box(str)\n size = str.size\n border_line = '+-' + ('-' * size) + '-+'\n empty_line = '| ' + (' ' * size) + ' |'\n text_line = '| ' + str + ' |'\n \n puts border_line\n puts empty_line\n puts text_line\n puts empty_line\n puts border_line\nend",
"def show\n \"\\t#{@line}: #{first_line}\"\n end",
"def show_line\n say \"=\" * 25\nend",
"def display(line, column=0) #:yield:\n result = \"\\e[s\"\n result << \"\\e[#{line.to_i};#{column.to_i}H\"\n if block_given?\n result << yield\n result << \"\\e[u\"\n #elsif string\n # result << string\n # result << \"\\e[u\"\n end\n result\n end",
"def console_header(str)\n width = 20\n delimiter = '-' * width\n puts delimiter\n puts str.center(width)\n puts delimiter\nend",
"def line(opts = { print: true })\n if color?\n result = ANSI_CODES[:bold] + GLYPHS[:heavy_dash] * 80 + ANSI_CODES[:reset] + \"\\n\"\n else\n result = \"-\" * 80 + \"\\n\"\n end\n print_or_return(result, opts[:print])\n end",
"def line(*font)\n @io.puts(tag(:hr))\n end",
"def p_blankline_hr\n p :class => \"underline\" do\n nbsp\n end\n end",
"def print_new_line\n puts ''\nend",
"def blank\n print \"\\r\"\n if @last_print_msg\n print ' ' * IO.console.winsize[1]\n end\n print \"\\r\"\n end",
"def print_separator\n\t40.times {print '-'}\n\tputs\nend",
"def escape\n puts \"\"\n puts \" \" + \"_\" * 40\n puts \"\"\n end",
"def draw(text)\n printf \"%s %-#{(columns / 3) - 5}s \" % [V_SEP, text]\n end",
"def print_separator\n str = \"+\" + \"-\" * (title_width + 2)\n \n column_order.length.times do\n str += \"+\" + \"-\" * (column_width + 2)\n end\n \n puts str + '+'\n end",
"def print_output\n output.map { |line| (line =~ /^\\-$/) ? ('-' * total_width) : line.rjust(total_width) }\n end",
"def linebreak(char='')\n puts \"#{char*50}\"\n end",
"def render\n @board.each.with_index do |row, y|\n row.each.with_index do |item, x|\n chr = item.nil? ? \" \" : item\n print \" #{chr} \"\n print \"|\" unless x == row.size - 1\n end\n print \"\\n-----------\\n\" unless y == @board.size - 1\n end\n print \"\\n\"\n end",
"def show_blank(p)\r\n set_cursor p\r\n print Normal\r\n print \" \"*@disks + \"|\" + \" \"*@disks\r\n update\r\n end",
"def print_in_box(message)\n width = message.length + 2\n line = '++'\n space = '||'\n banner = \"| #{message} |\"\n\n (width).times do |i|\n line.insert(1,'-')\n space.insert(1,' ')\n end\n\n puts line\n puts space\n puts banner\n puts space\n puts line\nend",
"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 display_board(board)\n horiz_line = \"-----------\"\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts horiz_line\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts horiz_line\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"def hputs(str=\"\")\n str << \"\\n\" unless str[-1] == ?\\n\n print str.gsub(/\\n/, \"<br />\\n\")\nend",
"def line(text, length=20)\n puts \"-\" * length\n puts text \nend",
"def print_line(line)\n @maxlinelength = line.length if line.length > @maxlinelength\n print line.ljust(@maxlinelength) << \"\\r\"\n $stdout.flush\nend",
"def show\n\t puts \"\t#{@spaces[0]} #{@spaces[1]} #{@spaces[2]}\"\n\t puts \"\t#{@spaces[3]} #{@spaces[4]} #{@spaces[5]}\"\n\t puts \"\t#{@spaces[6]} #{@spaces[7]} #{@spaces[8]}\"\n\tend",
"def display_header\n puts \" 1 2 3 4 5 6 7 8 9 10\"\n puts \" -----------------------------------------\"\n end",
"def horizontal_blank_space(msg_line=\"\")\n screen_width - msg_line.length\n end",
"def print_line\n @pdf.stroke_horizontal_line @pdf.bounds.left, @pdf.bounds.right\n end",
"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 clear_line\n puts \"\\e[0A\\e[0G\"\n end",
"def space\n 20.times do\n puts \"\"\n end\n end",
"def spacing\n puts \"\"\n puts \"\"\n puts \"\"\n end",
"def space\n 3.times { puts \"\\n\"}\n end",
"def hline_top\n\tputs \"__________________________________________________________\"\nend",
"def display\n\t\tbreakline = \"---- --- ----\"\n\t\tputs breakline.center(@linewidth)\n\t\tputs \"| #{@board[:one]} | #{@board[:two]} | #{@board[:three]} |\".center(@linewidth)\n\t\tputs breakline.center(@linewidth)\n\t\tputs \"| #{@board[:four]} | #{@board[:five]} | #{@board[:six]} |\".center(@linewidth)\n\t\tputs breakline.center(@linewidth)\n\t\tputs \"| #{@board[:seven]} | #{@board[:eight]} | #{@board[:nine]} |\".center(@linewidth)\n\t\tputs breakline.center(@linewidth)\n\t\tputs \"\".center(@linewidth)\n\tend",
"def print_header(string)\n puts '*'.white * 80\n puts string.center(80)\n puts '*'.white * 80\nend",
"def print_in_box(str)\n width = str.length + 2\n \n puts \"+#{'-'*width}+\"\n puts \"|#{' '*width}|\"\n puts \"| #{str} |\"\n puts \"|#{' '*width}|\"\n puts \"+#{'-'*width}+\"\nend",
"def draw\n\t\tputs \"\\n\"\n\t\tmid = (@height/2.0).ceil\n\t\tfor line in 1..@height\n\t\t\tspace0 = (mid - (mid-line).abs).abs\n\t\t\tspace1 = (mid - line).abs * 2 - 1\n\t\t\tputs space1 > 0 ?\n\t\t\t\t \" \" * space0 + \"X \" + \" \" * space1 + \"X\" :\n\t\t\t\t \" \" * space0 + \"X\"\n\t\tend\n\tend",
"def print_heading_message message\n puts message\n\n message.size.times do\n print \"-\"\n end\n print_spacing(1)\nend",
"def print\n # Special handling: print the top line.\n line = \"+\"\n for x in (0...@width)\n line.concat(x == @start_x && @start_y == 0 ? \" +\" : \"---+\")\n end\n puts line\n \n # For each cell, print the right and bottom wall, if it exists.\n for y in (0...@height)\n if y == @start_y && @start_x == 0 then\n line = \" \"\n else\n line = \"|\"\n end\n for x in (0...@width)\n line.concat(\" \")\n line.concat(@vertical_walls[y][x] != :open ? \"|\" : \" \")\n end\n puts line\n \n line = \"+\"\n for x in (0...@width)\n line.concat(@horizontal_walls[y][x] != :open ? \"---+\" : \" +\")\n end\n puts line\n end\n end",
"def print_in_box(str)\n dash_inserts = '-' * str.length\n horiz_border = '+-' + dash_inserts + '-+'\n space_inserts = ' ' * str.length\n padding_border = '| ' + space_inserts + ' |'\n puts horiz_border\n puts padding_border\n puts '| ' + str + ' |'\n puts padding_border\n puts horiz_border\nend",
"def print\n # Special handling: print the top line.\n line = '#'\n for x in (0...@width)\n line.concat(x == @start_x ? ' #' : '####')\n end\n puts line\n\n # For each cell, print the right and bottom wall, if it exists.\n for y in (0...@height)\n line = '#'\n for x in (0...@width)\n line.concat(@path[y][x] ? \" o \" : \" \")\n line.concat(@vertical_walls[y][x] ? '#' : \" \")\n end\n puts line\n\n line = '#'\n for x in (0...@width)\n line.concat(@horizontal_walls[y][x] ? '####' : ' #')\n end\n puts line\n end\n end",
"def print_in_box(text)\n horizontal = \"+\" + \"-\" * (text.length + 2) + \"+\"\n text_line = \"| \" + text + \" |\"\n vertical = \"|\" + \" \" * (text.length + 2) + \"|\"\n\n puts horizontal\n puts vertical\n puts text_line\n puts vertical\n puts horizontal\nend",
"def separator\n puts \" \"\n puts pastel.bright_magenta(\"======================================================\")\n puts \" \"\n end",
"def separator\n puts \" \"\n puts pastel.bright_magenta(\"======================================================\")\n puts \" \"\n end",
"def separator\n puts \" \"\n puts pastel.bright_magenta(\"======================================================\")\n puts \" \"\n end",
"def liner box_char=@box_char, box_size=@box_size\n self.puts( box_char * box_size ) if self.debug?\n end",
"def newline\n @printer.nl\n end",
"def triangle(rows)\n 1.upto(rows) { |num| puts \"#{\"*\" * num}\".rjust(rows)}\nend",
"def draw_horizontal(line, start_char, end_char)\n start_char.upto(end_char) { |char_idx| @lines[line][char_idx] = PATH_CHAR } \n end",
"def format_line(arr)\n x = TTY::Screen.width - 2\n small_items = 12\n first_item = x - 5 * small_items\n\n output = \"\"\n arr.each_with_index do |l, i|\n if i == 0\n output << l.to_s[0..first_item].ljust(first_item)\n else\n output << l.to_s[0..small_items].ljust(small_items)\n end\n end\n output\n end",
"def underline(str)\n str += \"\\n\" + \"-\"*str.length\n end",
"def print_line(height, num)\n result = \" \" * (height - num)\n num.times do\n result += \"* \"\n end\n puts result\nend",
"def clear_line; print \"\\e[2K\" end",
"def header\n\t\t\t\tputs stars(47).green\n\t\t\t\tputs \"* \".green + \" _____ _ _ _ _ \".light_red + \" *\".green\n\t\t\t\tputs \"* \".green + \" / ____| | | | | | (_) \".light_red + \" *\".green\n\t\t\t\tputs \"* \".green + \" | (___ ___ _ __ __ _| |__ | |__ | |_ \".light_red + \" *\".green\n\t\t\t\tputs \"* \".green + \" \\\\___ \\\\ / __| '__/ _` | '_ \\\\| '_ \\\\| | | \".light_red + \" *\".green\n\t\t\t\tputs \"* \".green + \" ____) | (__| | | (_| | |_) | |_) | | | \".light_red + \" *\".green\n\t\t\t\tputs \"* \".green + \" |_____/ \\\\___|_| \\\\__,_|_.__/|_.__/|_|_| \".light_red + \" *\".green\n\t\t\t\tputs \"* \".green + \" \".light_red + \" *\".green\n\t\t\tend",
"def draw_segment(character, offset)\n puts \"#{' ' * offset}#{character}\"\nend",
"def h(heading)\n puts \"\"\n puts \"-\"*10\n puts heading\n puts \"-\"*10\nend",
"def print_horizontal_pyramid(height)\n n = 1\n h = height\n (1..height).each do |i|\n space = \" \"\n star = \"*\"\n print space * h + star * n\n n = n+2\n h = h-1\n print \"\\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 draw_horizontal_stars(line, start_char, end_char)\n start_char.upto(end_char) { |char_idx| @lines[line][char_idx] = STAR_CHAR }\n end",
"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 display_board\n cell = \" \"\n divider = \"|\"\n demarcator = \"\"\n 11.times { demarcator << \"-\" }\n row = cell + divider + cell + divider + cell\n\n puts row\n puts demarcator\n puts row\n puts demarcator\n puts row\nend",
"def puts(string=nil)\n $stdout.puts(string.to_s.gsub(/^/, \" \"))\n end",
"def display_board(board)\n line = ''\n 0.upto(board.length - 1) do |lane|\n 0.upto(5) do |row|\n line += fig('pad')\n 0.upto(board[lane].length - 1) do |col|\n line += board[lane][col][row]\n line += fig('vbar') unless col == 2\n line += \"\\n\" unless col < 2\n end\n line += (fig('pad') + fig('hbar')) if row == 5 && lane < 2\n end\n end\n print line\n end",
"def print_heading\n @report_file.puts\n @report_file.puts(' ##### ######')\n @report_file.puts(' # # ## # ###### #### # # ###### ##### #### ##### #####')\n @report_file.puts(' # # # # # # # # # # # # # # # #')\n @report_file.puts(' ##### # # # ##### #### ###### ##### # # # # # # #')\n @report_file.puts(' # ###### # # # # # # ##### # # ##### #')\n @report_file.puts(' # # # # # # # # # # # # # # # # #')\n @report_file.puts(' ##### # # ###### ###### #### # # ###### # #### # # #')\n @report_file.puts('********************************************************************************')\n @report_file.puts\n end",
"def display_header\n @output.puts # spacer\n @output.puts ''.center(WIDTH, '=')\n @output.puts \" Gambler v#{Gambler::VERSION} \".center(WIDTH, '=')\n @output.puts ''.center(WIDTH, '=')\n @output.puts '----------------------------------------'.center(WIDTH)\n @output.puts '| Feeding yet another human addiction. |'.center(WIDTH)\n @output.puts '----------------------------------------'.center(WIDTH)\n end",
"def line\n\t\tl = @name\n\t\t(1..25).each do |i|\n\t\t\tl += \" &\"\n\t\t\tif i <= @number then\n\t\t\t\tl += \" \\\\!$\\\\times$\"\n\t\t\tend\n\t\tend\n\t\tl += \" \\\\\\\\\\n\"\n\t\treturn l\n\tend",
"def write_separator\n @stream.puts('')\n end",
"def print_line(fields)\n output.puts(format_with_color(fields[:color], format_line(fields)))\n end"
] |
[
"0.8005121",
"0.76812214",
"0.76274747",
"0.76106316",
"0.7433871",
"0.74207246",
"0.7286814",
"0.7189737",
"0.71714747",
"0.71148264",
"0.7102233",
"0.7086485",
"0.70694804",
"0.7062242",
"0.70052105",
"0.6995032",
"0.6995032",
"0.6977793",
"0.6972181",
"0.69254994",
"0.6857278",
"0.68483144",
"0.683985",
"0.68225586",
"0.68039864",
"0.68039864",
"0.67752564",
"0.6765458",
"0.67557734",
"0.67499393",
"0.67055976",
"0.66503704",
"0.6646695",
"0.6641839",
"0.66326123",
"0.660339",
"0.66006213",
"0.6581225",
"0.65797406",
"0.6569988",
"0.6568929",
"0.65494037",
"0.6548805",
"0.6536519",
"0.65306187",
"0.6487946",
"0.64831126",
"0.64714366",
"0.64430016",
"0.64345604",
"0.6433322",
"0.6430684",
"0.64195234",
"0.6416529",
"0.6414599",
"0.64057547",
"0.6405611",
"0.6393949",
"0.6391234",
"0.63880676",
"0.63831615",
"0.6372365",
"0.6370105",
"0.6368361",
"0.6367267",
"0.634777",
"0.63432926",
"0.63392323",
"0.63254577",
"0.6321676",
"0.632109",
"0.63188726",
"0.6314688",
"0.63037527",
"0.62972105",
"0.62972105",
"0.62972105",
"0.6288136",
"0.62809443",
"0.62775373",
"0.62623084",
"0.6260439",
"0.6256652",
"0.6253542",
"0.6248583",
"0.62472093",
"0.6238516",
"0.622099",
"0.621322",
"0.62079036",
"0.6196903",
"0.61876464",
"0.6181262",
"0.618122",
"0.6180531",
"0.617341",
"0.6171702",
"0.6154559",
"0.6150784",
"0.615011"
] |
0.6565153
|
41
|
Initializes a new keychain from the specified keychain file
|
def initialize(options={})
unless options.has_key?(:keychain_file) || options.has_key?(:keychain_data)
raise ArgumentError, 'Either a keychain_file or keychain_data is required to create a new keychain class'
end
@keychain = options[:keychain_data] || JSON.parse(IO.read(options[:keychain_file]))
# TODO: Validate that the hash is correct.
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def keychain\n @keychain ||= Keychain.new\n end",
"def open(path)\n raise ArgumentError unless path\n out_buffer = FFI::MemoryPointer.new(:pointer)\n status = Sec.SecKeychainOpen(path,out_buffer);\n Sec.check_osstatus(status)\n Keychain.new(out_buffer.read_pointer).release_on_gc\n end",
"def create(certificate_chain_file_path, private_key_file_path)\n import(certificate_chain_file_path, private_key_file_path)\n end",
"def initialize(file_or_path, options = {})\n data = file_or_path.read if file_or_path.respond_to?(:read)\n data ||= File.read file_or_path\n\n @keystore = options[:keystore]\n\n init(data)\n end",
"def initialize(verbose = true)\n @verbose = verbose\n \n @cert_kc_name = \"SystemCACertificates.keychain\"\n @cert_kc_path = File.join(CertTools.output_keychain_path, @cert_kc_name)\n end",
"def create_temp_keychain()\n puts \"Creating empty temp keychain at #{@temp_kc_path}\" if @verbose \n CertTools.createKeychain(@temp_kc_path, @temp_kc_name)\n end",
"def initialize(verbose = true)\n @verbose = verbose\n \n @root_cert_file_name = \"SystemRootCertificates.keychain\"\n @root_cert_kc_path = File.join(CertTools.output_keychain_path, @root_cert_file_name)\n\n @settings_file_name = \"SystemTrustSettings.plist\"\n @setting_file_path = File.join(CertTools.output_keychain_path, @settings_file_name)\n\n @temp_kc_name = \"SystemTempCertificates.keychain\"\n @temp_kc_path = File.join(CertTools.build_dir, @temp_kc_name)\n\n end",
"def set_key_entry(aliaz, key, certificate_chain, password = nil)\n\n end",
"def init_client keyfile, options\n verify_keyfile! keyfile\n client_opts = client_options keyfile, options\n Signet::OAuth2::Client.new client_opts\n end",
"def keychain\n out = FFI::MemoryPointer.new :pointer\n status = Sec.SecKeychainItemCopyKeychain(self,out)\n Sec.check_osstatus(status)\n CF::Base.new(out.read_pointer).release_on_gc\n end",
"def initialize(otrkey_file, email, password)\n @email = email\n @password = Base64.decode64 password\n\n @file_in_path = otrkey_file\n @file_out_path = File.expand_path(@file_in_path + '/..') + '/my_' + File.basename(@file_in_path, '.otrkey')\n end",
"def initialize(file, environment_based, keys = [])\n @file, @environment_based, @keys = file, environment_based, keys\n end",
"def initialize(options = {})\n invalid_options = options.keys - [:private_key_file, :public_key_file, :algorithm, :password]\n raise ArgumentError, \"Unknown key(s): #{invalid_options.join(\", \")}\" unless invalid_options.empty?\n \n options = {\n :private_key_file => AsymmetricCipher.default_private_key_file,\n :public_key_file => AsymmetricCipher.default_public_key_file\n }.merge(options)\n \n @public_key = @private_key = nil\n \n self.private_key_file = options[:private_key_file]\n self.public_key_file = options[:public_key_file]\n raise ArgumentError, 'At least one key file must be specified (:private_key_file or :public_key_file)' unless private_key_file || public_key_file\n \n self.algorithm = options[:algorithm]\n self.password = options[:password]\n \n super()\n end",
"def load\n # read the keystore file and extract the parts\n file = File.read(@config[:filename])\n encrypted_key = file[0,128]\n iv = file[128,16]\n ciphertext = file[144, file.length - 144]\n \n # decrypt the KEK\n kek = @config[:SSLPrivateKey].private_decrypt(encrypted_key)\n \n # decrypt the keystore with the KEK and IV\n cipher = get_cipher\n cipher.decrypt(kek)\n cipher.iv = iv\n ksdata = cipher.update(ciphertext)\n ksdata << cipher.final\n \n # remove the random offset and reanimate the keystore\n offset = ksdata.slice!(0,2).unpack(\"n\").first\n ksdata.slice!(0,offset)\n @ks = Marshal.restore(ksdata)\n end",
"def initialize(json: nil, path: nil)\n if json\n load_privatekeyjson(json)\n elsif path\n load_privatekeyfile(path)\n end\n end",
"def load(key_store_file, password)\n\n end",
"def initialize(file)\n unless file.end_with?(Wallet::EXT, Copies::EXT)\n raise \"Wallet file must end with #{Wallet::EXT} or #{Copies::EXT}: #{file}\"\n end\n @file = File.absolute_path(file)\n @txns = CachedTxns.new(Txns.new(@file))\n @head = CachedHead.new(Head.new(@file))\n end",
"def initialize(berksfile)\n @berksfile = berksfile\n @filepath = File.expand_path(\"#{berksfile.filepath}.lock\")\n @dependencies = {}\n\n load! if File.exists?(@filepath)\n end",
"def initialize(verbose = true)\n\n @verbose = verbose\n\n @open_ssl_tool_path = \"/usr/bin/openssl\"\n @plistbuddy_tool_path = \"/usr/libexec/PlistBuddy\"\n @evroots_config_path = File.join(CertTools.certificate_dir, \"CertificateTool/BuildOSXRootKeychain/evroot.config\")\n @evroots_config_data = nil\n\n Utilities.check_path(@evroots_config_path, false)\n\n @evroots_kc_name = \"EVRoots.keychain\"\n @evroots_kc_path = File.join(CertTools.build_dir, @evroots_kc_name)\n\n @evroots_plist_name = \"EVRoots.plist\"\n @evroots_plist_path = File.join(CertTools.output_keychain_path, @evroots_plist_name)\n\n end",
"def load_private_key(filename, passphrase = T.unsafe(nil), ask_passphrase = T.unsafe(nil), prompt = T.unsafe(nil)); end",
"def default\n out_buffer = FFI::MemoryPointer.new(:pointer)\n status = Sec.SecKeychainCopyDefault(out_buffer);\n Sec.check_osstatus(status)\n\n Keychain.new(out_buffer.read_pointer).release_on_gc\n end",
"def add(key_file); end",
"def initialize(options = {})\n options = options.symbolize_keys\n options.assert_valid_keys(\n :private_key_file,\n :public_key_file,\n :key,\n :algorithm\n )\n options.reverse_merge!(\n :private_key_file => @@default_private_key_file,\n :public_key_file => @@default_public_key_file,\n :algorithm => @@default_algorithm\n )\n \n @public_key = @private_key = nil\n @key = options[:key]\n @algorithm = options[:algorithm]\n \n self.private_key_file = options[:private_key_file]\n self.public_key_file = options[:public_key_file]\n \n super()\n end",
"def initialize(filename = \"config/salt\")\n file_path = File.join(Merb.root, filename)\n if File.exists? file_path\n @salt = load_salt(file_path)\n else # saltfile doesn't exist, let's generate a salt\n @salt = generate_salt\n save_salt(file_path)\n end\n end",
"def init_keystore\n @ks = Hash.new\n @ks[:serial] = 0\n @ks[:family] = Hash.new\n save\n end",
"def initialize(host_or_file, port, keyfile, keypass, cafile)\r\n\r\n unless SSLEnabled\r\n raise RuntimeError.new(\"Ruby/OpenSSL module is required for WiKID authentication.\")\r\n end\r\n\r\n if (cafile.empty?)\r\n cafile = File.expand_path(File.join(File.dirname(__FILE__), \"..\", \"share\", \"data\", \"WiKID-ca.pem\"))\r\n end\r\n\r\n if (File.exist?(host_or_file))\r\n # props = parse_ini_file(host_or_file)\r\n props = Hash.new\r\n\r\n @host = props['host']\r\n @port = props['port']\r\n @keyfile = props['keyfile']\r\n @keypass = props['pass']\r\n @cafile = props['cafile']\r\n else\r\n @host = host_or_file.untaint\r\n @port = port.untaint\r\n @keyfile = keyfile.untaint\r\n @keypass = keypass.untaint\r\n unless (cafile.nil? || cafile.empty?)\r\n @cafile = cafile.untaint\r\n end\r\n end\r\n if (!@port.is_a?(Integer))\r\n @port = 0\r\n end\r\n\r\n _dprint(\"WiKID.rb initialized: host=#{@host}, port=#{@port}, keyfile=#{@keyfile}, cafile=#{@cafile}\")\r\n\r\n ## simple hack to allow for testing during gem installation (prevents security errors since keys may not yet be available)\r\n unless port == -1\r\n checkKeys()\r\n end\r\n\r\n return true\r\n end",
"def initialize(*)\n super\n\n @encrypted_env_key = \"ENCRYPTED_#{env_key}\"\n @encrypted_key_path = \"#{key_path}.enc\"\n end",
"def import(certificate_chain_file_path, private_key_file_path)\n @call_params[:file_path_certificate] = certificate_chain_file_path\n @call_params[:file_path_private_key] = private_key_file_path\n @client.call(self.class, __callee__.to_s, @call_params)\n end",
"def initialize(password, config = {})\n self.config = config\n @secret_key = @secret_iv = @clear_data = @encrypted_data = ''\n\n begin\n @public_key = OpenSSL::PKey::RSA.new(File.open(self.config[:public_key]))\n @private_key =\n OpenSSL::PKey::RSA.new(File.open(self.config[:private_key]), password)\n @keystore = Nachos::KeyStore.new\n\n keypair\n rescue Errno::ENOENT\n raise Nachos::EncryptorException, \"Public or private key missing! \" +\n \"(maybe both!)\"\n rescue Nachos::KeyStoreException => e\n raise\n rescue => e\n raise Nachos::EncryptorException, \"There was a problem loading or \" +\n \"decrypting the keypair and/or keystore! (#{e})\" \n end\n end",
"def load_last_keychain_id!\n @last_keychain_id_file ||= build_keychain_path\n if File.exists?(@last_keychain_id_file)\n self.last_keychain_id = File.read(@last_keychain_id_file).to_i\n else\n self.last_keychain_id = 0\n save\n end\n end",
"def initialize(key_base64)\n @key = key_base64\n end",
"def initialize\n key_pair = ECDSA.generate_key_pair\n self.private_key, self.public_key = key_pair.values_at(:private_key, :public_key)\n end",
"def start_tls args={}\n\t priv_key, cert_chain = args.values_at(:private_key_file, :cert_chain_file)\n\t \n\t [priv_key, cert_chain].each do |file|\n\t next if file.nil? or file.empty?\n\t raise FileNotFoundException, \n\t \"Could not find #{file} for start_tls\" unless File.exists? file\n end\n\t\t\n\t\tEventMachine::set_tls_parms(@signature, priv_key || '', cert_chain || '')\n\t\t\n\t\tEventMachine::start_tls @signature\n\tend",
"def load(path, password=nil)\n json = JSON.load File.read(path)\n raise ValidationError, 'Invalid keystore file' unless Keystore.validate(json)\n new json, password, path\n end",
"def initialize(file_name: nil, env: nil)\n env ||= defined?(Rails) ? Rails.env : ENV[\"RACK_ENV\"] || ENV[\"RAILS_ENV\"] || \"development\"\n\n unless file_name\n root = defined?(Rails) ? Rails.root : \".\"\n file_name =\n if (env_var = ENV.fetch(\"SYMMETRIC_ENCRYPTION_CONFIG\", nil))\n File.expand_path(env_var)\n else\n File.join(root, \"config\", \"symmetric-encryption.yml\")\n end\n raise(ConfigError, \"Cannot find config file: #{file_name}\") unless File.exist?(file_name)\n end\n\n @env = env\n @file_name = file_name\n end",
"def load_private_key(filename, passphrase = nil, ask_passphrase = true, prompt = Prompt.default)\n data = File.read(File.expand_path(filename))\n load_data_private_key(data, passphrase, ask_passphrase, filename, prompt)\n end",
"def initialize(key)\n @key = key\n @k1, @k2 = CMAC.gen_subkeys(@key)\n end",
"def initialize(*paths)\n @store=OpenSSL::X509::Store.new\n# @store.set_default_path paths.shift if paths.length>0\n paths.each {|path| @store.add_path path}\n end",
"def private_key_file=(file)\n @private_key_file = file and load_private_key\n end",
"def myinitialize()\n # TODO: To improve flexibility, we can allow the user to specify the path to the file.\n client = Stormpath::Client.new api_key_file_location: File.join(ENV['HOME'], '.stormpath', 'apiKey.properties')\n return client\nend",
"def certificate_chain(private_key_alias, keystore_intermediate_path, keystore_authorizable_id)\n RubyAem::Resources::CertificateChain.new(@client, private_key_alias, keystore_intermediate_path, keystore_authorizable_id)\n end",
"def initialize(key, mac_class = :CMAC)\n Internals::Util.validate_bytestring(\"key\", key, length: [32, 64])\n length = key.length / 2\n\n case mac_class\n when :CMAC\n @mac = CMAC.new(key[0, length])\n when :PMAC\n @mac = PMAC.new(key[0, length])\n else raise ArgumentError, \"bad MAC class: #{mac_class} (expected :CMAC or :PMAC)\"\n end\n\n @ctr = Internals::AES::CTR.new(key[length..-1])\n end",
"def initialize(key, data_file_name)\n # Get a handle on the file.\n data_file = Pathname.new(__FILE__).dirname + 'data' + data_file_name.to_s\n raise ArgumentError, \"No such file #{data_file.to_s}\" unless data_file.exist?\n\n # Parse\n @data = case data_file.extname\n when '.json'\n JSON.parse( data_file.read, :symbolize_names => true )\n else\n raise ArgumentError \"Cannot parse files of type #{data_file.extname}\"\n end\n\n # Set key and freeze\n @key = key.freeze\n @data.freeze\n end",
"def initialize(keyid = nil, vcode = nil, scope=\"account\")\n keyid ||= EAAL.config.keyid\n vcode ||= EAAL.config.vcode\n scope = EAAL.config.scope if EAAL.config.scope\n self.keyid = keyid.to_s\n self.vcode = vcode.to_s\n self.scope = scope.to_s\n end",
"def initialize()\n \n @saved_kc_list = nil;\n @build_dir = ENV[\"BUILT_PRODUCTS_DIR\"]\n @project_dir = ENV[\"PROJECT_DIR\"]\n @certificate_dir = File.join(@project_dir, \"..\")\n \n @distrusted_certs_dir = File.join(certificate_dir, \"distrusted\")\n @revoked_certs_dir = File.join(certificate_dir, \"revoked\")\n @root_certs_dir = File.join(certificate_dir, \"roots\")\n @intermediate_certs_dir = File.join(certificate_dir, \"certs\")\n \n Utilities.check_path(@distrusted_certs_dir)\n Utilities.check_path(@revoked_certs_dir)\n Utilities.check_path(@root_certs_dir)\n Utilities.check_path(@intermediate_certs_dir)\n\n @security_tool_path = '/usr/bin/security'\n Utilities.check_path(@security_tool_path, false)\n\n @output_keychain_path = File.join(@build_dir , \"BuiltKeychains\")\n FileUtils.mkdir_p(@output_keychain_path) if !FileTest.exists? @output_keychain_path\n \n output_variables = false\n if output_variables\n puts \"=================================================\"\n puts \"CertTools variables\"\n puts \" \"\n puts \"@build_dir = #{@build_dir}\"\n puts \"@project_dir = #{@project_dir}\"\n puts \"@certificate_dir = #{@certificate_dir}\"\n puts \"@distrusted_certs_dir = #{@distrusted_certs_dir}\"\n puts \"@revoked_certs_dir = #{@revoked_certs_dir}\"\n puts \"@root_certs_dir = #{@root_certs_dir}\"\n puts \"@intermediate_certs_dir = #{@intermediate_certs_dir}\"\n puts \"@security_tool_path = #{@security_tool_path}\"\n puts \"@output_keychain_path = #{@output_keychain_path}\"\n puts \"=================================================\"\n puts \" \" \n end \n end",
"def test_initialize_default\n keyfile = AuthorizedKeysFile.new(@container)\n assert_same(@container, keyfile.container, \n 'AuthorizedKeysFile container not set correctly')\n assert_equal(@username, keyfile.username, \n 'AuthorizedKeysFile username not set correctly')\n assert_equal(@homedir + \"/.ssh/authorized_keys\", keyfile.filename, \n 'AuthorizedKeysFile filename not set correctly')\n assert_equal('/bin/bash', @container.container_plugin.gear_shell, \n 'AuthorizedKeysFile container shell not set correctly')\n end",
"def key_file\n super\n end",
"def init_key_with_cookbook_name(key, files)\n self[key] = {}\n self['cookbook'] ||= {}\n path_name_regex = BOOKWORM_KEYS[key]['path_name_regex']\n files.each do |path, ast|\n m = path.match(%r{/?([\\w-]+)/#{path_name_regex}})\n cookbook_name = m[1]\n file_name = m[2]\n self['cookbook'][cookbook_name] ||= {}\n self[key][\"#{cookbook_name}::#{file_name}\"] =\n { 'path' => path, 'cookbook' => cookbook_name, 'ast' => ast }\n end\n end",
"def private_key_file=(file)\n @private_key_file = file and load_private_key\n end",
"def initialize(key, encoding = :raw)\n key = Encoder[encoding].decode(key)\n Util.check_length(key, NaCl::PUBLICKEYBYTES, \"key\")\n\n @key = key\n end",
"def initialize(path)\n @path = path\n @certificates = []\n load\n end",
"def initialize(rsa_bits = DEFAULT_RSA_BITS, digest = DEFAULT_DIGEST)\n @key, @cert = generate_keypair(rsa_bits, digest) unless rsa_bits.nil?\n end",
"def initialize(file_name)\n create(file_name)\n end",
"def initialize\n @key_files = []\n @host_key_files = []\n @use_agent = true\n @agent = nil\n end",
"def load_public_key(filename); end",
"def initialize(filename = nil, namespace = nil, password = nil)\n @pw_file = File.expand_path(filename || ENV[\"PWS\"] || '~/.pws')\n @pw_file << namespace if namespace\n access_safe(password)\n read_safe\n end",
"def keyload(key_file_path=\"rsa_private_key.rb\")\n #require key_file_path\n require_relative key_file_path\n @n, @e= publickey\n @privatekey=privatekey\n #puts $n, $e, $privatekey\n end",
"def initialize directory_name, opts = {}\n @cask_directory = directory_name\n FileUtils.mkdir_p @cask_directory\n\n @lockfile = \"#{@cask_directory}/#{LOCKFILE_NAME}\"\n if File.exist? @lockfile\n raise BitcaskLockedError.new \"lockfile is present, other instance running?\"\n else\n File.write @lockfile, \"\"\n end\n\n # populate keydict from hint file or data files\n @keydict = read_data_and_hint_files\n\n # Keep file handles for all old data files open\n # path => file handle\n @old_data_files = {}\n\n # open new data file to write to\n @data_file = open_new_data_file\n end",
"def initialize_keys\n @key0 = 0x12345678\n @key1 = 0x23456789\n @key2 = 0x34567890\n @password.each_byte { |byte| update_keys(byte.chr) }\n nil\n end",
"def set_keys\n self.auth = gen_key('auth') if auth.blank?\n self.mkey = gen_key('mkey') if mkey.blank?\n end",
"def initialize(key_vault_client, key_vault_namespace, kms_providers, kms_tls_options)\n Crypt.validate_ffi!\n @crypt_handle = Handle.new(\n kms_providers,\n kms_tls_options,\n explicit_encryption_only: true\n )\n @encryption_io = EncryptionIO.new(\n key_vault_client: key_vault_client,\n metadata_client: nil,\n key_vault_namespace: key_vault_namespace\n )\n end",
"def initialize_keys\n super\n\n # Create and encrypt a 12 byte header to protect the encrypted file data\n # from attack. The first 10 bytes are random, and the last 2 bytes are\n # the low order word in little endian byte order of the last modified\n # time of the entry in DOS format.\n header = ''\n 10.times do\n header << rand(256).chr\n end\n header << mtime.to_dos_time.pack[0, 2]\n\n # Take care to ensure that all bytes in the header are written.\n while header.size > 0 do\n begin\n header.slice!(0, unbuffered_write(header))\n rescue Errno::EAGAIN, Errno::EINTR\n sleep(1)\n end\n end\n\n # Reset the total bytes written in order to disregard the header.\n @total_bytes_in = 0\n\n nil\n end",
"def create(pvt)\n key = Bitcoin::Key.new\n key.priv = pvt\n key.addr\n end",
"def init(dir)\n dir = File.expand_path(dir)\n db_file = db(dir)\n raise \"Database #{db_file} already exists\" if File.exist?(db_file)\n FileUtils.mkdir_p(File.dirname(db_file))\n # create database\n monotone(\"db init\", db_file)\n # TODO: do a genkey\n monotone(\"read\", db_file) do |io|\n io.write(File.open(@keys_file).read)\n io.close_write\n end\n end",
"def initialize(keys)\n if keys.empty?\n raise Error, \"Cannot initialize encryptor without encryption key\"\n end\n\n # First key is used for encryption\n @key_id, @key, @auth_data, @padding = keys[0]\n\n # All keys are candidates for decryption\n @key_map = {}\n keys.each do |key_id, key, auth_data, padding|\n @key_map[key_id] = [key, auth_data, padding].freeze\n end\n\n freeze\n end",
"def initialize_connection_from_file(file_path)\n raise Errno::ENOENT unless File.exists?(file_path)\n file = File.open(file_path)\n config = symbolize_keys(YAML::load(file.read))\n self.initialize_connection(config[:lobby], config[:options])\n end",
"def initialize(pvt_key_string)\n @pvt_key_string = pvt_key_string\n @pvt_key = PrivateKey.new pvt_key_string\n log 'pvt key', @pvt_key\n @address = @pvt_key.address_str\n log 'address', @address\n end",
"def initialize(file_path)\r\n # create if default doesn't exist?\r\n @file_descriptor = File.open(file_path, File::RDWR | File::CREAT)\r\n @file_descriptor.seek(0, IO::SEEK_SET)\r\n torrent_string = @file_descriptor.readlines.join\r\n @torrents = YAML.load(torrent_string)\r\n end",
"def init\n if @args.first.nil?\n @ui.error('Please specify the configuration')\n return ARGUMENT_ERROR_RESULT\n end\n\n @mdbci_config = Configuration.new(@args.first, @env.labels)\n @keyfile = @env.keyFile.to_s\n unless File.exist?(@keyfile)\n @ui.error('Please specify the key file to put to nodes')\n return ARGUMENT_ERROR_RESULT\n end\n result = NetworkSettings.from_file(@mdbci_config.network_settings_file)\n if result.error?\n @ui.error(result.error)\n return ARGUMENT_ERROR_RESULT\n end\n\n @network_settings = result.value\n SUCCESS_RESULT\n end",
"def initialize(key, password, account, options = {})\n self.key = key\n self.password = password\n self.account = account\n self.options = self.class.options.merge(options)\n end",
"def initialize(directory)\n p_dir = Pathname.new(directory)\n @nonce_dir = p_dir.join('nonces')\n @association_dir = p_dir.join('associations')\n @temp_dir = p_dir.join('temp')\n @auth_key_name = p_dir.join('auth_key')\n @max_nonce_age = 6 * 60 * 60\n \n self.ensure_dir(@nonce_dir)\n self.ensure_dir(@association_dir)\n self.ensure_dir(@temp_dir)\n self.ensure_dir(File.dirname(@auth_key_name))\n end",
"def initialize(key, filename, content)\n @key = key\n @filename = filename\n @content = content\n end",
"def initialize(file_name='persistance.db')\n require 'gdbm'\n # Creates database file if it doesn't exist\n @file_name = file_name\n unless File.directory?('db')\n Dir.mkdir('db/')\n end\n @db = GDBM.new('db/' + file_name)\n @wallet_db = GDBM.new('db/wallets_' + file_name)\n end",
"def initialize(filename, input_password = nil)\n coercer = [:to_path, :to_str, :path].find{|meth| filename.respond_to? meth}\n @filename = coercer ? filename.send(coercer) : filename\n\n @input_password = input_password || default_input_password\n @owner_password = default_owner_password\n @user_password = default_user_password\n @permissions = default_permissions || []\n @new_info = {}\n \n run_callbacks_for(:after_initialize)\n end",
"def init_cosigner_master(wallet, index)\n key = \"cosigner#{index}\".to_sym\n wallet[key] = {}\n wallet[key][:master] = seed(index)\nend",
"def initialize \n @Attributes = Hash.new \n @ConfigurationFilename = \"configuration.txt\" \n load_attributes \n end",
"def initialize(file_name, stream = T.unsafe(nil), encrypter = T.unsafe(nil)); end",
"def load_keypair(private_key, public_key)\n @private_key = private_key\n @public_key = public_key\n @private_rsa = OpenSSL::PKey::RSA.new @private_key\n @public_rsa = OpenSSL::PKey::RSA.new @public_key\n end",
"def add_keycert(keycert_file); end",
"def initialize(seed, encoding = :raw)\n seed = Encoder[encoding].decode(seed)\n\n Util.check_length(seed, NaCl::SECRETKEYBYTES, \"seed\")\n\n pk = Util.zeros(NaCl::PUBLICKEYBYTES)\n sk = Util.zeros(NaCl::SECRETKEYBYTES * 2)\n\n NaCl.crypto_sign_seed_keypair(pk, sk, seed) || raise(CryptoError, \"Failed to generate a key pair\")\n\n @seed, @signing_key = seed, sk\n @verify_key = VerifyKey.new(pk)\n end",
"def initialize(keyring)\n @keyring = keyring\n @system = System.new\n end",
"def initialize( key_string = nil )\n self.key_string = key_string\n end",
"def initialize key, code, owner, active=false\n\t\t\t@key = key\n\t\t\t@code = code\n\t\t\t@owner = owner\n\t\t\t@active = active\n\t\tend",
"def initialize(filename, mode = ALTER)\n @filename = filename\n @mode = mode\n @dirty = false\n\n raise FileAccessError, \"Invalid mode #{mode}\" unless [ ALTER, CREATE ].include?(mode)\n\n if (filename != STDOUT_FLAG) and (mode == ALTER) and (not ::File.exist?(filename)) then\n raise FileAccessError, \"Could not open passwd file #{filename} for reading.\" \n end\n\n begin\n @entries = {}\n @lines = []\n load_entries if (@mode == ALTER) and (filename != STDOUT_FLAG)\n rescue => e\n raise FileAccessError, e.message\n end\n end",
"def call\n key_pairs = namespaces.map do |namespace|\n Chamber::KeyPair.new(namespace: namespace,\n key_file_path: rootpath)\n end\n key_pairs << Chamber::KeyPair.new(namespace: nil,\n key_file_path: rootpath)\n\n key_pairs.each { |key_pair| generate_key_pair(key_pair) }\n\n if signature\n signature_key_pair = Chamber::KeyPair.new(namespace: 'signature',\n key_file_path: rootpath)\n\n generate_key_pair(signature_key_pair)\n end\n\n append_to_gitignore\n\n shell.copy_file settings_template_filepath, settings_filepath, skip: true\n\n shell.say ''\n shell.say '********************************************************************************', :green\n shell.say ' Success!', :green\n shell.say '********************************************************************************', :green\n shell.say ''\n\n if namespaces.empty?\n shell.say '.chamber.pem is your DEFAULT Chamber key.', :yellow\n shell.say ''\n shell.say 'If you would like a key which is used only for a certain environment (such as'\n shell.say 'production), or your local machine, you can rerun the command like so:'\n shell.say ''\n shell.say '$ chamber init --namespaces=\"production my_machines_hostname\"', :yellow\n shell.say ''\n shell.say 'You can find more information about namespace keys here:'\n shell.say ''\n shell.say ' * '\n shell.say 'https://github.com/thekompanee/chamber/wiki/Namespaced-Key-Pairs', :blue\n shell.say ''\n shell.say '--------------------------------------------------------------------------------'\n shell.say ''\n end\n\n if signature\n shell.say ' Your Signature Keys'\n shell.say ''\n shell.say 'Your signature keys, which will be used for verification, are located at:'\n shell.say ''\n shell.say ' * Public Key: '\n shell.say signature_key_pair\n .public_key_filepath\n .relative_path_from(Pathname.pwd),\n :yellow\n shell.say ' * Private Key: '\n shell.say signature_key_pair\n .unencrypted_private_key_filepath\n .relative_path_from(Pathname.pwd),\n :yellow\n shell.say ' * Encrypted Private Key: '\n shell.say signature_key_pair\n .encrypted_private_key_filepath\n .relative_path_from(Pathname.pwd),\n :yellow\n shell.say ' * Encrypted Passphrase: '\n shell.say signature_key_pair\n .encrypted_private_key_passphrase_filepath\n .relative_path_from(Pathname.pwd),\n :yellow\n\n shell.say ''\n shell.say 'The signature private keys should be thought of separately from the other'\n shell.say 'project private keys you generate. They are not required to run the app'\n shell.say 'and should only be given out to *very select* people.'\n shell.say ''\n shell.say 'You can find more information about settings verification here:'\n shell.say ''\n shell.say ' * '\n shell.say 'https://github.com/thekompanee/chamber/wiki/Verifying-Settings', :blue\n shell.say ''\n shell.say '--------------------------------------------------------------------------------'\n shell.say ''\n end\n\n shell.say ' Your Encrypted Keys'\n shell.say ''\n shell.say 'You can send your team members any of the file(s) located at:'\n shell.say ''\n\n key_pairs.each do |key_pair|\n shell.say ' * '\n shell.say key_pair.encrypted_private_key_filepath.relative_path_from(Pathname.pwd), :yellow\n end\n\n shell.say ''\n shell.say 'and not have to worry about sending them via a secure medium, however do'\n shell.say 'not send the passphrase along with it. Give it to your team members in'\n shell.say 'person.'\n shell.say ''\n shell.say 'You can learn more about encrypted keys here:'\n shell.say ''\n shell.say ' * '\n shell.say 'https://github.com/thekompanee/chamber/wiki/Keypair-Encryption#the-encrypted-private-key', :blue\n shell.say ''\n shell.say '--------------------------------------------------------------------------------'\n shell.say ''\n shell.say ' Your Key Passphrases'\n shell.say ''\n shell.say 'The passphrases for your encrypted private key(s) are stored in the'\n shell.say 'following locations:'\n shell.say ''\n\n key_pairs.each do |key_pair|\n shell.say ' * '\n shell.say key_pair.encrypted_private_key_passphrase_filepath.relative_path_from(Pathname.pwd), :yellow\n end\n\n shell.say ''\n shell.say 'In order for them to decrypt it (for use with Chamber), they can use something'\n shell.say 'like the following (swapping out the actual key filenames if necessary):'\n shell.say ''\n shell.say \"$ cp #{key_pairs[0].encrypted_private_key_filepath.relative_path_from(Pathname.pwd)} #{key_pairs[0].unencrypted_private_key_filepath.relative_path_from(Pathname.pwd)}\", :yellow\n shell.say \"$ ssh-keygen -p -f #{key_pairs[0].unencrypted_private_key_filepath.relative_path_from(Pathname.pwd)}\", :yellow\n shell.say ''\n shell.say 'Enter the passphrase when prompted and leave the new passphrase blank.'\n shell.say ''\n shell.say '--------------------------------------------------------------------------------'\n shell.say ''\n end",
"def initialize(options = {})\n key = options.fetch(:key)\n salt = options.fetch(:salt)\n\n @encryptor = ::ActiveSupport::MessageEncryptor.new \\\n ::ActiveSupport::KeyGenerator.new(key).generate_key(salt, 32)\n end",
"def initialize(key)\n @key = Util.check_hmac_key(key, \"#{self.class} key\")\n @state = State.new\n @authenticator = Util.zeros(tag_bytes)\n\n self.class.auth_hmacsha256_init(@state, key, key.bytesize)\n end",
"def initialize(options = {})\n @filename = options[:file]\n @ledger = options[:bin] || 'ledger'\n end",
"def do_processing()\n CertTools.saveKeychainList\n CertTools.createKeychain(@evroots_kc_path, @evroots_kc_name)\n pass_one \n puts \"Removing #{@evroots_plist_path}\" if @verbose \n FileUtils.rm_f @evroots_plist_path \n pass_two\n FileUtils.chmod 0644, @evroots_plist_path \n puts \"Built #{@evroots_plist_path} successfully\" if @verbose \n end",
"def initialize(key, secret)\n super()\n self.key = key\n self.secret = secret\n end",
"def initialize(\n master_key = nil, custom_key = nil, read_key = nil,\n write_key = nil, timeout = 60)\n @requester = Core::Requester.new(timeout)\n @key = organize_keys(master_key, custom_key, write_key, read_key)\n @api_key = nil\n @status_code = nil\n @headers = nil\n @req = nil\n end",
"def create_new!\n if Dir.exist? @config_dir\n # Without :secure, it would follow symlinks and destroy things outside of\n # that folder. See docs for details.\n FileUtils.rm_rf( @config_dir, :secure => true )\n end\n Dir.mkdir(@config_dir, 0700)\n new_private_key = RbNaCl::PrivateKey.generate\n File.open(@config_file, \"w\") do |f|\n f.write(new_private_key.to_bytes)\n end\n end",
"def import(input, app_list=[])\n input = input.read if input.is_a? IO\n\n # Create array of TrustedApplication objects\n trusted_apps = get_trusted_apps(app_list)\n\n # Create an Access object\n access_buffer = FFI::MemoryPointer.new(:pointer)\n status = Sec.SecAccessCreate(path.to_cf, trusted_apps, access_buffer)\n Sec.check_osstatus status\n access = CF::Base.typecast(access_buffer.read_pointer)\n\n key_params = Sec::SecItemImportExportKeyParameters.new\n key_params[:accessRef] = access\n\n # Import item to the keychain\n cf_data = CF::Data.from_string(input)\n cf_array = FFI::MemoryPointer.new(:pointer)\n status = Sec.SecItemImport(cf_data, nil, :kSecFormatUnknown, :kSecItemTypeUnknown, :kSecItemPemArmour, key_params, self, cf_array)\n access.release\n Sec.check_osstatus status\n item_array = CF::Base.typecast(cf_array.read_pointer).release_on_gc\n\n item_array.to_ruby\n end",
"def initialize(hash_or_file = self.class.source, section = nil)\n #puts \"new! #{hash_or_file}\"\n case hash_or_file\n when nil\n raise Errno::ENOENT, \"No file specified as Settingslogic source\"\n when Hash\n self.replace hash_or_file\n else\n file_contents = open(hash_or_file).read\n hash = file_contents.empty? ? {} : YAML.load(ERB.new(file_contents).result).to_hash\n if self.class.namespace\n hash = hash[self.class.namespace] or return missing_key(\"Missing setting '#{self.class.namespace}' in #{hash_or_file}\")\n end\n self.replace hash\n end\n @section = section || self.class.source # so end of error says \"in application.yml\"\n create_accessors!\n end",
"def set_key_file(opts)\n opts = check_params(opts,[:keys])\n super(opts)\n end",
"def initialize(key)\n @key = key.to_sym\n @defaults = {}\n @file = []\n @validator = nil\n @children = {}\n @env = {}\n end",
"def load\n (Dir.entries(@path) - %w(. .. ca.crt)).each do |entry|\n certificate_path = File.join(@path, entry)\n self << CertificateDepot::Certificate.from_file(certificate_path)\n end\n end",
"def load_data_private_key(data, passphrase = T.unsafe(nil), ask_passphrase = T.unsafe(nil), filename = T.unsafe(nil), prompt = T.unsafe(nil)); end",
"def initialize(path, load=nil)\n @path = path\n @inihash = {}\n \n if load or ( load.nil? and FileTest.readable_real? @path )\n restore()\n end\n end",
"def initialize(options = {})\n if options[:data]\n @x509_csr = OpenSSL::X509::Request.new(options[:data])\n\n else\n # generate the subject name\n subjectX509 = OpenSSL::X509::Name.parse options[:subject]\n\n # save the key pair which was used for that\n @key_pair = options[:key]\n\n # generate the csr\n @x509_csr = OpenSSL::X509::Request.new\n @x509_csr.version = 0\n @x509_csr.subject = subjectX509\n @x509_csr.public_key = @key_pair.to_x509.public_key\n @x509_csr = @x509_csr.sign @key_pair.to_x509, OpenSSL::Digest::SHA1.new\n end\n end"
] |
[
"0.6764559",
"0.6604155",
"0.65220153",
"0.65177053",
"0.62628347",
"0.625992",
"0.610372",
"0.6082258",
"0.6002221",
"0.599431",
"0.59017736",
"0.5871112",
"0.58412194",
"0.5766371",
"0.57511413",
"0.57114697",
"0.5698304",
"0.5624285",
"0.5613551",
"0.56077284",
"0.56032497",
"0.55723876",
"0.5570484",
"0.55607724",
"0.55515456",
"0.5516013",
"0.5496234",
"0.5483288",
"0.5479342",
"0.54281944",
"0.5414265",
"0.54125136",
"0.53791296",
"0.5367121",
"0.5366973",
"0.5346489",
"0.53455794",
"0.5302493",
"0.5300853",
"0.5287641",
"0.5281812",
"0.5274477",
"0.5243598",
"0.52419454",
"0.52413684",
"0.5238259",
"0.52152765",
"0.52082515",
"0.5201933",
"0.5190969",
"0.5179947",
"0.5175602",
"0.5174309",
"0.51699114",
"0.5163589",
"0.5162077",
"0.51380616",
"0.5136838",
"0.5113502",
"0.5111648",
"0.51105446",
"0.51086396",
"0.5103359",
"0.5101437",
"0.5101184",
"0.5099714",
"0.50962687",
"0.50915456",
"0.5087852",
"0.5071164",
"0.5064967",
"0.50613505",
"0.504984",
"0.50465137",
"0.5042923",
"0.5028203",
"0.5025599",
"0.5017089",
"0.50156885",
"0.4995989",
"0.49945638",
"0.49910456",
"0.49821588",
"0.4965641",
"0.4965493",
"0.4960263",
"0.49499947",
"0.49496046",
"0.4942209",
"0.49417463",
"0.49355865",
"0.49056253",
"0.49052563",
"0.4901969",
"0.48990035",
"0.48983347",
"0.4898153",
"0.48967624",
"0.4890629",
"0.4881909"
] |
0.7851533
|
0
|
Lists the names of all keys in the keychain
|
def list
@keychain.keys
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def list_keychains(params: {})\n call :get, '/keychain', params\n end",
"def list_keys()\n # TODO\n end",
"def list_keys\n @keydict.keys\n end",
"def list_keys\n @keys.keys\n end",
"def all_keys\n @cluster.client.list_keys(@name)\n end",
"def list_checkout_keys\n CircleCi.request(conf, \"#{base_path}/checkout-key\").get\n end",
"def list_api_keys(opts = {})\n @transporter.read(:GET, '/1/keys', {}, opts)\n end",
"def keys\n\t\tdoc = xml get('/user/keys')\n\t\tdoc.elements.to_a('//keys/key').map do |key|\n\t\t\tkey.elements['contents'].text\n\t\tend\n\tend",
"def keys\n\t\tdoc = xml get('/user/keys')\n\t\tdoc.elements.to_a('//keys/key').map do |key|\n\t\t\tkey.elements['contents'].text\n\t\tend\n\tend",
"def keys\n deprecate # 07/31/2012\n doc = xml get('/user/keys').to_s\n doc.elements.to_a('//keys/key').map do |key|\n key.elements['contents'].text\n end\n end",
"def list_account_keys(account_name, group = configuration.resource_group)\n validate_resource_group(group)\n\n url = build_url(group, account_name, 'listKeys')\n response = rest_post(url)\n hash = JSON.parse(response.body)\n\n parse_account_keys_from_hash(hash)\n end",
"def keys\n list = []\n each_key{|key| list << key}\n list\n end",
"def list_checkout_keys\n CircleCi.request(@conf, \"/project/#{username}/#{project}/checkout-key\").get\n end",
"def list(selection=nil)\n\n env.config.keypairs.each do |name,provider|\n env.ui.info(\"Keypair name:#{name}\")\n end\n end",
"def get_keys\n @encryption_io.get_keys\n end",
"def keys(options={})\n get(\"/user/keys\", options, 3)\n end",
"def keys_for(username)\n @api.client.users.keys.list(user: username).body\n end",
"def keys\n list.keys\n end",
"def keys\n ::M2X::Client::Key.list(@client, params.merge(device: self[\"id\"]))\n end",
"def keys\n IbmCloudRest.get \"#{@uri}/keys\"\n end",
"def keys\n JSON.parse get('/users/ssh_keys', :accept => 'json').to_s\n end",
"def keys\n [ name ]\n end",
"def list_api_keys(request_options = {})\n client.get(Protocol.index_keys_uri(name), :read, request_options)\n end",
"def keys\n doc = JSON.parse get('/api/v1/ssh_keys')\n doc[\"ssh_keys\"]\n end",
"def keys\n jiak.client.keys(jiak.bucket)\n end",
"def ls(prefix)\n list_objects(prefix).contents.map(&:key)\n end",
"def list_keys request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_keys_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::ApiKeys::V2::ListKeysResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"def get_keys()\n\t\t\treturn @config.keys\n\t\tend",
"def list_keys(iam, user_name)\n begin\n list_access_keys_response = iam.list_access_keys({ user_name: user_name })\n\n if list_access_keys_response.access_key_metadata.count == 0\n puts \"No access keys.\"\n else\n puts \"Access keys:\"\n list_access_keys_response.access_key_metadata.each do |key_metadata|\n puts \" Access key ID: #{key_metadata.access_key_id}\"\n end\n end\n\n rescue Aws::IAM::Errors::NoSuchEntity\n puts \"Cannot find user '#{user_name}'.\"\n exit(false)\n end\nend",
"def keys\n keys = []\n each_pair {|k,v| keys << k}\n keys\n end",
"def list_account_key_objects(account_name, group = configuration.resource_group, skip_accessors_definition = false)\n validate_resource_group(group)\n\n unless recent_api_version?\n raise ArgumentError, \"unsupported api-version string '#{api_version}'\"\n end\n\n url = build_url(group, account_name, 'listKeys')\n response = rest_post(url)\n JSON.parse(response.body)['keys'].map { |hash| StorageAccountKey.new(hash, skip_accessors_definition) }\n end",
"def keyspace_names\n @keyspaces.keys\n end",
"def list_signing_keys(opts = {})\n data, _status_code, _headers = list_signing_keys_with_http_info(opts)\n data\n end",
"def list_sshkeys(client)\n sshkey_ids = []\n\n # List all keys\n client.ssh_keys.all.each_with_index{ |x, i|\n puts \"[\" + i.to_s + \"] [SSHKey] id: \" + x.id.to_s + \" , name: \" + x.name\n sshkey_ids << x.id\n }\n\n\treturn sshkey_ids\nend",
"def all\n @keys\n end",
"def get_key_list\n read(Common::KEY) || Hash.new\n end",
"def list(selection=nil)\n\n env.config.providers.each do |name,provider|\n env.ui.info(\"Asking provider #{name} to list keystore #{selection}\")\n provider.keystore_list(selection,options)\n end\n end",
"def list_keys(bucket, options = {})\n keys = bucket_data(bucket, options[:type])[:keys].keys\n\n if block_given?\n yield keys unless keys.empty?\n true\n else\n keys\n end\n end",
"def list\n\trequire_relative '../lib/localhost'\n\t\n\tterminal = self.terminal\n\t\n\tLocalhost::Authority.list do |authority|\n\t\tterminal.print(\n\t\t\t:hostname, authority.hostname, \" \",\n\t\t\t:name, authority.name, \"\\n\", :reset,\n\t\t\t\"\\tCertificate Path: \", authority.certificate_path, \"\\n\",\n\t\t\t\"\\t Key Path: \", authority.key_path, \"\\n\",\n\t\t\t\"\\t Expires: \", authority.certificate.not_after, \"\\n\",\n\t\t\t:reset, \"\\n\"\n\t\t)\n\tend\nend",
"def names\n @list.keys\n end",
"def claimed_keys\n [key]\n end",
"def keys\n candy.keys\n end",
"def keys\n @disk.keys\n end",
"def get_storage_account_keys(name)\n if get_storage_account name\n path = \"/services/storageservices/#{name}/keys\"\n request = client.management_request(:get, path)\n response = request.call\n Serialization.storage_account_keys_from_xml(response)\n else\n Azure::Loggerx.warn \"Storage Account '#{name}' does not exist.\"\n end\n end",
"def list_tls_keys(opts = {})\n data, _status_code, _headers = list_tls_keys_with_http_info(opts)\n data\n end",
"def keys\n @ledger.keys\n end",
"def list_key_credentials_for_application(app_id, options = {})\n get(\"/apps/#{app_id}/credentials/keys\", options)\n end",
"def keys() end",
"def encrypted_keys\n Array(config[:encrypted_keys]).concat(\n Array(Chef::Config[:knife][:secure_data_bag][:encrypted_keys])\n ).uniq\n end",
"def key_ids\n @keys.keys\n end",
"def display_keys\n students.each_key { |key| puts \"- #{key}\" }\nend",
"def str_all_keys (options={})\n str = \"\"\n @data.keys.each do |key_name|\n if options[:filter] && options[:filter][:key_name]\n next unless key_name == options[:filter][:key_name]\n end\n str << \"\\n\"\n str << \"#{key_name}:\\n\"\n str << str_key_name(key_name, options)\n end\n str\n end",
"def list_keys(iam, user_name)\r\n begin \r\n list_access_keys_response = iam.list_access_keys({ user_name: user_name })\r\n\r\n if list_access_keys_response.access_key_metadata.count == 0\r\n puts \"No access keys.\"\r\n else\r\n puts \"Access keys:\"\r\n list_access_keys_response.access_key_metadata.each do |key_metadata|\r\n puts \" Access key ID: #{key_metadata.access_key_id}\"\r\n end\r\n end\r\n \r\n rescue Aws::IAM::Errors::NoSuchEntity\r\n puts \"Cannot find user '#{user_name}'.\"\r\n exit(false)\r\n end \r\nend",
"def keys\n return []\n end",
"def get_all_keys\n keys = Hash.new()\n @packages.each do |key, value|\n keys[key] = value.stringpool_keystrings.values\n end\n\n return keys\n end",
"def keys\n entries.keys\n end",
"def list(keydir)\n\n # FIXME: insert code that connects to the backend and affects the list\n # operation\n #\n # - Convert any exceptions into a failed status result with a meaningful\n # error message.\n #\n\n { :result => nil, :err_msg => 'FIXME: not implemented' }\n end",
"def find_all_redis_keys\n redis.connection do |c|\n c.keys(\"#{self.REDIS_KEY_NAMESPACE}:*\")\n end\n end",
"def keys\n head.commit.tree.contents.map{|blob| deserialize(blob.name) }\n end",
"def keys\n head.commit.tree.contents.map{|blob| deserialize(blob.name) }\n end",
"def list_checkout_keys(username, project)\n default_config.logger.warn('[Deprecated] Use instance method CircleCi::Project#list_checkout_keys instead')\n new(username, project, default_config).list_checkout_keys\n end",
"def keys\n end",
"def keys(arg = nil)\n if arg.nil?\n storage.keys\n else\n with_interest(arg).map { |key, _, _| key }\n end\n end",
"def keys\n @config.keys\n end",
"def get_keys(opts = {})\n data, _status_code, _headers = get_keys_with_http_info(opts)\n data\n end",
"def keys\n @keys ||= LicenseField.all.map(&:key)\n end",
"def keys\n @redis.keys(@list + '*').reject { |s| s.end_with? '_MD5' }\n end",
"def keys\n @key\n end",
"def local_keys(body)\n disp = \" -- Registered Accounts --\\n\"\n disp << \"Name: RSA Fingerprint: Status:\\n\"\n @var[:user_keys].each do |name,key|\n key_hash = MD5::digest(key)[0,8]\n fingerprint = _fingerprint(key_hash)\n status = []\n status = [ \"Granted\" ] if @var[:granted].include?(name)\n status = [ \"Revoked\" ] if @var[:revoked].include?(name)\n if @var[:presence][key_hash]\n status << @var[:presence][key_hash].first\n else\n status << \"offline\"\n end\n disp << \"#{(name+(' '*12))[0,12]} #{fingerprint} #{status.join(', ')}\\n\"\n end\n _notice(disp)\nend",
"def list_names\n @lib.list_names\n end",
"def keys_and_usernames\n keys.map do |key|\n [key[0], key[1]].join(' ')\n end\n end",
"def keys\n configuration.keys\n end",
"def list(api_params)\n raw = api_request(SSHKEYS, LIST, api_params)\n @ssh_keys = to_hash(raw[:body]) unless raw.nil?\n end",
"def keys(carrier)\n carrier.keys\n end",
"def key_files; end",
"def get_keys(user=nil) \n\t\tuser = Account.current_account if !user\n\t\tKey.all(:account_id => user.id, :project_id => self.id)\n\tend",
"def keys; end",
"def keys; end",
"def keys; end",
"def keys; end",
"def keys; end",
"def keys; end",
"def keys; end",
"def keys; end",
"def keys; end",
"def keys\n configs.keys | store.keys\n end",
"def fetch_all_gpg_keys\n args = ['--with-colons', '--fixed-list-mode', '--lock-never', key_type_option]\n gpg_cmd = [config[:gpg] + \" --homedir #{config[:home_directory]}\"] + args\n\n _cmd_out, _cmd_err, _status = Open3.capture3 gpg_cmd.join(' ')\n end",
"def keys\n authorized_keys = []\n if team.present?\n log \"Got Github Team '#{team.name}' for Org '#{@org}'\"\n\n members = team_members(team.id)\n\n members.each do |member|\n log(\"Getting Member...#{member.login}\")\n\n keys = keys_for(member.login)\n\n # Can't get the real email address without logging in as that user\n email = \"#{member.login}@github.com\"\n\n keys.each do |key|\n authorized_keys << [key[:key], email]\n end\n end\n else\n log(\"No '#{@team_name}' team for '#{@org}' found\")\n log(teams.inspect)\n end\n authorized_keys\n end",
"def keys\n\n clib.tcmapiterinit(pointer_or_raise)\n a = []\n\n klen = FFI::MemoryPointer.new(:int)\n\n loop do\n k = clib.tcmapiternext(@pointer, klen)\n break if k.address == 0\n a << k.get_bytes(0, klen.get_int(0))\n end\n\n return a\n\n ensure\n\n klen.free\n end",
"def keys\n\t\t\treturn @storage.keys\n\t\tend",
"def keys\n @hash.keys\n end",
"def keys\n @hash.keys\n end",
"def keys\n # Lock for thread safety\n # Only one thread can write to the hash at a time and prevent partial keys from being returned.\n @thread_lock.synchronize do\n if @keys.nil?\n @keys = {}\n @user_keys.each_pair do |name, rsa_keys|\n # Use the sha256 of the user name as the internal name\n # This is to both avoid naming problems when uploading and to obfuscate the key name\n keys_key = BackupEngine::Checksums::Engines::SHA256.new.block(name.to_s)\n raise('Key name sha collission') if @keys.key?(keys_key)\n\n @keys[keys_key] = rsa_keys.merge(name: name)\n end\n end\n end\n\n raise('No encryption keys') if @keys.empty?\n\n return @keys\n end",
"def file_names\n file_names = []\n @bucket.objects.each do |obj|\n file_names << obj.key\n end\n file_names\n end",
"def keyscan_dump\n\t\trequest = Packet.create_request('stdapi_ui_get_keys')\n\t\tresponse = client.send_request(request)\n\t\treturn response.get_tlv_value(TLV_TYPE_KEYS_DUMP);\n\tend",
"def keys\n end",
"def keys\n end",
"def keys\n end",
"def list_access_keys(iam, user_name)\n response = iam.list_access_keys(user_name: user_name)\n\n if response.access_key_metadata.count.positive?\n puts \"Access key IDs:\"\n response.access_key_metadata.each do |key_metadata|\n puts \" #{key_metadata.access_key_id}\"\n end\n else\n puts \"No access keys found for user '#{user_name}'.\"\n end\nrescue Aws::IAM::Errors::NoSuchEntity\n puts \"Error listing access keys: cannot find user '#{user_name}'.\"\n exit 1\nrescue StandardError => e\n puts \"Error listing access keys: #{e.message}\"\nend",
"def keys\n map(&:key)\n end"
] |
[
"0.7622633",
"0.76178783",
"0.75705016",
"0.75571156",
"0.70517576",
"0.6900648",
"0.68866533",
"0.68799704",
"0.68799704",
"0.68628806",
"0.6859105",
"0.6853512",
"0.67059165",
"0.66911805",
"0.6687311",
"0.66767424",
"0.6670743",
"0.66431934",
"0.6604101",
"0.6594838",
"0.6566967",
"0.65351397",
"0.6494499",
"0.6466619",
"0.63892704",
"0.6346847",
"0.63152677",
"0.6287076",
"0.62852645",
"0.62834376",
"0.62760097",
"0.6269061",
"0.6226529",
"0.6212203",
"0.6211788",
"0.62068313",
"0.61854047",
"0.6179695",
"0.61721563",
"0.6164379",
"0.6163096",
"0.61523116",
"0.61458963",
"0.61281836",
"0.61237717",
"0.6119969",
"0.6119317",
"0.61119604",
"0.6037564",
"0.6033293",
"0.59971905",
"0.5986071",
"0.5983527",
"0.5981165",
"0.59694076",
"0.5942843",
"0.5939554",
"0.593084",
"0.5921237",
"0.5921237",
"0.59124005",
"0.5909717",
"0.59005964",
"0.5900152",
"0.5899367",
"0.5897626",
"0.58959585",
"0.58839613",
"0.58827907",
"0.58673346",
"0.5865592",
"0.58610016",
"0.58573806",
"0.5854854",
"0.58531183",
"0.5849855",
"0.5841545",
"0.5841545",
"0.5841545",
"0.5841545",
"0.5841545",
"0.5841545",
"0.5841545",
"0.5841545",
"0.5841545",
"0.58360875",
"0.5826666",
"0.58131284",
"0.58116883",
"0.5811446",
"0.5807443",
"0.5807443",
"0.5804982",
"0.58049315",
"0.58030295",
"0.5797937",
"0.5797937",
"0.5797937",
"0.5790691",
"0.5788193"
] |
0.8521618
|
0
|
Array operator override to access keys by their name
|
def [](key)
@keychain[key]
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def [] k\n @values[k.to_sym]\n end",
"def [](k) data[k.to_sym] end",
"def [] name\n to_h[name.to_s]\n end",
"def []( name )\n @hash[name]\n end",
"def [](name); @hash[name.to_s]; end",
"def []( key ) send( key ); end",
"def keys\n [ name ]\n end",
"def [](*names)\n ary = values_at(*names)\n names.size == 1 ? ary.first : ary\n end",
"def keys(*) end",
"def [](key); end",
"def [](key); end",
"def [](key); end",
"def [](key); end",
"def [](key); end",
"def [](key); end",
"def [](key); end",
"def [](key); end",
"def [](key); end",
"def [](key); end",
"def [](key); end",
"def [](key); end",
"def [](key); end",
"def [](key); end",
"def [](key); end",
"def [](key); end",
"def [](key); end",
"def [](k)\n internal[k]\n end",
"def [](k) \n @data[k] \n end",
"def [] key\n return @hash[key.to_s]\n end",
"def [](k)\n @values[k.to_sym]\n end",
"def [](key)\n index = self.keys.index(key) unless @array.empty?\n value = @array[index][1] if index\n end",
"def [](key, index_name = T.unsafe(nil)); end",
"def keys(index_name = T.unsafe(nil)); end",
"def [] key\r\n data[key]\r\n end",
"def [] key\n @data[key]\n end",
"def [] key\n @data[key]\n end",
"def [](name)\n @hash[name.to_s]\n end",
"def [](key)\n data[key.to_sym]\n end",
"def [](key) ; @data[key] ; end",
"def [](name)\n @names[name.to_sym]\n end",
"def [](key) self.send(key) end",
"def [](key); [ \"_#{@type}\", { @type => key }, -1 ]; end",
"def values_at(*keys); end",
"def [](key)\n @data[key.to_sym]\n end",
"def [](key)\n @data[key.to_sym]\n end",
"def [](name); end",
"def [](name); end",
"def [](name); end",
"def [](name); end",
"def [](name); end",
"def map_by_name(arr)\n return arr.map { |key| key[\"name\"] }\nend",
"def [] key\n data[key]\n end",
"def [] k\n\t\tget k\n\t end",
"def [] key\n @data[key]\n end",
"def [] key\n @attributes[key.to_s]\n end",
"def [](key)\n send key.to_sym\n end",
"def [](k)\n self.send(k)\n end",
"def [](name)\n @by_name[name]\n end",
"def [](key)\n send(key)\n end",
"def keys\n @array.transpose[0]\n end",
"def [](key)\n @map[key.to_sym]\n end",
"def [] key\n processed_data[key]\n end",
"def [](key)\n end",
"def [](key)\n end",
"def[](key)\n #k = @rkeys.index(key)\n #@rarray[k]\n p key\n #p self.rarray\n self.rarray.get(key).merge!({:mod_name=>self.name})\n end",
"def [](key_or_instance)\n proxy_across_keytypes(:[], key_or_instance)\n end",
"def [](key); self.send(key); end",
"def [](key); send(key); end",
"def [](key)\n __getobj__[key]\n end",
"def [](key)\n send(key)\n end",
"def [](k)\n @hash[k]\n end",
"def [](key)\n @map[key.to_sym]\n end",
"def [](*key)\n get(*key)\n end",
"def [](key)\n\n lookup(key.to_s)\n end",
"def [] (key)\n get(key)\n end",
"def [](key)\n self.send key.to_sym\n end",
"def map_by_name(arr)\n return arr.map { |hash| hash[\"name\"] }\nend",
"def map_by_name(arr)\nreturn arr.map { |hash| hash[\"name\"] }\nend",
"def array_start(key)\n @array_name = key\n end",
"def [](key)\n ruby_get(key&&key.to_s)\n end",
"def [] key\n\t\t\t\t@keyed[key]&.value\n\t\t\tend",
"def [](key)\n super(key.to_sym)\n end",
"def [] name\n annotations_hash[name.to_sym]\n end",
"def [](key)\n @entries[key]\n end",
"def [](key)\n self.send key\n end",
"def keys\n map(&:key)\n end",
"def [] key\n\t\t\t\t@attributes[key]\n\t\t\tend",
"def keys(*_arg0, &_arg1); end",
"def map_by_name(arr)\n arr.map { |hash| hash[\"name\"] }\nend",
"def [](name)\n list[name.to_sym].value\n end",
"def keys; end",
"def keys; end",
"def keys; end",
"def keys; end",
"def keys; end",
"def keys; end",
"def keys; end",
"def keys; end",
"def keys; end",
"def [](key)\n @_hash[key.to_sym]\n end",
"def [] key\n @config[key.to_s]\n end"
] |
[
"0.73069924",
"0.7305951",
"0.7114895",
"0.6979752",
"0.6947191",
"0.69000113",
"0.6850709",
"0.6774187",
"0.6734963",
"0.67124546",
"0.67124546",
"0.67124546",
"0.67124546",
"0.67124546",
"0.67124546",
"0.67124546",
"0.67124546",
"0.67124546",
"0.67124546",
"0.67124546",
"0.67124546",
"0.67124546",
"0.67124546",
"0.67124546",
"0.67124546",
"0.67124546",
"0.66815674",
"0.6662603",
"0.6656403",
"0.66531813",
"0.66388726",
"0.66368926",
"0.6594594",
"0.6577699",
"0.65427923",
"0.65427923",
"0.6519603",
"0.6518323",
"0.6516767",
"0.6502046",
"0.65001154",
"0.64817196",
"0.64732283",
"0.64718056",
"0.64718056",
"0.6469164",
"0.6469164",
"0.6469164",
"0.6469164",
"0.6469164",
"0.64666414",
"0.64592165",
"0.64490557",
"0.6437756",
"0.64300734",
"0.641653",
"0.6404127",
"0.64018106",
"0.63874835",
"0.63686615",
"0.63607824",
"0.63598394",
"0.6355896",
"0.6355896",
"0.6309057",
"0.63023573",
"0.62906224",
"0.6283366",
"0.626897",
"0.6264252",
"0.6263396",
"0.626331",
"0.6251208",
"0.62298995",
"0.622708",
"0.62111485",
"0.62094694",
"0.6207052",
"0.6191426",
"0.61815494",
"0.61693734",
"0.6169257",
"0.6166274",
"0.61485916",
"0.61451316",
"0.61348075",
"0.6120191",
"0.61143184",
"0.61127084",
"0.6112663",
"0.60943985",
"0.60943985",
"0.60943985",
"0.60943985",
"0.60943985",
"0.60943985",
"0.60943985",
"0.60943985",
"0.60943985",
"0.60939384",
"0.608996"
] |
0.0
|
-1
|
Get a hash of the position. This representation is suitable for use in the language server protocol.
|
def to_hash
{
line: line,
character: character
}
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def hash\n source_position.hash\n end",
"def hash\n offset.hash\n end",
"def position_digest\n hex_digest = @board.flatten.map(&:to_s).join.to_i(3).to_s(16)\n \"#{hex_to_base64_digest(hex_digest)};#{size};#{turn_color}\"\n end",
"def hash\n @offset.hash ^ @previous_offset.hash ^ @timestamp.hash\n end",
"def hash\n 0\n end",
"def hash\n size.hash ^ rank.hash\n end",
"def hash\n @hash ||= begin\n result = 17\n result = 31 * result + self.class.hash\n result = 31 * result + ord\n result.is_a?(Fixnum) ? result : result.hash\n end\n end",
"def hash\n @hash ||= begin\n result = 17\n result = 31 * result + self.class.hash\n result = 31 * result + ord\n result.is_a?(Fixnum) ? result : result.hash\n end\n end",
"def position(x) #x will be the Hashable object\r\n return x.hashvalue % @size\r\n end",
"def hash\n bytes.hash\n end",
"def hash\n [@offset, @previous_offset, @timestamp_value].hash\n end",
"def hexhash\n hash.to_s(16)\n end",
"def hash\n self.begin.hash ^ self.end.hash\n end",
"def hash\n @hash || @hash = (value.hash * -1)\n end",
"def hash\n\t\t\"#{@x}#{@y}\".hash\n\tend",
"def hash\n @symbols.hash + 37*positive?.hash\n end",
"def hash\n [oct, pc].hash\n end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash\n node_id.hash\n end",
"def hash\n @string.hash\n end",
"def hash\n @string.hash\n end",
"def hash\n @string.hash\n end",
"def binary_hash\n [@hash].pack(\"H*\").reverse\n end",
"def position\n get_cipher_position * 64\n end",
"def hash\n Zlib.crc32(to_a.map(&:to_s).sort.to_s)\n end",
"def hash_code; end",
"def hash\n @id.hash\n end",
"def hash\n type.hash ^ (id.hash >> 1)\n end",
"def hash\r\n id.hash\r\n end",
"def hash\n id.hash + 32 * bs_request.hash\n end",
"def hash\n value_id.hash\n end",
"def hash\n return to_s.hash\n end",
"def hash\r\n return to_s.hash\r\n end",
"def hash\n \"#{@ipv4}#{@port}\".hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n return @id.hash\n end",
"def hash\n Digest::SHA256.hexdigest( \"#{nonce}#{time}#{difficulty}#{prev}#{data}\" )\n end",
"def calculate_hash!\n prefix = PREFIX_NAME_LOOKUP[self.type]\n # add special cases for refs\n self.hash_id = NodeId.sha1(\"#{prefix} #{self.size}\\0#{self.content}\")\n end",
"def hash\n shasum.hash\n end",
"def hash\n shasum.hash\n end",
"def hash\n shasum.hash\n end",
"def hash\n guid.hash\n end",
"def hash\n code.hash\n end",
"def position\n @state[\"position\"]\n end",
"def hash\n @vector\n end",
"def calculate_finger_position(node_id, bit_position)\n ((Integer(\"0x#{node_id}\") + (1 << (bit_position - 1))) & KeyBitMask).to_s(16)\n end",
"def hash\n address.hash\n end",
"def cypher_hash(cypher_string)\n cypher_string.hash.abs\n end",
"def hash\n to_s.hash\n end",
"def hash\n @points.inject(0) { |sum, point| sum += point.x + point.y }\n end",
"def hash # Hack for Ruby 1.8.6\n @node.id.hash ^ self.class.hash\n end",
"def hash()\n #This is a stub, used for indexing\n end",
"def get_hash(key)\n (Zlib.crc32(key).abs % 100).to_s(36)\n end",
"def hash\n num = @high << 64\n num |= @low\n num.hash\n end",
"def hash_offset\n super\n end",
"def hash\n h = @e.nil? ? 0 : @e\n h = (h << 1) ^ @r.hash\n h = (h << 1) ^ @v.hash\n end",
"def hash(*) end",
"def hash\n @value.hash\n end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash; end",
"def hash\n self[:pc].hash\n end",
"def pos_to_index(position)\n position[1] * 8 + position[0]\n end",
"def hash_id\n @hid\n end",
"def hashed_coord(x, y)\n num = 0\n num += 65536 if x < 0\n num += 65536 * y\n num += x\n num\nend",
"def hash\n @offset.hash ^ @previous_offset.hash ^ @numerator_or_time.hash ^ @denominator.hash\n end",
"def hash\n @id\n 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 hash\n _window.hash\n end",
"def hash\n @vbits.hash\n end",
"def hash\n @offset.hash ^ @previous_offset.hash ^ @numerator_or_time.hash ^ @denominator.hash\n end",
"def hash\n @id\n end",
"def hash\n state.hash\n end",
"def hash\n state.hash\n end",
"def sha\n result_hash['sha']\n end",
"def hash\n self.atoms.hash\n end",
"def hash\n code.hash\n end",
"def hash\n return @revision.hash if @revision\n return object_id\n end"
] |
[
"0.7781621",
"0.7679458",
"0.6923816",
"0.6768183",
"0.6708193",
"0.6663256",
"0.6662692",
"0.6662692",
"0.65905654",
"0.654992",
"0.64730215",
"0.63291514",
"0.6317915",
"0.63122",
"0.6297588",
"0.62733406",
"0.6270021",
"0.6252283",
"0.6252283",
"0.6252283",
"0.6252283",
"0.6252283",
"0.6252283",
"0.6252283",
"0.6205085",
"0.61664367",
"0.61664367",
"0.61664367",
"0.61547625",
"0.6144614",
"0.61442214",
"0.6122495",
"0.61073595",
"0.6103402",
"0.6099656",
"0.60888815",
"0.6081534",
"0.60697967",
"0.6063942",
"0.6046335",
"0.60315824",
"0.60262126",
"0.60262126",
"0.60262126",
"0.60262126",
"0.60262126",
"0.60262126",
"0.60262126",
"0.60262126",
"0.60262126",
"0.60257965",
"0.60240215",
"0.6019626",
"0.6014476",
"0.6009836",
"0.6009836",
"0.6009836",
"0.59840935",
"0.59793794",
"0.5979339",
"0.5978362",
"0.59749866",
"0.5972307",
"0.5968092",
"0.59502715",
"0.5949847",
"0.5943793",
"0.5934273",
"0.59218943",
"0.5909572",
"0.59015757",
"0.5899732",
"0.5895757",
"0.5884112",
"0.58807117",
"0.58807117",
"0.58807117",
"0.58807117",
"0.58807117",
"0.58807117",
"0.58807117",
"0.58807117",
"0.58807117",
"0.58807117",
"0.58799416",
"0.5872256",
"0.58626163",
"0.58620226",
"0.58475524",
"0.5844213",
"0.58428234",
"0.5840586",
"0.5840446",
"0.5828627",
"0.5819134",
"0.58151287",
"0.58151287",
"0.5813992",
"0.5809691",
"0.5801508",
"0.57986844"
] |
0.0
|
-1
|
Override to supress Text.check call
|
def element=( element )
@element = element
self
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def repair(text); end",
"def has_text?; end",
"def validate_text\n errors.add(:text, :must_be_null_in_this_slide) if !self.allows_text? && !self.text.nil?\n end",
"def guard_text( text )\n # todo/fix 2: note we need to differentiate between blocks and inline\n # thus, to avoid runs - use guard_block (add a leading newline to avoid getting include in block that goes before)\n \n # todo/fix: remove wrap_markup; replace w/ guard_text\n # why: text might be css, js, not just html\n \n ### !!!!!!!!!!!!\n ## todo: add print depreciation warning\n \n wrap_markup( text )\n end",
"def apply_validations_for_text\n apply_validations_for_string\n end",
"def clean(text)\n @cleaner.clean(text)\n end",
"def validate_and_sanitize\n r = super\n return r unless r.success?\n\n success\n end",
"def checks; end",
"def validate_and_sanitize\n super\n end",
"def sanitize\n\t\tif @text.length == 0\n\t\t\t@text = [\"\"]\n\t\t\t@row = 0\n\t\t\t@col = 0\n\t\t\treturn\n\t\tend\n\t\tif @row >= @text.length\n\t\t\t@row = @text.length - 1\n\t\tend\n\t\tif @col > @text[@row].length\n\t\t\t@col = @text[@row].length\n\t\tend\n\tend",
"def validate_text(text)\n return validate({:rawdata => text})\n end",
"def check_that_no_text_run_is_active\n if @rt_run_context.inside_a_run\n raise \"Unexpected run! #{ @rt_run_context.inspect }\"\n end\n end",
"def isText _args\n \"isText _args;\" \n end",
"def precheck\n end",
"def text_filter(field)\n raise UnimplementedError\n end",
"def check\n \n end",
"def check\n \n end",
"def text?; end",
"def text?; end",
"def text?; end",
"def drop_text?(child); end",
"def clean_text(text)\n text = strip_html_quote_entities(text)\n text = Helper::Text.strip_html_tags(text)\n text = strip_copyright_text(text)\n text.strip!\n text = Helper::Text.clean_verse_start(text)\n text = Helper::Text.clean_verse_end(text)\n end",
"def sanitize!; end",
"def text_not_search (string,text)\n\tif $browser.text.include? string \n\t\tputs \"Error: #{text} should not be present\"\n\tend\nend",
"def print_result result\n return super if EatWhites.disabled?\n super unless @input.strip == ''\n end",
"def check_bad_word(o)\n @@bad_word_visitor.visit_this_0(self, o)\n end",
"def drop_text?(child)\n text = fetch_tag(:text)\n !child.allowed_child?(text)\n end",
"def check?\n if (@entry.text == \"\")\n false\n else\n true\n end\n end",
"def check?\n if (@entry.text == \"\")\n false\n else\n true\n end\n end",
"def check\n raise(CheckNotDefined, \"Your subclass must define its own #check.\")\n end",
"def before_process(text_line)\n nil\n end",
"def check ; true ; end",
"def text_only\n @text_only = @text.gsub(@@PRIREG, '')\n #.gsub(@@CONREG, '').gsub(@@PROREG, '')\n end",
"def raw_text?\n check_assignment_or_regexp(:raw_text, RawTextRegexp)\n end",
"def warning(text); end",
"def warning(text); end",
"def validate_text(text)\n return validate({:content => text})\n end",
"def text_validation_and_cache\n cache_record if stop_text?\n end",
"def input_model_text(new_text)\n pending(\"proper input text method that triggers all normal events\")\n fail\n end",
"def validate_and_sanitize\n r = super\n return r unless r.success?\n\n r = validate_matches\n return r unless r.success?\n\n success\n end",
"def checks_from_text(text)\n text.gsub(DISABLE_PREFIX_PATTERN, '').strip.split(',').map(&:strip)\n end",
"def special(txt, sub)\n raise 'not implemented'\n end",
"def _ctext\n\n _save = self.pos\n while true # choice\n _tmp = scan(/\\A(?-mix:[^)\\\\\\x0D\\x80-\\xFF(]+)/n)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_linear_white_space)\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_ctext unless _tmp\n return _tmp\n end",
"def clean?( text )\n\t\t@clean_calls += 1\n\t\t@banned_words.each do |word|\n\t\t\treturn false if text =~ /\\b#{word}\\b/\n\t\tend\n\t\ttrue\n\tend",
"def not_spam\n errors.add(:base, \"invalid reply\") if check_field.present?\n end",
"def text(txt)\r\n puts \"text: #{txt}\" if $DEBUG\r\n\r\n if (inRule?)\r\n txt = cleanText(txt)\r\n @curRuleSrc += txt\r\n end\r\n end",
"def validate(text)\n _check_options(text) &&\n _check_validators(text)\n end",
"def without_instruction(text)\n text.gsub(/^you (should|must)/i, '').gsub(/\\.$/, '')\n end",
"def clean?( text )\n @clean_calls += 1\n @banned_words.each do |word|\n return false if text =~ /\\b#{word}\\b/\n end\n true\n end",
"def reset_fancyness\n self.plain_text\n end",
"def valid_text?\n valid_command = Navigation.VALID_COMMANDS.clone\n (0..@command[0].max).each{|i| valid_command.push(i)}\n list = @command.clone\n list.flatten!\n list -= valid_command\n if list.length == 0\n return true\n else\n return false\n end\n end",
"def clean_input(text)\n text.gsub(/\\r/, '') rescue text\n end",
"def untaint()\n bug( \"you must override untaint()\" )\n end",
"def ignores; end",
"def clean_text(force_clean=false)\n if self.name_changed? || force_clean\n self.name = self.name.strip\n \n if self.locale != 'ka'\n self.name = self.name.latinize.titlecase if self.name.is_georgian?\n end\n \n self.search_name = self.name.latinize.to_ascii.downcase\n end\n \n if self.address_changed? || force_clean\n self.address = self.address.strip\n \n if self.locale != 'ka'\n self.address = self.address.latinize.titlecase if self.address.is_georgian?\n end\n\n self.search_address = self.address.latinize.to_ascii.downcase\n end\n \n end",
"def said_no?(text, *args)\n self.no?(\"#{text}\", :yellow, *args)\n end",
"def never_lines; end",
"def never_lines; end",
"def bypass_title_validation?\n bypass_title_validation\n end",
"def literal_validation; end",
"def literal_validation; end",
"def invalid; end",
"def check_validity!\n # nothing\n end",
"def clean?( text )\n @clean_calls += 1\n @banned_words.each do |word|\n return false if text =~ /\\b#{word}\\b/\n end\n true\n end",
"def _qtext\n\n _save = self.pos\n while true # choice\n _tmp = scan(/\\A(?-mix:[^\"\\\\\\x0D\\x80-\\xFF]+)/n)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_linear_white_space)\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_qtext unless _tmp\n return _tmp\n end",
"def checks=(_arg0); end",
"def sanitize\n # ui_enabled only for the belongs_to, has_many and many_to_many types\n self.ui_enabled = nil unless self.is_relationship?\n\n # text_formatting only for the text type\n self.text_formatting = nil unless self.type == :text\n end",
"def stub_unrecognized_text\n FileUtils.mkdir(\"/b\")\n FileUtils.touch(\"/b/b_000001_m.tif\")\n FileUtils.touch(\"/b/asdfasd\")\n Nyudl::Text::Base.new('/b', 'b')\n end",
"def source_check_state\n super\n end",
"def opposite_style_detected; end",
"def opposite_style_detected; end",
"def opposite_style_detected; end",
"def filter text\n if width + @font.text_width(text) < 133\n return text.gsub(/[^A-Z0-9a-z ]/, '')\n else \n return nil\n end\n end",
"def exclude_from_xss_checks; %w{ body html } end",
"def check_file\n super\n end",
"def text_input; end",
"def sanitize text\n [' ', '\\r\\n', \"\\r\\n\", \"\\n\", \"\\r\", \"\\t\", / ^/, / $+/, /^ /, /^ /].each { |text_to_remove|\n text.gsub!(text_to_remove,'')\n }\n return text\n end",
"def extended\n divided_text.length > 1\n end",
"def expected_char_checked()\n self.expected_char_checked_stm_line()\n self.expected_char_checked_stm_token()\n end",
"def isatty()\n #This is a stub, used for indexing\n end",
"def clean_text(text)\n text.gsub!(/\\r\\n/, '')\n text.gsub!(/\\r/, '')\n text\n end",
"def scrubbed\n end",
"def sanitize(text)\n text.gsub(@filter) { |gotcha| 'x' * gotcha.length }\n end",
"def clean_message(message); end",
"def text=(text); end",
"def clean()\n #strip all illegal content here. (scripts, shit that will break layout, etc.)\n end",
"def html_markup_textile_strict(text); end",
"def ascii_only?()\n #This is a stub, used for indexing\n end",
"def is_text?(); @type == GRT_TEXT; end",
"def corrector; end",
"def corrector; end",
"def corrector; end",
"def corrector; end",
"def before_validation\n\t\tself.class.columns.each do |c|\n\t\t\tif self[c.name] and [:string, :text].include?(c.class)\n\t\t\t\tself[c.name] = RailsSanitize.full_sanitizer.sanitize(self[c.name]) \n\t\t\tend\n\t\tend\t\t\n\tend",
"def write_no_newline(text)\n print(sanitize(text))\n end",
"def =~(check)\n raw_text =~ check\n end",
"def have_text(text)\n HaveText.new(text)\n end",
"def spell_check_all(text_arr)\n\t\tcheck_arr = []\n\t\tchecked_text = []\n\n\t\ttext_arr.each do |word|\n\t\t\tif ender?(word)\n\t\t\t\tcheck_arr << true\n\t\t\telse\n\t\t\t\tcheck_arr << Hunspell.check?(word)\n\t\t\tend\n\t\tend\n\n\t\tcheck_arr.each_with_index do |bool, i|\n\t\t\tif bool\n\t\t\t\tchecked_text << text_arr[i]\n\t\t\telse\n\t\t\t\tchecked_text << {original: text_arr[i],\n\t\t\t\t\t\t\t\t\t\t\t\t suggests: Hunspell.suggest(text_arr[i])}\n\t\t\tend\n\t\tend\n\t\treturn checked_text\n\tend",
"def display_repel_check\n display_message(parse_text(39, 0))\n end",
"def validate_and_sanitize\n validate\n end",
"def valid?(text)\n Gman.new(text).valid?\n end"
] |
[
"0.6137159",
"0.61293745",
"0.6096938",
"0.60914934",
"0.6044499",
"0.5962476",
"0.5914449",
"0.5895591",
"0.58363694",
"0.5805118",
"0.57921046",
"0.57769644",
"0.5742918",
"0.5733017",
"0.5724954",
"0.5719928",
"0.5719928",
"0.5714669",
"0.5714669",
"0.5714669",
"0.5700171",
"0.56976295",
"0.5690792",
"0.5661059",
"0.56578255",
"0.56525475",
"0.5651295",
"0.56471443",
"0.56471443",
"0.5625569",
"0.559631",
"0.5589746",
"0.55808586",
"0.55499566",
"0.55491024",
"0.55491024",
"0.5523024",
"0.55149114",
"0.5506877",
"0.54673165",
"0.5467282",
"0.5443476",
"0.5434965",
"0.5433023",
"0.54315645",
"0.54054207",
"0.54045403",
"0.5398707",
"0.53726584",
"0.5372158",
"0.5363966",
"0.5352721",
"0.5352604",
"0.53370965",
"0.5329872",
"0.5328069",
"0.53250897",
"0.53250897",
"0.5324833",
"0.53188944",
"0.53188944",
"0.53033245",
"0.53028536",
"0.5294212",
"0.5283894",
"0.52721196",
"0.52617645",
"0.52614284",
"0.526054",
"0.5258753",
"0.5258753",
"0.5258753",
"0.52537423",
"0.52439994",
"0.52420104",
"0.52363753",
"0.52358603",
"0.5231541",
"0.5230359",
"0.522791",
"0.5218665",
"0.5210545",
"0.5210382",
"0.5196457",
"0.51936203",
"0.51912093",
"0.5182553",
"0.5181583",
"0.5180508",
"0.5177329",
"0.5177329",
"0.5177329",
"0.5177329",
"0.5173707",
"0.5173585",
"0.5170984",
"0.5163404",
"0.51568973",
"0.5147288",
"0.5140034",
"0.51356065"
] |
0.0
|
-1
|
Index action to render all companies
|
def index
@companies = Company.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @companies = Company.all\n end",
"def index\n @companies = Company.all\n end",
"def index\n @companies = Company.all\n end",
"def index\n @companies = Company.all\n end",
"def index\n @companies = Company.all\n end",
"def index\n @companies = Company.all\n end",
"def index\n @companies = Company.all\n\n end",
"def index\n @company = Company.all\n end",
"def index\n @companies = ClientCompany.all\n end",
"def index\n @companions = Companion.all\n end",
"def index\n @main_companies = MainCompany.all\n end",
"def index\n @business_companies = Business::Company.all\n end",
"def index\n @companies_info = Company.display_information\n end",
"def index\n @production_companies = ProductionCompany.all\n end",
"def index\n @account_companies = Account::Company.all\n end",
"def index\n\t\t\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @companies }\n end\n end",
"def index\n @companies = Company.paginate(page: params[:page]).per_page(10) # pagination (gem 'will_paginate')\n end",
"def index\n\t\tif current_user.user_role.code == 'admin'\n\t\t\t@companies = Company.all\n\t\telse\n\t\t\t@companies = current_user.created_companies\n\t\tend\n\t\tmake_breadcrumbs\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @companies }\n\t\tend\n\tend",
"def index\n set_company\n end",
"def index\n @pagetitle = \"compros\"\n \n @companies = Company.where(user_id: current_user.id).order(\"name\")\n @path = 'compros'\n end",
"def index\n @visit_companies = VisitCompany.all\n end",
"def index\n if request.format.to_sym == :html\n @companies = Company.page(params[:page]).order(\"LOWER(name)\")\n else\n @companies = Company.all\n end\n respond_with(@companies)\n end",
"def index\n @hiring_companies = HiringCompany.all\n end",
"def show\n @companies = Company.all\n end",
"def index\n @companies = NasdaqCompany.all_companies\n respond_with(@companies)\n end",
"def index\n @company = current_company\n end",
"def index\n @customer_companies = CustomerCompany.all\n end",
"def index\n @companies = Company.all\n if @companies\n render json: {\n companies: @companies\n }\n else\n render json: {\n status: 500,\n errors: ['No companies']\n }\n end\n end",
"def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"def index\n @group_companies = GroupCompany.all\n end",
"def index\n if params[:company_type]\n @search = @community.companies.where(:company_type => params[:company_type]).search(params[:q])\n else\n @search = @community.companies.search(params[:q])\n end\n @companies = @search.result\n\n @tab_name = \"companies\"\n @page_title = \"Companies\"\n @page_subtitle = \"Loyal Businesses\"\n @page_description = \"\"\n\n add_breadcrumb \"Companies\", companies_path, :title => \"#{@community.name} Companies\"\n end",
"def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @companies }\n end\n end",
"def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @companies }\n end\n end",
"def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @companies }\n end\n end",
"def index\n @companies = Company.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @companies }\n end\n end",
"def index\n @companies = Company.order(:name).page(params[:page]).per(10)\n end",
"def show\n @companies = @sub_index.companies.where(\"tweet_count > 0\").page(params[:page]).per(30)\n @main_indices = MainIndex.all\n render :template => \"companies/index\"\n end",
"def index\n @companies = companies_scope\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"def index\n @companies = current_user.companies.all\n flash[:notice] = t('flash.actions.index.notice') if @companies.empty?\n respond_with(@companies)\n end",
"def index\n @company_names = CompanyName.all\n end",
"def index\n if current_user.nil?\n redirect_to root_path\n else \n puts '233r'\n end\n @companies = Company.all\n end",
"def index\n @contact_companies = ContactCompany.all\n end",
"def index\n @invoced_companies = InvocedCompany.all\n end",
"def index\n if current_user.admin?\n @companies = Company.all.order(:name).page(params[:page]).per(10)\n else\n @companies = current_user.company\n end\n end",
"def index\n @companies = Company.alphabetical.all\n end",
"def index\n @company_informations = CompanyInformation.all\n end",
"def index\n @compania = Companium.all\n end",
"def index\n @company_investors = CompanyInvestor.all\n end",
"def index\n @companyregs = Companyreg.all\n end",
"def index\n @companies = @person.companies\n\n respond_to do |format|\n format.html # index.html.haml\n format.xml { render :xml => @companies }\n end\n end",
"def index\n # Available only for admin and project manager\n if current_user.admin? || current_user.manager?\n @companies = Company.all\n else\n redirect_to projects_path, :alert => \"Access denied.\" and return\n end\n end",
"def index\n @type_companies = TypeCompany.all\n end",
"def index\n @companycreations = Companycreation.all\n end",
"def index\n @couts = Cout.order(:code)\n @company = Company.find(1)\n end",
"def index\n @companies = Company.all.page params[:page]\n end",
"def index\n @page_id = 'companyList'\n @banners = Banner.companies.where('start_at <= ? and end_at >= ?', Time.now, Time.now).where(:language => params[:locale] == 'en' ? [0, 1] : [0, 2])\n @company_classifies = CompanyClassify.design\n @companies = params[:company_classify_id].present? ? Company.joins(:company_classify_relations).where('company_classify_relations.company_classify_id = ?', params[:company_classify_id]).design.allow.human_order : Company.design.allow.human_order\n end",
"def index\n @company_categories = CompanyCategory.all\n end",
"def index\n @credit_companies = CreditCompany.all.page(params[:page]).per(10)\n end",
"def index\n @rail_companies = RailCompany.all\n end",
"def index\n @companies = NewCompany.where(user: current_user)\n end",
"def index\n manage_filter_state\n if session[:organization] != '0'\n @companies = Company.where(organization_id: session[:organization]).includes(:organization).paginate(:page => params[:page], :per_page => per_page).order(sort_column + ' ' + sort_direction)\n else\n @companies = Company.includes(:organization).paginate(:page => params[:page], :per_page => per_page).order(sort_column + ' ' + sort_direction)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n format.js\n end\n end",
"def index\n @company_owners = CompanyOwner.all\n end",
"def index\n @gas_companies = GasCompany.all\n end",
"def index\n @travel_companions = TravelCompanion.all\n end",
"def index\n add_breadcrumb \"all\", nil, \"glyphicon-list\"\n\n @companies = current_user.account.companies || []\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"def index\n @guarantee_companies = GuaranteeCompany.all\n end",
"def index\n @supporting_companies = SupportingCompany.all\n end",
"def index\n @companies = Company.all\n @recently_added_companies = Company.order(created_at: :desc).limit(5)\n @top_five = Company.order(rating: :desc).limit(5)\n render('index')\n end",
"def index\n @companies = Company.all\n @com_info = Company.last\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"def index\n @projects = Admin::Project.published\n @companies = Admin::Company.all\n end",
"def index\n @companies = Company.where(user_id: current_user.id).order(\"name\")\n @path = 'viaticos'\n @pagetitle = \"viaticos\"\n end",
"def index\n @companies = Company.all\n @users = User.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @companies }\n end\n end",
"def index\n\t @contentPageHeading = 'My Companies'\n\t @companies = current_user.companies\n\t @user_companies = UserCompany.where(:user_id => current_user.id)\n\t # @public_companies = Array.new\n\t # for user_company in @user_companies\n\t # \t@public_companies.push(user_company,Company.find(user_company.pc_id))\n\t # end\n\t\t# @public_companies = Company.find(:all, :order => 'name', :conditions => 'id IN (SELECT pc_id FROM user_companies WHERE user_id = '+current_user.id.to_s+')')\n end",
"def index\n @companies = Company.all.first(50000)\n end",
"def index\n # current_user.companies.\n @incidents = Incident.all\n end",
"def index\n @title = \"Customer Relation Management\"\n @companies = Company.all\n @contacts = Contact.all\n\t@opportunities = Opportunity.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @companies }\n end\n end",
"def companies\n render \"company/companies.json.jbuilder\", status: :ok\n end",
"def index\r\n # Get all companies alphabetized\r\n #@companies = Company.order(\"LOWER(name)\")\r\n @companies = Company.order(\"LOWER(name)\").paginate(:page =>params[:page], :per_page =>10)\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @companies }\r\n end\r\n end",
"def index\n @companies = Company.find(:all, :conditions => {:user_id => getUserId()}, :order => \"name\")\n @path = 'divisions'\n @pagetitle = \"Divisions\"\n end",
"def index\n @companies = Company.all\n respond_to do |format|\n format.html {}\n format.json {render json: {message: @companies}, status: 200}\n end\n end",
"def index\n @movie_companies = MovieCompany.all\n end",
"def index\n @businesses = Business.all\n render :index\n end",
"def index\n redirect_to home_company_path(@company)\n # @company_job_opportunities = @company.job_opportunities\n end",
"def index\n @producer_companies = ProducerCompany.all\n end",
"def index\n @companies = current_user.companies.paginate(:page => 1, :page => params[:page], :order => \"name DESC\")\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @companies }\n end\n end",
"def index\n @employees = Employee.paginate(page: params[:page]).per_page(10) # pagination (gem 'will_paginate')\n @companies = Company.all\n end",
"def index\r\n @company = Company.find_by(params[:id])\r\n @services = Service.where(company_id: params[:id])\r\n end",
"def index\n\t\tif session[:role] == \"admin\"\n\t\t\t@companies = Company.all\n\t\telse\n\t\t\t@companies = Company.where({approved: true})\n\t\tend\n\tend",
"def index\n @company_cards = CompanyCard.all\n end",
"def index\n @companies = Company.where(user_id: current_user.id).order(\"name\")\n @path =\"guia\"\n @pagetitle = \"deliverys\"\n end",
"def index\n @target_company = TargetCompany.new\n @target_companies = TargetCompany.all\n end",
"def index\n @companies = Company.all.order(\"created_at ASC\").paginate(page: params[:page], per_page: 15)\n end",
"def index\n @companies = Company.where(user_id: current_user.id).order(\"name\")\n @path = 'products_categories'\n @pagetitle = \"Product categories\"\n end",
"def index\n @company_fields = CompanyField.all\n end",
"def index\n @companies = Company.order(:name).confirmed.paginate(:page => params[:page], :per_page => 15)\n end",
"def index\n @company_users = CompanyUser.all\n end"
] |
[
"0.8519863",
"0.8519863",
"0.8519863",
"0.8519863",
"0.8519863",
"0.8519863",
"0.8468628",
"0.832885",
"0.83087826",
"0.82209325",
"0.8141195",
"0.81384903",
"0.80968875",
"0.8066812",
"0.8035232",
"0.80041826",
"0.8001578",
"0.7999802",
"0.79804623",
"0.7973436",
"0.7971096",
"0.795159",
"0.79437387",
"0.79180837",
"0.78905916",
"0.7890438",
"0.788487",
"0.78688914",
"0.7863685",
"0.7863685",
"0.7863685",
"0.7863685",
"0.7839121",
"0.7838631",
"0.78312474",
"0.78312474",
"0.78312474",
"0.78312474",
"0.78236675",
"0.7808222",
"0.77980965",
"0.7788256",
"0.77853477",
"0.77628565",
"0.7762672",
"0.7761609",
"0.77396804",
"0.7730715",
"0.77248275",
"0.7721235",
"0.77140284",
"0.77101547",
"0.77023846",
"0.76912415",
"0.76778674",
"0.76764995",
"0.7659203",
"0.7658234",
"0.7654486",
"0.7651104",
"0.76164603",
"0.76148266",
"0.7614781",
"0.76037025",
"0.7592842",
"0.7588283",
"0.75804526",
"0.7551277",
"0.7529315",
"0.75207317",
"0.75188786",
"0.75046414",
"0.7493997",
"0.7492883",
"0.74858874",
"0.747183",
"0.74588513",
"0.74425715",
"0.7434834",
"0.74130034",
"0.7411791",
"0.7394735",
"0.73815864",
"0.73813355",
"0.7362836",
"0.7357562",
"0.7354738",
"0.7348776",
"0.7326153",
"0.73073155",
"0.73000443",
"0.7299619",
"0.72973704",
"0.7296812",
"0.7287951",
"0.726864",
"0.72552234",
"0.7254337",
"0.72460324"
] |
0.85308367
|
1
|
New action for creating company
|
def new
@company = Company.new
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @company = Company.new(params[:company])\n\n if @company.save\n flash[:success] = \"Company was successfully created.\"\n redirect_to crm_path\n else\n render :action => 'new'# Clear page\n end\n end",
"def create\n @company = Company.new(company_params)\n if current_user\n current_user.companies << @company\n end\n @company.save\n flash[:safe] = %Q[#{t(\"company_created\")} #{view_context.link_to(t(\"create_new_open_jobs\"), administration_company_path(@company))}.]\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :internal_server_error }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n \n if @company.save\n redirect_to companies_path, notice: 'Company was successfully created.' \n else\n format.html { render :new }\n end\n end",
"def create\n # render plain: params[:company].inspect\n @company = Company.new(company_params) # Company.create() = Company.new() + Company.save\n \n if @company.save\n redirect_to @company\n else\n render 'new'\n end\n end",
"def create\n @company = Company.new(company_params)\n if @company.save\n redirect_to @company, notice: \"Company was successfully created.\"\n else\n render :new, status: :unprocessable_entity\n end\n end",
"def create\n @company = Company.create!(company_params)\n end",
"def create\n \n @company = Company.new(params[:company])\n \n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Empresa foi criada com sucesso.' }\n format.json { render json: @company, status: :created, location: @company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n add_to_log(t('Company created log') + @company.name,\"companies\",\"create\")\n flash[:notice] = t('Company created')\n if params[:submit_continue] == I18n.t('Create and continue')\n format.html { redirect_to(:action => :new) }\n else\n format.html { redirect_to(@company) }\n format.xml { render :xml => @company, :status => :created, :location => @company }\n end\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n begin\n \n detail = @@data_util.hash_data_to_upper_case( params[:company], ['description'])\n\n detail[:mypclient_id] = session[:client_id]\n detail[:createdby] = session[:username]\n detail[:isactive] = 1\n\n @company = Company.new(detail)\n if @company.save\n @@request_result[:success] = true\n @@request_result[:notice] = 'New company successfully created.'\n else\n @@request_result[:errormsg] = @company.errors.full_messages[0]\n end\n rescue Exception => e\n @@request_result[:errormsg] = e.message\n end\n render json: @@request_result\n end",
"def create\n @company = Company.new(company_params)\n\n render status: \\\n current_user.save_company(@company) ? :created : :unprocessable_entity\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render json: @company, status: :created, location: @company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render json: @company, status: :created, location: @company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render json: @company, status: :created, location: @company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render json: @company, status: :created, location: @company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tyc_company = Tyc::Company.new(tyc_company_params)\n\n respond_to do |format|\n if @tyc_company.save\n format.html { redirect_to @tyc_company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @tyc_company }\n else\n format.html { render :new }\n format.json { render json: @tyc_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render json: @company, status: :created, location: @company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render json: @company, status: :created, location: @company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @new_company = NewCompany.new(new_company_params)\n @new_company.user = current_user\n\n respond_to do |format|\n if @new_company.save\n format.html { redirect_to new_requesit_path, notice: 'Вы успешно добавили компанию!' }\n format.json { render :show, status: :created, location: @new_company }\n else\n format.html { render :new }\n format.json { render json: @new_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render action: 'show', status: :created, location: @company }\n else\n format.html { render action: 'new' }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n @company = Company.new(params[:company])\r\n respond_to do |format|\r\n if @company.save\r\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\r\n format.json { render json: @company, status: :created, location: @company }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @company.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n @company = Company.new(company_params)\n if @company.save\n flash[:success] = \"Company was successfully created.\"\n redirect_to companies_url\n else\n flash[:error] = @company.errors.full_messages.join(\" and \")\n redirect_to new_company_url(@company)\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html {\n redirect_to @company, notice: 'Company was successfully created.'\n }\n format.json {\n render json: @company, status: :created, location: @company\n }\n else\n format.html { render action: \"new\" }\n format.json {\n render json: @company.errors, status: :unprocessable_entity\n }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n respond_to do |format|\n if @company.save\n #format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n #format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\t@company = Company.new(company_params)\n\t\tif @company.save\n\t\t\tflash[:notice] = \"Successfully created company!\"\n\t\t\tredirect_to company_path(@company)\n\t\telse\n\t\t\tflash[:alert] = \"Error creating new company!\"\n\t\t\trender :new\n\t\tend\n\tend",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, :notice => 'Company was successfully created.' }\n format.json { render :json => @company, :status => :created, :location => @company }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @company = Company.new\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to(@company, :notice => 'Company was successfully created.') }\n format.xml { render :xml => @company, :status => :created, :location => @company }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to(@company, :notice => 'Company was successfully created.') }\n format.xml { render :xml => @company, :status => :created, :location => @company }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to(@company, :notice => 'Company was successfully created.') }\n format.xml { render :xml => @company, :status => :created, :location => @company }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @company = Company.new\n end",
"def create\n @account_company = Account::Company.new(account_company_params)\n\n respond_to do |format|\n if @account_company.save\n format.html { redirect_to @account_company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @account_company }\n else\n format.html { render :new }\n format.json { render json: @account_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Bar criado com sucesso.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_company\n company = Company.create!()\n company\n end",
"def create\n # binding.pry\n @company = Company.new(params[:company])\n if @company.save\n UpdateMailer.update_email(@company, current_user, action_name).deliver\n flash[:notice] = 'Company was successfully created.'\n end\n respond_with(@company)\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n flash[:notice] = 'Company was successfully created.'\n format.html { redirect_to(@company) }\n format.xml { render :xml => @company, :status => :created, :location => @company }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html {redirect_to @company, notice: 'Company was successfully created.'}\n format.json {render :show, status: :created, location: @company}\n else\n format.html {render :new}\n format.json {render json: @company.errors, status: :unprocessable_entity}\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html {redirect_to @company, notice: 'Company was successfully created.'}\n format.json {render :show, status: :created, location: @company}\n else\n format.html {render :new}\n format.json {render json: @company.errors, status: :unprocessable_entity}\n end\n end\n end",
"def create\n if @company = Company.find(entity_id_from_params(:company))\n respond_to do |format|\n current_user.account.companies << @company\n format.html { redirect_to root_path, notice: 'Company was successfully created.' }\n format.json\n end\n end\n end",
"def create\n @company = @current_agency.companies.new(company_params)\n authorize @company\n\n respond_to do |format|\n if @company.save\n current_admin.events.create(action: \"created\", eventable: @company)\n format.html { redirect_to admin_company_path(@company), notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n @company.user = current_user\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to companies_path, notice: 'Компания успешно создана' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\t@company = Company.new(params[:company].merge({:by_user_id => current_user.id}))\n\t\tmake_breadcrumbs\n\n\t\trespond_to do |format|\n\t\t\tif @company.save\n\t\t\t\tformat.html { redirect_to @company, notice: t('app.companies.created') }\n\t\t\t\tformat.json { render json: @company, status: :created, location: @company }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @company.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n # result = self.add()\n # # @company = result[:company]\n # format.html { redirect_to result[:company], notice: 'Company was successfully created.' }\n # format.json { render :show, status: :created, location: result[:company] }\n end",
"def create\n @global_company = GlobalCompany.new(params[:global_company])\n\n respond_to do |format|\n if @global_company.save\n format.html { redirect_to @global_company, notice: 'Global company was successfully created.' }\n format.json { render json: @global_company, status: :created, location: @global_company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @global_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = @community.companies.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = current_user.companies.build(params[:company])\n flash[:notice] = t('flash.actions.create.notice', :resource_name => Company.model_name.human) if @company.save\n respond_with(@company, :location => companies_path)\n end",
"def create\n @ins_company = InsCompany.new(params[:ins_company])\n\n respond_to do |format|\n if @ins_company.save\n format.html { redirect_to @ins_company, notice: 'Ins company was successfully created.' }\n format.json { render json: @ins_company, status: :created, location: @ins_company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ins_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = current_user.companies.build(company_params)\n\n if @company.save\n flash[:success] = \"Saved!\"\n redirect_to companies_path\n else\n render 'new'\n end\n end",
"def create\n @company = Company.new(params[:company])\n \n if current_user\n\t @company.user_id = current_user.id\n end\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to(@company, :notice => 'Company was successfully created.') }\n format.xml { render :xml => @company, :status => :created, :location => @company }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n\t\t@company = Company.new(company_params)\n\t\t# for admin to add a company\n\t\tif admin? && @company.save\n\t\t\tflash[:success] = \"#{@company.name} was successfully saved!\"\n\t\t\tredirect_to beanformed_company_beans_path(@company.id)\n\t\t# for all users; new companies come in as approved : false\n\t\telsif @company.save\n\t\t\tflash[:success] = \"Thanks for registering #{@company.name}! You will be notified when you are approved!\"\n\t\t\t@roaster = Roaster.find(session[:roaster_id])\n\t\t\t@roaster.update({company_id: @company.id, phone: params[:company][:phone], role: \"pending\"})\n\t\t\tredirect_to new_beanformed_company_path\n\t\telse\n\t\t\tflash[:error] = \"Please fill out all fields.\"\n\t\t\tredirect_to new_beanformed_company_path\n\t\tend\n\tend",
"def create\n @credit_company = CreditCompany.new(credit_company_params)\n\n respond_to do |format|\n if @credit_company.save\n format.html { redirect_to @credit_company, notice: t('credit_company.created') }\n format.json { render :show, status: :created, location: @credit_company }\n else\n format.html { render :new }\n format.json { render json: @credit_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n @company.create_default_infos\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company successfully created.' }\n format.json { render json: @company, status: :created, location: @company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n if @company.save\n respond_with @company, status: :created, location: @company\n else\n respond_with @company, status: :unprocessable_entity\n end\n end",
"def new\n @company = Company.find_or_create_by(name: 'New Company')\n begin\n @company.save!\n rescue\n flash[:error] = \"Company NOT be found or was not created.\"\n nil\n end\n @address = @company.addresses.find_or_create_by( {addressable_type: 'Company', addressable_id: @company.id} )\n @address.save!\n end",
"def create\n Rails.logger.info \"\\n*****\\nParams Company: #{params[:company]} ********\\n\"\n\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.js\n format.json { render json: @company, status: :created, location: @company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n @company.owner = User.find(session[:user_id])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render json: @company, status: :created, location: @company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @type_company = TypeCompany.new(type_company_params)\n\n respond_to do |format|\n if @type_company.save\n format.html { redirect_to @type_company, notice: 'Type company was successfully created.' }\n format.json { render :show, status: :created, location: @type_company }\n else\n format.html { render :new }\n format.json { render json: @type_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @companycreation = Companycreation.new(companycreation_params)\n respond_to do |format|\n if @companycreation.save\n format.html { redirect_to companycreations_url, notice: 'Companycreation was successfully created.' }\n format.json { render :show, status: :created, location: @companycreation }\n else\n format.html { redirect_to companycreations_url, notice: 'Companycreation was Not successfully created.'}\n format.json { render json: @companycreation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n #@battalion = Battalion.find(params[:battalion_id])\n respond_to do |format|\n if @company.save\n flash[:notice] = 'Company was successfully created.'\n format.html { redirect_to :back }\n format.xml { render :xml => @company, :status => :created, :location => @company }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n company = Company.create(company_params)\n if company\n render json:{\n status: :created,\n company: company\n }\n else\n render json: { status: 500 }\n end\n\n \n \n end",
"def set_new_company\n @new_company = NewCompany.find(params[:id])\n end",
"def create\n @company_name = CompanyName.new(company_name_params)\n\n respond_to do |format|\n if @company_name.save\n format.html { redirect_to @company_name, notice: 'Company name was successfully created.' }\n format.json { render :show, status: :created, location: @company_name }\n else\n format.html { render :new }\n format.json { render json: @company_name.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n render json: Company.create(params[\"company\"])\n end",
"def create\n @visit_company = VisitCompany.new(visit_company_params)\n\n respond_to do |format|\n if @visit_company.save\n format.html { redirect_to @visit_company, notice: 'Visit company was successfully created.' }\n format.json { render :show, status: :created, location: @visit_company }\n else\n format.html { render :new }\n format.json { render json: @visit_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n @company = current_user.build_company(params[:company])\r\n respond_to do |format|\r\n if @company.save\r\n expire_fragment \"yellowpage\"\r\n expire_fragment \"users_center_#{session[:user_id]}\"\r\n flash[:notice] = '公司成功创建,恭喜你创建完成了!'\r\n format.html { redirect_to :action=>\"show\",:id=>@company.id}\r\n else\r\n flash[:notice] = '公司创建失败了,再次创建试试看?'\r\n format.html { redirect_to :action=>\"new\"}\r\n end\r\n end\r\n end",
"def create\n @companyreg = Companyreg.new(companyreg_params)\n\n respond_to do |format|\n if @companyreg.save\n format.html { redirect_to @companyreg, notice: 'Companyreg was successfully created.' }\n format.json { render :show, status: :created, location: @companyreg }\n else\n format.html { render :new }\n format.json { render json: @companyreg.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @listed_company = ListedCompany.new(listed_company_params)\n\n respond_to do |format|\n if @listed_company.save\n format.html { redirect_to listed_companies_path, notice: 'Listed company was successfully created.' }\n format.json { render :show, status: :created, location: @listed_company }\n else\n format.html { render :new }\n format.json { render json: @listed_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @main_company = MainCompany.new(main_company_params)\n\n respond_to do |format|\n if @main_company.save\n format.html { redirect_to @main_company, notice: 'Main company was successfully created.' }\n format.json { render :show, status: :created, location: @main_company }\n else\n format.html { render :new }\n format.json { render json: @main_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @lib_company = LibCompany.new(params[:lib_company])\n\n respond_to do |format|\n if @lib_company.save\n format.html { redirect_to(@lib_company, :notice => 'Lib company was successfully created.') }\n format.xml { render :xml => @lib_company, :status => :created, :location => @lib_company }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @lib_company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @production_company = ProductionCompany.new(production_company_params)\n\n respond_to do |format|\n if @production_company.save\n format.html { redirect_to @production_company, notice: 'Production company was successfully created.' }\n format.json { render :show, status: :created, location: @production_company }\n else\n format.html { render :new }\n format.json { render json: @production_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @admin_company_type = Admin::CompanyType.new(admin_company_type_params)\n\n respond_to do |format|\n if @admin_company_type.save\n format.html { redirect_to @admin_company_type, notice: 'Company type was successfully created.' }\n format.json { render action: 'show', status: :created, location: @admin_company_type }\n else\n format.html { render action: 'new' }\n format.json { render json: @admin_company_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @guarantee_company = GuaranteeCompany.new(guarantee_company_params)\n\n respond_to do |format|\n if @guarantee_company.save\n format.html { redirect_to @guarantee_company, notice: 'Guarantee company was successfully created.' }\n format.json { render action: 'show', status: :created, location: @guarantee_company }\n else\n format.html { render action: 'new' }\n format.json { render json: @guarantee_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n respond_to do |format|\n if @company.save\n # User becomes company admin\n current_user.update_attribute(:company_id, @company.id)\n current_user.update_attribute(:company_admin, true)\n # Send email notifications to Admins and current user\n ExampleMailer.create_company_admin(@company).deliver\n ExampleMailer.create_company(@company).deliver\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company_owner = CompanyOwner.new(company_owner_params)\n\n respond_to do |format|\n if @company_owner.save\n format.html { redirect_to @company_owner, notice: 'Company owner was successfully created.' }\n format.json { render action: 'show', status: :created, location: @company_owner }\n else\n format.html { render action: 'new' }\n format.json { render json: @company_owner.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @contact_company = ContactCompany.new(contact_company_params)\n\n respond_to do |format|\n if @contact_company.save\n format.html { redirect_to @contact_company, notice: 'Contact company was successfully created.' }\n format.json { render action: 'show', status: :created, location: @contact_company }\n else\n format.html { render action: 'new' }\n format.json { render json: @contact_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.json { render :show, status: :created, location: @company }\n SignUpNotifier.registrated(@company).deliver\n else\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gas_company = GasCompany.new(gas_company_params)\n\n respond_to do |format|\n if @gas_company.save\n format.html { redirect_to admins_gas_company_path(@gas_company), notice: 'Gas company was successfully created.' }\n format.json { render :show, status: :created, location: @gas_company }\n else\n format.html { render :new }\n format.json { render json: @gas_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @holding_company = HoldingCompany.new(params[:holding_company])\n\n respond_to do |format|\n if @holding_company.save\n flash.now[:notice] = 'Holding Company berhasil ditambah !'\n format.html { redirect_to(holding_companies_path) }\n format.xml { render :xml => @holding_company, :status => :created, :location => @holding_company }\n else\n flash.now[:notice] = 'Holding Company tidak berhasil ditambah !'\n format.html { render :action => \"new\" }\n format.xml { render :xml => @holding_company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @company_investor = CompanyInvestor.new(company_investor_params)\n\n end",
"def create\n\n respond_to do |format|\n if @company_business.save\n format.html { redirect_to @company_business, notice: 'Company business was successfully created.' }\n format.json { render json: @company_business, status: :created, location: @company_business }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company_business.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = companies_scope.new(company_params)\n\n respond_to do |format|\n if @company.save\n CompanyRegisterMailer.send_request(@company.id).deliver\n\n flash.now[:notice] = I18n.t('commons.successfully_created')\n format.html { render action: \"show\" }\n format.json { render json: @company, status: :created, location: @company.location }\n format.js #\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n format.js #\n end\n end\n end",
"def create\n @company = current_user.companies.build(params[:company])\n logger.debug params.to_yaml\n # logger.debug @company.code\n @company.code.upcase!\n \n respond_to do |format|\n if @company.save\n flash[:notice] = 'Company was successfully created.'\n format.html { redirect_to(root_path) }\n format.xml { render :xml => @company, :status => :created, :location => @company }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @group_company = GroupCompany.new(group_company_params)\n\n respond_to do |format|\n if @group_company.save\n format.html { redirect_to @group_company, notice: 'Group company was successfully created.' }\n format.json { render :show, status: :created, location: @group_company }\n else\n format.html { render :new }\n format.json { render json: @group_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @invoced_company = InvocedCompany.new(invoced_company_params)\n\n respond_to do |format|\n if @invoced_company.save\n format.html { redirect_to @invoced_company, notice: t(:successfully_updated_invoced_company) }\n format.json { render action: 'show', status: :created, location: @invoced_company }\n else\n format.html { render action: 'new' }\n format.json { render json: @invoced_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def companycreation_params\n params.require(:companycreation).permit(:companyname)\n end",
"def create\n @hiring_company = HiringCompany.new(hiring_company_params)\n\n respond_to do |format|\n if @hiring_company.save\n format.html { redirect_to @hiring_company, notice: 'Hiring company was successfully created.' }\n format.json { render :show, status: :created, location: @hiring_company }\n else\n format.html { render :new }\n format.json { render json: @hiring_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @pagetitle = \"New compro\"\n \n if(params[:company_id])\n @company = Company.find(params[:company_id])\n @locations = @company.get_locations()\n @divisions = @company.get_divisions()\n @transports = @company.get_transports()\n @ac_user = getUsername()\n \n if(@company.can_view(current_user))\n @compro = Compro.new\n @compro.company_id = @company.id\n else\n errPerms()\n end\n else\n redirect_to('/companies')\n end\n end",
"def create\n @intelcompany = IntelCompany.new(intelcompany_params)\n\n if @intelcompany.save\n render json: @intelcompany, status: :created, location: @intelcompany\n else\n render json: @intelcompany.errors, status: :unprocessable_entity\n end\n\n end",
"def create\n @part_company = PartCompany.new(params[:part_company])\n\n respond_to do |format|\n if @part_company.save\n format.html { redirect_to @part_company, notice: 'Part company was successfully created.' }\n format.json { render json: @part_company, status: :created, location: @part_company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @part_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n @company = current_profile.companies.build(company_params)\n\n @company.companytype_id = params[:company_id]\n\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(nested_params)\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pagetitle = \"New compro\"\n \n \n \n @company = Company.find(params[:compro][:company_id])\n @compro = Compro.new(compro_params)\n \n \n @locations = @company.get_locations()\n @divisions = @company.get_divisions()\n @transports = @company.get_transports()\n \n \n respond_to do |format|\n if @compro.save\n format.html { redirect_to(@compro, :notice => 'compro was successfully created.') }\n format.xml { render :xml => @compro, :status => :created, :location => @compro }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @compro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @supporting_company = SupportingCompany.new(supporting_company_params)\n\n respond_to do |format|\n if @supporting_company.save\n format.html { redirect_to @supporting_company, notice: 'Supporting company was successfully created.' }\n format.json { render :show, status: :created, location: @supporting_company }\n else\n format.html { render :new }\n format.json { render json: @supporting_company.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.8238307",
"0.8067915",
"0.80352366",
"0.8024617",
"0.80087876",
"0.8000446",
"0.7984897",
"0.79737574",
"0.7935416",
"0.7934482",
"0.79234785",
"0.7916446",
"0.7916446",
"0.7916446",
"0.7916446",
"0.79163134",
"0.7916167",
"0.79161584",
"0.7906685",
"0.78983325",
"0.78842646",
"0.78842646",
"0.78842646",
"0.78842646",
"0.78842646",
"0.788028",
"0.78796905",
"0.78794944",
"0.7874008",
"0.787194",
"0.7854055",
"0.7851125",
"0.7844851",
"0.77988917",
"0.77961135",
"0.77961135",
"0.77961135",
"0.77948195",
"0.7768331",
"0.7748213",
"0.7741144",
"0.772731",
"0.77261937",
"0.7716815",
"0.7716815",
"0.7675719",
"0.76574504",
"0.76481897",
"0.76153725",
"0.76122886",
"0.76067275",
"0.7584613",
"0.7575264",
"0.7552479",
"0.75494844",
"0.7538058",
"0.7518609",
"0.75148296",
"0.75136536",
"0.75057393",
"0.74940336",
"0.748591",
"0.7483295",
"0.7468375",
"0.74621665",
"0.74581414",
"0.7454373",
"0.74299014",
"0.7416274",
"0.7408845",
"0.7397959",
"0.73670805",
"0.7359434",
"0.7358139",
"0.735407",
"0.73509556",
"0.73487395",
"0.7346539",
"0.73319364",
"0.7327631",
"0.7309972",
"0.7302127",
"0.72948325",
"0.7280087",
"0.7257252",
"0.7254708",
"0.72515315",
"0.72414553",
"0.72382796",
"0.72255075",
"0.72244376",
"0.7223286",
"0.720882",
"0.7205085",
"0.718579",
"0.71793383",
"0.71704316",
"0.71675557",
"0.71655095",
"0.7158891"
] |
0.7786426
|
38
|
Create action saves the company into database
|
def create
@company = Company.new(company_params)
if @company.save
flash[:notice] = "Successfully created company!"
redirect_to company_path(@company)
else
flash[:alert] = "Error creating new company!"
render :new
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @company = Company.create!(company_params)\n end",
"def create\n @company = Company.new(company_params)\n\n \n if @company.save\n redirect_to companies_path, notice: 'Company was successfully created.' \n else\n format.html { render :new }\n end\n end",
"def create\n @company = Company.new(company_params)\n if @company.save\n redirect_to @company, notice: \"Company was successfully created.\"\n else\n render :new, status: :unprocessable_entity\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n if @company.save\n flash[:success] = \"Company was successfully created.\"\n redirect_to crm_path\n else\n render :action => 'new'# Clear page\n end\n end",
"def create\n # render plain: params[:company].inspect\n @company = Company.new(company_params) # Company.create() = Company.new() + Company.save\n \n if @company.save\n redirect_to @company\n else\n render 'new'\n end\n end",
"def create_company\n company = Company.create!()\n company\n end",
"def create\n @company = Company.new(company_params)\n\n render status: \\\n current_user.save_company(@company) ? :created : :unprocessable_entity\n end",
"def create\n \n @company = Company.new(params[:company])\n \n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Empresa foi criada com sucesso.' }\n format.json { render json: @company, status: :created, location: @company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n if @company.save\n flash[:success] = \"Company was successfully created.\"\n redirect_to companies_url\n else\n flash[:error] = @company.errors.full_messages.join(\" and \")\n redirect_to new_company_url(@company)\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n respond_to do |format|\n if @company.save\n #format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n #format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render json: @company, status: :created, location: @company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render json: @company, status: :created, location: @company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render json: @company, status: :created, location: @company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render json: @company, status: :created, location: @company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render json: @company, status: :created, location: @company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render json: @company, status: :created, location: @company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html {\n redirect_to @company, notice: 'Company was successfully created.'\n }\n format.json {\n render json: @company, status: :created, location: @company\n }\n else\n format.html { render action: \"new\" }\n format.json {\n render json: @company.errors, status: :unprocessable_entity\n }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render action: 'show', status: :created, location: @company }\n else\n format.html { render action: 'new' }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n @company = Company.new(params[:company])\r\n respond_to do |format|\r\n if @company.save\r\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\r\n format.json { render json: @company, status: :created, location: @company }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @company.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n begin\n \n detail = @@data_util.hash_data_to_upper_case( params[:company], ['description'])\n\n detail[:mypclient_id] = session[:client_id]\n detail[:createdby] = session[:username]\n detail[:isactive] = 1\n\n @company = Company.new(detail)\n if @company.save\n @@request_result[:success] = true\n @@request_result[:notice] = 'New company successfully created.'\n else\n @@request_result[:errormsg] = @company.errors.full_messages[0]\n end\n rescue Exception => e\n @@request_result[:errormsg] = e.message\n end\n render json: @@request_result\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n add_to_log(t('Company created log') + @company.name,\"companies\",\"create\")\n flash[:notice] = t('Company created')\n if params[:submit_continue] == I18n.t('Create and continue')\n format.html { redirect_to(:action => :new) }\n else\n format.html { redirect_to(@company) }\n format.xml { render :xml => @company, :status => :created, :location => @company }\n end\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Bar criado com sucesso.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @account_company = Account::Company.new(account_company_params)\n\n respond_to do |format|\n if @account_company.save\n format.html { redirect_to @account_company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @account_company }\n else\n format.html { render :new }\n format.json { render json: @account_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, :notice => 'Company was successfully created.' }\n format.json { render :json => @company, :status => :created, :location => @company }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n if current_user\n current_user.companies << @company\n end\n @company.save\n flash[:safe] = %Q[#{t(\"company_created\")} #{view_context.link_to(t(\"create_new_open_jobs\"), administration_company_path(@company))}.]\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :internal_server_error }\n end\n end\n end",
"def create\n if @company = Company.find(entity_id_from_params(:company))\n respond_to do |format|\n current_user.account.companies << @company\n format.html { redirect_to root_path, notice: 'Company was successfully created.' }\n format.json\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n # result = self.add()\n # # @company = result[:company]\n # format.html { redirect_to result[:company], notice: 'Company was successfully created.' }\n # format.json { render :show, status: :created, location: result[:company] }\n end",
"def create\n # binding.pry\n @company = Company.new(params[:company])\n if @company.save\n UpdateMailer.update_email(@company, current_user, action_name).deliver\n flash[:notice] = 'Company was successfully created.'\n end\n respond_with(@company)\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to(@company, :notice => 'Company was successfully created.') }\n format.xml { render :xml => @company, :status => :created, :location => @company }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to(@company, :notice => 'Company was successfully created.') }\n format.xml { render :xml => @company, :status => :created, :location => @company }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to(@company, :notice => 'Company was successfully created.') }\n format.xml { render :xml => @company, :status => :created, :location => @company }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @tyc_company = Tyc::Company.new(tyc_company_params)\n\n respond_to do |format|\n if @tyc_company.save\n format.html { redirect_to @tyc_company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @tyc_company }\n else\n format.html { render :new }\n format.json { render json: @tyc_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n @company.owner = User.find(session[:user_id])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render json: @company, status: :created, location: @company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n #@battalion = Battalion.find(params[:battalion_id])\n respond_to do |format|\n if @company.save\n flash[:notice] = 'Company was successfully created.'\n format.html { redirect_to :back }\n format.xml { render :xml => @company, :status => :created, :location => @company }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @company = current_user.companies.build(company_params)\n\n if @company.save\n flash[:success] = \"Saved!\"\n redirect_to companies_path\n else\n render 'new'\n end\n end",
"def create\n @company = Company.new(params[:company])\n \n if current_user\n\t @company.user_id = current_user.id\n end\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to(@company, :notice => 'Company was successfully created.') }\n format.xml { render :xml => @company, :status => :created, :location => @company }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @new_company = NewCompany.new(new_company_params)\n @new_company.user = current_user\n\n respond_to do |format|\n if @new_company.save\n format.html { redirect_to new_requesit_path, notice: 'Вы успешно добавили компанию!' }\n format.json { render :show, status: :created, location: @new_company }\n else\n format.html { render :new }\n format.json { render json: @new_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html {redirect_to @company, notice: 'Company was successfully created.'}\n format.json {render :show, status: :created, location: @company}\n else\n format.html {render :new}\n format.json {render json: @company.errors, status: :unprocessable_entity}\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html {redirect_to @company, notice: 'Company was successfully created.'}\n format.json {render :show, status: :created, location: @company}\n else\n format.html {render :new}\n format.json {render json: @company.errors, status: :unprocessable_entity}\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n @company.user = current_user\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to companies_path, notice: 'Компания успешно создана' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n flash[:notice] = 'Company was successfully created.'\n format.html { redirect_to(@company) }\n format.xml { render :xml => @company, :status => :created, :location => @company }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n\t\t@company = Company.new(company_params)\n\t\t# for admin to add a company\n\t\tif admin? && @company.save\n\t\t\tflash[:success] = \"#{@company.name} was successfully saved!\"\n\t\t\tredirect_to beanformed_company_beans_path(@company.id)\n\t\t# for all users; new companies come in as approved : false\n\t\telsif @company.save\n\t\t\tflash[:success] = \"Thanks for registering #{@company.name}! You will be notified when you are approved!\"\n\t\t\t@roaster = Roaster.find(session[:roaster_id])\n\t\t\t@roaster.update({company_id: @company.id, phone: params[:company][:phone], role: \"pending\"})\n\t\t\tredirect_to new_beanformed_company_path\n\t\telse\n\t\t\tflash[:error] = \"Please fill out all fields.\"\n\t\t\tredirect_to new_beanformed_company_path\n\t\tend\n\tend",
"def create\n @company = Company.new(company_params)\n respond_to do |format|\n if @company.save\n # User becomes company admin\n current_user.update_attribute(:company_id, @company.id)\n current_user.update_attribute(:company_admin, true)\n # Send email notifications to Admins and current user\n ExampleMailer.create_company_admin(@company).deliver\n ExampleMailer.create_company(@company).deliver\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n company = Company.create(company_params)\n if company\n render json:{\n status: :created,\n company: company\n }\n else\n render json: { status: 500 }\n end\n\n \n \n end",
"def create\n @company = Company.new(params[:company])\n\n if @company.save\n respond_with @company, status: :created, location: @company\n else\n respond_with @company, status: :unprocessable_entity\n end\n end",
"def create\n @company = @current_agency.companies.new(company_params)\n authorize @company\n\n respond_to do |format|\n if @company.save\n current_admin.events.create(action: \"created\", eventable: @company)\n format.html { redirect_to admin_company_path(@company), notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n @company.create_default_infos\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company successfully created.' }\n format.json { render json: @company, status: :created, location: @company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = @community.companies.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n render json: Company.create(params[\"company\"])\n end",
"def create\n @credit_company = CreditCompany.new(credit_company_params)\n\n respond_to do |format|\n if @credit_company.save\n format.html { redirect_to @credit_company, notice: t('credit_company.created') }\n format.json { render :show, status: :created, location: @credit_company }\n else\n format.html { render :new }\n format.json { render json: @credit_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = current_user.companies.build(params[:company])\n flash[:notice] = t('flash.actions.create.notice', :resource_name => Company.model_name.human) if @company.save\n respond_with(@company, :location => companies_path)\n end",
"def create\n Company.transaction do\n @company = Company.new(company_params)\n logger.warn \"asfafdas #{@company.to_yaml}\"\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render action: 'show', status: :created, location: @company }\n companyReview = CompanyReview.new\n companyReview.user_id = current_user.id\n companyReview.company_id = @company.id\n companyReview.save!\n else\n format.html { render action: 'new' }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def create\n Rails.logger.info \"\\n*****\\nParams Company: #{params[:company]} ********\\n\"\n\n @company = Company.new(params[:company])\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.js\n format.json { render json: @company, status: :created, location: @company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = current_user.companies.build(params[:company])\n logger.debug params.to_yaml\n # logger.debug @company.code\n @company.code.upcase!\n \n respond_to do |format|\n if @company.save\n flash[:notice] = 'Company was successfully created.'\n format.html { redirect_to(root_path) }\n format.xml { render :xml => @company, :status => :created, :location => @company }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n\n @asset_company = AssetCompany.new(params[:asset_company])\n respond_to do |format|\n if @asset_company.save\n #session[:asset_company_id] = @asset_company.id\n flash[:notice] = \"Account for #{@asset_company.company_name} was successfully created.\"\n format.html { redirect_to(:action=>'show', :id => @asset_company.id) }\n format.xml { render :xml => @asset_company, :status => :created, :location => @asset_company }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @asset_company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n \n @company = current_profile.companies.build(company_params)\n\n @company.companytype_id = params[:company_id]\n\n\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n @company.company_admins.create(:user_id => current_user.id, :company_id => @company.id, :user_role => 'admin')\n format.html { redirect_to @company, flash: {:success => 'Company was successfully created.'} }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ins_company = InsCompany.new(params[:ins_company])\n\n respond_to do |format|\n if @ins_company.save\n format.html { redirect_to @ins_company, notice: 'Ins company was successfully created.' }\n format.json { render json: @ins_company, status: :created, location: @ins_company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ins_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company_contact = CompanyContact.new(params[:company_contact]) \n @company = Company.new(session[:company])\n @company.save\n @company_contact.company_id = @company.id\n @company_contact.save\n redirect_to @company\n end",
"def create\n @companycreation = Companycreation.new(companycreation_params)\n respond_to do |format|\n if @companycreation.save\n format.html { redirect_to companycreations_url, notice: 'Companycreation was successfully created.' }\n format.json { render :show, status: :created, location: @companycreation }\n else\n format.html { redirect_to companycreations_url, notice: 'Companycreation was Not successfully created.'}\n format.json { render json: @companycreation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @visit_company = VisitCompany.new(visit_company_params)\n\n respond_to do |format|\n if @visit_company.save\n format.html { redirect_to @visit_company, notice: 'Visit company was successfully created.' }\n format.json { render :show, status: :created, location: @visit_company }\n else\n format.html { render :new }\n format.json { render json: @visit_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n @company = current_user.build_company(params[:company])\r\n respond_to do |format|\r\n if @company.save\r\n expire_fragment \"yellowpage\"\r\n expire_fragment \"users_center_#{session[:user_id]}\"\r\n flash[:notice] = '公司成功创建,恭喜你创建完成了!'\r\n format.html { redirect_to :action=>\"show\",:id=>@company.id}\r\n else\r\n flash[:notice] = '公司创建失败了,再次创建试试看?'\r\n format.html { redirect_to :action=>\"new\"}\r\n end\r\n end\r\n end",
"def create\n @global_company = GlobalCompany.new(params[:global_company])\n\n respond_to do |format|\n if @global_company.save\n format.html { redirect_to @global_company, notice: 'Global company was successfully created.' }\n format.json { render json: @global_company, status: :created, location: @global_company }\n else\n format.html { render action: \"new\" }\n format.json { render json: @global_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @production_company = ProductionCompany.new(production_company_params)\n\n respond_to do |format|\n if @production_company.save\n format.html { redirect_to @production_company, notice: 'Production company was successfully created.' }\n format.json { render :show, status: :created, location: @production_company }\n else\n format.html { render :new }\n format.json { render json: @production_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @type_company = TypeCompany.new(type_company_params)\n\n respond_to do |format|\n if @type_company.save\n format.html { redirect_to @type_company, notice: 'Type company was successfully created.' }\n format.json { render :show, status: :created, location: @type_company }\n else\n format.html { render :new }\n format.json { render json: @type_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company_name = CompanyName.new(company_name_params)\n\n respond_to do |format|\n if @company_name.save\n format.html { redirect_to @company_name, notice: 'Company name was successfully created.' }\n format.json { render :show, status: :created, location: @company_name }\n else\n format.html { render :new }\n format.json { render json: @company_name.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company_owner = CompanyOwner.new(company_owner_params)\n\n respond_to do |format|\n if @company_owner.save\n format.html { redirect_to @company_owner, notice: 'Company owner was successfully created.' }\n format.json { render action: 'show', status: :created, location: @company_owner }\n else\n format.html { render action: 'new' }\n format.json { render json: @company_owner.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @main_company = MainCompany.new(main_company_params)\n\n respond_to do |format|\n if @main_company.save\n format.html { redirect_to @main_company, notice: 'Main company was successfully created.' }\n format.json { render :show, status: :created, location: @main_company }\n else\n format.html { render :new }\n format.json { render json: @main_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @listed_company = ListedCompany.new(listed_company_params)\n\n respond_to do |format|\n if @listed_company.save\n format.html { redirect_to listed_companies_path, notice: 'Listed company was successfully created.' }\n format.json { render :show, status: :created, location: @listed_company }\n else\n format.html { render :new }\n format.json { render json: @listed_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_new_company\n @new_company = NewCompany.find(params[:id])\n end",
"def create\n\t\t@company = Company.new(params[:company].merge({:by_user_id => current_user.id}))\n\t\tmake_breadcrumbs\n\n\t\trespond_to do |format|\n\t\t\tif @company.save\n\t\t\t\tformat.html { redirect_to @company, notice: t('app.companies.created') }\n\t\t\t\tformat.json { render json: @company, status: :created, location: @company }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @company.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def create\n company = Company.find_by_id(params[:company_id])\n company_logo = company.image_logo\n company_name = company.name \n\n \n @company_order = CompanyOrder.new(company_order_params)\n\n if @company_order.save\n render json: @company_order, status: :created, location: @company_order\n else\n render json: @company_order.errors, status: :unprocessable_entity\n end\n end",
"def create\n @company = Company.new(company_params)\n @company.tipo = '01'\n if @company.save \n render json: { status: :created }\n else\n render json: @company.errors, status: :unprocessable_entity\n end\n end",
"def create\n @company = Company.new(company_params)\n\n respond_to do |format|\n if @company.save\n format.json { render :show, status: :created, location: @company }\n SignUpNotifier.registrated(@company).deliver\n else\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.new(params[:user])\n @user.company = current_company\n create!\n end",
"def create\n @group_company = GroupCompany.new(group_company_params)\n\n respond_to do |format|\n if @group_company.save\n format.html { redirect_to @group_company, notice: 'Group company was successfully created.' }\n format.json { render :show, status: :created, location: @group_company }\n else\n format.html { render :new }\n format.json { render json: @group_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @companyreg = Companyreg.new(companyreg_params)\n\n respond_to do |format|\n if @companyreg.save\n format.html { redirect_to @companyreg, notice: 'Companyreg was successfully created.' }\n format.json { render :show, status: :created, location: @companyreg }\n else\n format.html { render :new }\n format.json { render json: @companyreg.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @contact_company = ContactCompany.new(contact_company_params)\n\n respond_to do |format|\n if @contact_company.save\n format.html { redirect_to @contact_company, notice: 'Contact company was successfully created.' }\n format.json { render action: 'show', status: :created, location: @contact_company }\n else\n format.html { render action: 'new' }\n format.json { render json: @contact_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @company = Company.find_or_create_by(name: 'New Company')\n begin\n @company.save!\n rescue\n flash[:error] = \"Company NOT be found or was not created.\"\n nil\n end\n @address = @company.addresses.find_or_create_by( {addressable_type: 'Company', addressable_id: @company.id} )\n @address.save!\n end",
"def create\n @admin_company_detail = Admin::CompanyDetail.new(params[:admin_company_detail])\n\n respond_to do |format|\n if @admin_company_detail.save\n #format.html { redirect_to @admin_company_detail, :notice => 'Company detail was successfully created.' }\n format.html { redirect_to :action => :index, :notice => 'Company detail was successfully created.' }\n format.json { render :json => @admin_company_detail, :status => :created, :location => @admin_company_detail }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @admin_company_detail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n\n respond_to do |format|\n if @company_business.save\n format.html { redirect_to @company_business, notice: 'Company business was successfully created.' }\n format.json { render json: @company_business, status: :created, location: @company_business }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company_business.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @guarantee_company = GuaranteeCompany.new(guarantee_company_params)\n\n respond_to do |format|\n if @guarantee_company.save\n format.html { redirect_to @guarantee_company, notice: 'Guarantee company was successfully created.' }\n format.json { render action: 'show', status: :created, location: @guarantee_company }\n else\n format.html { render action: 'new' }\n format.json { render json: @guarantee_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gas_company = GasCompany.new(gas_company_params)\n\n respond_to do |format|\n if @gas_company.save\n format.html { redirect_to admins_gas_company_path(@gas_company), notice: 'Gas company was successfully created.' }\n format.json { render :show, status: :created, location: @gas_company }\n else\n format.html { render :new }\n format.json { render json: @gas_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(params[:company])\n @profile = Profile.new\n\n respond_to do |format|\n if @company.save\n @profile.company = @company\n @profile.user = current_user\n @profile.save\n\n @role = Role.new\n @role.name = @company.name + \"_admin\"\n @role.client_id = CLIENT_ID\n @role.save\n\n @resource = Resource.new \n @resource.name = \"^/companies/\" + @company.id.to_s + \"($|/.*$)\" \n @resource.client_id = CLIENT_ID\n @resource.save\n\n @role.add_to_resource(@resource)\n @role.add_to_subject(Subject.find(current_user.preallowed_id)) \n \n flash[:notice] = 'Company was successfully created.'\n format.html { redirect_to(@company) }\n format.xml { render :xml => @company, :status => :created, :location => @company }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @company_investor = CompanyInvestor.new(company_investor_params)\n\n end",
"def companycreation_params\n params.require(:companycreation).permit(:companyname)\n end",
"def create\n @company = Company.new\n @company.name = params[:new_company][:name]\n @company.slug = @company.name.parameterize\n @company.state = COMPANY_STATE[:unchecked]\n @user = User.new\n if @company.save\n @user = @company.users.build\n @user.email = params[:new_company][:email]\n @user.name = t(:root)\n @user.state = STATE[:unchecked]\n @user.role = ROOT\n @user.password_digest = 0\n @user.locale = I18n.locale\n if @user.save\n UserMailer.verification_email(@user).deliver\n flash[:success] = t(:company_account_created)\n redirect_to company_signin_path @company.id\n else\n @company.destroy\n render 'new'\n end\n else\n render 'new'\n end\n end",
"def create\n @intelcompany = IntelCompany.new(intelcompany_params)\n\n if @intelcompany.save\n render json: @intelcompany, status: :created, location: @intelcompany\n else\n render json: @intelcompany.errors, status: :unprocessable_entity\n end\n\n end",
"def create\n @rail_company = RailCompany.new(rail_company_params)\n\n respond_to do |format|\n if @rail_company.save\n format.html { redirect_to @rail_company, notice: 'Rail company was successfully created.' }\n format.json { render action: 'show', status: :created, location: @rail_company }\n else\n format.html { render action: 'new' }\n format.json { render json: @rail_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @az_company = AzCompany.new(params[:az_company])\n #admin = AzUser.find_by_login('admin')\n user = @az_company.ceo\n #@az_company.ceo = admin\n ret = @az_company.save\n if ret\n\n if Integer(params[:az_company][:wo_ceo_co_create]) != 1\n @az_company.add_employee(user) \n end\n\n if Integer(params[:az_company][:create_default_content_co_create]) == 1\n @az_company.create_default_content\n end\n end\n respond_to do |format|\n if ret\n flash[:notice] = 'AzCompany was successfully created.'\n format.html { redirect_to(@az_company) }\n format.xml { render :xml => @az_company, :status => :created, :location => @az_company }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @az_company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @company = Company.new(nested_params)\n respond_to do |format|\n if @company.save\n format.html { redirect_to @company, notice: 'Company was successfully created.' }\n format.json { render :show, status: :created, location: @company }\n else\n format.html { render :new }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @admin_company_type = Admin::CompanyType.new(admin_company_type_params)\n\n respond_to do |format|\n if @admin_company_type.save\n format.html { redirect_to @admin_company_type, notice: 'Company type was successfully created.' }\n format.json { render action: 'show', status: :created, location: @admin_company_type }\n else\n format.html { render action: 'new' }\n format.json { render json: @admin_company_type.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.8303029",
"0.8127907",
"0.807158",
"0.80383486",
"0.8025331",
"0.7981589",
"0.79738605",
"0.78923965",
"0.78797215",
"0.78650695",
"0.78329533",
"0.78236306",
"0.78170335",
"0.78170335",
"0.78170335",
"0.78170335",
"0.78170335",
"0.78029746",
"0.77784824",
"0.77784824",
"0.77784824",
"0.77784824",
"0.7778154",
"0.7764468",
"0.77420783",
"0.7739091",
"0.7733489",
"0.7721773",
"0.7720572",
"0.7706387",
"0.77042776",
"0.7699085",
"0.767033",
"0.76694083",
"0.7656502",
"0.7640618",
"0.76320446",
"0.76320446",
"0.76320446",
"0.7629874",
"0.75993174",
"0.7597396",
"0.75680745",
"0.756665",
"0.75632334",
"0.75631654",
"0.75631654",
"0.7561216",
"0.7547599",
"0.75070643",
"0.7480463",
"0.74578726",
"0.7454968",
"0.7452327",
"0.74494",
"0.7447161",
"0.7429981",
"0.74096894",
"0.73925096",
"0.73913336",
"0.73897237",
"0.7379359",
"0.7340301",
"0.732103",
"0.73150873",
"0.73118013",
"0.7306546",
"0.7296226",
"0.7294175",
"0.7270853",
"0.7270769",
"0.7268874",
"0.72675055",
"0.7265378",
"0.7265134",
"0.7244306",
"0.7243367",
"0.722878",
"0.7195703",
"0.7184394",
"0.7181695",
"0.71804315",
"0.7168336",
"0.7166622",
"0.7165151",
"0.71625507",
"0.7153834",
"0.71518743",
"0.7149441",
"0.7148792",
"0.7146104",
"0.71256053",
"0.71211076",
"0.71201706",
"0.7113283",
"0.7113115",
"0.71123177",
"0.71096075",
"0.71047777",
"0.7103126"
] |
0.7542614
|
49
|
Edit action retrives the company and renders the edit page
|
def edit
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def edit\n @company = Company.find(params[:id])\n end",
"def edit\n\t\t@roaster = Roaster.find(session[:roaster_id])\n\t\tif admin?\n\t\t\t@company = Company.find(params[:id])\n\t\telsif @roaster.company_id == params[:id]\n\t\t\t@company = Company.find(params[:id])\n\t\telse\n\t\t\tredirect_to beanformed_companies_path\n\t\tend\n\tend",
"def edit\n respond_with(@company)\n end",
"def edit\n @company = Company.find_by_uuid(current_user.company.uuid)\n end",
"def edit\n @company = Company.find( params[:company_id] )\n @user = @company.users.find( params[:id])\n end",
"def update\n @company = Company.find(params[:id])\n\n if @company.update_attributes(params[:company])\n flash[:success] = @company.name + \" was successfully updated.\"\n redirect_to crm_path\n else\n @title = \"Edit \" + @company.name\n render 'edit'\n end\n end",
"def update\n\t\t@company = Company.find(params[:id])\n\t\tmake_breadcrumbs\n\n\t\trespond_to do |format|\n\t\t\tif @company.update_attributes(params[:company])\n\t\t\t\tformat.html { redirect_to @company, notice: t('app.companies.updated') }\n\t\t\t\tformat.json { head :ok }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"edit\" }\n\t\t\t\tformat.json { render json: @company.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def show\n @company = Company.find(params[:company_id])\n end",
"def update\n\t\tif @company.update_attributes(company_params)\n\t\t\tflash[:notice] = \"Successfully updated company!\"\n\t\t\tredirect_to company_path(@company)\n\t\telse\n\t\t\tflash[:alert] = \"Error updating company!\"\n\t\t\trender :edit\n\t\tend\n\tend",
"def edit\n @company = current_user.companies.find(params[:company_id])\n @memberships = @company.company_memberships.all\n end",
"def update\n if @company.update(company_params)\n flash[:success] = \"Company was successfully updated.\"\n redirect_to company_url(@company)\n else\n flash[:error] = @company.errors.full_messages.join(\" and \")\n render \"edit\"\n end\n end",
"def update\r\n @company = Company.find(params[:id])\r\n \r\n respond_to do |format|\r\n if @company.update_attributes(params[:company])\r\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @company.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n company = Company.find(params[:id]) if params[:id].present?\n if company.present? && params[:company].present?\n company.attributes = params[:company] \n updated_attributes = company.changes\n @log_msg = \"Company \" + company.id.to_s + \" details \" + updated_attributes.to_s + \" updated by user \" + current_user.id.to_s if company.save\n\n return render :partial => 'layouts/conditional_popup_display', :locals => {:partial_tobe_rendered => \"companies/overview\", :partial_locals => overiew_params_for_company(company.id), :modal_id => \"updatedetails\", :button_caption => params[:commit] }\n end\n end",
"def update\n @company = current_user.companies.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n flash[:notice] = 'Company was successfully updated.'\n format.html { redirect_to(@company) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to companies_path, notice: 'Общая информация о компании успешно отредактирована' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(COMPANY_ID)\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to administration_company_path(@company), notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n Rails.logger.info \"******\\n\\n\\nCompany: #{params[:company]}***********\\n\\n\\n\"\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to(@company, :notice => 'Company was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to(@company, :notice => 'Company was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def company\n @company ||= Company.find(params[:id])\n end",
"def update\n @title = \"Update Company\"\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n flash[:notice] = 'Company was successfully updated.'\n format.html { redirect_to(@company) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to(@company, :notice => 'Company was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n if @company.update(company_params)\n redirect_to @company, notice: \"Company was successfully updated.\"\n else\n render :edit, status: :unprocessable_entity\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n flash[:notice] = 'Company was successfully updated.'\n format.html { redirect_to(@company) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @asset_company = AssetCompany.find(params[:id]) \n respond_to do |format|\n if @asset_company.update_attributes(params[:asset_company])\n flash[:notice] = \"#{@asset_company.company_name} was successfully updated\"\n format.html { redirect_to(:action=>'show', :id => @asset_company.id ) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @asset_company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def get_company\n @company = Company.find(params[:company_id])\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to @company, :notice => 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html {\n redirect_to @company, notice: 'Company was successfully updated.'\n }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json {\n render json: @company.errors, status: :unprocessable_entity\n }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html {redirect_to action: :index, notice: 'Company was successfully updated.'}\n format.json {render :show, status: :ok, location: @company}\n else\n format.html {render :edit}\n format.json {render json: @company.errors, status: :unprocessable_entity}\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to companies_path, notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @admin_company_detail = Admin::CompanyDetail.find(params[:id])\n\n respond_to do |format|\n if @admin_company_detail.update_attributes(params[:admin_company_detail])\n format.html { redirect_to @admin_company_detail, :notice => 'Company detail was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @admin_company_detail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n\t\t@company = Company.find(params[:id])\n\t\t@company.update(company_params)\n\t\tredirect_to company_path(@company)\n\tend",
"def index\n @company = current_company\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n add_to_log(t('Company updated log') + @company.name,\"companies\",\"update\")\n flash[:notice] = t('Company updated')\n format.html { redirect_to(@company) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @new_company.update(new_company_params)\n format.html { redirect_to @new_company, notice: 'Вы успешно отредактировали компанию' }\n format.json { render :show, status: :ok, location: @new_company }\n else\n format.html { render :edit }\n format.json { render json: @new_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # authorize @company\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to admin_company_path(@company), notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { render action: 'show', status: :ok, location: @company }\n else\n format.html { render action: 'edit' }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @breadcrumb = 'update'\n @company = Company.find(params[:id])\n @company.updated_by = current_user.id if !current_user.nil?\n # Should use attachment from drag&drop?\n if !$attachment.avatar.blank? && $attachment.updated_at > @company.updated_at\n @company.logo = $attachment.avatar\n end\n # @company.cache_images\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n $attachment.destroy\n $attachment = nil\n format.html { redirect_to @company,\n notice: (crud_notice('updated', @company) + \"#{undo_link(@company)}\").html_safe }\n format.json { head :no_content }\n else\n @notifications = notifications_dropdown\n @users = users_dropdown\n @classes = bank_account_classes_dropdown\n @zipcodes = zipcodes_dropdown\n @towns = towns_dropdown\n @provinces = provinces_dropdown\n # @countries = countries_dropdown\n # @banks = banks_dropdown\n # @offices = bank_offices_dropdown\n $attachment.destroy\n $attachment = Attachment.new\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html {redirect_to @company, notice: 'Company was successfully updated.'}\n format.json {render :show, status: :ok, location: @company}\n else\n format.html {render :edit}\n format.json {render json: @company.errors, status: :unprocessable_entity}\n end\n end\n end",
"def update\n @ins_company = InsCompany.find(params[:id])\n\n respond_to do |format|\n if @ins_company.update_attributes(params[:ins_company])\n format.html { redirect_to @ins_company, notice: 'Ins company was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ins_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id]);\n end",
"def update\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to companies_url, notice: @company.name + ' was successfully created.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end"
] |
[
"0.84720045",
"0.79543686",
"0.79157513",
"0.7898176",
"0.76353866",
"0.7452758",
"0.710841",
"0.70802593",
"0.7077142",
"0.7071543",
"0.7069447",
"0.6996391",
"0.69850296",
"0.697513",
"0.6961961",
"0.6961909",
"0.6955674",
"0.6950118",
"0.6950118",
"0.69466066",
"0.69426185",
"0.6938558",
"0.690882",
"0.6905925",
"0.6885622",
"0.68833226",
"0.6882654",
"0.68821895",
"0.68821895",
"0.68821895",
"0.68821895",
"0.68821895",
"0.68821895",
"0.6849859",
"0.6840243",
"0.6833386",
"0.6821781",
"0.6809164",
"0.68063354",
"0.6804014",
"0.6804014",
"0.6793373",
"0.67930585",
"0.67838514",
"0.67769426",
"0.6759352",
"0.6743451",
"0.67290574",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67270344",
"0.67265826",
"0.6724583",
"0.67236066",
"0.6723513",
"0.6723513",
"0.6723513",
"0.6723513",
"0.6723513",
"0.6723513",
"0.6723513",
"0.6723513"
] |
0.0
|
-1
|
Update action updates the company with the new information
|
def update
if @company.update_attributes(company_params)
flash[:notice] = "Successfully updated company!"
redirect_to company_path(@company)
else
flash[:alert] = "Error updating company!"
render :edit
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n\t\t@company = Company.find(params[:id])\n\t\t@company.update(company_params)\n\t\tredirect_to company_path(@company)\n\tend",
"def update\n if @company.update(company_params)\n redirect_to @company, notice: \"Company was successfully updated.\"\n else\n render :edit, status: :unprocessable_entity\n end\n end",
"def update\n @company = Company.find(params[:id])\n Rails.logger.info \"******\\n\\n\\nCompany: #{params[:company]}***********\\n\\n\\n\"\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @company.update(company_params)\n flash[:success] = \"Company updated!\"\n redirect_to @company\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n if @company.update_attributes(params[:company])\n flash[:success] = @company.name + \" was successfully updated.\"\n redirect_to crm_path\n else\n @title = \"Edit \" + @company.name\n render 'edit'\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n add_to_log(t('Company updated log') + @company.name,\"companies\",\"update\")\n flash[:notice] = t('Company updated')\n format.html { redirect_to(@company) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @title = \"Update Company\"\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n flash[:notice] = 'Company was successfully updated.'\n format.html { redirect_to(@company) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n begin\n @company = Company.find(params[:id])\n detail = @@data_util.hash_data_to_upper_case(params[:company], ['description'])\n detail[:lastupdateby] = session[:username]\n\n @@request_result[:data] = detail \n @@request_result[:type] = params[:company].class \n if @company.update_attributes(detail)\n @@request_result[:success] = true\n @@request_result[:notice] = 'Company successfully updated.'\n else\n @@request_result[:errormsg] = @company.errors.full_messages[0]\n end\n rescue Exception => e\n @@request_result[:errormsg] = e.message\n end\n render json: @@request_result\n end",
"def update\n\t\t@company = Company.find(params[:id])\n\t\tif @company.update(company_params)\n\t\t\tflash[:success] = \"#{@company.name} has been updated.\"\n\t\t\tredirect_to beanformed_companies_path\n\t\telse\n\t\t\tflash[:error] = \"Update error! Please check your input fields.\"\n\t\t\tredirect_to beanformed_companies_path\n\t\tend\n\tend",
"def update\n @company = Company.find(COMPANY_ID)\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to administration_company_path(@company), notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @target_company.update(target_company_params)\n @target_company = TargetCompany.new\n @target_companies = TargetCompany.all\n\n end",
"def update\n if @company.update(company_params)\n flash[:success] = \"Company was successfully updated.\"\n redirect_to company_url(@company)\n else\n flash[:error] = @company.errors.full_messages.join(\" and \")\n render \"edit\"\n end\n end",
"def update\r\n @company = Company.find(params[:id])\r\n \r\n respond_to do |format|\r\n if @company.update_attributes(params[:company])\r\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @company.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to @company, :notice => 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to(@company, :notice => 'Company was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to companies_path, notice: 'Общая информация о компании успешно отредактирована' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html {\n redirect_to @company, notice: 'Company was successfully updated.'\n }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json {\n render json: @company.errors, status: :unprocessable_entity\n }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to(@company, :notice => 'Company was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to(@company, :notice => 'Company was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to companies_path, notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\t@company = Company.find(params[:id])\n\t\tmake_breadcrumbs\n\n\t\trespond_to do |format|\n\t\t\tif @company.update_attributes(params[:company])\n\t\t\t\tformat.html { redirect_to @company, notice: t('app.companies.updated') }\n\t\t\t\tformat.json { head :ok }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"edit\" }\n\t\t\t\tformat.json { render json: @company.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to companies_url, notice: @company.name + ' was successfully created.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n flash[:notice] = 'Company was successfully updated.'\n format.html { redirect_to(@company) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { render action: 'show', status: :ok, location: @company }\n else\n format.html { render action: 'edit' }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to @company, notice: 'Empresa foi atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = current_user.companies.find(params[:id])\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n flash[:notice] = 'Company was successfully updated.'\n format.html { redirect_to(@company) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n #format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n #format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n if @company.update_attributes(params[:company])\n UpdateMailer.update_email(@company, current_user, action_name).deliver\n flash[:notice] = 'Company was successfully updated.'\n end\n respond_with(@company)\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: t(\"updated\") }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # authorize @company\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to admin_company_path(@company), notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html {redirect_to action: :index, notice: 'Company was successfully updated.'}\n format.json {render :show, status: :ok, location: @company}\n else\n format.html {render :edit}\n format.json {render json: @company.errors, status: :unprocessable_entity}\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n if @company.update_attributes(params[:company])\n respond_with @company\n else\n respond_with @company, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @account_company.update(account_company_params)\n format.html { redirect_to @account_company, notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @account_company }\n else\n format.html { render :edit }\n format.json { render json: @account_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.json { render :show, status: :ok, location: @company }\n else\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @new_company.update(new_company_params)\n format.html { redirect_to @new_company, notice: 'Вы успешно отредактировали компанию' }\n format.json { render :show, status: :ok, location: @new_company }\n else\n format.html { render :edit }\n format.json { render json: @new_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @ins_company = InsCompany.find(params[:id])\n\n respond_to do |format|\n if @ins_company.update_attributes(params[:ins_company])\n format.html { redirect_to @ins_company, notice: 'Ins company was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ins_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n @company.infos.each do |i|\n\t i.value = params[i.key]\n\t i.save\n end\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n format.html { redirect_to @company, notice: 'Company successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html {redirect_to @company, notice: 'Company was successfully updated.'}\n format.json {render :show, status: :ok, location: @company}\n else\n format.html {render :edit}\n format.json {render json: @company.errors, status: :unprocessable_entity}\n end\n end\n end",
"def update\n company = Company.find(params[:id]) if params[:id].present?\n if company.present? && params[:company].present?\n company.attributes = params[:company] \n updated_attributes = company.changes\n @log_msg = \"Company \" + company.id.to_s + \" details \" + updated_attributes.to_s + \" updated by user \" + current_user.id.to_s if company.save\n\n return render :partial => 'layouts/conditional_popup_display', :locals => {:partial_tobe_rendered => \"companies/overview\", :partial_locals => overiew_params_for_company(company.id), :modal_id => \"updatedetails\", :button_caption => params[:commit] }\n end\n end",
"def update\n @asset_company = AssetCompany.find(params[:id]) \n respond_to do |format|\n if @asset_company.update_attributes(params[:asset_company])\n flash[:notice] = \"#{@asset_company.company_name} was successfully updated\"\n format.html { redirect_to(:action=>'show', :id => @asset_company.id ) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @asset_company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @az_company = AzCompany.find(params[:id])\n\n respond_to do |format|\n if @az_company.update_attributes(params[:az_company]) #TODO Защитить баланс!!!\n flash[:notice] = 'AzCompany was successfully updated.'\n format.html { redirect_to(@az_company) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @az_company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(company_params[:id])\n\n if @company.update(company_params)\n head :no_content\n else\n render json: @company.errors, status: :unprocessable_entity\n end\n end",
"def update\n @company = Company.find_by_uuid(current_user.company.uuid)\n if @company.update(company_params)\n flash[:success] = t('messages.default_success')\n redirect_to dashboard_url\n else\n flash[:error] = t('messages.default_error')\n render :edit\n end\n end",
"def update\n @holding_company = HoldingCompany.find(params[:id])\n\n respond_to do |format|\n if @holding_company.update_attributes(params[:holding_company])\n flash.now[:notice] = 'Holding Company berhasil diubah !'\n format.html { redirect_to(holding_companies_path) }\n format.xml { head :ok }\n else\n flash.now[:notice] = 'Holding Company tidak berhasil diubah !'\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @holding_company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n flash[:notice] = t('flash.actions.update.notice', :resource_name => Company.model_name.human) if @company.update_attributes(params[:company])\n respond_with(@company, :location => companies_path)\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Configurações da empresa alteradas com sucesso!' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Bar atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n @battalion = Battalion.find(params[:battalion_id])\n respond_to do |format|\n if @company.update_attributes(params[:company])\n flash[:notice] = 'Company was successfully updated.'\n format.html { redirect_to battalion_company_path(@battalion, @company) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @admin_company_detail = Admin::CompanyDetail.find(params[:id])\n\n respond_to do |format|\n if @admin_company_detail.update_attributes(params[:admin_company_detail])\n format.html { redirect_to @admin_company_detail, :notice => 'Company detail was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @admin_company_detail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n respond_to do |format|\n if @company.update(company_params)\n @company.email_format = nil if @company.allow_email_regex == false\n @company.save\n @company.track_company_activity(\" updated the company \")\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @lib_company = LibCompany.find(params[:id])\n\n respond_to do |format|\n if @lib_company.update_attributes(params[:lib_company])\n format.html { redirect_to(@lib_company, :notice => 'Lib company was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @lib_company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n\n params[:company][:projects_attributes][\"0\"].merge!(:user_id => current_user.id)\n respond_to do |format|\n if @company.update_attributes(params[:company])\n\tformat.html { redirect_to(@company, :notice => 'Company was successfully updated.') }\n\tformat.xml { head :ok }\n else\n\tformat.html { render :action => \"edit\" }\n\tformat.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @credit_company.update(credit_company_params)\n format.html { redirect_to @credit_company, notice: t('credit_company.updated') }\n format.json { render :show, status: :ok, location: @credit_company }\n else\n format.html { render :edit }\n format.json { render json: @credit_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @main_company.update(main_company_params)\n format.html { redirect_to @main_company, notice: 'Main company was successfully updated.' }\n format.json { render :show, status: :ok, location: @main_company }\n else\n format.html { render :edit }\n format.json { render json: @main_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client_company.update(company_params)\n format.html {redirect_to @client_company, notice: 'Company was successfully updated.'}\n format.json {render :show, status: :ok, location: @client_company}\n else\n format.html {render :edit}\n format.json {render json: @client_company.errors, status: :unprocessable_entity}\n end\n end\n end",
"def update\n @global_company = GlobalCompany.find(params[:id])\n\n respond_to do |format|\n if @global_company.update_attributes(params[:global_company])\n format.html { redirect_to @global_company, notice: 'Global company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @global_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @sp_company_info = SpCompanyInfo.find(params[:id])\n\n respond_to do |format|\n if @sp_company_info.update_attributes(sp_company_info_params)\n format.html { redirect_to \"/sp_company_infos\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sp_company_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @events_company = EventsCompany.find(params[:id])\n\n respond_to do |format|\n if @events_company.update_attributes(params[:events_company])\n format.html { redirect_to @events_company, :notice => 'Events company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @events_company.errors, :event => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Cliente actualizado con exito' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company_information.update(company_information_params)\n format.html { redirect_to @company_information, notice: 'Company information was successfully updated.' }\n format.json { render :show, status: :ok, location: @company_information }\n else\n format.html { render :edit }\n format.json { render json: @company_information.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tyc_company.update(tyc_company_params)\n format.html { redirect_to @tyc_company, notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @tyc_company }\n else\n format.html { render :edit }\n format.json { render json: @tyc_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @breadcrumb = 'update'\n @company = Company.find(params[:id])\n @company.updated_by = current_user.id if !current_user.nil?\n # Should use attachment from drag&drop?\n if !$attachment.avatar.blank? && $attachment.updated_at > @company.updated_at\n @company.logo = $attachment.avatar\n end\n # @company.cache_images\n\n respond_to do |format|\n if @company.update_attributes(params[:company])\n $attachment.destroy\n $attachment = nil\n format.html { redirect_to @company,\n notice: (crud_notice('updated', @company) + \"#{undo_link(@company)}\").html_safe }\n format.json { head :no_content }\n else\n @notifications = notifications_dropdown\n @users = users_dropdown\n @classes = bank_account_classes_dropdown\n @zipcodes = zipcodes_dropdown\n @towns = towns_dropdown\n @provinces = provinces_dropdown\n # @countries = countries_dropdown\n # @banks = banks_dropdown\n # @offices = bank_offices_dropdown\n $attachment.destroy\n $attachment = Attachment.new\n format.html { render action: \"edit\" }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #@company = Company.find(params[:id])\n #@address=Address::getrightaddress params[:address]\n @company.attributes=params[:company]\n @success=help_process\n respond_to do |format|\n if @success\n flash[:notice] = 'Company was successfully updated.'\n format.html { redirect_to(@company) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @guarantee_company.update(guarantee_company_params)\n format.html { redirect_to @guarantee_company, notice: 'Guarantee company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @guarantee_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n @company = Company.find(1)\n @puntos = @company.get_puntos()\n @employees = @company.get_employees2() \n@trucks = @company.get_trucks\n\n respond_to do |format|\n if @cout.update(cout_params)\n format.html { redirect_to @cout, notice: 'Cout was successfully updated.' }\n format.json { render :show, status: :ok, location: @cout }\n else\n format.html { render :edit }\n format.json { render json: @cout.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @biz_company = BizCompany.find(params[:id])\n\n respond_to do |format|\n if @biz_company.update_attributes(params[:biz_company])\n format.html { redirect_to @biz_company, notice: '商业品牌更新成功。' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @biz_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n respond_to do |format|\n if @company.update!(nested_params)\n format.html { redirect_to @company, notice: \"#{@company.name} Company has been updated.\" }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @company_owner.update(company_owner_params)\n format.html { redirect_to @company_owner, notice: 'Company owner was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @company_owner.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @company_business.update_attributes(params[:company_business])\n format.html { redirect_to @company_business, notice: 'Company business was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company_business.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @visit_company.update(visit_company_params)\n format.html { redirect_to @visit_company, notice: 'Visit company was successfully updated.' }\n format.json { render :show, status: :ok, location: @visit_company }\n else\n format.html { render :edit }\n format.json { render json: @visit_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(id_from_params)\n\n respond_to do |format|\n if @company.accounts.exists? current_user.account.id\n @company.accounts.delete(current_user.account)\n @company.accounts << current_user.account\n\n format.html { redirect_to root_path, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n @company.accounts << current_user.account\n format.html { redirect_to root_path, notice: 'Company was successfully updated.' }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n\n if @invoced_company.update(invoced_company_params)\n format.html { redirect_to @invoced_company, notice: t(:successfully_updated_invoced_company) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invoced_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @crunch_company = CrunchCompany.find(params[:id])\n @fetch_crunch = Crunchbase::Company.get(@crunch_company.company_name)\n @fetch_crunch_posts = @fetch_crunch.ipo\n\n respond_to do |format|\n if @crunch_company.update_attributes(params[:crunch_company])\n @crunch_company.update_attribute(:posts, @fetch_crunch_posts)\n format.html { redirect_to @crunch_company, notice: 'Crunch company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @crunch_company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @listed_company.update(listed_company_params)\n format.html { redirect_to listed_companies_path, notice: 'Listed company was successfully updated.' }\n format.json { render :show, status: :ok, location: @listed_company }\n else\n format.html { render :edit }\n format.json { render json: listed_companies_path.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.update(company_params)\n # $redis.publish('companies.update', @company.to_json)\n # render :action => 'show'\n end",
"def update\n respond_to do |format|\n if @intelcompany.update(intelcompany_params)\n format.html { redirect_to @intelcompany, notice: 'Intel company was successfully updated.' }\n format.json { render :show, status: :ok, location: @intelcompany }\n else\n format.html { render :edit }\n format.json { render json: @intelcompany.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @company = Company.find(params[:id])\n \n\t\t# logger.debug \"Hello\"\n # logger.debug params.to_yaml\n # logger.debug \"Hello\"\n # logger.debug params[\"company\"][\"code\"].upcase!\n # params[\"company\"[\"code\"]].to_upper!\n code_to_upper(params)\n \n respond_to do |format|\n if @company.update_attributes(params[:company])\n flash[:notice] = 'Company was successfully updated.'\n format.html { redirect_to(@company) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company.errors, :status => :unprocessable_entity }\n end\n end\n end"
] |
[
"0.8254352",
"0.81927496",
"0.8167805",
"0.8164558",
"0.8137533",
"0.8134285",
"0.80130804",
"0.7998484",
"0.7988416",
"0.79785246",
"0.79724103",
"0.79520226",
"0.7938241",
"0.7932582",
"0.7926068",
"0.7920895",
"0.79143786",
"0.79143786",
"0.79143786",
"0.79143786",
"0.79143786",
"0.79143786",
"0.7909645",
"0.7900664",
"0.7900664",
"0.7888194",
"0.788463",
"0.7867633",
"0.78525084",
"0.7851295",
"0.7851295",
"0.7851295",
"0.7851295",
"0.7851295",
"0.7851295",
"0.7851295",
"0.7851295",
"0.7851295",
"0.7851295",
"0.7851295",
"0.7851295",
"0.78497833",
"0.784754",
"0.783934",
"0.78375024",
"0.78305733",
"0.7816172",
"0.7808767",
"0.7807756",
"0.7807756",
"0.7797872",
"0.7797031",
"0.77835715",
"0.77749926",
"0.776403",
"0.77601355",
"0.7745125",
"0.774288",
"0.77415925",
"0.7706472",
"0.7701384",
"0.7696602",
"0.7690547",
"0.76877403",
"0.768603",
"0.76765555",
"0.7676115",
"0.766723",
"0.7658519",
"0.7608664",
"0.76082486",
"0.76022",
"0.7592281",
"0.758429",
"0.7564326",
"0.7562362",
"0.7554547",
"0.7551155",
"0.7548466",
"0.75336313",
"0.75248694",
"0.7520942",
"0.7506911",
"0.7503953",
"0.7467406",
"0.7466933",
"0.7466832",
"0.7453709",
"0.7448132",
"0.7439887",
"0.7433412",
"0.743013",
"0.7426523",
"0.7421319",
"0.74011564",
"0.73981094",
"0.7397461",
"0.7397251",
"0.7391065",
"0.73792607"
] |
0.80741525
|
6
|
The show action renders the individual company after retrieving the the id
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @company = Company.find(params[:company_id])\n end",
"def show\n @companies = Company.all\n end",
"def show\r\n @company = Company.find(params[:id])\r\n set_seo_meta(\"#{@company.name}\",\"#{Setting.app_name}#{t(\"companycommon.yellowpage\")}\")\r\n drop_breadcrumb(t(\"companies.mycompany\"))\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @company }\r\n end\r\n end",
"def show\n @company = @job_offer.company_id\n end",
"def show\n @company = set_company\n begin\n @identifiers = @company.identifiers\n rescue\n flash[:error] = 'No identifiers found.'\n end \n begin\n @address = Address.where(\"addressable_id = ? AND addressable_type = ?\", @company.id, 'Company').limit(1)\n rescue\n flash[:error] = \"No address found.\"\n end\n begin\n @people = @company.people\n rescue\n flash[:error] = \"No people are affiliated.\"\n end\n end",
"def show\n @empresa1 = Company.all\n @empresa = @empresa1.find(1)\n end",
"def show\n\t begin\n\t\t if params[:id].to_i != 0\n\t\t\t # id given\n\t\t @company = Company.find(params[:id])\n\t\t else\n\t\t\t # name given\n\t\t\t @company = Company.find_by_name(params[:id])\n\t\t end\n\t rescue Exception => e\n\t\t @company = nil\n\t\tend\n\n\t if @company.nil?\n\t\t redirect_to root_path, alert: \"This company does not exist.\"\n\t\t return\n\t end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"def show\n @company = Company.find(params[:id])\n @company_news = CompanyNews.where(company_id: @company.id )\n @vacancies = Vacancy.where(company_id: @company.id)\n @company_contacts = CompanyContact.where(company_id: @company.id)\n @company_comments = CompanyComment.where(company_id: @company.id)\n @company_clients = CompanyClient.where(company_id: @company.id)\n @company_rewiews = CompanyReview.where(company_id: @company.id)\n @company_practices = CompanyPractice.where(company_id: @company.id)\n end",
"def show\n @title = \"Show Company\"\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @company }\n end\n end",
"def show\n @company = Company.find(params[:id])\n @title = @company.name\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @company }\n end\n end",
"def show\n\n @company = Company.find(params[:id])\n\n\n \n\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @company }\n end\n end",
"def show\n\n \tbegin\n \t@company = Company.find(COMPANY_ID)\n rescue ActiveRecord::RecordNotFound\n \t@company = Company.create({:description => ''})\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end \n end",
"def show\n render json: Company.find(params[\"id\"])\n end",
"def show\n add_breadcrumb \"all\", nil, \"glyphicon-screenshot\"\n\n @company = Company.find(id_from_params)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"def show\n @company = Company.find(params[:id])\n employees_and_bio_signals\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"def show\n\t\t@company = Company.find(params[:id])\n\t\tmake_breadcrumbs\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @company }\n\t\tend\n\tend",
"def show\n @company_user = CompanyUser.find(params[:id])\n end",
"def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"def show\n @company = Company.find(params[:id])\n @clients = @company.clients\n @employees = @company.employees\n @drivers = @company.drivers\n @shipments = @company.shipments\n end",
"def show\n @company = Company.find(params[:id])\n respond_with @company\n end",
"def show\n render json: [*@company]\n end",
"def show\n @breadcrumb = 'read'\n @company = Company.find(params[:id])\n @offices = @company.offices.paginate(:page => params[:page], :per_page => per_page).order(:office_code)\n @notifications = @company.company_notifications.paginate(:page => params[:page], :per_page => per_page).order('id')\n @accounts = @company.company_bank_accounts.paginate(:page => params[:page], :per_page => per_page).order(:id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"def company\n @company ||= Company.find(params[:id])\n end",
"def show\n @ins_company = InsCompany.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ins_company }\n end\n end",
"def show\n @company = Company.find(params[:id]) if params[:id].present?\n @company_notes = Note.notes_of_company @company if @company.present?\n @active_campaigns = @company.active_campaigns if @company.present?\n session[:page_title] = \"Company Profile\"\n session[:tab_title] = \"Company Overview\"\n end",
"def show\n respond_with(@company)\n end",
"def get_company\n @company = Company.find(params[:company_id])\n end",
"def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @company }\n end\n end",
"def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @company }\n end\n end",
"def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @company }\n end\n end",
"def show\n\n @asset_company = AssetCompany.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @asset_company }\n end\n end",
"def index\n @company = current_company\n end",
"def show\n @company_user_info = CompanyUserInfo.find(params[:id])\n end",
"def index\n @companies_info = Company.display_information\n end",
"def show\n begin\n @company = Company.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n logger.error(\"Attempt to access invalid company #{params[:id]}\" )\n flash[:notice] = \"找不到id=#{params[:id]}的公司\"\n redirect_to :action => :index\n else\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @company }\n end\n end\n end",
"def show\n @holding_company = HoldingCompany.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @holding_company }\n end\n end",
"def show\n @crunch_company = CrunchCompany.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @crunch_company }\n end\n end",
"def show\n @company = Company.find(params[:id])\n\n if current_user.is_student?\n @student_file = StudentFile.find_or_initialize_by_student_id_and_applyable_id_and_applyable_type(current_user.id, @company.id, \"Company\")\n @owner = false\n elsif current_user.is_company_entity?\n @owner = (current_user.company_id == @company.id)\n end\n \n #@followed = !!Following.find_by_follower_id_and_followed_id( current_user.id, @company.user_id)\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @company }\n end\n end",
"def show\n # @company_news = CompanyNews.where(company_id: @company.id )\n @vacancies = Vacancy.where(new_company_id: @new_company.id)\n # @company_contacts = CompanyContact.where(company_id: @company.id)\n # @company_comments = CompanyComment.where(company_id: @company.id)\n # @company_clients = CompanyClient.where(company_id: @company.id)\n # @company_rewiews = CompanyReview.where(company_id: @company.id)\n @company_practices = CompanyPractice.where(new_company_id: @new_company.id)\n end",
"def show\n @job = Job.find(params[:id])\n @company = Company.find(@job.company_id)\n end",
"def show\n company = Company.find_by_id(params[:id])\n if company.blank?\n render(\n json: {\n error: {\n code: 404,\n message: \"Company not found\",\n errors: {\n message: \"Company not found\"\n }\n }\n })\n return\n end\n\n render json: {\n data: {\n kind: Company.name,\n id: company.id,\n company: company.as_json(include: :industry)\n }\n }\n end",
"def render_company_info(company = resource.company)\n partial :sidebar_company_info, :locals => {:company => company}\n end",
"def show\n @biz_company = BizCompany.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @biz_company }\n end\n end",
"def show\n\t\t@company = Company.find(params[:id])\n\t\trespond_to do |format|\n\t\t\tformat.html do\n\t\t\t\tredirect_to root_path\n\t\t\tend\n\t\t\tformat.pdf do\n\t\t\t\tpdf = CompanyPdf.new(@company)\n\t\t\t\tsend_data pdf.render,\tfilename: \"informacion_#{@company.company_name}.pdf\",\n\t\t\t\t\ttype: \"application/pdf\",\n\t\t\t\t\tdisposition: \"inline\"\n\t\t\tend\n\t\tend\n\tend",
"def show\n\n @company = Company.find(1)\n @trucks = @company.get_trucks()\n @employees = @company.get_employees()\n end",
"def show\n\n\t\t# Check if a ID paramaters is recevied\n \t\tif params.has_key?(:id) \n\n \t\t\t# Check if the ID exists in the company table\n\t\t\tif is_valid_id params[:id].to_i\n\n\n\t\t\t\tsession[:comp_id] = params[:id]\n\t\t\t\t@user = User.find(@company.user_id)\n\n\t\t\t# If not then redirect to login\n\t\t\telse\n\t\t\t\tredirect_to login_path\n\t\t\tend\n\t\t# If not then redirect to login\n\t\telse\n\t\t\tredirect_to login_path\n\t\tend\n\tend",
"def show\n render json: @company\n end",
"def show\n\n\n @company = Company.find(1)\n\n @trucks = @company.get_trucks\n\n @employees = @company.get_employees2() \n @puntos = @company.get_puntos()\n end",
"def show\n @company = current_user.companies.find(params[:company_id])\n @report = @company.labors.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @report }\n end\n end",
"def show\n @company_account = CompanyAccount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @company_account }\n end\n end",
"def show\n @order = Order.find(params[:id])\n #TODO comnpany se debe sacar de la informacion del order\n \n @company = current_user.companies ? current_user.companies.first : nil || Company.new\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @order }\n end\n end",
"def edit\n @company = Company.find_by_uuid(current_user.company.uuid)\n end",
"def show\n @company =Company.find_by(user_id: params[:user_id])\n render json:\n @company\n \n end",
"def show\n @entity = Entity.find(params[:id])\n session[:entity_id] = @entity.id\n session[:company_id] = @entity.company.id.to_i\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @entity }\n end\n end",
"def show\n @az_company = AzCompany.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @az_company }\n end\n end",
"def show\n @current_coa = Coa.find(params[:id])\n @companies = @current_coa.companies\n @categories = Category.all\n @scales = Scale.all\n Company.eager_load(:answers)\n calc_company_score()\n \n render :partial => \"companies\"\n end",
"def edit\n @company = Company.find(params[:id])\n end",
"def show\n @lib_company = LibCompany.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lib_company }\n end\n end",
"def show\n @events_company = EventsCompany.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @events_company }\n end\n end",
"def show\n @company = Company.find(params[:id])\n\n # if @company.jobs.count != 0\n # redirect_to job_portal_path(Job.first.id)\n # else\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n # end\n end",
"def show\n @sp_company_info = SpCompanyInfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sp_company_info }\n end\n end",
"def show\n @title = @company.titles.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @title }\n end\n end",
"def show\n @contact = Contact.find(params[:id])\n @company = @contact.company\n @company = Company.new if !@company\n @company_path_ = @company.id ? company_path(@company) : \" \"\n restrict_access(\"contacts\") if @contact.firm_id != @firm.id\n end",
"def show\n respond_to do |format|\n format.html # show.html.haml\n format.xml { render :xml => @company }\n end\n end",
"def set_company\n @company = Company.friendly.find(params[:id])\n end",
"def set_company\n Company.find(params[:id])\n end",
"def show\n @companyprofile = Companyprofile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @companyprofile }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"def show\n @part_company = PartCompany.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @part_company }\n end\n end",
"def show\n @company_profile = CompanyProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @company_profile }\n end\n end",
"def set_company\n @company = Company.find(params[:id]);\n end",
"def show\n @company = Company.find(params[:company_id])\n @payment = Payment.new \n end",
"def show\n @noteable = @company\n @note = @company.notes.new\n @notes = @company.notes.order(\"created_at desc\")\n\n @tab_name = \"companies\"\n @page_title = \"#{@company.name}\"\n @page_subtitle = \"Connected on #{@company.created_at.strftime(\"%b %e, %Y\")}\"\n @page_description = \"\"\n\n add_breadcrumb \"Companies\", companies_path, :title => \"#{@community.name} Companies\"\n add_breadcrumb \"#{@company.name}\", company_path(@company), :title => \"#{@company.name} with #{@community.name}\"\n end",
"def show\n company = Company.find(1)\n @suppliers = company.get_suppliers\n @telecredito_details = @telecredito.telecredito_details\n\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def show\n @company = Company.find(params[:id])\n @company_boats = @company.boats\n end",
"def show\n @news_company = NewsCompany.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @news_company }\n end\n end",
"def show\n @company = Company.find(params[:id])\n @company.projects.build\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @company }\n end\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end",
"def set_company\n @company = Company.find(params[:id])\n end"
] |
[
"0.8319527",
"0.77378297",
"0.77033097",
"0.7667692",
"0.755856",
"0.75167996",
"0.7502622",
"0.7499609",
"0.7493004",
"0.7480807",
"0.746824",
"0.7455381",
"0.743616",
"0.7433101",
"0.74198264",
"0.740923",
"0.7402561",
"0.7391672",
"0.7391672",
"0.7391672",
"0.7391672",
"0.7391672",
"0.7391672",
"0.73863095",
"0.73834574",
"0.7346942",
"0.7330376",
"0.7327146",
"0.73209125",
"0.7309638",
"0.73059636",
"0.73017025",
"0.72924703",
"0.72924703",
"0.72924703",
"0.7287495",
"0.72817075",
"0.72786677",
"0.72750086",
"0.72547126",
"0.7249762",
"0.72269934",
"0.7222097",
"0.72198594",
"0.72030437",
"0.71787745",
"0.716687",
"0.71616536",
"0.7159707",
"0.7149174",
"0.7145935",
"0.71347654",
"0.71218145",
"0.71175545",
"0.7116274",
"0.71116096",
"0.7085456",
"0.7054991",
"0.70403355",
"0.70358473",
"0.7028577",
"0.70239997",
"0.70185494",
"0.6980086",
"0.69439554",
"0.69345266",
"0.6924297",
"0.69190276",
"0.69070137",
"0.6905856",
"0.69017744",
"0.6864033",
"0.68547493",
"0.685304",
"0.684072",
"0.68367296",
"0.68325025",
"0.6829469",
"0.68289095",
"0.68265116",
"0.68265116",
"0.68265116",
"0.68265116",
"0.68265116",
"0.68265116",
"0.68265116",
"0.68265116",
"0.68255705",
"0.6825276",
"0.6823852",
"0.68153894",
"0.6815172",
"0.6815172",
"0.6815172",
"0.6815172",
"0.6815172",
"0.6815172",
"0.6815172",
"0.6815172",
"0.6815172",
"0.6815172"
] |
0.0
|
-1
|
The destroy action removes the company permanently from the database
|
def destroy
if @company.destroy
flash[:notice] = "Successfully deleted company!"
redirect_to companies_path
else
flash[:alert] = "Error updating company!"
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @intelcompany.destroy\n end",
"def destroy\n @company.destroy\n redirect_to(companies_url)\n end",
"def destroy\n @company.destroy\n\n head :no_content\n end",
"def destroy\n @company.destroy\n redirect_to companies_url, notice: \"Company was successfully destroyed.\"\n end",
"def destroy\n\t\t@company = Company.find(params[:id])\n\t\t@company.destroy\n\t\tredirect_to beanformed_companies_path\n\tend",
"def destroy\n @company.destroy\n flash[:success] = \"Company deleted!\"\n redirect_to companies_path\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n flash[:success] = \"Company was successfully deleted.\"\n redirect_to crm_path\n end",
"def destroy\n @company = Company.find(params[:id])\n\n respond_to do |format|\n if @company.destroy\n format.html { redirect_to companies_url,\n notice: (crud_notice('destroyed', @company) + \"#{undo_link(@company)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { redirect_to companies_url, alert: \"#{@company.errors[:base].to_s}\".gsub('[\"', '').gsub('\"]', '') }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n # Admin only\n if !current_user.admin?\n redirect_to projects_path, :alert => \"Access denied.\" and return\n end\n # Set to false the value of the company_admin\n @admins = User.all.where(company_admin: true).where(company_id: @company.id)\n @admins.each do |admin|\n admin.update_attribute(:company_admin, false)\n end\n # Delete the company attribute of the company's members\n @users = @company.users\n @users.each do |user|\n user.update_attribute(:company_id, nil)\n end\n # Delete the company\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @company = Company.find(params[:id])\r\n @company.destroy\r\n respond_to do |format|\r\n format.html { redirect_to(admincompany_manage_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n add_to_log(t('Company destroy log') + @company.name,\"companies\",\"destroy\")\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n Company.transaction do\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end\n end",
"def destroy\n###### @company.destroy\n @company.active = false\n @company.save\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'company was successfully INACTIVATED.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n\t\t@company = Company.find(params[:id])\n\t\t@company.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to companies_url }\n\t\t\tformat.json { head :ok }\n\t\tend\n\tend",
"def destroy\n if @company.destroy()\n render json: { :message => \"Success!\" }\n else\n render json: { :message => \"La zona no pudo ser eliminada\" }\n end\n end",
"def destroy\n # this automatically removes the entries in the asset_company_notes table of the asset_company being destroyed\n @asset_company = AssetCompany.find(params[:id])\n @asset_company.destroy\n\n flash[:notice] = \"#{@asset_company.company_name} was successfully deleted\"\n respond_to do |format|\n session[:after_destroy_asset_company] = \"yes\"\n format.html { redirect_to(:controller => 'admin', :action => 'logout') }\n format.xml { head :ok }\n end\n end",
"def destroy\n @company = set_company\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_path, notice: \"#{@company.name} has been deleted.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company = Company.find(id_from_params)\n @company.accounts.delete(current_user.account)\n #current_user.companies.delete(@company)\n #@company.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @target_company.destroy\n @target_companies = TargetCompany.all\n\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_path, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company = current_user.companies.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @guarantee_company.destroy\n respond_to do |format|\n format.html { redirect_to guarantee_companies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_company_detail = Admin::CompanyDetail.find(params[:id])\n @admin_company_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_company_details_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @company_type.destroy\n\n head :no_content\n end",
"def destroy\n @title = \"Destroy Company\"\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @company_authority.destroy\n\n head :no_content\n end",
"def destroy\n @account_company.destroy\n respond_to do |format|\n format.html { redirect_to account_companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to(companies_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @company = set_company\n if @company.destroy \n head :no_content\n # format.html { redirect_to categories_url, notice: \"Category was successfully destroyed.\" }\n else\n render json: {error: @companies.error.messege }\n end\n end",
"def destroy\r\n @company = Company.find(params[:id])\r\n @company.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to companies_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: t(\"company_destroyed\") }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @rail_company.destroy\n respond_to do |format|\n format.html { redirect_to rail_companies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n UpdateMailer.update_email(@company, current_user, action_name).deliver\n flash[:notice] = 'Company was successfully deleted.'\n respond_with(@company)\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n @companies = Company.all\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Company was successfully destroyed.' }\n format.json {render json: {message: @companies}, status: 200}\n end\n end",
"def destroy\n @biz_company = BizCompany.find(params[:id])\n @biz_company.destroy\n\n respond_to do |format|\n format.html { redirect_to biz_companies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ins_company = InsCompany.find(params[:id])\n @ins_company.destroy\n\n respond_to do |format|\n format.html { redirect_to ins_companies_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @credit_company.destroy\n respond_to do |format|\n format.html { redirect_to credit_companies_url, notice: t('credit_company.destroyed') }\n format.json { head :no_content }\n end\n end",
"def destroy\n\n @company.destroy\n authorize @company\n respond_to do |format|\n format.html { redirect_to admin_companies_path, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @business_company.destroy\n respond_to do |format|\n format.html { redirect_to business_companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @crunch_company = CrunchCompany.find(params[:id])\n @crunch_company.destroy\n\n respond_to do |format|\n format.html { redirect_to crunch_companies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @global_company = GlobalCompany.find(params[:id])\n @global_company.destroy\n\n respond_to do |format|\n format.html { redirect_to global_companies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @listed_company.destroy\n respond_to do |format|\n format.html { redirect_to listed_companies_url, notice: 'Listed company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @new_company.destroy\n respond_to do |format|\n format.html { redirect_to new_companies_url, notice: 'New company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gas_company.destroy\n respond_to do |format|\n format.html { redirect_to admins_gas_companies_url, notice: 'Gas company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company = Company.find(params[:id])\n @company.destroy\n\n flash[:notice] = \"company deleted\" \n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n #format.html { redirect_to companys_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @main_company.destroy\n respond_to do |format|\n format.html { redirect_to main_companies_url, notice: 'Main company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Компания успешно удалена' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html {redirect_to companies_url, notice: 'Company was successfully destroyed.'}\n format.json {head :no_content}\n end\n end",
"def destroy\n @hiring_company.destroy\n respond_to do |format|\n format.html { redirect_to hiring_companies_url, notice: 'Hiring company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html {redirect_to companies_url, notice: 'Company was successfully destroyed.'}\n format.json {head :no_content}\n end\n end",
"def destroy\n @company_business.destroy\n\n respond_to do |format|\n format.html { redirect_to company_businesses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @az_company = AzCompany.find(params[:id])\n @az_company.destroy\n\n respond_to do |format|\n format.html { redirect_to(:back) }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Person was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @production_company.destroy\n respond_to do |format|\n format.html { redirect_to production_companies_url, notice: 'Production company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tyc_company.destroy\n respond_to do |format|\n format.html { redirect_to tyc_companies_url, notice: 'Company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @visit_company.destroy\n respond_to do |format|\n format.html { redirect_to visit_companies_url, notice: 'Visit company was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@company = Company.find_by_slug(params[:id])\n @company.destroy\n\n respond_to do |format|\n format.html { redirect_to companies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.html { redirect_to companies_url, notice: 'Cliente eliminado con exito' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @companyreg.destroy\n respond_to do |format|\n format.html { redirect_to companyregs_url, notice: 'Companyreg was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company = companies_scope.find(params[:id])\n\n respond_to do |format|\n format.html {\n if @company.destroy\n redirect_to companies_url, notice: I18n.t('commons.successfully_deleted')\n else\n redirect_to companies_url, alert: @company.errors.full_messages.first\n end\n }\n end\n end",
"def destroy\n @lib_company = LibCompany.find(params[:id])\n @lib_company.destroy\n\n respond_to do |format|\n format.html { redirect_to(lib_companies_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @company_account = CompanyAccount.find(params[:id])\n @company_account.destroy\n\n respond_to do |format|\n format.html { redirect_to company_accounts_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @companycreation.destroy\n respond_to do |format|\n format.html { redirect_to companycreations_url, notice: 'Companycreation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n begin\n @company = Company.find(params[:id])\n if @company.destroy\n @@request_result[:success] = true\n @@request_result[:notice] = 'Operation ended successfully.'\n else\n @@request_result[:errormsg] = @company.errors.full_messages[0]\n end\n rescue Exception => e\n @@request_result[:errormsg] = e.message\n @@request_result[:errorcode] = e.code\n end\n render json: @@request_result\n end"
] |
[
"0.86034006",
"0.8572705",
"0.8494708",
"0.84766626",
"0.83959895",
"0.83357334",
"0.8330473",
"0.8252475",
"0.815262",
"0.81016177",
"0.8101401",
"0.80640364",
"0.80359054",
"0.80227053",
"0.80147207",
"0.79973376",
"0.7991117",
"0.79716605",
"0.7946429",
"0.793928",
"0.7935166",
"0.7906457",
"0.78811693",
"0.7877439",
"0.7864355",
"0.7861232",
"0.7861232",
"0.7861232",
"0.7861232",
"0.7861232",
"0.7861232",
"0.7861232",
"0.7860493",
"0.78553134",
"0.7852689",
"0.7848889",
"0.78227377",
"0.78204685",
"0.78204685",
"0.78204685",
"0.78204685",
"0.78204685",
"0.78204685",
"0.78204685",
"0.78204685",
"0.78204685",
"0.78204685",
"0.7810481",
"0.7810249",
"0.7810249",
"0.7810249",
"0.7810249",
"0.7810249",
"0.7810249",
"0.7810249",
"0.7810249",
"0.7810249",
"0.7810249",
"0.7810249",
"0.7810249",
"0.7810249",
"0.78084695",
"0.7805944",
"0.779921",
"0.77908826",
"0.77908826",
"0.77908826",
"0.7786387",
"0.7785887",
"0.7773594",
"0.7771567",
"0.77641064",
"0.7749914",
"0.7748885",
"0.77460605",
"0.7743748",
"0.7738716",
"0.7733161",
"0.77037966",
"0.7701994",
"0.7693548",
"0.76933867",
"0.7681969",
"0.766644",
"0.7666109",
"0.7665992",
"0.7664293",
"0.76619107",
"0.7657567",
"0.7641959",
"0.76329833",
"0.76320434",
"0.76129967",
"0.76067126",
"0.7590738",
"0.75760764",
"0.75655514",
"0.75619787",
"0.756191",
"0.7557282"
] |
0.8540976
|
2
|
GET /proposals/passed GET /proposals/passed.json
|
def passed
# the non-preliminary ones go first
@proposals = Proposal.select{ |p| p.committee.preliminary == false and p.status == 'Passed'}
@proposals += Proposal.select{ |p| p.committee.preliminary == true and p.status == 'Passed'}
respond_to do |format|
format.html # passed.html.erb
format.json { render json: @proposals }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @proposals = listing.proposals\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proposals }\n end\n end",
"def index\n @proposals = current_user.proposals\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proposals }\n end\n end",
"def index\n @proposals = Proposal.all\n\n render json: @proposals\n end",
"def index\n @proposals = current_user.proposals\n end",
"def index\n @proposals = Proposal.all()\n end",
"def show\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proposal }\n end\n end",
"def show\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proposal }\n end\n end",
"def print_proposals\n puts \"____________\"\n puts \"Proposals\"\n sent_proposals.each_with_index do |proposed, i|\n puts \"#{i} => #{proposed}\"\n end\n puts \"____________\"\n end",
"def responses\n @proposal = current_user.proposals.find(params[:id])\n @responses = @proposal.responses\n\n respond_to do |format|\n format.html # responses.html.erb\n format.xml { render :xml => @responses }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proposal }\n end\n end",
"def new\n @proposal = listing.proposals.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proposal }\n end\n end",
"def update\n @proposal = listing.proposals.find(params[:id])\n\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @votes = @proposal.votes\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @votes }\n end\n end",
"def gov_proposals_get(opts = {})\n data, _status_code, _headers = gov_proposals_get_with_http_info(opts)\n data\n end",
"def new\n @proposal = Proposal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proposal }\n end\n end",
"def new\n @proposal = Proposal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proposal }\n end\n end",
"def new\n @proposal = Proposal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proposal }\n end\n end",
"def gov_proposals_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: GovernanceApi.gov_proposals_get ...'\n end\n # resource path\n local_var_path = '/gov/proposals'\n\n # query parameters\n query_params = {}\n query_params[:'voter'] = opts[:'voter'] if !opts[:'voter'].nil?\n query_params[:'depositor'] = opts[:'depositor'] if !opts[:'depositor'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<TextProposal>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GovernanceApi#gov_proposals_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n respond_to do |format|\n if @proposal.accepted == true\n format.html { redirect_to @proposal, notice: 'The Proposal Can Not Be Changed After It Has Been Assigned' }\n end\n unless params[:proposal][:bts].nil? || params[:proposal][:bts].count == 0\n @proposal.bts.clear\n params[:proposal][:bts].each do |bt|\n @proposal.bts << bt\n end\n end\n unless params[:proposal][:focus_points].nil? || params[:proposal][:focus_points].count == 0\n @proposal.focus_points.clear\n params[:proposal][:focus_points].each do |fp|\n @proposal.focus_points << fp\n end\n end\n if @proposal.update(proposal_params)\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { render :show, status: :ok, location: @proposal }\n else\n format.html { render :edit }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @proposal = Proposal.find(params[:id])\n\n unless current_user.proposals.map {|p| p.id.to_s} .include? @proposal.id.to_s\n redirect_to proposal_path, :flash => { :error => 'Sem permissão, proposta não é sua.'}\n return\n end\n\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def pending\n @reviews = current_user.written_reviews.pending\n render json: @reviews\n end",
"def update\n respond_to do |format|\n if @proposal.update(proposal_params)\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { render :show, status: :ok, location: @proposal }\n else\n format.html { render :edit }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def filter_by_accepting_proposals(collection)\n collection.where(\"request_for_proposals.state = ?\", 'pending')\n end",
"def show\n @user = @user.proposals.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit\n @proposal = listing.proposals.find(params[:id])\n end",
"def index\n respond_with (@depts = Dept.all)\n end",
"def create\n @proposal = Proposal.new(proposal_params)\n\n respond_to do |format|\n if @proposal.save\n format.html { redirect_to @proposal, notice: 'Proposal was successfully created.' }\n format.json { render :show, status: :created, location: @proposal }\n else\n format.html { render :new }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @proposal = Proposal.new(params[:proposal])\n\n respond_to do |format|\n if @proposal.save\n format.html { redirect_to @proposal, notice: 'Proposal was successfully created.' }\n format.json { render json: @proposal, status: :created, location: @proposal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @proposal = Proposal.find(params[:id])\n\n @proposal.votes.each do |v|\n if v.user == current_user\n @vote = v\n end\n end\n if can? :vote, @proposal\n if @vote.nil?\n @vote = @proposal.votes.new\n end\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proposal }\n end\n end",
"def show\n @proposal = Proposal.find(params[:id])\n @amendments = @proposal.amendments.order(confidence: :desc)\n @comments = @proposal.comments.order(confidence: :desc)\n end",
"def show\n proposal_authorize(@proposal, \"show\", params[:category_service])\n\n respond_to do |format|\n format.html { render :show, locals: { back_url: params[:back_url]} }\n format.json { render json: @proposal, root: false, include: [] }\n end\n end",
"def destroy\n @proposal = listing.proposals.find(params[:id])\n\n\n respond_to do |format|\n if @proposal.id == @proposal.listing.accepted_proposal_id\n format.html { redirect_to listing_proposals_url(@listing), error: \"You can't remove an accepted proposal.\" }\n format.json { head :no_content }\n else\n @proposal.destroy\n format.html { redirect_to listing_proposals_url(@listing) }\n format.json { head :no_content }\n end\n end\n end",
"def new\n @proposal = current_user.proposals.build\n end",
"def submit\n @proposal = current_user.proposals.find(params[:id])\n\n if request.post?\n @proposal.submit!\n\n redirect_to proposals_path\n end\n end",
"def proposal_status(proposal)\n if proposal.key?(:decision)\n proposal.fetch(:decision)\n else\n proposal[:submitted_at].nil? ? 'draft' : 'submitted'\n end\n end",
"def update\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n if @proposal.update_attributes(update_params)\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @comments = proposal.comments.includes(:user).order(\"created_at DESC\")\n\n @comment = Comment.new\n @comment.proposal = proposal\n\n respond_with @proposal\n end",
"def new\n @proposal.accepted = false\n @proposal.enrolment = Enrolment.find(params[:enrolment_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proposal }\n end\n end",
"def destroy\n @proposal = Proposal.find(params[:id])\n unless current_user.proposals.map {|p| p.id.to_s} .include? @proposal.id.to_s\n redirect_to :back, :flash => { :error => 'Sem permissão, proposta não é sua.'}\n return\n end\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to proposals_url }\n format.json { head :no_content }\n end\n end",
"def update\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to(@proposal, :notice => 'Proposal was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @proposal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def show\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @proposal }\n end\n end",
"def show\n #@proposal = Proposal.where(:identifier_id => @proposal.id)\n @proposals=Proposal.find(params[:id])\n end",
"def index\n @parts_for_proposal = PartsForProposal.all\n end",
"def index\n @event_proposals = EventProposal.all\n end",
"def destroy\n @proposal = Proposal.find(params[:id])\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to proposals_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal = Proposal.find(params[:id])\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to proposals_url }\n format.json { head :no_content }\n end\n end",
"def create\n @proposal = Proposal.new(params[:proposal])\n @proposal.user = current_user\n respond_to do |format|\n if @proposal.save\n format.html { redirect_to @proposal, notice: 'Proposal was successfully created.' }\n format.json { render json: @proposal, status: :created, location: @proposal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def approved_flights\n pireps.approved\n end",
"def retrieve_solved\n\t\trender json: @@problems_solved_shared\n\tend",
"def show\n @pledge = Pledge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pledge }\n end\n end",
"def proposal_params\n params.require(:proposal).permit(:proposal_status_id, :not_approved_comment )\n end",
"def destroy\n @proposal.destroy\n respond_to do |format|\n format.html { redirect_to proposals_url, notice: 'Proposal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal.destroy\n respond_to do |format|\n format.html { redirect_to proposals_url, notice: 'Proposal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal.destroy\n respond_to do |format|\n format.html { redirect_to proposals_url, notice: 'Proposal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def show\n @judgement = Judgement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @judgement }\n end\n end",
"def show\n @judgement = Judgement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @judgement }\n end\n end",
"def update\n respond_to do |format|\n if proposal.update_attributes(proposal_params)\n format.html { redirect_to(@proposal, :notice => 'Proposal was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @proposal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def proposal_params\n params.require(:proposal).permit(:title, :description, :user_id, :hackathon_id)\n end",
"def create\n respond_to do |format|\n if @proposal.save\n format.html { redirect_to @proposal.enrolment, notice: 'Proposal was successfully created.' }\n format.json { render json: @proposal, status: :created, location: @proposal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\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 approvals\n approvals_list = []\n if params[:count]\n if params[:skip]\n approvals_list = current_user.db_user.approval_approvers.order('created_at desc').offset(params[:skip].to_i).take(params[:count].to_i)\n else\n approvals_list = current_user.db_user.approval_approvers.order('created_at desc').take(params[:count].to_i)\n end\n else\n approvals_list = current_user.db_user.approval_approvers.order('created_at desc')\n end\n\n # make sure we are only fetching bound approvals\n approvals_list = approvals_list.to_a.select { |approver| approver.approval.is_bound? }\n # return final approvals_list\n render status: 200, json: approvals_list.as_json(include: { approval_type: { }, approval: { methods: [:approval_status, :approval_link, :approval_source_requested_item, :approval_source, :approval_source_character_name, :approval_source_on_behalf_of], include: { approval_kind: { }, approval_approvers: { methods: [:character_name, :approver_response], include: { approval_type: { } } } } } })\n end",
"def create\n @proposal = Proposal.new(params[:proposal])\n\n respond_to do |format|\n if @proposal.save\n format.html { redirect_to(@proposal, :notice => 'Proposal was successfully created.') }\n format.xml { render :xml => @proposal, :status => :created, :location => @proposal }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @proposal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def chainsolutionget\n @participation = Participation.find(params[:id])\n @submission=Submission.find(:first,:conditions =>{:Participation_id => @participation.id,:response => nil })\n if @submission==nil\n redirect_to @participation,:notice=> 'No pending submissions left for this participation'\n return\n end\n respond_to do |format|\n format.html\n end\n end",
"def update\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to @proposal, notice: 'Orçamento instantâneo atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @pledges = Pledge.where('user_id = ?', current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pledges }\n end\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @proposal.update(proposal_params)\n format.html { redirect_to :back, notice: 'La proposition a été modifiée.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @vote = Vote.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: [@proposal, @vote] }\n end\n end",
"def proposal_params\n params.require(:proposal).permit(:admin_id, :homework_id, :cost, :notes, :status, :deadline)\n end",
"def show\n @proposal = IlpProposal.find(params[:id])\n\t\t@provinces = Province.order(\"name\").where(\"only_circunscription = ?\", false)\n\t\t@signature = @proposal.attestors_signatures.new(params[:signature])\n\t\t@title = @proposal.problem\n\t\t\n share_texts(@proposal)\n\t\t\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @proposal }\n end\n end",
"def proposal_params\n params.require(:proposal).permit(:title, :content, :deadline, :price, :accepted, :company_id, :proposal_type, :completed, :completed_on, :paid, :charge_id, :bts, :focus_points, :time_of_day, :location_id, :background, :model_release)\n end",
"def show\n @peptide = Peptide.find(params[:id])\n logger.info(\"PEPTIDE: (#{params[:id]}) #{@peptide.pep_seq}\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @peptide }\n end\n end",
"def index\n @goals = @user.goals.non_project\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @goals }\n end\n end",
"def email_approved_proposal\n ProposalMailer.email_approved_proposal\n end",
"def index\n @ideas = Idea.all\n\n render json: @ideas\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.csv\n format.json { render json: @proposals }\n end\n end",
"def index\n @ideas = Idea.current_ideas_for(current_user).entries\n respond_with(@ideas) do |format|\n format.json { render json: @ideas }\n end\n end",
"def show\n begin\n @proposal = Proposal.approved.published.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n @proposal = Proposal.find_by_id(params[:id].to_i)\n if @proposal.present? && !(logged_in? && (is_admin? || @proposal.user_id == current_user.id))\n raise ActiveRecord::RecordNotFound and return\n elsif @proposal.nil?\n @debate = Debate.published.find(params[:id])\n redirect_to debate_path(@debate) and return\n end\n end\n\n @parent = @proposal\n\n @comments = @proposal.comments.approved.paginate :page => params[:page], :per_page => 25\n @arguments = @proposal.arguments.published.paginate :page => params[:page], :per_page => 50\n\n if logged_in? && params[:n_id].present?\n notification = current_user.notifications.find(params[:n_id])\n notification.read_at = Time.zone.now if notification.read_at.nil?\n notification.save\n end\n\n respond_to do |format|\n format.html { render }\n format.floki { render }\n end\n end",
"def new\n @proposal = Proposal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @proposal }\n end\n end",
"def new\n @proposal = Proposal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @proposal }\n end\n end",
"def retrieve_attempted\n\t\trender json: @@contests_attempted_shared\n\tend",
"def destroy\n @proposal = Proposal.find(params[:id])\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Proposal was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def create\n @parts_for_proposal = PartsForProposal.new(parts_for_proposal_params)\n\n respond_to do |format|\n if @parts_for_proposal.save\n curr_id = @parts_for_proposal.proposal_id\n format.html { redirect_to proposal_url(:id => curr_id), notice: 'Part added to this proposal successfully.' }\n format.json { render :show, status: :created, location: @parts_for_proposal }\n else\n format.html { render :new }\n format.json { render json: @parts_for_proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @proposal = Proposal.find(params[:id])\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to(proposals_url) }\n format.xml { head :ok }\n end\n end",
"def index\n @course_proposal_questions = CourseProposalQuestion.all\n end",
"def progress\n @goal = Goal.find(params[:id])\n\n respond_to do |format|\n format.html # progress.html.erb\n format.json { render json: @goal }\n end\n\n private\n\n # Use this method to whitelist the permissible parameters. Example:\n # params.require(:person).permit(:name, :age)\n # Also, you can specialize this method with per-user checking of permissible attributes.\n def permitted_params\n params.require(:goal).permit(:date, :description, :name, :priority, :status)\n end\n \n def allowed_params\n [:date, :description, :name, :priority, :status]\n end\nend",
"def index\n @hackathon = Hackathon.find_by id: params[\"hackathon_id\"]\n\n @proposal = Proposal.all.order(:cached_votes_score => :desc)\n \n #@proposals=Proposal.find_by id: params[\"hackathon_id\"]\n\n \n \n\n end",
"def set_proposal\n @proposal = Proposal.includes(:requirements).find(params[:id])\n end",
"def index\n if current_user.user_type == 'creative'\n @proposals = Proposal.where(user: current_user).where(completed: nil).order(:created_at).page params[:page]\n else\n @proposals = Proposal.where(company: current_user.company).order(:created_at).page params[:page]\n end\n end",
"def update\n respond_to do |format|\n# if @proposal.update(proposal_params)\n if @proposal.update_with_conflict_validation(proposal_params)\n format.html { redirect_to @proposal, notice: '提案を1件更新しました。' }\n format.json { render :show, status: :ok, location: @proposal }\n else\n format.html { render :edit }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @solutions = @idea.solutions.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @solutions }\n end\n end",
"def show\n\n \t\t\trespond_with @penalty\n\n \t\tend",
"def show\n @solution = @idea.solutions.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @solution }\n end\n end",
"def proposal_params\n params.require(:proposal).permit(:title, :content, :deadline, :price, :proposal_type, :company_id, :user_id)\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end"
] |
[
"0.68021756",
"0.6721464",
"0.6610791",
"0.63833416",
"0.61589944",
"0.6157168",
"0.6157168",
"0.615602",
"0.61308897",
"0.6048299",
"0.5965278",
"0.5956122",
"0.5862362",
"0.5791369",
"0.57696813",
"0.57696813",
"0.57696813",
"0.5732901",
"0.5709056",
"0.56706655",
"0.5640843",
"0.56396866",
"0.56248355",
"0.5619076",
"0.5614353",
"0.5605832",
"0.56055844",
"0.5602585",
"0.55603856",
"0.55571836",
"0.5554553",
"0.5524615",
"0.5483939",
"0.5477235",
"0.545757",
"0.5451111",
"0.5438972",
"0.543194",
"0.5413923",
"0.54071283",
"0.5395384",
"0.53875524",
"0.5387263",
"0.5375494",
"0.5373394",
"0.5362294",
"0.5326501",
"0.5326501",
"0.53253704",
"0.5316674",
"0.53128546",
"0.5305129",
"0.5293604",
"0.52763116",
"0.52763116",
"0.52763116",
"0.5274742",
"0.5274742",
"0.52730054",
"0.5267624",
"0.5250095",
"0.5243911",
"0.52278143",
"0.5214265",
"0.52112126",
"0.51990426",
"0.51964325",
"0.5196367",
"0.51959294",
"0.51925266",
"0.5186784",
"0.51776147",
"0.51774853",
"0.51743144",
"0.51468664",
"0.51435333",
"0.5134945",
"0.5124095",
"0.5118931",
"0.51184326",
"0.5113275",
"0.5113275",
"0.5112581",
"0.510429",
"0.50978535",
"0.5092852",
"0.5089263",
"0.5085359",
"0.50834346",
"0.5071124",
"0.50697094",
"0.50694984",
"0.5049367",
"0.50393873",
"0.5037991",
"0.5033894",
"0.5031224",
"0.5031224",
"0.5031224",
"0.5031224"
] |
0.78760844
|
0
|
GET /proposals/1 GET /proposals/1.json
|
def show
@proposal = Proposal.find(params[:id])
@proposal.votes.each do |v|
if v.user == current_user
@vote = v
end
end
if can? :vote, @proposal
if @vote.nil?
@vote = @proposal.votes.new
end
end
respond_to do |format|
format.html # show.html.erb
format.json { render json: @proposal }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @proposals = listing.proposals\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proposals }\n end\n end",
"def index\n @proposals = current_user.proposals\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proposals }\n end\n end",
"def index\n @proposals = current_user.proposals\n end",
"def index\n @proposals = Proposal.all\n\n render json: @proposals\n end",
"def show\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proposal }\n end\n end",
"def show\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proposal }\n end\n end",
"def index\n @proposals = Proposal.all()\n end",
"def edit\n @proposal = listing.proposals.find(params[:id])\n end",
"def show\n @user = @user.proposals.find(params[:id])\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proposal }\n end\n end",
"def new\n @proposal = listing.proposals.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proposal }\n end\n end",
"def print_proposals\n puts \"____________\"\n puts \"Proposals\"\n sent_proposals.each_with_index do |proposed, i|\n puts \"#{i} => #{proposed}\"\n end\n puts \"____________\"\n end",
"def show\n #@proposal = Proposal.where(:identifier_id => @proposal.id)\n @proposals=Proposal.find(params[:id])\n end",
"def responses\n @proposal = current_user.proposals.find(params[:id])\n @responses = @proposal.responses\n\n respond_to do |format|\n format.html # responses.html.erb\n format.xml { render :xml => @responses }\n end\n end",
"def update\n @proposal = listing.proposals.find(params[:id])\n\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @proposal = Proposal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proposal }\n end\n end",
"def new\n @proposal = Proposal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proposal }\n end\n end",
"def new\n @proposal = Proposal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proposal }\n end\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end",
"def new\n @proposal = current_user.proposals.build\n end",
"def show\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @proposal }\n end\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end",
"def gov_proposals_get(opts = {})\n data, _status_code, _headers = gov_proposals_get_with_http_info(opts)\n data\n end",
"def index\n @votes = @proposal.votes\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @votes }\n end\n end",
"def gov_proposals_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: GovernanceApi.gov_proposals_get ...'\n end\n # resource path\n local_var_path = '/gov/proposals'\n\n # query parameters\n query_params = {}\n query_params[:'voter'] = opts[:'voter'] if !opts[:'voter'].nil?\n query_params[:'depositor'] = opts[:'depositor'] if !opts[:'depositor'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<TextProposal>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GovernanceApi#gov_proposals_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n @comments = proposal.comments.includes(:user).order(\"created_at DESC\")\n\n @comment = Comment.new\n @comment.proposal = proposal\n\n respond_with @proposal\n end",
"def lookup_proposals\n return RAILS_CACHE.fetch_object(\"proposals_for_event_#{self.id}\") do\n self.proposals\n end\n end",
"def update\n @proposal = Proposal.find(params[:id])\n\n unless current_user.proposals.map {|p| p.id.to_s} .include? @proposal.id.to_s\n redirect_to proposal_path, :flash => { :error => 'Sem permissão, proposta não é sua.'}\n return\n end\n\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_proposal\n @proposal = Proposal.includes(:requirements).find(params[:id])\n end",
"def destroy\n @proposal = Proposal.find(params[:id])\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to proposals_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal = Proposal.find(params[:id])\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to proposals_url }\n format.json { head :no_content }\n end\n end",
"def update\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @event_proposals = EventProposal.all\n end",
"def show\n @proposal = Proposal.find(params[:id])\n @amendments = @proposal.amendments.order(confidence: :desc)\n @comments = @proposal.comments.order(confidence: :desc)\n end",
"def proposals_by_person(person)\n person=Person.find_by_id(person) if person.is_a? Fixnum\n self.proposals.select {|p| p.people.include? person}\n end",
"def update\n respond_to do |format|\n if @proposal.update(proposal_params)\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { render :show, status: :ok, location: @proposal }\n else\n format.html { render :edit }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @proposal = Proposal.find(params[:id])\n unless current_user.proposals.map {|p| p.id.to_s} .include? @proposal.id.to_s\n redirect_to :back, :flash => { :error => 'Sem permissão, proposta não é sua.'}\n return\n end\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to proposals_url }\n format.json { head :no_content }\n end\n end",
"def set_proposal\n unless params[:id].nil?\n @proposal = Proposal.find(params[:id])\n else\n @proposal = Proposal.find(params[:proposal_id])\n end\n end",
"def destroy\n @proposal = listing.proposals.find(params[:id])\n\n\n respond_to do |format|\n if @proposal.id == @proposal.listing.accepted_proposal_id\n format.html { redirect_to listing_proposals_url(@listing), error: \"You can't remove an accepted proposal.\" }\n format.json { head :no_content }\n else\n @proposal.destroy\n format.html { redirect_to listing_proposals_url(@listing) }\n format.json { head :no_content }\n end\n end\n end",
"def show\n @proposal = IlpProposal.find(params[:id])\n\t\t@provinces = Province.order(\"name\").where(\"only_circunscription = ?\", false)\n\t\t@signature = @proposal.attestors_signatures.new(params[:signature])\n\t\t@title = @proposal.problem\n\t\t\n share_texts(@proposal)\n\t\t\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @proposal }\n end\n end",
"def show\n @propose = Propose.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @propose }\n end\n end",
"def update\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n if @proposal.update_attributes(update_params)\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def proposal_params\n params.require(:proposal).permit(:title, :description, :user_id, :hackathon_id)\n end",
"def update\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.csv\n format.json { render json: @proposals }\n end\n end",
"def create\n @proposal = Proposal.new(proposal_params)\n\n respond_to do |format|\n if @proposal.save\n format.html { redirect_to @proposal, notice: 'Proposal was successfully created.' }\n format.json { render :show, status: :created, location: @proposal }\n else\n format.html { render :new }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @proposal = Proposal.new(params[:proposal])\n\n respond_to do |format|\n if @proposal.save\n format.html { redirect_to @proposal, notice: 'Proposal was successfully created.' }\n format.json { render json: @proposal, status: :created, location: @proposal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def passed\n # the non-preliminary ones go first\n @proposals = Proposal.select{ |p| p.committee.preliminary == false and p.status == 'Passed'}\n @proposals += Proposal.select{ |p| p.committee.preliminary == true and p.status == 'Passed'}\n\n respond_to do |format|\n format.html # passed.html.erb\n format.json { render json: @proposals }\n end\n end",
"def new\n @vote = Vote.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: [@proposal, @vote] }\n end\n end",
"def show\n @proposal = Proposal.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @proposal }\n format.pdf do\n render :pdf => \"proposal\", :template => \"proposals/show\"\n end\n end\n end",
"def proposal_params\n params.require(:proposal).permit(:title, :content, :deadline, :price, :proposal_type, :company_id, :user_id)\n end",
"def destroy\n @proposal = Proposal.find(params[:id])\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to(proposals_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @proposal.destroy\n respond_to do |format|\n format.html { redirect_to proposals_url, notice: 'Proposal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal.destroy\n respond_to do |format|\n format.html { redirect_to proposals_url, notice: 'Proposal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal.destroy\n respond_to do |format|\n format.html { redirect_to proposals_url, notice: 'Proposal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal = Proposal.find(params[:id])\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Proposal was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def update\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to(@proposal, :notice => 'Proposal was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @proposal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def proposal_from_attrs(attrs)\n Proposal.find_by(id: attrs[:proposal_id])\n end",
"def show\n proposal_authorize(@proposal, \"show\", params[:category_service])\n\n respond_to do |format|\n format.html { render :show, locals: { back_url: params[:back_url]} }\n format.json { render json: @proposal, root: false, include: [] }\n end\n end",
"def submit\n @proposal = current_user.proposals.find(params[:id])\n\n if request.post?\n @proposal.submit!\n\n redirect_to proposals_path\n end\n end",
"def show\n begin\n @proposal = Proposal.approved.published.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n @proposal = Proposal.find_by_id(params[:id].to_i)\n if @proposal.present? && !(logged_in? && (is_admin? || @proposal.user_id == current_user.id))\n raise ActiveRecord::RecordNotFound and return\n elsif @proposal.nil?\n @debate = Debate.published.find(params[:id])\n redirect_to debate_path(@debate) and return\n end\n end\n\n @parent = @proposal\n\n @comments = @proposal.comments.approved.paginate :page => params[:page], :per_page => 25\n @arguments = @proposal.arguments.published.paginate :page => params[:page], :per_page => 50\n\n if logged_in? && params[:n_id].present?\n notification = current_user.notifications.find(params[:n_id])\n notification.read_at = Time.zone.now if notification.read_at.nil?\n notification.save\n end\n\n respond_to do |format|\n format.html { render }\n format.floki { render }\n end\n end",
"def show\n id = params[:id]\n\n begin\n Float(id)\n if current_user\n @proposal = Proposal.find(id)\n unless current_user.proposals.map {|p| p.id.to_s} .include? id\n redirect_to root_path, :flash => { :error => 'Sem permissão, proposta não é sua.'}\n return\n end\n else\n redirect_to root_path, :flash => { :error => 'Sem permissão'}\n return\n end\n \n rescue ArgumentError, TypeError\n @proposal = Proposal.where(token: id).first\n unless @proposal \n message = \"TOKEN ACCESS inválido.\"\n redirect_to root_path, :flash => { :error => message}\n return\n end\n\n rescue Exception => e \n redirect_to root_path, :flash => { :error => e.message}\n return \n end\n\n @comment = Comment.new()\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proposal }\n end\n end",
"def new\n @proposal = Proposal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @proposal }\n end\n end",
"def new\n @proposal = Proposal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @proposal }\n end\n end",
"def destroy\n proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to(proposals_url) }\n format.xml { head :ok }\n end\n end",
"def new\n @proposal = Proposal.new\n end",
"def create\n @proposal = Proposal.new(params[:proposal])\n @proposal.user = current_user\n respond_to do |format|\n if @proposal.save\n format.html { redirect_to @proposal, notice: 'Proposal was successfully created.' }\n format.json { render json: @proposal, status: :created, location: @proposal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def proposal_params\n params.require(:proposal).permit(:id, :branch_cd, :user_id, :proposal_date, :section_name1, :section_name2, :mail, :tel, :proposal_type, :project_type_a, :project_type_b, :project_type_c, :project_type_d, :project_type_e, :project_type_f, :proposal_title, :now_problem, :proposal_detail, :effect, :lock_version)\n end",
"def index\n @parts_for_proposal = PartsForProposal.all\n end",
"def show\n @peptide = Peptide.find(params[:id])\n logger.info(\"PEPTIDE: (#{params[:id]}) #{@peptide.pep_seq}\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @peptide }\n end\n end",
"def proposal_params\n params.require(:proposal).permit(:admin_id, :homework_id, :cost, :notes, :status, :deadline)\n end",
"def edit_proposal(proposal_name, opts={})\n \n defaults = {\n :proposal_id_dyn_var => 'ep_proposal_id',\n :proposal_id_regexp => 'proposal.resultColumn.proposalId\\\"\\,\\\"\\([^\\\"]+\\)',\n #:proposal_dyn_var => 'ep_proposal',\n #:proposal_regexp => 'proposal\\\"\\,\\\"\\([^\\\"]+\\)',\n :proposal_num_dyn_var => 'ep_proposal_num',\n :proposal_num_regexp => 'proposal\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"\\([^\\\"]+\\)',\n :workflow_id_dyn_var => 'ep_workflow_id',\n :workflow_id_regexp => 'workflowId\\\"\\,\\\"\\([^\\\"]+\\)',\n :id_translation_id_dyn_var => 'ep_id_translation_id',\n :id_translation_id_regexp => 'id-translation\\\"\\,\\\"\\([^\\\"]+\\)',\n :code_dyn_var => 'ep_code',\n :code_regexp => 'code\\\"\\,\\\"\\([^\\\"]+\\)',\n :course_num_suffix_dyn_var => 'ep_course_num_suffix',\n :course_num_suffix_regexp => 'courseNumberSuffix\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_category_id_dyn_var => 'ep_lo_cat_id',\n :lo_category_id_regexp => 'expirationDate\\\"\\,\\\"id\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_category_dyn_var => 'ep_lo_cat',\n :lo_category_regexp => 'name\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_cat_text_dyn_var => 'ep_lo_cat_text',\n :lo_cat_text_regexp => 'loInfo\\\"\\,\\\"sequence\\\"\\,\\\"0\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_cat_id_dyn_var => 'ep_lo_cat_id',\n :lo_cat_id_regexp => '\\([^\\\"]+\\)\\\"\\,\\\"loRepositoryKey',\n :create_id_dyn_var => 'ep_create_id',\n :create_id_regexp => 'createId\\\"\\,\\\"\\([^\\\"]+\\)',\n :course_title_dyn_var => 'ep_course_title',\n :course_title_regexp => 'courseTitle\\\"\\,\\\"\\([^\\\"]+\\)',\n :oversight_org_dyn_var => 'ep_oversight_org',\n :oversight_org_regexp => 'curriculumOversightOrgs\\\"\\,\\\"[^\\,]+\\,\\\"\\([^\\\"]+\\)',\n :lab_fee_id_dyn_var => 'ep_lab_fee_id',\n :lab_fee_id_regexp => 'kuali.enum.type.feeTypes.labFee\\\"\\,\\\"\\([^\\\"]+\\)',\n :atp_dur_week_id_dyn_var => 'ep_atp_dur_week_id',\n :atp_dur_week_id_regexp => 'kuali.atp.duration.Week\\\"\\,\\\"Week\\\"\\,\\\"\\([^\\\"]+\\)',\n :lab_id_dyn_var => 'ep_lab_id',\n :lab_id_regexp => 'Lab\\\"\\,\\\"\\([^\\\"]+\\)',\n :grade_id_dyn_var => 'ep_grade_id',\n :grade_id_regexp => 'kuali.resultComponent.grade[^\\,]+\\,\\\"[^\\,]+\\,\\\"\\([^\\\"]+\\)',\n :person_id_dyn_var => 'ep_person_id',\n :person_id_regexp => 'personId\\\"\\,\\\"\\([^\\\"]+\\)',\n :joints_dyn_var => 'ep_joints',\n :joints_regexp => 'joints\\\"\\,\\\"\\([^\\\"]+\\)',\n :subject_area_dyn_var => 'ep_subject_area',\n :subject_area_regexp => 'subjectArea\\\"\\,\\\"\\([^\\\"]+\\)',\n :title_dyn_var => 'ep_title',\n :title_regexp => 'proposal\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"\\([^\\\"]+\\)',\n :rationale_dyn_var => 'ep_rationale',\n :rationale_regexp => 'rationale\\\"\\,\\\"\\([^\\\"]+\\)',\n :modify_fields => {\n :course_information => {},\n :governance => {},\n :course_logistics => {},\n :learning_objectives => {},\n :active_dates => {},\n :financials => {}\n }\n }\n \n opts = defaults.merge(opts)\n \n # Search for proposal\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|13|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.lang.Integer/3438268394|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|proposal.queryParam.proposalOptionalName|#{proposal_name}|proposal.search.generic|proposal.resultColumn.proposalOptionalName|1|2|3|4|1|5|5|6|10|7|0|8|1|9|10|0|11|12|13|0|6|0|\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:proposal_id_dyn_var], \"re\" => opts[:proposal_id_regexp]}\n ]\n }\n )\n \n # Select\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|526F889935910B01B2508B535A13901E|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|isAuthorized|org.kuali.student.core.rice.authorization.PermissionType/259370389|java.util.Map|java.util.HashMap/962170901|java.lang.String/2004016611|kualiStudentObjectWorkflowId|%%_#{opts[:proposal_id_dyn_var]}%%|1|2|3|4|2|5|6|5|1|7|1|8|9|8|10|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add_thinktime(2)\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|526F889935910B01B2508B535A13901E|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|getMetadata|java.lang.String/2004016611|kualiStudentObjectWorkflowId|%%_#{opts[:proposal_id_dyn_var]}%%|1|2|3|4|2|5|5|6|7|\"\n },{'subst' => 'true'}\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|526F889935910B01B2508B535A13901E|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|getData|java.lang.String/2004016611|%%_#{opts[:proposal_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:workflow_id_dyn_var], \"re\" => opts[:workflow_id_regexp]},\n {\"name\" => opts[:id_translation_id_dyn_var], \"re\" => opts[:id_translation_id_regexp]},\n {\"name\" => opts[:code_dyn_var], \"re\" => opts[:code_regexp]},\n {\"name\" => opts[:course_num_suffix_dyn_var], \"re\" => opts[:course_num_suffix_regexp]},\n {\"name\" => opts[:lo_category_id_dyn_var], \"re\" => opts[:lo_category_id_regexp]},\n {\"name\" => opts[:lo_category_dyn_var], \"re\" => opts[:lo_category_dyn_var]},\n {\"name\" => opts[:lo_cat_text_dyn_var], \"re\" => opts[:lo_cat_text_regexp]},\n {\"name\" => opts[:lo_cat_id_dyn_var], \"re\" => opts[:lo_cat_id_regexp]},\n {\"name\" => opts[:create_id_dyn_var], \"re\" => opts[:create_id_regexp]},\n {\"name\" => opts[:course_title_dyn_var], \"re\" => opts[:course_title_regexp]},\n {\"name\" => opts[:oversight_org_dyn_var], \"re\" => opts[:oversight_org_regexp]},\n {\"name\" => opts[:lab_fee_id_dyn_var], \"re\" => opts[:lab_fee_id_regexp]},\n {\"name\" => opts[:atp_dur_week_id_dyn_var], \"re\" => opts[:atp_dur_week_id_regexp]},\n {\"name\" => opts[:lab_id_dyn_var], \"re\" => opts[:lab_id_regexp]},\n {\"name\" => opts[:grade_id_dyn_var], \"re\" => opts[:grade_id_regexp]},\n {\"name\" => opts[:person_id_dyn_var], \"re\" => opts[:person_id_regexp]},\n {\"name\" => opts[:joints_dyn_var], \"re\" => opts[:joints_regexp]},\n {\"name\" => opts[:subject_area_dyn_var], \"re\" => opts[:subject_area_regexp]},\n {\"name\" => opts[:proposal_dyn_var], \"re\" => opts[:proposal_regexp]},\n {\"name\" => opts[:proposal_num_dyn_var], \"re\" => opts[:proposal_num_regexp]},\n {\"name\" => opts[:title_dyn_var], \"re\" => opts[:title_regexp]},\n {\"name\" => opts[:rationale_dyn_var], \"re\" => opts[:rationale_regexp]}\n ]\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|1|2|3|4|1|5|5|0|0|6|0|7|0|0|0|\"\n }\n )\n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|1|2|3|4|1|5|5|0|0|6|0|7|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.percentage|kuali.resultComponent.grade.recitalReview|kuali.resultComponent.grade.designReview|kuali.resultComponent.grade.completedNotation|lrc.search.resultComponent|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|6|11|12|11|13|11|14|11|15|11|16|11|17|0|18|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.percentage|kuali.resultComponent.grade.recitalReview|kuali.resultComponent.grade.designReview|kuali.resultComponent.grade.completedNotation|lrc.search.resultComponent|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|6|11|12|11|13|11|14|11|15|11|16|11|17|0|18|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|enumeration.queryParam.enumerationType|kuali.lu.finalExam.status|enumeration.management.search|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|enumeration.queryParam.enumerationType|kuali.lu.finalExam.status|enumeration.management.search|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|0|0|0|\"\n }\n )\n \n @request.add_thinktime(2)\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n \n # Edit Proposal\n \n if(!opts[:modify_fields][:course_information].empty?)\n \n if(opts[:modify_fields][:course_information][:description])\n \n # Save changes\n contents1 = \"5|0|159|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|526F889935910B01B2508B535A13901E|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.core.assembly.data.Data/3119441076|org.kuali.student.core.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.core.assembly.data.Data$StringKey/1742996354|administeringOrgs|org.kuali.student.core.assembly.data.Data$DataValue/4040075329|org.kuali.student.core.assembly.data.Data$IntegerKey/2690592210|java.lang.Integer/3438268394|org.kuali.student.core.assembly.data.Data$StringValue/3696151110|58|_runtimeData|id-translation|%%_#{opts[:id_translation_id_dyn_var]}%%|passFail|org.kuali.student.core.assembly.data.Data$BooleanValue/268767974|java.lang.Boolean/476441737|audit|finalExamStatus|STD|campusLocations|ALL|All|code|%%_#{opts[:code_dyn_var]}%%|courseNumberSuffix|%%_#{opts[:course_num_suffix_dyn_var]}%%|courseSpecificLOs|loCategoryInfoList|desc|formatted|<p>Desc</p>|plain|Desc|effectiveDate|org.kuali.student.core.assembly.data.Data$DateValue/3833457837|java.sql.Timestamp/1769758459|expirationDate|id|%%_#{opts[:lo_category_id_dyn_var]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|versionInd|1|name|%%_#{opts[:lo_category_dyn_var]}%%|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|0|%%_#{opts[:lo_cat_text_dyn_var]}%%|%%_#{opts[:lo_cat_id_dyn_var]}%%|loRepositoryKey|createId|%%_#{opts[:create_id_dyn_var]}%%|createTime|updateId|updateTime|SINGLE USE LO|kuali.lo.type.singleUse|courseTitle|%%_#{opts[:course_title_dyn_var]}%%|creditOptions|fixedCreditValue|10|kuali.creditType.credit.degree.10|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|curriculumOversightOrgs|51|%%_#{opts[:oversight_org_dyn_var]}%%|descr|#{opts[:modify_fields][:course_information][:description]}|dirty|duration|atpDurationTypeKey|kuali.atp.duration.Year|timeQuantity|org.kuali.student.core.assembly.data.Data$IntegerValue/991919491|Year|expenditure|affiliatedOrgs|feeJustification|fees|feeAmounts|currencyQuantity|currencyTypeKey|kuali.currency.type.usdollars.cents|feeType|kuali.enum.type.feeTypes.labFee|%%_#{opts[:lab_fee_id_dyn_var]}%%|rateType|fixedRateFee|Fixed Rate Fee|Laboratory Fee|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_dur_week_id_dyn_var]}%%|2|draft|Lab|%%_#{opts[:lab_id_dyn_var]}%%|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:grade_id_dyn_var]}%%|instructors|personId|%%_#{opts[:person_id_dyn_var]}%%|joints|%%_#{opts[:joints_dyn_var]}%%|pilotCourse|revenues|specialTopicsCourse|subjectArea|%%_#{opts[:subject_area_dyn_var]}%%|termsOffered|kuali.atp.season.Any|Any|kuali.lu.type.CreditCourse|variations|Standard final Exam|transcriptTitle|proposal|%%_#{opts[:proposal_id_dyn_var]}%%|%%_#{opts[:proposal_num_dyn_var]}%%|%%_#{opts[:title_dyn_var]}%%|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|%%_#{opts[:rationale_dyn_var]}%%|kuali.proposal.type.course.create|workflowId|%%_#{opts[:workflow_id_dyn_var]}%%|\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|34|8|9|10|5|6|7|0|2|11|12|0|13|14|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|17|-12|-14|-5|-10|-1|-3|8|18|19|20|0|8|21|19|-22|8|22|13|23|8|24|10|5|6|7|0|2|11|-8|13|25|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|26|-35|-37|-29|-33|-1|-27|8|27|13|28|8|29|13|30|8|31|10|5|6|7|0|1|11|-8|10|5|6|7|0|3|8|32|10|5|6|7|0|1|11|-8|10|5|6|7|0|9|8|33|10|5|6|7|0|2|8|34|13|35|8|36|13|37|-61|-63|8|38|39|40|867724416|1198295875584|0|8|41|39|40|3896582272|1258425417728|0|8|42|13|43|8|44|13|45|8|46|10|5|6|7|0|1|8|47|13|48|-61|-81|8|49|13|50|8|51|13|52|8|53|13|54|-57|-59|-53|-55|8|55|10|5|6|7|0|0|-53|-93|8|56|10|5|6|7|0|7|8|57|13|58|8|33|10|5|6|7|0|2|8|34|13|59|8|36|13|59|-99|-103|8|42|13|60|8|61|13|45|8|46|10|5|6|7|0|5|8|62|13|63|8|64|39|40|3246181412|1284195221504|916000000|8|65|13|63|8|66|39|40|3246183944|1284195221504|448000000|8|47|13|48|-99|-115|8|49|13|67|8|53|13|68|-53|-97|-49|-51|-1|-47|8|69|13|70|8|71|10|5|6|7|0|1|11|-8|10|5|6|7|0|6|8|72|13|73|8|42|13|74|8|46|10|5|6|7|0|1|8|47|13|58|-143|-149|8|75|10|5|6|7|0|1|11|-8|13|73|-143|-155|8|53|13|76|8|15|10|5|6|7|0|1|8|53|10|5|6|7|0|1|8|16|13|77|-165|-167|-143|-163|-139|-141|-1|-137|8|78|10|5|6|7|0|0|-1|-173|8|79|10|5|6|7|0|2|11|-8|13|80|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|81|-185|-187|-179|-183|-1|-177|8|82|10|5|6|7|0|2|8|36|13|83|8|15|10|5|6|7|0|1|8|84|10|5|6|7|0|1|8|36|19|20|1|-201|-203|-195|-199|-1|-193|8|85|10|5|6|7|0|3|8|86|13|87|8|88|89|12|1|8|15|10|5|6|7|0|1|8|86|10|5|6|7|0|1|8|16|13|90|-221|-223|-212|-219|-1|-210|8|91|10|5|6|7|0|1|8|92|10|5|6|7|0|0|-231|-233|-1|-229|8|93|10|5|6|7|0|0|-1|-237|8|94|10|5|6|7|0|1|11|-8|10|5|6|7|0|5|8|95|10|5|6|7|0|1|11|-8|10|5|6|7|0|2|8|96|89|12|10|8|97|13|98|-251|-253|-247|-249|8|99|13|100|8|42|13|101|8|102|13|103|8|15|10|5|6|7|0|2|8|102|10|5|6|7|0|1|8|16|13|104|-270|-272|8|99|10|5|6|7|0|1|8|16|13|105|-270|-278|-247|-268|-243|-245|-1|-241|8|106|10|5|6|7|0|1|11|-8|10|5|6|7|0|5|8|107|10|5|6|7|0|1|11|-8|10|5|6|7|0|9|8|108|13|109|8|110|10|5|6|7|0|3|8|111|13|73|8|112|13|113|8|15|10|5|6|7|0|1|8|112|10|5|6|7|0|1|8|16|13|114|-312|-314|-304|-310|-298|-302|8|79|10|5|6|7|0|0|-298|-320|8|115|89|12|100|8|85|10|5|6|7|0|3|8|86|13|116|8|88|89|12|12|8|15|10|5|6|7|0|1|8|86|10|5|6|7|0|1|8|16|13|117|-338|-340|-329|-336|-298|-327|8|42|13|118|8|46|10|5|6|7|0|5|8|62|13|63|8|64|39|40|3246177449|1284195221504|953000000|8|65|13|63|8|66|39|40|3246183904|1284195221504|408000000|8|47|13|119|-298|-348|8|51|13|120|8|15|10|5|6|7|0|1|8|108|10|5|6|7|0|1|8|16|13|121|-368|-370|-298|-366|-294|-296|-290|-292|8|42|13|122|8|46|10|5|6|7|0|5|8|62|13|63|8|64|39|40|3246177416|1284195221504|920000000|8|65|13|63|8|66|39|40|3246183890|1284195221504|394000000|8|47|13|119|-290|-378|8|51|13|120|8|53|13|123|-286|-288|-1|-284|8|124|10|5|6|7|0|2|11|-8|13|125|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|126|-406|-408|-400|-404|-1|-398|8|42|13|127|8|128|10|5|6|7|0|1|11|-8|10|5|6|7|0|2|8|129|13|63|8|15|10|5|6|7|0|1|8|129|10|5|6|7|0|1|8|16|13|130|-428|-430|-422|-426|-418|-420|-1|8|128|8|131|10|5|6|7|0|0|-1|-437|8|46|10|5|6|7|0|5|8|62|13|63|8|64|39|40|3246166611|1284195221504|115000000|8|65|13|63|8|66|39|40|3246183834|1284195221504|338000000|8|47|13|132|-1|-441|8|133|19|-22|8|134|10|5|6|7|0|0|-1|-459|8|135|19|-22|8|51|13|120|8|136|13|137|8|138|10|5|6|7|0|2|11|-8|13|139|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|140|-477|-479|-471|-475|-1|-469|8|53|13|141|8|142|10|5|6|7|0|0|-1|-487|8|15|10|5|6|7|0|3|8|136|10|5|6|7|0|1|8|16|13|137|-493|-495|8|22|10|5|6|7|0|1|8|16|13|143|-493|-501|-203|10|5|6|7|0|3|8|144|19|-209|8|128|19|-209|8|136|19|-209|-493|-203|-1|-491|8|145|10|5|6|7|0|10|8|42|13|146|8|46|10|5|6|7|0|5|8|62|13|63|8|64|39|40|3246166532|1284195221504|36000000|8|65|13|63|8|66|39|40|3246183375|1284195221504|879000000|8|47|13|147|-518|-522|8|49|13|148|8|149|10|5|6|7|0|1|11|-8|13|127|-518|-540|8|150|13|151|8|152|10|5|6|7|0|0|-518|-548|8|153|10|5|6|7|0|0|-518|-552|8|154|13|155|8|53|13|156|8|157|13|158|-1|-516|-510|13|159|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n end\n \n end\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n \n end",
"def edit_proposal(proposal_name, opts={})\n \n defaults = {\n :proposal_id_dyn_var => 'ep_proposal_id',\n :proposal_id_regexp => 'proposal.resultColumn.proposalId\\\"\\,\\\"\\([^\\\"]+\\)',\n #:proposal_dyn_var => 'ep_proposal',\n #:proposal_regexp => 'proposal\\\"\\,\\\"\\([^\\\"]+\\)',\n :proposal_num_dyn_var => 'ep_proposal_num',\n :proposal_num_regexp => 'proposal\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"\\([^\\\"]+\\)',\n :workflow_id_dyn_var => 'ep_workflow_id',\n :workflow_id_regexp => 'workflowId\\\"\\,\\\"\\([^\\\"]+\\)',\n :id_translation_id_dyn_var => 'ep_id_translation_id',\n :id_translation_id_regexp => 'id-translation\\\"\\,\\\"\\([^\\\"]+\\)',\n :code_dyn_var => 'ep_code',\n :code_regexp => 'code\\\"\\,\\\"\\([^\\\"]+\\)',\n :course_num_suffix_dyn_var => 'ep_course_num_suffix',\n :course_num_suffix_regexp => 'courseNumberSuffix\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_category_id_dyn_var => 'ep_lo_cat_id',\n :lo_category_id_regexp => 'expirationDate\\\"\\,\\\"id\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_category_dyn_var => 'ep_lo_cat',\n :lo_category_regexp => 'name\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_cat_text_dyn_var => 'ep_lo_cat_text',\n :lo_cat_text_regexp => 'loInfo\\\"\\,\\\"sequence\\\"\\,\\\"0\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_cat_id_dyn_var => 'ep_lo_cat_id',\n :lo_cat_id_regexp => '\\([^\\\"]+\\)\\\"\\,\\\"loRepositoryKey',\n :create_id_dyn_var => 'ep_create_id',\n :create_id_regexp => 'createId\\\"\\,\\\"\\([^\\\"]+\\)',\n :course_title_dyn_var => 'ep_course_title',\n :course_title_regexp => 'courseTitle\\\"\\,\\\"\\([^\\\"]+\\)',\n :oversight_org_dyn_var => 'ep_oversight_org',\n :oversight_org_regexp => 'curriculumOversightOrgs\\\"\\,\\\"[^\\,]+\\,\\\"\\([^\\\"]+\\)',\n :lab_fee_id_dyn_var => 'ep_lab_fee_id',\n :lab_fee_id_regexp => 'kuali.enum.type.feeTypes.labFee\\\"\\,\\\"\\([^\\\"]+\\)',\n :atp_dur_week_id_dyn_var => 'ep_atp_dur_week_id',\n :atp_dur_week_id_regexp => 'kuali.atp.duration.Week\\\"\\,\\\"Week\\\"\\,\\\"\\([^\\\"]+\\)',\n :lab_id_dyn_var => 'ep_lab_id',\n :lab_id_regexp => 'Lab\\\"\\,\\\"\\([^\\\"]+\\)',\n :grade_id_dyn_var => 'ep_grade_id',\n :grade_id_regexp => 'kuali.resultComponent.grade[^\\,]+\\,\\\"[^\\,]+\\,\\\"\\([^\\\"]+\\)',\n :person_id_dyn_var => 'ep_person_id',\n :person_id_regexp => 'personId\\\"\\,\\\"\\([^\\\"]+\\)',\n :joints_dyn_var => 'ep_joints',\n :joints_regexp => 'joints\\\"\\,\\\"\\([^\\\"]+\\)',\n :subject_area_dyn_var => 'ep_subject_area',\n :subject_area_regexp => 'subjectArea\\\"\\,\\\"\\([^\\\"]+\\)',\n :title_dyn_var => 'ep_title',\n :title_regexp => 'proposal\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"\\([^\\\"]+\\)',\n :rationale_dyn_var => 'ep_rationale',\n :rationale_regexp => 'rationale\\\"\\,\\\"\\([^\\\"]+\\)',\n :modify_fields => {\n :course_information => {},\n :governance => {},\n :course_logistics => {},\n :learning_objectives => {},\n :active_dates => {},\n :financials => {}\n }\n }\n \n opts = defaults.merge(opts)\n \n # Search for proposal\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|13|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.lang.Integer/3438268394|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|proposal.queryParam.proposalOptionalName|#{proposal_name}|proposal.search.generic|proposal.resultColumn.proposalOptionalName|1|2|3|4|1|5|5|6|10|7|0|8|1|9|10|0|11|12|13|0|6|0|\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:proposal_id_dyn_var], \"regexp\" => opts[:proposal_id_regexp]}\n ]\n }\n )\n \n # Select\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|526F889935910B01B2508B535A13901E|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|isAuthorized|org.kuali.student.core.rice.authorization.PermissionType/259370389|java.util.Map|java.util.HashMap/962170901|java.lang.String/2004016611|kualiStudentObjectWorkflowId|%%_#{opts[:proposal_id_dyn_var]}%%|1|2|3|4|2|5|6|5|1|7|1|8|9|8|10|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add_thinktime(2)\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|526F889935910B01B2508B535A13901E|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|getMetadata|java.lang.String/2004016611|kualiStudentObjectWorkflowId|%%_#{opts[:proposal_id_dyn_var]}%%|1|2|3|4|2|5|5|6|7|\"\n },{'subst' => 'true'}\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|526F889935910B01B2508B535A13901E|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|getData|java.lang.String/2004016611|%%_#{opts[:proposal_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:workflow_id_dyn_var], \"regexp\" => opts[:workflow_id_regexp]},\n {\"name\" => opts[:id_translation_id_dyn_var], \"regexp\" => opts[:id_translation_id_regexp]},\n {\"name\" => opts[:code_dyn_var], \"regexp\" => opts[:code_regexp]},\n {\"name\" => opts[:course_num_suffix_dyn_var], \"regexp\" => opts[:course_num_suffix_regexp]},\n {\"name\" => opts[:lo_category_id_dyn_var], \"regexp\" => opts[:lo_category_id_regexp]},\n {\"name\" => opts[:lo_category_dyn_var], \"regexp\" => opts[:lo_category_dyn_var]},\n {\"name\" => opts[:lo_cat_text_dyn_var], \"regexp\" => opts[:lo_cat_text_regexp]},\n {\"name\" => opts[:lo_cat_id_dyn_var], \"regexp\" => opts[:lo_cat_id_regexp]},\n {\"name\" => opts[:create_id_dyn_var], \"regexp\" => opts[:create_id_regexp]},\n {\"name\" => opts[:course_title_dyn_var], \"regexp\" => opts[:course_title_regexp]},\n {\"name\" => opts[:oversight_org_dyn_var], \"regexp\" => opts[:oversight_org_regexp]},\n {\"name\" => opts[:lab_fee_id_dyn_var], \"regexp\" => opts[:lab_fee_id_regexp]},\n {\"name\" => opts[:atp_dur_week_id_dyn_var], \"regexp\" => opts[:atp_dur_week_id_regexp]},\n {\"name\" => opts[:lab_id_dyn_var], \"regexp\" => opts[:lab_id_regexp]},\n {\"name\" => opts[:grade_id_dyn_var], \"regexp\" => opts[:grade_id_regexp]},\n {\"name\" => opts[:person_id_dyn_var], \"regexp\" => opts[:person_id_regexp]},\n {\"name\" => opts[:joints_dyn_var], \"regexp\" => opts[:joints_regexp]},\n {\"name\" => opts[:subject_area_dyn_var], \"regexp\" => opts[:subject_area_regexp]},\n {\"name\" => opts[:proposal_dyn_var], \"regexp\" => opts[:proposal_regexp]},\n {\"name\" => opts[:proposal_num_dyn_var], \"regexp\" => opts[:proposal_num_regexp]},\n {\"name\" => opts[:title_dyn_var], \"regexp\" => opts[:title_regexp]},\n {\"name\" => opts[:rationale_dyn_var], \"regexp\" => opts[:rationale_regexp]}\n ]\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|1|2|3|4|1|5|5|0|0|6|0|7|0|0|0|\"\n }\n )\n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|1|2|3|4|1|5|5|0|0|6|0|7|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.percentage|kuali.resultComponent.grade.recitalReview|kuali.resultComponent.grade.designReview|kuali.resultComponent.grade.completedNotation|lrc.search.resultComponent|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|6|11|12|11|13|11|14|11|15|11|16|11|17|0|18|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.percentage|kuali.resultComponent.grade.recitalReview|kuali.resultComponent.grade.designReview|kuali.resultComponent.grade.completedNotation|lrc.search.resultComponent|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|6|11|12|11|13|11|14|11|15|11|16|11|17|0|18|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|enumeration.queryParam.enumerationType|kuali.lu.finalExam.status|enumeration.management.search|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|enumeration.queryParam.enumerationType|kuali.lu.finalExam.status|enumeration.management.search|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|0|0|0|\"\n }\n )\n \n @request.add_thinktime(2)\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n \n # Edit Proposal\n \n if(!opts[:modify_fields][:course_information].empty?)\n \n if(opts[:modify_fields][:course_information][:description])\n \n # Save changes\n contents1 = \"5|0|159|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|526F889935910B01B2508B535A13901E|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.core.assembly.data.Data/3119441076|org.kuali.student.core.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.core.assembly.data.Data$StringKey/1742996354|administeringOrgs|org.kuali.student.core.assembly.data.Data$DataValue/4040075329|org.kuali.student.core.assembly.data.Data$IntegerKey/2690592210|java.lang.Integer/3438268394|org.kuali.student.core.assembly.data.Data$StringValue/3696151110|58|_runtimeData|id-translation|%%_#{opts[:id_translation_id_dyn_var]}%%|passFail|org.kuali.student.core.assembly.data.Data$BooleanValue/268767974|java.lang.Boolean/476441737|audit|finalExamStatus|STD|campusLocations|ALL|All|code|%%_#{opts[:code_dyn_var]}%%|courseNumberSuffix|%%_#{opts[:course_num_suffix_dyn_var]}%%|courseSpecificLOs|loCategoryInfoList|desc|formatted|<p>Desc</p>|plain|Desc|effectiveDate|org.kuali.student.core.assembly.data.Data$DateValue/3833457837|java.sql.Timestamp/1769758459|expirationDate|id|%%_#{opts[:lo_category_id_dyn_var]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|versionInd|1|name|%%_#{opts[:lo_category_dyn_var]}%%|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|0|%%_#{opts[:lo_cat_text_dyn_var]}%%|%%_#{opts[:lo_cat_id_dyn_var]}%%|loRepositoryKey|createId|%%_#{opts[:create_id_dyn_var]}%%|createTime|updateId|updateTime|SINGLE USE LO|kuali.lo.type.singleUse|courseTitle|%%_#{opts[:course_title_dyn_var]}%%|creditOptions|fixedCreditValue|10|kuali.creditType.credit.degree.10|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|curriculumOversightOrgs|51|%%_#{opts[:oversight_org_dyn_var]}%%|descr|#{opts[:modify_fields][:course_information][:description]}|dirty|duration|atpDurationTypeKey|kuali.atp.duration.Year|timeQuantity|org.kuali.student.core.assembly.data.Data$IntegerValue/991919491|Year|expenditure|affiliatedOrgs|feeJustification|fees|feeAmounts|currencyQuantity|currencyTypeKey|kuali.currency.type.usdollars.cents|feeType|kuali.enum.type.feeTypes.labFee|%%_#{opts[:lab_fee_id_dyn_var]}%%|rateType|fixedRateFee|Fixed Rate Fee|Laboratory Fee|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_dur_week_id_dyn_var]}%%|2|draft|Lab|%%_#{opts[:lab_id_dyn_var]}%%|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:grade_id_dyn_var]}%%|instructors|personId|%%_#{opts[:person_id_dyn_var]}%%|joints|%%_#{opts[:joints_dyn_var]}%%|pilotCourse|revenues|specialTopicsCourse|subjectArea|%%_#{opts[:subject_area_dyn_var]}%%|termsOffered|kuali.atp.season.Any|Any|kuali.lu.type.CreditCourse|variations|Standard final Exam|transcriptTitle|proposal|%%_#{opts[:proposal_id_dyn_var]}%%|%%_#{opts[:proposal_num_dyn_var]}%%|%%_#{opts[:title_dyn_var]}%%|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|%%_#{opts[:rationale_dyn_var]}%%|kuali.proposal.type.course.create|workflowId|%%_#{opts[:workflow_id_dyn_var]}%%|\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|34|8|9|10|5|6|7|0|2|11|12|0|13|14|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|17|-12|-14|-5|-10|-1|-3|8|18|19|20|0|8|21|19|-22|8|22|13|23|8|24|10|5|6|7|0|2|11|-8|13|25|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|26|-35|-37|-29|-33|-1|-27|8|27|13|28|8|29|13|30|8|31|10|5|6|7|0|1|11|-8|10|5|6|7|0|3|8|32|10|5|6|7|0|1|11|-8|10|5|6|7|0|9|8|33|10|5|6|7|0|2|8|34|13|35|8|36|13|37|-61|-63|8|38|39|40|867724416|1198295875584|0|8|41|39|40|3896582272|1258425417728|0|8|42|13|43|8|44|13|45|8|46|10|5|6|7|0|1|8|47|13|48|-61|-81|8|49|13|50|8|51|13|52|8|53|13|54|-57|-59|-53|-55|8|55|10|5|6|7|0|0|-53|-93|8|56|10|5|6|7|0|7|8|57|13|58|8|33|10|5|6|7|0|2|8|34|13|59|8|36|13|59|-99|-103|8|42|13|60|8|61|13|45|8|46|10|5|6|7|0|5|8|62|13|63|8|64|39|40|3246181412|1284195221504|916000000|8|65|13|63|8|66|39|40|3246183944|1284195221504|448000000|8|47|13|48|-99|-115|8|49|13|67|8|53|13|68|-53|-97|-49|-51|-1|-47|8|69|13|70|8|71|10|5|6|7|0|1|11|-8|10|5|6|7|0|6|8|72|13|73|8|42|13|74|8|46|10|5|6|7|0|1|8|47|13|58|-143|-149|8|75|10|5|6|7|0|1|11|-8|13|73|-143|-155|8|53|13|76|8|15|10|5|6|7|0|1|8|53|10|5|6|7|0|1|8|16|13|77|-165|-167|-143|-163|-139|-141|-1|-137|8|78|10|5|6|7|0|0|-1|-173|8|79|10|5|6|7|0|2|11|-8|13|80|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|81|-185|-187|-179|-183|-1|-177|8|82|10|5|6|7|0|2|8|36|13|83|8|15|10|5|6|7|0|1|8|84|10|5|6|7|0|1|8|36|19|20|1|-201|-203|-195|-199|-1|-193|8|85|10|5|6|7|0|3|8|86|13|87|8|88|89|12|1|8|15|10|5|6|7|0|1|8|86|10|5|6|7|0|1|8|16|13|90|-221|-223|-212|-219|-1|-210|8|91|10|5|6|7|0|1|8|92|10|5|6|7|0|0|-231|-233|-1|-229|8|93|10|5|6|7|0|0|-1|-237|8|94|10|5|6|7|0|1|11|-8|10|5|6|7|0|5|8|95|10|5|6|7|0|1|11|-8|10|5|6|7|0|2|8|96|89|12|10|8|97|13|98|-251|-253|-247|-249|8|99|13|100|8|42|13|101|8|102|13|103|8|15|10|5|6|7|0|2|8|102|10|5|6|7|0|1|8|16|13|104|-270|-272|8|99|10|5|6|7|0|1|8|16|13|105|-270|-278|-247|-268|-243|-245|-1|-241|8|106|10|5|6|7|0|1|11|-8|10|5|6|7|0|5|8|107|10|5|6|7|0|1|11|-8|10|5|6|7|0|9|8|108|13|109|8|110|10|5|6|7|0|3|8|111|13|73|8|112|13|113|8|15|10|5|6|7|0|1|8|112|10|5|6|7|0|1|8|16|13|114|-312|-314|-304|-310|-298|-302|8|79|10|5|6|7|0|0|-298|-320|8|115|89|12|100|8|85|10|5|6|7|0|3|8|86|13|116|8|88|89|12|12|8|15|10|5|6|7|0|1|8|86|10|5|6|7|0|1|8|16|13|117|-338|-340|-329|-336|-298|-327|8|42|13|118|8|46|10|5|6|7|0|5|8|62|13|63|8|64|39|40|3246177449|1284195221504|953000000|8|65|13|63|8|66|39|40|3246183904|1284195221504|408000000|8|47|13|119|-298|-348|8|51|13|120|8|15|10|5|6|7|0|1|8|108|10|5|6|7|0|1|8|16|13|121|-368|-370|-298|-366|-294|-296|-290|-292|8|42|13|122|8|46|10|5|6|7|0|5|8|62|13|63|8|64|39|40|3246177416|1284195221504|920000000|8|65|13|63|8|66|39|40|3246183890|1284195221504|394000000|8|47|13|119|-290|-378|8|51|13|120|8|53|13|123|-286|-288|-1|-284|8|124|10|5|6|7|0|2|11|-8|13|125|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|126|-406|-408|-400|-404|-1|-398|8|42|13|127|8|128|10|5|6|7|0|1|11|-8|10|5|6|7|0|2|8|129|13|63|8|15|10|5|6|7|0|1|8|129|10|5|6|7|0|1|8|16|13|130|-428|-430|-422|-426|-418|-420|-1|8|128|8|131|10|5|6|7|0|0|-1|-437|8|46|10|5|6|7|0|5|8|62|13|63|8|64|39|40|3246166611|1284195221504|115000000|8|65|13|63|8|66|39|40|3246183834|1284195221504|338000000|8|47|13|132|-1|-441|8|133|19|-22|8|134|10|5|6|7|0|0|-1|-459|8|135|19|-22|8|51|13|120|8|136|13|137|8|138|10|5|6|7|0|2|11|-8|13|139|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|140|-477|-479|-471|-475|-1|-469|8|53|13|141|8|142|10|5|6|7|0|0|-1|-487|8|15|10|5|6|7|0|3|8|136|10|5|6|7|0|1|8|16|13|137|-493|-495|8|22|10|5|6|7|0|1|8|16|13|143|-493|-501|-203|10|5|6|7|0|3|8|144|19|-209|8|128|19|-209|8|136|19|-209|-493|-203|-1|-491|8|145|10|5|6|7|0|10|8|42|13|146|8|46|10|5|6|7|0|5|8|62|13|63|8|64|39|40|3246166532|1284195221504|36000000|8|65|13|63|8|66|39|40|3246183375|1284195221504|879000000|8|47|13|147|-518|-522|8|49|13|148|8|149|10|5|6|7|0|1|11|-8|13|127|-518|-540|8|150|13|151|8|152|10|5|6|7|0|0|-518|-548|8|153|10|5|6|7|0|0|-518|-552|8|154|13|155|8|53|13|156|8|157|13|158|-1|-516|-510|13|159|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n end\n \n end\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n \n end",
"def proposal_params\n params.require(:proposal).permit(:title, :content, :deadline, :price, :accepted, :company_id, :proposal_type, :completed, :completed_on, :paid, :charge_id, :bts, :focus_points, :time_of_day, :location_id, :background, :model_release)\n end",
"def update\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to @proposal, notice: 'Orçamento instantâneo atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n\t\t@proposal = Proposal.new\n\tend",
"def update\n respond_to do |format|\n if @proposal.update(proposal_params)\n format.html { redirect_to :back, notice: 'La proposition a été modifiée.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @propositions = Proposal.where(consultant_id: @collaborator.id)\n end",
"def proposal_params\n params.require(:proposal).permit(:proposal_status_id, :not_approved_comment )\n end",
"def index\n if current_user.user_type == 'creative'\n @proposals = Proposal.where(user: current_user).where(completed: nil).order(:created_at).page params[:page]\n else\n @proposals = Proposal.where(company: current_user.company).order(:created_at).page params[:page]\n end\n end",
"def update\n respond_to do |format|\n if @proposal.accepted == true\n format.html { redirect_to @proposal, notice: 'The Proposal Can Not Be Changed After It Has Been Assigned' }\n end\n unless params[:proposal][:bts].nil? || params[:proposal][:bts].count == 0\n @proposal.bts.clear\n params[:proposal][:bts].each do |bt|\n @proposal.bts << bt\n end\n end\n unless params[:proposal][:focus_points].nil? || params[:proposal][:focus_points].count == 0\n @proposal.focus_points.clear\n params[:proposal][:focus_points].each do |fp|\n @proposal.focus_points << fp\n end\n end\n if @proposal.update(proposal_params)\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { render :show, status: :ok, location: @proposal }\n else\n format.html { render :edit }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def gov_proposals_proposal_id_get_with_http_info(proposal_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: GovernanceApi.gov_proposals_proposal_id_get ...'\n end\n # verify the required parameter 'proposal_id' is set\n if @api_client.config.client_side_validation && proposal_id.nil?\n fail ArgumentError, \"Missing the required parameter 'proposal_id' when calling GovernanceApi.gov_proposals_proposal_id_get\"\n end\n # resource path\n local_var_path = '/gov/proposals/{proposalId}'.sub('{' + 'proposalId' + '}', proposal_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'TextProposal')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GovernanceApi#gov_proposals_proposal_id_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n respond_to do |format|\n if proposal.update_attributes(proposal_params)\n format.html { redirect_to(@proposal, :notice => 'Proposal was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @proposal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @proposal = listing.proposals.build(params[:proposal])\n\n #prolly a better way to do this\n @proposal.proposer_id = current_user.id\n\n respond_to do |format|\n if @proposal.save\n format.html { redirect_to listing_proposal_url(@listing, @proposal), notice: 'Proposal was successfully created.' }\n format.json { render json: @proposal, status: :created, location: @proposal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @pledge = Pledge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pledge }\n end\n end",
"def show\n @thesis_proposal = ThesisProposal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @thesis_proposal }\n end\n end",
"def show\n @paragraph_rating = ParagraphRating.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @paragraph_rating }\n end\n end",
"def index\n\n if current_user.isAdmin?\n @proposals = Proposal.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proposals }\n end\n\n elsif current_user.isStudent?\n @proposals = Proposal.all\n @proposal = Proposal.new\n\n respond_to do |format|\n format.html { render 'index_student' }\n format.json { render json: @proposals }\n end\n end\n\n end",
"def index\n @proposal_positions = ProposalPosition.all\n end",
"def show\n @solution = @idea.solutions.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @solution }\n end\n end",
"def show\n @change_suggestion = ChangeSuggestion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @change_suggestion }\n end\n end",
"def index\n @ideas = Idea.all\n\n render json: @ideas\n end",
"def create\n @proposal = Proposal.new(params[:proposal])\n\n respond_to do |format|\n if @proposal.save\n format.html { redirect_to(@proposal, :notice => 'Proposal was successfully created.') }\n format.xml { render :xml => @proposal, :status => :created, :location => @proposal }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @proposal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def destroy\n @proposal = Proposal.find(params[:id])\n committee = @proposal.committee\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to committee_path(committee) }\n format.json { head :no_content }\n end\n end"
] |
[
"0.783358",
"0.7670677",
"0.7426053",
"0.7383007",
"0.7237042",
"0.7237042",
"0.7177102",
"0.7021893",
"0.70093054",
"0.68766254",
"0.6743452",
"0.6633271",
"0.6588128",
"0.6507679",
"0.64621466",
"0.64602923",
"0.64602923",
"0.64602923",
"0.63885087",
"0.6378215",
"0.63140625",
"0.62686586",
"0.62686586",
"0.62686586",
"0.62686586",
"0.62686586",
"0.62686586",
"0.62686586",
"0.6260057",
"0.62173533",
"0.6208069",
"0.61462027",
"0.6145901",
"0.61376727",
"0.61163265",
"0.6115647",
"0.6115647",
"0.6084211",
"0.6055722",
"0.6049327",
"0.6016182",
"0.6015837",
"0.5974282",
"0.5971661",
"0.5939294",
"0.5916451",
"0.59076345",
"0.58998287",
"0.5899082",
"0.5884641",
"0.58802336",
"0.58473384",
"0.58413696",
"0.5790724",
"0.57855785",
"0.57846487",
"0.5766601",
"0.5760719",
"0.575929",
"0.575929",
"0.575929",
"0.57489306",
"0.5726577",
"0.5721721",
"0.57135254",
"0.57068574",
"0.5706826",
"0.5691683",
"0.5677898",
"0.5677898",
"0.566416",
"0.5652454",
"0.56516767",
"0.56255287",
"0.56208634",
"0.55883896",
"0.55869144",
"0.5585523",
"0.5585523",
"0.55805695",
"0.5573951",
"0.55685556",
"0.5558421",
"0.55481297",
"0.5522894",
"0.55216706",
"0.5517499",
"0.5503761",
"0.54953825",
"0.5486466",
"0.54727286",
"0.5471051",
"0.54533863",
"0.54376847",
"0.54266745",
"0.5413672",
"0.54092777",
"0.5407101",
"0.53910184",
"0.537606"
] |
0.63843185
|
19
|
PUT /proposals/1 PUT /proposals/1.json
|
def update
@proposal = Proposal.find(params[:id])
respond_to do |format|
if @proposal.update_attributes(update_params)
format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @proposal.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @proposal = listing.proposals.find(params[:id])\n\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @proposal.update(proposal_params)\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { render :show, status: :ok, location: @proposal }\n else\n format.html { render :edit }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @proposal = Proposal.find(params[:id])\n\n unless current_user.proposals.map {|p| p.id.to_s} .include? @proposal.id.to_s\n redirect_to proposal_path, :flash => { :error => 'Sem permissão, proposta não é sua.'}\n return\n end\n\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to @proposal, notice: 'Orçamento instantâneo atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to(@proposal, :notice => 'Proposal was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @proposal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def edit\n @proposal = listing.proposals.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @proposal.update(proposal_params)\n format.html { redirect_to :back, notice: 'La proposition a été modifiée.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if proposal.update_attributes(proposal_params)\n format.html { redirect_to(@proposal, :notice => 'Proposal was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @proposal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @proposal = Proposal.find(params[:id])\n old_priority = @proposal.priority\n\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n new_priority = @proposal.priority\n\n # insert proposal in order \n if new_priority > old_priority\n @proposal.insert_at_priority(@proposal.priority, \"ASC\")\n else\n @proposal.insert_at_priority(@proposal.priority, \"DESC\")\n end\n\n format.html { redirect_to proposals_path, notice: 'Proposal was successfully created.' }\n format.json { head :no_content }\n else\n format.html { redirect_to proposals_path, notice: 'Proposal submission unsuccessful, most probably because of duplication. ' }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @proposal.accepted == true\n format.html { redirect_to @proposal, notice: 'The Proposal Can Not Be Changed After It Has Been Assigned' }\n end\n unless params[:proposal][:bts].nil? || params[:proposal][:bts].count == 0\n @proposal.bts.clear\n params[:proposal][:bts].each do |bt|\n @proposal.bts << bt\n end\n end\n unless params[:proposal][:focus_points].nil? || params[:proposal][:focus_points].count == 0\n @proposal.focus_points.clear\n params[:proposal][:focus_points].each do |fp|\n @proposal.focus_points << fp\n end\n end\n if @proposal.update(proposal_params)\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { render :show, status: :ok, location: @proposal }\n else\n format.html { render :edit }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end",
"def set_proposal\n @proposal = Proposal.find(params[:id])\n end",
"def update\n respond_to do |format|\n# if @proposal.update(proposal_params)\n if @proposal.update_with_conflict_validation(proposal_params)\n format.html { redirect_to @proposal, notice: '提案を1件更新しました。' }\n format.json { render :show, status: :ok, location: @proposal }\n else\n format.html { render :edit }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_proposal\n @proposal = Proposal.includes(:requirements).find(params[:id])\n end",
"def proposal_params\n params.require(:proposal).permit(:title, :description, :user_id, :hackathon_id)\n end",
"def set_proposal\n unless params[:id].nil?\n @proposal = Proposal.find(params[:id])\n else\n @proposal = Proposal.find(params[:proposal_id])\n end\n end",
"def submit\n @proposal = current_user.proposals.find(params[:id])\n\n if request.post?\n @proposal.submit!\n\n redirect_to proposals_path\n end\n end",
"def proposal_params\n params.require(:proposal).permit(:title, :content, :deadline, :price, :proposal_type, :company_id, :user_id)\n end",
"def destroy\n @proposal = Proposal.find(params[:id])\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to proposals_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal = Proposal.find(params[:id])\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to proposals_url }\n format.json { head :no_content }\n end\n end",
"def update\n @thesis_proposal = ThesisProposal.find(params[:id])\n\n respond_to do |format|\n if @thesis_proposal.update_attributes(params[:thesis_proposal])\n format.html { redirect_to(@thesis_proposal, :notice => 'ThesisProposal was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @thesis_proposal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @proposals = listing.proposals\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proposals }\n end\n end",
"def proposal_params\n params.require(:proposal).permit(:admin_id, :homework_id, :cost, :notes, :status, :deadline)\n end",
"def edit_proposal(proposal_name, opts={})\n \n defaults = {\n :proposal_id_dyn_var => 'ep_proposal_id',\n :proposal_id_regexp => 'proposal.resultColumn.proposalId\\\"\\,\\\"\\([^\\\"]+\\)',\n #:proposal_dyn_var => 'ep_proposal',\n #:proposal_regexp => 'proposal\\\"\\,\\\"\\([^\\\"]+\\)',\n :proposal_num_dyn_var => 'ep_proposal_num',\n :proposal_num_regexp => 'proposal\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"\\([^\\\"]+\\)',\n :workflow_id_dyn_var => 'ep_workflow_id',\n :workflow_id_regexp => 'workflowId\\\"\\,\\\"\\([^\\\"]+\\)',\n :id_translation_id_dyn_var => 'ep_id_translation_id',\n :id_translation_id_regexp => 'id-translation\\\"\\,\\\"\\([^\\\"]+\\)',\n :code_dyn_var => 'ep_code',\n :code_regexp => 'code\\\"\\,\\\"\\([^\\\"]+\\)',\n :course_num_suffix_dyn_var => 'ep_course_num_suffix',\n :course_num_suffix_regexp => 'courseNumberSuffix\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_category_id_dyn_var => 'ep_lo_cat_id',\n :lo_category_id_regexp => 'expirationDate\\\"\\,\\\"id\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_category_dyn_var => 'ep_lo_cat',\n :lo_category_regexp => 'name\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_cat_text_dyn_var => 'ep_lo_cat_text',\n :lo_cat_text_regexp => 'loInfo\\\"\\,\\\"sequence\\\"\\,\\\"0\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_cat_id_dyn_var => 'ep_lo_cat_id',\n :lo_cat_id_regexp => '\\([^\\\"]+\\)\\\"\\,\\\"loRepositoryKey',\n :create_id_dyn_var => 'ep_create_id',\n :create_id_regexp => 'createId\\\"\\,\\\"\\([^\\\"]+\\)',\n :course_title_dyn_var => 'ep_course_title',\n :course_title_regexp => 'courseTitle\\\"\\,\\\"\\([^\\\"]+\\)',\n :oversight_org_dyn_var => 'ep_oversight_org',\n :oversight_org_regexp => 'curriculumOversightOrgs\\\"\\,\\\"[^\\,]+\\,\\\"\\([^\\\"]+\\)',\n :lab_fee_id_dyn_var => 'ep_lab_fee_id',\n :lab_fee_id_regexp => 'kuali.enum.type.feeTypes.labFee\\\"\\,\\\"\\([^\\\"]+\\)',\n :atp_dur_week_id_dyn_var => 'ep_atp_dur_week_id',\n :atp_dur_week_id_regexp => 'kuali.atp.duration.Week\\\"\\,\\\"Week\\\"\\,\\\"\\([^\\\"]+\\)',\n :lab_id_dyn_var => 'ep_lab_id',\n :lab_id_regexp => 'Lab\\\"\\,\\\"\\([^\\\"]+\\)',\n :grade_id_dyn_var => 'ep_grade_id',\n :grade_id_regexp => 'kuali.resultComponent.grade[^\\,]+\\,\\\"[^\\,]+\\,\\\"\\([^\\\"]+\\)',\n :person_id_dyn_var => 'ep_person_id',\n :person_id_regexp => 'personId\\\"\\,\\\"\\([^\\\"]+\\)',\n :joints_dyn_var => 'ep_joints',\n :joints_regexp => 'joints\\\"\\,\\\"\\([^\\\"]+\\)',\n :subject_area_dyn_var => 'ep_subject_area',\n :subject_area_regexp => 'subjectArea\\\"\\,\\\"\\([^\\\"]+\\)',\n :title_dyn_var => 'ep_title',\n :title_regexp => 'proposal\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"\\([^\\\"]+\\)',\n :rationale_dyn_var => 'ep_rationale',\n :rationale_regexp => 'rationale\\\"\\,\\\"\\([^\\\"]+\\)',\n :modify_fields => {\n :course_information => {},\n :governance => {},\n :course_logistics => {},\n :learning_objectives => {},\n :active_dates => {},\n :financials => {}\n }\n }\n \n opts = defaults.merge(opts)\n \n # Search for proposal\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|13|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.lang.Integer/3438268394|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|proposal.queryParam.proposalOptionalName|#{proposal_name}|proposal.search.generic|proposal.resultColumn.proposalOptionalName|1|2|3|4|1|5|5|6|10|7|0|8|1|9|10|0|11|12|13|0|6|0|\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:proposal_id_dyn_var], \"re\" => opts[:proposal_id_regexp]}\n ]\n }\n )\n \n # Select\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|526F889935910B01B2508B535A13901E|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|isAuthorized|org.kuali.student.core.rice.authorization.PermissionType/259370389|java.util.Map|java.util.HashMap/962170901|java.lang.String/2004016611|kualiStudentObjectWorkflowId|%%_#{opts[:proposal_id_dyn_var]}%%|1|2|3|4|2|5|6|5|1|7|1|8|9|8|10|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add_thinktime(2)\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|526F889935910B01B2508B535A13901E|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|getMetadata|java.lang.String/2004016611|kualiStudentObjectWorkflowId|%%_#{opts[:proposal_id_dyn_var]}%%|1|2|3|4|2|5|5|6|7|\"\n },{'subst' => 'true'}\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|526F889935910B01B2508B535A13901E|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|getData|java.lang.String/2004016611|%%_#{opts[:proposal_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:workflow_id_dyn_var], \"re\" => opts[:workflow_id_regexp]},\n {\"name\" => opts[:id_translation_id_dyn_var], \"re\" => opts[:id_translation_id_regexp]},\n {\"name\" => opts[:code_dyn_var], \"re\" => opts[:code_regexp]},\n {\"name\" => opts[:course_num_suffix_dyn_var], \"re\" => opts[:course_num_suffix_regexp]},\n {\"name\" => opts[:lo_category_id_dyn_var], \"re\" => opts[:lo_category_id_regexp]},\n {\"name\" => opts[:lo_category_dyn_var], \"re\" => opts[:lo_category_dyn_var]},\n {\"name\" => opts[:lo_cat_text_dyn_var], \"re\" => opts[:lo_cat_text_regexp]},\n {\"name\" => opts[:lo_cat_id_dyn_var], \"re\" => opts[:lo_cat_id_regexp]},\n {\"name\" => opts[:create_id_dyn_var], \"re\" => opts[:create_id_regexp]},\n {\"name\" => opts[:course_title_dyn_var], \"re\" => opts[:course_title_regexp]},\n {\"name\" => opts[:oversight_org_dyn_var], \"re\" => opts[:oversight_org_regexp]},\n {\"name\" => opts[:lab_fee_id_dyn_var], \"re\" => opts[:lab_fee_id_regexp]},\n {\"name\" => opts[:atp_dur_week_id_dyn_var], \"re\" => opts[:atp_dur_week_id_regexp]},\n {\"name\" => opts[:lab_id_dyn_var], \"re\" => opts[:lab_id_regexp]},\n {\"name\" => opts[:grade_id_dyn_var], \"re\" => opts[:grade_id_regexp]},\n {\"name\" => opts[:person_id_dyn_var], \"re\" => opts[:person_id_regexp]},\n {\"name\" => opts[:joints_dyn_var], \"re\" => opts[:joints_regexp]},\n {\"name\" => opts[:subject_area_dyn_var], \"re\" => opts[:subject_area_regexp]},\n {\"name\" => opts[:proposal_dyn_var], \"re\" => opts[:proposal_regexp]},\n {\"name\" => opts[:proposal_num_dyn_var], \"re\" => opts[:proposal_num_regexp]},\n {\"name\" => opts[:title_dyn_var], \"re\" => opts[:title_regexp]},\n {\"name\" => opts[:rationale_dyn_var], \"re\" => opts[:rationale_regexp]}\n ]\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|1|2|3|4|1|5|5|0|0|6|0|7|0|0|0|\"\n }\n )\n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|1|2|3|4|1|5|5|0|0|6|0|7|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.percentage|kuali.resultComponent.grade.recitalReview|kuali.resultComponent.grade.designReview|kuali.resultComponent.grade.completedNotation|lrc.search.resultComponent|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|6|11|12|11|13|11|14|11|15|11|16|11|17|0|18|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.percentage|kuali.resultComponent.grade.recitalReview|kuali.resultComponent.grade.designReview|kuali.resultComponent.grade.completedNotation|lrc.search.resultComponent|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|6|11|12|11|13|11|14|11|15|11|16|11|17|0|18|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|enumeration.queryParam.enumerationType|kuali.lu.finalExam.status|enumeration.management.search|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|enumeration.queryParam.enumerationType|kuali.lu.finalExam.status|enumeration.management.search|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|0|0|0|\"\n }\n )\n \n @request.add_thinktime(2)\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n \n # Edit Proposal\n \n if(!opts[:modify_fields][:course_information].empty?)\n \n if(opts[:modify_fields][:course_information][:description])\n \n # Save changes\n contents1 = \"5|0|159|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|526F889935910B01B2508B535A13901E|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.core.assembly.data.Data/3119441076|org.kuali.student.core.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.core.assembly.data.Data$StringKey/1742996354|administeringOrgs|org.kuali.student.core.assembly.data.Data$DataValue/4040075329|org.kuali.student.core.assembly.data.Data$IntegerKey/2690592210|java.lang.Integer/3438268394|org.kuali.student.core.assembly.data.Data$StringValue/3696151110|58|_runtimeData|id-translation|%%_#{opts[:id_translation_id_dyn_var]}%%|passFail|org.kuali.student.core.assembly.data.Data$BooleanValue/268767974|java.lang.Boolean/476441737|audit|finalExamStatus|STD|campusLocations|ALL|All|code|%%_#{opts[:code_dyn_var]}%%|courseNumberSuffix|%%_#{opts[:course_num_suffix_dyn_var]}%%|courseSpecificLOs|loCategoryInfoList|desc|formatted|<p>Desc</p>|plain|Desc|effectiveDate|org.kuali.student.core.assembly.data.Data$DateValue/3833457837|java.sql.Timestamp/1769758459|expirationDate|id|%%_#{opts[:lo_category_id_dyn_var]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|versionInd|1|name|%%_#{opts[:lo_category_dyn_var]}%%|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|0|%%_#{opts[:lo_cat_text_dyn_var]}%%|%%_#{opts[:lo_cat_id_dyn_var]}%%|loRepositoryKey|createId|%%_#{opts[:create_id_dyn_var]}%%|createTime|updateId|updateTime|SINGLE USE LO|kuali.lo.type.singleUse|courseTitle|%%_#{opts[:course_title_dyn_var]}%%|creditOptions|fixedCreditValue|10|kuali.creditType.credit.degree.10|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|curriculumOversightOrgs|51|%%_#{opts[:oversight_org_dyn_var]}%%|descr|#{opts[:modify_fields][:course_information][:description]}|dirty|duration|atpDurationTypeKey|kuali.atp.duration.Year|timeQuantity|org.kuali.student.core.assembly.data.Data$IntegerValue/991919491|Year|expenditure|affiliatedOrgs|feeJustification|fees|feeAmounts|currencyQuantity|currencyTypeKey|kuali.currency.type.usdollars.cents|feeType|kuali.enum.type.feeTypes.labFee|%%_#{opts[:lab_fee_id_dyn_var]}%%|rateType|fixedRateFee|Fixed Rate Fee|Laboratory Fee|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_dur_week_id_dyn_var]}%%|2|draft|Lab|%%_#{opts[:lab_id_dyn_var]}%%|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:grade_id_dyn_var]}%%|instructors|personId|%%_#{opts[:person_id_dyn_var]}%%|joints|%%_#{opts[:joints_dyn_var]}%%|pilotCourse|revenues|specialTopicsCourse|subjectArea|%%_#{opts[:subject_area_dyn_var]}%%|termsOffered|kuali.atp.season.Any|Any|kuali.lu.type.CreditCourse|variations|Standard final Exam|transcriptTitle|proposal|%%_#{opts[:proposal_id_dyn_var]}%%|%%_#{opts[:proposal_num_dyn_var]}%%|%%_#{opts[:title_dyn_var]}%%|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|%%_#{opts[:rationale_dyn_var]}%%|kuali.proposal.type.course.create|workflowId|%%_#{opts[:workflow_id_dyn_var]}%%|\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|34|8|9|10|5|6|7|0|2|11|12|0|13|14|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|17|-12|-14|-5|-10|-1|-3|8|18|19|20|0|8|21|19|-22|8|22|13|23|8|24|10|5|6|7|0|2|11|-8|13|25|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|26|-35|-37|-29|-33|-1|-27|8|27|13|28|8|29|13|30|8|31|10|5|6|7|0|1|11|-8|10|5|6|7|0|3|8|32|10|5|6|7|0|1|11|-8|10|5|6|7|0|9|8|33|10|5|6|7|0|2|8|34|13|35|8|36|13|37|-61|-63|8|38|39|40|867724416|1198295875584|0|8|41|39|40|3896582272|1258425417728|0|8|42|13|43|8|44|13|45|8|46|10|5|6|7|0|1|8|47|13|48|-61|-81|8|49|13|50|8|51|13|52|8|53|13|54|-57|-59|-53|-55|8|55|10|5|6|7|0|0|-53|-93|8|56|10|5|6|7|0|7|8|57|13|58|8|33|10|5|6|7|0|2|8|34|13|59|8|36|13|59|-99|-103|8|42|13|60|8|61|13|45|8|46|10|5|6|7|0|5|8|62|13|63|8|64|39|40|3246181412|1284195221504|916000000|8|65|13|63|8|66|39|40|3246183944|1284195221504|448000000|8|47|13|48|-99|-115|8|49|13|67|8|53|13|68|-53|-97|-49|-51|-1|-47|8|69|13|70|8|71|10|5|6|7|0|1|11|-8|10|5|6|7|0|6|8|72|13|73|8|42|13|74|8|46|10|5|6|7|0|1|8|47|13|58|-143|-149|8|75|10|5|6|7|0|1|11|-8|13|73|-143|-155|8|53|13|76|8|15|10|5|6|7|0|1|8|53|10|5|6|7|0|1|8|16|13|77|-165|-167|-143|-163|-139|-141|-1|-137|8|78|10|5|6|7|0|0|-1|-173|8|79|10|5|6|7|0|2|11|-8|13|80|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|81|-185|-187|-179|-183|-1|-177|8|82|10|5|6|7|0|2|8|36|13|83|8|15|10|5|6|7|0|1|8|84|10|5|6|7|0|1|8|36|19|20|1|-201|-203|-195|-199|-1|-193|8|85|10|5|6|7|0|3|8|86|13|87|8|88|89|12|1|8|15|10|5|6|7|0|1|8|86|10|5|6|7|0|1|8|16|13|90|-221|-223|-212|-219|-1|-210|8|91|10|5|6|7|0|1|8|92|10|5|6|7|0|0|-231|-233|-1|-229|8|93|10|5|6|7|0|0|-1|-237|8|94|10|5|6|7|0|1|11|-8|10|5|6|7|0|5|8|95|10|5|6|7|0|1|11|-8|10|5|6|7|0|2|8|96|89|12|10|8|97|13|98|-251|-253|-247|-249|8|99|13|100|8|42|13|101|8|102|13|103|8|15|10|5|6|7|0|2|8|102|10|5|6|7|0|1|8|16|13|104|-270|-272|8|99|10|5|6|7|0|1|8|16|13|105|-270|-278|-247|-268|-243|-245|-1|-241|8|106|10|5|6|7|0|1|11|-8|10|5|6|7|0|5|8|107|10|5|6|7|0|1|11|-8|10|5|6|7|0|9|8|108|13|109|8|110|10|5|6|7|0|3|8|111|13|73|8|112|13|113|8|15|10|5|6|7|0|1|8|112|10|5|6|7|0|1|8|16|13|114|-312|-314|-304|-310|-298|-302|8|79|10|5|6|7|0|0|-298|-320|8|115|89|12|100|8|85|10|5|6|7|0|3|8|86|13|116|8|88|89|12|12|8|15|10|5|6|7|0|1|8|86|10|5|6|7|0|1|8|16|13|117|-338|-340|-329|-336|-298|-327|8|42|13|118|8|46|10|5|6|7|0|5|8|62|13|63|8|64|39|40|3246177449|1284195221504|953000000|8|65|13|63|8|66|39|40|3246183904|1284195221504|408000000|8|47|13|119|-298|-348|8|51|13|120|8|15|10|5|6|7|0|1|8|108|10|5|6|7|0|1|8|16|13|121|-368|-370|-298|-366|-294|-296|-290|-292|8|42|13|122|8|46|10|5|6|7|0|5|8|62|13|63|8|64|39|40|3246177416|1284195221504|920000000|8|65|13|63|8|66|39|40|3246183890|1284195221504|394000000|8|47|13|119|-290|-378|8|51|13|120|8|53|13|123|-286|-288|-1|-284|8|124|10|5|6|7|0|2|11|-8|13|125|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|126|-406|-408|-400|-404|-1|-398|8|42|13|127|8|128|10|5|6|7|0|1|11|-8|10|5|6|7|0|2|8|129|13|63|8|15|10|5|6|7|0|1|8|129|10|5|6|7|0|1|8|16|13|130|-428|-430|-422|-426|-418|-420|-1|8|128|8|131|10|5|6|7|0|0|-1|-437|8|46|10|5|6|7|0|5|8|62|13|63|8|64|39|40|3246166611|1284195221504|115000000|8|65|13|63|8|66|39|40|3246183834|1284195221504|338000000|8|47|13|132|-1|-441|8|133|19|-22|8|134|10|5|6|7|0|0|-1|-459|8|135|19|-22|8|51|13|120|8|136|13|137|8|138|10|5|6|7|0|2|11|-8|13|139|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|140|-477|-479|-471|-475|-1|-469|8|53|13|141|8|142|10|5|6|7|0|0|-1|-487|8|15|10|5|6|7|0|3|8|136|10|5|6|7|0|1|8|16|13|137|-493|-495|8|22|10|5|6|7|0|1|8|16|13|143|-493|-501|-203|10|5|6|7|0|3|8|144|19|-209|8|128|19|-209|8|136|19|-209|-493|-203|-1|-491|8|145|10|5|6|7|0|10|8|42|13|146|8|46|10|5|6|7|0|5|8|62|13|63|8|64|39|40|3246166532|1284195221504|36000000|8|65|13|63|8|66|39|40|3246183375|1284195221504|879000000|8|47|13|147|-518|-522|8|49|13|148|8|149|10|5|6|7|0|1|11|-8|13|127|-518|-540|8|150|13|151|8|152|10|5|6|7|0|0|-518|-548|8|153|10|5|6|7|0|0|-518|-552|8|154|13|155|8|53|13|156|8|157|13|158|-1|-516|-510|13|159|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n end\n \n end\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n \n end",
"def edit_proposal(proposal_name, opts={})\n \n defaults = {\n :proposal_id_dyn_var => 'ep_proposal_id',\n :proposal_id_regexp => 'proposal.resultColumn.proposalId\\\"\\,\\\"\\([^\\\"]+\\)',\n #:proposal_dyn_var => 'ep_proposal',\n #:proposal_regexp => 'proposal\\\"\\,\\\"\\([^\\\"]+\\)',\n :proposal_num_dyn_var => 'ep_proposal_num',\n :proposal_num_regexp => 'proposal\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"\\([^\\\"]+\\)',\n :workflow_id_dyn_var => 'ep_workflow_id',\n :workflow_id_regexp => 'workflowId\\\"\\,\\\"\\([^\\\"]+\\)',\n :id_translation_id_dyn_var => 'ep_id_translation_id',\n :id_translation_id_regexp => 'id-translation\\\"\\,\\\"\\([^\\\"]+\\)',\n :code_dyn_var => 'ep_code',\n :code_regexp => 'code\\\"\\,\\\"\\([^\\\"]+\\)',\n :course_num_suffix_dyn_var => 'ep_course_num_suffix',\n :course_num_suffix_regexp => 'courseNumberSuffix\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_category_id_dyn_var => 'ep_lo_cat_id',\n :lo_category_id_regexp => 'expirationDate\\\"\\,\\\"id\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_category_dyn_var => 'ep_lo_cat',\n :lo_category_regexp => 'name\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_cat_text_dyn_var => 'ep_lo_cat_text',\n :lo_cat_text_regexp => 'loInfo\\\"\\,\\\"sequence\\\"\\,\\\"0\\\"\\,\\\"\\([^\\\"]+\\)',\n :lo_cat_id_dyn_var => 'ep_lo_cat_id',\n :lo_cat_id_regexp => '\\([^\\\"]+\\)\\\"\\,\\\"loRepositoryKey',\n :create_id_dyn_var => 'ep_create_id',\n :create_id_regexp => 'createId\\\"\\,\\\"\\([^\\\"]+\\)',\n :course_title_dyn_var => 'ep_course_title',\n :course_title_regexp => 'courseTitle\\\"\\,\\\"\\([^\\\"]+\\)',\n :oversight_org_dyn_var => 'ep_oversight_org',\n :oversight_org_regexp => 'curriculumOversightOrgs\\\"\\,\\\"[^\\,]+\\,\\\"\\([^\\\"]+\\)',\n :lab_fee_id_dyn_var => 'ep_lab_fee_id',\n :lab_fee_id_regexp => 'kuali.enum.type.feeTypes.labFee\\\"\\,\\\"\\([^\\\"]+\\)',\n :atp_dur_week_id_dyn_var => 'ep_atp_dur_week_id',\n :atp_dur_week_id_regexp => 'kuali.atp.duration.Week\\\"\\,\\\"Week\\\"\\,\\\"\\([^\\\"]+\\)',\n :lab_id_dyn_var => 'ep_lab_id',\n :lab_id_regexp => 'Lab\\\"\\,\\\"\\([^\\\"]+\\)',\n :grade_id_dyn_var => 'ep_grade_id',\n :grade_id_regexp => 'kuali.resultComponent.grade[^\\,]+\\,\\\"[^\\,]+\\,\\\"\\([^\\\"]+\\)',\n :person_id_dyn_var => 'ep_person_id',\n :person_id_regexp => 'personId\\\"\\,\\\"\\([^\\\"]+\\)',\n :joints_dyn_var => 'ep_joints',\n :joints_regexp => 'joints\\\"\\,\\\"\\([^\\\"]+\\)',\n :subject_area_dyn_var => 'ep_subject_area',\n :subject_area_regexp => 'subjectArea\\\"\\,\\\"\\([^\\\"]+\\)',\n :title_dyn_var => 'ep_title',\n :title_regexp => 'proposal\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"\\([^\\\"]+\\)',\n :rationale_dyn_var => 'ep_rationale',\n :rationale_regexp => 'rationale\\\"\\,\\\"\\([^\\\"]+\\)',\n :modify_fields => {\n :course_information => {},\n :governance => {},\n :course_logistics => {},\n :learning_objectives => {},\n :active_dates => {},\n :financials => {}\n }\n }\n \n opts = defaults.merge(opts)\n \n # Search for proposal\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|13|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.lang.Integer/3438268394|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|proposal.queryParam.proposalOptionalName|#{proposal_name}|proposal.search.generic|proposal.resultColumn.proposalOptionalName|1|2|3|4|1|5|5|6|10|7|0|8|1|9|10|0|11|12|13|0|6|0|\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:proposal_id_dyn_var], \"regexp\" => opts[:proposal_id_regexp]}\n ]\n }\n )\n \n # Select\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|526F889935910B01B2508B535A13901E|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|isAuthorized|org.kuali.student.core.rice.authorization.PermissionType/259370389|java.util.Map|java.util.HashMap/962170901|java.lang.String/2004016611|kualiStudentObjectWorkflowId|%%_#{opts[:proposal_id_dyn_var]}%%|1|2|3|4|2|5|6|5|1|7|1|8|9|8|10|\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n @request.add_thinktime(2)\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|526F889935910B01B2508B535A13901E|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|getMetadata|java.lang.String/2004016611|kualiStudentObjectWorkflowId|%%_#{opts[:proposal_id_dyn_var]}%%|1|2|3|4|2|5|5|6|7|\"\n },{'subst' => 'true'}\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|526F889935910B01B2508B535A13901E|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|getData|java.lang.String/2004016611|%%_#{opts[:proposal_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:workflow_id_dyn_var], \"regexp\" => opts[:workflow_id_regexp]},\n {\"name\" => opts[:id_translation_id_dyn_var], \"regexp\" => opts[:id_translation_id_regexp]},\n {\"name\" => opts[:code_dyn_var], \"regexp\" => opts[:code_regexp]},\n {\"name\" => opts[:course_num_suffix_dyn_var], \"regexp\" => opts[:course_num_suffix_regexp]},\n {\"name\" => opts[:lo_category_id_dyn_var], \"regexp\" => opts[:lo_category_id_regexp]},\n {\"name\" => opts[:lo_category_dyn_var], \"regexp\" => opts[:lo_category_dyn_var]},\n {\"name\" => opts[:lo_cat_text_dyn_var], \"regexp\" => opts[:lo_cat_text_regexp]},\n {\"name\" => opts[:lo_cat_id_dyn_var], \"regexp\" => opts[:lo_cat_id_regexp]},\n {\"name\" => opts[:create_id_dyn_var], \"regexp\" => opts[:create_id_regexp]},\n {\"name\" => opts[:course_title_dyn_var], \"regexp\" => opts[:course_title_regexp]},\n {\"name\" => opts[:oversight_org_dyn_var], \"regexp\" => opts[:oversight_org_regexp]},\n {\"name\" => opts[:lab_fee_id_dyn_var], \"regexp\" => opts[:lab_fee_id_regexp]},\n {\"name\" => opts[:atp_dur_week_id_dyn_var], \"regexp\" => opts[:atp_dur_week_id_regexp]},\n {\"name\" => opts[:lab_id_dyn_var], \"regexp\" => opts[:lab_id_regexp]},\n {\"name\" => opts[:grade_id_dyn_var], \"regexp\" => opts[:grade_id_regexp]},\n {\"name\" => opts[:person_id_dyn_var], \"regexp\" => opts[:person_id_regexp]},\n {\"name\" => opts[:joints_dyn_var], \"regexp\" => opts[:joints_regexp]},\n {\"name\" => opts[:subject_area_dyn_var], \"regexp\" => opts[:subject_area_regexp]},\n {\"name\" => opts[:proposal_dyn_var], \"regexp\" => opts[:proposal_regexp]},\n {\"name\" => opts[:proposal_num_dyn_var], \"regexp\" => opts[:proposal_num_regexp]},\n {\"name\" => opts[:title_dyn_var], \"regexp\" => opts[:title_regexp]},\n {\"name\" => opts[:rationale_dyn_var], \"regexp\" => opts[:rationale_regexp]}\n ]\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|1|2|3|4|1|5|5|0|0|6|0|7|0|0|0|\"\n }\n )\n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|1|2|3|4|1|5|5|0|0|6|0|7|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.percentage|kuali.resultComponent.grade.recitalReview|kuali.resultComponent.grade.designReview|kuali.resultComponent.grade.completedNotation|lrc.search.resultComponent|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|6|11|12|11|13|11|14|11|15|11|16|11|17|0|18|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.percentage|kuali.resultComponent.grade.recitalReview|kuali.resultComponent.grade.designReview|kuali.resultComponent.grade.completedNotation|lrc.search.resultComponent|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|6|11|12|11|13|11|14|11|15|11|16|11|17|0|18|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|enumeration.queryParam.enumerationType|kuali.lu.finalExam.status|enumeration.management.search|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|0|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|enumeration.queryParam.enumerationType|kuali.lu.finalExam.status|enumeration.management.search|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|0|0|0|\"\n }\n )\n \n @request.add_thinktime(2)\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n \n # Edit Proposal\n \n if(!opts[:modify_fields][:course_information].empty?)\n \n if(opts[:modify_fields][:course_information][:description])\n \n # Save changes\n contents1 = \"5|0|159|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|526F889935910B01B2508B535A13901E|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.core.assembly.data.Data/3119441076|org.kuali.student.core.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.core.assembly.data.Data$StringKey/1742996354|administeringOrgs|org.kuali.student.core.assembly.data.Data$DataValue/4040075329|org.kuali.student.core.assembly.data.Data$IntegerKey/2690592210|java.lang.Integer/3438268394|org.kuali.student.core.assembly.data.Data$StringValue/3696151110|58|_runtimeData|id-translation|%%_#{opts[:id_translation_id_dyn_var]}%%|passFail|org.kuali.student.core.assembly.data.Data$BooleanValue/268767974|java.lang.Boolean/476441737|audit|finalExamStatus|STD|campusLocations|ALL|All|code|%%_#{opts[:code_dyn_var]}%%|courseNumberSuffix|%%_#{opts[:course_num_suffix_dyn_var]}%%|courseSpecificLOs|loCategoryInfoList|desc|formatted|<p>Desc</p>|plain|Desc|effectiveDate|org.kuali.student.core.assembly.data.Data$DateValue/3833457837|java.sql.Timestamp/1769758459|expirationDate|id|%%_#{opts[:lo_category_id_dyn_var]}%%|loRepository|kuali.loRepository.key.singleUse|metaInfo|versionInd|1|name|%%_#{opts[:lo_category_dyn_var]}%%|state|active|type|loCategoryType.subject|loDisplayInfoList|loInfo|sequence|0|%%_#{opts[:lo_cat_text_dyn_var]}%%|%%_#{opts[:lo_cat_id_dyn_var]}%%|loRepositoryKey|createId|%%_#{opts[:create_id_dyn_var]}%%|createTime|updateId|updateTime|SINGLE USE LO|kuali.lo.type.singleUse|courseTitle|%%_#{opts[:course_title_dyn_var]}%%|creditOptions|fixedCreditValue|10|kuali.creditType.credit.degree.10|resultValues|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|curriculumOversightOrgs|51|%%_#{opts[:oversight_org_dyn_var]}%%|descr|#{opts[:modify_fields][:course_information][:description]}|dirty|duration|atpDurationTypeKey|kuali.atp.duration.Year|timeQuantity|org.kuali.student.core.assembly.data.Data$IntegerValue/991919491|Year|expenditure|affiliatedOrgs|feeJustification|fees|feeAmounts|currencyQuantity|currencyTypeKey|kuali.currency.type.usdollars.cents|feeType|kuali.enum.type.feeTypes.labFee|%%_#{opts[:lab_fee_id_dyn_var]}%%|rateType|fixedRateFee|Fixed Rate Fee|Laboratory Fee|formats|activities|activityType|kuali.lu.type.activity.Lab|contactHours|unitQuantity|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|kuali.atp.duration.Week|Week|%%_#{opts[:atp_dur_week_id_dyn_var]}%%|2|draft|Lab|%%_#{opts[:lab_id_dyn_var]}%%|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|Letter|%%_#{opts[:grade_id_dyn_var]}%%|instructors|personId|%%_#{opts[:person_id_dyn_var]}%%|joints|%%_#{opts[:joints_dyn_var]}%%|pilotCourse|revenues|specialTopicsCourse|subjectArea|%%_#{opts[:subject_area_dyn_var]}%%|termsOffered|kuali.atp.season.Any|Any|kuali.lu.type.CreditCourse|variations|Standard final Exam|transcriptTitle|proposal|%%_#{opts[:proposal_id_dyn_var]}%%|%%_#{opts[:proposal_num_dyn_var]}%%|%%_#{opts[:title_dyn_var]}%%|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|%%_#{opts[:rationale_dyn_var]}%%|kuali.proposal.type.course.create|workflowId|%%_#{opts[:workflow_id_dyn_var]}%%|\"\n contents2 = \"|1|2|3|4|1|5|5|6|7|0|34|8|9|10|5|6|7|0|2|11|12|0|13|14|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|17|-12|-14|-5|-10|-1|-3|8|18|19|20|0|8|21|19|-22|8|22|13|23|8|24|10|5|6|7|0|2|11|-8|13|25|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|26|-35|-37|-29|-33|-1|-27|8|27|13|28|8|29|13|30|8|31|10|5|6|7|0|1|11|-8|10|5|6|7|0|3|8|32|10|5|6|7|0|1|11|-8|10|5|6|7|0|9|8|33|10|5|6|7|0|2|8|34|13|35|8|36|13|37|-61|-63|8|38|39|40|867724416|1198295875584|0|8|41|39|40|3896582272|1258425417728|0|8|42|13|43|8|44|13|45|8|46|10|5|6|7|0|1|8|47|13|48|-61|-81|8|49|13|50|8|51|13|52|8|53|13|54|-57|-59|-53|-55|8|55|10|5|6|7|0|0|-53|-93|8|56|10|5|6|7|0|7|8|57|13|58|8|33|10|5|6|7|0|2|8|34|13|59|8|36|13|59|-99|-103|8|42|13|60|8|61|13|45|8|46|10|5|6|7|0|5|8|62|13|63|8|64|39|40|3246181412|1284195221504|916000000|8|65|13|63|8|66|39|40|3246183944|1284195221504|448000000|8|47|13|48|-99|-115|8|49|13|67|8|53|13|68|-53|-97|-49|-51|-1|-47|8|69|13|70|8|71|10|5|6|7|0|1|11|-8|10|5|6|7|0|6|8|72|13|73|8|42|13|74|8|46|10|5|6|7|0|1|8|47|13|58|-143|-149|8|75|10|5|6|7|0|1|11|-8|13|73|-143|-155|8|53|13|76|8|15|10|5|6|7|0|1|8|53|10|5|6|7|0|1|8|16|13|77|-165|-167|-143|-163|-139|-141|-1|-137|8|78|10|5|6|7|0|0|-1|-173|8|79|10|5|6|7|0|2|11|-8|13|80|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|81|-185|-187|-179|-183|-1|-177|8|82|10|5|6|7|0|2|8|36|13|83|8|15|10|5|6|7|0|1|8|84|10|5|6|7|0|1|8|36|19|20|1|-201|-203|-195|-199|-1|-193|8|85|10|5|6|7|0|3|8|86|13|87|8|88|89|12|1|8|15|10|5|6|7|0|1|8|86|10|5|6|7|0|1|8|16|13|90|-221|-223|-212|-219|-1|-210|8|91|10|5|6|7|0|1|8|92|10|5|6|7|0|0|-231|-233|-1|-229|8|93|10|5|6|7|0|0|-1|-237|8|94|10|5|6|7|0|1|11|-8|10|5|6|7|0|5|8|95|10|5|6|7|0|1|11|-8|10|5|6|7|0|2|8|96|89|12|10|8|97|13|98|-251|-253|-247|-249|8|99|13|100|8|42|13|101|8|102|13|103|8|15|10|5|6|7|0|2|8|102|10|5|6|7|0|1|8|16|13|104|-270|-272|8|99|10|5|6|7|0|1|8|16|13|105|-270|-278|-247|-268|-243|-245|-1|-241|8|106|10|5|6|7|0|1|11|-8|10|5|6|7|0|5|8|107|10|5|6|7|0|1|11|-8|10|5|6|7|0|9|8|108|13|109|8|110|10|5|6|7|0|3|8|111|13|73|8|112|13|113|8|15|10|5|6|7|0|1|8|112|10|5|6|7|0|1|8|16|13|114|-312|-314|-304|-310|-298|-302|8|79|10|5|6|7|0|0|-298|-320|8|115|89|12|100|8|85|10|5|6|7|0|3|8|86|13|116|8|88|89|12|12|8|15|10|5|6|7|0|1|8|86|10|5|6|7|0|1|8|16|13|117|-338|-340|-329|-336|-298|-327|8|42|13|118|8|46|10|5|6|7|0|5|8|62|13|63|8|64|39|40|3246177449|1284195221504|953000000|8|65|13|63|8|66|39|40|3246183904|1284195221504|408000000|8|47|13|119|-298|-348|8|51|13|120|8|15|10|5|6|7|0|1|8|108|10|5|6|7|0|1|8|16|13|121|-368|-370|-298|-366|-294|-296|-290|-292|8|42|13|122|8|46|10|5|6|7|0|5|8|62|13|63|8|64|39|40|3246177416|1284195221504|920000000|8|65|13|63|8|66|39|40|3246183890|1284195221504|394000000|8|47|13|119|-290|-378|8|51|13|120|8|53|13|123|-286|-288|-1|-284|8|124|10|5|6|7|0|2|11|-8|13|125|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|126|-406|-408|-400|-404|-1|-398|8|42|13|127|8|128|10|5|6|7|0|1|11|-8|10|5|6|7|0|2|8|129|13|63|8|15|10|5|6|7|0|1|8|129|10|5|6|7|0|1|8|16|13|130|-428|-430|-422|-426|-418|-420|-1|8|128|8|131|10|5|6|7|0|0|-1|-437|8|46|10|5|6|7|0|5|8|62|13|63|8|64|39|40|3246166611|1284195221504|115000000|8|65|13|63|8|66|39|40|3246183834|1284195221504|338000000|8|47|13|132|-1|-441|8|133|19|-22|8|134|10|5|6|7|0|0|-1|-459|8|135|19|-22|8|51|13|120|8|136|13|137|8|138|10|5|6|7|0|2|11|-8|13|139|8|15|10|5|6|7|0|1|11|-8|10|5|6|7|0|1|8|16|13|140|-477|-479|-471|-475|-1|-469|8|53|13|141|8|142|10|5|6|7|0|0|-1|-487|8|15|10|5|6|7|0|3|8|136|10|5|6|7|0|1|8|16|13|137|-493|-495|8|22|10|5|6|7|0|1|8|16|13|143|-493|-501|-203|10|5|6|7|0|3|8|144|19|-209|8|128|19|-209|8|136|19|-209|-493|-203|-1|-491|8|145|10|5|6|7|0|10|8|42|13|146|8|46|10|5|6|7|0|5|8|62|13|63|8|64|39|40|3246166532|1284195221504|36000000|8|65|13|63|8|66|39|40|3246183375|1284195221504|879000000|8|47|13|147|-518|-522|8|49|13|148|8|149|10|5|6|7|0|1|11|-8|13|127|-518|-540|8|150|13|151|8|152|10|5|6|7|0|0|-518|-548|8|153|10|5|6|7|0|0|-518|-552|8|154|13|155|8|53|13|156|8|157|13|158|-1|-516|-510|13|159|0|0|\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"#{contents1}#{contents2}\"\n },\n {\n 'subst' => 'true'\n }\n )\n \n end\n \n end\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|D1DD59B8A92305DA33192DAC65F9F820|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflow_id_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n \n \n end",
"def update\n proposal_authorize(@proposal, \"update\", params[:category_service])\n\n @proposal.user = current_user\n \n respond_to do |format|\n if @proposal.update(proposal_params)\n flash_message :success, t('activerecord.messages.successfull.updated', data: @proposal.fullname)\n\n format.html { redirect_to proposal_path(@proposal, category_service: params[:category_service]) }\n format.json { render :show, status: :ok, location: @proposal }\n else\n format.html { render :edit, locals: { back_url: params[:back_url] } }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def proposal_params\n params.require(:proposal).permit(:title, :content, :deadline, :price, :accepted, :company_id, :proposal_type, :completed, :completed_on, :paid, :charge_id, :bts, :focus_points, :time_of_day, :location_id, :background, :model_release)\n end",
"def create\n @proposal = Proposal.new(params[:proposal])\n\n respond_to do |format|\n if @proposal.save\n format.html { redirect_to @proposal, notice: 'Proposal was successfully created.' }\n format.json { render json: @proposal, status: :created, location: @proposal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @proposal = Proposal.new(proposal_params)\n\n respond_to do |format|\n if @proposal.save\n format.html { redirect_to @proposal, notice: 'Proposal was successfully created.' }\n format.json { render :show, status: :created, location: @proposal }\n else\n format.html { render :new }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @parts_for_proposal.update(parts_for_proposal_params)\n curr_id = @parts_for_proposal.proposal_id\n format.html { redirect_to proposal_url(:id => curr_id), notice: 'Part configuration update was successfull.' }\n format.json { render :show, status: :ok, location: @parts_for_proposal }\n else\n format.html { render :edit }\n format.json { render json: @parts_for_proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def proposal_params\n params.require(:proposal).permit(:proposal_status_id, :not_approved_comment )\n end",
"def new\n @proposal = listing.proposals.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proposal }\n end\n end",
"def destroy\n @proposal = listing.proposals.find(params[:id])\n\n\n respond_to do |format|\n if @proposal.id == @proposal.listing.accepted_proposal_id\n format.html { redirect_to listing_proposals_url(@listing), error: \"You can't remove an accepted proposal.\" }\n format.json { head :no_content }\n else\n @proposal.destroy\n format.html { redirect_to listing_proposals_url(@listing) }\n format.json { head :no_content }\n end\n end\n end",
"def create\n @proposal = Proposal.new(params[:proposal])\n @proposal.user = current_user\n respond_to do |format|\n if @proposal.save\n format.html { redirect_to @proposal, notice: 'Proposal was successfully created.' }\n format.json { render json: @proposal, status: :created, location: @proposal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @proposal = current_user.proposals.build\n end",
"def index\n @proposals = current_user.proposals\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proposals }\n end\n end",
"def proposal_params\n params.require(:proposal).permit(:id, :branch_cd, :user_id, :proposal_date, :section_name1, :section_name2, :mail, :tel, :proposal_type, :project_type_a, :project_type_b, :project_type_c, :project_type_d, :project_type_e, :project_type_f, :proposal_title, :now_problem, :proposal_detail, :effect, :lock_version)\n end",
"def update\n respond_to do |format|\n if @course_proposal_question.update(course_proposal_question_params)\n format.html { redirect_to @course_proposal_question, notice: 'Course proposal question was successfully updated.' }\n format.json { render :show, status: :ok, location: @course_proposal_question }\n else\n format.html { render :edit }\n format.json { render json: @course_proposal_question.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @proposal = Proposal.find(params[:id])\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to(proposals_url) }\n format.xml { head :ok }\n end\n end",
"def create\n @proposal = listing.proposals.build(params[:proposal])\n\n #prolly a better way to do this\n @proposal.proposer_id = current_user.id\n\n respond_to do |format|\n if @proposal.save\n format.html { redirect_to listing_proposal_url(@listing, @proposal), notice: 'Proposal was successfully created.' }\n format.json { render json: @proposal, status: :created, location: @proposal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vote.proposal = @proposal\n @vote.user = current_user\n @comment = @proposal.comments.new\n\n respond_to do |format|\n if @vote.save\n InformCommitteeMembers.vote_submitted(@vote)\n format.html { redirect_to @proposal, notice: 'Vote was successfully created.' }\n format.json { render json: @proposal, status: :created, location: @proposal }\n else\n format.html { render \"proposals/show\" }\n format.json { render json: @vote.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @proposal = Proposal.find(params[:id])\n unless current_user.proposals.map {|p| p.id.to_s} .include? @proposal.id.to_s\n redirect_to :back, :flash => { :error => 'Sem permissão, proposta não é sua.'}\n return\n end\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to proposals_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal.destroy\n respond_to do |format|\n format.html { redirect_to proposals_url, notice: 'Proposal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal.destroy\n respond_to do |format|\n format.html { redirect_to proposals_url, notice: 'Proposal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal.destroy\n respond_to do |format|\n format.html { redirect_to proposals_url, notice: 'Proposal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal = Proposal.find(params[:id])\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Proposal was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def update\n @idea = Idea.find(params[:id])\n respond_with(@idea) do |format|\n if @idea.update_attributes(params[:idea])\n format.json { render json: @idea, status: :created, location: @idea }\n else\n format.json { render json: @idea.errors, status: :unprocessable_entity }\n end\n end\n end",
"def proposal_params\n params.require(:proposal).permit(:subject, :body)\n end",
"def update\n @proposed_person = ProposedPerson.find(params[:id])\n\n respond_to do |format|\n if @proposed_person.update_attributes(params[:proposed_person])\n flash[:notice] = 'ProposedPerson was successfully updated.'\n format.html { redirect_to(@proposed_person) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @proposed_person.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @propose = Propose.find(params[:id])\n\n respond_to do |format|\n if @propose.update_attributes(params[:propose])\n format.html { redirect_to @propose, notice: 'Propuesta actualizada' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @propose.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to(proposals_url) }\n format.xml { head :ok }\n end\n end",
"def update\n respond_to do |format|\n if @proposal_position.update(proposal_position_params)\n format.html { redirect_to @proposal_position, notice: 'Proposal position was successfully updated.' }\n format.json { render :show, status: :ok, location: @proposal_position }\n else\n format.html { render :edit }\n format.json { render json: @proposal_position.errors, status: :unprocessable_entity }\n end\n end\n end",
"def proposal_params\n params.require(:proposal).permit(:esod_category, :customer_id, :category, :note, :user_id)\n end",
"def index\n @proposals = current_user.proposals\n end",
"def modify_project_proposal1\n project_proposal = ProjectProposal.find(params[:project_proposal_id])\n if project_proposal.present?\n #conversation = Conversation.find(project_proposal.conversation_id)\n revison = project_proposal.create_proposal_revisions current_filmmaker, params[:description]\n if revison.present?\n revison.create_modified_proposal_milestones\tparams[:milestones]\n end\n content = render_to_string( layout: false, partial: \"/filmmakers/proposal_content\", locals: { project_proposal: project_proposal })\n #current_client.reply_to_conversation(conversation, content)\n #redirect_to :back\n end\n redirect_to :back, notice: \"Proposal has been modified!\"\n end",
"def index\n @proposals = Proposal.all\n\n render json: @proposals\n end",
"def index\n @proposals = Proposal.all()\n end",
"def update\n @paperproposal.update_attributes(params[:paperproposal])\n @paperproposal.save\n\n @paperproposal.dataset_paperproposals.clear if ( params[:datasets].nil? && params[:paperproposal].nil? )\n if params[:datasets]\n @datasets = Dataset.find(params[:datasets])\n @paperproposal.datasets= @datasets\n end\n update_aspects if params[:aspect]\n update_author_list(@paperproposal)\n redirect_to edit_paperproposal_path(@paperproposal)\n end",
"def set_event_proposal\n @event_proposal = EventProposal.find(params[:id])\n end",
"def create\n @proposal = Proposal.new(params[:proposal])\n\n respond_to do |format|\n if @proposal.save\n format.html { redirect_to(@proposal, :notice => 'Proposal was successfully created.') }\n format.xml { render :xml => @proposal, :status => :created, :location => @proposal }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @proposal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @idea = Idea.find(params[:id])\n\n respond_to do |format|\n if @idea.update_attributes(params[:idea])\n format.html { redirect_to @idea, notice: 'Idea was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @idea.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @idea = Idea.find(params[:id])\n\n respond_to do |format|\n if @idea.update_attributes(params[:idea])\n format.html { redirect_to @idea, notice: 'Idea was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @idea.errors, status: :unprocessable_entity }\n end\n end\n end",
"def proposal_params\n params.require(:proposal).permit(:multi_app_identifier, :proposal_status_id, :category, :creator_id, \n :name, :given_names, :pesel, :citizenship_code, :birth_date, :birth_place, :family_name, :phone, :email,\n :lives_in_poland, :address_combine_id, :province_code, :province_name, :district_code, :district_name,\n :commune_code, :commune_name, :city_code, :city_name, :city_parent_code, :city_parent_name, :street_code, :street_name, :street_attribute,\n :c_address_house, :c_address_number, :c_address_postal_code,\n :esod_category, :exam_id, :exam_fullname, :exam_date_exam, :exam_online, :division_id, :division_fullname, :division_short_name, :division_min_years_old, \n :exam_fee_id, :exam_fee_price, :face_image_blob_path, :bank_pdf_blob_path, :consent_pdf_blob_path )\n end",
"def show\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proposal }\n end\n end",
"def show\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proposal }\n end\n end",
"def proposal_params\n params.require(:proposal).permit(:user_id, :file, :remove_file, :title, :description, :category_id, :team_name, :privacy, :attachments, :answer1, :answer2, :detailed_description, members_attributes:[:proposal_id, :name, :surname, :profession, :_destroy, :id], referent_attributes:[:proposal_id, :name, :surname, :email, :id])\n end",
"def proposeedit(id, name, address, city, state, zip, ll, options = {})\n post(\"venues/#{id}/proposeedit\", {\n :name => name,\n :address => address,\n :city => city,\n :state => state,\n :zip => zip,\n :ll => ll\n }.merge(options))\n nil\n end",
"def update\n @suggestion = Suggestion.find(params[:id])\n\n respond_to do |format|\n if @suggestion.update_attributes(params[:suggestion])\n format.html { redirect_to @suggestion, notice: 'Suggestion was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @suggestion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @proposal = current_user.proposals.build(proposal_params)\n\n respond_to do |format|\n if @proposal.save\n # publish to the feed\n current_user.feed_items.publish(@proposal)\n\n format.html { redirect_to @proposal, notice: 'Proposal was successfully created.' }\n format.json { render action: 'show', status: :created, location: @proposal }\n else\n format.html { render action: 'new' }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @idea = Idea.find(params[:id])\n raise_error_on_intrusion\n\n respond_to do |format|\n if @idea.update_attributes(params[:idea])\n format.html { redirect_to @idea, notice: 'Idea was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @idea.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n course = Course.includes(:professors).find(params[:id])\n course.update!(course_params)\n \n course.professor_ids=(params[:professors])\n\n render json: course.to_json(include: :professors)\n end",
"def create\n respond_to do |format|\n if @proposal.save\n format.html { redirect_to @proposal.enrolment, notice: 'Proposal was successfully created.' }\n format.json { render json: @proposal, status: :created, location: @proposal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @vote = Vote.find(params[:id])\n\n previous_value = @vote.vote\n\n respond_to do |format|\n if @vote.update_attributes(vote_params)\n InformCommitteeMembers.vote_changed(@vote.proposal, current_user, previous_value, @vote.vote)\n format.html { redirect_to [@proposal, @vote], notice: 'Vote was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vote.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_proposal_position\n @proposal_position = ProposalPosition.find(params[:id])\n end",
"def set_ProposalId(value)\n set_input(\"ProposalId\", value)\n end",
"def proposal_params\n params.require(:proposal).permit(:customer, :portfolio_url, :tools, :estimated_hours, :hourly_rate, :weeks_to_complete, :client_email)\n end",
"def update\n @preceed = Preceed.find(params[:id])\n\n respond_to do |format|\n if @preceed.update_attributes(params[:preceed])\n format.html { redirect_to @preceed, notice: 'Preceed was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @preceed.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @opinion.update(opinion_params)\n format.html { redirect_to @opinion, notice: 'Opinion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @opinion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @user = @user.proposals.find(params[:id])\n end",
"def update\n @idea = Idea.find(params[:id])\n\n\t\t\n\t\trespond_to do |format|\n if @idea.update_attributes(params[:idea])\n flash[:notice] = 'Idea was successfully updated.'\n format.html { redirect_to(@idea) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @idea.errors, :status => :unprocessable_entity }\n end\n end\n\n end",
"def update\n set_proposed_item\n\n respond_to do |format|\n if @proposed_item.update(proposed_item_params)\n format.html { redirect_to @budget, notice: 'Proposed item was successfully updated.' }\n format.json { render :show, status: :ok, location: @proposed_item }\n else\n format.html { render :edit }\n format.json { render json: @proposed_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @opinion = Opinion.find(params[:id])\n\n respond_to do |format|\n if @opinion.update_attributes(params[:opinion])\n format.html { redirect_to @opinion, notice: 'Opinion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @opinion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @idea = Idea.find(params[:id])\n\n respond_to do |format|\n if @idea.update_attributes(params[:idea])\n format.html { redirect_to @idea, :notice => 'Idea was successfully updated.' }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end",
"def update\n @solution = @idea.solutions.find(params[:id])\n\n if @solution.update_attributes(params[:solution])\n render json: { text: \"success\" }\n else\n render json: { text: \"fail\"}\n end\n end",
"def destroy\n @proposal = Proposal.find(params[:id])\n committee = @proposal.committee\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to committee_path(committee) }\n format.json { head :no_content }\n end\n end",
"def create\n @proposal = Proposal.new(proposal_params)\n\n # 提案日セット\n# require \"date\"\n# d = Date.today\n# strdate = d.year.to_s + sprintf(\"%02d\", d.month).to_s + sprintf(\"%02d\", d.day).to_s \n# @proposal.proposal_date = strdate\n\n respond_to do |format|\n if @proposal.save\n# format.html { redirect_to proposals_path, notice: '提案を1件登録しました。' }\n format.html { redirect_to @proposal, notice: '提案を1件登録しました。' }\n format.json { render :show, status: :created, location: @proposal }\n else\n format.html { render :new }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def proposal_params\n params.require(:proposal).permit(:category, :user_id, :title, :vehicle, :publication_date, :name_member_1, :cpf_member_1, :name_member_2, :cpf_member_2, :name_member_3, :cpf_member_3, :name_member_4, :cpf_member_4, :name_member_5, :cpf_member_5, :url, :archive)\n end",
"def update\n respond_to do |format|\n if @idea.update(idea_params)\n format.html { redirect_to @idea, notice: 'Idea was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @idea.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n logger.info('PUT Update:')\n logger.info(request_body)\n new_pub = hashed_request\n old_pub = Publication.find_by(id: params[:id])\n if old_pub.blank?\n head :not_found\n return\n elsif old_pub.deleted?\n head :gone\n return\n end\n if old_pub.harvested_pub? # only manually entered (i.e. non-harvested) publications may be updated with this method\n render json: {\n error: \"This record SulPubID #{old_pub.id} may not be modified. If you had originally entered details for the record, \" \\\n 'it has been superceded by a central record.'\n },\n status: :forbidden, format: 'json'\n return\n elsif !validate_or_create_authors(new_pub[:authorship])\n render json: { error: 'You have not supplied a valid authorship record.' }, status: :not_acceptable,\n format: 'json'\n return\n end\n logger.info(\"Update manual publication #{old_pub.inspect} with BibJSON:\")\n logger.info(request_body)\n old_pub.update_manual_pub_from_pub_hash(new_pub, request_body)\n old_pub.save!\n old_pub.reload\n logger.debug(\"resulting pub hash: #{old_pub.pub_hash}\")\n render json: old_pub.pub_hash, status: :accepted\n end",
"def update\n @initiative = Initiative.find(params[:id])\n \n respond_to do |format|\n if @initiative.update_attributes(params[:initiative])\n \n format.html { redirect_to @initiative, notice: 'Initiative was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @initiative.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_suggested_course_pathway\n suggested_pathway = SuggestedPathway.find_by(id: params[:id])\n suggested_pathway.name = params[:name]\n suggested_pathway.year = params[:year]\n suggested_pathway.course_id = params[:course_id]\n suggested_pathway.data = params[:data]\n suggested_pathway.save\n render json: suggested_pathway\n end",
"def update\n respond_to do |format|\n if @api_v1_initiative.update(api_v1_initiative_params)\n format.html { redirect_to @api_v1_initiative, notice: 'Initiative was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.7447891",
"0.7311585",
"0.7120701",
"0.70780736",
"0.70620924",
"0.7024957",
"0.700769",
"0.69558644",
"0.68180454",
"0.67874616",
"0.6773295",
"0.66783243",
"0.6647473",
"0.6558442",
"0.6558442",
"0.6558442",
"0.6558442",
"0.6558442",
"0.6558442",
"0.6558442",
"0.6483972",
"0.63724166",
"0.63647556",
"0.6358961",
"0.6272927",
"0.62053037",
"0.61587864",
"0.61587864",
"0.61568415",
"0.6099738",
"0.6092019",
"0.6076323",
"0.6076323",
"0.60597265",
"0.60585755",
"0.60229445",
"0.6019608",
"0.6005069",
"0.60016733",
"0.5986092",
"0.5978606",
"0.5973419",
"0.5949702",
"0.5939871",
"0.5921614",
"0.589857",
"0.58825403",
"0.58811456",
"0.58679175",
"0.5865141",
"0.5842295",
"0.5842295",
"0.5842295",
"0.5831955",
"0.58299106",
"0.5828837",
"0.58250993",
"0.58175594",
"0.5805252",
"0.57936156",
"0.57862437",
"0.5783525",
"0.5781976",
"0.5772922",
"0.57101685",
"0.56680727",
"0.5642697",
"0.56066155",
"0.56063914",
"0.56063914",
"0.55901736",
"0.55898154",
"0.55898154",
"0.5581953",
"0.5575161",
"0.55667746",
"0.5531505",
"0.55192196",
"0.5507984",
"0.5499103",
"0.5488795",
"0.5485985",
"0.548518",
"0.5478245",
"0.5476163",
"0.54761535",
"0.5473889",
"0.54692286",
"0.54613405",
"0.54607576",
"0.5457731",
"0.5454226",
"0.545378",
"0.54457456",
"0.5443284",
"0.5442686",
"0.54404134",
"0.54227304",
"0.5407635",
"0.5407387"
] |
0.72117543
|
2
|
DELETE /proposals/1 DELETE /proposals/1.json
|
def destroy
@proposal = Proposal.find(params[:id])
committee = @proposal.committee
@proposal.destroy
respond_to do |format|
format.html { redirect_to committee_path(committee) }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @proposal = Proposal.find(params[:id])\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to proposals_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal = Proposal.find(params[:id])\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to proposals_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal = Proposal.find(params[:id])\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Proposal was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to(proposals_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @proposal = Proposal.find(params[:id])\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to(proposals_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @proposal.destroy\n respond_to do |format|\n format.html { redirect_to proposals_url, notice: 'Proposal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal.destroy\n respond_to do |format|\n format.html { redirect_to proposals_url, notice: 'Proposal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal.destroy\n respond_to do |format|\n format.html { redirect_to proposals_url, notice: 'Proposal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal = Proposal.find(params[:id])\n unless current_user.proposals.map {|p| p.id.to_s} .include? @proposal.id.to_s\n redirect_to :back, :flash => { :error => 'Sem permissão, proposta não é sua.'}\n return\n end\n @proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to proposals_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal.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 @proposal = listing.proposals.find(params[:id])\n\n\n respond_to do |format|\n if @proposal.id == @proposal.listing.accepted_proposal_id\n format.html { redirect_to listing_proposals_url(@listing), error: \"You can't remove an accepted proposal.\" }\n format.json { head :no_content }\n else\n @proposal.destroy\n format.html { redirect_to listing_proposals_url(@listing) }\n format.json { head :no_content }\n end\n end\n end",
"def destroy\n curr_id = @parts_for_proposal.proposal_id\n @parts_for_proposal.destroy\n respond_to do |format|\n format.html { redirect_to proposal_url(:id => curr_id), notice: 'Part configuration was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: \"La proposition a été supprimée\"}\n format.json { head :no_content }\n end\n end",
"def destroy\n @thesis_proposal = ThesisProposal.find(params[:id])\n @thesis_proposal.destroy\n\n respond_to do |format|\n format.html { redirect_to(thesis_proposals_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vote = Vote.find(params[:id])\n @vote.destroy\n\n respond_to do |format|\n format.html { redirect_to proposal_url(@proposal) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @paperproposal.destroy\n redirect_to :paperproposals\n end",
"def destroy\n @propose = Propose.find(params[:id])\n @propose.destroy\n\n respond_to do |format|\n format.html { redirect_to proposes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @puntuation.destroy\n @unvoted_contribution = Contribution.find(@puntuation.contribution_id)\n @unvoted_contribution.decrement!(:puntuation, 1)\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ref_protein = RefProtein.find(params[:id])\n @ref_protein.destroy\n\n respond_to do |format|\n format.html { redirect_to ref_proteins_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal_position.destroy\n respond_to do |format|\n format.html { redirect_to proposal_positions_url, notice: 'Proposal position was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @paragraph_assignment.destroy\n respond_to do |format|\n format.html { redirect_to paragraph_assignments_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @docs_ponto.destroy\n respond_to do |format|\n format.html { redirect_to docs_pontos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposed_person = ProposedPerson.find(params[:id])\n @proposed_person.destroy\n\n respond_to do |format|\n format.html { redirect_to(proposed_people_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @course_proposal_question.destroy\n respond_to do |format|\n format.html { redirect_to course_proposal_questions_url, notice: 'Course proposal question was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @idea = Idea.find(params[:id])\n @idea.destroy\n respond_to do |format|\n format.json { render json: {status: \"ok\"} }\n end\n end",
"def destroy\n @paragraph.destroy\n respond_to do |format|\n format.html { redirect_to paragraphs_url, notice: \"Paragraph was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @protein = Protein.find(params[:id])\n @protein.destroy\n\n respond_to do |format|\n format.html { redirect_to proteins_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @approval = Approval.find(params[:id])\n @approval.destroy\n\n respond_to do |format|\n format.html { redirect_to approvals_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @idea = Idea.find(params[:id])\n @idea.destroy\n\n respond_to do |format|\n format.html { redirect_to ideas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @idea = Idea.find(params[:id])\n @idea.destroy\n\n respond_to do |format|\n format.html { redirect_to ideas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @apt = Apt.find(params[:id])\n @apt.destroy\n\n respond_to do |format|\n format.html { redirect_to apts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pr_committee.destroy\n respond_to do |format|\n format.html { redirect_to pr_committees_url, notice: 'Petition Review committee was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @snippet = Snippet.find(params[:id])\n @snippet.destroy\n\n respond_to do |format|\n format.html { redirect_to snippets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @snippet = Snippet.find(params[:id])\n @snippet.destroy\n\n respond_to do |format|\n format.html { redirect_to snippets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proverb.destroy\n respond_to do |format|\n format.html { redirect_to proverbs_url, notice: \"Proverb was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def cancels_proposal\n context.proposal.destroy!\n end",
"def destroy\n @doc_ponto_comer.destroy\n respond_to do |format|\n format.html { redirect_to doc_ponto_comers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @idea = current_user.ideas.find(params[:id])\n @idea.destroy\n\n respond_to do |format|\n format.html { redirect_to ideas_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @exprience = Exprience.find(params[:id])\n @exprience.destroy\n\n respond_to do |format|\n format.html { redirect_to expriences_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @peptide = Peptide.find(params[:id])\n @peptide.destroy\n\n respond_to do |format|\n format.html { redirect_to peptides_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @change_suggestion = ChangeSuggestion.find(params[:id])\n @change_suggestion.destroy\n\n respond_to do |format|\n format.html { redirect_to change_suggestions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @projecct = Projecct.find(params[:id])\n @projecct.destroy\n\n respond_to do |format|\n format.html { redirect_to projeccts_url }\n format.json { head :no_content }\n end\n end",
"def delete\n @guide = Guide.find(params[:id])\n @guide.destroy\n respond_to do |format|\n format.html { redirect_to guides_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @intention = Intention.find(params[:id])\n @intention.destroy\n\n respond_to do |format|\n format.html { redirect_to intentions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @prioridade_adocao = PrioridadeAdocao.find(params[:id])\n @prioridade_adocao.destroy\n\n respond_to do |format|\n format.html { redirect_to prioridade_adocoes_url }\n format.json { head :no_content }\n end\n end",
"def destroyit\n @judgement = Judgement.find(params[:id])\n @judgement.destroy\n\n respond_to do |format|\n format.html { redirect_to judgements_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @poetry_anthology_book.destroy\n respond_to do |format|\n format.html { redirect_to poetry_anthology_books_url, notice: \"Poetry anthology review was successfully deleted.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @id_proof = IdProof.find(params[:id])\n @id_proof.destroy\n\n respond_to do |format|\n format.html { redirect_to id_proofs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mercurial.destroy\n respond_to do |format|\n format.html { redirect_to mercurials_url, notice: 'Mercurial was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pre = Pre.find(params[:id])\n @pre.destroy\n\n respond_to do |format|\n format.html { redirect_to pres_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @judgement = Judgement.find(params[:id])\n @judgement.destroy\n\n respond_to do |format|\n format.html { redirect_to judgements_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @idea.destroy\n respond_to do |format|\n format.html { redirect_to ideas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @idea.destroy\n respond_to do |format|\n format.html { redirect_to ideas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @idea.destroy\n respond_to do |format|\n format.html { redirect_to ideas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @idea = Idea.find(params[:id])\n raise_error_on_intrusion\n @idea.destroy\n\n respond_to do |format|\n format.html { redirect_to ideas_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @idea = Idea.find(params[:id])\n @idea.destroy\n\n respond_to do |format|\n format.html { redirect_to(ideas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @idea = Idea.find(params[:id])\n @idea.destroy\n\n respond_to do |format|\n format.html { redirect_to(ideas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @idea = Idea.find(params[:id])\n @idea.destroy\n\n respond_to do |format|\n format.html { redirect_to(ideas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @completion.destroy\n respond_to do |format|\n format.html { redirect_to completions_url, notice: 'Completion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @approval.destroy\n respond_to do |format|\n format.html { redirect_to approvals_url, notice: 'Approval was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @idea = Idea.find(params[:id])\n @idea.destroy\n\n respond_to do |format|\n format.html { redirect_to dashboard_ideas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @snippet = Snippet.find(params[:id])\n @snippet.destroy\n\n respond_to do |format|\n format.html { redirect_to(snippets_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @snippet = Snippet.find(params[:id])\n @snippet.destroy\n\n respond_to do |format|\n format.html { redirect_to(snippets_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @editorial.destroy\n respond_to do |format|\n format.html { redirect_to editorials_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @protein.destroy\r\n respond_to do |format|\r\n format.html { redirect_to proteins_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @opinion = Opinion.find(params[:id])\n @opinion.destroy\n\n respond_to do |format|\n format.html { redirect_to opinions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @opinion = Opinion.find(params[:id])\n @opinion.destroy\n\n respond_to do |format|\n format.html { redirect_to opinions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @explaination = Explaination.find(params[:id])\n @explaination.destroy\n\n respond_to do |format|\n format.html { redirect_to explainations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposal=Proposal.find(@geographic_coverage.proposal_id)\n @geographic_coverage.destroy\n respond_to do |format|\n format.html { redirect_to edit_proposal_path(@proposal.id) }\n # format.json { render :show, status: :ok, location: @proposal }\n format.js\n end\n # @geographic_coverage.destroy\n # respond_to do |format|\n # format.html { redirect_to geographic_coverages_url, notice: 'Geographic coverage was successfully destroyed.' }\n # format.json { head :no_content }\n # end\n end",
"def destroy\n @articy_draft.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @passage = Passage.find(params[:id])\n @passage.destroy\n\n respond_to do |format|\n format.html { redirect_to passages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @advancement = Advancement.find(params[:id])\n @advancement.destroy\n\n respond_to do |format|\n format.html { redirect_to advancements_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @snippet.destroy\n\n respond_to do |format|\n format.html { redirect_to snippets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @draft = Draft.find(params[:id])\n @draft.destroy\n\n respond_to do |format|\n format.html { redirect_to drafts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @draft.destroy\n respond_to do |format|\n format.html { redirect_to drafts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @nudge.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @exam_option = ExamOption.find(params[:id])\n @exam_option.destroy\n\n respond_to do |format|\n format.html { redirect_to exam_options_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @paragraph_rating = ParagraphRating.find(params[:id])\n @paragraph_rating.destroy\n\n respond_to do |format|\n format.html { redirect_to paragraph_ratings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @guide_post = GuidePost.find(params[:id])\n @guide_post.destroy\n\n respond_to do |format|\n format.html { redirect_to current_user, notice: 'Your post has been deleted.' }\n format.json { head :ok }\n end\n end",
"def destroy\n @gdoc.destroy\n respond_to do |format|\n format.html { redirect_to gdocs_url }\n format.json { head :no_content }\n end\n end",
"def destroy \n @idea = @agenda.ideas.find(params[:id])\n @idea.destroy\n\t respond_to do |format|\n format.html { redirect_to agenda_path(@agenda), notice: 'Idea deleted successfully.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @poc.destroy\n respond_to do |format|\n format.html { redirect_to pocs_url, notice: 'Poc was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bracket_golfer.destroy\n respond_to do |format|\n format.html { redirect_to bracket_golfers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pledge = Pledge.find(params[:id])\n @pledge.destroy\n\n respond_to do |format|\n format.html { redirect_to pledges_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pledge = Pledge.find(params[:id])\n @pledge.destroy\n\n respond_to do |format|\n format.html { redirect_to pledges_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @proposition.destroy\n respond_to do |format|\n format.html { redirect_to propositions_url, notice: 'Proposition was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @snippet.destroy\n respond_to do |format|\n format.html { redirect_to snippets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @programme_exercise.destroy\n respond_to do |format|\n format.html { redirect_to programme_exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json do\n render :json => { :notice => \"Snippet deleted\" }\n end\n end\n end",
"def destroy\n @ptel_reup.destroy\n respond_to do |format|\n format.html { redirect_to ptel_reups_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pphrase.destroy\n respond_to do |format|\n format.html { redirect_to pphrases_url, notice: 'Pphrase was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @idea = Idea.find(params[:id])\n @idea.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_ideas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @idea = Idea.find(params[:id])\n @idea.destroy if @idea.user = current_user\n\n\n respond_to do |format|\n format.html { redirect_to ideas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @politicalcommittee = Politicalcommittee.find(params[:id])\n @politicalcommittee.destroy\n\n respond_to do |format|\n format.html { redirect_to politicalcommittees_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @paperedit.destroy\n respond_to do |format|\n format.html { redirect_to paperedits_url, notice: 'Paperedit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n\n @suggestion = Suggestion.find(params[:id])\n @suggestion.destroy\n\n respond_to do |format|\n format.html { redirect_to(suggestions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @po = Po.find(params[:id])\n @po.destroy\n\n respond_to do |format|\n format.html { redirect_to pos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @judge.destroy\n respond_to do |format|\n format.html { redirect_to judges_url, notice: 'Judge was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @opinion.destroy\n respond_to do |format|\n format.html { redirect_to opinions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @propriedade.destroy\n respond_to do |format|\n format.html { redirect_to propriedades_url, notice: 'Propriedade was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] |
[
"0.7913258",
"0.7913258",
"0.77106977",
"0.7677443",
"0.7642395",
"0.7607506",
"0.7607506",
"0.7607506",
"0.74856466",
"0.7362166",
"0.73345053",
"0.7122501",
"0.70645434",
"0.6992418",
"0.69782144",
"0.69289726",
"0.6910627",
"0.6502949",
"0.6474011",
"0.647114",
"0.6455633",
"0.6437434",
"0.64300805",
"0.6413991",
"0.6405018",
"0.6384623",
"0.63736784",
"0.63624483",
"0.63427144",
"0.63427144",
"0.6340914",
"0.6337487",
"0.6336025",
"0.6336025",
"0.6335659",
"0.6334887",
"0.63196605",
"0.6316365",
"0.63082665",
"0.6296651",
"0.6287588",
"0.6277085",
"0.62719893",
"0.6267776",
"0.62525827",
"0.62500536",
"0.62445027",
"0.6243261",
"0.6243086",
"0.6242444",
"0.6240803",
"0.62395287",
"0.62395287",
"0.62395287",
"0.6234016",
"0.62291396",
"0.62291396",
"0.62291396",
"0.62286603",
"0.6228429",
"0.62280625",
"0.62265664",
"0.62265664",
"0.6224706",
"0.6220894",
"0.62187654",
"0.62187654",
"0.6213283",
"0.62123746",
"0.6209438",
"0.62068766",
"0.6200991",
"0.6195989",
"0.6195203",
"0.61936456",
"0.6185943",
"0.6182072",
"0.6181388",
"0.6180644",
"0.6179426",
"0.6174174",
"0.6170248",
"0.6169443",
"0.61692584",
"0.61692584",
"0.6168801",
"0.6161719",
"0.6158087",
"0.61493933",
"0.61473954",
"0.6145726",
"0.6145282",
"0.6140453",
"0.6138015",
"0.6136296",
"0.61359644",
"0.61356515",
"0.61332846",
"0.61317825",
"0.61302286"
] |
0.74042296
|
9
|
XXX should be in revisioncontroller?
|
def revision_params
params.require(:revision).permit(:rule_text, :body, :change_description, :background, :references)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def fetch_revision\n end",
"def revisions\n raise NotImplementedError\n end",
"def revision\n 99\n end",
"def revision\r\n @revision\r\n end",
"def title\n revision.title\n end",
"def revision_class #:nodoc:\n self\n end",
"def revision_class #:nodoc:\n self\n end",
"def private; end",
"def body\n revision.body\n end",
"def current_revision\n raise NotImplementedError\n end",
"def revision\n revisions.first\n end",
"def render(*args)\n if request.path_parameters['action'] == \"edit\" && params[:revision]\n # Change revision number if given revision is not existed and we have set last revision\n params[:revision] = model.set_to_revision(params[:revision])\n end\n super(*args)\n end",
"def repository; end",
"def revision(revision)\n raise NotImplementedError\n end",
"def title\n \"#{self.article_revision.title}\"\n end",
"def wf_revision; h.wf_revision; end",
"def sub_wf_revision; h.sub_wf_revision; end",
"def start_revision(revision)\n end",
"def current_revision\n @svninfo.current_revision\n end",
"def after_initialize\n self.revision_model = (klass.camelize + 'Revision').constantize\n revision = is_preview ? self.last_revision : self.published_revision\n self.attributes = change_attributes_to_revision_attributes(revision) if revision\n end",
"def category\n revision.category\n end",
"def render(*args)\n if request.path_parameters['action'] == \"edit\" && params[:revision]\n model.set_to_revision(params[:revision])\n end\n super(*args)\n end",
"def published_revision\n self.revision_model.find(:first, :conditions => { klass + '_id' => self.id, :number => self.published_revision_number })\n end",
"def modified?; end",
"def acts_as_revision(*args, &block)\n revisable_shared_setup(args, block)\n self.send(:include, Revision) \n end",
"def set_revision\n @revision = find_revision(params[:id])\n end",
"def do_revision\n @record = find_if_allowed(params[:id], :read)\n @current_revision_number = @record.current_revision_number\n @revision_number ||= @current_revision_number\n @rev_record_1 = @record.restore_revision(@revision_number) if @revision_number\n @rev_record_2 = @record.restore_revision(@revision_number - 1) if @revision_number > 1\n end",
"def name\n revision_data[\"name\"]\n end",
"def refutal()\n end",
"def revision_setup #:nodoc:\n now = Time.current\n prev = current_revision.revisions.first\n prev.update_attribute(:revisable_revised_at, now) if prev\n self[:revisable_current_at] = now + 1.second\n self[:revisable_is_current] = false\n self[:revisable_branched_from_id] = current_revision[:revisable_branched_from_id]\n self[:revisable_type] = current_revision[:type] || current_revision.class.name\n end",
"def revision_name\n \n if revision\n revision = self.revision.name\n # revision += self.numeric_revision > 0 ? self.numeric_revision.to_s : ''\n else\n NOT_SET\n end\n \n end",
"def set_current_revision\n raise NotImplementedError\n end",
"def repo; end",
"def repo; end",
"def repo; end",
"def repo; end",
"def revision\n @job = Mugen::Job.find(params[:job_id]) \n @revision = Mugen::Job.revision(params[:job_id], params[:id])\n \n respond_to do |format|\n format.html {}\n format.xml { render :xml => @job }\n end\n end",
"def revision_setup #:nodoc:\n now = Time.current\n prev = current_revision.revisions.first\n prev.update(revisable_revised_at: now) if prev\n self[:revisable_current_at] = now + 1.second\n self[:revisable_is_current] = false\n self[:revisable_branched_from_id] = current_revision[:revisable_branched_from_id]\n self[:revisable_type] = current_revision[:type] || current_revision.class.name\n end",
"def revision\n raise NotImplementedError.new(\"revision() must be implemented by subclasses of AbstractVersionedFile.\")\n end",
"def verdi; end",
"def after_initialize \n self.revision_model = PagePartRevision \n begin\n revision = PagePartRevision.find_by_page_part_id_and_number(self.id, self.page.published_revision.number)\n self.attributes = change_attributes_to_revision_attributes(revision, FIELDS['page_part_revision_specific_attributes'])\n rescue \n nil\n end\n end",
"def set_revision\n @revision = Revision.find(params[:id])\n end",
"def show\n if params[:id] == 'current'\n @revision = Document.find(params[:document_id]).current_revision\n else\n @revision = Revision.find(params[:id])\n end\n\n if !@revision.document.allowed_to_read\n redirect_back\n else\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @revision }\n end\n end\n end",
"def create\n @revision = Revision.create(params[:revision])\n redirect_to page_base_url(:page_title => @revision.page.title)\n end",
"def action_hook; end",
"def drafts=(_arg0); end",
"def all_changes_in_revisions array\n raise NotImplementedError.new('Define method :all_changes_in_revisions on your source control.')\n end",
"def set_revisions\n @revisions = @notebook.revision_list(@user)\n end",
"def new\n @revision = Revision.create(params[:revision])\n redirect_to page_base_url(:page_title => @revision.page.title)\n end",
"def logical_revision\n @logical_revision || \"rev-\" + self.rev \n end",
"def revisions\n @revisions ||= RevisionCollection.new(self)\n end",
"def author; end",
"def last_revision\n self.revision_model.find(:first, :conditions => { klass + '_id' => self.id }, :order => \"number DESC\")\n end",
"def index\n user = User.find(params[:user_id])\n course = Course.find(params[:course_id])\n\n @revisions = course.tracked_revisions.where(user_id: user.id)\n .order('revisions.date DESC')\n .eager_load(:article, :wiki)\n .limit(params[:limit] || DEFAULT_REVISION_LIMIT)\n end",
"def create_revision!\n logger.info(\"Creating a new revision for article_submission id: #{self.id}\")\n rev = self.copy(false)\n unless rev.article_submission\n rev.article_submission = self \n self.update_attribute(:last_revision,false)\n else\n rev.article_submission.article_submissions.each do |as|\n as.update_attribute(:last_revision,false)\n end\n end\n \n rev.resubmitted = nil\n rev.committed = nil\n rev.last_revision = true\n rev.save(false) \n rev.set_version!\n self.article_submission_reviewers.each do |ar|\n reviewer = ar.clone\n reviewer.change_status(ArticleSubmissionReviewer::NOT_YET_INVITED)\n rev.article_submission_reviewers << reviewer\n end\n rev.change_status(ArticleSubmission::STARTED)\n rev.increment_manuscript_rev_num\n\n return rev\n end",
"def original_content\n last_applied = revision.ancestors.find(&:applied?)\n RevisionContent.new(last_applied) if last_applied\n end",
"def revision(version)\n revision_with audit_changes(version)\n end",
"def revision_name #:nodoc:\n self[:revisable_name]\n end",
"def revision_name #:nodoc:\n self[:revisable_name]\n end",
"def details\n @article = Article.find(params[:article_id])\n revisions = @course.tracked_revisions.where(article_id: @article.id).order(:date)\n @first_revision = revisions.first\n @last_revision = revisions.last\n editor_ids = revisions.pluck(:user_id).uniq\n @editors = User.where(id: editor_ids)\n end",
"def edit\n return unless has_permission :can_post_news\n @page_title = 'Edit Static Page'\n @document = StaticContent.find(params[:id])\n if params[:version]!=nil\n @document = @document.get_version params[:version]\n end\n if request.method == :post\n @document.last_updated_by = current_user \n if @document.update_attributes(params[:document])\n flash[:notice] = 'Document was successfully updated.'\n end\n end\n @versions = @document.versions\nend",
"def last_revision\n get_revision('REVISION')\n end",
"def revision\n return changeset.rev if @changeset || @change_id\n link_rev\n end",
"def history; end",
"def history; end",
"def history; end",
"def revision\n # HEAD is the default, but lets just be explicit here.\n get_revision('HEAD')\n end",
"def drafts; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edit; end",
"def edits\n\nend",
"def page_revisions\n self.back_to_top\n page_revisions_button\n wait_for_ajax\n \n end",
"def view_flow; end",
"def index\n @revisions = @page.revisions.sort { |a, b| b.created_at <=> a.created_at }\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @revisions }\n end\n end",
"def revision\n if @new_resource.revision == 'HEAD'\n ['-A']\n else\n ['-r', @new_resource.revision]\n end\n end",
"def revision\n self.major_rev_number.to_s + '.' + self.minor_rev_number.to_s\n end",
"def show\n @page = Page.find(params[:page_id])\n @revision = @page.revisions.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @revision }\n end\n end",
"def activate_revision(revision)\n raise NotImplementedError\n end",
"def set_current_revisions!\n self.class.transaction do\n save! unless self.id\n\n t = RevisionListContent.table_name\n \n connection.execute <<\"END\"\nDELETE FROM #{t} WHERE revision_list_id = #{self.id}\nEND\n \n connection.execute <<\"END\"\nINSERT INTO #{t} ( revision_list_id, content_version_id )\nSELECT #{self.id}, content_versions.id \nFROM contents, content_versions \nWHERE content_versions.content_id = contents.id AND content_versions.version = contents.version\nEND\n\n t = RevisionListContentKey.table_name\n \n connection.execute <<\"END\"\nDELETE FROM #{t} WHERE revision_list_id = #{self.id}\nEND\n \n connection.execute <<\"END\"\nINSERT INTO #{t} ( revision_list_id, content_key_version_id )\nSELECT #{self.id}, content_key_versions.id \nFROM content_keys, content_key_versions \nWHERE content_key_versions.content_key_id = content_keys.id AND content_key_versions.version = content_keys.version\nEND\n\n end\n\n # Association caches are out-of-date.\n reload\n\n self\n end",
"def def_version; end",
"def test_revision\n get :revision, :id => 1, :rev => 2\n assert_response :success\n assert_template 'revision'\n\n assert_select 'ul' do\n assert_select 'li' do\n # link to the entry at rev 2\n assert_select 'a[href=?]', '/projects/ecookbook/repository/revisions/2/entry/test/some/path/in/the/repo', :text => 'repo'\n # link to partial diff\n assert_select 'a[href=?]', '/projects/ecookbook/repository/revisions/2/diff/test/some/path/in/the/repo'\n end\n end\n end",
"def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={}, &block)\r\n logger.debug \"<cvs> revisions path:'#{path}',identifier_from #{identifier_from}, identifier_to #{identifier_to}\"\r\n \r\n path_with_project=\"#{url}#{with_leading_slash(path)}\"\r\n cmd = \"#{CVS_BIN} -d #{root_url} rlog\"\r\n cmd << \" -d\\\">#{time_to_cvstime(identifier_from)}\\\"\" if identifier_from\r\n cmd << \" #{shell_quote path_with_project}\"\r\n shellout(cmd) do |io|\r\n state=\"entry_start\"\r\n \r\n commit_log=String.new\r\n revision=nil\r\n date=nil\r\n author=nil\r\n entry_path=nil\r\n entry_name=nil\r\n file_state=nil\r\n branch_map=nil\r\n \r\n io.each_line() do |line| \r\n \r\n if state!=\"revision\" && /^#{ENDLOG}/ =~ line\r\n commit_log=String.new\r\n revision=nil\r\n state=\"entry_start\"\r\n end\r\n \r\n if state==\"entry_start\"\r\n branch_map=Hash.new\r\n if /^RCS file: #{Regexp.escape(root_url_path)}\\/#{Regexp.escape(path_with_project)}(.+),v$/ =~ line\r\n entry_path = normalize_cvs_path($1)\r\n entry_name = normalize_path(File.basename($1))\r\n logger.debug(\"Path #{entry_path} <=> Name #{entry_name}\")\r\n elsif /^head: (.+)$/ =~ line\r\n entry_headRev = $1 #unless entry.nil?\r\n elsif /^symbolic names:/ =~ line\r\n state=\"symbolic\" #unless entry.nil?\r\n elsif /^#{STARTLOG}/ =~ line\r\n commit_log=String.new\r\n state=\"revision\"\r\n end \r\n next\r\n elsif state==\"symbolic\"\r\n if /^(.*):\\s(.*)/ =~ (line.strip) \r\n branch_map[$1]=$2\r\n else\r\n state=\"tags\"\r\n next\r\n end \r\n elsif state==\"tags\"\r\n if /^#{STARTLOG}/ =~ line\r\n commit_log = \"\"\r\n state=\"revision\"\r\n elsif /^#{ENDLOG}/ =~ line\r\n state=\"head\"\r\n end\r\n next\r\n elsif state==\"revision\"\r\n if /^#{ENDLOG}/ =~ line || /^#{STARTLOG}/ =~ line \r\n if revision\r\n \r\n revHelper=CvsRevisionHelper.new(revision)\r\n revBranch=\"HEAD\"\r\n \r\n branch_map.each() do |branch_name,branch_point|\r\n if revHelper.is_in_branch_with_symbol(branch_point)\r\n revBranch=branch_name\r\n end\r\n end\r\n \r\n logger.debug(\"********** YIELD Revision #{revision}::#{revBranch}\")\r\n \r\n yield Revision.new({ \r\n :time => date,\r\n :author => author,\r\n :message=>commit_log.chomp,\r\n :paths => [{\r\n :revision => revision,\r\n :branch=> revBranch,\r\n :path=>entry_path,\r\n :name=>entry_name,\r\n :kind=>'file',\r\n :action=>file_state\r\n }]\r\n }) \r\n end\r\n \r\n commit_log=String.new\r\n revision=nil\r\n \r\n if /^#{ENDLOG}/ =~ line\r\n state=\"entry_start\"\r\n end\r\n next\r\n end\r\n \r\n if /^branches: (.+)$/ =~ line\r\n #TODO: version.branch = $1\r\n elsif /^revision (\\d+(?:\\.\\d+)+).*$/ =~ line\r\n revision = $1 \r\n elsif /^date:\\s+(\\d+.\\d+.\\d+\\s+\\d+:\\d+:\\d+)/ =~ line\r\n date = Time.parse($1)\r\n author = /author: ([^;]+)/.match(line)[1]\r\n file_state = /state: ([^;]+)/.match(line)[1]\r\n #TODO: linechanges only available in CVS.... maybe a feature our SVN implementation. i'm sure, they are\r\n # useful for stats or something else\r\n # linechanges =/lines: \\+(\\d+) -(\\d+)/.match(line)\r\n # unless linechanges.nil?\r\n # version.line_plus = linechanges[1]\r\n # version.line_minus = linechanges[2]\r\n # else\r\n # version.line_plus = 0\r\n # version.line_minus = 0 \r\n # end \r\n else \r\n commit_log << line unless line =~ /^\\*\\*\\* empty log message \\*\\*\\*/\r\n end \r\n end \r\n end\r\n end\r\n end"
] |
[
"0.7037463",
"0.673076",
"0.66951185",
"0.6402124",
"0.635609",
"0.6221742",
"0.6221742",
"0.61663604",
"0.61640227",
"0.61521244",
"0.61475223",
"0.6135103",
"0.60964423",
"0.6077526",
"0.6027368",
"0.5989344",
"0.5981241",
"0.59520555",
"0.5938156",
"0.5933731",
"0.5916808",
"0.5912932",
"0.58835185",
"0.58714694",
"0.58622026",
"0.58096695",
"0.5808959",
"0.5799756",
"0.5787164",
"0.5787048",
"0.5782765",
"0.5776099",
"0.5762867",
"0.5762867",
"0.5762867",
"0.5762867",
"0.57431775",
"0.5741743",
"0.5728426",
"0.57255125",
"0.5698927",
"0.56830114",
"0.56807977",
"0.5663662",
"0.56584215",
"0.5657045",
"0.5621968",
"0.5614077",
"0.5608717",
"0.56007063",
"0.55988455",
"0.55947137",
"0.55793715",
"0.5570452",
"0.5564653",
"0.55561554",
"0.5550022",
"0.5544068",
"0.5544068",
"0.5538216",
"0.5536548",
"0.5518779",
"0.55156904",
"0.5512797",
"0.5512797",
"0.5512797",
"0.55007595",
"0.5497089",
"0.54959697",
"0.54959697",
"0.54959697",
"0.54959697",
"0.54959697",
"0.54959697",
"0.54959697",
"0.54959697",
"0.54959697",
"0.54959697",
"0.54959697",
"0.54959697",
"0.54959697",
"0.54959697",
"0.54959697",
"0.54959697",
"0.54959697",
"0.54959697",
"0.54959697",
"0.54959697",
"0.54959697",
"0.5495127",
"0.5493517",
"0.5489123",
"0.54718906",
"0.54717815",
"0.546603",
"0.5465823",
"0.54637784",
"0.5463666",
"0.5452542",
"0.54483616",
"0.5447053"
] |
0.0
|
-1
|
def sum(a, b) a + b end def square(a) binding.pry a 2 end def cube(a) square(a) a end
|
def factorial(x)
if x == 1
1
else
x * factorial(x-1)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def sum(a, b)\n p a + b\nend",
"def sum(a, b)\n p a + b\nend",
"def sum(a,b)\n p a + b\nend",
"def square x\n puts (x * x)\nend",
"def add(x, y)\n p x+y\nend",
"def multiply(a,b)\n p a*b\nend",
"def square(a)\n a * a\nend",
"def summator(x, y)\n p x + y\nend",
"def add(a,b)\n p (a + b)\nend",
"def sum_method(a, b)\n puts \"Adding #{a} + #{b}\"\n puts a + b\nend",
"def plus_two(num)\n sum = num + 2\n #binding.pry\nend",
"def square(a)\n a * a\nend",
"def square(a) #a is the variable\n\t# is the input \n\t# the output is the LAST thing that it does - like the return in javascript\n\ta * a #so this is the last line and it becomes the output to whatever called it\nend",
"def sum (a, b)\n puts a + b\nend",
"def square(x)\nend",
"def sum(x, y)\n puts x + y\nend",
"def square(n)\n puts n * n\nend",
"def sum(a, b)\n puts \"Sum total: #{a} + #{b} = #{10 + 20}\"\n\nend",
"def square(a)\n\ta * a\nend",
"def square(x)\n x*x\nend",
"def square(x)\n x*x\nend",
"def square(x)\n x*x\nend",
"def plus_two(num)\n\tsum = num + 2\n\tsum\n\t#binding.pry\nend",
"def sum(x, y)\n puts \"The sum of #{x} + #{y} is:\"\n puts \"-> #{x+y}\"\nend",
"def square(num)\n num * num\nend",
"def square(num)\n num * num\nend",
"def multiply(a, b)\n puts a*b\nend",
"def multiply(a,b)\n puts a*b\nend",
"def square(x) # Define a method named square with one parameter x\n x*x # Return x squared\nend",
"def square(a)\n multiply(a, a)\nend",
"def square a\n a * a\nend",
"def cubed(num)\n puts num**3\nend",
"def add(a, b)\n puts a + b\nend",
"def add(a, b)\n puts a + b\nend",
"def add(a, b)\n puts a + b\nend",
"def add(a, b)\n puts a + b\nend",
"def sqr(x)\n puts x*x\nend",
"def cube(num) #specify, pass it num \n num * num * num \n 5 \nend",
"def add(a,b)\n puts \"Adding #{a} + #{b}\"\n a + b\nend",
"def add\n puts 2+2\nend",
"def square(number)\n number * number\nend",
"def square(x)\n\tx*x\nend",
"def add(a, b)\n puts \"SUM #{a} + #{b}\"\n return a + b\nend",
"def sum x,y \n puts x+y \nend",
"def summe(a,b)\r\n a+b\r\nend",
"def addition(a, b)\n puts a + b\nend",
"def square(x)\n x ** 2\nend",
"def add(x, y)\n puts \"Adding #{x}, #{y}\"\n return x + y\nend",
"def print_sum(num1, num2)\n p num1 + num2\nend",
"def sum(a,b)\n a + b \nend",
"def add(num_1, num_2)\n p num_1 + num_2\nend",
"def multiply(num1, num2)\n p num1 * num2\nend",
"def add(a, b)\n p \"ADDING #{a} + #{b}\"\n return a + b\nend",
"def addition(a,b)\n puts a + b\nend",
"def multiply(x , y)\n\tputs x * y \nend",
"def add(a, b)\n puts \"ADDING #{a} + #{b}\"\n a + b\nend",
"def add(a, b)\n puts \"Add #{a} + #{b}\"\n return a + b\nend",
"def square(num)\n multiply(num, num)\nend",
"def square(num)\n multiply(num, num)\nend",
"def square(num)\n multiply(num, num)\nend",
"def square(num)\n multiply(num, num)\nend",
"def square(num)\n multiply(num, num)\nend",
"def square(num)\n multiply(num, num)\nend",
"def cube(num)\n puts \"Hello\"\n return num * num * num, \"The cube value\"\n 5\nend",
"def square(n)\n puts n**2\nend",
"def cube(number)\n\n number * number * number\n\nend",
"def add(number_1, number_2)\n p number_1 + number_2\nend",
"def add(a, b)\n puts \"addng #{a} + #{b}\"\n return a + b\nend",
"def add(num_1, num_2)\n num_1 = 2\n num_2 = 3\n p num_1 + num_2\nend",
"def square(number)\n number**2\nend",
"def square(num)\n return num * num\nend",
"def square(num)\n return num * num\nend",
"def square (x)\n return x * x\nend",
"def add_two num\n p num + 2\nend",
"def square(num)\n return num*num\nend",
"def multiply\n puts 22*44\nend",
"def sum(a, b)\n a + b\nend",
"def sum(a, b)\n a + b\nend",
"def square(num1)\n multiply(num1, num1)\nend",
"def sum(a,b)\n a + b\nend",
"def add(a, b)\n puts \"adding #{a} and #{b}:\"\n return a + b\nend",
"def add (a, b)\n puts \"Adding #{a} + #{b}\"\n return a+b\nend",
"def add(x, y)\n puts \"The sum of x & y is: #{x} + #{y}\"\n return x + y\nend",
"def sum(a, b)\n puts \"The sum of #{a} + #{b} = \" + \"#{(a + b)}\"\n #return a + b not needed for this\nend",
"def multiply(a,b)\n puts \"Multiplying #{a} and #{b} to get #{a * b}\"\nend",
"def z(a)\n # a + a # =>\nend",
"def add(x, y)\n x + y\nend",
"def add(a,b)\n puts \"Adding #{a} and #{b}:\"\n return a + b\nend",
"def add(a, b)\n #puts a + b\n return a + b\nend",
"def addition(num1, num2)\n p num1 + num2\nend",
"def sum (a, b)\n a + b\nend",
"def multiply(x,y)\n\tbinding.pry # stops code, opens in pry so you can test it out\n\tKernel.puts(\"After binding.pry\")\n\treturn x*y\nend",
"def cubed(num)\n return num * num * num\n 5\nend",
"def add(a, b)\n puts \"ADDING #{a} + #{b}\"\n return a + b\nend",
"def add(a, b)\n puts \"ADDING #{a} + #{b}\"\n return a + b\nend",
"def add_sum(a, b)\n puts \"ADDING #{a} + #{b}\"\n return a + b\nend",
"def add_three(n)\r\n puts n + 3 \r\nend",
"def square(x) = x * x",
"def square(num)\n return num**2\nend",
"def square(num)\n return num**2\nend",
"def square(num)\n return num**2\nend"
] |
[
"0.74183464",
"0.74183464",
"0.73782516",
"0.72844267",
"0.7239701",
"0.72227305",
"0.71977866",
"0.7176084",
"0.7153587",
"0.714591",
"0.7145611",
"0.71251667",
"0.71198326",
"0.7100431",
"0.7085373",
"0.70819634",
"0.70737755",
"0.70472735",
"0.70319426",
"0.70100325",
"0.70100325",
"0.69907415",
"0.6989499",
"0.69867784",
"0.6963257",
"0.6963257",
"0.6937496",
"0.6920881",
"0.69147336",
"0.69131273",
"0.69092757",
"0.6907065",
"0.6906059",
"0.6906059",
"0.6906059",
"0.6906059",
"0.6876851",
"0.68534315",
"0.68530864",
"0.68414736",
"0.6833831",
"0.6828407",
"0.682294",
"0.6817372",
"0.68102354",
"0.6797093",
"0.67847925",
"0.67816544",
"0.67613083",
"0.67586833",
"0.6755898",
"0.67478865",
"0.6744355",
"0.6744054",
"0.6735779",
"0.6733751",
"0.6728886",
"0.67228764",
"0.67228764",
"0.67228764",
"0.67228764",
"0.67228764",
"0.67228764",
"0.6719021",
"0.6718489",
"0.6713974",
"0.67109776",
"0.67007804",
"0.6698639",
"0.668685",
"0.66805124",
"0.66805124",
"0.667977",
"0.66758734",
"0.6665924",
"0.66650677",
"0.6661498",
"0.6661498",
"0.6660384",
"0.6652213",
"0.66222477",
"0.6615197",
"0.6614859",
"0.66108334",
"0.66087466",
"0.66034573",
"0.6601132",
"0.6598554",
"0.65980005",
"0.6596228",
"0.65959287",
"0.6589956",
"0.65881777",
"0.6583111",
"0.6583111",
"0.6576209",
"0.6575112",
"0.65748477",
"0.6571622",
"0.6571622",
"0.6571622"
] |
0.0
|
-1
|
Get parameters for lograge
|
def append_info_to_payload(payload)
super
payload["params"] = request.params
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def log_params\n params[:log]\n end",
"def log_params()\n lparms = @parameters.clone if @parameters\n lparms = {} unless lparms\n lparms[:cur_host] = @host\n lparms[:cur_port] = @port\n lparms[:cur_login] = @login\n lparms[:cur_passcode] = @passcode\n lparms[:cur_ssl] = @ssl\n lparms[:cur_recondelay] = @reconnect_delay\n lparms[:cur_parseto] = @parse_timeout\n lparms[:cur_conattempts] = @connection_attempts\n lparms[:cur_failure] = @failure # To assist in debugging\n lparms[:openstat] = open?\n #\n lparms\n end",
"def history_log_params\n end",
"def parameters()\n @melody = params[:melody].upcase.split(\",\") # create array of notes in melody parameter\n @shift = params[:shift] # shift parameter\nend",
"def get_log_args\n args = {}\n args[\"APP_UUID\"] = @application.uuid if @application\n args[\"DOMAIN\"] = (@application.domain_namespace if @application) || (@domain.namespace if @domain)\n args\n end",
"def error_log_params\n params[:error_log]\n end",
"def user_log_params\n params[:user_log]\n end",
"def print_parameters()\n @h.each do |clave, valor|\n \n $LOG.debug \"The Parameter #{clave} have the value \" +valor.to_s\n end\n end",
"def get_parameters; end",
"def get_parameters; end",
"def print_parameters()\n @params.each do |clave, valor|\n #$LOG.debug \"The Parameter #{clave} have the value \" +valor.to_s\n puts \"#{clave} = #{valor} \"\n end\n end",
"def get_user_parms\r\n parms = UserParameter.find(1)\r\n @cheap = parms.bargain_limit\r\n @mort_cheap = parms.low_mortgage_limit\r\n @earlyad = parms.early_ad\r\n @log.info \"Running with parms: Cheap: #{@cheap}, Mortgage split: #{@mort_cheap}, Early Ad Id: #{@earlyad} \"\r\n end",
"def get_parameters\r\n @parameters\r\n end",
"def log_request\n logger.info \"HTTP request received => #{request.fullpath} , params => #{params} \"\n end",
"def collectd\n logger.info(params.inspect)\n end",
"def params\n @parameters\n end",
"def log_params\n p = params.require(:log).permit(:type, :team_id, :time, :user_id, :client, :log_type, :deleted, :point, :data, :gen)\n if !p.has_key?(:type)\n # add the type if not present; this can be from an old app\n p.merge!({ type: 'TeamLog' })\n else\n p\n end\n end",
"def parameters\n data[:parameters]\n end",
"def parameters\n @parameters ||= {}\n end",
"def parameters\n @parameters ||= {}\n end",
"def log_load_time_params\n params.fetch(:log_load_time, {})\n end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def parameters; end",
"def log\n advanced[:log]\n end",
"def extract_params()\n param = extract_params_pm()\n param[:dureeCours] = @dureeCours\n param[:dureeTP] = @dureeTP\n param[:quadri] = @quadri\n param[:professeur] = @professeur\n return param\n end",
"def log_params\n params.require(:log).permit(:class_name, :method_name, :hash_parms)\n end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params\n @opts\n end",
"def parameters\n @parameters\n end",
"def params\n @env.params\n end",
"def params() request.params end",
"def parameters\n @property_hash[:parameters]\n end",
"def parameters\n context.parameters.map(&:name)\n end",
"def params\n # endpoint.declared(endpoint.params)\n @params = \"#{env['QUERY_STRING']}_#{env[Grape::Env::RACK_INPUT].read}\"\n end",
"def params_to_pass\n settings\n end",
"def p(params)\n MyLogger.info params\nend",
"def log_metric_params\n params.fetch(:log_metric, {})\n end",
"def params\n _params\n end",
"def config_log_params\n params.require(:config_log).permit(:userid, :timemodified, :plugin, :name, :value, :oldvalue)\n end",
"def parameters()\n\n url = \"#{@base_url}/#{@tool}/parameters/\"\n uri = URI.parse(url)\n resp = Net::HTTP.get_response(uri)\n params = XmlSimple.xml_in(resp.body)\n\n return params\n\n end",
"def log_params\n params.permit(:macaddress, :secret_key, :log_file, :page)\n end",
"def query_parameters\n request.GET\n end",
"def query_parameters\n end",
"def report_params\n end",
"def cmd_twitt_show_parms\n\t\t\t\tprint_status(\"Parameters:\")\n\t\t\t\tprint_good(\"consumer_key: #{@consumer_key}\")\n\t\t\t\tprint_good(\"consumer_secret: #{@consumer_secret}\")\n\t\t\t\tprint_good(\"oauth_token: #{@oauth_token}\")\n\t\t\t\tprint_good(\"oauth_token_secret: #{@oauth_token_secret}\")\n\t\t\t\tprint_good(\"user: #{@user}\")\n\t\t\t\tprint_good(\"source: #{@source}\")\n\t\t\tend",
"def params\n @params\n end",
"def params\n @params\n end",
"def params\n @params\n end",
"def parameter_string\n\t\tend",
"def params\n @params\n end",
"def base_params\n {\n v: PROTOCOL_VERSION,\n # Client ID\n cid: @user_id,\n # Tracking ID\n tid: TRACKING_ID,\n # Application Name\n an: APPLICATION_NAME,\n # Application Version\n av: Bolt::VERSION,\n # Anonymize IPs\n aip: true,\n # User locale\n ul: Locale.current.to_rfc,\n # Custom Dimension 1 (Operating System)\n cd1: @os\n }\n end",
"def params\n @@params\n end",
"def log_params\n params.fetch(:log, {}).permit(\n :cat_id, :feed_id, :fed_at\n )\n end",
"def parameters\n @parameters ||= get_field_by_type(PARAMETER_FIELDS)\n end",
"def plag_params\n params.fetch(:plag, {})\n end",
"def query_parameters; end",
"def parameters\n @parameters || []\n end",
"def params\n '(%s)' % @format\n end",
"def request_parameters; end",
"def params\n @_params\n end",
"def getParam(value)\n param = \"\"\n value.getParameters().each do |p|\n #TODO: Actually Get all parameters, cookies, jason, url, maybe we should get only url,get/post parameters\n #http://portswigger.net/burp/extender/api/constant-values.html#burp.IParameter.PARAM_BODY\n param += \"%s\" % p.getType() + \":\" + p.getName() + \"=\" + p.getValue() + \",\"\n end\n return param\n\n end",
"def params\n @params ||= {}\n end",
"def params\n @params ||= {}\n end",
"def query_params\n get_query_params\n end",
"def params\n self.class.const_get(\"REQUEST_PARAMETERS\").inject({}) do |parameters, parameter|\n parameters[parameter] = instance_variable_get(\"@#{parameter}\") unless instance_variable_get(\"@#{parameter}\").nil?\n parameters\n end\n end",
"def log_params\n params.require(:log).permit(:uniqid, :contact_id, :log_type, :time, :duration, :device_id, :device_imei, :contact_number)\n end",
"def parameters\n return @parameters\n end",
"def printparams\r\n return if @@params.empty?\r\n @@params.each {|key, value| puts \"#{key} : #{value}\" }\r\n end",
"def parameters\n @params.extra_parameters\n end",
"def injection_params\n params[:injection]\n end",
"def params\n request.env[\"action_dispatch.request.request_parameters\"]\n end",
"def parameters(host, options)\n hiera = Enc::Hiera.new(host, options)\n params = hiera.params\n params.to_yaml\n end",
"def read_params(params)\n cg_reader.read_params(params)\n end",
"def request_params; end",
"def parameters\n nil\n end",
"def light_log_params\n params.require(:light_log).permit(:event)\n end",
"def parameters\n url_params = \"\"\n\n if @resource == :catalog\n url_params += \"&\" + \"offset=#{URI.escape(@offset.to_s)}\" if @offset\n url_params += \"&\" + \"size=#{URI.escape(@size.to_s)}\" if @size\n url_params += \"&\" + \"search=#{URI.escape(@search)}\" if @search\n url_params += \"&\" + \"filter=#{URI.escape(@filter)}\" if @filter\n url_params += \"&\" + \"state=#{URI.escape(@state)}\" if @state\n url_params += \"&\" + \"sort=#{URI.escape(@sort)}\" if @sort\n url_params += \"&\" + \"instock=#{@instock}\" if @instock\n elsif @resource == :categorymap\n url_params += \"&\" + \"filter=#{URI.escape(@filter)}\" if @filter\n url_params += \"&\" + \"search=#{URI.escape(@search)}\" if @search\n elsif @resource == :reference\n url_params += \"&\" + \"filter=#{URI.escape(@filter)}\" if @filter\n end\n\n return url_params\n end",
"def collect_parameters\n @search = params[:search]\n @page = (params[:page]).blank? ? 1 : params[:page]\n @latitude = params[:origin_latitude]\n @longitude = params[:origin_longitude]\n @location_lock = (params[:location_lock]).blank? ? \"true\" : params[:location_lock]\n @proximity = (params[:proximity]).blank? ? 5 : (params[:proximity]).to_i\n @user_id = params[:user_id]\n end",
"def params\n @params ||= {}\n end"
] |
[
"0.72568727",
"0.6974977",
"0.6796814",
"0.6654633",
"0.64986485",
"0.639651",
"0.63504136",
"0.6282042",
"0.62636644",
"0.62636644",
"0.6207054",
"0.6097402",
"0.60580355",
"0.6000372",
"0.599456",
"0.5974364",
"0.59423983",
"0.59374064",
"0.5936171",
"0.5936171",
"0.5930091",
"0.5927391",
"0.5927391",
"0.5927391",
"0.5927391",
"0.5927391",
"0.5927391",
"0.5927391",
"0.5927391",
"0.59241104",
"0.5911416",
"0.5900942",
"0.588504",
"0.588504",
"0.588504",
"0.588504",
"0.588504",
"0.588504",
"0.588504",
"0.588504",
"0.588504",
"0.588504",
"0.588504",
"0.588504",
"0.588504",
"0.588504",
"0.588504",
"0.588504",
"0.588504",
"0.5875948",
"0.58599037",
"0.5851042",
"0.58366597",
"0.5812047",
"0.5806987",
"0.5795937",
"0.5766556",
"0.57565784",
"0.57538503",
"0.5743033",
"0.5708461",
"0.5695959",
"0.56746036",
"0.5669901",
"0.56645465",
"0.56577015",
"0.56490886",
"0.56386155",
"0.56386155",
"0.56386155",
"0.56366825",
"0.5635786",
"0.56350905",
"0.56202155",
"0.56176925",
"0.55986893",
"0.5593173",
"0.5592537",
"0.5583345",
"0.55809796",
"0.55701935",
"0.5569313",
"0.55597335",
"0.5550968",
"0.5550968",
"0.5549078",
"0.55405056",
"0.5539939",
"0.5536967",
"0.5529364",
"0.55199987",
"0.5519717",
"0.55169076",
"0.55131996",
"0.55100983",
"0.5508488",
"0.55066645",
"0.5503488",
"0.5467857",
"0.54640555",
"0.5453991"
] |
0.0
|
-1
|
para almacenar la tarea, se debe validar si ya existe o no, se debe utililzar un match porque en la base de datos las tareas estan con el nombre mas el nombre del usuario si la tarea no existe se crea la tarea con el nombre de la tarea y el nombre del usuario, para poder luego sacar las tareas correspondientes al usuario
|
def almacenar(nombre)
array = Tarea.all
@@existente = false
array.each{|x| @@existente = true if /#{nombre}/.match(x["title"])}
unless @@existente
Tarea.create("#{nombre} #{@@usuario}")
end
@@existente
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def obtener\narray = Tarea.all\n \n @@tareas = Array.new\n array.each{|x| @@tareas.push(x) if /#{@@usuario}/.match(x[\"title\"])}\n\n @@tareas.each do |x|\nstring = x[\"title\"].split\n string.pop\nx[\"title\"] = string.join(\" \")\n\n\n end\n #esto es para que no quede una tarea vacia al principio, la cual es la correspondiente login\n@@tareas.shift\n @@tareas\n\nend",
"def RepeticionUsuarioCreate(lista_usuarios, nombre_usuario, apellidos_usuarios)\n val = true\n lista_usuarios.each do |usuario|\n if usuario.nombre_usuario == nombre_usuario.upcase\n if usuario.apellidos_usuario == apellidos_usuarios.upcase\n val = false\n break\n end\n end\n end\n return val\n end",
"def recibir_auto(usuario)\n if self.estado_id == 2\n traza_creada = Traza.create(:copia_id => self.id, :movimiento_id => 2, :usuario => usuario, :buzon_id => usuario.puesto.buzon_id)\n return false unless traza_creada\n self.estado_id = 3\n return true if self.save \n #si llega aqui, algo malo paso.\n return false\n end\n end",
"def create\n\n if @alumno = User.find(session[:usuario]).grupo.last.alumno.length == 6\n flash[:notice] = \"El limite de alumnos es de 6 personas\"\n redirect_to(home_alumno_path) and return\n end\n\n\n if @alumno = User.find(session[:usuario]).grupo.last.alumno.where(:cedula => params[:alumno]['cedula']).length >0\n flash[:notice] = \"Ya registraste un alumno con esta cedula\"\n @alumno = Alumno.new(alumno_params)\n @__title = \"Crear nuevo alumno\"\n\n render 'new' and return\n end\n\n @alumno = User.find(session[:usuario]).grupo.last.alumno.new(alumno_params)\n\n respond_to do |format|\n if @alumno.save\n format.html { redirect_to grupos_path, notice: '#Nuevo alumno agregado al grupo' }\n format.json { render action: 'show', status: :created, location: @alumno }\n else\n format.html { render action: 'new' }\n format.json { render json: @alumno.errors, status: :unprocessable_entity }\n end\n end\n end",
"def tarea_params\n params.require(:tarea).permit(:nombre, :image, :subida, :listo, :user_id)\n end",
"def registrar_entrada(rango)\n reg = self.class.last(:conditions => {:usuario_id => self.usuario_id})\n reg = self.class.new if reg.nil?\n unless rango.include?(reg.created_at)\n self.tipo = \"E\"\n else\n errors.add_to_base(\"Usted ya ha registrado su Entrada\")\n return false\n end\n end",
"def RepeticionMarcaCreate(lista_tipos, nombre_tipo)\n val = true\n lista_tipos.each do |tipo|\n if tipo.descrip_tipo == nombre_tipo.upcase\n val = false\n break\n end\n end\n return val\n end",
"def actualiza_atributos_con(hash, estado)\n # Validación de atributos de plaza, estado y rol.\n if hash[:rol_id].blank?\n self.errors.add(:rol, \"Rol no puede ir vacío\")\n elsif Rol.find(hash[:rol_id]).nombre.eql?(\"Encargado\")\n if hash[:plaza_id].blank?\n self.errors.add(:plaza, \"Plaza no puede ir vacía\")\n end\n if estado.blank?\n self.errors.add(:estado, \"Estado no puede ir vacío\")\n end\n end\n \n return false unless self.errors.empty?\n self.update_attributes(hash.merge({:password => \"cablecom_#{hash[:login]}\", :password_confirmation => \"cablecom_#{hash[:login]}\"}))\n end",
"def avanzar_unidad_apoyo_consultoria(usuario,unidad)\n unless self.Estatus.const_id == 'ST0004'\n self.errors.add(:solicitud, I18n.t('Sistema.Body.Modelos.Solicitud.Errores.estatus_no_adecuado'))\n else\n if unidad == 1\n validacion = SolicitudRecaudo.validar_consultoria(self.id)\n unless validacion\n self.errors.add(:solicitud, I18n.t('Sistema.Body.Modelos.Solicitud.Errores.analisis_debe_ser_copletado'))\n return\n end\n self.consultoria = true\n mensaje = I18n.t('Sistema.Body.Modelos.Solicitud.Errores.analisis_legal_solicitud')\n elsif unidad == 2\n validacion = SolicitudAvaluo.validar_avaluo(self.id)\n unless validacion == true\n self.errors.add(:solicitud, validacion)\n return\n end\n self.avaluo = true\n mensaje = I18n.t('Sistema.Body.Modelos.Solicitud.Errores.revision_inspeccion_avaluos')\n elsif unidad == 3\n validacion = SolicitudResguardo.validar_resguardo(self.id)\n unless validacion == true\n self.errors.add(:solicitud, validacion)\n return\n end\n self.resguardo = true\n mensaje = I18n.t('Sistema.Body.Modelos.Solicitud.Errores.revision_resguardo_institucional')\n end\n self.save\n ControlSolicitud.create_new(self.id, self.estatus_id, usuario, I18n.t('Sistema.Body.General.avanzar'), self.estatus_id, mensaje)\n if self.resguardo == true && self.avaluo == true && self.consultoria == true\n estatus_origen_id = self.estatus_id\n configuracion_avance = ConfiguracionAvance.find_by_estatus_origen_id(self.estatus_id)\n self.estatus_id = configuracion_avance.estatus_destino_id\n self.fecha_actual_estatus = Time.now.strftime(\"%Y/%m/%d\")\n self.save\n ControlSolicitud.create_new(self.id, self.estatus_id, usuario, I18n.('Sistema.Body.General.avanzar'), estatus_origen_id, '')\n end\n end\n end",
"def create\n nominee_params = params[:nominee][:user_id]\n nominee_split = nominee_params.split(\" \")\n\n # There could be spaces in the name. Safest assumption is first array item is partial firstname, and last array element is email\n # \"user_id\"=>\"User 14 Company2 (amoldalvicoursera+local2user14@gmail.com)\"}\n nominee_firstname = nominee_split.first rescue nil\n\n nominee_email1 = nominee_split.last\n nominee_email = nominee_email1.gsub(/[()]/, \"\") rescue nil\n nominee = User.where([\"firstname LIKE ? and email LIKE ? and admin_user_id = ?\", \"%#{nominee_firstname}%\",\"%#{nominee_email}%\", current_user.id])\n if nominee == nil || nominee.length == 0\n flash[:success] = \"Sorry, we couldn't locate that user.\"\n redirect_to :back\n end\n user_id = nominee[0].id\n email = nominee[0].email\n fullname = nominee[0].fullname\n firstname = nominee[0].firstname\n lastname = nominee[0].lastname\n @nominee = Nominee.new(params[:nominee])\n @nominee.user_id = user_id\n @nominee.email = email\n @nominee.fullname = fullname\n @nominee.firstname = firstname\n @nominee.lastname = lastname\n\n \n if nominee_params.present?\n nomineeemail = User.where('email = ?',nominee_email)\n if nomineeemail.present?\n if @nominee.save\n flash[:success] = \"User has been successfully nominated.\"\n redirect_to :back\n \n else\n redirect_to :back, :notice=> \"Please enter all the fields below.\"\n end\n else\n flash[:notice] = \"Sorry, we cannot find that person.\"\n redirect_to :back \n end\n else\n redirect_to :back, :notice=> \"Please enter all the fields below.\"\n end\nend",
"def create\n @tarea = Tarea.new(params[:tarea])\n\n respond_to do |format|\n if @tarea.save\n flash[:notice] = 'Tarea creada correctamente.'\n format.html { params[:oper].nil? ? redirect_to(@tarea.cargo) : render(:text => \"Ok\")}\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tarea.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @usuario = Usuario.new(parametros_de_usuario)\n @usuario.celular = params[:area] + params[:numero]\n @usuario.fh_sesion = Time.now.strftime(\"%Y%m%d%H%M\")\n @usuario.f_creado = Time.now\n @usuario.f_actualizado = Time.now\n\n celulart = params[:area] + params[:numero]\n respond_to do |format|\n if Usuario.exists?(celulart)\n @usuario = Usuario.find(celulart)\n if @usuario.f_eliminado == nil\n\n format.html { redirect_to usuarios_url, notice: '*** ERROR usuario existe ***' }\n else\n format.html { redirect_to usuarios_url, notice: '*** Advertencia: usuario eliminado por un administrador ***' } \n end\n else\n if Usuario.any?\n @usuario.rol = 'opera'\n else\n @usuario.rol = 'admin'\n end\n if @usuario.save\n if session[:rol_usuario] == nil\n session[:celular_usuario] = @usuario.celular\n end\n format.html { redirect_to @usuario, notice: '*** Cuenta creada ***' }\n else\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def create\n @userarea = Userarea.new(userarea_params)\n\n respond_to do |format|\n if @userarea.save\n format.html { redirect_to @userarea, info: 'El área de usuario fue creada con éxito.' }\n format.json { render :show, status: :created, location: @userarea }\n else\n format.html { render :new }\n format.json { render json: @userarea.errors, status: :unprocessable_entity }\n end\n end\n end",
"def podeCadastrarNovaTurma\n\n if (current_usuario.usuarioLimitado? && current_usuario.turmas.exists?)\n #se usuario é limitado e ja possui local\n #true -true\n return false\n end\n\n return true\n\n end",
"def create\n @tareas = Tarea.all\n @tareapositivas = Tarea.where(listo: true)\n @tarea = Tarea.new(tarea_params)\n\n respond_to do |format|\n if @tarea.save\n format.html { redirect_to @tarea, notice: 'Tarea was successfully created.' }\n format.json { render :show, status: :created, location: @tarea }\n else\n format.html { render :new }\n format.json { render json: @tarea.errors, status: :unprocessable_entity }\n end\n end\n end",
"def seguir(otro_usuario)\n\t\t# siguiendo << otro_usuario\n\t\trelaciones_activas.create(seguido_id: otro_usuario.id)\n\tend",
"def update\n @errors = []\n @area = Area.find(params[:id])\n \n #Me fijo que haya seleccionado al menos un coordinador válido para el área.\n if !project_leaders_valid?(params[:area][:project_leaders].split(%r{,\\s*})) \n @errors = @errors.concat([\"Debe seleccionar un coordinador válido para el área \" + @area.name])\n end\n \n @area.attributes = params[:area]\n \n if @errors.empty? and @area.valid?\n @area.save\n \n #Actualizo los roles project_leader del área.\n #Primero saco todas los coordinadores que tiene el área. \n User.with_role_in_area('project_leader', @area).each do |user|\n user.has_no_role!(:project_leaders, @area)\n end\n \n #Agrego todos los nuevos project leaders al área. \n set_project_leaders(params[:area][:project_leaders].split(%r{,\\s*}), @area) \n end\n respond_with(@area)\n end",
"def valida_usuario(correo, clave)\n data = Usuario.find_by(correo: correo, estado: ACTIVO, validado: VALIDADO)\n if data.blank?\n data1 = Usuario.find_by(correo: correo, estado: ACTIVO)\n if data1.blank? != true\n return [false, 'El usuario no ha sido validado, hágalo desde el mensaje que llego a su correo electrónico']\n else\n return [false, 'No existe usuario con ese correo electrónico']\n end\n else\n psw = data[:psw]\n clave_ing = crypttext(clave)\n res = psw <=> clave_ing\n if res == 0\n return [true, data]\n else\n return [false, 'contraseña incorrecta']\n end\n end\n end",
"def checkIdEscuelaForDirector\n if !self[:id_permission].nil? && self.user_permission.name == \"Director\"\n if !self[:escuela_id].nil?\n if !Escuela.exists?(id: self[:escuela_id])\n self.errors[:carrera_id] = \"La escuela seleccionada no se encuentra en el sistema.\"\n end\n else\n # El director creado no tiene una carrera asignada.\n self.errors[:escuela_id] = \"Debe seleccionar una escuela para el usuario director.\"\n end\n end\n end",
"def create\n @director_tesis_registro = current_user.director_tesis_registros.build(director_tesis_registro_params)\n\n if @director_tesis_registro.save\n flash[:success] = \"Su petición de registro de director de tesis ha sido creado!\"\n if current_user.tipos_usuario.tipo == \"Alumno\"\n redirect_to alumnos_path\n else\n redirect_to root_path\n end\n else\n flash[:alert] = \"Su petición de registro de director de tesis no pudo ser creada! Revise el formulario.\"\n render :new\n end\n end",
"def inicia_analista\n current_usuario = Usuario.create!(PRUEBA_USUARIO_AN)\n current_usuario.grupo_ids = [20]\n current_usuario.save\n return current_usuario\n end",
"def inicia_analista\n current_usuario = Usuario.create!(PRUEBA_USUARIO_AN)\n current_usuario.grupo_ids = [20]\n current_usuario.save\n return current_usuario\n end",
"def inicia_analista\n current_usuario = Usuario.create!(PRUEBA_USUARIO_AN)\n current_usuario.grupo_ids = [20]\n current_usuario.save\n return current_usuario\n end",
"def inicia_analista\n current_usuario = Usuario.create!(PRUEBA_USUARIO_AN)\n current_usuario.grupo_ids = [20]\n current_usuario.save\n return current_usuario\n end",
"def inicia_analista\n current_usuario = Usuario.create!(PRUEBA_USUARIO_AN)\n current_usuario.grupo_ids = [20]\n current_usuario.save\n return current_usuario\n end",
"def inicia_analista\n current_usuario = Usuario.create!(PRUEBA_USUARIO_AN)\n current_usuario.grupo_ids = [20]\n current_usuario.save\n return current_usuario\n end",
"def rescatar\n self.estado_id = 1 #salida si lo creo, entrada/foliado si lo redirijo\n self.estado_id = 3 if self.trazas.count(:conditions => 'movimiento_id in (2,7,8)') > 0\n if self.origen.externo\n RAILS_DEFAULT_LOGGER.info \"devolviendo de origen externo #{self.origen.to_label} a #{self.documento.buzon}\"\n self.buzon_id = self.documento.buzon_id\n else\n self.buzon_id = self.origen_id\n end\n self.add_traza(current_user.id, 14, current_user.puesto.buzon_id)\n self.save!\n end",
"def tarea_params\n params.require(:tarea).permit(:user_id, :proyecto_id, :categoria_id, :descripcion, :prioridad, :fecha_inicio, :fecha_fin, :tiempo, :borrado)\n end",
"def create\n\t@lista_de_tarea = ListaDeTarea.find(params[:lista_de_tarea_id])\n @tarea = @lista_de_tarea.tareas.build(params[:tarea])\n if @tarea.save\n flash[:notice] = \"Nueva tarea creada!\"\n redirect_to lista_de_tarea_url(@lista_de_tarea)\n else\n render :action => :new\n end\n end",
"def create\n @leccion = Leccion.find(params[:leccion_id])\n @apunte = @leccion.apuntes.create(apunte_params)\n @apunte.user_id = current_user.id\n if @apunte.save\n redirect_to @leccion\n else\n flash.now[:danger] = \"error\"\n end\n end",
"def create\n @cambio_director_tesis_registro = current_user.cambio_director_tesis_registros.build(cambio_director_tesis_registro_params)\n if @cambio_director_tesis_registro.save\n flash[:success] = \"Su petición para cambiar director(es) de tesis ha sido creada!\"\n if current_user.tipos_usuario.tipo == \"Alumno\"\n redirect_to alumnos_path\n else\n redirect_to root_path\n end\n else\n flash[:alert] = \"Su petición para cambiar director(es) de tesis no pudo crearse! Revise el formulario.\"\n render :new\n end\n end",
"def create\n \n if params[:parent_id]\n @parent_area = Area.find(params[:parent_id]) \n @area = @parent_area.children.build(params[:area]) \n else\n @area = Area.new(params[:area]) \n end\n \n @errors = []\n \n #Me fijo que haya seleccionado al menos un coordinador válido para el área.\n @project_leaders = @area.project_leaders.split(%r{,\\s*})\n if !project_leaders_valid?(@project_leaders) \n @errors = @errors.concat([\"Debe seleccionar un coordinador válido para el área \" + @area.name])\n end\n \n if @errors.empty? && @area.valid?\n @area.save\n set_project_leaders(@project_leaders, @area)\n end\n respond_with(@area)\n end",
"def create\n @alumno = Alumno.new(alumno_params)\n @alumno.nombre=@alumno.nombre.capitalize\n @alumno.ap_paterno=@alumno.ap_paterno.capitalize\n @alumno.ap_materno=@alumno.ap_materno.capitalize\n @alumno.nombre_tutor=@alumno.nombre_tutor.capitalize\n @alumno.ap_paterno_tutor=@alumno.ap_paterno_tutor.capitalize\n @alumno.ap_materno_tutor=@alumno.ap_materno_tutor.capitalize\n\n\n respond_to do |format|\n if @alumno.save\n format.html { redirect_to @alumno, notice: 'Alumno registrado correctamente .' }\n format.json { render :show, status: :created, location: @alumno }\n else\n format.html { render :new }\n format.json { render json: @alumno.errors, status: :unprocessable_entity }\n end\n end\n end",
"def registrar_usuario\n business_user = User.new\n business_user.email = self.email\n business_user.password = business_user.generar_password\n business_user.client_type = 'empresa'\n business_user.save\n update(user_id: business_user.id, user_created_id: business_user.id)\n #luego de registrar al usuario se almacena la contraseña en la tabla Historypassword\n #donde se almacenaran las 3 ultimas usadas\n password_business = HistoryPassword.new\n password_business.password = business_user.password\n password_business.user_id = business_user.id\n password_business.save\n end",
"def create\r\n @postagem = @user.user.postagems.build(postagem_params)\r\n if (admin_signed_in? || aluno_signed_in? || docente_signed_in? ) # se é admin ou aluno ou docente\r\n if (admin_signed_in?) #admin logado pode criar vazio\r\n respond_to do |format|\r\n if @postagem.save(postagem_params)\r\n format.html { redirect_to @postagem, notice: 'Postagem was successfully created.' }\r\n format.json { render :show, status: :created, location: @postagem }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @postagem.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n elsif (aluno_signed_in? && current_aluno.laboratorio_id != nil) #aluno não pode criar vazio\r\n respond_to do |format|\r\n if @postagem.save(postagem_params)\r\n format.html { redirect_to @postagem, notice: 'Postagem was successfully created.' }\r\n format.json { render :show, status: :created, location: @postagem }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @postagem.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n elsif (docente_signed_in? && !current_docente.laboratorios.empty?) #docente não pode criar vazio\r\n respond_to do |format|\r\n if @postagem.save(postagem_params)\r\n format.html { redirect_to @postagem, notice: 'Postagem was successfully created.' }\r\n format.json { render :show, status: :created, location: @postagem }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @postagem.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n else\r\n respond_to do |format|\r\n format.html { redirect_to new_postagem_url, notice: 'Não foi possível criar postagem.' }\r\n format.json { render :show, status: :created, location: @postagem }\r\n end\r\n end\r\n end\r\n end",
"def create\n unless current_user.admin? or current_user.coordinador?\n redirect_to '/', :alert => \"Acceso denegado.\" #por ahora solo un adminsitrador puede ver esto\n end\n\n @tutor = Tutor.new(tutor_params)\n @tutor.firstname= params[:tutor][:firstname].upcase!\n @tutor.lastname= params[:tutor][:lastname].upcase!\n @tutor.lastnamema= params[:tutor][:lastnamema].upcase!\n @tutor.status = true\n if @tutor.save\n flash[:noticep] = 'Tutor añadido con éxito' \n redirect_to :action => \"index\" \n else\n flash[:noticen] = 'Error al añadir tutor' \n render :new \n end\n \n end",
"def create\n @usuario = Usuario.new(usuario_params)\n @usuario.nombres = @usuario.nombres.upcase\n @usuario.apellidos = @usuario.apellidos.upcase\n @usuario.salario = 0\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to @usuario, notice: 'El Usuario se ha creado correctamente.' }\n format.json { render :show, status: :created, location: @usuario }\n else\n @div_edit_admin = true\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n \n end",
"def cargarAula\n @aula = Aula.new(aula_params)\n cumple = true\n\n Aula.all.each do |aul|\n if(@aula.NombreAula == aul.NombreAula)\n flash[:notice] = 'Ya exite un aula con ese nombre'\n cumple = false\n end\n end\n if(cumple)\n if @aula.save\n flash[:notice] = 'El aula se creó exitosamente!'\n redirect_to listadoAulas_path\n else\n redirect_to listadoAulas_path\n end\n else\n redirect_to listadoAulas_path\n end\n end",
"def create\n #@rutas_usuario = RutasUsuario.new(rutas_usuario_params)\n if current_user != nil\n respond_to do |format|\n\t if params[:ruta_favorita] != \"\"\n @ruta = Ruta.find(params[:ruta_favorita])\n @user = current_user\n @rutas_usuario = RutasUsuario.new(ruta:@ruta, user:@user)\n #@favorita = Ruta.where(:id => params[:rutas])\n #@favorita = Ruta.first.id\n #@currentUser = current_user.id\n #@rutas_usuario.user = current_user\n #@rutas_usuario.ruta = Ruta.first\n #RutasUsuario.create(ruta:Ruta.first, user:current_user)\n #@current_user = User.find(session[\"user_id\"])\n\t end\n\n if @rutas_usuario.save\n format.html { redirect_to @rutas_usuario, notice: 'Ruta favorita agregada.' }\n format.json { render :show, status: :created, location: @rutas_usuario }\n else\n format.html { render :new }\n format.json { render json: @rutas_usuario.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def IniciaArea\n\t\t@Lojaq = Admloja.all\n\t\tif @Lojaq.size != 1\t# Se não houver exatamente um registro\n\t\t\t@loja = Admloja.all\n\t\t\t# @loja.delete.all\n\t\t\t# Admloja.delete\n\t\t\t@Novo = Admloja.new\n\t\telse\n\t\t\treturn\n\t\tend\n\n\t\t@Novo.nome = \"MINI LOJA VIRTUAL\"\n\t\t@Novo.cnpj = \"33014556000196\"\n\t\t@Novo.endereco = \"Rua José Dias, 1024\"\n\t\t@Novo.cidade = \"São José dos Campos\"\n\t\t@Novo.bairro = \"Jd. Aquarius\"\n\t\t@Novo.estado = \"SP\"\n\t\t@Novo.tel = \"1212341234\"\n\t\t@Novo.fax = \"1243214321\"\n\t\t@Novo.cel = \"1212345678\"\n\t\t@Novo.email = \"lojavirtual@modelo.com\"\n\t\t@Novo.password = \"175a6350f1f49ed49ab438ab6b2e0e45f6d3b8f9\"\t# senha\n\t\t@Novo.pagadm = 6\n\t\t@Novo.pagloja = 12\n\t\t@Novo.mcab = 1\n\t\t@Novo.maxsec = 0\n\t\t@Novo.maxdep = 0\n\t\t@Novo.upreco = 1\n\t\t@Novo.udesconto = 0\n\t\t@Novo.ufrete = 1\n\t\t@Novo.freefrete = 150\n\t\t@Novo.rodape = \"<strong> ESTE É O RODAPÉ DA LOJA VIRTUAL </STRONG>\"\n\t\t@Novo.cabecalho = '<div class=\"destaque\"><center>Aproveite as promoções da Loja Virtual! <br>Todos os produtos foram cuidadosamente selecionados pra você!<br>Conforto, Segurança e Tecnologia, <br>agora você encontra aqui!!!<br></div>'\n\t\t@Novo.cep = \"12345691\"\n\t\t@Novo.complemento = \"\"\n\t\t@Novo.cpostal = \"\"\t\t\n\t\t@Novo.save\n\t\treturn\n\tend",
"def completa_info(root_usuario_id=nil)\n if usuario_id.present?\n self.es_propietario = root_usuario_id == self.usuario_id ? true : false\n\n begin # Por si viene del scope datos_basicos y encontro el usuario\n self.nombre = u_nombre\n self.correo = u_email\n self.institucion = u_institucion\n rescue\n u = usuario\n self.nombre = \"#{u.nombre} #{u.apellido}\".strip\n self.correo = u.email\n self.institucion = u.institucion\n end\n\n else # Por si no esta el usuario_id\n begin # Trato de ver si venia de un scope\n self.nombre = c_nombre\n self.institucion = c_institucion\n self.es_propietario = true\n rescue\n self.es_propietario = true\n end\n end\n end",
"def tarea_params\n params.require(:tarea).permit(:Nombre, :descripcion, :importancia, :fecha)\n end",
"def create\n @user = User.new(users_params)\n @users = User.all\n #Verificacion de que los campos estén llenos\n if params[:user][:nombre_usuario] == \"\" || params[:user][:apellidos_usuario] == \"\" || params[:user][:email] == \"\" || params[:user][:rol] == \"\" || params[:user][:estado] == \"\"\n @titulo = \"Creacion de usuario\"\n @mensaje = \"Debe llenar todos los campos\"\n @tipo = \"warning\"\n @icono = \"icon fa fa-warning\"\n else\n #Verificacion de la password\n if params[:user][:password] != params[:user][:password_confirmation]\n @titulo = \"Creacion de usuario\"\n @mensaje = \"Las contraseñas son distintas\"\n @tipo = \"warning\"\n @icono = \"icon fa fa-warning\"\n else\n #Verificacion de la repeticion del nombre\n if !RepeticionUsuarioCreate(@users, params[:user][:nombre_usuario], params[:user][:apellidos_usuario])\n @titulo = \"Creacion de usuario\"\n @mensaje = \"Ya existe un usuario con ese nombre y apellido\"\n @tipo = \"warning\"\n @icono = \"icon fa fa-warning\"\n else\n if !RepeticionEmailCreate(@users, params[:user][:email])\n @titulo = \"Creacion de usuario\"\n @mensaje = \"Ya existe un usuario con correo electrónico registrado\"\n @tipo = \"warning\"\n @icono = \"icon fa fa-warning\"\n else\n if !RepeticionLoginCrete(@users, params[:user][:login])\n @titulo = \"Creacion de usuario\"\n @mensaje = \"Ya existe un usuario con ese login\"\n @tipo = \"warning\"\n @icono = \"icon fa fa-warning\"\n else\n respond_to do |format|\n if @user.save\n format.js\n format.html {redirect_to @user, notice: \"Usuario creado correctamente\"}\n format.json {render :show, status: :created, location: @user}\n @titulo = \"Creacion de usuario\"\n @mensaje = \"Se a creado el usuario correctamente\"\n @tipo = \"success\"\n @icono = \"icon fa fa-check\"\n else\n format.js\n format.html {render :new}\n format.json {render json: @user.errors, status: :unprocessable_entity}\n @titulo = \"Creacion de usuario\"\n @mensaje = \"Ha ocurrido un error\"\n @tipo = \"danger\"\n @icono = \"icon fa fa-ban\"\n end\n end\n end\n end\n end\n end\n end\n end",
"def cargar_area_id\n\t\tarea= Area.where(nombre: 'Nutrición').first.id\n\t\tself.area_id= area\n\tend",
"def create\n #Creamos el objeto con los valores a ingresar.\n @usuario = Usuario.new({\n :nombre => params[:usuario][:nombre],\n :apellido => params[:usuario][:apellido],\n :user=> params[:usuario][:user],\n :pass => params[:usuario][:pass],\n });\n #Verificamos si el usuario ha sido creado.\n if @usuario.save()\n redirect_to :controller => \"usuarios\", :action => \"exito\", :notice => \"El usuario ha sido creado\";\n else\n render \"registrar\";\n end\n end",
"def create\n @userarea = Userarea.new(userarea_params)\n\n respond_to do |format|\n if @userarea.save\n format.html { redirect_to @userarea, notice: 'Userarea was successfully created.' }\n format.json { render :show, status: :created, location: @userarea }\n else\n format.html { render :new }\n format.json { render json: @userarea.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n existing_user = User.find_by(email_id: params[:user][:email_id])\n if existing_user != nil\n if existing_user.is_realtor == true\n redirect_to login_path, notice: 'You are already registered as an Realtor'\n else\n existing_user.is_realtor = true\n existing_user.password = params[:user][:password]\n if existing_user.save\n add_realtor = Realtor.new(realtor_params)\n add_realtor.users_id = existing_user.id\n if add_realtor.save\n redirect_to login_path, notice: 'Realtor was successfully created.'\n else\n redirect_to login_path, notice: 'Error saving realtor.'\n end\n else\n redirect_to login_path, notice: 'Error saving user.'\n end\n end\n else\n @realtor = Realtor.new(realtor_params)\n @user = User.new(user_params)\n @user.is_realtor = true\n respond_to do |format|\n if @user.save\n @realtor.users_id = @user.id\n if @realtor.save\n format.html {redirect_to login_path, notice: 'Realtor was successfully created.'}\n format.json {render :show, status: :created, location: @realtor}\n else\n format.html {redirect_to login_path, notice: 'Error creating realtor'}\n format.json {render json: @realtor.errors, status: :unprocessable_entity}\n end\n else\n format.html {redirect_to login_path, notice: 'Error creating user. Please check input.'}\n format.json {render json: @user.errors, status: :unprocessable_entity}\n end\n end\n end\n end",
"def create\n if params == [:usuario_id,:tweet_id,:texto_id,:id]\n @usuario = Usuario.find(params[:usuario_id])\n @tweet = Tweet.find(params[:tweet_id])\n @textos = Texto.find(params[:texto_id])\n end\n if params == [:palabra_bolsa_id,:id]\n @palabra_bolsa = PalabraBolsa.find(params[:palabra_bolsa_id])\n end\n @texto_palabra = TextoPalabra.new(texto_palabra_params, :id_texto => @textos.id_texto)\n respond_to do |format|\n if @texto_palabra.save\n format.html { redirect_to @texto_palabras, notice: 'Texto palabra was successfully created.' }\n format.json { render :show, status: :created, location: @texto_palabra }\n else\n format.html { render :new }\n format.json { render json: @texto_palabra.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n cour = Cour.find(params[:elefe][:ville_entrainement])\n u = current_user\n #info_ville = params[:elefe][:info_ville].join.to_i\n #params[:elefe][:info_ville] = info_ville\n # CAS DES FICHES EXISTANTES\n if @All_Eleves.exists?(:nom => params[:elefe][:nom], :prenom => params[:elefe][:prenom])\n @fiche_exist = @All_Eleves.find_by(:nom => params[:elefe][:nom], :prenom => params[:elefe][:prenom])\n params[:elefe][:info_ville] = params[:elefe][:info_ville].join(',') if params[:elefe][:info_ville] != nil\n params[:elefe][:prix] = @tarif[params[:elefe][:parentee].to_i] if params[:elefe][:parentee] != nil\n # Fusion de l'élève avec une fiche existante créée à partir des présences (officialisation)\n if !@fiche_exist.date_naissance\n puts \"On update eleve existant\"\n @elefe = @fiche_exist\n cours = @elefe.cours\n if !cours.detect { |b| b.id == cour.id }\n @elefe.cours << cour\n end\n u.eleves << @elefe\n u.commandes << Commande.create(description: 'Affiliation '+params[:elefe][:nom]+' '+params[:elefe][:prenom], montant: params[:elefe][:prix])\n @elefe.commandes << u.commandes.last\n respond_to do |format|\n if @elefe.update(elefe_params)\n format.html { redirect_to @elefe, notice: 'La fiche élève a bien été modifiée.' }\n format.json { render :show, status: :ok, location: @elefe }\n else\n format.html { render :edit }\n format.json { render json: @elefe.errors, status: :unprocessable_entity }\n end\n end\n else\n # Ne peut pas écraser une fiche existante\n redirect_back(fallback_location: :back, alert: 'Il existe déjà un élève inscrit avec le même nom et prénom. Peut-être pourriez-vous entrer un deuxième prénom pour vous différencier ?')\n end\n # CAS CLASSIQUE DE L'INSCRIPTION\n else\n params[:elefe][:info_ville] = params[:elefe][:info_ville].join(',') if params[:elefe][:info_ville] != nil\n params[:elefe][:prix] = @tarif[params[:elefe][:parentee].to_i] if params[:elefe][:parentee] != nil\n @elefe = Elefe.new(elefe_params)\n @elefe.cours << cour\n u.eleves << @elefe\n u.commandes << Commande.create(description: 'Affiliation '+params[:elefe][:nom]+' '+params[:elefe][:prenom], montant: params[:elefe][:prix])\n @elefe.commandes << u.commandes.last\n respond_to do |format|\n if @elefe.save\n format.html { redirect_to @elefe, notice: 'La fiche élève a bien été créée.' }\n format.json { render :show, status: :created, location: @elefe }\n else\n format.html { render :new }\n format.json { render json: @elefe.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def create\n @idioma_usuario = IdiomaUsuario.new(params[:idioma_usuario])\n @usuario = @idioma_usuario.usuario\n respond_to do |format|\n if @idioma_usuario.save\n format.html {\n flash[:notice] = 'Se agregó el idioma correctamente.'\n params[:oper].nil? ? redirect_to(cuenta(@formacion.usuario)) : render(:text => \"Ok\")\n }\n format.js {actualizar_view}\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @idioma_usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @chatarea = current_user.chatareas.new(chatarea_params)\n\n respond_to do |format|\n if @chatarea.save\n @chatarea.chatarea_users.where(user_id: current_user.id).first_or_create\n format.html { redirect_to chatareas_path, notice: 'Chatarea was successfully created.' }\n format.json { render :show, status: :created, location: @chatarea }\n else\n format.html { render :new }\n format.json { render json: @chatarea.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n @var=params[:despachar]\n if !(params[:enviar].nil?)\n\n @ordenes=params[:enviar]\n @ordenes.each do |orden|\n if orden[1] != \"no\"\n @orden = Orden.find(orden[1])\n @orden.empleado_id = @var[\"recolector\"]\n @orden.estado = \"Asignada para Recoleccion\"\n NUESTRO_LOG.info \"Se despacho la orden correctamente\"\n @orden.save\n end\n end\n end\n @ordenprincipal = Orden.find(@var[\"orden\"])\n @ordenprincipal.estado = \"Asignada para Recoleccion\"\n @ordenprincipal.empleado_id = @var[\"recolector\"]\n @ordenprincipal.save\n redirect_to(despachador_path, :notice => t('rutarecolecciones'))\n\n end",
"def set_userarea\n @userarea = Userarea.find(params[:id])\n end",
"def set_userarea\n @userarea = Userarea.find(params[:id])\n end",
"def valida_datos_aval?(attributes)\n\t\tif Aval.joins(:clients).where('avals.nombre = ? AND avals.apellidos = ? AND clients.ruta = ?',attributes['nombre'],attributes['apellidos'],self.ruta).exists?\n\t\t\terrors.add(:ruta, \"El Aval ya ha sido asignado a esta ruta\")\n\t\tend\n\tend",
"def show\n @area = Area.find_by(nombre: 'Emergencia')\n if params[:name] == nil\n @medicos = User.where(area: @area).paginate(:page => params[:page], :per_page => 5)\n else\n @medicos = User.where(area: @area)\n .and(\n User.or(name: /.*#{params[:name].downcase}.*/i).or(last_name: /.*#{params[:name].downcase}.*/i).selector\n ).paginate(:page => params[:page], :per_page => 5)\n end\n end",
"def create\n @empresa = Empresa.new(empresa_params)\n user_id = params[:user_id].to_i\n if user_id > 0 #Given n0 is admin and \"\" could be interpreted as 0, we avoid the risk\n @empresa.user_id = user_id\n end\n respond_to do |format|\n if @empresa.save\n helpers.set_current_empresa(@empresa.user, @empresa.id)\n format.html { redirect_to @empresa, notice: 'Empresa creada con éxito.' }\n format.json { render :show, status: :created, location: @empresa }\n else\n format.html { render :new }\n format.json { render json: @empresa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\tauthorize! :create, AsignacionRol\n @asignacion_rol = AsignacionRol.new(asignacion_rol_params)\n @asignacion_rol.esActual = true\n @asignacion_rol.active = true\n @proyecto = @asignacion_rol.proyecto\n @roles = []\n @rols = Rol.where(tipo_rol: TipoRol.where(nombre:'Proyecto'))\n coor_sist = Rol.where(\"nombre = ?\", 'Coordinador Sistema').first\n asig_func = AsignacionFuncion.where(\"usuario_id = ? AND rol_id = ?\", current_usuario, coor_sist).first\n @rols.each do |rol|\n if rol.nombre != 'Coordinador' || asig_func != nil then\n @roles << rol\n end\n end\n if unica(@asignacion_rol.usuario_id,@asignacion_rol.proyecto_id, @asignacion_rol.rol_id) == true\n\t respond_to do |format|\n\t if @asignacion_rol.save\n sesion= Sesion.find_by(usuario_id: current_usuario.id, fechaFin: nil)\n Transaccion.create!(\n \t\t descripcion: \"Creación asociación rol #{@asignacion_rol.rol.nombre} al usuario #{@asignacion_rol.usuario.nombreUsuario} del proyecto #{@asignacion_rol.proyecto.nombre} : actual = #{ t @asignacion_rol.esActual.to_s}\",\n \t\t sesion_id: sesion.id ,\n \t\t proyecto_id: @asignacion_rol.proyecto.id)\n\t\tformat.html {redirect_to :controller => 'asignacion_roles', :action => 'index',:proyecto_id => @asignacion_rol.proyecto.id } \n\t\tformat.json { render :show, status: :created, location: @asignacion_rol }\n\t else\n params[:usuario_id] = @asignacion_rol.usuario_id\n \t\tformat.html { render :new }\n \t\tformat.json { render json: @asignacion_rol.errors, status: :unprocessable_entity }\n\t end\n\t end\n else\n\t respond_to do |format|\n\t\t format.html { redirect_to :controller => 'asignacion_roles', :action => 'index', :proyecto_id => @asignacion_rol.proyecto.id\n\t\t flash[:danger] = 'El usuario ya se encuentra asignado' } \n\t end\n end\n end",
"def RepetecionUsuarioUpdate(lista_usuario, nombre_usuario, apellidos_usuario ,id_usuario)\n val = true\n lista_usuario.each do |usuario|\n if usuario.nombre_usuario == nombre_usuario.upcase && usuario.apellidos_usuario == apellidos_usuario.upcase && usuario.id.to_i != id_usuario.to_i\n val = false\n break\n end\n end\n return val\n end",
"def create\n @actividad = Actividad.new(actividad_params)\n @actividad.empresa_id = @current_empresa.id\n\n #Verificamos si la tarea ha podido ser guardado correctamente.\n \n if @actividad.save()\n redirect_to actividads_path, :notice => \"La actividad ha sido creada\";\n else\n render \"new\";\n end\n end",
"def tarea_params\n params.require(:tarea).permit(:fecha, :titulo, :desc, :estado, :establecimiento_id)\n end",
"def show\n @area = Area.find_by(nombre: 'Fisioterapia')\n if params[:name] == nil\n @medicos = User.where(area: @area).paginate(:page => params[:page], :per_page => 5)\n else\n @medicos = User.where(area: @area)\n .and(\n User.or(name: /.*#{params[:name].downcase}.*/i).or(last_name: /.*#{params[:name].downcase}.*/i).selector\n ).paginate(:page => params[:page], :per_page => 5)\n end\n end",
"def create\n @usuario = Usuario.new(params[:usuario])\n @usuario.perfil = Perfil.where(\"nome=?\",\"Usuário\").first if @usuario.perfil.nil?\n #if @usuario.senha_flag.blank?\n @usuario.senha_segura = encrypt(@usuario.senha_flag,nil)\n #end\n if params[:peso_novo]\n if @usuario.peso.nil? || params[:peso_novo].to_f != @usuario.peso.peso\n @usuario.pesos << Peso.new(:data=>@usuario.peso.data,:peso=>@usuario.peso.peso) unless (@usuario.peso.nil? || params[:peso_novo].to_f == @usuario.peso.peso)\n # @usuario.peso.create(:peso=>params[:peso_novo],:data=>Date.current,:usuario=>@usuario)\n @usuario.peso = Peso.new(:peso=>params[:peso_novo],:data=>Date.current)\n end\n end\n \n respond_to do |format|\n if @usuario.save\n flash[:success] = \"Cadastro efetuado com sucesso, bem-vindo à Aliments\"\n flash[:subtitle] = \"Para iniciar efetue o login\"\n format.html { redirect_to(@usuario, :notice => 'Usuario was successfully created.') }\n format.xml { render :xml => @usuario, :status => :created, :location => @usuario }\n else\n flash[:error] = \"Não foi possível efetuar seu cadastro.\"\n flash[:subtitle] = \"Verifique os erros e tente novamente\"\n format.html { render :action => \"new\" }\n format.xml { render :xml => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @usuario = Usuario.new\n \n @personasvinculadas = PersonaVinculada.anioescolar_colegio(anio_escolar.id).where(\"personas_vinculadas.id not in (select persona_vinculada_id from usuarios where colegio_id = ? and persona_vinculada_id <> 0)\", colegio.id).order(\"apellido_paterno\", \"apellido_materno\", \"nombres\")\n @alumnoscolegio = Alumno.por_anio_escolar(anio_escolar.id).where(\"alumnos.id not in (select alumno_id from usuarios where colegio_id = ? and alumno_id <> 0)\", colegio.id).order(\"apellido_paterno\", \"apellido_materno\", \"nombres\")\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @usuario }\n end\n end",
"def set_usuario\n #if UsuarioUsuario.find(params[:id]).exists?\n @usuario = Usuario.find(params[:id])\n #else\n # @usuario = Nil\n #end\n end",
"def agregar(palabra, relacion)\n return if palabra.nil?\n\n @trie.agregar(palabra, relacion)\n end",
"def create\r\n @cambiar_tema = current_user.cambiar_temas.build(cambiar_tema_params)\r\n if @cambiar_tema.save\r\n flash[:success] = \"Su petición para cambiar tema de tesis ha sido creada!\"\r\n if current_user.tipos_usuario.tipo == \"Alumno\"\r\n redirect_to alumnos_path\r\n else\r\n redirect_to root_path\r\n end\r\n else\r\n flash[:alert] = \"Su petición para cambiar tema de tesis no pudo crearse! Revise el formulario.\"\r\n render :new\r\n end\r\n end",
"def new\n @orden = Orden.new\n @maquina = Maquina.find(params[:maquina_id])\n @tecnicos = Usuario.find(:all,:conditions => [\"tipo_usuario = ? and capacidad_tecnica = ? \", Usuario::TECNICO, @maquina.tipo_area_tecnica ])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @orden }\n end\n end",
"def valida_titulo\n errors.add_to_base 'avisotitulo' if tituloes.blank? and titulofr.blank? \nend",
"def guarda_fotos_todas\n dame_fotos_todas\n\n if x_foto_principal.present?\n a = adicional ? adicional.reload : Adicional.new(especie_id: id)\n a.foto_principal = x_foto_principal\n\n if a.changed?\n a.save\n reload\n end\n end\n end",
"def create\n @missionario = Missionario.new(params[:missionario])\n return unless access_control\n\n #if @missionario.cargo.nivel < @nivelmin\n # flash[:notice] = 'Cargo não foi alterado.'\n # @missionario.cargo = Cargo.find_by_nivel(5)\n #end\n\n respond_to do |format|\n\n if @missionario.save\n flash[:notice] = \"Missionario criado: #{@missionario.nome_cracha}\"\n coordenacao(params[:missionario][:cargo_id])\n unless @user.missionario\n @user.missionario = @missionario\n @user.save\n redirect_to :controller => :home\n return\n end\n\n format.html { redirect_to(@missionario) }\n format.xml { render :xml => @missionario, :status => :created, :location => @missionario }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @missionario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def grabar_usuario_ensambladora(nombre,password)\n @usuario = Usuario.find(:first, :conditions => \"nombre='#{nombre}'\")\n if @usuario!=nil\n $tirajson = '{ \"success\": \"true\", \"exito\": \"true\", \"message\": \"Ya existe ese nombre de usuario!\" }'\n else\n @usuario= Usuario.new\n @usuario.nombre=nombre\n @usuario.password=password\n @usuario.rols_id= 3\n @usuario.estatus='a'\n @usuario.save\n $tirajson = '{ \"success\": \"true\", \"exito\": \"true\", \"message\": \"Datos guardados satisfactoriamente!\" }'\n valor=1\n end\n \n \n end",
"def create\n\n if params[:cliente_id] == \"\"\n @pessoa = Pessoa.new(pessoa_params)\n if params[:senha] == \"\"\n @password = SecureRandom.random_number(99999999)\n else\n @password = params[:senha]\n end\n\n @user = User.new\n @user.email = @pessoa.email\n @user.password = @password\n @user.password_confirmation = @password\n if current_user.id == 1\n @user.empresa_id = current_user.empresa_id\n #@user.role = \"ADMIN\"\n else\n @user.empresa_id = 1\n #@user.role = \"USER\"\n end\n\n @user.role = \"USER\"\n\n respond_to do |format|\n if @pessoa.save\n #criando usuário\n @user.pessoa_id = @pessoa.id\n if @user.save\n Userinfo.send_email(@user,current_user.empresa.nome_empresa).deliver\n end\n #relacionando usuário com empresa\n Clienteempresa.create(:empresa_id => current_user.empresa_id, :pessoa_id => @pessoa.id)\n format.html { redirect_to @pessoa, notice: 'Cadastro realizado com sucesso!.' }\n format.json { render :show, status: :created, location: @pessoa }\n else\n format.html { render :new }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n end\n else\n Clienteempresa.create(:empresa_id => current_user.empresa_id, :pessoa_id => params[:cliente_id])\n respond_to do |format|\n format.html { redirect_to pessoas_url, notice: 'Cadastro realizado com sucesso!' }\n format.json { head :no_content }\n end\n end\n\n end",
"def create\n @area = Area.new(params[:area])\n \n respond_to do |format|\n if @area.save\n flash[:notice] = 'Area creada correctamente.'\n format.html { params[:oper].nil? ? redirect_to(@area) : render(:text => \"Ok\")}\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @area.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n existe = UsuarioPartida.where(:partida_id => params[:usuario_partida][:partida_id], :usuario_id => params[:usuario_partida][:usuario_id]).first\n @partida = Partida.find(params[:usuario_partida][:partida_id])\n count = UsuarioPartida.where(:partida_id => params[:usuario_partida][:partida_id]).count\n \n respond_to do |format|\n if @partida.cantidad_jugadores > count && existe.nil?\n @usuario_partida = UsuarioPartida.new(params[:usuario_partida])\n if @usuario_partida.save\n count = count + 1\n if @partida.cantidad_jugadores = count\n @partida.update_attributes(:estado => true)\n end\n format.html { redirect_to @usuario_partida, notice: 'Usuario partida was successfully created.' }\n format.json { render json: @usuario_partida, status: :created, location: @usuario_partida }\n else\n format.html { render action: \"new\" }\n format.json { render json: {:id => 0} }\n end\n else\n format.html { redirect_to usuario_partidas_path, notice: 'El usuario ya existe en la partida o ya se agotaron los cupos.' }\n format.json { render json: {:id => 0} }\n end\n end\n end",
"def numero_fattura_must_be_unique_in_anno_and_data_fattura\n #return if field.blank?\n not_uniq = self.class.count(:conditions => [\"anno = ? AND numero_fattura = ? AND YEAR(data_fattura) = ?\", self.anno, self.numero_fattura, self.data_fattura.year])\n if not_uniq > 0\n #self.errors.add(:data_fattura, \"anno, numero_fattura e anno di data_fattura devono essere unici\")\n flash[:error] = \"anno, numero_fattura e anno di data_fattura devono essere unici\"\n end\n #not_uniq = self.class.where(:anno=>self.anno,:numero_fattura=>self.numero_fattura).where(\"YEAR(data_fattura) = ?\",data_fattura.year).first\n #self.errors.add(:data_fattura, \"anno, numero_fattura e anno di data_fattura devono essere unici\") if not_uniq\n end",
"def create\n @adherent = User.find(params[:user_id])\n\n @crenau = Crenau.new(crenau_params)\n if @adherent.function.name == \"Professeur\"\n @usercollection = [@adherent]\n @crenau.user = @adherent\n else\n @usercollection = User.joins(:function).where(\"functions.name = 'Professeur'\").order('first_name')\n @crenau.user = User.joins(:function).where(\"functions.name = 'Professeur'\").last\n end\n @crenau.recurence = @recurences.find_index { |w| w == params[\"crenau\"][\"recurence\"] }\n @crenau.jour = @jours.find_index { |w| w == params[\"crenau\"][\"jour\"] }\n if @crenau.save\n redirect_to adherent_crenaus_path(@adherent), notice: 'Creneau crée.'\n else\n render :new\n end\n end",
"def create\n # puts params.inspect\n # puts realtor_params.inspect\n\n @realtor = Realtor.new(realtor_params)\n\n if (current_user.user_type != 1 and params['create_by_admin'] == 0) || realtor_params[:user_id] == nil #We do not want admins to automatically bind created users to account.\n @realtor.user = current_user\n else\n @realtor.user = User.find(realtor_params[:user_id])\n end\n\n @realtorExists = Realtor.where('user_id': @realtor.user.id)\n\n # puts @realtor.user.inspect\n\n if @realtorExists.empty?\n\n respond_to do |format|\n if @realtor.save\n format.html { redirect_to @realtor, notice: 'Realtor was successfully created.' }\n format.json { render :show, status: :created, location: @realtor }\n\n @realtor.user.user_type = 2 # set user type to realtor after creation\n @realtor.user.save # save realtor to current user\n else\n format.html { render :new }\n format.json { render json: @realtor.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n format.html { redirect_to new_realtor_path, notice: 'Realtor account already exists for this user.' }\n format.json { head :no_content }\n end\n end\n\n end",
"def guarda_nombres_comunes_todos\n dame_nombres_comunes_todos\n\n if x_nombre_comun_principal.present?\n a = adicional ? adicional : Adicional.new(especie_id: id)\n a.nombres_comunes = x_nombres_comunes.encode('UTF-8', {invalid: :replace, undef: :replace, replace: ''})\n a.nombre_comun_principal = x_nombre_comun_principal.force_encoding(\"UTF-8\")\n\n if a.changed?\n a.save\n reload\n end\n end\n end",
"def create\n @tablero = Tablero.new(tablero_params)\n m= params.require(:tablero).permit(:idusuario, :grupo, :descripcion, :e1, :e2, :e3, :puntaje)\n\n params[idusuario.each] do |i|\n miembros=[params[:idusuario[i]]:grupo[i], :descripcion[i], :e1[i], :e2[i], :e3[i], :puntaje[i]]\n end\n\n respond_to do |format|\n if @tablero.save\n format.html { redirect_to @tablero, notice: \"El tablero se creó correctamente\" }\n format.json { render :show, status: :created, location: @tablero }\n else\n format.html { render :new }\n format.json { render json: @tablero.errors, status: :unprocessable_entity }\n end\n end\n end",
"def tarea_params\n params.require(:tarea).permit(:titulo, :descripcion, :fecha_entrega, :hora_entrega)\n end",
"def create\n user = Empleado.find_by(usuario: params[:session][:usuario].downcase)\n if !user\n flash.now['not_user'] = 'Usuario no existe'\n render 'new'\n elsif user.authenticate(params[:session][:password])\n log_in user\n if user.categoria == 0\n redirect_to empleados_path if user.categoria == 0\n else\n redirect_to empleado_proyectos_path(user)\n end\n else\n flash.now['not_pass'] = 'Password incorrecto'\n render 'new'\n end\n end",
"def set_texto_palabra\n if params == [:usuario_id,:tweet_id,:texto_id,:id]\n @usuario = Usuario.find(params[:usuario_id])\n @tweet = Tweet.find(params[:tweet_id])\n @textos = Texto.find(params[:texto_id])\n end\n if params == [:palabra_bolsa_id,:id]\n @palabra_bolsa = PalabraBolsa.find(params[:palabra_bolsa_id])\n end\n @texto_palabra = TextoPalabra.find(params[:id])\n end",
"def create\n @tarea = Tarea.new(tarea_params)\n\n respond_to do |format|\n if @tarea.save\n format.html { redirect_to @tarea, notice: 'La Tarea ha sido eliminada correctamente.' }\n format.json { render :show, status: :created, location: @tarea }\n else\n format.html { render :new }\n format.json { render json: @tarea.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_controles\n @controles= Control.where(area_id: @consulta.ficha_nutricional_adulto.area_id, paciente_id: @consulta.ficha_nutricional_adulto.paciente_id).limit(9).order(id: :desc)\n end",
"def create\n @candidato = Candidato.new(candidato_params)\n @usuario = current_user\n @usuario.pessoa = @candidato\n @usuario.status = true\n \n respond_to do |format|\n extensoes_foto = ['jpg', 'jpeg', 'gif', 'png']\n if @candidato.foto_url != nil and !extensoes_foto.include? @candidato.foto_url.split('.')[1].downcase\n format.html { redirect_to edit_candidato_path(@candidato), :flash => { :alert => \"Formato da foto não é de imagem.\" } }\n else\n @candidato.telefone.gsub!(/[^a-zA-Z]/, '')\n if @candidato.save! && @usuario.save!\n format.html { redirect_to edit_candidato_path(@candidato), notice: 'Candidato criado com sucesso.' }\n format.json { render :show, status: :created, location: @candidato }\n else\n format.html { render :new, alert: @candidato.errors}\n format.json { render json: @candidato.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def create\n @alumno = Alumno.new(params[:alumno])\n respond_to do |format|\n if @alumno.save\n user = @alumno.user\n edad = calcular_edad user\n user.update_attribute(:is_alumno, true)\n user.update_attribute(:edad, edad )\n @alumno.cursos << @alumno.curso\n format.html { redirect_to @alumno, notice: 'El alumno ha sido registrado con exito.' }\n CustomLogger.info(\"Nuevo alumno: #{@alumno.user_nombre.inspect} ,Apellido: #{@alumno.user_apellido.inspect} ,Cedula de Identidad: #{@alumno.user_CINro.inspect} ,Sexo: #{@alumno.user_sexo.inspect} ,Telefono:#{@alumno.user_telefono.inspect} ,Correo Electronico: #{@alumno.user_email.inspect} ,Fecha de Nacimiento:#{@alumno.user_fecha_nacimiento.inspect} ,Lugar de Nacimiento: #{@alumno.user_lugar_nacimiento.inspect} ,Nombre del Responsable: #{@alumno.responsable.inspect} ,Telefono del Responsable: #{@alumno.telefono_responsable.inspect} ,Direccion: #{@alumno.user.address.direccion.inspect} ,Documentos Personales: Certificado de Estudio: #{@alumno.doc_cert_estudios.inspect} ,Cedula: #{@alumno.doc_cedula.inspect} ,Certificado de Nacimiento: #{@alumno.doc_cert_nacimiento.inspect} ,Foto Tipo Carnet: #{@alumno.doc_foto.inspect} ,Nombre de Usuario: #{@alumno.user_username.inspect} creado por el usuario: #{current_user.full_name.inspect} ,#{Time.now}\")\n format.json { render json: @alumno, status: :created, location: @alumno }\n format.js {}\n else\n @new = true\n atributos\n format.html { render action: \"new\" }\n CustomLogger.error(\"Error al querer crear el nuevo alumno: #{@alumno.user_nombre.inspect} y sus demas atributos, por el usuario: #{current_user.full_name.inspect} ,#{Time.now}\")\n format.json { render json: @alumno.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @habrauser = Habrauser.new\n @habrauser.user = current_user\n @habrauser.name = params[:habrauser][:name]\n @habrauser.slug = @habrauser.name_to_slug\n\n respond_to do |format|\n if @habrauser.save\n format.html { redirect_to fetch_habrauser_path(@habrauser),\n notice: \"Хабраюзер '#{@habrauser.name}' успешно привязан к вашему аккаунту.\" }\n format.json { render json: @habrauser, status: :created, location: @habrauser }\n else\n format.html { render action: \"new\" }\n format.json { render json: @habrauser.errors, status: :unprocessable_entity }\n end\n end\n end",
"def validate_username?\n @user = User.find_by username: self.usuario\n unless self.usuario == \"\"\n unless @user.nil? \n #Luego de que se verifica que el usuario si es usado, se pregunta si ese username pertenece al mismo\n #empleado que actualizara sus datos\n if self.usuario == self.user.username \n #si es el mismo username retorna true \n return true\n else\n #si es el mismo username retorna false \n errors.add(:usuario, :invalid)\n return false\n end\n else\n #no existe ningún usuario con este username que se intenta registrar\n return true\n end\n else\n errors.add(:usuario, \"Debe ingresar un usuario.\")\n return false\n end \n end",
"def valida_plantilla(current_usuario, idplant)\n true\n end",
"def crear_actualizar_usuario(nusuario, ldapus, grupos, prob, \n clave = nil)\n usuario = Usuario.where(nusuario: nusuario).take\n if usuario.nil?\n usuario = crear_usuario_min(nusuario, ldapus, prob, clave)\n if usuario.nil?\n prob << 'No pudo crear usuario: ' + prob\n return nil\n end\n end\n return actualizar_usuario(usuario, ldapus, grupos, prob, clave)\n end",
"def registrar_usuario\n employee_user = User.new\n employee_user.email = self.email\n employee_user.password = employee_user.generar_password\n employee_user.username = asignar_username_con_opciones\n if asignar_username_con_opciones.present?\n employee_user.username = asignar_username_con_opciones\n else\n employee_user.username = self.usuario.downcase\n end\n employee_user.client_type = 'empleado'\n employee_user.save\n update(user_id: employee_user.id, user_created_id: employee_user.id) \n #luego de registrar al usuario se almacena la contraseña en la tabla Historypassword\n #donde se almacenaran las 3 ultimas usadas\n password_employee = HistoryPassword.new\n password_employee.password = employee_user.password\n password_employee.user_id = employee_user.id\n password_employee.save\n end",
"def create\n\n\n @it_inscripcion_registro = current_user.it_inscripcion_registros.build(it_inscripcion_registro_params)\n\n #Se cuenta cuantas personas se han preinscrito a un grupo. Se cuenta con todos los registros no\n #importando que éstos no hayan sido validados. El dato se obtiene a través de todos los registros\n #de preinscripción, el id para el grupo actual se obtiene con @it_inscripcion_registro.grupo_id\n cupos = ItInscripcionRegistro.where(grupo_id: @it_inscripcion_registro.grupo_id).count\n\n #Se localiza si el usuatio tiene un id previo con ese mismo grupo. Si existe se le envia un mensaje\n # y no se permite guardar el registro por segunda ocasión.\n usuario = User.find(current_user.id)\n registro = ItInscripcionRegistro.find_by(user_id: usuario, grupo_id: @it_inscripcion_registro.grupo_id)\n\n #Si el cupo del grupo excede los 25 alunos se le muestra un mensaje al usuario donde se le indica\n #que deberá elegir un grupo distinto, el registro de inscripción no se guardará en la base dde datos_bancos\n #hay que agregar este metodo a las rb de el modelo correspondiente.\n if cupos > 40\n redirect_to new_it_inscripcion_registro_path, notice: \"El grupo ha alcanzado su ocupación máxima. Por favor elija otro grupo\"\n elsif registro.present? && registro.grupo_id == @it_inscripcion_registro.grupo_id\n redirect_to panel_alumnos_path, notice: \"Usted ya tiene registrada una solicitud con este grupo.\"\n else\n\n respond_to do |format|\n if @it_inscripcion_registro.save\n format.html { redirect_to @it_inscripcion_registro, notice: 'El registro de inscripción se creó correctamente.' }\n format.json { render :show, status: :created, location: @it_inscripcion_registro }\n else\n format.html { render :new }\n format.json { render json: @it_inscripcion_registro.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def create\n @usuario = Usuario.new(usuario_params)\n @usuario.empresa_id = @empresa.id\n @usuario.estado = true\n @usuario.eliminado = false\n respond_to do |format|\n if @usuario.save\n format.html { redirect_to empresa_usuario_path(@usuario.empresa_id,@usuario.id), notice: 'Usuario was successfully created.' }\n format.json { render :show, status: :created, location: @usuario }\n else\n format.html { render :new }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def alta_profesores\n\t\t@tab = \"admin\"\n\t \tprof = params[:miembro]\n\t \t\n\t \t\tx = User.find(prof)\n\t \t\tx.profesor = true\t#se le dan derechos de profesor\n\t \t\tx.admin = false\n\t \t\tx.estudiante = false\n\t \t\tx.save\n\t \t\n\t \trespond_to do |format|\n\t\t format.html { redirect_to(alta_profesores_lista_path)}\n\t\t format.xml { head :ok }\n\t\tend\n\tend",
"def RepetecionNombreUpdate(lista_tipos, nombre_tipo, id_tipo)\n val = true\n lista_tipos.each do |tipo|\n if tipo.descrip_tipo == nombre_tipo.upcase\n if tipo.id.to_i != id_tipo.to_i\n val = false\n break\n end\n end\n end\n return val\n end",
"def preencher_usuario2 (nome, sobrenome, email, endereco, universidade, profissao, genero, idade)\n self.nome.set nome\n self.sobrenome.set sobrenome\n self.email.set email\n self.endereco.set endereco\n self.universidade.set universidade\n self.profissao.set profissao\n self.genero.set genero\n self.idade.set idade\n self.btn_criar.click\n end",
"def create\r\n @comite_registro = current_user.comite_registros.build(comite_registro_params)\r\n\r\n if @comite_registro.save\r\n flash[:success] = \"Su petición para registrar su comité tutorial fue creada!\"\r\n if current_user.tipos_usuario.tipo == \"Alumno\"\r\n redirect_to alumnos_path\r\n else\r\n redirect_to root_path\r\n end\r\n else\r\n flash[:alert] = \"Su petición para registrar su comité tutorial no pudo ser creada! Revise el formulario.\"\r\n render :new\r\n end\r\n end",
"def create\n @subenlaces = User.where(:role => 'subenlace')\n @enlaces = User.where(:role => 'enlace')\n @groups = Group.all\n @coordinadores = User.where(:role => 'coordinador')\n @groupsdropdown = Group.all\n @hijos = Array.new\n if params[:user][:password].blank? && params[:user][:password_confirmation].blank?\n params[:user].delete(:password)\n params[:user].delete(:password_confirmation)\n end\n\n if params[:user][:documents_attributes].blank? \n params[:user].delete(:documents_attributes)\n else\n i=0\n if params[:user][:documents_attributes][\"0\"]['description'].blank?\n params[:user][:documents_attributes].delete \"0\"\n end\n if params[:user][:documents_attributes][\"1\"]['description'].blank?\n params[:user][:documents_attributes].delete \"1\"\n end\n if params[:user][:documents_attributes][\"2\"]['description'].blank?\n params[:user][:documents_attributes].delete \"2\"\n end\n end\n @user = User.new(user_params)\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 action: 'show', 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\t\tauthorize! :create, Postulacion\n @postulacion = Postulacion.new(postulacion_params)\n @postulacion.aceptado=false\n\n respond_to do |format|\n if @postulacion.save\n sesion= Sesion.find_by(usuario_id: current_usuario.id, fechaFin: nil)\n Transaccion.create!(\n\t\t descripcion: \"Creación de la Postulación al proyecto #{@postulacion.proyecto.nombre} del usuario #{@postulacion.usuario.nombreUsuario}: aceptado = #{t @postulacion.aceptado.to_s}\",\n\t\t sesion_id: sesion.id ,\n\t\t proyecto_id: @postulacion.proyecto.id)\n\tformat.html {redirect_to :controller => 'proyectos', :action => 'index'\n\t flash[:success] = 'Se ha registrado tu participación' } \n format.json { render :show, status: :created, location: @postulacion }\n else\n format.html { render :new }\n format.json { render json: @postulacion.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.59642744",
"0.5899846",
"0.5511915",
"0.54818285",
"0.544675",
"0.54358274",
"0.5411925",
"0.5399754",
"0.53953266",
"0.53914344",
"0.5381514",
"0.5363181",
"0.5362122",
"0.5315221",
"0.5314342",
"0.5248974",
"0.5230554",
"0.5224633",
"0.51843625",
"0.515506",
"0.51540273",
"0.51540273",
"0.51540273",
"0.51540273",
"0.51540273",
"0.51540273",
"0.515253",
"0.51425564",
"0.513557",
"0.511973",
"0.51151824",
"0.50954837",
"0.5045761",
"0.50237215",
"0.50218487",
"0.50104797",
"0.5009636",
"0.5003724",
"0.5001224",
"0.4999594",
"0.49952322",
"0.49938238",
"0.4993075",
"0.49881694",
"0.49640253",
"0.4947867",
"0.4941019",
"0.49302226",
"0.4929219",
"0.49275133",
"0.49273494",
"0.492599",
"0.49058598",
"0.49058598",
"0.49010095",
"0.49006993",
"0.48978743",
"0.48962456",
"0.48961663",
"0.4889835",
"0.48892623",
"0.4878461",
"0.48768234",
"0.48747727",
"0.48591107",
"0.48588067",
"0.4858435",
"0.48562965",
"0.48510477",
"0.4847207",
"0.48459613",
"0.48414046",
"0.48402104",
"0.48253027",
"0.4822818",
"0.481849",
"0.48166707",
"0.4813454",
"0.4801406",
"0.4800182",
"0.47996742",
"0.47937402",
"0.47876087",
"0.47863108",
"0.47839072",
"0.47831312",
"0.47806084",
"0.4779397",
"0.4777178",
"0.47765076",
"0.47757888",
"0.4770454",
"0.4769652",
"0.47627082",
"0.47607026",
"0.47543892",
"0.47531122",
"0.47527888",
"0.47464713",
"0.47436622"
] |
0.70636255
|
0
|
obtiene las tareas correspondientes a cada usuario para mostrarla en la vista, como en la base de datos el nombre de la tarea esta con el nombre mas el usuario se debe quitar el usuario para poder mostrar solo el nombre de la tarea
|
def obtener
array = Tarea.all
@@tareas = Array.new
array.each{|x| @@tareas.push(x) if /#{@@usuario}/.match(x["title"])}
@@tareas.each do |x|
string = x["title"].split
string.pop
x["title"] = string.join(" ")
end
#esto es para que no quede una tarea vacia al principio, la cual es la correspondiente login
@@tareas.shift
@@tareas
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def alta_profesores_lista\n\t\t@profesores = []\n\t\t@tab = \"admin\"\n\t\tusuarios = User.select('id, matricula, nombre, apellido, admin, profesor').order(:matricula)\n\t\tusuarios.each do |usuario|\n\t\t\tif (usuario.matricula[0].chr == \"l\") || (usuario.matricula[0].chr == \"L\")\n\t\t\t#se checa primero que la matricula empiece con 'l'\n\t\t\t#'chr' se utiliza para leer el caracter tomando el ASCII\n\t\t\t\tif (!usuario.admin? && !usuario.profesor?)\n\t\t\t\t#checar que no sea admin ni profesor aun\n\t\t\t\t\t@profesores << usuario\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def menciones\n\t\tcontenido.scan(/@(#{Usuario::RegexNombre})/).flatten.map do |mencion|\n\t\t\tUsuario.find_by(nombre: mencion)\n\t\tend.compact\n\tend",
"def estudiantes\n\t\t@seccion = \"Estudiantes\"\n @titulo = \"Estudiantes\"\n\t\tif params[:orden]\n\t\t\t@orden = params[:orden]\n\t\telse\n\t\t\t@orden = \"Cédula\"\n\t\tend\n\n #Guardo todos los estudiantes\n if Estudiante.all().size > 0\n case @orden\n \twhen \"Cédula\"\n \t\t@usuarios = Usuario.order('cedula').where(:id => Estudiante.all)\n \twhen \"Nombre\"\n \t\t@usuarios = Usuario.order('nombre').where(:id => Estudiante.all)\n \twhen \"Apellido\"\n \t\t@usuarios = Usuario.order('apellido').where(:id => Estudiante.all)\n \twhen \"Correo\"\n \t\t@usuarios = Usuario.order('correo').where(:id => Estudiante.all)\n \tend\n end\n\n\t\t@categorias = ['Cédula', 'Nombre', 'Apellido', 'Correo'] #Este es el orden que se mostrará en el select de la vista\n\n\t\t@estudiante_datos = [] #En este arreglo se guardan los pares \"Cedula - Nombre Apellido\" de cada usuario para mostrar en el campo de busqueda\n\t\tUsuario.order('nombre').where(:id => Estudiante.all).each do |usuario|\n\t\t\t#En este foro se agregan uno a uno los valores de cada estudiante al arreglo de la manera indicada arriba\n\t\t\t@estudiante_datos << usuario.cedula.to_s + \" - \" + usuario.nombre_y_apellido.to_s\n\t\tend\n\tend",
"def set_controles\n @controles= Control.where(area_id: @consulta.ficha_nutricional_adulto.area_id, paciente_id: @consulta.ficha_nutricional_adulto.paciente_id).limit(9).order(id: :desc)\n end",
"def index\n if current_cuentum.email == \"admin@admin.com\"\n @usuarios = Usuario.all\n @div_admin = true\n end\n @usuariosAux = Usuario.all\n @cuentas = Cuentum.all\n @usuariosAux.each do |u| \n if cuentum_signed_in? && current_cuentum.id == u.cuenta_id\n if u.rol == \"ADMINISTRADOR\"\n @usuarios = @usuariosAux\n @div_admin = true\n end\n if u.rol == \"USUARIO\" || u.rol == \"OPERARIO\"\n @usuarios = []\n @usuarios << u\n end\n end\n end\n end",
"def index\n @trocaentreusuarios = Trocaentreusuario.all\n end",
"def mostrar_opciones_tutoria\n acciones = ['Peticiones pendientes de aceptar', 'Cola alumnos', 'Borrar tutoría', 'Volver']\n menu = MenuInlineTelegram.crear(acciones)\n texto = \"Tutoría elegida #{@tutoria.fecha}. Elija que desea hacer:\"\n @@bot.api.edit_message_text(chat_id: @ultimo_mensaje.id_chat, message_id: @ultimo_mensaje.id_mensaje, text: texto, reply_markup: menu, parse_mode: 'Markdown')\n end",
"def puertos_utiles\n puertos.select do |puerto|\n puerto.conectado_fisicamente?\n end\n end",
"def index\n @userareas = Userarea.all\n @users = User.all\n @areas = Area.all\n end",
"def index\n\n\n @cont = 0 # Variable para acceso al arreglo de @usuarios en la vista\n @clinicas = Clinica.all\n @usuarios = Usuario.find(:all, :conditions => \"datos_type = 'Clinica'\")\n\n\n end",
"def show_roles_and_users\n chorus_object_roles.map(&:role).uniq.map do |r|\n [r.name, users_for_role(r).map(&:username)]\n end\n end",
"def index\n @datos_usuarios = DatosUsuario.all\n @talla = Talla.all\n end",
"def index\n @userareas = Userarea.page(params[:page]).per(5)\n @users = User.all\n @areas = Area.all\n end",
"def index\r\n @tipos_usuarios = TiposUsuario.all\r\n end",
"def user\n t = []\n ville = nom_ville\n\t\tville.each do |i|\n\t\t\tCLIENT.search(i).take(1).collect do |tweet|\n\t\t\t\tt.push(\"#{tweet.user.screen_name}\") \n\n\t\t\tend\n\t\t end\n\treturn t\nend",
"def view_all_users\n # !! get all user so can interact after viewing them? all_users\n # User.select(:username).each_with_index {|user, index| puts \"#{index+1}. #{user.username}\"}\n #??????\n User.select(:username).each {|user| puts user.username}\n end",
"def pontosanunciante\n\n\t\tUsuario.find(self.id_usuario).meuspontos\n\n\tend",
"def show\n @line_investigation = @thesis.line_investigation\n @area_interests = @thesis.project.area_interests\n\n role = Role.where(descripcion: \"Participante\").first\n @users = role.users\n\n role = Role.where(descripcion: \"Profesor\").first\n @users1 = role.users\n\n end",
"def select_tiporelacion\n [ \n [\"BENEFICIARIO\",\"BENEFICIARIO\"],\n [\"INTEGRANTE\",\"INTEGRANTE\"],\n [\"PROPIETARIO\",\"PROPIETARIO\"],\n [\"APODERADO\",\"APODERADO\"]\n ] \n end",
"def index\n if(current_user.entidade_id.nil?)\n @users = []\n @users.push User.find_by(email: current_user.email)\n else\n @users = User.where(entidade_id: current_user.entidade_id.to_int)\n end\n\n if(current_user.tipo.eql? 1)\n @users = User.where('tipo = 1 or tipo = 2 or tipo = 4')\n elsif(current_user.tipo.eql? 2)\n @users = User.distinct()\n .joins('left join reservas r on users.id = r.user_id')\n .where('(tipo in(2,3) and users.entidade_id=?) or (tipo = 4 and r.entidade_id=?)', current_user.entidade_id, current_user.entidade_id)\n elsif(current_user.tipo.eql? 3)\n @users = User.distinct()\n .joins('left join reservas r on users.id = r.user_id')\n .where('tipo = 4 and r.entidade_id=?', current_user.entidade_id)\n else \n end\n end",
"def show\n @usuarios = Usuario.where(tipo: 'usuario')\n end",
"def plantilla_colocar_tabla(usuarios,historiales,cabecera_notas, tipo_evaluaciones, accion, editar)\n form_tag accion do\n haml_tag(:table, :class => 'tablesorter', :id => \"ingles\") do\n haml_tag :thead do\n haml_tag :tr do\n haml_tag :th, '#'\n haml_tag :th, 'Nombres'\n haml_tag :th, 'Cédula'\n haml_tag :th, cabecera_notas[0]\n haml_tag :th, cabecera_notas[1]\n haml_tag :th, cabecera_notas[2]\n haml_tag :th, cabecera_notas[3]\n haml_tag :th, 'Final'\n haml_tag :th, 'Descripción'\n end\n end\n haml_tag :tbody do \n historiales.each_with_index{ |h,i|\n haml_tag :tr do\n haml_tag :td, i+1\n haml_tag :td, h.usuario.nombre_completo\n haml_tag :td, h.usuario.ci\n valor = nil\n valor = h.nota_en_evaluacion(tipo_evaluaciones[0]).nota_valor\n if editar\n haml_tag :td do\n if valor != HistorialAcademico::SC\n haml_concat (text_field :nota1,h.usuario.ci, \\\n {:value => valor, :maxlength => 5})\n else\n haml_concat(text_field :nota1,h.usuario.ci,{:placeholder => \"SC\",:maxlength => 5})\n end\n end\n else\n haml_tag :td, valor\n end\n \n valor = h.nota_en_evaluacion(tipo_evaluaciones[1]).nota_valor\n \n if editar\n haml_tag :td do\n if valor != HistorialAcademico::SC\n haml_concat (text_field :nota2,h.usuario.ci, \\\n {:value => valor, :maxlength => 5})\n else\n haml_concat(text_field :nota2,h.usuario.ci,{:placeholder => \"SC\",:maxlength => 5})\n end\n end\n else\n haml_tag :td, valor\n end\n\n valor = h.nota_en_evaluacion(tipo_evaluaciones[2]).nota_valor\n \n if editar\n haml_tag :td do\n if valor != HistorialAcademico::SC\n haml_concat (text_field :nota3,h.usuario.ci, \\\n {:value => valor, :maxlength => 5})\n else\n haml_concat(text_field :nota3,h.usuario.ci,{:placeholder => \"SC\",:maxlength => 5})\n end\n end\n else\n haml_tag :td, valor\n end\n\n valor = h.nota_en_evaluacion(tipo_evaluaciones[3]).nota_valor\n\n if editar\n haml_tag :td do\n if valor != HistorialAcademico::SC\n haml_concat (text_field :nota4,h.usuario.ci, \\\n {:value => valor, :maxlength => 5})\n else\n haml_concat(text_field :nota4,h.usuario.ci,{:placeholder => \"SC\",:maxlength => 5})\n end\n end\n else\n haml_tag :td, valor\n end\n \n if h.nota_final != HistorialAcademico::SC\n haml_tag(:td,:id => \"nota_final_\"+h.usuario.ci) do\n haml_concat HistorialAcademico.colocar_nota(h.nota_final)\n end\n else \n haml_tag(:td,:id => \"nota_final_\"+h.usuario.ci) do\n haml_concat \"SC\"\n end\n end\n if h.nota_final == -1\n valor = -1\n else\n valor = h.nota_final\n end\n if editar\n haml_concat(hidden_field :notafinal,h.usuario.ci,{:value => valor})\n end\n \n haml_tag :td do\n haml_tag(:div, :id => \"descripcion_#{h.usuario.ci}\") do\n haml_concat HistorialAcademico::NOTASPALABRAS[h.nota_final+2]\n end\n end\n end\n }\n end\n end \n if editar\n haml_tag :br\n haml_concat(submit_tag :Calificar)\n end\n end \n end",
"def lista_users\n if params[:type_of].to_i == 6\n @role_users = RolesUser.find(:all, :joins => :user, :order => 'login ASC')\n else\n if params[:type_of].to_i == 1\n @role_users = RolesUser.find(:all, :joins => :user, :conditions => [\"users.unidade_id = ?\", current_user.unidade_id],:order => 'login ASC')\n end\n end\n\n render :update do |page|\n page.replace_html 'users', :partial => \"users\"\n end\n\n end",
"def index\n @persona = Persona.where(usuarioId: session[:usuario_id]).take\n \n @planformacions = Planformacion.where(tutorId: session[:usuario_id]).take\n #@usuarios= Usuario.all #se quiere acceder a la informacion del usuario como el nombre, para agregarlo en la tabla pero aun no sabemos como\n #@personas= Persona.all\n end",
"def usuario_actual\n \t#se guarda al usuario actual que esta loggeado por cuestion de eficiencia\n \t#para no accesar a la base de datos todo el tiempo\n \t@usuario_actual ||= Alumno.find(session[:alumno_id]) if session[:alumno_id]\n end",
"def relatorio\n @users = User.all\n @total_por_usuario = []\n\n @users.each do |user| \n @pontos = Ponto.where(\"user_id = ?\", user.id)\n .by_month(Time.now.strftime(\"%B\"), field: :created_at)\n .order(\"created_at asc\")\n\n @segundos = 0\n\n @pontos.each do |ponto|\n if ponto.situacao == \"Entrada\"\n @entrada = ponto.data_hora\n else\n @saida = ponto.data_hora\n @segundos += TimeDifference.between(@entrada, @saida).in_seconds.to_i if (@entrada && @saida )\n end\n end\n\n @total_por_usuario.push ({user => (@segundos/3600).to_i.to_s.rjust(2,'0') + \":\"+Time.at(@segundos).utc.strftime(\"%M:%S\") })\n end\n end",
"def update_users\n\tusers = [['adoni','Biwi'],\n\t['biwi','Biwi'],\n\t['dyton','Biwi'],\n\t['bwalo','Bwalo 1'],\n\t['bwalo2','Bwalo 2'],\n\t['bwatha','Bwatha'],\n\t['zunguzeni','Bwatha'],\n\t['chagamba','Chagamba'],\n\t['kelvin','Chagamba'],\n\t['chakale','Chakala'],\n\t['chalasa','Chalasa'],\n\t['chaonya','Chaonya'],\n\t['kenivasi','Chaonya'],\n\t['chidalanda','Chidalanda'],\n\t['gilbert','Chidalanda'],\n\t['chembekezo','Chidzele'],\n\t['chigo','Chikamba'],\n\t['chikamba','Chikolokoto'],\n\t['abisoni','Chimphepo'],\n\t['chimphepo','Chimphepo'],\n\t['salimoni','Chimphepo'],\n\t['chisomba','Chisomba'],\n\t['rose','Chisomba'],\n\t['biliyati','Chitawa'],\n\t['liana','Chitawa'],\n\t['rihanna','Chitawa'],\n\t['chithengo','Chithengo'],\n\t['yoki','Chithengo'],\n\t['chitululu','Chitululu'],\n\t['chizumba','Chizumba'],\n\t['chule','Chule 1'],\n\t['kathumba','Chule 1'],\n\t['rodiwelo','Chule 1'],\n\t['chule2','Chule 2'],\n\t['kambizeni','Chule 2'],\n\t['dongo','Dongolosi'],\n\t['dongolosi','Dongolosi'],\n\t['fainda','Fainda'],\n\t['yolamu','Fainda'],\n\t['beatrice','Kabzyoko'],\n\t['kabzoko','Kabzyoko'],\n\t['kacheche','Kacheche'],\n\t['esawo','Kalulu'],\n\t['kamadzi','Kamadzi'],\n\t['steve','Kamadzi'],\n\t['kambira','Kambiri'],\n\t['kambulire','Kambulire 1'],\n\t['kambulire2','Kambulire 2'],\n\t['sankhani','Kambulire 2'],\n\t['kamphinga','Kamphinga'],\n\t['kaninga','Kaninga'],\n\t['kondwani','Kaninga'],\n\t['kanyoza','Kanyoza'],\n\t['bazale','Kanyoza'],\n\t['lotale','Kazinkambani'],\n\t['kholongo','Kholongo'],\n\t['david',\"M’maso\"],\n\t['davie',\"M’maso\"],\n\t['mayikolo','Malenga'],\n\t['mankhwazi','Mankhwazi'],\n\t['jenet','Maole'],\n\t['maole','Maole'],\n\t['maselero','Maselero'],\n\t['charles','Masumba'],\n\t['masumba','Masumba'],\n\t['weluzani','Masumba'],\n\t['matchakaza','Matchakaza'],\n\t['william','Matchakaza'],\n\t['mawunda','Maunda'],\n\t['mazira','Mazira'],\n\t['kazimkambani','Mbalame'],\n\t['mbalame','Mbalame'],\n\t['mblame','Mbalame'],\n\t['mbewa','Mbewa'],\n\t['mbulachisa','Mbulachisa'],\n\t['kasakula','Mchena'],\n\t['mchena','Mchena'],\n\t['nchazime','Mchezime'],\n\t['henry','Mdzoole'],\n\t['mdzoole','Mdzoole'],\n\t['mfuti','Mfuti'],\n\t['mgwadula','Mgwadula'],\n\t['misewu','Misewo'],\n\t['mkupeta','Mkupeta'],\n\t['mmaso','Mmaso'],\n\t['brino','Mndele'],\n\t['mphandu','Mphandu'],\n\t['mphonde','Mphonde'],\n\t['mseteza','Mseteza'],\n\t['jackson','Mtema 1'],\n\t['makombe','Mtema 1'],\n\t['mtema1','Mtema 1'],\n\t['fredrick','Mtema 2'],\n\t['mtsukwachikupa','Mtsukwa Chikupa'],\n\t['mtsukwakalonje','Mtsukwa Kalonje'],\n\t['mutu','Mutu'],\n\t['mwaza','Mwaza'],\n\t['mtsatsula','Mzingo'],\n\t['hezekia','Mzumanzi 1'],\n\t['mzumazi2','Mzumanzi 2'],\n\t['nzumazi2','Mzumanzi 2'],\n\t['nzumazi','Mzumazi 1'],\n\t['ndalama','Ndalama'],\n\t['ngoza','Ngoza'],\n\t['sitima','Ngoza'],\n\t['nkhadani1','Nkhadani 1'],\n\t['nkhadani2','Nkhadani 2'],\n\t['nkhanamba','Nkhanamba'],\n\t['konkha','Nkhonkha'],\n\t['amosi','Nkhutchi'],\n\t['chisisi','Nkhutchi'],\n\t['andrew','Nkhutchi'],\n\t['ezala','Nsanda'],\n\t['ezara','Nsanda'],\n\t['nsanda','Nsanda'],\n\t['pheleni','Pheleni'],\n\t['laston','Suntche 1'],\n\t['suntche1','Suntche 1'],\n\t['jonathani','Suntche 1'],\n\t['boston','Suntche 2'],\n\t['suntche2','Suntche 2'],\n\t['jonas','Taiza'],\n\t['kwimbayani','Taiza'],\n\t['taiza','Taiza'],\n\t['joseph','Wayakumseche']]\n\t\n\t#-----------------------------\n\t\n\t(users || []).each do |user|\n\t\tusername = user[0]\n\t\tvillage_name = user[1]\n\t\tuser_village = Village.find_by_name(village_name)\n\t\tif user_village.nil?\n\t\t\tputs \"#{user} failed to update. Moving on to next user\"\n\t\t\tnext\n\t\tend\n\t\t\n\t\tuser_district = District.find_by_name('Lilongwe')\n\t\t\n\t\tuser_update = User.find(username)\n\t\tnext if user_update.nil?\n\t\t\n\t\tuser_update.district_id = user_district.id\n\t\tuser_update.ta_id = user_village.ta_id\n\t\tuser_update.village_id = user_village.id\n\t\tuser_update.save\n\t\t\n\t\tputs \"Username #{user} updated successfully \\n\"\n\tend\nend",
"def index\n @tipo_usuarios = TipoUsuario.all\n end",
"def textareas\n @textareas ||= fields.select { |f| f.class == Textarea }\n end",
"def verifica_usuarios\n# @user_pages, @usuarios = paginate :users, :per_page => 10\n @usuarios = User.find(:all, :order => 'nombre')\n @rol = Rol.find(params[:id])\n @usuarios = @rol.users\n end",
"def register\n\ti = 0\n\twhile i <= 10\n\t\tprint \"Alege un username: \"\n\t\talegere_username = gets.chomp\n\t\tif $users_profil.include?(alegere_username)\n\t\t\tputs \"Numele de utilizator deja exista.\"\n\t\telse\n\t\t\tputs \"Felicitari, numele tau de utilizator este: #{alegere_username}\"\n\t\t\tputs \"Completeaza profilul: \"\n\t\t\tprint \"Varsta: \"\n\t\t\tvarsta = gets.chomp\n\t\t\tprint \"In ce oras locuiesti: \"\n\t\t\toras = gets.chomp\n\t\t\tprint \"Stare civila: \"\n\t\t\tscivil = gets.chomp\n\n\t\t\tarr_util = [varsta, oras, scivil] # stocam valorile intr-un array pe care il adaugam ca valoare atasata cheiei din hash-ul $users_profil\n\t\t\t$users_profil.store(alegere_username, arr_util) # pur si simplu adaugam in baza de date\n\t\t\tputs $users_profil[alegere_username] # printam de dragul afisarii\n\t\t\tprintout # apelam functia care stocheaza noua baza de date intr-un fisier .txt\n\t\t\tbreak\n\t\tend\n\ti += 1\n\tend\n\n\nend",
"def clinicas_todas(id)\n Usuario.find_by_datos_id(id, :conditions => \"datos_type = 'Clinica'\")\n end",
"def completa_info(root_usuario_id=nil)\n if usuario_id.present?\n self.es_propietario = root_usuario_id == self.usuario_id ? true : false\n\n begin # Por si viene del scope datos_basicos y encontro el usuario\n self.nombre = u_nombre\n self.correo = u_email\n self.institucion = u_institucion\n rescue\n u = usuario\n self.nombre = \"#{u.nombre} #{u.apellido}\".strip\n self.correo = u.email\n self.institucion = u.institucion\n end\n\n else # Por si no esta el usuario_id\n begin # Trato de ver si venia de un scope\n self.nombre = c_nombre\n self.institucion = c_institucion\n self.es_propietario = true\n rescue\n self.es_propietario = true\n end\n end\n end",
"def index\n # @usuarios = @topico.perguntas.usuarios\n end",
"def show\n @user_list= []\n \n @customtable = CustomeTable.where(:identifier_id => @hackathon.id)\n @reguser = Registration.where(:hackathon_id => @hackathon.id)\n \n @reguser.each do |user| \n u = User.find(user.userId)\n @user_list.push(u.user_name)\n end\n end",
"def tratar_datos(tipo_cuenta, total_retito)\n\n \t billete = ContarBilletes(total_retito)\n devuelve = ValorRetirado(billete ,total_retito , tipo_cuenta)\n [billete, devuelve]\n end",
"def alta_profesores\n\t\t@tab = \"admin\"\n\t \tprof = params[:miembro]\n\t \t\n\t \t\tx = User.find(prof)\n\t \t\tx.profesor = true\t#se le dan derechos de profesor\n\t \t\tx.admin = false\n\t \t\tx.estudiante = false\n\t \t\tx.save\n\t \t\n\t \trespond_to do |format|\n\t\t format.html { redirect_to(alta_profesores_lista_path)}\n\t\t format.xml { head :ok }\n\t\tend\n\tend",
"def docentes\n\t\t@seccion = \"Docentes\"\n @titulo = \"Docentes\"\n\n if Docente.all().size > 0\n \t\tif params[:orden]\n \t\t\t@orden = params[:orden]\n \t\telse\n \t\t\t@orden = \"Cédula\"\n \t\tend\n\n \t\t#Guardo todos los docentes\n \t\tcase @orden\n \t\twhen \"Cédula\"\n \t\t\t@usuarios = Usuario.order('cedula').where(:id => Docente.all)\n \t\twhen \"Nombre\"\n \t\t\t@usuarios = Usuario.order('nombre').where(:id => Docente.all)\n \t\twhen \"Apellido\"\n \t\t\t@usuarios = Usuario.order('apellido').where(:id => Docente.all)\n \t\twhen \"Correo\"\n \t\t\t@usuarios = Usuario.order('correo').where(:id => Docente.all)\n \t\tend\n\n end\n\t\t\n\t\t @categorias = ['Cédula', 'Nombre', 'Apellido', 'Correo'] #Este es el orden que se mostrará en el select de la vista\n\n \t\t@docente_datos = [] #En este arreglo se guardan los pares \"Cedula - Nombre Apellido\" de cada usuario para mostrar en el campo de busqueda\n \t\tUsuario.order('nombre').where(:id => Docente.all).each do |usuario|\n \t\t\t#En este foro se agregan uno a uno los valores de cada docente al arreglo de la manera indicada arriba\n \t\t\t@docente_datos << usuario.cedula.to_s + \" - \" + usuario.nombre_y_apellido.to_s\n \t\tend\n\tend",
"def index\n\t @allUsuarios = Usuario.all\n end",
"def authenticate_user!\n if user_signed_in?\n if @current_user.stato != 'confermato'\n signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name))\n #cancello sessioni di openweb\n if signed_out\n session.keys.each{ |chiave_sessione|\n next if chiave_sessione == \"_csrf_token\"\n session.delete(chiave_sessione.to_sym)\n }\n messaggio = \"Utente non confermato dall'amministratore\"\n redirect_to auth_hub.new_user_session_path, notice: messaggio\n return\n end\n end\n #enti_gestiti = @current_user.enti_gestiti\n \n #creo array ordinato di enti_gestiti, cancello ente_gestito se il cliente non esiste (per eliminazione da db)\n enti_gestiti = []\n @current_user.enti_gestiti.each{ |ente| \n if ente.clienti_cliente.blank?\n ente.delete\n else\n enti_gestiti << ente\n end\n }\n enti_gestiti = enti_gestiti.sort_by{|ente| ente.clienti_cliente.CLIENTE }\n @array_enti_gestiti = []\n @array_enti_gestiti_solo_id = []\n @ente_principale = session['ente_corrente']\n enti_gestiti.each do |ente|\n @ente_principale = ente if ente.principale? && @ente_principale.blank?\n #array_ente_per_select_tag = [\" \".html_safe+ente.clienti_cliente.CLIENTE, ente.clienti_cliente.ID] #mostra uno stemmino su ogni riga\n array_ente_per_select_tag = [ente.clienti_cliente.CLIENTE, ente.clienti_cliente.ID]\n @array_enti_gestiti << array_ente_per_select_tag\n @array_enti_gestiti_solo_id << ente.clienti_cliente.ID\n end\n #salvo in sessione per usarlo nei vari controller come user_controller\n session['array_enti_gestiti'] = @array_enti_gestiti_solo_id\n #se non ho ente in sessione e non ho il principale assegnato metto il primo \n @ente_principale = enti_gestiti[0] if enti_gestiti.length > 0 && @ente_principale.blank?\n return true\n else\n messaggio = nil\n #controllo se arrivo da form di login\n if request.post? and !params['user'].blank?\n @current_user = warden.authenticate!(:scope => :user)\n #controllo se lo stato è confermato\n if @current_user.stato == 'confermato'\n return true\n else\n signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name))\n #cancello sessioni di openweb\n if signed_out\n session.keys.each{ |chiave_sessione|\n next if chiave_sessione == \"_csrf_token\"\n session.delete(chiave_sessione.to_sym)\n }\n messaggio = \"Utente non confermato dall'amministratore\"\n end\n end\n end\n messaggio ||= \"Si prega di accedere per vedere la pagina!\"\n redirect_to auth_hub.new_user_session_path, notice: messaggio\n end\n end",
"def find_user (map)\n user = []\n for i in 0..map.length-1\n for j in 0..map.length-1\n if map[i][j] == \" U \"\n user = [i,j]\n end\n end\n end\n user\n end",
"def show\n if logged_in? && (current_user.cliente.estoque_mp == \"Sim\") && (current_user.nivel_usuario == \"admin\")\n @receitacliente = Receitum.where(cliente_id: current_user.cliente_id)\n @receita = []\n @receitanomes = Receitum.where(cliente_id: current_user.cliente_id).uniq.pluck(:nome_receita)\n @receitanomes.each do |receitas|\n @receita << @receitacliente.where(nome_receita: receitas).first\n end\n \n end\n end",
"def mostrar_palabras_clave_grupos \n \n puts \"Esta operación puede tardar un poco, le rogamos tenga paciencia por favor.\"\n puts\n puts\n coleccion = @hemeroteca.palabras_clave_grupos \n coleccion.each_index do |i|\n puts \"Grupo #{i+1}:\" \n puts \"---------\"\n puts coleccion[i].join(\", \")\n puts \n puts \n end\n if coleccion.empty? then\n puts \"Lo sentimos, no se han encontrado noticias.\" \n puts\n puts\n end \n \n end",
"def colocar_tabla_30(usuarios,historiales,editar)\n form_tag \"guardar_notas_30\" do\n haml_tag(:table, :class => 'tablesorter', :id => \"ingles\") do\n haml_tag :thead do\n haml_tag :tr do\n haml_tag :th, \"#\"\n haml_tag :th, \"Nombre\"\n haml_tag :th, \"Cédula\"\n haml_tag :th, \"E. Teórico 1 (30%)\"\n haml_tag :th, \"E. Teórico 2 (30%)\"\n haml_tag :th, \"E. Oral (30%)\"\n haml_tag :th, \"Otros (10%)\"\n haml_tag :th, \"Final\"\n haml_tag :th, \"Descripción\"\n end\n end\n haml_tag :tbody do \n historiales.each_with_index{ |h,i|\n haml_tag :tr do\n haml_tag :td, i+1\n haml_tag :td, h.usuario.nombre_completo\n haml_tag :td, h.usuario.ci\n valor = nil\n valor = h.nota_en_evaluacion(HistorialAcademico::EXAMENESCRITO1).nota_valor\n if editar\n haml_tag :td do\n if valor != HistorialAcademico::SC\n haml_concat (text_field :nota1,h.usuario.ci, \\\n {:value => valor, :maxlength => 5})\n else\n haml_concat(text_field :nota1,h.usuario.ci,{:placeholder => \"SC\",:maxlength => 5})\n end\n end\n else\n haml_tag :td, valor\n end\n \n valor = h.nota_en_evaluacion(HistorialAcademico::EXAMENESCRITO2).nota_valor\n \n if editar\n haml_tag :td do\n if valor != HistorialAcademico::SC\n haml_concat (text_field :nota2,h.usuario.ci, \\\n {:value => valor, :maxlength => 5})\n else\n haml_concat(text_field :nota2,h.usuario.ci,{:placeholder => \"SC\",:maxlength => 5})\n end\n end\n else\n haml_tag :td, valor\n end\n\n valor = h.nota_en_evaluacion(HistorialAcademico::EXAMENORAL).nota_valor\n \n if editar\n haml_tag :td do\n if valor != HistorialAcademico::SC\n haml_concat (text_field :nota3,h.usuario.ci, \\\n {:value => valor, :maxlength => 5})\n else\n haml_concat(text_field :nota3,h.usuario.ci,{:placeholder => \"SC\",:maxlength => 5})\n end\n end\n else\n haml_tag :td, valor\n end\n\n valor = h.nota_en_evaluacion(HistorialAcademico::OTRAS).nota_valor\n\n if editar\n haml_tag :td do\n if valor != HistorialAcademico::SC\n haml_concat (text_field :nota4,h.usuario.ci, \\\n {:value => valor, :maxlength => 5})\n else\n haml_concat(text_field :nota4,h.usuario.ci,{:placeholder => \"SC\",:maxlength => 5})\n end\n end\n else\n haml_tag :td, valor\n end\n \n if h.nota_final != HistorialAcademico::SC\n haml_tag(:td,:id => \"nota_final_\"+h.usuario.ci) do\n haml_concat HistorialAcademico.colocar_nota(h.nota_final)\n end\n else \n haml_tag(:td,:id => \"nota_final_\"+h.usuario.ci) do\n haml_concat \"SC\"\n end\n end\n if h.nota_final == -1\n valor = -1\n else\n valor = h.nota_final\n end\n if editar\n haml_concat(hidden_field :notafinal,h.usuario.ci,{:value => valor})\n end\n \n haml_tag :td do\n haml_tag(:div, :id => \"descripcion_#{h.usuario.ci}\") do\n haml_concat HistorialAcademico::NOTASPALABRAS[h.nota_final+2]\n end\n end\n end\n }\n end\n end \n if editar\n haml_tag :br\n haml_concat(submit_tag :Calificar)\n end\n end \n end",
"def create\n @tablero = Tablero.new(tablero_params)\n m= params.require(:tablero).permit(:idusuario, :grupo, :descripcion, :e1, :e2, :e3, :puntaje)\n\n params[idusuario.each] do |i|\n miembros=[params[:idusuario[i]]:grupo[i], :descripcion[i], :e1[i], :e2[i], :e3[i], :puntaje[i]]\n end\n\n respond_to do |format|\n if @tablero.save\n format.html { redirect_to @tablero, notice: \"El tablero se creó correctamente\" }\n format.json { render :show, status: :created, location: @tablero }\n else\n format.html { render :new }\n format.json { render json: @tablero.errors, status: :unprocessable_entity }\n end\n end\n end",
"def name(users)\n #arr = []\n variable = Deck.find(users).users.uniq\n variable.each do |user|\n p user.name\n end\n #arr\n end",
"def ultimas_compras\n\t\tresu = []\n\t\tlista = current_user.compras.limit(10).order(\"created_at DESC\")\n\n\t\tlista.each do |compra|\n\t\t\tif(compra.users.first == current_user)\n\t\t\t\tresu << compra\n\t\t\tend\n\t\tend\n\t\tresu\n\tend",
"def compras_compartilhadas\n\t\tlista = current_user.compras.order(\"created_at DESC\")\n\t\tresu = []\n\t\tlista.each do |compra|\n\t\t\tif(compra.users.first != current_user)\n\t\t\t\tresu << compra\n\t\t\tend\n\t\tend\n\t\tresu\n\tend",
"def ordenar_todos_los_datos(pila,array=[],cola,lista,ordenamientof)\n if ordenamientof[:ordenar]\n array_anterior=array.join(',')\n array_rendi = rendimientof(pila,cola,lista)\n tabla = Terminal::Table.new do |a|\n a.title= \"ORDENAR TODO #{array_anterior} \"\n a.headings = [{value:'PASOS', alignment: :center},{value:'ESTRUCTURA', alignment: :center},{value:'% RENDIMIENTO', alignment: :center},{value:'Ordenada', alignment: :center}]\n a.add_row([pila.pasos_pila(),{value:'PILA', alignment: :center},{value:array_rendi[0], alignment: :center},pila.mostrar_pila()])\n a.add_row([cola.pasos_cola(),{value:'COLA', alignment: :center},{value:array_rendi[1], alignment: :center},cola.mostrar_cola()])\n a.add_row([lista.pasos_lista(),{value:'KISTA', alignment: :center},{value:array_rendi[2], alignment: :center},lista.mostrar_lista()])\n end\n puts tabla\n gets\nelse\n array_anterior=array.join(',')\n pila.ordenar_pila(array)\n cola.ordenar_cola(array)\n lista.ordenar_lista(array)\n array_rendi = rendimientof(pila,cola,lista)\n tabla = Terminal::Table.new do |a|\n a.title= \"ORDENAR TODO #{array_anterior} \"\n a.headings = [{value:'N. PASOS', alignment: :center},{value:'ESTRUCTURA', alignment: :center},{value:'% RENDIMIENTO', alignment: :center},{value:'Ordenada', alignment: :center}]\n a.add_row([pila.pasos_pila(),{value:'PILA', alignment: :center},{value:array_rendi[0], alignment: :center},pila.mostrar_pila()])\n a.add_row([cola.pasos_cola(),{value:'COLA', alignment: :center},{value:array_rendi[1], alignment: :center},cola.mostrar_cola()])\n a.add_row([lista.pasos_lista(),{value:'LISTA', alignment: :center},{value:array_rendi[2], alignment: :center},lista.mostrar_lista()])\n end\n puts tabla\n ordenamientof[:ordenar]=true\n gets\nend\nend",
"def index\n @usuario = User.where(:id => current_user.id).pluck(:id).first\n @registros = Registro.where(:grupo_id => params[:clave]).paginate(:page => params[:page]).order('id DESC')\n @name = Grupo.where(:clave => params[:clave]).pluck(:nombre).first\n @grupos = Grupo.all\n @grupo = Grupo.new\n end",
"def titulares_serial\n Representante.find(self.titular_ids_serial).map(&:nombre)\n end",
"def index\n if current_user.adm && params[:horarios].present?\n @horarios = Horario.all.order('data desc')\n @todosHorarios = true\n else\n @horarios = Horario.where(user_id: current_user.id).order('data desc')\n @todosHorarios = false\n end\n end",
"def obliterate()\n @@users_by_uid.delete(@uid)\n @@users_by_nick.delete(Channel.to_lower(@nick))\n part_all()\n end",
"def enter_users(test_data)\n users = test_data[UseOfCollections::USER_GRP.name] || [UseOfCollections.empty_user]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::USER_GRP.name)], users)\n\n users.each_with_index do |user, index|\n enter_auto_complete(user_name_input(index), user_name_options(index), user[UseOfCollections::USER.name], 'Local Persons')\n wait_for_options_and_select(user_type_input(index), user_type_options(index), user[UseOfCollections::USER_INSTITUTION_ROLE.name])\n wait_for_options_and_select(user_role_input(index), user_role_options(index), user[UseOfCollections::USER_UOC_ROLE.name])\n enter_auto_complete(user_institution_input(index), user_institution_options(index), user[UseOfCollections::USER_INSTITUTION.name], 'Local Organizations')\n end\n end",
"def index\n # @alegeri_user_temas = AlegeriUserTema.all\n end",
"def index\n @cuarteles = Cuartel.select(:id, :nombre).order(:nombre)\n\n # Control de los botones activos\n @gu_active = ''\n @rm_active = ''\n @cuarteles_active = 'active'\n end",
"def tables\n @users = [{:name => 'Yorick Peterse', :age => 18}, {:name => 'Chuck Norris', :age => 9000}, {:name => 'Bob Ross', :age => 53}]\n end",
"def index\n @usuario_seguidores = UsuarioSeguidor.all\n end",
"def tas\n Ta.find(ta_memberships.map(&:user_id))\n end",
"def index\n @direccions = Direccion.all\n @usuarios = Usuario.all\n end",
"def set_usuario\n @user = Usuario.select('id,nombre,apellido,usuario,twitter').find(params[:id])\n end",
"def user_labels\n @users = User.where(id: params[:user_ids].split(\",\").map(&:to_i).uniq).all\n end",
"def index\n authorize! :ver, UsuarioPrestamo.new\n @usuarios_prestamos = UsuarioPrestamo.all\n @alumnos = UsuarioPrestamo.where(:categoria => UsuarioPrestamo.categorias[:alumno])\n @profesores = UsuarioPrestamo.where(:categoria => UsuarioPrestamo.categorias[:profesor])\n @personal = UsuarioPrestamo.where(:categoria => UsuarioPrestamo.categorias[:personal])\n end",
"def edit_users\n return self[:edit_users] unless persisted?\n (self[:edit_users] + (Wayfinder.for(self).ephemera_project&.edit_users || [])).uniq\n end",
"def index\n @rutas_usuarios = RutasUsuario.all\n end",
"def donee_names_for(user)\n @donee_names = {} unless defined? @donee_names\n\n @donee_names[user.id] = collect_donee_names_for(user) if @donee_names[user.id].nil?\n\n @donee_names[user.id]\n end",
"def almacenar(nombre)\n\t\narray = Tarea.all\n@@existente = false\narray.each{|x| @@existente = true if /#{nombre}/.match(x[\"title\"])}\n\t\nunless @@existente \nTarea.create(\"#{nombre} #{@@usuario}\")\n\nend\n@@existente\nend",
"def RepeticionUsuarioCreate(lista_usuarios, nombre_usuario, apellidos_usuarios)\n val = true\n lista_usuarios.each do |usuario|\n if usuario.nombre_usuario == nombre_usuario.upcase\n if usuario.apellidos_usuario == apellidos_usuarios.upcase\n val = false\n break\n end\n end\n end\n return val\n end",
"def index\n @usuarios = Usuario.where(rol: 'opera', f_eliminado: nil).order(\"celular\")\n end",
"def index\n @ajudantes = current_usuario.ajudantes\n end",
"def handle_getting_names_for(users, user_role=\"contact\")\n @data.users = users\n @data.index = users.next_to_fill_in\n @data.user_role = user_role\n\n if @data.index\n user = @data.users[@data.index]\n collect_for(user)\n else\n @session.pop\n end\n end",
"def reactivacion\r\n\t\tif session[:usuario_id]\r\n\t\t\tenti = Usuarioentidad.where(usuario_id: session[:usuario_id]).take\r\n\t\tend\r\n\t\t#Solamente el consejo de facultad tiene la posibilidad de reactivar instructores\r\n\t\tif session[:usuario_id] && session[:entidad] == true && enti.entidad_id == 13\r\n\t\t\tsession[:adecuacion_id] = nil\r\n\t\t\tsession[:plan_id] = nil\r\n\t\t\tsession[:instructorName] = nil\r\n\t\t\tsession[:informe_id]=nil\r\n\t\t\t@cjpTipo=Usuario.find(session[:usuario_id]).tipo\r\n\t\t\t@nombre = session[:nombre_usuario]\r\n\t\t\t@usu=Usuarioentidad.where(entidad_id: session[:entidad_id]).take\r\n\t\t\t@entidad_escuela_id= @usu.escuela_id\r\n\t\t\t@usuarios = Usuario.where(activo: 0).all\r\n\t\t\t@instructores = []\r\n\t\t\tcpcontador = 0\r\n\t\t\t@instructores[cpcontador] = Array.new(2) { |i| }\r\n\t\t\t@instructores[cpcontador][0] = \"Seleccione el instructor\"\r\n\t\t\t@instructores[cpcontador][1] = 0\r\n\t\t\tcpcontador = cpcontador + 1\r\n\r\n\t\t\t@usuarios.each do |usuari|\t\t#Arreglo con los usuarios inahibilitados\r\n\t\t\t\tcppersona = Persona.find_by usuario_id: usuari.id\r\n\t\t\t\t@instructores[cpcontador] = Array.new(2) { |i| }\r\n\t\t\t\t@instructores[cpcontador][0] = cppersona.nombres.to_s.split.map(&:capitalize).join(' ') + \" \" + cppersona.apellidos.to_s.split.map(&:capitalize).join(' ')\r\n\t\t\t\t@instructores[cpcontador][1] = usuari.id\r\n\t\t\t\tcpcontador = cpcontador + 1\r\n\t\t\tend\r\n\r\n\t\t\ti = 1\r\n\t\t\tj = 1\r\n\t\t\tnombre = \"hola\"\r\n\t\t\tcpid = 1\r\n\r\n\t\t\t#Ordena los nombres por orden alfabetico (Ordenamiento Burbuja)\r\n\t\t\twhile i < cpcontador do\r\n\t\t\t\tnombre = @instructores[i][0]\r\n\t\t\t\tcpid = @instructores[i][1]\r\n\t\t\t\tj = i + 1\r\n\t\t\t\twhile j < cpcontador do\r\n\r\n\t\t\t\t\tif @instructores[j][0] < nombre\r\n\t\t\t\t\t\t@instructores[i][0] = @instructores[j][0]\r\n\t\t\t\t\t\t@instructores[i][1] = @instructores[j][1]\r\n\t\t\t\t\t\t@instructores[j][0] = nombre\r\n\t\t\t\t\t\t@instructores[j][1] = cpid\r\n\t\t\t\t\t\tnombre = @instructores[i][0]\r\n\t\t\t\t\t\tcpid = @instructores[i][1]\r\n\t\t\t\t\tend\r\n\r\n\t\t\t\t\tj +=1\r\n\t\t\t\tend\r\n\t\t\t\ti +=1\r\n\t\t\tend\r\n\r\n\t\telse\r\n\t\t\tredirect_to controller:\"forminst\", action: \"index\"\r\n\t\tend\r\n\tend",
"def index\n\n if session[:perfil] == \"Comum\" or session[:perfil] == \"Técnico\" or session[:perfil] == \"Zelador\"\n\n @informativo_obras = InformativoObra.where(:usuario_id => current_user).order(\"id desc\")\n\n elsif session[:perfil] == \"Administrador\"\n\n @informativo_obras = InformativoObra.all\n\n end\n\n\n end",
"def index\n @encargado_tallers = EncargadoTaller.where ([\"usuario_id = '%s'\", current_user.id])\n end",
"def new\n @usuario = Usuario.new\n \n @personasvinculadas = PersonaVinculada.anioescolar_colegio(anio_escolar.id).where(\"personas_vinculadas.id not in (select persona_vinculada_id from usuarios where colegio_id = ? and persona_vinculada_id <> 0)\", colegio.id).order(\"apellido_paterno\", \"apellido_materno\", \"nombres\")\n @alumnoscolegio = Alumno.por_anio_escolar(anio_escolar.id).where(\"alumnos.id not in (select alumno_id from usuarios where colegio_id = ? and alumno_id <> 0)\", colegio.id).order(\"apellido_paterno\", \"apellido_materno\", \"nombres\")\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @usuario }\n end\n end",
"def index\r\n @usuario_gustos = UsuarioGusto.all\r\n end",
"def index\n @grupo_usuarios = GrupoUsuario.all\n end",
"def gym_user_instances\n user_names = []\n self.exercise_instances.each do |user|\n user_names << User.all.find {|user_instance| user_instance.id == user.user_id}\n end\n user_names\n \n end",
"def atributos_index\n [ :id,\n :nusuario,\n :nombre,\n :email,\n :grupo_ids,\n :foto,\n :habilitado,\n ]\n end",
"def index\n @users = User.order(:name)\n if( !current_user.isadmin() )\n @users = @users.select { |u| u.isplayer(u.id) == true }\n end\n # print('heloo')\n case params[:format]\n when 'staff'\n @users = @users.select { |u| u.canrole == 'staff' } + @users.select { |u| u.canrole == 'medical' } + @users.select { |u| u.canrole == 'admin' } + @users.select { |u| u.canrole == 'staffpremiere' }\n when 'premiere'\n @users = @users.select { |u| u.canrole == 'premiere' }\n when 'staffpremiere'\n @users = @users.select { |u| u.canrole == 'satffpremiere' }\n when 'm21'\n @users = @users.select { |u| u.canrole == 'm21' }\n when 'm18'\n @users = @users.select { |u| u.canrole == 'm18' }\n when 'm16'\n @users = @users.select { |u| u.canrole == 'm16' }\n when 'm15'\n @users = @users.select { |u| u.canrole == 'm15' }\n when 'fe14'\n @users = @users.select { |u| u.canrole == 'fe14' }\n when 'fe13'\n @users = @users.select { |u| u.canrole == 'fe13' }\n when 'fe12'\n @users = @users.select { |u| u.canrole == 'fe12' }\n when 'fe11'\n @users = @users.select { |u| u.canrole == 'fe11' }\n when 'fc10'\n @users = @users.select { |u| u.canrole == 'fc10' }\n when 'fc9'\n @users = @users.select { |u| u.canrole == 'fc9' }\n when 'fc8'\n @users = @users.select { |u| u.canrole == 'fc8' }\n when 'fc7'\n @users = @users.select { |u| u.canrole == 'fc7' }\n when 'archived'\n @users = @users.select { |u| u.canrole == 'archived' }\n end\n end",
"def index\n @anios = Ordenanza.select(:anio).uniq.map do | ord | ord.anio end\n\n @temas = Ordenanza.select(:tema).uniq.map do | ord | ord.tema end\n\n #TODO: Borrar\n @ordenanzas = Ordenanza.limit(10)\n end",
"def show\n @tareapositivas = Tarea.where(listo: true)\n @tareas = Tarea.all\n end",
"def set_usuario\n @usuario = Usuario.find(params[:celular])\n params[:area] = @usuario.celular.to_s[0,4]\n params[:numero] = @usuario.celular.to_s[4,10]\n end",
"def loadUsers()\n @@userid_count+=1\n user1 = User.new(@@userid_count, \"Shweta\", \"Dublin 1\", 1, Array.new)\n @@userid_count+=1\n user2 = User.new(@@userid_count, \"Chirag\", \"Dublin 2\", 5, Array.new)\n @@userid_count+=1\n user3 = User.new(@@userid_count, \"Karishma\", \"Galway\", 5, Array.new)\n\n @users += [user1, user2, user3]\n end",
"def ordenar_todos_los_datos(pila,array=[],cola,lista,ya_ordeno)\n if ya_ordeno[:ordenar]\n array_antes=array.join(',')\n tabla = Terminal::Table.new do |a|\n a.title= \"Ordenar todos los datos: #{array_antes} \"\n a.headings = [{value:'Estructura', alignment: :center},{value:'Ordenada', alignment: :center}]\n a.add_row([{value:'pila', alignment: :center},pila.mostrar_pila()])\n a.add_row([{value:'cola', alignment: :center},cola.mostrar_cola()])\n a.add_row([{value:'lista', alignment: :center},lista.mostrar_lista()])\n end\n puts tabla\n gets\nelse\n array_antes=array.join(',')\n pila.ordenar_pila(array)\n cola.ordenar_cola(array)\n lista.ordenar_lista(array)\n tabla = Terminal::Table.new do |a|\n a.title= \"Ordenar todos los datos: #{array_antes} \"\n a.headings = [{value:'Estructura', alignment: :center},{value:'Ordenada', alignment: :center}]\n a.add_row([{value:'pila', alignment: :center},pila.mostrar_pila()])\n a.add_row([{value:'cola', alignment: :center},cola.mostrar_cola()])\n a.add_row([{value:'lista', alignment: :center},lista.mostrar_lista()])\n end\n puts tabla\n ya_ordeno[:ordenar]=true\n gets\nend\nend",
"def index\n @caja_sucursals = current_user.sucursal.caja_sucursals\n end",
"def show\n @empresa = Empresa.find_by(params[:user_id])\n # @empresa = Empresa.find_by_user_id(current_user.id) #buscar en la tabla empresa el user_id que sea igual al id del actual usuarios\n\n end",
"def enter_users(test_data)\n users = test_data[CoreUseOfCollectionsData::USER_GRP.name] || [CoreUseOfCollectionsData.empty_user]\n hide_notifications_bar\n prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::USER_GRP.name)], users)\n\n users.each_with_index do |user, index|\n logger.info \"Entering user data set at index #{index}: #{user}\"\n enter_auto_complete(user_name_input(index), user_name_options(index), user[CoreUseOfCollectionsData::USER.name], 'Local Persons')\n wait_for_options_and_select(user_type_input(index), user_type_options(index), user[CoreUseOfCollectionsData::USER_INSTITUTION_ROLE.name])\n wait_for_options_and_select(user_role_input(index), user_role_options(index), user[CoreUseOfCollectionsData::USER_UOC_ROLE.name])\n enter_auto_complete(user_institution_input(index), user_institution_options(index), user[CoreUseOfCollectionsData::USER_INSTITUTION.name], 'Local Organizations')\n end\n end",
"def index\n if current_user.local_access?\n @uos = {current_user.uo.nome => current_user.uo.id}\n\n if !params[:q].blank? && !params[:q][:uo_id_eq].blank?\n if params[:q][:uo_id_eq].to_i != current_user.uo_id\n params[:q][:uo_id_eq] = -1\n end\n end\n\n @q = User.where(\"uo_id = ?\", current_user.uo_id).order(\"nome ASC\").search(params[:q])\n else\n @uos = Uo.order(\"nome ASC\").all.collect {|o| [o.nome, o.id]}\n\n @q = User.order(\"nome ASC\").search(params[:q])\n end\n\n @users = @q.result.page(params[:page])\n @total_registros = @q.result.count\n @roles = Role.order(\"nome ASC\").collect{ |r| [r.nome, r.id]}\n end",
"def set_usuario\n \n end",
"def show\n @area = Area.find_by(nombre: 'Fisioterapia')\n if params[:name] == nil\n @medicos = User.where(area: @area).paginate(:page => params[:page], :per_page => 5)\n else\n @medicos = User.where(area: @area)\n .and(\n User.or(name: /.*#{params[:name].downcase}.*/i).or(last_name: /.*#{params[:name].downcase}.*/i).selector\n ).paginate(:page => params[:page], :per_page => 5)\n end\n end",
"def index\n @user_hitos = UserHito.all\n end",
"def index\n @tw_usuarios = TwUsuario.all\n end",
"def all_users\n @date = (params[:date])? Date.parse(params[:date]) : Date.today\n users_ungroup = User.all(:conditions => {:status => User::STATUS_ACTIVE}, :order => 'login').sort\n @user_counts = users_ungroup.size\n @reported = false\n @daily_todo_users_group = Array.new\n @daily_todo_groups = Group.all().sort\n @daily_todo_groups.each do |group|\n users_of_group = group.users.sort_by { |u| u.name }\n no_todo_users, todo_users = users_of_group.partition do |user|\n DailyTodo.first(:conditions => {:user_id => user.id, :date => @date}).nil?\n end\n\n hash_users_of_group = {:todo => todo_users, :no_todo => no_todo_users}\n @daily_todo_users_group.push(hash_users_of_group)\n # Check if the current user has written todo for this date\n @reported = @reported || todo_users.any? { |user|\n user.id == User.current.id\n }\n\n users_of_group.each do |user_of_group|\n users_ungroup.delete_if do |user_ungroup|\n user_ungroup.id == user_of_group.id\n end\n end\n end\n\n no_todo_ungroup_users, todo_ungroup_users = users_ungroup.partition do |user|\n DailyTodo.first(:conditions => {:user_id => user.id, :date => @date}).nil?\n end\n @daily_todo_users_ungroup = {:todo => todo_ungroup_users, :no_todo => no_todo_ungroup_users}\n @reported = @reported || todo_ungroup_users.any? do |user|\n user.id == User.current.id\n end\n end",
"def seguir(otro_usuario)\n\t\t# siguiendo << otro_usuario\n\t\trelaciones_activas.create(seguido_id: otro_usuario.id)\n\tend",
"def ordenar_todos_los_datos(pila,array=[],cola,lista,ya_ordeno)\n if ya_ordeno[:ordenar]\n array_antes=array.join(',')\n array_rendi = obtener_rendimiento(pila,cola,lista)#obtener array con el rendimiento\n tabla = Terminal::Table.new do |a|\n a.title= \"Ordenar todos los datos: #{array_antes} \"\n a.headings = [{value:'Pasos', alignment: :center},{value:'Estructura', alignment: :center},{value:'Rendimiento %', alignment: :center},{value:'Ordenada', alignment: :center}]\n a.add_row([pila.pasos_pila(),{value:'pila', alignment: :center},{value:array_rendi[0], alignment: :center},pila.mostrar_pila()])\n a.add_row([cola.pasos_cola(),{value:'cola', alignment: :center},{value:array_rendi[1], alignment: :center},cola.mostrar_cola()])\n a.add_row([lista.pasos_lista(),{value:'lista', alignment: :center},{value:array_rendi[2], alignment: :center},lista.mostrar_lista()])\n end\n puts tabla\n gets\nelse\n array_antes=array.join(',')\n pila.ordenar_pila(array)\n cola.ordenar_cola(array)\n lista.ordenar_lista(array)\n array_rendi = obtener_rendimiento(pila,cola,lista)#obtener array con el rendimiento\n tabla = Terminal::Table.new do |a|\n a.title= \"Ordenar todos los datos: #{array_antes} \"\n a.headings = [{value:'Pasos', alignment: :center},{value:'Estructura', alignment: :center},{value:'Rendimiento %', alignment: :center},{value:'Ordenada', alignment: :center}]\n a.add_row([pila.pasos_pila(),{value:'pila', alignment: :center},{value:array_rendi[0], alignment: :center},pila.mostrar_pila()])\n a.add_row([cola.pasos_cola(),{value:'cola', alignment: :center},{value:array_rendi[1], alignment: :center},cola.mostrar_cola()])\n a.add_row([lista.pasos_lista(),{value:'lista', alignment: :center},{value:array_rendi[2], alignment: :center},lista.mostrar_lista()])\n end\n puts tabla\n ya_ordeno[:ordenar]=true\n gets\nend\nend",
"def privileges\n users.reduce([]) do |memo, user|\n operations.reject(&:prohibition?).each do |operation|\n objects.each do |object|\n if is_privilege?(user, operation, object)\n memo << [user, operation, object]\n end\n end\n end\n memo\n end\n end",
"def index\n @verfugbarkeits = Verfugbarkeit.all\n @alle_user = User.where(typ: :Mitarbeiter).order(:username)\n end",
"def show\n @area = Area.find_by(nombre: 'Emergencia')\n if params[:name] == nil\n @medicos = User.where(area: @area).paginate(:page => params[:page], :per_page => 5)\n else\n @medicos = User.where(area: @area)\n .and(\n User.or(name: /.*#{params[:name].downcase}.*/i).or(last_name: /.*#{params[:name].downcase}.*/i).selector\n ).paginate(:page => params[:page], :per_page => 5)\n end\n end",
"def users\n result_hash['usr']\n end"
] |
[
"0.5945775",
"0.5942997",
"0.5903607",
"0.5740135",
"0.5599673",
"0.5557967",
"0.5499954",
"0.54700273",
"0.54623455",
"0.5425284",
"0.54154193",
"0.5392129",
"0.53889495",
"0.53850555",
"0.5361046",
"0.53598773",
"0.5352898",
"0.5348539",
"0.53281385",
"0.53147465",
"0.53136206",
"0.53106225",
"0.5301838",
"0.5285077",
"0.5269378",
"0.5251989",
"0.5246476",
"0.5245168",
"0.5243916",
"0.52152926",
"0.52006346",
"0.5196093",
"0.5195758",
"0.5192917",
"0.51864326",
"0.5180349",
"0.51743305",
"0.51720685",
"0.5153982",
"0.51365495",
"0.51325786",
"0.51322734",
"0.5131394",
"0.51242644",
"0.5117657",
"0.5108168",
"0.50976634",
"0.5097354",
"0.50905",
"0.50904435",
"0.5089515",
"0.5086768",
"0.5085756",
"0.50821173",
"0.5077823",
"0.5077138",
"0.5058085",
"0.5056552",
"0.50547194",
"0.5051902",
"0.5050385",
"0.5049862",
"0.5041118",
"0.5040368",
"0.50344104",
"0.50308526",
"0.5026766",
"0.50194097",
"0.5017378",
"0.5013012",
"0.5012637",
"0.5007388",
"0.5000903",
"0.49915707",
"0.49911788",
"0.4978752",
"0.49782223",
"0.49781093",
"0.49694696",
"0.4961844",
"0.4961295",
"0.49575093",
"0.49538037",
"0.49527672",
"0.4947272",
"0.4938292",
"0.4938102",
"0.49377534",
"0.49362588",
"0.49343425",
"0.4932341",
"0.49215275",
"0.49153826",
"0.49106833",
"0.49106216",
"0.49048114",
"0.49004692",
"0.48940423",
"0.4893616",
"0.48890352"
] |
0.66560787
|
0
|
valida si una tarea existe, si lo esta la elimina
|
def eliminar(id)
@@encontrada = false
array = Tarea.all
array.each{|x| @@encontrada = true if x["id"] == id.to_i}
if @@encontrada
Tarea.destroy(id)
end
@@encontrada
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n tmp_element_error = PostitTask.new\n tmp = PostitTask.find(params[:id])\n if tmp\n name = tmp.name\n unless tmp.destroy\n tmp.errors.full_messages.each do |tmp_error| \n tmp_element_error.errors.add(:base, tmp_error)\n end\n end\n end\n if tmp_element_error.errors.empty? \n flash[:notice] = 'Cette tâche a correctement été supprimée.'.trn\n else\n flash[:errors_destroy] = tmp_element_error\n end\n redirect_to :action => \"list\"\n end",
"def eliminar(id)\n begin\n registro_mercantil = RegistroMercantil.count(:conditions=>\"tenencia_unidad_produccion_id = #{self.id}\")\n if registro_mercantil > 0\n errors.add(:tenencia_unidad_produccion, I18n.t('Sistema.Body.Modelos.AlmacenMaquinaria.Errores.item_utilizado'))\n return false\n else\n tenencia_unidad_produccion = TenenciaUnidadProduccion.find(id)\n transaction do\n tenencia_unidad_produccion.destroy\n return true\n end\n end\n rescue\n errors.add(:tenencia_unidad_produccion, I18n.t('Sistema.Body.Modelos.AlmacenMaquinaria.Errores.item_utilizado'))\n return false\n end\n end",
"def can_delete?\n programas.empty? && estaciones.empty?\n end",
"def check_cuotas\n return if @adquisicion.cuotas.none?\n flash[:alert] = \"No se puede eliminar porque tiene cuotas asociadas. Puede darle una fecha de finalización a esta adquisición. Si realmente quiere borrarla, elimine primero las cuotas asociadas.\"\n redirect_to @adquisicion\n end",
"def almacenar(nombre)\n\t\narray = Tarea.all\n@@existente = false\narray.each{|x| @@existente = true if /#{nombre}/.match(x[\"title\"])}\n\t\nunless @@existente \nTarea.create(\"#{nombre} #{@@usuario}\")\n\nend\n@@existente\nend",
"def eliminar_asignaturas\n @seccion = \"Asignaturas\"\n #Primero se verifica que se enviaron datos a través de un formulario\n #Para esto basta con probar que la variable params[:docentes] existe\n unless params[:asignaturas] && params[:id] && __es_numero_entero?(params[:id])\n flash[:error] = \"Disculpe, no se especificó ninguna asignatura. Inténtelo nuevamente.\"\n redirect_to :action => \"asignaturas\"\n return\n end\n\n #Esta variable almacenara cuantos docentes (checkboxs) existian en el formulario\n car = params[:id].to_s\n cant = params[:asignaturas][\"cantidad_\"+car].to_i\n\n #se itera sobre cada posible docente eliminando el que haya sido seleccionado\n for i in 1..cant do\n #En rails solo los checkbox seleccionados son enviados por parametro al servidor, por lo que\n #si el parametro existe, entonces fue seleccionado y por ende debe ser eliminado\n if params[\"asignatura_check_box_\"+car+\"_\"+i.to_s]\n id = params[\"asignatura_check_box_\"+car+\"_\"+i.to_s]\n if asignatura = Asignatura.find(id)\n asignatura.destroy\n end\n end\n end\n\n flash[:exito] = \"Se eliminaron las asignaturas seleccionados exitosamente.\"\n redirect_to :action => \"asignaturas\"\n return\n end",
"def eliminar_asignatura\n @seccion = \"Asignaturas\"\n #Primero se verifica que se enviaron datos a través de un formulario\n if params[:id]\n id = params[:id]\n #Se verifica que el id sea numérico\n if __es_numero_entero?(id)\n #Se verifica que el id pertenezca a una asignatura del sistema\n if asignatura = Asignatura.where(:id => id).first\n #Si existe se elimina\n asignatura.destroy\n flash[:exito] = \"Se eliminó la asignatura satisfactoriamente.\"\n else\n flash[:error] = \"Disculpe, la asignatura especificada no existe en el sistema. Inténtelo nuevamente.\"\n end\n else\n flash[:error] = \"Disculpe, la asignatura especificada no existe en el sistema. Inténtelo nuevamente.\"\n end\n else\n flash[:error] = \"Disculpe, no se especificó una asignatura. Inténtelo nuevamente.\"\n end\n redirect_to :action => \"asignaturas\"\n return\n end",
"def eliminar_estudiante_seccion_sitio_web\n if __es_del_grupo_docente\n @sitio_web = SitioWeb.sitio_actual(params[:asignatura_nombre],params[:semestre])\n #Primero se verifica que se enviaron datos a través de un formulario\n #Para esto basta con probar que la variable params[:estudiantes] existe\n unless params[:id] && __es_numero_entero?(params[:id]) && SeccionSitioWeb.where(:id => params[:id]).size > 0\n flash[:error] = \"Disculpe, no se pudo eliminar a los estudiantes seleccionados\"\n redirect_to :asignatura_nombre => @sitio_web.nombre_url, :semestre => @sitio_web.periodo, :controller => \"estudiantes\", :action => \"index\"\n return\n end\n seccion_sitio_web = SeccionSitioWeb.find(params[:id])\n\n unless params[:seccion_sitio_web] && params[:seccion_sitio_web][\"cantidad_#{seccion_sitio_web.id}\"]\n flash[:error] = \"Disculpe, no se especificó un estudiante. Inténtelo nuevamente.\"\n redirect_to :asignatura_nombre => @sitio_web.nombre_url, :semestre => @sitio_web.periodo, :controller => \"estudiantes\", :action => \"index\"\n return\n end\n\n #Esta variable almacenara cuantos estudiantes (checkboxs) existian en el formulario\n cant = params[:seccion_sitio_web][\"cantidad_#{seccion_sitio_web.id}\"].to_i\n\n #se itera sobre cada posible estudiante eliminando el que haya sido seleccionado\n for i in 1..cant do\n #En rails solo los checkbox seleccionados son enviados por parametro al servidor, por lo que\n #si el parametro existe, entonces fue seleccionado y por ende debe ser eliminado\n if id = params[\"check_box_estudiante_seccion_#{seccion_sitio_web.id}_\"+i.to_s]\n estudiante_seccion_sitio_web = EstudianteSeccionSitioWeb.where(:estudiante_id => id, \n :seccion_sitio_web_id => seccion_sitio_web.id).first\n estudiante_seccion_sitio_web.destroy\n end\n end\n\n flash[:exito] = \"Se eliminaron los estudiantes seleccionados exitosamente.\" \n redirect_to :asignatura_nombre => @sitio_web.nombre_url, :semestre => @sitio_web.periodo, :controller => \"estudiantes\", :action => \"index\"\n return\n end\n redirect_to :asignatura_nombre => @sitio_web.nombre_url, :semestre => @sitio_web.periodo, :controller => \"estudiantes\", :action => \"index\"\n return\n end",
"def check_destroy \n raise ActiveRecord::RecordNotSaved.new(\"No se puede borrar '#{self.name}'. Existen #{expenses.length} gastos asociados.\") if expenses.length > 0 \n end",
"def destroy\n @tipo_lista = TipoLista.find(params[:id])\n if @tipo_lista.possui_funcionarios?\n mensagem=\"a lista #{@tipo_lista.nome} possui funcionários, não pode ser removida\"\n else\n @tipo_lista.destroy\n mensagem=\"O tipo #{@tipo_lista.nome} foi removida com sucesso!\"\n end\n respond_to do |format|\n format.html { redirect_to(tipo_listas_url,:alert => mensagem) }\n format.xml { head :ok }\n end\nend",
"def eliminar_estudiante\n\t\t@seccion = \"Estudiantes\"\n\t\t#Primero se verifica que se enviaron datos a través de un formulario\n\t\tif params[:id]\n\t\t\tid = params[:id]\n\t\t\t#Se verifica que el id sea numérico\n\t\t\tif __es_numero_entero?(id)\n\t\t\t\t#Se verifica que el id pertenezca a un docente del sistema\n\t\t\t\tif estudiante = Estudiante.where(:id => id).first\n\t\t\t\t\t#Si existe se elimina tanto el estudiante como el usuario, ya que los usurios sin rol no cumplen ningun papel en el sistema\n\t\t\t\t\t( (estudiante.usuario.tiene_mas_de_un_rol)? estudiante.destroy : estudiante.usuario.destroy)\n\t\t\t\t\tflash[:exito] = \"Se eliminó al estudiante satisfactoriamente.\"\n\t\t\t\telse\n\t\t\t\t\tflash[:error] = \"Disculpe, el estudiante especificado no existe en el sistema. Inténtelo nuevamente.\"\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tflash[:error] = \"Disculpe, el estudiante especificado no existe en el sistema. Inténtelo nuevamente.\"\n\t\t\tend\n\t\telse\n\t\t\tflash[:error] = \"Disculpe, no se especificó un estudiante. Inténtelo nuevamente.\"\n\t\tend\n\t\tredirect_to :action => \"estudiantes\"\n\t\treturn\n\tend",
"def clean_actividades(vaca,reg_actividad)\n act_tot_reg = vaca.actividades.where(\"registrada > ? and tipo = ?\", reg_actividad,'recorrido')\n if act_tot_reg.any?\n act_tot_reg.destroy_all\n end \n end",
"def destroy\n begin\n @cautela.destroy\n message = 'Exclusão efetuada com sucesso.'\n carrier = :notice\n rescue ActiveRecord::DeleteRestrictionError => e\n @cautela.errors.add(:base, e)\n puts @cautela.errors[:base].to_s\n carrier = :alert\n message = 'O registro possui referências em outra(s) tabela(s) e não pode ser excluído.'\n #message = 'A cautela possui itens associados e não pode ser excluída. #{@cautela.errors[:base].to_s}'\n ensure\n respond_to do |format|\n format.html { redirect_to cautelas_path, carrier => message }\n format.json { head :error }\n end\n end\n end",
"def create\n @tarea = Tarea.new(tarea_params)\n\n respond_to do |format|\n if @tarea.save\n format.html { redirect_to @tarea, notice: 'La Tarea ha sido eliminada correctamente.' }\n format.json { render :show, status: :created, location: @tarea }\n else\n format.html { render :new }\n format.json { render json: @tarea.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @sponsor.in_trash = @sponsor.in_trash == false\n @sponsor.save\n respond_to do |format|\n format.html { redirect_to sponsors_url, notice: 'El auspiciante se eliminó correctamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n unless current_user.admin? or current_user.coordinador?\n redirect_to '/', :alert => \"Acceso denegado.\" #por ahora solo un adminsitrador puede ver esto\n end\n @tutor = Tutor.find(params[:id]) \n if current_user.admin? or current_user.coordinador?\n if @tutor.update(status:false) \n flash[:noticep] = 'Tutor borrado con éxito' \n redirect_to request.referrer \n else \n flash[:noticen] = 'Error al eliminar tutor' \n redirect_to request.referrer\n end\n else\n flash[:noticen] = 'Usted no tiene permisos para eliminar este tutor' \n redirect_to request.referrer \n end \n \n end",
"def eliminar_estudiantes\n\t\t@seccion = \"Estudiantes\"\n\t\t#Primero se verifica que se enviaron datos a través de un formulario\n\t\t#Para esto basta con probar que la variable params[:estudiantes] existe\n\t\tunless params[:estudiantes]\n\t\t\tflash[:error] = \"Disculpe, no se especificó un estudiante. Inténtelo nuevamente.\"\n\t\t\tredirect_to :action => \"estudiantes\"\n\t\t\treturn\n\t\tend\n\n\t\t#Esta variable almacenara cuantos estudiantes (checkboxs) existian en el formulario\n\t\tcant = params[:estudiantes][:cantidad].to_i\n\n\t\t#se itera sobre cada posible estudiante eliminando el que haya sido seleccionado\n\t\tfor i in 1..cant do\n\t\t\t#En rails solo los checkbox seleccionados son enviados por parametro al servidor, por lo que\n\t\t\t#si el parametro existe, entonces fue seleccionado y por ende debe ser eliminado\n\t\t\tif params[\"estudiante_check_box_\"+i.to_s]\n\t\t\t\tid = params[\"estudiante_check_box_\"+i.to_s]\n\t\t\t\testudiante = Estudiante.find(id)\n\t\t\t\t( (estudiante.usuario.tiene_mas_de_un_rol)? estudiante.destroy : estudiante.usuario.destroy)\n\t\t\tend\n\t\tend\n\n\t\tflash[:exito] = \"Se eliminaron los estudiantes seleccionados exitosamente.\"\n\t\tredirect_to :action => \"estudiantes\"\n\t\treturn\n\tend",
"def destroy\n if@conta.filiais.length == 0\n @conta.destroy\n respond_to do |format|\n format.html { redirect_to contas_url, notice: 'Conta was successfully destroyed.' }\n format.json { head :no_content }\n end\n else\n @conta.errors.add(:filiais, \"não é possível remover uma conta que possui filiais\" )\n respond_to do |format| \n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n\n if @reuniao.status==\"Preparação\"\n @reuniao.destroy\n respond_to do |format|\n format.html { redirect_to reuniaos_url, notice: 'Reuniao was successfully destroyed.' }\n format.json { head :no_content }\n end\n else\n\n redirect_to @reuniao , notice: 'Desculpe mas,reuniao já foi confirmada você não pode remove-la.'\n \n end\n end",
"def destroy\n @tarea.destroy\n respond_to do |format|\n format.html { redirect_to tareas_url, notice: 'La Tarea ha sido eliminada correctamente.' }\n format.json { head :no_content }\n end\n end",
"def check_destroy\n valid=true\n msg=\"\"\n if students.count > 0\n valid=false\n end\n if teachings.count > 0\n valid=false\n msg+=\" There are #{teachings.count} teachings references\"\n end\n self.errors.add(:base, \"Class school can't be destroyed:#{msg}\") unless valid\n valid\n end",
"def destroy\n \n if @funcionario.destroy\n flash[:success] = \"Funcionário excluido com sucesso!\"\n redirect_to funcionarios_path\n end\n \n end",
"def check_destroy\n raise ActiveRecord::RecordNotSaved.new(\"No se puede borrar '#{self.print_name}'. Tiene #{expenses.length} gastos asociados\") if expenses.length > 0\n raise ActiveRecord::RecordNotSaved.new(\"No se puede borrar '#{self.print_name}'. Tiene #{payments.length} pagos asociados\") if payments.length > 0 \n raise ActiveRecord::RecordNotSaved.new(\"No se puede borrar '#{self.print_name}'. Es supervisor de #{supervised_users.length} usuarios\") if self.is_supervisor? && supervised_users.length > 0 \n end",
"def destroy\n @tareapositivas = Tarea.where(listo: true)\n @tarea.destroy\n respond_to do |format|\n format.html { redirect_to tareas_url, notice: 'Tarea was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def check_destroy\n valid=true\n msg=\"\"\n if grades.count > 0\n valid=false\n msg+=\" There are #{grades.count} teachings references\"\n end\n self.errors.add(:base, \"Grade context can't be destroyed:#{msg}\") unless valid\n valid\n end",
"def validate_route_deletion!\n unless route.stations.find { |station| station.name == station_name }\n raise 'Unexisting station'\n end\n if station_name == route.stations.first\n raise 'First station can not be deleted'\n end\n return false unless station_name == route.stations.last\n raise 'Last station can not be deleted'\n end",
"def control_sin_items_comprobantes\n if [detalles].any? {|detalle| detalle.any? }\n self.errors[:base] = \"error que queres hacer?\"\n return false\n end \n end",
"def destroy\n if @aluno.matriculas.any?\n redirect_to alunos_path, alert: \"Não foi possível excluir o(a) aluno(a) #{@aluno.nome}. Primeiro você precisa encerrar as matrículas vinculadas.\"\n else\n respond_to do |format|\n if @aluno.destroy\n #gera_notificacao(\"admin\",@aluno, action_name)\n format.html { redirect_to alunos_path}\n #format.json { head :no_content }\n else\n showErrors(@aluno.errors)\n format.html { redirect_back fallback_location: alunos_path }\n end\n end\n end\n end",
"def eliminar(identificador)\n\t\t@tabla.delete(identificador)\n\t\t@tamanio.delete(identificador)\n\tend",
"def destroy\n if(current_user!=nil && current_user.rol==\"admin\"||(current_user.rol==\"regular\" && current_user.id==@location.user_id))\n @user=@location.user\n if(@location.delivers.size>0)\n \n flash[:alert]=\"No se puede eliminar hay pedidos a esta direccion!\"\n else\n@location.destroy\nflash[:alert]=\"Eliminado correctamente\"\n end\n if(current_user.rol==\"admin\")\n redirect_to '/locations/index/'+@user.id.to_s\n else\n redirect_to locations_url\n end\n else\n redirect_to root_path\n end\n end",
"def destroy\n #@maquinat.destroy # NO SE DEBEN DESTRUIR POR LAS RELACIONES EXISTENTES AL MENOS QUE CONFIGUREMOS DEPENDENT DETROY( NO RECOMENDABLE POR EL HISTORIAL DE VENTAS) SOLO DESABILITARLAS => ACTIVA => NO OK. TED.\n @maquinat.activa = \"no\"\n if @maquinat.save\n respond_to do |format|\n format.html { redirect_to maquinats_url, notice: 'Maquina desactivada. Para activarla nuevamente presione Editar' }\n format.json { head :no_content }\n end\n end # lo del error del .save (en caso que pase) no se considera por ahora, solo el if, para proteger al sw de una exception. ok.\n end",
"def check_destroy\n valid=true\n msg=\"\"\n if matters.count > 0\n valid=false\n msg+=\" There are #{matters.count} teacher_matters references\"\n end\n if teachings.count > 0\n valid=false\n msg+=\" There are #{teachings.count} teachings references\"\n end\n self.errors.add(:base, \"Teacher can't be destroyed:#{msg}\") unless valid\n valid\n end",
"def delete_validator\n if is_used?\n self.errors.add \"This event is used on participant records. You must remove all participant events before deleteing this event type\"\n false\n end\n end",
"def destroy\n if @persona_nota_seguimiento.destroy\n redirect_to @persona, notice: 'Eliminado Correctamente.'\n else\n render :edit\n end\n end",
"def destroy\n respond_to do |format|\n @ra = Reserva.where(user_id: params[:id], status: 1)\n @r = Reserva.where(entidade_id: @user.entidade_id, status: 1)\n\n if(@ra.any? || (@r.any? && (@user.tipo.eql? 2)) || (@user.nome.eql? 'master'))\n format.html { redirect_to users_url, alert: 'Não pode ser excluido porque tem atividades ativas!' }\n format.json { head :no_content }\n else\n ActiveRecord::Base.connection.execute(\"update users set status = 0 where id =\"+ params[:id])\n format.html { redirect_to users_url, notice: 'Excluido com sucesso.' }\n format.json { head :no_content }\n end\n end\n end",
"def destroy\n @lista_precio = ListaPrecio.find(params[:id])\n\n #existen_reg = Comprobante.find(:all, :conditions=>{:lista_precio_id=>params[:id]}))\n\n \n respond_to do |format|\n\n # unless existen_reg\n # @lista_precio.destroy\n # noti = \"La lista de precios #{@lista_precio.nombre} ha sido eliminada satisfactoriamente.\"\n # format.xml { head :ok }\n # else\n ruta = \"lista_precios/#{@lista_precio.id.to_s}/edit\"\n noti = \"Existen registro relacionados a esta lista de precio, solamente puede cambiar su estado a baja desde #{ActionController::Base.helpers.link_to 'aquí', ruta, :class=> 'fancybox'}.\" \n # end\n \n format.html { redirect_to( lista_precios_url, :notice=> noti)}\n \n end \n\n end",
"def eliminar_palabra\n @palabra = Palabra.find(params[:palabra_id])\n @palabra.destroy\n bot = Bot.find(params[:id])\n if bot.palabras.length == 0\n bot.update_attributes(estado: 0)\n end\n redirect_to(bot_palabras_path(params[:id]), :notice => \"Palabra Eliminada\")\n end",
"def delete(value)\n\t \n if @root == nil \n return false\n end\n \n #Obtenemos el nodo a remover\n\t toRemove = selectElement(value,@root)\n \n ## Mandamos a buscar al padre del nodo\n father = getFather(value,@root,toRemove)\n \n if !isLeaft(toRemove,father) ## remueve elemento al encontrarlo y sea hoja\n promote(toRemove,father) ##Verificamos si es hijo unico\n end\n \n return true\n end",
"def ensure_remitente_exists\n begin\n Entidad.find(self.remitente_id)\n rescue ActiveRecord::RecordNotFound\n errors.add(:remitente,'Debe seleccionar un Remitente')\n end\n\n end",
"def destroy\n if Doacao.where(\"benfeitor_id = #{params[:id]}\").count > 0\n flash[:error_delete] = \"Este benfeitor possui doações cadastradas. Primeiro é preciso excluí-las!\"\n else\n @benfeitor = Benfeitor.find(params[:id])\n @benfeitor.destroy\n flash[:notice] = \"Benfeitor excluido com sucesso!\"\n end\n\n respond_to do |format|\n format.html { redirect_to benfeitores_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente = Cliente.find(params[:id])\n control = Comprobante.find(:all, :conditions=>{:cliente_id => params[:id]})\n\n respond_to do |format|\n if control.blank?\n @cliente.destroy\n format.html { redirect_to(clientes_path, :notice => \"El cliente #{@cliente.nombre} ha sido eliminado satisfactoriamente.\") }\n format.xml { render :xml => @cliente, :status => :created, :location => @cliente }\n else\n format.html { redirect_to(clientes_path, :notice => \"El cliente no se ha podido eliminar porque existen datos relacionados a este registro, puedo asignarle estado igual a baja desde editar registro.\") }\n end\n end\n end",
"def deleteable?\n if smo_code == 'SPECIAL'\n # Can't delete the special code\n false\n elsif signs.exists?\n # Can't delete if there are assets using the code\n false\n else\n true\n end\n end",
"def destroy\n\t\traise CanCan::AccessDenied if !DetalleGasto.accessible_by(current_ability, :destroy).include?(@detalle_gasto)\n\t\tsesion = Sesion.find_by(usuario_id: current_usuario.id, fechaFin: nil)\n\t\tTransaccion.create!(descripcion: \"Eliminar detalle gasto #{@detalle_gasto.titulo}, descripcion: #{@detalle_gasto.descripcion}, con monto #{@detalle_gasto.monto}, concepto_gasto: #{@detalle_gasto.concepto_gasto.titulo}, voluntario: #{@detalle_gasto.voluntario.nombre}, comprobante: #{@detalle_gasto.comprobante.numero}\",\n sesion_id: sesion.id, \n proyecto_id: @detalle_gasto.informe_gasto.proyecto.id)\n @detalle_gasto.destroy\n \n respond_to do |format|\n format.html { redirect_to gestionar_informe_gastos_path(@informe_gastos)} #detalle_gastos_url, notice: 'Detalle gasto fue borrado satisfactoriamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy_right\n\n tmp_element_error = DirAccess.new\n tmp = DirAccess.find_by_id(params[:id])\n @dir = tmp.dir_manager\n if tmp\n unless tmp.destroy\n tmp.errors.full_messages.each do |tmp_error| \n tmp_element_error.errors.add(:base, tmp_error)\n end\n end\n end\n if tmp_element_error.errors.empty? \n flash[:notice] = \"Ce droit répertoire a correctement été supprimé.\".trn\n else\n flash[:errors_destroy] = tmp_element_error\n end\n redirect_to :action => \"right_dir\", :id => @dir.id\n end",
"def verifica_anulacion_del_cierre\n if Cierre.where(\"fechaproceso > ? and activo = ? and empresa_id = ? \", self.fechaproceso.to_date + 1.day, true, 1).exists?\n errors.add(:fechaproceso, \"Existen fechas posteriores que estan cerradas.\")\n end\n end",
"def destroy\n begin\n @seguimiento.destroy\n rescue ActiveRecord::InvalidForeignKey => e\n respond_to do |format|\n format.html { redirect_to @seguimiento.caso, notice: \"No se puede borrar el seguimiento hasta no eliminar sus documentos.\" }\n format.json { head :no_content }\n end\n return\n end \n respond_to do |format|\n format.html { redirect_to @seguimiento.caso, notice: \"Seguimiento borrado.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @corporacion_policiaca = CorporacionPoliciaca.find(params[:id])\n if @corporacion_policiaca.participantes.empty?\n @corporacion_policiaca.destroy\n flash[:notice] = \"Registro eliminado correctamente\"\n else\n flash[:error] = \"Registro no se pudo eliminar\"\n end\n\n respond_to do |format|\n format.html { redirect_to(corporacion_policiacas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @basico.en_venta = !@basico.en_venta\n @basico.save\n respond_to do |format|\n format.html { redirect_to basicos_url, notice: 'Estado cambiado correctamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n\t\t @trabajo.destroy\n\t\t respond_to do |format|\n\t\t format.html { redirect_to admin_trabajos_path, notice: 'El Trabajo se ha eliminado.' }\n\t\t format.json { head :no_content }\n\t\t end\n\t\t end",
"def verify_amount_before_destroy\n if Account.exists?(customer_id: self.id)\n amount = Account.find_by_customer_id(self.id).amount\n if amount > 0\n puts \"Impossible de supprimer le compte de cet utilisateur, son compte n'est pas vide\"\n # send SMS to user\n Sms.nexah(self.phone, \"#{self.complete_name}, votre compte n'est pas vide! Merci de transferer les fonds vers Orange/MTN/Compte bancaire avant de supprimer votre compte\")\n\n # wait job for 3 seconds\n sleep(3)\n\n raise ActiveRecord::Rollback\n else\n #delete customer account\n suppression = self.account.destroy!\n if suppression\n puts \"Compte supprimé avec succes!\"\n else\n puts \"Impossible de supprimer ce compte : #{suppression.error.messages}\"\n end\n end\n else\n puts \"Cet utilisateur ne dispose pas de compte financier.\"\n # raise ActiveRecord::Rollback\n supp = Customer.find(self.id).destroy!\n puts supp\n end\n end",
"def podeCadastrarNovaTurma\n\n if (current_usuario.usuarioLimitado? && current_usuario.turmas.exists?)\n #se usuario é limitado e ja possui local\n #true -true\n return false\n end\n\n return true\n\n end",
"def eliminar\n if user_signed_in?\n unless current_user.employee.nil?\n @permiso_eliminar = false\n @security_role_type = Security::RoleType.find_by(name: \"Eliminar\").name\n current_user.employee.security_profile.security_role.security_role_menus.each do |security_role_menu| \n if security_role_menu.security_menu.controller == params[:controller] \n security_role_menu.security_role_type_menus.each do |role_type|\n if @security_role_type == role_type.security_role_type.name\n @permiso_eliminar = true\n break\n end\n end\n elsif params[:controller] == \"security/role_type_menus\"\n params[:controller] = \"security/roles\"\n if security_role_menu.security_menu.controller == params[:controller] \n security_role_menu.security_role_type_menus.each do |role_type|\n if @security_role_type == role_type.security_role_type.name\n @permiso_eliminar = true\n break\n end\n end\n end\n end\n end\n if current_user.username == \"aadmin\"\n @permiso_eliminar = true\n end\n if params[:action] == \"delete\" && @permiso_eliminar == false\n redirect_to root_path\n end\n return @permiso_eliminar\n end\n end\n end",
"def destroy\n @cajas = Caja.all \n if @viatico_detail.destroy\n begin\n @viatico[:inicial] = @viatico.get_total_inicial\n rescue\n @viatico[:inicial] = 0\n end \n \n begin\n @viatico[:total_ing] = @viatico.get_total_ing\n rescue \n @viatico[:total_ing] = 0\n end \n begin \n @viatico[:total_egreso]= @viatico.get_total_sal\n rescue \n @viatico[:total_egreso]= 0 \n end \n @viatico[:saldo] = @viatico[:inicial] + @viatico[:total_ing] - @viatico[:total_egreso]\n @viatico.save\n \n if @viatico.caja_id == 1 \n a = @cajas.find(1)\n a.inicial = @viatico[:saldo]\n a.save\n end \n if @viatico.caja_id == 2\n a = @cajas.find(2)\n a.inicial = @viatico[:saldo]\n a.save\n end \n if @viatico.caja_id == 3 \n a = @cajas.find(3)\n a.inicial = @viatico[:saldo]\n a.save\n end \n if @viatico.caja_id == 4 \n a = @cajas.find(4)\n a.inicial = @viatico[:saldo]\n a.save\n end \n \n flash[:notice]= \"Item fue eliminado satisfactoriamente \"\n redirect_to @viatico\n else\n flash[:error]= \"Item ha tenido un error y no fue eliminado\"\n render :show \n end \n \n end",
"def eliminar_docente\n\t\t@seccion = \"Docentes\"\n\t\t#Primero se verifica que se enviaron datos a través de un formulario\n\t\tif params[:id]\n\t\t\tid = params[:id]\n\t\t\t#Se verifica que el id sea numérico\n\t\t\tif __es_numero_entero?(id)\n\t\t\t\t#Se verifica que el id pertenezca a un docente del sistema\n\t\t\t\tif docente = Docente.where(:id => id).first\n\t\t\t\t\t#Si existe se elimina tanto el docente como el usuario, ya que los usurios sin rol no cumplen ningun papel en el sistema\n\t\t\t\t\t( (docente.usuario.tiene_mas_de_un_rol)? docente.destroy : docente.usuario.destroy)\n\t\t\t\t\tflash[:exito] = \"Se eliminó al docente satisfactoriamente.\"\n\t\t\t\telse\n\t\t\t\t\tflash[:error] = \"Disculpe, el docente especificado no existe en el sistema. Inténtelo nuevamente.\"\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tflash[:error] = \"Disculpe, el docente especificado no existe en el sistema. Inténtelo nuevamente.\"\n\n\t\t\tend\n\t\telse\n\t\t\tflash[:error] = \"Disculpe, no se especificó un docente. Inténtelo nuevamente.\"\n\t\tend\n\t\tredirect_to :action => \"docentes\"\n\t\treturn\n\tend",
"def destroy\n @topes_legale.destroy\n respond_to do |format|\n format.html { redirect_to topes_legales_url, notice: 'Tope legal eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n\n\n @proveedor = Proveedor.find(params[:id])\n control = Comprobante.find(:all, :conditions=>{:proveedor_id => params[:id]})\n\n respond_to do |format|\n if control.blank?\n @proveedor.destroy\n format.html { redirect_to(proveedores_path, :notice => \"El proveedor #{@proveedor.nombre} ha sido eliminado satisfactoriamente.\") }\n format.xml { render :xml => @cliente, :status => :created, :location => @proveddor }\n else\n format.html { redirect_to(clientes_path, :notice => \"El proveedor no se ha podido eliminar porque existen datos relacionados a este registro, puedo asignarle estado igual a baja desde editar registro.\") }\n end\n end\n end",
"def destroy\n @puntaje = Puntaje.find(params[:id])\n @destruyo = false\n respond_to do |format|\n begin\n if @puntaje.destroy\n @destruyo = true\n end\n notice = \"El puntaje y sus demas atributos han sido eliminado correctamente. \"\n CustomLogger.info(\"Puntaje: #{@puntaje.puntaje.to_i.inspect} correspondiente a la tarea: #{@puntaje.planificacion_tarea.inspect} del alumno: #{@puntaje.alumno.user_full_name.inspect} , Descripcion:#{@puntaje.descripcion.inspect} han sido eliminados por el usuario: #{current_user.full_name.inspect}, #{Time.now}\")\n rescue\n notice = \"Este puntaje y sus demas atributos no pueden ser eliminados\"\n CustomLogger.error(\"Error al eliminar el puntaje: #{@puntaje.puntaje.to_i.inspect} y sus demas atributos, por el usuario: #{current_user.full_name.inspect}, #{Time.now}\")\n ensure\n format.html { redirect_to puntajes_url, notice: notice }\n format.json { head :no_content }\n format.js\n end\n end\n end",
"def delete\n ret_val = error_if_exists('delete')\n super if ret_val\n return ret_val\n end",
"def destroy\n @cajas = Caja.all \n if @viatico_detail.destroy\n begin\n @viatico[:inicial] = @viatico.get_total_inicial\n rescue\n @viatico[:inicial] = 0\n end \n \n begin\n @viatico[:total_ing] = @viatico.get_total_ingreso\n rescue \n @viatico[:total_ing] = 0\n end \n begin \n @viatico[:total_egreso]= @viatico.get_total_egreso\n rescue \n @viatico[:total_egreso]= 0 \n end \n @viatico[:saldo] = @viatico[:inicial] + @viatico[:total_ing] - @viatico[:total_egreso]\n @viatico.save\n \n if @viatico.caja_id == 1 \n a = @cajas.find(1)\n a.inicial = @viatico[:saldo]\n a.save\n end \n if @viatico.caja_id == 2\n a = @cajas.find(2)\n a.inicial = @viatico[:saldo]\n a.save\n end \n if @viatico.caja_id == 3 \n a = @cajas.find(3)\n a.inicial = @viatico[:saldo]\n a.save\n end \n if @viatico.caja_id == 4 \n a = @cajas.find(4)\n a.inicial = @viatico[:saldo]\n a.save\n end \n \n flash[:notice]= \"Item fue eliminado satisfactoriamente \"\n redirect_to @viatico\n else\n flash[:error]= \"Item ha tenido un error y no fue eliminado\"\n render :show \n end \n \n end",
"def eliminar_ciudad\n begin\n @botciudad = BotCiudad.find(params[:id_botciudad])\n @botciudad.destroy\n bot = Bot.find(params[:id])\n if bot.botCiudads.length == 0\n bot.update_attributes(estado: 0)\n end\n redirect_to(bot_ciudades_path(params[:id]), notice: \"Ciudad Eliminada\")\n rescue Exception => e\n redirect_to(bot_path, :notice => \"Error: #{e}\")\n end\n end",
"def destroy\n @especie.destroy\n bitacora=Bitacora.new(:descripcion => \"Eliminó al taxón #{@especie.nombre_cientifico} (#{@especie.id})\", :usuario_id => current_usuario.id)\n bitacora.save\n respond_to do |format|\n format.html { redirect_to especies_index_path, :notice => \"El taxón #{@especie.nombre_cientifico} fue elimanado correctamente\" }\n format.json { head :no_content }\n end\n end",
"def check_destroy\n valid=true\n msg=\"\"\n if grades.count > 0\n valid=false\n msg+=\" There are #{grades.count} grades references\"\n end\n if teachers.count > 0\n valid=false\n msg+=\" There are #{teachers.count} grades references\"\n end\n if teacher_matters.count > 0\n valid=false\n msg+=\" There are #{teacher_matters.count} teacher_matters references\"\n end\n self.errors.add(:base, \"Matter can't be destroyed:#{msg}\") unless valid\n valid\n end",
"def internal_delete_object\n if self.transaction_activity.is_confirmed?\n self.errors.add(:generic_errors, \"Transaction sudah di konfirmasi\")\n return self \n end\n \n self.destroy \n end",
"def destroy\n @tarefa.destroy\n redirect_to dashboard_monitorias_path, notice: \"Tarefa removida!\"\n end",
"def destroy\n @subfamilia = Subfamilia.find(params[:id])\n @generos = @subfamilia.generos\n\n @destroyed = false\n if @generos.first.nil?\n @subfamilia.destroy\n @destroyed = true\n end\n\n respond_to do |format|\n if @destroyed\n flash[:notice] = 'Subfamília excluído com sucesso.'\n else\n flash[:notice] = 'O subfamília não pode ser excluído devido a relação com o gênero ' + @generos.first.nome\n end\n format.html { redirect_to(subfamilias_url) }\n format.xml { head :ok }\n end\n end",
"def check_before_remove(transport)\n \t# pokud je transport uzavřen vyvolam vyjímku\n \tif not transport.efectiveUnLoadTime.nil?\n \t\traise \"Transport is finished - you can not remove item\" \n \telse\n \t\t#Pokud jde o posledni transport daneho itemu vynuluju jeho Place_id\n \t\tif self.transports.size == 1 then\n \t\t\tself.place_id = nil\n \t\t\tself.placeSince = nil\n \t\t\tself.save\n\t\t\tend\t\n \tend\t\n end",
"def remove_should_check_existing?\n true\n end",
"def delete\n self.is_deleted = true\n save :validate => false\n true\n end",
"def valida_descarga_guia\n if params[:especie_id].present?\n begin\n t = Especie.find(params[:especie_id])\n cat = t.categoria_taxonomica\n \n if [3,4,5].include?(cat.nivel1)\n self.resp = { estatus: true }\n else\n return self.resp = { estatus: false, msg: 'El taxón no es una clase, orden o familia' }\n end\n\n rescue => e\n return self.resp = { estatus: false, msg: 'El taxón seleccionado no existe' + e.inspect }\n end \n \n else\n return self.resp = { estatus: false, msg: 'Se debe escoger un taxón' } \n end\n\n if params[:region_id].present? && (params[:tipo_region].present? && %(municipio anp).include?(params[:tipo_region]))\n self.resp = { estatus: true }\n else\n self.resp = { estatus: false, msg: 'La región seleccionada no es un municipio o ANP' }\n end\n end",
"def check_to_remove_row\n\t\t\n\t\t\t# Check if the currently selected row hasn't changed\n\t\t\t# after the delete action was confirmed. Delete if unchanged\n\t\t\tif @form.folderList.currentRow == @to_delete_row\n\t\t\t\n\t\t\t\t# Remove from list\n\t\t\t\t@form.folderList.takeItem(@to_delete_row).dispose\n\t\t\t\t\n\t\t\t\t# Reset delete button\n\t\t\t\t@remove_button.was_confirmed\n\t\t\t\t\n\t\t\t\t# Post state changed event\n\t\t\t\tstate_changed\n\t\t\tend\n\t\t\t\n\t\tend",
"def destroy\n @alumno = Alumno.find(params[:id])\n @destruyo = false\n respond_to do |format|\n begin\n if @alumno.destroy\n @destruyo = true\n end\n notice = \"El alumnos y sus demas atributos han sido eliminados correctamente. \"\n CustomLogger.info(\"Nombre del alumno: #{@alumno.user_nombre.inspect} ,Apellido: #{@alumno.user_apellido.inspect} ,Cedula de Identidad: #{@alumno.user_CINro.inspect} ,Sexo: #{@alumno.user_sexo.inspect} ,Telefono:#{@alumno.user_telefono.inspect} ,Correo Electronico: #{@alumno.user_email.inspect} ,Fecha de Nacimiento:#{@alumno.user_fecha_nacimiento.inspect} ,Lugar de Nacimiento: #{@alumno.user_lugar_nacimiento.inspect} ,Nombre del Responsable: #{@alumno.responsable.inspect} ,Telefono del Responsable: #{@alumno.telefono_responsable.inspect} ,Direccion: #{@alumno.user.address.direccion.inspect} ,Documentos Personales: Certificado de Estudio: #{@alumno.doc_cert_estudios.inspect} ,Cedula: #{@alumno.doc_cedula.inspect} ,Certificado de Nacimiento: #{@alumno.doc_cert_nacimiento.inspect} ,Foto Tipo Carnet: #{@alumno.doc_foto.inspect} ,Nombre de Usuario: #{@alumno.user_username.inspect} han sido eliminados por el usuario: #{current_user.full_name.inspect} ,#{Time.now}\")\n rescue\n notice = \"Este alumnos y sus demas atributos no pueden ser eliminados\"\n CustomLogger.error(\"Error al eliminar el alumno: Nombre del alumno: #{@alumno.user_nombre.inspect} y sus demas atributos, por el usuario: #{current_user.full_name.inspect} ,#{Time.now} \")\n ensure\n format.html { redirect_to alumnos_url, notice: notice }\n format.json { head :no_content }\n format.js\n end\n end\n end",
"def validate_destroy\r\n errors.add(:base, I18n.t(\"activerecord.errors.models.user.delete\")) if User.count == 1\r\n unless current_user.nil?\r\n errors.add(:base, I18n.t(\"activerecord.errors.models.user.invalid_role_full\")) if Role::ORDER.index(current_user.role.id) < Role::ORDER.index(self.role.id) \r\n errors.add(:base, I18n.t(\"activerecord.errors.models.user.self_delete\")) if current_user.id == self.id\r\n end\r\n errors.blank?\r\n end",
"def destroy\n #adicionando itens baixados da cautela na reserva \n if params[:baixar]=='false' \n @reservaarmamento=Reservaarmamento.where(id: @cautelaarmamento.reservaarmamento_id,\n reserva_id: @cautelaarmamento.cautela.reserva_id)\n qtd_reserva=0\n @reservaarmamento.each do |reservaarmamento| \n qtd_reserva = reservaarmamento.qtd_armamento\n end\n qtd_armamento_baixado =@cautelaarmamento.qtd_armamento\n qtd_realocar= qtd_reserva + qtd_armamento_baixado \n @reservaarmamento.update(qtd_armamento: qtd_realocar)\n mensagem='O Item foi excluído com Scuesso!'\n end \n \n @cautelaarmamento.destroy\n respond_to do |format|\n format.html { redirect_to \"/cautelaarmamentos?cautela_id=\"+@cautelaarmamento.cautela_id.to_s+\"&reserva_id=\"+@cautelaarmamento.cautela.reserva_id.to_s, notice: mensagem}\n format.json { head :no_content }\n end\n end",
"def eliminar_palabra\n\t\t@palabra = Palabra.find(params[:palabra_id])\n\t\t@palabra.destroy\n\t\tbot = Bot.find(params[:id])\n\t\tif bot.palabras.length == 0\n\t\t\tbot.update_attributes(estado: 0)\n\t\tend\n\t\tredirect_to(bot_palabras_path(params[:id]), :notice => \"Palabra Eliminada\")\n\tend",
"def destroy\n\t@lt = ListaDeTarea.find(params[:lista_de_tarea_id])\n @tarea = Tarea.find(params[:id])\n @tarea.destroy\n\n respond_to do |format|\n format.html { redirect_to lista_de_tarea_url(@lt) }\n format.xml { head :ok }\n end\n end",
"def delete_type_paiement\n data = params[:type_id]\n\n #recherche et suppression\n query = Modepaiement.find(data)\n query.status = 0\n if query.save\n redirect_to parametre_type_paiement_path\n end\n end",
"def destroy\n #elimina correctamente pero falta pedir confirmacion o validar que se pueda destruir\n @paciente.destroy\n respond_to do |format|\n format.html { redirect_to pacientes_url, notice: 'Paciente Eliminado correctamente.' }\n format.json { head :no_content }\n end\n rescue ActiveRecord::StatementInvalid => e\n flash[:danger] = 'No se puede eliminar el registro esta en uso'\n redirect_to pacientes_path\n end",
"def destroy\n #adicionando itens baixados da cautela na reserva \n if params[:baixar]=='false' \n @reservamunicao=Reservamunicao.where(id: @cautelamunicao.reservamunicao_id,\n reserva_id: @cautelamunicao.cautela.reserva_id)\n \n qtd_reserva=0\n @reservamunicao.each do |reservamunicaos| \n qtd_reserva = reservamunicaos.qtd_municao\n end\n qtd_municao_baixado =@cautelamunicao.qtd_municao\n qtd_realocar= qtd_reserva + qtd_municao_baixado \n @reservamunicao.update(qtd_municao: qtd_realocar)\n mensagem='O Item foi excluído com Scuesso!'\n end \n \n @cautelamunicao.destroy\n respond_to do |format|\n format.html { redirect_to \"/cautelamunicaos?cautela_id=\"+@cautelamunicao.cautela_id.to_s+\"&reserva_id=\"+@cautelamunicao.cautela.reserva_id.to_s, notice: mensagem}\n format.json { head :no_content }\n end\n end",
"def checkIdEscuelaForDirector\n if !self[:id_permission].nil? && self.user_permission.name == \"Director\"\n if !self[:escuela_id].nil?\n if !Escuela.exists?(id: self[:escuela_id])\n self.errors[:carrera_id] = \"La escuela seleccionada no se encuentra en el sistema.\"\n end\n else\n # El director creado no tiene una carrera asignada.\n self.errors[:escuela_id] = \"Debe seleccionar una escuela para el usuario director.\"\n end\n end\n end",
"def destroy\n @os_tarefa.destroy\n respond_to do |format|\n if @os_tarefa.ordem_servico.id!=nil\n format.js { render :layout => false }\n format.html { redirect_to \"/ordem_servicos/\"+@os_tarefa.ordem_servico.id.to_s, notice: 'Os tarefa foi excluído(a)' }\n format.json { head :no_content }\n else\n format.html { redirect_to os_tarefas_url, notice: 'A Tarefa foi excluído(a)' }\n format.json { head :no_content }\n format.js { render :layout => false }\n\n end\n end\n end",
"def check_before_destroy\n unless is_comment? || sir_item.sir_entries.last.id == id\n errors.add( :base, I18n.t( 'sir_items.msg.bad_del_req' ))\n# raise ActiveRecord::Rollback\n throw( :abort )\n end\n end",
"def destroy\n @detalle_orden_trabajo.destroy\n respond_to do |format|\n format.html { redirect_to @orden_trabajo, notice: 'Detalle fue eliminado con éxito.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n has_use = EventVolunteerUser.where(position: params[:id], event_volunteer_id: @event_vol_position.event_volunteer_id).exists?\n if has_use\n @event_vol_position.errors[:该职位] << '已被分配到志愿者,不能删除,只能编辑'\n else\n @event_vol_position.destroy\n end\n respond_to do |format|\n format.html { redirect_to admin_positions_url, notice: @event_vol_position.name + '已成功删除.' }\n format.json { head :no_content }\n format.js\n end\n end",
"def check_destroy\n valid=true\n msg=\"\"\n puts \"******************* students.count=#{students.count}\"\n if students.count > 0\n valid=false\n msg+=\" There are #{students.count} students references\"\n end\n puts \"******************* teachings.count=#{teachings.count}\"\n if teachings.count > 0\n valid=false\n msg+=\" There are #{teachings.count} teachings references\"\n end\n puts \"******************* valid=#{valid}\"\n puts \"******************* msg=#{msg}\"\n self.errors.add(:base, \"Class school can't be destroyed:#{msg}\") unless valid\n valid\n end",
"def destroy\n\nrol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"ACRM\"\n @municipio_de_la_preparatoria_o_universidad_de_origen = MunicipioDeLaPreparatoriaOUniversidadDeOrigen.find(params[:id])\n @municipio_de_la_preparatoria_o_universidad_de_origen.destroy\nelse\n flash[:error] ='No tienes permiso para realizar esta accion'\n\nend\n\n \n\n respond_to do |format|\n format.html { redirect_to municipio_de_la_preparatoria_o_universidad_de_origens_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @core_empresa = Core::Empresa.find(params[:id])\n \n if @core_empresa.status == TRUE\n \t@core_empresa.status = FALSE\n \tflash[:success] = \"O status da empresa mudou para #{@core_empresa.status}\"\n \t@core_empresa.save\n \tredirect_to core_empresas_path\n else\n \t@core_empresa.status = TRUE\n \tflash[:success] = \"O status da empresa mudou para #{@core_empresa.status}\"\n \t@core_empresa.save\n \tredirect_to core_empresas_path\n end\n \n #if @core_empresa.empresa_modulos.count == 0\n\t\t\t#flash[:success] = \"Essa Empresa Nao tem modulos pode apagar\"\n \t#redirect_to core_empresas_path\n #else\n \t#flash[:error] = \"Essa Empresa tem modulos\"\n \t#redirect_to core_empresas_path\n #end\n \n #if @core_empresa.destroy\n \t#flash[:success] = \"Apagado com Sucesso\"\n \t#redirect_to core_empresas_path\n #else\n \t#flash[:success] = \"Erro ao Apagar\"\n \t#redirect_to core_empresas_path\n #end\n\n end",
"def destroy\n @funcionario.destroy\n flash[:notice] = \"Funcionario excluido com sucesso\"\n redirect_to funcionarios_url\n end",
"def destroy\n @suplemento.destroy\n respond_to do |format|\n format.html { redirect_to suplementos_url, notice: 'Suplemento was successfully destroyed.' }\n format.json { head :no_content }\n end\n rescue ActiveRecord::StatementInvalid => e\n flash[:danger] = 'No se puede eliminar el registro esta en uso'\n redirect_to pacientes_path\n end",
"def delete_invalid_eobs(check, client_id, facility_id)\r\n insurance_eobs_count = InsurancePaymentEob.count(:conditions => [ \"check_information_id = ?\", check.id ] )\r\n if insurance_eobs_count != 0\r\n deleted_eobs = InsurancePaymentEob.destroy_all(:check_information_id => check.id, :patient_account_number => nil)\r\n entity = 'insurance_payment_eobs'\r\n else\r\n deleted_eobs = PatientPayEob.destroy_all(:check_information_id => check.id, :account_number => nil)\r\n entity = 'patient_pay_eobs'\r\n end\r\n if deleted_eobs.length > 0\r\n deleted_entity_records = []\r\n deleted_eobs.each do |deleted_eob|\r\n parameters = { :entity => entity, :entity_id => deleted_eob.id,\r\n :client_id => client_id, :facility_id => facility_id }\r\n deleted_entity_records << DeletedEntity.create_records(parameters)\r\n end\r\n if deleted_entity_records.present?\r\n DeletedEntity.import(deleted_entity_records)\r\n end\r\n end\r\n end",
"def valid_for_removal\n if timetable_in_use.include?(id)\n return false\n else\n return true\n end\n end",
"def excluir(contato)\n\tputs(\"\\n\\nTem certeza que deseja excluir o contato? S/N: \")\n\tif Validacao.excluirCase(gets.chomp)\n\t\tContatoDAO.new.excluir(contato.id)\n\t\tputs(\"\\nContato Excluido com sucesso!\\n\")\n\tend\nend",
"def destroy\n @area = Area.find(params[:id])\n if @area.children.size == 0 and @area.name != \"localhost\"\n @area.destroy\n flash[:notice] = \"Deleted #{@area.to_s}\" \n else\n flash[:notice] = \"#{@area.to_s} not deleted. It has children or is the localhost node.\" \n end\n\n respond_to do |format|\n #format.html { redirect_to(areas_url) }\n format.html { redirect_to(locations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @usuario = Usuario.find(params[:id])\n \n if @usuario.tipo=='traductor'\n @usuario.destroy\n redirect_to usuarios_path(:tipo=>'traductor')\n else\n @sitio=@usuario.sitio\n @usuario.destroy\n redirect_to usuarios_path(:id=>@sitio) \n end \n end",
"def destroy\n ActiveRecord::Base.transaction do\n @cuenca.status = Status.find(Status::VALUES[:deleted])\n @cuenca.save validate: false\n respond_to do |format|\n format.html { redirect_to cuencas_url, notice: 'La Cuenca se marco como borrada.' }\n format.json { head :no_content }\n end\n end\n end",
"def destroy\n tmp_element_error = @@model.new\n tmp = @@model.find(params[:id])\n if tmp\n unless tmp.destroy\n tmp.errors.full_messages.each do |tmp_error| \n tmp_element_error.errors.add(:base, tmp_error)\n end\n end\n end\n if tmp_element_error.errors.empty? \n flash[:notice] = @@msg_delete.trn\n else\n flash[:errors_destroy] = tmp_element_error\n end\n redirect_to :action => \"list\"\n end",
"def destroy\n if(params[:id].to_i == Organismo::ID_FCEFQyN)\n flash[:error]=\"No se pude eliminar la Facultad de Ciencias Exactas\"\n else\n @organismo = Organismo.find(params[:id])\n begin\n @organismo.destroy\n rescue ActiveRecord::DeleteRestrictionError => e\n flash[:error]=\"No se pudo eliminar porque otros dependen de el\\n(#{e})\"\n end\n end\n respond_to do |format|\n format.html { redirect_to organismos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fornecedor = Fornecedor.find(params[:id])\n @fornecedor.destroy\n \n redirect_to fornecedores_path, notice: 'Fornecedor excluído'\n \n end",
"def destroy\n authorize @contrato\n contrato_numero = @contrato.numero\n contrato_ano = @contrato.ano\n \n if @contrato.destroy\n redirect_to contratos_path, notice: \"O Contrato (#{contrato_numero}/#{contrato_ano}) foi excluído com sucesso!\"\n else\n render :index\n end\n \n end",
"def safe_to_destroy?\n grades.empty?\n end",
"def destroy\n @client.in_trash = @client.in_trash == false\n @client.save\n\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'El cliente se eliminó correctamente.' }\n format.json { head :no_content }\n end\n end"
] |
[
"0.65420526",
"0.65188605",
"0.6476775",
"0.64403194",
"0.64224887",
"0.6373143",
"0.632365",
"0.62232006",
"0.6194863",
"0.6190611",
"0.6156925",
"0.6076415",
"0.60588896",
"0.5997926",
"0.59929645",
"0.59666306",
"0.5931902",
"0.59313625",
"0.5925074",
"0.5871588",
"0.5845483",
"0.58067113",
"0.5806318",
"0.5793865",
"0.57859427",
"0.5777613",
"0.5743401",
"0.57306546",
"0.573057",
"0.57216966",
"0.5708594",
"0.5706372",
"0.56991744",
"0.5691825",
"0.56869966",
"0.5673416",
"0.5668718",
"0.5666886",
"0.56545657",
"0.5647536",
"0.5645169",
"0.5644871",
"0.56428",
"0.5638913",
"0.5638455",
"0.56384116",
"0.56292504",
"0.5629228",
"0.562866",
"0.56226534",
"0.56189644",
"0.5617656",
"0.5612681",
"0.56118166",
"0.560787",
"0.5604752",
"0.5603012",
"0.5599865",
"0.55963874",
"0.5592206",
"0.559043",
"0.5581728",
"0.5572652",
"0.5568295",
"0.5566616",
"0.55630654",
"0.55625814",
"0.5557698",
"0.555488",
"0.5553416",
"0.55515194",
"0.5550938",
"0.55491996",
"0.5546536",
"0.5546426",
"0.5545548",
"0.55408466",
"0.5536251",
"0.55335855",
"0.5533218",
"0.5532427",
"0.5530278",
"0.5525142",
"0.552027",
"0.55185074",
"0.55184567",
"0.55147594",
"0.55126876",
"0.5502756",
"0.54948795",
"0.549452",
"0.54922885",
"0.5488094",
"0.54858446",
"0.5484494",
"0.54835504",
"0.5481642",
"0.54815394",
"0.548151",
"0.5478847"
] |
0.69417965
|
0
|
si una tarea existe y esta desactualizada la actualiza pero si existe y esta actualizada no lo hace
|
def actualizar(id)
@@encontrada1 = false
@@actualizada = false
array = Tarea.all
array.each do |x|
if x["id"] == id.to_i && x["done"] == true
@@encontrada1 =true
@@actualizada= true
elsif x["id"] == id.to_i && x["done"] == false
Tarea.update(id)
@@encontrada1 = true
end
end
return @@encontrada1,@@actualizada
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def actualizar_extracto_de_cuenta_corriente\n if deleted?\n CuentaCorrienteExtracto.eliminar_movimiento(self.becomes(Boleta), fecha, importe_pendiente * -1)\n else\n if persona_id_changed? && !persona_id_was.nil? # si cambio de cuenta corriente\n old = get_old_boleta\n CuentaCorrienteExtracto.eliminar_movimiento(old.becomes(Boleta), fecha_was, importe_pendiente_was * -1)\n CuentaCorrienteExtracto.crear_o_actualizar_extracto(self.becomes(Boleta), fecha, 0, importe_pendiente)\n else\n CuentaCorrienteExtracto.crear_o_actualizar_extracto(self.becomes(Boleta), fecha, importe_pendiente_was.to_f, importe_pendiente)\n end\n end\n end",
"def almacenar(nombre)\n\t\narray = Tarea.all\n@@existente = false\narray.each{|x| @@existente = true if /#{nombre}/.match(x[\"title\"])}\n\t\nunless @@existente \nTarea.create(\"#{nombre} #{@@usuario}\")\n\nend\n@@existente\nend",
"def rescatar\n self.estado_id = 1 #salida si lo creo, entrada/foliado si lo redirijo\n self.estado_id = 3 if self.trazas.count(:conditions => 'movimiento_id in (2,7,8)') > 0\n if self.origen.externo\n RAILS_DEFAULT_LOGGER.info \"devolviendo de origen externo #{self.origen.to_label} a #{self.documento.buzon}\"\n self.buzon_id = self.documento.buzon_id\n else\n self.buzon_id = self.origen_id\n end\n self.add_traza(current_user.id, 14, current_user.puesto.buzon_id)\n self.save!\n end",
"def actualizar_objetivos\n mes = params[:mes]\n anio = params[:anio] \n @vendedor = Vendedor.find(params[:vendedor][:id])\n cantidad_op = params[:oportunidades]\n cantidad_pm = params[:pruebas_manejo]\n cantidad_v = params[:ventas]\n cantidad_f = params[:financiaciones]\n cantidad_c = params[:calidad] \n tipo_objetivo_id = 7\n objetivo_op = ObjetivoMensual.find_by(mes: mes, anio: anio, vendedor_id: @vendedor.id, tipo_objetivo_id: tipo_objetivo_id)\n if cantidad_op.to_i == 0 and cantidad_pm.to_i == 0 and cantidad_v.to_i == 0 and cantidad_f.to_i == 0 and cantidad_c.to_i == 0\n msj = \"No hay datos para actualizar\"\n else\n msj = 'Se actualizaron los valores de '\n end\n @errores = Hash.new\n if cantidad_op.to_i != 0\n if objetivo_op != nil\n objetivo_op.cantidad_propuesta = cantidad_op\n if objetivo_op.save \n msj += ' Oportunidades '\n else\n @errores[:oportunidades] = objetivo_op.errors.full_messages.first\n end\n else\n objetivo = ObjetivoMensual.new()\n objetivo.mes = mes\n objetivo.anio = anio\n objetivo.vendedor_id = @vendedor.id\n objetivo.punto_venta_id = @vendedor.punto_venta_id\n objetivo.tipo_objetivo_id = tipo_objetivo_id\n objetivo.user_id = current_user.id\n objetivo.cantidad_propuesta = cantidad_op\n if objetivo.save\n msj += ' Oportunidades '\n else\n @errores[:oportunidades] = objetivo.errors.full_messages.first\n end\n end\n end\n tipo_objetivo_id = 4\n objetivo_pm = ObjetivoMensual.find_by(mes: mes, anio: anio, vendedor_id: @vendedor.id, tipo_objetivo_id: tipo_objetivo_id)\n if cantidad_pm.to_i != 0 \n if objetivo_pm != nil\n objetivo_pm.cantidad_propuesta = cantidad_pm\n if objetivo_pm.save\n msj += ' Pruebas de manejo '\n else\n @errores[:pruebas_de_manejo] = objetivo_pm.errors.full_messages.first\n end\n else\n objetivo = ObjetivoMensual.new()\n objetivo.mes = mes\n objetivo.anio = anio\n objetivo.vendedor_id = @vendedor.id\n objetivo.punto_venta_id = @vendedor.punto_venta_id\n objetivo.tipo_objetivo_id = tipo_objetivo_id\n objetivo.user_id = current_user.id\n objetivo.cantidad_propuesta = cantidad_pm\n if objetivo.save\n msj += ' Pruebas de manejo '\n else\n @errores[:pruebas_de_manejo] = objetivo.errors.full_messages.first\n end\n end\n end\n tipo_objetivo_id = 5\n objetivo_v = ObjetivoMensual.find_by(mes: mes, anio: anio, vendedor_id: @vendedor.id, tipo_objetivo_id: tipo_objetivo_id)\n if cantidad_v.to_i != 0 \n if objetivo_v != nil\n objetivo_v.cantidad_propuesta = cantidad_v\n if objetivo_v.save\n msj += ' Ventas '\n else\n @errores[:ventas] = objetivo_v.errors.full_messages.first\n end\n else\n objetivo = ObjetivoMensual.new()\n objetivo.mes = mes\n objetivo.anio = anio\n objetivo.vendedor_id = @vendedor.id\n objetivo.punto_venta_id = @vendedor.punto_venta_id\n objetivo.tipo_objetivo_id = tipo_objetivo_id\n objetivo.user_id = current_user.id\n objetivo.cantidad_propuesta = cantidad_v\n if objetivo.save\n msj += ' Ventas '\n else\n @errores[:ventas] = objetivo.errors.full_messages.first\n end\n end\n end\n tipo_objetivo_id = 8\n objetivo_f = ObjetivoMensual.find_by(mes: mes, anio: anio, vendedor_id: @vendedor.id, tipo_objetivo_id: tipo_objetivo_id)\n if cantidad_f.to_i != 0 \n if objetivo_f != nil\n objetivo_f.cantidad_propuesta = cantidad_f\n if objetivo_f.save\n msj += ' Financiaciones '\n else\n @errores[:financiaciones] = objetivo_f.errors.full_messages.first\n end\n else\n objetivo = ObjetivoMensual.new()\n objetivo.mes = mes\n objetivo.anio = anio\n objetivo.vendedor_id = @vendedor.id\n objetivo.punto_venta_id = @vendedor.punto_venta_id\n objetivo.tipo_objetivo_id = tipo_objetivo_id\n objetivo.user_id = current_user.id\n objetivo.cantidad_propuesta = cantidad_f\n if objetivo.save\n msj += ' Financiaciones '\n else\n @errores[:financiaciones] = objetivo.errors.full_messages.first\n end\n end\n end\n tipo_objetivo_id = 3\n objetivo_c = ObjetivoMensual.find_by(mes: mes, anio: anio, vendedor_id: @vendedor.id, tipo_objetivo_id: tipo_objetivo_id)\n if cantidad_c.to_i != 0 \n if objetivo_c != nil\n objetivo_c.cantidad_propuesta = cantidad_c\n if objetivo_c.save\n msj += ' Calidad '\n else\n @errores[:calidad] = objetivo_c.errors.full_messages.first\n end\n else\n objetivo = ObjetivoMensual.new()\n objetivo.mes = mes\n objetivo.anio = anio\n objetivo.vendedor_id = @vendedor.id\n objetivo.punto_venta_id = @vendedor.punto_venta_id\n objetivo.tipo_objetivo_id = tipo_objetivo_id\n objetivo.user_id = current_user.id\n objetivo.cantidad_propuesta = cantidad_c\n if objetivo.save\n msj += ' Calidad '\n else\n @errores[:calidad] = objetivo.errors.full_messages.first\n end\n end\n end\n\n respond_to do |format|\n if @errores.blank?\n format.html { redirect_to @vendedor, notice: msj }\n format.json { head :no_content }\n else\n @bg_gray = true\n format.html { render :show }\n format.json { render json: @errores, status: :unprocessable_entity }\n end\n end \n end",
"def actualizar\n if toca_actualizar\n actualizar_privado\n end\n end",
"def guarda_fotos_todas\n dame_fotos_todas\n\n if x_foto_principal.present?\n a = adicional ? adicional.reload : Adicional.new(especie_id: id)\n a.foto_principal = x_foto_principal\n\n if a.changed?\n a.save\n reload\n end\n end\n end",
"def update\n\t@lista_de_tarea = ListaDeTarea.find(params[:lista_de_tarea_id])\n @tarea = @lista_de_tarea.tareas.find(params[:id])\n\n \n if @tarea.update_attributes(params[:tarea])\n flash[:notice] = 'La tarea fue modificada satisfacotiramente'\n redirect_to lista_de_tarea_url(@lista_de_tarea)\n else\n render :action => \"edit\" \n end\n end",
"def update\n #if current_user.has_role?(:admin)\n @asunto = Asunto.find(params[:id])\n if pertenece_a_mi_o_subordinados?(current_user,regresa_subordinados(current_user.id), @asunto.persona_turnado_id)\n \n process_file_uploads(@asunto)\n \n \n respond_to do |format|\n Asunto.transaction do \n asunto_old = @asunto.clone\n if @asunto.update_attributes(params[:asunto])\n if (configatron.envia_email)\n if (@asunto.persona_turnado_id != asunto_old.persona_turnado_id)\n UserMailer.deliver_registration_confirmation(current_user.email, \"Asunto actualizado\", \"Se ha actualizado un asunto que necesita de su atencion, por favor verifiquelo. Asunto:\"+@asunto.asunto)\n end\n end\n actualizar_historial(@asunto, asunto_old) \n format.html { redirect_to(@asunto, :notice => 'Asunto was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @asunto.errors, :status => :unprocessable_entity }\n end\n end\n end\n else\n redirect_to(root_path,:notice => 'No se tienen permisos.')\nend \n end",
"def actualiza_atributos_diariodets \n sum_debe = 0\n sum_haber = 0\n sum_debe_sec = 0\n sum_haber_sec = 0\n item_max = 0\n idcuenta_ajuste_dif_cambio = 709 #Catalogo.find_by(id: Catalogo::ID_CTA_AJUSTE_DIF_CAMBIO)\n\n set_datos_segun_conf\n\n if self.origenasiento_id == 1 # si es manual actualiza columnas debe, haber...\n diariodets.each do |child| \n if child.ajuste.blank? or child.ajuste == '0'\n cod_moneda_trasac = Moneda.find_by(id:child.moneda_id).codigo \n child.tcori = self.tc\n child.ajuste = '0' \n if cod_moneda_trasac == Moneda::CODIGO_SYS[:nal]\n child.debe = (child.debeori).round(2) \n child.haber = (child.haberori).round(2) \n child.debesec = (child.debeori/Conta::TCV_CONST).round(2) \n child.habersec = (child.haberori/Conta::TCV_CONST).round(2) \n child.tcsec = child.tcori\n else\n if cod_moneda_trasac == Moneda::CODIGO_SYS[:sec]\n tc_transac = 0\n if Conta::TCV_CONST != child.tcori\n tc_transac = child.tcori\n else\n tc_transac = Conta::TCV_CONST\n end\n child.tcsec = tc_transac\n\n child.debe = (child.debeori*tc_transac).round(2) \n child.haber = (child.haberori*tc_transac).round(2) \n\n child.debesec = (child.debeori).round(2) \n child.habersec = (child.haberori).round(2) \n end #cod_moneda_trasac = Moneda::CODIGO_SYS[:sec]\n end #cod_moneda_trasac = Moneda::CODIGO_SYS[:nal]\n if item_max < child.item\n item_max = child.item\n end \n sum_debe = sum_debe + child.debe\n sum_haber = sum_haber + child.haber\n sum_debe_sec = sum_debe_sec + child.debesec\n sum_haber_sec = sum_haber_sec + child.habersec\n end #if child.ajuste.blank? or child.ajuste == '0'\n end #end diariodets.each do |child|\n\n ###\n ###cuadre global\n if (sum_debe != sum_haber) or (sum_debe_sec != sum_haber_sec)\n ajuste = 0\n ajuste_sec = 0 \n ajuste = sum_debe - sum_haber\n ajuste_sec = sum_debe_sec - sum_haber_sec \n if ajuste != 0 \n if ajuste > 0\n item_max = item_max + 1\n diariodets.build(:item => item_max, :catalogo_id => idcuenta_ajuste_dif_cambio, :tlaux1 => \"0\", :tlaux2 => \"0\", :codtlaux1 => \"\", :codtlaux2 => \"\", :debe => 0, :haber => ajuste, :debesec => 0, :habersec => 0, :debeori => 0, :haberori => ajuste, :tcori => self.tc, :glosa => 'AJUSTE AUTOMATICO POR CUADRE', :esdebito => false, :monto => ajuste, :ajuste => \"1\", :oficina_id => Oficina.id_oficina_nacional, :libauxdet_id => 0, :moneda_id => 1)\n else\n ajuste = ajuste * (-1)\n item_max = item_max + 1\n diariodets.build(:item => item_max, :catalogo_id => idcuenta_ajuste_dif_cambio, :tlaux1 => \"0\", :tlaux2 => \"0\", :codtlaux1 => \"\", :codtlaux2 => \"\", :debe => ajuste, :haber => 0, :debesec => 0, :habersec => 0, :debeori => ajuste, :haberori => 0, :tcori => self.tc, :glosa => 'AJUSTE AUTOMATICO POR CUADRE', :esdebito => false, :monto => ajuste_sec, :ajuste => \"1\", :oficina_id => Oficina.id_oficina_nacional, :libauxdet_id => 0, :moneda_id => 1)\n end#end ajuste > 0\n end# end ajuste != 0 \n if ajuste_sec != 0\n if ajuste_sec > 0\n item_max = item_max + 1\n diariodets.build(:item => item_max, :catalogo_id => idcuenta_ajuste_dif_cambio, :tlaux1 => \"0\", :tlaux2 => \"0\", :codtlaux1 => \"\", :codtlaux2 => \"\", :debe => 0, :haber =>0 , :debesec => 0, :habersec => ajuste_sec, :debeori => 0, :haberori => ajuste_sec, :tcori => self.tc, :glosa => 'AJUSTE AUTOMATICO POR CUADRE', :esdebito => false, :monto => ajuste_sec, :ajuste => \"1\", :oficina_id => Oficina.id_oficina_nacional, :libauxdet_id => 0, :moneda_id => 2)\n else\n ajuste_sec = ajuste_sec * (-1)\n item_max = item_max + 1\n diariodets.build(:item => item_max, :catalogo_id => idcuenta_ajuste_dif_cambio, :tlaux1 => \"0\", :tlaux2 => \"0\", :codtlaux1 => \"\", :codtlaux2 => \"\", :debe => 0, :haber => 0, :debesec => ajuste_sec, :habersec => 0, :debeori => ajuste_sec, :haberori => 0, :tcori => self.tc, :glosa => 'AJUSTE AUTOMATICO POR CUADRE', :esdebito => false, :monto => ajuste_sec, :ajuste => \"1\", :oficina_id => Oficina.id_oficina_nacional, :libauxdet_id => 0, :moneda_id => 2) \n end#end ajuste_sec > 0\n end# end ajuste_sec != 0 \n end #(sum_debe != sum_haber) or (sum_debe_sec != sum_haber_sec)\n end#if self.tipocomprobante_id != 5 # si es automatico no aplica lo siguiente \n end",
"def update\n\t\tauthorize! :update, AsignacionRol\n @asignacion_rol_viejo = AsignacionRol.find(@asignacion_rol.id)\n @asignacion_rol_viejo.esActual=false\n @asignacion_rol_new = AsignacionRol.new\n @asignacion_rol_new.proyecto = @asignacion_rol_viejo.proyecto\n @asignacion_rol_new.rol_id = params[:asignacion_rol][:rol_id]\n @asignacion_rol_new.esActual=true\n @asignacion_rol_new.usuario=@asignacion_rol.usuario\n if unica(@asignacion_rol_new.usuario_id,@asignacion_rol_new.proyecto_id, @asignacion_rol_new.rol_id) == true\n @asignacion_rol_new.save\n\t respond_to do |format|\n\t if @asignacion_rol_viejo.save\n sesion= Sesion.find_by(usuario_id: current_usuario.id, fechaFin: nil)\n Transaccion.create!(\n\t\t descripcion: \"Actualizar asociación rol #{@asignacion_rol.rol.nombre} al usuario #{@asignacion_rol.usuario.nombreUsuario} del proyecto #{@asignacion_rol.proyecto.nombre} : actual = #{ t @asignacion_rol.esActual.to_s}\",\n\t\t sesion_id: sesion.id ,\n\t\t proyecto_id: @asignacion_rol.proyecto.id)\n\t\tformat.html { redirect_to :controller => 'asignacion_roles', :action => 'index', :proyecto_id => @asignacion_rol.proyecto.id \n\t\tflash[:success] = 'Asignacion rol fue actualizado satisfactoriamente.' }\n\t\tformat.json { render :show, status: :ok, location: @asignacion_rol }\n\t else\n\t\tformat.html { render :edit }\n\t\tformat.json { render json: @asignacion_rol.errors, status: :unprocessable_entity }\n\t end\n\t end\n else\n\t respond_to do |format|\n\n\t\t format.html { redirect_to :controller => 'asignacion_roles', :action => 'index', :proyecto_id => @asignacion_rol.proyecto.id\n\t\t flash[:danger] = 'El usuario ya se encuentra asignado' } \n\t end\n end\n end",
"def after_update(trabajo)\n # Si se cambia a estado de finalizado\n if trabajo.finalizado?\n Solicitante.increment_counter(:trabajos_recibidos,trabajo.solicitante_id)\n Proveedor.increment_counter(:trabajos_realizados,trabajo.contratado_id)\n end\n end",
"def chegou_no_destino?(cegonha)\n\n if cegonha.cidade_destino == cegonha.cidade_id && cegonha.estado_destino == cegonha.estado_id\n cegonha.cars.each do |car|\n # protege contra codigo legado antes do historico\n if car.historicos.empty?\n car.historicos.create(:cegonha_id => car.cegonha.id)\n end\n #saiu da cegonha\n car.historicos.last.update_attributes(:data_saida => Time.now, :localizacao_saida => car.cegonha.localizacao)\n # verifica se o carro descarregado chegou no destino ou se vai embarcar em outra cegonha/parceiro (logistica)\n if car.cidade_destino == cegonha.cidade_destino and car.estado_destino == cegonha.estado_destino\n car.ativo = 2\n else\n car.ativo = 6\n end\n car.cegonha = nil\n car.save\n\n end\n ceg_id = cegonha.id\n cegonha = Cegonha.find(ceg_id)\n cegonha.rotas += 1\n cegonha.cidade_origem = nil\n cegonha.cidade_destino = nil\n cegonha.estado_origem = nil\n cegonha.estado_destino = nil\n cegonha.save\n return true\n else\n return false\n end\n end",
"def update\n respond_to do |format|\n\n if @os_tarefa.update(os_tarefa_params)\n #se as situacao da tarefa nao for aceita, altera a ordem_servico_pagamento para null\n if(@os_tarefa.situacao!=OsTarefa.situacoes[0] && @os_tarefa.situacao!=OsTarefa.situacoes[1])\n\n @os_tarefa.ordem_servico_pagamento=nil\n @os_tarefa.save\n end\n\n if @os_tarefa.ordem_servico.id!=nil\n format.html { redirect_to \"/ordem_servicos/\"+@os_tarefa.ordem_servico.id.to_s, notice: 'A Tarefa foi atualizado(a)' }\n format.json { head :no_content }\n else\n format.html { redirect_to @os_tarefa, notice: 'A Tarefa foi atualizado(a)' }\n format.json { render :show, status: :ok, location: @os_tarefa }\n end\n else\n format.html { render :edit }\n format.json { render json: @os_tarefa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def actualizar(identificador, tipo, tamanio, asignacion)\n\t\t@tabla.store(identificador.valor.str, tipo)\n\n\t\tif tamanio != nil then\n\t\t\t@tamanio.store(identificador.valor.str, tamanio)\n\t\tend\n\n\t\tif asignacion != nil then\n\t\t\t@asignacion.store(identificador.valor.str, asignacion)\n\t\tend\n\tend",
"def update\n\n @empresa_registrada = EmpresaRegistrada.find(params[:id])\n\n if params[:activar].nil? # El parametro activar indica que no se esta actualñizando datos sino activando empresa\n\n @empresa_registrada.fecha_ultima_modificacion = Time.now # Se registra la fecha en que se edita la empresa\n \n # DATOS BASICOS EMPRESA SE LLEVAN A MAYUSCULAS\n\n params[:empresa_registrada][:nombre_empresa] = params[:empresa_registrada][:nombre_empresa].upcase if params[:empresa_registrada][:nombre_empresa]\n params[:empresa_registrada][:nombre_comercial] = params[:empresa_registrada][:nombre_comercial].upcase if params[:empresa_registrada][:nombre_comercial]\n params[:empresa_registrada][:direccion_empresa] = params[:empresa_registrada][:direccion_empresa].upcase if params[:empresa_registrada][:direccion_empresa]\n params[:empresa_registrada][:circunscripcion_judicial] = params[:empresa_registrada][:circunscripcion_judicial].upcase if params[:empresa_registrada][:circunscripcion_judicial]\n params[:empresa_registrada][:rep_legal] = params[:empresa_registrada][:rep_legal].upcase if params[:empresa_registrada][:rep_legal]\n params[:empresa_registrada][:cargo_rep_legal] = params[:empresa_registrada][:cargo_rep_legal].upcase if params[:empresa_registrada][:cargo_rep_legal]\n params[:empresa_registrada][:nacionalidad_responsable_legal] = params[:empresa_registrada][:nacionalidad_responsable_legal].upcase if params[:empresa_registrada][:nacionalidad_responsable_legal]\n params[:empresa_registrada][:domicilio_responsable_legal] = params[:empresa_registrada][:domicilio_responsable_legal].upcase if params[:empresa_registrada][:domicilio_responsable_legal]\n\n\n # DATOS EAN SE LLEVAN A MAYUSCULAS\n\n params[:empresa_registrada][:rep_ean] = params[:empresa_registrada][:rep_ean].upcase if params[:empresa_registrada][:rep_ean]\n params[:empresa_registrada][:rep_ean_cargo] = params[:empresa_registrada][:rep_ean_cargo].upcase if params[:empresa_registrada][:rep_ean_cargo]\n params[:empresa_registrada][:galpon_edificio_quinta] = params[:empresa_registrada][:galpon_edificio_quinta].upcase if params[:empresa_registrada][:galpon_edificio_quinta]\n params[:empresa_registrada][:oficina_apartamento] = params[:empresa_registrada][:oficina_apartamento].upcase if params[:empresa_registrada][:oficina_apartamento]\n params[:empresa_registrada][:avenida_calle] = params[:empresa_registrada][:avenida_calle].upcase if params[:empresa_registrada][:avenida_calle]\n params[:empresa_registrada][:urbanizacion_barrio_sector] = params[:empresa_registrada][:urbanizacion_barrio_sector].upcase if params[:empresa_registrada][:urbanizacion_barrio_sector]\n params[:empresa_registrada][:parroquia_ean] = params[:empresa_registrada][:parroquia_ean].upcase if params[:empresa_registrada][:parroquia_ean]\n params[:empresa_registrada][:punto_ref_ean] = params[:empresa_registrada][:punto_ref_ean].upcase if params[:empresa_registrada][:punto_ref_ean]\n\n\n # DATOS CORREO ELECTRONICO Y SINCRONET SE LLEVAN A MAYUSCULAS\n\n params[:empresa_registrada][:rep_edi] = params[:empresa_registrada][:rep_edi].upcase if params[:empresa_registrada][:rep_edi]\n params[:empresa_registrada][:rep_edi_cargo] = params[:empresa_registrada][:rep_edi_cargo].upcase if params[:empresa_registrada][:rep_edi_cargo]\n params[:empresa_registrada][:galpon_edificio_quinta_sincronet] = params[:empresa_registrada][:galpon_edificio_quinta_sincronet].upcase if params[:empresa_registrada][:galpon_edificio_quinta_sincronet]\n params[:empresa_registrada][:piso_numero_sincronet] = params[:empresa_registrada][:piso_numero_sincronet].upcase if params[:empresa_registrada][:piso_numero_sincronet]\n params[:empresa_registrada][:oficina_apartamento_sincronet] = params[:empresa_registrada][:oficina_apartamento_sincronet].upcase if params[:empresa_registrada][:oficina_apartamento_sincronet]\n params[:empresa_registrada][:avenida_calle_sincronet] = params[:empresa_registrada][:avenida_calle_sincronet].upcase if params[:empresa_registrada][:avenida_calle_sincronet]\n params[:empresa_registrada][:urbanizacion_barrio_sector_sincronet] = params[:empresa_registrada][:urbanizacion_barrio_sector_sincronet].upcase if params[:empresa_registrada][:urbanizacion_barrio_sector_sincronet]\n params[:empresa_registrada][:parroquia_edi] = params[:empresa_registrada][:parroquia_edi].upcase if params[:empresa_registrada][:parroquia_edi]\n params[:empresa_registrada][:punto_ref_edi] = params[:empresa_registrada][:punto_ref_edi].upcase if params[:empresa_registrada][:punto_ref_edi]\n\n \n # DATOS RECURSOS SE LLEVAN A MAYUSCULA \n \n params[:empresa_registrada][:rep_recursos] = params[:empresa_registrada][:rep_recursos].upcase if params[:empresa_registrada][:rep_recursos]\n params[:empresa_registrada][:rep_recursos_cargo] = params[:empresa_registrada][:rep_recursos_cargo].upcase if params[:empresa_registrada][:rep_recursos_cargo]\n\n # DATOS MERCADEO SE LLEVAN A MAYUSCULA\n\n params[:empresa_registrada][:rep_mercadeo] = params[:empresa_registrada][:rep_mercadeo].upcase if params[:empresa_registrada][:rep_mercadeo]\n params[:empresa_registrada][:rep_mercadeo_cargo] = params[:empresa_registrada][:rep_mercadeo_cargo].upcase if params[:empresa_registrada][:rep_mercadeo_cargo]\n \n # Se obtienen los numeros completos\n\n params[:empresa_registrada][:contacto_tlf1_completo] = \"(\"+ params[:empresa_registrada][:cod_contacto_tlf1] + \")\" +\" \"+ params[:empresa_registrada][:contacto_tlf1] if params[:empresa_registrada][:cod_contacto_tlf1] != \"\"\n params[:empresa_registrada][:contacto_tlf2_completo] = \"(\"+ params[:empresa_registrada][:cod_contacto_tlf2] + \")\"+ \" \" + params[:empresa_registrada][:contacto_tlf2] if params[:empresa_registrada][:cod_contacto_tlf2] != \"\"\n params[:empresa_registrada][:contacto_tlf3_completo] =\"(\"+ params[:empresa_registrada][:cod_contacto_tlf3] + \")\" +\" \"+ params[:empresa_registrada][:contacto_tlf3] if params[:empresa_registrada][:cod_contacto_tlf3] != \"\"\n params[:empresa_registrada][:contacto_fax_completo] = \"(\"+params[:empresa_registrada][:cod_contacto_fax] + \")\" +\" \"+ params[:empresa_registrada][:contacto_fax] if params[:empresa_registrada][:cod_contacto_fax] != \"\"\n params[:empresa_registrada][:direccion_ean] = params[:empresa_registrada][:tipo_urbanizacion_barrio_sector] + \" \" + params[:empresa_registrada][:urbanizacion_barrio_sector] + \" \" + params[:empresa_registrada][:tipo_avenida_calle] + \" \" + params[:empresa_registrada][:avenida_calle] + \" \" + params[:empresa_registrada][:tipo_galpon_edificio_quinta] + \" \" + params[:empresa_registrada][:galpon_edificio_quinta] + \" \" + params[:empresa_registrada][:tipo_piso_numero] + \" \" + params[:empresa_registrada][:piso_numero] + \" \" + params[:empresa_registrada][:tipo_oficina_apartamento] + \" \" + params[:empresa_registrada][:oficina_apartamento] \n params[:empresa_registrada][:telefono1_ean_completo] = \"(\"+ params[:empresa_registrada][:cod_tlf1_ean] + \")\" +\" \"+ params[:empresa_registrada][:telefono1_ean] if params[:empresa_registrada][:cod_tlf1_ean] != \"\"\n params[:empresa_registrada][:telefono2_ean_completo] = \"(\"+ params[:empresa_registrada][:cod_tlf2_ean] + \")\" +\" \"+ params[:empresa_registrada][:telefono2_ean] if params[:empresa_registrada][:cod_tlf2_ean] != \"\"\n params[:empresa_registrada][:telefono3_ean_completo] = \"(\"+ params[:empresa_registrada][:cod_tlf3_ean] + \")\" +\" \"+ params[:empresa_registrada][:telefono3_ean] if params[:empresa_registrada][:cod_tlf3_ean] != \"\"\n params[:empresa_registrada][:fax_ean_completo] = \"(\"+ params[:empresa_registrada][:cod_fax_ean] + \")\" +\" \"+ params[:empresa_registrada][:fax_ean] if params[:empresa_registrada][:cod_fax_ean] != \"\" \n\n # SE OBTIENE EL RIF COMPLETO\n\n params[:empresa_registrada][:rif_completo] = params[:empresa_registrada][:tipo_rif] + \"-\" + params[:empresa_registrada][:rif]\n\n end\n \n\n respond_to do |format|\n \n if params[:activar] # Si se esta activando la empresa no se aactualiza los datos porque ese usuario no tiene el privilegio\n\n Empresa.activar(@empresa_registrada, params[:empresa_registrada][:prefijo])\n Auditoria.registrar_evento(session[:usuario],\"\", \"Activar\", Time.now, \"EMPRESA ACTIVADA. PREFIJO:#{@empresa_registrada.prefijo}\")\n format.html { redirect_to \"/empresa_registradas?activar_empresa=true\", notice: \"EMPRESA ACTIVADA. PREFIJO #{@empresa_registrada.prefijo} NOMBRE EMPRESA #{@empresa_registrada.nombre_empresa} RIF #{@empresa_registrada.rif_completo}\" and return }\n\n else # Se actualizan los datos de la empresa privilegio asociado a Administracion - VEntas\n\n if @empresa_registrada.update_attributes(params[:empresa_registrada])\n \n Auditoria.registrar_evento(session[:usuario],\"empresa_registradas\", \"Editar\", Time.now, params[:empresa_registrada])\n format.html { redirect_to \"/empresa_registradas\", notice: \"Los datos de la Empresa:#{@empresa_registrada.nombre_empresa} RIF:#{@empresa_registrada.rif_completo} fueron actualizados satisfactoriamente.\" and return}\n \n \n else\n format.html { render action: \"edit\" }\n \n end\n\n end\n\n\n\n end\n end",
"def update\n @tarea = Tarea.find(params[:id])\n\n respond_to do |format|\n if @tarea.update_attributes(params[:tarea])\n flash[:notice] = 'Tarea actualizado correctamente.'\n format.html { redirect_to(@tarea.cargo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tarea.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def pai_modificado\n \tif (self.changed.include? 'pai_id') & (self.pai == nil) \t\t\n \t\tself.errors.add(:pai, \"Não é possível tornar Matriz uma conta Filial\")\n \tend\n \tend",
"def despachar\n self.estado_id = 2 # en ruta\n self.buzon_id = self.destinatario_id\n self.add_traza(current_user.id ,1, current_user.puesto.buzon_id)\n self.recepcion = Time.now\n self.save!\n end",
"def actualiza_atributos_con(hash, estado)\n # Validación de atributos de plaza, estado y rol.\n if hash[:rol_id].blank?\n self.errors.add(:rol, \"Rol no puede ir vacío\")\n elsif Rol.find(hash[:rol_id]).nombre.eql?(\"Encargado\")\n if hash[:plaza_id].blank?\n self.errors.add(:plaza, \"Plaza no puede ir vacía\")\n end\n if estado.blank?\n self.errors.add(:estado, \"Estado no puede ir vacío\")\n end\n end\n \n return false unless self.errors.empty?\n self.update_attributes(hash.merge({:password => \"cablecom_#{hash[:login]}\", :password_confirmation => \"cablecom_#{hash[:login]}\"}))\n end",
"def analizarPago(idPago, idFactura)\n sist = Sistema.new\n pago = JSON.parse(sist.obtenerTransaccion(idPago))\n Rails.logger.debug(\"debug:: Se obtuvo el pago\")\n ## Vemos que el pago exista\n if pago[0] == nil\n return false \n end\n if pago[0][\"param\"] == \"id\"\n return false\n end\n Rails.logger.debug(\"debug:: Pago existe\")\n ## Vemos que la factura exista\n factura = JSON.parse(sist.obtenerFactura(idFactura))\n if factura[0] == nil\n return false \n end\n if factura[0][\"param\"] == \"id\"\n return false\n end \n Rails.logger.debug(\"debug:: Factura existe\")\n\n ## Obtenemos la orden de compra de la factura (asumimos que existe)\n idoc = factura[0][\"oc\"]\n oc = JSON.parse(sist.obtenerOrdenDeCompra(idoc))\n Rails.logger.debug(\"debug:: Orden de Compra obtenida\")\n\n ## Comprobamos que el monto sea el correcto\n if factura[0][\"total\"].to_i != pago[0][\"monto\"].to_i\n return false\n end\n Rails.logger.debug(\"debug:: Monto Correcto\")\n\n ## Comprobamos que seamos el destinatario del pago\n if pago[0][\"destino\"] != sist.idBanco\n return false\n end\n Rails.logger.debug(\"debug:: Destinatario Correcto\")\n\n ## Vemos que ese pago no estuviera ya ingresado\n oc = Oc.find_by(pago: idPago)\n if oc != nil\n return false\n end\n sist.facturaPagada(idFactura)\n Rails.logger.debug(\"debug:: El pago es nuevo, se marcó en el sistema como \")\n\n \n ## Actualizamos la oc\n ocBD = Oc.find_by(oc: idoc)\n \n ## La OC es de otro?\n if ocBD == nil\n return false\n end\n \n ocBD.update(estados: \"Pagada\")\n ocBD.update(pago: idPago)\n Rails.logger.debug(\"debug:: Datos actualizados\")\n \n invent = Inventario.new \n invent.definirVariables\n Thread.new do\n Rails.logger.debug(\"debug:: intentamos despachar\")\n ## Gatillamos el envio desde aqui si es posible?\n res = invent.verSiEnviar(idFactura)\n nOtroGrupo = Grupo.find_by(factura: idFactura)[\"nGrupo\"]\n #url = \"http://localhost:3000/api/despacho/recibir/\" + fact[\"_id\"]\n url = \"http://integra\" + nOtroGrupo.to_s + \".ing.puc.cl/api/despacho/recibir/\" + idFactura\n ans = sist.httpGetRequest(url ,nil)\n Rails.logger.debug(\"debug:: le avisamos al otro grupo\")\n\n\n end\n return true \n end",
"def update\n guardaRelaciones(EspecieCatalogo)\n guardaRelaciones(EspecieRegion)\n guardaRelaciones(NombreRegion)\n guardaRelaciones(NombreRegionBibliografia)\n\n respond_to do |format|\n argumentosRelaciones=especie_params\n argumentosRelaciones.delete(:especies_catalogos_attributes)\n argumentosRelaciones.delete(:especies_regiones_attributes)\n argumentosRelaciones.delete(:nombres_regiones_attributes)\n argumentosRelaciones.delete(:nombres_regiones_bibliografias_attributes)\n\n if @especie.update(argumentosRelaciones) && params[:commit].eql?('Guardar')\n descripcion=\"Actualizó el taxón #{@especie.nombre_cientifico} (#{@especie.id})\"\n bitacora=Bitacora.new(:descripcion => descripcion, :usuario_id => current_usuario.id)\n bitacora.save\n format.html { redirect_to @especie, notice: \"El taxón #{@especie.nombre_cientifico} fue modificado exitosamente.\" }\n format.json { head :no_content }\n elsif @especie.update(argumentosRelaciones) && params[:commit].eql?('Guardar y seguir editando')\n descripcion=\"Actualizó el taxón #{@especie.nombre_cientifico} (#{@especie.id})\"\n bitacora=Bitacora.new(:descripcion => descripcion, :usuario_id => current_usuario.id)\n bitacora.save\n #format.html { render action: 'edit' }\n format.html { redirect_to \"/especies/#{@especie.id}/edit\", notice: \"El taxón #{@especie.nombre_cientifico} fue modificado exitosamente.\" }\n #else\n #format.html { render action: 'edit' }\n #format.json { render json: @especie.errors, status: :unprocessable_entity }\n end\n end\n end",
"def before_update_save(record)\n record.puesto_id = nil\n record.origen_id = record.buzon_id\n record.carpeta_id = nil\n record.add_traza(current_user.id, 8, current_user.puesto.buzon_id)\n if record.documento.digital \n record.despachar\n else\n record.estado_id = 6\n end\n end",
"def update\n respond_to do |format|\n if @tarea.update(tarea_params)\n format.html { redirect_to @tarea, notice: 'La Tarea ha sido modificada correctamente.' }\n format.json { render :show, status: :ok, location: @tarea }\n else\n format.html { render :edit }\n format.json { render json: @tarea.errors, status: :unprocessable_entity }\n end\n end\n end",
"def denuncia (identificador)\n\t\tsaida = false\n\t\tsurvivorAbduzido = Survivor.find(identificador)\n\t\tif survivorAbduzido.flag1 == 0\n\t\t\tsurvivorAbduzido.flag1 = self.id\n\t\t\tsurvivorAbduzido.save\n\t\t\tsaida=true\n\n\t\t\n\t\telsif survivorAbduzido.flag2 == 0&&self.id != survivorAbduzido.flag1\n\t\t\tsurvivorAbduzido.flag2 = self.id\n\t\t\tsurvivorAbduzido.save\n\t\t\tsaida=true\n\n\n\t\telsif survivorAbduzido.flag3 == 0&&self.id != survivorAbduzido.flag1&&self.id != survivorAbduzido.flag2\n\t\t\tsurvivorAbduzido.flag3 = self.id\n\t\t\tsurvivorAbduzido.save\n\t\t\tsaida=true\n\n\t\t\t\n\t\tend\n\t\tsaida\n\tend",
"def update\n\t\traise CanCan::AccessDenied if !DetalleGasto.accessible_by(current_ability, :update).include?(@detalle_gasto)\n respond_to do |format|\n if @detalle_gasto.update(detalle_gasto_params)\n sesion = Sesion.find_by(usuario_id: current_usuario.id, fechaFin: nil)\n Transaccion.create!(descripcion: \"Actualización del detalle gasto #{@detalle_gasto.titulo}, descripcion: #{@detalle_gasto.descripcion}, con monto #{@detalle_gasto.monto}, concepto_gasto: #{@detalle_gasto.concepto_gasto.titulo}, voluntario: #{@detalle_gasto.voluntario.nombre}, comprobante: #{@detalle_gasto.comprobante.numero}\",\n sesion_id: sesion.id, \n proyecto_id: @detalle_gasto.informe_gasto.proyecto.id)\n format.html { redirect_to gestionar_informe_gastos_path(@detalle_gasto.informe_gasto)} #@detalle_gasto, notice: 'Detalle gasto fue actualizado satisfactoriamente.' }\n #format.json { render :show, status: :ok, location: @detalle_gasto }\n else\n format.html { render :edit }\n format.json { render json: @detalle_gasto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def save\n temp = eval(self.class.name.to_s + \".find(\" + self.id.to_s + \")\") unless self.new_record? ## moze to zmienic, zeby nie odwolywac sie dodatkowo do bazy ? ;)\n \n ##DO ZMIANY PO ZAINSTALOWANIU BORTA \n self.edited_by = 33\n #self.edited_by = current_user.id\n self.user_stamp = @user_stamp\n \n wrk1 = self.changed? & !self.new_record?\n wrk2 = super\n\n archiving temp unless !(wrk1 & wrk2)\n \n wrk2\n end",
"def update\n @teste=Reuniao.new(reuniao_params)\n if @reuniao.status ==\"finalizada\" \n redirect_to @reuniao , notice: 'Desculpe mas,reuniao finalizada não pode ser auterada.'\n \n else\n respond_to do |format|\n\n if @reuniao.update(reuniao_params)\n @pautum=Pautum.search(@reuniao.pautum)\n @pautum[0].status=@reuniao.status\n @pautum[0].titulo=@reuniao.titulo\n\n @pautum[0].save\n\n @atum=Atum.search(@reuniao.atum)\n @atum[0].status=@reuniao.status\n @atum[0].save\n format.html { redirect_to @reuniao, notice: 'Reuniao was successfully updated.' }\n format.json { render :show, status: :ok, location: @reuniao }\n else\n format.html { render :edit }\n format.json { render json: @reuniao.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def update\n @nota_destacada = NotaDestacada.find(params[:id])\n\n expire_fragment Time.now.to_date.to_s\n expire_fragment '/ultimo'\n \n respond_to do |format|\n if @nota_destacada.update_attributes(params[:nota_destacada])\n flash[:notice] = 'NotaDestacada se ha actualizado con exito..'\n format.html { redirect_to(admin_nota_destacadas_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @nota_destacada.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @usuario = Usuario.find(params[:id])\n usuario_temp = Usuario.new(params[:usuario])\n \n if !usuario_temp.senha_atual.blank?\n @usuario.atualizar_senha = true\n if @usuario.senha_segura != encrypt(usuario_temp.senha_atual,nil)\n @usuario.errors.add :senha_atual, \"Senha inválida\"\n flash[:error] = \"Senha inválida\"\n render :action => \"edit\"\n return\n end\n @usuario.senha_segura = encrypt(usuario_temp.senha_flag,nil)\n end\n \n if params[:peso_novo]\n if @usuario.peso.nil? || params[:peso_novo].to_f != @usuario.peso.peso\n @usuario.pesos << Peso.new(:usuario=>@usuario,:data=>@usuario.peso.data,:peso=>@usuario.peso.peso) unless (@usuario.peso.nil? || params[:peso_novo].to_f == @usuario.peso.peso)\n # @usuario.peso.create(:peso=>params[:peso_novo],:data=>Date.current,:usuario=>@usuario)\n @usuario.peso = Peso.new(:peso=>params[:peso_novo],:data=>Date.current,:usuario=>@usuario)\n \n end\n end\n #UsuarioMailer.cadastro_ok(@usuario).deliver\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario].reject{|k,v| v.blank?})\n usuario_logged_refresh\n flash[:success] = \"Dados atualizados com sucesso\"\n format.html { redirect_to(@usuario, :notice => 'Usuario was successfully updated.') }\n format.xml { head :ok }\n else\n flash[:error] = \"Erro ao atualizar dados\"\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def actualizar\n \n @puntaje.tipo = params_puntaje[:tipo]\n @puntaje.save\n redirect_to puntajes_path\n end",
"def finalizar\n if (Date.today >= self.fecha_finalizacion.to_date)\n \t self.finalizado = true\n \telse\n \t self.finalizado = false\n end\n self.save\n end",
"def update\n @egreso = Egreso.find(params[:id])\n @total=dinero_actual\n \n if @egreso.update(egreso_params)\n if @egreso.monto>@total\n flash[:warning] = 'El monto de egreso no puede ser mayor al monto actual'\n render action: \"edit\"\n else\n flash[:success] = \"Egreso actualizado exitosamente\"\n redirect_to '/egresos'\n end\n end\n end",
"def completa\n @tarea = Tarea.find(params[:id])\n @tarea.update_attribute :completa, true\n @resp = current_responsable\n @tarea.update_attribute :autor, @resp.nombre\n \n \n if request.xhr?\n render :partial => 'tarea', :locals => {:tarea => @tarea}\n else\n respond_to do |format|\n format.html { redirect_to(tareas_url) }\n format.xml { head :ok }\n end\n end\n end",
"def update\n @egreso_interno = EgresoInterno.find(params[:id])\n @total=dinero_actual\n if @egreso_interno.monto>@total\n flash[:warning] = 'El monto de egreso no puede ser mayor al monto actual'\n render action: \"edit\"\n else\n if @egreso_interno.update(egreso_interno_params)\n flash[:success] = \"Egreso Interno actualizado exitosamente\"\n redirect_to @egreso_interno\n else\n render action: \"edit\"\n end\n end\n end",
"def update\n\t\traise CanCan::AccessDenied if !Postulacion.accessible_by(current_ability, :update).include?(@postulacion)\n respond_to do |format|\n if @postulacion.update(postulacion_params)\n sesion= Sesion.find_by(usuario_id: current_usuario.id, fechaFin: nil)\n Transaccion.create!(\n\t\t descripcion: \"Actualización de la Postulación al proyecto #{@postulacion.proyecto.nombre} del usuario #{@postulacion.usuario.nombreUsuario}: #{@postulacion.previous_changes}\" ,\n\t\t sesion_id: sesion.id ,\n\t\t proyecto_id: @postulacion.proyecto.id)\n format.html { redirect_to @postulacion\nflash[:success] = 'Postulacion fue actualizada satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @postulacion }\n else\n format.html { render :edit }\n format.json { render json: @postulacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def movimentar_capital_before_update\n situacao_anterior = Item.find(self.id).situacao_item\n if situacao_anterior.id == 1 #Pendente\n if self.situacao_item.id == 2 #Pago \n update_capital \n end \n end\n end",
"def update\n\t\tauthorize! :update, TipoPrivilegio\n respond_to do |format|\n if @tipo_privilegio.update(tipo_privilegio_params)\n\t\t\t\t\t\t\t\t\t\tsesion= Sesion.find_by(usuario_id: current_usuario.id, fechaFin: nil)\n\t\t\t\tTransaccion.create!(\n \t\t\t\tdescripcion: \"Actualización del tipo de privilegio: #{@tipo_privilegio.previous_changes}\" ,\n \t\t\t\tsesion_id: sesion.id\n\t\t\t\t)\n format.html { redirect_to @tipo_privilegio\nflash[:success] = 'Tipo privilegio fue actualizado satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @tipo_privilegio }\n else\n format.html { render :edit }\n format.json { render json: @tipo_privilegio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n super\n\n # Cuando un pez encuentra comida\n Pez.each_collision(Comida) do |pez, comida|\n pez.comer\n comida.destroy\n end # each\n\n #Cuando se generan las burbujas\n if (Time.now - @tiempo_burbuja) > 1\n Burbuja.create\n @tiempo_burbuja = Time.now\n end # if\n\n\n\n\n\n # Cuando ha pasado el tiempo necesario, se genera comida\n if (Time.now - @comida_inicio) > @comida_tasa\n Comida.create\n @comida_inicio = Time.now\n end # if\n\n # Cuando un pez encuentra otro pez\n Pez.each_collision(Pez) do |pez1, pez2|\n # print rand(10).to_s + \"Colision: pez1.rep=#{pez1.puede_reproducir?}, pez2.rep=#{pez1.puede_reproducir?}\\n\"\n if pez1.puede_reproducir? && pez2.puede_reproducir? && pez1.get_genero != pez2.get_genero\n pez1.reproducirse\n pez2.reproducirse\n reproducir_veces = $configuracion[2][1].to_i\n pez_vida_tiempo = $configuracion[3][1].to_i\n pez_reproducir_tiempo = $configuracion[6][1].to_i\n Pez.create.definir_parametros2(pez1.get_x, pez2.get_y, rand(2)+1, pez_vida_tiempo, reproducir_veces, pez_reproducir_tiempo)\n end # if\n end # each\n\n # Cuando un tiburon encuentra con un pez\n Tiburon.each_collision(Pez) do |tiburon, pez|\n tiburon.comer_pez(pez)\n pez.destroy\n end # each\n\n # Los peces buscan particulas de comida y pareja al azar\n Pez.each do |pez|\n if pez.get_libre\n # 50 % de probabilidad de ir a buscar comida o buscar pareja\n pareja = rand(2)\n\n contador = 0\n if pareja == 1\n # los peces macho son la segunda mitad, por lo tanto si el pez\n # ... es hembra debe buscar solo los peces de la segunda mitad\n tam_pez = Pez.size / 2\n sumar = pez.get_genero == 1 ? tam_pez : 0\n elegido = rand(tam_pez) + sumar\n Pez.each do |pez2|\n if contador == elegido\n pez.buscar(pez2.get_x, pez2.get_y)\n end # if\n contador += 1\n end # each\n else\n elegido = rand(Comida.size)\n Comida.each do |comida|\n if contador == elegido\n pez.buscar(comida.get_x, comida.get_y)\n end # if\n contador += 1\n end # each\n end #if\n end # if\n\n # El pez tiende a evitar un tiburon al azar\n contador = 0\n elegido = rand(Tiburon.size)\n Tiburon.each do |tiburon|\n if contador == elegido\n pez.evitar(tiburon.get_x, tiburon.get_y)\n end # if\n contador += 1\n end # each\n end # each\n\n # Los tiburones buscan peces al azar\n Tiburon.each do |tiburon|\n contador = 0\n if tiburon.get_libre\n elegido = rand(Pez.size)\n Pez.each do |pez|\n if contador == elegido\n tiburon.buscar(pez.get_x, pez.get_y)\n end # if\n contador += 1\n end # each\n end #if\n end # each\n\n $window.caption = \"FPS: #{$window.fps} - Objetos: #{current_game_state.game_objects.size} - Peces: #{Pez.size} - Tiburones: #{Tiburon.size}\"\n end",
"def atendimento_update\n @agendamento = Agendamento.find(params[:id])\n situacao = TipoSituacao.find(params[:agendamento][:tipo_situacao_id])\n cidadao_id = @agendamento.cidadao.id\n respond_to do |format|\n if ((situacao.id != @agendamento.tipo_situacao_id) && (@agendamento.tipo_situacao.descricao == \"Agendado\"))\n if (situacao.descricao == \"Não Compareceu\")\n prefeitura = Prefeitura.first\n cidadao_faltas = Agendamento.cidadao_faltas(@agendamento.cidadao).periodo(prefeitura.periodo_agendamentos).count + 1\n if (cidadao_faltas >= prefeitura.max_faltas)\n bloqueio = Bloqueio.new(:data_entrada => Date.today,\n :data_expira => prefeitura.dias_bloqueio.days.from_now.to_date,\n :cidadao_id => cidadao_id)\n bloqueio.save!\n end\n end\n\n if (@agendamento.update_attributes(:tipo_situacao_id => situacao.id, :cidadao_id => cidadao_id))\n format.html {redirect_to agendamentos_atendimento_path,\n notice: \"Situação do agendamento atualizada como: #{@agendamento.tipo_situacao.descricao}.\"}\n else\n format.html {redirect_to agendamentos_atendimento_path,\n warning: \"Erro: Situação do agendamento não pode ser atualizada.\"}\n end\n else\n format.html {redirect_to agendamentos_atendimento_path}\n end\n end\n end",
"def update\n begin\n respond_to do |format|\n if params[:chkTarea]\n if params[:chkTarea] != \"-1\"\n params[:task][:tarea_padre] = params[:chkTarea]\n else\n params[:task][:tarea_padre] = nil\n end\n end\n\n if params[:chkFechaCompromiso]\n fecha = DateTime.new(params[:date][:year].to_i, \n params[:date][:month].to_i,\n params[:date][:day].to_i,\n params[:date][:hour].to_i,\n params[:date][:minute].to_i) \n params[:task][:fecha_compromiso] = fecha\n else\n params[:task][:fecha_compromiso] = nil\n end\n\n if @task.capturada? || @task.asignada?\n TasksEmployee.where(task_id: @task.id).destroy_all\n \n if params[:empleado]\n empleados = params[:empleado]\n asignada = false\n\n empleados.each do |empleado|\n task_employee = TasksEmployee.new\n task_employee.task_id = @task.id\n task_employee.employee_id = empleado\n if task_employee.save\n asignada = true \n end\n end\n\n if @task.capturada?\n if asignada\n @task.status = :asignada\n else\n @task.status = :capturada \n end\n end\n else\n if @task.asignada?\n @task.status = :capturada\n end\n # raise ActiveRecord::Rollback, \"No se puede eliminar la asignación\"\n end\n end\n\n if !params[:chkCancelar]\n params[:task][:motivo_cancelacion] = nil\n else\n @task.status = :cancelada\n end\n\n if @task.update(task_params)\n format.html { redirect_to tasks_path, notice: 'Tarea actualizada correctamente' }\n format.json { render :show, status: :ok, location: tasks_path }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n rescue Exception => ex \n redirect_to tasks_path, notice: 'No se actualizó, hubo un problema al actualizar la tarea'\n logger.debug ex\n end\n end",
"def update\n respond_to do |format|\n if @ranchada.update(ranchada_params)\n actualizar_dependencias\n AuditoriaDataAccess.log current_user, Auditoria::MODIFICACION, Auditoria::RANCHADA, @ranchada\n format.html { redirect_to ranchadas_url, notice: I18n.t('common.exito.actualizacion_ranchada') }\n format.json { render :show, status: :ok, location: @ranchada }\n else\n if @ranchada.zone\n @zonas = Zone.where(:area_id => @ranchada.zone.area.id)\n else\n @zonas = Zone.zonas_primer_area\n @ranchada.area_id = @zonas.first.area_id\n @ranchada.zone_id = @zonas.first.id\n end\n\n format.html { render :edit }\n format.json { render json: @ranchada.errors, status: :unprocessable_entity }\n end\n end\n end",
"def actualizar_plan_general(solicitud_id,params,oficina_id)\n\n oficina = Oficina.find(oficina_id)\n logger.debug \"Actualizando Plan general ===============> #{solicitud_id.to_s}\"\n #logger.debug \"PARAMETROS ===============> \" << params.inspect\n\n @errores = ''\n @plan_inversion = PlanInversion.find(:all,:conditions=>\"solicitud_id = #{solicitud_id}\",\n :order =>\"estado_nombre,oficina_nombre,sector_nombre,tipo_item\",\n :include=>[:unidad_medida])\n\n @errores = ''\n\n begin\n\n # Creación del arreglo de los id del plan de inversion\n \n lista_id = Array.new\n params.each do |k,v|\n \n sep = k.split(\"_\")\n \n if sep[0] == 'cantidad' or sep[0] == 'monto'\n \n if v.to_f > 0 \n \n lista_id << sep[1]\n end\n \n end\n \n end\n \n lista_id.uniq!\n \n #Validación de cantidades y montos que se actualizarán en el plan de inversión\n \n @errores = ''\n \n if !lista_id.empty?\n \n lista_id.each do |id|\n \n\n if params[:\"cantidad_#{id}\"].to_f > 0 and params[:\"monto_#{id}\"].to_f == 0\n @errores << \"#{I18n.t('Sistema.Body.Modelos.PlanInversion.Errores.cantidad_mayor_que_cero_costo_no_puede_ser_cero')} #{PlanInversion.find(id).item_nombre}\" << '|'\n\n end\n \n logger.info \"id #{id.to_s})\"\n logger.info \"Params monto #{params[:\"monto_#{id}\"].to_d.to_s} format: #{format_fm(params[:\"monto_#{id}\"])}\"\n logger.info \"Monto plan #{PlanInversion.find(id).costo_maximo.to_s} format: #{PlanInversion.find(id).costo_maximo.to_d.to_s}\"\n if params[:\"monto_#{id}\"].to_d > PlanInversion.find(id).costo_maximo\n\n @errores << \"#{I18n.t('Sistema.Body.Modelos.PlanInversion.Errores.monto_asignado_mayor_que_costo_maximo')} #{PlanInversion.find(id).item_nombre}\" << '|'\n end\n \n end\n else\n @errores << I18n.t('Sistema.Body.Modelos.PlanInversion.Errores.debe_tener_al_menos_un_item_con_cantidad_monto')\n end\n \n if !@errores.empty?\n \n return @errores\n end\n \n #Se crea el arreglo de cantidades y montos para pasarlo a la función\n #que actualiza el plan de inversion\n \n if !params.nil?\n \n items_plan = '{'\n primero = true\n if lista_id.empty?\n items_plan = nil\n end\n if !lista_id.empty?\n lista_id.each { |x| items_plan += ( primero ? '' : ',' ) + '{\"' + x.to_s +\n '\",\"' + params[\"cantidad_#{x}\".to_s] +\n '\",\"' + params[\"monto_#{x}\".to_s] + '\"}'; primero = false }\n end\n hay_items = true\n items_plan += \"}\"\n else\n items_plan = '{'\n items_plan += \"}\"\n hay_items = false\n end\n \n logger.info \"Items Plan: ================> #{items_plan.inspect}\"\n \n PlanInversion.transaction do\n\n #Se invoca la función de actualización del plan de inversión\n \n params = {\n :p_solicitud_id=>solicitud_id,\n :p_items_plan =>items_plan,\n :p_hay_items =>hay_items\n }\n \n ejecutar = execute_sp('actualizar_plan_inversion_costo_variable', params.values_at(\n :p_solicitud_id,\n :p_items_plan,\n :p_hay_items))\n\n #@plan_inversion.each do |plan|\n\n #if params[:\"cantidad_#{plan.id}\"].to_f > 0 and params[:\"monto_#{plan.id}\"].to_f == 0\n\n #@errores << \"Si la cantidad es mayor que cero el costo no puede ser cero #{plan.item_nombre}\" << '|'\n\n #end\n\n #if params[:\"monto_#{plan.id}\"].to_f <= plan.costo_maximo.to_f\n\n ##logger.debug \"CANTIDAD #{plan.id} =======> \" << params[:\"cantidad_#{plan.id}\"].to_s\n #logger.debug \"MONTO #{plan.id} =======> \" << params[:\"monto_#{plan.id}\"].to_f.to_s\n #logger.debug \"MONTO CONFIGURADOR =======> \" << plan.costo_maximo.to_f.to_s\n\n #plan.cantidad = params[:\"cantidad_#{plan.id}\"].to_f\n #plan.costo_real = params[:\"monto_#{plan.id}\"].to_f\n #plan.monto_financiamiento = plan.cantidad.to_f * plan.costo_real.to_f\n #plan.save!\n\n #else\n #logger.debug \"Monto mayor que máximo establecido #{plan.item_nombre}\"\n #@errores << \"Monto asignado mayor que costo máximo en #{plan.item_nombre}\" << '|'\n #end #===> Fin if params[\"monto_\"]\n\n #end\n \n #======================================\n # Actualización/Creación del préstamo\n #======================================\n \n # #Prestamo.transaction do\n\n # @solicitud = Solicitud.find(solicitud_id)\n # @prestamo = Prestamo.find_by_solicitud_id(@solicitud.id)\n # logger.info \"Prestamo Leido ==============> #{@prestamo.inspect}\"\n # @plan_inversion = PlanInversion.find_by_solicitud_id(@solicitud.id)\n\n # #Buscando condiciones de financiamiento\n\n # @condiciones = CondicionesFinanciamiento.find_by_programa_id_and_sector_id_and_sub_sector_id_and_rubro_id(@solicitud.programa_id,\n # @solicitud.sector_id,\n # @solicitud.sub_sector_id,\n # @solicitud.rubro_id)\n # #Buscando tasa beneficiario\n\n # #tasa = Tasa.find_by_tipo_cliente_id(solicitud.cliente.tipo_cliente_id)\n\n # # ----------------------------------------------------------------------\n # # Ajuste para ubicar la tasa segun el subrubro y no por el tipo cliente\n # # Efectuado por Alexander Cioffi 18-04-2012\n # # ----------------------------------------------------------------------\n # tasa = Tasa.find_by_sub_rubro_id(@solicitud.sub_rubro_id)\n # @tasa_valor = TasaValor.find_by_sql(\"Select * from tasa_valor where tasa_id = #{tasa.id} order by id desc LIMIT 1\")\n # @tasa_valor = @tasa_valor[0]\n\n\n # monto_prestamo = PlanInversion.sum(:monto_financiamiento,:conditions=>\"solicitud_id=#{@solicitud.id}\")\n # @plan_inversion = PlanInversion.find(:all, :conditions=>\"solicitud_id = #{@solicitud.id}\",:order =>\"estado_nombre,oficina_nombre,sector_nombre,tipo_item\")\n\n # @solicitud.hectareas_recomendadas = 0.00\n # @solicitud.semovientes_recomendados = 0.00\n\n # if @solicitud.actividad.paquetizado\n\n # @solicitud.hectareas_recomendadas = 0\n # @solicitud.semovientes_recomendados = 0.00\n # else\n # @solicitud.hectareas_recomendadas = 0.00\n # @solicitud.semovientes_recomendados = 0.00\n # end\n\n # @solicitud.semovientes_recomendados = 0.00\n\n # @solicitud.semovientes_recomendados = PlanInversion.sum(:cantidad, :conditions=>\"(partida_nombre like \\'\\%SEMOVIENTES\\%\\' or partida_nombre like \\'\\%TORO REPRODUCTOR\\%\\') and solicitud_id = #{@solicitud.id.to_s}\")\n # if @solicitud.semovientes_recomendados.nil?\n # @solicitud.semovientes_recomendados = 0.00\n # end\n\n # @solicitud.save\n\n # monto_prestamo = PlanInversion.sum(:monto_financiamiento,:conditions=>\"solicitud_id=#{@solicitud.id}\")\n # monto_banco = PlanInversion.sum(:monto_financiamiento, :conditions=>\"solicitud_id=#{@solicitud.id} and tipo_item = 'B'\")\n # monto_insumo = PlanInversion.sum(:monto_financiamiento, :conditions=>\"solicitud_id=#{@solicitud.id} and tipo_item = 'I'\")\n\n # if @prestamo.nil?\n\n # logger.info \"Entro por prestamo nil ===========================>\"\n # @producto = Producto.find_by_programa_id_and_sector_id_and_sub_sector_id(@solicitud.programa_id, @solicitud.sector_id, @solicitud.sub_sector_id)\n\n # prestamo = Prestamo.new(:solicitud=>@solicitud, :producto=>@producto, :oficina=>oficina, :destinatario=>\"E\")\n\n # prestamo.monto_solicitado = monto_prestamo.to_f\n \n # # -----------------------------------------\n # # Calculo del sras\n # # ---------------------rubro---------------\n\n # parametro = ParametroGeneral.find(1)\n # factor_mensual_primer_ano = parametro.porcentaje_sras_primer_ano / 1200\n # factor_mensual_anos_siguen = parametro.porcentaje_sras_anos_subsiguientes / 1200\n\n # plazo_total = prestamo.plazo + prestamo.meses_gracia\n # if plazo_total <= 12\n # sras_primer_ano = (monto_prestamo * factor_mensual_primer_ano) * 12\n # sras_anos_siguen = 0.00\n # end\n\n # if plazo_total > 12\n # sras_primer_ano = (monto_prestamo * factor_mensual_primer_ano) * 12\n # sras_anos_siguen = (monto_prestamo * factor_mensual_anos_siguen) * (plazo_total - 12)\n # end\n\n # sras_total = sras_primer_ano + sras_anos_siguen\n\n # prestamo.monto_sras_primer_ano = sras_primer_ano\n # prestamo.monto_sras_anos_subsiguientes = sras_anos_siguen\n # prestamo.monto_sras_total = sras_total\n\n # # ----------------------------------------------------------------------\n # # Ajuste para ubicar la tasa segun el subrubro y no por el tipo cliente\n # # Efectuado por Alexander Cioffi 18-04-2012\n # # ----------------------------------------------------------------------\n\n # prestamo.tasa_inicial = @tasa_valor.valor\n # prestamo.tasa_vigente = @tasa_valor.valor\n # prestamo.tasa_valor = @tasa_valor.valor\n # prestamo.tasa_referencia_inicial = @tasa_valor.valor\n # prestamo.tasa_id = tasa.id\n\n # prestamo.monto_banco = monto_banco.to_f\n # prestamo.monto_insumos = monto_insumo.to_f\n\n # #-----------------------------------------------------------------\n # # Inicio de la Rutina para ajustar el total gastos en el prestamo\n # # Alexander Cioffi 14/03/2012\n # #-----------------------------------------------------------------\n\n # logger.debug \"Rutina de Gastos al crear el prestamo\"\n # gastos = ProgramaTipoGasto.find_by_programa_id_and_tipo_gasto_id(@solicitud.programa_id, 1)\n # logger.debug \"GASTOS==============> \"<<@gastos.inspect\n\n # total_gasto = 0.00\n # unless (gastos.nil?)\n # if gastos.porcentaje > 0\n # monto = ((prestamo.monto_banco + prestamo.monto_insumos)*(gastos.porcentaje/100))\n # else\n # monto = gastos.monto_fijo\n # end\n # total_gasto = monto\n # end\n # prestamo.monto_gasto_total = total_gasto.to_f\n\n # #-----------------------------------------------------------------\n # # Fin de la Rutina para ajustar el total gastos en el prestamo\n # #-----------------------------------------------------------------\n # #-----------------------------------------------------------------\n # # Inicio de la Rutina para ajustar el monto solicitado en la solicitud\n # # Luis Rojas / Alexander Cioffi 14/03/2012 y 15/03/2012\n # #-----------------------------------------------------------------\n\n # @solicitud.monto_solicitado = prestamo.monto_banco + prestamo.monto_insumos + prestamo.monto_sras_total + prestamo.monto_gasto_total\n # @solicitud.monto_aprobado = @solicitud.monto_solicitado\n # @solicitud.save\n\n # #-----------------------------------------------------------------\n # # Fin de la Rutina para ajustar el monto solicitado en la solicitud\n # #-----------------------------------------------------------------\n\n # prestamo.save\n # logger.info \"Save despues de insert #{prestamo.errors.full_messages.to_s}\"\n\n # if prestamo.errors.size == 0\n # return true\n # else\n # return false\n # end\n\n # else\n # # ----------------------------------------------------------------------\n # # Ajuste para ubicar la tasa segun el subrubro y no por el tipo cliente\n # # Efectuado por Alexander Cioffi 18-04-2012\n # # ----------------------------------------------------------------------\n\n # logger.info \"Entro por else =======> #{@prestamo.inspect}\"\n # @prestamo.tasa_inicial = @tasa_valor.valor\n # @prestamo.tasa_vigente = @tasa_valor.valor\n # @prestamo.tasa_valor = @tasa_valor.valor\n # @prestamo.tasa_referencia_inicial = @tasa_valor.valor\n # @prestamo.tasa_id = tasa.id\n\n\n # # ------------------------------------\n # # Calculo del sras\n # # ------------------------------------\n\n # parametro = ParametroGeneral.find(1)\n # logger.info \"Parametro General =======> #{parametro.inspect}\"\n # logger.info \"Prestamo ================> #{prestamo.inspect}\"\n # factor_mensual_primer_ano = parametro.porcentaje_sras_primer_ano / 1200\n # factor_mensual_anos_siguen = parametro.porcentaje_sras_anos_subsiguientes / 1200\n\n # monto_prestamo = PlanInversion.sum(:monto_financiamiento,:conditions=>\"solicitud_id=#{@solicitud.id}\")\n # monto_banco = PlanInversion.sum(:monto_financiamiento, :conditions=>\"solicitud_id=#{@solicitud.id} and tipo_item = 'B'\")\n # monto_insumo = PlanInversion.sum(:monto_financiamiento, :conditions=>\"solicitud_id=#{@solicitud.id} and tipo_item = 'I'\")\n\n # plazo_total = @prestamo.plazo + @prestamo.meses_gracia\n\n # if plazo_total <= 12\n # sras_primer_ano = (monto_prestamo.to_f * factor_mensual_primer_ano) * 12\n # sras_anos_siguen = 0.00\n # end\n\n # if plazo_total > 12\n # sras_primer_ano = (monto_prestamo.to_f * factor_mensual_primer_ano) * 12\n # sras_anos_siguen = (monto_prestamo.to_f * factor_mensual_anos_siguen) * (plazo_total - 12)\n # end\n\n # sras_total = sras_primer_ano + sras_anos_siguen\n\n # @prestamo.monto_sras_primer_ano = sras_primer_ano\n # @prestamo.monto_sras_anos_subsiguientes = sras_anos_siguen\n # @prestamo.monto_sras_total = sras_total\n # @prestamo.monto_banco = monto_banco.to_f\n # @prestamo.monto_insumos = monto_insumo.to_f\n # @prestamo.monto_solicitado = monto_prestamo.to_f\n\n # #-----------------------------------------------------------------\n # # Inicio de la Rutina para ajustar el total gastos en el prestamo\n # # Alexander Cioffi 14/03/2012\n # #-----------------------------------------------------------------\n\n # #logger.debug \"Rutina de Gastos al modificar el prestamo\"\n # @gastos = ProgramaTipoGasto.find_by_programa_id_and_tipo_gasto_id(@solicitud.programa_id, 1)\n # #logger.debug \"GASTOS==============> \"<<@gastos.inspect\n # total_gasto = 0.00\n\n # unless (@gastos.nil?)\n # if @gastos.porcentaje > 0\n # monto = ((@prestamo.monto_banco + @prestamo.monto_insumos)*(@gastos.porcentaje/100))\n # else\n # monto = @gastos.monto_fijo\n # end\n # total_gasto = monto\n # end\n # @prestamo.monto_gasto_total = total_gasto.to_f\n\n # #-----------------------------------------------------------------\n # # Fin de la Rutina para ajustar el total gastos en el prestamo\n # #-----------------------------------------------------------------\n # #-----------------------------------------------------------------\n # # Inicio de la Rutina para ajustar el monto solicitado en la solicitud\n # # Luis Rojas / Alexander Cioffi 14/03/2012 y 15/03/2012\n # #-----------------------------------------------------------------\n # @solicitud.monto_solicitado = @prestamo.monto_banco + @prestamo.monto_insumos + @prestamo.monto_sras_total + @prestamo.monto_gasto_total\n # @solicitud.monto_aprobado = @solicitud.monto_solicitado\n # @solicitud.save\n\n # #-----------------------------------------------------------------\n # # Fin de la Rutina para ajustar el monto solicitado en la solicitud\n # #-----------------------------------------------------------------\n # @prestamo.save\n # logger.info \"Save despues de actualizacion #{@prestamo.errors.full_messages.to_s}\"\n # if @prestamo.errors.size == 0\n # return true\n # else\n # return false\n # end\n\n # end\n\n #end # ----> Fin Prestamo.transaction do\n \n end #===> Fin PlanInversion.transaction do\n\n rescue => detail\n\n logger.info \"Errorressssssss ====> #{@errores.to_s + detail.message + detail.backtrace.to_s}\"\n return @errores + detail.message\n end\n\n if @errores.empty?\n @errores = true\n end\n return @errores\n end",
"def update\r\n @solicitudlabexa = Solicitudlabexa.find(params[:id])\r\n saveObject(params)\r\n getViewModel\r\n\r\n respond_to do |format|\r\n if @solicitudlabexa.save\r\n CorreoTecnicos::emitesolicitudexamen(@solicitudlabexa,params[:fecha],\"Solicitud cursada por admin\",\"Cambios en \").deliver_later \r\n @solicitudlabexas = Solicitudlabexa.all\r\n format.html { redirect_to :action => \"index\" }\r\n format.xml { head :ok }\r\n else\r\n format.html { render :action => \"edit\"}\r\n format.xml { render :xml => @solicitudlabexa.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\nend",
"def update\n @planificacion = Planificacion.find(params[:id])\n tarea_antigua = @planificacion.tarea\n etapa_antigua = @planificacion.etapa\n fecha_entrega_antigua = @planificacion.fecha_entrega\n total_puntos_antiguo = @planificacion.total_puntos\n descripcion_antigua = @planificacion.descripcion\n\n respond_to do |format|\n if @planificacion.update_attributes(params[:planificacion])\n tarea_nueva = @planificacion.tarea\n etapa_nueva = @planificacion.etapa\n fecha_entrega_nueva = @planificacion.fecha_entrega\n total_puntos_nuevo = @planificacion.total_puntos\n descripcion_nueva = @planificacion.descripcion\n\n format.html { redirect_to @planificacion, notice: 'La planificacion ha sido actualizada con exito.' }\n CustomLogger.info(\"Los datos antes de ser actualizados son: tarea: #{tarea_antigua.inspect}, Etapa: #{etapa_antigua.inspect}, Fecha de Entrega: #{fecha_entrega_antigua.inspect} ,Total de Puntos: #{total_puntos_antiguo.inspect} ,Descripcion: #{descripcion_antigua.inspect} .Los datos actualizados por el usuario: #{current_user.full_name.inspect} son los siguientes: Tarea: #{tarea_nueva.inspect}, Etapa: #{etapa_nueva.inspect}, Fecha de Entrega: #{fecha_entrega_nueva.inspect} ,Total de Puntos: #{total_puntos_nuevo.inspect} ,Descripcion: #{descripcion_nueva.inspect}, #{Time.now}\")\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @planificacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @karteikarte \t= Karteikarte.find(params[:id])\n\n @person \t= Person.find(@karteikarte.person_id)\n @person.update_attributes(params[:karteikarte][:person])\n @person.save\n\n @tier \t\t= Tier.find(@karteikarte.tier_id)\n @tier.update_attributes(params[:karteikarte][:tier])\n if params[:neue_behandlung] == \"true\"\n @tier.behandlungen << Behandlung.new\n end\n @tier.save\n\n @karteikarte.save\n\n\n\n=begin\n\t\t@behandlung = @tier.behandlungen.last # order( 'behandlungsdatum desc' )\n\t\tunless !@behandlung.nil? && @behandlung.diagnose.blank? && @behandlung.laborwerte1.blank? && @behandlung.laborwerte2.blank? &&\n\t\t\t\t\t @behandlung.arzneien.blank? && @behandlung.arzneimittel.blank? && @behandlung.impfungswert_ids.blank? && @behandlung.gewicht_kg.blank?\n\t\t\t@tier.behandlungen << Behandlung.new\n\t\tend\n=end\n render(:action => :edit)\n end",
"def update\n respond_to do |format|\n Compra.transaction do\n if @compra.guardar(compra_params, params[:guardar_si_o_si].present?)\n format.html { redirect_to @compra, notice: t('mensajes.save_success', recurso: 'la compra') }\n format.json { render :show, status: :created, location: @compra }\n else\n @pago = @compra.recibos_detalles.first.recibo if @compra.recibos_detalles.first\n @pago.rebuild_detalles if @pago\n format.html { render :form }\n format.json { render json: @compra.errors, status: :unprocessable_entity }\n end\n end\n end\n\n end",
"def update\n @tareas = Tarea.all\n @tareapositivas = Tarea.where(listo: true)\n respond_to do |format|\n if @tarea.update(tarea_params)\n format.html { redirect_to root_path, notice: 'Tarea was successfully updated.' }\n format.json { render :show, status: :ok, location: @tarea }\n else\n format.html { render :edit }\n format.json { render json: @tarea.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @feuille = validateBelongsToEmploye(Feuille.find(params[:id]))\n \n if (params[:cancel])\n redirect_to(@feuille)\n return;\n end\n \n heures = Feuille.getHeures(@feuille.periode, params[:feuille][:jours])\n heures = @feuille.replaceWithDbHeures(heures)\n if @feuille.heuresValidations(heures)\n @feuille.heures = heures;\n flash[:notice] = 'Feuille de temps mise à jour.'\n backToFeuilleGroupe(@feuille.periode)\n else\n @feuille.jourVar = params[:feuille][:jours]\n render :action => \"edit\"\n end\n end",
"def recibir_auto(usuario)\n if self.estado_id == 2\n traza_creada = Traza.create(:copia_id => self.id, :movimiento_id => 2, :usuario => usuario, :buzon_id => usuario.puesto.buzon_id)\n return false unless traza_creada\n self.estado_id = 3\n return true if self.save \n #si llega aqui, algo malo paso.\n return false\n end\n end",
"def controller_issues_edit_after_save(context={})\r\n issue = context[:issue].reload\r\n if valid_to_allocate(issue) && !issue.estimated_hours\r\n issue.estimated_hours = default_estimated_hours(issue)\r\n issue.save\r\n IssueListener.reallocate!(issue)\r\n elsif valid_to_allocate(issue) && issue.estimated_hours > 0\r\n IssueListener.reallocate!(issue)\r\n end\r\n updateParentTask(issue)\r\n end",
"def update\n buenosFrascos = obtener_frascos_string(params[:id])\n indice = buenosFrascos.index(\"#\", buenosFrascos.index(\"#\", buenosFrascos.index(\"$\"+params[:idFra]+\"#\"))+1)+1\n puts indice\n \n\n if(Integer(params[:noRet]) == 0)\n actualizar = Time.new\n puts actualizar.strftime(\"%Y-%m-%d\")\n actualizar = actualizar.strftime(\"%Y-%m-%d\")\n mensaje = 'Se ha entregado el frasco'\n else\n actualizar = 'NO RETIRO'\n mensaje = 'Se ha cambiado el estado del frasco a NO RETIRADO'\n end\n buenosFrascos.insert(indice,actualizar)\n puts buenosFrascos\n @frasco.frascos = buenosFrascos\n @frasco.saltar_validacion_usuario = true\n @frasco.validar_usuario_nuevo = false\n respond_to do |format|\n if @frasco.save\n format.html { redirect_to frasco_path(params[:id]), notice: mensaje }\n format.json { render :show, status: :ok, location: @frasco }\n else\n format.html { render :show }\n format.json { render json: @frasco.errors, status: :unprocessable_entity }\n end\n end\n puts \"Ando actualizando\"\n end",
"def update\n @errors = []\n @area = Area.find(params[:id])\n \n #Me fijo que haya seleccionado al menos un coordinador válido para el área.\n if !project_leaders_valid?(params[:area][:project_leaders].split(%r{,\\s*})) \n @errors = @errors.concat([\"Debe seleccionar un coordinador válido para el área \" + @area.name])\n end\n \n @area.attributes = params[:area]\n \n if @errors.empty? and @area.valid?\n @area.save\n \n #Actualizo los roles project_leader del área.\n #Primero saco todas los coordinadores que tiene el área. \n User.with_role_in_area('project_leader', @area).each do |user|\n user.has_no_role!(:project_leaders, @area)\n end\n \n #Agrego todos los nuevos project leaders al área. \n set_project_leaders(params[:area][:project_leaders].split(%r{,\\s*}), @area) \n end\n respond_with(@area)\n end",
"def update\n tp = tumor_params\n tp[:tipo_tumor], ad, p = tipo(tp)\n if p == nil\n p=0\n end\n respond_to do |format|\n if @tumor.update(tp)\n format.html { redirect_to @tumor, notice: 'El registro fue actualizado con exito con tipo de tumor => '+tp[:tipo_tumor].capitalize+\n '.<>Arbol de decision:<>'+\n ad+'<>Con un grado de acierto de: '+\n p.to_s+\n ' y un porcentaje de acierto de 83.19%' }\n format.json { render :show, status: :ok, location: @tumor }\n else\n format.html { render :edit }\n format.json { render json: @tumor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @escala = Escala.find(params[:id])\n sequencia = @escala.numero_sequencia.to_i\n sequencia = sequencia + 1\n @escala.numero_sequencia = sequencia\n\n if @escala.data_execucao < Date.today\n\n end\n\n status = @escala.update_attributes(params[:escala])\n\n\n if (@escala.tipo_acao.descricao == 'Alteração') or (@escala.tipo_acao.descricao == 'Remoção')\n agendamentos = Agendamento.where('escala_id = ?',@escala.id)\n agendamentos.each do |agendamento|\n\n #########################################\n #MANDA EMAIL PARA agendamento.cidadao_id#\n #########################################\n\n agendamento.tipo_situacao_id = TipoAcao.where(\"descricao = ?\",\"Alteração\").first.id\n agendamento.save\n end\n\n if (@escala.tipo_acao.descricao == 'Alteração' ) #Se Alteracao, refaz a agenda\n #Cria entradas da tabela agendamento para cada escala\n minutos = @escala.horario_fim_execucao - @escala.horario_inicio_execucao #em segundos\n minutos = minutos / 60\n intervalo = minutos / @escala.numero_atendimentos\n for j in 0..(@escala.numero_atendimentos-1)\n @agendamento = Agendamento.new\n @agendamento.orgao_id = @escala.orgao_id\n @agendamento.escala_id = @escala.id\n @agendamento.tipo_situacao_id = TipoSituacao.where(\"descricao = ?\", \"Vago\").first.id\n @agendamento.horario_inicio_consulta = @escala.horario_inicio_execucao + (j*intervalo*60)\n fim_consulta = j + 1\n @agendamento.horario_fim_consulta = @escala.horario_inicio_execucao + (fim_consulta*intervalo*60)\n @agendamento.save\n end\n end\n end\n\n respond_to do |format|\n if status\n format.html { redirect_to @escala, notice: 'Escala atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @escala.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n completed = false\n @candidato = Candidato.find(params[:id])\n cpf = params[:candidato].delete :cpf\n eleitor = Eleitor.find(params[:candidato][:eleitor_id])\n cargo = Cargo.find(params[:candidato][:candidatura_attributes].delete :cargo_eleicao_id)\n params[:candidato].delete :eleitor_attributes\n\n if \"Presidente\".eql? cargo.nome\n @cargo_eleicao = CargoEleicao.find(:first, conditions: [\"eleicao_id = ? and cargo_id = ? and uf_id is null and municipio_id is null\", eleicao_atual.id, cargo.id])\n elsif [\"Governador\", \"Deputado Federal\", \"Deputado Estadual\", \"Senador\"].include? cargo.nome\n @cargo_eleicao = CargoEleicao.find(:first, conditions: [\"eleicao_id = ? and cargo_id = ? and uf_id = ? and municipio_id is null\", eleicao_atual.id, cargo.id, eleitor.endereco.municipio.uf.id])\n elsif [\"Vereador\", \"Prefeito\", \"Vice-Prefeito\"].include? cargo.nome\n @cargo_eleicao = CargoEleicao.find(:first, conditions: [\"eleicao_id = ? and cargo_id = ? and municipio_id = ?\", eleicao_atual.id, cargo.id, eleitor.endereco.municipio.id])\n end\n\n params[:candidato][:candidatura_attributes][:cargo_eleicao_id] = @cargo_eleicao.id if @cargo_eleicao\n params[:candidato][:candidatura_attributes].delete :candidato_id\n candidatura_attributes = params[:candidato].delete :candidatura_attributes\n\n Candidato.transaction do\n if @candidato.candidatura.update_attributes candidatura_attributes\n puts params[:candidato]\n if @candidato.update_attributes params[:candidato]\n completed = true\n else\n puts @candidato.errors.inspect\n raise ActiveRecord::Rollback\n end\n else\n puts @candidato.candidatura.errors.inspect\n raise ActiveRecord::Rollback\n end\n end\n\n\n if completed\n redirect_to @candidato, notice: 'Candidato atualizado com sucesso!'\n else\n render action: \"edit\"\n end\n end",
"def update\n @conteudo = Conteudo.find(params[:id])\nt=0\n respond_to do |format|\n if @conteudo.update_attributes(params[:conteudo])\n #if @conteudo.validacao == 1\n # @conteudo.validado_por = current_user.login\n # @conteudo.validado_em = Time.now\n # @conteudo.save\n #end\n\n flash[:notice] = 'Operação realizada com sucesso.'\n format.html { redirect_to(@conteudo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @conteudo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n nueva_carv = params[:nodo][:vaca_id]\n nodo_id = params[:nodo][:nodo_id]\n \n nodo = Nodo.where(\"nodo_id = ?\",nodo_id).first\n vaca_ant = Vaca.where(\"nodo_id = ?\",nodo_id).first \n \n vaca_check = Vaca.where(\"caravana = ?\",nueva_carv) \n\n if !vaca_check.blank?\n #flash[:error] = \"ERROR: La Caravana \" + nueva_carv.to_s + \" ya asignada esta en el sistema\"\n #redirect_to edit_nodo_path(:id => 1)\n vaca = vaca_check.first\n else\n vaca = Vaca.create!(caravana: nueva_carv,\n raza: \"Holando\",\n rodeo: 1,\n estado: \"Normal\") \n end\n\n if !vaca_ant.nil? && vaca_ant.caravana.to_i != nueva_carv.to_i\n vaca_ant.nodo_id = 0\n vaca_ant.nodo = nil\n vaca_ant.save\n end\n \n vaca.nodo_id = nodo_id\n vaca.nodo = nodo\n \n if vaca.save \n flash[:success] = \"Collar cambiado\"\n end\n redirect_to vacas_path \n end",
"def update\n \n @teste = Urna.find(@urna.id)\n alterados_log = \"\"\n \n if @urna.update(urna_params)\n \n n1 = false\n n2 = false\n n3 = false\n n4 = false\n n5 = false\n n6 = false\n n7 = false\n n8 = false\n \n if @teste.escola != @urna.escola\n n1 = true\n alterados_log = alterados_log + \" escola: \" + @urna.escola\n end\n if @teste.localidade != @urna.localidade\n n2 = true\n alterados_log = alterados_log + \" localidade: \" + @urna.localidade\n end\n if @teste.eleicao_id != @urna.eleicao_id\n n3 = true\n alterados_log = alterados_log + \" eleicao_id: \" + @urna.eleicao_id.to_s\n end\n if @teste.numero != @urna.numero\n n4 = true\n alterados_log = alterados_log + \" numero: \" + @urna.numero\n end\n if @teste.total_votacao != @urna.total_votacao\n n5 = true\n alterados_log = alterados_log + \" total_votacao: \" + @urna.total_votacao.to_s\n end\n if @teste.finalizada != @urna.finalizada\n n6 = true\n alterados_log = alterados_log + \" finalizada: \" + @urna.finalizada.to_s\n end\n if @teste.secoes != @urna.secoes\n n7 = true\n alterados_log = alterados_log + \" secoes: \" + @urna.secoes\n end\n if @teste.eleitores != @urna.eleitores\n n8 = true\n alterados_log = alterados_log + \" eleitores: \" + @urna.eleitores.to_s\n end\n descricao_log = current_user.name + \" alterou a urna: \" + @urna.id.to_s + \", para as seguintes informações: \" + alterados_log\n \n if n1 or n2 or n3 or n4 or n5 or n6 or n7 or n8\n Log.create!(data_hora: Time.current, descricao: descricao_log)\n end\n \n redirect_to urnas_path, notice: \"A Urna (#{@urna.id} - #{@urna.escola}) foi atualizada com sucesso!\"\n else\n render :edit\n end\n end",
"def actualizarElementosContenido\n\n\n contenido_id = params[:contenido][:id]\n \n # Se borran elementos originales del contenido\n @elementos_asociados = Elemento.find(:all, :conditions => \"contenido_id = #{params[:contenido][:id]}\")\n \n for elemento in @elementos_asociados\n elemento.destroy\n end\n \n\n @elementos = params[:elemento]\n logger.debug(\"Esta es la cantidad de elementos para grabar nuevos: #{@elementos.size()}\" )\n if (!@elementos.nil? && @elementos.size() > 0 )\n \n # Guardando los nuevos elementos\n @elementos.each do |elemento|\n\n campos = elemento[1] # 1 corresponde al hash de campos / 0 es el id del elemento actual\n \n elemento_nuevo = Elemento.new()\n elemento_nuevo.id = campos[:id]\n elemento_nuevo.ubicacion = campos[:ubicacion] \n elemento_nuevo.contenido_id = contenido_id\n elemento_nuevo.valor = campos[:valor]\n elemento_nuevo.tipo_id = campos[:tipo_id]\n \n # Salvo\n elemento_nuevo.save!\n \n end\n end \n end",
"def controller_issues_edit_after_save(context={ })\n if context[:time_entry] && context[:time_entry][:hours].present?\n if(context[:time_entry].user_id == context[:issue].assigned_to_id && context[:time_entry].activity.name[0..2].include?(\"BD\"))\n context[:controller].flash[:warning] = l(:notice_ayty_remember_fill_rest_bd,\n :hours => ( context[:issue].ayty_get_value_by_custom_field_name(\"Tempo Restante BD\",\n context[:issue].ayty_get_value_by_custom_field_name(\"Estimativa BD - hr\", 0)).to_f -\n context[:time_entry][:hours].to_f))\n end\n if(context[:time_entry].user_id == context[:issue].assigned_to_id && context[:time_entry].activity.name[0..2].include?(\"SIS\"))\n context[:controller].flash[:warning] = l(:notice_ayty_remember_fill_rest_sys,\n :hours => ( context[:issue].ayty_get_value_by_custom_field_name(\"Tempo Restante SIS\",\n context[:issue].ayty_get_value_by_custom_field_name(\"Estimativa SIS - hr\", 0)).to_f -\n context[:time_entry][:hours].to_f))\n end\n end\n end",
"def update\n @solicitudlabexa = Solicitudlabexa.find(params[:id])\n\n respond_to do |format|\n\n\n\n if params[:fecha]=~ /[0-3]?[0-9]\\-[0-1]?[0-9]\\-[0-9]{4}/\n nfecha=formato_europeo(params[:fecha])\n else\n nfecha=@solicitudlabexa.fecha\n end\n\n pref=\"\"\n @especiales=Laboratorio.where('especial=?',\"t\").to_a\n for especial in @especiales do\n nombre=especial.ssoo.to_s\n if params[:\"#{nombre}\"].to_s!='in'\n pref+=especial.nombre_lab.to_s+'-'+nombre+'-'+params[:\"#{nombre}\"]+\";\"\n end\n end\n @solicitudlabexa.preferencias=pref\n\n nombrecomp = params[:usuario][:identificador].to_s.split(', ')\n if @solicitudlabexa.update_attributes(:fecha => nfecha, \n :usuario_id => @usuario_actual.id,\n :fechasol => Date.today,\n :horaini => params[:horaini][:comienzo],\n :horafin => params[:horafin][:fin],\n\t\t\t\t\t :curso => params[:nivel].to_s,\n :asignatura_id => params[:asignatura][:id].to_i,\n\t\t\t\t\t :npuestos => params[:npuestos],\n :comentarios => Iconv.conv('ascii//translit//ignore', 'utf-8', params[:comentarios].to_s))\n\n CorreoTecnicos::emitesolicitudexamen(@solicitudlabexa,params[:fecha],\"\",\"Cambios en \").deliver_later \n @solicitudlabexas = Solicitudlabexa.where(\"usuario_id = ?\",@usuario_actual.id).to_a\n @cuenta=@solicitudlabexas.size\n format.html { redirect_to :action => \"index\" }\n format.xml { head :ok }\n else\n format.html { redirect_to :action => \"edit\"}\n format.xml { render :xml => @solicitudlabexa.errors, :status => :unprocessable_entity }\n end\n \n end\n end",
"def update\n flash[:notice] = ''\n params[:missionario][:sacramento_ids] ||= []\n params[:missionario][:existe_telefone_attributes] ||= { }\n\n @missionario = Missionario.find(params[:id])\n\n return unless access_control\n\n cargo = Cargo.find(params[:missionario][:cargo_id])\n if cargo.nivel < @nivelmin\n flash[:notice] = 'Cargo não foi alterado.'\n parms[:missionario][:cargo_id] = @missionario.cargo.id\n end\n\n respond_to do |format|\n if @missionario.update_attributes(params[:missionario])\n coordenacao(params[:missionario][:cargo_id])\n flash[:notice] += 'Missionario was successfully updated.'\n format.html { redirect_to(@missionario) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @missionario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :update, Cargo\n respond_to do |format|\n # if !@cargo.sueldos.where(created_at: Time.now.beginning_of_month..Time.now.end_of_month).empty?\n nuevo = false\n if $quincena == 0\n nuevo = @cargo.sueldos.where(created_at: Time.now.beginning_of_month..(Time.now.beginning_of_month + 14.days)).empty?\n else\n nuevo = @cargo.sueldos.where(created_at: (Time.now.beginning_of_month + 15.days)..Time.now.end_of_month).empty?\n end\n key, value = params[:cargo][:sueldos_attributes].first\n\n if nuevo\n\n viejo = @cargo.sueldos.where(activo: true).last\n\n @cargo.sueldos.update_all(activo: false)\n crear = @cargo.sueldos.new\n crear.monto = params[:cargo][:sueldos_attributes][key][:monto]\n crear.sueldo_integral = params[:cargo][:sueldos_attributes][key][:sueldo_integral]\n\n params[:cargo][:sueldos_attributes][key][:monto] = viejo.monto\n params[:cargo][:sueldos_attributes][key][:sueldo_integral] = viejo.sueldo_integral\n\n end\n if @cargo.update(cargo_params)\n log(\"Se ha actualizado el cargo: #{@lt}\", 1)\n\n format.html { redirect_to @cargo, notice: 'Los datos del cargo fueron actualizados exitosamente.' }\n format.json { render :show, status: :ok, location: @cargo }\n else\n format.html { render :edit }\n format.json { render json: @cargo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n#if params[:site_id]!=nil #si site_id no es nil ... \n@orden_new = params[:viaje][:orden] \n@orden_old = params[:viaje][:orden_old]\n @viaje_old = Viaje.find_by_orden(@orden_new)\n @viaje = Viaje.find(params[:id]) #al que modifico pongo orden que me envian y al viaje_old le pongo el orden del actual\n \n respond_to do |format|\n if (@viaje.update_attributes(:orden => @orden_new) and @viaje_old.update_attributes(:orden => @orden_old))\n # if @viaje.update_attributes(params[:viaje])\n format.html { redirect_to @viaje, notice: 'Viaje was successfully updated. Order Changed--> ' + 'new order: '+@orden_new.to_s}\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @viaje.errors, status: :unprocessable_entity }\n end\n end\n\n \nend",
"def actualizar_intermedio\n quedan = @registro.caracterizacionpersona.where(\n \"respuestafor_id IN (SELECT id \" +\n \"FROM mr519_gen_respuestafor AS rf \" +\n \"JOIN cor1440_gen_caracterizacionpf AS cpf ON \" +\n \"rf.formulario_id=cpf.formulario_id JOIN \" +\n \"cor1440_gen_beneficiariopf AS bpf ON \" +\n \"bpf.proyectofinanciero_id=cpf.proyectofinanciero_id \" +\n \"WHERE bpf.persona_id=?)\",\n @registro.id,\n ).pluck(:id)\n elim = @registro.caracterizacionpersona_ids - quedan\n if elim != []\n Cor1440Gen::Caracterizacionpersona.where(id: elim).delete_all\n end\n true\n end",
"def update\n respond_to do |format|\n if @tarea.update(tarea_params)\n format.html { redirect_to @tarea, notice: 'Tarea was successfully updated.' }\n format.json { render :show, status: :ok, location: @tarea }\n else\n format.html { render :edit }\n format.json { render json: @tarea.errors, status: :unprocessable_entity }\n end\n end\n end",
"def actualizar\n @puntaje = Puntaje.find(params[:id])\n datos_puntaje = params.require(:puntaje).permit(:tipo)\n @puntaje.tipo = datos_puntaje[:tipo]\n @puntaje.save\n redirect_to puntajes_path\n end",
"def update_asignar(control_asignacion)\n if control_asignacion[:usuario_id].nil? || control_asignacion[:usuario_id].empty?\n self.errors.add(:solicitud, I18n.t('Sistema.Body.Modelos.Errores.analista_asignar_es_requerido'))\n unless self.estatus_id == 10002\n if control_asignacion[:observacion].nil? || control_asignacion[:observacion].empty?\n self.errors.add(:solicitud, I18n.t('Sistema.Body.Modelos.Errores.observacion_es_requerido'))\n end\n end\n return false\n end\n unless self.estatus_id == 10002\n if control_asignacion[:observacion].nil? || control_asignacion[:observacion].empty?\n self.errors.add(:solicitud, I18n.t('Sistema.Body.Modelos.Errores.observacion_es_requerido'))\n return false\n end\n end\n\n if self.estatus_id == 10002\n asignar = true\n else\n asignar = false\n end\n\n control = ControlAsignacion.new(control_asignacion)\n control.solicitud_id = self.id\n control.fecha = Time.now\n control.asignacion = asignar\n control.unidad = 'C'\n control.save\n usuario = Usuario.find(control.usuario_id)\n self.usuario_pre_evaluacion = usuario.nombre_usuario\n self.save\n return true\n\n end",
"def actualizar_estado\n last_accion = accions.first\n self.estado = case last_accion.resultado\n when \"Sigue\" then \"En progreso\"\n when \"Posterga\" then \"En progreso\"\n when \"Cancela\" then \"Perdido\"\n when \"Contrata\" then \"Ganado\"\n end\n self.save\n end",
"def update_completed? ; false ; end",
"def resale\n\n end",
"def realizar_cuestionario_conflicto\n @paciente = Paciente.find(params[:id])\n @accionPerfilamiento = \"Cuestionario por Conflicto\"\n end",
"def update\n @puntaje = Puntaje.find(params[:id])\n puntaje_antiguo = @puntaje.puntaje\n descripcion_antigua = @puntaje.descripcion\n\n respond_to do |format|\n if @puntaje.update_attributes(params[:puntaje])\n puntaje_nuevo = @puntaje.puntaje\n descripcion_nuevo = @puntaje.descripcion\n\n CustomLogger.info(\"Los datos antes de actualizar son: Puntaje: #{puntaje_antiguo.to_i.inspect} con la descripcion: #{descripcion_antigua.inspect} .Los datos actualizados por el usuario #{current_user.full_name.inspect} son el nuevo puntaje: #{puntaje_nuevo.to_i.inspect} con la descripcion: #{descripcion_nuevo.inspect} ,#{Time.now}\")\n format.html { redirect_to @puntaje, notice: 'El puntaje ha sido actualizado con exito. ' }\n format.json { head :no_content }\n else\n atributos\n format.html { render action: \"edit\" }\n format.json { render json: @puntaje.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\tfalse\n\tend",
"def update_area2_to_scraping_complete(prefecture, area1, area2)\r\n update_columns_of_table_with_eq_condition(:area2s, { scraping_completed: true }, { area2: area2 })\r\n end",
"def update\n f_inicio_vieja = @contrato.fecha_inicio\n f_fin_vieja = @contrato.fecha_fin\n respond_to do |format|\n if @contrato.update(contrato_params)\n f_inicio_nueva = @contrato.fecha_inicio\n f_fin_nueva = @contrato.fecha_fin\n if f_inicio_nueva < f_inicio_vieja\n @contrato.anadir_conceptosdepago(f_inicio_nueva, f_inicio_vieja)\n elsif f_fin_nueva > f_fin_vieja\n @contrato.anadir_conceptosdepago(f_fin_vieja, f_fin_nueva)\n end\n format.html { redirect_to @contrato, notice: 'Contrato fue actualizado exitosamente.' }\n format.json { render :show, status: :ok, location: @contrato }\n else\n format.html { render :edit }\n format.json { render json: @contrato.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit_missing\n @punch.arrival and @punch.departure and raise \"Nulla da inserire\"\n end",
"def update\n coligacao_partido = params[:coligacao].delete :coligacao_partido\n cargo_eleicao = params[:coligacao].delete :cargo_eleicao\n\n if cargo_eleicao[:municipio_id]\n @cargo_eleicao = CargoEleicao.find(:first, conditions: [\"eleicao_id = ? and cargo_id = ? and municipio_id = ?\", cargo_eleicao[:eleicao_id], cargo_eleicao[:cargo_id], cargo_eleicao[:municipio_id]])\n elsif cargo_eleicao[:uf_id]\n @cargo_eleicao = CargoEleicao.find(:first, conditions: [\"eleicao_id = ? and cargo_id = ? and uf_id = ?\", cargo_eleicao[:eleicao_id], cargo_eleicao[:cargo_id], cargo_eleicao[:uf_id]])\n else\n @cargo_eleicao = CargoEleicao.find(:first, conditions: [\"eleicao_id = ? and cargo_id = ?\", cargo_eleicao[:eleicao_id], cargo_eleicao[:cargo_id]]) unless @cargo_eleicao\n end\n\n @coligacao = Coligacao.find(params[:id])\n @coligacao.cargo_eleicao = nil\n\n if @cargo_eleicao\n @coligacao.cargo_eleicao = @cargo_eleicao\n end\n\n Coligacao.transaction do\n if @coligacao.update_attributes(params[:coligacao])\n redirect_to @coligacao, notice: 'Coligção atualizada com sucesso!'\n else\n ActiveRecord::Rollback\n render action: \"edit\"\n end\n end\n end",
"def set_nota_temporal\n @nota_temporal = NotaTemporal.find(params[:id])\n @user = current_user\n if @nota_temporal.dependencia_id != @user.dependencia_id\n flash[:error] = \"No puede acceder a esta nota\"\n redirect_to :log_in # halts request cycle\n end\n end",
"def descontar_medicamentos\n\t \tself.medicamento.cantidad -= self.cantidad\n\t \tself.medicamento.save\n\t end",
"def update\n # Evitar que se cambie el estado si todos los precios son 0\n precios_actualizados = false\n pedido_cotizacion_params[:pedido_cotizacion_detalles_attributes].each do |d|\n unless precios_actualizados\n precios_actualizados = true if d[1]['costo_unitario'].to_i > 0\n end\n end\n\n if @pedido_cotizacion.estado == PedidosEstados::PENDIENTE && precios_actualizados\n @pedido_cotizacion.estado = PedidosEstados::COTIZADO\n @pedido_cotizacion.fecha_cotizado = DateTime.now\n end\n if @pedido_cotizacion.update(pedido_cotizacion_params)\n CustomLogging.create(item_type: 'PedidoCotizacion', item_id: @pedido_cotizacion.id, event: 'update', whodunnit: current_user.id, object: YAML::dump(@pedido_cotizacion.attributes), created_at: DateTime.now)\n\n flash.notice = \"Se ha actualizado los datos del pedido de cotizacion N˚ #{@pedido_cotizacion.numero}.\"\n index\n else\n flash.alert = \"No se ha actualizado los datos del pedido de cotizacion N˚ #{@pedido_cotizacion.numero}.\"\n end\n end",
"def update\n @ingrediente = Ingrediente.find(params[:id])\n\n if @ingrediente.update_attributes(params[:ingrediente])\n unidadesmedida = Unidadmedida.find(:all)\n etiquetaings = Etiquetaing.find(:all)\n\n for unidad in unidadesmedida\n valor=0\n medida=Unidadmedidaingrediente.find(:first,:conditions => \"ingrediente = \"+@ingrediente.id.to_s+\" AND unidadmedida = \"+unidad.id.to_s)\n if params[\"unidad_\"+unidad.id.to_s]==\"yes\"\n if medida==nil\n medida=Unidadmedidaingrediente.new\n medida.ingrediente=@ingrediente.id\n medida.unidadmedida=unidad.id\n medida.save\n end\n else\n if medida!=nil \n medida.destroy\n end\n end\n end \n end\n redirect_to :back\n end",
"def test_necessary_existence_of_nomen\n @person.nomen = nil\n assert @person.save\n \n end",
"def avanzar_unidad_apoyo_consultoria(usuario,unidad)\n unless self.Estatus.const_id == 'ST0004'\n self.errors.add(:solicitud, I18n.t('Sistema.Body.Modelos.Solicitud.Errores.estatus_no_adecuado'))\n else\n if unidad == 1\n validacion = SolicitudRecaudo.validar_consultoria(self.id)\n unless validacion\n self.errors.add(:solicitud, I18n.t('Sistema.Body.Modelos.Solicitud.Errores.analisis_debe_ser_copletado'))\n return\n end\n self.consultoria = true\n mensaje = I18n.t('Sistema.Body.Modelos.Solicitud.Errores.analisis_legal_solicitud')\n elsif unidad == 2\n validacion = SolicitudAvaluo.validar_avaluo(self.id)\n unless validacion == true\n self.errors.add(:solicitud, validacion)\n return\n end\n self.avaluo = true\n mensaje = I18n.t('Sistema.Body.Modelos.Solicitud.Errores.revision_inspeccion_avaluos')\n elsif unidad == 3\n validacion = SolicitudResguardo.validar_resguardo(self.id)\n unless validacion == true\n self.errors.add(:solicitud, validacion)\n return\n end\n self.resguardo = true\n mensaje = I18n.t('Sistema.Body.Modelos.Solicitud.Errores.revision_resguardo_institucional')\n end\n self.save\n ControlSolicitud.create_new(self.id, self.estatus_id, usuario, I18n.t('Sistema.Body.General.avanzar'), self.estatus_id, mensaje)\n if self.resguardo == true && self.avaluo == true && self.consultoria == true\n estatus_origen_id = self.estatus_id\n configuracion_avance = ConfiguracionAvance.find_by_estatus_origen_id(self.estatus_id)\n self.estatus_id = configuracion_avance.estatus_destino_id\n self.fecha_actual_estatus = Time.now.strftime(\"%Y/%m/%d\")\n self.save\n ControlSolicitud.create_new(self.id, self.estatus_id, usuario, I18n.('Sistema.Body.General.avanzar'), estatus_origen_id, '')\n end\n end\n end",
"def update\n if params[:recursos][:status] == '1'\n @count = count_of_resource\n save_multiples_recursos\n end\n respond_to do |format|\n if @area.update(area_params)\n format.html { redirect_to @area, notice: 'El Área fue modificada éxitosamente.' }\n format.json { render :show, status: :ok, location: @area }\n else\n format.html { render :edit }\n format.json { render json: @area.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n handle_orcamento_update\n end",
"def analise\n unless possui_acesso?()\n return\n end\n @matricula = Matricula.find(params[:id])\n @teste = params[:matricula]\n \n if @matricula.update_attributes(params[:matricula])\n UserMailer.analise_matricula(@matricula).deliver\n if @matricula.parecer == \"Aprovado\"\n @matricula.status = 1\n else\n @matricula.status = -1\n end\n \n @matricula.save\n flash[:notice] = t(:analise_realizada)\n\n \n else \n flash[:erro] = t(:erro_analise)\n end\n redirect_to :back\n end",
"def do_patch_modification_users\n dauto = nil\n autorised = begin\n if dpaie = try_paiement_unan\n dauto = {\n start_time: dpaie[:created_at],\n end_time: dpaie[:created_at] + (365+366).days,\n raison: \"UNANUNSCRIPT\"\n }\n true\n elsif dpaie = try_paiement_abonnement\n dauto = {\n start_time: dpaie[:created_at],\n end_time: dpaie[:created_at] + 365.days,\n raison: \"ABONNEMENT UN AN\"\n }\n true\n elsif icarien_actif?\n dauto = {\n start_time: Time.now.to_i - 10,\n end_time: nil,\n raison: \"ICARIEN ACTIF\"\n }\n true\n else\n false\n end\n end\n\n if autorised && dauto\n table_autorisations.insert(dauto.merge!(user_id: id, created_at: Time.now.to_i, updated_at: Time.now.to_i))\n debug \"USER AUTORISÉ : #{pseudo} (##{id}) : #{dauto.inspect}\"\n reset_autorisations\n end\n return autorised\n end",
"def update\n\n DebugLog('Lancamento - params: ' + params.inspect)\n params[:lancamento][:valor] = params[:lancamento][:valor].gsub('.', '').gsub(',', '.')\n @lancamento = Lancamento.find(params[:id])\n\n @lancamento.category = Category.find_or_create_by_descricao(params[:category]) unless params[:category].blank?\n @lancamento.centrodecusto = Centrodecusto.find_or_create_by_descricao(params[:centrodecusto]) unless params[:centrodecusto].blank?\n\n\n @quitado = params[:quitado]\n @freqParcelas = params[:freqParcelas] unless params[:freqParcelas].blank?\n @numParcelas = Integer(params[:numParcelas]) unless params[:numParcelas].blank?\n\n @freqAgendamentos = params[:freqAgendamentos] unless params[:freqAgendamentos].blank?\n @numAgendamentos = Integer(params[:numAgendamentos]) unless params[:numAgendamentos].blank?\n\n #Validações padrão\n @lancamento.tipo = :receita if @lancamento.tipo.blank?\n @lancamento.valor = 0 if @lancamento.valor.blank?\n\n @numParcelas = 1 if @numParcelas.blank?\n @numAgendamentos = 1 if @numAgendamentos.blank?\n\n @freqParcelas = 'Mensal' if @freqParcelas.blank?\n @freqAgendamentos = 'Mensal' if @freqAgendamentos.blank?\n\n\n if @quitado == 'true'\n @lancamento.status = :quitado\n @lancamento.dataacao = Date.today.strftime('%d-%m-%Y')\n end\n\n #Verifica se o registro ja possui parcela, caso contrário não será permitido parcelamento\n # 2013-05-02: Quando editando o primeiro registro deve ser transformado em um registro parcelado\n\n if @numParcelas > 1 and !@lancamento.has_parcelamento?\n # Cria o registro de parcela\n @parcela = Parcela.new\n @parcela.num_parcelas = @numParcelas\n\n if @parcela.save then\n @lancamento_original = @lancamento.dup\n @lancamento.valor = @lancamento.valor/@numParcelas\n\n @lancamento.descricao = \"#{@lancamento.descricao} - #{@freqParcelas} - (#{1}/#{@numParcelas})\"\n @lancamento.parcela = @parcela\n\n @lancamento.save\n (2..@numParcelas).each do |i|\n @lancamento_parcela = Lancamento.new\n @lancamento_parcela = @lancamento_original.dup\n @lancamento_parcela.valor = @lancamento_original.valor/@numParcelas\n\n @lancamento_parcela.datavencimento = case @freqParcelas\n when 'Semanal' then\n @lancamento_parcela.datavencimento + (i-1).weeks\n when 'Mensal' then\n @lancamento_parcela.datavencimento + (i-1).months\n when 'Semestral' then\n @lancamento_parcela.datavencimento + ((i-1)*6).months\n when 'Anual' then\n @lancamento_parcela.datavencimento + (i-1).years\n else\n @lancamento_parcela.datavencimento\n end\n\n @lancamento_parcela.descricao = \"#{@lancamento_original.descricao} - #{@freqParcelas} - (#{i}/#{@numParcelas})\"\n @lancamento_parcela.parcela = @parcela\n\n @lancamento_parcela.save\n end #do\n end # if @parcela.save\n end # @numParcelas > 1\n\n #Verifica se o registro ja possui agendamento, caso contrário não será permitido agendamento\n if @numAgendamentos > 1 and !@lancamento.has_agendamento?\n # Cria o registro de agendamento\n @agendamento = Agendamento.new\n @agendamento.num_agendamentos = @numAgendamentos\n\n if @agendamento.save\n (2..@numAgendamentos).each do |i|\n @lancamento_agendamento = Lancamento.new\n @lancamento_agendamento = @lancamento.dup\n\n @lancamento_agendamento.datavencimento = case @freqAgendamentos\n when 'Semanal' then\n @lancamento_agendamento.datavencimento + (i-1).weeks\n when 'Mensal' then\n @lancamento_agendamento.datavencimento + (i-1).months\n when 'Semestral' then\n @lancamento_agendamento.datavencimento + ((i-1)*6).months\n when 'Anual' then\n @lancamento_agendamento.datavencimento + (i-1).years\n else\n @lancamento_agendamento.datavencimento\n end\n @lancamento_agendamento.agendamento = @agendamento\n\n @lancamento_agendamento.save\n end #do\n end #@agendamento.save\n end\n\n if (!(@numParcelas > 1 and @lancamento.has_parcelamento?) and !(@numAgendamentos > 1 and @lancamento.has_agendamento?))\n if @lancamento.update_attributes(params[:lancamento])\n flash[:notice] = 'Sucesso - update'\n else\n flash[:notice] = 'Falha ao atualizar o lancamento'\n end\n end\n @lancamentos = Lancamento.unscoped.all\n @lancamento = Lancamento.new\n end",
"def update\n @teste=Pautum.new(pautum_params)\n if @pautum.status ==\"finalizada\"\n redirect_to @pautum , notice: 'Desculpe mas,reuniao finalizada não pode auterar sua pauta.'\n \n\n\n \n elsif @teste.status == \"cancelada\" and @pautum.status== \"Aguardando registro de ata\"\n redirect_to @pautum , notice: 'Desculpe mas,pauta Aguardando registro de ata não pode ser cancelada.'\n \n\n\n\n\n else\n respond_to do |format|\n if @pautum.update(pautum_params)\n format.html { redirect_to @pautum, notice: 'Pautum was successfully updated.' }\n format.json { render :show, status: :ok, location: @pautum }\n else\n format.html { render :edit }\n format.json { render json: @pautum.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def undo_mark_for_destruction\n template_divisions.each { |div| div.reload if div.marked_for_destruction? } if exam_been_uploaded?\n end",
"def actualizar\n #Pasamos el 'id' del registro a actualizar\n @eventos = Evento.find(params[:id])\n @eventos = Evento.where(id: @eventos)\n end",
"def after_commit(mapping)\n if obsoleted?(mapping)\n RpmdiffRun.invalidate_obsolete_runs(mapping.errata)\n end\n end",
"def update\n @ponto = Ponto.find(params[:id])\n @ponto.saida = Time.now\n @ponto.total_trabalhado = ((@ponto.saida.to_i - @ponto.entrada.to_i ) / 60)\n respond_to do |format|\n if @ponto.update_attributes(params[:ponto])\n\n flash[:notice] = 'SAÍDA REALIZADA COM SUCESSO.'\n format.html { redirect_to(@ponto) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ponto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n cour = Cour.find(params[:elefe][:ville_entrainement])\n u = current_user\n #info_ville = params[:elefe][:info_ville].join.to_i\n #params[:elefe][:info_ville] = info_ville\n # CAS DES FICHES EXISTANTES\n if @All_Eleves.exists?(:nom => params[:elefe][:nom], :prenom => params[:elefe][:prenom])\n @fiche_exist = @All_Eleves.find_by(:nom => params[:elefe][:nom], :prenom => params[:elefe][:prenom])\n params[:elefe][:info_ville] = params[:elefe][:info_ville].join(',') if params[:elefe][:info_ville] != nil\n params[:elefe][:prix] = @tarif[params[:elefe][:parentee].to_i] if params[:elefe][:parentee] != nil\n # Fusion de l'élève avec une fiche existante créée à partir des présences (officialisation)\n if !@fiche_exist.date_naissance\n puts \"On update eleve existant\"\n @elefe = @fiche_exist\n cours = @elefe.cours\n if !cours.detect { |b| b.id == cour.id }\n @elefe.cours << cour\n end\n u.eleves << @elefe\n u.commandes << Commande.create(description: 'Affiliation '+params[:elefe][:nom]+' '+params[:elefe][:prenom], montant: params[:elefe][:prix])\n @elefe.commandes << u.commandes.last\n respond_to do |format|\n if @elefe.update(elefe_params)\n format.html { redirect_to @elefe, notice: 'La fiche élève a bien été modifiée.' }\n format.json { render :show, status: :ok, location: @elefe }\n else\n format.html { render :edit }\n format.json { render json: @elefe.errors, status: :unprocessable_entity }\n end\n end\n else\n # Ne peut pas écraser une fiche existante\n redirect_back(fallback_location: :back, alert: 'Il existe déjà un élève inscrit avec le même nom et prénom. Peut-être pourriez-vous entrer un deuxième prénom pour vous différencier ?')\n end\n # CAS CLASSIQUE DE L'INSCRIPTION\n else\n params[:elefe][:info_ville] = params[:elefe][:info_ville].join(',') if params[:elefe][:info_ville] != nil\n params[:elefe][:prix] = @tarif[params[:elefe][:parentee].to_i] if params[:elefe][:parentee] != nil\n @elefe = Elefe.new(elefe_params)\n @elefe.cours << cour\n u.eleves << @elefe\n u.commandes << Commande.create(description: 'Affiliation '+params[:elefe][:nom]+' '+params[:elefe][:prenom], montant: params[:elefe][:prix])\n @elefe.commandes << u.commandes.last\n respond_to do |format|\n if @elefe.save\n format.html { redirect_to @elefe, notice: 'La fiche élève a bien été créée.' }\n format.json { render :show, status: :created, location: @elefe }\n else\n format.html { render :new }\n format.json { render json: @elefe.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def update\n #parametros_autocomplete!(params[:estudiante][:persona])\n @estudiante = Estudiante.find(params[:id])\n \n begin\n @estudiante.persona_id = params[:persona][:id]\n rescue\n end\n\n respond_to do |format|\n if @estudiante.update_attributes(params[:estudiante])\n format.html { redirect_to @estudiante, notice: 'Estudiante actualizado' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @estudiante.errors, status: :unprocessable_entity }\n end\n end\n end",
"def actualizar_extractos_de_mercaderias\n if fecha_changed?\n detalles.each do |d|\n MercaderiaExtracto.crear_o_actualizar_extracto(d, fecha, d.cantidad, d.cantidad)\n end\n end\n end",
"def correctly_update_status\n\t\terrors.add(:base, 'La transaccion no fue exitosa') if self.invalid_status\n\tend",
"def create\n @plan_horario = PlanHorario.new(params[:plan_horario])\n usuario= Usuario.find(params[:plan_horario][:usuario_id])\n plan_horario_anterior=usuario.planes_horarios.last()\n# if plan_horario_anterior\n# plan_horario_anterior.fin=params[:plan_horario][:inicio]\n# plan_horario_anterior.save\n# end\n respond_to do |format|\n if @plan_horario.save\n format.html {\n flash[:notice] = 'Plan Horario creado correctamente.'\n params[:oper].nil? ? redirect_to(@plan_horario.usuario) : render(:text => \"Ok\")\n }\n format.js {actualizar_view}\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @plan_horario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @entrenamiento = Entrenamiento.find(params[:id])\n @entrenamiento.show_or_wait=true\n @entrenamiento.save\n flash[:success] = \"Entrenamiento guardado!\"\n redirect_to entrenamientos_home_path\n end"
] |
[
"0.64145064",
"0.624611",
"0.6233149",
"0.61522454",
"0.6043943",
"0.5963727",
"0.5861259",
"0.58606106",
"0.58526224",
"0.5843798",
"0.5835305",
"0.5811307",
"0.5772033",
"0.57637846",
"0.57327574",
"0.5695957",
"0.5693342",
"0.5688258",
"0.56590956",
"0.56460863",
"0.56210274",
"0.5618407",
"0.56175923",
"0.56085545",
"0.5605603",
"0.55738974",
"0.5560332",
"0.555195",
"0.55305713",
"0.5518063",
"0.55166894",
"0.5515425",
"0.55013466",
"0.5487487",
"0.5483796",
"0.54802954",
"0.5461683",
"0.5459734",
"0.5442515",
"0.5432891",
"0.5428596",
"0.5413048",
"0.54101306",
"0.54041266",
"0.5403579",
"0.53957576",
"0.5392679",
"0.53859526",
"0.53796744",
"0.53762496",
"0.5366144",
"0.5361449",
"0.53552157",
"0.5347536",
"0.53412",
"0.53283507",
"0.5327913",
"0.5323982",
"0.5321245",
"0.53162813",
"0.53103834",
"0.5299662",
"0.5298155",
"0.5298014",
"0.52960384",
"0.5295368",
"0.52940995",
"0.5289667",
"0.5289054",
"0.5288772",
"0.52838314",
"0.52822375",
"0.5281084",
"0.5268244",
"0.52628857",
"0.5258495",
"0.5248171",
"0.52402264",
"0.52376986",
"0.5237012",
"0.5230068",
"0.52253735",
"0.52186465",
"0.52102",
"0.5208321",
"0.5207382",
"0.52005416",
"0.52002084",
"0.5199271",
"0.51947963",
"0.51889527",
"0.51886296",
"0.51884586",
"0.51875186",
"0.5185692",
"0.51837826",
"0.5183347",
"0.51815695",
"0.5181357",
"0.5180621"
] |
0.6222373
|
3
|
Render the error message with a status of 404 and a message letting the user know the resource does not exist.
|
def render_404
render(
json: {
error_messages: ['Resource does not exist'],
error_code: 'NOT_FOUND'
},
status: 404
)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def render_missing\r\n RenderError.new('404')\r\n end",
"def not_found\n render(status: :not_found, json: { errors: [{\n status: '404', code: :not_found, title: 'Not Found'\n }]})\n # render jsonapi: nil, code: 404, title: 'Invalid Path', detail: params[:path], status: :not_found\n end",
"def render_404\n render_error(\"The remote resource was not found\")\n end",
"def not_found\n render status: :not_found\n end",
"def render_404 message=nil\n if message\n render :text => message, :status => 404\n else\n render :file => \"public/404.html\", :status => 404\n end\n end",
"def render_404\n render json: {\n message: '404 Not Found',\n details: exception.error_codes\n }, status: 404\n end",
"def render_record_not_found\n render :template => \"error/404\", :status => 404\n end",
"def not_found\n render(\n json: {\n errors: [{\n type: \"Not Found\"\n }]\n },\n status: :not_found #alias for 404 in rails\n )\n end",
"def render_404(_exception = nil)\n errors = JsonApiServer.errors(\n status: 404,\n title: I18n.t('json_api_server.render_404.title'),\n detail: I18n.t('json_api_server.render_404.detail', name: _i18n_name)\n )\n render json: errors.to_json, status: 404\n end",
"def not_found\n render_error status: :not_found, body: 'page not found'\n end",
"def page_not_found\n render 'shared/http_status', formats: [:html], locals: { code: '404', message: HttpStatusHelper::ERROR_CODE['message']['404'] }, status: 404, layout: false\n end",
"def render_not_found\n\n respond_to do |message|\n \n message.html{ render :template => \"errors/404\", :status => 404 }\n \n end\n\n end",
"def render_not_found(error)\n json_response({ error: { message: error.message } }, :not_found)\n end",
"def response_not_found\n render status: 404,\n json: {\n source: {\n pointer: request.original_url\n },\n errors: [ { message: \"Not Found\" } ]\n }\n end",
"def record_not_found\n render :partial => \"shared/error\", :layout => \"one_box\", :status => 404, :locals => {:error_title => 'No hemos encontrado lo que buscabas', :error_message => 'Puedes haber tecleado mal la dirección o la página puede haber sido movida.'}\n end",
"def not_found\n render :template => \"shared/rescues/not_found\", :status => 404 \n end",
"def no_found(message)\n render json: {\n errors: message,\n status: :no_found\n }, status: 404\n end",
"def respond_with_not_found(exception = nil, error_code = \"not_found\")\n msg = exception ? exception.message : \"Not Found\"\n render partial: \"api/error\", locals: { message: msg, error_code: error_code }, status: 404\n return false\n end",
"def not_found\n\n r = Result::Base.error(\n {\n internal_id: 'ac_1',\n general_error_identifier: 'resource_not_found',\n http_code: GlobalConstant::ErrorCode.not_found\n }\n )\n\n return render_api_response(r)\n\n end",
"def show_not_found\n render_json_error(code: :show_not_found, status: :not_found)\n end",
"def not_found\n\n render_error( :not_found )\n\n end",
"def record_not_found!\n render partial: 'errors/404', status: 404 && return\n end",
"def not_found\n render plain: \"not found\"\n end",
"def render_record_not_found_message\n render json: {error: \"Student not found\"}, status: :not_found\n end",
"def render_404\n render :template => \"errors/404\", :status => :not_found, :layout => false\n end",
"def rescue_not_found\n render nothing: true, status: 404\n end",
"def resource_not_found\n flash.now.alert = \"notifications.document.not_found\"\n @info = { id: params[:id] }\n render \"shared/html/404\" and return\n end",
"def not_found\n render nothing: true, status: 404\n end",
"def render_404(exception = nil)\n @not_found_path = exception.message if exception\n respond_to do |format|\n format.html { render template: 'errors/not_found', layout: 'application', status: 404 }\n format.all { render nothing: true, status: 404 }\n end\n end",
"def not_found\n render :status => 404\n end",
"def return_404_error\n\n render json: { success: false, error: I18n.t('errors.e_404'),\n status_code: 404 }, status: :not_found\n end",
"def not_found\n response_error(code: 404, message: 'Object not found.')\n end",
"def render_404\n render 'web/404', status: 404\n end",
"def not_found(exception)\n render json: { status: \"404\", \"#{exception.message}\": \"page not found\"}\n end",
"def render_404\n raise ActionController::RoutingError.new('Not Found')\n end",
"def not_found\n render :nothing => true, :status => 404\n end",
"def record_not_found\n render :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n end",
"def record_not_found\n render :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n end",
"def record_not_found\n render :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n end",
"def handle_not_found(exception = nil)\n render \"shared/not_found\".freeze, status: 404\n end",
"def render_not_found(exception)\n render :file => 'public/404', :format => :html, :status => :not_found, :layout => nil\n end",
"def render_not_found(exception)\n render :file => 'public/404', :format => :html, :status => :not_found, :layout => nil\n end",
"def show_404\n show_error 'Page Not Found', :not_found\n end",
"def blank; render :plain => \"Not Found.\", :status => 404 end",
"def not_found\n render file: 'public/404', status: 404, formats: [:html]\n end",
"def render_404\n render :text => '404 Error: not found', :status => 404 \n end",
"def return_not_found\n return_error(error_code: 404, message: 'Not Found')\n end",
"def record_not_found\n render json: {error: I18n.t('errors.not_found')}.to_json, status: 404\n end",
"def render_404(exception=nil)\n if exception\n logger.error \"Rendering 404 with exception: #{exception.message}\"\n logger.error exception.backtrace.join(\"\\n\")\n end\n breadcrumbs.clear\n @error = [404, 'Not Found']\n render status: 404, template: 'errors/default.html'\n end",
"def respond_resource_not_found(path)\n log(\"#{path} Not Found\")\n make_response(nil, false, 404, \"Not Found\")\n end",
"def not_found\n res = {\n error: 'ost_page_not_found',\n error_display_text: 'Page not found',\n http_code: GlobalConstant::ErrorCode.not_found\n }\n @response = Result::Base.error(res)\n render_error_response_for(@response)\n end",
"def not_found\n res = {\n error: 'ost_page_not_found',\n error_display_text: 'Page not found',\n http_code: GlobalConstant::ErrorCode.not_found\n }\n @response = Result::Base.error(res)\n render_error_response_for(@response)\n end",
"def not_found\n res = {\n error: 'ost_page_not_found',\n error_display_text: 'Page not found',\n http_code: GlobalConstant::ErrorCode.not_found\n }\n @response = Result::Base.error(res)\n render_error_response_for(@response)\n end",
"def record_not_found\n render :file => File.join(::Rails.root.to_s, 'public', '404.html'), :status => 404\n end",
"def record_not_found\n \t\trender :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n \tend",
"def render_missing_page\n render :template => \"error/404\", :status => 404\n end",
"def not_found\n raise ActionController::RoutingError.new('Not Found')\n rescue\n render_404\n end",
"def not_found\n status 404\n body \"not found\\n\"\n end",
"def not_found\n status 404\n body \"not found\\n\"\n end",
"def not_found\n status 404\n body \"not found\\n\"\n end",
"def render_404\n render_optional_error_file(404)\n end",
"def render_figgy_404 # rubocop:disable Naming/VariableNumber\n respond_to do |format|\n format.html { render \"errors/not_found\", status: :not_found }\n format.json { head :not_found }\n end\n end",
"def record_not_found\n render file: \"#{Rails.root}/public/404.html\", layout: false, status: :not_found\n end",
"def not_found\n \trender file: \"#{Rails.root}/public/404.html\", layout: true, status: 404\n end",
"def not_found\n respond_with 404\n end",
"def not_found\n logger.error \"404 from #{request.referer}\"\n render :template => 'errors/404', :status => 404\n end",
"def render_404\n render template: '/shared/record_not_found', layout: false, status: :not_found\n end",
"def not_found(message = t('messages.generics.errors.find'))\n error(message, 404)\n end",
"def not_found(exception)\n render json: { error: exception.message }, status: :not_found\n end",
"def record_not_found\n render :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n end",
"def record_not_found\n render :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n end",
"def record_not_found\n render :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n end",
"def record_not_found\n render :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n end",
"def record_not_found\n render :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n end",
"def record_not_found\n render :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n end",
"def record_not_found\n render :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n end",
"def not_found\n render file: \"#{Rails.root}/public/404\", layout: true, status: :not_found\n end",
"def record_not_found\n render json: {\n error: 'Record not found.'\n }, status: :not_found\n end",
"def record_not_found\n render json: \"Record not found\", status: 404\n end",
"def error_404\n error_layout 404, '404 Not Found', %[\n <p>\n The requested URL <code>#{h(request.REQUEST_URI)}</code> was not\n found on this server.\n </p>\n ]\n end",
"def not_found\n render json: { error: { message: 'There was nothing found at this address.' }}, status: :not_found\n end",
"def error_404\n # The default router already logs things, so we don't need to do more.\n # You can do something like this to log more information, but be sure\n # to escape attacker data to counter log forging:\n # logger.info 'Page not found'\n render(\n template: 'static_pages/error_404',\n formats: [:html], layout: false,\n status: :not_found\n )\n end",
"def render_404\n render \"404\", :status => 404\n end",
"def rescue_not_found\n render \"#{Rails.root}/public/404.html\", status: 404\n end",
"def rescue_not_found\n render \"#{Rails.root}/public/404.html\", status: 404\n end",
"def not_found\n render file: 'public/404.html', status: :not_found, layout: false\n end",
"def error_404\n render 'error/error404'\n end",
"def render_not_found exception\n\n #logger.info\"==========error 404=========\"\n #Rails.logger.error(exception)\n #render :template => \"/errors/404.html.erb\", :status => 404\n @not_found_path = exception.message\n respond_to do |format|\n format.html { render template: 'errors/error_404', status: 404, layout:false }\n format.all { render nothing: true, status: 404 }\n end\n log_exception_handler(exception)\n end",
"def record_not_found\n render json: { error: { message: 'Record not found.' }}, status: :not_found\n end",
"def render_destroy_error\n render json: @resource, status: :not_found\n end",
"def record_not_found\n render file: 'public/404.zh-TW.html', stats: :not_found\n end",
"def render_404(error)\n @error_message = error\n logger.error error.backtrace if Rails.env.development?\n render template: \"static_pages/error\", status: 404\n end",
"def error_404\n if !request.xhr?\n render :template => \"errors/404\", :status => \"404 Error\"\n else\n respond_to do |format|\n format.json {render :json => {\n :error => \"404\",\n }, :status => \"404\"}\n end\n end\n end",
"def status_not_found\n @status = 404\n @e.error 'The requested page does not exist.', 404\n throw :exit\n end",
"def render_404(exception = nil)\n @not_found_path = exception.message if exception\n if !signed_in?\n #gflash error: \"#{exception}\"\n redirect_to signin_path, flash: { error: 'You must first sign in or sign up.' }\n else\n respond_to do |format|\n format.html { render template: 'errors/not_found', layout: 'application', status: 404 }\n format.all { render nothing: true, status: 404 }\n end\n end\n end",
"def halt_not_found(exception)\n halt 404, json({ message: exception.reason })\n end",
"def record_not_found_message\n resource_name&.present? ? I18n.t(:x_not_found, name: resource_name&.singularize&.titleize) : I18n.t(:not_found)\n end",
"def render_not_found(type, id, option='id')\n payload = { errors: { general: [\"Could not find #{type} with '#{option}'=#{id}\"] } }\n render json: payload, status: 404\n end",
"def render_not_found\n\t\tflash[:notice] = 'The object you tried to access does not exist!'\n\t\tredirect_to root_path\n\tend",
"def not_found\n \trender file: \"#{Rails.root}/public/404.html\", status: 404\n end"
] |
[
"0.8218796",
"0.81986064",
"0.8143563",
"0.8131394",
"0.8115979",
"0.8108247",
"0.8099551",
"0.8097435",
"0.80966157",
"0.80960447",
"0.8017813",
"0.7997156",
"0.79967624",
"0.7992711",
"0.7984181",
"0.7970211",
"0.7950132",
"0.7933182",
"0.7915035",
"0.7908608",
"0.78991777",
"0.7895982",
"0.7869977",
"0.7860174",
"0.7840407",
"0.78403896",
"0.78288764",
"0.7823101",
"0.78135717",
"0.78100806",
"0.78076524",
"0.7798731",
"0.77667207",
"0.7763499",
"0.77458894",
"0.77453196",
"0.77406746",
"0.77406746",
"0.77406746",
"0.7740329",
"0.77390766",
"0.77390766",
"0.7732327",
"0.77322775",
"0.7729566",
"0.7726031",
"0.7725759",
"0.7718981",
"0.7712779",
"0.77040434",
"0.7688767",
"0.7688767",
"0.7688767",
"0.7686765",
"0.7670217",
"0.7665219",
"0.7648106",
"0.7645699",
"0.7645699",
"0.7645699",
"0.76420796",
"0.7624799",
"0.7617524",
"0.7609405",
"0.76080924",
"0.76062334",
"0.7604991",
"0.7585154",
"0.75816524",
"0.75799733",
"0.75799733",
"0.75799733",
"0.75799733",
"0.75799733",
"0.75799733",
"0.75799733",
"0.75751716",
"0.7567238",
"0.75658154",
"0.75586444",
"0.7546524",
"0.75426435",
"0.7542311",
"0.75311637",
"0.75311637",
"0.7528419",
"0.7525299",
"0.75095063",
"0.7508116",
"0.750014",
"0.7491944",
"0.74784577",
"0.74739236",
"0.7471871",
"0.7462662",
"0.7455113",
"0.7452683",
"0.7452655",
"0.7441399",
"0.7435499"
] |
0.8725738
|
0
|
points are 2d with as in [x,y] example invocation: closest_pair([[2,3], [1,4], [3,5], [2,2]]) approach: brute force complexity: O(nn)
|
def closest_pair1(points)
min_distance = Float::MAX
best_pair = nil
(0...points.length).each do |i|
(i...points.length).each do |j|
if i != j
curr_distance = distance1(points[i], points[j])
if curr_distance < min_distance
min_distance = curr_distance
best_pair = [points[i], points[j]]
end
end
end
end
best_pair
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def main(points) # array with all the points\n #copy of the array by an especific cordinate\n #nlogn\n # This is a primitive, aka operations that are costless compared to the\n # total complexity we are aming for\n px = sort_by_cordinate(points, 0)\n py = sort_by_cordinate(points, 1)\n\n result = closest_pair(px, py)\nend",
"def find_closest_pair(pairs)\n zz = {:x => 0, :y => 0}\n distances_from_zz = pairs.map { |p| {:distance => distance(p, zz), :point => p} } # O(n)\n cloest_pair = distances_from_zz.sort { |p1, p2|\n dist = abs(p1[:distance] - p2[:distance])\n puts dist\n dist\n }.take(2)\n cloest_pair.map { |p| \"#{p[:point][:x]}, #{p[:point][:y]} -- distance: #{p[:distance]}\" }\nend",
"def _closest_pair(px, py)\n nx, ny = px.length, py.length\n return [px[0], py[0]] if nx == 1 and ny == 1\n return best([px[0], px[1]], [py[0], py[1]]) if nx == 2 and ny == 2\n qx, rx, qy, ry = px[0...nx/2], px[nx/2...nx], py[0...ny/2], py[ny/2...ny]\n qpair = _closest_pair(qx, qy)\n rpair = _closest_pair(rx, ry)\n min_dist = [distance(qpair[0], qpair[1]), distance(rpair[0], rpair[1])].min\n split_pair = closest_split_pair(px, py, min_dist)\n best(qpair, rpair, split_pair)\nend",
"def closest_pair vector_array\n\tby_x = vector_array.sort_by { |e| e.x }\n\tby_y = vector_array.sort_by { |e| e.y }\n\n\tarray, best = recursive_split by_x\n\tp \"Da #{best.distance}\"\nend",
"def closest_points(points)\n distances = points.map { |point| [manhattan_distance(point), point] }\n distance_hash = Hash[distances.group_by(&:first).map { |k, a| [k, a.map(&:last)] }]\n # p distance_hash\n # p distance_hash.keys.min\n distance_hash[distance_hash.keys.min]\n end",
"def closest_neighbors(num_neighbors, point, data)\n data.keys.sort { |a,b| euclidean_distance(a, point) <=> euclidean_distance(b, point) }.take(num_neighbors)\nend",
"def k_closest(points, k)\n arr = points.map { |point| [euclidean_distance(point, [0, 0]), point] }.sort\n\n res = []\n k.times { res << arr.delete_at(0)[1] }\n res\nend",
"def k_closest_points(arr, k)\n temp = []\n \n arr[0..k-1].each do |coords|\n temp << Math.sqrt((coords[0] ** 2 + coords[1] ** 2))\n end\n\n arr[k..-1].each do |coords|\n distance = Math.sqrt((coords[0] ** 2 + coords[1] ** 2))\n\n max_idx = 0\n temp.each_with_index { |temp_dist, i| max_idx = i if temp_dist > temp[max_idx] }\n\n temp[max_idx] = distance if distance < temp[max_idx]\n end\n\n temp\nend",
"def k_closest(points, k)\n points.sort_by!{|p| p[0]*p[0] + p[1]*p[1]}.first(k)\nend",
"def compute_point_distances(points)\n if points.size >= 2\n paired_points = points[0...-1].zip(points[1..-1])\n distances = [0]\n distances + paired_points.map { |(p, q)| p.distance(q) }\n else\n []\n end\n end",
"def findnearest( coords, targetx, targety )\n # find nearest coordinate\n nearest = 0\n targetcounter = 0\n target = -1\n coords.each do |neighborx,neighbory|\n d = Math::sqrt( ( neighborx - targetx ) ** 2 + ( neighbory - targety ) ** 2 )\n if d < 0.2\n target = targetcounter\n end\n targetcounter += 1\n end\n return target\nend",
"def k_closest_a(points, k)\n points.sort_by { |point| point[0]**2 + point[1]**2 }[0,k]\nend",
"def unique_distance_to_point?\n # ALL_POINTS.sort_by { |obj| obj.distance_to_main }.first\n @distances = ALL_POINTS.map(&:distance_to_main)\n @sorted_distances = @distances.sort\n @closest = @sorted_distances.first\n @distances.one?(@closest)\nend",
"def closest_point_index(*other)\n other = Point.new(*other)\n 0.upto(n - 1).sort_by { |i| Line.new(points[i], other).length }.first\n end",
"def find_closest_distance\n closest_distance = 1\n closest_clusters = [nil, nil]\n\n @clusters.combination(2) do |c|\n dist = c[0].distance_to(c[1])\n if dist < closest_distance\n closest_distance = dist\n closest_clusters = [c[0], c[1]]\n end\n end\n\n return closest_distance, closest_clusters[0], closest_clusters[1]\n end",
"def find_closest_points(reference_point, geometric_resolution)\n do_find_closest_points(reference_point.to_a, geometric_resolution)\n end",
"def k_closest(points, k)\n points.sort_by!{|p| p[0]*p[0] + p[1]*p[1]}[..k-1]\nend",
"def find_pair\n before = self.entropy\n reduce_pair_line\n reduce_pair_col\n reduce_pair_grid\n reduce_solved if before > self.entropy\n self\n end",
"def find_one_closest_point(reference_point, guess, geometric_resolution)\n do_find_one_closest_point(reference_point.to_a, guess, geometric_resolution)\n end",
"def closest_to_center(list)\n list\n .sort_by { |point| dist(point, point(0,0)) }\n .first\nend",
"def find_closest!\n 1000.times { @particles.values.map(&:tick) }\n closest = @particles.values.min { |p1, p2| p1.manhattan_distance <=> p2.manhattan_distance }\n end",
"def generate_pairs(point_array)\n pair_list = []\n\n point_array.each_index do |index|\n this_point = point_array[index]\n next_point = point_array[index + 1]\n\n if next_point\n pair_list << [this_point, next_point]\n end\n end\n\n pair_list\n end",
"def pairs_within_dist(a, dist)\n ans, i = 0, 0\n (1...a.size).each do |j|\n i += 1 while a[j] - a[i] > dist\n ans += j - i\n end\n ans\nend",
"def distance_to_point(point)\n to_a.zip(point.to_a).map{|a, b| (b - a) ** 2}.reduce(:+) ** 0.5\n end",
"def find_pairs(array, k)\n # write your code here\n pairs = []\n \n array.each_with_index do |x, index|\n array[(index + 1)..-1].each do |y|\n pairs.push([x, y]) if x + y == k\n end\n end\n \n pairs\nend",
"def find_pair\n return false if potential_pairs.empty?\n potential_pairs.sample\n end",
"def closest_centroid(point, centroids)\n min = Float::INFINITY\n min_index = 0\n \n centroids.each.with_index do |centroid, i|\n dist = euclidean_distance(point, centroid)\n if dist < min\n min = dist\n min_index = i\n end\n end\n \n min_index\nend",
"def nearest_driver(map,user)\n driver_pos=[]\n\n for i in 0..map.length-1\n for j in 0..map.length-1\n if map[i][j] == \" D \"\n driver_pos << [i,j]\n end\n end\n end\n @driver_pos=driver_pos\n\n nearest_driver_position = driver_pos[0]\n distance = driver_pos[0].zip(user).map { |x| x.reduce(:-).abs }.sum\n\n for i in 1..driver_pos.length-1\n temp = driver_pos[i].zip(user).map { |x| x.reduce(:-).abs }.sum\n if temp < distance\n distance = temp\n nearest_driver_position = driver_pos[i]\n end\n end\n nearest_driver_position\n end",
"def pairs_within_dist_a(a, dist)\n ans = 0\n (0...a.size).each do |i|\n ans += ((i+1...a.size).bsearch { |j| a[j] - a[i] > dist } || a.size) - (i+1)\n end\n ans\nend",
"def eqs_for_free_points(p)\n return [] if p.free?\n q, r = first_point, second_point\n eqs = []\n uv = [:x,:y,:z] # uv stands for unused vars\n %w{x y z}.map(&:to_sym).each do |v|\n if 0 == (q.send(v).to_f - r.send(v).to_f)\n eqs << p.send(v.to_s+\"_to\", q) # <-- A bit different equation\n uv.delete(v)\n end\n end\n if uv.size == 3\n eq_for_non_free_points(p) # The equations are the same as the\n # non-free-points options\n elsif uv.size == 2\n eqs << eq_for_coordinates(p, *uv)\n end\n eqs\n end",
"def distance2_to(data_point)\n [@coordinates,data_point.coordinates].transpose.map do\n |arr| arr.inject { |sum, coordinate| (sum - coordinate)**2 }\n end.inject(:+)\n end",
"def nn(x,y)\n measured = points.each_with_object(Hash.new { |h, k| h[k] = [] }) do |(coords, point), h|\n next if point.coords == [x, y]\n\n dist = point.dist(x, y)\n\n h[dist] << coords\n end\n\n measured.min_by { |k, _v| k }[1]\n end",
"def distance2_to(data_point)\n [@coordinates,data_point.coordinates].transpose.map{|arr| arr.inject{|sum, coordinate| (sum - coordinate)**2}}.inject(:+)\n end",
"def distCalc(point1, point2)\n first = ((point2[:x] - point1[:x]) **2)\n second = ((point2[:y] - point1[:y]) **2)\n sum = (first + second)\n dist = Math.sqrt(sum)\n return dist\nend",
"def find_closest(array, value, k)\n results_hash = {}\n \n array.each do |number|\n if number == value\n next\n else\n difference = (value - number).abs # get absolute value\n results_hash[number] = difference\n end\n end\n \n sorted_results = results_hash.min_by(k) do |number, diff|\n diff\n end\n \n sorted_results.map! do |array|\n array[0]\n end\n \n return sorted_results\nend",
"def closest_to(*args)\n if args.length == 1\n if args.first.respond_to?(:distance_to)\n closest_to_coordinates(args.first)\n elsif %w(first last).all? { |m| args.first.respond_to?(m) }\n closest_to_lat_lng(args.first)\n else\n raise ArgumentError, \"expected two-element Array or GeoKit::LatLng\"\n end\n elsif args.length == 2\n closest_to_lat_lng(args)\n else\n raise ArgumentError, \"closest_to() will accept one Array argument, one GeoKit::LatLng argument, or two FixNum arguments\"\n end\n end",
"def get_adjacent_pairs_large(vector)\n responds_to_arguments vector, [:rank, :shape]\n # Set up the output matrix\n out = get_pairs_output_vector vector\n [0, 1].each do |i|\n out.rank(*pairs_args(out, 1, i), :reference)[*slice_args(out)]= vector.rank(*pairs_args(vector, 0, i))\n end\n out\n end",
"def find_list_of_pairs(arr1, arr2, target)\n final_hash = {}\n arr1_hash = arr1.to_h\n arr2_hash = arr2.to_h\n\n arr1_hash.each do |k1, v1|\n arr2_hash.each do |k2, v2|\n sum = v1 + v2\n final_hash[sum] = final_hash[sum] ? final_hash[sum].push([k1, k2]) : [[k1, k2]]\n end\n end\n\n if final_hash[target]\n return final_hash[target]\n else\n greatest_sum = -1\n final_hash.each do |k, v|\n if k < target && k > greatest_sum\n greatest_sum = k\n end\n end\n\n return final_hash[greatest_sum]\n end\nend",
"def euclidean_distance_to(point)\n if self.dimensions != point.dimensions\n raise HonorRoll::IncompatibleDimensionsError\n end\n coord_pairs = self.coords.zip point.coords\n Math.sqrt coord_pairs.map{ |p| (p[0] - p[1])**2 }.reduce(:+)\n end",
"def all_squared_pairs(num) \n squared_pairs=[]\n upper = num**(1/2.0).ceil\n (0..upper).each do |x|\n (0..upper).each do |y|\n squared_pairs<<[x,y] if (x*x)+(y*y)==num\n end\n end\n squared_pairs.map(&:sort).uniq\nend",
"def largest_pair(pairs_array)\n bestPair = []\n largestSum = -99999\n pairs_array.each do |element|\n if element[0] + element[1] > largestSum\n largestSum = element[0] + element[1]\n bestPair = element\n end\n end\n return bestPair\n \nend",
"def points_n2\n result = [:infinity]\n (0...@p).each do |x|\n (0...@p).each do |y|\n point = [x,y]\n result << point if valid?(point)\n end\n end\n result\n end",
"def solution(x, y)\n sheep = []\n\n (0...x.size).each do |i|\n sheep.push([x[i], y[i]])\n end\n\n min_d = 123456 # larger then max position\n sheep.sort! { |x,y| (x[0]**2 + x[1]**2) <=> (y[0]**2 + y[1]**2) }\n (0..(x.size - 2)).each do |i|\n dist = (sheep[i+1][0] - sheep[i][0]).abs\n next if dist > min_d\n offset =(sheep[i+1][1] - sheep[i][1]).abs\n min_d = [min_d, [dist, offset].max].min\n end\n\n (min_d / 2).floor\nend",
"def points_distance(x1, y1, x2, y2)\n Math.sqrt((x1 - x2).abs2 + (y1 - y2).abs2)\n end",
"def closest_param_point(c)\n ab = @p2.curr - @p1.curr\n t = (ab.dot(c - @p1.curr)) / (ab.dot(ab))\n MathUtil.clamp(t, 0.0, 1.0)\n end",
"def assignClosest(parr)\n self.dims[0].times do |i|\n self.dims[1].times do |j|\n distances = Array.new\n parr.each do |point|\n distances << point.distance(i, j)\n end\n mins = distances.min(2)\n if mins[0] == mins[1]\n @grid[i][j] = -1\n else\n @grid[i][j] = distances.index(mins[0])\n end\n end\n end\n end",
"def sum_pair(list, target)\n list.each do |a|\n list.each do |b|\n if a + b == target and list.index(a) != list.index(b)\n return [a, b]\n end\n end\n end\nend",
"def get_near(point)\n res = []\n\n for dx in -1..1\n for dy in -1..1\n if dx == 0 && dy == 0\n next\n end\n res << get_at(Point.new(point.x + dx, point.y + dy))\n end\n end\n\n res.empty? ? nil : res\n end",
"def find_pairs(arr, sum)\n arr.combination(2).find_all { |x, y| x + y == sum }\nend",
"def point_point_distance(a, b)\n (((a.x - b.x) ** 2 + (a.y - b.y) ** 2) ** 0.5).abs\n end",
"def findPairs(set)\n 0.upto(@size-1) do |n|\n (n+1).upto(@size-1) do |m|\n if (set[n].possible.size == 2 && set[n].possible ==\nset[m].possible)\n eliminateExcept(set, [m,n], set[n].possible)\n end\n end\n end\n end",
"def find_neighbors(*point)\n point.flatten! # Ensure we have 1-D array\n raise ArgumentError, \"More than 2 coordinates received\" if point.size > 2\n\n find_neighbors_rec(point, root)\n end",
"def neighbor_points point\n validate_point(point)\n row, col, height = point[0], point[1], point[2]\n offsets = [[-1,-1,0], [-1,0,0], [0,-1,0], [0,1,0], [1,0,0], \\\n [1,1,0], [0,0,1], [0,0,-1]]\n offsets.map do |r,c,h|\n [row+r, col+c, height+h]\n end\n end",
"def closest_point(pt)\n if pt.is_valid?\n vect = GeoFunctions.point_minus_point(pt, @origin)\n dist = GeoFunctions.vector_dot_product(vect, @z_axis)\n delta = GeoFunctions.vector_times(@z_axis, dist)\n GeoFunctions.point_minus_vector(pt, delta)\n else\n GeoFunctions.invalid_a_point\n end\n end",
"def find_path_brute_force( board, start_point )\n options = get_options( start_point, board )\n\n # Bottom right corner\n if options.length == 0\n return { points: [start_point], best_value: get_value( start_point, board ) }\n end\n\n # If there's only one option, this works fine still.\n first_result = find_path_brute_force( board, options.first )\n second_result = find_path_brute_force( board, options.last )\n if first_result[:best_value] > second_result[:best_value]\n return {\n points: [start_point] + first_result[:points],\n best_value: first_result[:best_value] + get_value( start_point, board )\n }\n else\n return {\n points: [start_point] + second_result[:points],\n best_value: second_result[:best_value] + get_value( start_point, board )\n }\n end\nend",
"def distance(point1, point2)\n # square root of (x2-x1) squared + (y2-y1) squared\n Math.sqrt(((point2[0]-point1[0])**2)+((point2[1]-point1[1])**2))\nend",
"def min_cost_connect_points(points)\n total = 0\n visited = [true] + [false] * (points.length - 1)\n min_costs = {}\n current_id = 0\n\n (points.length - 1).times do\n min = nil\n next_id = nil\n points.each_with_index do |point, index|\n next if visited[index]\n\n new_min = manhattan_distance(points[current_id], points[index])\n\n if !min_costs[index] || min_costs[index] > new_min\n min_costs[index] = new_min\n else\n new_min = min_costs[index]\n end\n\n if !min || new_min < min\n min = min_costs[index] < new_min ? min_costs[index] : new_min\n next_id = index\n end\n end\n\n total += min\n visited[next_id] = true\n current_id = next_id\n end\n\n total\nend",
"def find_pair(array,sum)\n indices = []\n for i in 0...array.length\n for j in i+1...array.length\n indices.push(\"#{i},#{j}\") if array[i] + array[j] == sum\n end\n end\n indices\nend",
"def pair_sum(array, k)\n pairs = []\n\n (0...array.length - 1).each do |i|\n (i + 1...array.length).each do |j|\n a = array[i]\n b = array[j]\n pairs << [[a, b].min, [a, b].max] if a + b == k\n end\n end\n\n pairs.uniq\nend",
"def distance4(*points)\n x1, y1, x2, y2 = points.flatten\n raise ArgumentError unless [x1, y1, x2, y2].all? { |e| e.is_a? Numeric }\n Math.hypot(x2 - x1, y2 - y1)\nend",
"def distance_between_points(a, b)\n Math.sqrt( (b.x - a.x)**2 + (b.y - a.y)**2 ).round(6)\nend",
"def farthest_point_along_axis(points, axis)\n PointAlongAxis.new(nil, nil, nil).tap do |farthest|\n points.each_with_index do |point, i|\n this_position = position_along_axis(axis, point)\n\n if farthest.position.nil? || this_position > farthest.position\n farthest.point = point\n farthest.index = i\n farthest.position = this_position\n end\n end\n end\n end",
"def my_points(distances,paths,x_s,subroutines=nil)\n if distances.uniq == distances\n sorted = distances.sort\n end\n points = Array.new(x_s.count){0}\n\n i = 0\n my_dists = []\n my_points = []\n while points != Array.new(x_s.count){2} && sorted[i] != nil\n p1, p2 = paths[distances.index(sorted[i])]\n \n usable = true\n if subroutines\n subroutines.each do |sub|\n if sub.has_how_many_points_in(my_points) >= (sub.count - 1)\n usable = false\n end\n end\n end\n \n if points[p1] < 2 && points[p2] < 2 && usable\n my_dists << sorted[i]\n my_points << [p1,p2]\n points[p1] += 1\n points[p2] += 1\n p points\n p my_points\n puts\n end\n if (i + 1) < sorted.count\n i += 1\n else\n i = 0\n end\n end\n [my_points, my_dists]\nend",
"def find_pair(person)\n total = @pairs.length\n pick = rand(total)\n if invalid_pair? pick,person\n pair = @pairs.delete_at(pick)\n else \n pair = find_pair(person) \n end \n pair \nend",
"def k_nearest_neighbours(k)\n other_users = User.where.not(id: id)\n users_with_similarity = []\n\n other_users.each do |other_user|\n user_similarity = Calculations.pearson_correlation(ratings_vector, other_user.ratings_vector)\n users_with_similarity.push(other_user[:id] => user_similarity)\n end\n\n users_with_similarity.to_a.sort_by! { |user_with_similarity| -user_with_similarity.values.first }[0, k]\n end",
"def all_squared_pairs(num)\n 0.upto(num).take_while { |n| n * n <= num / 2 }.\n map { |n| [n, Math.sqrt(num - n * n)] }.\n select { |n, m| m == m.to_i }\nend",
"def min_distance_away(truth_points, up)\n truth_points.inject([]){|arr, p| arr << [up.sqd_distance(p), p]; arr}.min{|a, b| a.first <=> b.first}\n end",
"def next_point sol\n\tfor i in 0...sol.size\n\t\tfor j in 0...sol[i].size\n\t\t\tif sol[i][j].ord < 'a'.ord\n\t\t\t\treturn i, j\n\t\t\tend\n\t\tend\n\tend\n\n\treturn nil, nil\nend",
"def surrounding(position, radius)\n dlat = 0.0001\n dlng = 0.0001\n (1..radius).map do |r|\n (-r..r).map do |rlat|\n points = [sum(position, [dlat * rlat, dlng * (r - rlat.abs)])]\n if rlat.abs != r\n points += [sum(position, [dlat * rlat, dlng * (rlat.abs - r)])]\n end\n points\n end.flatten(1)\n end\nend",
"def social_distance_to user_id\n\n fake_test_data = {\n 1 => [5,6],\n 5 => [1],\n 6 => [1,7,8],\n 7 => [6],\n 8 => [6, 9, 12],\n 9 => [8],\n 12 => [13, 8],\n 13 => [12,14],\n 14 => [13]\n }\n\n start_id = 1\n end_id = user_id\n\n get_vertices = lambda { |x|\n fake_test_data[x] || []\n }\n\n a = start_id\n b = end_id\n marked = Set.new # keep track of checked vertices\n depth_a = get_vertices.call a\n depth_b = get_vertices.call b\n # check for distance=1 here, next checks will be for a common vertex in-between\n return 1 if b.in? depth_a\n distance = 2\n next_depth_a = []\n next_depth_b = []\n while depth_a.size > 0 && depth_b.size > 0\n # first check for even distances\n return distance if (depth_a & depth_b).size > 0\n distance += 1\n # get full front on next depth (all connected vertices of all vertices on this depth)\n depth_a.each do |aa|\n unless aa.in? marked\n next_depth_a += get_vertices.call aa\n marked.add(aa)\n end\n end\n # ... same for the other end\n depth_b.each do |bb|\n unless bb.in? marked\n next_depth_b += get_vertices.call bb\n marked.add(bb)\n end\n end\n depth_a = next_depth_a\n # second check with only one front moved forward (otherwise we might \"jump over\" the common vertex)\n return distance if (depth_a & depth_b).size > 0\n distance += 1\n depth_b = next_depth_b\n next_depth_a = next_depth_b = []\n end\nend",
"def solve(input_a, input_b)\n least_distance_from_start(\n cross_points(\n covered_cells(split_parse(input_a)),\n covered_cells(split_parse(input_b))\n )\n )\nend",
"def closestNumbers(n, arr)\n sorted_arr = arr.sort\n abs_arr = []\n for i in 0..n-2 do\n diff = sorted_arr[i] - sorted_arr[i+1]\n #abs_arr << (sorted_arr[i] - sorted_arr[i+1]).abs\n abs_arr << diff.abs\n end\n min_abs = abs_arr.min\n ele_num = abs_arr.each_index.select{|i| abs_arr[i] == min_abs}\n result = []\n ele_num.each do |j|\n result.push(sorted_arr[j], sorted_arr[j+1])\n end\n return result.sort\nend",
"def get_key(point1, point2)\n x1, y1 = point1.first, point1.last\n x2, y2 = point2.first, point2.last\n if(x1 == x2)\n c = -1 * x1\n return [1, 0, c]\n end\n if(y1 == y2)\n c = -1 * y1\n return [0, 1, c]\n end\n tx = x1 - x2\n ty = y1 - y2\n mcd = max_common_divisor(tx.abs, ty.abs)\n k1 = ty / mcd\n k2 = tx / mcd\n b = y1 - x1 * k1 / k2\n return [k1, k2, -1, b]\nend",
"def find_closest(a, s, n)\n results = []\n a.each { |number|\n if results.length < n\n results << number\n else\n if number <= s \n if (s - number) < (s-results[0]) \n results = results.drop(1)\n results << number\n else\n end\n else\n if (number - s) < (s-results[0])\n results = results.drop(1)\n results << number\n elsif (number-s) < s-results[n-1]\n delete_at(n-1)\n results << number\n end\n end\n end\n }\n results\n \n end",
"def sum_pairs(nums, target)\n results = []\n if nums.count < 2\n return results\n end\n nums.sort!\n (0..(nums.length - 2)).each do |first_index|\n second_index = first_index + 1\n until second_index == nums.length\n sum = nums[first_index] + nums[second_index]\n if sum == target\n results << [nums[first_index], nums[second_index]].sort\n end\n second_index += 1\n end\n end\n results.sort\nend",
"def point_pairs(ride)\n pairs = []\n\n ride.points.each_with_index do |point, index|\n if index < ride.points.size - 1\n pair = [point, ride.points[index + 1]]\n\n if block_given?\n yield pair\n else\n pairs << pair\n end\n end\n end\n\n pairs unless block_given?\n end",
"def cell_closest_to_mouse2\n # Closest cell grid to the mouse in the second\n x = (inputs.mouse.point.x / grid.cell_size).to_i\n y = (inputs.mouse.point.y / grid.cell_size).to_i\n # Translate the cell to the first grid\n x -= grid.width + 1\n # Bound x and y to the first grid\n x = 0 if x < 0\n y = 0 if y < 0\n x = grid.width - 1 if x > grid.width - 1\n y = grid.height - 1 if y > grid.height - 1\n # Return closest cell\n [x, y]\n end",
"def update_closest(array, city, new_dist)\n if !array.include?([city, new_dist])\n insert_point = binary_insert(array, new_dist)\n array.insert(insert_point,[city, new_dist])\n end\nend",
"def closest_arrow_and_tile(row, x, y)\n all_coord = []\n\n @game_board.board[row].each do |tile|\n all_coord << tile.center_top\n all_coord << tile.center_bottom\n all_coord << tile.center_right\n all_coord << tile.center_left\n end\n\n closest_arrow = all_coord.inject do |sum, value|\n distance_sum = Gosu::distance(x, y, sum[0], sum[1])\n distance_val = Gosu::distance(x, y, value[0], value[1])\n distance_sum < distance_val ? sum : value\n end\n\n column = find_col_in_row(all_coord, closest_arrow)\n\n tile = @game_board.board[row][column]\n tile_position = [row, column]\n [tile, closest_arrow, tile_position]\n end",
"def is_straight?\n order_by_value.each_cons(2).all? { |x,y| y.point == x.point + 1 }\n end",
"def nextrelvector(z)\r\n best = []\r\n bestDist = Float::MAX\r\n (0..1).each do |i|\r\n (0..1).each do |j|\r\n (0..1).each do |k|\r\n p = (B*Vector[i,j,k])\r\n dist = (z - p).magnitude()\r\n if(dist < bestDist)\r\n bestDist = dist\r\n best = p\r\n end\r\n end\r\n end\r\n end\r\n return best\r\nend",
"def find_greater_pair(src)\n # src will be an array of [ [number1, number2], ... [numberN, numberM] ]\n # Produce a new Array that contains the larger number of each of the pairs\n # that are in the inner Arrays\n row_index = 0\n bignum_array = []\n \n while row_index < src.count do\n bignum_array.push(src[row_index][0] > src[row_index][1] ? src[row_index][0] : src[row_index][1])\n \n row_index += 1\n end\n\n bignum_array\nend",
"def grab_nearest_by_location(distance, loc)\n\n end",
"def nearest(coords, code, n=5)\n with_distance = find(code).map { |pos| [pos, (pos[0] - coords[0]).abs + (pos[1] - coords[1]).abs + (pos[2] - coords[2]).abs ] }\n return with_distance.sort_by { |pos, dist| dist }[0..n]\n end",
"def nearest_fortress_exit_point(point)\n nearest_fortress_exit_cell = nil\n nearest_distance = MAX_DISTANCE\n fortress_exit_cells.each do |exit_cell|\n distance = Tools.calc_distance(point, exit_cell)\n if distance < nearest_distance\n nearest_distance = distance\n nearest_fortress_exit_cell = exit_cell\n end\n end\n return Point.new(nearest_fortress_exit_cell.x, nearest_fortress_exit_cell.y)\n end",
"def find_pairs(array)\n sub_arrays = []\n\n for start_idx in (0..array.size - 2) do\n for right_idx in ((start_idx + 1)..array.size - 1) do\n sub_arrays << [array[start_idx], array[right_idx]]\n end\n end\n result = sub_arrays.select do |sub|\n sub[0] * sub[1] == 100\n end\n result.uniq\nend",
"def distance(p1,p2)\ndelta_x = p1[0] - p2[0]\ndelta_y = p1[1] - p2[1]\n\nMath.sqrt(delta_x ** 2 + delta_y **2)\n\nend",
"def sum_of_all_pairs(arr, sum)\n answer = []\n arr.each_with_index do |ele, idx|\n while idx < arr.length - 1\n if ele + arr[idx + 1] == sum\n if ele < arr[idx + 1]\n temp_arr = [ele, arr[idx + 1]]\n else\n temp_arr = [arr[idx + 1], ele]\n end\n if !answer.include?(temp_arr)\n answer.push(temp_arr)\n end \n end\n idx = idx + 1\n end\n end\n return answer\nend",
"def find_triplets(target)\n @nums.each do |num, occ|\n pair = find_pairs(target - num)\n return num * pair if pair != -1\n end\n end",
"def find_pair(array,sum)\n indices = []\n hash = Hash.new\n array.each_with_index do |element,i|\n if hash[sum - element] != nil then\n indices.push(\"#{hash[sum - element]},#{i}\")\n end\n hash[element] = i\n end\n indices\nend",
"def food_proximity(snake_head_location, food_locations)\n proximities = []\n\n food_locations.each { |food_location|\n proximity = (food_location[:y] - snake_head_location[:y]) ** 2\n proximity += (food_location[:x] - snake_head_location[:x]) ** 2\n proximity = Math.sqrt(proximity)\n\n proximities.push(proximity)\n }\n\n return proximities\nend",
"def nearest_neighbors(vector)\n vector = Vector.elements(vector)\n\n distances = @predictors.map.with_index do |p, index|\n { index: index, distance: euclidian_distance(p, vector), value: targets[index] }\n end\n\n distances.sort! { |x,y| x[:distance] <=> y[:distance] }\n\n neighboring_predictors = distances.first(@k).map { |neighbor| @predictors[neighbor[:index]] }\n neighboring_targets = distances.first(@k).map { |neighbor| @targets[neighbor[:index]] }\n\n return neighboring_predictors, neighboring_targets\n end",
"def replace_worst_point(point_value_pair)\n n = @simplex.length - 1\n 0.upto(n - 1) do |i|\n if (compare(@simplex[i], point_value_pair) > 0)\n point_value_pair, @simplex[i] = @simplex[i], point_value_pair\n end\n end\n @simplex[n] = point_value_pair\n end",
"def each_adj_near x, y\n (axis_range_adj y).each do |adj_y|\n (axis_range_adj x).each do |adj_x|\n unless x == adj_x && y == adj_y\n yield adj_x, adj_y\n end\n end\n end\n end",
"def sum_pairs(numbers, sum)\n # Numbers witch we select as checked that we have in array.\n # Selected number is the index of array. So if we want to select\n # number 4 as chekced we do it so with putting checked[4] = 1 and so on.\n checked = []\n # Iterate over each number\n numbers.each do |n|\n # check what is the difference between searching sum and current number\n temp = sum - n\n # ... and if we already checked such number (checked[temp] == 1)\n # and it is grater or equal 0 (because we are looking for sum )\n # then there is our pair of numbers ([temp, n])\n return [temp, n] if (temp >= 0) && (checked[temp] == 1)\n checked[n] = 1\n end\n nil\nend",
"def dist(x, y)\n z = -x-y\n [x.abs, y.abs, z.abs].max\nend",
"def contains_pair_product?(arr, target)\n arr.each_with_index do |num1, idx1|\n arr.each_with_index do |num2, idx2|\n if (idx2 > idx1) && (num1 * num2 == target)\n return true\n end\n end\n end\n\n return false\n\nend",
"def closest_planet\n finder = self.class.select(\"id, name, location, planets.location<->POINT('#{self.location}') as distance\")\n self.class.my_planets.each do |p|\n finder = finder.where(\"NOT location ~= POINT(?)\", p.location)\n end\n finder.order(\"distance ASC\").first\n end",
"def adjacent_traversible_points(point)\n\n left_point = [point[0] - 1, point[1]]\n right_point = [point[0] + 1, point[1]]\n top_point = [point[0], point[1] - 1]\n bottom_point = [point[0], point[1] + 1]\n\n [left_point, right_point, top_point, bottom_point].select do |n|\n (@space_points.include?(n) || n.eql?(@stop_point))\n end\n end",
"def find_pairs(array)\n sub_arrays = []\n\n left_idx = 0\n\n while left_idx <= array.size - 2\n right_idx = left_idx + 1\n while right_idx <= array.size - 1\n sub_arrays << [array[left_idx], array[right_idx]]\n right_idx += 1\n end\n left_idx += 1\n end\n result = sub_arrays.select do |sub|\n sub[0] * sub[1]== 100\n end\n result.uniq\n end"
] |
[
"0.85408145",
"0.8106821",
"0.7751728",
"0.7697608",
"0.69138294",
"0.6890541",
"0.67882025",
"0.6780664",
"0.6744194",
"0.6680858",
"0.6556518",
"0.6529613",
"0.6514368",
"0.6484864",
"0.6425766",
"0.63992155",
"0.6346496",
"0.63223886",
"0.62771577",
"0.6265098",
"0.6232421",
"0.62089705",
"0.6132312",
"0.6128085",
"0.6122416",
"0.60192394",
"0.5937054",
"0.5936922",
"0.59017533",
"0.5876386",
"0.5835209",
"0.58268297",
"0.57861555",
"0.57766354",
"0.5769586",
"0.5769447",
"0.5764637",
"0.5756943",
"0.5747418",
"0.57007796",
"0.5693131",
"0.5684315",
"0.5659542",
"0.564868",
"0.56374836",
"0.5612653",
"0.5612097",
"0.56072557",
"0.55798507",
"0.5574285",
"0.5571616",
"0.55541426",
"0.5546836",
"0.5544149",
"0.5542069",
"0.55389744",
"0.5533789",
"0.55122876",
"0.54858637",
"0.5484213",
"0.5481969",
"0.54602474",
"0.5457102",
"0.54478455",
"0.543728",
"0.5430218",
"0.5419891",
"0.5417233",
"0.5416963",
"0.5411829",
"0.54081166",
"0.53989154",
"0.5396272",
"0.5390388",
"0.53894794",
"0.5388515",
"0.5379275",
"0.535796",
"0.53374314",
"0.5335249",
"0.53350496",
"0.5333065",
"0.5325421",
"0.5322437",
"0.5321752",
"0.5316542",
"0.5310719",
"0.5289608",
"0.5285346",
"0.5281129",
"0.5278913",
"0.52780294",
"0.5270196",
"0.5269958",
"0.52676237",
"0.5265266",
"0.5252292",
"0.5251019",
"0.52501476",
"0.5250056"
] |
0.84537935
|
1
|
px > all points sorted by their x coordinates py > all points sorted by their y coordinates
|
def _closest_pair(px, py)
nx, ny = px.length, py.length
return [px[0], py[0]] if nx == 1 and ny == 1
return best([px[0], px[1]], [py[0], py[1]]) if nx == 2 and ny == 2
qx, rx, qy, ry = px[0...nx/2], px[nx/2...nx], py[0...ny/2], py[ny/2...ny]
qpair = _closest_pair(qx, qy)
rpair = _closest_pair(rx, ry)
min_dist = [distance(qpair[0], qpair[1]), distance(rpair[0], rpair[1])].min
split_pair = closest_split_pair(px, py, min_dist)
best(qpair, rpair, split_pair)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def points\n [top_left, top_right, bottom_left, bottom_right]\n end",
"def sorted_x\n @sorted_x ||= [start_point.x, end_point.x].sort\n end",
"def y_points\n points = []\n (0...width).each do |x|\n (0...height).reverse_each do |y|\n if (array[y][x]).nonzero? && (y + 1 >= height || (array[y + 1][x]).zero?)\n points << Point.new(x, y + 1) + @position\n end\n end\n end\n\n points\n end",
"def size\n\t\tx,y = 0,0\n\t\t@points.each do |point|\n\t\t\tx = point[0]\tif point[0] > x\n\t\t\ty = point[1]\tif point[1] > y\n\t\tend\n\t\treturn [x,y]\n\tend",
"def all_points\n\t\tcase @orientation\n\t\twhen :vertical\n\t\t\tx = @points[0][:x]\n\t\t\tys = [@points[0][:y],@points[1][:y]]\n\t\t\t(ys.min..ys.max).map{|y| {:x => x, :y => y}}\n\t\twhen :horizontal\n\t\t\txs = [@points[0][:x],@points[1][:x]]\n\t\t\ty = @points[0][:y]\n\t\t\t(xs.min..xs.max).map{|x| {:x => x, :y => y}}\n\t\tend\n\tend",
"def main(points) # array with all the points\n #copy of the array by an especific cordinate\n #nlogn\n # This is a primitive, aka operations that are costless compared to the\n # total complexity we are aming for\n px = sort_by_cordinate(points, 0)\n py = sort_by_cordinate(points, 1)\n\n result = closest_pair(px, py)\nend",
"def get_point_order\n order = Array.new(@feature.length)\n @feature.each_with_index.sort_by(&:first).each_with_index { |f_and_index, i| order[f_and_index[1]] = i }\n order\n end",
"def sortBorderPoints\n border_points.sort { |a,b| a.local_index <=> b.local_index }\n end",
"def sort_points(args)\n points\n .sort_by { |point| point[:distance] }\n .first(args[:k])\n .map do |point|\n point[:weight] = calc_point_weight(args[:weight], point[:distance])\n point\n end\n end",
"def compare_coords(_x1, y1, _x2, y2)\n return y1 > y2\n end",
"def compare_coords(x1, _y1, x2, _y2)\n return x1 > x2\n end",
"def nn(x,y)\n measured = points.each_with_object(Hash.new { |h, k| h[k] = [] }) do |(coords, point), h|\n next if point.coords == [x, y]\n\n dist = point.dist(x, y)\n\n h[dist] << coords\n end\n\n measured.min_by { |k, _v| k }[1]\n end",
"def points()\n\t\t\tfilter()\n\t\t\treturn @points_floor + @points_ceil.reverse\n\t\tend",
"def collect_adjacent_points(coords)\n\t\tpoints = []\n\t\tx = coords[:x]\n\t\ty = coords[:y]\n\t\tx_range = ([0, x-1].max..[$dimensions[:x], x+1].min)\n\t\ty_range = ([0, y-1].max..[$dimensions[:y], y+1].min)\n\t\tx_range.each do |i|\n\t\t\ty_range.each do |j|\n\t\t\t\tpoints << {:x => i, :y => j} unless ( (i == x && j == y ) || occupied?(i, j))\n\t\t\tend\n\t\tend\n\t\tpoints\n\tend",
"def my_points(distances,paths,x_s,subroutines=nil)\n if distances.uniq == distances\n sorted = distances.sort\n end\n points = Array.new(x_s.count){0}\n\n i = 0\n my_dists = []\n my_points = []\n while points != Array.new(x_s.count){2} && sorted[i] != nil\n p1, p2 = paths[distances.index(sorted[i])]\n \n usable = true\n if subroutines\n subroutines.each do |sub|\n if sub.has_how_many_points_in(my_points) >= (sub.count - 1)\n usable = false\n end\n end\n end\n \n if points[p1] < 2 && points[p2] < 2 && usable\n my_dists << sorted[i]\n my_points << [p1,p2]\n points[p1] += 1\n points[p2] += 1\n p points\n p my_points\n puts\n end\n if (i + 1) < sorted.count\n i += 1\n else\n i = 0\n end\n end\n [my_points, my_dists]\nend",
"def compare_position(point)\n (v2.x - v1.x) * (point.y - v1.y) - (point.x - v1.x) * (v2.y - v1.y)\n end",
"def petunin(points)\n\tif points.size() < 4\n\t\tputs \"Error on #{__LINE__} in #{__FILE__}\"\n\t\texit(1)\n\tend\n\t#return [x,x0,y,y0]\n\trect = find_rect(points)\n\tdx, phi, coef = get_transf_coef(rect)\n\tdx.each {}\n\t#rect = translate(rect, -dx[0], -dx[1])\n\trect = rotate(rect, phi)\n\trect = scale(rect, 1.0, coef)\n\n\t#points = translate(points, -dx[0], -dx[1])\n\tpoints = rotate(points,phi)\n\tpoints = scale(points, 1, coef)\n\n\tcentre = rect[0].zip(rect[2]).to_a.map { |u,v| (u+v)/2 }\n\trs = []\n\tpoints.each do |p|\n\t\trs << [dist(p, centre), p]\n\tend\n\trs = rs.sort\n\n\tres = []\n\n\trs.each do |r,p|\n\t\tel = Ellipse.new\n\t\tel.centre = centre\n\t\tel.axes = [r]*2\n\n\t\t#back\n\t\tel.scale(1, 1/coef)\n\n\t\tel.rotate(-phi)\n\t\tres << [el,p]\n\tend\n\n\treturn res\n\n\t# For testing reasons only\n\n\t#rect = scale(rect, 1, 1/coef)\n\t#points = scale(points, 1, 1/coef)\n\t#rect = rotate(rect, -phi)\n\t#points = rotate(points, -phi)\n\t#points.map! { |x| [x] }\n\n\t#points + [rect] + res.inject([]) { |sum,el| sum + [el.get_draw_data] }\nend",
"def get_hatch_points_y(points, y)\r\n plane = [Geom::Point3d.new(0, y, 0), Geom::Vector3d.new(0,1,0)]\r\n pts = []\r\n for i in 0..points.length-1 do\r\n y1 = points[i-1].y\r\n y2 = points[i].y\r\n # very small differences in Y values will cause the following tests to 'next' when they should not\r\n # ie Y might display as 2.9mm but be 1e-17 different than the point.y, and y < y1 so you get no point\r\n # where you want a point\r\n # rather use signed differences\r\n# next if (y1 == y2)\r\n# next if ((y1 > y2) && ((y > y1) || (y < y2)))\r\n# next if ((y1 < y2) && ((y < y1) || (y > y2)))\r\n#puts \"y1 #{y1} y2 #{y2}\" \r\n# dif = (y1-y2).abs\r\n if ((y1 - y2).abs < 0.001) # small enough?\r\n next\r\n end\r\n d1 = y - y1\r\n d2 = y - y2\r\n if ((y1 > y2) && ((d1 > 0.0001) || (d2 < -0.0001)))\r\n next\r\n end\r\n if ((y1 < y2) && ((d1 < -0.0001) || (d2 > 0.0001)))\r\n next\r\n end\r\n\r\n line = [points[i-1], points[i]]\r\n pt = Geom::intersect_line_plane(line, plane)\r\n# if ((pt.x < 237.0) || (pt.x > 366.0))\r\n# puts \"y1#{y1} y2#{y2} dif#{dif.to_mm} pt #{pt} Y #{y.to_mm} line #{line}\"\r\n# end\r\n if (pt)\r\n pts << pt\r\n end\r\n end #for\r\n pts.uniq!\r\n return pts.sort{|a,b| a.x <=> b.x}\r\n end",
"def get_hatch_points_x(points, x)\r\n plane = [Geom::Point3d.new(x, 0, 0), Geom::Vector3d.new(1,0,0)]\r\n pts = []\r\n for i in 0..points.length-1 do\r\n x1 = points[i-1].x\r\n x2 = points[i].x\r\n\r\n# next if (x1 == x2)\r\n# next if ((x1 > x2) && ((x > x1) || (x < x2)))\r\n# next if ((x1 < x2) && ((x < x1) || (x > x2)))\r\n if ((x1 - x2).abs < 0.001)\r\n next\r\n end\r\n d1 = x - x1\r\n d2 = x - x2\r\n if ((x1 > x2) && ((d1 > 0.0001) || (d2 < -0.0001))) # the signs are important\r\n next\r\n end\r\n if ((x1 < x2) && ((d1 < -0.0001) || (d2 > 0.0001)))\r\n next\r\n end\r\n\r\n line = [points[i-1], points[i]]\r\n# puts \"#{line} #{x.to_mm}\"\r\n pt = Geom::intersect_line_plane(line, plane)\r\n if (pt)\r\n pts << pt\r\n end\r\n end #for\r\n pts.uniq!\r\n return pts.sort{|a,b| a.y <=> b.y}\r\n end",
"def x_points\n points = [[], []]\n (0...height).each do |y|\n (0...width).each do |x|\n if (array[y][x]).nonzero? && (x - 1 < 0 || (array[y][x - 1]).zero?)\n points[0] << Point.new(x - 1, y) + @position\n end\n\n if (array[y][x]).nonzero? && (x + 1 >= length || (array[y][x + 1]).zero?)\n points[1] << Point.new(x + 1, y) + @position\n end\n end\n end\n\n points\n end",
"def flip_range_xy(points); points.collect{ |v| Vertex.new(-v.y,-v.x)}; end",
"def coords\n coord_list = []\n (@x..(@x + @size_x - 1)).each do |i|\n (@y..(@y + @size_y - 1)).each do |j|\n coord = [i, j]\n coord_list << coord\n end\n end\n\n return coord_list\n end",
"def hull_points(hull)\n points = []\n hull.map {|x| points.push(x[0],x[1])}\n points.uniq\nend",
"def calculate_points(lines)\n points = lines.map do |line|\n if line.p1.x == line.p2.x\n ys = Range.new(*[line.p1.y, line.p2.y].sort).to_a\n xs = [line.p1.x] * ys.size\n elsif line.p1.y == line.p2.y\n xs = Range.new(*[line.p1.x, line.p2.x].sort).to_a\n ys = [line.p1.y] * xs.size\n else\n # Diagonal line\n # Sort by x axis\n p1, p2 = [line.p1, line.p2].sort_by(&:x)\n xs = Range.new(*[p1.x, p2.x]).to_a\n if p1.y > p2.y \n # negative slope (reverse so we can still use range)\n ys = Range.new(*[p2.y, p1.y]).to_a.reverse\n else\n # positive slope\n ys = Range.new(*[p1.y, p2.y]).to_a\n end\n end\n xs.zip(ys).map { |c| Point.new(*c) }\n end\nend",
"def points_n2\n result = [:infinity]\n (0...@p).each do |x|\n (0...@p).each do |y|\n point = [x,y]\n result << point if valid?(point)\n end\n end\n result\n end",
"def points; end",
"def flip_range_y(points); points.collect{ |v| Vertex.new(-v.x,v.y)}; end",
"def to_a\n @sorted_points.map { |p|\n if p.hull.nil?\n c = nil\n else\n id = (p.hull.hash ^ p.hull.hull_id) % 64 # XXX p.hull.hull_id % 64\n\n r = (id % 4) / 6.0 + 0.25\n g = ((id / 4) % 4) / 6.0 + 0.25\n b = (id / 16) / 6.0 + 0.25\n a = 0.8\n\n c = [r, g, b, a]\n end\n\n {\n x: p.x, y: p.y,\n color: c,\n name: p.name,\n neighbors: p.neighbors.map { |n| { x: n.x, y: n.y, color: n == p.first ? [0.9, 0.1, 0.1, 0.9] : nil } }\n }\n }\n end",
"def coordinates\n [@y_location, @x_location]\n end",
"def clockwise points\n ul = Struct.new(:x, :y).new 0, 0\n upper_left = points.min_by { |point| distance point, ul }\n until points.first == upper_left\n points = points.rotate\n end\n points\n end",
"def coords_to_pos(point)\n (size - 1 - point.y) * size + point.x\n end",
"def interpolbi pontos\n pontos = pontos.sort\n lambda do |*x|\n lagrange pontos.map {|x1, pts|\n [x1, lagrange(pts).call(x[1])]\n }.call(x[0])\n end\nend",
"def sort_points_snake(pt_a,first_dim=:x, sdir_a=[:asc,:asc], epsilon_a=[])\n\t\t# Based on first_dim , set order of sorting\n\t\tdim_a=(first_dim == :x) ? [0,1] : [1,0]\n\n\t\ttmp_h = pt_a.group_by { |ele| pt_a[dim_a[0]] }\n\n\t\tk_a=tmp_h.keys.sort\n\t\tep=epsilon_a[dim_a[0]]\n\t\t# Points within this band is consider as belong same row/col \n\t\tif (ep)\n\t\t\tcur_val=k_a.last\n\t\t\t(k_a.length-2).downto(0) { |i|\n\t\t\t\tif ( ((cur_val-k_a[i]).abs) <= ep)\n\t\t\t\t\ttmp_h[k_a[i]] += tmp_h[k_a[i+1]]\n\t\t\t\t\ttmp_h.delete(k_a[i+1])\n\t\t\t\t\tk_a[i+1]=nil\n\t\t\t\telse\n\t\t\t\t\tcur_val=k_a[i]\n\t\t\t\tend\n\t\t\t}\n\t\t\tk_a.compact!\n\t\tend\n\n\t\tk_a.reverse! if (sdir_a[dim_a[0]] == :des)\n\n\t\tflag = (sdir_a[dim_a[1]] == :asc) ? 1 : -2 \n\t\tep=epsilon_a[dim_a[1]]\n\t\tk_a.each { |k|\n\t\t\ttmp_h[k].sort! { |p1,p2| \n\t\t\t\tif ( (!ep) || ((p1[dim_a[1]]-p2[dim_a[1]]).abs > ep ) )\n\t\t\t\t\t(flag>0) ? p1[dim_a[1]] <=> p2[dim_a[1]] : p2[dim_a[1]] <=> p1[dim_a[1]]\n\t\t\t\telse\n\t\t\t\t\t0\n\t\t\t\tend\n\t\t\t}\n\t\t\tflag = ~flag\n\t\t}\n\t\tres_h={}\n\t\tk_a.each { |k| res_h[k]=tmp_h[k] }\n\t\treturn res_h\n\tend",
"def crossPointsAround\n [KBPoint.new.init([x+1,y]),KBPoint.new.init([x-1,y]),KBPoint.new.init([x,y-1]),KBPoint.new.init([x,y+1])]\n end",
"def points #:nodoc:\n [self]\n end",
"def points #:nodoc:\n [self]\n end",
"def pick_editable_points( x, y, view )\r\n tr = view.model.edit_transform\r\n ph = view.pick_helper\r\n ph.init( x, y, VERTEX_SIZE )\r\n picked = []\r\n for vertex in vertices\r\n picked << vertex if ph.test_point( vertex.position.transform( tr ) )\r\n end\r\n for point in manual_interior_points\r\n picked << point if ph.test_point( point.position.transform( tr ) )\r\n end\r\n picked.uniq\r\n end",
"def absolute_points\n points.map do |cv_pt|\n make_absolute(cv_pt.point)\n end\n end",
"def generate_coordinates(options = {})\n options[:point_distance] = width / (points.size - 1).to_f\n\n points.inject_with_index([]) do |memo, point, idx|\n x_coord = options[:point_distance] * idx\n\n if point\n relative_percent = ((point == min_value) ? 0 : ((point - min_value) / (max_value - min_value).to_f))\n y_coord = (height - (height * relative_percent))\n \n memo << [x_coord, y_coord]\n end\n \n memo\n end\n end",
"def calculate_coordinates\n (\n egde(@x1, @y1, @x2, @y1) +\n egde(@x2, @y1, @x2, @y2) +\n egde(@x2, @y2, @x1, @y2) +\n egde(@x1, @y2, @x1, @y1)\n ).uniq\n end",
"def pt___x(n, y); ptdist(n, 1.0 - y); end",
"def game_players_by_points\n game_players.sort_by{|game_player| [-game_player.points, game_player.player.email.downcase]}\n end",
"def flip_range_x(points); points.collect{ |v| Vertex.new(v.x, -v.y)}; end",
"def sort_snps\n @snps.sort!{|x,y| x.location <=> y.location}\n end",
"def inRectangle(points)\n\tpointsY = points.sort{|a, b| a[Y_COORDINATE] <=> b[Y_COORDINATE]}\n\treturn false if pointsY[0][Y_COORDINATE] > ORIGIN[Y_COORDINATE]\n\treturn false if pointsY[2][Y_COORDINATE] < ORIGIN[Y_COORDINATE]\n\tpointsX = points.sort{|a, b| a[X_COORDINATE] <=> b[X_COORDINATE]}\n\treturn false if pointsX[0][X_COORDINATE] > ORIGIN[X_COORDINATE]\n\treturn false if pointsX[2][X_COORDINATE] < ORIGIN[X_COORDINATE]\n\treturn true\nend",
"def flip_range_neg_xy(points); points.collect{ |v| Vertex.new(v.y,v.x)}; end",
"def corner_points_of_entity(x, y)\n [\n [x, y],\n [x + Entity::WIDTH - 1, y],\n [x, y + Entity::HEIGHT - 1],\n [x + Entity::WIDTH - 1, y + Entity::HEIGHT - 1],\n ]\n end",
"def coords; {:x => @x, :y => @y} end",
"def points\n []\n end",
"def get_points(x_point, y_point, slope, x_bound = 6, y_bound = 5)\n y_int = y_intercept(x_point, y_point, slope)\n x_values = [*0..x_bound]\n possible_y = [*0..y_bound]\n\n x_values.each_with_object([]) do |x, points|\n y = (slope*x) + y_int\n points << [x, y] if possible_y.include?(y)\n end\n end",
"def partition_points(points)\n points.sort_by! {|x| x[0]} #why I think my algorithm needs to be nlogn\n return points.in_groups(2)\nend",
"def pt__X_(n, y); ptdist(n, 0.5 + y); end",
"def minimal_convex_hull_2d(points)\n return points if points.empty? || points.size == 1 || points.size == 2\n\n points.sort_by! { |p| [p.x, p.y] }\n p1 = points[0]\n p2 = points.last\n up = [p1]\n down = [p1]\n\n (1...points.size).each do |i|\n point = points[i]\n if i == points.size - 1 || clockwise(p1, point, p2)\n while up.size >= 2 && !clockwise(up[up.size - 2], up[up.size - 1], point)\n up.pop\n end\n up.push(point)\n end\n\n if i == points.size - 1 || counter_clockwise(p1, point, p2)\n while down.size >= 2 && !counter_clockwise(down[down.size - 2], down[down.size - 1], point)\n down.pop\n end\n down.push(point)\n end\n end\n hull = []\n (0...up.size).each do |j|\n hull.push(up[j])\n end\n (1..(down.size - 2)).reverse_each do |j|\n puts j\n hull.push(down[j])\n end\n hull\n end",
"def <=>(point)\n raise \"Must compare to another point\" unless point.is_a? Point\n if self.x < point.x\n -1\n elsif self.x > point.x\n 1\n else\n if self.y < point.y\n -1\n elsif self.y > point.y\n 1\n else\n 0\n end\n end\n end",
"def coords_of_neighbors(x, y)\n coords_of_neighbors = []\n (x - 1).upto(x + 1).each do |neighbors_x|\n (y - 1).upto(y + 1).each do |neighbors_y|\n next if (x == neighbors_x) && (y == neighbors_y)\n coords_of_neighbors << [neighbors_x, neighbors_y]\n end\n end\n coords_of_neighbors\n end",
"def each_adj_near x, y\n (axis_range_adj y).each do |adj_y|\n (axis_range_adj x).each do |adj_x|\n unless x == adj_x && y == adj_y\n yield adj_x, adj_y\n end\n end\n end\n end",
"def events_xy(x, y)\n result = []\n for event in $game_map.events.values\n result.push(event) if event.pos?(x, y)\n end\n return result\n end",
"def map(points)\n points\n end",
"def farthest_point_along_axis(points, axis)\n PointAlongAxis.new(nil, nil, nil).tap do |farthest|\n points.each_with_index do |point, i|\n this_position = position_along_axis(axis, point)\n\n if farthest.position.nil? || this_position > farthest.position\n farthest.point = point\n farthest.index = i\n farthest.position = this_position\n end\n end\n end\n end",
"def entities_at_points(coords)\n coords.collect {|x, y| entity_at_point(x, y) }.compact.to_set\n end",
"def proefssorted\n \tproefs.order(:position)\n end",
"def <=>(other)\n if x == other.x && y == other.y\n 0\n # elsif (x < other.x && y == other.y) || (x == other.x && y < other.y) || (x < other.x && y < other.y) || (x < other.x && y > other.y)\n elsif (x < other.x && y == other.y) || (x == other.x && y > other.y) || (x < other.x && y < other.y) || (x < other.x && y > other.y)\n -1\n # elsif (x < other.x && y == other.y) || (x == other.x && y > other.y) || (x < other.x && y < other.y) || (x < other.x && y > other.y)\n elsif (x > other.x && y == other.y) || (x == other.x && y < other.y) || (x > other.x && y > other.y) || (x > other.x && y < other.y)\n 1\n end\n end",
"def minpos\n v, opts = min x: true, y: true\n x = opts[\"x\"]\n y = opts[\"y\"]\n [v, x, y]\n end",
"def edge_sort(n, points, edges)\n bottom_y = 0\n p1 = nil\n \n edge1 = Edge.new\n\n edges.next = edge1\n edge1.next = nil\n\n edges.y_top = Integer.MAX_VALUE;\n edge1.y_top = -Integer.MAX_VALUE;\n\n p1 = points.last\n bottom_y = p1.y\n\n for k in (k...n)\n if (p1.y != points[k].y)\n insert_edge(edges,p1,points[k],next_y(k,points,n));\n else\n set_dither_line(p1,points[k].x)\n end\n \n if (points[k].y < bottom_y)\n bottom_y = points[k].y\n end\n p1 = points[k];\n end\n \n return bottom_y\n end",
"def extremes\n point = @points[0]\n #puts \"next\"\n #p [point.x, point.y]\n left = right = point.x # @position.x + point.x\n top = bottom = point.y # @position.y + point.y\n @points[1..-1].each do |point|\n #p [point.x, point.y]\n x, y = point.to_a # (@position + point).to_a\n left = x if x < left\n right = x if x > right\n top = y if y < top\n bottom = y if y > bottom\n end\n #p [left, right, top, bottom]\n [left, right, top, bottom]\n end",
"def <=>(other_point)\n ret = self.x <=> other_point.x\n if ret == 0\n ret = self.y <=> other_point.y\n end\n ret\n end",
"def find_farthest_points(vertices_hash)\n @positive_x = center.x + radius\n @positive_y = center.y + radius\n # In case the convexity is pointing down the negative direction of the x or y axis.\n @negative_x = center.x - radius\n @negative_y = center.y - radius\n end",
"def find_adjacent_pts(grid, pt)\r\n pts = []\r\n for x in [pt[X] - 1, pt[X], pt[X] + 1]\r\n for y in [pt[Y] - 1, pt[Y], pt[Y] + 1]\r\n pts << [x, y] unless x < 0 or y < 0 or \r\n x == grid.n or y == grid.n or\r\n (x == pt[X] and y == pt[Y])\r\n end\r\n end\r\n \r\n pts\r\n end",
"def normalize_coords(x, y)\n x = x * -1 - 1 if x < 0\n y = y * -1 - 1 if y > -1\n [x, y]\n end",
"def ptx__x(n, y); ptdist(n, 1.0 - y / 2.0); end",
"def cells_at_points(coords)\n coords.collect {|x, y| cell_at_point(x, y) }.to_set\n end",
"def bad_find_corners(all_inputs, min_max)\n puts \"#{__method__}:: \"\n\n x_sort = all_inputs.sort_by {|_key, value| value['x']}\n y_sort = all_inputs.sort_by {|_key, value| value['y']}\n\n min_max['x_min'] = x_sort[0][1]['x']\n min_max['x_max'] = x_sort[-1][1]['x']\n min_max['y_min'] = y_sort[0][1]['y']\n min_max['y_max'] = y_sort[-1][1]['y']\n pp min_max\n\n #tr = (x - point['x']).abs + (y - point['y']).abs\n tl = min_max['y_max'] + min_max['x_max']\n tl_label = ''\n x = 0\n y = 0\n all_inputs.each do |label, point|\n d = (x - point['x']).abs + (y - point['y']).abs\n if d < tl\n tl = d\n tl_label = label\n end\n end\n\n bl = min_max['y_max'] + min_max['x_max']\n bl_label = ''\n x = 0\n y = min_max['y_max']\n all_inputs.each do |label, point|\n d = (x - point['x']).abs + (y - point['y']).abs\n if d < bl\n bl = d\n bl_label = label\n end\n end\n\n tr = min_max['y_max'] + min_max['x_max']\n tr_label = ''\n x = min_max['x_max']\n y = 0\n all_inputs.each do |label, point|\n d = (x - point['x']).abs + (y - point['y']).abs\n if d < tr\n tr = d\n tr_label = label\n end\n end\n\n br = min_max['y_max'] + min_max['x_max']\n br_label = ''\n x = min_max['x_max']\n y = min_max['y_max']\n all_inputs.each do |label, point|\n d = (x - point['x']).abs + (y - point['y']).abs\n if d < br\n br = d\n br_label = label\n end\n end\n\n puts \"tl_label #{tl_label}\"\n puts \"bl_label #{bl_label}\"\n puts \"tr_label #{tr_label}\"\n puts \"br_label #{br_label}\"\n # pp x_sort\n # pp y_sort\n\n # Top right corner is a point that has overall max X and overall min\n # Y. Find it by sorting all points by x and all points by y. Then\n # start at largest X - 1 and smallest Y and look for point that has\n # matching y and label name.\n found = false\n x_sort.reverse.each do |xlabel, xpoint|\n y_sort[0..-2].each do |ylabel, ypoint|\n #puts \"Check #{xlabel} #{xpoint} #{ylabel} #{ypoint}\"\n if (xlabel == ylabel)\n puts \" MATCH TR #{xlabel} #{xpoint}\"\n all_inputs[xlabel]['corner'] = 'TR'\n found = true\n break\n end\n end\n break if found\n end\n\n # Bottom left corner is similar to to top right.\n found = false\n x_sort[1..-1].each do |xlabel, xpoint|\n y_sort.reverse.each do |ylabel, ypoint|\n #puts \"Check #{xlabel} #{xpoint} #{ylabel} #{ypoint}\"\n if (xlabel == ylabel)\n puts \" MATCH BL #{xlabel} #{xpoint}\"\n all_inputs[xlabel]['corner'] = 'BL'\n found = true\n break\n end\n end\n break if found\n end\n\n # Top left corner\n found = false\n x_sort.each do |xlabel, xpoint|\n y_sort.each do |ylabel, ypoint|\n #puts \"Check #{xlabel} #{xpoint} #{ylabel} #{ypoint}\"\n if (xlabel == ylabel)\n puts \" MATCH TL #{xlabel} #{xpoint}\"\n all_inputs[xlabel]['corner'] = 'TL'\n found = true\n break\n end\n end\n break if found\n end\n\n # Bottom corner\n found = false\n x_sort.reverse.each do |xlabel, xpoint|\n y_sort.reverse.each do |ylabel, ypoint|\n #puts \"Check #{xlabel} #{xpoint} #{ylabel} #{ypoint}\"\n if (xlabel == ylabel)\n puts \" MATCH BR #{xlabel} #{xpoint}\"\n all_inputs[xlabel]['corner'] = 'BR'\n found = true\n break\n end\n end\n break if found\n end\n\nend",
"def entry_points\n return @entry_points.sort_by do |a| a.at(0) end\n end",
"def <=>(other)\n# Define the <=> operator\nreturn nil unless other.instance_of? Point\nself.x**2 + self.y**2 <=> other.x**2 + other.y**2\nend",
"def coords\n [x, y]\n end",
"def get_next_point(low_ys , high_ys , cur_y)\n #Current point is nearer to high_ys than low_ys\n if cur_y - low_ys.last > high_ys.last - cur_y\n high_ys << cur_y\n return low_ys.last + (cur_y - low_ys.last) * GOLDEN_RATIO\n else\n low_ys << cur_y\n return cur_y + (high_ys.last - cur_y) * GOLDEN_RATIO\n end\n end",
"def solution(x, y)\n sheep = []\n\n (0...x.size).each do |i|\n sheep.push([x[i], y[i]])\n end\n\n min_d = 123456 # larger then max position\n sheep.sort! { |x,y| (x[0]**2 + x[1]**2) <=> (y[0]**2 + y[1]**2) }\n (0..(x.size - 2)).each do |i|\n dist = (sheep[i+1][0] - sheep[i][0]).abs\n next if dist > min_d\n offset =(sheep[i+1][1] - sheep[i][1]).abs\n min_d = [min_d, [dist, offset].max].min\n end\n\n (min_d / 2).floor\nend",
"def position\n [@x, @y]\n end",
"def topological_sort(vertices)\n \nend",
"def plot_points(points = [])\n x = []\n y = []\n points << [(@parameters[:xhigh]-@parameters[:xlow])*2 + @parameters[:xhigh],\n (@parameters[:yhigh]-@parameters[:xlow])*2 + @parameters[:xhigh]] if points.empty?\n points.each do |p|\n x << p[0]\n y << p[1]\n end\n\n plot_generic(x, y, \"points pt 7\")\n end",
"def logical_pos(x, y)\n [\n (x / @tile_width).floor,\n (y / @tile_height).floor\n ]\n end",
"def < (point2)\n end",
"def to_array\n @points.collect { |p| [p.x, p.y] }\n end",
"def sort_costs(y_costs, x_costs)\n x_costs.sort!\n y_costs.sort!\n order = []\n until y_costs.empty? && x_costs.empty?\n if x_costs.empty? \n order << [y_costs.pop, \"y\"] \n elsif y_costs.empty?\n order << [x_costs.pop, \"x\"]\n elsif y_costs.last > x_costs.last \n order << [y_costs.pop, \"y\"] \n else\n order << [x_costs.pop, \"x\"]\n end\n end\n order\nend",
"def position\n [x, y]\n end",
"def getVertices( x0, y0, x1, y1) # arguments define bounding box\n\t\tw, h = x1 - x0, y1 - y0\n\t\thh = (h/2).to_i\n\n\t\t[\n\t\t\t[ hh, 0], [ w - hh, 0], [ w, hh], [ w - hh, h], [ hh, h], [ 0, hh]\n\t\t].map do |v| [ v[0] + x0, v[1] + y0 ] end.flatten\n\tend",
"def find_end_points(x, y, chip)\n end_points = @DIR_DELTAS.keys.map { |dir| end_point_in_direction(x, y, chip, dir) }\n end_points.uniq { |point| point.take(2) }\n end",
"def gather_coords(x,y)\n if y == 100\n y = 99.9\n end\n if x == 100\n x = 99.9\n end\n id = (x * 10000 + 0.5).floor * 10000 + (y * 10000 + 0.5).floor\n return id/100\nend",
"def points\n -1\n end",
"def filter_points(points)\n\t\t\tpoint_pre = nil\n\t\t\tangle_pre = nil\n\t\t\tpoints_filtered = []\n\t\t\tpoints.each do |point|\n\t\t\t\tif point_pre == nil\n\t\t\t\t\t# always keep first\n\t\t\t\t\tpoints_filtered.push(point)\n\t\t\t\telse\n\t\t\t\t\tangle_cur = Math.atan2(point[1] - point_pre[1], point[0]-point_pre[0])\n\t\t\t\t\tif angle_pre != angle_cur\n\t\t\t\t\t\tpoints_filtered.push(point)\n\t\t\t\t\telse\n\t\t\t\t\t\t# same slope as previous, keep this, remove previous\n\t\t\t\t\t\tpoints_filtered.pop()\n\t\t\t\t\t\tpoints_filtered.push(point)\n\t\t\t\t\tend\n\t\t\t\t\tangle_pre = angle_cur\n\t\t\t\tend\n\t\t\t\tpoint_pre = point\n\t\t\tend\n\t\t\treturn points_filtered\n\t\tend",
"def points\n @results.inject(0.0) { |t, r| t += r.points }\n end",
"def sortWaypoints\n if waypoints.present?\n waypoints = waypoints.sort { |a,b| a.local_index <=> b.local_index } if waypoints.present?\n end\n end",
"def print_points(points,size)\n grid = []\n for i in 0..size-1\n grid.push([])\n for j in 0..size-1\n if points.include? [j,i]\n grid.last.push(\"x\")\n else\n grid.last.push(\".\")\n end\n end\n end\n grid.reverse!\n grid.map {|x| puts x.join(\" \")}\nend",
"def top\n @x_max + @y_max\n end",
"def near_to(p)\n\t\treturn around(p).sort_by{|e| e.distance_sq_to(p)}\n\tend",
"def asteroid_relative(x,y,grid)\n\tpoints = Hash.new\n\tx_root, y_root = x, y\n\tgrid.each do |(x, y), value|\t\t\n\t\tpoints[[x,y]] = Point.from_offset(x_root, y_root, x, y)\n\tend\n\tpoints\nend",
"def products_at_point(x,y)\n -1.upto(1) do |j|\n -1.upto(1) do |k|\n unless (j == 0 && k == 0)\n product = 1\n 0.upto(ADJACENT - 1) do |factor|\n row = x + j * factor\n col = y + k * factor\n next if row < 0 || col < 0 || row >= GRID_SIZE || col >= GRID_SIZE\n product *= @grid[row][col]\n fin = factor == ADJACENT - 1\n @largest_product = product if fin && product > @largest_product\n end\n end\n end\n end\n end",
"def relative_range_era(points)\n relative_range = []\n player = $game_player\n x,y = player.x, player.y\n points.each do |v|\n relative_range.push(Vertex.new(v.x + x, v.y + y))\n end\n relative_range\n end",
"def to_xy\n [x, y]\n end",
"def <=>(other)\n if x_param == other.x_param && y_param == other.y_param\n 0\n elsif other.x_param <= x_param && other.y_param <= y_param\n 1\n else\n -1\n end\n end"
] |
[
"0.6760582",
"0.6673579",
"0.6670379",
"0.6607183",
"0.66027606",
"0.6515585",
"0.6399834",
"0.63084525",
"0.6298823",
"0.62878114",
"0.62847793",
"0.6271636",
"0.62151116",
"0.6192268",
"0.6185999",
"0.61644",
"0.6112506",
"0.61103016",
"0.60958165",
"0.6049482",
"0.6034011",
"0.60265034",
"0.6009228",
"0.59922004",
"0.5980315",
"0.59703726",
"0.59684306",
"0.5965658",
"0.58941686",
"0.58777994",
"0.5866784",
"0.5859032",
"0.57921517",
"0.57809883",
"0.5770435",
"0.5770435",
"0.57677186",
"0.5763148",
"0.576005",
"0.5746096",
"0.5734831",
"0.57173425",
"0.57137007",
"0.57121783",
"0.57007205",
"0.5687576",
"0.5684369",
"0.56603134",
"0.5635855",
"0.5625647",
"0.5621675",
"0.5618963",
"0.5613495",
"0.56097806",
"0.55994636",
"0.55878043",
"0.558185",
"0.55794543",
"0.55730367",
"0.5572133",
"0.5565175",
"0.55574024",
"0.55541545",
"0.55432266",
"0.55381024",
"0.5529598",
"0.5514175",
"0.5510907",
"0.55074894",
"0.5469259",
"0.5466214",
"0.5465754",
"0.5465426",
"0.54616696",
"0.54571795",
"0.5449052",
"0.5447601",
"0.5446118",
"0.54371923",
"0.5435536",
"0.54314965",
"0.54287595",
"0.5421532",
"0.5420916",
"0.5418464",
"0.5403378",
"0.54008913",
"0.53961945",
"0.53950083",
"0.5394071",
"0.5389562",
"0.5381557",
"0.5379329",
"0.5376793",
"0.5371146",
"0.5370759",
"0.5365225",
"0.5364311",
"0.53641415",
"0.53576404"
] |
0.54595035
|
74
|
Returns if account number is already present, else continues to generate a token
|
def generate_account_number
return if account_number.present?
self.account_number = generate_account_number_token
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def generate_account_number_token\n loop do\n token = SecureRandom.hex(3).upcase\n break token unless User.find_by(account_number: token)\n end\n end",
"def generate_auth_token\n loop do \n token = SecureRandom.hex\n break token unless self.class.exists?(auth_token: token)\n end\n end",
"def generate_unique_authentication_token\n loop do\n token = SecureRandom.hex[0..6]\n if !User.where(authentication_token: token).exists? && !EmailAuthenticationToken.where(authentication_token: token).exists?\n break token\n end\n end\n end",
"def generate_auth_token\n begin\n token = SecureRandom.hex\n end while AuthToken.exists?(auth_token: token)\n self.auth_tokens.create(auth_token: token)\n token\n end",
"def generate_token\n self.token = loop do\n random_token = SecureRandom.urlsafe_base64(nil, false)\n break random_token unless Organization.exists?(token: random_token)\n end\n end",
"def create_token\n if self.token.nil?\n self.token = loop do\n random_token = \"BON-#{SecureRandom.uuid.split('-').first}\"\n break random_token unless self.class.exists?(token: random_token)\n end\n end\n end",
"def generate_auth_token\n \tbegin\n \t\tself.auth_token = User.new_token\n \tend while self.class.exists?(auth_token: auth_token)\n end",
"def token\n begin\n self.token = SecureRandom.hex\n end while self.class.exists?(token: auth_token)\n end",
"def generate_authentication_token!\n begin\n self.auth_token = SecureRandom.hex(20)\n end while self.class.exists?(auth_token: auth_token)\n end",
"def generate_token\n begin\n self[:auth_token] = SecureRandom.urlsafe_base64\n end while User.exists?(:auth_token => self[:auth_token])\n end",
"def generate_token\n self.token ||= loop do\n random_token = SecureRandom.urlsafe_base64(nil, false)\n break random_token unless self.class.exists?(token: random_token)\n end\n end",
"def generate_token\n self.token = loop do\n random_token = SecureRandom.base58(UID_LENGTH)\n break random_token unless Session.exists?(token: random_token)\n end\n end",
"def generate_token\n loop do\n random_token = SecureRandom.urlsafe_base64(nil, false)\n break random_token unless self.class.exists?(invite_code: random_token)\n end\n end",
"def generate_access_token\n begin\n self.token = SecureRandom.hex\n end while self.class.exists?(token: token)\n end",
"def generate_access_token\n begin\n self.token = SecureRandom.hex\n end while self.class.exists?(token: token)\n end",
"def create_token\n Rails.logger.info(\"Enter Create Token\")\n \n # create token\n token = GenerateToken.unique_token\n access_token = self.create_access_token( token: token, role: {})\n raise et(\"account.create_token_failed\") if access_token.blank?\n\n true\n rescue => e \n Rails.logger.error(\"**** ERROR **** #{e.message}\")\n end",
"def generate_authentication_token\n\t\tloop do\n\t\t\ttoken = SecureRandom.base64.tr('+/=', 'Qrt')\n\t\t\tbreak token unless User.exists?(authentication_token: token)\n\t\tend\n\tend",
"def generate_token\n loop do\n token = SecureRandom.base64(44).tr(\"+/=\", \"xyz\").first(16).upcase\n break token unless self.class.where(:token => token).first\n end\n end",
"def generate_token\n loop do\n self.token = SecureRandom.hex(64)\n break if Follower.where(token: token).empty?\n end\n end",
"def generate_token\n unless self.token\n self.token = loop do\n random_token = SecureRandom.urlsafe_base64(nil, false)\n break random_token unless User.exists?(token: random_token)\n end\n self.save\n end\n end",
"def token\n return self[:token] if self[:token] # <- Will not generate a token more than once.\n begin\n byte_string = [self.user_id, rand(2**32)].pack('L*') << rand(256)\n self[:token] = Base64.urlsafe_encode64(byte_string)\n end while UserAuthToken.exists?(token: self[:token])\n end",
"def generate_auth_token!\n \tbegin\n \t\tself.auth_token = Devise.friendly_token\n \tend while User.exists?(auth_token: auth_token)\n\tend",
"def generate_token\n\t\tself.token = loop do\n\t\t\trandom_token = SecureRandom.urlsafe_base64(nil, false)\n\t\t\tbreak random_token unless Invite.exists?(token: random_token)\n\t\tend\n\tend",
"def generate_token\n # Repeat method until unique token is found\n self.token = loop do\n random_token = (Digest::MD5.hexdigest \"#{SecureRandom.hex(10)}-#{DateTime.now.to_s}\")[1..16]\n break random_token unless Bar.where(token: random_token).exists?\n end\n end",
"def generate_token\n begin\n self.token = Digest::SHA1.hexdigest([Time.now, rand].join)\n end while Invitation.exists?(:token => self.token)\n end",
"def generate_token\n loop do\n new_token = Digest::SHA1.hexdigest([Time.now, rand].join).first(35)\n break self.token = new_token unless InvitationLink.where(:token => new_token).exists?\n end\n end",
"def assign_unique_token\n unless(self.token)\n begin\n self.token = rand(36**8).to_s(36).downcase # a-z \n end while self.class.exists?(:token => token)\n end\n end",
"def generate_auth_token!\n begin\n self.auth_token = Devise.friendly_token\n end while self.class.exists?(auth_token: auth_token)\n end",
"def auth_token(client_token = '')\n\t\tif self.authen_token == client_token\n\t\t\treturn true\n\t\telse\n\n self.wrong_token_time += 1\n #debugger\n self.save\n if self.wrong_token_time >= 3\n self.generate_token\n end\n \n return false\n\t\tend\t\n\tend",
"def token_generate\n res = call('auth.token_generate')\n\n return unless res || res['token']\n\n res['token']\n end",
"def generate_authentication_token\n loop do\n token = generate_secure_token_string\n break token unless User.where(:authentication_token=>token).first\n end\n end",
"def new_account_number\n return rand(99999999)\n end",
"def new_account_number\n return rand(99999999)\n end",
"def generate_token\n\t\t\tself.id_token ||= SecureRandom.hex(8) \n\t\t\tif Appointment.exists?(:id_token => id_token)\n\t\t\t\tself.id_token = nil\n\t\t\t\traise\n\t\t\tend\t\t\t\n\t\trescue Exception => e\n\t\t\t@token_attempts = @token_attempts.to_i + 1\n\t\t\tputs \"Record not unique \" + @token_attempts.to_s\n\t\t\tretry if @token_attempts < MAX_RETRIES\n\t\t\traise e, \"#{I18n.t(:professional)}: #{I18n.t(:create_unsuccess)} #{I18n.t(:uniqueness_unsuccess)}\"\n\t\tend",
"def check_auth_token\n generate_authentication_token! if new_record? || user_status_id_changed?\n end",
"def generate_access_token\n begin\n self.access_token = SecureRandom.hex\n end while self.class.exists?(access_token: access_token)\n end",
"def generate_access_token\n begin\n self.access_token = SecureRandom.hex\n end while self.class.exists?(access_token: access_token)\n end",
"def generate_access_token\n begin\n self.access_token = SecureRandom.hex\n end while self.class.exists?(access_token: access_token)\n end",
"def generate_access_token\n begin\n self.access_token = SecureRandom.hex\n end while self.class.exists?(access_token: access_token)\n end",
"def check_token\n input_token = request.headers['X-Auth-Token'] || params[:token]\n return unless input_token\n\n token = AuthenticationToken.find_by(token: input_token)\n return unless token\n\n # Count token usage\n token.inc(number_of_use: 1)\n # Update the updated_at because inc doesn't do it\n token.set(updated_at: Time.now.getlocal)\n\n # Sign in\n sign_in token.user\n end",
"def generate_token\n begin\n token = Other::TokenGenerator.call(25).value_or('')\n end until !User.where(token: token).nil?\n self.bf_api_token = token\n end",
"def generate_access_token\n begin\n self.access_token = User.new_token\n end while ApiKey.exists?(access_token: access_token)\n end",
"def keep_or_generate_token!\n if api_token.nil? || api_token.empty?\n self.api_token = loop do\n random_token = SecureRandom.urlsafe_base64(nil, false)\n break random_token unless User.exists?(api_token: random_token)\n end\n update_column(:api_token, api_token) unless new_record?\n end\n end",
"def private_generate_token\n begin\n #self.access_id = SecureRandom.base64(40)\n\t self.access_id = SecureRandom.hex(40)\n end while self.class.exists?(access_id: access_id)\n end",
"def populate_token\n if new_record? && self.token.nil?\n self.token = SecureRandom.uuid().to_s.last(8)\n while check_token?(self.token) == true\n self.token = SecureRandom.uuid().to_s.last(8)\n end\n end\n end",
"def valid_token\n # generate the token\n self.token=Digest::MD5.hexdigest(\"#{Time.now}-#{self.ad_id}-#{self.publisher_id}\")\n\n # Aux var to the ValidatorLoop\n counter = 0\n\n # Loop which validate the token on the DB\n while true do\n another_access = Access.where(token: self.token).take\n break if another_access.nil?\n self.token=\"#{self.token}#{counter}\"\n counter=counter+1\n end\n end",
"def token_based?\n @userId && @authToken && !@authToken.empty?\n end",
"def generate_authentication_token!\n begin\n self.auth_token = Devise.friendly_token\n end while User.exists?(auth_token: auth_token)\n end",
"def generate_authentication_token!\n begin\n self.auth_token = Devise.friendly_token\n end while User.exists?(auth_token: auth_token)\n end",
"def generate_token\n self.token = custom_token.presence || SecureRandom.hex(3)\n self.custom_token = nil\n generate_token if AliasedLink.exists?(token: token)\n end",
"def unique_token\n token = random_string\n loop do\n break unless Coupon.match_token?(token)\n token = random_string\n end\n token\n end",
"def generate_authentication_token!\n begin\n self.auth_token = Devise.friendly_token\n end while self.class.exists?(auth_token: auth_token)\n end",
"def generate_authentication_token!\n begin\n self.auth_token = Devise.friendly_token\n end while self.class.exists?(auth_token: auth_token)\n end",
"def generate_authentication_token!\n begin\n self.auth_token = Devise.friendly_token\n end while self.class.exists?(auth_token: auth_token)\n end",
"def generate_authentication_token!\n begin\n self.auth_token = Devise.friendly_token\n end while self.class.exists?(auth_token: auth_token)\n end",
"def valid_token?\n # we check against a copy invitation object\n match = Invitation.find_by_token(self.token)\n \n if !match\n errors.add :token, 'not found'\n return false\n elsif User.registered.find_by_invitation_id(match)\n errors.add :token, 'already used'\n return false\n end\n \n true\n end",
"def generate_authentication_token!\n begin\n self.auth_token = Devise.friendly_token\n end while self.class.exists?(auth_token: self.auth_token)\n end",
"def get_token\n if @token && @valid_until && @valid_until > Time.now + 10\n @token\n else\n renew_token\n end\n end",
"def generate_token\n if self.token.blank?\n self.id = self.token = UniqueToken.generate\n end\n end",
"def generate_token\n self.card_token = SecureRandom.uuid unless card_token && card_token.length > 0\n end",
"def next_available_token_id\n raise \"Not yet implemented\"\n # implementation idea: list token ids owned by our backend (ie the public key associated w/ AIRDROP_PRIVATE_KEY)\n # https://ethereum.stackexchange.com/questions/54959/list-erc721-tokens-owned-by-a-user-on-a-web-page\n #\n # return nil unless we find a token id that can be delivered\n end",
"def keep_or_generate_token!\n return if api_token.present?\n\n generate_token! unless new_record?\n end",
"def ensure_token_uniqueness\n self.session_token = generate_token\n while User.find_by(session_token: self.session_token)\n self.session_token = generate_token\n end\n self.session_token\n end",
"def generate_authentication_token!\n\tbegin\n\t\tself.auth_token = Devise.friendly_token\n\tend while self.class.exists?(auth_token: auth_token)\nend",
"def generate_token\n self.token = Digest::MD5.hexdigest(\"PersonRecordToken#{email}#{Rails.application.config.try(:hash_salt)}\")[0..254]\n end",
"def requested_account_authorized?\n session[:_bookingsync_account_id].blank? ||\n session[:_bookingsync_account_id] == session[:account_id]\n end",
"def generate_token\n self.token = UniqueToken.generate\n end",
"def generate_identifier_token\n self.identifier_token ||= loop do\n token = ('%015i' % random_number)\n break token unless self.class.find_by_identifier_token(token)\n end\n\n self.twilio_conference_name ||= identifier_token\n end",
"def generate_authentication_token\n loop do\n self.authentication_token = SecureRandom.base64(64)\n break if !Admin::User.find_by(authentication_token: authentication_token)\n end\n end",
"def generate_token\n\t\t@pending_invite = Invitation.find_by_recipient_phone(self.recipient_phone)\n\t self.token = @pending_invite.try(:token) || Forgery('name').last_name + sender_id.to_s\n\tend",
"def generate_auth_token!\n loop do\n @token = Devise.friendly_token\n break unless Token.find_by(token: @token)\n end\n self.tokens.create token: @token\n return @token\n end",
"def generate_tokens\n self.token = loop do\n random_token = SecureRandom.urlsafe_base64(nil, false)\n break random_token unless User.exists?(token: random_token)\n end\n self.owner_token = loop do\n random_token = SecureRandom.urlsafe_base64(nil, false)\n break random_token unless User.exists?(owner_token: random_token)\n end\n end",
"def generate_invite_token\n self.invite_token = Devise.friendly_token(INVITE_CODE_LENGTH)\n rescue ActiveRecord::RecordNotUnique => e\n @token_attempts = @token_attempts.to_i += 1\n retry if @token_attempts < INVITE_MAX_RETRIES\n raise e, \"Retries exhausted, could not find a unique token\"\n end",
"def generate_token\n self.token = loop do\n random_token = SecureRandom.urlsafe_base64(nil, false)\n break random_token unless FeedbackRequest.exists?(token: random_token)\n end\n end",
"def validate_token\n return success if @token.blank?\n\n service_response = UserManagement::DoubleOptIn.new({client: @client, t: @token, user_id: @user_id}).perform\n #TODO: user_token_sale_state should be sent to web.\n return unauthorized_access_response('um_gbd_2') unless service_response.success?\n @user.reload\n\n @account_activated = true if (@user_token_sale_state != @user.get_token_sale_state_page_name &&\n @user_token_sale_state == GlobalConstant::User.get_token_sale_state_page_names(\"verification_page\"))\n\n @user_token_sale_state = @user.get_token_sale_state_page_name\n success\n end",
"def create_authentication_token!\n begin\n self.authentication_token = User.token\n end while User.exists?(authentication_token: self.authentication_token)\n end",
"def generate_authentication_token\n begin\n self.access_token = Devise.friendly_token\n end while self.class.exists?(access_token: access_token)\n end",
"def ensure_token\n if self.token_expiration and Time.now > self.token_expiration\n self.token = nil\n end\n self.token ||= self.generate_token\n self.token_expiration = Time.now + 1.day\n self.save\n return self.token\n end",
"def account_number\n @account_number ? @account_number.to_s.delete('-') : nil\n end",
"def check_token card, token, model\n if token && model.user.acct_token\n Payment::assign_card card, model, token\n card.token = token\n result = card.save\n else\n result = card.save_account \n end\n end",
"def generate_api_key\n loop do\n token = SecureRandom.base64.tr('+/=', 'Qrt')\n break token unless User.exists?(api_key: token)\n end\n end",
"def generate_api_key\n loop do\n token = SecureRandom.base64.tr('+/=', 'Qrt')\n break token unless User.exists?(api_key: token)\n end\n end",
"def generate_api_key\n loop do\n token = SecureRandom.base64.tr('+/=', 'Qrt')\n break token unless User.exists?(api_key: token)\n end\n end",
"def token_account\n return {} unless token\n if token.respond_to?(:account)\n token.account\n elsif token.kind_of?(Hash) && token['account'].kind_of?(String)\n config.find_account(token['account'])\n else\n {}\n end\n rescue => ex\n error { \"Access token refresh exception\" }\n error { ex }\n false\n end",
"def generate_account\n self.account = Account.create(:name => self.email) unless account\n end",
"def random_account_number\n acct_num = rand(10**11).to_s.rjust(11, '1')\n return acct_num\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 alpha_invited?\n unless Token.exists?(:value => email)\n errors.add :email, \"is not on our alpha list\" \n end\n end",
"def create_unique_id\n\t\tself.unique_id = loop do\n\t\t\trandom_token = SecureRandom.urlsafe_base64\n\t\t\tbreak random_token unless User.exists?(unique_id: random_token)\n\t\tend\n\tend",
"def generate_api_key\n loop do\n token = SecureRandom.base64.tr('+/=', 'RST')\n break token unless User.exists?(api_key: token)\n end\n end",
"def auth_token\n return token if token.present?\n\n false\n # raise(CustomException::MissingToken, 'token is missing')\n end",
"def generate_token!(column)\n attempts = 3\n\n begin\n token = SecureRandom.urlsafe_base64(24)\n update_column(column, token)\n rescue ActiveRecord::RecordNotUnique\n retry if (attempts -= 1) > 0\n end\n\n send(column) == token\n end",
"def generate_api_key\n\t\tloop do\n\t\t\ttoken = SecureRandom.base64.tr('+/=', 'Qrt')\n\t\t\tbreak token unless User.exists?(api_key: token)\n\t\tend\n\tend",
"def generate_account\n toll_free = @client.available_phone_numbers('US').toll_free.list(limit: 1)\n\n toll_free.each do |record|\n \n incoming_phone_number = @client.incoming_phone_numbers.create(phone_number: record.phone_number)\n\n puts incoming_phone_number.sid\n end\n\n \n end",
"def have_account?\n false\n end",
"def get_account_id\n num = rand(111111111..999999999)\n id = sprintf(\"%09d\", num)\n id.to_s\n end",
"def generate_utoken\n self.utoken = loop do\n random_token = SecureRandom.base58(UTOKEN_LENGTH)\n break random_token unless Session.exists?(utoken: random_token)\n end\n end",
"def one_active_token\n return true if self.class.for_user_and_service(user: user, service: external_service_name).nil?\n\n errors.add(:access_token, _('only one active access token allowed per user / service'))\n end",
"def valid_new_token?(token)\n unique_token?(token) && token_looks_safe?(token)\n end",
"def generate_authentication_token\n loop do\n token = Devise.friendly_token\n break token unless self.class.exists?(authentication_token: token)\n end\n end"
] |
[
"0.7797333",
"0.7063733",
"0.6776236",
"0.6755165",
"0.6741222",
"0.670835",
"0.6672453",
"0.66361755",
"0.6619657",
"0.6612816",
"0.6607426",
"0.65576863",
"0.65078455",
"0.6486288",
"0.6486288",
"0.6439464",
"0.64173603",
"0.6401108",
"0.6376855",
"0.637618",
"0.6359196",
"0.6351443",
"0.6344189",
"0.63107806",
"0.6306598",
"0.62573254",
"0.62208533",
"0.62077075",
"0.6190591",
"0.6180683",
"0.6140157",
"0.612076",
"0.612076",
"0.61161435",
"0.6112459",
"0.6096515",
"0.6096515",
"0.6096515",
"0.6096515",
"0.6092216",
"0.6080475",
"0.6057793",
"0.6056203",
"0.604541",
"0.601644",
"0.6007062",
"0.6005272",
"0.5953381",
"0.5953381",
"0.5935246",
"0.59277946",
"0.5926501",
"0.5926501",
"0.5926501",
"0.5926501",
"0.59230494",
"0.5903184",
"0.58881176",
"0.58876956",
"0.5885294",
"0.5858969",
"0.5843387",
"0.5838232",
"0.5832819",
"0.58266187",
"0.5822732",
"0.5818864",
"0.5813622",
"0.5810021",
"0.58026636",
"0.57995677",
"0.57888955",
"0.5779417",
"0.5776588",
"0.5775859",
"0.5765689",
"0.5756097",
"0.5755638",
"0.5754954",
"0.5751289",
"0.5750548",
"0.5750548",
"0.5750548",
"0.57449764",
"0.5744558",
"0.5744374",
"0.574344",
"0.5733079",
"0.57305795",
"0.5729369",
"0.5716636",
"0.57095045",
"0.5689108",
"0.5688791",
"0.5688454",
"0.5685868",
"0.56814927",
"0.5680152",
"0.56765914",
"0.5675558"
] |
0.7640776
|
1
|
SecureRandom.hex(3) gives a 6 character long alphanumeric string which will be upcased before saving. If we want to change the length of account number, change the number here. The character length will be twice the number_of_bytes that we pass in as argument. SecureRandom.hex(3) => "2c1083" SecureRandom.hex(4) => "2bb093ed"
|
def generate_account_number_token
loop do
token = SecureRandom.hex(3).upcase
break token unless User.find_by(account_number: token)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"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 random_hex(len=16)\n raise NotImplementedError\n SecureRandom.hex(len)\nend",
"def new_account_number\n return rand(99999999)\n end",
"def new_account_number\n return rand(99999999)\n end",
"def random_account_number\n acct_num = rand(10**11).to_s.rjust(11, '1')\n return acct_num\n end",
"def get_account_id\n num = rand(111111111..999999999)\n id = sprintf(\"%09d\", num)\n id.to_s\n end",
"def gen_random_hex(len)\n (1..len).inject(\"\"){|str| str += rand(16).to_s(16)}\nend",
"def generateRandomString ()\n return SecureRandom.hex(4)\nend",
"def build_hash_code\n\t\tSecureRandom.hex(8) + (Time.now.to_f * 1000).to_i.to_s\n\tend",
"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 random_hex_string_upto_length(max_length)\r\n length = random_integer(max_length)\r\n random_hex_string_of_length(length)\r\n end",
"def generate_random_id\n len = 8\n chars = (\"a\"..\"z\").to_a + (\"A\"..\"Z\").to_a + (\"0\"..\"9\").to_a\n newpass = \"\"\n 1.upto(len) { |i| newpass << chars[rand(chars.size-1)] }\n return newpass\n end",
"def identifier\n SecureRandom.hex(16)\n end",
"def get_random_identifier\n SecureRandom.hex\n end",
"def password(length=20)\n SecureRandom.base64(length+2).tr('=', '')\n end",
"def generate_code(code_length=6)\n chars = (\"a\"..\"z\").to_a + (\"1\"..\"9\").to_a \n new_code = Array.new(code_length, '').collect{chars[rand(chars.size)]}.join\n Digest::MD5.hexdigest(new_code)[0..(code_length-1)].upcase\n end",
"def rand_string(length = 10)\r\n rand(36**length).to_s(36)\r\n end",
"def rand_pass(length=8)\n return rand(36**length).to_s(36)\nend",
"def rand_string(length = 10)\n rand(36**length).to_s(36)\n end",
"def rand_string(length = 10)\n\t\trand(36**length).to_s(36)\n\tend",
"def generate_password\r\n return rand(36 ** 20).to_s(36)\r\n end",
"def random_name\n SecureRandom.hex(20)\n end",
"def hexadecimal(digits: 6)\n hex = ''\n digits.times { hex += rand(15).to_s(16) }\n hex\n end",
"def generate_account_number\n return if account_number.present?\n self.account_number = generate_account_number_token\n end",
"def randstr\n\trand(36 ** 8).to_s(36)\nend",
"def random_string(length)\n rand(36**length).to_s(36)\n end",
"def generate_password( len = 6 )\n charset = %w{ 2 3 4 6 7 9 A C D E F G H J K M N P Q R T V W X Y Z a c d e g h j k m n p q r v w x y z }\n (0...len).map{ charset.to_a[rand(charset.size)] }.join\nend",
"def generate_id\n SecureRandom.hex(8)\n end",
"def random_id\n \"#{('a'..'z').to_a.sample}-#{SecureRandom.alphanumeric(6)}\"\n end",
"def generate_password\n [*('a'..'z'), *('A'..'Z'), *('0'..'9')].sample(8).join\n end",
"def generate_random_token\n SecureRandom.hex(15)\n end",
"def generate_password\n password = [('a'..'z'), ('A'..'Z'),(0..9)].map { |i| i.to_a }.flatten\n (8...32).map { password[rand(password.length)] }.join\n end",
"def ran_str_maker\r\n length = 10\r\n ran_str = rand(36**length).to_s(36)\r\n return ran_str\r\nend",
"def gen_id\n SecureRandom.hex(32)\n end",
"def generate_password\n charset = %w{ 2 3 4 6 7 9 A C D E F G H J K M N P Q R T V W X Y Z @ # $ & ! }\n (0...6).map{ charset.to_a[rand(charset.size)] }.join\n end",
"def assign_uid\n chars = ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a\n uid = ''\n 1.upto(8) {\n i = rand(62)\n uid += chars[i]\n }\n self.uid = uid\n end",
"def random_hex_string_of_length(length)\r\n str = ''\r\n # Binary length is double in ASCII\r\n 1.upto(length*2) do\r\n str << HEX_CHARS[rand(HEX_CHARS.size)]\r\n end\r\n str\r\n end",
"def generate_backup_code\n ROTP::Base32.random_base32(16).scan(/.{1,4}/).join('-')\n end",
"def create_password(length)\n chars = ('a' .. 'z').to_a + ('1' .. '9').to_a + '%$?@!'.split(//)\n Array.new(length, '').collect { chars[rand(chars.size)] }.join\nend",
"def random_chars(length = 64)\n return rand(36**length).to_s(36)\nend",
"def generate_token\n SecureRandom.hex(10)\n end",
"def generate\n @password = (1..@length).map { (33 + rand(89)).chr }.join \n check_password_contents\n @password\n end",
"def random_string2(str_length=4)\n chars = 'abcdef0123456789'\n password = ''\n str_length.times { password << chars[rand(chars.length)] }\n password\nend",
"def generate_password(length=6)\n chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ23456789'\n password = ''\n length.times { |i| password << chars[rand(chars.length)] }\n password\n end",
"def generate_new_password\n chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'\n password = ''\n 10.times { password << chars[rand(chars.size)] }\n self.update_attributes(:encrypted_password => User.encrypt(password, self.salt))\n UserMailer.deliver_forgot_password_mail(self, password)\n password\n end",
"def make_up_password\n\to = [('a'..'z'), ('A'..'Z'), ('0'..'9')].map { |i| i.to_a }.flatten\n\tpass = (0...12).map { o[rand(o.length)] }.join + \"@\"\n\tputs \"Using #{pass} for password\\n\"\n\treturn pass\nend",
"def create_uuid\n hex = (\"a\"..\"f\").to_a\n (0..9).each{|num| hex << num.to_s}\n \n uuid = \"\"\n uuid_format = [8,4,4,4,12]\n uuid_format.each do |num|\n num.times{ uuid += hex.sample}\n uuid += \"-\" if uuid.length < 36\n end\n uuid\nend",
"def make_hash\n chars = (\"a\"..\"z\").to_a + (\"A\"..\"Z\").to_a + (\"0\"..\"9\").to_a\n string = \"\"\n 20.times do\n string << chars[rand(chars.size-1)]\n end\n hash = Digest::SHA2.hexdigest(string)\n end",
"def generate_uuid\n hex = []\n (0..9).each { |i| hex << i.to_s }\n ('a'..'f').each { |l| hex << l }\n\n result = []\n sections = [8, 4, 4, 4, 12]\n\n sections.each do |num|\n num.times do \n result << hex[rand(16)]\n end\n result << '-'\n end\n\n result.join.chop\nend",
"def gen_uuid\n arr = [('a'..'f'), (0..9)].map{|i| i.to_a}.flatten\n uuid = \"\"\n 8.times {uuid << arr[rand(16)].to_s} ; uuid << \"-\"\n 3.times {4.times {uuid << arr[rand(16)].to_s} ; uuid << \"-\"}\n 12.times {uuid << arr[rand(16)].to_s}\n uuid\nend",
"def generate_random_token\n #generates a random hex string of length 5\n unless self.random_token\n self.random_token = SecureRandom.hex(5)\n end\n end",
"def random_token\n SecureRandom.hex(20)\n end",
"def make_uuid()\n uuid = \"\"\n 8.times { uuid << rand(16).to_s(16) }\n uuid << \"-\"\n 3.times do\n 4.times { uuid << rand(16).to_s(16) }\n uuid << \"-\"\n end\n 12.times { uuid << rand(16).to_s(16) }\n \n uuid\nend",
"def generate_four_hexes\n hexadecimals = 'abcdef0123456789'\n rand_hexes = ''\n 4.times do |x|\n rand_hexes << hexadecimals[rand(16)]\n end\n rand_hexes\nend",
"def upgrade_user_code\n # duplicate user_code is disallowed but it's\n # impossible to get a duplicate new code here\n new_code = SecureRandom.hex(32)\n self.user_code = new_code\n save\n new_code\n end",
"def generate_unique_mac\n sprintf('b88d12%s', (1..3).map{\"%0.2X\" % rand(256)}.join('').downcase)\n end",
"def generate_key\n SecureRandom.hex(32)\nend",
"def generate_random_hex_key(length: key_length)\n generate_random_key(length: length).unpack(\"H*\")[0]\n end",
"def uuid\n hex = ((0..15).to_a).zip((('0'..'9').to_a).concat(('a'..'f').to_a)).to_h\n result = \"\"\n 32.times do\n result << hex[rand(0..15)]\n end\n result.insert(8, '-')\n result.insert(13, '-')\n result.insert(18, '-')\n result.insert(23, '-')\n result\nend",
"def _my_mkpass()\n mymkpass = ''\n 9.to_i.times{ mymkpass << (65 + rand(25)).chr }\n return mymkpass\nend",
"def create_uuid\n characters = [*'a'..'f', *'0'..'9']\n \"#{characters.sample(8).join}-#{characters.sample(4).join}-#{characters.sample(4).join}-#{characters.sample(4).join}-#{characters.sample(12).join}\"\nend",
"def random_code(len)\n #generat a random password consisting of strings and digits\n chars = (\"a\"..\"z\").to_a + (\"A\"..\"Z\").to_a + (\"0\"..\"9\").to_a\n newcode = \"\"\n 1.upto(len) { |i| newcode << chars[rand(chars.size-1)] }\n return newcode\n end",
"def random_uid\n SecureRandom.hex 5\n end",
"def generate_UUID\n characters = []\n (0..9).each { |digit| characters << digit.to_s }\n ('a'..'f').each { |digit| characters << digit }\n\n uuid = \"\"\n sections = [8, 4, 4, 4, 12] # integers representing the number of characters in each section\n sections.each_with_index do |section, index|\n section.times { uuid += characters.sample }\n uuid += '-' unless index >= sections.size - 1 # index >= 4\n end\n\n uuid\nend",
"def random_suffix\n length = 10\n SecureRandom.random_number(36 ** length).to_s(36).rjust(length, '0')\n end",
"def short_uuid\n rand(36**8).to_s(36)\n end",
"def random_string(length); random_bytes(length / 2).unpack(\"H*\")[0] end",
"def generate_uuid\n hexadecimals = ('0'..'9').to_a.concat(('a'..'f').to_a)\n uuid = ''\n\n 32.times do\n uuid += hexadecimals.sample\n end\n uuid.insert(8, '-').insert(13, '-').insert(18, '-').insert(23, '-')\nend",
"def friendly_token(length = 20)\n # To calculate real characters, we must perform this operation.\n # See SecureRandom.urlsafe_base64\n rlength = (length * 3) / 4\n SecureRandom.urlsafe_base64(rlength).tr('lIO0', 'sxyz')\n end",
"def generate_auth\n self.auth = SecureRandom.hex(32)\n end",
"def secret_number\n\tnumber = '8'\nend",
"def password\n Digest::MD5.hexdigest(uuid)[0..9]\n end",
"def make_uuid()\n hex_set = %w(a b c d e f 1 2 3 4 5 6 7 8 9)\n uuid_string = ''\n counter = 1 \n 5.times do\n case counter\n when 1\n hex = 8\n when (2..4)\n hex = 4\n when 5\n hex = 12\n end \n hex.times { uuid_string << hex_set[rand(hex_set.size)] } \n uuid_string << '-' unless counter == 5\n counter += 1\n end\n uuid_string\nend",
"def unique_identifier\n Digest::MD5.hexdigest(@name.to_s)[0..9]\n end",
"def create_new_salt\n self.password_salt = [Array.new(6){rand(256).chr}.join].pack(\"m\").chomp\n end",
"def uuid()\n 8.times.map { [*'0'..'9', *'a'..'f'].sample }.join + \"-\" + \\\n 4.times.map { [*'0'..'9', *'a'..'f'].sample }.join + \"-\" + \\\n 4.times.map { [*'0'..'9', *'a'..'f'].sample }.join + \"-\" + \\\n 4.times.map { [*'0'..'9', *'a'..'f'].sample }.join + \"-\" + \\\n 12.times.map { [*'0'..'9', *'a'..'f'].sample }.join\nend",
"def rand_uuid\n [8,4,4,4,12].map {|n| rand_hex_3(n)}.join('-').to_s\nend",
"def rand_uuid\n [8,4,4,4,12].map {|n| rand_hex_3(n)}.join('-').to_s\nend",
"def rand_text_hex(length, bad=payload_badchars)\n if debugging?\n rand_text_debug(length, '0')\n else\n Rex::Text.rand_text_hex(length, bad)\n end\n end",
"def generateCode()\n require 'securerandom'\n return SecureRandom.hex\n end",
"def uuid\n char = (0..9).collect { |n| n.to_s }\n char += ('a'..'f').to_a\n blocks = [8,4,4,4,12]\n \n uuid = ''\n blocks.each do |num|\n while num >= 0\n uuid << char.sample\n num -= 1\n end\n uuid += '-' \n end\n uuid.chop\nend",
"def generate_token\n SecureRandom.hex(64)\nend",
"def generate_code\n self.code = Digest::SHA1.hexdigest(\"--#{Time.now.to_s}--#{user_id}--#{rand(256)}\")[0,32]\n end",
"def generate_uid(io)\n SecureRandom.hex(30)\n end",
"def gen_int_phone_num\n \"011-#{rand(100) + 1}-#{rand(100) + 10}-#{rand(1000) + 1000}\"\nend",
"def create_uuid()\n characters = []\n ('a'..'z').each { |let| characters << let}\n ('0'..'9').each { |num| characters << num}\n\n uuid = \"\"\n sections = [8, 4, 4, 4, 12]\n sections.each_with_index do |num, index|\n num.times { uuid += characters.sample }\n uuid += '-' unless index >= sections.size - 1\n end\n\n uuid\nend",
"def generate_uuid\n\t\t\t\tSecureRandom.hex(5)\n\t\t\tend",
"def generate_and_send_new_password\n new_password = \"\"\n chars = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!#,.;:?%&\".split(//)\n (0..8).each do |i|\n new_password += chars.at(rand(chars.length))\n end\n self.update_attributes(:password => new_password)\n save!\n AdminMailer.password_reset(self, new_password).deliver\n new_password\n end",
"def generate_password!(model:, **)\n model.password = SecureRandom.urlsafe_base64(8)\n end",
"def create_UUID\n characters =[]\n (0..9).each { |digit| characters << digit.to_s }\n ('a'..'f').each { |digit| characters << digit }\n\n uuid = \"\"\n sections = [8, 4, 4, 4, 12]\n sections.each_with_index do |section, index|\n section.times { uuid += characters.sample }\n uuid += '-' unless index >= section.size - 1\n end\n\n uuid\nend",
"def salt\n # 72 bits\n SecureRandom.hex(9)\n end",
"def random_token\n 32.times.map{ rand(36).to_s(36) }.join # 32 alphanumeric characters\n end",
"def generate_UUID\n characters = []\n (0..9).each{ | digit | characters << digit.to_s}\n ('a'..'f').each{ | digit | characters << digit}\n\n uuid = \"\"\n sections = [8, 4, 4, 4, 12]\n sections.each_with_index do |section, index|\n section.times{ uuid += characters.sample }\n uuid += '-' unless index >= sections.size - 1\n end\n\n return uuid\n end",
"def random_password\n chars = (\"a\"..\"z\").to_a + (\"A\"..\"Z\").to_a + (\"0\"..\"9\").to_a\n password = ''\n #40.times { |i| password << chars[rand(chars.size-1)] }\n 15.times { |i| password << chars[rand(chars.size-1)] }\n self.password = password\n self.password_confirmation = password\n self.pwd = password\n self\n end",
"def generate_guid(length = 16)\n guid = case length\n when 16\n rand(MAX_RAND_16)\n when 32\n rand(MAX_RAND_32)\n else\n rand(16**length)\n end.to_s(16)\n guid.length < length ? guid.rjust(length, '0') : guid\n end",
"def generate_password\n self.password = random_string(32)\n self.e_password = Digest::SHA256.hexdigest(self.password)\n end",
"def create_uuid\n characters = []\n (0..9).each { |digit| characters << digit.to_s }\n ('a'..'f').each { |digit| characters << digit }\n \n uuid = \"\"\n sections = [8, 4, 4, 4, 12]\n sections.each_with_index do |section, index|\n section.times { uuid += characters.sample }\n uuid += '-' unless index >= sections.size - 1\n end\n \n uuid\nend",
"def new_uuid\n uuid_arr = []\n ('a'..'f').each {|char| uuid_arr << char}\n (0..9).each {|num| uuid_arr << num.to_s}\n\n uuid = \" \"\n uuid_arr.sample\n\nend",
"def generate_phone_verification_code\n verification_code = SecureRandom.hex(3)\n verification_code\n end",
"def generate_seed\n update(seed: SecureRandom.hex(16))\n end"
] |
[
"0.7158446",
"0.712532",
"0.7117916",
"0.7117916",
"0.7103283",
"0.70025915",
"0.6944367",
"0.6851234",
"0.68287796",
"0.68034685",
"0.67911935",
"0.6709046",
"0.66102356",
"0.66062856",
"0.66043776",
"0.66009974",
"0.65993917",
"0.6586957",
"0.6582496",
"0.6579175",
"0.65467775",
"0.6534128",
"0.6524593",
"0.65024394",
"0.6500421",
"0.6493429",
"0.6491221",
"0.6488618",
"0.6470648",
"0.64612734",
"0.645475",
"0.64249104",
"0.64166105",
"0.64137113",
"0.64079636",
"0.64040834",
"0.63977945",
"0.63972133",
"0.6386365",
"0.63631636",
"0.63611126",
"0.63118017",
"0.63082236",
"0.6297017",
"0.6292781",
"0.628827",
"0.62763983",
"0.6271404",
"0.62650776",
"0.62647086",
"0.62602645",
"0.625753",
"0.6257018",
"0.6248932",
"0.62486845",
"0.6244357",
"0.62363136",
"0.6233052",
"0.6232224",
"0.62182283",
"0.6216854",
"0.6211458",
"0.61939675",
"0.6186976",
"0.61734045",
"0.61637545",
"0.6160419",
"0.6151636",
"0.6150547",
"0.6150477",
"0.6139351",
"0.6129656",
"0.6125936",
"0.6125934",
"0.6121809",
"0.6114238",
"0.61077225",
"0.61077225",
"0.61011446",
"0.60975283",
"0.6095695",
"0.6095074",
"0.6092678",
"0.60904044",
"0.6085112",
"0.6083874",
"0.6082545",
"0.6080478",
"0.6074697",
"0.60686255",
"0.6063978",
"0.6061449",
"0.60596645",
"0.6058635",
"0.6057205",
"0.60398495",
"0.6038244",
"0.60328496",
"0.60271376",
"0.6025013"
] |
0.65648484
|
20
|
Use callbacks to share common setup or constraints between actions.
|
def set_movielist
@movielist = Movielist.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def setup_handler\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def workflow\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def setup\n # override and do something appropriate\n end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"def startcompany(action)\n @done = true\n action.setup\n end",
"def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"def initialize(*args)\n super\n @action = :set\nend",
"def setup\n #implement in subclass;\n end",
"def after_set_callback; end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def around_hooks; end",
"def save_action; end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def duas1(action)\n action.call\n action.call\nend"
] |
[
"0.6165152",
"0.60463154",
"0.59467196",
"0.5917112",
"0.5890387",
"0.58345735",
"0.57773316",
"0.56991524",
"0.56991524",
"0.565454",
"0.5622282",
"0.54232633",
"0.54119074",
"0.54119074",
"0.54119074",
"0.53937256",
"0.53801376",
"0.5358599",
"0.53412294",
"0.5340814",
"0.53314966",
"0.53114754",
"0.52984965",
"0.52977055",
"0.5296272",
"0.5260649",
"0.5245076",
"0.52388334",
"0.52388334",
"0.52388334",
"0.52388334",
"0.52388334",
"0.5235081",
"0.52321917",
"0.5228592",
"0.5220735",
"0.52198535",
"0.52139324",
"0.5208539",
"0.5206585",
"0.5178542",
"0.5175199",
"0.5173538",
"0.5167041",
"0.51614195",
"0.51577675",
"0.5153909",
"0.51528823",
"0.5152225",
"0.51429904",
"0.5141399",
"0.51345575",
"0.51145",
"0.5114052",
"0.5114052",
"0.5110216",
"0.5108656",
"0.50935394",
"0.5089196",
"0.5081936",
"0.5079627",
"0.50675833",
"0.5056105",
"0.5053687",
"0.5050475",
"0.5050475",
"0.503471",
"0.5028311",
"0.501982",
"0.50157547",
"0.5013552",
"0.50014806",
"0.50011593",
"0.49976763",
"0.4990292",
"0.4990292",
"0.49882022",
"0.4981269",
"0.49792367",
"0.49766538",
"0.4967978",
"0.49667212",
"0.4958987",
"0.49572337",
"0.49550423",
"0.4954479",
"0.4952353",
"0.494726",
"0.4944055",
"0.4935437",
"0.4931248",
"0.49283475",
"0.49281213",
"0.49268973",
"0.4921738",
"0.49204507",
"0.4918924",
"0.49182287",
"0.4916538",
"0.49158585",
"0.49156788"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def movielist_params
params.require(:movielist).permit(:movie_id, :list_id)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def 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
|
Usr Bin Crash puzzle Kanwei Li, 2009 From memoize gem
|
def memoize(name)
cache = {}
(class<<self; self; end).send(:define_method, name) do |*args|
cache[args] = super unless cache.has_key?(args)
cache[args]
end
cache
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def memo; end",
"def memo\n end",
"def memo=(_arg0); end",
"def gen_washing\r\r\n end",
"def problem_108(size = 1001)\n func = lambda do |a|\n if a.length == 1\n a[0]+1\n else\n m = a[0]\n (2*m+1) * func.call(a[1,a.length]) -m\n end\n end\n\n primes = Primes.upto(200)\n prime_number = lambda do |a|\n r = 1\n a.sort.reverse.each_with_index { |m,i| r *= primes[i] ** m }\n r\n end\n\n values = {}\n last = 0\n 1.upto(100).each do |nn|\n nn.groupings do |a|\n sols = func.call a\n ans = prime_number.call a\n# puts \"np=#{nn} sols=#{sols} ans=#{ans} => #{a.inspect}\"\n if values[sols]\n values[sols] = [values[sols],[ans,a]].min\n else\n values[sols] = [ans,a]\n end\n true\n end\n size.upto(size*5/4) do |num|\n if values[num]\n puts \"for np = #{nn} => #{num} => #{values[num].inspect}\"\n if last == values[num]\n puts \"factors = #{values[num][0].factors}\"\n return values[num][0] \n end\n last = values[num]\n break\n end\n end\n #values.sort.each do |k,v|\n # puts \"#{k} => #{v}\"\n #end\n end\n nil\nend",
"def problem_8\nend",
"def crack_xor\n key_size = (2..40).to_a\n data = Tools.get_data6\n binding.pry\n \n end",
"def euler020\n def fact(x)\n ans = x.downto(1).reduce(:*)\n end\n fact(100).to_s.split('').map { |x| x.to_i}.reduce(:+)\nend",
"def solver (seed_char, blanks_words_sizes, matrix)\n\t# Set numerical target\n\ttarget = magic_num(seed_char)\t\n\t# Find magic number sum buckets\n\tskynet(target, blanks_words_sizes, blanks_words_sizes.length - 1, 0, [])\n\t# Alphabetical sort input matrix\n\tsorted_seed_char = seed_char.chars.sort.join\t\n\n\t# Find unique sets from skynet solutions\n\t$answer[:trace].each do |arrOarr|\n\t\tarrOarr.sort!\n\tend \n\n\t$answer[:trace].uniq!\t\n\t\n\t# Finds match for complete set of words from skynet solutions\n\t$answer[:trace].each do |answer_arr_el|\t\t\t\t\n\t\tunordered_match(sorted_seed_char, matrix, answer_arr_el, answer_arr_el.length - 1, \"\", [])\n\t\t# Can be ignored\n\t\t$ops += $seed[answer_arr_el[0][0]][:num_groups][answer_arr_el[0][1]].length *\n\t\t\t$seed[answer_arr_el[1][0]][:num_groups][answer_arr_el[1][1]].length *\n\t\t\t$seed[answer_arr_el[1][0]][:num_groups][answer_arr_el[1][1]].length *\n\t\t\t$seed[answer_arr_el[1][0]][:num_groups][answer_arr_el[1][1]].length\t\t\n\tend\n\t\n\treturn $answer[:words]\nend",
"def problem_60\n prime_check = lambda do |a,b|\n (a + b).to_i.prime? && (b + a).to_i.prime?\n end\n\n find_match = lambda do |a,k|\n r = a.select {|p| k != p && prime_check.call(k,p) }\n end\n\n primes = Primes.upto(10_000).map(&:to_s)\n primes.delete(\"2\")\n\n hit = {}\n\n primes.each do |p1|\n p1a = find_match.call(primes,p1)\n p1a.each do |p2|\n p2a = find_match.call(p1a,p2)\n p2a.each do |p3|\n p3a = find_match.call(p2a,p2)\n p3a.each do |p3|\n p4a = find_match.call(p3a,p3)\n p4a.each do |p4|\n p5a = find_match.call(p4a,p4)\n if p5a.length > 0\n p5a.each do |p5|\n a = [p1,p2,p3,p4,p5]\n sum = a.map(&:to_i).reduce(&:+)\n unless hit[sum]\n puts \"#{sum} #{a.inspect}\"\n else\n hit[sum] = true\n end\n return sum\n end\n end\n end\n end\n end\n end\n end\nend",
"def problem_104\n all = [\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"]\n k = 2\n low_fn0,low_fn1 = 1,1\n hi_fn0,hi_fn1 = 1,1\n loop do\n k += 1\n low_fn0,low_fn1 =(low_fn0 + low_fn1) % 10_000_000_000, low_fn0\n hi_fn0, hi_fn1 = hi_fn0 + hi_fn1, hi_fn0\n if hi_fn0 > 1_000_000_000_000_000_000\n hi_fn0 /= 10\n hi_fn1 /= 10\n end\n front = false\n next unless k > 300\n hi = hi_fn0.to_s[0,9].split(//)\n if (hi & all).length == 9\n puts \"front #{k}\" \n front = true\n end\n if (low = low_fn0.to_s).length >= 9\n low = low[-9,9].split(//)\n if (low & all).length == 9\n puts \"back #{k}\" \n return k if front\n end\n end\n end\nend",
"def main\n\trun \"100011 00000 10001 0000000000000100\"\n\trun \"100011 00000 10010 0000000000010000\"\n\trun \"100011 00000 10011 0000000000100000\"\n\trun \"100011 00000 10100 0000000000010100\"\n\trun \"101011 00000 10001 0000000001010000\"\n\trun \"101011 00000 10010 0000000001000100\"\n\trun \"101011 00000 10011 0000000001001100\"\n\trun \"101011 00000 10100 0000000011100000\"\n\trun \"100011 00000 10001 0000000000100100\"\n\trun \"100011 00000 10010 0000000000101100\"\n\trun \"100011 00000 10011 0000000000010000\"\n\trun \"100011 00000 10100 0000000010101100\"\n\trun \"101011 00000 10001 0000000000010100\"\n\trun \"101011 00000 10010 0000000000011000\"\n\trun \"101011 00000 10011 0000000000100100\"\n\trun \"101011 00000 10100 0000000001000100\"\n\trun \"100011 00000 10001 0000000000100100\"\n\trun \"100011 00000 10010 0000000000101100\"\n\trun \"100011 00000 10011 0000000000010000\"\n\trun \"100011 00000 10100 0000000010101100\"\n\trun \"101011 00000 10001 0000000001100000\"\n\trun \"101011 00000 10010 0000000001010100\"\n\trun \"101011 00000 10011 0000000001011100\"\n\trun \"101011 00000 10100 0000000011110000\"\n\tprint \"\\n\\nRegisters \\n\" + REGISTERS.to_s\n\tprint \"\\n\\nCACHE \\n\"\n\tcounter = 0\n\t(CACHE.to_s.gsub(\"],\",\"\\n\").split(\">\\n\")).each{|i| print \"Set \" + ((counter+=1)-1).to_s + i + \"\\n\"}\n\tcounter = 0\n\tprint \"\\n\\nMAIN MEMORY\\n\"\n\tMAIN_MEMORY.each{|i| print \"Memory Cell \" + ((counter+=1)-1).to_s + \" has \" + i.to_s + \"\\n\"}\n\t\"\"\nend",
"def euler028 n\n (4*n**3 + 3*n**2 + 8*n - 9) / 6\nend",
"def happens(memo, tuple) \n memo + 1\n end",
"def solve(minemap, miner, exit, answer = [])\n# this block sets variables for dimension max indexes\n# declares variables for the current miner position\n# declares variables for the exit position\n# I did this for easier manipulation of the values\n# than referring to and changing a hash constantly\n# it also sets up an array possible values the map\n# can take on, with the direction a miner should travel\n# replacing true, which signals to the miner that he\n# should not return to that position (probably not necessary\n# because false would work just as well unless two branches\n# are both valid, but right, left, up, down could probably\n# be eliminated\n\n x_max = minemap.size - 1\n y_max = minemap[0].size - 1\n x = miner['x']\n y = miner['y']\n ex = exit['x']\n ey = exit['y']\n walls = %w(right left up down branch)\n walls.push(false)\n\n# copying the map so it can be manipulated (again, probably\n# not necessary and, even if it is, my copy_array should be\n# expanded to multi dimensional arrays)\n\n copy = Array.new(x_max+1){Array.new(y_max+1)}\n (0..x_max).each do |x|\n (0..y_max).each do |y|\n copy[x][y] = minemap[x][y]\n end\n end\n\n# loops while not at exit\n\n while x != ex || y != ey\n\n# sets a boolean array to 4 trues, then checks\n# each possible move to false if unavailable\n\n rlud = [true, true, true, true]\n rlud[0] = false if x == x_max || walls.include?(copy[x+1][y])\n rlud[1] = false if x == 0 || walls.include?(copy[x-1][y])\n rlud[2] = false if y == 0 || walls.include?(copy[x][y-1])\n rlud[3] = false if y == y_max || walls.include?(copy[x][y+1])\n\n# if there is nowhere to turn, the answer array is set to an array \n# of size equal to thenumber of elements in the map, because this \n# number is more than the possible number of steps the miner could\n# take in an actual solution, then returns this array as answer\n# this signals the previous call of solve that the branch was a \n# dead end (this will not happen on the first iteration by if\n# the initial conditions are valid)\n\n answer = Array.new((x_max + 1) * (y_max + 1)) if rlud.count(true) == 0 \n return answer if rlud.count(true) == 0\n\n# if there is only one path (only one true in the boolean array)\n# then the position is updated, the step is pushed to the answer\n# array and the copy of the original position is set to a string\n# indicating the miner must travel\n\n if rlud.count(true) == 1 \n if rlud[0] == true\n copy[x][y] = \"right\" \n answer.push('right')\n x += 1\n elsif rlud[1] == true\n copy[x][y] = \"left\" \n answer.push('left')\n x -= 1\n elsif rlud[2] == true\n copy[x][y] = \"up\" \n answer.push('up')\n y -= 1\n else\n copy[x][y] = \"down\"\n answer.push('down')\n y += 1 \n end \n\n# if there is more than one possible move, this section\n# calls the branch explore with the direction to explore\n# as one parameter and a copy of the answer to be appended \n# to in case a valid path is found, if a dead end is reached\n# branch_explore will mark the initial branch position as false\n\n else\n copy[x][y] = false\n if rlud[0] == true\n r = copy_array(answer)\n r = branch_explore(copy, 'right', exit, r, x, y, x_max, y_max)\n end \n if rlud[1] == true\n l = copy_array(answer)\n l = branch_explore(copy, 'left', exit, l, x, y, x_max, y_max)\n end\n if rlud[2] == true\n u = copy_array(answer) \n u = branch_explore(copy, 'up', exit, u, x, y, x_max, y_max)\n end\n if rlud[3] == true\n d = copy_array(answer)\n d = branch_explore(copy, 'down', exit, d, x, y, x_max, y_max)\n end\n\n# this section pushes the answer arrays that are valid paths to\n# a branch array \n\n branch_array = [] \n branch_array.push(r.size) if x != x_max && copy[x+1][y].to_s == \"branch\"\n branch_array.push(l.size) if x != 0 && copy[x-1][y].to_s == \"branch\"\n branch_array.push(u.size) if y != 0 && copy[x][y-1].to_s == \"branch\"\n branch_array.push(d.size) if y != y_max && copy[x][y+1].to_s == \"branch\"\n\n# this determines which of the potential valid paths is shorts and \n# set the answer to that array\n \n min = branch_array.min\n answer = copy_array(r) if r != nil && r.size == min\n answer = copy_array(l) if l != nil && l.size == min\n answer = copy_array(u) if u != nil && u.size == min\n answer = copy_array(d) if d != nil && d.size == min\n end\n end\n\n# return the answer\n\n answer\nend",
"def solution(m, a)\n n = a.count\n result = 0\n front = 0\n numbers = Array.new(m + 1, false)\n n.times { |back|\n while front < n and not numbers[a[front] - 1]\n numbers[a[front] - 1] = true\n front += 1\n result += front - back\n return 1_000_000_000 if result >= 1_000_000_000\n end\n numbers[a[back] - 1] = false\n }\n result\nend",
"def main\n # GC::Profiler.enable\n # limit = 10 ** 6\n limit = 5 * (10 ** 7)\n prime_limit = (limit * Math.sqrt(2)).to_i\n prime_cache = Prime::Cache.new(prime_limit)\n primes = prime_cache.primes.select {|prime| prime % 8 == 1 || prime % 8 == 7}\n prime_cache = nil\n prime_length = primes.length\n puts \"Primes cached. Length: #{prime_length}\"\n\n # GC.disable\n sqrts = []\n tick = Time.new\n primes.each_with_index do |prime, prime_index|\n if prime_index % (10 ** 4) == 0\n tock = Time.new\n puts \"#{prime_index}/#{prime_length}\\t#{tock - tick}\"\n tick = tock\n end\n sqrts << modular_sqrt((prime + 1)/2, prime)\n end\n puts \"Square roots cached\"\n # GC.enable\n\n is_prime_per_n = [true] * (limit + 1)\n [0, 1].each do |exception_index|\n is_prime_per_n[exception_index] = false\n end\n\n primes.each_with_index do |prime, prime_index|\n puts \"#{prime_index}/#{prime_length}\" if prime_index % (10 ** 5) == 0\n sqrt1 = sqrts[prime_index]\n\n [sqrt1, prime - sqrt1].each do |sqrt|\n raise \"#{prime}'s sqrt is 0\" if sqrt == 0\n if sqrt == 1\n sqrt += prime\n end\n \n if sqrt <= limit && (2 * sqrt * sqrt - 1 != prime)\n is_prime_per_n[sqrt] = false\n end\n sqrt += prime\n\n while sqrt <= limit\n is_prime_per_n[sqrt] = false\n sqrt += prime\n end\n end\n end\n\n count = 0\n is_prime_per_n.each_with_index do |is_prime, n|\n if is_prime\n count += 1\n end\n end\n\n p count\n # puts GC::Profiler.result\nend",
"def problem_77a\n primes = Primes.upto(100)\n\n # off is the offset in the prime array, we can work down :-)\n solve = lambda do |a,off,max|\n n = 0\n while a[off] < max && (a.length-off) >= 2 \n a[off] += a.pop\n n += 1 if (a & primes).length == a.uniq.length\n n += solve.call(a.dup,off+1,a[off]) if a.length - off > 1\n end\n n\n end\n m = 0\n (2..100).each do |num|\n break if (m = solve.call([1] * num,0,num-1)) > 5000\n puts \"#{num} => #{m}\"\n end\n m\nend",
"def problem_60a\n num_cut = 5\n# simple\n pairs = {}\n seen_primes = []\n num_primes = 0\n last = start = Time.now\n Primes.each do |p|\n next if p == 2\n b = p.to_s\n seen_primes.each_index do |sp_i|\n sp = seen_primes[sp_i]\n a = sp.to_s\n ai,bi = a.to_i,b.to_i\n ab = (a + b).to_i\n ba = (b + a).to_i\n\n if ba.prime? && ab.prime?\n # We have a pair that works both ways so add the peer to each prime\n pairs[ai] = aa = ((pairs[ai] || []) << bi).uniq\n pairs[bi] = bb = ((pairs[bi] || []) << ai).uniq\n next unless pairs[bi].length >= num_cut - 1 # bi is biggest of pair\n\n check = ([ai] + aa) & ([bi] + bb)\n if check.length >= num_cut\n puts \"Try #{check.inspect}\"\n perm = check.permutation(2).to_a\n new = perm.select do |x,y|\n (x.to_s + y.to_s).to_i.prime? && (x.to_s + y.to_s).to_i.prime?\n end\n if new.length == perm.length\n n = new.flatten.uniq\n sum = n.reduce(&:+)\n puts \"#{n.inspect} *** #{sum}\"\n return sum\n end\n end\n end\n end\n seen_primes << p\n end\n nil\nend",
"def euler008\n big_num = <<-eos\n 73167176531330624919225119674426574742355349194934\n 96983520312774506326239578318016984801869478851843\n 85861560789112949495459501737958331952853208805511\n 12540698747158523863050715693290963295227443043557\n 66896648950445244523161731856403098711121722383113\n 62229893423380308135336276614282806444486645238749\n 30358907296290491560440772390713810515859307960866\n 70172427121883998797908792274921901699720888093776\n 65727333001053367881220235421809751254540594752243\n 52584907711670556013604839586446706324415722155397\n 53697817977846174064955149290862569321978468622482\n 83972241375657056057490261407972968652414535100474\n 82166370484403199890008895243450658541227588666881\n 16427171479924442928230863465674813919123162824586\n 17866458359124566529476545682848912883142607690042\n 24219022671055626321111109370544217506941658960408\n 07198403850962455444362981230987879927244284909188\n 84580156166097919133875499200524063689912560717606\n 05886116467109405077541002256983155200055935729725\n 71636269561882670428252483600823257530420752963450\n eos\n\n current_max = 0\n\n until big_num.length == 5 do\n current_prod = big_num[0..4].split('').map { |i| i.to_i }.reduce(:*)\n current_max = current_prod if current_prod > current_max\n big_num = big_num[1..-1]\n end\n\n current_max\nend",
"def exercise_1113 (matrix)\n end",
"def _reduce_659(val, _values, result)\n result = [ @builder.kwnilarg(val[0], val[1]) ]\n \n result\nend",
"def problem_78\n n = 1\n p_cache = [1]\n\n generate = lambda do |k|\n ret = 0\n sign = 0\n Integer.generalized_pentagonals do |gp|\n if k < gp\n false # Need to exit ruby1.8, can't break...\n else\n if sign >= 0\n ret += p_cache[k-gp]\n else\n ret -= p_cache[k-gp]\n end\n sign += (sign == 1) ? -3 : 1 # 4 states + + - -\n end\n end\n p_cache[k] = ret % 100_000_000\n ret\n end\n\n p = 1\n loop do\n r = generate.call(p)\n# puts \"#{p} #{generate.call(p)}\"\n break if r % 1_000_000 == 0\n p += 1\n end\n p\nend",
"def rebuild_cache (kuni)\n all_tasks = kuni.tasks\n all_done = all_tasks.all(:is_done => true)\n ratio = 0.0\n if !all_tasks.nil? and !all_done.nil? and all_done.count != 0\n ratio = all_done.count.to_f/all_tasks.count.to_f * 100.0\n else\n ratio = 0\n end\n case ratio\n when 0..1\n kuni.cache = 0\n when 0..10\n kuni.cache = 10\n when 10..20\n kuni.cache = 20\n when 20..30\n kuni.cache = 30\n when 30..40\n kuni.cache = 40\n when 40..50\n kuni.cache = 50\n when 50..60\n kuni.cache = 60\n when 60..70\n kuni.cache = 70\n when 70..80\n kuni.cache = 80\n when 80..90\n kuni.cache = 90\n when 90..100\n kuni.cache = 100\n else\n kuni.cache = 0\n end\n if kuni.save\n true\n else\n false\n end\n end",
"def climb_stairs_memo(n)\n memo = []\n climb_stairs_memo_helper(0, n, memo)\nend",
"def examine_rule_memoization(input, rule_index, rule_name)\n # System.out.println(\"examine memo \"+ruleName);\n stop_index = @parser.get_rule_memoization(rule_index, input.index)\n if ((stop_index).equal?(BaseRecognizer::MEMO_RULE_UNKNOWN))\n # System.out.println(\"rule \"+ruleIndex+\" missed @ \"+input.index());\n @num_memoization_cache_misses += 1\n @num_guessing_rule_invocations += 1 # we'll have to enter\n else\n # regardless of rule success/failure, if in cache, we have a cache hit\n # System.out.println(\"rule \"+ruleIndex+\" hit @ \"+input.index());\n @num_memoization_cache_hits += 1\n end\n end",
"def problem10()\n\tsum = 0; Prime.each(2000000) {|i| sum += i}; return sum\nend",
"def euler65\n vec = []\n val = tmp = den = num = 0 \n (0..98).each do |i|\n val = i%3==1 ? 2*(i/3+1) : 1\n vec.push(val)\n\n den = 1 \n num = vec.last\n vec.reverse.drop(1).each do |r| \n tmp = num;\n num = num * r + den; \n den = tmp;\n end\n \n den = 2 * num + den;\n $ans = den.to_s.split(//).inject(0){|sum,x| sum+x.to_i}\n end\nend",
"def solve\n s = Hash[(1...1000).map { |i| [i, i * i] }]\n (1...1000).each do |c|\n (1...c).each do |b|\n (1..b).each do |a|\n return a * b * c if (a + b + c) == 1000 && (s[a] + s[b]) == s[c]\n end\n end\n end\nend",
"def find_largest_chain \n n = 999999\n until n < 700000\n collatz_evaluate_sequence(n)\n n -= 1\n end\n puts @solutions.max_by { |k,v| v } \nend",
"def euler29(n)\n terms = []\n 2.upto(n) do |i|\n 2.upto(n) do |j|\n if terms.include?(i ** j) == false\n terms << i ** j\n end\n end\n end\n \n terms.length\nend",
"def main\n results = {}\n strings = Hash.new(Array.new)\n 0.upto(10000).each do |ind|\n result = Helper.to_power_3(ind)\n results[ind] = result\n key = result.to_s.split(//).sort.join\n strings[key] += [ind]\n if strings[key].size == 5\n puts strings[key][0] \n puts results[strings[key][0]]\n break\n end\n \n end\n\n#puts results[345]\n#puts results[384]\n#puts results[405]\n\n#strings.each do |key,value|\n#pp results[value[0]] if value.length == 5\n#end\n \nend",
"def frog_hops_bottom_up(n)\n frog_cache_builder(n)\n end",
"def run\n\n line1 = gets.strip.split(\" \").map!{ |e| e.to_i }\n\n number_of_lines = line1[0]\n m = line1[1]\n k = line1[2]\n q = line1[3]\n\n maxtrix = Hash.new\n number_of_lines.times do |row|\n line = gets.strip.split(\" \").map!{ |e| e.to_i }\n\n m.times do |col|\n maxtrix[[row,col]] = line[col]\n end\n end\n\n last_line = gets.strip.split(\" \").map!{ |e| e.to_i }\n empty_slot = [last_line[0]-1,last_line[1]-1]\n caocao = [last_line[2]-1,last_line[3]-1]\n exit = [last_line[4]-1,last_line[5]-1]\n\n maxtrix[empty_slot] = \"E\"\n maxtrix[caocao] = \"C\"\n maxtrix[exit] = \"D\"\n\n knowledge_base = Hash.new\n\n printmap(number_of_lines, m, maxtrix)\nend",
"def euler016\n (2 ** 1000).to_s.split('').map { |x| x.to_i }.reduce(:+)\nend",
"def problem3 ( )\n n = 600851475143\n i = 1\n while (i < n)\n if n % i == 0\n n /= i\n i -= 2\n end\n i += 2\n end\n n\nend",
"def big_bad; end",
"def rehash() end",
"def brute_resolve(num)\n while num != 1 && num != 89 do\n num = shrink num\n end\n num\nend",
"def frog_hops_bottom_up(n)\n cache = frog_cache_builder(n)\n\n cache[n]\n \n end",
"def euler006\n square_of_sum = (1..100).reduce(:+) ** 2\n sum_of_squares = (1..100).inject { |sum, n| sum + n*n }\n\n return square_of_sum - sum_of_squares\nend",
"def problem18(r) \n h = r.length\n sum = 0\n for i in 0..h-1 \n \n end\nend",
"def problem_76a\n num = 100\n solve = lambda do |a,off,max|\n n = 0\n while a[off] < max && (a.length-off) >= 2 \n a[off] += a.pop\n n += 1\n n += solve.call(a.dup,off+1,a[off]) if a.length - off > 1\n end\n n\n end\n puts 1 + solve.call([1] * num, 0,num-1)\nend",
"def decode_weak(guess, code)\n guess.compact.each.reduce(0) do |count, code_peg|\n index = code.find_index(code_peg)\n if index\n count += 1\n code[index] = nil\n end\n count\n end\n end",
"def _reduce_659(val, _values, result)\n result = [ @builder.kwnilarg(val[0], val[1]) ]\n\n result\nend",
"def solve2( n = 150_000_000 )\n # Brute force.\n sum = 10\n i = 20\n\n while i < n\n if 0 != i % 3\n i2 = i*i\n\n # Must verify that the primes are consecutive (i.e. there aren't any\n # primes hiding between entries).\n if (i2 + 1).miller_rabin? &&\n (i2 + 3).miller_rabin? &&\n (i2 + 7).miller_rabin? &&\n (i2 + 9).miller_rabin? &&\n !(i2 + 11).miller_rabin? &&\n (i2 + 13).miller_rabin? &&\n !(i2 + 17).miller_rabin? &&\n !(i2 + 19).miller_rabin? &&\n !(i2 + 21).miller_rabin? &&\n !(i2 + 23).miller_rabin? &&\n (i2 + 27).miller_rabin?\n \n sum += i\n i += 315410\n end\n end\n\n # From observation that 10 | a_n in similar sequences.\n i += 10\n end\n\n sum\n end",
"def euler048\n (1..1000).each.reduce { |a,i| a + i**i }.to_s.slice(-10, 10).to_i\nend",
"def test_memoize_cache\n assert_nothing_raised{ @cache1 = self.memoize(:fib) }\n assert_nothing_raised{ @cache2 = self.memoize(:factorial) }\n\n assert_nothing_raised{ self.fib(3) }\n assert_nothing_raised{ self.factorial(3) }\n\n assert_kind_of(Hash, @cache1)\n assert_kind_of(Hash, @cache2)\n\n assert_not_equal(@cache1, @cache2)\n end",
"def euler003\n 600851475143.prime_factors.last\nend",
"def find_solutions_memoized(index, amount)\n return 1 if amount == 0\n return 0 if amount < 0 || index == 0\n \n tail = amount - @coins[index-1]\n @memoizations[index-1][amount] ||= find_solutions(index-1, amount)\n @memoizations[index][tail] ||= find_solutions(index, amount - @coins[index-1])\n @memoizations[index-1][amount] + @memoizations[index][tail]\n end",
"def bug\n end",
"def qytt\n # procure the numbers\n arrNumbers = [ arrNumbersOfProcGivenMinMax( method(:intGetTriangleInt), 1000, 10000),\n arrNumbersOfProcGivenMinMax( method(:intGetSquareInt), 1000, 10000),\n arrNumbersOfProcGivenMinMax( method(:intGetPentagonalInt), 1000, 10000),\n arrNumbersOfProcGivenMinMax( method(:intGetHexagonalInt), 1000, 10000),\n arrNumbersOfProcGivenMinMax( method(:intGetHeptagonalInt), 1000, 10000),\n arrNumbersOfProcGivenMinMax( method(:intGetOctagonalInt), 1000, 10000) ]\n arrNumbers.map! do |arr|\n deletable = []\n arr.each do |num|\n if ( num / 10 % 10 == 0 )\n deletable << num\n end\n end\n arr -= deletable\n end\n\n # get the hash numbers which we will jump to and from\n hashNumbers = Array.new(6){ HashChained.new }\n (0..5).each do |i|\n arrNumbers[i].each do |num|\n hashNumbers[i][num/100] = num % 100\n end\n end\n\n threads = []\n # we're guaranteed only one solution\n superResult = 0\n\n # iterate through the octagonal numbers\n arrNumbers.last.each do | firstNum |\n checker = firstNum % 100\n hashNumbers[0..4].permutation.each do |perm|\n t = Thread.new do\n result = qyttRecursion( checker, perm )\n if result[0] > 0 && result[1] == firstNum / 100\n superResult = result[0] + firstNum\n end\n end\n threads << t\n end\n end\n\n threads.each do |t|\n t.join\n end\n superResult\n\nend",
"def knot_hash(input)\n sequence = input.bytes.to_a\n sequence << [17, 31, 73, 47, 23]\n sequence = sequence.flatten\n list = (0..255).to_a\n\n @current_position = 0\n @skip_size = 0\n # list = (0..4).to_a\n # sequence = [3, 4, 1, 5]\n\n # sequence = '1,2,3'.bytes.to_a\n # sequence << [17, 31, 73, 47, 23]\n # sequence = sequence.flatten\n\n 64.times do\n sequence.each do |seq|\n puts \"STARTING SEQ #{seq}\"\n if @current_position + seq > list.size\n puts \"wrapping\"\n ending_array = list[@current_position..-1]\n ending_array_size = ending_array.size\n puts \"ending array is #{ending_array.inspect}\"\n beginning_array = list[0...seq - ending_array.size]\n puts \"beginning array is #{beginning_array.inspect}\"\n beginning_array_size = beginning_array.size\n array_to_modify = ending_array + beginning_array\n puts \"array_to_modify is #{array_to_modify.inspect}\"\n array_to_modify.reverse!\n puts \"reversed array_to_modify is #{array_to_modify.inspect}\"\n # array_to_modify.rotate(@current_position)\n array_to_modify[0...ending_array_size].each_with_index do |a,i|\n list[@current_position+i] = a\n end\n puts list.inspect\n\n array_to_modify[-beginning_array_size..-1].each_with_index do |a,i|\n list[i] = a\n end\n\n puts list.inspect\n else\n puts \"not wrapping\"\n array_to_modify = list[@current_position...@current_position+seq]\n array_to_modify.reverse!\n array_to_modify.each_with_index do |a,i|\n list[@current_position + i] = a\n end\n puts list.inspect\n\n end\n\n if @current_position + seq + @skip_size > list.size\n @current_position = (@current_position + seq + @skip_size) % list.size\n else\n @current_position = @current_position + seq + @skip_size\n end\n puts \"@current_position is #{@current_position}\"\n @skip_size += 1\n end\n @list = list\n end\n\n foo = []\n @list.each_slice(16) do |chunk|\n foo << chunk.inject(:^)\n end\n\n result = []\n foo.each do |hex|\n if hex.to_s(16).size == 1\n result << '0' + hex.to_s(16)\n else\n result << hex.to_s(16)\n end\n end\n\n result.join\nend",
"def solve_zero_vs_six_vs_nine\n return if @arr[1].nil? || @arr[4].nil?\n\n #p \"1,4: #{@arr[1]},#{@arr[4]}\"\n\n @words.filter{|x| x.length == 6 && @hash[x].nil?}.each{|w|\n if @arr[4].chars.all?{|c| w.chars.include?(c)}\n solved(9, w)\n elsif @arr[1].chars.all?{|c2| w.chars.include?(c2)}\n solved(0, w)\n else\n solved(6, w)\n end\n }\n end",
"def temp_test(sudoku_datas)\n sudoku_cells = prepare_sudoku_cells(sudoku_datas)\n # display_sudoku(sudoku_cells, \"Sudoku to solve\")\n # build the potential list of values for each cell\n build_potential_value_list(sudoku_cells)\n update_cells(sudoku_cells) # update the value of each cell\n counter = 0\n # continue to the try to solve\n # if the counter goes beyond a million\n # it's probably a bad sudoku\n \n display_sudoku(sudoku_cells, \"Test\")\n shed_potential_value_list(sudoku_cells)\n \n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n double_whammer(sudoku_cells)\n update_cells(sudoku_cells)\n display_sudoku(sudoku_cells, \"Test\")\n \nend",
"def cache_solution(state, outcomes)\n @TAB_CACHE[state.board_bits] = outcomes\n alt = state\n 3.times do\n alt = rotate_state alt\n @TAB_CACHE[alt.board_bits] = outcomes\n end\n \n alt = flip_state state\n @TAB_CACHE[alt.board_bits] = outcomes\n 3.times do\n alt = rotate_state alt\n @TAB_CACHE[alt.board_bits] = outcomes\n end\n end",
"def solve( n = 2_000 )\n # We can classify every tile according to its angular position around the\n # unit circle, setting position 0 at the top since that's where each row\n # starts in the problem statement. Positions 1-5 then follow every 60° as\n # we work our way counter-clockwise. Depending on which of these positions\n # each tile falls (or between which pair of positions), we use different\n # formulae to calculate its six neighbors to the N, NW, SW, S, SE, and NE:\n # \n # Pos 0: n even = fhp\n # N = n + ring (g) S = n - ring + 6 (a)\n # NW = n + ring + 1 (h) SE = n + ring - 1 (f)\n # SW = n + 1 NE = n + (2*ring + 5) (p)\n #\n # Pos 0-1: n even = bh, n odd = ag \n # N = n + ring (g) S = n - ring + 6 (a)\n # NW = n + ring + 1 (h) SE = n - ring + 5 (b)\n # SW = n + 1 NE = n - 1\n #\n # Pos 1: n even = bh, n odd = gi\n # N = n + ring (g) S = n + 1\n # NW = n + ring + 1 (h) SE = n - ring + 5 (b)\n # SW = n + ring + 2 (i) NE = n - 1\n #\n # Pos 1-2: n even = bh, n odd = ci\n # N = n - 1 S = n + 1\n # NW = n + ring + 1 (h) SE = n - ring + 5 (b)\n # SW = n + ring + 2 (i) NE = n - ring + 4 (c)\n #\n # Pos 2: n even = hj\n # N = n - 1 S = n + ring + 3 (j)\n # NW = n + ring + 1 (h) SE = n + 1\n # SW = n + ring + 2 (i) NE = n - ring + 4 (c)\n #\n # Pos 2-3: n even = dj, n odd = ci\n # N = n - ring + 3 (d) S = n + ring + 3 (j)\n # NW = n - 1 SE = n + 1\n # SW = n + ring + 2 (i) NE = n - ring + 4 (c)\n #\n # Pos 3: n even = dj, n odd = ik\n # N = n - ring + 3 (d) S = n + ring + 3 (j)\n # NW = n - 1 SE = n + ring + 4 (k)\n # SW = n + ring + 2 (i) NE = n + 1\n #\n # Pos 3-4: n even = dj, n odd = ek\n # N = n - ring + 3 (d) S = n + ring + 3 (j)\n # NW = n - ring + 2 (e) SE = n + ring + 4 (k)\n # SW = n - 1 NE = n + 1\n #\n # Pos 4: n even = jl\n # N = n + 1 S = n + ring + 3 (j)\n # NW = n - ring + 2 (e) SE = n + ring + 4 (k)\n # SW = n - 1 NE = n + ring + 5 (l)\n #\n # Pos 4-5: n even = fl, n odd = ek\n # N = n + 1 S = n - 1\n # NW = n - ring + 2 (e) SE = n + ring + 4 (k)\n # SW = n - ring + 1 (f) NE = n + ring + 5 (l)\n #\n # Pos 5: n even = fl, n odd = km\n # N = n + ring + 6 (m) S = n - 1\n # NW = n + 1 SE = n + ring + 4 (k)\n # SW = n - ring + 1 (f) NE = n + ring + 5 (l)\n #\n # Pos 5-0, except last: n even = fl, n odd = gm\n # N = n + ring + 6 (m) S = n - ring (g)\n # NW = n + 1 SE = n - 1\n # SW = n - ring + 1 (f) NE = n + ring + 5 (l)\n #\n # Pos 5-0, only last: n even = flo, n odd = gmo\n # N = n + ring + 6 (m) S = n - ring (g)\n # NW = n - ring + 1 (f) SE = n - 1\n # SW = n - (2*ring - 7) (o) NE = n + ring + 5 (l)\n #\n # From these formula, we can derive the difference between a tile and each\n # of its neighbors. If we arrange all potential differences in ascending\n # order, it becomes obvious that for n even or odd, some deltas will al-\n # ways be even, and thus can never be prime (>2).\n #\n # Furthermore, we can see that only in certain positions will a tile ever\n # differ from three neighbors by odd amounts (position 0 and just to the\n # right of position 0). In all other cases, at most two deltas will be\n # odd, meaning PD(n) will be 2 or less.\n #\n # n even n odd\n # a = ring - 6 even a\n # b = ring - 5 b even\n # c = ring - 4 even c\n # d = ring - 3 d even\n # e = ring - 2 even e\n # f = ring - 1 f even\n # g = ring even g\n # h = ring + 1 h even\n # i = ring + 2 even i\n # j = ring + 3 j even\n # k = ring + 4 even k\n # l = ring + 5 l even\n # m = ring + 6 even m\n # o = 2ring - 7 o o\n # p = 2ring + 5 p p\n pd3 = [1, 2]\n base, ring = 8, 12\n \n while pd3.size < n\n # Only at position 0 and one tile to the right will there ever be three\n # odd deltas, so those are the only ones we have to check for primality.\n # Both share a delta of f = ring - 1.\n if (ring - 1).prime?\n # Check the other odd deltas for position 0. \n pd3 << base if (ring + 1).prime? && (2*ring + 5).prime?\n\n # Check the other odd deltas for one tile to the right of position 0.\n pd3 << base + ring - 1 if (ring + 5).prime? && (2*ring - 7).prime?\n end\n\n # Advance the first tile of the current ring (base), and the number of\n # tiles it contains (ring). \n base += ring\n ring += 6\n end\n\n pd3[-1]\n end",
"def gencode(instr)\n memoizer = Hash.new { |h,morse|\n retval = []\n get_letters(morse) { |c,rest|\n h[rest].each {|s| retval << (c+s)}\n }\n h[morse] = retval\n }\n memoizer[''] = ['']\n memoizer[instr]\nend",
"def climb_stairs_memo(n, cache={})\n\treturn 1 if n <= 1\n\toperand_one = cache[n-1] || climb_stairs_memo(n-1)\n\toperand_two = cache[n-2] || climb_stairs_memo(n-2)\n\tresult = operand_one + operand_two\n\tcache[n] = result\n\tresult\nend",
"def frog_hops_bottom_up(n)\n frog_cache_builder(n)[n]\n end",
"def euler66\n max = 0\n val = 0\n min = 0 \n set = Set.new\n vec = [] \n (2..1000).each do |r|\n num = 1\n \n set.clear()\n vec.clear() \n\n sr = Math.sqrt(r)\n min = val = sr.floor\n\n next if min*min==r\n\n print \"#{r}: \" if $debug\n\n num = ( r - val*val ) / num\n \n #print \"(#{num})\"\n\n tval = 0 \n tmin = -min\n while ( ( sr - tmin ) / num ) > 1\n tval += 1\n tmin += num\n #print \"#{tmin} #{( ( sr - tmin ) / num )}\"\n end\n min = tmin \n val = tval\n\n print \"(#{tval}_#{min}_#{num})\" if $debug\n set.add(\"#{tval}_#{min}_#{num}\")\n vec.push(tval)\n\n # This section get from Euler64\n freq = 1\n while true\n num = ( r - min*min ) / num\n \n tval = 0 \n tmin = -min\n while ( ( sr - tmin ) / num ) > 1\n tval += 1\n tmin += num\n end\n min = tmin \n val = tval\n\n str = \"#{tval}_#{min}_#{num}\"\n break if set.include?(str) \n print \" (#{str})\" if $debug\n set.add(str)\n vec.push(tval)\n freq += 1\n end\n print \" # #{freq}\" if $debug\n\n num = 1\n if vec.size==1\n den = vec.last\n lnum = 2 \n vec.reverse.drop(lnum).each do |v|\n tval = den\n den = v*den + num \n num = tval \n end\n num = sr.floor * den + num \n else \n n = vec.size\n vec_ = vec + vec # One frequent section is not enough\n\n # variable backup\n tden = den \n tnum = num\n\n # We need to continue trying ... \n (n..2*n).each do |nn|\n tvec = vec_[0..nn-1]\n den = tvec.reverse.drop(1).last\n tvec.reverse.drop(2).each do |v|\n tval = den\n den = v*den + num \n num = tval \n end\n num = sr.floor * den + num\n \n break if (num*num-den*den*r)==1 # Check if this fraction is any \n den = tden \n num = tnum\n end \n end\n \n puts \" => #{num} #{den} \" if $debug\n\n if max < num \n $ans = r\n max = num\n end\n end\nend",
"def problem_77\n primes = Primes.upto(120)\n\n # num is the value we want and\n # off is the index in primes to use next\n hits = 0\n solve = lambda do |num, off|\n return 1 if num == 0\n return 0 if num == 1\n ret = 0\n p = primes[off]\n ret += 1 if num % p == 0 # Add if a multiple\n ret += solve.call(num,off-1) if off > 0 \n n = num / p\n if n > 0 # Do each multiple\n 1.upto(n) do |i|\n left = num - i*p\n ret += solve.call(left,off-1) if off > 0 && left > 1\n end\n end\n ret\n end\n\n #(2..100).each do |num|\n num = 0\n (2..100).each do |num|\n off = primes.index {|i| i > num } - 1\n hits = solve.call(num,off)\n puts \"#{num} => #{hits}\"\n return num if hits >= 5000\n end\nend",
"def formingMagicSquare(s)\r\n out = 100\r\n for i in 0...8 do\r\n cost = 0\r\n for j in 0...3 do\r\n for k in 0...3 do\r\n cost += ($magic_square[i][j][k] - s[j][k]).abs\r\n end\r\n end\r\n puts cost\r\n out = [out, cost].min\r\n end \r\n out\r\nend",
"def euler001\n (1...1000).select { |i| i % 3 == 0 or i % 5 == 0 }.reduce(:+)\nend",
"def euler012\n each_triangle_number do |n, index|\n return n if n.factors.size > 500\n end\nend",
"def test_controller_computed_primes\n\n assert_equal(Sieve::Primes.new.take(104)[4,-1],Prime.each.take(104)[4,-1])\n end",
"def longest_unique_substring_memoize str\n return str if str.length <= 2\n len = str.length\n memoize = Array.new(len+1) { Array.new(len+1) }\n\n #setup memoize\n memoize[0][0] = ''\n\n j = 1\n while j <= len\n memoize[0][j] = ''\n j += 1\n end\n\n j = 1\n while j <= len\n memoize[j][0] = ''\n j += 1\n end\n #setup middle cells\n\n i = 1\n while i <= len\n memoize[i][i] = str[i-1]\n i+=1\n end\n\n j = 2\n i = 1\n\n # puts memoize.inspect\n\n while i < len+1\n while j < len+1\n memoize[i][j] = if str[i-1..j-1].split('').uniq.length > 2\n find_string_with_max_lenght([memoize[i][j-1], memoize[i-1][j]])\n else\n find_string_with_max_lenght([str[i-1..j-1], memoize[i][j-1], memoize[i-1][j]])\n end\n j +=1\n end\n i += 1\n j = i+1\n end\n\n return memoize[len-1][len]\nend",
"def breakXORCipher(cipherText)\n scoredTexts = Hash.new\n \n #Try all ASCII keys from \n for i in 32..126 do\n keyChar = i.chr\n \n possiblePlaintext = hexToASCII(singleByteXOR(cipherText.upcase, keyChar))\n scoredTexts[keyChar] = scorePlaintext(possiblePlaintext)\n \n if(scoredTexts[keyChar] == possiblePlaintext.length)\n puts cipherText\n puts possiblePlaintext \n puts keyChar + \" scored \" + scoredTexts[keyChar].to_s\n end\n end\nend",
"def hard(string)\n hasher = KnotHash.new(256, string.bytes + [17, 31, 73, 47, 23])\n 64.times { hasher.round }\n hasher.hash\nend",
"def hash; map{|el| \"#{el.name} @ #{el.hash}\"}; map(&:hash).reduce(:+) % 2**32; end",
"def reduce_solved\n before = 9*9*9\n after = entropy\n while before > after\n before = after\n reduce_line\n reduce_col\n reduce_grid\n after = entropy\n end\n self\n end",
"def puzzle(sudoku)\n\tfor i in (1..65)\n\t\tb = rand(81)\n\t\tsudoku[b] = 0\n\tend\n\tsudoku\nend",
"def euler079\n inputs = []\n File.open_euler('keylog.txt').each_line do |line|\n inputs.push(line.chomp)\n end\n inputs.uniq!.sort!\n\n # create hash of all the numbers that exist\n proceeded_freq = inputs.join.split('').uniq.sort.reduce({}) { |a,n| a[n] = []; a }\n\n # populate the hash, for each key, the value is the numbers that follow it\n inputs.each do |n|\n proceeded_freq[n[0].chr].push(n[1].chr)\n proceeded_freq[n[0].chr].push(n[2].chr)\n proceeded_freq[n[1].chr].push(n[2].chr)\n end\n\n proceeded_freq.map { |k,v| v = v.uniq! }\n proceeded_freq = proceeded_freq.sort_by { |k,v| v.length }.reverse\n\n answer = proceeded_freq.reduce(\"\") { |a, n| a << n[0] }.to_i\nend",
"def solve\n perms = (1..9).to_a.permutation.map {|p| p.join}\n prods = []\n\n perms.each do |p|\n (1..2).each do |len|\n a, b, c = p[0, len].to_i, p[len..4].to_i, p[5, 4].to_i\n prods << c if a * b == c\n end\n end\n \n prods.uniq.reduce( :+ )\n end",
"def sub_array_memo(nums)\n\t@cache = []\n\tmax_sum(nums, nums.length)\n\t@cache.max\nend",
"def solve\n # Read lines and split into start-end pairs.\n pairs = []\n IO.read( 'resources/0079_keylog.txt' ).split.uniq.each do |line|\n pairs << line[0, 2] << line[1, 2] << line[0] + line[2]\n end\n\n # Delete duplicates and compute weight based on start character frequency.\n pairs.uniq!\n weight = (0..9).map {|i| pairs.count {|p| p[0].to_i == i}}\n\n # Order pairs according to most popular starting character, since we want\n # to maximize how many numbers appear after each one.\n pairs.sort_by! {|p| 10 * weight[p[0].to_i] + weight[p[1].to_i]}\n\n # Concatenate characters as long as they haven't been seen before. This\n # is not a general-purpose solution, but the problem (as stated) is not\n # exceptionally challenging.\n pwd = []\n pairs.reverse.each do |p|\n pwd << p[0] unless pwd.include?( p[0] )\n pwd << p[1] unless pwd.include?( p[1] )\n end\n\n pwd.join.to_i\n end",
"def verify_word_on_board(w, hash_table)\n w = w.upcase # Since the letters on board is in capital letter\n\n p hash_table\n i = 0\n searched_index = {} # Hash table to keep track what has been searched\n (0...w.length).each { |i| searched_index.store(i, -1)} # Initiate values to indicate that no letters have been searched\n\n while i >= 0 && i < w.length\n # puts \"\\nStart of while loop, i = #{i}, searching letter #{w[i]}...\" ###\n move = false\n\n unless hash_table[w[i]].empty?\n # print \"Letter #{w[i]} exist at #{hash_table[w[i]]}\\n\" ###\n hash_table[w[i]].each_with_index do | value , index |\n # puts \"Scanning through #{w[i]} at position #{value}\" ###\n \n # This unmark the position that was used previously during backtracking.\n if value + @total_letters < 0\n # puts \"Position #{hash_table[w[i]][index]} of #{w[i]} is restored...\" ###\n hash_table[w[i]][index] += (@total_letters * 2)\n # puts \"Position of #{w[i]} is now #{hash_table[w[i]][index]}.\" ###\n end\n\n if index <= searched_index[i] # This skips letters that are already searched\n # puts \"#{w[i]} at #{hash_table[w[i]][index]} is already searched.\" ###\n next\n end\n\n if value >= 0\n \n # The position is subtrated by no of total letters to indicate that it has been searched.\n # No of total letters is used so that duplicate of hash table is not required.\n \n if i == 0 || is_adjacent(hash_table[w[i]][index],(@total_letters + hash_table[w[i-1]][searched_index[i-1]]))\n hash_table[w[i]][index] -= @total_letters\n # puts \"#{value} has been subracted by @total_letters to #{hash_table[w[i]][index]}\" ###\n \n \n searched_index[i] = index\n # puts \"Moving to next letter, searched_index[#{i}] now has been updated to #{searched_index[i]}\" ###\n move = true\n i += 1\n break\n end\n\n end\n end\n\n end\n\n # i -= 1 if move == false\n if move == false\n if i > 0\n # puts \"Previously used #{w[i-1]} position of #{hash_table[w[i-1]][searched_index[i-1]]} is being marked for restoration.\" ###\n \n hash_table[w[i-1]][searched_index[i-1]] -= @total_letters # To mark position to be restored to original value as it will not be used anymore\n # puts \"Current position of #{w[i-1]} is #{hash_table[w[i-1]][searched_index[i-1]]}.\" ###\n searched_index[i] = -1\n end\n\n\n # puts \"Letter #{w[i]} is not available/not adjacent and i will be subtracted\" ###\n i -= 1\n end\n\n end\n\n # Restore back all coordinates for next word\n\n\n restore_hash_table(hash_table)\n\n # Check whether word exists.\n if i >= 0 \n puts \"#{w} exists!\"\n return true\n else\n puts \"#{w} is not available.\"\n return false\n end\n \n end",
"def inmj\n result = 0\n (1..9).each do |base|\n exponent = 1\n while (intGetLengthInt(base ** exponent) == exponent)\n result += 1\n exponent += 1\n end\n end\n result\nend",
"def marcsCakewalk(calorie)\n arr = calorie.sort.reverse!\n\n sum = 0\n arr.each_with_index do |cal, index|\n sum += cal * (2**index)\n end\n sum\nend",
"def compute_max_beauty( hash )\n max_beauty = 0\n cur_beauty_mult = 26\n arr = hash.sort_by { |letter, count| count }\n arr.reverse_each do |entry|\n max_beauty += cur_beauty_mult * entry[1]\n cur_beauty_mult -= 1\n end\n max_beauty\nend",
"def solution\n 971 * (-61)\nend",
"def update_possible!()\r\n\r\n #falls es keine Hits gibt, werden ale Tipps geloescht, die eine der Ziffern enthalten\r\n if (@last_hits == [0,0])\r\n @digits.times do |i|\r\n\r\n @left.delete_if{ |x|\r\n x.include?(@last_guess[i])\r\n }\r\n\r\n end\r\n\r\n end\r\n\r\n #falls es keine Black Hits gibt, werden alle Tipps mit einer identischen Stelle geloescht\r\n if @last_hits[0]==0\r\n\r\n @digits.times do |i|\r\n\r\n @left.delete_if { |x|\r\n x[i]==@last_guess[i]\r\n }\r\n end\r\n\r\n end\r\n\r\n #loescht alle, deren Uebereinstimmung mit dem letzten Tipp nicht den Black Hits entspricht\r\n @left.delete_if { |x|\r\n @last_hits[0] != @mastermind.hits(@last_guess,x)[0]\r\n }\r\n\r\n #loescht alle, deren Uebereinstimmung mit dem letzten Tipp nicht den Total Hits entspricht\r\n @left.delete_if { |x|\r\n (@last_hits[0] + @last_hits[1]) != (@mastermind.hits(@last_guess,x)[0]+@mastermind.hits(@last_guess,x)[1])\r\n }\r\n\r\n end",
"def compute_down_cache\n collection = Array.new(@row_ct) { Array.new(@col_ct) { 0 }}\n c_idx = 0\n while (c_idx < @col_ct) do\n r_idx = 0 # LESSON: whenever doing these nested loops, make sure to double check that values get properly reset...\n counter = 0\n while (r_idx < @row_ct) do\n val = @grid[r_idx][c_idx]\n if val == 1\n counter += 1\n else\n counter = 0\n end\n collection[r_idx][c_idx] = counter\n r_idx += 1\n end\n c_idx += 1\n end\n return collection\n end",
"def code\n d = a + (7 * 362)\n b = c = 0\n loop do\n a = d\n while a != 0\n b = a\n a = 0\n loop do\n c = 2\n while c != 0\n break if b == 0\n\n b -= 1\n c -= 1\n end\n break if b == 0\n\n a += 1\n end\n b = 2 - c\n c = 0\n puts b\n end\n end\n end",
"def hole6\n [?A,*(?2..'10'),?J,?K,?Q].product([?C,?H,?S,?D]).map(&:join) + [?J,?J]\n # put your implementation in here, but please leave the comments above and at the 'end'\n\n end",
"def lcs_backtrack_blosum(v, w, sigma)\n <<-DOC\n LCSBACKTRACK(v, w)\n for i ← 0 to |v|\n si, 0 ← 0\n for j ← 0 to |w| \n s0, j ← 0\n for i ← 1 to |v|\n for j ← 1 to |w|\n si, j ← max{si-1, j, si,j-1, si-1, j-1 + 1 (if vi = wj)}\n if si,j = si-1,j\n Backtracki, j ← \"↓\"\n if si, j = si, j-1\n Backtracki, j ← \"→\"\n if si, j = si-1, j-1 + 1\n Backtracki, j ← \"↘\"\n return Backtrack\n DOC\n # puts v\n # puts w\n\n blosum = blosum_62()\n s = []\n backtrack = []\n (0..(v.length)).each {|i| s[i] = []}\n (0..(v.length)).each {|i| backtrack[i] = []}\n\n # (0..(v.length-1)).each {|i| s[i][0] = 0}\n (0..(v.length)).each do |i| \n s[i][0] = i*(-sigma)\n backtrack[i][0] = \"down\"\n end\n # (0..(w.length-1)).each {|j| s[0][j] = 0}\n (0..(w.length)).each do |j| \n s[0][j] = j*(-sigma)\n backtrack[0][j] = \"right\"\n end\n\n (1..(v.length)).each do |i|\n (1..(w.length)).each do |j|\n # puts \"i #{i} j #{j} #{v[i-1]} #{w[j-1]} #{blosum[v[i-1]][w[j-1]]}\"\n down_val = s[i-1][j] - sigma\n right_val = s[i][j-1] - sigma\n diag_val = s[i-1][j-1] + blosum[v[i-1]][w[j-1]]\n s[i][j] = [down_val, right_val, diag_val].max\n if s[i][j] == down_val\n backtrack[i][j] = \"down\"\n elsif s[i][j] == right_val\n backtrack[i][j] = \"right\"\n elsif s[i][j] == diag_val\n backtrack[i][j] = \"diag\"\n end\n\n end \n end\n\n return [s[v.length][w.length], backtrack]\n end",
"def my_version(lorem)\n points = proc { |word| word.chars.map { |l| l.ord - 96 }.sum }\n lorem.split.reduce do |memo, word|\n points.call(word) > points.call(memo) ? word : memo\n end\nend",
"def mambo_no_5; end",
"def get_hint(secret, guess)\r\n hash1 = Hash.new(0)\r\n hash2 = Hash.new(0)\r\n bulls = 0\r\n cows = 0\r\n \r\n secret.each_char.with_index do |char, idx| \r\n hash1[char] += 1\r\n bulls += 1 if secret[idx] == guess[idx]\r\n end\r\n \r\n guess.each_char {|char| hash2[char] += 1}\r\n hash1.keys.each {|key| cows += [hash1[key], hash2[key]].min}\r\n \r\n bulls.to_s + \"A\" + (cows-bulls).to_s + \"B\"\r\nend",
"def memo(m_id)\n r_memo = \"\"\n $memos.each do |memo|\n if memo['id'].to_s == m_id.to_s then\n r_memo = memo\n break\n else\n r_memo = \"unko\"\n end \n end\n return r_memo\nend",
"def expansionclave(iteracion)\n t_mclave=@m_clave\n aux=Array.new(4){Array.new(4)}\n #operacion del rotword (rotando la ultima columna de la matriz de las claves)\n aux[0][3],aux[1][3],aux[2][3],aux[3][3]=t_mclave[1][3],t_mclave[2][3],t_mclave[3][3],t_mclave[0][3]\n\n #relleno la matriz completa con los demas elementos de la matrz de la clave\n for i in 0...4\n for j in 0...3\n aux[i][j]=t_mclave[i][j]\n end\n end\n #se busca en la sbox los valores de la matriz\n aux[0][3],aux[1][3],aux[2][3],aux[3][3]=get_sbox(aux[0][3].to_i(16)).to_s(16).rjust(2,'0'),get_sbox(aux[1][3].to_i(16)).to_s(16).rjust(2,'0'),get_sbox(aux[2][3].to_i(16)).to_s(16).rjust(2,'0'),get_sbox(aux[3][3].to_i(16)).to_s(16).rjust(2,'0')\n #se realiza la operación de principal de la epansion de claves\n aux[0][0]=(@m_clave[0][0].to_i(16)^aux[0][3].to_i(16)^Rcon[0][iteracion]).to_s(16).rjust(2,'0')\n aux[1][0]=(@m_clave[1][0].to_i(16)^aux[1][3].to_i(16)^Rcon[1][iteracion]).to_s(16).rjust(2,'0')\n aux[2][0]=(@m_clave[2][0].to_i(16)^aux[2][3].to_i(16)^Rcon[2][iteracion]).to_s(16).rjust(2,'0')\n aux[3][0]=(@m_clave[3][0].to_i(16)^aux[3][3].to_i(16)^Rcon[3][iteracion]).to_s(16).rjust(2,'0')\n for i in 0...4\n for j in 1...4\n aux[i][j]=(@m_clave[i][j].to_i(16)^aux[i][j-1].to_i(16)).to_s(16).rjust(2,'0')\n end\n end\n\n @m_clave=aux\n end",
"def solve\n n = 33\n while true\n begin\n n += 2\n end while n.prime?\n\n s, ds = 2, 6\n while s < n && !(n - s).prime?\n s += ds\n ds += 4\n end\n\n break if s >= n\n end\n \n n\n end",
"def problem_14\nend",
"def fuse\r\n\t\ti,j=0\r\n\t\twhile i<8 do \r\n\t\t j=0\r\n\t\t while j<8 do\r\n\t\t \r\n\t\t if @nha[i][j] == nil\r\n\t\t @nha[i][j] =\".\" \r\n\t\t end\r\n\t\t j+=1\r\n\t\t end \r\n\t\t i+=1\r\n\t\tend \r\n\t\treturn true\r\n\tend",
"def example_group_memoized_helpers; end",
"def branch_explore(copy_of_map_arr, direction, exit_hash, copy_of_answer_array, x, y, x_max, y_max)\n x += 1 if direction == 'right'\n x -= 1 if direction == 'left'\n y -= 1 if direction == 'up'\n y += 1 if direction == 'down'\n temp_miner = {'x' => x, 'y' => y}\n copy_of_answer_array = solve(copy_of_map_arr, temp_miner, exit_hash, copy_of_answer_array)\n if copy_of_answer_array.size == ((x_max + 1) * (y_max + 1)) \n copy_of_map_arr[x][y] = false \n else\n copy_of_map_arr[x][y] == \"branch\"\n end\n x -= 1 if direction == 'right'\n x += 1 if direction == 'left'\n y += 1 if direction == 'up'\n y -= 1 if direction == 'down'\n copy_of_answer_array\nend",
"def challenge; end",
"def problem_106a\n combin = lambda { |m,h| m.factorial / (h.factorial * (m - h).factorial) }\n max = 20\n\n sum = Array.new(max+1,-1)\n 1.upto(max) do |n|\n 0.upto(n/2) do |k|\n sum[n] += combin.call(n,2*k) * combin.call(2*k - 1, k + 1)\n end\n puts \"#{n} #{sum[n]}\"\n end\n sum[12]\nend",
"def get_shakey \n {\"William Shakespeare\"=>{\"1\"=>{\"title\"=>\"The Two Gentlemen of Verona\", \"finished\"=>1591}, \"2\"=>{\"title\"=>\"The Taming of the Shrew\", \"finished\"=>1591}, \"3\"=>{\"title\"=>\"Henry VI, Part 2\", \"finished\"=>1591}, \"4\"=>{\"title\"=>\"Henry VI, Part 3\", \"finished\"=>1591}, \"5\"=>{\"title\"=>\"Henry VI, Part 1\", \"finished\"=>1592}, \"6\"=>{\"title\"=>\"Titus Andronicus\", \"finished\"=>1592}, \"7\"=>{\"title\"=>\"Richard III\", \"finished\"=>1593}, \"8\"=>{\"title\"=>\"Edward III\", \"finished\"=>1593}, \"9\"=>{\"title\"=>\"The Comedy of Errors\", \"finished\"=>1594}, \"10\"=>{\"title\"=>\"Love's Labour's Lost\", \"finished\"=>1595}, \"11\"=>{\"title\"=>\"Love's Labour's Won\", \"finished\"=>1596}, \"12\"=>{\"title\"=>\"Richard II\", \"finished\"=>1595}, \"13\"=>{\"title\"=>\"Romeo and Juliet\", \"finished\"=>1595}, \"14\"=>{\"title\"=>\"A Midsummer Night's Dream\", \"finished\"=>1595}, \"15\"=>{\"title\"=>\"King John\", \"finished\"=>1596}, \"16\"=>{\"title\"=>\"The Merchant of Venice\", \"finished\"=>1597}, \"17\"=>{\"title\"=>\"Henry IV, Part 1\", \"finished\"=>1597}, \"18\"=>{\"title\"=>\"The Merry Wives of Windsor\", \"finished\"=>1597}, \"19\"=>{\"title\"=>\"Henry IV, Part 2\", \"finished\"=>1598}, \"20\"=>{\"title\"=>\"Much Ado About Nothing\", \"finished\"=>1599}, \"21\"=>{\"title\"=>\"Henry V\", \"finished\"=>1599}, \"22\"=>{\"title\"=>\"Julius Caesar\", \"finished\"=>1599}, \"23\"=>{\"title\"=>\"As You Like It\", \"finished\"=>1600}, \"24\"=>{\"title\"=>\"Hamlet\", \"finished\"=>1601}, \"25\"=>{\"title\"=>\"Twelfth Night\", \"finished\"=>1601}, \"26\"=>{\"title\"=>\"Troilus and Cressida\", \"finished\"=>1602}, \"27\"=>{\"title\"=>\"Sir Thomas More\", \"finished\"=>1604}, \"28\"=>{\"title\"=>\"Measure for Measure\", \"finished\"=>1604}, \"29\"=>{\"title\"=>\"Othello\", \"finished\"=>1604}, \"30\"=>{\"title\"=>\"All's Well That Ends Well\", \"finished\"=>1605}, \"31\"=>{\"title\"=>\"King Lear\", \"finished\"=>1606}, \"32\"=>{\"title\"=>\"Timon of Athens\", \"finished\"=>1606}, \"33\"=>{\"title\"=>\"Macbeth\", \"finished\"=>1606}, \"34\"=>{\"title\"=>\"Antony and Cleopatra\", \"finished\"=>1606}, \"35\"=>{\"title\"=>\"Pericles, Prince of Tyre\", \"finished\"=>1608}, \"36\"=>{\"title\"=>\"Coriolanus\", \"finished\"=>1608}, \"37\"=>{\"title\"=>\"The Winter's Tale\", \"finished\"=>1611}, \"38\"=>{\"title\"=>\"Cymbeline\", \"finished\"=>1610}, \"39\"=>{\"title\"=>\"The Tempest\", \"finished\"=>1611}, \"40\"=>{\"title\"=>\"Cardenio\", \"finished\"=>1613}, \"41\"=>{\"title\"=>\"Henry VIII\", \"finished\"=>1613}, \"42\"=>{\"title\"=>\"The Two Noble Kinsmen\", \"finished\"=>1614}}}\nend",
"def solve( n = 100 )\n n.partition_sieve[-1] - 1\n end",
"def break_chocolate(n, m)\n breaks = 0\n breaks += (n-1)\n n.times do |pieces|\n breaks += (m-1)\n end\n breaks\nend"
] |
[
"0.6939625",
"0.6509942",
"0.5713137",
"0.5653655",
"0.5631309",
"0.5526025",
"0.5495748",
"0.54901093",
"0.5465837",
"0.54655796",
"0.54559904",
"0.5449411",
"0.5444663",
"0.54371756",
"0.54044294",
"0.53928345",
"0.5390152",
"0.53773975",
"0.5370268",
"0.5365193",
"0.53597295",
"0.53340083",
"0.5332378",
"0.533136",
"0.53273684",
"0.5326142",
"0.53261393",
"0.5321359",
"0.5320843",
"0.5314695",
"0.53136253",
"0.5308548",
"0.53053796",
"0.53007156",
"0.5297501",
"0.52923757",
"0.52914053",
"0.5277408",
"0.5276536",
"0.5274482",
"0.52739406",
"0.52697897",
"0.5267901",
"0.52651304",
"0.52627224",
"0.52619743",
"0.52614427",
"0.5258212",
"0.5250423",
"0.5250072",
"0.5246932",
"0.5245904",
"0.5245639",
"0.52429307",
"0.52414054",
"0.5236304",
"0.52340597",
"0.52337813",
"0.5215124",
"0.5211238",
"0.52079254",
"0.52029186",
"0.51916724",
"0.5177272",
"0.5176916",
"0.5169767",
"0.5160198",
"0.51596475",
"0.51498383",
"0.5145493",
"0.5144899",
"0.51403487",
"0.5137759",
"0.5136833",
"0.5133897",
"0.51336837",
"0.5130701",
"0.51292324",
"0.5126024",
"0.5123692",
"0.51173794",
"0.5117356",
"0.5117006",
"0.5114869",
"0.51141715",
"0.5113111",
"0.5108743",
"0.510715",
"0.5091832",
"0.5089232",
"0.5084274",
"0.50798774",
"0.50795287",
"0.50757384",
"0.5074043",
"0.50675935",
"0.50669545",
"0.5060695",
"0.5059892",
"0.5056624",
"0.5046794"
] |
0.0
|
-1
|
Store array of items as a global so we don't have to pass it around Recursive is clean but blows stack on large inputs!
|
def optimize(weight)
return 0 if weight <= 0
best = nil
$items.each do |item|
c = optimize(weight - item.weight) + item.cost
best = c if best.nil? || c < best
end
best
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def items; @items.clone end",
"def enqueue(items)\n @in_stack = []\n items.each { |item| @in_stack << item }\nend",
"def items\n @items ||= []\n end",
"def get_items\n\t\t@arr\n\tend",
"def all_items\r\n list = Array.new\r\n items.each{ |item| list.push(item)}\r\n list\r\n end",
"def buildArray(localObjCache, increase)\n localDirContents=[] #Array of all items in the cwd\n localDirContents=Dir[Dir.pwd+\"/*\"] #Builds the array of items in cwd\n\n localDirContents.each do |item|\n if File.file?(item)\n fileObj = FileName.new(item)\n localObjCache.push(fileObj)\n n = increase.call #printing every 100 files scanned\n if n % 100 == 0\n puts n\n end\n elsif File.directory?(item)\n Dir.chdir(item)\n buildArray(localObjCache, increase) \n end\n end\n\n return localObjCache\n end",
"def push_multi(items)\n raise ArgumentError, \"push multi takes an array!, not an #{items.class}!\" unless items.is_a?(Array)\n synchronize do |buffer|\n items.each {|item| push_unsafe(item) }\n end\n end",
"def add_item(elective_array, item)\n elective_array.push(item)\n puts elective_array\nend",
"def assign(items)\n return if items.nil?\n\n items.each do |values|\n new_item = @item_proc.call\n new_item.parent = self\n new_item.assign(values)\n @items << new_item\n end\n end",
"def atomic_array_pushes\n @atomic_array_pushes ||= {}\n end",
"def get_items\r\n @arr.to_a\r\n end",
"def initialize\n @listOfItem = Array.new\n end",
"def storage_all_items\n storage_items + storage_equip_items\n end",
"def create_a_list(items)\n item_array = items.split\n shopping_list = {}\n item_array.each do |x|\n shopping_list[x] = 1\n end\n #shopping_list.store(items)\n shopping_list\nend",
"def add_item(groccery_items, item)\n groccery_items[item] = 1\n p groccery_items\nend",
"def store_processes(process_array)\n process_repeat(\"start\")\n process_array.each do |thing|\n arr = []\n arr.push(thing)\n p arr\n end\nend",
"def items\n @items ||= line_items.to_a\n end",
"def add_item(array, item)\n\tarray.push(item)\nend",
"def calculateDistanceFromRobot()\r\n\tfor r in 0...$globalArr.length\r\n\t\t#for c in 0...$globalArr[r].length\r\n\t\t\t#calculateDistance(0,0,)\r\n\t\t\t#print \"#{$globalArr[r][c]},\"\r\n\t\t#end\r\n\t\tpos = $globalArr[r][1]\r\n\t\tdistanceFromRobot = calculateDistance(0,0,pos[0],pos[1])\r\n\t\t$globalArr[r].push(distanceFromRobot)\r\n\t\t#$globalArr2[r].push(distanceFromRobot)\r\n\t\t#puts \"\"\r\n\tend\r\n\t#printAns() \r\n\torderItem()\r\n\t#orderItemReverse()\r\nend",
"def make_item_list\n @data = $game_party.all_items.select {|item| include?(item)}\n @data.push(nil) if include?(nil)\n end",
"def add_item(array, item)\n\tarray << item\nend",
"def initialize\n @items = []\n end",
"def add_to_array(array, item)\n\tarray += [item]\n\tp array\nend",
"def push(*items)\n items = _ensure_array_is_valid items\n super\n end",
"def add_item(item)\r\n \t@arr.push(item)\r\n end",
"def all_item_ids\n [id] + item_ids\n end",
"def push(item); end",
"def add_to_array(array, item)\n array << item\nend",
"def all_items\n # retzrb => [ \"item23\", \"item42\", \"item17\", (...) ]\n raise \"implemented in subclass\"\n end",
"def initialize array_of_items\n\tend",
"def all_items\n @allitems ||= syncitems :lastsync => \"1970-01-01 00:00:00\"\n end",
"def initialize(input_arr=[])\n @internal_arr = []\n \n # take the input_arr and pass each value to add \n input_arr.each{|new_ele| add(new_ele)}\n\n end",
"def local_set( local_index )\n \n local_index = local_index < 0 ? @array_instance.size + local_index : local_index\n \n if local_index >= @array_instance.size\n local_index = local_insert( local_index, 1 )\n elsif @local_index_to_parent_map and parent_array = @local_index_to_parent_map[ local_index ]\n local_parent_map = local_parent_map( parent_array )\n local_parent_map[ local_index ] = nil\n @local_index_to_parent_map[ local_index ] = nil\n @requires_lookup[ local_index ] = false\n end\n\n return local_index\n \n end",
"def push_many(items)\n # we're expecting items to have an nested array of args, lets take each one and correctly normalize them\n payloads = items[:args].map do |args|\n fail ArgumentError, \"Bulk arguments must be an Array of Arrays: [[:foo => 'bar'], [:foo => 'foo']]\" unless args.is_a?(Array)\n # clone the original items (for :queue, :class, etc..)\n item = items.clone\n # merge this item's args (eg the nested `arg` array)\n item.merge!(args: args) unless args.empty?\n # normalize this individual item\n normalize_item(item)\n end.compact\n\n # if successfully persisted to redis return the size of the jobs\n pushed = false\n pushed = raw_push(payloads) unless payloads.empty?\n pushed ? payloads.size : nil\n end",
"def add_value(item)\n array.push(item)\n end",
"def push *items\n @items.concat items\n end",
"def push(item)\n raise StackOverflow if full?\n @info[@index] = item\n @index += 1\n self\n end",
"def make_array(item1, item2, item3)\n\tarray = [item1, item2, item3]\n\n\tarray\nend",
"def current_list(grocery_list, item, qty)\n grocery_list[item] = qty\n grocery_list\nend",
"def atomic_array_add_to_sets\n @atomic_array_add_to_sets ||= {}\n end",
"def add_to_array(arr, a)\r\n\treturn_array = arr\r\n\treturn_array << a\r\nend",
"def items_hash()\n return @items\n end",
"def add_to_array!(array, item)\n array << item\nend",
"def initialize\n @items_list = []\n end",
"def nested_array\n curr = @nested\n @list.each do |num|\n r = rand(3)\n if r == 1\n curr << num\n elsif r == 2\n curr << []\n curr = curr[curr.length - 1]\n curr << num\n else\n curr = @nested\n curr << num\n end\n end\n @nested\n end",
"def add_item(item, item_qty, grocery_list)\n grocery_list[item] = item_qty\n # print_list(grocery_list)\n grocery_list\nend",
"def menu_lists\n @@lists ||= create_menu_lists.freeze\nend",
"def global_linear_search(item, array)\n\n result = []\n\n\n \tfor i in 0...array.length\n\t \tif array[i] == item\n\t \t\tresult << i\n\t \tend\n\t \t\n\t \ti += 1\n\n end\n result\nend",
"def add_item(item_list, item, qty)\r\n item_list[item] = qty\r\n item_list\r\nend",
"def get_custom_list(num_of_items, items_type)\n input_items = [] # stores user-provided items for items_type\n (1..num_of_items).each do |item_num|\n print \" #{item_num}. \"\n user_item = get_user_item_if_valid(items_type, input_items)\n # user_item is 'nil' if user entered an empty String or a duplicate item\n user_item.nil? ? redo : input_items.push(user_item)\n end\n return input_items\nend",
"def initialize\n @items = []\n @item_stack = []\n yield self if block_given?\n end",
"def custom_hook_all(items)\n items\n end",
"def custom_hook_all(items)\n items\n end",
"def items\n @items ||= Items.new\n end",
"def loot\r\n\t@@item_number += 1\r\n\t$items = @@item_number\r\n\treturn\r\n\tend",
"def resize\n temp_array = Array.new(@items)\n @items = Array.new(temp_array.length*2)\n\n # Iterates over every item in the original array, makes a new hash key, and puts it into new @items.\n for item in temp_array do\n if item != nil\n new_hash_key = self.index(item.key,self.size)\n @items[new_hash_key] = item\n end\n end\n end",
"def to_ary\n resolve\n @items\n end",
"def findSet(originalname,checkitem) \n if @store[checkitem].is_a?(Integer) then\n #Updating refrence to speed up further query\n if originalname!=checkitem then\n @store[originalname]=checkitem\n end\n return Array.[](checkitem,@store[checkitem]) #Return the Absolute Parent name and the number of element it has\n else\n findSet(originalname,@store[checkitem]) \n end\n end",
"def add_item(list, item, quantity)\n #list = item.push\n list[item] = quantity.to_i\n list\nend",
"def _ItemsList\n\n _save = self.pos\n while true # choice\n _tmp = apply_with_args(:_UnorderedList, 1)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_OrderedList)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_DefinitionList)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_LongDefinitionList)\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_ItemsList unless _tmp\n return _tmp\n end",
"def initialize(input_arr=[])\n \n @internal_arr = []\n\n # Pass each element in input_arr to 'add' method (if it isn't empty)\n input_arr.each { | ele | add(ele) } \n\n end",
"def we_can_add_things(x)\n array = [ 1, 2, 3]\n array.push(x)\nend",
"def add_item(item, quantity, list)\r\n list[item] = quantity\r\n p list\r\n list\r\nend",
"def optimize_depth_array()\n\n @root = @all_depths[0].first[1]\n\n # for each depth in tree\n @all_depths[1..@all_depths.length-1].each do |depth|\n # for each item in depth (could be node or array of nodes)\n depth.each do |sec_id, item|\n if (item.class == Node)\n node = item\n parent = get_parent(node.path)\n parent.add_child(node)\n else # item is array of nodes\n item.each do |node|\n parent = get_parent(node.path)\n parent.add_child(node)\n end\n end\n end\n end\n\n end",
"def pop_inv(inv, size) \n\n items = Array.new;\n\n # Populate with size\n case size\n when :pocket\n @book = Item.new([\"book\", \"novel\"], \"1984\", \"An Orwellian Nightmare\")\n @pen = Item.new([\"pen\", \"biro\"], \"4-Pen\", \"A four pen with red, green, blue and black inks\")\n @phone = Item.new([\"phone\", \"cell\"], \"iPhone\", \"An iPhone 5\") \n items.push(@book, @pen, @phone)\n \n when :wallet\n @myki = Item.new([\"myki\", \"travelcard\"], \"Myki\", \"An consession myki card\")\n @idcard = Item.new([\"id\", \"card\"], \"ID card\", \"Swinny ID card\")\n @cash = Item.new([\"cash\", \"money\"], \"$20 banknote\", \"A 20 dollar banknote\") \n items.push(@myki, @idcard, @cash)\n end\n \n #put the items in\n items.each do |item|\n inv.put(item)\n end\nend",
"def add_to_back(item)\n @array << item\n end",
"def items\n return @items\n end",
"def items_to_obj\n item_basket = []\n @items.each do |id, nbr|\n nbr.times do |i|\n item_basket << $data_items[id]\n end\n end\n item_basket\n end",
"def initialize(input_arr=[])\n @internal_arr = []\n input_arr.each do |x|\n self.add(x)\n end\n end",
"def push_flat(input_item)\n raise 'Queue is closed!' if @closed\n\n @logger.debug(\"Pushing flat into #{@name} values: #{input_item}\")\n if input_item.respond_to? :each\n input_item.each { |item| push(item) }\n else\n @mutex.synchronize do\n until offer(input_item)\n @logger.debug(\"#{@name} is waiting on full\")\n @full.wait(@mutex)\n end\n @empty.broadcast\n end\n end\n @logger.debug(\"Finished pushing flat into #{@name} values: #{input_item}\")\n end",
"def add_item item\n @items << item\n @@all_items << item\n end",
"def items\n items, iter = [], @obj.items\n while (i = iter.next) do\n items << i\n end\n items\n end",
"def build_array\n arr = []\n yield(arr)\n arr \n end",
"def resize\n doubled = Array.new(size*2)\n @items.each do |item|\n if item\n doubled[index(item.key, doubled.length)] = item\n #puts \"item: #{item.key} \\n#{doubled}\"\n end\n end\n @items = doubled\n end",
"def create_list(items)\n grocery_list = Hash.new(0) #other method is only local in grocery_list\n food_array = items.split(\" \")\n food_array.each{|food| grocery_list[food] = 1}\n grocery_list\nend",
"def update_quan(older_list, item, quantity)\r\n older_list[item] = quantity\r\n return older_list \r\nend",
"def initialize_list(desired_start_items)\n\n arr = desired_start_items.split(' ')\n\n # The each loop will run once for every element in the array.\n arr.each do |item_name|\n add_item(item_name) # this will be updating $list_items\n end\n\n display_list\nend",
"def global_food(people)\n food_array = []\n for person in people\n food_array.push(person[:favourites][:snacks])\n #food_array.concat(person[:favourites][:snacks])\n # if we want to return only one array\n end\n return food_array\nend",
"def initialize(input_arr=[])\n @internal_arr = []\n input_arr.each { |x| add x }\n # Fill in the rest of the initialize method here.\n # What should you do with each element of the incoming array?\n end",
"def all\n Maglev::PERSISTENT_ROOT[self].values\n end",
"def items(&block) \n if block_given?\n instance_eval(&block) \n else\n @items\n end \n end",
"def store_items\n store = {\n \"yogurts\" => 2,\n \"meat\" => 7,\n \"vegetables\" => 5,\n \"potatoes\" => 2,\n \"rice\" => 1\n }\n return store\nend",
"def get_all_vals(node, arr)\n # add the value of the node to the array\n arr << node.val\n \n # using a ternary operator, check if there is another node in the list\n # if so, recursively run the function again\n # if not, return the array\n return node.next ? get_all_vals(node.next, arr) : arr\n end",
"def items=(value)\n @items = value\n end",
"def items=(value)\n @items = value\n end",
"def resize\n old_array = @items\n @items = Array.new(old_array.length * 2)\n old_array.each do |ll|\n unless ll.nil?\n current = ll.head\n unless current.nil?\n index = self.index(current.key, @items.length)\n if @items[index].nil?\n @items[index] = LinkedList.new\n @items[index].add_to_tail(Node.new(current.key, current.value))\n if load_factor >= @max_load_factor\n self.resize\n end\n current = current.next\n else\n @items[index].add_to_tail(Node.new(current.key, current.value))\n if load_factor >= @max_load_factor\n self.resize\n end\n current = current.next\n end\n end\n end\n end\n end",
"def load_items\n @items = []\n data_sources.each do |ds|\n items_in_ds = ds.items\n items_in_ds.each { |i| i.identifier = File.join(ds.items_root, i.identifier) }\n @items += items_in_ds\n end\n\n @items_loaded = true\n end",
"def items(**items)\n const_set(:ITEMS, items)\n end",
"def initialize\n @items = []\n end",
"def set_values(*items)\r\n items = *items\r\n @value = [nil]\r\n items.each do |item|\r\n @value.push(item)\r\n end\r\n end",
"def recursive(*args)\n @scope.with_values += args\n @scope.recursive_value = true\n @scope\n end",
"def recursive(*args)\n @scope.with_values += args\n @scope.recursive_value = true\n @scope\n end",
"def resize\n old_items = @items\n @items = Array.new(@items.size*2)\n old_items.each do |i|\n if i != nil\n puts i\n @items[index(i.key,@items.length)] = HashItem.new(i.key, i.value)\n end\n end\n end",
"def update_qty(item, item_qty, grocery_list)\n grocery_list[item] = item_qty\n # print_list(grocery_list)\n grocery_list\nend",
"def << item\n @items << item\n end",
"def initialize(input_arr=[])\n @internal_arr = []\n input_arr.each {|ele| add ele}\n\n # Fill in the rest of the initialize method here.\n \n # What should you do with each element of the incoming array?\n end",
"def take_array(a)\n a = [\"a\", 1, 3, \"we0w98\"] \n puts a\n dont_mutate\n #mutate_caller\n end",
"def copyfreeze(items)\n case items\n when Hash\n result = {}\n items.each do |k, v|\n result[k] = copyfreeze(v)\n end\n result.freeze\n when Array\n items.map { |i| copyfreeze(i) }\n when Numeric\n items\n when NilClass\n items\n when TrueClass\n items\n when FalseClass\n items\n when String\n if items.frozen?\n items\n else\n items.dup.freeze\n\tend\n else\n STDERR.puts \"Unrecognized item type #{items.class.inspect} in copyfreeze!\"\n items.dup.freeze\n end\n end",
"def add_item(title, price, quantity = 1)\n item = {\n title: title,\n price: price,\n quantity: quantity\n}\n\n\n@items_array << item\n@total += price * quantity\n\n\nend",
"def initialize(input_arr=[])\n @internal_arr = []\n # Fill in the rest of the initialize method here.\n # What should you do with each element of the incoming array?\n input_arr.each { |x|\n add(x)\n }\n end",
"def items(prefix = '')\n queue = []\n collect(\n _get(@root, prefix, 0),\n prefix,\n queue\n )\n queue\n end"
] |
[
"0.5740575",
"0.5699575",
"0.5669918",
"0.5640651",
"0.55961436",
"0.55216527",
"0.55216354",
"0.54467195",
"0.5440653",
"0.5433007",
"0.5420189",
"0.53713655",
"0.53476924",
"0.5341562",
"0.5326156",
"0.5321798",
"0.5321605",
"0.5318663",
"0.53123057",
"0.52989674",
"0.5281274",
"0.5259699",
"0.52356476",
"0.52332145",
"0.5214025",
"0.5209333",
"0.52004534",
"0.51934904",
"0.5182405",
"0.51796824",
"0.51604074",
"0.5158592",
"0.5151112",
"0.514588",
"0.5124885",
"0.5120943",
"0.511925",
"0.51153725",
"0.5112899",
"0.5102736",
"0.5086718",
"0.50836474",
"0.50817764",
"0.5080958",
"0.5078666",
"0.5067656",
"0.50565344",
"0.5051748",
"0.5044136",
"0.5043554",
"0.5043013",
"0.50369334",
"0.50369334",
"0.5036228",
"0.50293595",
"0.5027496",
"0.5023817",
"0.5022083",
"0.50192815",
"0.50176287",
"0.50167865",
"0.4999426",
"0.4998727",
"0.49960187",
"0.49948344",
"0.49840042",
"0.4982172",
"0.49782193",
"0.49745464",
"0.49644426",
"0.496286",
"0.49624",
"0.49489573",
"0.49474555",
"0.49470976",
"0.49414453",
"0.49412197",
"0.4934069",
"0.49339935",
"0.4930489",
"0.4920961",
"0.4914381",
"0.49143296",
"0.4913175",
"0.4913175",
"0.4908388",
"0.490823",
"0.4900873",
"0.48968092",
"0.48963422",
"0.48943505",
"0.48943505",
"0.4893655",
"0.48922327",
"0.48904982",
"0.48736018",
"0.48724452",
"0.48714402",
"0.48593566",
"0.48504516",
"0.48493138"
] |
0.0
|
-1
|
Finally, something that works, somewhat ugly though =\
|
def optimize3(weight, cost=0, items = $items)
return cost if weight <= 0 || items.empty?
# puts "#{weight}\t#{cost}\t#{items.collect{|i| i.weight}.join(' ')}"
same_ratio = items.find_all { |i| i.ratio == items[0].ratio }
global_best = nil
same_ratio.size.times do |x|
if weight % items[x].weight == 0
return items[x].cost * (weight / items[x].weight) + cost
end
best = (x == 0) ? items[x].cost * (weight / items[x].weight + 1) + cost : nil
(items - [items[x]]).each do |item|
if x == 0
c = optimize3(weight % items[x].weight, items[x].cost * (weight / items[x].weight) + cost, items - [items[x]])
else
c = optimize3(weight - items[x].weight, items[x].cost + cost, items)
end
best = c if (best.nil? || c < best)
end
global_best = best if best && (global_best.nil? || best < global_best)
end
global_best
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def escaper; end",
"def probers; end",
"def private; end",
"def finalize!; end",
"def final; end",
"def finalized; end",
"def schubert; end",
"def terpene; end",
"def escaper=(_); end",
"def berlioz; end",
"def rassoc(p0) end",
"def original_result; end",
"def original; end",
"def hiss; end",
"def finally\n end",
"def anchored; end",
"def stderrs; end",
"def cleanup; end",
"def cleanup; end",
"def cleanup; end",
"def cleanup; end",
"def with_repl_like_sigint; end",
"def trd; end",
"def finalize\n end",
"def suivre; end",
"def dematerialize ; end",
"def gounod; end",
"def surge; end",
"def compilereturn\n\n end",
"def herald; end",
"def cleanup!; end",
"def cleanup!; end",
"def final?; end",
"def probers=(_arg0); end",
"def finalise\n end",
"def expanded; end",
"def finalize\n end",
"def finalize\n end",
"def finalize\n end",
"def finalize\n end",
"def finalize\n end",
"def finalize\n end",
"def finalize\n end",
"def beautify; end",
"def beautify; end",
"def faint; end",
"def faint; end",
"def wrapper; end",
"def finished; end",
"def reap; end",
"def phase; end",
"def ibu; end",
"def restore; end",
"def transform; end",
"def compressor; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def rest_positionals; end",
"def refutal()\n end",
"def post_process; end",
"def bs; end",
"def begin; end",
"def herebody_s=(_arg0); end",
"def transforms; end",
"def done; end",
"def pausable; end",
"def finalize\n\n end",
"def jack_handey; end",
"def sld; end",
"def returns; end",
"def finalize_operations\n\tend",
"def finished=(_arg0); end",
"def deco_call; end",
"def deco_pos; end",
"def sharp; accidental; end",
"def spice; end",
"def pass; end",
"def pass; end",
"def alt; end",
"def replace(p0) end",
"def replace(p0) end",
"def malts; end",
"def replace(p0) end",
"def finish; end",
"def finish; end",
"def finish; end",
"def finish; end",
"def finish; end",
"def finish; end",
"def finish; end",
"def finish; end",
"def parslet; end",
"def parslet; end",
"def parslet; end",
"def parslet; end",
"def succ!() end",
"def dh; end",
"def transact; end",
"def entry_order=(_arg0); end"
] |
[
"0.5907005",
"0.58743",
"0.57806504",
"0.5761968",
"0.5761125",
"0.57155097",
"0.56638974",
"0.5642834",
"0.56424576",
"0.5517063",
"0.5429609",
"0.5425099",
"0.539132",
"0.53842324",
"0.5383482",
"0.53655034",
"0.5355179",
"0.5343857",
"0.5343857",
"0.5343857",
"0.5343857",
"0.53344345",
"0.5330465",
"0.53245485",
"0.53111845",
"0.53019404",
"0.529097",
"0.52869606",
"0.52643657",
"0.5238296",
"0.5223611",
"0.5223611",
"0.5217514",
"0.5199162",
"0.5192557",
"0.519249",
"0.51379687",
"0.51379687",
"0.51379687",
"0.51379687",
"0.51379687",
"0.51379687",
"0.51379687",
"0.5136675",
"0.5136675",
"0.51337683",
"0.51337683",
"0.5121531",
"0.5114935",
"0.5092339",
"0.5088887",
"0.5088821",
"0.5084679",
"0.5076994",
"0.50768673",
"0.5073423",
"0.5073423",
"0.5073423",
"0.5073423",
"0.5067802",
"0.5067695",
"0.50661224",
"0.5062572",
"0.5060321",
"0.5055536",
"0.5034938",
"0.50332826",
"0.503231",
"0.5031585",
"0.5031548",
"0.50267273",
"0.50202554",
"0.50185573",
"0.50181234",
"0.501588",
"0.49983904",
"0.49968758",
"0.49927008",
"0.49911973",
"0.49911973",
"0.4991114",
"0.49888575",
"0.49888575",
"0.49882236",
"0.49877372",
"0.49809963",
"0.49809963",
"0.49809963",
"0.49809963",
"0.49809963",
"0.49809963",
"0.49809963",
"0.49809963",
"0.49743274",
"0.49743274",
"0.49743274",
"0.49743274",
"0.49683973",
"0.49602583",
"0.49540958",
"0.49529886"
] |
0.0
|
-1
|
shows all posts | HTML GET REQUEST
|
def index
@articles = Article.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n\t@posts = list_posts\n end",
"def index\n # TODO: implement listing all posts\n end",
"def index\n\t\t@posts = Post.order('created_at DESC').where(status:true).page(params[:page]).per(10)\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\tend\n\tend",
"def index\n\t\t@posts = Post.all\n\t\trender :index\n\tend",
"def index\n posts = Post.all\n @view.list_all_posts(posts)\n # TODO: implement listing all posts\n end",
"def display_posts\n begin\n response = RestClient.get \"#{@@DOMAIN}/api/posts.json?all\", authorization_hash\n\n puts \"Response code: #{response.code}\"\n puts \"Response cookies:\\n #{response.cookies}\\n\\n\"\n puts \"Response headers:\\n #{response.headers}\\n\\n\"\n puts \"Response content:\\n #{response.to_str}\"\n\n js = JSON response.body\n js.each do |item_hash|\n item_hash.each do |k, v|\n puts \"#{k}: #{v}\"\n end\n end\n rescue => e\n puts STDERR, \"Error accessing REST service. Error: #{e}\"\n end\n end",
"def index\n # TODO: implement listing all posts\n @view.list_all_posts\n end",
"def index\n # TODO: implement listing all posts\n all_posts = Post.all\n @view.show_output(all_posts)\n end",
"def list\n @posts = Post.all(:order => 'updated_at DESC')\n s=render :index\n\t\ts\n end",
"def index\n set_tab :all\n respond_with(@posts)\n end",
"def index\n respond_with Post.all\n end",
"def index\n get_posts_with_filter\n end",
"def index\n\t\t@post = Post.all\n\t\t# stream\n\tend",
"def index\n\t\t@posts = Post.all\n\tend",
"def index\n\t\t@posts = Post.all\n\tend",
"def index\n\t\t@posts = Post.all\n\tend",
"def index\n\t\t@posts = Post.all\n\tend",
"def index\n\t\t@posts = Posts.all\n\tend",
"def index\n @posts = Post.page(params[:page]).per(PER)\n end",
"def list\n @posts = Post.all(:order => 'updated_at DESC')\n render :index\n end",
"def index\n @posts = Post.find(:all)\n end",
"def index\n \t@posts = Post.all\n end",
"def index\n @posts = Post.all\n \n end",
"def index\n @posts = Post.order(\"created_at DESC\").where(:published => true).limit(5)\n @title = \"Home\"\n @description = \"the blog and website of bassist and programmer Johnny Grubb. no baseball information here.\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n format.xml\n end\n end",
"def index\n @posts = Post.published.page(params[:page]).per(5).ordered\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"def index\n @posts = PostService.getAllPosts\n end",
"def index\n if params[:all]\n @posts = Post.all\n elsif\n @posts = Post.tagged_with(\"blog\")\n end\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"def index\n @posts = Post.all.page(params[:page]).per_page(10)\n end",
"def index\n #how do i get data here\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def index\n @posts = Post.all\n end",
"def show\n\t\t @posts = Post.all.paginate(page: params[:page], per_page: 10) \n\tend",
"def feed\n @posts = Post.all\n\n render_view(:feed)\n end",
"def index\n @posts = Post.infor_post.order(id: :asc).page(params[:page]).\n per(Settings.perpage)\n end",
"def list\r\n @posts = Post.paginate :page => params[:page], :per_page => 24, :order => \"created_at DESC\"\r\n\r\n respond_to do |format|\r\n\r\n format.html # list.html.erb\r\n format.xml { render :xml => @posts }\r\n end\r\n end",
"def index\n @truncate_posts = true\n\n if can? :read_drafts, Post\n @posts = @posts.recent\n else\n @posts = @posts.recently_published\n end\n\n respond_to do |format|\n format.html { @posts = @posts.page(params[:page]).per(10) }\n format.json { }\n end\n end",
"def index\n @posts = Post.all\n\n end",
"def index\n @posts = Post.all\n\n end",
"def index\n @posts = Mist::Post.recently_published(20, Mist.authorized?(:view_drafts, self))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @posts }\n end\n end",
"def index\n @posts = Post.paginate(page: params[:page], per_page: 5)\n end",
"def index\n @posts = Post.all\n\tend",
"def index\n @posts = Post.all\n end",
"def index\n\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @posts }\n end\n end",
"def all\n@posts = Post.all\nend",
"def index\n @posts = Post.all\n\n return @posts\n end",
"def index\n @posts = Post.all\n\n\n\n end",
"def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end",
"def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end"
] |
[
"0.79067683",
"0.77236617",
"0.76746476",
"0.76382035",
"0.76263076",
"0.75548047",
"0.75131756",
"0.75066006",
"0.7471579",
"0.7424324",
"0.7418772",
"0.739495",
"0.7369397",
"0.73656404",
"0.73656404",
"0.73656404",
"0.73656404",
"0.7361862",
"0.7358644",
"0.7338148",
"0.7300049",
"0.72955436",
"0.7267468",
"0.72532743",
"0.7229376",
"0.7227346",
"0.7226777",
"0.72265303",
"0.72156507",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.720775",
"0.7199933",
"0.7177701",
"0.71759456",
"0.71758467",
"0.717342",
"0.71698487",
"0.71698487",
"0.7160577",
"0.7155418",
"0.7144538",
"0.7141616",
"0.71301025",
"0.7121784",
"0.7121244",
"0.7118205",
"0.7112645",
"0.7112645",
"0.7112645"
] |
0.0
|
-1
|
shows the specified post | HTML GET REQUEST
|
def show
@article = Article.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n provides :xml, :json\n \n @post = Post[params[:id]]\n \n if content_type == :html\n render\n else\n display @post\n end\n end",
"def display_post\n begin\n # asks the user for the post id\n print \"Enter the post ID: \"\n id = STDIN.gets.chomp\n response = RestClient.get \"#{@@DOMAIN}/api/posts/#{id}.json\", authorization_hash\n\n js = JSON response.body\n js.each do |k, v|\n puts \"#{k}: #{v}\"\n end\n rescue => e\n puts STDERR, \"Error accessing REST service. Error: #{e}\"\n end\n end",
"def show\n\t\t@post\n\tend",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html\n end\n end",
"def show\n post_name = params[\"name\"] || \"Post-#{params[:id]}\"\n @title = \"#{post_name}'s page\"\n @post = Post.find(params[:id])\n build_response render_template\n end",
"def view_post\n content \n end",
"def show\n \n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @post }\n end\n end",
"def show\n\t@post=Post.find(params[:id])# URL is used to get the post id to find\n end",
"def show\n\t\tpost = Post.find_by(id: params[:id])\n\t\tif post\n\t\trender json: {success: true, auth_token: @current_user.authentication_token, post_desc: post.description}\n\t\telse\n\t\trender json: {success: false, message: \"Not found\"}, status: 404\n\t\tend\n\tend",
"def show\n @post = Post.find(params[:id])\n render :show\n end",
"def show\n @post ||= Mist::Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.text { render :text => @post.content }\n end\n end",
"def show\n \n @post = Post.find(params[:id])\n \n authorize! :read, @post\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n format.json { render :json => @post }\n end\n end",
"def show\n @post = Post.find(params[:id]) #get the post from the id and return the post\n end",
"def show\n\t\t@post = Post.find(params[:id])\n end",
"def show\n r = PostRepository.new\n @post = r.GetPost(\"PostID\", params[:id].to_i)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end \n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @post }\n end\n end",
"def show\n \t@post = Post.find(params[:id])\n end",
"def show\n @post = Post.find params[:id]\n end",
"def show\n if @post\n json_response(@post)\n else\n json_response(@post.errors)\n end\n end",
"def show\r\n @post = root_post_of(Post.find(params[:id]))\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @post }\r\n end\r\n end",
"def show\n respond_with @post\n end",
"def show\n @post = Post.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n\t\t@post = Post.find(params[:id])\n\tend",
"def show\n\t\t@post = Post.find(params[:id])\n\tend",
"def show\n\t\t@post = Post.find(params[:id])\n\tend",
"def show\n @post = Post.find(params[:id])\n @videos = Video.get_for @post #where([\"post_id = ?\", params[:id]]).all\n @background = get_background_for @post #Background::DEFAULT #Background.where([\"post_id = ?\", params[:id]])\n @nav = get_navigation :for => 'post', :current => @post\n @menu = get_menu :for => 'post'\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n @title = @post.title\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @post }\n end\n end",
"def show\n set_xpingback_header\n @post.attributes = params[:post] if params[:post]\n respond_to do |format|\n format.html # show.html.erb\n format.yaml { render :text => @post.to_yaml }\n format.xml { render :xml => @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\r\n @post = Post.find(params[:id])\r\n end",
"def show\n @post = Post.find params[:id]\n end",
"def show\n #@post = Post.find(params[:id]) #I.e., GET params\n #^This variable becomes visible in show.html.erb\n ## No longer need to define @post because of before_action up there ^ ##\n end",
"def show\n #@post = Post.find(params[:id])\n\n #respond_to do |format|\n # format.html # show.html.erb\n #format.json { render json: @post }\n #end\n end",
"def show\n @post = Post.find(params[:id])\n @title = @post.title\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n format.json { render :json => @post }\n end\n end",
"def show\n #GET a single post by ID\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def show\n\t \trender json: Post.find(params[:id])\n\t end",
"def show\n\t\t@post = Post.find(params[:id])\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.xml { render:xml => @post}\n\t\tend\n\tend",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n @title = @post.title\n \n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @post.to_xml }\n end\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n # @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n # format.json { render json: @post }\n end\n end",
"def read(post_id)\n @post = Post.find(post_id)\n\n render :view\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n\n end",
"def show \n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n @post_data = PostDecorator.new.show_post_data(@post, current_user)\n render :show_post\n end",
"def view_node(post_node)\n node = post_node.node\n case node\n when PostText\n show_text_node(post_node)\n when PostImage\n show_image_node(node)\n when PostGif\n show_gif_node(node)\n when VideoEmbed\n show_video_embed(node)\n when PostVotePoll\n show_post_vote_poll(node)\n when PostTest\n show_post_test(node)\n when MediaStory\n show_media_story(node)\n end\n end",
"def show\n @posts = Post.all\n #authorize! if can? :read, @post\n @title = @post.title\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.where(:id => params[:id]).first\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = BlogPost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end",
"def show\n @preview_post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @preview_post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n render json: @post, meta: { status: :ok }, meta_key: 'result'\n end",
"def show\n Rails.logger.debug(\"Inside show \")\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n # Is going to get a single post by ID\n @post = Post.find(params[:id])\n end",
"def show_post\n @post = Post.find(params[:id])\n end",
"def view\n view_get if request.get?\n view_post if request.post?\n end",
"def show\n @post = @post_block.post\n end",
"def show\n @post = Post.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def show\n @test_post = TestPost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @test_post }\n end\n end",
"def show\n view = @post.text? ? 'show_text' : 'show_link'\n @team = @post.team.decorate if @post.team_id.present?\n\n render view\n end",
"def show\n \trender json: Post.find(params[:id])\n end",
"def show\n render json: {\n data: @post\n }\n end",
"def show\n render json: @post\n end",
"def show\n @post = Post.find(params[:id])\n\n #SEO FACTS\n @meta_title = \"Dreams interpretation: \" + @post.text.truncate(70)\n @meta_keywords = \"Dreams interpretation: \" + @post.text.truncate(40)\n @meta_description = \"Dreams interpretation: \" + @post.text.truncate(140)\n @ogsitename = \"Saysadream - Dreams interpretation network\"\n @ogurl = \"saysadream.com\"\n @ogdescription = \"Dream interpretation: \" + @post.text.truncate(140)\n @ogtitle = \"Dream interpretation: \" + @post.text.truncate(40)\n @twittercard = \"summary\"\n #END SEO FACTS\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end"
] |
[
"0.74067384",
"0.72723067",
"0.7238035",
"0.7180139",
"0.70329213",
"0.70030636",
"0.69749856",
"0.69275206",
"0.69186425",
"0.6901656",
"0.6890421",
"0.68674827",
"0.68652225",
"0.6853499",
"0.6815958",
"0.6811897",
"0.6811784",
"0.6811784",
"0.680041",
"0.6791802",
"0.6788596",
"0.67868",
"0.67809904",
"0.6779857",
"0.67727375",
"0.67727375",
"0.67727375",
"0.6771378",
"0.6768351",
"0.6760091",
"0.67559046",
"0.67559046",
"0.67559046",
"0.67559046",
"0.67559046",
"0.67559046",
"0.67559046",
"0.67559046",
"0.67559046",
"0.67559046",
"0.67559046",
"0.67559046",
"0.67559046",
"0.67559046",
"0.67466664",
"0.6728434",
"0.6725167",
"0.6709237",
"0.6707679",
"0.6706232",
"0.6674019",
"0.6674019",
"0.6670984",
"0.6669693",
"0.6666437",
"0.66643655",
"0.66643655",
"0.66643655",
"0.66643655",
"0.66643655",
"0.66643655",
"0.66643655",
"0.66643655",
"0.66643655",
"0.66643655",
"0.66643655",
"0.66643655",
"0.66643655",
"0.66643655",
"0.66643655",
"0.6662178",
"0.66554135",
"0.66479707",
"0.66429794",
"0.66268665",
"0.66237897",
"0.6618767",
"0.6616825",
"0.6608026",
"0.66077155",
"0.66027164",
"0.65947473",
"0.65878177",
"0.6581435",
"0.6580167",
"0.6575758",
"0.65750366",
"0.6564918",
"0.6551625",
"0.65446335",
"0.653731",
"0.6534983",
"0.65313387",
"0.6530704",
"0.6527792",
"0.6525189",
"0.6516504",
"0.6516504",
"0.6516504",
"0.6516504",
"0.6516504"
] |
0.0
|
-1
|
shows the 'new' post view | HTML GET REQUEST
|
def new
@article = Article.new
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html\n end\n end",
"def new\n\t\t@post = Post.new\n\t\trender :new\n\tend",
"def new\n @post = Post.new\n render :new\n end",
"def new\n \n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @post }\n end\n end",
"def new\n @post = Post.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n # @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n # format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n @title = \"New post\"\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @title = \"Create New Post\"\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @post }\n end\n end",
"def new\n @post = model.new\n\n respond_to do |format|\n format.html { render :action => resource_template(\"new\") }\n end\n end",
"def new \n @post = Post.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @post }\n end\n end",
"def new\r\n @post = Post.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @post }\r\n end\r\n end",
"def new\n @post = Post.new\n @title = \"New Post\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n format.json { render :json => @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n authenticated\n\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n format.xml { render :xml => @post }\n end\n end",
"def new\n # Display a form to create a new post\n # The actual post creation is handled by method: create\n @post = Post.new\n end",
"def new\n @post = Post.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n \n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n #@post = Post.new\n\n #respond_to do |format|\n # format.html # new.html.erb\n #format.json { render json: @post }\n #end\n end",
"def new # Showing the new form\n # Responsible for creating a new instance of a post - not saved in DB yet.\n @post = Post.new\n end",
"def new_post\n @i = 0\n @post_title = params[:title]\n @post\n render \"post\"\n end",
"def new\r\n @post = Post.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @post }\r\n end\r\n end",
"def new\r\n @post = Post.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @post }\r\n end\r\n end",
"def new\n @post = Post.new\n # Creating a new post involves two actions. \n # The first is the new action, which \n # instantiates an empty Post object\n # The new.html.erb view displays this \n # empty Post to the user\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n post = Post.new\n render json: post\n end",
"def new #http://localhost:3000/posts/new\n\t@post = Post.new #creates a new empty post,if a form is created for it, it will be empty as well \n end",
"def new\n authorize\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"def new\n @post = Post.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = flash[:form_data] || Post.new\n @title = 'New post'\n\n render_view(:form)\n end",
"def new\n @post = Post.new\n respond_with(@post)\n end",
"def new\n @post = Post.new\n respond_with(@post)\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html { render layout: \"editor\" }\n format.json { render json: @post }\n end\n end",
"def new\n # responsbile for creating a new instance of a post\n @post = Post.new\n end",
"def new\n @post = Post.new\n respond_to do |format|\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @posttag = Posttag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @posttag }\n end\n end",
"def new\n @post253 = Post253.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post253 }\n end\n end",
"def new\n @post = Post.new\n\n respond_to do |format|\n format.html #{ redirect_to '/' }\n format.json { render json: @post }\n end\n end",
"def new\n @posttag = Posttag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @posttag }\n end\n end",
"def new\n @posto = Posto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @posto }\n end\n end",
"def new\n respond_with(@post)\n end",
"def new\n @post = Post.new\n @publish = false\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @mypost = Mypost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mypost }\n end\n end",
"def new\n render :text => \"The current time is #{Time.now.to_s}\"\n\t #@post = Post.new\n\n #respond_to do |format|\n # format.html # new.html.erb\n # format.json { render json: @post }\n #end\n end",
"def new\n\t\t@post = Post.new\n\t\trender layout: \"admin_layout\"\n\tend",
"def new\n @post350 = Post350.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post350 }\n end\n end",
"def new\n respond_with @post\n end",
"def new\n @post = Post.new\n\t@posts = Post.all\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def new\n @test_post = TestPost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @test_post }\n end\n end",
"def new\n @post246 = Post246.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post246 }\n end\n end",
"def new\n redirect_to posts_path and return unless Mist.authorized?(:create_post, self)\n @post = Mist::Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @post }\n end\n end",
"def new\n @post117 = Post117.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post117 }\n end\n end"
] |
[
"0.8336588",
"0.82702637",
"0.8258363",
"0.8224554",
"0.8113327",
"0.8089222",
"0.808262",
"0.8077111",
"0.8042758",
"0.8036729",
"0.8026767",
"0.8023611",
"0.80227154",
"0.80070585",
"0.8004633",
"0.79964083",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.79953367",
"0.7959638",
"0.7942015",
"0.7938016",
"0.7910934",
"0.7909888",
"0.790935",
"0.7877535",
"0.7877266",
"0.787679",
"0.7827983",
"0.7827983",
"0.78196645",
"0.7818875",
"0.78113914",
"0.7767958",
"0.77657056",
"0.7758229",
"0.77373785",
"0.77373785",
"0.7736999",
"0.7733341",
"0.77267456",
"0.77096766",
"0.77096766",
"0.77096766",
"0.77096766",
"0.77096766",
"0.77096766",
"0.77096766",
"0.77096766",
"0.77096766",
"0.77096766",
"0.77096766",
"0.77096766",
"0.77096766",
"0.77096766",
"0.77096766",
"0.77096766",
"0.77096766",
"0.77096766",
"0.7708865",
"0.770178",
"0.76825565",
"0.7674245",
"0.766674",
"0.7663959",
"0.7661215",
"0.7654673",
"0.7652865",
"0.7638592",
"0.7606943",
"0.75961405",
"0.75941",
"0.7593799",
"0.7589184",
"0.75610876",
"0.7555146",
"0.75544125"
] |
0.0
|
-1
|
shows the specified post page to be edited | HTML GET REQUEST
|
def edit
@article = Article.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n post = Post.find_by(id: params[:id])\n redirect_to admin_preview_post_path(post)\n end",
"def edit\n \t\t@post = Post.find(params[:id])\n\tend",
"def edit # Showing edit form\n @post = Post.find(params[:id])\n end",
"def edit\n\t\t@post = Post.find(params[:id])\n\t\trender layout: \"admin_layout\"\n\tend",
"def edit\n @blogpost = Blogpost.find(params[:id])\n @page_title = \"Editing Blog Post\"\n end",
"def edit\r\n @post = Post.find(params[:id])\r\n end",
"def show\n post_name = params[\"name\"] || \"Post-#{params[:id]}\"\n @title = \"#{post_name}'s page\"\n @post = Post.find(params[:id])\n build_response render_template\n end",
"def edit\n\t\t@post = Post.find(params[:id])\n\tend",
"def edit\n\t\t@post = Post.find(params[:id])\n\tend",
"def edit\n r = PostRepository.new\n @post = r.GetPost(\"PostID\", params[:id].to_i)\n end",
"def edit\n # @post = Post.find(params[:id])\n end",
"def edit\n @page = Page.find(params[:id])\n # render edit.html.erb\n end",
"def edit\n #@post = Post.find(params[:id])\n #^This variable becomes visible in edit.html.erb\n ## No longer need to define @post because of before_action up there ^ ##\n end",
"def edit\n @post = Post.find(params[:id]) #find the post\n end",
"def edit\n # @post = Post.find(params[:id])\nend",
"def edit\n @post = Post.find(params[:id])\n end",
"def edit\n @post = Post.find(params[:id])\n end",
"def edit\n @post = Post.find(params[:id])\n end",
"def edit\n @post = Post.find(params[:id])\n end",
"def edit\n @post = Post.find(params[:id])\n end",
"def edit\n @post = Post.find(params[:id])\n end",
"def edit\n @post = Post.find(params[:id])\n end",
"def edit\n @post = Post.find(params[:id])\n end",
"def edit\n @post = Post.find(params[:id])\n end",
"def edit\n @post = Post.find(params[:id])\n end",
"def edit\n @post = Post.find(params[:id])\n end",
"def edit\n @post = Post.find(params[:id])\n end",
"def edit\n @page = Page.find(params[:id])\n #render :edit - app/views/pages/edit.html.erb\n end",
"def view_post\n content \n end",
"def show\n redirect_to pretty_post_url(@post) + \"#comment_#{params[:id]}\"\n end",
"def edit\n @post = Post.find_by(id: params[:id])\n end",
"def edit\n @page = Page.find(params[:id])\n #render the edit form\n end",
"def edit\n # find_post method gets called here\n end",
"def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html\n end\n end",
"def edit\n @page = Page.find(params[:id])\n # render :edit - app/views/pages/\n end",
"def edit \n\t@post=Post.find(params[:id])# URL is used to get de post id to find, @post gets assigned a post object, if a form is created for it, it will map such object properties \n end",
"def show\n\t\t@post\n\tend",
"def edit_by_title\n @post = Roxiware::Blog::Post.where(:guid=>request.env['REQUEST_PATH']).first\n raise ActiveRecord::RecordNotFound if @post.nil?\n authorize! :edit, @post\n\n respond_to do |format|\n format.html { render :partial =>\"roxiware/blog/post/editform\" }\n format.json { render :json => @post.ajax_attrs(@role) }\n end\n end",
"def edit\n @post = BlogPost.find(params[:id])\n end",
"def edit\n @post = BlogPost.find(params[:id])\n end",
"def edit\n @post = BlogPost.find(params[:id])\n end",
"def edit\n @post = BlogPost.find(params[:id])\n end",
"def edit\n @post = BlogPost.find(params[:id])\n end",
"def edit\n @post = BlogPost.find(params[:id])\n end",
"def edit\n @post = BlogPost.find(params[:id])\n end",
"def edit\n @post = BlogPost.find(params[:id])\n end",
"def edit\n @post = BlogPost.find(params[:id])\n end",
"def edit\n @post = BlogPost.find(params[:id])\n end",
"def edit\n @post = BlogPost.find(params[:id])\n end",
"def edit\n @post = BlogPost.find(params[:id])\n end",
"def edit\n @post = BlogPost.find(params[:id])\n end",
"def edit\n @post = BlogPost.find(params[:id])\n end",
"def edit \n @post = BlogPost.find(params[:id])\n end",
"def show\n\t@post=Post.find(params[:id])# URL is used to get the post id to find\n end",
"def update\n if @post.update(post_params)\n redirect_to find_redirect(@post.page)\n else\n render :edit\n end\n end",
"def edit\n @post = Post.find(params[:post_id])\n\n assert(@post.kind_of?(Post))\n\n return @post\n end",
"def edit\n\t\t@post = Post.find(params[:id])\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json {render json: @post}\n\t\tend\n\tend",
"def show\n\t\t@post = Post.find(params[:id])\n end",
"def edit\n\t\t@post = @document.post\n\tend",
"def show\n if request.path != project_post_path(@current_project, @post)\n return redirect_to project_post_path(@current_project, @post), :status => :moved_permanently\n end\n end",
"def edit\n # Clear the page cache for this page... ?\n @page = Comatose::Page.find_is_snippet params[:id]\n if request.post?\n @page.update_attributes(params[:page])\n @page.updated_on = Time.now\n @page.author = current_user\n if @page.valid? && @page.save\n expire_cms_page @page\n expire_cms_fragment @page\n flash[:notice] = \"Saved changes to '#{@page.title}'\"\n redirect_to :controller=>self.controller_name, :action=>'index'\n end\n \n end\n end",
"def show_post\n @post = Post.find(params[:id])\n end",
"def show\n \t@post = Post.find(params[:id])\n end",
"def show\n provides :xml, :json\n \n @post = Post[params[:id]]\n \n if content_type == :html\n render\n else\n display @post\n end\n end",
"def edit\n @page = Page.find(params[:id])\n end",
"def edit\n @page = Page.find(params[:id])\n end",
"def show\r\n @post = Post.find(params[:id])\r\n end",
"def show\n\t\t@post = Post.find(params[:id])\n\tend",
"def show\n\t\t@post = Post.find(params[:id])\n\tend",
"def show\n\t\t@post = Post.find(params[:id])\n\tend",
"def show\n @post = Post.find(params[:id])\n render :show\n end",
"def edit\n\t\t@page_name = \" - Edit Show\"\n\tend",
"def show\n @post = Post.find params[:id]\n end",
"def show\n @post = Post.find(params[:id]) #get the post from the id and return the post\n end",
"def edit\n @user = User.find_by_slug(params[:user_id])\n @post = @user.posts.find(params[:id])\n\n @post_title = \"editing your post\"\n# @title = \"editing #{@post.title}\" if @post.title?\n respond_with(@user, @post)\n end",
"def edit\n respond_with(page)\n end",
"def show\n @post = Post.find params[:id]\n end",
"def show\n \n if request.path != post_path(@post)\n return redirect_to @post, :status => :moved_permanently\n end\n @meta_title = @post.title\n @meta_description = @post.description\n\n\n end",
"def show\n @post = BlogPost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end",
"def edit\n\n @user = User.find_by_slug(params[:user_id])\n @post = @user.posts.find(params[:id])\n\n @post_title = \"editing your post\"\n# @title = \"editing #{@post.title}\" if @post.title?\n respond_with(@user, @post)\n end",
"def read(post_id)\n @post = Post.find(post_id)\n\n render :view\n end",
"def show\n post = Post.find(params[:id])\n redirect_to post.permalink\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def update\n\t\t#If a post has the post parameteres (title and content) redirect to the index of posts\n\t\tif @post.update(post_params)\n\t\t\tredirect_to @post\n\t\telse\n\t\t\trender 'edit'\n\t\tend\n\tend",
"def show\n #@post = Post.find(params[:id]) #I.e., GET params\n #^This variable becomes visible in show.html.erb\n ## No longer need to define @post because of before_action up there ^ ##\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n @post = Post.find(params[:id])\n end",
"def show\n\t \t@post = Post.published.friendly.find(params[:id])\n\t end"
] |
[
"0.7095083",
"0.7075483",
"0.70543313",
"0.70260066",
"0.701512",
"0.70120955",
"0.6999625",
"0.69994766",
"0.69994766",
"0.6979481",
"0.6975455",
"0.6971174",
"0.6970981",
"0.6964401",
"0.6905543",
"0.68873066",
"0.68873066",
"0.68873066",
"0.68873066",
"0.68873066",
"0.68873066",
"0.68873066",
"0.688389",
"0.6883637",
"0.68608236",
"0.68608236",
"0.68608236",
"0.683579",
"0.6831248",
"0.68261474",
"0.68233675",
"0.6800876",
"0.6800699",
"0.67885333",
"0.67599344",
"0.6743417",
"0.6740393",
"0.67290336",
"0.67163575",
"0.67163575",
"0.67163575",
"0.67163575",
"0.67163575",
"0.67163575",
"0.67163575",
"0.67163575",
"0.67163575",
"0.67163575",
"0.67163575",
"0.67163575",
"0.67163575",
"0.67163575",
"0.6712176",
"0.66901046",
"0.66859245",
"0.66668284",
"0.66664433",
"0.6664085",
"0.6661745",
"0.6655108",
"0.664615",
"0.66341513",
"0.66335785",
"0.6625733",
"0.6605116",
"0.6605116",
"0.6602638",
"0.6599306",
"0.6599306",
"0.6599306",
"0.6595579",
"0.65816367",
"0.6580789",
"0.6575748",
"0.6558872",
"0.65532094",
"0.65369934",
"0.6534374",
"0.65251297",
"0.6523572",
"0.6522507",
"0.65103644",
"0.6508932",
"0.6498105",
"0.64980817",
"0.6493947",
"0.6493947",
"0.6493947",
"0.6493947",
"0.6493947",
"0.6493947",
"0.6493947",
"0.6493947",
"0.6493947",
"0.6493947",
"0.6493947",
"0.6493947",
"0.6493947",
"0.6493947",
"0.6493947",
"0.6479388"
] |
0.0
|
-1
|
creates the new post and redirects to the new post | HTML POST REQUEST
|
def create
@article = Article.new(article_params)
if @article.save
redirect_to @article
else
render 'new'
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @post = Post.create(post_params)\n\n # post_url comes from the prefix from our route\n redirect_to post_url(@post)\n end",
"def create\n #binding.pry\n # saving the post w/the form values into the database\n @post = Post.new(post_params) #call a new method as params - post in memory\n if @post.save #making active record call to see if we saved in db\n redirect_to post_path(@post) #look at rake routes bundle exec rake routes read right left; rails is smart enough that u don't need @post.id\n else\n # unsuccessful create attempt\n render :new #render new page (most basic flow here)\n end\n end",
"def create\n Post.create(params[:post])\n redirect_to new_post_path\n end",
"def create\n @post = Post.new(post_params)\n if @post.save\n redirect_to find_redirect(@post.page)\n else\n render :new\n render json: @post.errors, status: :unprocessable_entity\n end\n end",
"def create\n @post = Post.new(params[:post])\n if @post.save\n redirect_to post_path(@post)\n else\n render :action => \"new\"\n end\n end",
"def new_post\n @i = 0\n @post_title = params[:title]\n @post\n render \"post\"\n end",
"def create\n\t\t@post = Post.new(params[:post].permit(:title, :text))\n\t\t\n\t\tif @post.save\n\t\t\n\t\t\t#tell browser to issue anothe request\n\t\t\tredirect_to @post\n\t\telse\n\t\t\n\t\t\t#render is used so that @post is passed back to the\n\t\t\t#new template when it is rendered\n\t\t\trender 'new'\n\t\tend\n\tend",
"def create\n isSavePost = PostService.createPost(post_params)\n if isSavePost\n redirect_to posts_path\n else\n render :new\n end\n end",
"def create\n # render plain: params[:post].inspect #get the inspected parameters filled by the user in the form\n @post = Post.new(post_params) #Create a new post with the supplied post parameters\n if(@post.save) #Saves the post to the database\n redirect_to @post #Redirects to the show method\n else\n render 'new' #If got any errors while saving, render the new.html.erb page and show the error \n end\n end",
"def create \n #render plain: params[:post].inspect\n @post = Post.new(post_params) #Capture paramters from the View\n @post.save #Save the new Post object to the DV\n redirect_to @post #Display the new post once saved\n end",
"def create\n @active_link = \"upload\"\n params[:post][:is_upload] = true\n @post = generate_post(session_obj, params[:post])\n if @post.save\n flash[:notice] = \"You made a new post!\"\n redirect_to board_path(@board)\n else\n flash[:error] = @post.errors.full_messages.first\n render :new\n end\n end",
"def create\n @post = Post.create(post_params)\n\n redirect_to post_path(@post)\n end",
"def create\n @post = Post.new(post_params)\n if @post.save\n redirect_to post_path(@post)\n else\n render :new\n end\n end",
"def create\n @post302 = Post302.new(params[:post302])\n\n respond_to do |format|\n if @post302.save\n format.html { redirect_to(@post302, :notice => 'Post302 was successfully created.') }\n format.xml { render :xml => @post302, :status => :created, :location => @post302 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post302.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n\n\t\t@post = Post.new(post_params)\n\t\tif @post.tag == \"\"\n\t\t\tredirect_to :back\n\t\telsif @post.body == \"\"\n\t\t\tredirect_to :back\n\t\telse\n\t\t\t@post.save\n\t\t\tredirect_to \"#\"\n\t\t\tflash[:info] = \"Post submited!\"\n\t\tend\n\tend",
"def create\n #first create post\n @post = Post.new(post_params)\n\n # if statement to control when to display error messages and to handle if save is successful\n if @post.save\n flash[:notice] = \"Post successfully created\"\n redirect_to @post\n else\n #we want to do a render instead of a redirect because a redirect will do a new http refresh if the post did not save and the user will loose all the content they put in the form. Render new method keeps all content in place\n flash.now[:notice] = \"Could not create new post, please try again\"\n render 'new'\n end\n end",
"def create\n if @post.save\n redirect_to root_path, notice: t('.notice_create')\n else\n render :new\n end\n end",
"def create\n\t\t@post = Post.new(post_params)\n\n\t\t#if the post has been saved redirects to index of posts\n\t\tif @post.save\n\t\t\tredirect_to root_path\n\t\telse\n\t\t\trender 'new'\n\t\tend\n\tend",
"def newPost(_, _, _, metaweblog_struct, _)\n post = Post.create(@db.content_path, metaweblog_struct)\n @db.refresh_post_paths\n\n run_user_cmd\n post['postid']\n end",
"def create\n Post.create(post_params)\n redirect_to controller: 'posts', action: 'index'\n end",
"def create\n @post = Post.new(post_params)\n\n if @post.save\n redirect_to posts_path\n\n else\n render :new\n end\n\n end",
"def create\n @post = Post.new(params[:post])\n\n if @post.save\n redirect_to posts_path, :notice => t(:post_added)\n else\n render :action => \"new\"\n end\n end",
"def create\n @post = Post.new\n @post.title = params[:title]\n @post.description = params[:description]\n @post.save\n\n #each route will automatically check for a matching view..\n # since we don't need a view for create, we must redirect\n # after we are done saving the post... in order to avoid errors.\n \n redirect_to post_path(@post)\n end",
"def create\n restrict('allow only admins and store users') or begin\n @post = Post.new(params[:post])\n @post.author = current_user\n respond_to do |format|\n if @post.save\n format.html {redirect_to current_user.kind_of?(Admin) ? admin_posts_url : posts_url}\n format.js do\n responds_to_parent do\n render :update do |page|\n page.insert_html :top, 'posts_container', \"<hr />\"\n page.insert_html :top, 'posts_container', :partial => 'posts/show_post', :locals => { :post => @post }\n page['new_post_title'].value = ''\n page['new_post_text_area'].value = ''\n page['post_attachment_temp'].value = ''\n page['post_attachment'].value = ''\n page.hide('new_post_container')\n end # render\n end # responds_to_parent\n end # wants\n format.xml\n else\n format.html { render :action => \"new\" }\n format.js {}\n format.xml \n end\n end\n end\n end",
"def create\n # displays post information in JSON format\n # render([current,] :text => params[:post].inspect )\n# render text: params[:post].inspect\n\n # get post form data from params as new Post\n# Rails 4.0\n# @post = Post.new(params[:post].permit(:title, :text))\n @post = Post.new(params[:post])\n\n # save post in sqlite db; save returns false if invalid\n if @post.save\n # send GET request to post, conveying post id => posts#show\n redirect_to @post\n else # invalid form\n # same form => posts#new\n render 'new'\n end\n end",
"def create\n @post = Post.new(params[:post])\n @post.researcher = logged_in_researcher \n\n respond_to do |format|\n if @post.save\n format.html { redirect_to(@post, :notice => 'Post was successfully created.') }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n format.json { render :json => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n format.json { render :json => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n #initialize a new post object with the parameters submitted, validated by post_params\n @post = Post.new(post_params)\n \n isComment = false\n #check whether this is actually a comment, meaning it should have kind=2 and will need an originating post id\n if params[:kind].present?\n @post.kind = params[:kind].to_i\n @post.originatingPost_id = params[:originatingPost_id].to_i\n isComment = true\n \n #otherwise, it is a post, which optionally has tags\n else\n @post.kind = 0\n @tagsToAdd = params[:tagsToAdd].split(\" \")\n @tagsToAdd.each do |t|\n @post.tags << createTag(t)\n end\n end\n \n #either way, the currently logged in user should be logged as the creator of this post/comment\n @post.user = User.find(session[:user_id])\n \n if @post.save!\n if isComment\n redirect_to action: \"show\", :id => params[:originatingPost_id] #stay on the post's show page\n else\n redirect_to action: \"show\", :id => @post.id #go to this new post's show page\n end\n else\n redirect_to action: 'new' #upon failure, try again\n end\n end",
"def make\n\t@post = Post.new(post_parameter)\n\n if @post.save\n redirect_to @post, notice: 'Post was successfully made.'\n \n else\n render :fresh\n \n end\n \nend",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: \"Post was successfully created. #{make_undo_link}\" }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n\n current_user_or_redirect ? nil : return\n\n if params[:post_type] && (params[:post_type] == 'link')\n @post = Post.new({:user_id => @current_user.id, :post_type => 'link'})\n else\n r = params[:r] ? params[:r] : nil\n @post = Post.create({:user_id => @current_user.id, :post_type => 'text', :status => 'infant', :post_id => r})\n redirect_to edit_post_path(@post)\n return\n end\n\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n flash[:notice] = 'Oprettet'\n format.html { redirect_to(:action => 'blog', :page => session[:page]) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n @post.user_id = current_user.id\n @post.date = Time.now\n \n DaoHelper.instance.save_new_post(@post)\n \n redirect_to( :action =>\"index\")\n \n # respond_to do |format|\n # flash[:notice] = 'Post was successfully created.'\n # format.html { redirect_to(\"posts\") }\n # end\n \n # respond_to do |format|\n # if @post.save \n # flash[:notice] = 'Post was successfully created.'\n # format.html { redirect_to(\"posts\") }\n # format.xml { render :xml => @post, :status => :created, :location => @post }\n # else\n # flash[:notice] = 'Post was NOT successfully created: ' + @post.errors \n # format.html { render :action => \"new\" }\n # format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n # end\n # end\n \n end",
"def create\n\n current_user_or_redirect ? nil : return\n\n @post = Post.new(params[:post])\n @post.user_id = @current_user.id\n\n if @post.link?\n @post.status = 'live'\n @post.link = \"http://#{@post.link}\" unless @post.link[/^https?/]\n end\n\n respond_to do |format|\n if @post.save\n @post.delay.update_slug\n @post.delay.add_interactions\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to magazine_post_path(@post.short_url), notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\", layout: \"editor\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n isSavePost = PostsService.createPost(post_params,current_user)\n if isSavePost\n redirect_to root_path , notice: Messages::POST_CREATE_SUCCESS\n else\n render :new\n end\n end",
"def new\n redirect_to posts_path and return unless Mist.authorized?(:create_post, self)\n @post = Mist::Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @post }\n end\n end",
"def create\n @post350 = Post350.new(params[:post350])\n\n respond_to do |format|\n if @post350.save\n format.html { redirect_to(@post350, :notice => 'Post350 was successfully created.') }\n format.xml { render :xml => @post350, :status => :created, :location => @post350 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post350.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @post = new_resource_post\n \n respond_to do |format|\n if @post.save\n flash[:success] = 'Post created'\n format.html { redirect_to post_url }\n else\n format.html { render :action => resource_template(\"new\") }\n end\n end\n end",
"def create\n @post318 = Post318.new(params[:post318])\n\n respond_to do |format|\n if @post318.save\n format.html { redirect_to(@post318, :notice => 'Post318 was successfully created.') }\n format.xml { render :xml => @post318, :status => :created, :location => @post318 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post318.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n\t\t@post = Post.new(post_params) # calls the method down below where i state my params\n\t\tif @post.save\n\t\t\tflash[:notice] = \"Successfully created post!\"\n\t\t\tredirect_to post_path(@post)\n\t\telse\n\t\t\tflash[:alert] = \"Error creating new post!\"\n\t\t\trender :new\n\t\tend\n\tend",
"def create\n @post = current_user.posts.build(post_params)\n if @post.save\n # one time message on redirect that post was created\n flash[:success] = \"Post created\"\n redirect_to root_url\n else\n # re-renders home page and does not add item to feed if fails\n @feed_items = []\n render 'static_pages/home'\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to(:action => \"index\", :notice => 'Post was successfully created.') }\n else\n format.html { render :action => \"new\" }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post creado con éxito.' }\n else\n format.html { render action: \"new\" }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n save_notice(\"文章创建成功,可以 <a href=\\\"#{url_for(:controller => \"/posts\", :action => \"show\", :slug => @post.slug)}\\\" target=\\\"_blank\\\">点击这里</a> 查看\")\n format.html { redirect_to :controller => \"posts\", :action => \"index\" }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n flash[:notice] = 'Post was successfully created.'\n format.html { redirect_to post_url(@post) }\n# format.xml { head :created, :location => post_url(@post) }\n else\n format.html { render :action => \"new\" }\n# format.xml { render :xml => @post.errors.to_xml }\n end\n end\n end",
"def create\n\t\t# can only call render once in an action\n\t\t# render text: params[:post].inspect\n\t\t# this is a render({text: ...})\n\t\t# render text: params[:post].inspect\n\t\t# other options: 'text', 'xml', 'json' (appropriate Content-Type headers are also sent)\n\t\t# render json: params[:post]\n\t\t# render xml: {name: \"david\"}.to_xml\n\n\t\t# @instance_variable\n\t\t# @post = Post.new(params[:post]) - equivalent to Post.new(params['post'])\n\t\t@post = Post.new(post_params)\n\t\tif @post.save\n\t\t\tredirect_to @post\n\t\telse\n\t\t\t# validation failed\n\t\t\t# renders the 'new' template with the current parameters\n\t\t\trender 'new'\n\t\tend\n\tend",
"def create # Update new to DB\n # Saving the post with the form values into the DB\n @post = Post.new(post_params)\n if @post.save\n # A successful new record in the DB\n # Look at bundle exec rake routes\n redirect_to post_path(@post)\n else\n # Unsuccessful create\n render :new\n end\n end",
"def create\n @post = current_user.posts.create(post_params)\n \n if @post.save\n redirect_to action: :index\n else\n flash.now[:alert] = \"Unable to create new post\"\n render :new\n #redirect_to action: :new\n end\n end",
"def create\n redirect_to login_path unless session[:user_id]\n message = 'Post was successfully created.'\n @post = Post.new(post_params)\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: message }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\t\t\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n post = Post.new(name: params['post']['name'])\n post.save\n redirect_to \"/posts/#{post.id}\"\n end",
"def create\n\t\t@post = Post.new(post_params)\n\t\tif @post.save\n\t\t\tredirect_to @post, notice: \"Hello Shoaib You are article is created\"\n\t\telse\n\t\t\trender 'new', notice: \"Oh not I unable to save your post\"\n\t\tend\n\tend",
"def create\n @post246 = Post246.new(params[:post246])\n\n respond_to do |format|\n if @post246.save\n format.html { redirect_to(@post246, :notice => 'Post246 was successfully created.') }\n format.xml { render :xml => @post246, :status => :created, :location => @post246 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post246.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n authenticated\n\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new #http://localhost:3000/posts/new\n\t@post = Post.new #creates a new empty post,if a form is created for it, it will be empty as well \n end",
"def index\n # redirect_to controller: 'post', action: 'new_post'\n end",
"def create\n\t\tp \"james\"\n\t\t@post = Post.new(post_params)\n\t\t# @post = current_user.posts.build(post_params)\n\t\tif @post.save\n\t\t\tredirect_to '/posts/new'\n\t\telse\n\t\t\tp \"FAILED\"\n\t\t\trender 'new'\n\t\tend\n\tend",
"def create\n @post227 = Post227.new(params[:post227])\n\n respond_to do |format|\n if @post227.save\n format.html { redirect_to(@post227, :notice => 'Post227 was successfully created.') }\n format.xml { render :xml => @post227, :status => :created, :location => @post227 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post227.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.find(session[:user_id])\n @post = @user.posts.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to(\"/#{@post.url}\", :notice => t('controller.created')) }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render action: 'show', status: :created, location: @post }\n else\n format.html { render action: 'new' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n @post = Post.new(params[:post])\r\n\r\n respond_to do |format|\r\n if @post.save\r\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\r\n format.json { render json: @post, status: :created, location: @post }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @post.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n @post349 = Post349.new(params[:post349])\n\n respond_to do |format|\n if @post349.save\n format.html { redirect_to(@post349, :notice => 'Post349 was successfully created.') }\n format.xml { render :xml => @post349, :status => :created, :location => @post349 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post349.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\r\n @post = Post.new(params[:post])\r\n\r\n respond_to do |format|\r\n if @post.save\r\n format.html { redirect_to(@post, :notice => 'Post was successfully created.') }\r\n format.xml { render :xml => @post, :status => :created, :location => @post }\r\n else\r\n format.html { render :action => \"new\" }\r\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\r\n @post = Post.new(params[:post])\r\n\r\n respond_to do |format|\r\n if @post.save\r\n format.html { redirect_to(@post, :notice => 'Post was successfully created.') }\r\n format.xml { render :xml => @post, :status => :created, :location => @post }\r\n else\r\n format.html { render :action => \"new\" }\r\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n\t@post=Post.new(params[:post])#params uses the URL to get the post object \t\n\tif @post.save #yes the method post returns boolean\n\t\tredirect_to posts_path, :notice=>\"a new Post was saved\" #this is a flash message, it must be enabled in the layout file of the project, \\app\\views\\layouts\\application.html.erb \n\telse\n\t\trender \"new\" #renders a view\n\tend\n end",
"def create\n @post297 = Post297.new(params[:post297])\n\n respond_to do |format|\n if @post297.save\n format.html { redirect_to(@post297, :notice => 'Post297 was successfully created.') }\n format.xml { render :xml => @post297, :status => :created, :location => @post297 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post297.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to(@post, :notice => 'Post was successfully created.') }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to(@post, :notice => 'Post was successfully created.') }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\r\n new_post = current_user.posts.new(post_params)\r\n new_post.save\r\n redirect_to post_path new_post\r\n end",
"def create\n #this saves the post with the form values into the database\n @post = Post.new(post_params)\n if @post.save\n #this is a successful new record in the database\n redirect_to post_path(@post) #find in bundle exec rake routes and use prefix\n else\n #this means it was unsuccessful create /not created\n render :new\n end\nend",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to(posts_url, :notice => 'Post was successfully created.') }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @post295 = Post295.new(params[:post295])\n\n respond_to do |format|\n if @post295.save\n format.html { redirect_to(@post295, :notice => 'Post295 was successfully created.') }\n format.xml { render :xml => @post295, :status => :created, :location => @post295 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post295.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n \t# create the post\n \t# the following is the short version of getting data\n \t@post = Post.new(params[:post])\n \t# the following is the long version of getting data\n \t# @post = Post.new(params[:title], params[:url], params[:description])\n \t# @post.user_id = 1 #TODO: add in real user after we have authentication\n # @post.user_id = current_user.id\n @post.user_id = session[:user_id]\n \tif @post.save\n \t\tflash[:notice] = \"Post was created!\"\n \t\tredirect_to posts_path # \"/posts/#{@post_id}\"\n \telse # validation failure\n render :new\n end\n end",
"def create\n @post267 = Post267.new(params[:post267])\n\n respond_to do |format|\n if @post267.save\n format.html { redirect_to(@post267, :notice => 'Post267 was successfully created.') }\n format.xml { render :xml => @post267, :status => :created, :location => @post267 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post267.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @post310 = Post310.new(params[:post310])\n\n respond_to do |format|\n if @post310.save\n format.html { redirect_to(@post310, :notice => 'Post310 was successfully created.') }\n format.xml { render :xml => @post310, :status => :created, :location => @post310 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post310.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @post339 = Post339.new(params[:post339])\n\n respond_to do |format|\n if @post339.save\n format.html { redirect_to(@post339, :notice => 'Post339 was successfully created.') }\n format.xml { render :xml => @post339, :status => :created, :location => @post339 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post339.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n respond_to do |format|\n if @post.save\n format.html { redirect_to :back, notice: 'Post was successfully created.' }\n else\n format.html { redirect_to :back, notice: @post.errors.full_messages }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post54 = Post54.new(params[:post54])\n\n respond_to do |format|\n if @post54.save\n format.html { redirect_to(@post54, :notice => 'Post54 was successfully created.') }\n format.xml { render :xml => @post54, :status => :created, :location => @post54 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post54.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @post = session[:post] || @contest.posts.build\n @post.subject = @contest.name #|| params[:subject] if params[:subject]\n @post.url = @contest.url #|| params[:url] if params[:url]\n @post.description = @contest.description \n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end",
"def create\n @post284 = Post284.new(params[:post284])\n\n respond_to do |format|\n if @post284.save\n format.html { redirect_to(@post284, :notice => 'Post284 was successfully created.') }\n format.xml { render :xml => @post284, :status => :created, :location => @post284 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post284.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n # responsbile for creating a new instance of a post\n @post = Post.new\n end",
"def create\n @post = postable.posts.build(params[:post])\n @post.author = current_agent\n\n respond_to do |format|\n if @post.save\n flash[:success] = t('post.created')\n format.html { redirect_to(polymorphic_path([ postable.container, postable ], :anchor => dom_id(@post))) }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save?\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { render action: 'new' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_form\n @post = Post.new(post_params)\n unless @post.valid?\n render :new\n else\n redirect_to :action => \"create_confirm\", title: @post.title, description: @post.description\n end\n end",
"def create\n @post129 = Post129.new(params[:post129])\n\n respond_to do |format|\n if @post129.save\n format.html { redirect_to(@post129, :notice => 'Post129 was successfully created.') }\n format.xml { render :xml => @post129, :status => :created, :location => @post129 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post129.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(post_params)\n\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to edit_post_path(id: @post.id), notice: t('Post was successfully created.') }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @post321 = Post321.new(params[:post321])\n\n respond_to do |format|\n if @post321.save\n format.html { redirect_to(@post321, :notice => 'Post321 was successfully created.') }\n format.xml { render :xml => @post321, :status => :created, :location => @post321 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post321.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n # make a new post and enter the post_params into it\n @post = Post.new(post_params)\n\n # make sure each tweet is associated with a user id\n @post.user_id = current_user.id\n\n if @post.save\n # function redirect_to, parameter: post_path, hash: notice\n redirect_to post_path(@post), notice: \"Post saved!\"\n else \n # error - re-render the \"new\" view\n render 'new'\n end\n end",
"def create\n @post = Post.new(params[:post])\n @title = \"Create New Post\"\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, :notice => 'Post was successfully created.' }\n format.json { render :json => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @post = Post.new(name: params[:name],\n email: params[:email],\n year: params[:year],\n major: params[:major],\n Q1: params[:Q1],\n Q2: params[:Q2],\n Q3: params[:Q3],\n Q4: params[:Q4],\n Q5: params[:Q5],\n Q6: params[:Q6],\n user_id: @current_user.id)\n if @post.save\n flash[:notice] = \"Your answer has been recorded.\"\n redirect_to(\"/user/#{@current_user.id}\")\n else\n render(\"post/new\")\n end\n end",
"def create\n post\n end",
"def create\n @post358 = Post358.new(params[:post358])\n\n respond_to do |format|\n if @post358.save\n format.html { redirect_to(@post358, :notice => 'Post358 was successfully created.') }\n format.xml { render :xml => @post358, :status => :created, :location => @post358 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post358.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n\t\t@post = Post.new\n\t\tif @post.save(post_params)\n\t\t\tflash[:notice] = \"Post Created!\"\n\t\t\tredirect_to post_path(@post)\n\t\telse\n\t\t\tflash[:alert] = \"Something is wrong!\"\n\t\t\trender :edit\n\t\tend\n\tend",
"def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n flash[:notice] = 'Post was successfully created.'\n format.html { redirect_to(@post) }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end"
] |
[
"0.7568445",
"0.7492326",
"0.747756",
"0.7451638",
"0.74442595",
"0.7400156",
"0.73955595",
"0.73916566",
"0.73732984",
"0.7320908",
"0.73159105",
"0.7314909",
"0.731061",
"0.73059666",
"0.7303393",
"0.72902817",
"0.7288135",
"0.7243147",
"0.72224844",
"0.7213529",
"0.7212501",
"0.719889",
"0.7191663",
"0.71905637",
"0.7159211",
"0.7145709",
"0.7144599",
"0.71062094",
"0.70993614",
"0.7082951",
"0.70522684",
"0.7049849",
"0.7038034",
"0.7036496",
"0.70320904",
"0.70276904",
"0.700649",
"0.7002182",
"0.6992533",
"0.6991337",
"0.6988397",
"0.6986434",
"0.6985332",
"0.69641984",
"0.6963004",
"0.6957279",
"0.6956221",
"0.69451565",
"0.6938466",
"0.6937281",
"0.6932906",
"0.69243515",
"0.6919868",
"0.6916988",
"0.69166803",
"0.6915241",
"0.69147635",
"0.6914694",
"0.69135326",
"0.69132173",
"0.6905131",
"0.68959546",
"0.68947846",
"0.68947846",
"0.68934166",
"0.68907577",
"0.68886846",
"0.68886846",
"0.6887433",
"0.6886788",
"0.6884975",
"0.68809897",
"0.6877512",
"0.687454",
"0.68742967",
"0.6871895",
"0.6871175",
"0.68659276",
"0.68659276",
"0.68659276",
"0.68659276",
"0.68659276",
"0.68659276",
"0.68659276",
"0.68625546",
"0.68586516",
"0.68577063",
"0.6849749",
"0.68494993",
"0.6848892",
"0.68487906",
"0.6844917",
"0.68415487",
"0.68354475",
"0.6834202",
"0.6833334",
"0.68332094",
"0.68327355",
"0.6829807",
"0.6829764",
"0.68289477"
] |
0.0
|
-1
|
updates the specified post and redirects to the updated post if valid, else it renders the edit page again. using 'render' rather than redirect_to allows the new params to be passed back, rather than erasing the fields HTML PATCH REQUEST
|
def update
@article = Article.find(params[:id])
if @article.update(article_params)
redirect_to @article
else
render 'edit'
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n if @post.update(post_params)\n redirect_to find_redirect(@post.page)\n else\n render :edit\n end\n end",
"def update\n\n if @post.update(post_params)\n redirect_back fallback_location: posts_url\n else\n render :edit\n end\n\n end",
"def update\n if @post.update_attributes(post_params)\n redirect_to post_path(@post)\n else\n render :edit\n end\n end",
"def update\n if @post.update_attributes(post_params)\n redirect_to post_path(@post)\n else\n render :edit\n end\n end",
"def update_post\n isPostUpdate = PostService.updatePost(post_form_params)\n if isPostUpdate\n redirect_to posts_path\n else \n render :edit\n end\n end",
"def update\n\t\t#If a post has the post parameteres (title and content) redirect to the index of posts\n\t\tif @post.update(post_params)\n\t\t\tredirect_to @post\n\t\telse\n\t\t\trender 'edit'\n\t\tend\n\tend",
"def update\n if @post.update(post_params)\n redirect_to root_path, notice: t('.notice_update')\n else\n render :edit\n end\n end",
"def update\n \n if @post.update(post_params)\n redirect_to @post, notice: 'Post was successfully updated.' \n \n else\n render action: 'edit' \n \n end \n end",
"def update\n @post = Post.find(params[:id]) #get the post from the id\n if(@post.update(post_params)) #check if the post gets updated\n redirect_to @post #returns the post to the \n else\n render 'edit' #If got any errors while updating, render the new.html.erb page and show the error \n end\n end",
"def update\n\t\t@post = Post.find(params[:id])\n\t\t\n\t\tif @post.update(params[:post].permit(:title, :text))\n\t\t\tredirect_to @post\n\t\t\t\n\t\telse\n\t\t\t#@post is passed back to the edit template\n\t\t\t#when it is rendered\n\t\t\trender 'edit'\n\t\tend\n\tend",
"def update\n \n if @post.update_attributes(post_params)\n flash[:success] = \"Post Updated\"\n redirect_to home_path\n \n else\n render action: 'edit' \n \n end\n \n end",
"def update \n\t\t\n\t\tif @post.update_attributes(post_params)\n\t\t\tredirect_to post_path(@post) \n\t\t\t# redirect_to(:action => 'posts#show') \n\t\telse \n\t\t\tflash[:alert] = \"Error updating post!\"\n\t\t\trender 'edit' \n\t\tend \n\tend",
"def update\n\t\n\t\tif @post.update(post_params)\n\t\t\tflash[:notice] = \"Solid Update!\"\n\t\t\tredirect_to post_path\n\t\telse\n\t\t\tflash[:alert] = \"Try Again!\"\n\t\t\trender :edit\n\t\tend\n\tend",
"def update\n #disable edit for now\n redirect_to posts_path\n return\n \n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @post.update(post_params)\n redirect_to @post, notice: 'Post was successfully updated.'\n else\n render :edit\n end\n end",
"def update\n @post = Post.find(params[:id])\n @post.update(post_params)\n if @post.valid?\n redirect_to @post\n else \n render :edit\n end\n end",
"def update\n @post = Post.find(params[:id])\n if @post.update(post_params)\n redirect_to post_url(@post) \n else\n flash.now[:errors] = @post.errors.full_messages\n render :edit \n end\n \n end",
"def update\n\t\tif @post.update_attributes(post_params)\n\t\t\tflash[:notice] = \"Successfully updated post!\"\n\t\t\tredirect_to post_path\n\t\telse\n\t\t\tflash[:alert] = \"Error updating post!\"\n\t\t\trender :edit\n\t\tend\n\tend",
"def update\n # get user input through params for this specific blog post\n if @post.update(post_params)\n # if update is successful show page will be displayed reflecting changes\n redirect_to post_path(@post)\n else\n # if udpate is not successful, edit page will be displayed again\n render :edit\n end\n end",
"def update\n\t if @post.update(post_params)\n\t flash[:success] = \"Post updated.\"\n\t redirect_to posts_path\n\t else\n\t flash[:alert] = \"Update failed. Please check the form.\"\n\t render :edit\n\t end\n\tend",
"def update\n if @post.update(post_params)\n redirect_to post_path(@post)\n flash[:notice] = 'Post was successfully updated.'\n else\n flash[:danger] = 'Post not updated' \n render :edit\n end\n end",
"def update\n # Get post from db\n @post = Post.find(params[:id])\n\n # Post parameters passed validations\n if @post.update_attributes(post_strong_params)\n # Show message to indicate success\n flash[:info] = \"Post edit was successful\"\n\n # Redirect to post page\n redirect_to @post\n\n # Some parameters didn't pass\n else\n # Render edit page with error messages attached to @post\n render 'edit'\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n flash[:success] = 'Post was successfully updated.'\n format.html { redirect_to root_url }\n else\n format.html { render 'edit' }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n \n if @post.update_attributes(params[:post])\n redirect_to(posts_path, :notice => t(:post_updated))\n else\n render :action => \"edit\" \n end\n \n end",
"def update # post_path, /post/:id, PUT or PATCH\n #using set_post before_action\n\n if @post.update(post_params)#strong paramters\n flash[:notice] = 'Post has been updated'\n redirect_to post_path(@post)\n else\n render :edit\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n if @post.update_attributes(params[:post])\n flash[:success] = 'Post was successfully created.'\n redirect_to @post \n else\n render action: \"edit\"\n end\n end",
"def update\n\t@post=Post.find(params[:id])#params uses the URL to get de post id object\n\tif @post.update_attributes(params[:post])# gets passed in a post from URL\n\t\tredirect_to posts_path, :notice=>\"the post was updated\" #posts_path is a named route, can be inferred from command rake routes result\n\telse\n\t\trender \"edit\"\n\tend\n end",
"def update\n authenticated\n\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update #db edits\n @post = Post.find(params[:id])\n if @post.update(post_params) #calling update not edit, not create\n # successful update in db\n redirect_to post_path(@post)\n else\n # unsuccessful db update\n render :edit #take back to where they started\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { #render plain: params\n redirect_to @post, notice: 'Post was successfully updated.' \n }\n format.json { render :show, status: :ok, location: @post }\n else\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :update, @post\n if @post.update(post_params)\n redirect_to post_path(@post), notice: 'Post Updated 🤗'\n else\n render :edit, alert: 'Problem Updating Post 😡'\n end\n end",
"def update # Update edit in DB\n @post = Post.find(params[:id])\n if @post.update(post_params)\n # Successful update in DB\n redirect_to post_path(@post)\n else\n # Unsuccessful DB update\n render :edit\n end\n end",
"def update\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @post.update(post_params)\n redirect_to [@post.board, @post]\n else\n render :edit\n end\n end",
"def post_edit_form\n @post_update_form = PostUpdateForm.new(post_update_form_params)\n unless @post_update_form.valid?\n render :edit\n else\n redirect_to :action => \"update_confirm\", title: @post_update_form.title, description: @post_update_form.description, state: @post_update_form.status, id: @post_update_form.id\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html {redirect_to @post, notice: 'Post was successfully updated.'}\n format.json {render :show, status: :ok, location: @post}\n else\n format.html {render :edit}\n format.json {render json: @post.errors, status: :unprocessable_entity}\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: '' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @post.update(post_params)\n success_post_show\n else\n error_post_save\n end\n end",
"def update\n @post = Post.find(params[:id])\n if @post.update (post_params)\n #then we have a successful update of a post\n redirect_to posts_path(@post)\n else\n #unsuccessful database update\n render :edit\n end\n end",
"def update\n if @post.update(post_params)\n render :show, status: :ok, location: @post\n else\n render json: @post.errors, status: :unprocessable_entity\n end\n end",
"def update\n if @post.update(post_params)\n render :show, status: :ok, location: @post\n else\n render json: @post.errors, status: :unprocessable_entity\n end\n end",
"def update\n if signed_in? && author_signed_in?\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to(@post, :notice => 'Post was successfully updated.') }\n else\n format.html { render :action => \"edit\" }\n end\n end\n else\n redirect_to root_path\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post}\n format.json { render :show, status: :ok, location: @post }\n else\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n @title = \"EDIT\"\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, :notice => 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n # get current post form data\n @post = Post.find(params[:id])\n\n # update post with form data from post/:id/edit\n# Rails 4.0\n# if @post.update(params[:post].permit(:title, :text))\n if @post.update_attributes(params[:post])\n redirect_to @post\n else\n # same form => posts#edit\n render 'edit'\n end\n end",
"def update\n authorize_user\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: I18n.t('post_updated') }\n format.json { render :show, status: :ok, location: @post }\n else\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n @post = Post.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @post.update_attributes(params[:post])\r\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @post.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post actualizado con éxito.' }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to post_path(@post), notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to \"/#{session[:username]}\", notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, success: 'Post editado exitosamente.' }\n format.json { render :show, status: :ok, location: @post }\n else\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to post_path, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to \"/members/dashboard\"}\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to(@post, :notice => 'Post was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n puts \"\\n******* update *******\"\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update?(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n render_forbidden and return unless can_edit?\n @post = Post.friendly.find(params[:id])\n \n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n redirect_to root_path\n end\n end\n end",
"def update\n # @post = Post.find(params[:id])\n # \"..if passed our security method declared above\"\n if @post.update(post_params)\n redirect_to @post\n else\n render 'edit' # else render the <edit> template again.\n end\n \nend",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to my_post_wholeseller_posts_path, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n @post = Post.find(params[:id])\r\n @post.attributes = params[:post]\r\n @post.save!\r\n redirect_to post_path(@post)\r\n rescue ActiveRecord::RecordInvalid\r\n render :action => 'edit'\r\n end",
"def update\n @post = current_user.posts.find(params[:id])\n if @post.update_attributes(params[:post])\n redirect_to @post, notice: \"Post has been updated\"\n else\n render :edit\n end\n end",
"def update\n # instantiant / Find\n @post = Post.find_by id: params[:id]\n # set values\n @post.title = params[:post][:title]\n @post.postbody = params[:post][:postbody]\n @post.user_id = params[:post][:user_id]\n # save it\n if @post.save\n # redirect to \"/posts\"\n redirect_to post_path(id: @post.id)\n else\n render :edit\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, :notice => 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, :notice => 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @post.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n\n if @post.update_attributes(post_params)\n redirect_to language_conversation_posts_path\n else\n render :edit\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html do\n redirect_to @post,\n notice: 'Post atualizado com sucesso.'\n end\n else\n format.html { render :edit, notice: 'Algo deu errado.' }\n end\n end\n end",
"def update\n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { render :show, status: :ok, location: @post }\n else\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n verify_owner_or_admin(@post)\n \n respond_to do |format|\n if @post.update(post_params)\n format.html { redirect_to @post, notice: \"Post was successfully updated.\" }\n format.json { render :show, status: :ok, location: @post }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @post = Post.find(params[:id])\n # In the update action, Rails first uses \n # the :id parameter passed back from the \n # edit view to locate the database record \n # that’s being edited. The update_attributes \n # call then takes the post parameter (a hash) \n # from the request and applies it to this record. \n # If all goes well, the user is redirected to the \n # post’s show action. If there are any problems, it \n # redirects back to the edit action to correct them.\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n @post = Post.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @post.update_attributes(params[:post])\r\n format.html { redirect_to(:action => 'adminlist') }\r\n format.xml { head :ok }\r\n else\r\n format.html { render :action => \"edit\" }\r\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end"
] |
[
"0.84780616",
"0.83904874",
"0.8348372",
"0.8348372",
"0.8319848",
"0.8243668",
"0.8222979",
"0.81953883",
"0.8185828",
"0.8176769",
"0.8105336",
"0.80838174",
"0.80635417",
"0.8052036",
"0.8024737",
"0.80176914",
"0.79997677",
"0.79912806",
"0.7968001",
"0.79638594",
"0.79584646",
"0.79318607",
"0.79261434",
"0.79201627",
"0.78781796",
"0.7846683",
"0.7812017",
"0.7802738",
"0.7789228",
"0.7773287",
"0.77633435",
"0.7751485",
"0.7748585",
"0.77394944",
"0.77313894",
"0.77283007",
"0.7722904",
"0.7701996",
"0.76983225",
"0.76925874",
"0.76860327",
"0.76764905",
"0.76764905",
"0.76704395",
"0.76663816",
"0.7659123",
"0.7654473",
"0.76533175",
"0.7652739",
"0.765162",
"0.76466894",
"0.7635529",
"0.76352614",
"0.76352614",
"0.76352614",
"0.76352614",
"0.76352614",
"0.76352614",
"0.76352614",
"0.76352614",
"0.76352614",
"0.76352614",
"0.76306033",
"0.76253605",
"0.7622051",
"0.7607394",
"0.76059586",
"0.76008505",
"0.75998175",
"0.7599409",
"0.75825",
"0.7580509",
"0.75596046",
"0.75492287",
"0.7548926",
"0.7546315",
"0.754537",
"0.754537",
"0.754537",
"0.754537",
"0.754537",
"0.754537",
"0.754537",
"0.754537",
"0.754537",
"0.754537",
"0.754537",
"0.754537",
"0.754537",
"0.754537",
"0.754537",
"0.754537",
"0.7544882",
"0.7544882",
"0.75434333",
"0.7542562",
"0.7533609",
"0.7526605",
"0.7521745",
"0.7521397",
"0.7520292"
] |
0.0
|
-1
|
delete/destroy the specified post and redirects to the index | HTML DELETE REQUEST
|
def destroy
@article = Article.find(params[:id])
@article.destroy
redirect_to articles_path
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_index_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id]) #get the post from the id\n @post.destroy #removes the post\n\n redirect_to posts_path #returns to the index page, posts_path => index page\n end",
"def destroy\n @post.destroy\n\n head :no_content\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to static_pages_index_path, notice: 'Post was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n\t@post.destroy\n redirect_to @post, notice: 'Post was successfully destroyed.'\n \n \n \nend",
"def destroy\n @post.destroy\n head :no_content\n end",
"def destroy\n @post.destroy\n head :no_content\n end",
"def destroy\n @post.destroy\n redirect_to \"/\"\n end",
"def delete_post\n Rails.logger.info('delete post')\n Post.delete_post_when_id_given((Post.find(params[:post_id_from_view])).id)\n redirect_to :controller => 'homes',:action =>'index'\n\n end",
"def destroy\n Post.find(params[:id]).delete\n\n redirect_to '/'\n end",
"def destroy\n @post.destroy\n head :no_content\n end",
"def destroy\n post = @post\n @post.destroy\n redirect_to find_redirect(post.page)\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_index_path, notice: \"Post was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n redirect_to root_url\n end",
"def destroy\r\n @post = Post.find(params[:id])\r\n @post.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(:action => 'adminlist') }\r\n format.xml { head :ok }\r\n end\r\n end",
"def destroy\n redirect_to '/posts'\n end",
"def destroy\n @post = Post.find(params[:id]) #find post\n @post.destroy # destory via delete action\n redirect_to posts_path #could do root or index but since we're in posts_controller\n end",
"def destroy\n @post.destroy\n\n redirect_to root_path, alert: t('.notice_destroy')\n end",
"def destroy\n\t\t@post = Post.find(params[:id])\n \t@post.delete\n \tredirect_to :back\n\tend",
"def destroy\n\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to '/admin/posts' }\n format.json { head :no_content }\n end\n end",
"def destroy\n r = PostRepository.new\n @post = r.GetPost(\"PostID\", params[:id].to_i)\n r.delete @post\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n @title = \"Kill Post\"\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n flash[:notice] = \"収納術を削除しました\"\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n if @post.destroy\n flash[:notice] = \"post deleted!\"\n end\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n #disable delete\n redirect_to posts_path\n return\n \n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post_entry.destroy\n respond_to do |format|\n format.html { redirect_to post_entries_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n \n respond_to do |format|\n format.html { redirect_to(posts_url, notice: t('posts.index.post_deleted')) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n # The destroy method of an Active Record model instance \n # removes the corresponding record from the database. After \n # that’s done, there isn’t any record to display, so Rails \n # redirects the user’s browser to the index action of the controller.\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n respond_with post.destroy(params[:id])\n end",
"def destroy\n authenticated\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_back(fallback_location: root_path); flash[:notice] = 'The post was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @post = Post.find(params[:id])\r\n @post.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to root_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n\t\t@post.destroy\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to posts_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n end\n end",
"def delete_post\n\t \n \tend",
"def destroy\n # @post = Post.find(params[:id])\n # @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to :action => 'index', :controller => 'admin' }\n format.json { head :ok }\n end\n end",
"def delete\n @post = Post.find(params[:id])\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_path }\n end\n end",
"def destroy\n authorize_user\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url, notice: I18n.t('post_deleted') }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @post = Post.find(params[:id])\r\n @post.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to posts_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @post = Post.find(params[:id])\n @controller_name = @post.post_type.name.gsub(\" \",\"_\").downcase.pluralize\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to :controller => @controller_name,\n :action => \"show\",\n :id => @post.id }\n format.xml { head :ok }\n end\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url, notice: \"Post was successfully destroyed. #{make_undo_link}\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n# format.xml { head :ok }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @post.destroy\n render json: {}, status: :ok\n end",
"def destroy\r\n @post = Post.find(params[:id])\r\n @post.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(posts_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"def destroy\r\n @post = Post.find(params[:id])\r\n @post.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(posts_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"def destroy\n Post.find(params[:id]).destroy\n flash[:success] = \"Post deleted.\"\n redirect_to home_path\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to blog_posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to all_user_posts_url }\n format.json { head :no_content }\n end\n end",
"def delete_post\n if post = TeamPost.where(:id=>params[:post_id]).first\n post.destroy\n flash[:success] = \"Your post has been deleted.\"\n end\n redirect_to registration_olympiad_path(@olympiad, :page=>\"wall\")\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(root_path, :notice => t('controller.deleted')) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.80750906",
"0.8056547",
"0.7964666",
"0.7933301",
"0.7917598",
"0.79012513",
"0.79012513",
"0.7900041",
"0.7894067",
"0.7885436",
"0.7873013",
"0.78465664",
"0.7806917",
"0.7804072",
"0.7795087",
"0.77905947",
"0.77826655",
"0.7772118",
"0.7767866",
"0.7748845",
"0.77417076",
"0.7737312",
"0.77356964",
"0.77314395",
"0.7717393",
"0.77058643",
"0.77058643",
"0.77058643",
"0.77058643",
"0.77058643",
"0.77058643",
"0.77058643",
"0.77058643",
"0.77058643",
"0.77058643",
"0.77058643",
"0.77058643",
"0.77058643",
"0.77058643",
"0.77034086",
"0.7702728",
"0.7691201",
"0.7690025",
"0.7686982",
"0.7682442",
"0.7681951",
"0.76811624",
"0.76798457",
"0.76742554",
"0.7670752",
"0.7663985",
"0.76587415",
"0.76504827",
"0.7649935",
"0.76279396",
"0.7627789",
"0.7623746",
"0.762361",
"0.7619231",
"0.76128787",
"0.76057905",
"0.76012504",
"0.76012504",
"0.76012504",
"0.76012504",
"0.75998825",
"0.75998825",
"0.7598013",
"0.75913775",
"0.7590603",
"0.7587059",
"0.757793",
"0.75757474",
"0.757472",
"0.7570969",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145",
"0.7570145"
] |
0.0
|
-1
|
before_action :authorized helper_method :current_teller, logged_in?
|
def login(teller)
session[:teller_id] = @teller.id
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def authorized?\nlogged_in?\nend",
"def authorized?\n logged_in?\n end",
"def authorized?\n logged_in?\n end",
"def authorized?\n current_user.logged_in?\n end",
"def logged_in?\n authorized?\n end",
"def authorized?\n logged_in? && current_user.login == \"ej0c\"\n end",
"def logged_in\r\n end",
"def authorized?\n current_user.login == \"Admin\"\n end",
"def is_authenticated?\n end",
"def logged_in?\n current_authuser\n end",
"def logged_in?\n end",
"def authorized?\n logged_in?\n end",
"def authorized?\n logged_in?\n end",
"def authorized?\n logged_in?\n end",
"def logged_in?\n!!current_user\nend",
"def authorized?(user)\n current_user == user\nend",
"def logged_in?\n act = StudyListAction.new(self)\n act.get\n !(act.redirected_to_login?)\n end",
"def logged_in?\n current_user\n end",
"def logged_in?\n current_user\n end",
"def logged_in?\n current_user\n end",
"def logged_in?\n current_user\n end",
"def logged_in?\n current_user\n end",
"def if_logged_in\n view_context.user_signed_in?\n end",
"def authorize\n redirect_to root_path unless current_recruiter\n end",
"def logged_in?\n\tsession[:user] and CTRL.authorize(session[:user], session[:session])\nend",
"def logged_in\n logged_in_user != nil\n end",
"def before_filter\n if current_user\n true\n end\n end",
"def user_is_authenticated\r\n !!current_user\r\n end",
"def authenticated?; super; end",
"def logged_in\n !!current_user\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 authorized\n redirect_to \"/login\" unless logged_in? \n end",
"def authorized?\n true\n end",
"def logged_in?\n current_user\n end",
"def logged_in_receptionist?\n !current_receptionist.nil?\n end",
"def authorize?(user)\n true\n #user.login == \"administrador\"\n end",
"def check_authenticated\n @logged_in = session[:logged_in]\n end",
"def authorized(m)\n m.user == current_user\n end",
"def logged_in?\n !current_teacher.nil?\n end",
"def logged_in?\n !current_teacher.nil?\n end",
"def logged_in?\n @logged_in\n end",
"def logged_in?\n @logged_in\n end",
"def is_logged_in\n #since these are also marked as helper methods, they are availalble in not just all ctronollers (cuz they inherit from appc ontroler) but also avialble to views\n\n (session[:user_id] && session[:user_id].present? ) ? true : false\n end",
"def logged_in\n !current_user.nil?\n end",
"def current_user\n # authorization initialization if not run yet\n # (in the case of paper_trial it might not have run)\n authorization_init\n @logged_in_user\n end",
"def authenticated_via_link\n self.is_authenticated == true\n end",
"def edit_authorized(current_user)\n return self.user_id == current_user.id\n end",
"def edit_authorized(current_user)\n return self.user_id == current_user.id\n end",
"def logged_in?\n \t!!current_user\n end",
"def logged_in?\n !real_user.nil?\n end",
"def authorized?(user)\n true\n end",
"def logged_in? \n !!session[:skater_id]\n end",
"def logged_in?\n !!getCurrentUser\n end",
"def logged_in?\n !!current_user\n end",
"def authorized?(action = action_name, resource = nil)\n logged_in?\n end",
"def logged_in?\n !!session[:admin_id]\n end",
"def logged_in?\n !!logged_in_user\n end",
"def logged_in?\n !!logged_in_user\n end",
"def authorize\n redirect_to '/' unless current_user || current_dealer\n end",
"def logged_in?\n!current_user.nil?\nend",
"def logged_in?\n!current_user.nil?\nend",
"def logged_in?\n session[:authorized] == true\n end",
"def logged_in?\n current_user\n end",
"def logged_in?\n current_user\n end",
"def current_user?\n \n end",
"def authenticate\n logged_in? ? true : access_denied\nend",
"def authorized?\n @authorized ||= current_user.present? # TODO: Check for authorization\n end",
"def current_user\n\t\tauthenticated(User)\n\tend",
"def logged_in?\n !!current_user\n end",
"def authenticated?\n true\n end",
"def login_required\n not_authorized unless current_user\n end",
"def logged_in?\n !current_admin.nil?\n end",
"def logged_in?\n !current_admin.nil?\n end",
"def logged_in?\n current_user ? true : false;\n end",
"def authorized?\n logged_in?\n end",
"def set_current_user\n current_user\n authorize\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 logged_in?\n if current_user\n true\n else \n false\n end\n end",
"def authorized_user!\n unless user_logged_in?\n redirect_to root_path\n end\n end",
"def view_authorized(current_user)\n return self.public? || self.edit_authorized(current_user)\n end",
"def authorize\n redirect_to \"/log_in\", :alert => t('.need_to_be_logged_in') unless signed_in?\n end",
"def logged_in?\n !current_person.nil?\n end",
"def logged_in?\n !current_person.nil?\n end",
"def admin?\n logged_in? && current_user.login == \"ej0c\"\n end",
"def logged_in?\n!current_user.nil?end",
"def authorized\n redirect_to '/welcome' unless logged_in?\n end",
"def logged_in?\n !!current_chef\n end",
"def authorize\n redirect_to new_session_path unless current_user #call method curent_user in sessions_helper\n end",
"def logged_in?\n current_user != nil \nend",
"def active_for_authentication?; end",
"def active_for_authentication?; end",
"def active_for_authentication? \n \tsuper && approved?\n \t\n\tend",
"def logged_in?\n !!logged_in_user \n end",
"def logged_in?\n current_user.present?\n end",
"def logged_in?\n current_user.present?\n end",
"def logged_in?\n current_user.present?\n end",
"def logged_in?\n current_user.present?\n end",
"def logged_in?\n current_user.present?\n end",
"def logged_in?\n current_user.present?\n end",
"def logged_in?\n current_user.present?\n end",
"def authorized?\n\t\t\t@authenticated\n\t\tend"
] |
[
"0.72957486",
"0.70217824",
"0.70217824",
"0.6943583",
"0.68494284",
"0.6810842",
"0.6760369",
"0.6719593",
"0.6699607",
"0.6688314",
"0.6677354",
"0.66520834",
"0.66520834",
"0.6642485",
"0.6606555",
"0.65748537",
"0.65519464",
"0.6549269",
"0.6549269",
"0.6549269",
"0.6549269",
"0.6549269",
"0.6528227",
"0.652021",
"0.65178126",
"0.6511245",
"0.6499651",
"0.6480511",
"0.6479846",
"0.6479389",
"0.64713514",
"0.6461126",
"0.6443072",
"0.6441029",
"0.6434722",
"0.6412002",
"0.6410397",
"0.6409982",
"0.6401189",
"0.6401189",
"0.63945746",
"0.63945746",
"0.6388124",
"0.6387683",
"0.6381924",
"0.6374475",
"0.6373574",
"0.6373574",
"0.63713384",
"0.63701814",
"0.6360788",
"0.6355242",
"0.63451004",
"0.6344952",
"0.6338156",
"0.63350356",
"0.633039",
"0.633039",
"0.63303494",
"0.6327745",
"0.6327745",
"0.63205785",
"0.6312387",
"0.6312387",
"0.63072586",
"0.6306304",
"0.63051903",
"0.63043994",
"0.63022524",
"0.6298133",
"0.629777",
"0.62947434",
"0.62947434",
"0.62941295",
"0.6292838",
"0.62909317",
"0.62904173",
"0.6289654",
"0.62889814",
"0.6283573",
"0.6280736",
"0.6280419",
"0.6280419",
"0.6280371",
"0.62785906",
"0.6274488",
"0.6265648",
"0.62647897",
"0.62528074",
"0.62505376",
"0.62505376",
"0.62502366",
"0.62481636",
"0.6247959",
"0.6247959",
"0.6247959",
"0.6247959",
"0.6247959",
"0.6247959",
"0.6247489",
"0.6243076"
] |
0.0
|
-1
|
This function takes in all of the smoothie ingredients, chops and mixes them up, and outputs a string of mixed characters, removing any whitespace.
|
def blend(smoothie_ingredients)
# retrieves only the food items and not the measurements
return smoothie_ingredients.keys.join.delete(" ").split('').shuffle!.join
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def blend(ingredients)\n smoothie = ''\n ingredients.each do |x,y|\n smoothie += x\n end\n puts smoothie.gsub(/\\s+/, \"\").split(\"\").shuffle!.join\nend",
"def blend(smoothie_ingredients)\n mix_ingredients = smoothie_ingredients.keys.join.split(//).shuffle\n return mix_ingredients.join.delete(\" \")\nend",
"def blend()\n grabs_items = @smoothie_ingredients.keys.join.split(\"\").shuffle\n # Return takes new variable, joins all array characters into one line\n # and removes any spaces\n return grabs_items.join.delete(\" \")\n end",
"def mix\n\n # Abort if there is no glass inside the replicator.\n return unless glass_inside_replicator\n\n # Draw power if possible and then mix ingredients around.\n if @power && @enterprise.reactor.draw_power(3)\n glass_inside_replicator.inside.contents.shuffle!.compact!\n end\n end",
"def get_ingredients \n # get rid of all characters that are not: a-z A-Z 0-9 - [] () . ' / , blank;\n clean_ingredients = self.ingredients.gsub(%r{[^a-zA-Z0-9\\-\\[\\]\\.\\,\\'\\(\\)\\/\\s]}, '')\n return clean_ingredients.split(', ').each { |ingredient| ingredient.strip! }\n end",
"def combine_ingredient_into_mixing_bowl\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 15 )\n value = nil\n combine_ingredient_into_mixing_bowl_start_index = @input.index\n text31 = nil\n ordinal32 = nil\n text33 = nil\n ordinal34 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return value\n end\n # at line 218:3: ( combine WS text WS into ( WS ordinal )? WS mixing WS bowl EOF | combine WS text WS into WS the ( WS ordinal )? WS mixing WS bowl EOF )\n alt_29 = 2\n alt_29 = @dfa29.predict( @input )\n case alt_29\n when 1\n # at line 218:5: combine WS text WS into ( WS ordinal )? WS mixing WS bowl EOF\n @state.following.push( TOKENS_FOLLOWING_combine_IN_combine_ingredient_into_mixing_bowl_837 )\n combine\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_combine_ingredient_into_mixing_bowl_839 )\n @state.following.push( TOKENS_FOLLOWING_text_IN_combine_ingredient_into_mixing_bowl_841 )\n text31 = text\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_combine_ingredient_into_mixing_bowl_843 )\n @state.following.push( TOKENS_FOLLOWING_into_IN_combine_ingredient_into_mixing_bowl_845 )\n into\n @state.following.pop\n # at line 218:29: ( WS ordinal )?\n alt_27 = 2\n look_27_0 = @input.peek( 1 )\n\n if ( look_27_0 == WS )\n look_27_1 = @input.peek( 2 )\n\n if ( look_27_1.between?( ST, TH ) )\n alt_27 = 1\n end\n end\n case alt_27\n when 1\n # at line 218:30: WS ordinal\n match( WS, TOKENS_FOLLOWING_WS_IN_combine_ingredient_into_mixing_bowl_848 )\n @state.following.push( TOKENS_FOLLOWING_ordinal_IN_combine_ingredient_into_mixing_bowl_850 )\n ordinal32 = ordinal\n @state.following.pop\n\n end\n match( WS, TOKENS_FOLLOWING_WS_IN_combine_ingredient_into_mixing_bowl_854 )\n @state.following.push( TOKENS_FOLLOWING_mixing_IN_combine_ingredient_into_mixing_bowl_856 )\n mixing\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_combine_ingredient_into_mixing_bowl_858 )\n @state.following.push( TOKENS_FOLLOWING_bowl_IN_combine_ingredient_into_mixing_bowl_860 )\n bowl\n @state.following.pop\n match( EOF, TOKENS_FOLLOWING_EOF_IN_combine_ingredient_into_mixing_bowl_862 )\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = {\n :cmd => :combine_ingredient_into_mixing_bowl,\n :args => {:ingredient => ( text31 && @input.to_s( text31.start, text31.stop ) ), :mixing_bowl => ordinal32.to_i}\n }\n \n # <-- action\n end\n\n when 2\n # at line 224:5: combine WS text WS into WS the ( WS ordinal )? WS mixing WS bowl EOF\n @state.following.push( TOKENS_FOLLOWING_combine_IN_combine_ingredient_into_mixing_bowl_870 )\n combine\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_combine_ingredient_into_mixing_bowl_872 )\n @state.following.push( TOKENS_FOLLOWING_text_IN_combine_ingredient_into_mixing_bowl_874 )\n text33 = text\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_combine_ingredient_into_mixing_bowl_876 )\n @state.following.push( TOKENS_FOLLOWING_into_IN_combine_ingredient_into_mixing_bowl_878 )\n into\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_combine_ingredient_into_mixing_bowl_880 )\n @state.following.push( TOKENS_FOLLOWING_the_IN_combine_ingredient_into_mixing_bowl_882 )\n the\n @state.following.pop\n # at line 224:36: ( WS ordinal )?\n alt_28 = 2\n look_28_0 = @input.peek( 1 )\n\n if ( look_28_0 == WS )\n look_28_1 = @input.peek( 2 )\n\n if ( look_28_1.between?( ST, TH ) )\n alt_28 = 1\n end\n end\n case alt_28\n when 1\n # at line 224:37: WS ordinal\n match( WS, TOKENS_FOLLOWING_WS_IN_combine_ingredient_into_mixing_bowl_885 )\n @state.following.push( TOKENS_FOLLOWING_ordinal_IN_combine_ingredient_into_mixing_bowl_887 )\n ordinal34 = ordinal\n @state.following.pop\n\n end\n match( WS, TOKENS_FOLLOWING_WS_IN_combine_ingredient_into_mixing_bowl_891 )\n @state.following.push( TOKENS_FOLLOWING_mixing_IN_combine_ingredient_into_mixing_bowl_893 )\n mixing\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_combine_ingredient_into_mixing_bowl_895 )\n @state.following.push( TOKENS_FOLLOWING_bowl_IN_combine_ingredient_into_mixing_bowl_897 )\n bowl\n @state.following.pop\n match( EOF, TOKENS_FOLLOWING_EOF_IN_combine_ingredient_into_mixing_bowl_899 )\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = {\n :cmd => :combine_ingredient_into_mixing_bowl,\n :args => {:ingredient => ( text33 && @input.to_s( text33.start, text33.stop ) ), :mixing_bowl => ordinal34.to_i}\n }\n \n # <-- action\n end\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 15 )\n memoize( __method__, combine_ingredient_into_mixing_bowl_start_index, success ) if @state.backtracking > 0\n\n end\n \n return value\n end",
"def remove_ingredient_from_mixing_bowl\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 8 )\n value = nil\n remove_ingredient_from_mixing_bowl_start_index = @input.index\n text22 = nil\n ordinal23 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return value\n end\n # at line 156:5: remove WS text ( WS from ( WS the )? ( WS ordinal )? WS mixing WS bowl )? EOF\n @state.following.push( TOKENS_FOLLOWING_remove_IN_remove_ingredient_from_mixing_bowl_532 )\n remove\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_remove_ingredient_from_mixing_bowl_534 )\n @state.following.push( TOKENS_FOLLOWING_text_IN_remove_ingredient_from_mixing_bowl_536 )\n text22 = text\n @state.following.pop\n # at line 156:20: ( WS from ( WS the )? ( WS ordinal )? WS mixing WS bowl )?\n alt_17 = 2\n look_17_0 = @input.peek( 1 )\n\n if ( look_17_0 == WS )\n alt_17 = 1\n end\n case alt_17\n when 1\n # at line 156:21: WS from ( WS the )? ( WS ordinal )? WS mixing WS bowl\n match( WS, TOKENS_FOLLOWING_WS_IN_remove_ingredient_from_mixing_bowl_539 )\n @state.following.push( TOKENS_FOLLOWING_from_IN_remove_ingredient_from_mixing_bowl_541 )\n from\n @state.following.pop\n # at line 156:29: ( WS the )?\n alt_15 = 2\n look_15_0 = @input.peek( 1 )\n\n if ( look_15_0 == WS )\n look_15_1 = @input.peek( 2 )\n\n if ( look_15_1.between?( T__16, T__17 ) )\n alt_15 = 1\n end\n end\n case alt_15\n when 1\n # at line 156:30: WS the\n match( WS, TOKENS_FOLLOWING_WS_IN_remove_ingredient_from_mixing_bowl_544 )\n @state.following.push( TOKENS_FOLLOWING_the_IN_remove_ingredient_from_mixing_bowl_546 )\n the\n @state.following.pop\n\n end\n # at line 156:39: ( WS ordinal )?\n alt_16 = 2\n look_16_0 = @input.peek( 1 )\n\n if ( look_16_0 == WS )\n look_16_1 = @input.peek( 2 )\n\n if ( look_16_1.between?( ST, TH ) )\n alt_16 = 1\n end\n end\n case alt_16\n when 1\n # at line 156:40: WS ordinal\n match( WS, TOKENS_FOLLOWING_WS_IN_remove_ingredient_from_mixing_bowl_551 )\n @state.following.push( TOKENS_FOLLOWING_ordinal_IN_remove_ingredient_from_mixing_bowl_553 )\n ordinal23 = ordinal\n @state.following.pop\n\n end\n match( WS, TOKENS_FOLLOWING_WS_IN_remove_ingredient_from_mixing_bowl_557 )\n @state.following.push( TOKENS_FOLLOWING_mixing_IN_remove_ingredient_from_mixing_bowl_559 )\n mixing\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_remove_ingredient_from_mixing_bowl_561 )\n @state.following.push( TOKENS_FOLLOWING_bowl_IN_remove_ingredient_from_mixing_bowl_563 )\n bowl\n @state.following.pop\n\n end\n match( EOF, TOKENS_FOLLOWING_EOF_IN_remove_ingredient_from_mixing_bowl_567 )\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = {\n :cmd => :remove_ingredient_from_mixing_bowl,\n :args => {:ingredient => ( text22.nil? ? nil : text22.value ), :mixing_bowl => ordinal23.to_i}\n }\n \n # <-- action\n end\n\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 8 )\n memoize( __method__, remove_ingredient_from_mixing_bowl_start_index, success ) if @state.backtracking > 0\n\n end\n \n return value\n end",
"def remix(drinks)\n alcohols = strip(drinks, 0)\n mixers = strip(drinks, 1)\n solution = mixer(alcohols, mixers)\nend",
"def crunch(string)\n string.squeeze\nend",
"def blend(list)\n food = []\n list.each { |k,v| food.push(k) }\n mix = food.join.delete(\" \")\n blended = mix.split(\"\").shuffle.join\n puts blended\n\nend",
"def crunch(words)\n words.split.map! do|word|\n word.squeeze\n end.join(' ')\nend",
"def cleanup_noreg(string)\n blocks = string.split\n result = blocks.map do |word|\n word = word.chars.map! do |char|\n if char.downcase == char.downcase.upcase\n ' '\n else \n char\n end\n end\n word = word.join\n # p word\n #p word.squeeze(\" \")\n #word.squeeze(\" \")\n # take note that here +*& is a block or word, and gets replaced by a space without\n # any contiguous letter chars\n # so after join on line 48, there are 3 spaces between my and line, without the squeeze call\n word\n end\n result = result.join(' ').squeeze(' ')#.squeeze\nend",
"def custom_squeeze(string)\n # characters = []\n # p characters = sentence.chars\n characters = string.chars\n eos = characters.length - 1\n return_string = \"\"\n # p return_string << characters[2]\n\n characters.each_with_index do |char, index|\n unless char == characters [index + 1] then return_string << characters[index]\n # puts \"char = #{char}\"\n # puts \"index = #{index}\"\n # puts \"characters from index = #{characters [index + 1]}\"\n # puts \"eos = #{eos}\"\n # puts \"return_string = #{return_string << characters[index]}\"\n # puts\n # else\n # puts \"Found repeating char #{char} at index #{index + 1}! \\n Removing repeating character!\"\n # puts\n end\n end\n return return_string\nend",
"def pig_latin_chop(word)\n\t#split single word into characters\n\n\twordArray = word.split(\"\") \n\tvowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']\n\tuntil vowels.include?(wordArray[0])==true\n\t\tconsonant = wordArray.shift().downcase\n\t\twordArray = wordArray.push(consonant)\n\tend\n\tnewWord = wordArray.join()+ \"ay\"\nend",
"def remix(ingredients)\n alcohol = ingredients.map {|el| el[0]}\n mixers = ingredients.map {|el| el[1] }\n alcohol.shuffle!\n mixers.shuffle!\n result = []\n alcohol.each_with_index do |al, i| \n result << [al, mixers[i]]\n end\n result\nend",
"def remix(ingredients)\n alchohols, mixers = [], []\n ingredients.each do |a, b|\n alchohols << a\n mixers << b\n end\n alchohols, mixers = alchohols.shuffle, mixers.shuffle\n alchohols.zip(mixers)\nend",
"def smash(words)\n sentence = \"\"\n words.each do |w|\n sentence = sentence + \"#{w} \"\n end\n sentence[0..-2]\nend",
"def silly_talk(sent)\n vowels = 'aeiou'\n words = sent.split\n new_words = []\n\n words.each do |word|\n if vowels.include?(word[-1])\n new_words << word + word[-1] \n else \n new_words << word.split('').map { |c| vowels.include?(c) ? (c + 'b' + c) : c }.join\n end \n end \n\n new_words.join(' ')\n\nend",
"def pig_it(str)\n words = str.split\n pigified = []\n words.each do |word|\n if word =~ /\\w/\n word += \"#{word.chr}ay\"\n word[0] = ''\n pigified << word\n else pigified << word\n end\n end\n pigified.join(' ')\nend",
"def crunch(text)\n clean_char = []\n text.chars.each do |char|\n clean_char << char unless clean_char.last == char\n end\n clean_char.join('')\nend",
"def silly_talk(str)\n vows = \"aeiou\"\n\n new_talk = str.split(\" \").map do |wrd|\n if vows.include?(wrd[-1].downcase)\n wrd + wrd[-1]\n else\n silly = wrd.split(\"\").map do |char|\n if vows.include?(char)\n char + \"b\" + char\n else\n char\n end\n end\n silly.join(\"\")\n end\n end\n\n new_talk.join(\" \")\nend",
"def unscramble_eggs(word)\n word.gsub(/egg/, \" \")\nend",
"def pig_it text\n\n # split string into array of words\n text_array = text.split(\" \")\n \n #for each word take first character from index [0] and move to last character index [-1] + 'ay', remove first character\n latin_array = text_array.map do |word|\n new_word = word + word[0] + \"ay\" \n new_word[1..-1]\n end\n \n #join together to single string\n latin_string = latin_array.join(\" \")\n \n #delete 'ay' from endings of sentences with punctuation - kind of cheating \n latin_string.sub! '!ay', '!' \n latin_string.sub! '?ay', '?'\n\n latin_string\n\nend",
"def pig_it_ms_two(str)\n pig = []\n str.split.each do |w|\n pig << w.chars.rotate.join + \"ay\" if w =~ /\\w/\n pig << w if w =~ /\\W/\n end\n pig.join(\" \")\nend",
"def crunch(double_string)\n current_character = ''\n new_string = ''\n double_string.each_char do |character|\n if character != current_character\n new_string += character\n current_character = character\n end\n end\n new_string\nend",
"def unscramble_eggs2(word)\n word.gsub(/egg/,\"\")\nend",
"def pig(word, howmany = 0)\r\n chars = word.split(//)\r\n lastletter_index = word.rindex(/\\w/)\r\n puncs = {}\r\n \r\n #grab punctuation, store info in hash\r\n chars.each_index { |x| puncs[x] = chars.at(x) if chars.at(x) =~ /\\W/ }\r\n\r\n #delete punctuation so we only deal with letters, does nothing if no punc \r\n chars.delete_if {|x| puncs.values.include?(x)} \r\n\r\n #not the most elegant for dealing with starts-with-vowel words, but more modular this way\r\n #skip this swapping stuff if it's a vowel for first letter\r\n if(howmany > 0) \r\n first = chars.slice!(0, howmany) #grab the first n chars, delete grabbed\r\n\r\n if(first[0] == first[0].upcase) #word was capitalized, swap order\r\n chars[0].upcase!\r\n first[0].downcase!\r\n end\r\n\r\n chars += first\r\n end\r\n\r\n #add back punctuation if it existed, does nothing if no punc\r\n puncs.keys.each { |key| chars.insert(key, puncs[key]) }\r\n \r\n #length == 1 means we got a single vowel like \"I\"; different rule\r\n chars.length == 1 ? chars << \"way\" : chars.insert(lastletter_index + 1, \"ay\") \r\n return chars.join(\"\")\r\nend",
"def chop\n str = self.class.__withAll(self) # preserve species\n str.chop!\n str\n end",
"def put_ingredient_into_mixing_bowl\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 2 )\n value = nil\n put_ingredient_into_mixing_bowl_start_index = @input.index\n text15 = nil\n ordinal16 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return value\n end\n # at line 107:5: put WS text WS into ( WS the )? ( WS ordinal )? WS mixing WS bowl EOF\n @state.following.push( TOKENS_FOLLOWING_put_IN_put_ingredient_into_mixing_bowl_229 )\n put\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_put_ingredient_into_mixing_bowl_231 )\n @state.following.push( TOKENS_FOLLOWING_text_IN_put_ingredient_into_mixing_bowl_233 )\n text15 = text\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_put_ingredient_into_mixing_bowl_235 )\n @state.following.push( TOKENS_FOLLOWING_into_IN_put_ingredient_into_mixing_bowl_237 )\n into\n @state.following.pop\n # at line 107:25: ( WS the )?\n alt_2 = 2\n look_2_0 = @input.peek( 1 )\n\n if ( look_2_0 == WS )\n look_2_1 = @input.peek( 2 )\n\n if ( look_2_1.between?( T__16, T__17 ) )\n alt_2 = 1\n end\n end\n case alt_2\n when 1\n # at line 107:26: WS the\n match( WS, TOKENS_FOLLOWING_WS_IN_put_ingredient_into_mixing_bowl_240 )\n @state.following.push( TOKENS_FOLLOWING_the_IN_put_ingredient_into_mixing_bowl_242 )\n the\n @state.following.pop\n\n end\n # at line 107:35: ( WS ordinal )?\n alt_3 = 2\n look_3_0 = @input.peek( 1 )\n\n if ( look_3_0 == WS )\n look_3_1 = @input.peek( 2 )\n\n if ( look_3_1.between?( ST, TH ) )\n alt_3 = 1\n end\n end\n case alt_3\n when 1\n # at line 107:36: WS ordinal\n match( WS, TOKENS_FOLLOWING_WS_IN_put_ingredient_into_mixing_bowl_247 )\n @state.following.push( TOKENS_FOLLOWING_ordinal_IN_put_ingredient_into_mixing_bowl_249 )\n ordinal16 = ordinal\n @state.following.pop\n\n end\n match( WS, TOKENS_FOLLOWING_WS_IN_put_ingredient_into_mixing_bowl_253 )\n @state.following.push( TOKENS_FOLLOWING_mixing_IN_put_ingredient_into_mixing_bowl_255 )\n mixing\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_put_ingredient_into_mixing_bowl_257 )\n @state.following.push( TOKENS_FOLLOWING_bowl_IN_put_ingredient_into_mixing_bowl_259 )\n bowl\n @state.following.pop\n match( EOF, TOKENS_FOLLOWING_EOF_IN_put_ingredient_into_mixing_bowl_261 )\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = {\n :cmd => :put_ingredient_into_mixing_bowl,\n :args => {:ingredient => ( text15.nil? ? nil : text15.value ), :mixing_bowl => ordinal16.to_i}\n }\n \n # <-- action\n end\n\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 2 )\n memoize( __method__, put_ingredient_into_mixing_bowl_start_index, success ) if @state.backtracking > 0\n\n end\n \n return value\n end",
"def without_garbage\n reg = Regexp.new /[#{String.characters.join}]+/\n self.scan(reg).join(\"\").gsub(\"\\n\", \" \").gsub(\"|\", \" \").gsub(\"-\", \" \")\n end",
"def inline_ingredients\n ingredients.to_a.map(&:name).join(' ')\n end",
"def strip_to_stems\n str = self.sanitize_tags\n terms_a = str.gsub(/[^a-z]+/u, ' ').strip.split(' ')\n terms = terms_a.reject do |term|\n ((term.length < 3 && !SHORT_WORDS.include?(term)) || term.length > 20)\n end\n terms.collect! {|term| term.stem}\n terms = terms.select {|term| term.length > 1}\n terms = terms - STOP_STEMS\n return terms.join(' ')\n end",
"def divide_ingredient_into_mixing_bowl\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 16 )\n value = nil\n divide_ingredient_into_mixing_bowl_start_index = @input.index\n text35 = nil\n ordinal36 = nil\n text37 = nil\n ordinal38 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return value\n end\n # at line 232:3: ( divide WS text WS into ( WS ordinal )? WS mixing WS bowl EOF | divide WS text WS into WS the ( WS ordinal )? WS mixing WS bowl EOF )\n alt_32 = 2\n alt_32 = @dfa32.predict( @input )\n case alt_32\n when 1\n # at line 232:5: divide WS text WS into ( WS ordinal )? WS mixing WS bowl EOF\n @state.following.push( TOKENS_FOLLOWING_divide_IN_divide_ingredient_into_mixing_bowl_915 )\n divide\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_divide_ingredient_into_mixing_bowl_917 )\n @state.following.push( TOKENS_FOLLOWING_text_IN_divide_ingredient_into_mixing_bowl_919 )\n text35 = text\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_divide_ingredient_into_mixing_bowl_921 )\n @state.following.push( TOKENS_FOLLOWING_into_IN_divide_ingredient_into_mixing_bowl_923 )\n into\n @state.following.pop\n # at line 232:28: ( WS ordinal )?\n alt_30 = 2\n look_30_0 = @input.peek( 1 )\n\n if ( look_30_0 == WS )\n look_30_1 = @input.peek( 2 )\n\n if ( look_30_1.between?( ST, TH ) )\n alt_30 = 1\n end\n end\n case alt_30\n when 1\n # at line 232:29: WS ordinal\n match( WS, TOKENS_FOLLOWING_WS_IN_divide_ingredient_into_mixing_bowl_926 )\n @state.following.push( TOKENS_FOLLOWING_ordinal_IN_divide_ingredient_into_mixing_bowl_928 )\n ordinal36 = ordinal\n @state.following.pop\n\n end\n match( WS, TOKENS_FOLLOWING_WS_IN_divide_ingredient_into_mixing_bowl_932 )\n @state.following.push( TOKENS_FOLLOWING_mixing_IN_divide_ingredient_into_mixing_bowl_934 )\n mixing\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_divide_ingredient_into_mixing_bowl_936 )\n @state.following.push( TOKENS_FOLLOWING_bowl_IN_divide_ingredient_into_mixing_bowl_938 )\n bowl\n @state.following.pop\n match( EOF, TOKENS_FOLLOWING_EOF_IN_divide_ingredient_into_mixing_bowl_940 )\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = {\n :cmd => :divide_ingredient_into_mixing_bowl,\n :args => {:ingredient => ( text35 && @input.to_s( text35.start, text35.stop ) ), :mixing_bowl => ordinal36.to_i}\n }\n \n # <-- action\n end\n\n when 2\n # at line 238:5: divide WS text WS into WS the ( WS ordinal )? WS mixing WS bowl EOF\n @state.following.push( TOKENS_FOLLOWING_divide_IN_divide_ingredient_into_mixing_bowl_948 )\n divide\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_divide_ingredient_into_mixing_bowl_950 )\n @state.following.push( TOKENS_FOLLOWING_text_IN_divide_ingredient_into_mixing_bowl_952 )\n text37 = text\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_divide_ingredient_into_mixing_bowl_954 )\n @state.following.push( TOKENS_FOLLOWING_into_IN_divide_ingredient_into_mixing_bowl_956 )\n into\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_divide_ingredient_into_mixing_bowl_958 )\n @state.following.push( TOKENS_FOLLOWING_the_IN_divide_ingredient_into_mixing_bowl_960 )\n the\n @state.following.pop\n # at line 238:35: ( WS ordinal )?\n alt_31 = 2\n look_31_0 = @input.peek( 1 )\n\n if ( look_31_0 == WS )\n look_31_1 = @input.peek( 2 )\n\n if ( look_31_1.between?( ST, TH ) )\n alt_31 = 1\n end\n end\n case alt_31\n when 1\n # at line 238:36: WS ordinal\n match( WS, TOKENS_FOLLOWING_WS_IN_divide_ingredient_into_mixing_bowl_963 )\n @state.following.push( TOKENS_FOLLOWING_ordinal_IN_divide_ingredient_into_mixing_bowl_965 )\n ordinal38 = ordinal\n @state.following.pop\n\n end\n match( WS, TOKENS_FOLLOWING_WS_IN_divide_ingredient_into_mixing_bowl_969 )\n @state.following.push( TOKENS_FOLLOWING_mixing_IN_divide_ingredient_into_mixing_bowl_971 )\n mixing\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_divide_ingredient_into_mixing_bowl_973 )\n @state.following.push( TOKENS_FOLLOWING_bowl_IN_divide_ingredient_into_mixing_bowl_975 )\n bowl\n @state.following.pop\n match( EOF, TOKENS_FOLLOWING_EOF_IN_divide_ingredient_into_mixing_bowl_977 )\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = {\n :cmd => :divide_ingredient_into_mixing_bowl,\n :args => {:ingredient => ( text37 && @input.to_s( text37.start, text37.stop ) ), :mixing_bowl => ordinal38.to_i}\n }\n \n # <-- action\n end\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 16 )\n memoize( __method__, divide_ingredient_into_mixing_bowl_start_index, success ) if @state.backtracking > 0\n\n end\n \n return value\n end",
"def snatch_cupcake(content)\n content.sub /\\*cupcake\\*/, '_______'\n end",
"def snatch_cupcake(content)\n content.sub /\\*cupcake\\*/, '_______'\n end",
"def mask_article(string, words)\n words.each { |x| string.gsub!(x, strike(x))}\n string\nend",
"def smash (words)\n \"#{words}\".chomp\nend",
"def pig_it text\n answer = text.split(' ')\n answer.each_with_index do |str, index|\n if (!str.match(/[-!$%^&*()_+|~=`{}\\[\\]:\";'<>?,.\\/]/))\n firstLetter = str[0]\n str[0] = str[0].delete(str[0])\n answer[index] = str.concat(firstLetter) + \"ay\"\n end\n end \n answer.join(' ')\nend",
"def pig_it(string)\n string2 = string.split.map{|e|e == '!' || e == '?' ? e : e.to_s << (e[0]) }.join(' ')\n\n string3 = string2.split.map{|e|e == '!' || e == '?' ? e : e.to_s << 'ay'}.join(' ')\n\n string3.split.map{|e| e == '!' || e == '?' ? e : e = e[1..-1]}.join(' ')\nend",
"def smash(words)\n words.join(\" \")\nend",
"def smash(words)\n words.join(\" \")\nend",
"def pigatize\n # Declare the output string\n piglatin = ''\n # Split the input text into words and loop with .each,\n # and 'word' as the iterator variable.\n split(' ').each do |word|\n # Check to see if the first letter is a vowel, else it's a consonant.\n if starts_with_vowel(word[0])\n # Add onto the output string with += and add an extra space.\n piglatin += word + 'way'\n else\n piglatin += word[1..-1] + word[0] + 'ay' + ' '\n end\n end\n # Added a .chomp here to get rid of any trailing space.\n piglatin.chomp\n end",
"def spell_out word6\n word6.downcase.split(\"\").join(\"-\")\nend",
"def shake!\n output_string = String.new\n\n @die_face = Array.new()\n\n i = 0\n while i < 16\n @die_face << @dice[i].split('').sample(1)\n i = i + 1\n end\n\n letter_array = @die_face.shuffle\n\n 4.times do\n output_string << letter_array.shift(4).join(' ') + \" \\n\"\n output_string.gsub!('Q ','Qu')\n end\n\n puts output_string\n end",
"def smash(words)\n return words * \" \"\nend",
"def ascii_products\n\" _ _ \n | | | | \n _ __ _ __ ___ __| |_ _ ___| |_ ___ \n| '_ \\\\| '__/ _ \\\\ / _` | | | |/ __| __/ __|\n| |_) | | | (_) | (_| | |_| | (__| |_\\\\__ \\\\\n| .__/|_| \\\\___/ \\\\__,_|\\\\__,_|\\\\___|\\\\__|___/\n| | \n|_| \"\n\tend",
"def pig_it(string)\n arr = string.split(\" \")\n result = \"\"\n arr.each do |word|\n # Check if word is containing only letters and not special characters\n if word.match? /\\A[a-zA-Z']*\\z/\n result += (word[1..-1] + word[0] + \"ay \")\n else\n result += (word + \" \")\n end\n end\n result[0...-1]\nend",
"def stir_ingredient_into_the_mixing_bowl\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 18 )\n value = nil\n stir_ingredient_into_the_mixing_bowl_start_index = @input.index\n ordinal41 = nil\n text42 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return value\n end\n # at line 256:5: stir WS text WS into ( WS the )? ( WS ordinal )? WS mixing WS bowl EOF\n @state.following.push( TOKENS_FOLLOWING_stir_IN_stir_ingredient_into_the_mixing_bowl_1049 )\n stir\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_stir_ingredient_into_the_mixing_bowl_1051 )\n @state.following.push( TOKENS_FOLLOWING_text_IN_stir_ingredient_into_the_mixing_bowl_1053 )\n text42 = text\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_stir_ingredient_into_the_mixing_bowl_1055 )\n @state.following.push( TOKENS_FOLLOWING_into_IN_stir_ingredient_into_the_mixing_bowl_1057 )\n into\n @state.following.pop\n # at line 256:26: ( WS the )?\n alt_36 = 2\n look_36_0 = @input.peek( 1 )\n\n if ( look_36_0 == WS )\n look_36_1 = @input.peek( 2 )\n\n if ( look_36_1.between?( T__16, T__17 ) )\n alt_36 = 1\n end\n end\n case alt_36\n when 1\n # at line 256:27: WS the\n match( WS, TOKENS_FOLLOWING_WS_IN_stir_ingredient_into_the_mixing_bowl_1060 )\n @state.following.push( TOKENS_FOLLOWING_the_IN_stir_ingredient_into_the_mixing_bowl_1062 )\n the\n @state.following.pop\n\n end\n # at line 256:36: ( WS ordinal )?\n alt_37 = 2\n look_37_0 = @input.peek( 1 )\n\n if ( look_37_0 == WS )\n look_37_1 = @input.peek( 2 )\n\n if ( look_37_1.between?( ST, TH ) )\n alt_37 = 1\n end\n end\n case alt_37\n when 1\n # at line 256:37: WS ordinal\n match( WS, TOKENS_FOLLOWING_WS_IN_stir_ingredient_into_the_mixing_bowl_1067 )\n @state.following.push( TOKENS_FOLLOWING_ordinal_IN_stir_ingredient_into_the_mixing_bowl_1069 )\n ordinal41 = ordinal\n @state.following.pop\n\n end\n match( WS, TOKENS_FOLLOWING_WS_IN_stir_ingredient_into_the_mixing_bowl_1073 )\n @state.following.push( TOKENS_FOLLOWING_mixing_IN_stir_ingredient_into_the_mixing_bowl_1075 )\n mixing\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_stir_ingredient_into_the_mixing_bowl_1077 )\n @state.following.push( TOKENS_FOLLOWING_bowl_IN_stir_ingredient_into_the_mixing_bowl_1079 )\n bowl\n @state.following.pop\n match( EOF, TOKENS_FOLLOWING_EOF_IN_stir_ingredient_into_the_mixing_bowl_1081 )\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = {\n :cmd => :stir_ingredient_into_the_mixing_bowl,\n :args => {\n :mixing_bowl => ordinal41.to_i,\n :ingredient => ( text42.nil? ? nil : text42.value )\n }\n }\n \n # <-- action\n end\n\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 18 )\n memoize( __method__, stir_ingredient_into_the_mixing_bowl_start_index, success ) if @state.backtracking > 0\n\n end\n \n return value\n end",
"def smash(words)\n words.join(' ')\nend",
"def smash(words)\n words.join(' ')\nend",
"def to_s\n morph = first.morpheme\n out_str = \"\"\n self.each do |syl|\n unless syl.morpheme==morph then # a new morpheme has been reached\n out_str += '-'\n morph = syl.morpheme\n end\n out_str += syl.to_s\n end\n return out_str\n end",
"def hipsterfy(str)\n finalArray = []\n alphabet = (\"a\"..\"z\").to_a\n wordArray = str.split(\" \")\n wordArray.each do |word|\n firstSeen = false\n reversed = word.split(\"\").reverse\n finalWord = []\n reversed.each do |letter|\n if firstSeen == true || letter != \"a\" && letter != \"e\" && letter != \"i\" && letter != \"o\" && letter != \"u\"\n finalWord.push(letter)\n\n elsif firstSeen == false && letter == \"a\" || letter == \"e\" || letter == \"i\" || letter == \"o\" || letter == \"u\"\n # don't add here\n firstSeen = true\n end\n end\n \n newString = \"\"\n finalWord.reverse.each do |element|\n newString += String(element)\n end\n finalArray.push(newString)\n \n end\n \n \n \n # print finalArray\n finalString = \"\"\n \n finalArray.each_with_index do |word, index|\n if index != finalArray.length - 1\n finalString += word + \" \"\n else\n finalString += word\n end\n end\n \n \n \n \n \n \n return finalString\n \n \n\n \nend",
"def compress(wrd)\n new_wrd = \"\"\n char = wrd[0]\n count = 1\n (1..wrd.length).each do |i|\n if char != wrd[i]\n new_wrd += char\n new_wrd += count.to_s if count > 1\n count = 1\n else\n count += 1\n end \n char = wrd[i] \n end\n\n new_wrd\nend",
"def fold_ingredient_into_mixing_bowl\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 5 )\n value = nil\n fold_ingredient_into_mixing_bowl_start_index = @input.index\n text18 = nil\n ordinal19 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return value\n end\n # at line 132:5: fold ( WS the )? WS text WS into ( WS the )? ( WS ordinal )? WS mixing WS bowl EOF\n @state.following.push( TOKENS_FOLLOWING_fold_IN_fold_ingredient_into_mixing_bowl_407 )\n fold\n @state.following.pop\n # at line 132:10: ( WS the )?\n alt_10 = 2\n look_10_0 = @input.peek( 1 )\n\n if ( look_10_0 == WS )\n look_10_1 = @input.peek( 2 )\n\n if ( look_10_1.between?( T__16, T__17 ) )\n look_10_2 = @input.peek( 3 )\n\n if ( look_10_2.between?( T__36, T__37 ) )\n look_10_4 = @input.peek( 4 )\n\n if ( look_10_4.between?( T__28, T__29 ) )\n look_10_5 = @input.peek( 5 )\n\n if ( look_10_5 == WS )\n look_10_6 = @input.peek( 6 )\n\n if ( syntactic_predicate?( :synpred24_Instructions ) )\n alt_10 = 1\n end\n end\n end\n end\n end\n end\n case alt_10\n when 1\n # at line 132:11: WS the\n match( WS, TOKENS_FOLLOWING_WS_IN_fold_ingredient_into_mixing_bowl_410 )\n @state.following.push( TOKENS_FOLLOWING_the_IN_fold_ingredient_into_mixing_bowl_412 )\n the\n @state.following.pop\n\n end\n match( WS, TOKENS_FOLLOWING_WS_IN_fold_ingredient_into_mixing_bowl_416 )\n @state.following.push( TOKENS_FOLLOWING_text_IN_fold_ingredient_into_mixing_bowl_418 )\n text18 = text\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_fold_ingredient_into_mixing_bowl_420 )\n @state.following.push( TOKENS_FOLLOWING_into_IN_fold_ingredient_into_mixing_bowl_422 )\n into\n @state.following.pop\n # at line 132:36: ( WS the )?\n alt_11 = 2\n look_11_0 = @input.peek( 1 )\n\n if ( look_11_0 == WS )\n look_11_1 = @input.peek( 2 )\n\n if ( look_11_1.between?( T__16, T__17 ) )\n alt_11 = 1\n end\n end\n case alt_11\n when 1\n # at line 132:37: WS the\n match( WS, TOKENS_FOLLOWING_WS_IN_fold_ingredient_into_mixing_bowl_425 )\n @state.following.push( TOKENS_FOLLOWING_the_IN_fold_ingredient_into_mixing_bowl_427 )\n the\n @state.following.pop\n\n end\n # at line 132:46: ( WS ordinal )?\n alt_12 = 2\n look_12_0 = @input.peek( 1 )\n\n if ( look_12_0 == WS )\n look_12_1 = @input.peek( 2 )\n\n if ( look_12_1.between?( ST, TH ) )\n alt_12 = 1\n end\n end\n case alt_12\n when 1\n # at line 132:47: WS ordinal\n match( WS, TOKENS_FOLLOWING_WS_IN_fold_ingredient_into_mixing_bowl_432 )\n @state.following.push( TOKENS_FOLLOWING_ordinal_IN_fold_ingredient_into_mixing_bowl_434 )\n ordinal19 = ordinal\n @state.following.pop\n\n end\n match( WS, TOKENS_FOLLOWING_WS_IN_fold_ingredient_into_mixing_bowl_438 )\n @state.following.push( TOKENS_FOLLOWING_mixing_IN_fold_ingredient_into_mixing_bowl_440 )\n mixing\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_fold_ingredient_into_mixing_bowl_442 )\n @state.following.push( TOKENS_FOLLOWING_bowl_IN_fold_ingredient_into_mixing_bowl_444 )\n bowl\n @state.following.pop\n match( EOF, TOKENS_FOLLOWING_EOF_IN_fold_ingredient_into_mixing_bowl_446 )\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = {\n :cmd => :fold_ingredient_into_mixing_bowl,\n :args => {:ingredient => ( text18.nil? ? nil : text18.value ), :mixing_bowl => ordinal19.to_i}\n }\n \n # <-- action\n end\n\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 5 )\n memoize( __method__, fold_ingredient_into_mixing_bowl_start_index, success ) if @state.backtracking > 0\n\n end\n \n return value\n end",
"def custom_squeeze(string)\n final=\"\"\n characters_array= string.split(\"\")\n characters_array.each_with_index do |char, index|\n unless index >= 0 && characters_array[index - 1] == char\n final += char\n end\n end\n p final\nend",
"def cracklepop1\n def aux x\n /[A-Z]+/i.match(x.to_s).to_s\n end\n (1..100).map do |i|\n x = i%3==0 ? 'crackle' : i\n i%5==0 ? (aux(x)+'pop') : x\n end\nend",
"def crunch(text)\n crunch_text = ''\n text.each_char do |x|\n crunch_text << x if /(.)\\1+/.match(x)\n end\n puts crunch_text\nend",
"def piglatinize(words)\n \n # \"flat iron\"\n # change the words in to an arry of words\n # words = \"Flat iron\"\n # expecting \"atFlay ironway\"\n splited_words = words.split(\" \")\n # vowels = [\"a\", \"e\",\"i\",\"o\"]\n sentence = []\n splited_words.each do |word|\n # .map do |word|\n changed_word = []\n beginning =[]\n i = 0\n while i < word.length do\n if word[i].downcase != \"a\" && word[i].downcase != \"e\" && word[i].downcase != \"i\" && word[i].downcase != \"o\" && word[i].downcase != \"u\"\n \n changed_word << word[i] \n else\n break\n end\n i += 1\n end\n \n beginning << word[i, word.length]\n if word[0].downcase != \"a\" && word[0].downcase != \"e\" && word[0].downcase != \"i\" && word[0].downcase != \"o\" && word[0].downcase != \"u\"\n\n latinized = beginning.join + changed_word.join + \"ay\" \n sentence << latinized \n else\n latinized = beginning.join + changed_word.join + \"way\" \n sentence << latinized\n end\n end \n sentence.join(\" \")\n end",
"def hipster(sentence)\n vowels = ['a', 'e', 'i', 'o', 'u']\n sentence.split.map do |word|\n idx = word.length - 1\n while idx >= 0 \n if vowels.include?(word[idx])\n word = word[0...idx] + word[idx + 1..-1]\n break\n end\n idx -= 1\n end\n word\n end.join(\" \")\nend",
"def pig_latin_name(word)\n# and returns a new string (pig latinified)\n# need to define vowels (can be an array?)\n vowels_list = vowels\n# break word into letters\n letters = word.split(\"\")\n# iterate through each letter of the word\n# until we hit a vowel\n letters.each do |letter|\n\n # check if first letter is vowel or consonant\n if is_consonant?(letter)\n # move it to the end\n removed_consonant = letters.shift\n letters = letters + removed_consonant.split\n #\n else\n letters.push(\"ay\")\n return letters.join\n end\n\n # then add \"ay\" at the end and return\n end\n\nend",
"def sentence_maker(array)\n combination = \"\"\n array.each {|x| combination = combination + x.to_s + \" \"}\n return combination.capitalize.chop + \".\"\nend",
"def hipsterfy(word)\n chars = word.split(\"\")\n\n i = chars.length - 1\n while i >= 0\n if $vowels.include?(chars[i])\n chars.delete_at(i)\n break\n end\n i -= 1\n end\n\n chars.join(\"\")\nend",
"def crunch(string)\n output = []\n string.chars.each { output << char unless output.last == char }\n output.join\nend",
"def pig_latin(string)\n words_array = string.split(\" \")\n modified_words_array = \"\"\n words_array.map do |word|\n \n if word =~ /\\A[aeiou]/\n word += \"ay\"\n modified_words_array << word + \" \"\n \n # regex to grab three consonants took from http://stackoverflow.com/questions/18406509/using-regexp-to-check-whether-a-string-starts-with-a-consonant\n # word starts with three consonants or \"[const.]qu\" ie. \"square\", \"squat\"\n elsif ( word =~ /\\A(?i:(?![aeiou])[a-z]){3}/ ) || ( word =~ (/\\b[^aeiou]+qu/) ) # word =~ /\\A[^aeiou]+qu{3}/ )\n without_first_three = word[3..-1]\n without_first_three += word[0..2] + \"ay\"\n if word[0] == word[0].upcase\n without_first_three.capitalize!\n end\n modified_words_array << without_first_three + \" \"\n \n # word starts with two consonants or \"qu\" ie. \"quake\", \"quart\" \n elsif ( word =~ /\\A(?i:(?![aeiou])[a-z]){2}/ ) || ( word =~ /\\A[qu]{2}/ )\n without_first_two = word[2..-1]\n without_first_two += word[0..1] + \"ay\"\n if word[0] == word[0].upcase\n without_first_two.capitalize!\n end\n modified_words_array << without_first_two + \" \"\n \n # word starts with consonant \n elsif word =~ /\\A[^aeiou]/\n without_first = word[1..-1]\n without_first += word[0] + \"ay\"\n if word[0] == word[0].upcase\n without_first.capitalize!\n end\n modified_words_array << without_first + \" \"\n end\n \n end\n modified_words_array.chomp(\" \")\nend",
"def parseIngredient(raw)\n name = \"\"\n quantity = 0\n measurement = \"\"\n prep_method = \"\"\n\n jooky = raw.tr('=', ',')\n if jooky.class != String\n puts \"*******************\"\n puts jooky.class\n end\n jooky = jooky.tr!(';', ',')\n jooky = jooky.tr!('{', ' ')\n jooky = jooky.tr!('}', ' ')\n jooky.strip!.slice!(-1)\n result = jooky.split(',')\n result.each { |x| \n x.tr!('\"\"', ' ')\n x.strip!\n }\n result_hash = Hash[*result.flatten]\n\n result_string = \"\"\n result_hash.delete_if {|key, value| value == \"\"}\n if result_hash.has_key?(\"quantity\")\n result_string << result_hash[\"quantity\"] + \" \"\n end\n \n if result_hash.has_key?(\"measurement\")\n result_string << result_hash[\"measurement\"] + \" \"\n end\n \n if result_hash.has_key?(\"name\")\n result_string << result_hash[\"name\"]\n end\n \n if result_hash.has_key?(\"method\")\n result_string << \", \" + result_hash[\"method\"]\n end\n \n return result_string\n\nend",
"def silly_talk(sentence)\n vowels = 'aeiou'\n new_sentence = []\n\n sentence.split(' ').each do |word|\n new_word = ''\n if vowels.include?(word[-1])\n new_word = word + word[-1]\n else\n word.each_char do |char|\n if vowels.include?(char.downcase)\n new_word << char + 'b' + char.downcase\n else\n new_word << char\n end\n end\n end\n new_sentence << new_word\n end\n\n new_sentence.join(' ')\nend",
"def crunch(str)\n str.split.map do |word|\n word.chars.each_with_object('') do |char, clean_word|\n clean_word << char if char != clean_word[-1]\n end\n end.join(' ')\nend",
"def sluggish_octopus(fishes)\r\n biggest_fish = \"\"\r\n\r\n fishes.each_with_index do |fish1, idx1|\r\n fishes.each_with_index do |fish2, idx2|\r\n if idx2 > idx1\r\n if fish2.length > biggest_fish.length\r\n biggest_fish << fish2\r\n end\r\n end\r\n end\r\n end\r\n return biggest_fish\r\nend",
"def pig_it text\n text.gsub(/(\\w)(\\w+)*/, '\\2\\1ay')\nend",
"def pig_it text\n text.gsub(/(\\w)(\\w+)*/, '\\2\\1ay')\nend",
"def pig_it(string)\n words = string.split\n\n words.map do |word|\n if word.match(/[a-z]/i)\n word[1..word.size] << word[0] << 'ay'\n else\n word\n end\n end.join(' ')\nend",
"def blend(hash)\n mix1 = []\n cycle1 = ''\n cycle2= ''\n hash.each{ |key, val| mix1.push(key)}\n #mix2 = mix1\n cycle1 = mix1.join.delete(\" \")\n cycle2 = cycle1.split(//).shuffle.join\n print \"Your Smoothie: \"+cycle2\nend",
"def crunch(string)\n crunched = []\n chars = string.split('') \n chars.each_with_index do |c,i|\n if i == 0\n crunched << c\n elsif chars[i-1] != c\n crunched << c\n end\n end\n crunched.join\nend",
"def add_ingredient_to_mixing_bowl\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 10 )\n value = nil\n add_ingredient_to_mixing_bowl_start_index = @input.index\n text25 = nil\n ordinal26 = nil\n text27 = nil\n ordinal28 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return value\n end\n # at line 172:3: ( add WS text WS into ( WS ordinal )? WS mixing WS bowl EOF | add WS text WS into WS the ( WS ordinal )? WS mixing WS bowl EOF )\n alt_21 = 2\n alt_21 = @dfa21.predict( @input )\n case alt_21\n when 1\n # at line 172:5: add WS text WS into ( WS ordinal )? WS mixing WS bowl EOF\n @state.following.push( TOKENS_FOLLOWING_add_IN_add_ingredient_to_mixing_bowl_616 )\n add\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_add_ingredient_to_mixing_bowl_618 )\n @state.following.push( TOKENS_FOLLOWING_text_IN_add_ingredient_to_mixing_bowl_620 )\n text25 = text\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_add_ingredient_to_mixing_bowl_622 )\n @state.following.push( TOKENS_FOLLOWING_into_IN_add_ingredient_to_mixing_bowl_624 )\n into\n @state.following.pop\n # at line 172:25: ( WS ordinal )?\n alt_19 = 2\n look_19_0 = @input.peek( 1 )\n\n if ( look_19_0 == WS )\n look_19_1 = @input.peek( 2 )\n\n if ( look_19_1.between?( ST, TH ) )\n alt_19 = 1\n end\n end\n case alt_19\n when 1\n # at line 172:26: WS ordinal\n match( WS, TOKENS_FOLLOWING_WS_IN_add_ingredient_to_mixing_bowl_627 )\n @state.following.push( TOKENS_FOLLOWING_ordinal_IN_add_ingredient_to_mixing_bowl_629 )\n ordinal26 = ordinal\n @state.following.pop\n\n end\n match( WS, TOKENS_FOLLOWING_WS_IN_add_ingredient_to_mixing_bowl_633 )\n @state.following.push( TOKENS_FOLLOWING_mixing_IN_add_ingredient_to_mixing_bowl_635 )\n mixing\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_add_ingredient_to_mixing_bowl_637 )\n @state.following.push( TOKENS_FOLLOWING_bowl_IN_add_ingredient_to_mixing_bowl_639 )\n bowl\n @state.following.pop\n match( EOF, TOKENS_FOLLOWING_EOF_IN_add_ingredient_to_mixing_bowl_641 )\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = {\n :cmd => :add_ingredient_to_mixing_bowl,\n :args => {:ingredient => ( text25 && @input.to_s( text25.start, text25.stop ) ), :mixing_bowl => ordinal26.to_i}\n }\n \n # <-- action\n end\n\n when 2\n # at line 178:5: add WS text WS into WS the ( WS ordinal )? WS mixing WS bowl EOF\n @state.following.push( TOKENS_FOLLOWING_add_IN_add_ingredient_to_mixing_bowl_649 )\n add\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_add_ingredient_to_mixing_bowl_651 )\n @state.following.push( TOKENS_FOLLOWING_text_IN_add_ingredient_to_mixing_bowl_653 )\n text27 = text\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_add_ingredient_to_mixing_bowl_655 )\n @state.following.push( TOKENS_FOLLOWING_into_IN_add_ingredient_to_mixing_bowl_657 )\n into\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_add_ingredient_to_mixing_bowl_659 )\n @state.following.push( TOKENS_FOLLOWING_the_IN_add_ingredient_to_mixing_bowl_661 )\n the\n @state.following.pop\n # at line 178:32: ( WS ordinal )?\n alt_20 = 2\n look_20_0 = @input.peek( 1 )\n\n if ( look_20_0 == WS )\n look_20_1 = @input.peek( 2 )\n\n if ( look_20_1.between?( ST, TH ) )\n alt_20 = 1\n end\n end\n case alt_20\n when 1\n # at line 178:33: WS ordinal\n match( WS, TOKENS_FOLLOWING_WS_IN_add_ingredient_to_mixing_bowl_664 )\n @state.following.push( TOKENS_FOLLOWING_ordinal_IN_add_ingredient_to_mixing_bowl_666 )\n ordinal28 = ordinal\n @state.following.pop\n\n end\n match( WS, TOKENS_FOLLOWING_WS_IN_add_ingredient_to_mixing_bowl_670 )\n @state.following.push( TOKENS_FOLLOWING_mixing_IN_add_ingredient_to_mixing_bowl_672 )\n mixing\n @state.following.pop\n match( WS, TOKENS_FOLLOWING_WS_IN_add_ingredient_to_mixing_bowl_674 )\n @state.following.push( TOKENS_FOLLOWING_bowl_IN_add_ingredient_to_mixing_bowl_676 )\n bowl\n @state.following.pop\n match( EOF, TOKENS_FOLLOWING_EOF_IN_add_ingredient_to_mixing_bowl_678 )\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n\n value = {\n :cmd => :add_ingredient_to_mixing_bowl,\n :args => {:ingredient => ( text27 && @input.to_s( text27.start, text27.stop ) ), :mixing_bowl => ordinal28.to_i}\n }\n \n # <-- action\n end\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 10 )\n memoize( __method__, add_ingredient_to_mixing_bowl_start_index, success ) if @state.backtracking > 0\n\n end\n \n return value\n end",
"def shopping_list\n ingredients.map do |ingredient|\n ingredient.name\n end.join(\" , \")\n end",
"def hipsterfy(sentence) \n sentence = sentence.split(\" \")\n arr = []\n sentence.each do |word|\n result = word.gsub(/[aeiou](?!.*[aeiou])/, '') # Negative Lookahead Regex\n arr << result\n end\n arr.join(\" \")\nend",
"def pig_it(str)\r\n str.split.map { |w| w =~ /[a-z]/i ? w[1..-1] + w[0] + 'ay' : w }.join(' ')\r\nend",
"def cartmans_phrase (string) #fix\n puts \"I'm not fat; I'm big-boned,\" + (string) #fix\nend",
"def pig_it(sentence)\n sentence.split.map do |word|\n if ('a'..'z').cover?(word.downcase)\n word[1..-1] + word[0] + 'ay'\n else\n word\n end\n end.join(' ')\nend",
"def awesomesauce_infusion(strings)\n i = 0\n infused_strings = []\n strings.length.times do\n infused_strings << strings[i]\n if i < strings.length - 1\n infused_strings << \"awesomesauce\"\n end\n i += 1\n end\n return infused_strings\nend",
"def to_morse translate\n translate.gsub!(' ', ' / ')\n\n @alpha_morse.each do |element|\n translate.gsub!(element[0], (element[1] + ' '))\n end\n\n translate\nend",
"def custom_squeeze(string)\n final = \"\"\n chars = string.split(\"\")\n chars.each_with_index { |char, index| char == chars[index + 1] ? next : final << char }\n final\nend",
"def pig_sentence(string)\n pig_latin = \"\"\n string.split().each do |word|\n pig_latin += pig_word(word).downcase + \" \"\n end\n pig_latin.strip!\nend",
"def crunch(string)\n clean_string = ''\n string.each_char do |letter|\n clean_string << letter unless letter == clean_string[-1]\n end\n clean_string\nend",
"def hipsterfy(sentence)\n # collection of vowels\n vowels = %w[\n a e i o u\n ]\n new_sentence = Array.new\n\n # digest per word\n sentence.split(' ').each do |word|\n\n last_vowel_position = 0\n # digest per character and saving the position of the vowel\n word.split('').each_with_index do |letter, idx|\n if vowels.include?(letter)\n last_vowel_position = idx\n end\n end\n\n # push the newly sliced word but with extra attention if it specifies the\n # 0th index\n if last_vowel_position != 0\n new_sentence.push(word.slice(0, last_vowel_position) + word.slice(last_vowel_position + 1, word.length))\n else\n # if the 0th index is a vowel, slice it out, otherwise leave it\n if vowels.include?(word[0])\n new_sentence.push(word.slice(0, last_vowel_position) + word.slice(last_vowel_position + 1, word.length))\n else\n new_sentence.push(word)\n end\n end\n end\n new_sentence.join(' ')\nend",
"def smash(string)\n\tstring.gsub(/[^a-z]/i, '').chars.join ' '\nend",
"def custom_squeeze(string)\n final = \"\"\n chars = string.split(\"\")\n chars.each_with_index { |char, index| char == chars[index + 1] ? next : final << char }\n final\nend",
"def sentence_maker(array)\n combination = \"\"\n array[0].capitalize!\n array.each {|x| combination = combination + x.to_s + \" \"}\n combination.rstrip!\n combination = combination + \".\"\n return combination\nend",
"def crunch(string)\n new_string = ''\n string.each_char { |char| new_string += char if new_string[-1] != char}\n new_string\nend",
"def sluggish(fishes)\n longest_fish = \"\"\n i = 0\n\n while i < fishes.length - 1\n j = i + 1\n while j < fishes.length\n if fishes[i].length >= fishes[j].length\n longest_fish = fishes[i]\n else\n longest_fish = fishes[j]\n end\n end\n i += 1\n end\nend",
"def piglatinizer(str)\n plstr = \"\"\n arr = str.split\n\n arr.each do |pig|\n if (pig.size <= 2) && (pig.slice(0) =~ /[aeiou]/)\n plstr << pig\n plstr << \"ay \"\n else\n l = pig.slice!(0)\n plstr << pig\n plstr << l\n plstr << \"ay \"\n end\n end\n plstr.downcase.capitalize\nend",
"def convert_pig_latin(sent)\n vowels = \"aeiou\"\n latin = []\n\n sent = sent.split(\" \")\n sent.each_with_index do |word,idx|\n uppercase = false\n if word.length < 3\n latin << word\n elsif vowels.include?(word[0].downcase)\n latin << (word + \"yay\")\n else\n temp_str = \"\"\n i = 0\n while i < word.length\n uppercase = true if i == 0 && word[i] == word[i].upcase\n if !vowels.include?(word[i].downcase)\n temp_str += word[i]\n else \n new_word = (word[i..-1] + temp_str.downcase + \"ay\")\n uppercase ? ( latin << (new_word[0].upcase + new_word[1..-1]) ) : ( latin << new_word )\n break\n end\n i += 1\n end\n end\n end\n latin.join(\" \")\nend",
"def pig(word)\n letters = word.split(\"\")\n letters.keep_if {|letter| letter != \".\"}\n if letters.size == 1 || vowel?(letters[0])\n letters << \"way\"\n elsif letters.size > 1\n until vowel?(letters[0])\n letters << letters.shift\n end\n letters << \"ay\"\n end\n letters.join\n end",
"def to_s\n map do |allomorphs, hyps|\n separator = \"-\"* allomorphs.to_s.length\n \"#{allomorphs}\\n#{separator}\\n\" + hyps.flatten.join(\"\\n\")\n end.join(\"\\n\\n\")\n end",
"def pig_it text\n text.split(' ').map do |word|\n if word == \"?\" || word == \"!\" || word == \".\" || word == \",\"\n word\n else\n (word[1..(word.length-1)] + word[0] + \"ay\")\n end\n end.join(' ')\nend",
"def mask_article(str, words_array)\n new_str = str\n words_array.each do |word|\n new_str.gsub! word, strike(word) if new_str.include? word\n end\n\n new_str\nend",
"def join_ingredients(src)\n \n new_array = []\n \n new_array.push(\"I love #{src[0][0]} and #{src[0][1]} on my pizza\")\n new_array.push(\"I love #{src[1][0]} and #{src[1][1]} on my pizza\")\n new_array.push(\"I love #{src[2][0]} and #{src[2][1]} on my pizza\")\n \n\n new_array\nend",
"def remix(ingredient_arrays)\n \n mixers = []\n \n ingredient_arrays.each do |array|\n mixers << array[1]\n end\n \n ingredient_arrays.each do |array|\n idx = rand(mixers.length)\n array[1] = mixers[idx]\n mixers.delete_at(idx)\n end\n \n return ingredient_arrays\n \nend",
"def crunch(str)\n last_character = ''\n collapsed = str.chars.each_with_object([]) do |character, arr|\n unless character == last_character\n arr.push(character)\n last_character = character\n end\n end\n collapsed.join\nend",
"def removeQuotesAndPunc sentence\n\t\tquotes = [\"\\\"\",\"'\",\":\",\",\",\".\",\"(\",\")\",\";\",\"!\",\"&\",\"<\",\">\",\"?\",\"-\",\"_\"]\n\t\twords = sentence.split(' ')\n\t\twords.map! do |w|\n\t\t\tw.slice!(1) if quotes.include?(w[0])\n\t\t\tw.slice(-1) if quotes.include?(w[-1])\n\t\t\tw\n\t\tend\n\t\treturn words.join(' ')\n\tend"
] |
[
"0.68733984",
"0.6839143",
"0.6540903",
"0.61374545",
"0.5888506",
"0.58621943",
"0.5845411",
"0.5831066",
"0.5780377",
"0.5769432",
"0.57523984",
"0.5745507",
"0.5734754",
"0.572601",
"0.5702836",
"0.558994",
"0.5587249",
"0.5564574",
"0.55623424",
"0.55589384",
"0.55501854",
"0.553708",
"0.553005",
"0.5526464",
"0.5519793",
"0.5515706",
"0.5506578",
"0.54813623",
"0.546465",
"0.5450617",
"0.544413",
"0.5431851",
"0.5418614",
"0.5414374",
"0.5414374",
"0.5396732",
"0.538316",
"0.53762865",
"0.5370862",
"0.53471476",
"0.53471476",
"0.5345123",
"0.5344782",
"0.53429496",
"0.53242826",
"0.53240365",
"0.5321344",
"0.53031653",
"0.53022915",
"0.53022915",
"0.52991045",
"0.52981967",
"0.52874136",
"0.5279018",
"0.5264591",
"0.52516544",
"0.52507895",
"0.5245227",
"0.52260333",
"0.52212024",
"0.52158755",
"0.5209499",
"0.5206796",
"0.52041286",
"0.5200188",
"0.5182923",
"0.5177525",
"0.51774746",
"0.51771957",
"0.51771957",
"0.51729316",
"0.5172587",
"0.5171172",
"0.5169826",
"0.5158967",
"0.5152045",
"0.51488745",
"0.5148037",
"0.513294",
"0.5131611",
"0.51296973",
"0.5129574",
"0.51284313",
"0.51275057",
"0.51198244",
"0.5119607",
"0.5117165",
"0.5112986",
"0.5105727",
"0.5102889",
"0.5096951",
"0.50968796",
"0.50948656",
"0.509077",
"0.50683284",
"0.5061321",
"0.5055948",
"0.5050259",
"0.5042118",
"0.503905"
] |
0.6229944
|
3
|
GET /meetings GET /meetings.xml
|
def index
@meetings = Meeting.recent
@past_meetings = Meeting.recent.past
@upcoming_meetings = Meeting.upcoming
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @meetings }
format.atom
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_meetings\n prepare\n @api.get_meetings\n end",
"def index\n respond_to do |format|\n format.html { render action: 'index' } # index.html.erb\n format.json do\n out = meetings.per(500).map(&:to_json_attributes)\n out.each { |m| m[:url] = meeting_path(m[:url]) }\n render json: out\n end\n format.xml { render xml: meetings }\n end\n end",
"def index\n @meetings_results = MeetingsResult.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @meetings_results }\n end\n end",
"def index\n @meetings = Meeting.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @meetings }\n end\n end",
"def index\n @meetings = Meeting.all\n end",
"def index\n @meetings = Meeting.all\n end",
"def index\n @meetings = Meeting.all\n end",
"def index\n @meetings = Meeting.all\n end",
"def index\n @meetings = Meeting.all\n end",
"def index\n @meetings = Meeting.all\n end",
"def index\n @meetings = Meeting.paginate(:page => params[:page], :per_page => 20)\n\t\t@title = \"Spotkania\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @meetings }\n format.rss { render :layout => false }\n end\n end",
"def show\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n format.xml { render :xml => @meeting }\n end\n end",
"def index\n #@meeting_assignments = Assignment.find_all_meetings\n @meeting_assignments = Assignment.find_all_meetings(@user.id, params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @meetings }\n end\n end",
"def index\n @meetings = Meeting.all\nend",
"def show\n @meetings_result = MeetingsResult.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @meetings_result }\n end\n end",
"def list_meeting_attendee(meeting_id=nil)\n operation_name=\"List Attendee\"\n @id = meeting_id unless meeting_id.nil?\n xml_value= xml_meetings(@configuration, operation_name,@id)\n \n res = Net::HTTP.start(@configuration[:host]){ |http|\n http.post(\"/WBXService/XMLService\",xml_value)\n }\n xml_data = res.body\n meeting_data = Hash.new\n attend = Attendee.new\n meeting_data= attend.parse_xml(res.body)\n puts res.body\n return meeting_data\n end",
"def show\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @meeting }\n end\n end",
"def index\n @meetings_lists = MeetingsList.all\n end",
"def show\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @person.to_xml }\n end\n end",
"def index\n @annual_meetings = AnnualMeeting.all\n end",
"def index\n @users_meetings = UsersMeeting.all\n end",
"def all_running_meetings\n bbb_server.get_meetings\n end",
"def show\n @meeting = Meeting.find(params[:id])\n if @meeting\n @attendee = @meeting.attendee_with_user(current_user) || Attendee.new\n @attendees = @meeting.attendees.find_all_by_rsvp(\"Yes\")\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @meeting }\n end\n end",
"def index\n @meetings = Meeting.all\n @users = User.all\n @atendees = Atendee.all\n @presentes = Presenter.all\n end",
"def index\n # # @meetings = Meeting.all\n # # Why check params for user_holder, but then using the root user one?\n # # I assume it is root user for now.\n # if params[:user_holder_id]\n # @cur_user_holder = current_user.user_holder\n # @meetings = @cur_user_holder.meetings\n # else\n # # No point to show all meeting.\n # @meetings = Meeting.all\n # end\n @pending_meetings = current_user.user_holder.meetings.where(status: \"pending\")\n @confirmed_meetings = current_user.user_holder.meetings.where(status: \"confirmed\")\n end",
"def index\n\n @staticpage = Staticpage.find(:first, :conditions => [\"page_name = ?\", \"MeetingNotes\"]) \n \n @meetings = Meeting.find(:all, :order => [\"meeting_date desc\"])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @meetings }\n end\n end",
"def index\n\n if params[:meeting_id]\n @meeting = Meeting.find(params[:meeting_id])\n end\n\n respond_to do |f|\n f.json {\n @meetings = Meeting\n start_p = Time.parse(params[:start])\n end_p = Time.parse(params[:end])\n @meetings = @meetings.where(\"start_at > ?\", params[:start])\n if start_p and end_p\n duration = end_p - start_p\n @meetings = @meetings.where(\"duration < ?\", duration)\n end\n\n render :json => @meetings.map{|m|\n {\n :id => m.id,\n :title => m.label,\n :start => m.start_at,\n :end => m.end_at,\n :url => \"/reunions/#{m.id}.js\",\n color: '#D42700',\n textColor: 'white'\n }\n }\n }\n f.html\n end\n end",
"def tournaments\n get('sports/en/tournaments.xml')\n end",
"def reports_meetings\n @reports_meetings = Meeting.all\n end",
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meeting }\n end\n end",
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meeting }\n end\n end",
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meeting }\n end\n end",
"def index\n @meetings = Meeting.for_school(@_current_school).paginate(page: params[:page], per_page: 50)\n end",
"def show\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meeting }\n end\n end",
"def show\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meeting }\n end\n end",
"def show\n @users_meetings = UsersMeeting.where(meeting_id_id: @meeting.id)\n end",
"def index\n @rooms = Room.all\n @meetings = Meeting.all\n respond_to do |format|\n format.html\n format.ics do\n cal = Icalendar::Calendar.new\n @meetings.each do |meeting|\n event = Icalendar::Event.new\n event.dtstart = meeting.start_at\n event.dtend = meeting.end_at\n event.summary = meeting.notes\n event.description = meeting.room.name\n cal.add_event(event)\n end\n render :text => cal.to_ical\n end\n end\n end",
"def timeline\n @bookings = Booking.find_waiting_pickup\n respond_to do |format|\n format.xml\n end\n end",
"def index\n\n @meetings = Meeting.joins(:company).where(Company.table_name => {:id => current_operator.company.id})\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @meetings }\n end\n end",
"def index\n @meetings = Meeting.all(:order => \"date\")\n end",
"def index\n render json: meeting.all\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 @meetusers = Meetuser.all\n end",
"def upcoming_meetings(content, opts = {})\n cutoff = opts[:cutoff] || Time.now\n\n doc = Nokogiri::XML(content)\n\n meetings = {}\n\n doc.xpath(\"//item\").each do |item|\n\n # \"Austin City Council - 1/13/2011 10:00 AM\"\n title = item.xpath(\"title\").inner_text\n m = title.match(/(.*) - (.*)/)\n group = m[1]\n meeting_time = Time.strptime(m[2], \"%m/%d/%Y %I:%M %p\")\n\n # Consider only future meetings.\n next unless meeting_time > cutoff\n\n # There are some weird far future meetings in the feed.\n # Cut off stuff more than a year out.\n next if meeting_time > cutoff + (365*24*60*60)\n\n # \"https://austin.siretechnologies.com/sirepub/mtgviewer.aspx?meetid=576&doctype=AGENDA\"\n link = item.xpath(\"link\").inner_text\n m = link.match(/meetid=([\\d]+)/)\n meetid = m[1].to_i\n\n pubdate = Time.parse(item.xpath(\"pubDate\").inner_text)\n\n meetings[meetid] = SireAgenda::Meeting.new(meetid,\n :group => group,\n :meeting_time => meeting_time,\n :last_changed => pubdate,\n :sire => self,\n )\n\n end\n\n meetings\n end",
"def index\n if current_user.usertype == \"superadmin\"\n @meetings = Meeting.all\n elsif params[:type] == nil\n @meetings = Meeting.find(:all, :conditions => [\"user_id = ? \", session[:user_id]] )#you are student\n elsif params[:type]=='pending' #meeting requested by the current user\n @meetings = Meeting.find(:all, :conditions=> [\"accept =0 and status = 0 and (tutor_id = ? or user_id = ?)\", session[:tutor_id], session[:user_id]])\n elsif params[:type]=='past'#meeting you attended in the past\n @meetings = Meeting.find(:all, :conditions=> [\"(tutor_id = ? OR user_id = ? )and status >= ?\", session[:tutor_id], session[:user_id], 3])\n elsif params[:type]=='attending' #meeting list that you will be attending(accepted, paid)\n @meetings = Meeting.find(:all, :conditions => ['(user_id = ? or tutor_id = ?) AND status = ? AND paid = ?', session[:user_id],session[:tutor_id], 1, true])\n else\n @meetings = Meeting.find(:all, :conditions => ['(user_id = ? or tutor_id = ?) AND status = ? AND paid = ?', session[:user_id],session[:tutor_id], 1, true])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @meetings }\n end\n end",
"def show\n @request_meeting = RequestMeeting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @request_meeting }\n end\n end",
"def show\n @meeting = Meeting.find(params[:id])\n @user = User.find_by_watiam(session[:cas_user])\n\n @allattendees = Attendee.where(:meeting_id => @meeting.id).all\n @allattendees.find(:sort => 'weight')\n @allusers = []\n \n \n #creates array of users that are attending the meeting\n @allattendees.each do |attendee|\n @userall = User.find(:first, :conditions => {:id => attendee.user_id})\n @allusers << @userall\n end\n \n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meeting }\n end\n end",
"def index\n @appointments = Appointment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @appointments }\n end\n end",
"def meeting_get(*args)\n options = Zoom::Params.new(Utils.extract_options!(args))\n options.require(%i[meeting_id])\n Utils.parse_response self.class.get(\"/meetings/#{options[:meeting_id]}\", headers: request_headers)\n end",
"def index\n @meetings = User.find(params[:user_id]).meetings\n #@meetings = Array.new\n Meeting.all.each do |m|\n if m.user_id == current_user.id\n @meetings.push(m)\n end\n end\n end",
"def set_meetings_list\n @meetings_list = MeetingsList.find(params[:id])\n end",
"def fetch_meetings\n response = self.api.get_meetings\n\n # updates the information in the rooms that are currently in BBB\n @meetings = []\n response[:meetings].each do |attr|\n room = BigbluebuttonRoom.find_by_server_id_and_meetingid(self.id, attr[:meetingID])\n if room.nil?\n room = BigbluebuttonRoom.new(:server => self, :meetingid => attr[:meetingID],\n :name => attr[:meetingID], :attendee_password => attr[:attendeePW],\n :moderator_password => attr[:moderatorPW], :external => true,\n :randomize_meetingid => false, :private => true)\n else\n room.update_attributes(:attendee_password => attr[:attendeePW],\n :moderator_password => attr[:moderatorPW])\n end\n room.running = attr[:running]\n\n @meetings << room\n end\n end",
"def get_possible_meetings( query )\n meetings = MeetingFinder.new( params[:query] ).search()\n meetings.each do |meeting|\n @result << {\n class: 'Meeting',\n id: meeting.id,\n description: meeting.get_scheduled_date_with_verbose_name,\n date: meeting.get_scheduled_date ? meeting.get_scheduled_date : meeting.header_date\n }\n end\n meetings\n end",
"def index\n\t\t@people = Person.all\n\t\t# respond_to do |format|\n\t\t# \tformat.xml { send_data @entries.to_xml, :type => 'text/xml; charset=UTF-8;', :disposition => 'attachment; filename=entries.xml'}\n\t\t# end\n\tend",
"def pending_meets \n assert_internal_error(@user)\n @pending_meets = @user.true_pending_meets\n respond_to do |format|\n format.html {\n # redirect back to user meets view if no more pending meets\n if @pending_meets.empty?\n redirect_back user_meets_path(@user)\n else\n @pending_meets = @pending_meets.paginate(:page => params[:page], :per_page => 25)\n attach_meet_infos(current_user, @pending_meets, true)\n end\n }\n format.json {\n cursor = params[:cursor] || params\n @pending_meets = @pending_meets.cursorize(cursor,\n :only=>[:time, :created_at, :updated_at, :lat, :lng])\n attach_meet_infos(current_user, @pending_meets, true)\n @pending_meets.each {|meet|\n meet.friends_name_list_params = {:except=>current_user,:delimiter=>\", \",:max_length=>80}\n }\n render :json => @pending_meets.to_json(MeetsController::JSON_PENDING_MEET_LIST_API)\n }\n end\n end",
"def show\n @users_meeting = UsersMeeting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @users_meeting }\n end\n end",
"def show\n\n \n @meet = Meet.find(params[:id])\n @track = @meet.track\n @cards = @meet.cards\n @comments = @meet.comments\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meet }\n end\n end",
"def show\n @meeting = Meeting.find(params[:id])\n end",
"def index\n @attendees = Attendee.paginate(:page => params[:page], :per_page => 40)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @attendees }\n end\n end",
"def index\n # if current_user.admin?\n # @meetings = Meeting.all\n # else\n # @meetings = current_user.meetings.where(user_id: current_user)\n # end\n end",
"def show\n @meeting = Meeting.find(params[:id])\n\n end",
"def index\n @site = Site.first\n @meetup_info = @site.meetup_info\n @meetups = Meetup.coming_soon\n end",
"def new\n @meeting = Meeting.new\n @statuses = get_status_dropdown\n @categories = get_category_dropdown\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meeting }\n end\n end",
"def index\n @meetups = Meetup.all\n @tags = Tag.all\n @tagmeetups = Tagmeetup.all\n\n end",
"def get_listings_xml(url)\n @client.get_content(url)\n end",
"def index\n @type_of_meetings = TypeOfMeeting.all\n end",
"def show\n set_room\n @rooms= Room.all\n @meetings = Meeting.where(:room_id => @room.id)\n @meeting = Meeting.new\n @ics_route = \"/rooms/#{ @room.id.to_s }.ics\"\n respond_to do |format|\n format.html\n format.ics do\n cal = Icalendar::Calendar.new\n @meetings.each do |meeting|\n event = Icalendar::Event.new\n event.dtstart = meeting.start_at\n event.dtend = meeting.end_at\n event.summary = meeting.notes\n event.description = meeting.room.name\n cal.add_event(event)\n end\n render :text => cal.to_ical\n end\n end\n end",
"def index\n @talks = @venue.talks\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @talks }\n format.json { render :json => @talks }\n end\n end",
"def fetch_meeting_info\n begin\n server = BigbluebuttonRails.configuration.select_server.call(self, :get_meeting_info)\n response = server.api.get_meeting_info(self.meetingid, self.moderator_api_password)\n\n @participant_count = response[:participantCount]\n @moderator_count = response[:moderatorCount]\n @has_been_forcibly_ended = response[:hasBeenForciblyEnded]\n @end_time = response[:endTime]\n @current_attendees = []\n if response[:attendees].present?\n response[:attendees].each do |att|\n attendee = BigbluebuttonAttendee.new\n attendee.from_hash(att)\n @current_attendees << attendee\n end\n end\n\n # a 'shortcut' to update meetings since we have all information we need\n # if we got here, it means the meeting is still in the server, so it's not ended\n update_current_meeting_record(response, true)\n\n rescue BigBlueButton::BigBlueButtonException => e\n # note: we could catch only the 'notFound' error, but there are complications, so\n # it's better to end the meeting prematurely and open it again if needed than to\n # not end it at all (e.g. in case the server stops responding)\n Rails.logger.info \"BigbluebuttonRoom: detected that a meeting ended in the room #{self.meetingid} after the error #{e.inspect}\"\n\n finish_meetings\n end\n\n response\n end",
"def index\n @chat_rooms = ChatRoom.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @chat_rooms }\n end\n end",
"def index\n @click_to_talks = ClickToTalk.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @click_to_talks }\n end\n end",
"def index\n @goals = Goal.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @goals }\n end\n end",
"def index\n @invite_requests = InviteRequest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @invite_requests }\n end\n end",
"def show\n \n @meetup = Meetup.find(params[:id])\n render json: {\n meetup: MeetupSerializer.new(@meetup)\n }\n end",
"def index\n @user = current_user\n @meetings = @user.meetings.all.where('date >= ?', Date.today).order('date ASC')\n @old_meetings = @user.meetings.all.where('date <= ?', Date.today).order('date ASC')\n end",
"def count_meetings\n # TODO respond with xml, only if valid session, otherwise return nil\n team = Team.find_by_id( params[:id] )\n if team\n render json: team.meetings.collect{|row| row.id}.uniq.size\n else\n render json: 0\n end\n end",
"def index\n @friend_invites = FriendInvite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friend_invites }\n end\n end",
"def index\n if current_user.admin?\n if params[:dom].present?\n @request_meetings = RequestMeeting.includes(:meeting).where(meetings: { domain_id: params[:dom] })#.per(50).page(params[:page])\n @domain = Domain.find params[:dom]\n else\n @request_meetings = RequestMeeting.all\n end\n else \n @request_meetings = current_user.request_meetings\n if params[:dom].present?\n @request_meetings.where(meetings: { domain_id: params[:dom] })\n end\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @request_meetings }\n end\n end",
"def index\n @meet_up_comments = MeetUpComment.in_conference(current_conference).all\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"def show\n @exibitor = Exibitor.find(params[:id])\n @exibitormeetings = @exibitor.sponsor.meeting\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exibitor }\n end\n end",
"def show\n @meeting_point = MeetingPoint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meeting_point }\n end\n end",
"def index\n @friend_requests = FriendRequest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friend_requests }\n end\n end",
"def show\n @fetmeeting = Fetmeeting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fetmeeting }\n end\n end",
"def index\n @friend_requests = FriendRequest.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friend_requests }\n end\n end",
"def index\n @user = User.find(params[:user_id])\n @mycontact = Mycontact.find(params[:mycontact_id])\n if @mycontact\n @meetings = @mycontact.meetings\n else\n @meetings = Meeting.all\n end\n end",
"def index\n @meetings = Meeting.includes(:organization).order('date_and_time DESC')\n @grouped_meetings = @meetings.group_by(&:organization)\n end",
"def index\n @tournament_days = TournamentDay.all(:include => :tournament)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tournament_days }\n end\n end",
"def index\n @meeting_follow_ups = MeetingFollowUp.all\n end",
"def show\n @group = Group.find(params[:id])\n @meetups = Meetup.where(\"group_id = ?\", @group.id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @group }\n end\n end",
"def dashboard_meetings_with_http_info(from, to, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DashboardsApi.dashboard_meetings ...'\n end\n # verify the required parameter 'from' is set\n if @api_client.config.client_side_validation && from.nil?\n fail ArgumentError, \"Missing the required parameter 'from' when calling DashboardsApi.dashboard_meetings\"\n end\n # verify the required parameter 'to' is set\n if @api_client.config.client_side_validation && to.nil?\n fail ArgumentError, \"Missing the required parameter 'to' when calling DashboardsApi.dashboard_meetings\"\n end\n if @api_client.config.client_side_validation && opts[:'type'] && !['past', 'pastOne', 'live'].include?(opts[:'type'])\n fail ArgumentError, 'invalid value for \"type\", must be one of past, pastOne, live'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 300\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling DashboardsApi.dashboard_meetings, must be smaller than or equal to 300.'\n end\n\n # resource path\n local_var_path = '/metrics/meetings'\n\n # query parameters\n query_params = {}\n query_params[:'from'] = from\n query_params[:'to'] = to\n query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'next_page_token'] = opts[:'next_page_token'] if !opts[:'next_page_token'].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', 'application/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['OAuth']\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 => 'InlineResponse20026')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DashboardsApi#dashboard_meetings\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meeting }\n end\n end",
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meeting }\n end\n end",
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meeting }\n end\n end",
"def show\n @meal_meeting = MealMeeting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meal_meeting }\n end\n end",
"def index\n @participants = Participant.all\n\n respond_to do |format|\n format.html # index.html.erb\n #format.xml { render :xml => @participants }\n end\n end",
"def show\n @appointment = person.appointments.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @appointment }\n end\n end",
"def show\n if params.key?(:meetings_to_show)\n session[:meetings_to_show] = params[:meetings_to_show]\n end\n\n @meetings_to_show = session[:meetings_to_show] || MEETINGS_TO_SHOW_DEFAULT\n\n respond_to do |format|\n format.html { render :show }\n format.json { render json: @member }\n end\n end",
"def index\n @meant_it_rels = MeantItRel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @meant_it_rels }\n end\n end",
"def new\n @meeting = Meeting.new\n @all = User.all\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meeting }\n end\n end",
"def edit\n @meetings = current_user.meetings.all\n end"
] |
[
"0.73006713",
"0.7228295",
"0.7150945",
"0.71381956",
"0.70992327",
"0.70992327",
"0.70992327",
"0.70992327",
"0.70992327",
"0.70992327",
"0.7081934",
"0.70216846",
"0.7017986",
"0.69139695",
"0.68607235",
"0.678778",
"0.6680968",
"0.6652381",
"0.6564465",
"0.65491414",
"0.6488006",
"0.6469294",
"0.645667",
"0.64450896",
"0.6432258",
"0.63892376",
"0.6296053",
"0.6262783",
"0.6252948",
"0.62506115",
"0.62506115",
"0.62506115",
"0.6241228",
"0.6228632",
"0.6228632",
"0.6222751",
"0.621943",
"0.6172401",
"0.6171229",
"0.61700517",
"0.6166975",
"0.61452216",
"0.6137695",
"0.61286694",
"0.6117386",
"0.6116404",
"0.6112671",
"0.6090889",
"0.6067775",
"0.6059712",
"0.60544455",
"0.6046865",
"0.6033751",
"0.6016312",
"0.5997687",
"0.59950805",
"0.5977816",
"0.59629166",
"0.5947168",
"0.5925155",
"0.5922993",
"0.59206164",
"0.59053725",
"0.58854324",
"0.5869286",
"0.5867038",
"0.58642596",
"0.5857028",
"0.58436114",
"0.58315855",
"0.5831285",
"0.583109",
"0.5827273",
"0.58222073",
"0.57976097",
"0.5795644",
"0.5793976",
"0.57932097",
"0.5792226",
"0.5790138",
"0.57742834",
"0.5766481",
"0.57626885",
"0.57616866",
"0.5757285",
"0.5756246",
"0.57539093",
"0.5752518",
"0.57508194",
"0.5747207",
"0.57412577",
"0.57412577",
"0.57412577",
"0.57408947",
"0.57397896",
"0.5736842",
"0.5721947",
"0.57101077",
"0.5708423",
"0.5704404"
] |
0.75696325
|
0
|
GET /meetings/1 GET /meetings/1.xml
|
def show
@meeting = Meeting.find(params[:id])
if @meeting
@attendee = @meeting.attendee_with_user(current_user) || Attendee.new
@attendees = @meeting.attendees.find_all_by_rsvp("Yes")
end
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @meeting }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @meetings = Meeting.recent\n @past_meetings = Meeting.recent.past\n @upcoming_meetings = Meeting.upcoming\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @meetings }\n format.atom\n end\n end",
"def show\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n format.xml { render :xml => @meeting }\n end\n end",
"def index\n respond_to do |format|\n format.html { render action: 'index' } # index.html.erb\n format.json do\n out = meetings.per(500).map(&:to_json_attributes)\n out.each { |m| m[:url] = meeting_path(m[:url]) }\n render json: out\n end\n format.xml { render xml: meetings }\n end\n end",
"def index\n @meetings_results = MeetingsResult.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @meetings_results }\n end\n end",
"def show\n @meetings_result = MeetingsResult.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @meetings_result }\n end\n end",
"def get_meetings\n prepare\n @api.get_meetings\n end",
"def index\n #@meeting_assignments = Assignment.find_all_meetings\n @meeting_assignments = Assignment.find_all_meetings(@user.id, params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @meetings }\n end\n end",
"def show\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @meeting }\n end\n end",
"def show\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @person.to_xml }\n end\n end",
"def index\n @meetings = Meeting.paginate(:page => params[:page], :per_page => 20)\n\t\t@title = \"Spotkania\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @meetings }\n format.rss { render :layout => false }\n end\n end",
"def index\n @meetings = Meeting.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @meetings }\n end\n end",
"def index\n @meetings = Meeting.all\n end",
"def index\n @meetings = Meeting.all\n end",
"def index\n @meetings = Meeting.all\n end",
"def index\n @meetings = Meeting.all\n end",
"def index\n @meetings = Meeting.all\n end",
"def index\n @meetings = Meeting.all\n end",
"def list_meeting_attendee(meeting_id=nil)\n operation_name=\"List Attendee\"\n @id = meeting_id unless meeting_id.nil?\n xml_value= xml_meetings(@configuration, operation_name,@id)\n \n res = Net::HTTP.start(@configuration[:host]){ |http|\n http.post(\"/WBXService/XMLService\",xml_value)\n }\n xml_data = res.body\n meeting_data = Hash.new\n attend = Attendee.new\n meeting_data= attend.parse_xml(res.body)\n puts res.body\n return meeting_data\n end",
"def index\n @meetings = Meeting.all\nend",
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meeting }\n end\n end",
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meeting }\n end\n end",
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meeting }\n end\n end",
"def index\n\n @staticpage = Staticpage.find(:first, :conditions => [\"page_name = ?\", \"MeetingNotes\"]) \n \n @meetings = Meeting.find(:all, :order => [\"meeting_date desc\"])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @meetings }\n end\n end",
"def index\n @meetings_lists = MeetingsList.all\n end",
"def show\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meeting }\n end\n end",
"def show\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meeting }\n end\n end",
"def index\n @annual_meetings = AnnualMeeting.all\n end",
"def index\n @meetings = Meeting.all\n @users = User.all\n @atendees = Atendee.all\n @presentes = Presenter.all\n end",
"def index\n @users_meetings = UsersMeeting.all\n end",
"def show\n @request_meeting = RequestMeeting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @request_meeting }\n end\n end",
"def show\n @meeting = Meeting.find(params[:id])\n end",
"def meeting_get(*args)\n options = Zoom::Params.new(Utils.extract_options!(args))\n options.require(%i[meeting_id])\n Utils.parse_response self.class.get(\"/meetings/#{options[:meeting_id]}\", headers: request_headers)\n end",
"def show\n @meeting = Meeting.find(params[:id])\n\n end",
"def index\n\t\t@people = Person.all\n\t\t# respond_to do |format|\n\t\t# \tformat.xml { send_data @entries.to_xml, :type => 'text/xml; charset=UTF-8;', :disposition => 'attachment; filename=entries.xml'}\n\t\t# end\n\tend",
"def index\n\n if params[:meeting_id]\n @meeting = Meeting.find(params[:meeting_id])\n end\n\n respond_to do |f|\n f.json {\n @meetings = Meeting\n start_p = Time.parse(params[:start])\n end_p = Time.parse(params[:end])\n @meetings = @meetings.where(\"start_at > ?\", params[:start])\n if start_p and end_p\n duration = end_p - start_p\n @meetings = @meetings.where(\"duration < ?\", duration)\n end\n\n render :json => @meetings.map{|m|\n {\n :id => m.id,\n :title => m.label,\n :start => m.start_at,\n :end => m.end_at,\n :url => \"/reunions/#{m.id}.js\",\n color: '#D42700',\n textColor: 'white'\n }\n }\n }\n f.html\n end\n end",
"def index\n # # @meetings = Meeting.all\n # # Why check params for user_holder, but then using the root user one?\n # # I assume it is root user for now.\n # if params[:user_holder_id]\n # @cur_user_holder = current_user.user_holder\n # @meetings = @cur_user_holder.meetings\n # else\n # # No point to show all meeting.\n # @meetings = Meeting.all\n # end\n @pending_meetings = current_user.user_holder.meetings.where(status: \"pending\")\n @confirmed_meetings = current_user.user_holder.meetings.where(status: \"confirmed\")\n end",
"def upcoming_meetings(content, opts = {})\n cutoff = opts[:cutoff] || Time.now\n\n doc = Nokogiri::XML(content)\n\n meetings = {}\n\n doc.xpath(\"//item\").each do |item|\n\n # \"Austin City Council - 1/13/2011 10:00 AM\"\n title = item.xpath(\"title\").inner_text\n m = title.match(/(.*) - (.*)/)\n group = m[1]\n meeting_time = Time.strptime(m[2], \"%m/%d/%Y %I:%M %p\")\n\n # Consider only future meetings.\n next unless meeting_time > cutoff\n\n # There are some weird far future meetings in the feed.\n # Cut off stuff more than a year out.\n next if meeting_time > cutoff + (365*24*60*60)\n\n # \"https://austin.siretechnologies.com/sirepub/mtgviewer.aspx?meetid=576&doctype=AGENDA\"\n link = item.xpath(\"link\").inner_text\n m = link.match(/meetid=([\\d]+)/)\n meetid = m[1].to_i\n\n pubdate = Time.parse(item.xpath(\"pubDate\").inner_text)\n\n meetings[meetid] = SireAgenda::Meeting.new(meetid,\n :group => group,\n :meeting_time => meeting_time,\n :last_changed => pubdate,\n :sire => self,\n )\n\n end\n\n meetings\n end",
"def index\n @appointments = Appointment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @appointments }\n end\n end",
"def all_running_meetings\n bbb_server.get_meetings\n end",
"def index\n @rooms = Room.all\n @meetings = Meeting.all\n respond_to do |format|\n format.html\n format.ics do\n cal = Icalendar::Calendar.new\n @meetings.each do |meeting|\n event = Icalendar::Event.new\n event.dtstart = meeting.start_at\n event.dtend = meeting.end_at\n event.summary = meeting.notes\n event.description = meeting.room.name\n cal.add_event(event)\n end\n render :text => cal.to_ical\n end\n end\n end",
"def show\n @appointment = person.appointments.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @appointment }\n end\n end",
"def new\n @meeting = Meeting.new\n @statuses = get_status_dropdown\n @categories = get_category_dropdown\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meeting }\n end\n end",
"def timeline\n @bookings = Booking.find_waiting_pickup\n respond_to do |format|\n format.xml\n end\n end",
"def index\n @meetings = Meeting.for_school(@_current_school).paginate(page: params[:page], per_page: 50)\n end",
"def index\n @site = Site.first\n @meetup_info = @site.meetup_info\n @meetups = Meetup.coming_soon\n end",
"def reports_meetings\n @reports_meetings = Meeting.all\n end",
"def show\n @users_meetings = UsersMeeting.where(meeting_id_id: @meeting.id)\n end",
"def index\n\n @meetings = Meeting.joins(:company).where(Company.table_name => {:id => current_operator.company.id})\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @meetings }\n end\n end",
"def index\n @meetusers = Meetuser.all\n end",
"def show\n\n \n @meet = Meet.find(params[:id])\n @track = @meet.track\n @cards = @meet.cards\n @comments = @meet.comments\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meet }\n end\n end",
"def set_meetings_list\n @meetings_list = MeetingsList.find(params[:id])\n end",
"def show\n @users_meeting = UsersMeeting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @users_meeting }\n end\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 if current_user.usertype == \"superadmin\"\n @meetings = Meeting.all\n elsif params[:type] == nil\n @meetings = Meeting.find(:all, :conditions => [\"user_id = ? \", session[:user_id]] )#you are student\n elsif params[:type]=='pending' #meeting requested by the current user\n @meetings = Meeting.find(:all, :conditions=> [\"accept =0 and status = 0 and (tutor_id = ? or user_id = ?)\", session[:tutor_id], session[:user_id]])\n elsif params[:type]=='past'#meeting you attended in the past\n @meetings = Meeting.find(:all, :conditions=> [\"(tutor_id = ? OR user_id = ? )and status >= ?\", session[:tutor_id], session[:user_id], 3])\n elsif params[:type]=='attending' #meeting list that you will be attending(accepted, paid)\n @meetings = Meeting.find(:all, :conditions => ['(user_id = ? or tutor_id = ?) AND status = ? AND paid = ?', session[:user_id],session[:tutor_id], 1, true])\n else\n @meetings = Meeting.find(:all, :conditions => ['(user_id = ? or tutor_id = ?) AND status = ? AND paid = ?', session[:user_id],session[:tutor_id], 1, true])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @meetings }\n end\n end",
"def tournaments\n get('sports/en/tournaments.xml')\n end",
"def show\n \n @meetup = Meetup.find(params[:id])\n render json: {\n meetup: MeetupSerializer.new(@meetup)\n }\n end",
"def show\n @meetup = Meetup.find_by(id: params[:id])\n end",
"def index\n @meetings = Meeting.all(:order => \"date\")\n end",
"def show\n @meeting = Meeting.find(params[:id])\n @user = User.find_by_watiam(session[:cas_user])\n\n @allattendees = Attendee.where(:meeting_id => @meeting.id).all\n @allattendees.find(:sort => 'weight')\n @allusers = []\n \n \n #creates array of users that are attending the meeting\n @allattendees.each do |attendee|\n @userall = User.find(:first, :conditions => {:id => attendee.user_id})\n @allusers << @userall\n end\n \n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meeting }\n end\n end",
"def index\n @attendees = Attendee.paginate(:page => params[:page], :per_page => 40)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @attendees }\n end\n end",
"def index\n render json: meeting.all\n end",
"def show\n #head :status => 405\n #return\n \n @participant = Participant.find(params[:id])\n \n # debugging\n #@meeting = Meeting.find(@participant.meeting_id)\n #send_invitation\n\n respond_to do |format|\n format.html # show.html.erb\n #format.xml { render :xml => @participant }\n end\n end",
"def index\n @meetups = Meetup.all\n @tags = Tag.all\n @tagmeetups = Tagmeetup.all\n\n end",
"def show\n set_room\n @rooms= Room.all\n @meetings = Meeting.where(:room_id => @room.id)\n @meeting = Meeting.new\n @ics_route = \"/rooms/#{ @room.id.to_s }.ics\"\n respond_to do |format|\n format.html\n format.ics do\n cal = Icalendar::Calendar.new\n @meetings.each do |meeting|\n event = Icalendar::Event.new\n event.dtstart = meeting.start_at\n event.dtend = meeting.end_at\n event.summary = meeting.notes\n event.description = meeting.room.name\n cal.add_event(event)\n end\n render :text => cal.to_ical\n end\n end\n end",
"def show\n @fetmeeting = Fetmeeting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fetmeeting }\n end\n end",
"def show\n @meeting_point = MeetingPoint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meeting_point }\n end\n end",
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meeting }\n end\n end",
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meeting }\n end\n end",
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meeting }\n end\n end",
"def show\n @group = Group.find(params[:id])\n @meetups = Meetup.where(\"group_id = ?\", @group.id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @group }\n end\n end",
"def pending_meets \n assert_internal_error(@user)\n @pending_meets = @user.true_pending_meets\n respond_to do |format|\n format.html {\n # redirect back to user meets view if no more pending meets\n if @pending_meets.empty?\n redirect_back user_meets_path(@user)\n else\n @pending_meets = @pending_meets.paginate(:page => params[:page], :per_page => 25)\n attach_meet_infos(current_user, @pending_meets, true)\n end\n }\n format.json {\n cursor = params[:cursor] || params\n @pending_meets = @pending_meets.cursorize(cursor,\n :only=>[:time, :created_at, :updated_at, :lat, :lng])\n attach_meet_infos(current_user, @pending_meets, true)\n @pending_meets.each {|meet|\n meet.friends_name_list_params = {:except=>current_user,:delimiter=>\", \",:max_length=>80}\n }\n render :json => @pending_meets.to_json(MeetsController::JSON_PENDING_MEET_LIST_API)\n }\n end\n end",
"def index\n @click_to_talks = ClickToTalk.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @click_to_talks }\n end\n end",
"def index\n @goals = Goal.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @goals }\n end\n end",
"def show\n @meal_meeting = MealMeeting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meal_meeting }\n end\n end",
"def index\n @invite_requests = InviteRequest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @invite_requests }\n end\n end",
"def index\n @participants = Participant.all\n\n respond_to do |format|\n format.html # index.html.erb\n #format.xml { render :xml => @participants }\n end\n end",
"def index\n @talks = @venue.talks\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @talks }\n format.json { render :json => @talks }\n end\n end",
"def show\n @today_activity = TodayActivity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @today_activity }\n end\n end",
"def index\n @meetings = User.find(params[:user_id]).meetings\n #@meetings = Array.new\n Meeting.all.each do |m|\n if m.user_id == current_user.id\n @meetings.push(m)\n end\n end\n end",
"def fetch_meetings\n response = self.api.get_meetings\n\n # updates the information in the rooms that are currently in BBB\n @meetings = []\n response[:meetings].each do |attr|\n room = BigbluebuttonRoom.find_by_server_id_and_meetingid(self.id, attr[:meetingID])\n if room.nil?\n room = BigbluebuttonRoom.new(:server => self, :meetingid => attr[:meetingID],\n :name => attr[:meetingID], :attendee_password => attr[:attendeePW],\n :moderator_password => attr[:moderatorPW], :external => true,\n :randomize_meetingid => false, :private => true)\n else\n room.update_attributes(:attendee_password => attr[:attendeePW],\n :moderator_password => attr[:moderatorPW])\n end\n room.running = attr[:running]\n\n @meetings << room\n end\n end",
"def show\n @meeting_member = MeetingMember.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @meeting_member }\n end\n end",
"def index\n @chat_rooms = ChatRoom.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @chat_rooms }\n end\n end",
"def new\n @iteration = Iteration.find(params[:iteration_id])\n @project = @iteration.project\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meeting }\n end\n end",
"def index\n @friend_invites = FriendInvite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friend_invites }\n end\n end",
"def index\n @meant_it_rels = MeantItRel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @meant_it_rels }\n end\n end",
"def index\n @friend_requests = FriendRequest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friend_requests }\n end\n end",
"def index\n @friend_requests = FriendRequest.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friend_requests }\n end\n end",
"def show\n @agile_task = AgileTask.find(params[:id])\n\n respond_to do |format|\n format.xml { render :xml => @agile_task }\n end\n end",
"def fetch_meeting_info\n begin\n server = BigbluebuttonRails.configuration.select_server.call(self, :get_meeting_info)\n response = server.api.get_meeting_info(self.meetingid, self.moderator_api_password)\n\n @participant_count = response[:participantCount]\n @moderator_count = response[:moderatorCount]\n @has_been_forcibly_ended = response[:hasBeenForciblyEnded]\n @end_time = response[:endTime]\n @current_attendees = []\n if response[:attendees].present?\n response[:attendees].each do |att|\n attendee = BigbluebuttonAttendee.new\n attendee.from_hash(att)\n @current_attendees << attendee\n end\n end\n\n # a 'shortcut' to update meetings since we have all information we need\n # if we got here, it means the meeting is still in the server, so it's not ended\n update_current_meeting_record(response, true)\n\n rescue BigBlueButton::BigBlueButtonException => e\n # note: we could catch only the 'notFound' error, but there are complications, so\n # it's better to end the meeting prematurely and open it again if needed than to\n # not end it at all (e.g. in case the server stops responding)\n Rails.logger.info \"BigbluebuttonRoom: detected that a meeting ended in the room #{self.meetingid} after the error #{e.inspect}\"\n\n finish_meetings\n end\n\n response\n end",
"def count_meetings\n # TODO respond with xml, only if valid session, otherwise return nil\n team = Team.find_by_id( params[:id] )\n if team\n render json: team.meetings.collect{|row| row.id}.uniq.size\n else\n render json: 0\n end\n end",
"def get_possible_meetings( query )\n meetings = MeetingFinder.new( params[:query] ).search()\n meetings.each do |meeting|\n @result << {\n class: 'Meeting',\n id: meeting.id,\n description: meeting.get_scheduled_date_with_verbose_name,\n date: meeting.get_scheduled_date ? meeting.get_scheduled_date : meeting.header_date\n }\n end\n meetings\n end",
"def index\n @people = Person.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @people }\n end\n end",
"def index\n @people = Person.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @people }\n end\n end",
"def index\n @people = Person.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @people }\n end\n end",
"def get_listings_xml(url)\n @client.get_content(url)\n end",
"def show\n @exibitor = Exibitor.find(params[:id])\n @exibitormeetings = @exibitor.sponsor.meeting\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exibitor }\n end\n end",
"def index\n @type_of_meetings = TypeOfMeeting.all\n end",
"def index\n @meet_up_comments = MeetUpComment.in_conference(current_conference).all\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"def index\n @user = User.find(params[:user_id])\n @mycontact = Mycontact.find(params[:mycontact_id])\n if @mycontact\n @meetings = @mycontact.meetings\n else\n @meetings = Meeting.all\n end\n end",
"def emit_meeting(cur_mtg_dir, svn_mtg_dir, dt, num_members, quorum_need, num_proxies, attend_irc)\n _div id: \"meeting-#{dt.year}\"\n _whimsy_panel(\"All Meeting Details for #{dt.strftime(DTFORMAT)}\", style: 'panel-info') do\n if Time.now > dt\n _p do\n _ 'At the time of this past meeting, we had:'\n _ul do\n _li \"#{num_members} eligible voting Members,\"\n _li \"#{quorum_need} needed for quorum (one third),\"\n _li \"#{num_proxies} proxy assignments available for the meeting,\"\n _li \"And hoped that at least #{attend_irc} would attend the start of meeting.\"\n end\n attendees_file = File.join(cur_mtg_dir, 'attend')\n if File.exist?(attendees_file)\n attendees = File.readlines(attendees_file)\n _ \"By the end of the meeting, we had a total of #{attendees.count} Members participating (either via attending IRC, sending a proxy, or voting via email)\"\n else\n _p.alert.alert_danger do\n _span \"Unable to calculate participating members (\"\n _code \"attend\"\n _span \"file does not yet exist for meeting)\"\n end\n end\n end\n _p \"These are historical links to the past meeting's record.\"\n else\n _p \"Live links to the upcoming meeting records/ballots/how-tos are below.\"\n end\n _ul do\n ASF::MeetingUtil::MEETING_FILES.each do |f, desc|\n _li do\n emit_link(svn_mtg_dir, f, desc)\n end\n end\n end\n end\nend"
] |
[
"0.7432931",
"0.7222755",
"0.7093803",
"0.6994988",
"0.69380337",
"0.69144934",
"0.6865746",
"0.6850136",
"0.68181527",
"0.6812334",
"0.67647654",
"0.6715466",
"0.6715466",
"0.6715466",
"0.6715466",
"0.6715466",
"0.6715466",
"0.66911983",
"0.6554662",
"0.645799",
"0.645799",
"0.645799",
"0.6279804",
"0.62157494",
"0.6207949",
"0.6207949",
"0.61787105",
"0.61125237",
"0.6097102",
"0.6095103",
"0.60836744",
"0.6060435",
"0.60442615",
"0.604225",
"0.60289955",
"0.602528",
"0.6017875",
"0.6013104",
"0.5989782",
"0.5986053",
"0.5973328",
"0.5961881",
"0.5952571",
"0.59478647",
"0.5939942",
"0.5919092",
"0.59101355",
"0.5910009",
"0.5902783",
"0.5899378",
"0.5896473",
"0.58811474",
"0.58782446",
"0.58733934",
"0.5871162",
"0.586913",
"0.5864403",
"0.58502394",
"0.5816365",
"0.58039135",
"0.58017135",
"0.5797379",
"0.5792953",
"0.5769465",
"0.5764159",
"0.57542574",
"0.575173",
"0.575173",
"0.575173",
"0.5750244",
"0.5740887",
"0.5740028",
"0.5737811",
"0.5717852",
"0.5712992",
"0.57102287",
"0.570973",
"0.5694073",
"0.56794137",
"0.5678725",
"0.56713927",
"0.566742",
"0.5666494",
"0.56617886",
"0.56510836",
"0.565066",
"0.56446743",
"0.5642562",
"0.5641909",
"0.5631992",
"0.56250215",
"0.56086415",
"0.56086415",
"0.56086415",
"0.56081456",
"0.5605403",
"0.5603793",
"0.5597342",
"0.55942476",
"0.5586644"
] |
0.6378646
|
22
|
GET /meetings/new GET /meetings/new.xml
|
def new
@meeting = Meeting.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @meeting }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meeting }\n end\n end",
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meeting }\n end\n end",
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meeting }\n end\n end",
"def new\n @meeting = Meeting.new\n @statuses = get_status_dropdown\n @categories = get_category_dropdown\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meeting }\n end\n end",
"def new\n @request_meeting = RequestMeeting.new params[:request_meeting]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request_meeting }\n end\n end",
"def new\n @iteration = Iteration.find(params[:iteration_id])\n @project = @iteration.project\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meeting }\n end\n end",
"def new\n @people = People.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @people }\n end\n end",
"def new\n @today_activity = TodayActivity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @today_activity }\n end\n end",
"def new\n @livingroom = Livingroom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @livingroom }\n end\n end",
"def new\n head :status => 405\n return\n \n @participant = Participant.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.xml { render :xml => @participant }\n end\n end",
"def new\n @users_meeting = UsersMeeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @users_meeting }\n end\n end",
"def new\n @monkey = Monkey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @monkey }\n end\n end",
"def new\n @meeting_member = MeetingMember.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @meeting_member }\n end\n end",
"def new\n @click_to_talk = ClickToTalk.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @click_to_talk }\n end\n end",
"def new\r\n @meeting_type = MeetingType.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @meeting_type }\r\n end\r\n end",
"def new\n @meal_meeting = MealMeeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meal_meeting }\n end\n end",
"def new\n @appointment = Appointment.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @appointment }\n end\n end",
"def new\n @appointment = Appointment.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @appointment }\n end\n end",
"def new\n @appointment = Appointment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @appointment }\n end\n end",
"def new\n @appointment = Appointment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @appointment }\n end\n end",
"def new\n @appointment = person.appointments.build\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @appointment }\n end\n end",
"def new\n @thing = Thing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thing }\n end\n end",
"def new\n @goaltemplate = Goaltemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @goaltemplate }\n end\n end",
"def create\n respond_to do |format|\n if meeting.save\n format.html { redirect_to( meeting, flash: { success: 'Meeting created.' } ) }\n format.xml { render xml: meeting, status: :created, location: meeting }\n else\n format.html { render action: \"new\" }\n format.xml { render xml: meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @tournaments = Tournament.all\n @tournament_day = TournamentDay.new\n\n respond_to do |format|\n format.html # new.rb\n format.xml { render :xml => @tournament_day }\n end\n end",
"def new\n @appointment_request = AppointmentRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @appointment_request }\n end\n end",
"def new\n @the_day = TheDay.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @the_day }\n end\n end",
"def new\n @activity = Activity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @activity }\n end\n end",
"def new\n @activity = Activity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @activity }\n end\n end",
"def new\n @activity = Activity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @activity }\n end\n end",
"def new\n @activity = Activity.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @activity }\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 @participant = Participant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @participant }\n end\n end",
"def new\n @participant = Participant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @participant }\n end\n end",
"def new\n @participant = Participant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @participant }\n end\n end",
"def create\n @meeting = Meeting.new(params[:meeting])\n\n respond_to do |format|\n if @meeting.save\n flash[:notice] = 'Meeting was successfully created.'\n format.html { redirect_to(@meeting) }\n format.xml { render :xml => @meeting, :status => :created, :location => @meeting }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @appointment }\n format.json { render :json => @appointment }\n end\n end",
"def new\n @peep = Peep.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @peep }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @participant }\n end\n end",
"def new\n @meeting_location = MeetingLocation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meeting_location }\n end\n end",
"def new\n @goal = Mg::Goal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @goal }\n end\n end",
"def create\n @meeting = Meeting.new(params[:meeting])\n\n respond_to do |format|\n if @meeting.save\n flash[:notice] = 'Meeting creato con successo.'\n format.html { redirect_to(@meeting) }\n format.xml { render :xml => @meeting, :status => :created, :location => @meeting }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @meetings = Meeting.recent\n @past_meetings = Meeting.recent.past\n @upcoming_meetings = Meeting.upcoming\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @meetings }\n format.atom\n end\n end",
"def new\n @evactivity = Evactivity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @evactivity }\n end\n end",
"def new\n @meeting = Meeting.new\n @all = User.all\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meeting }\n end\n end",
"def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"def new\n @work_day = WorkDay.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @work_day }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @task }\n end\n end",
"def new\n @room = Room.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @room }\n end\n end",
"def new\n @room = Room.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @room }\n end\n end",
"def new\n @viewing = Viewing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @viewing }\n end\n end",
"def new\n @meal = Meal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @meal }\n end\n end",
"def new\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @participant }\r\n end\r\n end",
"def new\n @new_employee_request = NewEmployeeRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @new_employee_request }\n end\n end",
"def new\n @mailing = Mailing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mailing }\n end\n end",
"def new\n @travel = Travel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @travel }\n end\n end",
"def new\n @travel = Travel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @travel }\n end\n end",
"def new\n @schedule = Schedule.new\n @apps = App.find(:all)\n @tags = Contact.get_tags\n\n respond_to do |format|\n format.html # new.haml\n format.xml { render :xml => @schedule }\n end\n end",
"def new\n @page = Page.new(:status => params[:from])\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 @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 @now = Time.zone.now\n @now = @now.change(:hour=>18, :min=>0, :sec=>0)\n @meeting = Meeting.new(:datetime=>@now)\n\t\t@alltopics = Topic.where(:meeting_id => nil)\n\t\t@title = \"Nowe spotkanie\"\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meeting }\n end\n end",
"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 @telecom_room = TelecomRoom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @telecom_room }\n end\n end",
"def new\n @game = Game.new\n @participants = Participant.find_all_by_meeting_id(@meeting.id)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @game }\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 @task = Task.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @task }\n format.xml { render xml: @tasks }\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\t\t@customers = Customer.joins(:company) \\\n .where(Company.table_name => {:id => current_operator.company.id}) \\\n .order(\"lastName ASC, firstName ASC\")\n\t\t@operators = Operator.joins(:company).where(Company.table_name => {:id => current_operator.company.id})\n\n\t\t@meeting = Meeting.new\n\t\tif @start != nil then\n\t\t\t@meeting.start = @start if @start != nil\n\t\tend\n\t\tif @end != nil then\n\t\t\t@meeting.end = @end \n\t\tend\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meeting }\n end\n end",
"def new\n @diet = Diet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @diet }\n end\n end",
"def new\n @ep = Ep.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ep }\n end\n end",
"def new\n @todos = Todos.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @todos }\n end\n end",
"def new\n @meal = Meal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meal }\n end\n end",
"def new\n @thing_list = ThingList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thing_list }\n end\n end",
"def new\n @chat_room = ChatRoom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @chat_room }\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 @event = Event.new_default\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def create\n\t@meeting = Meeting.create(params[:meeting])\n \n print \"URL\", url_for(@meeting) + \"?key=\" + @meeting.uuid\n\tredirect_to url_for(@meeting) + \"?key=\" + @meeting.uuid\n end",
"def new\n @person = Person.new\n @title = \"people\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @job }\n end\n end",
"def new\n @waypoint = Waypoint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @waypoint }\n end\n end",
"def new\n @invite_request = InviteRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invite_request }\n end\n end",
"def new\n @event = Event.new(:time_slots => @conference.default_timeslots)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def new\n @invite = Invite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invite }\n end\n end",
"def new\n @attender = Attender.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @attender }\n end\n end",
"def new\n @bday = Bday.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bday }\n end\n end",
"def new\n @webinar = Webinar.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @webinar }\n end\n end",
"def new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @finish }\n end\n end"
] |
[
"0.7177989",
"0.7177989",
"0.7177989",
"0.7172814",
"0.69502544",
"0.68651795",
"0.68575746",
"0.68321866",
"0.67510706",
"0.672825",
"0.67152536",
"0.66885686",
"0.66578853",
"0.66542256",
"0.6652893",
"0.66417617",
"0.6626984",
"0.6626984",
"0.66234565",
"0.66234565",
"0.66051745",
"0.6602449",
"0.65988123",
"0.65960574",
"0.65930915",
"0.6591005",
"0.6585844",
"0.65745354",
"0.65745354",
"0.65745354",
"0.657362",
"0.65724295",
"0.6567469",
"0.6567469",
"0.6567469",
"0.65570366",
"0.65398985",
"0.6539797",
"0.65375644",
"0.65322864",
"0.65304136",
"0.6513716",
"0.6507928",
"0.64906114",
"0.6488128",
"0.648767",
"0.648767",
"0.648767",
"0.648767",
"0.648767",
"0.648767",
"0.648767",
"0.648767",
"0.648767",
"0.648767",
"0.6477221",
"0.6474154",
"0.64731854",
"0.64731854",
"0.647292",
"0.6468403",
"0.6465714",
"0.64592266",
"0.64581996",
"0.6455913",
"0.6455913",
"0.6448286",
"0.64442325",
"0.6443974",
"0.6443974",
"0.6443974",
"0.6440319",
"0.64381707",
"0.642677",
"0.6424448",
"0.6422078",
"0.64195645",
"0.6403805",
"0.6396599",
"0.63954383",
"0.6393104",
"0.6390761",
"0.638175",
"0.638047",
"0.6379297",
"0.6379285",
"0.6371303",
"0.6370873",
"0.636628",
"0.6365852",
"0.6365442",
"0.63640785",
"0.636207",
"0.63564074",
"0.6355467",
"0.6353826",
"0.6353072",
"0.63493764"
] |
0.7672542
|
1
|
POST /meetings POST /meetings.xml
|
def create
@meeting = Meeting.new(params[:meeting])
respond_to do |format|
if @meeting.save
flash[:notice] = 'Meeting was successfully created.'
format.html { redirect_to(@meeting) }
format.xml { render :xml => @meeting, :status => :created, :location => @meeting }
else
format.html { render :action => "new" }
format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @meeting = current_user.meetings.new(meeting_params)\n new_event(@meeting)\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to new_event_path, notice: 'Meeting was successfully created.' }\n else\n format.html { render :new }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @meeting = Meeting.new(params[:meeting])\n\n respond_to do |format|\n if @meeting.save\n flash[:notice] = 'Meeting creato con successo.'\n format.html { redirect_to(@meeting) }\n format.xml { render :xml => @meeting, :status => :created, :location => @meeting }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n respond_to do |format|\n if meeting.save\n format.html { redirect_to( meeting, flash: { success: 'Meeting created.' } ) }\n format.xml { render xml: meeting, status: :created, location: meeting }\n else\n format.html { render action: \"new\" }\n format.xml { render xml: meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @meeting = Meeting.new(params[:meeting])\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to meetings_path, notice: 'Meeting was successfully created.' }\n format.json { render json: @meeting, status: :created, location: @meeting }\n else\n format.html { render action: \"new\" }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @meeting = Meeting.new(params[:meeting])\n @iteration = Iteration.find(params[:meeting][:iteration_id])\n respond_to do |format|\n if developer?\n if @meeting.save\n flash[:notice] = 'Meeting was successfully created.'\n format.html do \n \n params[:users].each do |uid|\n user = User.find(uid)\n MeetingParticipant.create(:user => user, :meeting => @meeting)\n end if params.key? :users\n \n redirect_to(iteration_stories_url(@iteration))\n end\n format.xml { render :xml => @meeting, :status => :created, :location => @meeting }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }\n end\n else\n format.xml { render :xml => XML_ERRORS[:not_authorized] }\n end\n end\n end",
"def create\n\n @meeting = Meeting.new(meeting_params)\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to meetings_path, notice: 'La réunion a bien été ajoutée.' }\n format.json { render :show, status: :created, location: @meeting }\n else\n format.html { render :new }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @meeting = Meeting.new(meeting_params)\n @meeting.checked_out_participant_count = 0\n @meeting.participant_count ||= 0\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n format.json { render action: 'show', status: :created, location: @meeting }\n else\n format.html { render action: 'new' }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @meetup = Meetup.new(meetup_params)\n @meetup.on_ranking = true\n authorize @meetup\n respond_to do |format|\n if @meetup.save\n @meetup.sessions.create(location_id: Location.where(active: true).first.id)\n @activity = @meetup.create_activity(current_user.id)\n @notifications = @activity.create_notification\n @meetup.holdings.create(user_id: current_user.id)\n notify_collaborators\n format.html { redirect_to meetup_path(@meetup) }\n format.json do\n render :show,\n status: :created, location: @meetup\n end\n else\n format.html { render :new }\n format.json do\n render json: @meetup.errors,\n status: :unprocessable_entity\n end\n end\n end\n end",
"def create\n @meeting = Meeting.new(meeting_params)\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to meeting_path(@meeting), notice: 'Meeting was successfully created.' }\n format.json { render :show, status: :created, location: @meeting }\n else\n format.html { render :new }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @meeting = Meeting.new(meeting_params)\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n format.json { render :show, status: :created, location: @meeting }\n else\n format.html { render :new }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @meeting = Meeting.new(meeting_params)\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to weekly_calendar_url, notice: 'Meeting was successfully created.' }\n format.json { render json: @meeting, status: :created, location: @meeting }\n else\n format.html { render action: \"new\" }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @meeting = Meeting.new(meeting_params)\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n format.json { render :show, status: :created, location: @meeting }\n else\n format.html { render :new }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def create\n @user = current_user\n @meeting = current_user.meetings.build(meeting_params)\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to root_path, notice: 'Enhorabuena! Tienes una nueva reunion.' }\n format.json { render :show, status: :created, location: @meeting }\n else\n format.html { render :new }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @meeting = Meeting.new(meeting_params)\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n format.json { render :show, status: :created, location: @meeting }\n else\n format.html { render :new }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n\n create_meetings_topics(@meeting)\n end",
"def create\n\t@meeting = Meeting.create(params[:meeting])\n \n print \"URL\", url_for(@meeting) + \"?key=\" + @meeting.uuid\n\tredirect_to url_for(@meeting) + \"?key=\" + @meeting.uuid\n end",
"def create\n @meeting = Meeting.new(meeting_params)\n\n # respond_to do |format|\n # if @meeting.save\n # format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n # format.json { render :show, status: :created, location: @meeting }\n # else\n # format.html { render :new }\n # format.json { render json: @meeting.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def create\n @meeting = Meeting.new(create_params)\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n format.json { render :show, status: :created, location: @meeting }\n else\n format.html { render :new }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n add_user_meeting_relation\n end",
"def create\n @meeting = Meeting.new(meeting_params)\n @meeting.user_id = current_user.id\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to user_meetings_path, notice: 'Meeting was successfully created.' }\n format.json { render :show, status: :created, location: @meeting }\n else\n format.html { render :new }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @meet = Meet.new(params[:meet])\n @meet.site_id = @site.id\n respond_to do |format|\n if @meet.save\n format.html { redirect_to @meet, notice: 'Meet was successfully created.' }\n format.json { render json: @meet, status: :created, location: @meet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @meet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @meeting.add_new_participant(@participant)\n respond_to do |format|\n if @participant.save && @meeting.save\n flash[:notice] = 'Participant and meeting updates were successfully created.'\n format.html { redirect_to(meeting_path(@meeting)) }\n format.xml { render :xml => @participant, :status => :created, :location => @participant }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @participant.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @meetings_list = MeetingsList.new(meetings_list_params)\n\n respond_to do |format|\n if @meetings_list.save\n format.html { redirect_to @meetings_list, notice: 'Die Meeting-Liste wurde erfolgreich erstellt.' }\n format.json { render :show, status: :created, location: @meetings_list }\n else\n format.html { render :new }\n format.json { render json: @meetings_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @meeting = Meeting.new(meeting_params)\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to root_path, flash: {success: 'Meeting was successfully created.'} }\n format.json { render :show, status: :created, location: @meeting }\n else\n format.html { redirect_to new_meeting_path, flash: {danger: \"Unable to create meeting. \" + @meeting.errors.full_messages.join('. ')} }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def list_meeting_attendee(meeting_id=nil)\n operation_name=\"List Attendee\"\n @id = meeting_id unless meeting_id.nil?\n xml_value= xml_meetings(@configuration, operation_name,@id)\n \n res = Net::HTTP.start(@configuration[:host]){ |http|\n http.post(\"/WBXService/XMLService\",xml_value)\n }\n xml_data = res.body\n meeting_data = Hash.new\n attend = Attendee.new\n meeting_data= attend.parse_xml(res.body)\n puts res.body\n return meeting_data\n end",
"def save\n if new_record?\n overwrite @api.post(\"/meetings.json\", writeable_attributes)\n else\n overwrite @api.put(\"/meetings/#{shortcode_url}.json\",\n writeable_attributes)\n end\n end",
"def meeting_params\n params.require(:meeting).permit(:name, :date, :s_time, :e_time, :room_id, :attending, user_ids: [])\n end",
"def create\n @request_meeting = RequestMeeting.new(params[:request_meeting])\n @request_meeting.user = current_user\n respond_to do |format|\n if @request_meeting.save\n format.html { redirect_to @request_meeting, notice: 'Заявка подана. Ожидается подтверждение администратором' }\n format.json { render json: @request_meeting, status: :created, location: @request_meeting }\n else\n format.html { render action: \"new\" }\n format.json { render json: @request_meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meeting }\n end\n end",
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meeting }\n end\n end",
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meeting }\n end\n end",
"def create\n @users_meeting = UsersMeeting.new(params[:users_meeting])\n\n respond_to do |format|\n if @users_meeting.save\n format.html { redirect_to @users_meeting, notice: 'Users meeting was successfully created.' }\n format.json { render json: @users_meeting, status: :created, location: @users_meeting }\n else\n format.html { render action: \"new\" }\n format.json { render json: @users_meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.find(params[:user_id])\n @mycontact = Mycontact.find(params[:mycontact_id])\n @meeting = @mycontact.meetings.new(meeting_params)\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to user_mycontact_meetings_path, notice: 'Meeting was successfully created.' }\n format.json { render action: 'show', status: :created, location: @meeting }\n else\n format.html { render action: 'new' }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @rooms = Room.all\n @users = User.all\n @meeting = Meeting.new(meeting_params)\n @meeting.users << current_user\n \n respond_to do |format|\n if @meeting.save\n EventMailer.with(meeting: @meeting, users: @meeting.users.map {|u| u}).new_meeting_email.deliver_now\n format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n format.json { render :show, status: :created, location: @meeting }\n else\n format.html { render :new }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @meeting = Meeting.new(meeting_params)\n @meeting.created_by = current_user.id\n @meeting.users << current_user\n @meeting.users << User.find(params[:teacher_id])\n\n respond_to do |format|\n if @meeting.save && @meeting.date > DateTime.now\n format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n format.json { render :show, status: :created, location: @meeting }\n elsif @meeting.date <= DateTime.now\n format.html { redirect_to '/meetings/new', alert: 'You cannot create a meeting in the past.' }\n else\n format.html { render :new }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @meetings = Meeting.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @meetings }\n end\n end",
"def create\n @meeting_member = MeetingMember.new(params[:meeting_member])\n\n respond_to do |format|\n if @meeting_member.save\n format.html { redirect_to @meeting_member, :notice => 'Meeting member was successfully created.' }\n format.json { render :json => @meeting_member, :status => :created, :location => @meeting_member }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @meeting_member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @users_meeting = UsersMeeting.new(users_meeting_params)\n\n respond_to do |format|\n if @users_meeting.save\n format.html { redirect_to @users_meeting, notice: 'Users meeting was successfully created.' }\n format.json { render :show, status: :created, location: @users_meeting }\n else\n format.html { render :new }\n format.json { render json: @users_meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n respond_to do |format|\n format.html { render action: 'index' } # index.html.erb\n format.json do\n out = meetings.per(500).map(&:to_json_attributes)\n out.each { |m| m[:url] = meeting_path(m[:url]) }\n render json: out\n end\n format.xml { render xml: meetings }\n end\n end",
"def index\n @meetings = Meeting.all\n end",
"def index\n @meetings = Meeting.all\n end",
"def index\n @meetings = Meeting.all\n end",
"def index\n @meetings = Meeting.all\n end",
"def index\n @meetings = Meeting.all\n end",
"def index\n @meetings = Meeting.all\n end",
"def create\n @team = Team.find(params[:team_id])\n @meeting = @team.meetings.new(meeting_params)\n\n respond_to do |format|\n if @meeting.save\n format.js {render json: @meeting.id}\n format.json { render :show, status: :created, location: @meeting }\n format.html { redirect_to team_meeting_path(@team, @meeting), notice: 'הפגישה נוצרה בהצלחה.' }\n else\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n format.js\n format.html { render :new }\n end\n end\n end",
"def create\n @title = \"ミーティング登録\"\n @catch_phrase = \" 新規にミーティングを登録します。\"\n @notice = \"\"\n @meeting = Meeting.new(params[:meeting])\n @projects = Project.where(\"id > 0\").order(\"name ASC\")\n @users = User.where(\"id > 0\").where(\"available=TRUE\").order(\"user_name ASC\")\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to @meeting, notice: '作成が完了しました!' }\n format.json { render json: @meeting, status: :created, location: @meeting }\n else\n format.html { render action: \"new\" }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @meeting = Meeting.new(params[:meeting])\n\n @meeting.user = @current_user\n @meeting.location = Location.find(params[:location])\n \n if u = params[:name]\n u.sub(/,$/,'').split(',').each{|a| @meeting.people << Person.find(a)}\n end\n if t = params[:time]\n if t =~ /m/\n @meeting.duration = 60*t.to_i\n elsif t =~ /h/\n @meeting.duration = 3600*t.to_i\n end\n end\n \n respond_to do |format|\n if @meeting.save\n format.html do\n # redirect_to(@meeting)\n render :partial => @meeting\n end\n format.xml { render :xml => @meeting, :status => :created, :location => @meeting }\n format.json { render :text => {\"name\" => @meeting.people.map(&:name).join(\", \"), \"time_str\" => @meeting.time_str}.to_json }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }\n format.json { render :text => {\"error\" => \"could not save\"}.to_json }\n end\n end\n end",
"def set_meetings_list\n @meetings_list = MeetingsList.find(params[:id])\n end",
"def create\n @fetmeeting = Fetmeeting.new(params[:fetmeeting])\n\n respond_to do |format|\n if @fetmeeting.save\n format.html { redirect_to @fetmeeting, notice: 'Fetmeeting was successfully created.' }\n format.json { render json: @fetmeeting, status: :created, location: @fetmeeting }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fetmeeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def meeting_params\n params.require(:meeting).permit(:meeting, :user_id, :mycontact_id, :name)\n end",
"def publish\n respond_to do |format|\n if request.method_symbol == :get\n meeting.publish_defaults\n format.html { render action: :publish }\n else\n meeting.assign_attributes publish_meeting_attributes\n meeting.publish_from = current_user.email\n if meeting.publish\n format.html { redirect_to( meeting, flash: { success: 'Meeting published.' } ) }\n format.xml { head :ok }\n else\n format.html { render action: :publish, flash: { error: 'You must specify a recipient.' } }\n format.xml { render xml: meeting.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def meeting_params\n params.require(:meeting).permit(:start_time, :end_time, :name, :participant_count, :salary, :cost, :location, :agenda, :actions, :checked_out_participant_count, :phone_number_to_text)\n end",
"def get_meetings\n prepare\n @api.get_meetings\n end",
"def new\n @request_meeting = RequestMeeting.new params[:request_meeting]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request_meeting }\n end\n end",
"def create\n @meeting = Meeting.new(params[:meeting])\n @assignment = Assignment.new(params[:assignment])\n @assignment.assignable = @meeting\n @assignment.user_id = @user.id\n\n respond_to do |format|\n if @meeting.save && @assignment.save\n flash[:notice] = 'Meeting was successfully created.'\n format.html { redirect_to(@meeting) }\n format.xml { render :xml => @meeting, :status => :created, :location => @meeting }\n else\n flash[:notice] = 'Meeting not created.'\n @statuses = get_status_dropdown\n @categories = get_category_dropdown\n format.html { render :action => \"new\" }\n format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def meeting_params\n params.require(:meeting).permit(:date, :group_id)\n end",
"def meeting_params\n params.require(:meeting).permit(:name, :start_date, :end_time)\n end",
"def create\n @meeting = Meeting.new(meeting_params)\n @meeting.valid?\n @meeting.save\n redirect_to users_show_path\n end",
"def index\n @meetings = Meeting.all\nend",
"def meeting_params\n params.require(:meeting).permit(:title, :date, :location, :description, :created_by, :address)\n end",
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meeting }\n end\n end",
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meeting }\n end\n end",
"def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meeting }\n end\n end",
"def create\n @meal_meeting = MealMeeting.new(params[:meal_meeting])\n\n respond_to do |format|\n if @meal_meeting.save\n format.html { redirect_to @meal_meeting, notice: 'Meal meeting was successfully created.' }\n format.json { render json: @meal_meeting, status: :created, location: @meal_meeting }\n else\n format.html { render action: \"new\" }\n format.json { render json: @meal_meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @meetings = Meeting.recent\n @past_meetings = Meeting.recent.past\n @upcoming_meetings = Meeting.upcoming\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @meetings }\n format.atom\n end\n end",
"def create\n @meetup = Meetup.new(params[:meetup])\n\t@meetup.meetupdetails\n\n\n respond_to do |format|\n if @meetup.save\n\n\t\t\n\t\t\n \n\n format.html { redirect_to @meetup, notice: 'Meetup was successfully created.' }\n format.json { render json: @meetup, status: :created, location: @meetup }\n else\n format.html { render action: \"new\" }\n format.json { render json: @meetup.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @annual_meeting = AnnualMeeting.new(annual_meeting_params)\n\n respond_to do |format|\n if @annual_meeting.save\n format.html { redirect_to @annual_meeting, notice: 'Annual meeting was successfully created.' }\n format.json { render :show, status: :created, location: @annual_meeting }\n else\n format.html { render :new }\n format.json { render json: @annual_meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n #@meeting_assignments = Assignment.find_all_meetings\n @meeting_assignments = Assignment.find_all_meetings(@user.id, params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @meetings }\n end\n end",
"def meeting_params\n params.require(:meeting).permit(:title, :start_datetime, :summary, :finished_flg)\n end",
"def meetup_params\n params.require(:meetup).permit(:external_id, :title, :description, :url, :start, :end, :location)\n end",
"def create\n \tif params[:meetings_result][:meeting_date] && !params[:meetings_result][:meeting_date].empty?\n \tparams[:meetings_result][:meeting_date] = DateTime.strptime(params[:meetings_result][:meeting_date], \"%d/%m/%Y\").strftime(\"%Y-%m-%d\")\n end\n\n @meetings_result = MeetingsResult.new(params[:meetings_result])\n\n respond_to do |format|\n if @meetings_result.save\n format.html { redirect_to(@meetings_result, :notice => 'Meetings result was successfully created.') }\n format.xml { render :xml => @meetings_result, :status => :created, :location => @meetings_result }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @meetings_result.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def meeting_params\n params.require(:meeting)\n .permit(\n :name, :kind_id, :related_meeting_id, :dates, :start_time, :lock_version,:approver_id,\n :scheduled_time_id, :venue, :message, :unregistered_guest,\n proceeding_attributes: [:id, :meeting_id],\n observers_attributes: [:id, :user_id],\n participants_attributes: [:id, :user_id])\n end",
"def create\n @meetup = Meetup.new(meetup_params)\n\n respond_to do |format|\n if @meetup.save\n # this should take us to conversations.\n # format.html { redirect_to @meetup, notice: \"Meetup was successfully created.\" }\n # instead of showing the meetup, we want to share it!\n format.html { redirect_to conversations_path(@meetup), notice: \"Meetup was successfully created. Please click on a conversation to share your meetup.\" }\n format.json { render :show, status: :created, location: @meetup }\n # p @meetup, '< MEETUP'\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @meetup.errors, status: :unprocessable_entity }\n end\n end\n end",
"def meeting_params\n params.require(:meeting).permit(:title, :meeting_start, :meeting_end, :user_id, :room_id)\n end",
"def meeting_params\n params.require(:meeting).permit(:name, :start_time, :end_time, :category)\n end",
"def create\n meetup = Meetup.new(meetup_params)\n meetup.friend = User.find_by(id: params[:user_id])\n meetup.primary = current_user\n meetup.acceptStatus=false\n meetup.meetup_at+=8.hour\n meetup.save\n \n redirect_to user_meetup_url(current_user, meetup)\n end",
"def create\n @meeting = Meeting.new(params[:meeting])\n @meeting.attendeePW = rand(36**20).to_s(36)\n @meeting.moderatorPW = rand(36**20).to_s(36)\n @meeting.user_id = session[:user_id]\n #puts session[:user_id].inspect\n @meeting.name = Subject.find(@meeting.subject).title + Time.now.strftime('_%y%m%d%h%m')\n if @meeting.tutor.rate == 0\n @meeting.paid = true\n end\n @meeting.status = 0\n respond_to do |format|\n if @meeting.save\n ta = TutorAvailability.find(@meeting.tutor_availability_id)\n ta.taken = 1\n ta.save\n format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n format.json { render json: @meeting, status: :created, location: @meeting }\n else\n format.html { render action: \"new\" }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def meeting_params\n params.require(:meeting).permit(:meeting_on, :structure_id, :location, :duration, :starts_at, :attendees_male, :attendees_females, :meeting_held, :closenote, :reopennote, issue_ids: [])\n end",
"def index\n @meetings_results = MeetingsResult.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @meetings_results }\n end\n end",
"def meetings_list_params\n params.require(:meetings_list).permit(:title, :responsible)\n end",
"def index\n @meetings = Meeting.paginate(:page => params[:page], :per_page => 20)\n\t\t@title = \"Spotkania\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @meetings }\n format.rss { render :layout => false }\n end\n end",
"def new\n @meeting = Meeting.new\n @statuses = get_status_dropdown\n @categories = get_category_dropdown\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meeting }\n end\n end",
"def meetup_params\n params.permit(:title, :description, :location, :start_time, :end_time, :date, :game_id)\n end",
"def meeting_params\n params.require(:meeting).permit(:meetingname,:date)\n end",
"def meeting_params\n params.require(:meeting).permit(:user_id, :friend_id, :location_id, :agenda, :start_time, :end_time, :state)\n end",
"def meeting_params\n params.require(:meeting).permit(:name, :start_time)\n end",
"def create\n @meeting = Meeting.new(params[:meeting])\n\t\t@meeting.company = current_operator.company\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to(@meeting, :notice => t(:meeting_notice_correctly_created) ) }\n format.xml { render :xml => @meeting, :status => :created, :location => @meeting }\n else\n \t\t@customers = Customer.joins(:company).where(Company.table_name => {:id => current_operator.company.id})\n \t\t@operators = Operator.joins(:company).where(Company.table_name => {:id => current_operator.company.id})\n format.html { render :action => \"new\" }\n format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def meeting_accepted(meeting)\n setup_email\n @recipients = meeting.host.email\n @subject += \"Cita aceptada\"\n @body = {:meeting => meeting}\n end",
"def meeting_params\n params.require(:meeting).permit(\n :calendar_id,\n :start_time,\n :end_time,\n :title,\n :attendees_number,\n :agenda\n )\n end",
"def meeting_params\n params.require(:meeting).permit(:user_id, :room_id, :start_time, :end_time, :date, :summary)\n end",
"def meeting_params\n params.require(:meeting).permit(:name, decisions_attributes: [:id, :name, :meeting_id, :_destroy],\n criteria_attributes: [:id, :name, :weight,:meeting_id, :_destroy])\n end",
"def create\n @meeting_group = MeetingGroup.new(meeting_group_params)\n\n respond_to do |format|\n if @meeting_group.save\n format.html { redirect_to @meeting_group, notice: 'Meeting group was successfully created.' }\n format.json { render :show, status: :created, location: @meeting_group }\n else\n format.html { render :new }\n format.json { render json: @meeting_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @meeting.update(meeting_params)\n format.html { redirect_to @meeting, notice: 'Meeting was successfully updated.' }\n format.json { render :show, status: :ok, location: @meeting }\n else\n format.html { render :edit }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n\n create_meetings_topics(@meeting)\n end",
"def create\n @meeting_time = MeetingTime.new(meeting_time_params)\n\n respond_to do |format|\n if @meeting_time.save\n format.html { redirect_to @meeting_time, notice: 'Meeting time was successfully created.' }\n format.json { render action: 'show', status: :created, location: @meeting_time }\n else\n format.html { render action: 'new' }\n format.json { render json: @meeting_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sponsor_meeting = SponsorMeeting.new(params[:sponsor_meeting])\n\n respond_to do |format|\n if @sponsor_meeting.save\n format.html { redirect_to @sponsor_meeting, notice: 'Sponsor meeting was successfully created.' }\n format.json { render json: @sponsor_meeting, status: :created, location: @sponsor_meeting }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sponsor_meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @meeting_follow_up = MeetingFollowUp.new(meeting_follow_up_params)\n respond_to do |format|\n if @meeting_follow_up.save\n format.html { redirect_to meeting_follow_up_record_employee_plans_path(plan_id: params[:meeting_follow_up][:employee_plan_id]), notice: 'Meeting follow up was successfully created.' }\n format.json { render :show, status: :created, location: @meeting_follow_up }\n else\n format.html { render :new }\n format.json { render json: @meeting_follow_up.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_meeting(name, id)\n # create a meeting on the BBB server\n prepare\n options = {\n attendeePW: 'ap',\n moderatorPW: 'mp',\n welcome: \"Welcome to the #{name} meeting!\"\n }\n\n @api.create_meeting(name, id, options)\n @api.join_meeting_url(id, 'Guest', 'mp')\n end",
"def meeting_params\n params.require(:meeting).permit(:title, :times, :attribute, :room, :started_at, :closed_at, :remarks, :registered_at, :updated_at, :deleted_at, :category)\n end",
"def create\n dateFormats = ['%m/%d/%Y %I:%M %p %Z', '%Y-%m-%dT%H:%M %Z']\n # 2016-05-10T10:10 or 05/21/2015 10:07 pm\n # 2016-10-18T00:24\n dateStr = meeting_params[:date] + \" \" + Time.zone.now.strftime('%Z')\n logger.info(\"dateStr: \" + dateStr)\n parsedDate = nil\n\n dateFormats.each do |format|\n parsedDate ||= DateTime.strptime(dateStr, format) rescue nil\n end\n\n if parsedDate.nil?\n logger.error(\"No date found for input date: \" + dateStr)\n raise ActiveRecord::RecordNotFound()\n end\n\n @meeting = Meeting.new({\n meeting_type: MeetingType.find(meeting_params[:meeting_type]),\n met: parsedDate,\n school_id: @_current_school.id,\n comment: meeting_params[:comment]\n })\n\n memberIds = meeting_params[:students].split(\",\")\n assistIds = meeting_params[:assistants].split(\",\")\n student_role = Role.student_role\n instructor_role = Role.teacher_role\n assistant_role = Role.assistant_role\n\n # Create an array of tuples, role to member to then add.\n students = Member.find(memberIds)\n assistants = Member.find(assistIds)\n instructor = Member.find(meeting_params[:instructor])\n\n mmembs = students.collect {|mem| [student_role, mem]} + assistants.collect {|mem| [assistant_role, mem]} + [instructor].collect {|mem| [instructor_role, mem]}\n\n mmembs.each do |mmem|\n puts mmem.inspect\n role, member = mmem\n mm = MeetingMember.new({\n meeting: @meeting,\n member: member,\n belt: member.belt,\n role: role,\n })\n\n mm.save\n end\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to meetings_path(), notice: 'Meeting was successfully created.' }\n format.json { render :show, status: :created, location: @meeting }\n else\n format.html { render :new }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @meeting_type = MeetingType.new(meeting_type_params)\n\n respond_to do |format|\n if @meeting_type.save\n format.html { redirect_to @meeting_type, notice: 'Meeting type was successfully created.' }\n format.json { render :show, status: :created, location: @meeting_type }\n else\n format.html { render :new }\n format.json { render json: @meeting_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def meetup_params\n params.require(:meetup).permit(:title, :description, :url, :created_at)\n end"
] |
[
"0.6385355",
"0.63697445",
"0.63660413",
"0.6332388",
"0.6302386",
"0.6289513",
"0.62788576",
"0.6221645",
"0.6170628",
"0.6160674",
"0.614793",
"0.61457247",
"0.60964406",
"0.6095229",
"0.60608953",
"0.606086",
"0.60464096",
"0.60216075",
"0.60052437",
"0.59765655",
"0.59733164",
"0.59336233",
"0.5911373",
"0.5909557",
"0.59037817",
"0.58889455",
"0.5886989",
"0.5886989",
"0.5886989",
"0.5867925",
"0.58629084",
"0.5830235",
"0.58126163",
"0.5784715",
"0.5783388",
"0.5749758",
"0.57342756",
"0.57325447",
"0.57325447",
"0.57325447",
"0.57325447",
"0.57325447",
"0.57325447",
"0.5721522",
"0.5707663",
"0.5702747",
"0.5698817",
"0.56902176",
"0.56897664",
"0.5684848",
"0.56752926",
"0.56701416",
"0.56550616",
"0.56536025",
"0.56531405",
"0.56460357",
"0.56279856",
"0.56253105",
"0.56215775",
"0.5604941",
"0.5604941",
"0.5604941",
"0.56026375",
"0.5601494",
"0.5594427",
"0.5588418",
"0.55868745",
"0.55737895",
"0.55607057",
"0.5545818",
"0.55414647",
"0.5540577",
"0.55290157",
"0.5517293",
"0.5516336",
"0.5515861",
"0.5500272",
"0.54959595",
"0.548169",
"0.548091",
"0.5473433",
"0.5470436",
"0.5459748",
"0.545413",
"0.5453505",
"0.5451901",
"0.5451441",
"0.5451055",
"0.54246503",
"0.54211783",
"0.54137576",
"0.5404825",
"0.5403345",
"0.5399118",
"0.5395646",
"0.53950393",
"0.5390675",
"0.5388307",
"0.5385473",
"0.53702813"
] |
0.63848025
|
1
|
PUT /meetings/1 PUT /meetings/1.xml
|
def update
@meeting = Meeting.find(params[:id])
respond_to do |format|
if @meeting.update_attributes(params[:meeting])
flash[:notice] = 'Meeting was successfully updated.'
format.html { redirect_to(@meeting) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @meet = Meet.find(params[:id])\n\n respond_to do |format|\n if @meet.update_attributes(params[:meet])\n format.html { redirect_to @meet, notice: 'Meet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @meet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if meeting.save\n format.html { redirect_to meeting, flash: { success: 'Meeting updated.' } }\n format.xml { head :ok }\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n if @meeting.update_attributes(params[:meeting])\n flash[:notice] = 'Meeting aggiornato con successo.'\n format.html { redirect_to(@meeting) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @meeting = Meeting.find(params[:id])\n\n \n respond_to do |format|\n if @meeting.update_attributes(params[:meeting])\n format.html { redirect_to @meeting, notice: 'Meeting was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n if @meeting.update_attributes(params[:meeting])\n format.html { redirect_to(@meeting, :notice => t(:meeting_notice_correctly_updated)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n if @meeting.update_attributes(params[:meeting])\n format.html { redirect_to meetings_path, notice: 'Meeting was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n if @meeting.update_attributes(params[:meeting])\n format.html { redirect_to @meeting, notice: 'Meeting was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n if developer?\n #take care of meeting participants\n param_users = (params[:users].map {|i| i.to_i} rescue []).to_set\n meeting_users = (@meeting.meeting_participants.map {|mp| mp.user.id}).to_set\n (param_users - meeting_users).each {|uid| MeetingParticipant.create(:user => User.find(uid), :meeting => @meeting)}\n (meeting_users - param_users).each {|uid| MeetingParticipant.find(:first, :conditions => [\"meeting_id = ? and user_id = ?\", @meeting.id, uid]).destroy rescue nil}\n\n if @meeting.update_attributes(params[:meeting])\n flash[:notice] = 'Meeting was successfully updated.'\n format.html { redirect_to(iteration_stories_url(@meeting.iteration)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }\n end\n else\n format.xml { render :xml => XML_ERRORS[:not_authorized] }\n end\n end\n end",
"def update\n @request_meeting = RequestMeeting.find(params[:id])\n\n respond_to do |format|\n if @request_meeting.update_attributes(params[:request_meeting])\n format.html { redirect_to @request_meeting, notice: 'Request meeting was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @request_meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @meetup = Meetup.find(params[:id])\n\n respond_to do |format|\n if @meetup.update_attributes(params[:meetup])\n format.html { redirect_to @meetup, notice: 'Meetup was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @meetup.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @meeting.update(meeting_params)\n format.html { redirect_to @meeting, notice: 'Meeting was successfully updated.' }\n format.json { render :show, status: :ok, location: @meeting }\n else\n format.html { render :edit }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n\n create_meetings_topics(@meeting)\n end",
"def update\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n if @meeting.update_attributes(meeting_params)\n format.html { redirect_to weekly_calendar_url, notice: 'Meeting was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @meeting = Meeting.find(params[:id])\n if @meeting.update_attributes(meeting_params)\n flash[:info] = \"successfully updated\"\n redirect_to meetings_path\n else\n flash[:info] = \"fail to update\"\n render :edit\n end\n end",
"def update\n respond_to do |format|\n if @meeting.update(meeting_params)\n format.json { head :no_content }\n else\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def update\n @users_meeting = UsersMeeting.find(params[:id])\n\n respond_to do |format|\n if @users_meeting.update_attributes(params[:users_meeting])\n format.html { redirect_to @users_meeting, notice: 'Users meeting was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @users_meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n respond_to do |format|\n if @meeting.update(meeting_params)\n @meeting.users << current_user\n format.html { redirect_to @meeting, notice: 'Meeting was successfully updated.' }\n format.json { render :show, status: :ok, location: @meeting }\n else\n format.html { render :edit }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @meeting_point = MeetingPoint.find(params[:id])\n\n respond_to do |format|\n if @meeting_point.update_attributes(params[:meeting_point])\n format.html { redirect_to @meeting_point, notice: 'Meeting point was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @meeting_point.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @meetup.update(meetup_params)\n format.html { redirect_to @meetup, notice: \"Meetup was successfully updated.\" }\n format.json { render :show, status: :ok, location: @meetup }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @meetup.errors, status: :unprocessable_entity }\n end\n end\n end",
"def save\n if new_record?\n overwrite @api.post(\"/meetings.json\", writeable_attributes)\n else\n overwrite @api.put(\"/meetings/#{shortcode_url}.json\",\n writeable_attributes)\n end\n end",
"def update\n respond_to do |format|\n if @meetup.update(meetup_params)\n format.html { redirect_to @meetup, notice: 'Meetup was successfully updated.' }\n format.json { render :show, status: :ok, location: @meetup }\n else\n format.html { render :edit }\n format.json { render json: @meetup.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @meeting.update(meeting_params)\n format.html { redirect_to @meeting, notice: 'Meeting was successfully updated.' }\n format.json { render :show, status: :ok, location: @meeting }\n else\n format.html { render :edit }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @meeting.update(meeting_params)\n format.html { redirect_to @meeting, notice: 'Meeting was successfully updated.' }\n format.json { render :show, status: :ok, location: @meeting }\n else\n format.html { render :edit }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @meeting.update(meeting_params)\n format.html { redirect_to @meeting, notice: 'Meeting was successfully updated.' }\n format.json { render :show, status: :ok, location: @meeting }\n else\n format.html { render :edit }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @meeting.update(meeting_params)\n format.html { redirect_to @meeting, notice: 'Meeting was successfully updated.' }\n format.json { render :show, status: :ok, location: @meeting }\n else\n format.html { render :edit }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @meeting.update(meeting_params)\n format.html { redirect_to @meeting, notice: 'Meeting was successfully updated.' }\n format.json { render :show, status: :ok, location: @meeting }\n else\n format.html { render :edit }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n\n\n end",
"def update\n authorize @meetup\n respond_to do |format|\n if @meetup.update(meetup_params)\n notify_collaborators\n format.html { redirect_to meetup_path(@meetup) }\n format.json { render :show, status: :ok, location: @meetup }\n else\n format.html { render :edit }\n format.json do\n render json: @meetup.errors,\n status: :unprocessable_entity\n end\n end\n end\n end",
"def set_meetup\n @meetup = Meetup.find(params[:id])\n end",
"def set_meetup\n @meetup = Meetup.find(params[:id])\n end",
"def set_meetup\n @meetup = Meetup.find(params[:id])\n end",
"def set_meetup\n @meetup = Meetup.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def update\n @meeting_member = MeetingMember.find(params[:id])\n\n respond_to do |format|\n if @meeting_member.update_attributes(params[:meeting_member])\n format.html { redirect_to @meeting_member, :notice => 'Meeting member was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @meeting_member.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @fetmeeting = Fetmeeting.find(params[:id])\n\n respond_to do |format|\n if @fetmeeting.update_attributes(params[:fetmeeting])\n format.html { redirect_to @fetmeeting, notice: 'Fetmeeting was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fetmeeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @meeting.update_attributes(meeting_params)\n format.html { redirect_to user_meeting_path, notice: 'Meeting was successfully updated.' }\n format.json { render :show, status: :ok, location: @meeting }\n else\n format.html { render :edit }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def set_meeting\n @meeting = Meeting.find(params[:id])\n end",
"def update\n @user = current_user\n respond_to do |format|\n if @meeting.update(meeting_params)\n format.html { redirect_to user_meetings_path(@user), notice: 'Editado correctamente.' }\n format.json { render :show, status: :ok, location: @meeting }\n else\n format.html { render :edit }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_should_update_invite_via_API_XML\r\n get \"/logout\"\r\n put \"/invites/1.xml\", :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => 'test@email.com',\r\n :user_id => 1 }\r\n assert_response 401\r\n end",
"def update\n @user = User.find(params[:user_id])\n @mycontact = @user.mycontacts.find(params[:mycontact_id])\n @meeting= @mycontact.meetings.find(params[:id])\n respond_to do |format|\n if @meeting.update(meeting_params)\n format.html { redirect_to user_mycontact_meetings_path, notice: 'Meeting was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @meeting.update(meeting_params)\n format.html { redirect_to meetings_path, notice: 'La réunion a bien été modifiée.' }\n format.json { render :show, status: :ok, location: @meeting }\n else\n format.html { render :edit }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @meal_meeting = MealMeeting.find(params[:id])\n\n respond_to do |format|\n if @meal_meeting.update_attributes(params[:meal_meeting])\n format.html { redirect_to @meal_meeting, notice: 'Meal meeting was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @meal_meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n @meeting.assign_attributes(params[:meeting])\n if @meeting.save\n format.js { head :no_content }\n format.html { redirect_to @meeting, notice: 'Meeting successfully updated.' }\n format.json { head :no_content }\n else\n format.js { render :json => { :errors => @meeting.errors.full_messages, :message => \"Problem updating meeting\" }, :status => :unprocessable_entity }\n format.html { render action: \"edit\" }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @participant.update_attributes(params[:participant]) && @meeting.update_attributes(@meeting.new_meeting_params_from(@participant, params[:participant]))\n flash[:notice] = 'Participant was successfully updated.'\n format.html { redirect_to(meeting_path(@meeting)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @participant.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_meeting\n @meeting = current_user.meetings.find(params[:id] || params[:meeting_id])\n end",
"def update\r\n @meeting_type = MeetingType.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @meeting_type.update_attributes(params[:meeting_type])\r\n format.html { redirect_to @meeting_type, only_path: true, notice: 'Meeting type was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @meeting_type.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n @site = Site.first\n @meetup_info = @site.meetup_info\n\n respond_to do |format|\n if @meetup_info.update(meetup_info_params)\n format.html { redirect_to backstage_index_path, notice: 'meetup_info was successfully updated.' }\n # format.json { render :show, status: :ok, location: @meetup_info }\n else\n format.html { render :edit }\n # format.json { render json: @meetup_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_meeting\n @meeting = Meeting.find(params[:meeting_id])\n end",
"def update\n @meeting = Meeting.find(params[:id])\n @meeting.meeting_time = params[:meeting][:meeting_time]\n respond_to do |format|\n if @meeting.update_attributes(params[:meeting])\n format.html { redirect_to club_meeting_path(params[:club_id],@meeting), notice: 'Meeting was successfully updated.' }\n format.json { head :ok }\n \n else\n format.html { render action: \"edit\" }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n \n end\n end\n end",
"def update\n @appointment = person.appointments.find(params[:id])\n respond_to do |format|\n if @appointment.update_attributes(params[:appointment])\n format.html { redirect_to([person, @appointment], :notice => 'Appointment was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @appointment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def meeting_update(*args)\n options = Zoom::Params.new(Utils.extract_options!(args))\n options.require(%i[meeting_id])\n Utils.process_datetime_params!(:start_time, options)\n # TODO Handle `topic` attr, Max of 300 characters.\n # TODO Handle `timezone` attr, refer to the id value in timezone list JSON file. like \"America/Los_Angeles\"\n # TODO Verify `password` attr, may only contain the following characters: a-z A-Z 0-9 @ - _\n # TODO Handle `option_audio` attr, Can be \"both\", \"telephony\", \"voip\".\n # TODO Handle `option_auto_record_type`, Can be \"local\", “cloud” or \"none\".\n Utils.parse_response self.class.patch(\"/meetings/#{options[:meeting_id]}\", body: options.except(:meeting_id).to_json, headers: request_headers)\n end",
"def update\n resource_path = \"/projects/#{project_id}/people/#{id}\"\n Request.put(resource_path, self.to_xml('person'))\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 set_meetings_list\n @meetings_list = MeetingsList.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @meeting.update(meeting_params)\n format.html { redirect_to root_path, flash: {success: 'Meeting was successfully updated.'} } \n format.json { render :show, status: :ok, location: @meeting }\n else\n format.html { redirect_to edit_meeting_path, flash: {danger: \"Unable to edit meeting. \" + @meeting.errors.full_messages.join('. ')} }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_meeting\n @meeting = User.find(params[:user_id]).meetings.find(params[:id])\n end",
"def update\n user = self.load_user(params)\n meeting = self.load_meeting(params)\n if user != nil and meeting != nil\n title = params[\"meeting\"][\"title\"]\n if title != nil\n meeting.title = title\n end\n result = meeting.save!\n if result\n self.send_ok\n else\n self.send_error 422\n end\n else\n self.send_error 401\n end\n end",
"def update\n respond_to do |format|\n if @horse_meet.update(horse_meet_params)\n format.html { redirect_to @horse_meet, notice: 'Horse meet was successfully updated.' }\n format.json { render :show, status: :ok, location: @horse_meet }\n else\n format.html { render :edit }\n format.json { render json: @horse_meet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if meeting_template.save\n format.html { redirect_to( meeting_template, flash: { success: \"Meeting template updated.\" } ) }\n format.xml { head :ok }\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: meeting_template.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @meeting.user == current_user && @meeting.update(meeting_params)\n format.html { redirect_to @meeting, notice: 'Meeting was successfully updated.' }\n format.json { render :show, status: :ok, location: @meeting }\n else\n format.html { render :edit }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @users_meeting.update(users_meeting_params)\n format.html { redirect_to @users_meeting, notice: 'Users meeting was successfully updated.' }\n format.json { render :show, status: :ok, location: @users_meeting }\n else\n format.html { render :edit }\n format.json { render json: @users_meeting.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[:meetup])\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 @sponsor_meeting = SponsorMeeting.find(params[:id])\n\n respond_to do |format|\n if @sponsor_meeting.update_attributes(params[:sponsor_meeting])\n format.html { redirect_to @sponsor_meeting, notice: 'Sponsor meeting was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sponsor_meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @meetings_list.update(meetings_list_params)\n format.html do\n redirect_to @meetings_list,\n notice: 'Die Meeting-Liste wurde erfolgreich aktualisiert.'\n end\n format.json { render :show, status: :ok, location: @meetings_list }\n else\n format.html { render :edit }\n format.json { render json: @meetings_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @meetuser.update(meetuser_params)\n format.html { redirect_to @meetuser, notice: 'Meetuser was successfully updated.' }\n format.json { render :show, status: :ok, location: @meetuser }\n else\n format.html { render :edit }\n format.json { render json: @meetuser.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @meeting = Meeting.find(params[:id])\n @meeting.destroy\n\n respond_to do |format|\n format.html { redirect_to(meetings_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @meeting = Meeting.find(params[:id])\n @meeting.destroy\n\n respond_to do |format|\n format.html { redirect_to(meetings_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @meeting = Meeting.find(params[:id])\n @meeting.destroy\n\n respond_to do |format|\n format.html { redirect_to(meetings_url) }\n format.xml { head :ok }\n end\n end",
"def show\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n format.xml { render :xml => @meeting }\n end\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 create\n respond_to do |format|\n if meeting.save\n format.html { redirect_to( meeting, flash: { success: 'Meeting created.' } ) }\n format.xml { render xml: meeting, status: :created, location: meeting }\n else\n format.html { render action: \"new\" }\n format.xml { render xml: meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @annual_meeting.update(annual_meeting_params)\n format.html { redirect_to @annual_meeting, notice: 'Annual meeting was successfully updated.' }\n format.json { render :show, status: :ok, location: @annual_meeting }\n else\n format.html { render :edit }\n format.json { render json: @annual_meeting.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit\n @meetings = current_user.meetings.all\n end",
"def update\n meeting = Meeting.find(@attending.meeting_id)\n notification_text = \"#{current_user.first_name} #{current_user.last_name} has accepted your invite to #{meeting.description}.\"\n Notification.create(user_id: meeting.organiser_id, message: notification_text)\n @attending.update(confirmed: true)\n redirect_to meetings_path\n end",
"def set_meeting\n @meeting_room = MeetingRoom.find(params[:id])\n end",
"def update\n @meeting_location = MeetingLocation.find(params[:id])\n\n respond_to do |format|\n if @meeting_location.update_attributes(params[:meeting_location])\n format.html { redirect_to @meeting_location, notice: 'Meeting location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @meeting_location.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6736497",
"0.67130566",
"0.6698899",
"0.6501453",
"0.64961463",
"0.64853835",
"0.64713913",
"0.6402791",
"0.6387426",
"0.6382748",
"0.6344773",
"0.63203645",
"0.62660897",
"0.62633264",
"0.6178516",
"0.61440146",
"0.6125862",
"0.61159986",
"0.61159945",
"0.6113205",
"0.60883313",
"0.60737056",
"0.60737056",
"0.60737056",
"0.60737056",
"0.60695285",
"0.6052202",
"0.60016966",
"0.60016966",
"0.60016966",
"0.60016966",
"0.59948117",
"0.59948117",
"0.59948117",
"0.59948117",
"0.59948117",
"0.5979767",
"0.59767884",
"0.5969861",
"0.5962193",
"0.5962193",
"0.5962193",
"0.5962193",
"0.5962193",
"0.5962193",
"0.5962193",
"0.5962193",
"0.5962193",
"0.5962193",
"0.5962193",
"0.5962193",
"0.5962193",
"0.5962193",
"0.5962193",
"0.5962193",
"0.5962193",
"0.5962193",
"0.5962193",
"0.5962193",
"0.5962193",
"0.5962193",
"0.59381497",
"0.5916568",
"0.5910008",
"0.5907457",
"0.5894405",
"0.5888822",
"0.58564645",
"0.58504033",
"0.5849544",
"0.5846205",
"0.5835308",
"0.5822504",
"0.58158374",
"0.5813342",
"0.5808329",
"0.5800451",
"0.5798549",
"0.578651",
"0.5777553",
"0.5771717",
"0.5762143",
"0.57408834",
"0.57406026",
"0.57346743",
"0.5714646",
"0.5709385",
"0.5706469",
"0.5695372",
"0.56715584",
"0.56715584",
"0.56715584",
"0.56651413",
"0.56392264",
"0.563122",
"0.56099874",
"0.56063616",
"0.5603449",
"0.56008846",
"0.55860883"
] |
0.66743153
|
3
|
DELETE /meetings/1 DELETE /meetings/1.xml
|
def destroy
@meeting = Meeting.find(params[:id])
@meeting.destroy
respond_to do |format|
format.html { redirect_to(meetings_url) }
format.xml { head :ok }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n meeting.destroy\n\n respond_to do |format|\n format.html { redirect_to( committee_meetings_url( meeting.committee ),\n flash: { success: \"Meeting destroyed.\" } ) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @meetup = Meetup.find(params[:id])\n @meetup.destroy\n\n respond_to do |format|\n format.html { redirect_to meetups_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n return if new_record?\n \n @api.delete \"/meetings/#{shortcode_url}.json\"\n end",
"def destroy\n @meeting = Meeting.find(params[:id])\n @meeting.destroy\n respond_to do |format|\n format.html { redirect_to meetings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting = Meeting.find(params[:id])\n @meeting.destroy\n\n respond_to do |format|\n format.html { redirect_to meetings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting = Meeting.find(params[:id])\n @meeting.destroy\n\n respond_to do |format|\n format.html { redirect_to meetings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting = Meeting.find(params[:id])\n @meeting.destroy\n\n respond_to do |format|\n format.html { redirect_to meetings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting = Meeting.find(params[:id])\n if !checkme? @meeting then return end\n \n @meeting.destroy\n\n respond_to do |format|\n format.html { redirect_to meetings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request_meeting = RequestMeeting.find(params[:id])\n @request_meeting.destroy\n\n respond_to do |format|\n format.html { redirect_to request_meetings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting = Meeting.find(params[:id])\n @meeting.destroy\n\t\t@title = \"Usuwanie spotkania\"\n respond_to do |format|\n format.html { redirect_to meetings_url }\n format.json { head :ok }\n end\n end",
"def destroy\n delete_meetings_from_users\n @meeting.destroy\n respond_to do |format|\n format.html { redirect_to meetings_url, notice: 'Meeting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting.destroy\n respond_to do |format|\n format.html { redirect_to meetings_url }\n end\n end",
"def destroy\n @meetup = Meetup.find_by(id: params[:id])\n @meetup.destroy\n \n redirect_to user_meetups_url(current_user)\n end",
"def delete_meeting(meeting_key, operation_name = \"Delete Meeting\")\n value = meeting_key\n xml_value = xml_meetings(@configuration, operation_name,value)\n res = Net::HTTP.start(@configuration[:host]){ |http|\n http.post(\"/WBXService/XMLService\",xml_value)\n }\n xml_data = res.body\n response = Hash.new\n doc = REXML::Document.new xml_data\n header = doc.root.elements[\"serv:header\"].elements[\"serv:response\"]\n response= {:result => header.elements[\"serv:result\"].text}\n return response\n end",
"def destroy\n @meeting.destroy\n respond_to do |format|\n format.html { redirect_to meetings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meetings_result = MeetingsResult.find(params[:id])\n @meetings_result.destroy\n\n respond_to do |format|\n format.html { redirect_to(meetings_results_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @meetup.destroy\n respond_to do |format|\n format.html { redirect_to meetups_url, notice: 'Meetup was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meetup.destroy\n respond_to do |format|\n format.html { redirect_to meetups_url, notice: \"Meetup was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fetmeeting = Fetmeeting.find(params[:id])\n @fetmeeting.destroy\n\n respond_to do |format|\n format.html { redirect_to fetmeetings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting = Meeting.find(params[:id])\n @meeting.destroy\n\n respond_to do |format|\n format.html { redirect_to club_meetings_path(params[:club_id]) }\n format.json { head :ok }\n end\n end",
"def destroy\n @users_meeting = UsersMeeting.find(params[:id])\n @users_meeting.destroy\n\n respond_to do |format|\n format.html { redirect_to users_meetings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meal_meeting = MealMeeting.find(params[:id])\n @meal_meeting.destroy\n\n respond_to do |format|\n format.html { redirect_to meal_meetings_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting.destroy\n respond_to do |format|\n format.html { redirect_to meetings_url, notice: 'Reunion borrada :(' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting.destroy\n respond_to do |format|\n format.html { redirect_to meetings_url, notice: 'La réunion a bien été détruite.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n # @meeting.destroy\n respond_to do |format|\n format.html { redirect_to meetings_url, notice: 'Meeting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting_point = MeetingPoint.find(params[:id])\n @meeting_point.destroy\n\n respond_to do |format|\n format.html { redirect_to meeting_points_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting_member = MeetingMember.find(params[:id])\n @meeting_member.destroy\n\n respond_to do |format|\n format.html { redirect_to meeting_members_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @meeting.destroy\n respond_to do |format|\n format.html { redirect_to meetings_url, notice: 'Meeting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting.destroy\n respond_to do |format|\n format.html { redirect_to meetings_url, notice: 'Meeting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting.destroy\n respond_to do |format|\n format.html { redirect_to meetings_url, notice: 'Meeting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting.destroy\n respond_to do |format|\n format.html { redirect_to meetings_url, notice: 'Meeting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting.destroy\n respond_to do |format|\n format.html { redirect_to meetings_url, notice: 'Meeting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting.destroy\n respond_to do |format|\n format.html { redirect_to meetings_url, notice: 'Meeting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting.destroy\n respond_to do |format|\n format.html { redirect_to meetings_url, notice: 'Meeting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting.destroy\n respond_to do |format|\n format.html { redirect_to user_holder_meetings_url, notice: 'Meeting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting.destroy\n respond_to do |format|\n format.html { redirect_to user_meetings_path, notice: 'Meeting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def meeting_delete(*args)\n options = Zoom::Params.new(Utils.extract_options!(args))\n options.require(%i[meeting_id])\n Utils.parse_response self.class.delete(\"/meetings/#{options[:meeting_id]}\", query: options.except(:meeting_id), headers: request_headers)\n end",
"def destroy\n @appointment = person.appointments.find(params[:id])\n @appointment.destroy\n respond_to do |format|\n format.html { redirect_to(patient_appointments_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user = User.find(params[:user_id])\n @mycontact = @user.mycontacts.find(params[:mycontact_id])\n @meeting= @mycontact.meetings.find(params[:id])\n @user = User.find(params[:user_id])\n @meeting.destroy\n respond_to do |format|\n format.html { redirect_to user_mycontact_meetings_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting = Meeting.find(params[:id])\n @iteration = @meeting.iteration\n begin\n respond_to do |format|\n @meeting.destroy\n format.html { redirect_to(iteration_stories_url(@iteration)) }\n format.xml { head :ok }\n end\n rescue ActiveRecord::StatementInvalid \n respond_to do |format|\n format.xml { render :xml => XML_ERRORS[:foreign_key_problem] }\n end\n end\n end",
"def destroy\n @appointment = Appointment.find(params[:id])\n @appointment.destroy\n\n respond_to do |format|\n format.html { redirect_to(appointments_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @appointment = Appointment.find(params[:id])\n @appointment.destroy\n\n respond_to do |format|\n format.html { redirect_to(appointments_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @appointment = Appointment.find(params[:id])\n @appointment.destroy\n\n respond_to do |format|\n format.html { redirect_to(appointments_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @today_activity = TodayActivity.find(params[:id])\n @today_activity.destroy\n\n respond_to do |format|\n format.html { redirect_to(today_activities_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @meet = Meet.find(params[:id])\n @meet.destroy\n @track = @meet.track\n respond_to do |format|\n format.html { redirect_to track_url(:id => @track.id) }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @meeting_type = MeetingType.find(params[:id])\r\n @meeting_type.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to meeting_types_url, only_path: true }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n authorize @meetup\n @meetup.destroy\n redirect_to(meetups_path)\n end",
"def destroy\n @evactivity = Evactivity.find(params[:id])\n @evactivity.destroy\n\n respond_to do |format|\n format.html { redirect_to(evactivities_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @appointment_request = AppointmentRequest.find(params[:id])\n @appointment_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(appointment_requests_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @annual_meeting.destroy\n respond_to do |format|\n format.html { redirect_to annual_meetings_url, notice: 'Annual meeting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meetuser.destroy\n respond_to do |format|\n format.html { redirect_to meetusers_url, notice: 'Meetuser was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting.destroy\n respond_to do |format|\n format.html { redirect_to root_path, flash: {success:'Meeting was successfully removed.'} }\n format.json { head :no_content }\n end\n end",
"def destroy\n @participant.destroy\n flash[:notice] = 'Participant was successfully removed.'\n respond_to do |format|\n format.html { redirect_to(meeting_participants_path(@meeting)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def delete\n user = self.load_user(params)\n meeting = self.load_meeting(params)\n\n if user != nil and meeting != nil\n participants = meeting.participants\n meeting.participants.delete(participants)\n meeting.delete\n self.send_ok\n else\n self.send_error 401\n end\n end",
"def destroy\n @user = Meetup.find(params[:id])\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to meetups_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @users_meeting.destroy\n respond_to do |format|\n format.html { redirect_to users_meetings_url, notice: 'Users meeting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting_time.destroy\n respond_to do |format|\n format.html { redirect_to meeting_times_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting_location = MeetingLocation.find(params[:id])\n @meeting_location.destroy\n\n respond_to do |format|\n format.html { redirect_to meeting_locations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @assignment = Assignment.find(params[:id])\n @meeting = @assignment.assignable\n @assignment.destroy\n @meeting.destroy\n\n respond_to do |format|\n flash[:notice] = 'Meeting was successfully deleted.'\n format.html { redirect_to(meetings_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @meeting.destroy\n respond_to do |format|\n format.html { redirect_to request.referer, notice: 'Meeting was successfully destroyed.' }\n format.json { head :no_content }\n end\n\n end",
"def destroy\n @meeting.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Meeting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meetup_profile = MeetupProfile.find(params[:id])\n @meetup_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to request.referer }\n format.json { head :no_content }\n end\n end",
"def destroy\n @click_to_talk = ClickToTalk.find(params[:id])\n @click_to_talk.destroy\n\n respond_to do |format|\n format.html { redirect_to(click_to_talks_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n meeting_template.destroy\n\n respond_to do |format|\n format.html { redirect_to(meeting_templates_url, flash: { sucess: \"Meeting template destroyed.\" } ) }\n format.xml { head :ok }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n client = Connection::MarkLogic.new.client\n client.send_corona_request(\"/v1/documents?uri=/amandments/amandment_#{@amandment.id}.xml\", :delete)\n @amandment.destroy\n respond_to do |format|\n format.html { redirect_to home_meeting_path, notice: 'Amandman was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @horse_meet.destroy\n respond_to do |format|\n format.html { redirect_to horse_meets_url, notice: 'Horse meet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @peep = Peep.find(params[:id])\n @peep.destroy\n\n respond_to do |format|\n format.html { redirect_to(peeps_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @meetings_list.destroy\n authorize(@meetings_list.destroy)\n respond_to do |format|\n format.html do\n redirect_to root_url,\n notice: 'Liste erfolgreich vernichtet.'\n end\n format.json { head :no_content }\n end\n end",
"def destroy\n @talk = Talk.find(params[:id])\n @talk.destroy\n\n respond_to do |format|\n format.html { redirect_to(talks_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @sponsor_meeting = SponsorMeeting.find(params[:id])\n @sponsor_meeting.destroy\n\n respond_to do |format|\n format.html { redirect_to sponsor_meetings_url }\n format.json { head :no_content }\n end\n end",
"def deleteAttendee(name)\n RSVP.delete(@id,name)\n end",
"def destroy\n @meeting_follow_up.destroy\n respond_to do |format|\n format.html { redirect_to meeting_follow_ups_url, notice: 'Meeting follow up was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @attendance = Attendance.find(params[:id])\n @attendance.destroy\n\n respond_to do |format|\n format.html { redirect_to(attendances_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @invite_request = InviteRequest.find(params[:id])\n @invite_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(invite_requests_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @attendance = Attendance.find(params[:id])\n @attendance.destroy\n\n respond_to do |format|\n format.html { redirect_to(:action=>'today') }\n format.xml { head :ok }\n end\n end",
"def destroy\n @day = Day.find(params[:id])\n @day.destroy\n\n respond_to do |format|\n format.html { redirect_to(conference_days_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @people = People.find(params[:id])\n @people.destroy\n\n respond_to do |format|\n format.html { redirect_to(peoples_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @patientappointmentinfo = Patientappointmentinfo.find(params[:id])\n @patientappointmentinfo.destroy\n\n respond_to do |format|\n format.html { redirect_to(patientappointmentinfos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @goal = Goal.find(params[:id])\n @goal.destroy\n\n respond_to do |format|\n format.html { redirect_to(goals_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @attend = Attend.find(params[:id])\n @attend.destroy\n\n respond_to do |format|\n format.html { redirect_to(attends_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @meeting.destroy if @meeting.user == current_user\n respond_to do |format|\n format.html { redirect_to @meeting.user, notice: 'Meeting was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n # @meeting_thread = MeetingThread.find(params[:id])\n @meeting_thread.destroy\n\n respond_to do |format|\n format.html { redirect_to meeting_threads_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invitee = Invitee.find(params[:id])\n @invitee.destroy\n\n respond_to do |format|\n format.html { redirect_to(invitees_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @diet = Diet.find(params[:id])\n @diet.destroy\n\n respond_to do |format|\n format.html { redirect_to(diets_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @current_activity.destroy\n\n respond_to do |format|\n format.html { redirect_to(activities_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @engagement_attendee.destroy\n head :no_content\n end",
"def destroy\n @type_of_meeting.destroy\n respond_to do |format|\n format.html {redirect_to type_of_meetings_url, notice: 'Type of meeting was successfully destroyed.'}\n format.json {head :no_content}\n end\n end",
"def destroy\n @hospedagem = Hospedagem.find(params[:id])\n @hospedagem.destroy\n\n respond_to do |format|\n format.html { redirect_to(hospedagens_url) }\n format.xml { head :ok }\n end\n end",
"def delete_appointment(id)\n @client.raw('delete', \"/config/appointments/#{id}\")\n end",
"def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n \n respond_to do |format|\n format.html { redirect_to activities_url }\n format.xml { render :nothing => true }\n end\n end",
"def destroy\n @datetime.destroy\n\n respond_to do |format|\n format.html { redirect_to request.env['HTTP_REFERER'] }\n format.xml { head :ok }\n end\n end",
"def destroy\n @tournament_day = TournamentDay.find(params[:id])\n @tournament_day.destroy\n\n respond_to do |format|\n format.html { redirect_to(tournament_days_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @persona = Persona.find(params[:id])\n @persona.destroy\n\n respond_to do |format|\n format.html { redirect_to(emple_path) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to(people_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to(people_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to(activities_url) }\n format.xml { head :ok }\n end\n end"
] |
[
"0.7192475",
"0.71921545",
"0.71268713",
"0.707988",
"0.7069304",
"0.7069304",
"0.7069304",
"0.7014493",
"0.7010651",
"0.7009012",
"0.6978566",
"0.6970698",
"0.69154376",
"0.69109815",
"0.690946",
"0.6866191",
"0.68227875",
"0.6816975",
"0.68023515",
"0.6794282",
"0.6767315",
"0.67465025",
"0.67011476",
"0.66951734",
"0.66857463",
"0.66618776",
"0.66511256",
"0.66497815",
"0.66497815",
"0.66497815",
"0.66497815",
"0.66497815",
"0.66497815",
"0.66497815",
"0.66412383",
"0.66401595",
"0.6637163",
"0.65915877",
"0.6567414",
"0.65292513",
"0.65274715",
"0.65274715",
"0.65274715",
"0.65217316",
"0.6517026",
"0.6512531",
"0.6487049",
"0.6480684",
"0.64749014",
"0.64591664",
"0.6454949",
"0.6454538",
"0.6427818",
"0.64177704",
"0.6407394",
"0.64056915",
"0.6405659",
"0.64035404",
"0.6399013",
"0.63967454",
"0.6389883",
"0.63275653",
"0.6318416",
"0.6314355",
"0.6312289",
"0.63096946",
"0.6291799",
"0.62898153",
"0.6279119",
"0.62787396",
"0.62729055",
"0.62665266",
"0.6242661",
"0.6237308",
"0.6229047",
"0.6225965",
"0.6222252",
"0.6220554",
"0.6211691",
"0.62069726",
"0.62067693",
"0.62065583",
"0.6206328",
"0.6205592",
"0.6199877",
"0.6198881",
"0.619841",
"0.6188962",
"0.6188763",
"0.61754763",
"0.6170626",
"0.61607105",
"0.6158769",
"0.61511314",
"0.61503625",
"0.61466414",
"0.61466414",
"0.6145557"
] |
0.7587487
|
1
|
Ignored by Nanoc 3
|
def get_filter(db, fid)
filter = db[:text_filters].where("id = ?", fid).get(:name).downcase
# Multiple filters are not handled (e.g. markdown smartypants)
filter = filter.split(' ')[0]
# Prepare metadata
case filter
when 'textile' then
return ['redcloth'], 'textile'
when 'markdown' then
return ['bluecloth'], 'markdown'
when 'bbcode' then
return ['bbcode'], 'bbcode'
else
return [], 'txt'
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def ignores; end",
"def doc; end",
"def doc; end",
"def doc; end",
"def doc; end",
"def ignore; end",
"def pre #:doc:\n end",
"def private; end",
"def doc=(_arg0); end",
"def doc=(_arg0); end",
"def doc=(_arg0); end",
"def missing; end",
"def docs=(_arg0); end",
"def document=(_arg0); end",
"def document=(_arg0); end",
"def document=(_arg0); end",
"def document=(_arg0); end",
"def document=(_arg0); end",
"def document=(_arg0); end",
"def document=(_arg0); end",
"def document=(_arg0); end",
"def document=(_arg0); end",
"def nosotros\n end",
"def print_undocumented_objects; end",
"def nodoc\n @hide_commands_without_desc and description.nil?\n end",
"def extra; end",
"def probers; end",
"def nodoc_comment?(node, require_all: T.unsafe(nil)); end",
"def docstring; end",
"def docstring; end",
"def docs; end",
"def initialize(doc); end",
"def ignore_test_structs_are_inherited\n #add_bundle_dir(File.expand_path(selfdir + \"/concretedocs\"), \"concretedocs\")\n deploy(selfdir + \"app\", [selfdir + \"concretedocs/base.sd\", selfdir + \"concretedocs/usebase.sd\"])\n start\n feed(:file => selfdir + \"docs.json\")\n assert_hitcount(\"query=sddocname:usebase\", 1)\n end",
"def unused\n end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def custom; end",
"def custom; end",
"def document?; end",
"def document?; end",
"def base_docstring; end",
"def caveats; nil end",
"def caveats; nil end",
"def process!(document); end",
"def ismn; end",
"def missing?; end",
"def gounod; end",
"def no_doc!\n @controller.doc = false\n end",
"def nocov_token(nocov_token = T.unsafe(nil)); end",
"def skip_token(nocov_token = T.unsafe(nil)); end",
"def internal; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def document; end",
"def isatty()\n #This is a stub, used for indexing\n end",
"def yyerrok; end",
"def yyerrok; end",
"def usage; end",
"def usage; end",
"def extra_annotations; end",
"def yardoc_file; end",
"def request_doc\n \n end",
"def notations; end",
"def parslet; end",
"def parslet; end",
"def parslet; end",
"def parslet; end",
"def rassoc(p0) end",
"def docstring=(_arg0); end",
"def html5_noti\n \n end",
"def load_yardoc(file = T.unsafe(nil)); end",
"def support_rdoc_document_file!(file = T.unsafe(nil)); end",
"def isolated; end",
"def isolated; end",
"def verdi; end",
"def never_lines; end",
"def never_lines; end",
"def start_document; end",
"def start_document; end",
"def docstring_hash_flag; end",
"def internal?; end"
] |
[
"0.6449991",
"0.62031597",
"0.62031597",
"0.62031597",
"0.62031597",
"0.6191442",
"0.6183876",
"0.6173716",
"0.614977",
"0.614977",
"0.614977",
"0.60011095",
"0.6001013",
"0.5989082",
"0.5989082",
"0.5989082",
"0.5989082",
"0.5989082",
"0.5989082",
"0.5989082",
"0.5989082",
"0.5989082",
"0.5952939",
"0.59380186",
"0.5887383",
"0.58625853",
"0.5793481",
"0.578281",
"0.57647437",
"0.57647437",
"0.5763621",
"0.5742638",
"0.5712442",
"0.5705377",
"0.569028",
"0.569028",
"0.569028",
"0.569028",
"0.56810904",
"0.56810904",
"0.5658595",
"0.5658595",
"0.5652607",
"0.56322366",
"0.56322366",
"0.5631996",
"0.56215924",
"0.56187195",
"0.5611086",
"0.5610957",
"0.5610669",
"0.55840224",
"0.55723864",
"0.5569299",
"0.5569299",
"0.5569299",
"0.5569299",
"0.5569299",
"0.5569299",
"0.5569299",
"0.5569299",
"0.5569299",
"0.5569299",
"0.5569299",
"0.5569299",
"0.5569299",
"0.5569299",
"0.5569299",
"0.5569299",
"0.5569299",
"0.5569299",
"0.5569299",
"0.5569299",
"0.5569299",
"0.5565227",
"0.5561393",
"0.5561393",
"0.55500436",
"0.55500436",
"0.5546337",
"0.5530835",
"0.55054694",
"0.54974806",
"0.54969394",
"0.54969394",
"0.54969394",
"0.54969394",
"0.5486008",
"0.54752725",
"0.5463527",
"0.5455543",
"0.5451486",
"0.5446354",
"0.5446354",
"0.54402256",
"0.54388994",
"0.54388994",
"0.5431477",
"0.5431477",
"0.54305506",
"0.5427722"
] |
0.0
|
-1
|
Add top tweets data onto feeds GET /feeds_with_top_tweets
|
def feeds_with_top_tweets
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def feed_tweets(max_tweets = nil, latest_date = nil )\n @tweets = Tweet.joins(:user)\n .joins(\"LEFT OUTER JOIN follows ON users.id = follows.followee_id\")\n .where(\"tweets.user_id = :id OR follows.follower_id = :id\", id: self.id)\n .order(\"tweets.created_at DESC\")\n .uniq\n #debugger\n\n @tweets = @tweets.limit(max_tweets) if max_tweets\n @tweets = @tweets.where(\"tweets.created_at < ?\", latest_date)\n\n @tweets\n end",
"def recent_tweets(count)\n start(\"/recent/tweets/#{count}\")\n end",
"def index\n @tweets = current_user.feed_tweets.order(id: :desc).page(params[:page])\n @tweet = current_user.tweets.build\n end",
"def get_latest_tweets(num_of_tweets)\n client = configure_authentication\n latest = client.home_timeline({:count => num_of_tweets})\n client.end_session\n info = latest.to_json\n end",
"def top_tweets(percentage_integer)\n\t\tputs \"Pulling top #{percentage_integer}% tweets\"\n\t\ttweets = []\n\t\ttwitter_accounts.each do |ta|\n\t\t\t# twitter_account.top_tweets pulls the top tweets for a given account\n\t\t\ttweets = tweets + ta.top_tweets(percentage_integer)\n\t\tend\n\t\ttweets\n\tend",
"def index\n @tweets = Tweet.all\n @user = current_user\n @recent_tweets = Tweet.order(created_at: :desc).limit(10)\n @pop_tweets = Tweet.order(likes_count: :desc).limit(10)\n @tweet = Tweet.new\n #@users # 基於測試規格,必須講定變數名稱,請用此變數中存放關注人數 Top 10 的使用者資料\n end",
"def latest_tweets\n client = Twitter::REST::Client.new do |config|\n config.consumer_key = ENV[\"TWITTER_CONSUMER_KEY\"]\n config.consumer_secret = ENV[\"TWITTER_CONSUMER_SECRET\"]\n end\n\n count = params[:count] || 10\n time_line = client.user_timeline(current_user.twitter_handle, {count: count})\n current_user.update(time_fetched: current_user.time_fetched+1)\n if time_line.class == Twitter::Error::NotFound\n render json: {status: 400, success: false, message: 'Twitter handle or id not valid'}\n else\n render json: {status: 200, success: true, message: 'Success', data: time_line.map{|a| a.text}.as_json}\n end\n\n rescue => e\n Rails.logger.error \"account_controller#latest_tweets - Error: #{e.message}\"\n render json: {status: 500, success: false, message: 'Unexpected error'}\n end",
"def latest_tweets(k=5)\n\n # Get the tweets\n response = make_response(\"statuses\",\"user_timeline\")\n timeline = JSON.parse(response.body)\n tweets = timeline[0..k-1]\n\nend",
"def show_tweets\n @user = get_user_or_current_user(params[:id])\n @tweets = Tweet.where(:user_id => @user.id).order(created_at: :desc)\n end",
"def getThreeTweets\n\t\trender json: TwitterAPI.get_top_3_tweets(params[:twitter_id])\n\tend",
"def display_new_retweets\n\t@curr_top = @top_after_new_stream\n\tclear_screen\n\tputs \"\"\n\tputs \"*\"*50\n\tputs \"TOP RETWEETS IN LAST #{@user_defined_window} MINUTE(S)\"\n\tputs \"*\"*50\n\tputs \"\"\n\t@curr_top.each do |retweet|\n\t\ttext = @tweet_db[retweet[0]][:original].text.gsub(/\\n/,\" \")\n\t\tcount = retweet[1]\n\t\tputs \"Retweet Count: #{count} Text: #{text}\"\n\tend\nend",
"def show\n set_up_twitter\n\n get_last_tweet\n get_five_last_tweets\n end",
"def index\n @tweets = Tweet.all.order(created_at: :desc)\n end",
"def recent_feed_items(limit = 100)\n feed_items.order('created_at DESC').limit(limit)\n end",
"def timeline\n tweets = []\n following.merge(my_info).each do |nick,url|\n tweets.concat timeline_for_user(nick,url)\n end\n tweeets = tweets[-timeline_limit, timeline_limit].sort_by { |h| h[:date] }\n (timeline_sort == 'descending') ? tweets.reverse : tweets\nend",
"def index\n @tweets = Tweet.all.order(created_at: :desc).page(params[:page]).per(25)\n @tweet = Tweet.new\n end",
"def top(url)\n response = HTTP.get(url)\n return response.to_s unless response.code != 200\n raise(\"Couldn't get the top posts, #{response.body}\")\n end",
"def init_tweets(tweeter)\n all_tweets = Twitter.user_timeline(tweeter.user, :trim_user => true, :count => 200, :include_rts => true)\n tweeter.latest_tweet = all_tweets.first.id\n tweeter.twit_id = all_tweets.first.user.id\n page = 2\n\n until all_tweets.empty?\n for item in all_tweets do\n Tweet.new(:data => item, :city_id => self.id, :user => tweeter.id, ).save\n end\n all_tweets = Twitter.user_timeline(tweeter.user, :trim_user => true, :count => 200, :include_rts => true, :page => page)\n page += 1\n end\n\n end",
"def load_twitter_data\n create_twitter_client\n twitter_feeds = current_user.feeds.where(provider: \"twitter\")\n\n twitter_feeds.each do |feed|\n @client.user_timeline(feed.uid.to_i).each do |tweet|\n feed.posts.find_or_create_by(\n author_name: tweet.user.name,\n author_handle: tweet.user.handle,\n author_profile_pic: tweet.user.profile_image_uri.to_s,\n content: tweet.text,\n uid: tweet.id.to_s,\n posted_time: tweet.created_at\n )\n end\n end\n end",
"def feed\n feed_items.desc(:created_at).limit(10).to_a\n end",
"def top_tweets(percentage_integer)\n\t\ttweets = tweets_since(48.hours.ago)\n\t\tif tweets.length < 1\n\t\t\ttweets = last(200)\n\t\tend\n\t\tarray_length = tweets.length\n\t\tpercentage_float = percentage_integer.to_f / 100\n\t\ttop_length = array_length.to_f * percentage_float\n\t\tranked = ranked_by_score(tweets)\n\t\ttweets = ranked[0..top_length - 1]\n\tend",
"def sorted_tweets\n tweets_list = most_retweeted.concat(favorited_tweets).concat(others_tweets)\n tweets_list\n end",
"def tweets\n @tweets = @user.tweets.order(created_at: :desc).paginate(:page => params[:page], :per_page => 5) # order OWN tweets according to when they were created, with the most recent tweet at the top.\n respond_to do |format|\n format.html\n format.js\n end\n end",
"def print_timeline(tweets)\n tweets.each do |tweet|\n count = 0\n if count < 10\n puts tweet[\"text\"]\n puts\n count += 1\n end\n end\nend",
"def tweets_by_tag\n @tag = Tag.find(params[:id])\n @tweets = @tag.tweets.order(created_at: :desc) # order the tweets according to when they were created, with the most recent tweet at the top.\n end",
"def index\n @feeds = Feed.all.order(\"updated_at DESC\")\n end",
"def recent_tweets\n @_recent_tweets ||= timeline.each_with_object([]) do |tweet, memo|\n age_of_tweet_in_days = (Time.now.to_date - tweet.created_at.to_date).to_i\n memo << tweet if age_of_tweet_in_days <= 7\n end\n end",
"def tweets\n @_tweets ||= client.filter_tweets(screen_names)\n end",
"def index\n chain = Tweet\n chain = chain.since_id(params[:since_id]) if params[:since_id]\n @tweets = chain.all(:order => 'msg_twid ASC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tweets }\n end\n end",
"def search\n @tweets = TwitterClient.search(params[:query], result_type: 'recent').take(20)\n render json: @tweets\n end",
"def topusers\n\t\t@topusers = User.find(:all, :order => \"points DESC\", :limit => \"10\")\n\tend",
"def feed\n\t\t@goths = Goth.find(:all, :conditions => 'published_at IS NOT NULL', :limit => 10, :order => 'published_at DESC')\n\tend",
"def index\n @users = User.all\n\n set_up_twitter\n\n @users.each do |user|\n tweets = @client.user_timeline(user.twitter_id, count: 5)\n user.last_tweet = tweets.first.full_text\n end\n end",
"def show\n @user = User.find_by!(username: params[:username])\n #This saves user tweets in desc order.\n @tweets = @user.tweets.order(created_at: :desc)\n end",
"def get_home_timeline_tweets\n\n begin\n if @last_tweet_id\n response = ::Twitter.home_timeline(:since_id => @last_tweet_id)\n else\n response = ::Twitter.home_timeline(:count => 3)\n end\n rescue => exc\n return exc\n end\n\n response || []\n\n end",
"def add_weiner_twitter_feeds\n\tWeiner.get.each do |twitter_results|\n\n\tend\nend",
"def show_recent_posts(keyword, hours = 4)\n\tclient = Twitter::REST::Client.new(TWITTER)\n\tputs past = Time.now - (60*60*hours)\n\ttweets = Array.new\n\tclient.search(keyword).each do |tweet|\n\t\tif tweet.created_at >= past\n\t\t\tp tweet.created_at.class.name\n\t\t\ttweets.push timestamp: tweet.created_at, retweet_count: tweet.retweet_count, favorite_count: tweet.favorite_count, url: tweet.uri.to_s, text: tweet.text\n\t\telse\n\t\t\treturn tweets\n\t\tend\n\tend\nend",
"def get_all_tweets(user)\n collect_with_max_id do |max_id|\n options = {count: @limit, include_rts: true}\n options[:max_id] = max_id unless max_id.nil?\n $client.user_timeline(user, options)\n end\n end",
"def news\n #creamos el hash para mostrar los datos en la api\n @tweet = Tweet.includes(:likes)\n\n #User.includes(:posts)\n api = []\n @tweet.each do |tweet|\n api << Hash[:id => tweet.id, :content => tweet.content, :user_id => tweet.user_id, :likes_count => tweet.likes.count,:retweets_count => tweet.count_tweet,:rewtitted_from => tweet.tweet_id]\n end\n @tweets = api.last(50)#ultimos50 tweets\n render json: @tweets \n end",
"def top_posts(count = nil)\n mock_request = Rack::MockRequest.new(APP)\n return mock_request.get(top_posts_endpoint) unless count\n\n mock_request.get(top_posts_endpoint, { 'router.params' => { count: count }, format: :json })\n end",
"def user_tweets(user, count=10, since_id=nil, max_id=nil)\n print \"Getting Last %d Statuses for User %s\" % [count, user.to_s]\n print \" since %s\" % since_id if since_id\n print \" until %s\" % max_id if max_id\n print \"\\n\"\n options = {:count => count, :trim_user => true, :include_rts => true, :include_entities => true}\n options[:since_id] = since_id if since_id\n options[:max_id] = max_id if max_id\n begin\n statuses = @MT.user_timeline(user, options)\n if statuses.size > 0\n status_data = statuses.map do |s|\n {\n :user_id => s.user.id,\n :created_at => s.created_at,\n :id => s.id,\n :text => s.text,\n :source => s.source,\n :truncated => s[\"truncated\"],\n :in_reply_to_user_id => s[\"in_reply_to_user_id\"],\n :in_reply_to_screen_name => s[\"in_reply_to_screen_name\"],\n :geo => s[\"geo\"],\n :coordinates => s[\"coordinates\"],\n :place => parse_place(s[\"place\"]),\n :contributors => s[\"contributors\"],\n :retweet_count => s[\"retweet_count\"],\n :entities => parse_entities(s.attrs[\"entities\"]),\n :retweeted_status => parse_retweeted_status(s[\"retweeted_status\"])\n }\n end\n status_data\n else\n []\n end\n rescue Twitter::Error::Unauthorized, Twitter::Error::Forbidden\n puts \"Failed for %s (Protected)\" % user.to_s\n []\n end\n end",
"def fetch_user_timeline(n=200)\n tweets.destroy_all if n == 200\n statuses = Twitter.user_timeline(screen_name, count: n)\n Tweet.many_from_twitter(statuses)\n end",
"def authors_top\n\t\t\t@db.js('musicthoughts.top_authors($1)', [20])\n\t\tend",
"def get_timeline(count=1000)\n # Max number of tweets is 3200\n count = [count, 3200].min\n options = {}\n\n # Cache timeline array\n if @timeline.count < count\n while @timeline.count < count\n\n # Can only retrieve 200 per request\n options[:count] = [200, count - @timeline.count].min\n\n # Duplicate tweets\n options[:max_id] = @timeline.last.id unless @timeline.empty?\n\n # max_id gets results with id less than AND equal to so get 1 more tweet\n # also need to avoid putting in the same tweet\n if options[:max_id]\n options[:count] = options[:count] + 1\n tweets = Twitter.user_timeline(@screen_name, options)\n\n # Top tweet is the max_id so delete index 0\n tweets.shift\n else\n tweets = Twitter.user_timeline(@screen_name, options)\n end\n\n # Tweets come in an array so add each individually\n tweets.each { |tweet| @timeline.push(tweet) }\n end\n end\n end",
"def tweets(options={})\n\n @tweets=(@tweets.empty? || (@last_tweets_options!=options)) ? @tweets=read_tweets(self.id, options) : @tweets\n @last_tweets_options=options\n @tweets\n end",
"def index\n @news_main_topics = NewsTopic.includes(:creator).order('id DESC').limit(10)\n @top_news = NewsTopic.top_news.order('id DESC').limit(10)\n end",
"def get_top_trends\n trend_info = TrendDatum.find_by_sql(\n [\n 'select locations.name as city, locations.country as country,\n trends.name as name, count(trend_data.trend_id) as value_occurrence from trend_data\n inner join locations on trend_data.location_id = locations.id\n inner join trends on trend_data.trend_id = trends.id\n group by trend_data.trend_id order by value_occurrence desc limit 20'\n ]\n )\n\n trending_data = []\n trend_info.each do |trend_data|\n trend_data_point = LocalTrendData.new(trend_data.country, trend_data.city, trend_data.name)\n unless trend_data_point.nil?\n trending_data.push trend_data_point\n end\n end\n trending_data\n end",
"def fetch_tweets_stream(trend_topic, type, count, poltu_code)\n response = @twitter_client.search(trend_topic,\n result_type: type, count: count)\n # The each enumerations will automatically make call to the next_results\n # Handling the limir_error gracefully.\n response.each do |tweet|\n # puts response.attrs[:statuses].size\n # puts response.attrs[:search_metadata]\n begin\n save_tweet(tweet, trend_topic, poltu_code)\n # break\n rescue Twitter::Error::TooManyRequests => error\n @logger.info(format('Rate limit reached. Sleeping for %s secs.',\n error.rate_limit.reset_in))\n @logger.info($!)\n sleep error.rate_limit.reset_in + 1\n retry\n end\n end\n end",
"def timeline\n timeline = tweets.map { |tweet| tweet }\n all_following.each do |user|\n timeline += user.tweets.map { |tweet| tweet }\n end\n timeline.sort_by!(&:created_at).reverse\n end",
"def twitt\n if PLANETOID_CONF[:twitter][:entries][:send_twitts] && self.published > self.feed.created_at\n twit=Twitter::Base.new(Twitter::HTTPAuth.new(PLANETOID_CONF[:twitter][:user], PLANETOID_CONF[:twitter][:password]))\n twit.update \"#{PLANETOID_CONF[:twitter][:entries][:prefix]} #{self.title[0..150]} #{self.url}\"\n end\n end",
"def show\n @all_tweets = set_tweet_collection.tweets\n end",
"def new_tweets\n q = search.q(@search_term)\n q = q.since_id(@last_id) if @last_id\n tweets = q.fetch\n tweets.reverse!\n\n @last_id = tweets.last.id_str if tweets.last\n\n tweets\n end",
"def list_tweets\n tweets\n end",
"def index\n @tweeeets = Tweeeet\n @tweeeet = Tweeeet.new\n @tweeeets = Tweeeet.page.all.order(\"created_at DESC\")#ordena los tweets de forma descendente\n # @tweeeets = Tweeeet.order(created_at: :desc).page params[:page]\n\n\n end",
"def post_feed\n offset = params[:offset].to_i * 10;\n @follows = Follow.includes(:follower, :followee).where(:follows => {:follower_id => params[:userId]})\n @posts = User.find(params[:userId]).offset_feed_posts(offset)\n @hashtags = Hashtag.all\n render 'api/posts/index'\n end",
"def recent_topics(count: 10)\n Topic.reorder(updated_at: :desc).where(user_id: id).limit(count)\n end",
"def index\n # binding.pry\n @tweet = Tweet.new\n if current_user\n friend_ids = Friend.where(user_id: current_user).pluck(:friends_id) \n @tweets = Tweet.where(user_id: friend_ids)\n else\n @tweets = Tweet.includes([:user]).all\n end\n\n @tweets = @tweets.order(updated_at: :desc).page(params[:page]).per(10)\n end",
"def get_top_fans( params )\n LastFM.get( \"track.getTopFans\", params )\n end",
"def top10(url)\n\t\tlista=recorre(url)\n\t\tfor i in 1..10\n\t\t\tdatos(lista[i][0])\n\t\tend\n\tend",
"def user_tweets(user_hash, opts = {})\n client = self.client(user_hash)\n user_name = user_hash['name']\n\n opts = @default_user_tweets_options.merge(opts)\n\n expected_count = opts['count'] || 20\n max_id = nil\n\n Enumerator.new do |yielder|\n # make API request & return results in an enumerator\n loop do\n query_opts = opts\n if max_id\n query_opts = opts.clone\n query_opts['max_id'] = max_id\n end\n\n results = client.user_timeline(user_name, query_opts)\n results.each do |tweet|\n id = tweet['id']\n max_id = id if (max_id.nil? || id < max_id) # max_id should descend\n yielder << tweet\n end\n\n # TODO catch RateLimitExceeded exception\n\n break if results.size < expected_count # this can happen if optional params are passed in...\n\n max_id -= 1 # subtract 1 from max_id to avoid redundant messages\n end\n end\n end",
"def scan_top (period)\n posts = []\n top = @subreddit.get_top(t: period, limit: 100)\n @logger.puts \"Scanning Content\", \"Num\\tLast ID\"\n begin\n posts.concat top\n after = top.last.fullname\n @logger.puts \"#{top.count}\\t#{after}\"\n top = @subreddit.get_top(t: period, limit: 100, after: after)\n end until top.count < 100\n @logger.puts \"#{top.count}\\tdone\"\n\n if block_given?\n posts.map! do |post|\n yield post\n end\n end\n\n posts\n end",
"def index\n #FIXME_AB: including_associations for eager loading is not readable\n #fixed\n @tweets = Tweet.order(created_at: :desc).eager_loading_associations\n end",
"def index\n @tweet_dbs = TweetDb.all.sort({\"retweet\":-1})\n end",
"def get_top_news(start=0,count=TopNewsPerPage)\n numitems = $r.zcard(\"news.top\")\n news_ids = $r.zrevrange(\"news.top\",start,start+(count-1))\n result = get_news_by_id(news_ids,:update_rank => true)\n # Sort by rank before returning, since we adjusted ranks during iteration.\n return result.sort_by(&:rank), numitems\nend",
"def index\n authenticate\n @tweets = Tweet.where(\n user_id: current_user.id,\n stat: nil\n ).order(:id)\n end",
"def get_tweets(screen_name, num_tweets)\n\t\n\tresult = \"\"\n #Query num_tweets tweets from screen_name and create the HTML\n Twitter.user_timeline(screen_name, {\"count\" => num_tweets}).each do |tweet|\n \tlinkified = linkifyTweet(tweet.text)\n \tresult = result + \"<li class=\\\"tweet\\\">\n <span class=\\\"gentle\\\">#{linkified}</span>\n </li>\"\n end\n return result\nend",
"def index\n @tweet = Tweet.new\n @comment = Comment.new\n @tweets = Tweet.all.order('created_at DESC')\n @friends = current_user.get_friends\n end",
"def index\n\t\t@tweets = current_user.tweets\n\tend",
"def get_news_feed(user_id)\n ids = []\n @follows[user_id] = { user_id => 1 } unless @follows.key?(user_id)\n @alltweets.reverse_each do |uid, tid|\n ids << tid if uid == user_id || @follows[user_id][uid]\n return ids if ids.size >= 10 \n end\n ids\n end",
"def index\n @tweets = Tweet.all\n @last_tweet = @tweets.max_by{ |x| x.id}\n\n #100.times {\n # @tweets = Tweet.find(:all, :conditions => [ \"id > ?\", \"#{@last_tweet.id}\" ]) \n # @last_tweet = @tweets.max_by{ |x| x.id}\n #}\n end",
"def filter_articles(articles)\n include PopularitySearch\n #this isn't fair to more recent articles\n popularity_cutoff = 300\n articles.each do |article|\n article[:twitter_pop] = twitter_popularity(article[:url])\n end\n articles.select do |article|\n article[:twitter_pop] > popularity_cutoff\n end\n articles = articles.sort_by{|article| article[:twitter_pop]}.reverse\n return articles[0..2] #only pick the top 3 if there's more than 3\nend",
"def fetch_new_tweets(search_query, search_type)\n # max_id is inclusive\n new_tweets = method(\"search_tweets_by_#{search_type}\").call(search_query)\n end",
"def fetch_latest_tweets(last_id = self.tweets ? self.tweets.maximum(:twitter_id) : nil)\n options = { count: 4, include_rts: true }\n options[:since_id] = last_id if last_id\n begin\n response = twitter_connection.user_timeline(options)\n response.each do |tw_tweet|\n tweet = Tweet.find_or_initialize_by(twitter_id: tw_tweet.id)\n tweet.retweet_count = tw_tweet.retweet_count\n tweet.favorite_count = tw_tweet.favorite_count\n tweet.tweet_created_at = tw_tweet.created_at\n tweet.url = tw_tweet.url.to_s\n tweet.full_text = tw_tweet.full_text\n tweet.twitter_account_id = self.id\n tweet.save\n end\n fetch_latest_tweets( response.last.id ) if(response.last and (response.last.id != last_id))\n rescue => e\n ExceptionNotifier.notify_exception(e, {options: options.inspect, last_id: last_id.inspect})\n raise e.exception if Rails.env.development?\n end\n return true\n end",
"def collect_tweets\n result = []\n begin\n @hashtags.each do |hashtag|\n result.push search(hashtag)\n end\n\n store_last_id calculate_last_id result\n filter_tweets_with_urls result\n\n rescue EOFError, SocketError, Twitter::Error::ClientError\n @logger.error \"Connection to Twitter seems to be not available.\"\n return nil\n end\n end",
"def top_spots(user_id=self.username)\n connection.get(\"/users/#{user_id}/top_spots\").body.top_spots\n end",
"def index\n @feeds = Feed.all.order('pub_date ASC')\n end",
"def fetch_user_timeline\n statuses = client.user_timeline(user_timeline_options)\n tweets = TweetMaker.many_from_twitter(statuses, project: project, twitter_account: self, state: :posted)\n update_max_user_timeline_twitter_id(tweets.map(&:twitter_id).max)\n tweets\n # If there's an error, just skip execution\n rescue Twitter::Error\n false\n end",
"def index\n @new_tweets = NewTweet.all\n end",
"def fetch_tweets!\n Twitter.user_timeline(username).each do |tweet|\n unless Tweet.where(twitter_user_id: self.id).find_by_content(tweet.text) \n self.tweets << Tweet.create(content: tweet.text)\n end\n end\n end",
"def retrieve_posts\n # Get posts\n rss = RSS::Parser.parse(AWL_RSS_URL)\n\n # Grab shortened URLs\n links = rss.items.map(&:guid).map(&:content)\n\n @articles = []\n\n links.each do |link|\n @articles << Article.new(link)\n end\n\n # TODO: Only grab the tags for articles that haven't already be tweeted\n @articles.map(&:retrieve_tags)\n end",
"def user_timeline(query={})\n\t\t# La fonction user_timeline est disponible à partir de l'API REST mais pas à partir de l'API \"twitter\", j'ai refait la fonction à la main \n\t\tHTTParty.get('http://twitter.com/statuses/user_timeline.json', :query => query)\n end",
"def feed_after(latest_update) \n\tif latest_update.present? \n\t\tself.feed.where(\"microposts.updated_at > ?\", latest_update)\n\tend\n end",
"def set_top_10_related_sub_reddits\n @top_10_related_sub_reddits = RelatedSubReddit\n .order(weight: :desc)\n .limit(20)\n .all\n .to_a\n .each_slice(2).map(&:last)\n end",
"def feed\r\n\t\t@blogs = Blog.find(:all, :conditions => { :is_indexed => true, :is_complete => true }, :order => \"created_at DESC\")\r\n\t\trender :action => :feed, :layout => false\r\n\tend",
"def top_five\n order = params[:order].try(:downcase)\n ascending = order == 'asc'\n\n @foos = Foo.order(:foo_date).reverse_order.to_a.take(5)\n @foos.reverse! if ascending\n\n render json: @foos\n end",
"def index\n # start_day = DateTime.now.prev_month\n # populars = Like.where(\"created_at > ?\", start_day).group(:feed_id).order(\"count_feed_id desc\").count(:feed_id)\n \n search_start_time = (DateTime.now - 1).utc\n populars = Like.where(\"created_at > ?\", search_start_time).group(:feed_id).order(\"count_feed_id desc\").count(:feed_id)\n \n feed_ids = populars.keys\n # @populars = Feed.find(feed_ids)\n @populars = Feed.where(id: feed_ids).where(\"created_at > ?\", search_start_time)\n end",
"def index\n \t@ratings = Rating.includes(:user, beer: :brewery).all\n @top3Beers = topbeer @ratings, 3\n @top3Breweries = topbrewery @ratings, 3\n @top3Raters = User.top 3\n @top3Styles = topstyle @ratings, 3\n @recent = @ratings.order(created_at: :desc).limit(5)\n end",
"def topTenBooks\n\t\t@requests = requests.order('count desc').limit(10)\n\tend",
"def fetch_full_user_timeline(screen_name, options={})\n opts = HashWithIndifferentAccess.new(options)\n opts[:max_id] ||= MAX_TWEET_ID\n opts[:since_id] ||= 1\n retries = opts.delete(:retry) == false ? 0 : 6\n be_verbose = opts.delete(:verbose) == false ? false : true\n all_tweets = []\n while opts[:max_id] > opts[:since_id]\n puts \"Tweets collected: #{all_tweets.count}; max_id: #{opts[:max_id]}\" if be_verbose\n begin\n tweets = fetch_user_timeline(screen_name, opts).collect(&:to_h)\n rescue Twitter::Error::TooManyRequests => err\n if retries > 0\n retries -= 1\n if retries > 3\n sleep_time = 20\n else\n sleep_time = err.rate_limit.reset_in + 1\n end\n puts \"Error: #{err}\", \"Sleeping for #{sleep_time}\" if be_verbose\n sleep sleep_time\n else\n raise err\n end\n rescue => err\n if TWITTER_500_ERRORS.include?(err.class) && retries > 0\n retries -= 1\n # sleep for two minutes\n sleep_time = 120\n puts \"Error: #{err}\", \"Sleeping for #{sleep_time}\" if be_verbose\n sleep sleep_time\n retry\n else\n raise err\n end\n else\n if( t = tweets.last )\n all_tweets.concat tweets\n opts[:max_id] = t[:id] - 1\n else\n opts[:max_id] = 0 # this will break the loop\n end\n end\n end\n\n return all_tweets\n end",
"def index\n @updated_posts = Post.order(updated_at: :desc)[0..5]\n @newest_posts = Post.order(updated_at: :desc)[0..5]\n end",
"def top_rentals\n return @badfruit.parse_movies_array(JSON.parse(@badfruit.get_lists_action(\"top_rentals\")))\n end",
"def top_ten\n Rails.cache.fetch('top_ten_resp', expires_in: 1.minutes) do\n conn = Faraday.new(url: @base_url) do |faraday|\n faraday.adapter(Faraday.default_adapter)\n end\n\n resp = conn.get do |req|\n req.url '/v1/cryptocurrency/listings/latest'\n req.headers['X-CMC_PRO_API_KEY'] = @api_key\n req.params['start'] = 1\n req.params['limit'] = 10\n req.params['convert'] = 'USD'\n req.params['sort'] = 'market_cap'\n req.params['sort_dir'] = 'desc'\n end\n\n raise 'Cannot parse response body' unless resp.body\n\n resp.body\n end\n end",
"def index\n @urls = Url.get_top(25)\n # render json: @urls\n end",
"def top_tags\n\n keys = ((params[:time] && params[:time].to_i) || 6).times.map do |i| \n at = (i*10).minutes.ago\n \"#{at.year}:#{at.month}:#{at.day}:#{at.hour}:#{at.min/10}\"\n end\n\n hashtags = keys.reduce({}) do |acc, k|\n $redis.zrevrange(k, 0, -1, {with_scores: true}).each do |hashtag, value|\n acc[hashtag] = (acc[hashtag] || 0) + value.to_i\n end\n acc\n end\n\n @tags = hashtags.to_a.sort{|a, b| b.second <=> a.second}.map{|h| {name: h[0], value: h[1]}}.first((params[:count] && params[:count].to_i) || 50)\n\n respond_to do |format|\n format.html\n format.json { render json: @tags }\n end\n\n end",
"def twitter\n @user = User.find(session[:user_id])\n t = @user.twitter\n unless t.present?\n redirect_to @user, :notice => \"Please add your twitter account!\"\n return\n end\n @tweets = t.home_timeline\n @posts = []\n @tweets.each do |tweet|\n if Post.exists?(:tweet_id => tweet[:id])\n @posts.push(Post.find_by_tweet_id(tweet[:id]))\n else\n p = Post.new\n p.tweet_id = tweet[:id]\n p.tweeter_twitter_id = tweet[:user][:id]\n if User.exists?(:twitter_id => tweet[:user][:id])\n p.user_id = User.find_by_twitter_id(tweet[:user][:id]).id\n else\n p.user_id = -1\n end\n p.post_type = 3\n p.created_at = tweet[:created_at].to_datetime\n url = \"https://api.twitter.com/1/statuses/oembed.json?id=#{tweet[:id]}&omit_script=true\"\n begin\n tweet_page = open(URI.parse(url))\n p.body = JSON.parse(tweet_page.read)['html']\n if p.save!\n @posts.push(p)\n end\n rescue\n # Tried to access a protected tweet, just skip it\n end\n end\n end\n\n @body_class = 'twitter-background'\n respond_to do |format|\n format.html # twitter.html.erb\n format.json { render json: @posts }\n end\n end",
"def get_user_tweets\n @tweets = COLL.find(\n selector = {\"user.id\" => @user[:id]},\n opts={ :sort=>[\"created_at\", Mongo::ASCENDING],\n :fields=>[\"coordinates\",\"user\",\"text\",\"created_at\", \"entities\", \"place\"]\n })\n\n @user[:tweet_count] = @tweets.count\n @tweets.count > 1\n end",
"def recent\n @limit = 10\n @webhooks = Webhook.limit(@limit).order(id: :desc)\n end",
"def index\n @user_feeds = UserFeed.find_all_by_user_id(current_user.id)\n end",
"def index\n # Load the latest full blog feed for Frank's blog as per \n @latest_blog_posts = load_blog_feed_for_url('http://blog.rietta.com/feeds/posts/default?alt=rss')\n \n # Load the latest posts for the Marketing label feed. Labels are case sensitive - Marketing != marketing\n # Please note that the example of the Google website has an error on its label example. The alt=rss comes after\n # the label in the feed URL\n @latest_marketing_posts = load_blog_feed_for_url('http://blog.rietta.com/feeds/posts/default/-/Marketing?alt=rss')\n \n # Load the latest posts for the SQL Converter label feed (space in the tag)\n @latest_sql_converter_posts = load_blog_feed_for_url('http://blog.rietta.com/feeds/posts/default/-/SQL%20Converter?alt=rss')\n end",
"def index\n @project = Project.find(params[:project_id])\n \n #depending if I am showing all entries or only the persons entries.\n @count = 0\n if params[:person_id] == nil\n @show_all = true\n @feed_entries = []\n @grouped_entries = []\n @grouped_by_hashtags = {}\n @grouped_by_replies = {}\n @grouped_urls = {}\n @feed_entries_count = @project.feed_entries_count\n @feed_entries = @project.feed_entries(1000).paginate :page => params[:page]\n \n \n #Get a distribution of collected tweets per person.\n @feed_entries_pp = {}\n @project.persons.each do |person|\n key = (FeedEntry.count(:conditions => \"person_id = #{person.id}\") / 100).to_i*100\n begin\n @feed_entries_pp[key] += 1\n rescue\n @feed_entries_pp[key] = 1\n end \n end\n @feed_entries_pp = @feed_entries_pp.sort{|a,b| a <=> b}\n\n @retweets_distr = {}\n @project.persons.each do |person| \n person.feed_entries.each do |f| \n key = f.retweet_count.to_i \n if key > 0\n begin\n @retweets_distr[key] += 1\n rescue\n @retweets_distr[key] = 1\n end\n end\n end\n end\n @retweets_distr = @retweets_distr.sort{|a,b| a <=> b}\n\n else \n @person = Person.find(params[:person_id])\n @feed_entries_count = @person.feed_entries.count\n @feed_entries = @person.feed_entries.paginate :page => params[:page], :order => 'updated_at DESC' \n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @feed_entries }\n end\n end"
] |
[
"0.7275259",
"0.7072762",
"0.6885682",
"0.68314815",
"0.670396",
"0.6624022",
"0.66227055",
"0.6522871",
"0.6467999",
"0.64549625",
"0.6415657",
"0.64075404",
"0.637743",
"0.6356602",
"0.63205814",
"0.6310111",
"0.6289296",
"0.62812",
"0.62709296",
"0.6202506",
"0.6184749",
"0.61745685",
"0.61716455",
"0.6142025",
"0.61260885",
"0.6111282",
"0.61061054",
"0.60981673",
"0.60886383",
"0.60876",
"0.60551536",
"0.6053661",
"0.6045679",
"0.6041087",
"0.60406363",
"0.60225165",
"0.60152555",
"0.59906864",
"0.5971382",
"0.5966835",
"0.5945025",
"0.59428114",
"0.5924331",
"0.59183663",
"0.5918199",
"0.5917304",
"0.59103847",
"0.59002674",
"0.58936775",
"0.58843154",
"0.5881962",
"0.5878633",
"0.5876684",
"0.58591217",
"0.5849942",
"0.5843215",
"0.58369476",
"0.5828346",
"0.5816207",
"0.5812552",
"0.5805464",
"0.58012354",
"0.57930434",
"0.57899594",
"0.57810825",
"0.5773481",
"0.5771375",
"0.576855",
"0.5764554",
"0.57559824",
"0.57459855",
"0.57275546",
"0.57143104",
"0.56999683",
"0.56905675",
"0.5686262",
"0.5685532",
"0.5678676",
"0.56718814",
"0.5671789",
"0.56620705",
"0.56615746",
"0.5657697",
"0.56515",
"0.56512046",
"0.5651011",
"0.5646985",
"0.56438684",
"0.5641951",
"0.5639436",
"0.5627937",
"0.5625959",
"0.5623556",
"0.5618398",
"0.56181556",
"0.55964434",
"0.5596059",
"0.55915135",
"0.5588039",
"0.55864495"
] |
0.8702587
|
0
|
Symlink the dynamic linker, ld.so
|
def symlink_ld_so
ld_so = HOMEBREW_PREFIX/"lib/ld.so"
return if ld_so.readable?
sys_interpreter = [
"/lib64/ld-linux-x86-64.so.2",
"/lib/ld-linux.so.3",
"/lib/ld-linux.so.2",
"/lib/ld-linux-armhf.so.3",
"/lib/ld-linux-aarch64.so.1",
"/system/bin/linker",
].find do |s|
Pathname.new(s).executable?
end
raise "Unable to locate the system's ld.so" unless sys_interpreter
interpreter = begin
glibc = Formula["glibc"]
glibc.installed? ? glibc.lib/"ld-linux-x86-64.so.2" : sys_interpreter
rescue FormulaUnavailableError
sys_interpreter
end
FileUtils.mkdir_p HOMEBREW_PREFIX/"lib"
FileUtils.ln_sf interpreter, ld_so
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def post_link_hook(linker)\n basic_name = get_basic_name(linker)\n soname = get_soname(linker)\n symlink_lib_to basic_name\n symlink_lib_to soname\n end",
"def post_link_hook(linker, bb)\n basic_name = get_basic_name(linker, bb)\n symlink_lib_to(basic_name, bb)\n end",
"def post_link_hook(linker, bb)\n basic_name = get_basic_name(linker, bb)\n soname = get_soname(linker, bb)\n symlink_lib_to(basic_name, bb)\n symlink_lib_to(soname, bb)\n end",
"def link\n throw 'Invalid linker' unless @ld.is_a?(Linker)\n throw 'One or more source files are required' unless @sources.length > 0\n cmd = @ld.command\n log.debug \"Invoking the linker: \" + cmd\n rc = Platform.execute cmd\n log.debug \"Linking complete; rc=#{rc.to_s}\"\n rc\n end",
"def linker cmdfile,config\n li=config['linker']\n raise GaudiConfigurationError,\"Missing 'linker' setting\" unless li\n return command_line(li,cmdfile,config.fetch('linker_commandfile_prefix',\"\"))\n end",
"def link exe, objects\n sh \"gcc #{objects.join ' '} -o #{exe} #{L_FLAGS.join ' '}\"\nend",
"def link(ld)\n makefile = Makefile.new\n ld.flags = @ldflags\n @ldadd = [ @ldadd ] if @ldadd.kind_of?(String)\n @ldadd.each { |lib| ld.library lib }\n ld.objects = self.objects\n ld.output = @output\n cmd = ld.rule \n makefile.add_target(output, self.objects, cmd)\n\n makefile.add_dependency('all', output)\n makefile.clean(output)\n makefile.distribute(sources) if distributable\n\n return makefile\n end",
"def create_helper_symlink\n FileUtils.symlink \"../lib\", normalize(\"codelib\"), :force => true\n end",
"def translate_ldadd(ldadd)\n static_libs = []\n # TODO: shared libs\n ldadd.each do |item|\n if item =~ /\\.a$/ \n if provides?(item) or item =~ /^obj\\/local\\//\n static_libs.push File.basename(item).sub(/\\.a$/, '-static')\n else\n static_libs.push File.basename(item).sub(/\\.a$/, '-prebuilt')\n end\n end\n end\n \n buf = ''\n buf += 'LOCAL_STATIC_LIBRARIES := ' + static_libs.join(' ') if static_libs\n buf\n end",
"def symlink_ruby_version\n current_ruby = `which ruby`.chomp\n FileUtils.symlink current_ruby, ruby_version_symlink_file unless ruby_version_symlink_file_exists?\n display.print \"New Symlink Created: #{ruby_version_symlink_file} from #{current_ruby}\"\n end",
"def link(params)\n\t\tobjs = ensureArray(requireParam(params, :objs))\n\t\ttarget = requireParam(params, :target)\n\t\totherOptions = params[:opts] || []\n\t\n\t\tprintAndCall(\"#{@LD} #{@LDFLAGS.join(' ')} #{otherOptions.join(' ')} -o #{target} #{objs.map {|entity| linkArgsFor(entity)}.join(' ')}\")\n\tend",
"def linked_dylibs\n # Some linkers produce multiple `LC_LOAD_DYLIB` load commands for the same\n # library, but at this point we're really only interested in a list of\n # unique libraries this Mach-O file links to, thus: `uniq`. (This is also\n # for consistency with `FatFile` that merges this list across all archs.)\n dylib_load_commands.map(&:name).map(&:to_s).uniq\n end",
"def symlink(old_name, new_name); end",
"def ld(lib)\n load lib.to_s + '.rb'\n end",
"def link_libraries\n if RbConfig::CONFIG[\"THREAD_MODEL\"] == \"pthread\"\n # Link gem extension against pthread library\n have_library \"pthread\"\n have_required_function \"pthread\", \"pthread_create\"\n end\n\n # Links gem extension against the `dl` library. This is needed when Ruby is\n # not linked against `dl` itself, so link it on the gem extension.\n have_library \"dl\"\n # Check if functions are available now from the linked library\n %w[dlopen dlclose dlsym].each do |func|\n have_required_function \"dl\", func\n end\nend",
"def link(filename, outdir, platform='linux')\n f = base(filename)\n cmd, args = *case platform\n when 'darwin'\n ['gcc', '-arch i386']\n when 'linux'\n ['ld', '']\n else\n raise \"unsupported platform: #{platform}\"\n end\n run_and_warn_on_failure(\"#{cmd} #{args} -o #{f} #{filename} 2>&1\")\n `chmod u+x #{f}`\n return f\nend",
"def rule\n ['$(LD)', flags, '$(LDFLAGS)', @objects, sorted_ldadd, '$(LDADD)'].flatten.join(' ')\n end",
"def vendorize_with_symlink\n FileUtils.symlink \"#{JSPEC_ROOT}/lib\", normalize('lib'), :force => true\n end",
"def linker_options component,system_config\n config=system_config.platform_config(component.platform)\n options= config.fetch('linker_options','').split(' ')\n options<< \"#{config['linker_out']}\\\"#{executable(component,system_config)}\\\"\"\n objects=component.sources.map{|src| object_file(src,component,system_config)}\n component.dependencies.each{|dep| objects+=dep.sources.map{|src| object_file(src,dep,system_config)}}\n objects.uniq!\n options+= prefixed_objects(objects,config[\"linker_in\"])\n shared_libs=component.shared_dependencies.map{|dep| library(dep,system_config)}\n options+= prefixed_objects(shared_libs,config[\"linker_shared\"]) \n options+= prefixed_objects(component.external_libraries,config[\"linker_lib\"])\n end",
"def make_symlink( old ) File.symlink( old, expand_tilde ) end",
"def linker_options(component, system_config)\n config = system_config.platform_config(component.platform)\n options = config.fetch(\"linker_options\", \"\").split(\" \")\n options << \"#{config[\"linker_out\"]}\\\"#{executable(component, system_config)}\\\"\"\n objects = component.sources.map { |src| object_file(src, component, system_config) }\n component.dependencies.each { |dep| objects += dep.sources.map { |src| object_file(src, dep, system_config) } }\n objects.uniq!\n options += prefixed_objects(objects, config[\"linker_in\"])\n shared_libs = component.shared_dependencies.map { |dep| library(dep, system_config) }\n options += prefixed_objects(shared_libs, config[\"linker_shared\"])\n options += prefixed_objects(component.external_libraries, config[\"linker_lib\"])\n end",
"def make_symlink(old) File.symlink(old, path) end",
"def link *args\n self.destination_and_options( args ) do |lnk, opts|\n symlink_requested = self.directory? || opts[:symbolic] || opts[:sym] || opts[:soft]\n \n if symlink_requested\n self.symlink lnk, opts\n else\n FileUtils.ln self, lnk, ** Utils::Opts.narrow_file_utils_options( opts, :ln )\n end\n \n lnk.fwf_filepath\n end\n end",
"def linkArgsFor(entity)\n\t\tcase BuildEnv::entityType(entity)[0]\n\t\t\twhen :cobj then return entity.to_s\n#as of 10 / 31 / 08, we never link internal static libs, because we can use their component object files instead with less annoyance\n#\t\t\twhen :intlib then return \"-L#{entity.dirname()} -l#{entity.basename().sub(entity.extname(), '')} -Wl,-rpath -Wl,#{entity.dirname()}\"\n\t\t\twhen :extlib then\n\t\t\t\tif BuildEnv::extlibHasLib?(entity)\n\t\t\t\t\tif BuildEnv::extlibHasDir?(entity)\n\t\t\t\t\t\treturn \"-L#{BuildEnv::extlibLibdir(entity)} -l#{BuildEnv::extlibBasename(entity)} -Wl,-rpath -Wl,#{BuildEnv::extlibLibdir(entity)}\"\n\t\t\t\t\telse\n\t\t\t\t\t\treturn \"-l#{BuildEnv::extlibBasename(entity)}\"\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\treturn \"\" #nothing to link, but the lib symbol is needed in order to find shared libs its headers depend on\n\t\t\t\tend\n\t\t\telse return ''\n\t\tend\n\tend",
"def symlink(existing_name, new_name)\n #windows mklink syntax is reverse of unix ln -s\n #windows mklink is built into cmd.exe\n _stdin, _stdout, _stderr, wait_thr =\n Open3.popen3('cmd.exe', \"/c mklink /d #{new_name.tr('/','\\\\')} #{existing_name.tr('/','\\\\')}\")\n wait_thr.value.exitstatus\n end",
"def dynamically_linked_libraries(except: :none)\n # The argument except is unused.\n puts if except == :unused\n metadata.dylibs\n end",
"def ld65_lib_paths(*more_paths)\n fail \"Sequence error: ld65_lib_paths\" unless [:create, :link].include?(@phase)\n append_option(:lib_paths, more_paths)\n @phase = :link\n end",
"def set_symlinks_for_jruby_commands\n %w(ruby irb).each do |item|\n FileUtils.ln_s(bin_path(\"j#{item}\"), bin_path(item))\n end\n end",
"def append_ld_flags(flags)\n flags = [flags] unless flags.is_a?(Array)\n with_ldflags(\"#{$LDFLAGS} #{flags.join(' ')}\") { true }\nend",
"def follow_symlinks; end",
"def write_create_symlinks_script(symlinks)\n File.open(SYMLINKS_SCRIPT, 'w') do |f|\n f.puts '#!/system/bin/sh'\n f.puts ''\n f.puts 'cd $(dirname $0)'\n f.puts ''\n f.puts \"single_file_binaries=\\\"#{symlinks.join(' ')}\\\"\"\n f.puts ''\n f.puts 'for i in $single_file_binaries; do'\n f.puts 'ln -s coreutils $i;'\n f.puts 'done'\n f.puts ''\n f.puts 'cd -'\n end\n FileUtils.chmod '+x', SYMLINKS_SCRIPT\n end",
"def install_symlink\n FileUtils.mkdir_p File.dirname(destination_path)\n FileUtils.symlink source_path, destination_path, force: true\n end",
"def ld65_libraries(*more_libs)\n fail \"Sequence error: ld65_libraries\" unless [:create, :link].include?(@phase)\n append_option(:libraries, more_libs)\n @phase = :link\n end",
"def follow_symlinks=(_arg0); end",
"def link fn,linkname\n\t\tif File.symlink?(linkname) and !Cfruby::FileOps::SymlinkHandler.points_to?(linkname,fn)\n\t\t\tCfruby.controller.inform('verbose', \"Existing #{linkname} is not pointing to #{fn}\")\n\t\t\tprint \"Existing #{linkname} is not pointing to #{fn}\\n\"\n\t\t\tCfruby::FileOps.delete linkname\n\t\tend\n\t\tif @cf.strict\n\t\t\tCfruby::FileOps.link fn,linkname\n\t\telse\n\t\t\tbegin\n\t\t\t\tCfruby::FileOps.link fn,linkname\n\t\t\trescue\n\t\t\t\tCfruby.controller.inform('verbose', \"Problem linking #{linkname} -> #{fn}\")\n\t\t\tend\n\t\tend\n\tend",
"def symlink_to_output(spec_path, destination_dir)\n spec_name = Pathname.new(spec_path).basename.to_s\n destination_spec_path = File.join(destination_dir, spec_name)\n FileUtils.symlink(File.expand_path(spec_path), destination_spec_path, force: true)\n end",
"def link\n display_change\n begin\n File.symlink(@real_path, new_path)\n rescue NotImplemented\n puts \"Error: cannot create symlinks\"\n end\n end",
"def create_symlink(dest_path); end",
"def link_jrnl_config\n local_config = \"jrnl.yaml\" # local config, specifies Dropbox file location\n system %Q{mkdir -p \"$HOME/.config\"}\n jrnl_config_path = File.join(ENV['HOME'], \".config\", \"jrnl\", \"jrnl.yaml\")\n FileUtils.touch(jrnl_config_path)\n puts \"linking #{jrnl_config_path}\"\n system %Q{ln -sf \"$PWD/#{local_config}\" #{jrnl_config_path}}\nend",
"def set_linker\n @linker = Linker.find(params[:id])\n end",
"def set_linker\n @linker = Linker.find(params[:id])\n end",
"def get_linker(linker)\n # return @linkers[linker]\n return get_fasta(@linkers,linker,\"linker\")\n end",
"def make_link(source:, link:)\n @output.item @i18n.t('setup.ln', target: link, source: source)\n FileUtils::rm link if (File::symlink? link and not File::exist? link)\n FileUtils::ln_s source, link unless File::exist? link\n end",
"def symlink_host_gcc\n version = DevelopmentTools.non_apple_gcc_version \"/usr/bin/gcc\"\n return if version.null?\n suffix = (version < 5) ? version.to_s[/^\\d+\\.\\d+/] : version.to_s[/^\\d+/]\n return if File.executable?(\"/usr/bin/gcc-#{suffix}\") || File.executable?(HOMEBREW_PREFIX/\"bin/gcc-#{suffix}\")\n FileUtils.mkdir_p HOMEBREW_PREFIX/\"bin\"\n [\"gcc\", \"g++\", \"gfortran\"].each do |tool|\n source = \"/usr/bin/#{tool}\"\n dest = HOMEBREW_PREFIX/\"bin/#{tool}-#{suffix}\"\n next if !File.executable?(source) || File.executable?(dest)\n FileUtils.ln_sf source, dest\n end\n end",
"def symlink_host_gcc\n version = DevelopmentTools.non_apple_gcc_version \"/usr/bin/gcc\"\n return if version.null?\n suffix = (version < 5) ? version.to_s[/^\\d+\\.\\d+/] : version.to_s[/^\\d+/]\n return if File.executable?(\"/usr/bin/gcc-#{suffix}\") || File.executable?(HOMEBREW_PREFIX/\"bin/gcc-#{suffix}\")\n FileUtils.mkdir_p HOMEBREW_PREFIX/\"bin\"\n [\"gcc\", \"g++\", \"gfortran\"].each do |tool|\n source = \"/usr/bin/#{tool}\"\n dest = HOMEBREW_PREFIX/\"bin/#{tool}-#{suffix}\"\n next if !File.executable?(source) || File.executable?(dest)\n FileUtils.ln_sf source, dest\n end\n end",
"def static=(value)\n linker.flags_before_libraries << \"-Wl,-B#{value ? 'static' : 'dynamic'}\"\n linker.flags_after_libraries << '-Wl,-Bdynamic'\n end",
"def externalize(obj, m_alias)\n dynlink(m_alias) do |*args|\n obj.call(*args)\n end\n end",
"def symlink(link=nil,existing=nil)\n if link.class == String && existing.class == String && block_given?\n @j_del.java_method(:symlink, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(link,existing,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling symlink(link,existing)\"\n end",
"def check_binary_linkage(binary, library)\n binary.dynamically_linked_libraries.any? do |dll|\n next false unless dll.start_with?(HOMEBREW_PREFIX.to_s)\n\n File.realpath(dll) == File.realpath(library)\n end\n end",
"def s_link(source_path, target_path)\n target_file = File.expand_path(target_path)\n\n # If the target file exists we don't really want to destroy it...\n if File.exists?(target_file) and not File.symlink?(target_file)\n puts \" ! Stashing your previous #{target_path} as #{target_path}.pre-mdf-bootstrap\"\n mv(target_file, File.expand_path(\"#{target_path}.pre-mdf-bootstrap\"))\n end\n\n if File.symlink?(target_file) and File.readlink(target_file).to_s != File.expand_path(source_path).to_s\n puts \" ! Existing symlink appears to point to incorrect file, moving it to #{target_file}.pre-mdf-bootstrap\"\n # Make a new link with the .old extension, pointing to the old target\n ln_s(File.readlink(target_file), File.expand_path(\"#{target_path}.pre-mdf-bootstrap\"))\n # Now we can get rid of the original target file to make room for the new link\n rm(target_file)\n end\n\n # At this point either the target file is the symlink we want,\n # or something weird happened and we don't want to replace it.\n unless File.exists?(target_file)\n # Counts on the fact that ln_s outputs \"puts\" the command for the user to see.\n ln_s(File.expand_path(source_path), target_file)\n end\nend",
"def symlink(old)\n warn 'Path::Name#symlink is obsoleted. Use Path::Name#make_symlink.'\n File.symlink(old, path)\n end",
"def make_link( old ) File.link( old, expand_tilde ) end",
"def file_linker(klass = nil)\n klass ? @file_linker = klass : get_inherited_attribute(\"@file_linker\")\n end",
"def symlink(dest, options = {})\n FileUtils.symlink(@path, dest, options)\n end",
"def symlink?() end",
"def lib_sh(cmd)\n sh \"RUBYLIB=lib #{cmd}\"\nend",
"def symlink!(path, target, &callback)\n wait_for(symlink(path, target, &callback))\n end",
"def right_link_dynamic_state_dir\n '/var/lib/rightscale/right_link'\n end",
"def right_link_dynamic_state_dir\n '/var/lib/rightscale/right_link'\n end",
"def link *a, &b; app.link *a, &b end",
"def symlinked_file(filepath)\n link_file = file(filepath)\n # /etc/letsencrypt/live/findwork.co/fullchain.pem ->\n # /etc/letsencrypt/live/findwork.co + / + ../../archive/fullchain1.pem\n return file(File.dirname(filepath) + File::SEPARATOR + link_file.link_target)\nend",
"def set_symlink(source,target)\n fail \"Original path doesn't exist or isn't a directory.\" unless File.directory?(source)\n fail \"Target already exists.\" unless File.directory?(target) == false\n puts \"creating a symlink from #{source} => #{target}.\"\n FileUtils.ln_s(source,target,:verbose => true)\n end",
"def readlink() self.class.new( File.readlink( expand_tilde ) ) end",
"def install_bin\n bin.install_symlink \"../opt/#{pkgname}/git-annex\"\n bin.install_symlink \"../opt/#{pkgname}/git-annex-shell\"\n bin.install_symlink \"../opt/#{pkgname}/git-annex\" => \"git-remote-tor-annex\"\n end",
"def link_target\n return if current_directory? && linked_path == current_path\n\n FileUtils.ln_s File.expand_path(current_path), current_directory\n end",
"def init_links(installed_path, tpkgfile)\n # I think users would rather have packages install without their init\n # scripts enabled than have them fail to install on platforms where we\n # don't have init script support.\n # raise NotImplementedError\n warn \"No init script support for OS #{os}\"\n []\n end",
"def fixLoadPath(oldpath,libpath,target)\n debug \"#{$install_name_tool} -change #{oldpath} #{$executableId}#{libpath} #{target}\"\n `#{$install_name_tool} -change #{oldpath} #{$executableId}#{libpath} #{target}`\nend",
"def conditional_link(source, target = source)\n source_dir = @onabase + \"/www/local/plugins/cfg_archive/bin/\"\n target_dir = @onabase + \"/bin/\"\n\n source_file = source_dir + source\n target_link = target_dir + target\n\n FileUtils.ln_sf(source_file, target_link)\nend",
"def symlink_scripts_to_root *script_names\n script_names.flatten.each do |name, val|\n script_file = File.join self.scripts_path, name.to_s\n pointer_file = File.join self.root_path, name.to_s\n\n @shell.symlink script_file, pointer_file\n end\n end",
"def make_symlink\n if not self.data['old-slug'].nil?\n path = File.join(CGI.unescape(self.url)).gsub(/^\\//, '')\n path = File.join(path, \"index.html\") if template[/\\.html$/].nil?\n path = File.join(site.dest, path)\n old_slug = File.join(site.dest, self.data['old-slug'])\n old_slug_dir = File.dirname(old_slug)\n path = (Pathname.new path).relative_path_from(Pathname.new old_slug_dir)\n\n # We write the symlink directly on the site destination\n FileUtils.mkdir_p(old_slug_dir)\n File.symlink(path, old_slug)\n end\n end",
"def symlink( *args )\n lnk, opts = self.destination_and_options( args )\n \n if opts[:absolute]\n lnk = lnk.fwf_filepath.expand\n else\n lnk = lnk.fwf_filepath\n end\n \n FileUtils.ln_s( self, lnk, ** Utils::Opts.narrow_file_utils_options( opts, :ln_s ) )\n lnk.fwf_filepath\n end",
"def symlinking_files\n linkables = Dir.glob('*/**{.symlink}')\n\n skip_all = false\n overwrite_all = false\n backup_all = false\n\n linkables.each do |linkable|\n overwrite = false\n backup = false\n\n file = File.basename(linkable).split('.')[0...-1].join('.')\n source = \"#{ENV[\"PWD\"]}/#{linkable}\"\n target = \"#{ENV[\"HOME\"]}/.#{file}\"\n\n puts \"======================#{file}==============================\"\n puts \"Source: #{source}\"\n puts \"Target: #{target}\"\n\n if File.exists?(target) || File.symlink?(target)\n unless skip_all || overwrite_all || backup_all\n puts \"File already exists: #{target}, what do you want to do? [s]kip, [S]kip all, [o]verwrite, [O]verwrite all, [b]ackup, [B]ackup all\"\n case STDIN.gets.chomp\n when 'o' then overwrite = true\n when 'b' then backup = true\n when 'O' then overwrite_all = true\n when 'B' then backup_all = true\n when 'S' then skip_all = true\n end\n end\n FileUtils.rm_rf(target) if overwrite || overwrite_all\n # run %{ mv HOME/.#{file}\" \"$HOME/.#{file}.backup } if backup || backup_all\n `mv \"$HOME/.#{file}\" \"$HOME/.#{file}.backup\"` if backup || backup_all\n end\n #run %{ ln -nfs \"#{source}\" \"#{target}\" }\n `ln -s \"$PWD/#{linkable}\" \"#{target}\"`\n puts \"==========================================================\"\n puts\n end\nend",
"def symlink(source, target=\".#{source}\")\n puts \"Symlinking #{dotfiles(source)} -> #{home(target)}\"\n if File.exist?(home(target))\n if user_confirms?(\"Overwrite\", home(target))\n FileUtils.ln_sf dotfiles(source), home(target) unless dry_run?\n else\n puts \"Skipping #{source}\"\n end\n else\n FileUtils.ln_sf dotfiles(source), home(target) unless dry_run?\n end\n end",
"def fake_embedded_bin(name)\n bin = File.join(software.install_dir, 'embedded', 'bin')\n\n FileUtils.mkdir_p(bin)\n FileUtils.ln_s(Bundler.which(name), File.join(bin, name))\n end",
"def ftype\n :symlink\n end",
"def dlopen library\n begin\n Fiddle::Handle.new(library)\n rescue DLError => error\n case RUBY_PLATFORM\n when /linux/\n case error.message\n when /\\A(\\/.+?): (?:invalid ELF header|file too short)/\n # This may be a linker script:\n # https://sourceware.org/binutils/docs/ld.html#Scripts\n path = $1\n else\n raise\n end\n else\n raise\n end\n\n File.open(path) do |input|\n input.each_line do |line|\n case line\n when /\\A\\s*(?:INPUT|GROUP)\\s*\\(\\s*([^\\s,\\)]+)/\n # TODO: Should we support multiple files?\n return dlopen($1)\n end\n end\n end\n\n # Not found\n raise\n end\n end",
"def sym_hook\n local_hooks_directory = File.join(barerepopath, 'hooks')\n shell_hook_dir = File.join(Glitter::Application.config.shell_path, 'hooks')\n new_dir_name = \"#{local_hooks_directory}.old.#{Time.now.to_i}\"\n FileUtils.mv(local_hooks_directory, new_dir_name)\n FileUtils.ln_s(shell_hook_dir, local_hooks_directory)\n end",
"def crap_for_windoze\n # gawd windoze land sucks\n case RUBY_PLATFORM\n when /mswin32/ then\n \" -link /LIBPATH:\\\"#{Config::CONFIG['libdir']}\\\" /DEFAULTLIB:\\\"#{Config::CONFIG['LIBRUBY']}\\\" /INCREMENTAL:no /EXPORT:Init_#{module_name}\"\n when /mingw32/ then\n \" -Wl,--enable-auto-import -L#{Config::CONFIG['libdir']} -lmsvcrt-ruby18\"\n when /i386-cygwin/ then\n ' -L/usr/local/lib -lruby.dll'\n else\n ''\n end\n end",
"def makeLinkerString()\n if @config then\n return (@config[\"linker\"].empty?)?\"g++ \":(@config[\"linker\"] + \" \") # g++ is default value\n else\n return \"g++ \"\n end\n end",
"def makeLinkerString()\n if @config then\n return (@config[\"linker\"].empty?)?\"g++ \":(@config[\"linker\"] + \" \") # g++ is default value\n else\n return \"g++ \"\n end\n end",
"def create_symlinks(logger = nil)\n if @options[:preserve_environments]\n install_directory_symlink(logger, File.join(@options[:basedir], 'environments'), 'environments')\n @options.fetch(:create_symlinks, %w(modules manifests)).each do |x|\n install_directory_symlink(logger, File.join(@options[:basedir], x), x)\n end\n else\n if @options[:environment]\n logger.warn '--environment is ignored unless --preserve-environments is used' unless logger.nil?\n end\n if @options[:create_symlinks]\n logger.warn '--create-symlinks is ignored unless --preserve-environments is used' unless logger.nil?\n end\n install_directory_symlink(logger, @options[:basedir])\n end\n end",
"def create_symlink(old_name, new_name)\n File.symlink(old_name, new_name)\n end",
"def create_symlink(old_name, new_name)\n File.symlink(old_name, new_name)\n end",
"def symlink?(entry); end",
"def symlink?\n false\n end",
"def update_link_definitions(link_defs); end",
"def link_to_omnibus_ssl_directory\n Dir.glob(File.join(@trusted_certs_dir, \"*\")) do |trusted_cert|\n if File.symlink?(trusted_cert) && is_x509_certificate?(trusted_cert)\n hash_name = File.basename(trusted_cert)\n certificate_path = File.realpath(trusted_cert)\n symlink_path = File.join(@omnibus_certs_dir, hash_name)\n\n puts \"\\n Linking #{hash_name} from #{certificate_path}\"\n\n FileUtils.ln_s certificate_path, symlink_path unless File.exist?(symlink_path)\n end\n end\n end",
"def before_run\n Dir.chdir('source') do\n `ln -s nonexisting.txt link1.txt`\n end\nend",
"def dylib_load_commands\n load_commands.select { |lc| DYLIB_LOAD_COMMANDS.include?(lc.type) }\n end",
"def link_to(dest)\n dir = File.dirname(dest)\n FileUtils.makedirs(dir) unless Dir.exist?(dir)\n FileUtils.symlink(@path, dest)\n end",
"def create_symlink\n unless File.exist? opt_dir\n success = true\n if !File.writable?( sys_root )\n puts \"Cannot write to #{sys_root}. Please ensure #{opt_torquebox} points to your torquebox installation.\"\n success = false\n else\n puts \"Creating #{opt_dir}\"\n Dir.new( opt_dir )\n end\n end\n\n unless File.exist?( opt_torquebox )\n if File.writable?( opt_dir )\n puts \"Linking #{opt_torquebox} to #{torquebox_home}\"\n File.symlink( torquebox_home, opt_torquebox )\n else\n puts \"Cannot link #{opt_torquebox} to #{torquebox_home}\"\n success = false\n end\n end\n success\n end",
"def get_dylibs lib\n `otool -L #{lib}`.split(\"\\n\").inject([]) do |dylibs, line|\n if line =~ /^\\S/ or line =~ /System|@executable_path|libobjc/\n dylibs\n else\n dylibs << line.gsub(/\\s\\(compatibility.*$/, '').strip\n end\n end\n end",
"def wrap bin_file, pythonpath\n bin_file = Pathname.new bin_file\n libexec_bin = Pathname.new libexec/'bin'\n libexec_bin.mkpath\n mv bin_file, libexec_bin\n bin_file.write <<-EOS.undent\n #!/bin/sh\n PYTHONPATH=\"#{pythonpath}:$PYTHONPATH\" \"#{libexec_bin}/#{bin_file.basename}\" \"$@\"\n EOS\n end",
"def wrap bin_file, pythonpath\n bin_file = Pathname.new bin_file\n libexec_bin = Pathname.new libexec/'bin'\n libexec_bin.mkpath\n mv bin_file, libexec_bin\n bin_file.write <<-EOS.undent\n #!/bin/sh\n PYTHONPATH=\"#{pythonpath}:$PYTHONPATH\" \"#{libexec_bin}/#{bin_file.basename}\" \"$@\"\n EOS\n end",
"def wrap bin_file, pythonpath\n bin_file = Pathname.new bin_file\n libexec_bin = Pathname.new libexec/'bin'\n libexec_bin.mkpath\n mv bin_file, libexec_bin\n bin_file.write <<-EOS.undent\n #!/bin/sh\n PYTHONPATH=\"#{pythonpath}:$PYTHONPATH\" \"#{libexec_bin}/#{bin_file.basename}\" \"$@\"\n EOS\n end",
"def linkify(*args); end",
"def make_cache_symlinks #:nodoc:\n self.get_civet_outputs.each do |co|\n link_path = self.cache_full_path + co.dsid\n link_value = co.cache_full_path.to_s\n File.unlink(link_path) if File.symlink?(link_path) && File.readlink(link_path) != link_value\n File.symlink(link_value, link_path) unless File.exist?(link_path)\n end\n end",
"def linked_path\n File.readlink current_directory\n end",
"def add_link_flags(*flags)\n @libs.push(*flags)\n end"
] |
[
"0.7580968",
"0.7148825",
"0.7120533",
"0.6471518",
"0.63533896",
"0.6184087",
"0.61486834",
"0.58158135",
"0.57919675",
"0.5790475",
"0.57530034",
"0.5734655",
"0.5685838",
"0.5631665",
"0.56026757",
"0.5596154",
"0.55924875",
"0.5586103",
"0.55793375",
"0.55639243",
"0.555779",
"0.5527658",
"0.5510169",
"0.5463719",
"0.54469496",
"0.53821474",
"0.53807247",
"0.53753424",
"0.53603095",
"0.5344512",
"0.53442585",
"0.53302914",
"0.53248346",
"0.528652",
"0.5263171",
"0.5258206",
"0.5245008",
"0.524454",
"0.52344525",
"0.52047646",
"0.52047646",
"0.5203408",
"0.51831466",
"0.51827794",
"0.51827794",
"0.51485646",
"0.51083",
"0.5100211",
"0.50606525",
"0.50503075",
"0.50496817",
"0.5043084",
"0.4964502",
"0.4956669",
"0.4943284",
"0.49386576",
"0.4936109",
"0.49305767",
"0.49305767",
"0.49212524",
"0.49197942",
"0.49100137",
"0.49048308",
"0.48948017",
"0.4882739",
"0.4864851",
"0.4864296",
"0.48570684",
"0.48381513",
"0.4836636",
"0.4834587",
"0.4829879",
"0.4829418",
"0.48258877",
"0.48250896",
"0.48201153",
"0.48180884",
"0.4811646",
"0.48055157",
"0.48055157",
"0.48038208",
"0.47880524",
"0.47880524",
"0.47822315",
"0.47608724",
"0.47584927",
"0.47539166",
"0.47467804",
"0.47418317",
"0.47346",
"0.47266573",
"0.47092694",
"0.4706575",
"0.4706575",
"0.4706575",
"0.4700403",
"0.46983498",
"0.46893737",
"0.4675954"
] |
0.82425684
|
0
|
Symlink the host's compiler
|
def symlink_host_gcc
version = DevelopmentTools.non_apple_gcc_version "/usr/bin/gcc"
return if version.null?
suffix = (version < 5) ? version.to_s[/^\d+\.\d+/] : version.to_s[/^\d+/]
return if File.executable?("/usr/bin/gcc-#{suffix}") || File.executable?(HOMEBREW_PREFIX/"bin/gcc-#{suffix}")
FileUtils.mkdir_p HOMEBREW_PREFIX/"bin"
["gcc", "g++", "gfortran"].each do |tool|
source = "/usr/bin/#{tool}"
dest = HOMEBREW_PREFIX/"bin/#{tool}-#{suffix}"
next if !File.executable?(source) || File.executable?(dest)
FileUtils.ln_sf source, dest
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def link(filename, outdir, platform='linux')\n f = base(filename)\n cmd, args = *case platform\n when 'darwin'\n ['gcc', '-arch i386']\n when 'linux'\n ['ld', '']\n else\n raise \"unsupported platform: #{platform}\"\n end\n run_and_warn_on_failure(\"#{cmd} #{args} -o #{f} #{filename} 2>&1\")\n `chmod u+x #{f}`\n return f\nend",
"def link exe, objects\n sh \"gcc #{objects.join ' '} -o #{exe} #{L_FLAGS.join ' '}\"\nend",
"def compile(path)\n\tif isExecutable(path) and not $link\n\t\t$keep = true\n\t\treturn path\n\tend\n\t\n\tbinaryPath = File.join($testDir, File.basename($link ? $source[0] : path, File.extname(path)))\n\n\tcompilerOutput = Tempfile.new(\"compiler\")\n\n# FIXME: If $link is true, it will only check the extension of the first argument.\n\tif File.extname($link ? $source[0] : path) == \".c\"\n\t\tsystem \"gcc -O2 -o \\\"#{binaryPath}\\\" #{path} &> #{compilerOutput.path}\"\n\telsif File.extname($link ? $source[0] : path) == \".cpp\"\n\t\tsystem \"g++ -O2 -o \\\"#{binaryPath}\\\" #{path} &> #{compilerOutput.path}\"\n\telse\n\t\t$stderr.puts \"This program only works with C or C++ source code.\"\n\t\texit 1\n\tend\n\n\tcompilerMessages = compilerOutput.read\n\n\tunless compilerMessages.empty?\n\t\tunless File.exists?(binaryPath)\n\t\t\t$stderr.puts red(\"Couldn't compile #{path}.\")\n\t\tend\n\t\t$stderr.puts yellow(\"Compiler output for #{path}:\")\n\t\t$stderr.puts compilerMessages\n\tend\n\n\tcompilerOutput.close\n\tcompilerOutput.unlink\n\n\tunless File.exists?(binaryPath)\n\t\tcleanup\n\t\texit 1\n\tend\n\n\treturn binaryPath\nend",
"def compile\n exe_file = File.join(@temp_dir, 'exe')\n result = TTY::Command.new(printer: :quiet).run!('gcc', '-o', exe_file, @src_file)\n [exe_file, result]\n end",
"def compile_eth(dir, to)\n Dir.chdir(dir) do\n sh 'make'\n sh \"cp build/bin/geth #{to}/geth\"\n end\nend",
"def create_helper_symlink\n FileUtils.symlink \"../lib\", normalize(\"codelib\"), :force => true\n end",
"def compile\n if @app_dir.nil?\n raise 'app directory must be provided'\n elsif @version.nil? || @uri.nil?\n raise \"Version #{@version} or uri #{@uri} is not available, detect needs to be invoked\"\n end\n\n # create a dynatrace home dir in the droplet\n dt_home = File.join(@app_dir, DT_HOME_DIR)\n FileUtils.mkdir_p(dt_home)\n\n @logger.debug(\"Dynatrace home directory: #{dt_home}\")\n\n download_and_install_agent(dt_home)\n end",
"def compile\n File.chmod(0o755, start_script(root))\n augment_classpath_content\n end",
"def compile obj, src\n sh \"gcc #{$C_FLAGS.join ' '} -c #{src} -o #{obj}\"\nend",
"def compile_project\n debug_msg \" compiling #{@project_name}\"\n system(HHC_PATH, @project_name)\n end",
"def install_bin\n bin.install_symlink \"../opt/#{pkgname}/git-annex\"\n bin.install_symlink \"../opt/#{pkgname}/git-annex-shell\"\n bin.install_symlink \"../opt/#{pkgname}/git-annex\" => \"git-remote-tor-annex\"\n end",
"def compile\n Dir.chdir(build_path) do\n do_compile\n end\n end",
"def vendorize_with_symlink\n FileUtils.symlink \"#{JSPEC_ROOT}/lib\", normalize('lib'), :force => true\n end",
"def install\n # Get rid of the JRE directory so it'll use the system JRE\n system \"rm\", \"-rf\", \"jre\"\n\n # There's probably a more correct way to do this\n system \"cp\", \"-a\", \".\", \"#{libexec}\"\n\n # Link in the actual commands\n bin.install_symlink \"../libexec/SMCIPMITool\"\n end",
"def compiler cmdfile,config\n cc=config['compiler']\n raise GaudiConfigurationError,\"Missing 'compiler' setting\" unless cc\n return command_line(cc,cmdfile,config.fetch('compiler_commandfile_prefix',\"\"))\n end",
"def compile_scheme_scripts\n rm_f 'config/TRUST-PRECOMPILED'\n # We need to give a real path here, because \".\" will cause problems for\n # the engine. And it needs to be a Windows path, not a Cygwin path!\n # We need to be in command line mode, not runtime mode, so we will write\n # out our file count for our progress bar.\n run './engine/win32/Halyard', '-c', '(exit-script)', absolute_path(pwd)\n run 'touch', 'config/TRUST-PRECOMPILED'\nend",
"def compile(compilable)\r\n compiler = File.expand_path @compiler_exe, @compiler_path\r\n result = []\r\n \r\n compilable.compiler_target_files.each do |target_file|\r\n # Construct paths.\r\n include_paths = \"-I#{compilable.compiler_include_paths.join ';'}\" unless\r\n compilable.compiler_include_paths.empty?\r\n \r\n module_paths = \"-M#{compilable.compiler_module_paths.join ';'}\" unless\r\n compilable.compiler_module_paths.empty?\r\n \r\n library_paths = \"-L#{compilable.compiler_library_paths.join ';'}\" unless\r\n compilable.compiler_library_paths.empty?\r\n \r\n # Run the NetLinx compiler.\r\n # Note: NLRC.exe v2.1 freaks out if empty arguments (\"\") are in the command.\r\n cmd = ''\r\n cmd += 'wine ' if @use_wine or compiler.include? '/.wine/'\r\n cmd += \"\\\"#{compiler}\\\" \\\"#{target_file}\\\"\"\r\n cmd += \" \\\"#{include_paths}\\\"\" if include_paths\r\n cmd += \" \\\"#{module_paths}\\\"\" if module_paths\r\n cmd += \" \\\"#{library_paths}\\\"\" if library_paths\r\n \r\n io = IO.popen cmd\r\n stream = io.read\r\n io.close\r\n \r\n # Build the result.\r\n result << NetLinx::CompilerResult.new(\r\n compiler_target_files: [target_file],\r\n compiler_include_paths: compilable.compiler_include_paths,\r\n compiler_module_paths: compilable.compiler_module_paths,\r\n compiler_library_paths: compilable.compiler_library_paths,\r\n stream: stream\r\n )\r\n end\r\n \r\n result\r\n end",
"def make_compile_rule(src)\n sha = Digest::SHA1.hexdigest(src)\n fn = File.basename(src, '.c')\n dest = \"build/#{sha}_#{fn}.o\"\n SOURCE_LOOKUP[src] = dest\n\n CompileTask.define_task(dest => [src]) do |t|\n sh \"#{TOOLCHAIN}gcc #{t.cflags.join(' ')} -c #{t.prerequisites.first} -o #{t.name}\"\n end\nend",
"def compiler?(verify = false, writeable_directory = false)\n if (session.methods.include? :cache) && session.cache.exists?(\"compiler?\")\n return session.cache.read(\"compiler?\")\n end\n writeable_directory = '/var/tmp/' unless writeable_directory == true\n compilers = ['gcc', 'cc', 'tcc', 'pcc']\n compilers.each do |tool|\n next unless installed?(tool)\n if verify == true\n\n tmp_file = writeable_directory.to_s + ::Rex::Text.rand_text_alpha(12)\n tmp_file_c = tmp_file + '.c'\n match_string = ::Rex::Text.rand_text_alpha(32)\n test_c = \"#include <stdio.h>\\nint main(void){printf(\\\"#{match_string} %c\\\",0x0a);return 0;}\"\n test_c.each_line do |line|\n cmd_exec(\"echo '#{line}'>>#{tmp_file_c}\")\n end\n compile = \"#{tool} #{tmp_file_c} -o #{tmp_file}\"\n cmd_exec(compile)\n out = cmd_exec(tmp_file)\n rm tmp_file\n rm tmp_file_c\n if out.match(match_string)\n session.cache.add(\"compiler?\", tool) if session.methods.include? :cache\n return tool\n end\n else\n session.cache.add(\"compiler?\", tool) if session.methods.include? :cache\n return tool\n end\n end\n session.cache.add(\"compiler?\", false) if session.methods.include? :cache\n false\n end",
"def compile\n cmd = self.command\n#puts ' + ' + cmd\n log.debug \"Invoking the compiler\"\n rc = Platform.execute cmd\n log.debug \"Compilation complete; rc=#{rc.to_s}\"\n rc\n end",
"def command\n log.debug self.pretty_inspect\n\n throw 'Invalid linker' unless @ld.is_a?(Linker)\n throw 'One or more source files are required' unless @sources.length > 0\n# cflags = default_flags\n# cflags.concat @flags\n# end\n# throw cflags\n\n# topdir = h[:topdir] || ''\n# ld = @ld\n# ldadd = h[:ldadd]\n# ld.flags = h[:ldflags]\n# ld.output = Platform.pathspec(h[:output])\n# ld.rpath = h[:rpath] if h[:rpath].length > 0\n\n# inputs = h[:sources]\n# inputs = [ inputs ] if inputs.is_a? String\n# inputs = inputs.map { |x| Platform.pathspec(topdir + x) }\n# throw 'One or more sources are required' unless inputs.count\n\n#TODO:if @combine\n# return [ @path, cflags, '-combine', ldflags, inputs, ldadd ].flatten.join(' ')\n#\n \n cmd = [ @path, '-DHAVE_CONFIG_H', '-I.', @platform_cflags, flags, '-c', @sources ].flatten.join(' ')\n\n cmd += Platform.dev_null if @quiet\n\n log.debug \"Compiler command: #{cmd}\"\n\n cmd\n end",
"def compile\n if @app_dir.nil?\n raise 'app directory must be provided'\n elsif @version.nil? || @uri.nil?\n raise \"Version #{@version} or uri #{@uri} is not available, detect needs to be invoked\"\n end\n\n # create a dynatrace home dir in the droplet\n dynatrace_home = File.join(@app_dir, DYNATRACE_HOME_DIR)\n FileUtils.mkdir_p(dynatrace_home)\n @logger.debug(\"Dynatrace OneAgent home directory: #{dynatrace_home}\")\n\n download_and_install_agent(dynatrace_home)\n\n # export dynatrace specific environment variables\n export_dynatrace_app_environment_variables\n export_dynatrace_connection_environment_variables\n end",
"def target(machine='vm')\n if machine == 'vm'\n require 'gmpforth/vm'\n end\n require \"gmpforth/#{machine}compiler\"\n GMPForth::const_get \"#{machine.upcase}Compiler\"\n end",
"def linker cmdfile,config\n li=config['linker']\n raise GaudiConfigurationError,\"Missing 'linker' setting\" unless li\n return command_line(li,cmdfile,config.fetch('linker_commandfile_prefix',\"\"))\n end",
"def symlink_current_dir\n @shell.symlink self.checkout_path, self.current_path\n end",
"def compile\n Logger.info \"Compiling. See rbpp_compile.log for details.\"\n require 'rbconfig'\n ruby = File.join(RbConfig::CONFIG[\"bindir\"], RbConfig::CONFIG[\"RUBY_INSTALL_NAME\"])\n FileUtils.cd @working_dir do\n system(\"#{ruby} extconf.rb > rbpp_compile.log 2>&1\")\n system(\"rm -f *.so\")\n system(\"make >> rbpp_compile.log 2>&1\")\n end\n Logger.info \"Compilation complete.\"\n end",
"def install\n # Get rid of the JRE directory so it'll use the system JRE\n system \"rm\", \"-rf\", \"jre\"\n\n # There's probably a more correct way to do this\n system \"cp\", \"-a\", \".\", \"#{libexec}\"\n\n # Link in the actual commands\n bin.install_symlink \"../libexec/IPMIView20\"\n bin.install_symlink \"../libexec/JViewerX9\"\n bin.install_symlink \"../libexec/TrapReceiver\"\n bin.install_symlink \"../libexec/iKVM\"\n end",
"def install_symlink\n FileUtils.mkdir_p File.dirname(destination_path)\n FileUtils.symlink source_path, destination_path, force: true\n end",
"def mkcompiler source=''\n VishCompiler.new source\nend",
"def install\n # use the brew python to install the tools needed\n\t system 'python', 'setup.py', 'install', \"--prefix=#{prefix}\", \"--single-version-externally-managed\", \"--record=installed.txt\"\n\n\n # install the gyp executable\n bin.install(\"gyp\")\n bin.install(\"gyp_main.py\")\n end",
"def compile\n read_yml if File.exists?(@project)\n\n default_options = {}\n other_options = {}\n\n @compile_options.each do |k,v| \n if /default/.match(k)\n default_options[k] = v\n else\n other_options[k] = v\n end\n end\n\n command = \"#{@flex_sdk_bin}#{@compiler}\"\n other_options.each { |k,v| command += \" -#{k}=\\\"#{[v].flatten.join ','}\\\"\" }\n default_options.each { |k,v| command += \" -#{k}=\\\"#{[v].flatten.join ','}\\\"\" }\n command += \" #{@document_class}.as\"\n\n# puts command\n# TextMate.exit_show_html\n\n @command = command\n#TextMate.exit_show_html\n if process_output command\n# load_debugger\n display_web_player #unless ARGV[0] = \"--display\"\n# display_player\n end\nend",
"def make_symlink( old ) File.symlink( old, expand_tilde ) end",
"def compiled_path; end",
"def program\n @compile\n end",
"def compile(target_path:)\n target_path = Pathname.new(target_path)\n mkdir_p target_path\n root = Pathname.new(\"/\")\n cache_resources = @site.cache_resources\n @stdout.puts \"Compiling #{@site.root_path.expand_path}\"\n begin\n @site.cache_resources = true\n @site.resources.each do |resource|\n derooted = Pathname.new(resource.request_path).relative_path_from(root)\n path = target_path.join(derooted)\n mkdir_p path.dirname\n @stdout.puts \" #{path}\"\n File.open(path.expand_path, \"w\"){ |f| f.write render(resource) }\n end\n @stdout.puts \"Successful compilation to #{target_path.expand_path}\"\n ensure\n @site.cache_resources = cache_resources\n end\n end",
"def link\n throw 'Invalid linker' unless @ld.is_a?(Linker)\n throw 'One or more source files are required' unless @sources.length > 0\n cmd = @ld.command\n log.debug \"Invoking the linker: \" + cmd\n rc = Platform.execute cmd\n log.debug \"Linking complete; rc=#{rc.to_s}\"\n rc\n end",
"def install_pcre\n pcre_filename = \"pcre-#{PCRE_VERSION}.tar.gz\"\n pcre_download_path = File.join(GEM_CACHE_DIR, pcre_filename)\n pcre_url = \"http://sourceforge.net/projects/pcre/files/pcre/#{PCRE_VERSION}/#{pcre_filename}\"\n\n FileUtils.chdir(SOURCE_DIR)\n if not File.exists?(pcre_download_path) then\n Downloader.download_file(pcre_url, pcre_download_path)\n # system! \"curl -L -o #{pcre_download_path} #{pcre_url}\"\n # system! \"wget -P #{GEM_CACHE_DIR} #{pcre_url}\"\n end\n link(pcre_download_path, pcre_filename)\n if bsd_tar?\n FileUtils.cp(File.join(EXT_ROOT, 'bsdtar-pcre-build.sh'), '.')\n run_script! './bsdtar-pcre-build.sh'\n else\n run_script! 'Tools/pcre-build.sh'\n end\n end",
"def install\n system \"cd c; make build\"\n\n bin.install \"c/helloworld\" => \"helloworld-c\"\n end",
"def make_symlink(old) File.symlink(old, path) end",
"def compile\n download_start_time = Time.now\n print \"-----> Downloading Spring Boot CLI #{@version} from #{@uri} \"\n\n JavaBuildpack::Util::ApplicationCache.new.get(@uri) do |file| # TODO: Use global cache #50175265\n puts \"(#{(Time.now - download_start_time).duration})\"\n expand(file, @configuration)\n end\n link_classpath_jars\n end",
"def install\n ENV[\"GOPATH\"] = buildpath\n ENV[\"PATH\"] = \"#{ENV[\"PATH\"]}:#{ENV[\"GOPATH\"]}/bin\"\n (buildpath/\"src/github.com/linkerd/namerctl\").install buildpath.children\n cd \"src/github.com/linkerd/namerctl\" do\n system \"go\", \"build\", \"-o\", bin/\"namerctl\"\n prefix.install_metafiles\n end\n end",
"def symlink_ruby_version\n current_ruby = `which ruby`.chomp\n FileUtils.symlink current_ruby, ruby_version_symlink_file unless ruby_version_symlink_file_exists?\n display.print \"New Symlink Created: #{ruby_version_symlink_file} from #{current_ruby}\"\n end",
"def write_create_symlinks_script(symlinks)\n File.open(SYMLINKS_SCRIPT, 'w') do |f|\n f.puts '#!/system/bin/sh'\n f.puts ''\n f.puts 'cd $(dirname $0)'\n f.puts ''\n f.puts \"single_file_binaries=\\\"#{symlinks.join(' ')}\\\"\"\n f.puts ''\n f.puts 'for i in $single_file_binaries; do'\n f.puts 'ln -s coreutils $i;'\n f.puts 'done'\n f.puts ''\n f.puts 'cd -'\n end\n FileUtils.chmod '+x', SYMLINKS_SCRIPT\n end",
"def symlink_ld_so\n ld_so = HOMEBREW_PREFIX/\"lib/ld.so\"\n return if ld_so.readable?\n sys_interpreter = [\n \"/lib64/ld-linux-x86-64.so.2\",\n \"/lib/ld-linux.so.3\",\n \"/lib/ld-linux.so.2\",\n \"/lib/ld-linux-armhf.so.3\",\n \"/lib/ld-linux-aarch64.so.1\",\n \"/system/bin/linker\",\n ].find do |s|\n Pathname.new(s).executable?\n end\n raise \"Unable to locate the system's ld.so\" unless sys_interpreter\n interpreter = begin\n glibc = Formula[\"glibc\"]\n glibc.installed? ? glibc.lib/\"ld-linux-x86-64.so.2\" : sys_interpreter\n rescue FormulaUnavailableError\n sys_interpreter\n end\n FileUtils.mkdir_p HOMEBREW_PREFIX/\"lib\"\n FileUtils.ln_sf interpreter, ld_so\n end",
"def symlink_ld_so\n ld_so = HOMEBREW_PREFIX/\"lib/ld.so\"\n return if ld_so.readable?\n sys_interpreter = [\n \"/lib64/ld-linux-x86-64.so.2\",\n \"/lib/ld-linux.so.3\",\n \"/lib/ld-linux.so.2\",\n \"/lib/ld-linux-armhf.so.3\",\n \"/lib/ld-linux-aarch64.so.1\",\n \"/system/bin/linker\",\n ].find do |s|\n Pathname.new(s).executable?\n end\n raise \"Unable to locate the system's ld.so\" unless sys_interpreter\n interpreter = begin\n glibc = Formula[\"glibc\"]\n glibc.installed? ? glibc.lib/\"ld-linux-x86-64.so.2\" : sys_interpreter\n rescue FormulaUnavailableError\n sys_interpreter\n end\n FileUtils.mkdir_p HOMEBREW_PREFIX/\"lib\"\n FileUtils.ln_sf interpreter, ld_so\n end",
"def compile\n if @app_dir.nil?\n raise 'app directory must be provided'\n elsif @version.nil? || @uri.nil? || @nosetup_zip.nil?\n raise \"Version #{@version}, uri #{@uri}, or new jrebel-nosetup.zip #{@nosetup_zip} is not available, detect needs to be invoked\"\n end\n\n jr_home = File.join(@app_dir, JR_HOME_DIR)\n FileUtils.mkdir_p(jr_home)\n FileUtils.rm_r(File.join(jr_home, JREBEL)) if Dir.exist?(File.join(jr_home, JREBEL))\n download_and_install_agent(jr_home)\n end",
"def install\n libexec.install \"networking-swagger-java.sh\"\n bin.install_symlink libexec/\"networking-swagger-java.sh\" => \"networking-swagger-java\"\n end",
"def compile_exec()\n compile\n exec\n end",
"def compiled_path=(path); end",
"def compile_web\n\n # Check for compiler toolchain issues\n if doctor_web(:building)\n puts \"Fix errors before building.\\n\\n\"\n end\n\n wasm_assets = \"#{Ruby2D.assets}/wasm\"\n\n # Get include directories\n incl_dir_ruby2d = \"#{Ruby2D.gem_dir}/ext/ruby2d/\"\n incl_dir_deps = \"#{Ruby2D.assets}/include/\"\n\n optimize_flags = '-Os --closure 1'\n ld_flags = \"#{wasm_assets}/libmruby.a\"\n\n # Compile using Emscripten\n run_cmd \"emcc -s WASM=1 -I#{incl_dir_ruby2d} -I#{incl_dir_deps} \"\\\n \"-s USE_SDL=2 -s USE_SDL_IMAGE=2 -s USE_SDL_MIXER=2 -s USE_SDL_TTF=2 \"\\\n \"build/app.c #{ld_flags} -o build/app.html\"\n\n # TODO: Copy HTML template from gem assets to build directory\n # FileUtils.cp \"#{wasm_assets}/template.html\", 'build/app.html'\n\n exit(1) unless $?.success?\nend",
"def compileSourceOfTarget(target)\n\t\tincstr = @includesString\t\n\t\tsrc_file = targetToSource(target)\n\t\ttarget_ext = File.extname target\n\t\tsource_ext = File.extname src_file\n\t\tartifacts = [target]\n\t\tdebug \"COMP: Target: \\'#{target}\\'\"\n\t\t#debug \"COMP: Source: \\'#{src_file}\\'\"\n\t\t#expected artifacts\n\t\tif (target_ext == '.cmx') \n\t\t\tartifacts.push(changeExt(target, '.o'))\n\t\tend\n\t\tif (source_ext == '.ml')\n\t\t\tunless(File.exist?(changeExt(target, '.mli')))\n\t\t\t\tartifacts.push(changeExt(target, '.cmi'))\n\t\t\tend\n\t\tend\n\n\t\tcase @compiler\n\t\t\twhen @@byteCodeCompiler \n\t\t\t\tcmd = \"ocamlfind ocamlc -g -c \"\n\t\t\t\tcmd += \"-package #{@libsStr} \" unless(@libsStr == \"\") \n\t\t\t\tcmd += \"#{incstr} #{src_file}\"\n\t\t\twhen @@machineCodeCompiler\n\t\t\t\tcmd = \"ocamlfind ocamlopt -c \"\n\t\t\t\tcmd += \"-p \" if (@profilingEnabled)\n\t\t\t\tcmd += \"-package #{@libsStr} \" unless(@libsStr == \"\") \n\t\t\t\tcmd += \"#{incstr} #{src_file}\"\n\t\t\telse \n\t\t\t\tputs \"ERROR couldn't compile to file: \" + target\n\t\tend\n\t\tdebug cmd\n\t\t`#{cmd}`\n\t\tif($? == 0) #the compiler had no error\n\t\t\tartifacts.each do |artfile|\n\t\t\t\t#debug \"compiler ran\"\n\t\t\t\tbuilddest = toBuildDirFile(artfile)\n\t\t\t\t#debug \"\\t builddirtarget: \" + builddest\n\t\t\t\t#debug \"\\t target: \" + artfile \n\t\t\t\t#if(not File.exists?(artfile)) then exit end\n\t\t\t\tunless (artfile == builddest)\n\t\t\t\t\tFile.rename(artfile, builddest)\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def install\n ohai \"THIS BUILD DIDN'T WORK!\"\n \n resource(\"7zip\").stage \"#{buildpath}/7zip\"\n\n system \"chmod +x compile*\"\n\n system \"cd HsLua && make\"\n\n # GHC 7.4.2 compatibility fixes\n #system \"sed -i.bak -e 's/^import System.Posix.Internals/import System.Posix.Internals hiding (CFilePath)/' 'Files.hs'\"\n #system \"sed -i.bak -e 's/^import Foreign/import Foreign hiding (unsafePerformIO)/' 'Files.hs'\"\n #system \"sed -i.bak -e '3,4d' 'Compression/CompressionLib.hs'\"\n #system \"sed -i.bak -e 's/foreign import ccall threadsafe/foreign import ccall safe/' 'Compression/CompressionLib.hs'\"\n\n system \"./compile-O2\"\n\n system \"cd Unarc && make unix\"\n end",
"def compile\n end",
"def install\n\t\tsystem 'make'\n\t\tlibexec.install 'waifu2x_glsl'\n\t\tlibexec.install 'models'\n\t\tlibexec.install 'vgg_7'\n\t\tbin.install_symlink libexec/\"waifu2x_glsl\"\n\tend",
"def compiler_application_path\n @compiler_application_path || DEFAULT_COMPILER_APPLICATION_PATH\n end",
"def install\n system \"./bootstrap\"\n args = %W[\n --prefix=#{prefix}\n --enable-shared\n ]\n\n system \"./configure\", *args\n system \"make\", \"install\"\n end",
"def test_should_compile_file_with_linker_error\n \n dir = \"./test_case/linker_error.rb\"\n filename = dir\n \n result = check_and_compile_file( dir , filename )\n \n assert_equal(true, result)\n \n end",
"def setup_proc\n comp = self\n # raise ArgumentError.new( \"File #{comp.target} is not exist!\" ) if !File.exists? comp.target\n\n set_check( ->(host) do \n test(\" [ -e #{comp.link} ] \" )\n end )\n\n set_up( Proc.new{ |host|\n if test( \" [ -w '#{File.dirname comp.link}' ] \" )\n execute( :ln, \"-s\", comp.target, comp.link ) \n else\n prepare_sudo_password( host ) do\n as :root do\n execute( :ln, \"-s\", comp.target, comp.link ) \n end\n end\n end\n })\n\n set_down( Proc.new{ |host|\n if test( \" [ -w '#{File.dirname comp.link}' ] \" )\n execute( :rm, comp.link ) \n else\n prepare_sudo_password( host ) do \n as :root do\n execute( :rm, comp.link ) \n end\n end\n end\n } )\n end",
"def with_codethink_compiler_flags(platform, env = {}, opts = {})\n env = with_standard_compiler_flags(env = env, opts = opts)\n\n compiler_flags =\n {\n \"LDFLAGS\" => \"-Wl,-rpath,#{install_dir}/lib -L#{install_dir}/lib\",\n \"CFLAGS\" => \"-I#{install_dir}/include -O2\",\n }\n\n return env.merge(compiler_flags).\n merge(\"CXXFLAGS\" => compiler_flags[\"CFLAGS\"]).\n merge(\"CPPFLAGS\" => compiler_flags[\"CFLAGS\"])\nend",
"def compile\n JavaBuildpack::Util.download(@version, @uri, 'Auto Reconfiguration', jar_name(@version), @lib_directory)\n end",
"def compile_ruby\n if $DEBUG\n puts \"user_home: #{user_home}\"\n puts \"user_local: #{user_local}\"\n puts \"make_command: #{make_command}\"\n puts \"version: #{version}\"\n puts \"ruby_cc_version: #{ruby_cc_version}\"\n puts \"ruby_source: #{ruby_source}\"\n puts \"srcdir: #{srcdir}\"\n puts \"blddir: #{blddir}\"\n puts \"libdir: #{libdir}\"\n end\n\n mingw32\n environment\n download_source\n extract_source\n makefile_in_bak # create Makefile.in.bak\n makefile_in # create Makefile.in\n configure # create Makefile\n make # creates ruby.exe\n make_install\n update_config\n end",
"def create_symlink(dest_path); end",
"def link( src, dest )\n if ( win? )\n FileUtils.cp_r( src, dest )\n else\n File.symlink( src, dest )\n end\n end",
"def set_symlinks_for_jruby_commands\n %w(ruby irb).each do |item|\n FileUtils.ln_s(bin_path(\"j#{item}\"), bin_path(item))\n end\n end",
"def compile_bin(cpu = host_cpu)\n platform = target_platform(cpu)\n native_dir = File.expand_path('../aws-crt-ffi', File.dirname(__FILE__))\n tmp_dir = File.expand_path(\"../tmp/#{platform.cpu}\", File.dirname(__FILE__))\n tmp_build_dir = File.expand_path('build', tmp_dir)\n\n # We need cmake to \"install\" aws-crt-ffi so that the binaries end up in a\n # predictable location. But cmake still adds subdirectories we don't want,\n # so we'll \"install\" under tmp, and manually copy to bin/ after that.\n tmp_install_dir = File.expand_path('install', tmp_dir)\n\n build_type = 'RelWithDebInfo'\n\n config_cmd = [\n CMAKE,\n \"-H#{native_dir}\",\n \"-B#{tmp_build_dir}\",\n \"-DCMAKE_INSTALL_PREFIX=#{tmp_install_dir}\",\n \"-DCMAKE_BUILD_TYPE=#{build_type}\",\n '-DBUILD_TESTING=OFF',\n ]\n\n # macOS can cross-compile for arm64 or x86_64.\n # This lets us prepare both types of gems from either type of machine.\n if platform.os == 'darwin'\n config_cmd.append(\"-DCMAKE_OSX_ARCHITECTURES=#{platform.cpu}\")\n end\n\n build_cmd = [\n CMAKE,\n '--build', tmp_build_dir,\n '--target', 'install',\n '--config', build_type,\n ]\n\n # Build using all processors\n if cmake_has_parallel_flag?\n build_cmd.append('--parallel')\n build_cmd.append(Etc.nprocessors.to_s)\n end\n\n run_cmd(config_cmd)\n run_cmd(build_cmd)\n\n # Move file to bin/, instead of where cmake installed it under tmp/\n bin_dir = crt_bin_dir(platform)\n FileUtils.mkdir_p(bin_dir)\n bin_name = crt_bin_name(platform)\n search_dirs = [\n 'bin', # windows\n 'lib64', # some 64bit unix variants\n 'lib', # some unix variants\n ]\n tmp_path = find_file(bin_name, search_dirs, tmp_install_dir)\n FileUtils.cp(tmp_path, bin_dir, verbose: true)\nend",
"def compile\n if @url.nil? || @system_id.nil?\n raise \"url #{@url}, or systemId #{@system_id} is not available, detect needs to be invoked\"\n end\n\n dp_home = File.join(@app_dir, '.dynamic_pulse_agent')\n FileUtils.mkdir_p(dp_home)\n\n download_and_unzip(@url, @system_id, 'dynamicpulse-agent.zip', dp_home)\n\n FileUtils.mv(File.join(dp_home, 'dynamicpulse.jar'), @lib_directory)\n FrameworkUtils.link_libs([@app_dir], @lib_directory)\n end",
"def install\n system \"./configure\", \"--prefix=#{prefix}\",\n \"--target=i386-jos-elf\",\n \"--disable-multilib\",\n \"--disable-nls\",\n \"--disable-werror\"\n system \"make\"\n system \"make\", \"install\"\n end",
"def compile filetask,system_config,platform\n cmd_file=command_file(filetask.name,system_config,platform)\n if File.exists?(cmd_file)\n mkdir_p(File.dirname(filetask.name),:verbose=>false)\n config=system_config.platform_config(platform)\n if is_assembly?(filetask.prerequisites.first)\n cmdline = assembler(cmd_file,config)\n else\n cmdline = compiler(cmd_file,config)\n end\n sh(cmdline.join(' '))\n else\n raise GaudiError, \"Missing command file for #{filetask.name}\"\n end\n end",
"def handle_compile_and_link(argv)\n source_files = argv.select { |f| f =~ /\\.(?:c|cc|C|cxx|cpp)$/ }\n is_compile = get_arg(argv, '-c', :first)\n output_file = get_arg(argv, '-o')\n return false if source_files.empty? or is_compile or not output_file\n\n # OK, this is a combined compile-and-link.\n # Replace it with multiple commands, where each command compiles a single source file.\n non_source_opts = argv.select { |a| not source_files.include?(a) }\n source_files.each do |f|\n current_args = non_source_opts.collect { |a| if a == output_file then \"#{f}.o\" else a end }\n current_args += ['-c', f]\n main(current_args)\n end\n\n # Add a link command\n link_args = argv.collect { |a| if source_files.include?(a) then \"#{a}.o\" else a end }\n main(link_args)\n\n return true\nend",
"def install\n system \"./waf\", \"configure\", \"--prefix=#{prefix}\", \"--no-plugins\", \"--lv2dir=#{lib}\"\n system \"./waf\", \"build\"\n system \"./waf\", \"install\"\n end",
"def cifrom(compiler)\n CodeInterpreter.new(compiler.bc, compiler.ctx)\nend",
"def compile(src, options = '')\n return self if src == @source\n\n @mutex.lock\n begin\n @program = @context.create_program src\n # Compilte the program on all available devices in the context.\n @program.build @context.devices, options, nil\n @source = src.freeze\n rescue CLError => e\n if e.program_build_failed?\n raise ProgramBuildError, @program.build_info(@context.default_device, CL_PROGRAM_BUILD_LOG)\n else\n raise e\n end\n ensure\n @mutex.unlock\n end\n self\n end",
"def link *args\n self.destination_and_options( args ) do |lnk, opts|\n symlink_requested = self.directory? || opts[:symbolic] || opts[:sym] || opts[:soft]\n \n if symlink_requested\n self.symlink lnk, opts\n else\n FileUtils.ln self, lnk, ** Utils::Opts.narrow_file_utils_options( opts, :ln )\n end\n \n lnk.fwf_filepath\n end\n end",
"def compile\n @version, @uri = Ruby.find_ruby(@configuration)\n\n download_start_time = Time.now\n if @uri.include? '://'\n print \"-----> Downloading #{@version} ruby from #{@uri} ... \"\n else\n filename = File.basename(@uri)\n print \"-----> Retrieving #{@version} ruby (#{filename}) ... \"\n end\n LibertyBuildpack::Util::Cache::ApplicationCache.new.get(@uri) do |file| # TODO: Use global cache\n puts \"(#{(Time.now - download_start_time).duration})\"\n expand file\n end\n end",
"def compile!\n puts \"Compiling website..\"\n puts %x[rm -rf output]\n puts %x[nanoc compile]\nend",
"def compile!\n puts \"Compiling website..\"\n puts %x[rm -rf output]\n puts %x[nanoc compile]\nend",
"def compile!\n puts \"Compiling website..\"\n puts %x[rm -rf output]\n puts %x[nanoc compile]\nend",
"def compile(script, filename=nil, linenum=nil)\n filename ||= 'none'\n linenum ||= 1\n @compiled_scripts[filename] = native_compile(script, filename, linenum)\n end",
"def install\n # Build instructions per https://www2.math.su.se/PATHd8/compile.html\n system ENV.cc, \"PATHd8.c\", \"-O3\", \"-lm\", \"-o\", \"PATHd8\"\n bin.install \"PATHd8\"\n end",
"def conditional_link(source, target = source)\n source_dir = @onabase + \"/www/local/plugins/cfg_archive/bin/\"\n target_dir = @onabase + \"/bin/\"\n\n source_file = source_dir + source\n target_link = target_dir + target\n\n FileUtils.ln_sf(source_file, target_link)\nend",
"def compile\n system \"rm -rf #{new_relic_home}\"\n system \"mkdir -p #{new_relic_home}\"\n system \"mkdir -p #{File.join new_relic_home, 'logs'}\"\n\n JavaBuildpack::Util.download(@version, @uri, 'New Relic Agent', jar_name(@version), new_relic_home)\n copy_resources new_relic_home\n end",
"def dlltool(dllname, deffile, libfile)\n # define if we are using GCC or not\n if Rake::ExtensionCompiler.mingw_gcc_executable then\n dir = File.dirname(Rake::ExtensionCompiler.mingw_gcc_executable)\n tool = case RUBY_PLATFORM\n when /mingw/\n File.join(dir, 'dlltool.exe')\n when /linux|darwin/\n File.join(dir, \"#{Rake::ExtensionCompiler.mingw_host}-dlltool\")\n end\n return \"#{tool} --dllname #{dllname} --def #{deffile} --output-lib #{libfile}\"\n else\n if RUBY_PLATFORM =~ /mswin/ then\n tool = 'lib.exe'\n else\n fail \"Unsupported platform for cross-compilation (please, contribute some patches).\"\n end\n return \"#{tool} /DEF:#{deffile} /OUT:#{libfile}\"\n end\nend",
"def compile!\n new_version = generate_version\n new_abs_path = abs_path(new_version)\n return @compiled_path = current_file_path if @compile_files.empty?\n\n FileUtils.mkdir_p @min_dir unless File.exist?(@min_dir)\n js? ? compile_js!(new_abs_path) : compile_css!(new_abs_path)\n\n if not_changed?(new_abs_path, current_abs_path)\n puts \"file not changed, use current file (#{current_file_path})\"\n FileUtils.rm_rf new_abs_path\n @compiled_path = current_file_path\n else\n puts \"new file version (#{file_path(new_version)}) created\"\n @compiled_path = file_path(new_version)\n end\n end",
"def get_source_link(host)\n if host['platform'] =~ %r{aix}\n 'http://int-resources.ops.puppetlabs.net/QA_resources/ibm_websphere/agent.installer.aix.gtk.ppc_1.8.4000.20151125_0201.zip'\n elsif host['platform'] =~ %r{linux}\n 'http://int-resources.ops.puppetlabs.net/QA_resources/ibm_websphere/agent.installer.linux.gtk.x86_64_1.8.3000.20150606_0047.zip'\n end\nend",
"def compiler=(name) #:nodoc:\n cls = Compiler.select(name) or raise ArgumentError, \"No #{name} compiler available. Did you install it?\"\n return self if cls === @compiler\n @compiler = cls.new(project, options)\n from Array(cls.sources).map { |path| project.path_to(:source, usage, path) }.\n select { |path| File.exist?(path) } if sources.empty?\n into project.path_to(:target, usage, cls.target) unless target\n with Array(@compiler.dependencies)\n self\n end",
"def post_link_hook(linker)\n basic_name = get_basic_name(linker)\n soname = get_soname(linker)\n symlink_lib_to basic_name\n symlink_lib_to soname\n end",
"def compilelet\n\n end",
"def javac(*args)\n Buildr.application.deprecated 'Use Java::Commands.javac instead.'\n Commands.javac(*args)\n end",
"def install\n system \"./configure\", \"--disable-dependency-tracking\", \"--enable-shared\",\n \"--prefix=#{prefix}\"\n system \"rm\", \"src/bits.o\", \"src/c_dd.o\", \"src/c_qd.o\", \"src/dd_const.o\", \"src/dd_real.o\", \"src/fpu.o\", \"src/qd_const.o\", \"src/qd_real.o\", \"src/util.o\"\n system \"rm\", \"src/bits.lo\", \"src/c_dd.lo\", \"src/c_qd.lo\", \"src/dd_const.lo\", \"src/dd_real.lo\", \"src/fpu.lo\", \"src/qd_const.lo\", \"src/qd_real.lo\", \"src/util.lo\"\n system \"make\"\n system \"make\", \"install\"\n end",
"def basic_compiler\n @basic_compiler ||= indirection.terminus(config['basic_compiler'])\n end",
"def compile\n Tipsy::Runners::Compiler.new(@args, @site)\n end",
"def link_target\n return if current_directory? && linked_path == current_path\n\n FileUtils.ln_s File.expand_path(current_path), current_directory\n end",
"def install\n ENV.deparallelize\n ENV.no_optimization\n\n system \"./configure\", \"--prefix=#{prefix}\", \"--with-telescope=carma\"\n system \"make\"\n system \"make\", \"install\"\n end",
"def compile\n puts \"Compilando archivos fuentes:\"\n @objs.each do |obj|\n command = \"#{@cc} -fpic -c -o #{obj} #{obj[0..-2] + \"c\"} #{@cflags}\"\n puts \"\\t\"+ command\n exit (0) if not((system(command)))\n end\n \n puts \"Convirtiendo a bibliotecas dinamicas\"\n system(\"mkdir lib\")\n @shared.each do |obj|\n library = obj.split('/').last\n compiled_libraries = `ls #{@lib_dir}`.split(\" \")\n \n libs = compiled_libraries.inject(\"\") {\n |string,lib|\n string += \"-l#{lib[3...-3]} \"\n }\n \n if (@so == \"linux\")\n command = \"#{@cc} -shared -o lib/lib#{library} #{obj[0..-3] + \"o\"}\" +\n \" -L#{@lib_dir} #{libs}\"\n elsif (@so == \"mac\")\n command = \"#{@cc} -shared -o lib/lib#{library} #{obj[0..-3] + \"o\"}\" +\n \" -L#{@lib_dir} #{libs}\" \n end\n puts \"\\t\" + command\n puts \"No compilo de forma correcta\" if not((system(command)))\n end\nend",
"def install_go_source\n source = \"go#{GO_VERSION}.src.tar.gz\"\n bootstrap = \"go1.4-bootstrap-20161024.tar.gz\"\n\n <<-SCRIPT\n mkdir -p /usr/local/go/bootstrap\n #{wget(bootstrap)}\n tar -C /usr/local/go/bootstrap -xzf #{bootstrap}\n bash -c \"cd /usr/local/go/bootstrap/go/src && ./make.bash\"\n\n #{wget(source)}\n tar -C /usr/local -xzf #{source}\n bash -c \"cd /usr/local/go/src && GOROOT_BOOTSTRAP=/usr/local/go/bootstrap/go ./make.bash\"\n SCRIPT\nend",
"def install\n system \"autoreconf\", \"-fiv\" if build.head?\n system \"./configure\", \"--disable-debug\",\n \"--disable-dependency-tracking\",\n \"--disable-silent-rules\",\n \"--prefix=#{prefix}\"\n system \"make\", \"install\"\n end",
"def install\n system \"make\"\n bin.install \"wrk\"\n end",
"def compile(script, filename=nil, linenum=nil)\n filename ||= 'none'\n linenum ||= 1\n native_compile(script, filename, linenum)\n end",
"def install\n clang_version = '10.0.0'\n\n include.install Dir['include/c++'] unless File.directory? \"#{include}/c++\"\n \"#{include}/c++\".install Dir['include/c++/v1'] unless File.directory? \"#{include}/c++/v1\"\n lib.install Dir['lib/clang'] unless File.directory? \"#{lib}/clang\"\n \"#{lib}/clang\".install Dir['lib/clang/#{clang_version}'] unless File.directory? \"#{lib}/clang/#{clang_version}\"\n lib.install Dir['lib/oclint']\n bin.install Dir['bin/*']\n\n end"
] |
[
"0.6607594",
"0.61349684",
"0.6115538",
"0.59941584",
"0.59676796",
"0.5895924",
"0.587867",
"0.5805132",
"0.577564",
"0.5770861",
"0.57555145",
"0.57321453",
"0.57066673",
"0.5703489",
"0.5626191",
"0.5576637",
"0.5545239",
"0.5505228",
"0.5503875",
"0.5474848",
"0.54355013",
"0.54346323",
"0.5422913",
"0.5409017",
"0.5396636",
"0.5395173",
"0.536411",
"0.5357148",
"0.53518397",
"0.5345668",
"0.53383297",
"0.5336168",
"0.5333247",
"0.5322268",
"0.53208846",
"0.530419",
"0.52998495",
"0.52667546",
"0.5262581",
"0.5241308",
"0.5207521",
"0.5194219",
"0.519207",
"0.51772577",
"0.51772577",
"0.5169392",
"0.5148941",
"0.51152027",
"0.5112375",
"0.51065105",
"0.5101475",
"0.50850075",
"0.50849426",
"0.50826097",
"0.5075462",
"0.50742155",
"0.50639635",
"0.50410163",
"0.50326324",
"0.50297076",
"0.50273293",
"0.5017829",
"0.5016517",
"0.5008483",
"0.50002396",
"0.4999207",
"0.49929163",
"0.49925315",
"0.49921876",
"0.49919656",
"0.4989029",
"0.49879026",
"0.49874458",
"0.49763778",
"0.49679607",
"0.49679607",
"0.49679607",
"0.4961965",
"0.49612305",
"0.495437",
"0.4952289",
"0.49505723",
"0.49485213",
"0.49418554",
"0.4933425",
"0.49332857",
"0.49312016",
"0.49308118",
"0.49258113",
"0.49141422",
"0.4913901",
"0.49137557",
"0.4906223",
"0.48969394",
"0.4896938",
"0.4896357",
"0.48804766",
"0.48788396",
"0.4874619"
] |
0.7200219
|
0
|
Sjaak van den Berg
|
def pattern(n)
if n <= 1 # number is 1 or lower
return ''
else # number is 2 or higher
# for each number from 1 up to n, select only the even numbers
# and print that number the amount of times equal to the number
# and follow up with a new line for each unique even number
(1..n).select(&:even?).map do |x|
x.times { print "#{x}" }
print "\n"
# return output
# print "\n"
# return x
# if n > 3
# return "#{x}" * x
# else
# return "#{x}" * x + "\n"
# end
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def schubert; end",
"def schumann; end",
"def zuruecksetzen()\n end",
"def berlioz; end",
"def bellini; end",
"def berg; end",
"def suivre; end",
"def sichtbar_machen()\n @dach.sichtbar_machen\n @gebaedekoerpe.sichtbar_machen\n @fenster.sichtbar_machen\n @tuer.sichtbar_machen\n end",
"def GueltigBis\n \treturn @GueltigBis\n end",
"def verdi; end",
"def oben() \n return @fahrbahn.obere_linke_ecke().y() \n end",
"def einschalten() \n @schirm.farbe_aendern('gelb')\n @leuchtstrahl1.sichtbar_machen()\n @leuchtstrahl2.sichtbar_machen()\n @leuchtstrahl3.sichtbar_machen()\n @leuchtstrahl4.sichtbar_machen()\n @leuchtstrahl1.farbe_aendern('gelb')\n @leuchtstrahl2.farbe_aendern('gelb')\n @leuchtstrahl3.farbe_aendern('gelb')\n @leuchtstrahl4.farbe_aendern('gelb')\n end",
"def bs; end",
"def intelligenter_zug(spielfeld, aktueller_spieler)\n zug = nil\n\n spieler = spielfeld.spieler\n gegner = nil\n for s in spieler\n if s.name != aktueller_spieler.name\n gegner = s\n break\n end\n end\n\n # 1. Regel: Zuerst nach einer Gewinnsituation suchen\n for reihe in Spielfeld::reihen\n besetzt, frei = spielfeld.reihen_status(reihe)\n\n # Wenn der aktuelle Spieler in einer Reihe bereits zwei Felder\n # besetzt hält und das dritte frei ist, dann natürlich das nehmen\n if (frei.size == 1) and (besetzt[aktueller_spieler].size == 2)\n zug = Zug.new(aktueller_spieler, frei[0])\n break # nicht weitersuchen\n end\n end\n\n if zug.nil?\n # 2. Regel: Suche dann nach den Reihen, in denen der Gegner bereits\n # genau 2 Felder besetzt hat und das dritte Feld noch frei ist.\n for reihe in Spielfeld::reihen\n besetzt, frei = spielfeld.reihen_status(reihe)\n\n # Gefährlich, wenn Gegner zwei besetzt hält. Wie in der vorherigen\n # Lektion gelernt, erhält man zum Index des aktuellen Spielers\n # in der Spielerliste den Index des Gegners mit der Bitoperation 1^wer\n if (frei.size == 1) and (besetzt[gegner].size == 2)\n # Jetzt muss der Spieler unbedingt das eine freie Feld besetzen!\n # Andernfalls kann der Gegner im nächsten Zug gewinnen.\n zug = Zug.new(aktueller_spieler, frei[0])\n break # nicht weitersuchen\n end\n end\n end\n\n # Eckensituation bestimmen\n ecken = {\n 1 => 0, # links oben\n 3 => 0, # rechts oben\n 7 => 0, # links unten\n 9 => 0 # rechts unten\n }\n gegen_ecken = [[1, 9], [9, 1], [3, 7], [7, 3]]\n for z in spielfeld.zuege\n feld = z.nummer\n # Gegner besetzt die Ecke, wenn:\n # feld ist eine Ecke und Gegner besetzt sie\n if (ecken[feld] != nil) and (z.spieler == gegner)\n # Markiere Ecke als vom Gegner besetzt\n ecken[feld] = 1\n end\n end\n\n # 3. Regel: Immer in die Mitte setzten, falls dort frei ist\n # Vorsicht vor der XOX Situation an der Diagonale!\n if zug.nil?\n frei = spielfeld.freie_felder\n mitte = 5\n if frei.include?(mitte)\n zug = Zug.new(aktueller_spieler, mitte)\n else\n # Aha, Mitte ist bereits besetzt.\n # Sofern sie vom aktuellen Spieler besetzt ist, dann nach der XOX\n # Situation Ausschau halten und den nächsten Zug nicht in eine Ecke setzen.\n # XOX (oder OXO) Situation besteht, wenn\n # Ecke 1 und 9 vom Gegner besetzt und aktueller Spieler auf 5 oder\n # Ecke 3 und 7 vom Gegner besetzt und aktueller Spieler auf 5.\n for ecken_paar in gegen_ecken\n besetzt, frei_ecken = spielfeld.reihen_status([ecken_paar[0], mitte, ecken_paar[1]])\n if besetzt[gegner].include?(ecken_paar[0]) and besetzt[gegner].include?(ecken_paar[1])\n if besetzt[aktueller_spieler].include?(mitte)\n # Jetzt also nicht in eine freie Ecke setzen, sondern auf\n # die Felder 2, 4, 6 oder 8, sofern sie frei sind.\n xox_felder = [2, 4, 6, 8]\n for f in xox_felder\n if !frei.include?(f)\n xox_felder.delete(f)\n end\n end\n # Von den freien Ausweichfeldern zufällig eines nehmen\n feld = zufalls_feld(xox_felder)\n if feld != nil\n zug = Zug.new(aktueller_spieler, feld)\n break\n end\n end\n end\n end\n\n end\n end\n\n # 4. Regel: Verteidige gegenüberliegende Ecke\n frei = spielfeld.freie_felder\n if zug.nil?\n # Wenn Ecke 1 besetzt, dann setze auf 9, oder umgekehrt (sofern frei).\n # Wenn Ecke 3 besetzt, dann setze auf 7, oder umgekehrt (sofern frei).\n for ecken_paar in gegen_ecken\n if (ecken[ecken_paar[0]] > 0) and (frei.include?(ecken_paar[1]))\n zug = Zug.new(aktueller_spieler, ecken_paar[1])\n break # nicht weitersuchen\n end\n end\n end\n\n # 5. Regel: Setze in irgendeine freie Ecke.\n # Verwende Variablen 'frei' und 'ecken' von oben\n if zug.nil?\n for ecke in ecken.keys\n if frei.include?(ecke)\n zug = Zug.new(aktueller_spieler, ecke)\n break # nicht weitersuchen\n end\n end\n end\n\n # Andernfalls Zufallszug machen\n if zug.nil?\n zug = zufalls_zug(spielfeld, aktueller_spieler)\n end\n\n zug\n end",
"def blg; end",
"def im_nachbarraum_umsehen(richtung)\n naechster_raum = @aktueller_raum.ausgang(richtung)\n puts naechster_raum\n end",
"def sichtbar_machen()\n end",
"def sichtbar_machen\n @sichtbar = true\n zeichnen()\n puts(self) \n end",
"def blam!\n berzerk? ? w00t! : super\n end",
"def terpene; end",
"def sichtbar_machen\n @backgrund.sichtbar_machen\n @baum1.sichtbar_machen\n @baum2.sichtbar_machen\n @baum3.sichtbar_machen\n @haus1.sichtbar_machen\n @haus2.sichtbar_machen\n @haus3.sichtbar_machen\n @hund1.sichtbar_machen\n @hund2.sichtbar_machen\n end",
"def ausschalten()\n @schirm.farbe_aendern('orange')\n @leuchtstrahl1.unsichtbar_machen()\n @leuchtstrahl2.unsichtbar_machen()\n @leuchtstrahl3.unsichtbar_machen()\n @leuchtstrahl4.unsichtbar_machen()\n end",
"def ausgabe\n\t\t@name\n\t\n\tend",
"def sn\n end",
"def bizet; end",
"def sichtbar_machen()\n # TODO\n end",
"def weber; end",
"def ausgabe\n\t\t@name\n\tend",
"def sichtbar_machen\n @fuss.sichtbar_machen\n @stiel.sichtbar_machen\n @schirm.sichtbar_machen\n unless @tag\n @leuchtstrahl1.sichtbar_machen\n @leuchtstrahl2.sichtbar_machen\n @leuchtstrahl3.sichtbar_machen\n @leuchtstrahl4.sichtbar_machen\n end\n end",
"def formation; end",
"def langsam_vertikal_bewegen(entfernung)\n absolute_entfernung = entfernung\n if sichtbar? \n delta = 1\n if entfernung < 0 \n delta = -1\n absolute_entfernung = - entfernung\n end \n x_delta = 0\n y_delta = delta\n Leinwand.gib_einzige_instanz().\n bewege(self,absolute_entfernung,x_delta,y_delta)\n end \n @spitze = @spitze + Punkt.new(0,entfernung)\n end",
"def jack_handey; end",
"def stderrs; end",
"def funktionsname\n\tanweisung\nend",
"def sea; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def saludanombre(nombre)\n\tputs \"Estimado Señor #{nombre}\"\nend",
"def gesendete_lesen\r\n @postausgang.each{|x| puts x}\r\n end",
"def sichtbar_machen()\n @fuss.sichtbar_machen()\n @stiel.sichtbar_machen()\n @schirm.sichtbar_machen()\n @leuchtstrahl1.sichtbar_machen()\n @leuchtstrahl2.sichtbar_machen()\n @leuchtstrahl3.sichtbar_machen()\n @leuchtstrahl4.sichtbar_machen()\n end",
"def feruchemist; end",
"def slogan\n # 'A maneira mais fácil de pré-qualificar ao Atlas.'\n ''\n end",
"def unsichtbar_machen()\n end",
"def strain; end",
"def sigla; @nome; end",
"def sauvegarderJeu()\n\t\t# création de la sauvegarde\n\t\t@sauvegarde = Sauvegarde.creer( self.joueur,self.carte,self.nbTour )\n\n @sauvegardeYaml = SauvegardeYAML.creer(self.joueur.nom)\n @sauvegardeYaml.enregistrement( self.sauvegarde)\n\n\tend",
"def mitch_hedberg; end",
"def sld; end",
"def gounod; end",
"def gluck_french; end",
"def squeek\r\n\t\treturn \"eeeep\"\r\n\tend",
"def unsichtbar_machen\n @fuss.unsichtbar_machen\n @stiel.unsichtbar_machen\n @schirm.unsichtbar_machen\n @leuchtstrahl1.unsichtbar_machen\n @leuchtstrahl2.unsichtbar_machen\n @leuchtstrahl3.unsichtbar_machen\n @leuchtstrahl4.unsichtbar_machen\n end",
"def herald; end",
"def check_bingo\n\t\t\n\tend",
"def wertungWorte (wertung)\n if wertung < 1\n return 'unglaublich schlecht'\n elsif wertung < 2\n return 'wirklich schlecht'\n elsif wertung < 3\n return 'relativ schlecht'\n elsif wertung < 4\n return 'in ordnung'\n elsif wertung < 5\n return 'relativ gut'\n elsif wertung < 6\n return 'wirklich gut'\n elsif wertung < 7\n return 'sehr gut'\n elsif wertung < 8\n return 'hervorragend'\n elsif wertung < 9\n return 'unbeschreiblich gut'\n elsif wertung < 10\n return 'betörend gut'\n elsif wertung < 11\n return 'unwirklich gut'\n else\n return 'katastrophal gut'\n end\n end",
"def rossini; end",
"def dh; end",
"def folge_berechnen(tn,jahr)\n folge = [ \"\" ]\n ges_einsaetze = \"28.12.#{jahr}\".to_date.cweek\n ger_schalter = 1\n namen = prio_bilden(tn,folge,ges_einsaetze,ger_schalter)\n zaehler = 0\n while folge.size <= ges_einsaetze\n namen.each do |name|\n unless tn[name].find_index(folge.size) || folge.size > ges_einsaetze\n folge << name\n zaehler += 1\n end\n end\n if zaehler == 0\n if namen.size < tn.size && ger_schalter == 1\n ger_schalter = 0\n else\n folge << \"nicht besetzt!\"\n ger_schalter = 1\n end\n end\n zaehler = 0\n namen = prio_bilden(tn,folge,ges_einsaetze,ger_schalter)\n end\n return folge \n end",
"def singular_siegler; end",
"def nach_unten_bewegen\n bewegen_um_punkt(Punkt.new(0,10))\n end",
"def buzzword; end",
"def buzzword; end",
"def mambo_no_5; end",
"def gerund\n b = gerundive.sub( /.*\\s+(.*)um.*$/, \"\\\\1\" )\n b += \"ī, ō, etc.\"\n return b\n end",
"def vertikal_bewegen(anzahl_punkte)\n @fuss.vertikal_bewegen(anzahl_punkte)\n @stiel.vertikal_bewegen(anzahl_punkte)\n @schirm.vertikal_bewegen(anzahl_punkte)\n @leuchtstrahl1.vertikal_bewegen(anzahl_punkte)\n @leuchtstrahl2.vertikal_bewegen(anzahl_punkte)\n @leuchtstrahl3.vertikal_bewegen(anzahl_punkte)\n @leuchtstrahl4.vertikal_bewegen(anzahl_punkte)\n end",
"def herebody_s; end",
"def drittelworte( wertung )\n if wertung < 1\n string1 = ''\n elsif wertung < 2\n string1 = 'eins'\n elsif wertung < 3\n string1 = 'zwei'\n elsif wertung < 4\n string1 = 'drei'\n elsif wertung < 5\n string1 = 'vier'\n elsif wertung < 6\n string1 = 'fünf'\n elsif wertung < 7\n string1 = 'secht'\n elsif wertung < 8\n string1 = 'sieben'\n elsif wertung < 9\n string1 = 'acht'\n elsif wertung < 10\n string1 = 'neun'\n elsif wertung < 11\n string1 = 'zehn'\n elsif wertung < 12\n string1 = 'elf'\n else\n string1 = 'zwöf'\n end\n rest = sprintf(\"%.1f\",(wertung.to_f % 1))\n if rest.to_f == 0.3\n return string1 + \" ein drittel\"\n elsif rest.to_f == 0.6\n return string1 + \" zwei drittel\"\n elsif rest.to_f == 0\n return string1\n else\n return sprintf(\"%.1f\",wertung.to_s).sub(\".\",\",\")\n end\n end",
"def karte_drucken()\n # TODO ÄNDERN\n if !tarif_gewaehlt?\n puts \"Kein Tarif wurde gewählt.\"\n else\n if @eingeworfen <= @tarif.betrag\n puts \"Der offener Betrag: #{@tarif.betrag - @eingeworfen }\"\n else\n puts(\"------------------\")\n puts(\"- Cinema Magico -\")\n puts(\"- Phantastische Tierwesen\")\n # TODO diese Zeile ändern\n puts(\"- Preis \" + @tarif.betrag().to_s + \" Euro\") # vordefiniert to_s , von Integer zum String wandeln\n puts(\"- Bezahlt \" + @eingeworfen.to_s + \" Euro\") # vordefiniert to_s , von Integer zum String wandeln\n puts(\"------------------\")\n # die Gesamtsumme, mit dem der Automat nach der letzten Leerung\n # gefuettert wurde\n @eingeworfen -= @tarif.betrag\n @summe_automat = @summe_automat + @tarif.betrag\n @tarif = nil\n return\n end\n end\n\n end",
"def unsichtbar_machen()\n @fuss.unsichtbar_machen()\n @stiel.unsichtbar_machen()\n @schirm.unsichtbar_machen()\n @leuchtstrahl1.unsichtbar_machen()\n @leuchtstrahl2.unsichtbar_machen()\n @leuchtstrahl3.unsichtbar_machen()\n @leuchtstrahl4.unsichtbar_machen()\n end",
"def bellini\n fetch('opera.italian.by_vincenzo_bellini')\n end",
"def ausgleich\n\t\tsums = {}\n\t\t%w(jo caro).each do |who|\n\t\t\tsums[who] = @db.get_first_value(\"select summe from sum_#{who} where jahr = #{@options[:jahr]} and monat = #{@options[:monat]} and gemeinsam = 'g'\").to_f\n\t\tend\n\n\t\tif(sums['jo'] == sums['caro'])\n\t\t\tputs \"Gleichstand\"\n\t\t\treturn\n\t\tend\n\n\t\tausg = ((sums['jo'] + sums['caro']) / 2 - sums['jo']).abs\n\t\t\n\t\tif(sums['jo'] > sums['caro'])\n\t\t\tprintf(\"Caro an Jo: %.2f EUR\\n\", ausg)\n\t\telse\n\t\t\tprintf(\"Jo an Caro: %.2f EUR\\n\", ausg)\n\t\tend\n\t\t\n\tend",
"def bstardrag\n bstar\n end",
"def guct\n end",
"def romeo_and_juliet; end",
"def sb(t, s, c)\n\n end",
"def insult_swabbie\n return case self.swab\n when :counter\n self.boatswain\n when :timestamp\n self.coxswain\n else\n \"\"\n end\n end",
"def spren; end",
"def horizontal_bewegen(anzahl)\n bewegen_um_punkt(Punkt.new(anzahl,0)) \n end",
"def malts; end",
"def zapis_vysledek(reseni, je_splnitelna) \n @reseni = reseni\n @vysledny_soucet_vah = vrat_soucet_vah(reseni)\n @je_splnitelna = je_splnitelna\n end",
"def breathe\n \"i get oxygen from the water\"\n end",
"def isbn; end",
"def chargementJeu(nomJoueur)\n @sauvegardeYaml = SauvegardeYAML.creer(nomJoueur)\n @sauvegarde = @sauvegardeYaml.chargement()\n @joueur = @sauvegarde.joueur\n nom=@joueur.nom.split(\".\")\n @joueur.nom = nom[0]\n print @joueur.nom\n @carte = @sauvegarde.carte\n @nbTour = @sauvegarde.nbTour\n\tend",
"def Blast\n\n\t\nend",
"def who_we_are\r\n end",
"def An()\n return @RownanieWielomianu.first.Wspolczynnik\n end",
"def gram_schmidtR\n gram_schmidt[1]\n end",
"def gusts \n \"gusts\" \n end",
"def hiss; end",
"def PodstawAn(ans) \n @RownanieWielomianu.each{ |wezel| \n if(ans.key?(wezel.Wspolczynnik))\n wezel.Wspolczynnik = ans[wezel.Wspolczynnik]\n end\n }\n end",
"def scientist; end",
"def england\n end",
"def tongue_twister; end",
"def probers; end",
"def zlosniwa\r\n raise # ponownie zglasza biezacy wyjatek\r\n raise \"Houston, we've got a problem!\" # zglasza RuntimeError\r\n raise InterfaceException, \"Blad klawiatury\", caller # ustawia komunikat i slad stosu\r\nend",
"def test_sbb\n puts Sbb.find('geneva', 'berne', Time.utc(2007,\"feb\",8,13,0,0)).inspect\n end",
"def mi_carrera\n\n\tend",
"def name; termid;end",
"def vin; end"
] |
[
"0.7576614",
"0.70595306",
"0.6850953",
"0.68300265",
"0.6652317",
"0.6635704",
"0.64665234",
"0.63879704",
"0.6330819",
"0.6307666",
"0.62543666",
"0.6253937",
"0.624926",
"0.6169856",
"0.61295396",
"0.6115479",
"0.6113548",
"0.6109211",
"0.6101353",
"0.60676706",
"0.6044888",
"0.60421085",
"0.60111254",
"0.60101676",
"0.600944",
"0.59913373",
"0.59817106",
"0.59649557",
"0.590478",
"0.5880659",
"0.58578277",
"0.5843083",
"0.58184266",
"0.5812214",
"0.58086973",
"0.5806323",
"0.5806323",
"0.5806323",
"0.5806323",
"0.5767323",
"0.5766141",
"0.5747116",
"0.57454497",
"0.57277894",
"0.57056093",
"0.5702362",
"0.5674423",
"0.56541294",
"0.5639651",
"0.56295735",
"0.56231767",
"0.56141925",
"0.56083107",
"0.56040084",
"0.5592942",
"0.55865866",
"0.5571775",
"0.5541313",
"0.5535259",
"0.55208844",
"0.5517274",
"0.5509007",
"0.5508371",
"0.5508371",
"0.5499663",
"0.5489449",
"0.54837984",
"0.5481399",
"0.5458728",
"0.545015",
"0.5447507",
"0.5441904",
"0.54382044",
"0.54280895",
"0.54251796",
"0.5423542",
"0.5417894",
"0.5393028",
"0.5392647",
"0.5391713",
"0.5387715",
"0.5383053",
"0.53825873",
"0.5380288",
"0.5377187",
"0.5375708",
"0.53661525",
"0.5361911",
"0.5354287",
"0.5353342",
"0.5353063",
"0.5351982",
"0.53401613",
"0.53361946",
"0.53290504",
"0.5327695",
"0.5324891",
"0.53243613",
"0.5318225",
"0.53112805",
"0.53094244"
] |
0.0
|
-1
|
collects all owner instances
|
def initialize(name) # takes name as input
@name = name # instance variable for person name
@species = "human" # set species to human
@@all << self # pushes each instance to @@all array
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def owners\n self.cars.map{|car_instance| car_instance.owner}.uniq\n end",
"def owners\n return @owners\n end",
"def objects\n @objects ||= population_group_members.collect(&:objects).flatten.uniq\n end",
"def owners\n @obj['owners']\n end",
"def instances\n Egi::Fedcloud::Vmhound::Log.info \"[#{self.class}] Retrieving active instances\"\n fetch_instances\n end",
"def dogs\n collection_of_dogs = []\n Dog.all.each do |dog|\n if dog.owner == self\n collection_of_dogs << dog\n end \n end \n return collection_of_dogs\n end",
"def owners\n # set @owners instance variable by\n # 1) grabbing all Ownerships containing this panlist\n # 2) converting each Ownership into an Owner\n @owners ||= Ownership.where(list_id: self.id).map do |ownership|\n Owner.find_by_netid(ownership.owner_id)\n end\n end",
"def instances\n @instances ||= []\n end",
"def getOwners\r\n\t\t\t\t\treturn @owners\r\n\t\t\t\tend",
"def dogs\n Dog.all.select do |dog_instance|\n dog_instance.owner == self \n end\n end",
"def active_instances; end",
"def list_owners\n Owner.all.each_with_index do |owner, i|\n puts \"\\n#{i + 1}. #{owner.name} \\nAddress: #{owner.address}\"\n puts \"Food provided: #{owner.food_provided.capitalize}\"\n puts \"Has a cat? #{owner.cat_already.to_s.capitalize} | Has a dog? #{owner.dog.to_s.capitalize}\"\n puts \"Lives in #{owner.neighborhood.name}\"\n all_cats = Cat.all.select { |x| x.owner_id == owner.id}\n cats_list = all_cats.map{ |x| x.name }.join(\", \")\n puts \"#{owner.name}'s cat(s): #{cats_list}\"\n puts \"\\n----------------------------------------------------------------------------\"\n end\n end",
"def owners\n self.car.map do |car| car.owner.uniq\nend\n\n\n\nend",
"def cats \n Cat.all.select do |cat_instance|\n cat_instance.owner == self \n end\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 add_owner_ids\n\t\tself.owner_ids << self.payable_from_organization_id \n\t\tself.owner_ids << self.payable_to_organization_id\n\t\tself.owner_ids << self.payable_from_patient_id\n\t\tself.owner_ids.compact!\n\t\tself.owner_ids.uniq!\n\tend",
"def instances\n\t\tAlgorithm.each_ancestor_singleton(self) do |a|\n\t\t\tif a.respond_to?(:instances) && a.instances\n\t\t\t\treturn a.instances.dup\n\t\t\tend\n\t\tend\n\n\t\traise \"No method 'instances' found in any ancestor for '#{self}' (class: #{self.class})\"\n\tend",
"def my_clients\n self.client_cars.map do |car|\n car.owner\n end\n end",
"def cats\n\t\t# Note that you call upon the other class within this class.\n\t\tCat.all.select do |cat|\n\t\t\tcat.owner == self\n\t\tend\n\tend",
"def instances()\n return @instances\n end",
"def dogs\n\t\t# Note that you call upon the other class within this class.\n\t\tDog.all.select do |dog|\n\t\t\tdog.owner == self\n\t\tend\n\tend",
"def list_of_instances\n super\n end",
"def show_all\n @owners = Owner.all\n end",
"def users\n return @canonical_user_pool if @canonical_user_pool\n Egi::Fedcloud::Vmhound::Log.debug \"[#{self.class}] Retrieving all users\"\n check_retval @user_pool.info!\n\n @canonical_user_pool = []\n @user_pool.each { |user| @canonical_user_pool << canonical_user(user) }\n @canonical_user_pool\n end",
"def gym_user_instances\n user_names = []\n self.exercise_instances.each do |user|\n user_names << User.all.find {|user_instance| user_instance.id == user.user_id}\n end\n user_names\n \n end",
"def index\n @object_owners = ObjectOwner.all\n end",
"def collect_objects\n results = []\n begin\n object_ids.each do |model_name, ids|\n results << model_name.to_s.constantize.find(ids)\n end\n results.flatten\n # rescue ActiveRecord::RecordNotFound\n # generate_objects!\n # collect_objects\n end\n end",
"def instances\n end",
"def owners=(value)\n @owners = value\n end",
"def owners\n self.authors.collect(&:user)\n end",
"def index\n @all_collections = Collection.all\n @current_user = User.find_by username: session[:user]\n @collections = []\n @all_collections.each do |collection|\n if collection.owner.id == @current_user.id or collection.user_ids.include? @current_user.id\n @collections.push(collection)\n end\n end\n end",
"def reachable_entities\n Domgen.error(\"reachable_entities invoked for graph #{name} when not instance based\") if 0 != @type_roots.size\n @reachable_entities ||= []\n end",
"def accumulate_instances\n self.repository = Hash.new { |h,k| h[k] = new(*k) }\n\n begin\n yield\n return repository.values\n ensure\n self.repository = nil\n end\n end",
"def owners_included; end",
"def find_owner_appointments\n owner_appointments = Appointment.all.select { |appointment| appointment.owners.include?(self) || appointment.owner_id == id } \n if !owner_appointments.empty?\n owner_appointments\n else\n nil\n end\n end",
"def all_objects; end",
"def instances\n @instances ||= init_instances.reject(&:terminated?)\n end",
"def owners_by_key\n @owners_by_key ||= owners.group_by do |owner|\n key = owner[owner_key_name]\n key && key.to_s\n end\n end",
"def owners_of_cars_serviced\n self.personal_mechanic_of.map{|owner_obj| owner_obj.name}\nend",
"def instances; end",
"def instances; end",
"def collected_entities entity_type, viewer=nil\n entity_type = entity_type.to_s\n if viewer == self\n assoc = entity_type.to_s\n scope = self.method(assoc).call\n scope = scope.where.not(owner_id: id) if entity_type == \"List\"\n scope\n else\n arr = collection_pointers.where(entity_type: entity_type, private: false).map(&:entity)\n arr = arr.keep_if { |l| l.owner != self } if entity_type == \"List\"\n arr\n end\n end",
"def owner_names\n self.pets.map {|p| p.owner}.pluck(:name).uniq\n end",
"def users\n # TODO use SQL\n results = self.approvers + self.observers + [self.requester]\n results.compact\n end",
"def set_instances\n @instances =\n case @klass\n when Symbol\n Symbol.all_symbols.sort_by do |s| s.to_s end\n else\n ObjectSpace.to_enum(:each_object, @klass).sort_by{|i| i.object_id}\n end\n end",
"def owners\n @data['owners']\n end",
"def owner_chains\n if owners == []\n [[self.id]]\n else\n owners.map(&:c).map(&:owner_chains).reduce(:+).map{|i| [self.id]+i}\n end\n end",
"def index\n @app_instances = parent_organization.app_instances.active.where(\"updated_at.gt\" => Time.at(timestamp)).select do |i|\n # force owner assignment to avoid a refetch in ability can?(:access,i)\n i.owner = parent_organization\n can?(:access,i)\n end\n end",
"def instances\n @instances ||= begin\n h = {}\n PPStore::new(app.pstore_new_sujets).each_root(except: :last_id) do |ps, art_id|\n h.merge! art_id => new( art_id )\n end\n h\n end\n end",
"def collect_objects\n results = []\n generate_objects! if object_ids.nil?\n begin\n object_ids.each do |model_name, ids|\n results << model_name.to_s.constantize.find(ids)\n end\n results.flatten\n rescue ActiveRecord::RecordNotFound\n generate_objects!\n collect_objects\n end\n end",
"def other_instances\n\t\tinstances.reject { |i| i == self }\n\tend",
"def process_owners(api_story)\n owner_ids = api_story['owner_ids']\n\n cached_owners = owner_ids.map do |owner_id|\n User.get_cached(owner_id)\n end\n\n return cached_owners if cached_owners.none?(&:nil?)\n\n project_id = api_story['project_id']\n story_id = api_story['id']\n User.get_by_project_and_story_id(project_id, story_id)\n end",
"def all_cars\n Car.all.select do |car|\n car.owner == self\n end\n end",
"def get_owners\n return make_request(\"#{self.endpoint}/list/owners\")\n end",
"def comics_owned\n comics_array = self.comics.map do |comic|\n comic\n end\n comics_array.uniq\n end",
"def club_owner_ids\n find.\n lifes.\n clubs.\n map(:_id).\n go!\n end",
"def players\n gp = Player.where :instance_id => self.id\n gp.map { |p| p.user_id }\n end",
"def instances #:nodoc:\n r = []\n ObjectSpace.each_object(self) { |mod| r << mod }\n r\n end",
"def owned_groups\n @owned_groups = Group.where(\"owner_id = ?\", current_user)\n end",
"def dogs\n Dog.all.select do |dog|\n dog.owner == self\n end\n end",
"def owners_contents\n files = applicable_owners_files\n\n return [] if files.nil?\n\n puts \"f: #{files.inspect}\"\n files.map { |f| f[:owners] }\n end",
"def cats\n Cat.all.select do |cat|\n cat.owner == self\n end\n end",
"def all\n @pool\n end",
"def cats\n #loop through .all class method for the class Cat\n #select the value for variable cat and return it to a new array\n #every time cat.owner == self is true\n Cat.all.select do |cat|\n #block determines true value\n cat.owner == self #returns if true\n end\n end",
"def by_owners\n @entries\n .group_by(&:owner)\n .map{|owner,certs| Group.new certs, owner: owner }\n .sort_by{|grp| [-grp.hosts_count, grp.owner.downcase] }\n end",
"def all_people_tracked\n Timing.users_for_client(self.id)\n end",
"def all_people_scheduled\n Entry.users_for_client(self.id)\n end",
"def other_household_members\n return [] if period.nil?\n ids = chooser.household.users.pluck(:id) - [chooser.id]\n period.shares.nonzero.where(user_id: ids).includes(:user).map(&:user)\n end",
"def generate_all_connections!\n organisation_level_connections = []\n\n self.has_members.each do |member_uri|\n member = Person.find(member_uri)\n organisation_level_connections << member.get_connections!\n end\n\n organisation_level_connections.flatten\n end",
"def users\n watches_unique_by_user.map(&:user)\n end",
"def users\n Collection.new(klass: User, client: @client, belongs_to: self)\n end",
"def cats\n Cat.all.select { |cats| cats.owner == self }\n end",
"def initialize(name, owner)\n @name = name\n @owner = owner\n @mood = \"nervous\"\n @@all << self\n @owner.dogs << self\n end",
"def instances\n @instances ||= aws_client.instances(filters: instance_filters).map do |instance|\n OpenStruct.new(\n with_tags(instance, private_ip: instance.private_ip_address,\n public_ip: instance.public_ip_address,\n instance: instance.instance_id)\n )\n end\n end",
"def instances_relating_to(obj)\n relationships.map {|relationship_defn|\n relationship_defn.who_participates_with(obj)\n }.flatten\n end",
"def objects\n @graphs.inject([]) {|memo, g| memo += g.objects}\n end",
"def iterate\n\t\t\t# First off, if we can free up resources, we should do that first.\n\t\t\tModel::Instance.marked_on_host(AppManager.host).each { |i|\n\t\t\t\tAppManager.kill_marked i\n\t\t\t}\n\n\t\t\t# We do this right after to avoid too long a wait for instances to\n\t\t\t# spin up.\n\t\t\tModel::Instance.started_on_host(AppManager.host).each { |i|\n\t\t\t\tAppManager.check_startup i\n\t\t\t}\n\n\t\t\tModel::Instance.live_on_host(AppManager.host).each { |i|\n\t\t\t\tAppManager.check_running i\n\t\t\t}\n\n\t\t\t# TODO: ready_dataset needs a .where(:some_criterion => foo); JG\n\t\t\t# suggests a distributed hashing algorithm for selecting instances,\n\t\t\t# which from the sound of it would avoid collisions. The goal is\n\t\t\t# to distribute load semi-optimally for capacity, ideally without\n\t\t\t# requiring that the nodes communicate with or monitor each other.\n\t\t\ti = Model::Instance.ready_dataset.first\n\t\t\tif i\n\t\t\t\tAppManager.spin_up i\n\t\t\tend\n\t\tend",
"def instance_ids\n @instance_ids ||= groups.map { |gr| gr.instances.map { |i| i.instance_id } }.flatten\n end",
"def cars\n Car.all.select {|c| c.owner == self}\n end",
"def find_all_gym_users\n self.gym_user_instances.map{|user| user.name } \n end",
"def dogs\n Dog.all.select {|d| d.owner == self}\n end",
"def dogs\n Dog.doggies.select { |dogs| dogs.owner == self }\n end",
"def cats\n Cat.all.select do |cat| \n cat.owner == self \n end \n end",
"def owners\n entities.map{|e| (e.investment.company.id if e.investment)}.reject{|i| i == nil}\n end",
"def remove_all\n @owner.transaction do\n self.each { |obj| @owner.send(@remove_proc, obj) }\n end\n @members.clear\n @loaded = false # gmosx: IS this needed?\n end",
"def car_owners\n car_owners_arr = Car.all.select do |car_ob|\n #binding.pry\n car_ob.mechanic == self\n end\n car_owners_arr.map do |car_ob|\n car_ob.owner\n end\nend",
"def objects\n @objects ||= []\n end",
"def owned_tag_set_ids\n OwnedSetTagging.where(:set_taggable_type => self.class.name, :set_taggable_id => self.id).value_of(:owned_tag_set_id)\n end",
"def cats\n Cat.all.select {|cat| cat.owner == self}\n end",
"def objects\n @objects ||= []\n end",
"def collect!\n super { |r| relate_resource(yield(orphan_resource(r))) }\n end",
"def filter_owners(path, unknown_owners)\n owners = { clients: [], users: [] }\n unknown_owners.each do |entity|\n if path[0] == \"organizations\" && path.length > 2\n begin\n data.get([\"organizations\", path[1], \"clients\", entity])\n owners[:clients] |= [ entity ]\n rescue\n owners[:users] |= [ entity ]\n end\n else\n owners[:users] |= [ entity ]\n end\n end\n owners\n end",
"def user_owners\n User.where(id: owners.keys).to_a.map do |_user|\n _user.anonymous_time_verification = owners[_user.id.to_s]\n _user\n end\n end",
"def owned_events\n events\n end",
"def quota_vms_by_owner(options)\n quota_vm_stats(:quota_find_vms_by_owner, options)\n end",
"def all_objects\n objects = []\n each_namespace{|n| objects << n}\n each_namespace{|n| \n n.each_relvar{|r| objects << r}\n }\n each_namespace{|n| \n n.each_relvar{|r| r.each_candidate_key{|k| objects << k}}\n }\n each_namespace{|n| \n n.each_relvar{|r| r.each_foreign_key{|k| objects << k}}\n }\n objects\n end",
"def dogs\nDog.all.find_all do |dog|\n dog.owner == self\nend\n\nend",
"def associated_users(permission: nil)\n owner = self.user\n shares = permission.present? ? self.study_shares.where(permission: permission) : self.study_shares\n share_users = shares.map { |share| User.find_by(email: /#{share.email}/i) }.compact\n [owner] + share_users\n end",
"def owner_rent_out\n cuties = []\n Rental.all.each do |r|\n temp_arr = []\n if r.cutie.user == self\n temp_arr[0] = r.cutie\n temp_arr[1] = r\n cuties << temp_arr\n end\n end\n return cuties\n end",
"def objects\n return @objects unless @objects.nil?\n objs = []\n dict = @instance.getDictionary\n (0 ... dict.getChildCount).each do |i|\n obj = dict.getChildAt(i)\n objs << {\n :name => obj.getName,\n :qual => obj.getQualification.toString.downcase.to_sym,\n :type => obj.getType.toString.downcase.to_sym,\n :object => obj,\n }\n end\n @objects = objs\n end",
"def dog_walkers # ex: dog_instance.dog_walkers\n dog_walkers_array = self.walks.map { |walk_instance| walk_instance.dog_walker }\n dog_walkers_array.uniq\n end"
] |
[
"0.661263",
"0.6466205",
"0.6305786",
"0.6274701",
"0.6246703",
"0.622373",
"0.6196797",
"0.6129333",
"0.6098595",
"0.6012128",
"0.60044944",
"0.5979221",
"0.59784985",
"0.5953312",
"0.5952858",
"0.59420705",
"0.59360725",
"0.5903167",
"0.5897607",
"0.58966917",
"0.58838564",
"0.58814675",
"0.58802557",
"0.58707976",
"0.5861959",
"0.580741",
"0.57973206",
"0.5792823",
"0.5787672",
"0.57801825",
"0.5754277",
"0.5747926",
"0.5742343",
"0.57203704",
"0.5715171",
"0.57011515",
"0.5691561",
"0.5688289",
"0.5683056",
"0.5669284",
"0.5669284",
"0.566848",
"0.56490624",
"0.5629558",
"0.56252",
"0.5615406",
"0.56151694",
"0.56130844",
"0.5590332",
"0.55883056",
"0.55777884",
"0.5563684",
"0.55597633",
"0.55579996",
"0.55498135",
"0.55494255",
"0.5547421",
"0.55474097",
"0.5546089",
"0.5530401",
"0.55191046",
"0.5517122",
"0.5516397",
"0.55009294",
"0.5494753",
"0.5494048",
"0.5484615",
"0.5478024",
"0.5466674",
"0.54607946",
"0.5460252",
"0.54578257",
"0.54564136",
"0.5453876",
"0.54434156",
"0.5435883",
"0.54346335",
"0.54339933",
"0.5432446",
"0.54303",
"0.54206365",
"0.54151505",
"0.5404822",
"0.5399572",
"0.53872114",
"0.53846097",
"0.5381504",
"0.5378856",
"0.5376829",
"0.5373438",
"0.5367615",
"0.53666407",
"0.5363059",
"0.5357357",
"0.5352888",
"0.5350439",
"0.5344496",
"0.5337988",
"0.53333056",
"0.5331961",
"0.5326391"
] |
0.0
|
-1
|
given a dropdown list, return the list items as an array of strings with symbols for header or divider
|
def dropdown_list_items(list)
css_select(list, "li").map do |item|
if item['class'] && item['class'].include?("divider")
:divider
elsif item['class'] && item['class'].include?("dropdown-header")
{ :header => item.text.strip }
else
item.text.strip
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def make_options(items)\n items.map do |item|\n if item.is_a?(Array)\n \"<option value=\\\"#{item.last}\\\">#{item.first}</option>\"\n else\n \"<option value=\\\"#{item}\\\">#{item}</option>\"\n end\n end.join(\"\\n\")\n end",
"def format_for_dropdown(collection)\n collection.map { |o| [o.title, o.id] }\n end",
"def select_options\n map {|e| [e.text, e.to_s] }\n end",
"def menu_items\n elements = []\n\n if display_parent_work && display_parent_work.rights.present?\n elements << \"<h3 class='dropdown-header'>Rights</h3>\".html_safe\n elements << rights_statement_item\n elements << \"<div class='dropdown-divider'></div>\".html_safe\n end\n\n if has_work_download_options?\n elements << \"<h3 class='dropdown-header'>Download all #{display_parent_work.member_count} images</h3>\".html_safe\n whole_work_download_options.each do |download_option|\n elements << format_download_option(download_option)\n end\n elements << \"<div class='dropdown-divider'></div>\".html_safe\n end\n\n if viewer_template_mode?\n elements << \"<h3 class='dropdown-header'>Download selected image</h3>\".html_safe\n elements << '<div data-slot=\"selected-downloads\"></div>'.html_safe\n elsif asset_download_options\n elements << \"<h3 class='dropdown-header'>Download selected #{thing_name}</h3>\".html_safe\n asset_download_options.each do |download_option|\n elements << format_download_option(download_option)\n end\n end\n\n safe_join(elements)\n end",
"def format_list(items)\n items.join('` or `')\n end",
"def all_items\n \t\tall(:xpath, \"//select[@id='ctl00_LC_drop3']//option\").map { |a| a.text}\n \tend",
"def display_choices\n display = []\n VALID_CHOICES.each do |key, val|\n display << \"[#{val}]#{key.to_s.slice(val.length, key.length)}\"\n end\n display\nend",
"def list_items\r\n list = \"\"\r\n items.each{ |item| list = list + item.name + \"\\n\"}\r\n list\r\n end",
"def select_options\n all.map {|e| [e.name, e.to_s] }\n end",
"def select_options\n all.map {|e| [e.name, e.to_s] }\n end",
"def make_list(options)\n list = []\n to_switches(options).split(\" \").each do |a|\n list << a.gsub('\"', \"\")\n end\n list\n end",
"def card_types_information\n [\"Visa\",\"Mastercard\",\"American Express\"].collect{|i| \"<option>#{i}</option>\"}.join('').html_safe\n end",
"def items_list\n return self.pickedup_items.ordered_by_item_category.map{|it| \n \" #{it.andand.item.andand.item_code} [#{it.number_donated}] \" << (it.comments.blank? ? \"\" : \"(#{it.comments}) \")\n }.join(\"/\")\n end",
"def list_options\n list_of_options = String.new\n Contacts.each { |contact| list_of_options = list_of_options + contact[0].to_s + \"(\" + contact[1][:name_choices] + \"),\" }\n return list_of_options \nend",
"def items_for_select_menu(options = {}) \n # clean out the various parts\n html_options = options.slice(:prompt, :divider, :show_root, :root_text)\n sql_options = options.except(:prompt, :divider, :show_root, :root_text)\n \n # defaults\n html_options = {\n :prompt => \"Select #{self.name}\",\n :divider => true,\n :show_root => true,\n :root_text => \"Top Level #{self.name}\",\n }.merge(html_options)\n \n sql_options = {\n :order => [self.select_field.to_sym],\n }.merge(sql_options)\n \n mi = self.select_options[:is_tree] ? all({ :parent_id => nil }.merge(sql_options) ) : all(sql_options)\n \n res = []\n if html_options[:prompt]\n res << [nil, html_options[:prompt]] \n res << ['nil', \" ------ \"] if html_options[:divider]\n if self.select_options[:is_tree]\n if html_options[:show_root]\n res << [0, html_options[:root_text]] \n res << ['nil',\" ------ \"] if html_options[:divider]\n end\n end\n end\n \n if self.select_options[:is_tree]\n mi.each do |x|\n res << [x.send(self.value_field), x.send(self.select_field)]\n unless x.children.blank?\n x.children.each do |child|\n res << [child.send(self.value_field), \"-- #{child.send(self.select_field)}\"]\n child.children.each do |grand_child| \n res << [ grand_child.send(self.value_field), \"-- -- #{grand_child.send(self.select_field)}\"] \n end unless child.children.blank?\n end\n end\n end\n else\n mi.each do |x|\n res << [x.send(self.value_field), x.send(self.select_field)]\n end\n end\n res\n end",
"def list_selected_options\n list_selected_options = []\n @selected_options.each do |option|\n list_selected_options << option.type\n end\n return list_selected_options\n end",
"def day_select_option_tags\n options_for_select DAYS.map.with_index.to_a\n end",
"def display_choices(selections)\n display = []\n selections.each do |y, z|\n thing = \"[#{z.to_s}]#{y.to_s.slice(z.length, y.length)}\"\n display << thing\n end\n display\nend",
"def for_dropdown\n ActiveRecord::Base.connection.select_all(\n select('brands.name, brands.id').group('1, 2').order('1').to_sql\n ).map { |r| [r['name'], r['id']] }\n end",
"def choices_as_text\n values = custom_attribute_choices.map { |c| c.value }\n values.join(\"\\n\")\n end",
"def render_menu\n output = []\n\n @paginator.paginate(@choices, @page_active, @per_page) do |choice, index|\n num = (index + 1).to_s + @enum + \" \"\n selected = num.to_s + choice.name.to_s\n output << if index + 1 == @active && !choice.disabled?\n (\" \" * 2) + @prompt.decorate(selected, @active_color)\n elsif choice.disabled?\n @prompt.decorate(@symbols[:cross], :red) + \" \" +\n selected + \" \" + choice.disabled.to_s\n else\n (\" \" * 2) + selected\n end\n output << \"\\n\"\n end\n\n output.join\n end",
"def select_list; end",
"def group_drop_down\n @groups = @list.map { |hash| hash[:group] }.uniq.compact\nend",
"def to_s\n @menu_items.collect {|i| i.to_s}.to_a.join \"\\n\"\n end",
"def names(options_tag)\n names = options_tag.map { |option| option.text }\n names.reject! { |s| s.nil? || s.strip.empty? || s == '\\n' || s == \"\\u00A0\"}\nend",
"def string_array_for_select(options, names=nil)\n names.nil? ? options.map { |o| [o.to_s.humanize, o.to_s] } : names.zip(options)\n end",
"def items_list\n return self.donor_items.map{|it| \" #{it.item.andand.item_code} (#{it.number_donated}) \"}.join(\"/\")\n end",
"def get_product_dropdown_list\n @product_dropdown_list ||= lambda {\n list = []\n\n page = ::Nokogiri::HTML(firstpage)\n page.search('//div[@class=\"sb-search\"]//select[@id=\"productDropdown\"]//option').each do |product|\n option_value = product.attributes['value'].value\n option_text = product.text\n next if option_value == '-1' # This is the ALL option\n list << { option_value: option_value, option_text: option_text }\n end\n\n list\n }.call\n end",
"def options_for_select\n choices.map do |choice|\n data = {}\n data[\"choice-category\"] = choice.category_id if choice.category_id\n\n content_tag(\n :option,\n choice.short_name,\n :value => choice.id,\n :selected => selected_choice?(item, choice),\n :data => data\n )\n end.join.html_safe\n end",
"def choices\n to_display.options[:choices].map { |c| c.nil? ? nil : items[c] }\n end",
"def checkbox_list(items)\n cl = \"<ul>\"\n if(!items.empty?)\n item_class = items[0].class.to_s\n item_class_sub = item_class[0..0].to_s\n for item in items\n cl += \"<li>#{check_box_tag(item_class +\"_ids[]\", item.id, @items_to_select.include?(item), :id=>\"#{item_class_sub + \"\" + item.id.to_s}\")}\"\n\n cl += \"<label for=\\\"#{item_class_sub + \"\" + item.id.to_s}\\\">#{item.name}</label></li>\"\n\n end\n cl += \"</ul>\"\n end\n return cl\n end",
"def plant_list\n self.plant_types.order('name').map {|m| m.name}.to_sentence\n end",
"def format_list(items); end",
"def get_select_format\n \treturn @OFFER_TYPES.map{|v| [v,v]}\n end",
"def display\n return \"#{@type} (CHOOSE ONE: #{@items.join(', ')})\"\n end",
"def options_text\n options.map{ |opt| opt.text}\n end",
"def search_bar_select\n blacklight_config.search_fields.collect do |key, field_def|\n [field_def.dropdown_label || field_def.label, field_def.key] if should_render_field?(field_def)\n end.compact\n end",
"def list_names\n list_of_names = String.new\n Contacts.each { |contact| list_of_names = list_of_names + contact[1][:name_choices] + \", \" }\n return list_of_names\nend",
"def get_options\n if parts = @text.match(/([\\d]*) (.*)/)\n return parts[1].strip, parts[2].split(\",\").map(&:strip)\n end\n end",
"def option_types_presentation\n self.option_types.order(position: :asc).pluck(:presentation).compact.map(&:pluralize).uniq.to_sentence\n end",
"def selected_options; end",
"def selected_options; end",
"def list\n MENU.select do |item|\n your_list = []\n your_list << item[:what] + \" \" + item[:type]\n your_list\n end\n end",
"def multi_select title, array\n arr = %x[ echo \"#{array.join(\"\\n\")}\" | fzf --multi --reverse --prompt=\"#{title} >\"]\n return arr.split(\"\\n\")\nend",
"def to_html\n bootstrap_wrapping do\n hidden_field_for_all << # Might need to remove this guy.\n collection.map { |choice|\n choice_html(choice)\n }.join(\"\\n\").html_safe\n end\n end",
"def to_s\r\n @list.map{|el| el.to_s}.join ' | '\r\n end",
"def to_s\n element_string = '['\n @options.each { |option| element_string.concat(\"#{option.join(',')}|\") }\n element_string.chop.concat(']')\n end",
"def equipment_names\n equipment = self.quote.project.company.equipment\n list = equipment.collect! {|x| x.name}\n# list.join()\n end",
"def option_values_to_s\n option_values_string = \"\"\n \n option_values.by_option_type_id.each_with_index do |option_value, index|\n option_values_string << option_value.option_type.name\n option_values_string << \": \" + option_value.name\n option_values_string << \" / \" unless ( index + 1 ) == option_values.size\n end\n \n option_values_string\n end",
"def show_sort_options\n sortDropdown = \"\"\n eds_info.fetch('AvailableSearchCriteria', {}).fetch('AvailableSorts', []).each do |sort_option|\n sortDropdown << \"<li><a href='#{eds_action_url sort_option[\"AddAction\"].to_s}'>#{sort_option[\"Label\"].to_s}</a></li>\"\n end\n sortDropdown.html_safe\n end",
"def search_bar_select\n blacklight_config.search_fields.map do |_key, field_def|\n if should_render_field?(field_def)\n [\n field_def.dropdown_label ||\n field_def.label, field_def.key, { 'data-placeholder' => placeholder_text(field_def) }\n ]\n end\n end.compact\n end",
"def fenix_product_options_types(p)\n values=p.option_types.to_a.map! do |ot|\n \"#{ot.presentation}\"\n end\n values.to_sentence({ words_connector: \", \", two_words_connector: \", \" })\n end",
"def fenix_product_options_types(p)\n values=p.option_types.to_a.map! do |ot|\n \"#{ot.presentation}\"\n end\n values.to_sentence({ words_connector: \", \", two_words_connector: \", \" })\n end",
"def make_option_list\n end",
"def make_option_list\n end",
"def camaleon_first_list_select\n res = []\n current_site.the_post_types.decorate.each {|p| res << \"<option value='#{p.the_slug}'>#{p.the_title}</option>\" }\n res.join(\"\").html_safe\n end",
"def get_drop_down_people_by_pedigree\n options = Person.has_pedigree(params[:pedigree_id]).collect { |per| \"\\\"#{per.id}\\\" : \\\"#{per.full_identifier}\\\"\" }\n render :text => \"{#{options.join(\",\")}}\"\n end",
"def specieslist\n temp = Species.all\n array = []\n temp.each do |r|\n if r.english_name.present?\n array.push(r.english_name.to_s + \"/\" + r.scientific_name.to_s)\n else \n array.push(\"No common name/\" + r.scientific_name.to_s)\n end\n end\n sorted = array.sort\n return sorted.insert(0,\"Select species\")\n end",
"def optns_list\n @optns_list ||= Select2BikeBinder.configuration.color_option_keys.map do |k| \n [ColorNameI18n::Color.new(k).name.capitalize, k]\n end\n @optns_list \n end",
"def tag_list\n tags.collect do |tag|\n tag.name\n end.join(', ')\n end",
"def select_list\n @browser.div(:class => \"select-list\")\n end",
"def options_for_select(option_items, state = {})\n return [] if option_items.count == 0\n option_items.map do |caption, value, attributes|\n html_attributes = { :value => value || caption }.merge(attributes||{})\n html_attributes[:selected] ||= option_is_selected?(html_attributes[:value], caption, state[:selected])\n html_attributes[:disabled] ||= option_is_selected?(html_attributes[:value], caption, state[:disabled])\n content_tag(:option, caption, html_attributes)\n end\n end",
"def items_list_gg_old\n return self.pickedup_items.map{|it| \" #{it.andand.item.andand.item_code} [#{it.number_donated}] \" << (it.comments.blank? ? \"\" : \"(#{it.comments}) \")}.join(\"/\")\n end",
"def grouped_sublibraries\n html = \"\"\n @sublibraries.keys.each do |sublibrary_group|\n html << content_tag(:optgroup, label: sublibrary_group) {\n @sublibraries[sublibrary_group].collect {|sublibrary|\n concat(content_tag(:option, \"#{strip_tags(sublibrary.stored(:web_text))} #{!access_to_sublibrary(sublibrary.stored(:code)) ? '(no access)' : ''}\", value: sublibrary.stored(:code), disabled: !access_to_sublibrary(sublibrary.stored(:code)), selected: sublibrary_selected(sublibrary)))\n }\n }\n end\n html\n end",
"def tag_list\n tags.map{ |tag| tag.name }.reject(&:empty?).join(\" \")\n end",
"def export_select_tags\n return Array.new unless @in_buffer_settings[\"EXPORT_SELECT_TAGS\"]\n @in_buffer_settings[\"EXPORT_SELECT_TAGS\"].split\n end",
"def clean_select_items\n @cleaned_select_items = \"\"\n\n if selectitems != nil\n itemname_list = selectitems.scan(/\\w+/)\n dupitem_list = []\n for itemname in itemname_list\n itemptr = schema.find_namedtype_by_name( itemname )\n\n if itemptr.kind_of? EXPSM::Entity\n\n for itemname2 in itemname_list\n thetype = schema.find_namedtype_by_name( itemname2 )\n\n if thetype != nil\n if itemptr.supertypes_all != nil &&\n itemptr.supertypes_all.include?(thetype.name)\n\n dupitem_list.push itemname\n end\n end\n end\n end\n end\n\n itemname_list.each do |itemname|\n if !dupitem_list.include? itemname\n @cleaned_select_items = @cleaned_select_items + \" \" + itemname\n end\n end\n\n @cleaned_select_items = @cleaned_select_items.lstrip\n end\n end",
"def value_text\n raise \"value_text is only valid for select items\" unless self.tag_name == \"select\"\n\n values = self.value\n if values.is_a?(Array)\n values.map do |value|\n self.find(\"option[value=\\\"#{value}\\\"]\", visible: false).text\n end\n else\n self.find(\"option[value=\\\"#{values}\\\"]\", visible: false).text\n end\n end",
"def select_list_option_label\n select_list.span(:class => \"select-list-option-label\")\n end",
"def human_list(list)\n case list.length\n when 0\n \"\"\n when 1\n list[0]\n when 2\n \"#{list[0]} and #{list[1]}\"\n else\n \"#{list[0...-1].join(', ')}, and #{list[-1]}\"\n end\nend",
"def select_by_id_get_options(id_name)\n i = 0\n options = Array.new\n select_list = select_by_id(id_name)\n while i < select_list.length\n options[i] = select_list[i].text\n i = i+ 1\n end\n return options\nend",
"def dropdown_list_items_urls(list)\n css_select(list, \"a\").map do |item|\n item.attributes['href'].try(:value) || \"\"\n end\n end",
"def events\n list = []\n frm.table(:class=>/listHier lines/).rows.each do |row|\n if row.label(:for=>/eventSelected/).exist?\n list << row.label.text\n end\n end\n names = []\n list.uniq!\n list.each do | item |\n name = item[/(?<=\\s).+(?=\\s\\s\\()/]\n names << name\n end\n return names\n end",
"def to_dropdown(options = {})\r\n acts_as_dropdown(options) unless options.empty?\r\n find(:all, :conditions => self.conditions_string, :order => self.order_string).to_dropdown(self.dropdown_text_attr.to_sym, self.dropdown_value_attr.to_sym)\r\n end",
"def display_roles\n return [] if !ds_field_value?\n ds_field_value.split(',').map{|r| r.strip }.map(&:to_sym)\n end",
"def tag_list\n tags.collect(&:name).join(', ')\n end",
"def tag_list\n tags.collect(&:name).join(', ')\n end",
"def select_hour_options\n array = \"\"\n (0..23).each do |x|\n array << \"<option>#{x}</option>\"\n end\n return array \n end",
"def formatted_animal_list\n output_strings = []\n if @animals.empty?\n output_strings << \"No animals to display.\"\n else\n output_strings << \"---- Animal List ----\"\n @animals.each { |k, animal| output_strings += animal.formatted_animal_display_info }\n end\n return output_strings\n end",
"def options_string\n self.form_field_options.map {|ffo| ffo.label}.join(', ')\n end",
"def filterList(input)\n set = false\n [*input].each_with_object([]) do |item, output|\n item = item.to_s\n item = item.chomp if (@accessoryType == 'combobox') ||\n (@accessoryType == 'radiobutton' && set)\n set = true if item.end_with?(\"\\n\")\n output << item unless item.empty? || (output & [item, \"#{item}\\n\"]).any?\n end\n end",
"def tag_list\n tags.map(&:name).join(', ')\n end",
"def display_list(list)\n\t\tsanitize(list.empty? ? \"None\" : list.map(&:display).join(', '))\n\tend",
"def selectize_items(selector = selectize_selector)\n all(\"#{selector} .selectize-dropdown-content .item\").map do |div|\n {\n value: div[:'data-value'],\n text: div.text,\n }\n end\n end",
"def getSelectedItems\r\n assert_exists\r\n returnArray = []\r\n #element.log \"There are #{@o.length} items\"\r\n @o.each do |thisItem|\r\n #puts \"#{thisItem.selected}\"\r\n if thisItem.selected\r\n #element.log \"Item ( #{thisItem.text} ) is selected\"\r\n returnArray << thisItem.text \r\n end\r\n end\r\n return returnArray \r\n end",
"def all_deputies_full_names\n names = []\n\n @doc.css('span[class = list_nom]').each do |element|\n names << element.text.strip\n end\n\n names.map { |name| name.split(', ') }.flatten\nend",
"def list(names)\n array = names.map{|n| n.values}\n if array.size > 2\n array[0..-2].join(\", \") + \" & #{array[-1][0]}\"\n else\n array.join(\" & \")\n end\nend",
"def display_menu choices\n\t\tmenu_array = [\"\\nHangman Options\", \"===============\"] + choices\n\t\tmenu_array.each { |menu| puts menu }\t\t\n\tend",
"def dropdown inner, args={}\n\t\t\ta = []\n\t\t\tprompt = (args && args[:prompt]) ? args[:prompt] + \" \" : \"\"\n\t\t\ta << '<a type=\"button\" class=\"btn btn-default dropdown-toggle\" data-toggle=\"dropdown\">'+prompt+'<span class=\"caret\">'\\\n\t\t\t '</span><span class=\"sr-only\">Toggle Dropdown</span></a>'\n\n\t\t\ta << inner\n\n\t\t\ta.flatten\n\t\tend",
"def tag_list\n tags.map(&:name).join(\", \")\n end",
"def array_to_html array, type\n '<ul> <li>' +\n array.join('</li><li>')\n + '</li> </ul>'\nend",
"def tag_list\n tags.map(&:name).join(\", \")\n end",
"def tag_list\n tags.map(&:name).join(\", \")\n end",
"def tag_list\n tags.map(&:name).join(\", \")\n end",
"def list_items_to_sell\r\n list = \"\"\r\n items.each{ |item|\r\n if item.active == true\r\n list = list + item.name + \"\\n\"\r\n end}\r\n list\r\n end",
"def college_application_choice_options_array\n return %w[Reach Solid Safety] if college_application_choice_options.blank?\n college_application_choice_options.try(:split, \"\\n\").try(:collect, &:strip).to_a\n end",
"def tag_list\n tags.join(\", \")\n end",
"def elements_for_select(elements)\n return [] if elements.nil?\n elements.collect do |e|\n [\n Element.display_name_for(e['name']),\n e['name']\n ]\n end\n end",
"def line_item_name line_item\n option_values_text = line_item.variant.option_values.map(&:presentation).join(\" \")\n [line_item.product.name, option_values_text].join(\" \")\n end"
] |
[
"0.6703572",
"0.6472989",
"0.6442024",
"0.6339355",
"0.625227",
"0.62237626",
"0.6216079",
"0.6163029",
"0.6160544",
"0.6160544",
"0.61278826",
"0.6117026",
"0.6082532",
"0.60705376",
"0.60685676",
"0.6016247",
"0.59884906",
"0.59873635",
"0.5909746",
"0.5871464",
"0.57388884",
"0.57215786",
"0.5714537",
"0.5677044",
"0.56641644",
"0.5662547",
"0.5652187",
"0.5647159",
"0.56401426",
"0.5635059",
"0.5622847",
"0.56200844",
"0.5619925",
"0.56038815",
"0.5584115",
"0.556203",
"0.55576205",
"0.55572",
"0.5543409",
"0.5529698",
"0.5509124",
"0.5509124",
"0.5501519",
"0.5478389",
"0.5474832",
"0.5473223",
"0.54715157",
"0.544395",
"0.54414046",
"0.54358125",
"0.54257643",
"0.5420099",
"0.5420099",
"0.5407574",
"0.5407574",
"0.5394831",
"0.5389762",
"0.53844476",
"0.5383456",
"0.5373794",
"0.5365445",
"0.53442144",
"0.53407097",
"0.5339098",
"0.5337386",
"0.53349525",
"0.5334086",
"0.5327275",
"0.5324263",
"0.5320174",
"0.5315209",
"0.53146166",
"0.53128",
"0.5305788",
"0.5302821",
"0.5299467",
"0.5299467",
"0.5298684",
"0.5291205",
"0.52868795",
"0.5286626",
"0.5283854",
"0.52809876",
"0.5273738",
"0.5267645",
"0.5265293",
"0.52644813",
"0.52629304",
"0.525957",
"0.52579534",
"0.5252971",
"0.52474594",
"0.52474594",
"0.52474594",
"0.5239098",
"0.5225327",
"0.5224494",
"0.52126354",
"0.5204847"
] |
0.73770213
|
1
|
GET /inversions GET /inversions.json
|
def index
permission_denied and return if current_user.cannot 'read_inversion'
@inversions = Inversion.all
@new_inversion = Inversion.new
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def versions\n JSON.parse(RestClient.get(\"#{VERSION_URL}/.json\", self.default_headers))[\"versions\"].collect { |v| v[\"id\"] }.uniq\n end",
"def list_all_aos_versions(args = {}) \n get(\"/aosversions.json/all\", args)\nend",
"def list_active_aos_versions(args = {}) \n get(\"/aosversions.json/\", args)\nend",
"def listversions(project=self.project)\n get('listversions.json', project: project)['versions']\n end",
"def fetch_versions\n http_get(\"#{host}/#{Configuration.versions_file}\").body\n end",
"def get_versions\r\n versions_nodes = BankNodestructure.version_gather(params[:subject], params[:grade])\r\n render json: versions_nodes.to_json\r\n end",
"def index\n @file_versions = FileVersion.all\n\n render json: @file_versions\n end",
"def versions\n authorize @page\n @versions = @page.versions\n status = params[:by_status] && Page.statuses[params[:by_status]]\n if status\n @versions = @versions.where_object(status: status)\n end\n @versions = @versions.reorder(created_at: :desc, id: :desc).page params[:page]\n end",
"def index\n @admin_versions = Admin::Version.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_versions }\n end\n end",
"def versions\n authorize @page\n @versions = @page.versions\n status = params[:by_status] && Page.statuses[params[:by_status]]\n if status\n @versions = @versions.where_object(status: status)\n end\n @versions = @versions.reorder(created_at: :desc, id: :desc).page params[:page]\n end",
"def get_versions(project_id_or_key)\n get(\"projects/#{project_id_or_key}/versions\")\n end",
"def index\n @versions = Version.all\n end",
"def getVersions\r\n\t\t\t\t\treturn @versions\r\n\t\t\t\tend",
"def show\n @document = Document.where(:id => params[:id])\n render :json => @document, :include => [:versions]\n end",
"def show\n puts params[:id]\n @file_versions = FileVersion.where(versioned_file_id: params[:id]) \n #@file_versions = FileVersion.find(:versioned_file_id => params[:versioned_file_id])\n render json: @file_versions\n end",
"def list_all_aos_version_boxes(args = {}) \n get(\"/aosversions.json/aosversionbox\", args)\nend",
"def index\n @versions = @application.versions.all\n respond_to do |format|\n format.html\n format.json { render json: VersionsDatatable.new(view_context) }\n end\n end",
"def set_inversion\n @inversion = Inversion.find(params[:id])\n end",
"def index_invites\n puts \"user: #{@current_user.json_hash[:id]}\"\n dinners = []\n @dinners = @current_user.invited_dinners\n @dinners.each do |dinner|\n dinners << dinner.all_info\n end\n render json: dinners\n end",
"def get_all_versions\n []\n end",
"def versions\n # TODO make this a collection proxy, only loading the first, then the\n # rest as needed during iteration (possibly in chunks)\n return nil if @archived\n @versions ||= [self].concat(CloudKit.storage_adapter.query { |q|\n q.add_condition('resource_reference', :eql, @resource_reference)\n q.add_condition('archived', :eql, 'true')\n }.reverse.map { |hash| self.class.build_from_hash(hash) })\n end",
"def index\n @api_versions = ApiVersion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @api_versions }\n end\n end",
"def versions\n versions = Backlogjp.base._command \"getVersions\", self.id\n versions.map {|hash| Version.new(hash)}\n end",
"def index\n @api_versions = ApiVersion.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @api_versions }\n end\n end",
"def remote_versions_for(name)\n require 'json'\n\n client.url = \"https://rubygems.org/api/v1/versions/#{name}.json\"\n client.follow_location = true\n client.http_get\n json = JSON.parse(client.body_str)\n json.collect { |version| version['number'] }\n end",
"def versions\n Version.all\n end",
"def versions\n\t\tObjectVersion.where(\n\t\t\t:format => 1,\n\t\t\t:model_id => self.id, \n\t\t\t:inki_model_name => self.class.to_s, \n\t\t).order(\"created_at DESC\")\n\tend",
"def inversions\n Chord.inversions[0..@chord_type.norm_interval_structure.size - 1]\n end",
"def page_versions\n list_versions_for(latest_version_of(@item.path))\n end",
"def index\n @manage_app_versions = Manage::AppVersion.all\n end",
"def get_aos_version(args = {}) \n get(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def versions\n @page = Comatose::Page.find_is_snippet params[:id]\n @version_num = (params[:version] || @page.versions.length).to_i\n @version = @page.find_version(@version_num)\n end",
"def get_all_versions()\n return []\n end",
"def versions\n @page = ComatosePage.find params[:id]\n @version_num = (params[:version] || @page.versions.length).to_i\n @version = @page.find_version(@version_num)\n end",
"def versions(sku, offer, location = @location, publisher = @publisher)\n raise ArgumentError, \"No location specified\" unless location\n raise ArgumentError, \"No publisher specified\" unless publisher\n\n url = build_url(\n location, 'publishers', publisher, 'artifacttypes', 'vmimage',\n 'offers', offer, 'skus', sku, 'versions'\n )\n\n JSON.parse(rest_get(url)).map{ |element| element['name'] }\n end",
"def index\n @inboxes = Inbox.all\n @inboxes = @inboxes.select { |x| x.umkm_id == params[:umkm_id].to_i }\n render json: {items: @inboxes}\n end",
"def versions(resource_uri, format = \"text/turtle\")\n log \"versions for #{resource_uri}\"\n get \"#{resource_uri}/fcr:versions\", format\n end",
"def index\n @invts = Invt.all\n end",
"def get(*args)\n params = args.extract_options!\n @connection.get do |req|\n req.url versioned_path(args), params\n end\n end",
"def versions\n info[:versions]\n end",
"def show\n @file_record = FileRecord.find(params[:id])\n @file_versions = @file_record.file_versions.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @file_record }\n format.json { render json: {file_record: @file_record,file_versions: @file_versions} }\n end\n end",
"def subject_versions(subject)\n get \"/subjects/#{subject}/versions\"\n end",
"def versions\n self.class.where(id: self._id)\n end",
"def index\n @invs = Inv.all\n end",
"def versions\n @versions ||= json_dir_names.sort_by { |v| Gem::Version.new(v) }.reverse!\n end",
"def versions()\n return MicrosoftGraph::Shares::Item::List::Items::Item::Versions::VersionsRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def get_aos_version_box_by_id(args = {}) \n get(\"/aosversions.json/aosversionbox/#{args[:aosVersionBoxId]}\", args)\nend",
"def index\n @page = Page.find(params[:page_id])\n @revisions = @page.revisions\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @revisions }\n end\n end",
"def show\n @admin_version = Admin::Version.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_version }\n end\n end",
"def partial_page_versions(partial)\n list_versions_for(latest_version_of(partial))\n end",
"def show\n @version = Version.find(params[:id])\n @versionconfig= @version.version_configurations.all\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @version }\n end\n end",
"def index\n @invites = Invite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @invites }\n end\n end",
"def index\n @invites = Invite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @invites }\n end\n end",
"def index\n @invites = Invite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @invites }\n end\n end",
"def index\n @nuage_versions = NuageVersion.all\n end",
"def index\n @vers = Ver.all\n end",
"def inversions\n inversions = Array.new\n 1.upto(size-1) do |i|\n (i+1).upto(size) do |j|\n inversions << [i,j] if self[i] > self[j]\n end\n end\n return inversions\n end",
"def versions_id(project_key)\n request = ServiceHelper.new base_url: @jira_url, path: \"rest/api/3/project/\"\n request.auth 'basic', @jira_user, @jira_token\n request.headers.add 'Accept', 'application/json'\n request.append_to_route \"#{project_key}/versions\"\n response = request.get\n raise Exception, response.body unless response.ok?\n\n response.parsed_body\n end",
"def list_versions request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_versions_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::ArtifactRegistry::V1beta2::ListVersionsResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"def index\n @client_releases = ClientRelease.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @client_releases }\n end\n end",
"def get_list_file_versions(request)\n data, _status_code, _headers = get_list_file_versions_with_http_info(request)\n data\n end",
"def index\n @active_page = :versions\n\n respond_to do |format|\n format.html\n format.xml do\n find_versions\n @versions_count = @versions.size\n @versions = @versions[ @page_limit * (@current_page - 1), @page_limit ].to_a\n render :action => :index, :layout => false\n end\n end\n end",
"def index\n\t\t@guild_invites = @guild.invites.order(\"id DESC\")\n\tend",
"def index\n @releases = Release.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @releases.to_json(:except => [:user_id]) }\n end\n end",
"def index\n @invoices = @user.invoices.all\n render json: @invoices, status: :ok\n end",
"def remote_versions\n Setting.upyun.images.versions\n end",
"def versions\n return @_versions ||= Regulate::Git::Interface.commits(id)\n end",
"def list_all_tenantcircles_for_a_version_box(args = {}) \n get(\"/aosversions.json/aosversionbox/circles/#{args[:aosVersionBoxId]}\", args)\nend",
"def received_invitations\n user = User.find(params[:user_id])\n @invitations = user.invitations\n\n render json: @invitations\n end",
"def show\n @version = Version.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @version }\n end\n end",
"def index\n @ivn_links = IvnLink.all\n end",
"def invited_users\n render json: @moot.list_users_can_vote\n end",
"def index\n @releases = @environment.releases.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @releases }\n end\n end",
"def calc_inversions arr\n n = arr.length\n return [0, arr] if n == 1\n half = n.even? ? n / 2 : (n + 1) / 2\n left_inversions, left_arr = calc_inversions(arr[0, half])\n right_inversions, right_arr = calc_inversions(arr[half, n])\n num_inversions, sorted_arr = count_and_sort_split_inversions(left_arr, right_arr)\n num_inversions = num_inversions + left_inversions + right_inversions\n [num_inversions, sorted_arr]\nend",
"def index\n @inboxes = current_user.inboxes\n end",
"def show\n @revision = Revision.find(params[:id])\n\n render json: @revision\n end",
"def versions\n registered_versions.keys\n end",
"def vips\n request :get, '/vips'\n end",
"def getVersionedObjects\n readVersionedObjects\n\n return @VersionedObjects\n end",
"def versions_list_with_http_info(project_id, translation_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VersionsHistoryApi.versions_list ...'\n end\n # verify the required parameter 'project_id' is set\n if @api_client.config.client_side_validation && project_id.nil?\n fail ArgumentError, \"Missing the required parameter 'project_id' when calling VersionsHistoryApi.versions_list\"\n end\n # verify the required parameter 'translation_id' is set\n if @api_client.config.client_side_validation && translation_id.nil?\n fail ArgumentError, \"Missing the required parameter 'translation_id' when calling VersionsHistoryApi.versions_list\"\n end\n # resource path\n local_var_path = '/projects/{project_id}/translations/{translation_id}/versions'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'translation_id' + '}', CGI.escape(translation_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?\n query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].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/json'])\n header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<TranslationVersion>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Basic', 'Token']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VersionsHistoryApi#versions_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n response = ::Phrase::Response.new(data, headers)\n return response, status_code, headers\n end",
"def list_versions_for(path)\n @list_versions_for_cache ||= {}\n @list_versions_for_cache[path] ||= begin\n _, root_folder, relative_path = split_relative_url(non_versioned_path(path))\n possible_versions = [current_version_for_folder(root_folder)] + Dir.glob(\"#{content_path}/#{root_folder}/versions/v*\").map do |path|\n version_from_relative_url(path[content_path.length..-1])\n end\n\n possible_versions.select do |version|\n version_exists_for_path?(version, path)\n end.compact.sort_by do |version|\n major_minor(version)\n end.reverse\n end\n end",
"def get_aos_version_by_name(args = {}) \n get(\"/aosversions.json/version/#{args[:aosVersionName]}\", args)\nend",
"def vin\n @vin ||= Vin.new(\n fetch(\n path: Vin::PATH.call(id)\n )\n ).vin\n end",
"def versions_by_id(klass, version_ids)\n klass.\n paper_trail.version_class.\n where(id: version_ids).\n inject({}) { |a, e| a.merge!(e.item_id => e) }\n end",
"def versions\n @versions ||= run( :versions, '--bare' ).lines.map( &:chomp )\n end",
"def related_versions\n PaperTrail::Version.where(item_owner: self)\n end",
"def add_inversions\n @cards.values.each {|c| add_card c.invert }\n end",
"def index\n @package_versions = PackageVersion.all\n end",
"def fetch_versions\n html = Nokogiri::HTML(open('https://bitnami.com/stack/elasticsearch/cloud/amazon'))\n raw_entries = html.xpath('//td[@class=\"instance_id\"]')\n entries = raw_entries.xpath('a')\n raw_entries.xpath('strong/a').each { |sa| entries << sa }\n raw_versions = entries.map do |i|\n [\n i.xpath('@href').first.value.split('/').last,\n i.children.first.text\n ]\n end.to_h\n parse_versions(raw_versions)\n end",
"def index\n @involvements = Involvement.all\n end",
"def versions\n @versions ||= VersionsProxy.new self\n end",
"def show\n @release = Release.find(params[:id])\n @total_downloads = 0\n @release.versions.each do |v|\n @total_downloads += v.downloads\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @release }\n end\n end",
"def index\n @invitations = Invitation.all\n\n render json: @invitations, except: [:created_at, :updated_at], \n include: [:event => {include: [:host => {except: [:password_digest, :created_at, :updated_at]}]}]\n end",
"def version_nodes\n design_response.map do |response|\n response.dig('node', 'versions', 'edges')\n end\n end",
"def fetch_version (resource_version,identifier,params={})\n uri = '/api/page_version/' + resource_version.to_s + '/' + identifier\n alt_http_get(uri,params)\n end",
"def inversions(arr)\n if arr.length <= 1\n return [0, arr]\n else\n m = arr.length / 2\n count_left, left = inversions(arr[0...m])\n count_right, right = inversions(arr[m..-1])\n count, result = merge_inversions(left, right)\n return [count_left + count_right + count, result]\n end\nend",
"def versions\n Code.where(parent_id: parent_id, parent_class: parent_class, name: name)\n end",
"def index\n @votes = @change.votes.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"def index\n #@verses = Verse.all\n @verses = Verse.paginate(page: params[:page]) \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @verses }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @supervisions }\n end\n end"
] |
[
"0.6828426",
"0.6658833",
"0.6615265",
"0.656496",
"0.6462295",
"0.6443544",
"0.634676",
"0.6336408",
"0.6273345",
"0.62544596",
"0.6249097",
"0.6248858",
"0.61608666",
"0.6144573",
"0.6137064",
"0.6088992",
"0.6064875",
"0.5995043",
"0.59650743",
"0.5959151",
"0.58936846",
"0.5891286",
"0.5881247",
"0.586047",
"0.5831829",
"0.5806189",
"0.5804617",
"0.5804314",
"0.57969826",
"0.5761395",
"0.5757857",
"0.57546216",
"0.5747741",
"0.5702705",
"0.57020456",
"0.567566",
"0.56655276",
"0.5654074",
"0.56467634",
"0.5640773",
"0.5636172",
"0.562536",
"0.561103",
"0.5589862",
"0.5584865",
"0.5573933",
"0.55721736",
"0.55442417",
"0.5517124",
"0.5508366",
"0.55076563",
"0.55036885",
"0.55036885",
"0.55036885",
"0.54918796",
"0.54862225",
"0.5485508",
"0.5485441",
"0.5482732",
"0.5464671",
"0.5463956",
"0.5450673",
"0.54460156",
"0.5444508",
"0.54371876",
"0.5428647",
"0.5425402",
"0.5414213",
"0.54117435",
"0.54092216",
"0.5407078",
"0.5402598",
"0.5388123",
"0.53873074",
"0.5374344",
"0.53685796",
"0.5359964",
"0.5344055",
"0.53251535",
"0.5322624",
"0.5319829",
"0.5315925",
"0.53094316",
"0.53090584",
"0.53056604",
"0.5298973",
"0.5273827",
"0.52722967",
"0.5263138",
"0.52623826",
"0.5261173",
"0.52555513",
"0.52497053",
"0.52467585",
"0.52446544",
"0.52319825",
"0.5227951",
"0.5211781",
"0.52070004",
"0.52028304"
] |
0.6722068
|
1
|
GET /inversions/1 GET /inversions/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def list_active_aos_versions(args = {}) \n get(\"/aosversions.json/\", args)\nend",
"def list_all_aos_versions(args = {}) \n get(\"/aosversions.json/all\", args)\nend",
"def versions\n JSON.parse(RestClient.get(\"#{VERSION_URL}/.json\", self.default_headers))[\"versions\"].collect { |v| v[\"id\"] }.uniq\n end",
"def index\n @admin_versions = Admin::Version.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_versions }\n end\n end",
"def index\n @versions = Version.all\n end",
"def index\n permission_denied and return if current_user.cannot 'read_inversion'\n @inversions = Inversion.all\n @new_inversion = Inversion.new\n end",
"def index\n @file_versions = FileVersion.all\n\n render json: @file_versions\n end",
"def fetch_versions\n http_get(\"#{host}/#{Configuration.versions_file}\").body\n end",
"def show\n @document = Document.where(:id => params[:id])\n render :json => @document, :include => [:versions]\n end",
"def show\n puts params[:id]\n @file_versions = FileVersion.where(versioned_file_id: params[:id]) \n #@file_versions = FileVersion.find(:versioned_file_id => params[:versioned_file_id])\n render json: @file_versions\n end",
"def index\n @versions = @application.versions.all\n respond_to do |format|\n format.html\n format.json { render json: VersionsDatatable.new(view_context) }\n end\n end",
"def show\n @version = Version.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @version }\n end\n end",
"def get_aos_version(args = {}) \n get(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def listversions(project=self.project)\n get('listversions.json', project: project)['versions']\n end",
"def show\n @admin_version = Admin::Version.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_version }\n end\n end",
"def index\n @api_versions = ApiVersion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @api_versions }\n end\n end",
"def get_versions\r\n versions_nodes = BankNodestructure.version_gather(params[:subject], params[:grade])\r\n render json: versions_nodes.to_json\r\n end",
"def get_versions(project_id_or_key)\n get(\"projects/#{project_id_or_key}/versions\")\n end",
"def show\n @version = Version.find(params[:id])\n @versionconfig= @version.version_configurations.all\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @version }\n end\n end",
"def versions\n authorize @page\n @versions = @page.versions\n status = params[:by_status] && Page.statuses[params[:by_status]]\n if status\n @versions = @versions.where_object(status: status)\n end\n @versions = @versions.reorder(created_at: :desc, id: :desc).page params[:page]\n end",
"def index\n @api_versions = ApiVersion.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @api_versions }\n end\n end",
"def get_aos_version_by_name(args = {}) \n get(\"/aosversions.json/version/#{args[:aosVersionName]}\", args)\nend",
"def show\n @api_version = ApiVersion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @api_version }\n end\n end",
"def list_all_aos_version_boxes(args = {}) \n get(\"/aosversions.json/aosversionbox\", args)\nend",
"def set_inversion\n @inversion = Inversion.find(params[:id])\n end",
"def versions\n authorize @page\n @versions = @page.versions\n status = params[:by_status] && Page.statuses[params[:by_status]]\n if status\n @versions = @versions.where_object(status: status)\n end\n @versions = @versions.reorder(created_at: :desc, id: :desc).page params[:page]\n end",
"def index\n response = VersionResponse.new( BUILD_VERSION )\n render json: response, :status => 200\n end",
"def versions\n @page = ComatosePage.find params[:id]\n @version_num = (params[:version] || @page.versions.length).to_i\n @version = @page.find_version(@version_num)\n end",
"def get(*args)\n params = args.extract_options!\n @connection.get do |req|\n req.url versioned_path(args), params\n end\n end",
"def getVersions\r\n\t\t\t\t\treturn @versions\r\n\t\t\t\tend",
"def get_aos_version_box_by_id(args = {}) \n get(\"/aosversions.json/aosversionbox/#{args[:aosVersionBoxId]}\", args)\nend",
"def show\n @file_version = FileVersion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @file_version }\n end\n end",
"def show\n @file_record = FileRecord.find(params[:id])\n @file_versions = @file_record.file_versions.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @file_record }\n format.json { render json: {file_record: @file_record,file_versions: @file_versions} }\n end\n end",
"def show\n @revision = Revision.find(params[:id])\n\n render json: @revision\n end",
"def show\n @fileversion = Fileversion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fileversion }\n end\n end",
"def versions\n\t\tObjectVersion.where(\n\t\t\t:format => 1,\n\t\t\t:model_id => self.id, \n\t\t\t:inki_model_name => self.class.to_s, \n\t\t).order(\"created_at DESC\")\n\tend",
"def versions\n @page = Comatose::Page.find_is_snippet params[:id]\n @version_num = (params[:version] || @page.versions.length).to_i\n @version = @page.find_version(@version_num)\n end",
"def index\n @manage_app_versions = Manage::AppVersion.all\n end",
"def view_version\n @version = params[:version].to_i\n @story = Story.find(params[:id])\n @story = @story.versions[@version].reify\n\n respond_to do |format|\n format.html { render :version }\n format.html { head :no_content }\n end\n end",
"def remote_versions_for(name)\n require 'json'\n\n client.url = \"https://rubygems.org/api/v1/versions/#{name}.json\"\n client.follow_location = true\n client.http_get\n json = JSON.parse(client.body_str)\n json.collect { |version| version['number'] }\n end",
"def index\n @nuage_versions = NuageVersion.all\n end",
"def index\n @vers = Ver.all\n end",
"def fetch_version (resource_version,identifier,params={})\n uri = '/api/page_version/' + resource_version.to_s + '/' + identifier\n alt_http_get(uri,params)\n end",
"def versions_id(project_key)\n request = ServiceHelper.new base_url: @jira_url, path: \"rest/api/3/project/\"\n request.auth 'basic', @jira_user, @jira_token\n request.headers.add 'Accept', 'application/json'\n request.append_to_route \"#{project_key}/versions\"\n response = request.get\n raise Exception, response.body unless response.ok?\n\n response.parsed_body\n end",
"def version_info\n path = File.join(SERVER_ROOT, 'public', 'version_info.json')\n JSON.load File.read(path)\nend",
"def page_versions\n list_versions_for(latest_version_of(@item.path))\n end",
"def versions\n info[:versions]\n end",
"def index\n @client_releases = ClientRelease.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @client_releases }\n end\n end",
"def versions(resource_uri, format = \"text/turtle\")\n log \"versions for #{resource_uri}\"\n get \"#{resource_uri}/fcr:versions\", format\n end",
"def show_version\n \t\t@policy = Policy.find(params[:id])\n\t\t@versions = @policy.versions\n \t@policy = @policy.versions[params[:version].to_i].reify if params[:version]\n \tend",
"def get_history_version(title_number, version)\n\n response = rest_get_call($HISTORIAN_URL + '/' + title_number +'?version=' + version.to_s)\n\n if (response.code != '200') then\n raise \"Failed to retrieve historical version specified: \" + response.body\n end\n\n return JSON.parse(response.body)\nend",
"def versions\n versions = Backlogjp.base._command \"getVersions\", self.id\n versions.map {|hash| Version.new(hash)}\n end",
"def index_invites\n puts \"user: #{@current_user.json_hash[:id]}\"\n dinners = []\n @dinners = @current_user.invited_dinners\n @dinners.each do |dinner|\n dinners << dinner.all_info\n end\n render json: dinners\n end",
"def get_all_versions\n []\n end",
"def index\n @invts = Invt.all\n end",
"def show\n @release = Release.find(params[:id])\n @total_downloads = 0\n @release.versions.each do |v|\n @total_downloads += v.downloads\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @release }\n end\n end",
"def show\n @app_version = @app.app_versions.find(params[:id])\n # @app_version = AppVersion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @app_version }\n end\n end",
"def index\n @releases = @environment.releases.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @releases }\n end\n end",
"def subject_versions(subject)\n get \"/subjects/#{subject}/versions\"\n end",
"def index\n @releases = Release.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @releases.to_json(:except => [:user_id]) }\n end\n end",
"def versions\n Version.all\n end",
"def index\n @page = Page.find(params[:page_id])\n @revisions = @page.revisions\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @revisions }\n end\n end",
"def versions(sku, offer, location = @location, publisher = @publisher)\n raise ArgumentError, \"No location specified\" unless location\n raise ArgumentError, \"No publisher specified\" unless publisher\n\n url = build_url(\n location, 'publishers', publisher, 'artifacttypes', 'vmimage',\n 'offers', offer, 'skus', sku, 'versions'\n )\n\n JSON.parse(rest_get(url)).map{ |element| element['name'] }\n end",
"def index\n @invs = Inv.all\n end",
"def versions\n # TODO make this a collection proxy, only loading the first, then the\n # rest as needed during iteration (possibly in chunks)\n return nil if @archived\n @versions ||= [self].concat(CloudKit.storage_adapter.query { |q|\n q.add_condition('resource_reference', :eql, @resource_reference)\n q.add_condition('archived', :eql, 'true')\n }.reverse.map { |hash| self.class.build_from_hash(hash) })\n end",
"def upgrade\n respond_to do |wants|\n wants.json {\n ver = params[:ver]\n soft = SoftVersion.find_new_version_by_ver(ver)\n hash = {}\n if soft and soft.is_a?SoftVersion\n hash[:newversion] = true\n hash[:url] = \"http://#{request.host_with_port}/welcome/download?soft=#{soft.soft_name}&version=#{soft.version}\"\n else\n hash[\"newversion\"] = false\n hash[\"url\"] = \"No new version\"\n end\n render :json => hash.to_json, :layout => false\n }\n end\n\n end",
"def versions\n self.class.where(id: self._id)\n end",
"def show\n @version_tag = VersionTag.find(params[:id].to_i) rescue nil\n respond_to do |format|\n unless @version_tag.blank?\n # to provide a version_tag specific and secure representation of an object, wrap it in a presenter\n \n format.xml { render :xml => version_tag_presenter }\n format.json { render :json => version_tag_presenter }\n else\n format.xml { head :not_found }\n format.json { head :not_found }\n end\n end\n end",
"def show_version\n @fdn_org_hierarchy = Fdn::OrgHierarchy.find(params[:id])\n @current_rel_id = params[:current_rel_id]\n @org_elements = @fdn_org_hierarchy.org_hie_elements\n @ver = params[:ver]||@fdn_org_hierarchy.org_hie_versions.first.ver\n end",
"def get_version\n response = self.class.get(\"/service/#{$service_id}/version/#{$service_version}\", {\n headers: {\"Fastly-Key\" => $key}\n })\n end",
"def get_aos_version_box_by_name(args = {}) \n get(\"/aosversions.json/aosversionbox/name/#{args[:aosVersionBoxName]}\", args)\nend",
"def index\n @active_page = :versions\n\n respond_to do |format|\n format.html\n format.xml do\n find_versions\n @versions_count = @versions.size\n @versions = @versions[ @page_limit * (@current_page - 1), @page_limit ].to_a\n render :action => :index, :layout => false\n end\n end\n end",
"def show\n @verse = Verse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @verse }\n end\n end",
"def show\n @verse = Verse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @verse }\n end\n end",
"def show\n @verse = Verse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @verse }\n end\n end",
"def fetch_version(resource_type,identifier,params={})\n path = '/api/' + resource_type.to_s + '_version?name=' + identifier\n http_get(path,params)\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @supervisions }\n end\n end",
"def vin\n @vin ||= Vin.new(\n fetch(\n path: Vin::PATH.call(id)\n )\n ).vin\n end",
"def index\n @invoices = @user.invoices.all\n render json: @invoices, status: :ok\n end",
"def json_for_version(version)\n JSON.parse(json_pathname(version).read)['content']\n end",
"def index\n @package_versions = PackageVersion.all\n end",
"def versions_list_with_http_info(project_id, translation_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VersionsHistoryApi.versions_list ...'\n end\n # verify the required parameter 'project_id' is set\n if @api_client.config.client_side_validation && project_id.nil?\n fail ArgumentError, \"Missing the required parameter 'project_id' when calling VersionsHistoryApi.versions_list\"\n end\n # verify the required parameter 'translation_id' is set\n if @api_client.config.client_side_validation && translation_id.nil?\n fail ArgumentError, \"Missing the required parameter 'translation_id' when calling VersionsHistoryApi.versions_list\"\n end\n # resource path\n local_var_path = '/projects/{project_id}/translations/{translation_id}/versions'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'translation_id' + '}', CGI.escape(translation_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?\n query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].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/json'])\n header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<TranslationVersion>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Basic', 'Token']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VersionsHistoryApi#versions_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n response = ::Phrase::Response.new(data, headers)\n return response, status_code, headers\n end",
"def index\n @invites = Invite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @invites }\n end\n end",
"def index\n @invites = Invite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @invites }\n end\n end",
"def index\n @invites = Invite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @invites }\n end\n end",
"def show\n @extension_versions_urls = @extension.sorted_extension_versions.map do |version|\n api_v1_extension_version_url(@extension, version)\n end\n end",
"def index\n @api_v1_post_votes = PostVote.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @api_v1_post_votes }\n end\n end",
"def url\n '/api/invoices'\n end",
"def get_all_versions()\n return []\n end",
"def add_aos_version(args = {}) \n post(\"/aosversions.json/\", args)\nend",
"def set_interestversion\n @interestversion = Interestversion.find(params[:id])\n end",
"def versions\n @versions ||= VersionsProxy.new self\n end",
"def list_all_tenantcircles_for_a_version_box(args = {}) \n get(\"/aosversions.json/aosversionbox/circles/#{args[:aosVersionBoxId]}\", args)\nend",
"def show\n @page = Page.find(params[:page_id])\n @revision = @page.revisions.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @revision }\n end\n end",
"def index\n @inboxes = Inbox.all\n @inboxes = @inboxes.select { |x| x.umkm_id == params[:umkm_id].to_i }\n render json: {items: @inboxes}\n end",
"def index\n @votes = @change.votes.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"def show\n json = self.as_json(only: [:created_at, :version])\n json['url'] = doi_url\n json\n end",
"def index\n @ivn_links = IvnLink.all\n end",
"def versions()\n return MicrosoftGraph::Shares::Item::List::Items::Item::Versions::VersionsRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def show\n @getinvoicedatum = Getinvoicedatum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @getinvoicedatum }\n end\n end",
"def index\n #@verses = Verse.all\n @verses = Verse.paginate(page: params[:page]) \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @verses }\n end\n end"
] |
[
"0.6979076",
"0.6932634",
"0.69099915",
"0.6688635",
"0.6681855",
"0.6679537",
"0.6670666",
"0.6663171",
"0.6652113",
"0.6604293",
"0.65808433",
"0.6558361",
"0.653319",
"0.64946985",
"0.64667904",
"0.6430677",
"0.64031637",
"0.6290831",
"0.6237408",
"0.6228973",
"0.6227888",
"0.6199654",
"0.6170557",
"0.61562574",
"0.6147004",
"0.6130415",
"0.6104212",
"0.6095484",
"0.6094577",
"0.60753113",
"0.60738146",
"0.606331",
"0.6046028",
"0.60403335",
"0.60377747",
"0.6035937",
"0.60156614",
"0.600777",
"0.59882224",
"0.5985181",
"0.5967434",
"0.59610605",
"0.5942403",
"0.59186465",
"0.59101725",
"0.58841014",
"0.5862982",
"0.5851134",
"0.5838424",
"0.58166206",
"0.5812329",
"0.5798401",
"0.57807463",
"0.57737106",
"0.5769406",
"0.5759082",
"0.57487386",
"0.5748623",
"0.573287",
"0.5730677",
"0.5716028",
"0.5711136",
"0.567742",
"0.56583273",
"0.5637823",
"0.5636724",
"0.56287855",
"0.5627432",
"0.56251454",
"0.5624704",
"0.5623743",
"0.5621341",
"0.56200224",
"0.56200224",
"0.56200224",
"0.56149715",
"0.56143564",
"0.5605542",
"0.5601948",
"0.5598419",
"0.5597642",
"0.55925757",
"0.55920106",
"0.55920106",
"0.55920106",
"0.5572619",
"0.5569849",
"0.5569338",
"0.5568462",
"0.55672896",
"0.55629706",
"0.5547552",
"0.5542534",
"0.5534181",
"0.5530125",
"0.5528482",
"0.55250955",
"0.5518488",
"0.55099094",
"0.5502488",
"0.5500028"
] |
0.0
|
-1
|
POST /inversions POST /inversions.json
|
def create
permission_denied and return if current_user.cannot 'create_inversion'
@inversion = Inversion.new(inversion_params)
respond_to do |format|
if @inversion.save
format.html { redirect_to inversions_url, success: @inversion.table_name_to_show.concat( ' fue creada satisfactoriamente.') }
format.json { render :show, status: :created, location: @inversion }
else
format.html { render :new }
format.json { render json: @inversion.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n permission_denied and return if current_user.cannot 'read_inversion'\n @inversions = Inversion.all\n @new_inversion = Inversion.new\n end",
"def add_aos_version(args = {}) \n post(\"/aosversions.json/\", args)\nend",
"def create\n version_attributes = params.require(:version).permit(:id, :file, :file_file_name, :version, :uploaded_by, :reason)\n @document = Document.find(params[:document_id])\n @document.versions << Version.create(version_attributes)\n render :json => @document, :include => [:versions]\n end",
"def set_inversion\n @inversion = Inversion.find(params[:id])\n end",
"def inversion_params\n params.require(:inversion).permit(:code, :description, :alias)\n end",
"def add_aos_version_box(args = {}) \n post(\"/aosversions.json/aosversionbox\", args)\nend",
"def create\n #assign unpermitted parameter 'entries' to a variable\n entries = params[\"entries\"]\n @invoice = @user.invoices.build(invoice_params)\n #save entries\n @invoice.entries = entries\n if @invoice.save\n render json: @invoice, status: :created, location: api_v1_user_invoice_url(@user, @invoice)\n else\n render json: @invoice.errors, status: :unprocessable_entity\n end\n end",
"def get_versions\r\n versions_nodes = BankNodestructure.version_gather(params[:subject], params[:grade])\r\n render json: versions_nodes.to_json\r\n end",
"def vig_params\n params.require(:vig).permit(:name, :date, :test_ids=>[])\n end",
"def vig_params\n params.require(:vig).permit(:name, :date, :test_ids=>[])\n end",
"def create\n @version = @app.versions.new(version_params)\n\n respond_to do |format|\n if @version.save\n format.html { redirect_to user_app_version_path(@user, @app, @version), notice: 'Version was successfully created.' }\n format.json { render :show, status: :created, location: @version }\n else\n format.html { render :new }\n format.json { render json: @version.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @inven = Inven.new(inven_params)\n\n respond_to do |format|\n if @inven.save\n format.html { redirect_to @inven, notice: 'Inven was successfully created.' }\n format.json { render :show, status: :created, location: @inven }\n else\n format.html { render :new }\n format.json { render json: @inven.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n permission_denied and return if current_user.cannot 'update_inversion'\n respond_to do |format|\n if @inversion.update(inversion_params)\n format.html { redirect_to inversion_url, success: @inversion.table_name_to_show.concat( ' fue actualizado satisfactoriamente.') }\n format.json { render :show, status: :ok, location: @inversion }\n else\n format.html { render :edit }\n format.json { render json: @inversion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @file_versions = FileVersion.all\n\n render json: @file_versions\n end",
"def assign_tenant_circles_to_an_aos_version_box(args = {}) \n body_put(\"/aosversions.json/aosversionbox/circles/#{args[:aosVersionBoxId]}\", args[:array_of_ids])\nend",
"def add_inversions\n @cards.values.each {|c| add_card c.invert }\n end",
"def versions\n authorize @page\n @versions = @page.versions\n status = params[:by_status] && Page.statuses[params[:by_status]]\n if status\n @versions = @versions.where_object(status: status)\n end\n @versions = @versions.reorder(created_at: :desc, id: :desc).page params[:page]\n end",
"def set_interestversion\n @interestversion = Interestversion.find(params[:id])\n end",
"def list_all_aos_versions(args = {}) \n get(\"/aosversions.json/all\", args)\nend",
"def versions\n JSON.parse(RestClient.get(\"#{VERSION_URL}/.json\", self.default_headers))[\"versions\"].collect { |v| v[\"id\"] }.uniq\n end",
"def index\n @admin_versions = Admin::Version.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_versions }\n end\n end",
"def create_recipe_request(version, auth_headers, data = {})\n post \"/api/recipes\", params: data, headers: {'Content-Type' => \"application/json\", 'Accept' => \"application/vnd.ink.#{version}\" }.merge(auth_headers)\nend",
"def list_active_aos_versions(args = {}) \n get(\"/aosversions.json/\", args)\nend",
"def calc_inversions arr\n n = arr.length\n return [0, arr] if n == 1\n half = n.even? ? n / 2 : (n + 1) / 2\n left_inversions, left_arr = calc_inversions(arr[0, half])\n right_inversions, right_arr = calc_inversions(arr[half, n])\n num_inversions, sorted_arr = count_and_sort_split_inversions(left_arr, right_arr)\n num_inversions = num_inversions + left_inversions + right_inversions\n [num_inversions, sorted_arr]\nend",
"def index\n @versions = Version.all\n end",
"def inversions\n inversions = Array.new\n 1.upto(size-1) do |i|\n (i+1).upto(size) do |j|\n inversions << [i,j] if self[i] > self[j]\n end\n end\n return inversions\n end",
"def build_inversions\n if @original_inversions\n @inversions = @original_inversions[:inversions]\n pivot_note = @original_inversions[:pivot_note]\n if pivot_note\n @pivot_note = Note.new({\n :text_value => pivot_note.text_value,\n :key => pivot_note.key,\n :pitch => pivot_note.pitch,\n :accidental => pivot_note.accidental,\n :octave => pivot_note.octave || DEFAULT_OCTAVE,\n :duration => @original_duration_token,\n :attack => @original_attack,\n :decay => @original_decay\n }, @pattern)\n @pivot_note.pattern = @pattern\n end\n else\n @inversions = 0\n end\n raise Exceptions::ChordInversionsException.new(\"Number of inversions (#{@inversions}) is greater than chord size (#{notes.size})\") if @inversions >= notes.size\n\n notes.each{ |note| note.pattern = @pattern }\n if @pivot_note\n actual_pivot = notes.index(notes.find { |note| @pivot_note.pitch == note.pitch }) # TODO: Dropped notes.index(&block) for compatibility with <1.8.7\n raise Exceptions::ChordInversionsException.new(\"Note #{@pivot_note.original_string}(#{@pivot_note.pitch}) does not belong to chord #{@original_string}\") unless actual_pivot\n actual_pivot.times { notes << notes.shift + 12 }\n else\n @inversions.times { notes << notes.shift + 12 }\n end\n end",
"def index_invites\n puts \"user: #{@current_user.json_hash[:id]}\"\n dinners = []\n @dinners = @current_user.invited_dinners\n @dinners.each do |dinner|\n dinners << dinner.all_info\n end\n render json: dinners\n end",
"def vagrant_json_update(image_name, version_entry)\n # Load the vagrant JSON file\n json_file = File.new(\"#{Packer::OUTPUT_DIR}/#{image_name}.json\", 'w+')\n json_str = json_file.read\n \n # Load the JSON data\n begin\n json_data = JSON.load json_str\n rescue JSON::ParserError\n json_data = {\n \"name\" => image_name,\n \"versions\" => []\n }\n end\n\n # This will make sure there are no duplicate\n # entries for each box version specified in the\n # JSON file\n json_data['versions'].each_index do |i|\n box_version = json_data['versions'][i]\n if box_version['version'] == version_entry['version']\n json_data['versions'][i].delete\n break\n end\n end\n\n # Insert the new version entry\n json_data['versions'].push version_entry\n \n # Write the thing\n json_file.puts JSON.dump json_data\nend",
"def create_revision(id, bin_params)\n @rest.post(\"#{id}/save\", bin_params)\n end",
"def new_releases\n api_call(\"https://api.spotify.com/\",\"/v1/browse/new-releases\")\n end",
"def update\n respond_to do |format|\n if @inven.update(inven_params)\n format.html { redirect_to @inven, notice: 'Inven was successfully updated.' }\n format.json { render :show, status: :ok, location: @inven }\n else\n format.html { render :edit }\n format.json { render json: @inven.errors, status: :unprocessable_entity }\n end\n end\n end",
"def versions\n authorize @page\n @versions = @page.versions\n status = params[:by_status] && Page.statuses[params[:by_status]]\n if status\n @versions = @versions.where_object(status: status)\n end\n @versions = @versions.reorder(created_at: :desc, id: :desc).page params[:page]\n end",
"def import_versions(vs)\n logger.debug 'updating valueset versions '\n vset = vs[:valueset]\n versions = vs[:versions] || []\n versions.sort! { |a, b| a.versionNumber <=> b.versionNumber }\n versions = [versions.last] if params[:use_latest]\n versions.each do |ver|\n create_vs_and_responses(vset, ver)\n end\n end",
"def create\n path = save_file \n if path \n if update_versioned_files?\n\n @file_version = FileVersion.new(:path =>path, :versioned_file_id => params[:versioned_file_id], :isActive => true )\n if @file_version.save\n render json: @file_version, status: :created, location: @file_version\n else\n render json: @file_version.errors, status: :unprocessable_entity\n end\n else\n render json: @file_versions.errors, status: :unprocessable_entity\n end\n else \n render json: { :message => \"The file is not valid\" }, :status => :precondition_failed\n end\n \n end",
"def create\n @rankin = Rankin.new(rankin_params)\n\n if @rankin.save\n render json: @rankin, status: :created, location: api_v1_rankin_url(@rankin, format: :json)\n else\n render json: @rankin.errors, status: :unprocessable_entity\n end\n end",
"def countInversions(a) \n def merge arr,*new \n return [0,arr] if arr.size == 1\n inv_merge = i = j = 0 \n inv_left, left = merge(arr[0...mid = arr.size / 2]) \n inv_right, right = merge(arr[mid..-1]) \n while i < mid && j < right.size \n if right[j] < left[i] \n inv_merge += mid - i \n new << right[j] \n j += 1 \n else \n new << left[i] \n i += 1 \n end \n end \n [inv_left + inv_merge + inv_right, new + (i < mid ? left[i..-1] : right[j..-1]) ]\n end \n merge(a)[0] % (10 ** 9 + 7)\nend",
"def create\n @invt = Invt.new(invt_params)\n\n respond_to do |format|\n if @invt.save\n format.html { redirect_to @invt, notice: 'El producto fue almacenado exitosamented.' }\n format.json { render :show, status: :created, location: @invt }\n else\n format.html { render :new }\n format.json { render json: @invt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @revision = Revision.new(params[:revision])\n\n if @revision.save\n render json: @revision, status: :created, location: @revision\n else\n render json: @revision.errors, status: :unprocessable_entity\n end\n end",
"def inversions(arr)\n if arr.length <= 1\n return [0, arr]\n else\n m = arr.length / 2\n count_left, left = inversions(arr[0...m])\n count_right, right = inversions(arr[m..-1])\n count, result = merge_inversions(left, right)\n return [count_left + count_right + count, result]\n end\nend",
"def recreate_versions!\n with_callbacks(:recreate_versions, file) do\n versions.each { |name, v| v.store!(file) }\n end\n end",
"def inven_params\n params.require(:inven).permit(:location, :name)\n end",
"def create_version\n Milkrun.say \"Creating new version of app in HockeyApp\"\n\n body = {}.tap do |json|\n json[:bundle_version] = version_code\n json[:bundle_short_version] = version_name\n json[:status] = 1\n end\n\n headers = {}.tap do |h|\n h[\"X-HockeyAppToken\"] = token\n h[\"Accept\"] = \"application/json\"\n h[\"Content-Type\"] = \"application/json\"\n end\n\n url = \"#{base_url}/#{app_id}/app_versions/new\"\n response = Excon.post(url, body: body.to_json, connect_timeout: 10, headers: headers)\n if response.status != 201\n Milkrun.error response.data.to_s\n raise \"Failed to post new version to HockeyApp!\"\n end\n\n Milkrun.say \"New version created in HockeyApp\"\n end",
"def version_params\n params[:version].permit(:version, :status, :current, :committee)\n end",
"def show\n @document = Document.where(:id => params[:id])\n render :json => @document, :include => [:versions]\n end",
"def index\n @inboxes = Inbox.all\n @inboxes = @inboxes.select { |x| x.umkm_id == params[:umkm_id].to_i }\n render json: {items: @inboxes}\n end",
"def countInversions(arr)\n metadata = OpenStruct.new(inversions: 0)\n mergesort! arr.dup, arr.dup, 0, arr.size-1, metadata\n return metadata.inversions\nend",
"def list_all_aos_version_boxes(args = {}) \n get(\"/aosversions.json/aosversionbox\", args)\nend",
"def copy\n copied_products = []\n\n params[:ids].each do |id| \n product = Product.find(id)\n copied_products << product.copy unless product.nil?\n end\n\n respond_to do |format|\n format.json { render json: copied_products.as_json(:include => {:product_variants => {:include => [:option_types,:pictures]}}, :methods => [:taxon_ids])}\n end\n end",
"def create\n @checkin = Checkin.new(Checkin.from_params(params))\n @checkin.user = current_user\n \n if @checkin.user and @checkin.user.venue\n @checkin.user.checkin_to_venue!(@checkin.user.venue)\n end\n\n if @checkin.save\n @checkin.on_committed()\n \n respond_to do |format|\n format.json { render json: @checkin, status: :created, location: @checkin }\n end\n else\n respond_to do |format|\n format.json { render json: @checkin.errors, status: :unprocessable_entity }\n end\n end\n end",
"def upgrade\n respond_to do |wants|\n wants.json {\n ver = params[:ver]\n soft = SoftVersion.find_new_version_by_ver(ver)\n hash = {}\n if soft and soft.is_a?SoftVersion\n hash[:newversion] = true\n hash[:url] = \"http://#{request.host_with_port}/welcome/download?soft=#{soft.soft_name}&version=#{soft.version}\"\n else\n hash[\"newversion\"] = false\n hash[\"url\"] = \"No new version\"\n end\n render :json => hash.to_json, :layout => false\n }\n end\n\n end",
"def listversions(project=self.project)\n get('listversions.json', project: project)['versions']\n end",
"def translations_versions_test_params\n params.require(:translations_versions_test).permit(:translations_versions_id, :test_id)\n end",
"def create\n @vote = @parent.votes.new\n# change this later for user login feature\n @vote.user_id = session[:user_id]\n\n respond_to do |format|\n if @vote.save\n @vote.update_post\n format.html { redirect_to :back, notice: 'Vote was successfully created.' }\n format.json { render json: @vote, status: :created, location: @vote }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vote.errors, status: :unprocessable_entity }\n end\n end\n end",
"def upvote\n\n\t\t@interview = InterviewReview.find(params[:id])\n\t\t@interview.upvotes.create(job_seeker_id: current_user.job_seeker.id)\n\t\t@total_votes = @interview.upvotes.count\n\t\trespond_to do |format|\n\t\t\t\n\t\t\tformat.js\n\t\tend\n\tend",
"def build_version(params)\n publication_versions.build(params)\n end",
"def vote\n @vote = Vote.find_or_initialize_by_entry_id_and_user_id(params[:entry_id], current_user.id)\n @entry = Entry.find(params[:entry_id])\n \n @previous_votes = current_user.votes.select { |v| v.entry.challenge_id == @entry.challenge_id }\n\n if @previous_votes.count == 0\n @vote.ignore = true\n else\n @vote.ignore = false\n\n if @previous_votes.count == 1\n @previous_votes.each do |v|\n old_vote = Vote.find(v.id)\n old_vote.ignore = false\n old_vote.save!\n end\n end\n end\n\n @vote.value = params[:value]\n\n respond_to do |format|\n if @entry.user != current_user && @vote.save! && @previous_votes.each { |v| v.save! }\n format.html { redirect_to next_entry }\n format.json { render json: @vote, status: :created, location: @vote }\n else\n format.html { redirect_to Entry.find(params[:entry_id]) }\n format.json { render json: @vote.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @invts = Invt.all\n end",
"def invited_users\n render json: @moot.list_users_can_vote\n end",
"def index\n @versions = @application.versions.all\n respond_to do |format|\n format.html\n format.json { render json: VersionsDatatable.new(view_context) }\n end\n end",
"def index\n @invs = Inv.all\n end",
"def show\n puts params[:id]\n @file_versions = FileVersion.where(versioned_file_id: params[:id]) \n #@file_versions = FileVersion.find(:versioned_file_id => params[:versioned_file_id])\n render json: @file_versions\n end",
"def set_post\n @version = Version.find(params[:id])\n end",
"def list_versions request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_versions_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::ArtifactRegistry::V1beta2::ListVersionsResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"def versions(sku, offer, location = @location, publisher = @publisher)\n raise ArgumentError, \"No location specified\" unless location\n raise ArgumentError, \"No publisher specified\" unless publisher\n\n url = build_url(\n location, 'publishers', publisher, 'artifacttypes', 'vmimage',\n 'offers', offer, 'skus', sku, 'versions'\n )\n\n JSON.parse(rest_get(url)).map{ |element| element['name'] }\n end",
"def restore\n authorize @page\n @version = @page.versions.find(params['version_id'])\n @page = @version.reify\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to page_versions_path(@page), notice: 'Page version was successfully restored.' }\n format.json { render :show, status: :ok, location: @page }\n else\n format.html { render :versions }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_inven\n @inven = Inven.find(params[:id])\n end",
"def versions()\n return MicrosoftGraph::Shares::Item::List::Items::Item::Versions::VersionsRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def create_rest\n @instrument_version = InstrumentVersion.new(params[:instrument_version])\n\n respond_to do |format|\n if @instrument_version.save\n flash[:notice] = 'InstrumentVersion was successfully created.'\n format.html { redirect_to(@instrument_version) }\n format.xml { render :xml => @instrument_version, :status => :created, :location => @instrument_version }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @instrument_version.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @involvement = Involvement.new(involvement_params)\n\n respond_to do |format|\n if @involvement.save\n format.html { redirect_to @involvement, notice: 'Involvement was successfully created.' }\n format.json { render :show, status: :created, location: @involvement }\n else\n format.html { render :new }\n format.json { render json: @involvement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def serialize\n repo = Repo.find_by! unique_identifier: CGI.unescape(params[:id])\n migration_hash = MigrationObjectBuilder.new(repo).build\n render json: migration_hash.to_json # TODO: use Oj?\n end",
"def received_invitations\n user = User.find(params[:user_id])\n @invitations = user.invitations\n\n render json: @invitations\n end",
"def create args\n logger.info \"Upserting version #{args[:number]} for pacticipant_id=#{args[:pacticipant_id]}\"\n version_params = {\n number: args[:number],\n pacticipant_id: args[:pacticipant_id],\n created_at: Sequel.datetime_class.now,\n updated_at: Sequel.datetime_class.now\n }\n id = PactBroker::Domain::Version.dataset.insert_ignore.insert(version_params)\n version = PactBroker::Domain::Version.find(number: args[:number], pacticipant_id: args[:pacticipant_id])\n PactBroker::Domain::OrderVersions.(version)\n version.refresh # reload with the populated order\n end",
"def versions\n @page = ComatosePage.find params[:id]\n @version_num = (params[:version] || @page.versions.length).to_i\n @version = @page.find_version(@version_num)\n end",
"def versions_list_with_http_info(project_id, translation_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VersionsHistoryApi.versions_list ...'\n end\n # verify the required parameter 'project_id' is set\n if @api_client.config.client_side_validation && project_id.nil?\n fail ArgumentError, \"Missing the required parameter 'project_id' when calling VersionsHistoryApi.versions_list\"\n end\n # verify the required parameter 'translation_id' is set\n if @api_client.config.client_side_validation && translation_id.nil?\n fail ArgumentError, \"Missing the required parameter 'translation_id' when calling VersionsHistoryApi.versions_list\"\n end\n # resource path\n local_var_path = '/projects/{project_id}/translations/{translation_id}/versions'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'translation_id' + '}', CGI.escape(translation_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?\n query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].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/json'])\n header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<TranslationVersion>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Basic', 'Token']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VersionsHistoryApi#versions_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n response = ::Phrase::Response.new(data, headers)\n return response, status_code, headers\n end",
"def add_version(project_id_or_key, name, params = {})\n params[:name] = name\n post(\"projects/#{project_id_or_key}/versions\", params)\n end",
"def fetch_versions\n http_get(\"#{host}/#{Configuration.versions_file}\").body\n end",
"def my_venues\n @venues = \n if admin_session?\n User.find_by_uuid(params[:for_user]).try(:owned_venues)\n else\n current_user.owned_venues\n end\n @venues ||= []\n respond_to do |format|\n format.json {\n @venues = [Venue.new(:name => 'TBD')] + @venues\n @venues += [Venue.new(:name => VenuesHelper::ADD_NEW_VENUE_PROMPT)] if params[:add_new]\n render :json => @venues.map {|v| {:value => v.uuid, :text => v.name}}\n }\n format.html\n end\n end",
"def create\n jsonString = request.body.read\n jsonHash = JSON.parse(jsonString)\n\n #CHECK IF VOTE EXIST. IF EXIST, EDIT Vote Integer. IF NOT, CREATE Vote.\n if CaptionVote.where(user_id: jsonHash['user_id'], caption_id: jsonHash['caption_id']).any?\n #Vote Entry Exist. Update Vote\n @caption_vote = CaptionVote.where(user_id: jsonHash['user_id'], caption_id: jsonHash['caption_id'])\n if @caption_vote.update(vote: jsonHash[\"vote\"])\n render json: {caption_vote: @caption_vote, total_votes: total_votes(jsonHash['caption_id'])}\n else\n render json: @caption_vote.errors\n end\n else\n #Vote Entry Don't Exist. Create Vote\n @caption_vote = CaptionVote.new(jsonHash)\n if @caption_vote.save\n render json: {caption_vote: @caption_vote, total_votes: total_votes(jsonHash['caption_id'])}\n else\n render json: {'error': @caption_vote.errors}, status: 401\n end\n end\n end",
"def appversion_params\n params.require(:appversion).permit(:name, :version_number, :version_string, :status)\n end",
"def add_vote(id, verdict)\n id = to_id(id)\n params = {\n data: {\n type: \"vote\",\n attributes: {\n verdict: verdict\n }\n }\n }\n _post(\"/#{name}/#{id}/votes\", params) { |json| json }\n end",
"def index\n @api_versions = ApiVersion.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @api_versions }\n end\n end",
"def index\n @api_versions = ApiVersion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @api_versions }\n end\n end",
"def versions_by_id(klass, version_ids)\n klass.\n paper_trail.version_class.\n where(id: version_ids).\n inject({}) { |a, e| a.merge!(e.item_id => e) }\n end",
"def create\n params[:submission][:verdict] = 'pending'\n create_base(params[:submission]) \n end",
"def create\n @inavailability = Inavailability.new(inavailability_params)\n\n respond_to do |format|\n if @inavailability.save\n format.html { redirect_to @inavailability, notice: 'Inavailability was successfully created.' }\n format.json { render :show, status: :created, location: @inavailability }\n else\n format.html { render :new }\n format.json { render json: @inavailability.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # Extract the version info\n release = params[:release]\n version = params[:release][:version]\n release.delete(\"version\")\n \n # Validate input\n if (release[:name] == \"\")\n flash[:notice] = \"You must supply a name for the release\"\n respond_to do |format|\n format.html { redirect_to :action => 'new' }\n format.json { head :no_content }\n end\n elsif (release[:source_url] == \"\")\n flash[:notice] = \"You must supply a source URL\"\n respond_to do |format|\n format.html { redirect_to :action => 'new' }\n format.json { head :no_content }\n end\n else\n # Add http:// prefix to source_url if it doesn't already exist\n release[:source_url] = \"http://#{release[:source_url]}\" if not release[:source_url].starts_with? \"http://\" and not release[:source_url].starts_with? \"https://\"\n \n @release = Release.new(release)\n @release.user = current_user\n \n # Add the version info\n # If the URL doesn't start with http:// or https://, add it\n version[:download_url] = \"http://#{version[:download_url]}\" if not version[:download_url].starts_with? \"http://\" and not version[:download_url].starts_with? \"https://\"\n \n @version = Version.new(version)\n @version.version_number = 1\n @version.release = @release\n @release.versions << @version\n\n respond_to do |format|\n if @release.save\n format.html { redirect_to @release, notice: 'Release was successfully created.' }\n format.json { render json: @release, status: :created, location: @release }\n else\n format.html { render action: \"new\" }\n format.json { render json: @release.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def create_version\n if handle_upload_data(true)\n comments = params[:revision_comments]\n\n respond_to do |format|\n create_new_version comments\n create_model_image @model, model_image_params if model_image_present?\n format.html { redirect_to @model }\n end\n else\n flash[:error]=flash.now[:error]\n redirect_to @model\n end\n end",
"def set_invt\n @invt = Invt.find(params[:id])\n end",
"def index\n @page = Page.find(params[:page_id])\n @revisions = @page.revisions\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @revisions }\n end\n end",
"def volunter_by_me\n @requests = @current_user.volunters.map(&:request)\n json_response(@requests)\n end",
"def versions()\n return MicrosoftGraph::IdentityGovernance::LifecycleWorkflows::Workflows::Item::Versions::VersionsRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def get_ids_signature_versions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityEastWestSecurityDistributedIdsSettingsSignaturesApi.get_ids_signature_versions ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityEastWestSecurityDistributedIdsSettingsSignaturesApi.get_ids_signature_versions, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicySecurityEastWestSecurityDistributedIdsSettingsSignaturesApi.get_ids_signature_versions, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/settings/firewall/security/intrusion-services/signature-versions'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IdsSignatureVersionListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityEastWestSecurityDistributedIdsSettingsSignaturesApi#get_ids_signature_versions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def article_versions_with_http_info(article_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ArticlesApi.article_versions ...\"\n end\n # verify the required parameter 'article_id' is set\n if @api_client.config.client_side_validation && article_id.nil?\n fail ArgumentError, \"Missing the required parameter 'article_id' when calling ArticlesApi.article_versions\"\n end\n if @api_client.config.client_side_validation && article_id < 1\n fail ArgumentError, 'invalid value for \"article_id\" when calling ArticlesApi.article_versions, must be greater than or equal to 1.'\n end\n\n # resource path\n local_var_path = \"/articles/{article_id}/versions\".sub('{' + 'article_id' + '}', article_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<Version>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ArticlesApi#article_versions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n @ink_varnish = InkVarnish.new(params[:ink_varnish])\n\n respond_to do |format|\n if @ink_varnish.save\n format.html { redirect_to @ink_varnish, notice: 'Ink Varnish was successfully created.' }\n format.json { render json: @ink_varnish, status: :created, location: @ink_varnish }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ink_varnish.errors, status: :unprocessable_entity }\n end\n end\n end",
"def version_nodes\n design_response.map do |response|\n response.dig('node', 'versions', 'edges')\n end\n end",
"def update\n respond_to do |format|\n if @deployment.update(deployment_params)\n services_params(@deployment).each do |service_name, version_name|\n version = Version.find_by(name: version_name)\n @deployment.versions << version if version\n end\n @deployment.save\n format.html { redirect_to @deployment, notice: 'Deployment was successfully updated.' }\n format.json { render :show, status: :ok, location: @deployment }\n else\n format.html { render :edit }\n format.json { render json: @deployment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_invoices(invoices)\n b = Builder::XmlMarkup.new\n request_xml = b.Invoices {\n invoices.each do | invoice |\n invoice.to_xml(b)\n end\n }\n\n response_xml = http_put(@client, \"#{@xero_url}/Invoices?SummarizeErrors=false\", request_xml, {})\n\n response = parse_response(response_xml, {:request_xml => request_xml}, {:request_signature => 'PUT/invoices'})\n response.invoices.each_with_index do | response_invoice, index |\n invoices[index].invoice_id = response_invoice.invoice_id if response_invoice && response_invoice.invoice_id\n end\n response\n end",
"def count_inversions(arr, l, r)\n inversions = 0\n\n if l < r\n mid = (r + l) / 2\n inversions += count_inversions(arr, l, mid)\n inversions += count_inversions(arr, mid + 1, r)\n inversions += merge_and_count_inversions(arr, l, mid, r)\n inversions\n else\n 0\n end\nend",
"def remote_versions_for(name)\n require 'json'\n\n client.url = \"https://rubygems.org/api/v1/versions/#{name}.json\"\n client.follow_location = true\n client.http_get\n json = JSON.parse(client.body_str)\n json.collect { |version| version['number'] }\n end"
] |
[
"0.6122786",
"0.5995528",
"0.59828323",
"0.58740574",
"0.5815153",
"0.5805874",
"0.5504974",
"0.54876375",
"0.5440713",
"0.54056454",
"0.5298512",
"0.52474576",
"0.51993805",
"0.51987857",
"0.5129507",
"0.5112156",
"0.5097236",
"0.5069937",
"0.50551194",
"0.5051203",
"0.5048383",
"0.504548",
"0.50348496",
"0.5014376",
"0.5011089",
"0.4996936",
"0.49955648",
"0.49913722",
"0.4988299",
"0.49806014",
"0.49408567",
"0.4938764",
"0.49356186",
"0.4927608",
"0.49116296",
"0.48961306",
"0.48840317",
"0.48775345",
"0.48641983",
"0.4856988",
"0.48331448",
"0.48315936",
"0.48299593",
"0.48216918",
"0.48056072",
"0.47946325",
"0.4789619",
"0.47852105",
"0.47814313",
"0.47736788",
"0.47705427",
"0.4765654",
"0.4761013",
"0.47535214",
"0.47525918",
"0.47481662",
"0.47462875",
"0.47389767",
"0.47357303",
"0.47291628",
"0.4726226",
"0.4716725",
"0.47117892",
"0.46908647",
"0.46903726",
"0.4687272",
"0.46822244",
"0.468195",
"0.46774134",
"0.46670628",
"0.46669498",
"0.46608222",
"0.46595994",
"0.46516496",
"0.46504962",
"0.46418494",
"0.4630548",
"0.46192357",
"0.46124312",
"0.46098977",
"0.46087214",
"0.46020103",
"0.45991683",
"0.4595274",
"0.45857316",
"0.45839998",
"0.458257",
"0.4581949",
"0.45740592",
"0.45723313",
"0.45721558",
"0.4566805",
"0.45652002",
"0.45646256",
"0.4559239",
"0.45587075",
"0.45541918",
"0.45514452",
"0.45452905",
"0.45428404"
] |
0.6142687
|
0
|
PATCH/PUT /inversions/1 PATCH/PUT /inversions/1.json
|
def update
permission_denied and return if current_user.cannot 'update_inversion'
respond_to do |format|
if @inversion.update(inversion_params)
format.html { redirect_to inversion_url, success: @inversion.table_name_to_show.concat( ' fue actualizado satisfactoriamente.') }
format.json { render :show, status: :ok, location: @inversion }
else
format.html { render :edit }
format.json { render json: @inversion.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"def update_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!(**args)\n @versions = args[:versions] if args.key?(:versions)\n end",
"def update!(**args)\n @versions = args[:versions] if args.key?(:versions)\n end",
"def update!(**args)\n @versions = args[:versions] if args.key?(:versions)\n end",
"def update_rest\n @instrument_version = InstrumentVersion.find(params[:id])\n\n respond_to do |format|\n if @instrument_version.update_attributes(params[:instrument_version])\n flash[:notice] = 'InstrumentVersion was successfully updated.'\n format.html { redirect_to(@instrument_version) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @instrument_version.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @version.update(version_params)\n format.html { redirect_to @version, notice: 'Version was successfully updated.' }\n format.json { render :show, status: :ok, location: @version }\n else\n format.html { render :edit }\n format.json { render json: @version.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @file_version = FileVersion.find(params[:id])\n params[:versioned_file_id] = @file_version.versioned_file_id\n if update_versioned_files? \n if @file_version.update(:isActive => true)\n head :no_content\n else\n render json: @file_version.errors, status: :unprocessable_entity\n end \n else \n render json: @file_version.errors, status: :unprocessable_entity\n end\n end",
"def add_aos_version(args = {}) \n post(\"/aosversions.json/\", args)\nend",
"def update\n @api_version = ApiVersion.find(params[:id])\n\n respond_to do |format|\n if @api_version.update_attributes(params[:api_version])\n format.html { redirect_to admin_api_versions_path, flash: {success: t('app.msgs.success_updated', :obj => t('mongoid.models.api_version.one'))} }\n format.json { head :no_content }\n else\n set_tabbed_translation_form_settings('advanced')\n format.html { render action: \"edit\" }\n format.json { render json: @api_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update # PATCH\n raise NotImplementedError\n end",
"def update\n @version = Version.find(params[:id])\n\n respond_to do |format|\n if @version.update_attributes(params[:version])\n format.html { redirect_to @version, notice: 'Version was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @version.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch!\n request! :patch\n end",
"def update\n @file_version = FileVersion.find(params[:id])\n\n respond_to do |format|\n if @file_version.update_attributes(params[:file_version])\n format.html { redirect_to @file_version, notice: 'File version was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @file_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @fileversion = Fileversion.find(params[:id])\n\n respond_to do |format|\n if @fileversion.update_attributes(params[:fileversion])\n format.html { redirect_to @fileversion, notice: 'Fileversion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fileversion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n document = @document.revision.versions.new(document_params(true))\n if document.save\n send_emails_helper(document)\n render json: document.attributes_for_edit\n else\n render json: document.errors, status: :unprocessable_entity\n end\n end",
"def update!(**args)\n @version_id = args[:version_id] if args.key?(:version_id)\n end",
"def update!(**args)\n @version_id = args[:version_id] if args.key?(:version_id)\n end",
"def update\n respond_to do |format|\n if @inven.update(inven_params)\n format.html { redirect_to @inven, notice: 'Inven was successfully updated.' }\n format.json { render :show, status: :ok, location: @inven }\n else\n format.html { render :edit }\n format.json { render json: @inven.errors, status: :unprocessable_entity }\n end\n end\n end",
"def updates_versions_of(*args, &block)\n # TODO\n end",
"def update\n respond_to do |format|\n if @ver.update(ver_params)\n format.html { redirect_to @ver, notice: 'Ver was successfully updated.' }\n format.json { render :show, status: :ok, location: @ver }\n else\n format.html { render :edit }\n format.json { render json: @ver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @version = args[:version] if args.key?(:version)\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @version = args[:version] if args.key?(:version)\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @version = args[:version] if args.key?(:version)\n end",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def update\n # actions\n path = URI(@endpoint).path\n action = URI(@req.request_uri).path.sub(path, '').split('/')\n action -= ['']\n if action.include?('_history')\n @actions = [action[0], '_history']\n else\n @actions = [action[0]]\n end\n\n # search param\n req_query = URI(@req.request_uri).query\n unless req_query.nil?\n @req_params = URI::decode_www_form(req_query).to_h\n end\n\n # requst method\n if @req.request_method == \"GET\" and @actions.include? '_history'\n @req_method = 'vread'\n elsif @req.request_method == \"GET\" and @req_params != nil\n @req_method = 'search-type'\n elsif @req.request_method == \"PUT\"\n @req_method = 'update'\n elsif @req.request_method == \"POST\"\n @req_method = 'create'\n else\n @req_method = 'read'\n end\n\n # interaction\n int1 = Interaction.last type: @actions[0], code: @req_method\n if int1.nil?\n @present = 0\n else\n @present = int1.id\n @intCode = int1.valueCode\n end\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 respond_to do |format|\n if @version_control.update(version_control_params)\n format.html { redirect_to @version_control, notice: 'Version control was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @version_control.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update options={}\n client.put(\"/#{id}\", options)\n end",
"def update\n @revision = Revision.find(params[:id])\n\n if @revision.update(params[:revision])\n head :no_content\n else\n render json: @revision.errors, status: :unprocessable_entity\n end\n end",
"def update!(**args)\n @endpoint = args[:endpoint] if args.key?(:endpoint)\n @version = args[:version] if args.key?(:version)\n end",
"def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"def patch_kubernetes_version_with_http_info(moid, kubernetes_version, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: KubernetesApi.patch_kubernetes_version ...'\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 KubernetesApi.patch_kubernetes_version\"\n end\n # verify the required parameter 'kubernetes_version' is set\n if @api_client.config.client_side_validation && kubernetes_version.nil?\n fail ArgumentError, \"Missing the required parameter 'kubernetes_version' when calling KubernetesApi.patch_kubernetes_version\"\n end\n # resource path\n local_var_path = '/api/v1/kubernetes/Versions/{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(kubernetes_version)\n\n # return_type\n return_type = opts[:debug_return_type] || 'KubernetesVersion'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"KubernetesApi.patch_kubernetes_version\",\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: KubernetesApi#patch_kubernetes_version\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def version_aware_update(resource, id, version_id, format = nil, options = {})\n base_update(resource, id, options, format, {if_match: \"W/#{version_id}\"})\n end",
"def update!(**args)\n @object_version = args[:object_version] if args.key?(:object_version)\n @original_object = args[:original_object] if args.key?(:original_object)\n end",
"def vagrant_json_update(image_name, version_entry)\n # Load the vagrant JSON file\n json_file = File.new(\"#{Packer::OUTPUT_DIR}/#{image_name}.json\", 'w+')\n json_str = json_file.read\n \n # Load the JSON data\n begin\n json_data = JSON.load json_str\n rescue JSON::ParserError\n json_data = {\n \"name\" => image_name,\n \"versions\" => []\n }\n end\n\n # This will make sure there are no duplicate\n # entries for each box version specified in the\n # JSON file\n json_data['versions'].each_index do |i|\n box_version = json_data['versions'][i]\n if box_version['version'] == version_entry['version']\n json_data['versions'][i].delete\n break\n end\n end\n\n # Insert the new version entry\n json_data['versions'].push version_entry\n \n # Write the thing\n json_file.puts JSON.dump json_data\nend",
"def update\n @article = Article.find(params[:id])\n\n\n respond_to do |format|\n if @article.update_attributes(params[:article])\n undo_link = view_context.link_to(\"undo\", revert_version_path(@article.versions.last), :method => :post)\n format.html { redirect_to @article, notice: \"Article was successfully updated. #{undo_link}\" }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @article.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @deployment.update(deployment_params)\n services_params(@deployment).each do |service_name, version_name|\n version = Version.find_by(name: version_name)\n @deployment.versions << version if version\n end\n @deployment.save\n format.html { redirect_to @deployment, notice: 'Deployment was successfully updated.' }\n format.json { render :show, status: :ok, location: @deployment }\n else\n format.html { render :edit }\n format.json { render json: @deployment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @versioned_signals = args[:versioned_signals] if args.key?(:versioned_signals)\n end",
"def UpdateView params = {}\n \n APICall(path: 'views.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update\n @api_version = ApiVersion.find(params[:id])\n\n @api_version.assign_attributes(params[:api_version])\n\n add_missing_translation_content(@api_version.api_version_translations)\n\n respond_to do |format|\n if @api_version.save\n format.html { redirect_to admin_api_versions_path, notice: t('app.msgs.success_updated', :obj => t('activerecord.models.api_version')) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @api_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @kind = args[:kind] if args.key?(:kind)\n @metadata = args[:metadata] if args.key?(:metadata)\n @spec = args[:spec] if args.key?(:spec)\n end",
"def update\n respond_to do |format|\n if @manage_app_version.update(manage_app_version_params)\n format.html { redirect_to @manage_app_version, notice: 'App version was successfully updated.' }\n format.json { render :show, status: :ok, location: @manage_app_version }\n else\n format.html { render :edit }\n format.json { render json: @manage_app_version.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @version = args[:version] unless args[:version].nil?\n @bindings = args[:bindings] unless args[:bindings].nil?\n @etag = args[:etag] unless args[:etag].nil?\n end",
"def update\n @api_v1_post_vote = PostVote.find(params[:id])\n\n respond_to do |format|\n if @api_v1_post_vote.update_attributes(params[:api_v1_post_vote])\n format.html { redirect_to @api_v1_post_vote, notice: 'Post vote was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @api_v1_post_vote.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put!\n request! :put\n end",
"def update\n @verb = Verb.find(params[:id])\n\n if @verb.update(verb_params)\n head :no_content\n else\n render json: @verb.errors, status: :unprocessable_entity\n end\n end",
"def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @versions = args[:versions] if args.key?(:versions)\n end",
"def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @versions = args[:versions] if args.key?(:versions)\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(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end",
"def patch(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 patch(path, **args); end",
"def update\n @app_version = @app.app_versions.find(params[:id])\n # @app_version = AppVersion.find(params[:id])\n\n respond_to do |format|\n if @app_version.update_attributes(params[:app_version])\n format.html { redirect_to([@app, @app_version], :notice => 'App Version was successfully updated.') }\n # format.html { redirect_to(@app_version, :notice => 'App version was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @app_version.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def update\n head :ok\n end",
"def add_aos_version_box(args = {}) \n post(\"/aosversions.json/aosversionbox\", args)\nend",
"def set_inversion\n @inversion = Inversion.find(params[:id])\n end",
"def edit(*args)\n arguments(args, required: [:owner, :repo, :id])\n\n patch_request(\"/repos/#{arguments.owner}/#{arguments.repo}/releases/#{arguments.id}\", arguments.params)\n end",
"def patch(path, data)\n request 'PATCH', path, body: data.to_json\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!(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_version_method(version)\nend",
"def patch\n end",
"def update!(**args)\n @continue = args[:continue] if args.key?(:continue)\n @resource_version = args[:resource_version] if args.key?(:resource_version)\n @self_link = args[:self_link] if args.key?(:self_link)\n end",
"def update_kubernetes_version_with_http_info(moid, kubernetes_version, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: KubernetesApi.update_kubernetes_version ...'\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 KubernetesApi.update_kubernetes_version\"\n end\n # verify the required parameter 'kubernetes_version' is set\n if @api_client.config.client_side_validation && kubernetes_version.nil?\n fail ArgumentError, \"Missing the required parameter 'kubernetes_version' when calling KubernetesApi.update_kubernetes_version\"\n end\n # resource path\n local_var_path = '/api/v1/kubernetes/Versions/{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(kubernetes_version)\n\n # return_type\n return_type = opts[:debug_return_type] || 'KubernetesVersion'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"KubernetesApi.update_kubernetes_version\",\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: KubernetesApi#update_kubernetes_version\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n respond_to do |format|\n if @verdict.update(verdict_params)\n format.html { redirect_to admin_verdicts_path(v: @verdict.slug), notice: t('shared.msgs.success_updated',\n obj: t('activerecord.models.verdict', count: 1)) }\n else\n set_date\n format.html { render :edit }\n end\n end\n end",
"def get_aos_version(args = {}) \n get(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def update\n# @eversion = Eversion.find(params[:id])\n @eversion = Eversion.find(params[:magazine_id]).eversion\n# return render :text => \"The object is: #{params.to_yaml}\"\n \n respond_to do |format|\n if @eversion.update_attributes(params[:eversion])\n format.html { redirect_to([:admin, @eversion], :notice => 'Eversion was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @eversion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @v1_order = V1::Order.find(params[:id])\n\n case @v1_order.state\n when 0\n if @v1_order.update(v1_order_params)\n head :no_content\n else\n render json: @v1_order.errors, status: :unprocessable_entity\n end\n else\n render json: {message: 'Can be edited only when in draft(0) state'}, status: 400\n end\n \n end",
"def patch_kubernetes_version_policy_with_http_info(moid, kubernetes_version_policy, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: KubernetesApi.patch_kubernetes_version_policy ...'\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 KubernetesApi.patch_kubernetes_version_policy\"\n end\n # verify the required parameter 'kubernetes_version_policy' is set\n if @api_client.config.client_side_validation && kubernetes_version_policy.nil?\n fail ArgumentError, \"Missing the required parameter 'kubernetes_version_policy' when calling KubernetesApi.patch_kubernetes_version_policy\"\n end\n # resource path\n local_var_path = '/api/v1/kubernetes/VersionPolicies/{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(kubernetes_version_policy)\n\n # return_type\n return_type = opts[:debug_return_type] || 'KubernetesVersionPolicy'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"KubernetesApi.patch_kubernetes_version_policy\",\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: KubernetesApi#patch_kubernetes_version_policy\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end",
"def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end",
"def list_all_aos_versions(args = {}) \n get(\"/aosversions.json/all\", args)\nend",
"def update\n @vint = Vint.find(params[:id])\n\n respond_to do |format|\n if @vint.update_attributes(params[:vint])\n format.html { redirect_to @vint, notice: 'Vint was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vint.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(url, payload, headers={})\n RestClient.patch url, payload, headers\n end",
"def update!(**args)\n @etag = args[:etag] if args.key?(:etag)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n @self_link = args[:self_link] if args.key?(:self_link)\n @title = args[:title] if args.key?(:title)\n @updated = args[:updated] if args.key?(:updated)\n end",
"def update\n @vote = @votable.votes.find(params[:id])\n\n respond_to do |format|\n if @vote.update(vote_params)\n format.html { redirect_to build_path_vote(@vote), notice: 'Vote was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @vote.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @vdocs_requirement = VdocsRequirement.find(params[:id])\n\t@contract = @vdocs_requirement.contract\n\n respond_to do |format|\n if @vdocs_requirement.update_attributes(params[:vdocs_requirement])\n flash[:notice] = 'VdocsRequirement was successfully updated.'\n format.html { redirect_to(@vdocs_requirement) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vdocs_requirement.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @bindings = args[:bindings] if args.key?(:bindings)\n @etag = args[:etag] if args.key?(:etag)\n @version = args[:version] if args.key?(:version)\n end",
"def update!(**args)\n @bindings = args[:bindings] if args.key?(:bindings)\n @etag = args[:etag] if args.key?(:etag)\n @version = args[:version] if args.key?(:version)\n end",
"def update!(**args)\n @bindings = args[:bindings] if args.key?(:bindings)\n @etag = args[:etag] if args.key?(:etag)\n @version = args[:version] if args.key?(:version)\n end",
"def update!(**args)\n @bindings = args[:bindings] if args.key?(:bindings)\n @etag = args[:etag] if args.key?(:etag)\n @version = args[:version] if args.key?(:version)\n end",
"def update!(**args)\n @bindings = args[:bindings] if args.key?(:bindings)\n @etag = args[:etag] if args.key?(:etag)\n @version = args[:version] if args.key?(:version)\n end",
"def update!(**args)\n @bindings = args[:bindings] if args.key?(:bindings)\n @etag = args[:etag] if args.key?(:etag)\n @version = args[:version] if args.key?(:version)\n end",
"def update!(**args)\n @bindings = args[:bindings] if args.key?(:bindings)\n @etag = args[:etag] if args.key?(:etag)\n @version = args[:version] if args.key?(:version)\n end",
"def update!(**args)\n @bindings = args[:bindings] if args.key?(:bindings)\n @etag = args[:etag] if args.key?(:etag)\n @version = args[:version] if args.key?(:version)\n end",
"def update!(**args)\n @bindings = args[:bindings] if args.key?(:bindings)\n @etag = args[:etag] if args.key?(:etag)\n @version = args[:version] if args.key?(:version)\n end",
"def update(id, version)\n @page = Page.by_slug(id) || raise(NotFound)\n @page.versions << @version = Version.new(version.merge!(:user => @user))\n if @version.save\n redirect url(:page, @page)\n else\n render :edit\n end\n end",
"def update\n put :update\n end",
"def update!(**args)\n @index_in_version_cluster = args[:index_in_version_cluster] if args.key?(:index_in_version_cluster)\n @num_versions = args[:num_versions] if args.key?(:num_versions)\n @version_cluster_id = args[:version_cluster_id] if args.key?(:version_cluster_id)\n end",
"def update!(**args)\n @version = args[:version] if args.key?(:version)\n end",
"def upgrade\n respond_to do |wants|\n wants.json {\n ver = params[:ver]\n soft = SoftVersion.find_new_version_by_ver(ver)\n hash = {}\n if soft and soft.is_a?SoftVersion\n hash[:newversion] = true\n hash[:url] = \"http://#{request.host_with_port}/welcome/download?soft=#{soft.soft_name}&version=#{soft.version}\"\n else\n hash[\"newversion\"] = false\n hash[\"url\"] = \"No new version\"\n end\n render :json => hash.to_json, :layout => false\n }\n end\n\n end",
"def set_interestversion\n @interestversion = Interestversion.find(params[:id])\n end",
"def update!(**args)\n @container_image_uri = args[:container_image_uri] if args.key?(:container_image_uri)\n @version_aliases = args[:version_aliases] if args.key?(:version_aliases)\n @version_description = args[:version_description] if args.key?(:version_description)\n @version_id = args[:version_id] if args.key?(:version_id)\n @vertex_model_source_info = args[:vertex_model_source_info] if args.key?(:vertex_model_source_info)\n end",
"def update\n respond_to do |format|\n if @involvement.update(involvement_params)\n format.html { redirect_to @involvement, notice: 'Involvement was successfully updated.' }\n format.json { render :show, status: :ok, location: @involvement }\n else\n format.html { render :edit }\n format.json { render json: @involvement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def list_active_aos_versions(args = {}) \n get(\"/aosversions.json/\", args)\nend",
"def update\n respond_to do |format|\n @computer.versionless do |doc|\n if doc.update(computer_params)\n format.html { redirect_to computers_path, notice: t('computer.updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @computer.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def update\n @getinvoicedatum = Getinvoicedatum.find(params[:id])\n\n respond_to do |format|\n if @getinvoicedatum.update_attributes(params[:getinvoicedatum])\n format.html { redirect_to @getinvoicedatum, notice: 'Getinvoicedatum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @getinvoicedatum.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6500243",
"0.6379029",
"0.6197282",
"0.6197282",
"0.6197282",
"0.6192458",
"0.6028327",
"0.6007387",
"0.59853804",
"0.59819144",
"0.59643567",
"0.59149766",
"0.5907336",
"0.5897103",
"0.5831606",
"0.57979035",
"0.5796307",
"0.5796307",
"0.57659876",
"0.57554513",
"0.5738424",
"0.5720371",
"0.5720371",
"0.5720371",
"0.5701932",
"0.5677457",
"0.5657682",
"0.5657682",
"0.5642633",
"0.5625944",
"0.5617574",
"0.5615801",
"0.5612159",
"0.56046355",
"0.55906534",
"0.55874354",
"0.55687255",
"0.55608964",
"0.556018",
"0.55542046",
"0.5547281",
"0.5528911",
"0.55283386",
"0.5505294",
"0.5495922",
"0.54845905",
"0.54831314",
"0.54819393",
"0.5479883",
"0.5479883",
"0.54773146",
"0.5475787",
"0.5468188",
"0.5453431",
"0.54514706",
"0.5450581",
"0.544919",
"0.54306126",
"0.5419465",
"0.54167557",
"0.54141074",
"0.5406676",
"0.5400746",
"0.5390199",
"0.53850037",
"0.53826165",
"0.53775257",
"0.5375349",
"0.53685874",
"0.5368184",
"0.53672475",
"0.5366348",
"0.5366272",
"0.5366272",
"0.53631914",
"0.5353115",
"0.53521186",
"0.535014",
"0.5346281",
"0.5343006",
"0.5339022",
"0.5337938",
"0.5337938",
"0.5337938",
"0.5337938",
"0.5337938",
"0.5337938",
"0.5337938",
"0.5337938",
"0.5336354",
"0.5333833",
"0.5333607",
"0.53331333",
"0.5330784",
"0.53221935",
"0.5321371",
"0.5316501",
"0.5314832",
"0.5314298",
"0.531119"
] |
0.6464035
|
1
|
DELETE /inversions/1 DELETE /inversions/1.json
|
def destroy
permission_denied and return if current_user.cannot 'destroy_inversion'
@inversion.destroy
respond_to do |format|
format.html { redirect_to inversions_url, success: 'Inversion fue eliminado satisfactoriamente.' }
format.json { head :no_content }
format.js { render 'layouts/destroy' }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def destroy_rest\n @instrument_version = InstrumentVersion.find(params[:id])\n @instrument_version.destroy\n\n respond_to do |format|\n format.html { redirect_to(instrument_versions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @version = Version.find(params[:id])\n @version.destroy\n\n respond_to do |format|\n format.html { redirect_to versions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_version = ApiVersion.find(params[:id])\n @api_version.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_api_versions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @file_version = FileVersion.find(params[:id])\n @file_version.destroy\n\n respond_to do |format|\n format.html { redirect_to file_versions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @version = Version.find(params[:id])\n @versionconfig = @version.version_configurations.destroy_all\n @version.destroy\n\n respond_to do |format|\n format.html { redirect_to [@application, @version] }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fileversion = Fileversion.find(params[:id])\n @fileversion.destroy\n\n respond_to do |format|\n format.html { redirect_to fileversions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_version = ApiVersion.find(params[:id])\n @api_version.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_api_versions_url, flash: {success: t('app.msgs.success_deleted', :obj => t('mongoid.models.api_version.one'))} }\n format.json { head :no_content }\n end\n end",
"def delete\n object.delete(:version_id => @version_id)\n end",
"def destroy\n @version.destroy\n respond_to do |format|\n format.html { redirect_to user_app_path(@user, @app), notice: 'Version was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @inven.destroy\n respond_to do |format|\n format.html { redirect_to invens_url, notice: 'Inven was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_version( doc_id:, version: )\n params = {}\n params[:backtrace] = @backtrace if @backtrace\n send_request :delete, \"#{url_for_base doc_id}/#{version}\", params, :json\n end",
"def destroy\n @version.destroy\n respond_to do |format|\n format.html { redirect_to alfred_module_url(@a_module), notice: 'Version was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @ver.destroy\n respond_to do |format|\n format.html { redirect_to vers_url, notice: 'Ver was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @td_version.destroy\n respond_to do |format|\n format.html { redirect_to td_versions_url, notice: 'Td version was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_story_version(id)\n @client.raw('delete', \"/content/story-versions/#{id}\")\n end",
"def destroy\n @app_version = @app.app_versions.find(params[:id])\n # @app_version = AppVersion.find(params[:id])\n @app_version.destroy\n\n respond_to do |format|\n format.html { redirect_to(app_app_versions_path(@app)) }\n # format.html { redirect_to(app_versions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @nuage_version.destroy\n respond_to do |format|\n format.html { redirect_to nuage_versions_url, notice: \"Nuage version was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @manage_app_version.destroy\n respond_to do |format|\n format.html { redirect_to manage_app_versions_url, notice: 'App version was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_v1_post_vote = PostVote.find(params[:id])\n @api_v1_post_vote.destroy\n\n respond_to do |format|\n format.html { redirect_to api_v1_post_votes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ink_varnish = InkVarnish.find(params[:id])\n @ink_varnish.destroy\n\n respond_to do |format|\n format.html { redirect_to ink_varnishes_url }\n format.json { head :ok }\n end\n end",
"def delete_version\n @object.delete(:version)\n end",
"def destroy\n @design_version.destroy\n respond_to do |format|\n format.html { redirect_to design_versions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n # @invoice = Invoice.find(params[:id])\n @invoice.destroy\n\n respond_to do |format|\n format.html { redirect_to invoices_url }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def destroy\n @vint = Vint.find(params[:id])\n @vint.destroy\n\n respond_to do |format|\n format.html { redirect_to vints_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invoice = Invoice.find(params[:id])\n @invoice.destroy\n\n respond_to do |format|\n format.html { redirect_to invoices_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invoice = Invoice.find(params[:id])\n @invoice.destroy\n\n respond_to do |format|\n format.html { redirect_to invoices_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invoice = Invoice.find(params[:id])\n @invoice.destroy\n\n respond_to do |format|\n format.html { redirect_to invoices_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invoice = Invoice.find(params[:id])\n @invoice.destroy\n\n respond_to do |format|\n format.html { redirect_to invoices_url }\n format.json { head :no_content }\n end\n end",
"def delete(vmname)\n uri = @uri + \"/#{vmname}?api-version=#{api_version}\"\n uri\n end",
"def destroy\n @version_control.destroy\n respond_to do |format|\n format.html { redirect_to version_controls_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 @invent.destroy\n respond_to do |format|\n format.html { redirect_to invents_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vote = @votable.votes.find(params[:id])\n @vote.destroy\n respond_to do |format|\n format.html { redirect_to build_path_votes }\n format.json { head :no_content }\n end\n end",
"def destroy\n @verse = Verse.find(params[:id])\n @verse.destroy\n\n respond_to do |format|\n format.html { redirect_to verses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @verse = Verse.find(params[:id])\n @verse.destroy\n\n respond_to do |format|\n format.html { redirect_to verses_url }\n format.json { head :no_content }\n end\n end",
"def delversion(version, project=self.project)\n post('delversion.json', project: project, version: version)\n end",
"def destroy\n @client_release = ClientRelease.find(params[:id])\n @client_release.destroy\n\n respond_to do |format|\n format.html { redirect_to client_releases_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @service_version = ServiceVersion.find(params[:id])\n @service_version.destroy\n\n respond_to do |format|\n format.html { redirect_to(service_versions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @version = Version.find(params[:id])\n @version.destroy_if_no_dependents\n respond_to do |format|\n unless @version\n foramt.html {redirect_to admin_versions_url, notice: \"Version destroyed\"}\n else\n format.html {redirect_to admin_versions_url, alert: \"Has dependent records\"}\n end\n end\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def destroy\n @translations_versions_test.destroy\n respond_to do |format|\n format.html { redirect_to translations_versions_tests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invoice.destroy\n respond_to do |format|\n format.html { redirect_to invoices_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @revision = Revision.find(params[:id])\n @revision.destroy\n\n respond_to do |format|\n format.html { redirect_to @revision.page }\n format.json { head :no_content }\n end\n end",
"def destroy\n @getinvoicedatum = Getinvoicedatum.find(params[:id])\n @getinvoicedatum.destroy\n\n respond_to do |format|\n format.html { redirect_to getinvoicedata_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @revision = Revision.find(params[:id])\n @revision.destroy\n\n head :no_content\n end",
"def destroy\n @admin_xampp_version.destroy\n respond_to do |format|\n format.html { redirect_to admin_xampp_versions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vnic = Vnic.find(params[:id])\n @vnic.destroy\n\n respond_to do |format|\n format.html { redirect_to vnics_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sinh_vien = SinhVien.find(params[:id])\n @sinh_vien.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end",
"def destroy\n @invoice=Invoice.find(params[:id])\n @invoice.destroy\n respond_to do |format|\n format.html { redirect_to invoices_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def destroy\n @voc = Voc.find(params[:id])\n @voc.destroy\n\n respond_to do |format|\n format.html { redirect_to vocs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @visit = Visit.find(params[:id])\n @visit.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @annex = Annex.find(params[:id])\n @annex.destroy\n\n respond_to do |format|\n format.html { redirect_to annexes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invoice_status = InvoiceStatus.find(params[:id])\n @invoice_status.destroy\n\n respond_to do |format|\n format.html { redirect_to invoice_statuses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @v1_order = V1::Order.find(params[:id])\n @v1_order.destroy\n\n head :no_content\n end",
"def destroy\n @api_method = ApiMethod.find(params[:id])\n @api_method.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_api_versions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n\n\n\n @vote = Vote.find(params[:id])\n\n @vote.destroy\n\n respond_to do |format|\n format.html { redirect_to votes_url }\n format.json { head :ok }\n end\n end",
"def DeleteView id\n \n APICall(path: \"views/#{id}.json\",method: 'DELETE')\n \n end",
"def destroy\n @involvement = Involvement.find(params[:id])\n @involvement.destroy\n\n respond_to do |format|\n format.html { redirect_to(involvements_url) }\n format.xml { head :ok }\n end\n end",
"def delete_version(key, version_id)\n raise MedusaStorage::Error::UnsupportedOperation\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 destroy\n @vote.destroy\n respond_to do |format|\n format.html { redirect_to votes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vote.destroy\n respond_to do |format|\n format.html { redirect_to votes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @verbindung = Verbindung.find(params[:id])\n @verbindung.destroy\n\n respond_to do |format|\n format.html { redirect_to verbindungs_url }\n format.json { head :no_content }\n end\n end",
"def delete\n request(:delete)\n end",
"def delete endpoint\n do_request :delete, endpoint\n end",
"def destroy\n @consensu = Consensu.find(params[:id])\n @consensu.destroy\n\n respond_to do |format|\n format.html { redirect_to consensus_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @verbo = Verbo.find(params[:id])\n @verbo.destroy\n\n respond_to do |format|\n format.html { redirect_to verbos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @kv = Kv.find(params[:id])\n @kv.destroy\n\n respond_to do |format|\n format.html { redirect_to kvs_url }\n format.json { head :no_content }\n end\n end",
"def 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 @file_version.destroy\n head :no_content\n end",
"def delete\n render json: Post.delete(params[\"id\"])\n end",
"def destroy\n repo = assets_repo\n repo.destroy(params[:id])\n\n respond_to do |format|\n format.html { redirect_to v_assets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @jm_verse = JmVerse.find(params[:id])\n @jm_verse.destroy\n\n respond_to do |format|\n format.html { redirect_to jm_verses_url }\n format.json { head :ok }\n end\n end",
"def destroy_rest\n @entry_instrument = EntryInstrument.find(params[:id])\n @entry_instrument.destroy\n\n respond_to do |format|\n format.html { redirect_to(entry_instruments_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end",
"def destroy\n @verdict.destroy\n respond_to do |format|\n format.html { redirect_to admin_verdicts_url, notice: t('shared.msgs.success_destroyed',\n obj: t('activerecord.models.verdict', count: 1)) }\n end\n end",
"def destroy\n @nvs_mig_status = NvsMigStatus.find(params[:id])\n @nvs_mig_status.destroy\n\n respond_to do |format|\n format.html { redirect_to nvs_mig_statuses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n \n if @client.deleted_at.blank?\n @client.destroy\n else\n @client.revive\n end\n \n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :ok }\n end\n end",
"def destroy\n @vote = Vote.find(params[:id])\n @vote.destroy\n\n respond_to do |format|\n format.html { redirect_to votes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @vote = Vote.find(params[:id])\n @vote.destroy\n\n respond_to do |format|\n format.html { redirect_to votes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @vote = Vote.find(params[:id])\n @vote.destroy\n\n respond_to do |format|\n format.html { redirect_to votes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @collection_invoice = CollectionInvoice.find(params[:id])\n @collection_invoice.destroy\n\n respond_to do |format|\n format.html { redirect_to collection_invoices_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @revise.destroy\n respond_to do |format|\n format.html { redirect_to revises_url }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Item.delete(params[\"id\"])\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 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 @livestock = Livestock.find(params[:id])\n @livestock.destroy\n\n respond_to do |format|\n format.html { redirect_to livestocks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ivn_link.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_ivn_links_url, notice: \"Ivn link was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def delete\n api_client.delete(url)\n end",
"def destroy\n @vet = Vet.find(params[:id])\n @vet.destroy\n\n respond_to do |format|\n format.html { redirect_to vets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @verification = Verification.find(params[:id])\n @verification.destroy\n\n respond_to do |format|\n format.html { redirect_to verifications_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @verification = Verification.find(params[:id])\n @verification.destroy\n\n respond_to do |format|\n format.html { redirect_to verifications_url }\n format.json { head :no_content }\n end\n end",
"def delete!\n request! :delete\n end"
] |
[
"0.77067125",
"0.7021626",
"0.6898421",
"0.6860792",
"0.6814764",
"0.67798084",
"0.6777002",
"0.67765176",
"0.67662334",
"0.6682487",
"0.65991765",
"0.65686244",
"0.65317816",
"0.6496022",
"0.6474038",
"0.6468849",
"0.645475",
"0.64395833",
"0.64281034",
"0.64163375",
"0.6401669",
"0.63816434",
"0.63718265",
"0.6363936",
"0.6361072",
"0.6342579",
"0.63379526",
"0.63361233",
"0.63361233",
"0.63361233",
"0.63361233",
"0.63228476",
"0.63154083",
"0.6305437",
"0.6294172",
"0.62902373",
"0.6285737",
"0.6285737",
"0.6269018",
"0.6228146",
"0.6227415",
"0.6221841",
"0.6219285",
"0.6217667",
"0.6216592",
"0.6213224",
"0.6210233",
"0.620399",
"0.62014467",
"0.61835414",
"0.618213",
"0.6176471",
"0.61758596",
"0.61758184",
"0.61585695",
"0.6151904",
"0.6147089",
"0.6143541",
"0.61399156",
"0.61248744",
"0.61177605",
"0.61132485",
"0.6103926",
"0.6103522",
"0.6103522",
"0.6103522",
"0.6103522",
"0.6090869",
"0.6090869",
"0.60906065",
"0.6088413",
"0.6087482",
"0.6083993",
"0.6074189",
"0.6073478",
"0.6067815",
"0.6063543",
"0.60582",
"0.60556155",
"0.6054217",
"0.6048158",
"0.60438496",
"0.604145",
"0.6032659",
"0.602283",
"0.60193783",
"0.60193783",
"0.60193783",
"0.6018213",
"0.6015169",
"0.60140955",
"0.6009805",
"0.60065967",
"0.600421",
"0.600412",
"0.6002244",
"0.60004056",
"0.59996545",
"0.59996545",
"0.5999267"
] |
0.66536504
|
10
|
Use callbacks to share common setup or constraints between actions.
|
def set_inversion
@inversion = Inversion.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 inversion_params
params.require(:inversion).permit(:code, :description, :alias)
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
|
overwrites current password with its hash
|
def hash_password!
@password = BCrypt::Password.create(@password)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def password=(new_password); end",
"def update_hash!(password)\n self.password = password\n hash_password\n save\n end",
"def hash_new_password\n self.password = BCrypt::Password.create(@new_password)\n end",
"def hash_new_password\n self.password = BCrypt::Password.create(@new_password)\n end",
"def hash_new_password\n self.encrypted_password = BCrypt::Password.create(@new_password)\n end",
"def password=(new_pw)\n @password = Password.create(new_pw)\n self.password_hash = @password\n end",
"def password=(new_pass)\n validate_password new_pass\n self.password_salt = User.random_string\n self.password_hash = digest(new_pass)\n end",
"def update_password(newpwd)\n self.password = Utils.sha1(newpwd + 'ad2012spot' + email)\n end",
"def set_password pass\n self.pass_salt = SHA256Salt.generate_random\n self.pass_hash = WodaHash.digest(self.pass_salt + pass).to_hex\n end",
"def password=(pass)\n @password=pass\n # self.password_updated_at = Time.now()\n salt = [Array.new(6){rand(256).chr}.join].pack(\"m\").chomp\n self.password_salt, self.password_hash = salt, Digest::SHA256.hexdigest(@password + salt)\n end",
"def password= new_pass\n # don't allow setting a blank password\n return if new_pass.blank?\n\n @password = BCrypt::Password.create(new_pass)\n self.password_digest = @password\n end",
"def password=(new_password)\n @raw_password = new_password\n @password = Password.create(new_password)\n self.password_hash = @password\n end",
"def set_password\n @password = Password.last\n @new_password = Password.new\n end",
"def scramble_password\n if self.password_changed?\n self.password = Digest::MD5.hexdigest(self.password)\n end\n end",
"def hash_password\n self.password = Digest::MD5.hexdigest(self.password)\n end",
"def password=(new_password)\n @password = Password.create(new_password)\n self.digest_password = @password\n end",
"def password=(new_password)\n @password = Password.create(new_password)\n self.password_hash = @password\n end",
"def password=(new_password)\n @password = Password.create(new_password)\n self.password_hash = @password\n end",
"def password=(pwd)\n @password = pwd\n return if pwd.blank?\n create_new_salt\n self.hashed_password = Agent.encrypted_password(self.password, self.salt)\n end",
"def password=(pwd)\n @password = pwd\n create_new_salt\n self.password_hash = User.encrypted_password(self.password, self.password_salt) \n end",
"def hash_pass()\n self.pass=(BCrypt::Password.create(pass).to_s)\n end",
"def password=(new_password)\n @passowrd = Password.create(new_password)\n self.password_hash = @password\n end",
"def encrypt_new_password\n return if password.blank?\n self.hashed_password = encrypt(password)\n end",
"def password=(new_password)\r\n\t\t@password_hash = User.calculate_hash(new_password)\r\n\tend",
"def password_field=(plaintext)\n if plaintext != self.password\n self.password = Digest::SHA1.hexdigest(plaintext)[0..39] \n end\n end",
"def encrypt_new_password\n return if password.blank?\n self.hashed_password = encrypt(password)\n end",
"def password= new_password\n new_password ||= SecureRandom::hex(8)\n @password = Password.create new_password\n self.password_digest = @password.to_s\n self.save\n end",
"def password=(new_password)\n self.password_hash = BCrypt::Password.create(new_password, :cost=>BCRYPT_COST)\n end",
"def hash_password\n return if password.blank?\n self.password_hash = Password.create(password)\n end",
"def hash_password\n self.hashed_password = BCrypt::Password.create(self.hashed_password)\n end",
"def password=(pwd)\n @password = pwd\n return if pwd.blank?\n create_new_salt\n self.password_hash = User.encrypted_password(self.password, self.salt)\n end",
"def hash_password\n \t\tself.salt = BCrypt::Engine.generate_salt\n \t\tself.password_digest = BCrypt::Engine.hash_secret(self.password, self.salt)\n \t\tself.password = nil\n \tend",
"def password=(new_password)\n\t\tsalt = [Array.new(6){rand(256).chr}.join].pack(\"m\").chomp\n\t\tself.password_salt, self.password_hash = salt, Digest::SHA256.hexdigest(new_password + salt)\n\tend",
"def password=(pass)\n @password = pass = password_confirmation\n self.password_hash = Digest::SHA256.hexdigest(pass)\n #Salt!\n #self.salt = User.random_string(10) if !self.salt?\n #self.password_hash = User.encrypt(@password, self.salt)\nend",
"def password=(new_password)\n if new_password != ''\n @password = Password.create(new_password)\n self.password_digest = @password\n end\n end",
"def set_password(new_password)\n self.salt = SecureRandom.base64(SALT_BYTES)\n self.password = Base64.encode64(OpenSSL::PKCS5::pbkdf2_hmac_sha1(new_password, salt, PBKDF2_ITERATIONS,\n HASH_BYTES))\n end",
"def password=(new_password)\n\t\tself.password_digest = BCrypt::Password.create(new_password)\n\tend",
"def password=(passwd)\n @password_hashed = Digest::SHA256.hexdigest(passwd)\n end",
"def password=(new_password)\n @password = BCrypt::Password.create(new_password)\n self.password_hash = @password\n end",
"def password=(new_password)\n @password = BCrypt::Password.create(new_password, :cost => 8)\n self.hashed_password = @password\n end",
"def password=(pass)\n @good_password = false if system(\"look \\\"#{pass.downcase}\\\" > /dev/null 2>&1\")\n super Encrypt::Password.createHash pass\n end",
"def password=(val)\n return if val.blank?\n attribute_set(:salt, Digest::SHA1.hexdigest(\"--#{Time.now.to_s}--#{name}--\")) if new?\n attribute_set(:crypted_password, val.encrypt(self.salt))\n end",
"def encrypt_password\n if new_record?\n self.salt = make_salt\n self.password_digest = encrypt(password_digest)\n end\n end",
"def crypt_password\n # EmailNotify.send_user_create_notification self\n self[:password] =\n password_hash(password(true))\n @password = nil\n end",
"def change_password(new_pass)\n self.salt = User.gen_salt\n salted_pass = User.salt_password(new_pass, self.salt)\n self.password = salted_pass\n end",
"def password=(pwd)\n self.password_digest = BCrypt::Password.create(pwd)\n end",
"def password= passwd\n return unless passwd\n new_salt = User.fresh_salt\n self.passworddate = Date.today.to_s\n self.salt = new_salt\n self.send(:write_attribute, :password, User.password_hash(passwd.to_s, new_salt))\n end",
"def password=(pwd)\n @password = pwd\n return if pwd.blank?\n #set the salt value for the user\n create_new_salt\n #create new hashed password\n self.hashed_password = User.encrypted_password(self.password, self.salt)\n end",
"def hash_password\n self.password_salt = SecureRandom.base64(8) if self.password_salt == nil\n self.hashed_password = Digest::SHA1.hexdigest(self.password_salt + self.password)\n end",
"def password=(pwd)\n return if pwd.blank?\n @password = pwd.to_s\n salt = HasPassword.random_hex(self.class.salt_length)\n self.password_salt = salt\n self.password_hash = HasPassword.encrypt(@password, salt)\n end",
"def set_password_legacy\n guid = @user['generateduid'][0].to_ruby\n password_hash_file = \"#{@@password_hash_dir}/#{guid}\"\n begin\n File.open(password_hash_file, 'w') { |f| f.write(resource[:password_sha1])}\n rescue Errno::EACCES => detail\n raise(\"Could not write to password hash file: #{detail}\")\n end\n end",
"def crypt_password\r\n write_attribute \"password\", self.class.sha1(password)\r\n end",
"def password=(new_password)\n self[:password] = new_password\n self.password_digest = BCrypt::Password.create(new_password)\nend",
"def password= new_password\n @password = new_password\n end",
"def hash_password # We'll call this method in the seed file; from https://gist.github.com/mdang/7b6097cc13b07db82c78\n if password.present?\n self.password_digest = BCrypt::Password.create(password)\n end\n end",
"def encrypt_passhash\n if passhash_changed?\n self.salt = BCrypt::Engine.generate_salt\n self.passhash = BCrypt::Engine.hash_secret(passhash, salt)\n end\n end",
"def password=(pass)\n salt = [Array.new(6) {rand(256).chr}.join].pack(\"m\").chomp\n self.password_salt, self.password_hash =\n salt, Digest::SHA256.hexdigest(pass+salt) \n \n @password=pass\n end",
"def password=(pass)\n @password = pass\n self.password_salt = [Array.new(10) { rand(256).chr }.join].pack(\"m\").chomp\n self.password_hash = Digest::SHA1.hexdigest(pass + password_salt)\n end",
"def change_temp_password\n\tend",
"def set_temp_password\n self.password = SecureRandom.urlsafe_base64(6)\n end",
"def password=(pass)\n @password = pass\n\n self.salt = random_string(10) if !self.salt\n\n self.hashed_password = Hacker.encrypt(@password, self.salt)\n end",
"def password=(new_password)\n @password = new_password\n self.encrypted_password = password_digest(@password) if @password.present?\n end",
"def password=(new_password)\n @password = nil\n\n if new_password.present?\n @password_hash = BCrypt::Password.create new_password\n end\n end",
"def encrypt_password\r\n \r\n # If the user is new, create a salt\r\n self.make_salt if new_record?\r\n \r\n # Hash the salt and password to create the encrypted pass\r\n self.encrypted_password = sha_hash(\"#{self.password}--#{self.salt}\")\r\n \r\n end",
"def crypt_password\n \t\twrite_attribute \"password\", self.class.sha1(password) unless self.password.empty?\n end",
"def password=(pw)\n @password = pw\n if pw and pw.size > 0\n self.salt = rand(100000000)\n self.hashed_password = Member.hashed_password(pw, self.salt)\n end\n end",
"def password=(new_password)\n self.password_hash = BCrypt::Password.create(new_password) if !new_password.nil? && new_password != ''\n @password = new_password\n end",
"def password=(pwd)\n\t\t@password=pwd\n\t\treturn if pwd.blank?\n\t\tcreate_new_salt\n\t\tself.hashed_password = User.encrypted_password(self.password, self.salt)\n\tend",
"def encrypt_password\n \tself.password = Digest::MD5.hexdigest(self.password)\n end",
"def set_new_password \n new_passwd = generate_password()\n self.password = self.password_confirmation = new_passwd\n self.save!\n return new_passwd\n end",
"def crypt_password\n write_attribute \"password\", self.class.sha1(password)\n end",
"def crypt_password\n write_attribute \"password\", self.class.sha1(password)\n end",
"def password=(password)\n self.password_digest = BCrypt::Password.create(password)\n \tend",
"def password=(password)\n salt = [Array.new(6){rand(256).chr}.join].pack(\"m\").chomp\n self.password_salt, self.password_hash = salt, Digest::SHA256.hexdigest(password + salt) \n end",
"def set_password_digest()\n\t\tself.password_digest = Password.create(self.password)\n\tend",
"def password= password\n @password = password\n\n self.password_digest = BCrypt::Password.create password\n end",
"def hash_password\n if password.present?\n self.salt = BCrypt::Engine.generate_salt\n self.hashed_password = BCrypt::Engine.hash_secret(password, self.salt)\n end\n end",
"def mutate_bcrypt_password(_)\n '400$8$2d$f6ed5a490c441958$67f59aa61bc617849a3280b5e80f78607e53b5aa5807a44ddbc53e804e2e2a99'\n end",
"def old_password=(string)\n end",
"def password=(new_password)\n @password = new_password\n self.password_digest = BCrypt::Password.create(new_password)\n end",
"def crypt_password\n\t\twrite_attribute \"password\", self.class.sha1(password)\n\tend",
"def crypt_password\n write_attribute \"password\", self.class.sha1(self.class.generate_salt, password)\n @password = nil\n end",
"def password=(password)\n@password = password\nif password.present?\ngenerate_salt\nself.hashed_password = self.class.encrypt_password(password, salt)\nend\nend",
"def password=(password)\n@password = password\nif password.present?\ngenerate_salt\nself.hashed_password = self.class.encrypt_password(password, salt)\nend\nend",
"def pass=(new_password)\n self.password = Password.create(new_password)\n end",
"def password=(password)\n\t\t@password = password\n\t\tself.salt = Random.rand.to_s\n\t\tnewPassword = [salt, password].join\n\t\tself.password_digest = Digest::SHA1.hexdigest newPassword\n\tend",
"def password=(new_password)\n self.encrypted_password = password_digest(new_password)\n end",
"def set_password(password) \n\t\t#Generate salt\n\t\tbase = [('a'..'z'),('A'..'Z')].map{|i| i.to_a}.flatten\n\t\tsalt = (0...50).map{ base[rand(base.length)] }.join\n\t\t\n\t\tenc_password = Digest::SHA1.hexdigest(salt+password)\n\t\t\n\t\tself.salt = salt\n\t\tself.password = enc_password\n\t\tself.temp_password = nil\n\t\tself.save\n\tend",
"def newPassword(newPass)\n\t\tDATABASE.edit(\"users\", \"password\", newPass, \"username\", @username)\n\tend",
"def password=(pass)\n @password = pass\n self.password_salt = [Array.new(10) { rand(256).chr }.join].pack(\"m\").chomp\n self.password_hash = Digest::SHA1.hexdigest(pass + password_salt)\n end",
"def password=(pwd) # define password = pwd(arg)?\n # set password_digest column to encrypted version of user's pwd.\n self.password_digest = BCrypt::Password.create(pwd)\n end",
"def add_password(a_password)\n self.password_hash = Digest::SHA256.hexdigest(a_password + Rails.application.secrets.salt)\n self.save\n end",
"def password=(new_password)\n @password = new_password\n end",
"def password=(new_password)\n @password = new_password if validate_password(new_password)\n end",
"def password=(new_password)\n @password = new_password if validate_password(new_password)\n end",
"def password_digest\n BCrypt::Password.new(super)\n end",
"def create_hashed_password\n self.password = password.crypt(\"ChaveDoProvas\")\n end",
"def password=(password)\n \t@password = password\n \tif password.present?\n \t genaerate_salt\n \t self.hash_password = self.class.encrypt_password(password,salt)\n \tend\n end",
"def password=(pwd)\n @password = pwd\n\n self.password_digest = BCrypt::Password.create(pwd)\n\n self.save\n end",
"def encrypt_password\n self.salt = make_salt if new_record?\n self.encrypted_password = encrypt(password)\n end"
] |
[
"0.80666226",
"0.79818887",
"0.7891975",
"0.7841877",
"0.7795894",
"0.7795579",
"0.77386457",
"0.7709716",
"0.77044505",
"0.76443547",
"0.7610888",
"0.760723",
"0.7571119",
"0.7560734",
"0.75541925",
"0.7538848",
"0.7512936",
"0.7512936",
"0.75051266",
"0.7495999",
"0.7479781",
"0.74772066",
"0.74692404",
"0.7467149",
"0.74535036",
"0.74321944",
"0.7430215",
"0.74143463",
"0.7407447",
"0.74047375",
"0.73736817",
"0.73599386",
"0.7358506",
"0.7356547",
"0.7342216",
"0.7337315",
"0.7318574",
"0.7299556",
"0.7291301",
"0.72807616",
"0.72535276",
"0.72527975",
"0.72513586",
"0.7244489",
"0.7237108",
"0.7231811",
"0.72288567",
"0.72189146",
"0.7217421",
"0.7214941",
"0.7204956",
"0.7193526",
"0.71905464",
"0.71848804",
"0.7173207",
"0.7171353",
"0.71687",
"0.7168594",
"0.7167204",
"0.71656734",
"0.71544105",
"0.71525353",
"0.7151863",
"0.7142482",
"0.7139361",
"0.7138451",
"0.7124078",
"0.7116312",
"0.7108551",
"0.7102341",
"0.70990694",
"0.70990694",
"0.709117",
"0.7091046",
"0.70875525",
"0.70843405",
"0.70766747",
"0.7075655",
"0.70739317",
"0.7064832",
"0.7064186",
"0.7060998",
"0.70596564",
"0.70596564",
"0.70565355",
"0.70548993",
"0.70545286",
"0.7050325",
"0.70402986",
"0.7039819",
"0.703257",
"0.7029757",
"0.7027894",
"0.7024205",
"0.7024205",
"0.70039016",
"0.700279",
"0.70025307",
"0.69987607",
"0.6997102"
] |
0.73712903
|
31
|
checks if given password matches with the user's
|
def password_match? password
BCrypt::Password.new(@password) == password
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def passwords_match?\n context.user.password == context.password\n end",
"def matching_password?(pass)\n self.password_hash == encrypt_password(pass)\n end",
"def password_match?(entered_password = '')\n password == User.hash_with_salt(entered_password, salt)\n end",
"def password_match?(password=\"\")\n hashed_password == User.hash_with_salt(password, salt)\n end",
"def password_match?(password=\"\")\n hashed_password == User.hash_with_salt(password, salt)\n end",
"def password_match?(password=\"\")\n hashed_password == AdminUser.hash_with_salt(password, salt)\n end",
"def password_match?(password=\"\")\n hashed_password == AdminUser.hash_with_salt(password, salt)\n end",
"def password_match?(login_password)\n\t\tencrypted_password == encrypt(login_password)\t\n\tend",
"def valid_password?(password); end",
"def password_match?( password=\"\")\n hashedPassword == Admin.hash_with_salt(password, salt)\n end",
"def match_password(login_password=\"\")\n password == BCrypt::Engine.hash_secret(login_password, salt)\n end",
"def correct_password?(params)\n current_password=params[:user][:current_password]\n password == current_password\n end",
"def matches_password(login_password)\n passhash == BCrypt::Engine.hash_secret(login_password, salt)\n end",
"def verify_password(password)\n hash_password(password) == @password_hash\n end",
"def match_password_basic(p)\n puts \"p: #{p}\"\n puts \"password: #{password}\"\n p == password\n end",
"def correct_password?(params)\n current_password = params[:user][:current_password]\n password == current_password\n end",
"def correct_password?(params)\n current_password = params[:user][:current_password]\n password == current_password\n end",
"def matching_passwords(params)\n if params[\"Password\"] == params[\"Confirmed_password\"]\n return true \n else \n return false\n end \n end",
"def correct_password?(params)\n current_password = params[:pd_user][:current_password]\n return (password == current_password)\n end",
"def has_password?(submitted_password)\n password == encrypt(submitted_password)\n end",
"def valid_password?(password)\n true\n end",
"def password_match\n if password != confirm_password\n errors.add(:password, \"doesn't match\")\n end\n end",
"def same?(params)\n User.find(params[:user_id]).play(PasswordRole) { |user|\n user.same_password?(params[:password])\n }\n end",
"def password\n password = @prompt.mask(\"Enter password: \", required: true)\n if password == @current_user.password\n true\n else\n puts \"Password is invalid.\"\n sleep(1)\n false\n end\n end",
"def cdb_verify_password(given_password)\n encrypt_password(given_password) == @password\n end",
"def correct_password?(params)\n self.current_password = params[:user][:current_password]\n self.password == self.current_password\n end",
"def password_match?\n self.password == self.password_confirmation\n end",
"def has_password?(submitted_password)\n #compare encrypted_password with the encrypted version of submitted password.\n password == submitted_password\n end",
"def check_password( username, password )\n\t\tdigest = self.class.users[ username ] or\n\t\t\tself.log_failure \"No such user %p.\" % [ username ]\n\n\t\t# Fail if the password's hash doesn't match\n\t\tself.log_failure \"Password mismatch.\" unless\n\t\t\tdigest == Digest::SHA1.base64digest( password )\n\n\t\treturn true\n\tend",
"def password_match?\n add_password_match_error if password != password_confirmation\n\n password == password_confirmation && !password.blank?\n end",
"def authenticate password\n if self.password == password\n true\n else\n false\n end\n end",
"def check_pw pw\n (encrypt pw) == (self[:password])\n end",
"def password_ok?(username, password)\n hashed_pass = hashed_password(username, password)\n PasswordCheck.check(username, hashed_pass, @passwords)\n end",
"def has_password?(submitted_password)\n\tpassword == encrypt(submitted_password) \n end",
"def credential_match?(user, login, password)\n return false unless user.phone == login || user.email == login\n return false unless user.password == password\n return true\n end",
"def credential_match?(user, login, password)\n return false unless user.phone == login || user.email == login\n return false unless user.password == password\n return true\n end",
"def credential_match?(user, login, password)\n return false unless user.phone == login || user.email == login\n return false unless user.password == password\n return true\n end",
"def credential_match?(user, login, password)\n return false unless user.phone == login || user.email == login\n return false unless user.password == password\n true\n end",
"def test_password_matches_custom_password\n user = User.named(\"user\", :password => \"verysecret\")\n assert(!user.password_matches?(\"user\"))\n assert(user.password_matches?(\"verysecret\"))\n end",
"def has_password?(submitted_password)\n # Return true if the user's password matches the submitted password.\n # Compare encrypted_password with the encrypted version of submitted_password\n encrypted_password == encrypt(submitted_password) \n end",
"def db_verify_user_password(userid, password)\n\t\t\n\t\t# SQL statement for selecting * given a userid and a hashed password\n \tquery = \"SELECT * FROM users\n\t\t\t\tWHERE userid='%%email%%'\n\t\t\t\tAND password='%%password%%';\"\n\t\t\n\t\t# Fill in userid and password values in the SQL statement\n \tquery = query.gsub(/%%email%%/, PG::Connection.escape_string(userid)).gsub(/%%password%%/, hashPassword(password))\n \t\n \t# Connect to the database\n \tconn = DBTools.new.connectToDB()\n \t\n \t# Execute SQL Statement\n results = conn.exec(query)\n \n # If there are 0 results\n if (results.ntuples == 0)\n \tresults.clear()\n conn.finish()\n return false\n\n # If there are too many results (this should never occur)\n elsif (results.ntuples > 1)\n \tresults.clear()\n \tconn.finish()\n raise \"Too many password matches.\"\n \n # Query successful\n else\n \tresults.clear()\n \tconn.finish()\n \treturn true\n end\n\tend",
"def has_password?(submitted_password)\n self.password == encrypt(submitted_password)\n end",
"def password?(password_candidate)\r\n\t\t@password_hash == User.calculate_hash(password_candidate)\r\n\tend",
"def is_password?(password)\n obj = Password.new(self.password_digest)\n obj.is_password?(password)\n end",
"def credential_match?(user, login, password)\n false unless user.email == login || user.phone == login\n false unless user.password == password\n true\n end",
"def authenticate(password)\n user && user.password == password\n end",
"def valid_pass?(test_pass)\n Encrypt::Password.validatePassword test_pass, password\n end",
"def has_password? pass\n WodaHash.digest(self.pass_salt + pass).to_hex.downcase == pass_hash.downcase\n end",
"def password_compare(password, user_id)\n password_digest = db.execute(\"SELECT password_digest FROM users WHERE user_id=?\", user_id)[0][0]\n if BCrypt::Password.new(password_digest) == password\n return true\n else\n return false\n end\n\nend",
"def has_password?( submitted_password )\n encrypted_password == encrypt( submitted_password )\n end",
"def has_password?(password)\n encrypted_password == encrypt(password)\n end",
"def match_password_hash\n\n evaluated_password_e = Admin.get_encrypted_password(@password, @login_salt_d)\n return incorrect_login_error('am_l_pa_5') unless (evaluated_password_e == @admin.password)\n\n success\n end",
"def has_password?(submitted_password)\r\n encrypted_password == encrypt(submitted_password)\r\n end",
"def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end",
"def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end",
"def check_password(password, hash)\n BCrypt::Password.new(hash) == password\n end",
"def check_password(password)\n return false unless key\n key == self.class.hash_password(password, key.split('|', 2).first)\n end",
"def compare_pass (pass)\r\n return self.encrypted_password == sha_hash(\"#{pass}--#{self.salt}\")\r\n end",
"def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end",
"def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end",
"def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end",
"def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end",
"def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end",
"def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end",
"def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end",
"def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end",
"def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end",
"def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end",
"def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end",
"def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end",
"def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end",
"def check_password(pass)\n hash = calc_hash(pass)\n\n return false if hash.nil?\n crypt_pass == hash\n end",
"def valid_password? password\r\n self.password === Digest::MD5.hexdigest(password)[0..19]\r\n end",
"def valid_password?(plain)\n password == hash_crypt(plain.to_s) \n end",
"def has_password?(submitted_password)\n # Compare encrypted password with the encrypted version of\n # Submitted password\n encrypted_password == encrypt(submitted_password)\n end",
"def has_password? (submitted_password)\n password_digest == encrypt(submitted_password)\n end",
"def match_password(password, password_cofirmation)\n return (password==password_cofirmation) ? true : false\n end",
"def is_password?(password)\n BCrypt::Password.new(self.password_digest) == password\n end",
"def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end",
"def authenticate password\n hash = BCrypt::Engine.hash_secret password, password_salt\n hash == password_hash\n end",
"def valid_password?(password)\n\t\t$users_and_passwords.each do |element|\n\t\t\tif element[USERNAME] == @username\n\t\t\t\tif element[PASSWORD] == password\n\t\t\t\t\t@authenticated=true\n\t\t\t\t\treturn true\n\t\t\t\tend\n\t\t\tend\n\t\tend\t\t\t\n\n\t\treturn false\n\tend",
"def authenticate(attempted_password)\n if self.password == attempted_password\n true\n else\n false\n end\n end",
"def authenticate(attempted_password)\n if self.password == attempted_password\n true\n else\n false\n end\n end",
"def has_password?(submitted_password)\n # compare encrypted_password with the encrypted version of submitted_password\n encrypted_password == encrypt(submitted_password)\n end",
"def has_password?(submitted_password)\n valid_password?(submitted_password)\n end",
"def test_contain_password12\n result = contains_password?(\"password1\")\n refute(result, \"'password1' should not be valid because it contains 'password'\")\n end",
"def correct_password?(user, password, field)\n unless user.authenticate(password)\n fail BadRequestError.new(code: :incorrect, field: field), \"Incorrect password\"\n end\n end",
"def password_is?(pw)\n Digest::MD5.hexdigest(pw + password_salt) == password_hash\n end",
"def password_match?\n self.errors[:password] << 'password not match' if password != password_confirmation\n self.errors[:password] << 'you must provide a password' if password.blank?\n password == password_confirmation and !password.blank?\n end",
"def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end",
"def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end",
"def has_password?(password_soumis)\n # Compare encrypted_password avec la version cryptée de password_soumis.\n encrypted_password == encrypt(password_soumis)\n end",
"def has_password?(submitted_password)\n #Compare encrypted_password with the encrypted version of \n # submitted_password.\n encrypted_password == encrypt(submitted_password)\n end",
"def has_password?(password_soumis)\n\t\t# Compare encrypted_password avec la version cryptée de password_soumis.\n encrypted_password == encrypt(password_soumis)\n end",
"def auth_pass(password)\n BCrypt::Password.create(password) == self.hash_pass\n end",
"def valid_password?(password)\n BCrypt::Password.new(self.password_digest).is_password?(password)\n end",
"def valid_password?(password)\n BCrypt::Password.new(self.password_digest).is_password?(password)\n end",
"def validate_password(email, password)\n password_for_email = $db.execute(\"SELECT password_digest FROM users WHERE email = ?\", email)[0][\"password_digest\"]\n p \"validating password\"\n if BCrypt::Password.new(password_for_email) == password\n p \"password match\"\n return true\n else\n p \"password not match\"\n return false\n end\nend",
"def needs_password?(user, params)\n user.email != params[:email] ||\n params[:password].present?\n end",
"def require_password\n\t\t\treturn (params[:password] and params[:password] == @server.password)\n\t\tend"
] |
[
"0.86199653",
"0.8453933",
"0.81589735",
"0.8134479",
"0.8134479",
"0.8130134",
"0.8130134",
"0.81194365",
"0.8072656",
"0.80581415",
"0.80513275",
"0.79164684",
"0.7905791",
"0.7898164",
"0.7897955",
"0.787927",
"0.787927",
"0.78194946",
"0.7812218",
"0.780571",
"0.78033835",
"0.7800761",
"0.7773054",
"0.7761096",
"0.7757877",
"0.7756125",
"0.7754002",
"0.7736341",
"0.7718836",
"0.7704491",
"0.76997393",
"0.7686994",
"0.7683828",
"0.7677419",
"0.76714957",
"0.76714957",
"0.76714957",
"0.76690465",
"0.766742",
"0.7655184",
"0.76369363",
"0.7635818",
"0.7614959",
"0.7606943",
"0.76060504",
"0.7605913",
"0.7587251",
"0.75768137",
"0.75728047",
"0.7562083",
"0.7559761",
"0.75567305",
"0.7554006",
"0.7548795",
"0.7548795",
"0.75476176",
"0.75458086",
"0.7538049",
"0.7537899",
"0.7537899",
"0.7537899",
"0.7537899",
"0.7537899",
"0.7537899",
"0.7537899",
"0.7537899",
"0.7537899",
"0.7537899",
"0.7537899",
"0.7537899",
"0.7537899",
"0.7528777",
"0.7520516",
"0.7516336",
"0.7515509",
"0.7512589",
"0.751116",
"0.7492727",
"0.74846464",
"0.747591",
"0.74712086",
"0.7469492",
"0.7469492",
"0.74663574",
"0.74662733",
"0.74613494",
"0.745854",
"0.7454751",
"0.7453066",
"0.74510676",
"0.74510676",
"0.74403244",
"0.74390495",
"0.7435001",
"0.7433883",
"0.7414103",
"0.7414103",
"0.7413815",
"0.7408622",
"0.74069434"
] |
0.8130207
|
5
|
generates and saves an random API key
|
def generate_api_key!
@api_key = Digest::SHA1.hexdigest((Time.now.to_f + rand(100) * rand()).to_s)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def generate_api_key\n key = Digest::SHA1.hexdigest(Time.now.to_s + rand(12345678).to_s)[1..10]\n self.api_key = self._id.to_s + key\n end",
"def generate_api_key\n key = Digest::SHA1.hexdigest(Time.now.to_s + rand(12345678).to_s)[1..10]\n self.api_key = self._id.to_s + key\n end",
"def generate_api_key\n self.api_key = SecureRandom.hex(16)\n end",
"def generate_api_key\n begin\n api_key = SecureRandom.uuid\n end while ApiKey.exists?(:api_key => api_key)\n\n api = ApiKey.new\n api.api_key = api_key\n api.save\n\n self.api_key = api\n end",
"def generate_api_key\n SecureRandom.random_number(2 ** 256).to_s(36)\n end",
"def generate_api_key\n begin\n self.api_key = SecureRandom.hex(16)\n end while self.class.exists?(api_key: api_key)\n self.save\n self.api_key\n end",
"def generate_api_key\n digest = Digest::SHA2.new(512)\n # generate a unique token\n unique_seed = SecureRandom.hex(20)\n digest.update(\"#{unique_seed} SECRET! #{Time.current.to_f}\").to_s\n end",
"def generate_api_key\n digest = Digest::SHA2.new(512)\n # generate a unique token\n unique_seed = SecureRandom.hex(20)\n digest.update(\"#{unique_seed} SECRET! #{Time.current.to_f}\").to_s\n end",
"def gen_api_key\n u = UUID.new\n self.api_key = u.generate\n end",
"def generate_api_key\n generate_uuid\nend",
"def generate_api_key(length = 20)\n self.api_secret_key = SecureRandom.hex(length)\n end",
"def generate_api_key\n loop do\n token = SecureRandom.base64.tr('+/=', 'Qrt')\n break token unless self.class.exists?(api_key: token)\n end\n end",
"def create_key\n self.key = loop do\n random_token = SecureRandom.urlsafe_base64(nil, false)\n break random_token unless Api.exists?(key: random_token)\n end\n end",
"def regenerate_api_key\n generate_api_key\n self.save\n end",
"def generate_api_key\n\t\tloop do\n\t\t\ttoken = SecureRandom.base64.tr('+/=', 'Qrt')\n\t\t\tbreak token unless User.exists?(api_key: token)\n\t\tend\n\tend",
"def generate_api_key\n # SecureRandom.hex(32) will generate a string of length 32 contaning\n # random hex characters.\n loop do\n self.api_key = SecureRandom.hex(32)\n # In the eventuality that we accidently create an API key that already exists in our database, we're going to loop and rengearate it until that is no longer the case\n break unless User.exists?(api_key: api_key)\n end\n end",
"def generate_api_key(id)\n request(:post, \"/users/#{id}/make_new_api_key.json\")\n end",
"def regenerate_api_key\n self.api_key = Digest::SHA1.hexdigest(\"#{self._id}-#{Time.now.to_f}-#{self.created_at}\")\n end",
"def generate_api_key\n loop do\n token = SecureRandom.base64.tr('+/=', 'RST')\n break token unless User.exists?(api_key: token)\n end\n end",
"def generate_api_key\n loop do\n token = SecureRandom.base64.tr('+/=', 'Qrt')\n break token unless User.exists?(api_key: token)\n end\n end",
"def generate_api_key\n loop do\n token = SecureRandom.base64.tr('+/=', 'Qrt')\n break token unless User.exists?(api_key: token)\n end\n end",
"def generate_api_key\n loop do\n token = SecureRandom.base64.tr('+/=', 'Qrt')\n break token unless User.exists?(api_key: token)\n end\n end",
"def generate_api_key\n @user.api_key = BCrypt::Engine.generate_salt\n end",
"def generate_api_key\n @user.generate_api_key\n @user.save\n redirect_to users_path\n end",
"def regenerate_api_key!\n self.regenerate_api_key\n self.save\n end",
"def generate_api_key\n api_key = new_token\n if AppSettings[:authentication][:key_based]\n Rails.cache.write( User.cached_api_key(api_key), self.authentication_token,\n expires_in: AppSettings[:authentication][:session_expiry] )\n api_key\n else\n secure_api_key = secured_key(api_key)\n update_hash = {}\n update_hash[:activation_digest] = User.digest(User.cached_api_key(secure_api_key))\n update_hash[:activated_at] = Time.now if self.activated_at < Time.now - 24.hours\n self.update(update_hash)\n secure_api_key\n end\n end",
"def generate_key\n self.key ||= SecureRandom.urlsafe_base64 32\n end",
"def generate_api_key\n @url = 'https://ericssonbasicapi2.azure-api.net/v1_0/apiuser/' +\n @uuid + '/apikey'\n response = Faraday.post(@url) do |req|\n req.headers['Ocp-Apim-Subscription-Key'] = @key\n end\n\n unless response.status == 201\n raise Momoapi::Error.new(response.body, response.status)\n end\n\n key = JSON.parse(response.body)\n puts \"\\n User ID: #{@uuid} \\n API key: #{key['apiKey']} \\n\\n\"\n end",
"def generate_api_key(id)\n response = request(:post, \"/users/#{id}/make_new_api_key.json\")\n response[\"user\"]\n end",
"def generate_api_key\n loop do\n token = SecureRandom.base64.tr('+/=', 'Qrt')\n break token unless Mp3.exists?(api_key: token)\n end\n end",
"def generate_access_key\n return if self.access_key.present?\n self.access_key = SecureRandom.uuid\n end",
"def generate_key\n self.key = SecureRandom.hex(KEY_LENGTH / 2)\n end",
"def generate_api_key\n loop do\n token = SecureRandom.base64.tr('+/=', 'Qrt')\n break token unless Employee.exists?(api_key: token)\n end\n end",
"def generate_key; end",
"def seed_api_key\n\t\t\tDoorkeeper::Application.create(name: \"sample app\", \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t uid: \"836ec399a145ffafbd7774c57e06960397b77a53bb1ccc03d4e45d95d0c31a3d\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t secret: \"cf8dc84d17c69e17a8b9d74ec971bdb636f231d3ba7d2ad2ebfca45bdc8ae3c9\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t redirect_uri: \"urn:ietf:wg:oauth:2.0:oob\")\n\t\tend",
"def generate_access_key\n access_keys.generate_new\n end",
"def generate_random_key\n SecureRandom.random_bytes(32)\n end",
"def add_api_key\n @user = current_user\n if @user.present?\n @user.api_key = generate_api_key(16, 'user')\n @user.save\n end\n end",
"def generate_key\n SecureRandom.hex(32)\nend",
"def generate_user_key\n\t\tself.key = loop do\n random_hex = SecureRandom.urlsafe_base64\n break random_hex unless self.class.exists?(key: random_hex)\n end\n\tend",
"def regenerate_api_key\n api_keys.map(&:expire)\n api_keys.create\n end",
"def regenerate_api_key\n api_keys.map(&:expire)\n api_keys.create\n end",
"def generate_personal_key\n self.personal_key = OaUtils.generate_random_key\n self.state = :active\n end",
"def set_api_key\n\t\tself.api_key = ApiKey.create()\n\tend",
"def generate_keys\n\t\tself.token = OAuth::Helper.generate_key(20)[0,20]\n\t\tself.expires_at = 10.minutes.from_now\n\t\tself.authorized_at = Time.now\n\tend",
"def create_api_key\n loop do\n # Generate a random api key\n @unique_api_key = SecureRandom.hex(12)\n\n begin\n # Check if the generated api key belongs to another User\n User.find_by(api_key: @unique_api_key)\n rescue Mongoid::Errors::DocumentNotFound\n # Break from loop if the api key doesn't already belong to another User\n break\n end\n end\n \n if @current_user.update(api_key: @unique_api_key)\n render json: { api_key: @current_user.api_key }\n else\n render json: { error: 'Failed to generate api_key for user' }\n end\n end",
"def assign_api_key!\n self.api_key = ApiKey.create!\n end",
"def generate_api_key\n @project.reset_token!\n render :settings_api\n end",
"def generate_access_key\n self.access_key = Digest::SHA1.hexdigest(SecureRandom.urlsafe_base64)\n end",
"def generate_key\n length = 5\n begin\n self.key = SecureRandom.urlsafe_base64 length\n end while Invite.exists?(key: self.key)\n end",
"def reset_api_key\n key = generate_api_key\n md5 = Digest::MD5.new\n md5.update(key)\n # base64 encode md5 hash\n self.update(api_key: Base64.encode64(md5.to_s).strip)\n end",
"def reset_api_key\n key = generate_api_key\n md5 = Digest::MD5.new\n md5.update(key)\n # base64 encode md5 hash\n self.update(api_key: Base64.encode64(md5.to_s).strip)\n end",
"def generate_registration_key\n self.registration_key = 'C'.freeze + SecureRandom.base64(8)\n end",
"def generate_keys\n self.client_id = OAuth::Helper.generate_key(40)[0,40]\n self.client_secret_hash = OAuth::Helper.generate_key(40)[0,40]\n end",
"def generate_key(store)\n store.token = loop do\n random_token = SecureRandom.urlsafe_base64(nil, false)\n break random_token unless Store.exists?(token: random_token)\n end\n end",
"def generate_key\n key = RbNaCl::Random.random_bytes(RbNaCl::SecretBox.key_bytes)\n Base64.strict_encode64 key\n end",
"def create_key\n self.key = Digest::MD5.hexdigest(self.official_id.to_s + self.sent_to_email)\n end",
"def generate_key\n proposed_key = nil\n\n loop do\n num_part = rand(10**7).to_s.rjust(7, \"0\")\n proposed_key = \"#{IDB_CONFIG[:key_prefix]}-#{num_part}\"\n break unless self.class.find_by(key: proposed_key)\n end\n proposed_key\n end",
"def save_verification_key\n self.verification_key = KeyGenerator.create\n end",
"def generate_random_key\n (0...8).map { 65.+(rand(25)).chr }.join\n end",
"def create_api_key(string, pepper = rand(9**99).to_s)\n # Hash then encrypt our seed string\n 10.times do\n # Run our string through 10 rounds of SHA512, each time \"peppering\" it with random data\n 10.times do\n string = sha512(string.to_s + pepper)\n end\n # Encrypt the end result to further obfuscate things\n string = encrypt(string + pepper)\n end\n return string[0...64] # return the end result, stripping to 64 characters\nend",
"def secret_keygen\n ('k' + Digest.hexencode(rand(9).to_s + self.message[0..2]) + self.id.to_s) \n end",
"def set_key\n self.key = SecureRandom.urlsafe_base64(KEY_LENGTH)\n self.set_key if Url.exists?(key: self.key)\n end",
"def randomkey; end",
"def randomkey; end",
"def generate_token\n self.update({:token => SecureRandom.hex})\n end",
"def generate_auth_key\n name = \"fasdfadf\"\n puts self.name\n puts name\n end",
"def create\n @private_key = User.where(login: params[:api][:login]).first.generate_private_key!\n end",
"def random_key_gen(key_len = 32, raw = false)\n @master_key = random_bytes key_len\n raw ? @master_key : Base64.strict_encode64(@master_key)\n end",
"def generate_token!\n new_token = User.unique_random(field_name: 'api_token')\n update_column(:api_token, new_token)\n end",
"def api_key\n token = self.api_token || self.create_api_token(:action => 'api')\n token.value\n end",
"def regenerate_apikey(uid)\n current_path = \"/api/v1/users/#{uid}/api-keys\"\n @conn.delete(current_path)\n end",
"def generate_unique_key\n\n # @TODO:need to update the algo. Right now it's very simple algo\n length = self.url.length\n rand(36**length).to_s(36)\n end",
"def random\n RandomJam.jam(@api_key, @https)\n end",
"def generate_validation_key\n self.validation_key = SecureRandom.base64(8)\n end",
"def generate_unique_key\n # not doing uppercase as url is case insensitive\n charset = ::Shortener.key_chars\n (0...::Shortener.unique_key_length).map{ charset[rand(charset.size)] }.join\n end",
"def api_key\n key\n end",
"def generate_token\n @token = SecureRandom.base58(10)\n self.update(token: @token)\n end",
"def generate_validkey(from_string = nil)\n\t\tfrom_string ||= User.sha1(AuthHelper::Utils::random_string(30))\n write_attribute \"validkey\", from_string\n end",
"def randomkey\n send_command([:randomkey])\n end",
"def create_api_key\n wait_until_bus_section_load\n locator = \"//a[text()='(create)']\"\n find_any = api_key_div.all(:xpath, locator)\n if find_any.size > 0\n api_key_div.find(:xpath, locator).click\n wait_until_bus_section_load\n end\n end",
"def set_key!\n self.new_user_key = [*('a'..'z'),*('0'..'9')].shuffle[0,8].join\n end",
"def generate\n key = Bitcoin::Key.generate.priv\n info(\"Bitcoin private key generated: #{key[0..8]}...\")\n key\n end",
"def generate_auth_key\n key = Base64.encode64(\"#{Filepreviews.api_key}:#{Filepreviews.secret_key}\").gsub(/\\n/, '')\n \"Basic #{key}\"\n end",
"def create_auth_token(key)\n\t\tself.auth_token = Digest::SHA1.hexdigest(\"#{random_string}--#{Time.now}---#{key}\")\n\tend",
"def generate\n key = Bitcoin::Key.generate.priv\n @log.info(\"Bitcoin private key generated: #{key[0..8]}...\")\n key\n end",
"def generate_token!\n self.token = SecureRandom.hex\n save!\n end",
"def create\n user = User.where(email: params[:email]).first\n\n if user && user.authenticate(params[:password])\n api_key = user.find_api_key(params[:scope])\n\n if !api_key.is_locked\n api_key.last_access = Time.now\n\n if !api_key.access_token || api_key.is_expired?\n puts \"non existant or expired key, generating\"\n api_key.set_expiry_date\n api_key.generate_access_token\n end\n\n api_key.save\n\n render json: api_key, status: 201\n else\n render json: { errors: 'Your account has been locked.' }, status: 401\n end\n\n else\n render json: { errors: 'Could not authenticate properly.' }, status: 401\n end\n end",
"def api_key\n @@api_key ||= ''\n end",
"def set_api_key\n @api_key = ApiKey.find(params[:id])\n end",
"def set_api_key\n @api_key = ApiKey.find(params[:id])\n end",
"def set_api_key\n @api_key = ApiKey.find(params[:id])\n end",
"def generate\n raise \"The secret file #{path} already exists.\" if File.exist?(path)\n\n set SecureRandom.hex(16)\n end",
"def generate_token\n SecureRandom.hex(10)\n end",
"def after_create\n self.secret_key = secret_keygen\n self.save!\n end",
"def regenerate_key\n self.private_key = true\n self.save\n end",
"def new_api_key\n @application = Doorkeeper::Application.find(params[:id])\n @application.secret = Doorkeeper::OAuth::Helpers::UniqueToken.generate\n @application.save\n message = I18n.t('new_api_key')\n flash[:notice] = render_to_string partial: 'applications/flash',\n locals: { message: message }\n redirect_to authorizations_path\n end",
"def generate_api_sig(options={})\n # Every request requires the api_key parameter\n options.merge! @auth\n # Keys must be sorted alphabetically\n api_sig = options.sort { |a, b| a.to_s <=> b.to_s }.join\n Digest::MD5.hexdigest(\"#{@secret}#{api_sig}\")\n end",
"def create_appplication_key\n\t\t# set guid key for current application_id\n\t\t# self.application_id = Admin::Guid.new.key\n\t\t@application_id = Admin::Guid.new.key\n\tend",
"def generate_id\n SecureRandom.hex(8)\n end"
] |
[
"0.8663579",
"0.8663579",
"0.8597357",
"0.8509766",
"0.84947217",
"0.8459179",
"0.83940005",
"0.83940005",
"0.8358565",
"0.82222754",
"0.819442",
"0.81201404",
"0.8104667",
"0.8020866",
"0.80207604",
"0.79967225",
"0.79954904",
"0.7971065",
"0.7943076",
"0.7903435",
"0.7903435",
"0.7903435",
"0.7877519",
"0.7822567",
"0.7796188",
"0.7775536",
"0.77505386",
"0.77362186",
"0.77339953",
"0.7648277",
"0.7548891",
"0.7532615",
"0.75282925",
"0.746969",
"0.7426021",
"0.7345633",
"0.73115283",
"0.72553635",
"0.72486013",
"0.7225718",
"0.7197479",
"0.7197479",
"0.7194525",
"0.71862525",
"0.7148196",
"0.7133201",
"0.7115183",
"0.70865995",
"0.70670086",
"0.7060313",
"0.70477384",
"0.70477384",
"0.7020518",
"0.7014185",
"0.70021474",
"0.69011545",
"0.6874122",
"0.68643385",
"0.6799305",
"0.6788724",
"0.6786601",
"0.67580146",
"0.67577964",
"0.67434794",
"0.67434794",
"0.673208",
"0.6726477",
"0.67081225",
"0.67075086",
"0.6689226",
"0.66715205",
"0.6666039",
"0.6649093",
"0.66452473",
"0.66442704",
"0.6636609",
"0.66254836",
"0.6605788",
"0.6582923",
"0.65816367",
"0.6578051",
"0.65770745",
"0.656196",
"0.65616435",
"0.6553132",
"0.65481496",
"0.6531023",
"0.65284",
"0.6527391",
"0.6514493",
"0.6514493",
"0.6514493",
"0.6491133",
"0.6485236",
"0.648063",
"0.6473316",
"0.6464519",
"0.64634466",
"0.6461197",
"0.64518535"
] |
0.86330414
|
2
|
list all natural numbers below limit that are multiples of 3 or 5 collects correct multiples of natural numbers below limit
|
def collect_multiples(limit)
multiples = []
(1...limit).each do |num|
multiples << num if (num % 3 == 0 || num % 5 == 0)
end
return multiples
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def collect_multiples(limit)\n multiples = []\n numbers = (1..limit.to_i-1).to_a\n numbers.each do |i|\n if i % 3 == 0 || i % 5 == 0\n multiples.push(i)\n end\n end\n multiples \nend",
"def multiples_of_3_or_5(max)\n multiples = []\n for i in 3...max #two dots are inclusive, three dots are not\n if i % 3 == 0 || i % 5 == 0 then multiples << i end\n end\n multiples\nend",
"def collect_multiples(limit)\n multiples = []\n\n for i in 1...limit do\n if (i % 5 == 0 || i % 3 == 0)\n multiples << i\n end\n end\n\n return multiples\n\nend",
"def collect_multiples(limit)\n 1.upto(limit-1).find_all do |i| #limit-1 so it takes range from 1 upto limit, excluding limit (so if limit is 10, range will be 1-9)\n (i % 5 == 0) || (i % 3 == 0)\n end #end loop\nend",
"def collect_multiples(limit)\n (1...limit).select {|e| e%3 == 0 || e%5 ==0}\nend",
"def collect_multiples(limit)\n #numbers = [1..(limit-1)]\n multiple_numbers = []\n (1..(limit-1)).map do |number|\n if number % 3 == 0 || number % 5 == 0\n multiple_numbers << number\n end\n end\n multiple_numbers\nend",
"def collect_multiples(limit)\n array = []\n (1...limit).each do |num|\n array << num if (num % 3 == 0) || (num % 5 == 0)\n end\n array\nend",
"def multiple_of_three_and_five(limit)\r\n (3...limit).select { |number| number % 3 == 0 || number % 5 ==0 }.inject(:+)\r\nend",
"def collect_multiples\n (1..@limit).select{|num| num%3 == 0 || num%5 == 0}\n end",
"def collect_multiples(num)\n range = (3...num)\n multiples = []\n range.each do |num|\n if num % 3 == 0 || num % 5 == 0\n multiples << num\n end\n end\n multiples\nend",
"def multiples_3_5_v1\n\tmultiples = (1...1000).find_all do |i| \n\t\ti % 3 == 0 || i % 5 == 0\n\tend\n\n\tanswer = multiples.inject do |memo, num|\n\t\tmemo + num\n\tend\n\n\treturn answer\nend",
"def collect_multiples(limit)\n (1...limit).to_a.reject {|num| num unless num % 3 == 0 || num % 5 == 0}\nend",
"def multisum(limit)\n multiples = []\n\n for num in 1..limit\n multiples << num if num % 3 == 0 || num % 5 == 0\n end\n\n multiples.inject(:+)\nend",
"def collect_multiples(limit)\n (1...limit).to_a.select{|i| i % 3 == 0 || i % 5 == 0}\nend",
"def collect_multiples(limit)\n array=*(1...limit)\n array.select {|num| num % 3 == 0 || num % 5 ==0}\nend",
"def sum_multiples(limit)\n(3...limit).find_all {|n| n % 3 == 0 || n % 5 == 0}.inject(:+)\nend",
"def multiples_three_five(max_number)\n sum = 0\n max_number = max_number - 1\n (0..max_number).each do |number|\n if number % 3 == 0 || number % 5 == 0\n sum = sum + number\n end\n end\n return sum\nend",
"def problem1 limit\n (0...limit).map {|n| (n%3==0 || n%5==0) ? n : 0 }.reduce(:+)\nend",
"def collect_multiples(number)\n \n numbers = Array.new(number - 1, 0)\n count = 0\n while count < numbers.length \n numbers[count] = count + 1\n count += 1\n end\n\n numbers.select do |element|\n element % 3 == 0 || element % 5 == 0\n end\n\nend",
"def get_multiples(max)\n\tmot = (1..max_limit(max, 3)).map { |a| a*3 }\n\tmo5 = (1..max_limit(max, 5)).map { |a| a*5 }\n\t(mot + mo5).uniq.inject(0, :+)\nend",
"def sum_of_multiples_3_5_below(n)\n (1...n).select {|x| x%3==0 || x%5==0}.inject(&:+)\nend",
"def multiples_of_3_and_5(number)\n (1...number).select{|num| num % 3 == 0 || num % 5 == 0}.inject(:+)\nend",
"def find_multiples(number)\n sum_of_multiples = (3...number).each_with_object([]) do |element, list|\n list << element if element % 3 == 0 || element % 5 == 0\n end.sum\nend",
"def sum_of_3_and_5_multiples(nbr)\n nbr_a = (1...nbr).to_a\n ls35 = nbr_a.select { |x| (x % 3).zero? || (x % 5).zero? }\n if nbr % 1 != 0 || nbr < 0 # conditiions pour les entiers relatifs\n return 'I said natural number only idiot!'\n elsif nbr > 1000 # pour ne pas calculer les > 1000\n return 'too high!'\n else\n return ls35.sum\n end\nend",
"def multiples\n\t\t#select all numbers from 3-999 using iterator i...\n\t\t(3..999).select do |i|\n\t\t\t#...that are divisible by 3 or divisible by 5\n\t\t\ti%3 == 0 || i%5 == 0\n\t\tend\n\tend",
"def multiples(num)\n (1...num).select { |n| n % 3 == 0 || n % 5 == 0 }.inject(:+)\nend",
"def multiples(n)\n (1...n).select do |num|\n num if (num % 3).zero? || (num % 5).zero?\n end.reduce(:+)\nend",
"def multiples_of_3_and_5\r\n total = 0\r\n (3...1000).each do |x|\r\n if x % 3 == 0 || x % 5 == 0\r\n # puts x\r\n total += x\r\n end\r\n end\r\n total\r\nend",
"def multiples\n (1..999).select do |i|\n i % 3 == 0 || i % 5 == 0\n end\nend",
"def multiples_3_5_v2\n\tsum = 0\n\n\t1.upto(999) do |i|\n\t\tif i % 3 == 0 || i % 5 == 0\n\t\t\tsum = sum + i\n\t\tend\n\tend\n\n\treturn sum\nend",
"def multiples(number)\n number_array = Array(1..number)\n multiples_array = []\n\n number_array.each do |num|\n if num % 3 == 0 || num % 5 == 0\n multiples_array << num\n end\n end\n multiples_array.inject(:+)\nend",
"def collect_multiples(limit)\n numbers = (1..limit-1).to_a\n result= numbers.select do |num|\n num % 5 == 0 || num %3 == 0\n end\n# binding.pry\n result\nend",
"def multiples_of_three_and_five(number)\n total = 0\n\n (1..(number - 1)).each { |n| total += n if n % 3 == 0 || n % 5 == 0 }\n \n return total\nend",
"def solution(max_num)\n (1...max_num).select { |number| number % 3 == 0 || number % 5 == 0 }.reduce(:+)\nend",
"def multiples(input)\n (1..input).select { |num| (num % 3).zero? || (num % 5).zero? }.reduce(:+)\nend",
"def find_multiples(integer)\n arr = (1..integer).to_a\n multiples = []\n\n arr.each do |val|\n if (val % 3).zero? || (val % 5).zero?\n multiples.push(val) # mutates original array\n end\n end\n multiples\nend",
"def find_sum_of_multiples_of_3_and_5_below_1000\n answer = 0\n for number in 1...1000\n answer += number if number % 3 == 0 || number % 5 == 0\n end\n answer\nend",
"def multisum(limit)\n nums = []\n 1.upto(limit) { |num| nums << num if (num % 3 == 0 || num % 5 == 0)}\n nums.sum\nend",
"def crazy_nums(max)\n res = []\n idx = 3\n while idx < max\n if (idx % 3 == 0 || idx % 5 == 0) && idx % 15 != 0\n res.push(idx)\n end\n idx += 1\n end\n return res\nend",
"def find_multiples_of_3_or_5_below_x x\n sum = 0\n n = 3\n while n < x\n sum += n\n n += 3\n end\n n = 5\n while n < x\n sum += n if n % 3 != 0\n n += 5\n end\n sum\nend",
"def multiples(number)\n number_array = Array(1..number)\n multiples_array = []\n\n number_array.each do |num|\n if num % 3 == 0 || num % 5 == 0\n multiples_array << num\n end\n end\n multiples_array.sum\nend",
"def multiples_3_and_5 (top_range_num)\n three_five_array = []\n i = 1\n while i < top_range_num\n if i%3 == 0\n three_five_array.push(i)\n elsif i%5 == 0\n three_five_array.push(i)\n end\n i += 1\n end\n three_five_array = three_five_array.uniq\n sum = three_five_array.inject {|total, x| total + x}\n puts sum\nend",
"def sum_multiples_of_3_or_5\n (1..999).to_a.select { |n| n.multiple_of?(3) or n.multiple_of?(5) }.inject(&:+)\nend",
"def multisum(limit)\n (1..limit).select { |num| (num % 3).zero? || (num % 5).zero? }.sum\nend",
"def natural_method(limit, number_multiple1, number_multiple2)\n\tarray = []\n\t(1..limit).each do |number|\n\t\tif (number % number_multiple1 == 0) || (number % number_multiple2 == 0)\n\t\t\tarray << number \n\t\tend\n\tend\n\tputs sum(array)\nend",
"def multiples\n numbers = (1...1000)\n sum = 0\n\n numbers.each do |num|\n sum += num if num % 5 == 0 || num % 3 == 0\n end\n sum\nend",
"def sum_of_multiples(min,max)\n natural_set = (min...max).to_a\n multiples = natural_set.select { |n| (n % 3 == 0) or (n % 5 == 0) }\n sum = multiples.reduce(&:+)\n puts \"Sum of natural numbers between #{min} and #{max} that are divisible by 3 or 5 is #{sum}\"\n sum\nend",
"def multiples_of_three_and_five(limit)\n arr = []\n i = 1\n\n while i < limit do\n if i % 5 == 0 || i % 3 == 0\n arr << i\n i += 1\n else\n i += 1\n end\n # puts $arr.inspect\n end\n\n arr_size = arr.count\n # puts arr_size\n total = 0\n i = 0\n\n while i < arr_size do\n total += arr[i]\n i += 1\n end\n\n return total\nend",
"def multiples(factors, max)\n 1.upto(max).select { |i| factors.any? { |f| i % f == 0 } }\nend",
"def threefive(num)\n\n if num < 1 || num > 100\n return \"Number must be between 1-100\"\n end\n mult_arr = []\n mult_arr << 0\n i = 0\n\n while num > i\n if (i % 3) == 0\n mult_arr << i\n elsif (i % 5) == 0\n mult_arr << i\n end\n i += 1\n end\n return mult_arr.inject{|sum,n| sum + n}\n\nend",
"def multisum(max_value)\n (1..max_value).select {|num| num % 3 == 0 || num % 5 == 0}.reduce(:+)\nend",
"def find_multiples (cap)\n\tsum = 0\n\t(0..(cap-1)).each {|num| sum += num if (num % 3 == 0 || num % 5 == 0) }\n\n\treturn sum\nend",
"def sum_of_multiples(n)\n multiples_of_3_or_5 = []\n for i in 1..n\n if i % 3 == 0 || i % 5 == 0\n multiples_of_3_or_5 << i\n end\n end\n multiples_of_3_or_5.sum\nend",
"def multiples(n, max)\n i = 1\n add = []\n loop do\n add << i * n\n i += 1\n add.last >= max && add.pop && break\n end\n p add\nend",
"def multisum(number)\n (1..number).select { |multiple| multiple % 3 == 0 || multiple % 5 == 0 }.inject(:+)\nend",
"def sum_of_3_or_5_multiples(n)\n n = n.to_i\n #compteur de boucle\n i = 0\n #tableu incluant les multiple de 3 et 5\n result_array = []\n while i < n\n a = i%3\n b = i%5\n if a == 0 || b == 0\n result_array << i\n i+=1\n else\n i+=1\t\n end\n \n end\n sum = 0\n result_array.each do |p|\n \t sum = sum + p\n end\n return sum \nend",
"def multiples_up_to(limit, divisor, multiples_to_limit=[])\n if limit < 1\n return multiples_to_limit\n end\n multiple = limit - (limit % divisor)\n multiples_to_limit << multiple\n multiple -= divisor\n multiples_up_to(multiple, divisor, multiples_to_limit) \nend",
"def sum_of_multiples\n list_of_multiples = [ ]\n 1000.times do |number| \n list_of_multiples << number if number % 3 == 0 || number % 5 == 0\n end\n list_of_multiples.inject(&:+)\nend",
"def sum_of_multiples\n multiples_of_three_or_five = []\n\n for n in 3...1000\n if n % 3 == 0\n multiples_of_three_or_five.push(n)\n end\n end\n\n for n in 5...1000\n if n % 5 == 0\n unless multiples_of_three_or_five.include?(n)\n multiples_of_three_or_five.push(n)\n end\n end\n end\n\n sum = multiples_of_three_or_five.inject { |sum, x| sum + x }\n return sum\nend",
"def sum_multiples\n @sum35 = (1..@limit).select{|num| num%3 == 0 || num%5 == 0}\n @sum35 = @sum35.reduce(:+)\n @sum35\n end",
"def mult_3_5\n\n p=0\n for x in 1..999 do \n if (x % 3 == 0) || (x % 5 == 0)\n p += x\n end\n end\n return p\nend",
"def solution(number)\n [*1...number].select {|n| (n % 3 == 0) or (n % 5 == 0)}.sum\nend",
"def sum_of_multiples(n)\n (1...n).select{ |n| n % 3 == 0 || n % 5 == 0 }.inject(:+)\nend",
"def primes_under(n)\n candidates = (3..n).step(2).to_a\n primes = [2]\n\n until primes.last > n ** 0.5\n primes << candidates.shift\n candidates.reject! {|candidate| candidate % primes[-1] == 0}\n end\n\n primes + candidates\nend",
"def problem_five\n (1..20).reduce(1) { |res, n| res.lcm n }\n end",
"def mult(number)\n (1..number).select { |i| i % 3 == 0 || i % 5 == 0 }.inject(:+)\nend",
"def solution(number)\n return (0...number).select{ |x| ((x % 3 == 0) || (x % 5 == 0))}.reduce(:+)\nend",
"def solution(int)\n multiples_3 = []\n multiples_5 = []\n threes = 3\n fives = 5\n \n until threes >= int\n multiples_3 << threes\n threes += 3\n end\n until fives >= int\n multiples_5 << fives\n fives += 5\n end\n \n (multiples_3 | multiples_5).sum\nend",
"def multisum(num)\n multiples = []\n 1.upto(num) do |x| \n if x % 3 == 0 || x % 5 == 0\n multiples << x\n end\n end\n multiples.inject(:+)\nend",
"def multisum(num)\n arr = [*1..num]\n multiples_3_5 = arr.select{ |ele| ele % 3 == 0 || ele % 5 == 0}\n multiples_3_5.sum\nend",
"def solution(number)\r\n (3...number).each_with_object([]) { |n, arr| arr << n if (n % 3).zero? || (n % 5).zero? }.uniq.sum\r\nend",
"def sum_multiples_of_3_and_5(num)\n arr = Array(0..(num-1))\n keep = arr.select do |n|\n n % 3 == 0 || n % 5 == 0\n end\n puts keep.reduce(:+)\nend",
"def multisum(number)\n multiples = (1..number).select do |num|\n num % 3 == 0 || num % 5 == 0\n end\n\n multiples.inject(:+)\nend",
"def multiple()\n\tresult = 0\n\t\tfor i in 1...1000\n\t\t\tif i%3 == 0 || i%5 == 0\n\tresult += i\n\t\t\tend\n\t\tend\n\treturn result\nend",
"def sum_multiple(limit, * numbers )\n (2..limit).to_a.find_all{ |x| numbers.any? {|n| x % n == 0 or x % n == 0} }.reduce(:+)\nend",
"def is_multiple(n)\n if n % 3 == 0\n return true;\n end\n if n % 5 == 0\n return true;\n end\nend",
"def sum_of_multiples(max, a, b)\n (1..max).select { |i| i % a == 0 || i % 5 == 0 }.reduce(:+)\nend",
"def sum_of_multiples_of_three_and_five(n)\r\n (1...n).to_a.select{|x| x % 3 == 0 || x % 5 == 0 }.reduce(:+)\r\nend",
"def problem_5(lower_limit, upper_limit)\n searching = true\n numerator = upper_limit\n while searching == true\n numerator += 2\n searching = false\n (lower_limit..upper_limit).each do |denominator|\n searching = true unless numerator % denominator == 0\n end\n end\n return numerator\nend",
"def getMultpiles(range)\n\tmultiples = []\n\tfor i in 3...range\n\t\tif i % 3 == 0 || i % 5 == 0\n\t\t\tmultiples << i\n\t\tend\n\tend\n\treturn multiples\nend",
"def multisum(number)\n multiples = (1..number).select { |x| (x % 3 == 0) || (x % 5 == 0) }\n multiples.reduce(:+)\nend",
"def print_list(limit)\n\n 1.upto(limit) do |number|\n\n if divisible_by?(15, number)\n puts \"Fizzbuzz\"\n\n elsif divisible_by?(3, number)\n puts \"Fizz\"\n\n elsif divisible_by?(5, number)\n puts \"Buzz\"\n\n else\n puts number\n\n end\n end\nend",
"def multiples_x(number, multiple)\n current_multiple = multiple\n multiples = []\n\n while current_multiple <= number\n multiples << current_multiple\n current_multiple += multiple\n end\n\n multiples\nend",
"def solution(number)\n sum = 0\n multipliers = (1..number-1).select {|x| x % 3 == 0 or x % 5 == 0}\n print multipliers\n multipliers.inject do |sum, x|\n sum + x\n end\nend",
"def amicable_numbers(max)\n (1...max).select do |num|\n divisors(num) && num == divisors(divisors(num)) && num != divisors(num)\n end\nend",
"def solution(number)\n return 0 if number < 3\n result = 0\n count = 3\n \n until count > number\n if count % 3 == 0 || count % 5 == 0\n result += count \n end\n count += 1\n end\n \n result\nend",
"def multiples(num)\n\tresult = []\n\tsum = 0\n\ti = 1\n\twhile i < num\n\t\tif i % 3 == 0 || i % 5 == 0\n\t\t\tresult << i\n\t\tend\n\t\ti += 1\n\tend\n\tresult.each do |digit|\n\t\tsum += digit\n\tend\n\tsum\t\nend",
"def divisible_by_5_and_3\n numbers = (1..100).to_a # this will create an array from 1 to 100. Check the Range class from Ruby - https://ruby-doc.org/core-2.5.1/Range.html\n\n numbers.select { |number| number % 3 == 0 && number % 5 == 0 }\nend",
"def smallest_multiple\n results = []\n values = (1..300000000).to_a\n\n values.each do |value|\n if value % 20 == 0 &&\n value % 19 == 0 &&\n value % 18 == 0 &&\n value % 17 == 0 &&\n value % 16 == 0 &&\n value % 15 == 0 &&\n value % 14 == 0 &&\n value % 13 == 0 &&\n value % 12 == 0 &&\n value % 11 == 0 &&\n value % 10 == 0 &&\n value % 9 == 0 &&\n value % 8 == 0 &&\n value % 7 == 0 &&\n value % 6 == 0 &&\n value % 5 == 0 &&\n value % 4 == 0 &&\n value % 3 == 0 &&\n value % 2 == 0\n results << value\n end\n\n end\n results\nend",
"def multiples_array(integer)\n multiples = []\n for i in 1..integer\n if i % 3 == 0 || i % 5 == 0\n multiples << i\n end\n end\n multiples\nend",
"def sum_multiples_3_and_5(number)\n\tsum = 0\n\t(1...number).each do |x|\n\t\tif x % 3 == 0\n\t\t\tsum += x\n\t\telsif x % 5 == 0\n\t\t\tsum += x\n\t\tend\n\tend\n\tsum\nend",
"def multiples\n sum = (1..999).select {|num| num % 3 == 0 || num % 5 == 0}.reduce(:+)\n puts sum\nend",
"def solution(number)\n (1..number-1).select{|x| x%3==0 || x%5 ==0 }.reduce(:+)\nend",
"def multiples(n)\n until (n % 3 == 0) || (n % 5 == 0)\n n -= 1\n end\n # base case\n return 3 if n == 3\n # recursive case\n n + multiples(n-1)\nend",
"def sum_multiples_of_3_and_5(range)\n range.select { |n| n % 3 == 0 || n % 5 == 0 }.inject(:+)\nend",
"def fizzBuzz2(max)\n sol = []\n\n (1...max).each do |num|\n if !(num % 5 == 0 && num % 3 == 0) && (num % 5 == 0 || num % 3 == 0)\n sol << num\n end\n end\n\n sol\nend",
"def sum_of_multiples_of_three_and_five(num)\n\ta = sum_of_first_n_multiples(3, (1000/3))\n\tb = sum_of_first_n_multiples(5, (1000/5))\n\tc = sum_of_first_n_multiples(15, (1000/15))\n\treturn (a + b - c - 1000)\nend",
"def at_least_n_factors(numbers, n)\n numbers.select{|num|num_factors(num)>=n}\nend",
"def p005(upper_bound = 20)\n # This builds on the idea that any value which is a multiple of another value can be used instead of it\n # Also that the lowest common multiple is a product of the minimal set of prime-multiples that cover the factors\n # So e.g. the lowest common multiple of 1..6 would be 5 x 2 x 2 x 3 = 60, where 2 appears twice because 2 x 2 = 4\n required_factors = (2..upper_bound).to_a\n required_primes = {}\n required_factors.each do |factor|\n required_primes.merge!(Prime.prime_division(factor).to_h) do |_prime_factor, old_multiple, new_multiple|\n [old_multiple, new_multiple].max\n end\n end\n required_primes.reduce(1) { |common_multiple, prime_multiple| common_multiple * prime_multiple[0]**prime_multiple[1] }\nend",
"def divisible_by_5_and_3\n numbers = (1..100).to_a # this will create an array from 1 to 100. Check the Range class from Ruby - https://ruby-doc.org/core-2.5.1/Range.html\nend"
] |
[
"0.7995934",
"0.7860386",
"0.7824288",
"0.7802197",
"0.7740848",
"0.7726163",
"0.7702223",
"0.76687694",
"0.763893",
"0.76187193",
"0.75940394",
"0.75856316",
"0.7561259",
"0.7499732",
"0.74889857",
"0.73814625",
"0.7367339",
"0.7303635",
"0.72721547",
"0.7257886",
"0.72504795",
"0.72285604",
"0.7196926",
"0.7181676",
"0.71760523",
"0.71650636",
"0.7152618",
"0.7065635",
"0.7065429",
"0.7030368",
"0.70189285",
"0.70010084",
"0.69813097",
"0.69768226",
"0.69552827",
"0.69316965",
"0.6927617",
"0.6915283",
"0.69130456",
"0.69121796",
"0.6911432",
"0.6897228",
"0.688951",
"0.68830544",
"0.68815976",
"0.6842252",
"0.68225116",
"0.6802252",
"0.6788676",
"0.67608744",
"0.67602575",
"0.6755538",
"0.6746696",
"0.67128634",
"0.67006224",
"0.6696545",
"0.66963786",
"0.6667017",
"0.6664404",
"0.66396713",
"0.6627022",
"0.6615383",
"0.6607226",
"0.66068",
"0.6606372",
"0.6604911",
"0.66045773",
"0.65993255",
"0.6592067",
"0.65880865",
"0.6572548",
"0.6565617",
"0.6564578",
"0.6560191",
"0.6556772",
"0.6555439",
"0.6543895",
"0.6543128",
"0.65282935",
"0.652652",
"0.651842",
"0.65145373",
"0.6509212",
"0.65077925",
"0.6505021",
"0.650074",
"0.6498187",
"0.64956796",
"0.6471299",
"0.6469657",
"0.64343065",
"0.6426914",
"0.64245814",
"0.6413053",
"0.6413052",
"0.64081794",
"0.6398917",
"0.63753414",
"0.6373489",
"0.6371337"
] |
0.7851614
|
2
|
returns correct sum of multiples of 10
|
def sum_multiples(limit)
multiples = collect_multiples(limit)
# return multiples.sum
return multiples.inject(0){|sum,n| sum + n }
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def sumdig_r(n)\n\n # puts \"#{n} and n /10 is #{n/10} and n%10 is #{n%10}\"\n\n if (n<10) \n return n\n else\n return n%10 + sumdig_r(n/10)\n end\nend",
"def sumdig_r(n)\n return n if n < 10\n (n%10) + sumdig_r(n/10)\nend",
"def modulo_10_method\n if @summed_array % 10 == 0\n true\n else\n false\n end\n end",
"def problem_80(size = 100)\n total = 0\n (2..100).each do |n|\n n,d = n.sqrt_frac(2*size)\n next unless n\n r = n * (10 ** (size * 1.1).to_i) / d\n r = r.to_s[0,size].split(//).map(&:to_i).reduce(&:+)\n total += r\n# puts r.inspect\n end\n total\nend",
"def sum3(integer)\n if integer < 10\n integer % 10\n else\n integer % 10 + sum(integer / 10)\n end\nend",
"def sum_multiples_3_and_5\n return 3 * 333 * 334 / 2 + 5 * 199 * 200 / 2 - 15 * 66 * 67 / 2\nend",
"def problem_80b(size = 100)\n total = 0\n (2..100).each do |n|\n r = n.sqrt_digits(size+1)\n next if r.length == 1\n r = r[0,size].reduce(&:+)\n total += r\n# puts \"#{n} #{r.inspect}\"\n end\n total\nend",
"def ten\n acc = 0\n (find_primes_below 2000000).each do |i|\n acc = acc + i\n end\n return acc \nend",
"def substracts_from_next_ten(input)\n output = 10 - input % 10\n output = 0 if output == 10\n output\n end",
"def digital_root(n)\n p '--- Jan-09-2017 problem2 --- '\n n = n.to_s.chars.map(&:to_i).reduce(:+) until n < 10\n n\nend",
"def digital_root(number)\n while number >= 10 do\n number = _digital_root_sum(number)\n end\n number\nend",
"def sum_func(n)\n if n / 10 == 0\n return n\n else\n return n % 10 + sum_func(n/10)\n end\nend",
"def sum_of_multiples_of_three_and_five(num)\n\ta = sum_of_first_n_multiples(3, (1000/3))\n\tb = sum_of_first_n_multiples(5, (1000/5))\n\tc = sum_of_first_n_multiples(15, (1000/15))\n\treturn (a + b - c - 1000)\nend",
"def modulo(digit_sum)\n digit_sum % 10 == 0\n end",
"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 digital_root(n)\r\n while n > 9\r\n n = n.digits.inject(:+)\r\n end\r\n n\r\nend",
"def digital_root(num)\n return num if num < 10\n i = 1\n sum = 0\n while 10 ** (i - 1) <= num\n sum += num % (10 ** i) / (10 ** (i - 1))\n i += 1\n end\n\n return digital_root(sum)\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 digital_root(n)\n n < 10 ? n : digital_root(n / 10 + n % 10)\nend",
"def closest_multiple_10(i)\n i.round(-1)\nend",
"def multiples_of_3_and_5\r\n total = 0\r\n (3...1000).each do |x|\r\n if x % 3 == 0 || x % 5 == 0\r\n # puts x\r\n total += x\r\n end\r\n end\r\n total\r\nend",
"def near_ten(num)\n total = (num/100 % 10) + (num/10 % 10) + (num % 10)\n remainder = total % 10\n if remainder <= 2 || remainder >= 8\n puts \"True\"\n elsif remainder <= 5\n puts \"10の倍数との差は#{remainder}です\"\n else \n puts \"10の倍数との差は#{10 - remainder}です\"\n end\nend",
"def digital_root(num)\n while num >= 10\n num = digit_sum(digits(num))\n end\n num\nend",
"def sum_func(num)\n return num if num <= 1\n\n divided = num / 10\n moded = num % 10\n\n moded + sum_func(divided)\nend",
"def digital_root(num)\n# sum variable \n# while loop => num > 0 \n# mod 10 add that to the sum var \n# div num by ten and reassign to num \n# check if sum >= 10 => digital_root(newNum) => return this\n\n sum = 0\n while num > 0 \n sum += num % 10 \n num /= 10\n end\n\n if sum >= 10 \n digital_root(sum)\n else \n sum \n end \nend",
"def sum_of_multiples\n list_of_multiples = [ ]\n 1000.times do |number| \n list_of_multiples << number if number % 3 == 0 || number % 5 == 0\n end\n list_of_multiples.inject(&:+)\nend",
"def problem_ten\n Prime.instance.each(2_000_000).reduce(&:+)\n end",
"def mul10pow(mul, pow)\n\t(1..pow).inject(1) { |prod| (prod*mul)%10000000000}\nend",
"def brut_force_solution\n (1...1000).inject(0){|sum, digit| ((digit % 3 == 0) || (digit % 5 == 0)) ? sum += digit : sum}\nend",
"def if_over_ten_split_digits_then_sum_digits(credit_card_number)\n double_every_other_number(credit_card_number).map.with_index do |num,index|\n if index.even?\n num\n else\n if num > 9\n num = num.to_s.chars\n\n new_num = num.map do |n|\n n.to_i\n end\n new_num.sum\n\n else\n num\n end\n end\n end\n end",
"def digital_root(num)\n array = []\n\n until num == 0\n array << num % 10\n num = num / 10\n end\n result = array.inject(:+)\n\n if result > 9\n digital_root(result)\n else\n result\n end\nend",
"def divisible_by_ten?(number)\n number % 10 === 0\nend",
"def sumdigit_r(num)\n if num < 10\n num\n else\n sumdigit_r(num/10) + num % 10\n end\nend",
"def digital_root(num)\n return num if num < 10\n \n sum = digital_root(num/10) + (num % 10)\n \n if sum > 10\n sum = digital_root(sum)\n else\n sum\n end\nend",
"def sum_multiples\n sum = 0\n\n (1...1000).each do |n|\n sum += n if n % 3 == 0 || n % 5 == 0\n end\n\n sum\nend",
"def sum_digits(n)\n return n if n <= 9\n n % 10 + sum_digits(n / 10)\nend",
"def digital_root(n)\n n < 10 ? n : digital_root(n.digits.sum)\nend",
"def div_ten num\n div_n(10, num)\nend",
"def digital_root_best(n)\r\n n < 10 ? n : digital_root_best(n/10 + n%10)\r\nend",
"def modulo_10_method(summed_array, card_number)\n if summed_array % 10 == 0\n \"The number #{card_number} is valid!\"\n else\n \"The number #{card_number} is invalid!\"\n end\nend",
"def find_sum_of_multiples_of_3_and_5_below_1000\n answer = 0\n for number in 1...1000\n answer += number if number % 3 == 0 || number % 5 == 0\n end\n answer\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_of_3_and_5_multiples(nbr)\n nbr_a = (1...nbr).to_a\n ls35 = nbr_a.select { |x| (x % 3).zero? || (x % 5).zero? }\n if nbr % 1 != 0 || nbr < 0 # conditiions pour les entiers relatifs\n return 'I said natural number only idiot!'\n elsif nbr > 1000 # pour ne pas calculer les > 1000\n return 'too high!'\n else\n return ls35.sum\n end\nend",
"def multisum(number)\n (0..number).reduce { |sum, n| n % 5 == 0 || n % 3 == 0 ? sum + n : sum }\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 multisum(integer)\n total = 0\n (1..integer).each do |num|\n total += num if (num % 3 ==0) || (num % 5 == 0)\n end\n total\nend",
"def main\n max = 10 ** 9 + 7\n all = 1\n zero = 1\n nine = 1\n zn = 1\n N.times.each do\n all = all * 10 % max\n zero = zero * 9 % max\n nine = nine * 9 % max\n zn = zn * 8 % max\n end\n return (all - zero - nine + zn) % max\nend",
"def multiples_sums(int)\n sum = 0\n (1...int).to_a.each do |x|\n \tif x % 3 == 0 || x % 5 == 0\n \t\tsum += x.to_int\n \tend\n end\n sum\nend",
"def total\n (1..64).reduce { |sum, space_number| sum + square(space_number) }\n end",
"def digital_root(num)\n reductions = []\n\n if num < 10\n return num\n elsif num < 19\n until num < 10 \n reductions << (num / 10)\n num -= 1\n end\n reduced = reductions.reduce(:+)\n else\n num = num / 10\n reductions = []\n digital_root(num)\n end\n\nend",
"def multiples\n numbers = (1...1000)\n sum = 0\n\n numbers.each do |num|\n sum += num if num % 5 == 0 || num % 3 == 0\n end\n sum\nend",
"def digital_root(num)\n\n total = digital_root_step(num)\n until total < 10\n total = digital_root_step(total)\n end\n total\nend",
"def run\n (3...1000).inject(0){|sum, num| (num % 3 == 0 || num % 5 == 0) ? sum += num : sum }\nend",
"def digit_factorials\r\n\tanswer = 0\r\n\t# Find upper bound for calculations. Since 9!*7 has seven digits and 9!*8 has seven digits, we use 9!*7\r\n\tlimit = (1..9).inject(:*)*7\r\n\t(10..limit).each do |x|\r\n\t\tputs x\r\n\t\tsum = 0\r\n\t\tnumber = x\r\n\t\t# Cycle through all digits of the number\r\n\t\twhile number > 0\r\n\t\t\t# Add factorial of digit to sum unless digit is 0, then add 1 because 0! is 1\r\n\t\t\tnumber%10 == 0 ? sum += 1 : sum += (1..number%10).inject(:*) \r\n\t\t\tnumber /= 10\r\n\t\tend\r\n\t\t# Add sum to answer if sum is equal to number\r\n\t\tanswer += sum if sum == x\r\n\tend\r\n\tputs answer\r\nend",
"def digital_root(number)\n return number if number < 10\n\n digital_root((number / 10) + (number % 10))\nend",
"def digit_sum(array)\n array.map { |n| n >= 10 ? n / 10 + n % 10 : n }\n end",
"def digital_root(num)\n return num if num < 10\n sum = 0\n sum += num % 10 + digital_root(num / 10)\n\n if sum > 10\n digital_root(sum)\n else\n sum\n end\n end",
"def SumDivisibleBy(n, target = 999)\n p = target / n\n return n*(p*(p+1)) / 2\nend",
"def sumOf(n)\n i = 0\n multiples = []\n while i < n do\n if i % 3 == 0 || i % 5 == 0\n multiples.push(i)\n end\n i += 1\n end\n multiples.inspect\n multiples.reduce(:+)\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_multiples(multiple, to)\n n = (to-1) / multiple\n n * (n+1) / 2 * multiple\nend",
"def sum_multiples()\n index = sum = 0\n while index < 1000\n sum += index if index%3 == 0 || index%5 == 0\n index+=1\n end\n sum\nend",
"def digital_sum(int)\n\tif int.div(10) == 0\n\t\treturn int.modulo(10)\n\telse\n\t\treturn int.modulo(10) + digital_sum(int.div(10))\n\tend\nend",
"def digital_root_alt(n)\n n < 10 ? n : digital_root(n.digits.sum)\nend",
"def sum_of_multiples\n multiples_of_three_or_five = []\n\n for n in 3...1000\n if n % 3 == 0\n multiples_of_three_or_five.push(n)\n end\n end\n\n for n in 5...1000\n if n % 5 == 0\n unless multiples_of_three_or_five.include?(n)\n multiples_of_three_or_five.push(n)\n end\n end\n end\n\n sum = multiples_of_three_or_five.inject { |sum, x| sum + x }\n return sum\nend",
"def sum(i)\n sum = i.digits.reduce(:+)\n sum\nend",
"def sum_of_multiples(x, n)\n multiples_count = n/x\n x * ((n/x) * ((n/x)+1)/2)\nend",
"def sum_of_power(p)\n result = []\n powers = 0.upto(10).map {|n| n**p}\n 2.upto(p.get_max_num) do |i|\n num = i.get_base_array(10).map {|n| powers[n]}\n if i == num.inject(0) {|t,n| t + n}\n result << i\n end\n end\n return result\nend",
"def checksum\n (10 - (digits.each_with_index.inject(0) do |sum, (digit, index)|\n sum + (digit * (index.even? ? 1 : 3))\n end % 10)) % 10\n end",
"def sum(n=16) end",
"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 multiples_three_five(max_number)\n sum = 0\n max_number = max_number - 1\n (0..max_number).each do |number|\n if number % 3 == 0 || number % 5 == 0\n sum = sum + number\n end\n end\n return sum\nend",
"def div10( context )\n s = \"div_10 \"\n compiler = compiler_for(:Integer,:div10 ,{})\n builder = compiler.builder(compiler.source)\n integer_tmp = builder.allocate_int\n builder.build do\n integer_self! << message[:receiver]\n integer_self.reduce_int\n integer_1! << integer_self\n integer_reg! << integer_self\n\n integer_const! << 1\n integer_1.op :>> , integer_const\n\n integer_const << 2\n integer_reg.op :>> , integer_const\n integer_reg.op :+ , integer_1\n\n integer_const << 4\n integer_1 << integer_reg\n integer_reg.op :>> , integer_1\n\n integer_reg.op :+ , integer_1\n\n integer_const << 8\n integer_1 << integer_reg\n integer_1.op :>> , integer_const\n\n integer_reg.op :+ , integer_1\n\n integer_const << 16\n integer_1 << integer_reg\n integer_1.op :>> , integer_const\n\n integer_reg.op :+ , integer_1\n\n integer_const << 3\n integer_reg.op :>> , integer_const\n\n integer_const << 10\n integer_1 << integer_reg\n integer_1.op :* , integer_const\n\n integer_self.op :- , integer_1\n integer_1 << integer_self\n\n integer_const << 6\n integer_1.op :+ , integer_const\n\n integer_const << 4\n integer_1.op :>> , integer_const\n\n integer_reg.op :+ , integer_1\n\n integer_tmp[Parfait::Integer.integer_index] << integer_reg\n message[:return_value] << integer_tmp\n\n end\n\n compiler.add_mom( Mom::ReturnSequence.new)\n return compiler\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 sum_multiples(limit)\n(3...limit).find_all {|n| n % 3 == 0 || n % 5 == 0}.inject(:+)\nend",
"def multiples_3_5_v2\n\tsum = 0\n\n\t1.upto(999) do |i|\n\t\tif i % 3 == 0 || i % 5 == 0\n\t\t\tsum = sum + i\n\t\tend\n\tend\n\n\treturn sum\nend",
"def calculate_check_digit\n sum = digits.first(12).each_with_index.sum do |digit, index|\n index.even? ? digit : (digit * 3)\n end\n remainder = sum % 10\n remainder.zero? ? remainder : (10 - remainder)\n end",
"def super_digit(n)\n return n if n < 10\n\n return super_digit(n.digits.sum)\nend",
"def multiples_of_three_and_five(number)\n total = 0\n\n (1..(number - 1)).each { |n| total += n if n % 3 == 0 || n % 5 == 0 }\n \n return total\nend",
"def super_digit(n)\n\n return n if n < 10\n super_digit(n.digits.sum)\n\nend",
"def sum_of_3_or_5_multiples(n)\n n = n.to_i\n #compteur de boucle\n i = 0\n #tableu incluant les multiple de 3 et 5\n result_array = []\n while i < n\n a = i%3\n b = i%5\n if a == 0 || b == 0\n result_array << i\n i+=1\n else\n i+=1\t\n end\n \n end\n sum = 0\n result_array.each do |p|\n \t sum = sum + p\n end\n return sum \nend",
"def sum_up_to_squared n=100\r\n (2 * n + 1) * (n + 1) * n / 6\r\nend",
"def sum_of_mults(num)\n ary = []\n num.times do |num|\n if num % 3 == 0 || num % 5 == 0\n ary << num\n end\n num -= 1\n end\n ary.inject(:+)\nend",
"def super_digit(n)\n return n if n < 10 \n return super_digit(n.to_s.chars.map(&:to_i).sum)\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 p206\n re = /1.2.3.4.5.6.7.8.9.0/\n max = Math.sqrt(1929394959697989990).floor\n\n # Round since only squares of multiples of 30 and 70 end with 9_0 (e.g. 900)\n i = round_up Math.sqrt(1020304050607080900).floor, 100\n while i < max\n p30 = (i+30) ** 2\n p70 = (i+70) ** 2\n\n if re === \"#{p30}\"\n return \"#{i+30}^2 = #{p30}\"\n elsif re === \"#{p70}\"\n return \"#{i+70}^2 = #{p70}\"\n end\n\n i += 100\n end\nend",
"def sumOfMultiples()\n sum = 0\n 1.upto(999) do |i|\n if (i % 3 == 0) or (i % 5 == 0)\n sum += i\n end\n end\n sum\nend",
"def totient4 n\n Prime.prime_division(n).each do |factor, _|\n n = n * (factor - 1) / factor\n end\n return n\nend",
"def compute_sum_of_threes_and_fives\r\n sum = 0\r\n (1...1000).each do |n|\r\n sum += n if n % 3 == 0 || n % 5 == 0\r\n end\r\n sum\r\nend",
"def smallest_multiple\n 9*16*5*7*11*13*17*19\nend",
"def sum_multiples_of_3_or_5\n (1..999).to_a.select { |n| n.multiple_of?(3) or n.multiple_of?(5) }.inject(&:+)\nend",
"def mult_sum num\n(1...num).select{|x| x%3==0 || x%5==0}.reduce(:+)\nend",
"def sum_square_digits(q)\n sum = 0\n return 1 if q == 0\n until q == 0\n q, r = q / 10, q % 10\n sum += r*r\n end\n sum\nend",
"def twenty\n sum_of_digits(factorial(100))\nend",
"def sum_of_multiple(multiple, n)\n p = n/multiple\n return multiple*((p*(p+1))/2)\nend",
"def valid_10_digit_isbn(isbn_array)\n\t#zreo is the first digit to be multiplied im the isbn number, the count is verfiting the isbn number is a 10 or 13 digit\n isbn_number_addition_total = 0\n count_isbn = 10\n #the isbn is counted and the problem is multiplied and then added and total by digits and the multiplied by the count\n while count_isbn > 1\n\t isbn_array.each do |digits|\n\t isbn_number_addition_total = isbn_number_addition_total + (digits * count_isbn)\n\t count_isbn = count_isbn - 1\n \tend\n\tend\t \t\n #after the total is givern the it is divided by 11 with no remainder to valid the isbn, if a remainder is found the isbn is not valid\t\n \tif isbn_number_addition_total % 11 == 0\n \t\tputs \"this is a valid 10 digit isbn number\"\n \telse\n \t\tputs \"this is not a valid isbn number\"\n \tend\nend",
"def sum(n)\n n.digits.sum\nend",
"def total\n squares = (1..64).map{|i| square(i)}\n squares.inject(:+)\n end",
"def sum_with_catch\n\t# placeholder to start running total\n\ttotal = 0\n\t# create array for each item that is multiples of 3 or 5, add to total\n\t(1...1000).each do |n|\n\t\tif (n % 3 == 0) || (n % 5 == 0)\n\t\t\ttotal += n\n\t\tend\n\tend\n\t# return total\n\treturn total\nend",
"def multisum(number)\n sum = 0\n (1..number).each do |num|\n if num % 3 == 0 || num % 5 == 0\n sum += num\n end\n end\n sum\nend",
"def digital_root(num)\n until num < 10\n num = num.to_s.split(\"\")\n formatted = []\n num.each do |n|\n formatted << n.to_i\n end\n\n num = formatted.inject(:+)\n end\n num\nend"
] |
[
"0.7196691",
"0.70145065",
"0.6914927",
"0.6913369",
"0.6868571",
"0.6838614",
"0.6735893",
"0.6732372",
"0.6712404",
"0.66845804",
"0.666835",
"0.6656885",
"0.66330254",
"0.6621975",
"0.66203463",
"0.6614378",
"0.65880513",
"0.6582631",
"0.657155",
"0.6567223",
"0.65586066",
"0.65534824",
"0.6526912",
"0.6518706",
"0.6514958",
"0.6511374",
"0.6506118",
"0.6504923",
"0.6504335",
"0.64739865",
"0.6459876",
"0.6458526",
"0.6437282",
"0.6433881",
"0.64180434",
"0.6417962",
"0.6413654",
"0.63909006",
"0.6390446",
"0.63854444",
"0.63785356",
"0.6374755",
"0.6368372",
"0.63675046",
"0.6355476",
"0.6351135",
"0.6349536",
"0.6341975",
"0.6331003",
"0.63293666",
"0.6324289",
"0.63191324",
"0.6294636",
"0.628553",
"0.6283284",
"0.6281175",
"0.626003",
"0.62502635",
"0.6248442",
"0.62440854",
"0.6243372",
"0.624148",
"0.624032",
"0.6239413",
"0.62364626",
"0.6233901",
"0.62264216",
"0.622512",
"0.6211123",
"0.62041897",
"0.61968815",
"0.6191499",
"0.6189563",
"0.6186213",
"0.61828506",
"0.6182682",
"0.61768097",
"0.6176372",
"0.61755395",
"0.61743516",
"0.61672544",
"0.6165572",
"0.61641735",
"0.61621135",
"0.6150738",
"0.6140733",
"0.6140041",
"0.6137743",
"0.6133983",
"0.6133138",
"0.6127475",
"0.6124364",
"0.6123787",
"0.612329",
"0.61230713",
"0.61221325",
"0.61150044",
"0.6109487",
"0.6108611",
"0.61031765",
"0.609575"
] |
0.0
|
-1
|
Returns my accounts as Padma::Account objects
|
def padma_accounts
return nil if self.accounts.nil?
self.accounts.map{|a|PadmaAccount.new(a)}
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def accounts\n Management::Account.all(self)\n end",
"def accounts\n\t\treturn @accounts\n\tend",
"def accounts\n response = query_api(\"/rest/accounts\")\n return response[\"accounts\"].map {|account| Account.new(self, account)}\n end",
"def get_accounts\n @accounts = Account.all\n end",
"def accounts\n return [] if self.id.nil?\n @accounts ||= \n OrgSync::Base.request(\"#{self.class.endpoint}/#{self.id}/accounts\", {}, @api_key).map { |json| \n OrgSync::Account.new(json, @api_key) \n }\n end",
"def accounts\n return @accounts if @accounts\n @accounts = [ brokerage_account, bank_account ].compact\n end",
"def accounts\n period.accounts\n end",
"def accounts\n request = request(method: :get, path: \"/Account.json\")\n response = request.perform\n instantiate(response[\"Account\"], Lightspeed::Account)\n end",
"def accounts\n account_data = request('listaccounts')\n account_data.map do |account_name, account_value|\n Account.new(self, account_name, account_value, false)\n end\n end",
"def all\n @dealing_platform.gather 'accounts', :accounts, Account\n end",
"def all\n result = @dealing_platform.session.get('accounts').fetch :accounts\n\n @dealing_platform.instantiate_models Account, result\n end",
"def accounts\n db.accounts.map do |raw|\n a = Account.parse_from_payload(raw)\n a.wallet = self\n a\n end\n end",
"def accounts\n get('/accounts')['accounts']\n end",
"def accounts\n @accounts_manager\n end",
"def enabled_accounts\n return [] if self.accounts.nil?\n self.accounts.reject{|a|!a['enabled']}.map{|a|PadmaAccount.new(a)}\n end",
"def list_accounts\n\ttp Account.all\nend",
"def listaccounts\n return {} unless node.wallet\n accounts = {}\n node.wallet.accounts.each do |a|\n accounts[a.name] = node.wallet.get_balance(a)\n end\n accounts\n end",
"def fetch_accounts\n log 'fetch_accounts'\n data = get(PRODUCTS_ENDPOINT, fields: { carteras: false,listaSolicitada: 'TODOS',indicadorSaldoPreTarj: false })\n cuentas = data['datosSalidaCuentas']['cuentas'].zip(data['datosSalidaCodIban']['datosIban'])\n cuentas.map{ |data| build_account(data) }\n end",
"def fetch_accounts\n log 'fetch_accounts'\n\n custom_headers = {\n 'Content-Type' => 'application/json; charset=UTF-8',\n 'Contexto' => get_context\n }\n\n params = {\n \"peticionCuentasKYOSPaginadas\" => {\n \"favoritos\" => false,\n \"paginacion\" => \"0\"\n }\n }\n\n response = with_headers(custom_headers) do\n post(BASE_ENDPOINT + ACCOUNTS_ENDPOINT, fields: params.to_json)\n end\n\n json = JSON.parse(response)\n\n if json['respuestacuentas']['cuentas'].is_a? Array\n # TODO: test this with a user with multiple accounts\n json['respuestacuentas']['cuentas'].map { |data| build_account(data) }\n else\n [build_account(json['respuestacuentas']['cuentas'])]\n end\n end",
"def accounts\n @accounts ||= Lightspeed::Accounts.new(context: self)\n end",
"def accounts\n @accounts ||= Yodlee::AccountDelegator.new(session)\n end",
"def get_account_csv\n to_return = [AppleNotesAccount.to_csv_headers]\n @accounts.each do |key, account|\n to_return.push(account.to_csv)\n end\n to_return\n end",
"def get_account_csv\n to_return = [AppleNotesAccount.to_csv_headers]\n @accounts.each do |key, account|\n to_return.push(account.to_csv)\n end\n to_return\n end",
"def accounts\n return @accounts if @accounts\n\n # find the bricklet articles, which contains the balance data\n @accounts = account_table_rows.map do |row|\n data = row.xpath(\".//td\").map(&:text)\n number = data.shift\n name = data.shift\n balance = data.pop.scan(NUMERIC_REGEXP).join\n available = data.pop.scan(NUMERIC_REGEXP).join\n available = balance if available.empty?\n Account.new(:bank, name, number, balance, available)\n end\n end",
"def accounts\n @accounts ||= EbanqApi::Accounts.new(self)\n end",
"def getAccounts\n broker_url = APP_CONFIG['broker_ip'] + ':' + APP_CONFIG['broker_port'].to_s\n http = broker_url + \"/resources/accounts\"\n res = httpGETRequest(http)\n return res\n end",
"def accounts\n return @accounts if @accounts\n\n # find the bricklet articles, which contains the balance data\n articles = accounts_summary_document.xpath(\"//article\").\n select{|a| a.attributes[\"class\"].value == \"bricklet\"}\n\n @accounts = articles.map do |article|\n prefix = article.attributes[\"id\"].value.gsub(\"_bricklet\", '')\n name = article.xpath(\".//a[@class='product_desc_link']\").text\n number = article.xpath(\".//span[@id='#{prefix}_number']\").text\n balance = article.xpath(\".//span[@id='#{prefix}_current_balance_amount']\").text\n available = first_numeric(article.xpath(\".//div[@id='#{prefix}_available_credit_amount']\").text)\n Account.new(:credit_card, name, number, balance, available)\n end\n end",
"def render_accounts\n\t accounts = []\n\t self.accounts.each do |acc|\n\t \taccounts.push acc.render_detail\n\t end\n\t \n\t accounts\n\tend",
"def rip_accounts()\n if @version >= IOS_VERSION_9\n @database.execute(\"SELECT ZICCLOUDSYNCINGOBJECT.Z_PK \" +\n \"FROM ZICCLOUDSYNCINGOBJECT \" + \n \"WHERE ZICCLOUDSYNCINGOBJECT.ZNAME IS NOT NULL\") do |row|\n rip_account(row[\"Z_PK\"])\n end \n end\n\n if @version == IOS_LEGACY_VERSION\n @database.execute(\"SELECT ZACCOUNT.Z_PK FROM ZACCOUNT\") do |row|\n rip_account(row[\"Z_PK\"])\n end\n end\n\n @accounts.each_pair do |key, account|\n @logger.debug(\"Rip Accounts final array: #{key} corresponds to #{account.name}\")\n end\n\n end",
"def account_list\n return [] unless company\n [company] + company.sibling_accounts\n end",
"def get_list_acc\n JSON.parse(curl_get(\"accounts\").body_str)\n end",
"def accounts( params={} )\n accounts = get_connections(\"accounts\", params)\n return map_connections accounts, :to => Facebook::Graph::Generic\n end",
"def get_accounts_by_user\n return User.find(params[:user_id]).accounts\n end",
"def accounts\n @transactions.collect(&:account).uniq\n end",
"def get_accounts\n response_xml = http_get(\"#{xero_url}/accounts\")\n parse_response(response_xml)\n end",
"def accounts\n end",
"def get_account\n account_id_array = []\n account_id = nil\n accounts = Bank::Account.create_accounts(\"./support/accounts.csv\")\n CSV.foreach(\"./support/account_owners.csv\") do |line|\n if line[1].to_i == @id\n account_id = line[0].to_i\n instance_of_account = Bank::Account.find(account_id)\n account_id_array << instance_of_account\n end\n end\n return account_id_array\n end",
"def list_accounts\n HTTP.headers(:accept => @@accept).basic_auth(:user => ENV[\"API_USERNAME\"], :pass => ENV[\"API_PASSWORD\"])\n .get(\"#{@@base_url}/users/#{self.guid}/accounts\").parse[\"accounts\"]\n end",
"def get_accounts()\n http_get(accounts_url)\n end",
"def accounts_from_current_user\n\t\taccounts = []\n\t\tcurrent_user.RelatedAccounts.each do |relatedaccount|\n\t\t\tAccount.find_all_by_Canal__c(relatedaccount.canal_id).each do |account|\n\t\t\t\taccounts << account\n\t\t\tend\n\t\tend\n\n\t\treturn accounts\n\tend",
"def get_accounts\n response_xml = http_get(@client, \"#{xero_url}/Accounts\")\n parse_response(response_xml, {}, {:request_signature => 'GET/accounts'})\n end",
"def accounts\n from = KEY_PREFIX[:account] + '00000000'\n to = KEY_PREFIX[:account] + 'ffffffff'\n level_db.each(from: from, to: to).map { |k, v| v}\n end",
"def list_of_accounts_online\n Stripe.api_key = Rails.application.credentials.stripe[Rails.env.to_sym][:secret_key]\n return Stripe::Account.list\n end",
"def account_return\n direct_login = []\n users = []\n ulist = Main.active.account_text.tr(\"\\n \",\",\").split(\",\")\n ulist.each do |n| \n n.strip!\n case n\n when /^.*@[0-9]{2,3}$/ \n direct_login << n.split(\"@\")\n when /^.{1,8}$/\n users << n\n end\n end\n #p Account.find_accounts(users).private.other_accounts.flatten\n accounts = users.empty? ? [] : Account.find_accounts_or_initialize(users)\n accounts.collect! { |account| account.all_accounts } if accounts\n accounts.flatten! if accounts\n if !accounts.empty?\n fill_accounts(accounts)\n else\n Main.active.status = [\"#{users}\", \"existiert nicht\", \"important\", -1]\n end\n end",
"def get_debaters\n\t\treturn self.accounts\n\tend",
"def get_account\n as_json(get_results('/account'))\n end",
"def get_account(acct)\n\t\t$DB.where(account_name: acct).each do |t|\n\t\t\tputs \"#{t[:account_name]}: #{t[:balance]}\"\n\t\tend\n\tend",
"def index\n @accountables = Accountable.all\n end",
"def rip_accounts()\n if @version >= IOS_VERSION_9\n @database.execute(\"SELECT ZICCLOUDSYNCINGOBJECT.Z_PK \" +\n \"FROM ZICCLOUDSYNCINGOBJECT \" + \n \"WHERE ZICCLOUDSYNCINGOBJECT.ZNAME IS NOT NULL\") do |row|\n rip_account(row[\"Z_PK\"])\n end \n end\n\n if @version == IOS_LEGACY_VERSION\n @database.execute(\"SELECT ZACCOUNT.Z_PK FROM ZACCOUNT\") do |row|\n rip_account(row[\"Z_PK\"])\n end\n end\n end",
"def index\n @a_accounts = AAccount.all\n end",
"def index\n @ad_accounts = AdAccount.all\n end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account\n find('Account', account_id)\n end",
"def listaccounts(minconf = 1)\n coind.listaccounts minconf\n end",
"def get_accounts_list(load_on_init = true)\n AccountsList.new(self, load_on_init)\n end",
"def accounts(query = nil)\n exec(\"accounts #{query if query}\").split(\"\\n\")\n end",
"def list_accounts(client, options)\n accounts = get_accounts(client, options)\n if accounts.nil?\n return\n end\n\n accounts.each do |acc|\n print_account(acc)\n end\nend",
"def enabled_accounts\n self.padma.try(:enabled_accounts)\n end",
"def acc_ids\n\t self.accounts.pluck(:id)\n\tend",
"def listaccounts(minconf = 1)\n @api.request 'listaccounts', minconf\n end",
"def index\n @api_v1_accounts = Api::V1::Account.all\n end",
"def index\n @accounts = current_user.accounts\n end",
"def index\n @accounts = current_user.accounts\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def index\n @accounts = Account.all\n end",
"def fetch_accounts\n # First we need to fetch the products / views for the user\n \n user_response = JSON.parse(get(BASE_ENDPOINT + USER_ENDPOINT))\n view = user_response['views'].find { |view| view['type'] == 0}\n view_id = view['id']\n\n # Now we get the accounts for that product / view\n products_response = JSON.parse(get(BASE_ENDPOINT + PRODUCTS_ENDPOINT + \"/#{view_id}\"))\n\n # Find which products are accounts\n products_response.select! do |product|\n product['$type'] == 'Arquia.Backend.Domain.Models.Entities.Account, Arquia.Backend.Domain.Models'\n end\n\n products_response.map { |account| build_account(account) }\n end",
"def serialize_one_account(account)\n [{ public_uid: account.public_uid,\n customer: account.customer,\n workmen: account.workmen,\n admin: account.admin,\n user_id: account.user_id\n }]\n end",
"def linked_account_names\n # user.user explained: first user is local user, second user ir padma_user\n @linked_account_names ||= @user.user.padma_accounts.map(&:name)\n end",
"def index\n @baka_accounts = BakaAccount.all\n end",
"def get_accounts(page = 1, \r\n limit = 10, \r\n filter = nil, \r\n sort = nil)\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/accounts'\r\n _query_builder = APIHelper.append_url_with_query_parameters _query_builder, {\r\n 'page' => page,\r\n 'limit' => limit,\r\n 'filter' => filter,\r\n 'sort' => sort\r\n }\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'Content-Type' => Configuration.content_type\r\n }\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.get _query_url, headers: _headers\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) if not (_context.response.raw_body.nil? or _context.response.raw_body.to_s.strip.empty?)\r\n return decoded\r\n end",
"def index\n @accounts = Account.page(params[:page])\n end",
"def get_accounts(token)\n result = get_user_from_token(token)\n user_id = result.raw['userID']\n\n # Find the correct account\n accounts = result.raw['accounts'].select do |account|\n account['accountNo'] == account_number\n end\n\n if accounts.count > 0\n return {\n user_id: user_id,\n accounts: result.raw['accounts']\n }\n else\n raise Trading::Errors::LoginException.new(\n type: :error,\n code: '403',\n description: 'Accounts could not be found',\n messages: ['Accounts could not be found']\n )\n end\n end",
"def index\n @analytic_accounts = AnalyticAccount.all\n\n\n end",
"def index\n @chart_account_klasses = Chart::AccountKlass.all\n end",
"def accounts\n @browser.lis(data_semantic: 'account-item')\n end",
"def index\n @heroku_accounts = Heroku::Account.all\n end",
"def fetch_accounts\n acc_obj_arr = []\n accounts.each do |link|\n link.click\n puts \"Accessing account: #{acc_name}\"\n wait_to_load\n puts 'Loading transactions data'\n scroll_to_bottom\n puts '>Transactions data successfully loaded'\n puts 'Fetching transactions'\n tr = TransFetch.new(@bank_page).fetch_trans\n acc_obj_arr << Account.new(acc_name, acc_currency, acc_balance,\n 'Credit Card', tr)\n puts \">Successfully retrieved data for #{acc_name} account\"\n end\n acc_obj_arr\n end",
"def parse_accounts(accounts)\n Account.new(accounts) if accounts\n end",
"def account\n get('account')\n end",
"def sub_accounts(conditions = {})\n client.accounts.list(conditions)\n end",
"def users\n user_arr = []\n accounts.each do |s|\n user_arr << User.find(s.user.id)\n end\n user_arr\n end",
"def index\n @accounts = @project.accounts\n end",
"def getaddressesbyaccount(account)\n coind.getaddressesbyaccount account\n end"
] |
[
"0.7751779",
"0.7661673",
"0.7652608",
"0.7641887",
"0.7597057",
"0.75443",
"0.754061",
"0.752987",
"0.75099534",
"0.74770606",
"0.74174017",
"0.7405429",
"0.71041197",
"0.70661867",
"0.70654166",
"0.70612395",
"0.70393413",
"0.7033915",
"0.7000612",
"0.69850373",
"0.6976003",
"0.6973258",
"0.6971611",
"0.6970451",
"0.6904286",
"0.6898",
"0.6888749",
"0.68751574",
"0.68299884",
"0.68284506",
"0.6819457",
"0.68184",
"0.68161887",
"0.67853177",
"0.6744728",
"0.6732292",
"0.6719809",
"0.6716311",
"0.67162955",
"0.6713513",
"0.6658797",
"0.66583085",
"0.6653531",
"0.66361946",
"0.662249",
"0.6617825",
"0.66030955",
"0.6599035",
"0.6577325",
"0.65523064",
"0.6550551",
"0.6542755",
"0.6542755",
"0.6542755",
"0.6542755",
"0.6542755",
"0.6542755",
"0.6542755",
"0.6542755",
"0.6542755",
"0.6542755",
"0.65355706",
"0.6532263",
"0.6530295",
"0.6528457",
"0.6526807",
"0.65260726",
"0.6502252",
"0.64759344",
"0.6463165",
"0.6461574",
"0.6461574",
"0.6456277",
"0.6456277",
"0.6456277",
"0.6456277",
"0.6456277",
"0.6456277",
"0.6456277",
"0.6456277",
"0.6456277",
"0.6456277",
"0.64521766",
"0.64518046",
"0.64104944",
"0.6409676",
"0.63968754",
"0.639574",
"0.63892436",
"0.63768363",
"0.6366567",
"0.6366174",
"0.6345358",
"0.63415873",
"0.63331306",
"0.6323859",
"0.6322932",
"0.6321286",
"0.63182825",
"0.63178414"
] |
0.8455378
|
0
|
Returns me enabled accounts as Padma::Account objects
|
def enabled_accounts
return [] if self.accounts.nil?
self.accounts.reject{|a|!a['enabled']}.map{|a|PadmaAccount.new(a)}
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def enabled_accounts\n self.padma.try(:enabled_accounts)\n end",
"def padma_accounts\n return nil if self.accounts.nil?\n self.accounts.map{|a|PadmaAccount.new(a)}\n end",
"def accounts\n Management::Account.all(self)\n end",
"def all\n @dealing_platform.gather 'accounts', :accounts, Account\n end",
"def all\n result = @dealing_platform.session.get('accounts').fetch :accounts\n\n @dealing_platform.instantiate_models Account, result\n end",
"def accounts\n\t\treturn @accounts\n\tend",
"def enabled_account_names\n @enabled_account_names ||= @user.enabled_accounts.map(&:name)\n end",
"def accounts\n period.accounts\n end",
"def accounts\n return @accounts if @accounts\n @accounts = [ brokerage_account, bank_account ].compact\n end",
"def get_accounts\n @accounts = Account.all\n end",
"def accounts\n @accounts_manager\n end",
"def accounts_from_current_user\n\t\taccounts = []\n\t\tcurrent_user.RelatedAccounts.each do |relatedaccount|\n\t\t\tAccount.find_all_by_Canal__c(relatedaccount.canal_id).each do |account|\n\t\t\t\taccounts << account\n\t\t\tend\n\t\tend\n\n\t\treturn accounts\n\tend",
"def list_of_accounts_online\n Stripe.api_key = Rails.application.credentials.stripe[Rails.env.to_sym][:secret_key]\n return Stripe::Account.list\n end",
"def accounts\n return [] if self.id.nil?\n @accounts ||= \n OrgSync::Base.request(\"#{self.class.endpoint}/#{self.id}/accounts\", {}, @api_key).map { |json| \n OrgSync::Account.new(json, @api_key) \n }\n end",
"def accounts\n account_data = request('listaccounts')\n account_data.map do |account_name, account_value|\n Account.new(self, account_name, account_value, false)\n end\n end",
"def allowed_accounts\n return @allowed_accounts\n end",
"def accounts\n response = query_api(\"/rest/accounts\")\n return response[\"accounts\"].map {|account| Account.new(self, account)}\n end",
"def get_accounts_by_user\n return User.find(params[:user_id]).accounts\n end",
"def listaccounts\n return {} unless node.wallet\n accounts = {}\n node.wallet.accounts.each do |a|\n accounts[a.name] = node.wallet.get_balance(a)\n end\n accounts\n end",
"def all_accounts\n with_exclusive_scope { self.all }\n end",
"def accounts\n @accounts ||= Yodlee::AccountDelegator.new(session)\n end",
"def list_accounts\n\ttp Account.all\nend",
"def accounts\n request = request(method: :get, path: \"/Account.json\")\n response = request.perform\n instantiate(response[\"Account\"], Lightspeed::Account)\n end",
"def accounts\n from = KEY_PREFIX[:account] + '00000000'\n to = KEY_PREFIX[:account] + 'ffffffff'\n level_db.each(from: from, to: to).map { |k, v| v}\n end",
"def accounts\n @accounts ||= Lightspeed::Accounts.new(context: self)\n end",
"def accounts\n db.accounts.map do |raw|\n a = Account.parse_from_payload(raw)\n a.wallet = self\n a\n end\n end",
"def list_accounts\n HTTP.headers(:accept => @@accept).basic_auth(:user => ENV[\"API_USERNAME\"], :pass => ENV[\"API_PASSWORD\"])\n .get(\"#{@@base_url}/users/#{self.guid}/accounts\").parse[\"accounts\"]\n end",
"def getAccounts\n broker_url = APP_CONFIG['broker_ip'] + ':' + APP_CONFIG['broker_port'].to_s\n http = broker_url + \"/resources/accounts\"\n res = httpGETRequest(http)\n return res\n end",
"def get_list_acc\n JSON.parse(curl_get(\"accounts\").body_str)\n end",
"def account_list\n return [] unless company\n [company] + company.sibling_accounts\n end",
"def accounts\n @transactions.collect(&:account).uniq\n end",
"def find_all_accounts(authorizer)\n accounts = OMF::SFA::Model::Account.exclude(:name => '__default__')\n accounts.map do |a|\n begin\n raise InsufficientPrivilegesException unless authorizer.can_view_account?(a)\n a\n rescue InsufficientPrivilegesException\n nil\n end\n end.compact\n end",
"def get_debaters\n\t\treturn self.accounts\n\tend",
"def fetch_accounts\n log 'fetch_accounts'\n\n custom_headers = {\n 'Content-Type' => 'application/json; charset=UTF-8',\n 'Contexto' => get_context\n }\n\n params = {\n \"peticionCuentasKYOSPaginadas\" => {\n \"favoritos\" => false,\n \"paginacion\" => \"0\"\n }\n }\n\n response = with_headers(custom_headers) do\n post(BASE_ENDPOINT + ACCOUNTS_ENDPOINT, fields: params.to_json)\n end\n\n json = JSON.parse(response)\n\n if json['respuestacuentas']['cuentas'].is_a? Array\n # TODO: test this with a user with multiple accounts\n json['respuestacuentas']['cuentas'].map { |data| build_account(data) }\n else\n [build_account(json['respuestacuentas']['cuentas'])]\n end\n end",
"def accounts\n @accounts ||= EbanqApi::Accounts.new(self)\n end",
"def acc_ids\n\t self.accounts.pluck(:id)\n\tend",
"def account_ids\n user.app_metadata.fetch('account_ids', [])\n end",
"def accounts\n get('/accounts')['accounts']\n end",
"def account_return\n direct_login = []\n users = []\n ulist = Main.active.account_text.tr(\"\\n \",\",\").split(\",\")\n ulist.each do |n| \n n.strip!\n case n\n when /^.*@[0-9]{2,3}$/ \n direct_login << n.split(\"@\")\n when /^.{1,8}$/\n users << n\n end\n end\n #p Account.find_accounts(users).private.other_accounts.flatten\n accounts = users.empty? ? [] : Account.find_accounts_or_initialize(users)\n accounts.collect! { |account| account.all_accounts } if accounts\n accounts.flatten! if accounts\n if !accounts.empty?\n fill_accounts(accounts)\n else\n Main.active.status = [\"#{users}\", \"existiert nicht\", \"important\", -1]\n end\n end",
"def fetch_accounts\n log 'fetch_accounts'\n data = get(PRODUCTS_ENDPOINT, fields: { carteras: false,listaSolicitada: 'TODOS',indicadorSaldoPreTarj: false })\n cuentas = data['datosSalidaCuentas']['cuentas'].zip(data['datosSalidaCodIban']['datosIban'])\n cuentas.map{ |data| build_account(data) }\n end",
"def fetch_accounts\n # First we need to fetch the products / views for the user\n \n user_response = JSON.parse(get(BASE_ENDPOINT + USER_ENDPOINT))\n view = user_response['views'].find { |view| view['type'] == 0}\n view_id = view['id']\n\n # Now we get the accounts for that product / view\n products_response = JSON.parse(get(BASE_ENDPOINT + PRODUCTS_ENDPOINT + \"/#{view_id}\"))\n\n # Find which products are accounts\n products_response.select! do |product|\n product['$type'] == 'Arquia.Backend.Domain.Models.Entities.Account, Arquia.Backend.Domain.Models'\n end\n\n products_response.map { |account| build_account(account) }\n end",
"def listaccounts(minconf = 1)\n @api.request 'listaccounts', minconf\n end",
"def account_list(user)\n (user.account_lists & account_lists).first\n end",
"def linked_account_names\n # user.user explained: first user is local user, second user ir padma_user\n @linked_account_names ||= @user.user.padma_accounts.map(&:name)\n end",
"def listaccounts(minconf = 1)\n coind.listaccounts minconf\n end",
"def accounts\n return @accounts if @accounts\n\n # find the bricklet articles, which contains the balance data\n @accounts = account_table_rows.map do |row|\n data = row.xpath(\".//td\").map(&:text)\n number = data.shift\n name = data.shift\n balance = data.pop.scan(NUMERIC_REGEXP).join\n available = data.pop.scan(NUMERIC_REGEXP).join\n available = balance if available.empty?\n Account.new(:bank, name, number, balance, available)\n end\n end",
"def padma_enabled?\n ea = self.enabled_accounts\n !(ea.nil? || ea.empty?)\n end",
"def get_accounts()\n http_get(accounts_url)\n end",
"def get_cpanel_account_list\n\t\tCPanelHelper::Local.find_accounts_by_string('.*', 'regexp').keys\n\tend",
"def accounts( params={} )\n accounts = get_connections(\"accounts\", params)\n return map_connections accounts, :to => Facebook::Graph::Generic\n end",
"def index\n @accountables = Accountable.all\n end",
"def get_accounts(token)\n result = get_user_from_token(token)\n user_id = result.raw['userID']\n\n # Find the correct account\n accounts = result.raw['accounts'].select do |account|\n account['accountNo'] == account_number\n end\n\n if accounts.count > 0\n return {\n user_id: user_id,\n accounts: result.raw['accounts']\n }\n else\n raise Trading::Errors::LoginException.new(\n type: :error,\n code: '403',\n description: 'Accounts could not be found',\n messages: ['Accounts could not be found']\n )\n end\n end",
"def get_account_csv\n to_return = [AppleNotesAccount.to_csv_headers]\n @accounts.each do |key, account|\n to_return.push(account.to_csv)\n end\n to_return\n end",
"def get_account_csv\n to_return = [AppleNotesAccount.to_csv_headers]\n @accounts.each do |key, account|\n to_return.push(account.to_csv)\n end\n to_return\n end",
"def accounts\n return @accounts if @accounts\n\n # find the bricklet articles, which contains the balance data\n articles = accounts_summary_document.xpath(\"//article\").\n select{|a| a.attributes[\"class\"].value == \"bricklet\"}\n\n @accounts = articles.map do |article|\n prefix = article.attributes[\"id\"].value.gsub(\"_bricklet\", '')\n name = article.xpath(\".//a[@class='product_desc_link']\").text\n number = article.xpath(\".//span[@id='#{prefix}_number']\").text\n balance = article.xpath(\".//span[@id='#{prefix}_current_balance_amount']\").text\n available = first_numeric(article.xpath(\".//div[@id='#{prefix}_available_credit_amount']\").text)\n Account.new(:credit_card, name, number, balance, available)\n end\n end",
"def accounts(query = nil)\n exec(\"accounts #{query if query}\").split(\"\\n\")\n end",
"def index\n @accounts = current_user.accounts\n end",
"def index\n @accounts = current_user.accounts\n end",
"def accountability_objects\n case count_method_for_accountability.to_sym\n when :awardees then awardees\n when :presenters then presenters\n when :complete then complete\n else []\n end\n end",
"def accounts\n end",
"def list_accounts(client, options)\n accounts = get_accounts(client, options)\n if accounts.nil?\n return\n end\n\n accounts.each do |acc|\n print_account(acc)\n end\nend",
"def get_accounts_list(load_on_init = true)\n AccountsList.new(self, load_on_init)\n end",
"def rip_accounts()\n if @version >= IOS_VERSION_9\n @database.execute(\"SELECT ZICCLOUDSYNCINGOBJECT.Z_PK \" +\n \"FROM ZICCLOUDSYNCINGOBJECT \" + \n \"WHERE ZICCLOUDSYNCINGOBJECT.ZNAME IS NOT NULL\") do |row|\n rip_account(row[\"Z_PK\"])\n end \n end\n\n if @version == IOS_LEGACY_VERSION\n @database.execute(\"SELECT ZACCOUNT.Z_PK FROM ZACCOUNT\") do |row|\n rip_account(row[\"Z_PK\"])\n end\n end\n\n @accounts.each_pair do |key, account|\n @logger.debug(\"Rip Accounts final array: #{key} corresponds to #{account.name}\")\n end\n\n end",
"def get_accounts\n response_xml = http_get(\"#{xero_url}/accounts\")\n parse_response(response_xml)\n end",
"def get_accounts\n response_xml = http_get(@client, \"#{xero_url}/Accounts\")\n parse_response(response_xml, {}, {:request_signature => 'GET/accounts'})\n end",
"def balances\n accounts.with_balance\n end",
"def sub_accounts(conditions = {})\n client.accounts.list(conditions)\n end",
"def get_account\n account_id_array = []\n account_id = nil\n accounts = Bank::Account.create_accounts(\"./support/accounts.csv\")\n CSV.foreach(\"./support/account_owners.csv\") do |line|\n if line[1].to_i == @id\n account_id = line[0].to_i\n instance_of_account = Bank::Account.find(account_id)\n account_id_array << instance_of_account\n end\n end\n return account_id_array\n end",
"def get_account\n as_json(get_results('/account'))\n end",
"def render_accounts\n\t accounts = []\n\t self.accounts.each do |acc|\n\t \taccounts.push acc.render_detail\n\t end\n\t \n\t accounts\n\tend",
"def rip_accounts()\n if @version >= IOS_VERSION_9\n @database.execute(\"SELECT ZICCLOUDSYNCINGOBJECT.Z_PK \" +\n \"FROM ZICCLOUDSYNCINGOBJECT \" + \n \"WHERE ZICCLOUDSYNCINGOBJECT.ZNAME IS NOT NULL\") do |row|\n rip_account(row[\"Z_PK\"])\n end \n end\n\n if @version == IOS_LEGACY_VERSION\n @database.execute(\"SELECT ZACCOUNT.Z_PK FROM ZACCOUNT\") do |row|\n rip_account(row[\"Z_PK\"])\n end\n end\n end",
"def users\n user_arr = []\n accounts.each do |s|\n user_arr << User.find(s.user.id)\n end\n user_arr\n end",
"def test_accounts\n if test_mode_on?\n @@test_accounts ||= Conf.test.map do |v|\n v.is_a?(Hash) ? v.keys : v\n end.flatten\n end\n @@test_accounts || []\n end",
"def accounts\n @browser.lis(data_semantic: 'account-item')\n end",
"def serialize_one_account(account)\n [{ public_uid: account.public_uid,\n customer: account.customer,\n workmen: account.workmen,\n admin: account.admin,\n user_id: account.user_id\n }]\n end",
"def all\n Message::Statement.display_all_account_data(raw_data_to_a)\n end",
"def all_users\n result = []\n api.search(accounts_dn, ::LDAP::LDAP_SCOPE_SUBTREE, accounts_filter) do |user|\n result << user.to_hash\n end\n result\n end",
"def get_account_quotas()\n session_url = '/sessions?page=0&pageSize=1'\n response = self.class.get(session_url, @options)\n response.headers.select { |k, _v| k.to_s.start_with? 'nexosis-account' }\n end",
"def find_all_accounts(authorizer)\n debug \"central find_all_accounts\"\n raise 'Method not implemented because the Central Manager just need to pass the same requisition to the other' \\\n ' brokers and create the concatenated results'\n end",
"def has_access_to_current_account\n return if self.padma.try(:current_account).nil?\n\n if self.enabled_accounts.nil?\n # nil means error in connection\n self.errors.add(:current_account_id, I18n.t('user.couldnt_connect_to_check_current_account'))\n else\n unless self.padma.current_account_name.in?(self.enabled_accounts.map{|ea|ea.name})\n self.errors.add(:current_account_id, I18n.t('user.invalid_current_account'))\n end\n end\n\n end",
"def account_details(*paramaters)\n accounts = []\n unless self.list_accounts.blank?\n self.list_accounts.each do |account|\n details = {} \n account.each do |key, value|\n if paramaters.include? key\n details[key] = value\n end\n end\n accounts << details\n end\n accounts\n end\n end",
"def affiliate_account_types\n @affiliate_account_types ||= []\n end",
"def index\n @account_users = AccountUser.account_users_for(current_user.id)\n end",
"def account\n self\n end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def account; Account.get(self.account_id); end",
"def index\n @ad_accounts = AdAccount.all\n end",
"def index\n authorize! :create_account, Account\n @accounts = Account.all.decorate\n\n end",
"def my_account\n @user = current_user\n @listings = Listing.where(user: current_user)\n end",
"def index\n @accounts = Account.where(:user_id => current_user.id)\n end",
"def wallet_payment_sources\n user.wallet_payment_sources.to_a\n end",
"def get_accounts(opts = {})\n data, _status_code, _headers = get_accounts_with_http_info(opts)\n data\n end"
] |
[
"0.7983615",
"0.75145507",
"0.7334475",
"0.7208966",
"0.70647144",
"0.7052674",
"0.7043298",
"0.70306796",
"0.70035243",
"0.6908325",
"0.6865661",
"0.68348813",
"0.68333775",
"0.6779871",
"0.6750549",
"0.67298484",
"0.6705439",
"0.6623847",
"0.66135246",
"0.65814143",
"0.6568079",
"0.6559959",
"0.6543612",
"0.65195405",
"0.6513235",
"0.6494981",
"0.64438707",
"0.6396182",
"0.639163",
"0.6351477",
"0.6322237",
"0.63182926",
"0.6310346",
"0.62777466",
"0.6273789",
"0.6261421",
"0.62599456",
"0.6259517",
"0.6248132",
"0.62417114",
"0.62354064",
"0.6223099",
"0.6220439",
"0.6206899",
"0.6175127",
"0.61585027",
"0.6154671",
"0.61289525",
"0.61153007",
"0.6106381",
"0.6091301",
"0.6087549",
"0.6083272",
"0.6081494",
"0.6065468",
"0.603037",
"0.6018783",
"0.6018783",
"0.60059243",
"0.5983752",
"0.59739065",
"0.5965536",
"0.5932502",
"0.5922999",
"0.5916003",
"0.5906601",
"0.5902832",
"0.589169",
"0.588337",
"0.58770835",
"0.5874471",
"0.5865426",
"0.58602834",
"0.5849689",
"0.58312124",
"0.5798615",
"0.57943547",
"0.57891273",
"0.5788776",
"0.5767492",
"0.57550997",
"0.574727",
"0.57368577",
"0.5736681",
"0.57366526",
"0.57366526",
"0.57366526",
"0.57366526",
"0.57366526",
"0.57366526",
"0.57366526",
"0.57366526",
"0.57366526",
"0.57366526",
"0.57357424",
"0.5723705",
"0.5711072",
"0.57095593",
"0.5709469",
"0.5707731"
] |
0.84496975
|
0
|
Hack for the calendar range to work
|
def start_time
Date.today
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def range_start=( value ); @range_start = value; rationalise_dates(); end",
"def beginning_of_week; end",
"def beginning_of_week; end",
"def setup_range(date)\n diff = date.wday - self.class.windex(start_wday)\n @first = date - (diff + ((diff < 0) ? DAYS : 0))\n @last = @first + DAYS - 1\n end",
"def declare_beg_range\n\t\t@beg_range = @beg_range.to_date \n\t\t@end_range = @end_range.to_date \n\tend",
"def retrieve_date_range_11\n @free_period = false\n @from, @to = nil, nil\n\n if params[:period_type] == '1' || (params[:period_type].nil? && !params[:period].nil?)\n case params[:period].to_s\n when 'today'\n @from = @to = Date.today\n when 'yesterday'\n @from = @to = Date.today - 1\n when 'current_week'\n @from = Date.today - (Date.today.cwday - 1)%7\n @to = @from + 6\n when 'last_week'\n @from = Date.today - 7 - (Date.today.cwday - 1)%7\n @to = @from + 6\n when '7_days'\n @from = Date.today - 7\n @to = Date.today\n when 'current_month'\n @from = Date.civil(Date.today.year, Date.today.month, 1)\n @to = (@from >> 1) - 1\n when 'last_month'\n @from = Date.civil(Date.today.year, Date.today.month, 1) << 1\n @to = (@from >> 1) - 1\n when '30_days'\n @from = Date.today - 30\n @to = Date.today\n when 'current_year'\n @from = Date.civil(Date.today.year, 1, 1)\n @to = Date.civil(Date.today.year, 12, 31)\n end\n elsif params[:period_type] == '2' || (params[:period_type].nil? && (!params[:from].nil? || !params[:to].nil?))\n begin; @from = params[:from].to_s.to_date unless params[:from].blank?; rescue; end\n begin; @to = params[:to].to_s.to_date unless params[:to].blank?; rescue; end\n @free_period = true\n else\n # default\n end\n \n @from, @to = @to, @from if @from && @to && @from > @to\n @from ||= (TimeEntry.earilest_date_for_project(@project) || Date.today)\n @to ||= (TimeEntry.latest_date_for_project(@project) || Date.today)\n end",
"def expand_service_range\n self.service_start_date ||= (service_except_dates + service_added_dates).min\n self.service_end_date ||= (service_except_dates + service_added_dates).max\n true\n end",
"def date_range\n @date_range ||= start_at..end_at\n end",
"def determine_date_range\n case @time_frame\n when 'week' then (@date.beginning_of_week..@date.end_of_week)\n when 'month' then (@date.beginning_of_month..@date.end_of_month)\n end\n end",
"def set_service_range\n self.service_start_date ||= (service_except_dates + service_added_dates).min\n self.service_end_date ||= (service_except_dates + service_added_dates).max\n true\n end",
"def event_range events\n [events.map(&:date).min.to_date, events.map(&:date).max.to_date]\nend",
"def booked_date_range\n { from: :start_date, to: :end_date }\n end",
"def date_range(past_day=nil, past_month=nil, past_year=nil, future_day=nil, future_month=nil,future_year=nil)\n if (past_day != nil || past_month != nil || past_year != nil) && (future_day != nil || future_month != nil || future_year != nil)\n start_date = get_date(past_day,past_month,past_year,-1)\n end_date = get_date(future_day,future_month,future_year, 1)\n elsif past_day == nil && past_month == nil && past_year == nil && future_day == nil && future_month == nil && future_year == nil\n start_date = get_date(nil,nil,nil,0)\n end_date = get_date(nil,nil,nil,0)\n elsif (past_day == nil && past_month == nil && past_year == nil) && (future_day != nil || future_month != nil || future_year != nil)\n start_date = get_date(nil,nil,nil,0)\n end_date = get_date(future_day,future_month,future_year,1)\n elsif (past_day != nil || past_month != nil || past_year == nil) && (future_day == nil && future_month == nil && future_year == nil)\n start_date = get_date(past_day,past_month,past_year, -1)\n end_date = get_date(nil,nil,nil,0)\n else\n fail(\"Invalid Argument Passed to date range method. Please enter correct arguments\")\n end\n return start_date,end_date\nend",
"def booking_range\n ary = [I18n.localize(begin_date, format: DATE_AND_TIME)]\n if same_day?(begin_date, end_date)\n ary << I18n.localize(end_date, format: '%R') # example: 09:00\n else\n ary << I18n.localize(end_date, format: DATE_AND_TIME)\n end\n ary.join ' - '\n end",
"def day_calculations\n\t\t@prev_beg_range = @beg_range.to_date-1.day\n\t\t@prev_end_range = @beg_range.to_date-1.day\n\t\t@next_beg_range = @beg_range.to_date+1.day\n\t\t@next_end_range = @beg_range.to_date+1.day\n\tend",
"def all_day\n beginning_of_day..end_of_day\n end",
"def to_range\n case\n when open?, unknown?\n nil\n else\n Range.new(unknown_start? ? Date.new : @from, max)\n end\n end",
"def beginning_of_week=(_arg0); end",
"def beginning_of_week=(_arg0); end",
"def test_range\n series = Dataset::Series.new\n ary = (1950..2007).map {|n| [ n, rand(100) ]}\n series.add(*ary)\n assert_equal(58, series.data.size)\n assert_raise(RuntimeError) { series.range() }\n assert_raise(TypeError) { series.range(Dataset::Chron::YYYYMM.new(\"01/1980\")) }\n assert_raise(TypeError) { series.range(nil, Dataset::Chron::YYYYMM.new(\"01/1980\")) }\n s2 = series.range(Dataset::Chron::YYYY.new(1980))\n assert_equal(28, s2.data.size)\n assert_equal(Dataset::Chron::YYYY.new(1980), s2.chrons.min)\n assert_equal(Dataset::Chron::YYYY.new(2007), s2.chrons.max)\n end",
"def ops_calendar\n # setup calendar cells\n @today = Date.today - 3\n if @today.strftime(\"%a\") == \"Mon\"\n @start_date = @today\n else\n @start_date = @today\n until @start_date.strftime(\"%a\") == \"Mon\"\n @start_date -= 1\n end\n end\n @end_date = @start_date+21\n @date_range = (@start_date..@end_date)\n @weeks = @date_range.to_a.in_groups_of(3)\n\n\n end",
"def breakable_range; end",
"def breakable_range=(_arg0); end",
"def retrieve_date_range_14\n @free_period = false\n @from, @to = nil, nil\n\n if params[:period_type] == '1' || (params[:period_type].nil? && !params[:period].nil?)\n case params[:period].to_s\n when 'today'\n @from = @to = Date.today\n when 'yesterday'\n @from = @to = Date.today - 1\n when 'current_week'\n @from = Date.today - (Date.today.cwday - 1)%7\n @to = @from + 6\n when 'last_week'\n @from = Date.today - 7 - (Date.today.cwday - 1)%7\n @to = @from + 6\n when '7_days'\n @from = Date.today - 7\n @to = Date.today\n when 'current_month'\n @from = Date.civil(Date.today.year, Date.today.month, 1)\n @to = (@from >> 1) - 1\n when 'last_month'\n @from = Date.civil(Date.today.year, Date.today.month, 1) << 1\n @to = (@from >> 1) - 1\n when '30_days'\n @from = Date.today - 30\n @to = Date.today\n when 'current_year'\n @from = Date.civil(Date.today.year, 1, 1)\n @to = Date.civil(Date.today.year, 12, 31)\n end\n elsif params[:period_type] == '2' || (params[:period_type].nil? && (!params[:from].nil? || !params[:to].nil?))\n begin; @from = params[:from].to_s.to_date unless params[:from].blank?; rescue; end\n begin; @to = params[:to].to_s.to_date unless params[:to].blank?; rescue; end\n @free_period = true\n else\n # default\n end\n\n @from, @to = @to, @from if @from && @to && @from > @to\n end",
"def specified_period\n @range = [@start_date, @end_date]\n end",
"def range\n (start_date...end_date) #exclusive date range\n end",
"def __evolve_date__\n __evolve_range_naive__.transform_values! {|v| v&.__evolve_date__ }\n end",
"def normalize_date_from\n\t\t\t\t\tstart = RicSeason.start\n\t\t\t\t\tif start\n\t\t\t\t\t\tif self.period.to_sym == :year\n\t\t\t\t\t\t\tfirst_day = Date.parse(\"#{self.from.cwyear}-#{start}\")\n\t\t\t\t\t\t\tif self.from < first_day\n\t\t\t\t\t\t\t\tself.from = first_day - 1.year\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tself.from = first_day\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\telsif self.period.to_sym == :month\n\t\t\t\t\t\t\tfirst_day = Date.parse(\"#{self.from.cwyear}-#{self.from.month}-#{start}\")\n\t\t\t\t\t\t\tif self.from < first_day\n\t\t\t\t\t\t\t\tself.from = first_day - 1.month\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tself.from = first_day\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend",
"def to_calendar(value)\n case value\n when -2\n nil\n when 1\n 'semesters'\n when 2\n 'quarters'\n else\n 'nontraditional'\n end\n end",
"def date_range( start_date, end_date )\n d_range = []\n cur_date = start_date \n\n until cur_date == end_date\n d_range << cur_date\n cur_date = Calendar.next_day( cur_date )\n end\n \n d_range << end_date\n end",
"def all_day\n beginning_of_day..end_of_day\n end",
"def m_range\r\n end",
"def check_dates\r\n self.start_time -= 8.hours\r\n self.end_time -= 8.hours\r\n end",
"def set_work_search_blog\n @event = Event.find(params[:id]) \n @event.date_range = @event.start.to_date.to_s + \" To \"+ (@event.end.to_date - 1.day).to_s \n end",
"def parse_range\n val = super || return\n val.begin == val.end ? val.begin : val\n end",
"def imply_dates\n return unless !@properties['end'].nil? && !@properties['start'].nil?\n\n start_date = nil\n\n @properties['start'].each do |start_val|\n if start_val =~ /^(\\d{4}-[01]\\d-[0-3]\\d)/\n start_date = Regexp.last_match(1) if start_date.nil?\n elsif start_val =~ /^(\\d{4}-[0-3]\\d\\d)/\n start_date = Regexp.last_match(1) if start_date.nil?\n end\n end\n\n unless start_date.nil?\n @properties['end'].map! do |end_val|\n if end_val.match?(/^\\d{4}-[01]\\d-[0-3]\\d/)\n end_val\n elsif end_val.match?(/^\\d{4}-[0-3]\\d\\d/)\n end_val\n else\n start_date + ' ' + end_val\n end\n end\n end\n end",
"def unavailable_dates\n errors[:base] << \"Unavailable dates.(-1)\" if start_date.present? && start_date < Time.zone.today\n errors[:base] << \"Unavailable dates.(-2)\" if (start_date.present? && end_date.present?) && start_date >= end_date\n errors[:base] << \"Unavailable dates.(-3)\" if (start_time.present? && end_time.present?) && start_time >= end_time\n errors[:base] << \"Unavailable dates.(-4)\" if (day_of_week.present? && week_of_month.present?) && ([0,1].exclude?(day_of_week) && week_of_month == 6)\n end",
"def day_range(rng=self)\n if rng.respond_to?(:exclude_end?) && rng.exclude_end?\n Range.new(rng.begin.to_date, rng.end.to_date, true)\n else\n Range.new(rng.begin.to_date, rng.end.to_date + 1, true)\n end\n end",
"def to_range_within(range)\n nb_weeks_offset = self.weekly_recurring ? ((range.end - self.starts_at.to_datetime) / 7).to_i : 0\n r = Range.new(self.starts_at + nb_weeks_offset.week, self.ends_at + nb_weeks_offset.week)\n range.cover?(r.begin)&&range.cover?(r.end) ? r : nil\n end",
"def default_range\n\t\t(measurements.first.date..Date.today)\n\tend",
"def base_for_time_range_components\n Time.current.beginning_of_day\n end",
"def unavailable_dates\n bookings.pluck(:start_dt, :end_dt).map do |range|\n { from: range[0], to: range[1] }\n end\n end",
"def date_range_s(format = :short)\n return date.year if all_year?\n\n if format == :long\n if start_date == end_date\n date.strftime(\"%-m/%-d/%Y\")\n else\n \"#{start_date.strftime('%-m/%-d/%Y')}-#{end_date.strftime('%-m/%-d/%Y')}\"\n end\n else\n start_date_s = \"#{start_date.month}/#{start_date.day}\"\n if start_date == end_date\n start_date_s\n elsif start_date.month == end_date.month\n \"#{start_date_s}-#{end_date.day}\"\n else\n \"#{start_date_s}-#{end_date.month}/#{end_date.day}\"\n end\n end\n end",
"def range_start; range.first; end",
"def to_range\n start_date..end_date\n end",
"def retrieve_date_range\n @free_period = false\n @from, @to = nil, nil\n\n if params[:period_type] == '1' || (params[:period_type].nil? && !params[:period].nil?)\n case params[:period].to_s\n when 'today'\n @from = @to = Date.today\n when 'yesterday'\n @from = @to = Date.today - 1\n when 'current_week'\n @from = Date.today - (Date.today.cwday - 1)%7\n @to = @from + 6\n when 'last_week'\n @from = Date.today - 7 - (Date.today.cwday - 1)%7\n @to = @from + 6\n when '7_days'\n @from = Date.today - 7\n @to = Date.today\n when 'current_month'\n @from = Date.civil(Date.today.year, Date.today.month, 1)\n @to = (@from >> 1) - 1\n when 'last_month'\n @from = Date.civil(Date.today.year, Date.today.month, 1) << 1\n @to = (@from >> 1) - 1\n when '30_days'\n @from = Date.today - 30\n @to = Date.today\n when 'current_year'\n @from = Date.civil(Date.today.year, 1, 1)\n @to = Date.civil(Date.today.year, 12, 31)\n end\n elsif params[:period_type] == '2' || (params[:period_type].nil? && (!params[:from].nil? || !params[:to].nil?))\n begin; @from = params[:from].to_s.to_date unless params[:from].blank?; rescue; end\n begin; @to = params[:to].to_s.to_date unless params[:to].blank?; rescue; end\n @free_period = true\n else\n # default\n end\n \n @from, @to = @to, @from if @from && @to && @from > @to\n\n end",
"def build_cal from, to\n (from..to).map{ |d| [d.month, d.year ] }.uniq.map { |m,y|\n `cal #{m} #{y}`\n }.join(\"\\n\").split(/\\n/)\n end",
"def to_range\n (@start_date..@end_date)\n end",
"def retrieve_date_range\n\t\t@free_period = false\n\t\t@from, @to = nil, nil\n\t\tperiod_type = session[:wkattendance][:period_type]\n\t\tperiod = session[:wkattendance][:period]\n\t\tfromdate = session[:wkattendance][:from]\n\t\ttodate = session[:wkattendance][:to]\n\t\tif (period_type == '1' || (period_type.nil? && !period.nil?)) \n\t\t case period.to_s\n\t\t when 'today'\n\t\t\t@from = @to = Date.today\n\t\t when 'yesterday'\n\t\t\t@from = @to = Date.today - 1\n\t\t when 'current_week'\n\t\t\t@from = getStartDay(Date.today - (Date.today.cwday - 1)%7)\n\t\t\t@to = Date.today #@from + 6\n\t\t when 'last_week'\n\t\t\t@from =getStartDay(Date.today - 7 - (Date.today.cwday - 1)%7)\n\t\t\t@to = @from + 6\n\t\t when '7_days'\n\t\t\t@from = Date.today - 7\n\t\t\t@to = Date.today\n\t\t when 'current_month'\n\t\t\t@from = Date.civil(Date.today.year, Date.today.month, 1)\n\t\t\t@to = Date.today #(@from >> 1) - 1\n\t\t when 'last_month'\n\t\t\t@from = Date.civil(Date.today.year, Date.today.month, 1) << 1\n\t\t\t@to = (@from >> 1) - 1\n\t\t when '30_days'\n\t\t\t@from = Date.today - 30\n\t\t\t@to = Date.today\n\t\t when 'current_year'\n\t\t\t@from = Date.civil(Date.today.year, 1, 1)\n\t\t\t@to = Date.today #Date.civil(Date.today.year, 12, 31)\n\t\t end\n\t\t#elsif params[:period_type] == '2' || (params[:period_type].nil? && (!params[:from].nil? || !params[:to].nil?))\n\t\telsif period_type == '2' || (period_type.nil? && (!fromdate.nil? || !todate.nil?))\n\t\t begin; @from = fromdate.to_s.to_date unless fromdate.blank?; rescue; end\n\t\t begin; @to = todate.to_s.to_date unless todate.blank?; rescue; end\n\t\t @free_period = true\n\t\telse\n\t\t # default\n\t\t # 'current_month'\t\t\n\t\t\t@from = Date.civil(Date.today.year, Date.today.month, 1)\n\t\t\t@to = Date.today #(@from >> 1) - 1\n\t\tend \n\n\t\t@from, @to = @to, @from if @from && @to && @from > @to\n\n\tend",
"def england\n # super doesn't call #new_start on MRI, so each method has to be\n # individually overridden.\n if_period(super) {|p,dt| dt.localize(p) }\n end",
"def set_day_range(days, start_day, end_day)\n pos = Days.index(start_day)\n while pos != (Days.index(end_day) + 1) % 7\n days[pos] = true\n pos = (pos + 1) % 7\n end\n end",
"def retrieve_date_range\n\t\t@free_period = false\n\t\t@from, @to = nil, nil\n\t\tperiod_type = session[:wkassetdepreciation][:period_type]\n\t\tperiod = session[:wkassetdepreciation][:period]\n\t\tfromdate = session[:wkassetdepreciation][:from]\n\t\ttodate = session[:wkassetdepreciation][:to]\n\t\t\n\t\tif (period_type == '1' || (period_type.nil? && !period.nil?)) \n\t\t case period.to_s\n\t\t\t when 'today'\n\t\t\t\t@from = @to = Date.today\n\t\t\t when 'yesterday'\n\t\t\t\t@from = @to = Date.today - 1\n\t\t\t when 'current_week'\n\t\t\t\t@from = getStartDay(Date.today - (Date.today.cwday - 1)%7)\n\t\t\t\t@to = @from + 6\n\t\t\t when 'last_week'\n\t\t\t\t@from =getStartDay(Date.today - 7 - (Date.today.cwday - 1)%7)\n\t\t\t\t@to = @from + 6\n\t\t\t when '7_days'\n\t\t\t\t@from = Date.today - 7\n\t\t\t\t@to = Date.today\n\t\t\t when 'current_month'\n\t\t\t\t@from = Date.civil(Date.today.year, Date.today.month, 1)\n\t\t\t\t@to = (@from >> 1) - 1\n\t\t\t when 'last_month'\n\t\t\t\t@from = Date.civil(Date.today.year, Date.today.month, 1) << 1\n\t\t\t\t@to = (@from >> 1) - 1\n\t\t\t when '30_days'\n\t\t\t\t@from = Date.today - 30\n\t\t\t\t@to = Date.today\n\t\t\t when 'current_year'\n\t\t\t\t@from = Date.civil(Date.today.year, 1, 1)\n\t\t\t\t@to = Date.civil(Date.today.year, 12, 31)\n\t end\n\t\telsif period_type == '2' || (period_type.nil? && (!fromdate.nil? || !todate.nil?))\n\t\t begin; @from = fromdate.to_s.to_date unless fromdate.blank?; rescue; end\n\t\t begin; @to = todate.to_s.to_date unless todate.blank?; rescue; end\n\t\t @free_period = true\n\t\telse\n\t\t # default\n\t\t # 'current_month'\t\t\n\t\t\t@from = Date.civil(Date.today.year, Date.today.month, 1)\n\t\t\t@to = (@from >> 1) - 1\n\t end \n\t\t\n\t\t@from, @to = @to, @from if @from && @to && @from > @to\n\n\tend",
"def event_start_end_dates\n esdate and eedate\n end",
"def day\n self.range('day')\n end",
"def range_check(date)\n if date < @start_date\n # puts \"Reconstruindo calculadora de feriados pois dia #{date} eh menor que #{@start_date} -> #{@end_date}\"\n build(date - 2.days, @end_date, @holidays)\n elsif date > @end_date\n # puts \"Reconstruindo calculadora de feriados pois dia #{date} eh maior que #{end_date}\"\n build(@start_date, date + 252.days, @holidays)\n end\n end",
"def year_calculations\n\t\t@prev_beg_range = @beg_range.to_date.beginning_of_year.prev_year\n\t\t@prev_end_range = @beg_range.to_date.beginning_of_year-1.day\n\t\t@next_beg_range = @beg_range.to_date.next_year.beginning_of_year\n\t\t@next_end_range = @beg_range.to_date.next_year.end_of_year\n\tend",
"def dates_within_conference_dates\n return unless start_date && end_date && program.try(:conference).try(:start_date) && program.try(:conference).try(:end_date)\n\n errors.add(:start_date, \"can't be outside of the conference's dates (#{program.conference.start_date}-#{program.conference.end_date})\") unless (program.conference.start_date..program.conference.end_date).cover?(start_date)\n errors.add(:end_date, \"can't be outside of the conference's dates (#{program.conference.start_date}-#{program.conference.end_date})\") unless (program.conference.start_date..program.conference.end_date).cover?(end_date)\n end",
"def out_of_bounds_time_format; end",
"def date_range_integrity\n super\n\n # TODO: remove this after tie-in to Settings\n return\n\n open_enrollment_term_maximum = Settings.aca.shop_market.open_enrollment.maximum_length.months.months\n if open_enrollment_term.end > (open_enrollment_term.begin + open_enrollment_term_maximum)\n errors.add(:open_enrollment_term, \"may not exceed #{open_enrollment_term_maximum} months\")\n end\n\n open_enrollment_term_earliest_begin = effective_term.begin - open_enrollment_term_maximum\n if open_enrollment_term.begin < open_enrollment_term_earliest_begin\n errors.add(:open_enrollment_begin_on, \"may not begin more than #{open_enrollment_term_maximum} months sooner than effective date\") \n end\n\n initial_application_earliest_start_date = effective_term.begin + Settings.aca.shop_market.initial_application.earliest_start_prior_to_effective_on.months.months\n if initial_application_earliest_start_date > TimeKeeper.date_of_record\n errors.add(:effective_term, \"may not start application before #{initial_application_earliest_start_date.to_date} with #{effective_term.begin} effective date\")\n end\n\n if !['canceled', 'suspended', 'terminated','termination_pending'].include?(aasm_state)\n benefit_term_minimum = Settings.aca.shop_market.benefit_period.length_minimum.year.years\n if end_on != (effective_term.begin + benefit_term_minimum - 1.day)\n errors.add(:effective_term, \"application term period should be #{duration_in_days(benefit_term_minimum)} days\")\n end\n end\n end",
"def w_day; end",
"def rationalise_dates\n default_range = date_range()\n\n begin\n if ( not @range_month_start.blank? )\n year, month = unpack_string( @range_month_start )\n range_start = Date.new( year, month )\n elsif ( not @range_week_start.blank? )\n year, week = unpack_string( @range_week_start )\n range_start = Timesheet.date_for( year, week, TimesheetRow::FIRST_DAY, true )\n else\n range_start = Date.parse( @range_start )\n end\n rescue\n range_start = default_range.min\n end\n\n begin\n if ( not @range_month_end.blank? )\n year, month = unpack_string( @range_month_end )\n range_end = Date.new( year, month ).at_end_of_month()\n elsif ( not @range_week_end.blank? )\n year, week = unpack_string( @range_week_end )\n range_end = Timesheet.date_for( year, week, TimesheetRow::LAST_DAY, true )\n else\n range_end = Date.parse( @range_end )\n end\n rescue\n range_end = default_range.max\n end\n\n if ( range_end < range_start )\n @range = range_end..range_start\n else\n @range = range_start..range_end\n end\n\n # Hard-coded range throttle to 32 days (just over a \"longest month\") for\n # daily reports to avoid excessive server load.\n\n if ( @frequency_data[ :generator ] == :daily_report )\n @range = ( @range.last - 32.days )..( @range.last ) if ( @range.last.to_time - @range.first.to_time > 32.days )\n end\n end",
"def friendly_date_range\n sessions.first.start.month == sessions.last.start.month ?\n \"#{sessions.first.start.strftime('%B %-d')}-#{sessions.last.start.strftime('%-d, %Y')}\" :\n \"#{sessions.first.start.strftime('%B %-d')} - #{sessions.last.start.strftime('%B %-d, %Y')}\"\n end",
"def new_start(start = Date::ITALY)\n if_period(super) {|p,dt| dt.localize(p) }\n end",
"def reservation_dates_must_make_sense\n\t if end_date <= start_date\n\t\t errors.add(:start_date, \"has to be before the end date\")\n\t end\n\tend",
"def reporthelp_start_time( form )\n return form.calendar_date_select(\n :range_start,\n {\n :embedded => false,\n :year_range => Timesheet.used_range()\n }\n )\n end",
"def retrieve_date_range\n\t\t@free_period = false\n\t\t@from, @to = nil, nil\n\t\tperiod_type = session[controller_name][:period_type]\n\t\tperiod = session[controller_name][:period]\n\t\tfromdate = session[controller_name][:from]\n\t\ttodate = session[controller_name][:to]\n\t\t\n\t\tif (period_type == '1' || (period_type.nil? && !period.nil?)) \n\t\t case period.to_s\n\t\t\t when 'today'\n\t\t\t\t@from = @to = Date.today\n\t\t\t when 'yesterday'\n\t\t\t\t@from = @to = Date.today - 1\n\t\t\t when 'current_week'\n\t\t\t\t@from = getStartDay(Date.today - (Date.today.cwday - 1)%7)\n\t\t\t\t@to = @from + 6\n\t\t\t when 'last_week'\n\t\t\t\t@from =getStartDay(Date.today - 7 - (Date.today.cwday - 1)%7)\n\t\t\t\t@to = @from + 6\n\t\t\t when '7_days'\n\t\t\t\t@from = Date.today - 7\n\t\t\t\t@to = Date.today\n\t\t\t when 'current_month'\n\t\t\t\t@from = Date.civil(Date.today.year, Date.today.month, 1)\n\t\t\t\t@to = (@from >> 1) - 1\n\t\t\t when 'last_month'\n\t\t\t\t@from = Date.civil(Date.today.year, Date.today.month, 1) << 1\n\t\t\t\t@to = (@from >> 1) - 1\n\t\t\t when '30_days'\n\t\t\t\t@from = Date.today - 30\n\t\t\t\t@to = Date.today\n\t\t\t when 'current_year'\n\t\t\t\t@from = Date.civil(Date.today.year, 1, 1)\n\t\t\t\t@to = Date.civil(Date.today.year, 12, 31)\n\t end\n\t\telsif period_type == '2' || (period_type.nil? && (!fromdate.nil? || !todate.nil?))\n\t\t begin; @from = fromdate.to_s.to_date unless fromdate.blank?; rescue; end\n\t\t begin; @to = todate.to_s.to_date unless todate.blank?; rescue; end\n\t\t @free_period = true\n\t\telse\n\t\t # default\n\t\t # 'current_month'\t\t\n\t\t\t@from = Date.civil(Date.today.year, Date.today.month, 1)\n\t\t\t@to = (@from >> 1) - 1\n\t end \n\t\t\n\t\t@from, @to = @to, @from if @from && @to && @from > @to\n\n\tend",
"def retrieve_date_range\n\t\t@free_period = false\n\t\t@from, @to = nil, nil\n\t\tperiod_type = session[controller_name][:period_type]\n\t\tperiod = session[controller_name][:period]\n\t\tfromdate = session[controller_name][:from]\n\t\ttodate = session[controller_name][:to]\n\t\t\n\t\tif (period_type == '1' || (period_type.nil? && !period.nil?)) \n\t\t case period.to_s\n\t\t\t when 'today'\n\t\t\t\t@from = @to = Date.today\n\t\t\t when 'yesterday'\n\t\t\t\t@from = @to = Date.today - 1\n\t\t\t when 'current_week'\n\t\t\t\t@from = getStartDay(Date.today - (Date.today.cwday - 1)%7)\n\t\t\t\t@to = @from + 6\n\t\t\t when 'last_week'\n\t\t\t\t@from =getStartDay(Date.today - 7 - (Date.today.cwday - 1)%7)\n\t\t\t\t@to = @from + 6\n\t\t\t when '7_days'\n\t\t\t\t@from = Date.today - 7\n\t\t\t\t@to = Date.today\n\t\t\t when 'current_month'\n\t\t\t\t@from = Date.civil(Date.today.year, Date.today.month, 1)\n\t\t\t\t@to = (@from >> 1) - 1\n\t\t\t when 'last_month'\n\t\t\t\t@from = Date.civil(Date.today.year, Date.today.month, 1) << 1\n\t\t\t\t@to = (@from >> 1) - 1\n\t\t\t when '30_days'\n\t\t\t\t@from = Date.today - 30\n\t\t\t\t@to = Date.today\n\t\t\t when 'current_year'\n\t\t\t\t@from = Date.civil(Date.today.year, 1, 1)\n\t\t\t\t@to = Date.civil(Date.today.year, 12, 31)\n\t end\n\t\telsif period_type == '2' || (period_type.nil? && (!fromdate.nil? || !todate.nil?))\n\t\t begin; @from = fromdate.to_s.to_date unless fromdate.blank?; rescue; end\n\t\t begin; @to = todate.to_s.to_date unless todate.blank?; rescue; end\n\t\t @free_period = true\n\t\telse\n\t\t # default\n\t\t # 'current_month'\t\t\n\t\t\t@from = Date.civil(Date.today.year, Date.today.month, 1)\n\t\t\t@to = (@from >> 1) - 1\n\t end \n\t\t\n\t\t@from, @to = @to, @from if @from && @to && @from > @to\n\n\tend",
"def advent_days(year:)\n min_day .. max_day(year: year)\n end",
"def range\n @range ||= set_range\n end",
"def report_period_to_range\n daily_report = false\n range = case self\n when 'this_month'\n daily_report = true\n (Date.today.beginning_of_month..Date.today)\n when 'last_month'\n daily_report = true\n (1.month.ago.to_date.beginning_of_month..1.month.ago.to_date.end_of_month)\n when 'last_6_months'\n (5.months.ago.to_date.beginning_of_month..Date.today).select {|d| d.day == 1}\n when 'this_year'\n (Date.today.beginning_of_year..Date.today).select {|d| d.day == 1}\n end\n [range, daily_report]\n end",
"def verifyCalendarDate\n # Make sure the given year is not less than 1900.\n if @year < 1900\n @year = 1900\n end\n\n # Make sure the month is within range.\n if @month > 12\n @month = 12\n end\n if @month < 1\n @month = 1\n end\n\n # Make sure the day given is within range of the month.\n month_length = CDK::CALENDAR.getMonthLength(@year, @month)\n if @day < 1\n @day = 1\n end\n if @day > month_length\n @day = month_length\n end\n end",
"def for_date_range(beginning:, ending:)\n new_with_date_range(beginning, ending)\n end",
"def test_outside_time_range2\n # outside of time-range, hidden\n blob = <<ICS\nBEGIN:VCALENDAR\nBEGIN:VEVENT\nUID:foobar7\nDTSTART:20110104T090000Z\nDTEND:20110104T100000Z\nEND:VEVENT\nEND:VCALENDAR\nICS\n\n assert_free_busy_report(\n '',\n blob\n )\n end",
"def extend_empty_end_date\n if self.end_date == self.start_date && !self.repeat_mode.rule.empty?\n self.end_date = Date.today + 10.year\n end\n return self\n end",
"def sred_range_for_date(date=today_as_date)\n start_of_year = (Date.new(date.year, 1, 1)..Date.new(date.year, 7, 31))\n if start_of_year.include?(date)\n return \"#{(date.year - 1)}/#{date.year}\"\n else\n return \"#{date.year}/#{date.year + 1}\"\n end\n end",
"def age_range\n 18..99\n end",
"def date_range_to_string(date_range)\n \"%s - %s\" % [date_range[0], date_range[1]] rescue nil \n end",
"def range\n beginning_of_period..(self.next_year).beginning_of_period\n end",
"def event_start_for_solr\n # return event_start.iso8601[0,19]+'Z'\n start_date = event_start\n\t \n start_date = entry_deadline if is_opportunity?\n \n\t return FinderHelper.date_for_solr_ymd(start_date)\n end",
"def padding_for_calendar\n (fmwday == 0 ? (0..5) : (0...fmwday - 1)).map { '' }\n end",
"def format_event_date(start_date, end_date)\n d1 = Date.parse(start_date) rescue nil\n d2 = Date.parse(end_date) rescue nil\n (d1 && d2) ? (d1..d2) : [d1, d2].compact\n end",
"def start_and_end_date_range\n unless self.start_datetime.nil? || self.end_datetime.nil?\n oldest_start_datetime = self.active_sale_events.not_blank_and_sorted_by(:start_datetime).first\n latest_end_datetime = self.active_sale_events.not_blank_and_sorted_by(:end_datetime).last\n errors.add(:start_datetime, I18n.t('spree.active_sale.event.validation.errors.invalid_root_dates')) if (oldest_start_datetime.nil? && latest_end_datetime.nil?) ? false : (self.start_datetime > oldest_start_datetime || self.end_datetime < latest_end_datetime)\n end\n end",
"def initialize(param)\n case param\n when Range\n super(param.begin, param.end, param.exclude_end?)\n when Date\n super(param, param.next_year - 1.day)\n else\n super\n end\n end",
"def range; end",
"def range; end",
"def range; end",
"def test_outside_time_range\n # outside of time-range, hidden\n blob = <<ICS\nBEGIN:VCALENDAR\nBEGIN:VEVENT\nUID:foobar6\nDTSTART:20110101T090000Z\nDTEND:20110101T100000Z\nEND:VEVENT\nEND:VCALENDAR\nICS\n\n assert_free_busy_report(\n '',\n blob\n )\n end",
"def unavailable_date_ranges_from_today\n self.reservations\n .where('end_date > ?', Date.today())\n .where(status: [1, 5])\n .map {|item| [item.start_date, item.end_date]}\n end",
"def _reduce_202(val, _values, result)\n result = new_irange(val[0], val[1], val[2])\n \n result\nend",
"def initialize\n super\n @lower_limit = DayOfWeekLowerLimit\n @upper_limit = DayOfWeekUpperLimit\n @single_value_pattern = DayOfWeekSingleValuePattern\n @range_pattern = DayOfWeekRangePattern\n end",
"def retrieve_date_range\n\t\t@free_period = false\n\t\t@from, @to = nil, nil\n\t\tperiod_type = session[:wkpayroll][:period_type]\n\t\tperiod = session[:wkpayroll][:period]\n\t\tfromdate = session[:wkpayroll][:from]\n\t\ttodate = session[:wkpayroll][:to]\n\t\t\n\t\tif (period_type == '1' || (period_type.nil? && !period.nil?)) \n\t\t case period.to_s\n\t\t\t when 'today'\n\t\t\t\t@from = @to = Date.today\n\t\t\t when 'yesterday'\n\t\t\t\t@from = @to = Date.today - 1\n\t\t\t when 'current_week'\n\t\t\t\t@from = getStartDay(Date.today - (Date.today.cwday - 1)%7)\n\t\t\t\t@to = @from + 6\n\t\t\t when 'last_week'\n\t\t\t\t@from =getStartDay(Date.today - 7 - (Date.today.cwday - 1)%7)\n\t\t\t\t@to = @from + 6\n\t\t\t when '7_days'\n\t\t\t\t@from = Date.today - 7\n\t\t\t\t@to = Date.today\n\t\t\t when 'current_month'\n\t\t\t\t@from = Date.civil(Date.today.year, Date.today.month, 1)\n\t\t\t\t@to = (@from >> 1) - 1\n\t\t\t when 'last_month'\n\t\t\t\t@from = Date.civil(Date.today.year, Date.today.month, 1) << 1\n\t\t\t\t@to = (@from >> 1) - 1\n\t\t\t when '30_days'\n\t\t\t\t@from = Date.today - 30\n\t\t\t\t@to = Date.today\n\t\t\t when 'current_year'\n\t\t\t\t@from = Date.civil(Date.today.year, 1, 1)\n\t\t\t\t@to = Date.civil(Date.today.year, 12, 31)\n\t end\n\t\telsif period_type == '2' || (period_type.nil? && (!fromdate.nil? || !todate.nil?))\n\t\t begin; @from = fromdate.to_s.to_date unless fromdate.blank?; rescue; end\n\t\t begin; @to = todate.to_s.to_date unless todate.blank?; rescue; end\n\t\t @free_period = true\n\t\telse\n\t\t # default\n\t\t # 'current_month'\t\t\n\t\t\t@from = Date.civil(Date.today.year, Date.today.month, 1)\n\t\t\t@to = (@from >> 1) - 1\n\t end \n\t\t\n\t\t@from, @to = @to, @from if @from && @to && @from > @to\n\n\tend",
"def report_range(start_date, end_date)\n @start_date = start_date\n @end_date = end_date\n end",
"def range_for period \n (period / ( 60 * 60 * 24 ) * -1)..-1\n end",
"def auto_range(direction); end",
"def validity_period\n super\n end",
"def from_ranges\n self[:date_time_slot] = RangeSupport.range_to_string(self[:date_time_slot])\n end",
"def clear_calendar\n end",
"def day=(_arg0); end",
"def start_date\n @start_date ||= Date.today - Date.today.wday - 7 * 52\nend",
"def dates\n end",
"def normalize_time(start_time, end_time=nil, format: :hcal, context: nil)\n if end_time.nil? and start_time.respond_to?(:start_time)\n end_time = start_time.end_time\n start_time = start_time.start_time\n end\n TimeRange.new(start_time, end_time, format, context).to_s.html_safe\n end"
] |
[
"0.66434234",
"0.6612971",
"0.6612971",
"0.6565703",
"0.65058154",
"0.6262707",
"0.6219479",
"0.6215323",
"0.6175778",
"0.6155572",
"0.61468124",
"0.6130412",
"0.61277306",
"0.6093429",
"0.60907793",
"0.60903525",
"0.6088403",
"0.6065767",
"0.6065767",
"0.60622823",
"0.6059741",
"0.6052052",
"0.6043727",
"0.60390896",
"0.6038353",
"0.6034872",
"0.6021727",
"0.6016457",
"0.60053194",
"0.59553474",
"0.59421617",
"0.59188265",
"0.5900123",
"0.58986044",
"0.5884804",
"0.58792734",
"0.58625114",
"0.58547",
"0.585234",
"0.58505255",
"0.58497113",
"0.5848433",
"0.58450484",
"0.58444035",
"0.5841989",
"0.58318055",
"0.58110344",
"0.58070296",
"0.5803354",
"0.57776845",
"0.5773546",
"0.5771607",
"0.5771104",
"0.5758022",
"0.5753022",
"0.5749136",
"0.5740172",
"0.5739665",
"0.57373434",
"0.5721014",
"0.57171476",
"0.571711",
"0.57158256",
"0.5703814",
"0.56908894",
"0.56851125",
"0.56851125",
"0.5681584",
"0.56807476",
"0.56737477",
"0.56606376",
"0.56594115",
"0.56516427",
"0.5642609",
"0.5642443",
"0.5641879",
"0.5628414",
"0.56179136",
"0.5602522",
"0.5600777",
"0.55942535",
"0.55887705",
"0.55675566",
"0.5563039",
"0.5563039",
"0.5563039",
"0.5555939",
"0.55421346",
"0.554006",
"0.55294156",
"0.55280155",
"0.55230266",
"0.5521778",
"0.5520034",
"0.55161893",
"0.5510179",
"0.55056375",
"0.5502498",
"0.54991627",
"0.54931307",
"0.54883057"
] |
0.0
|
-1
|
Returns a +key+ from the config.
|
def [](key)
config[key.to_s] || config[key.to_sym]
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get(key)\n self.config[key]\n end",
"def get(key)\n @config_hash[key]\n end",
"def config_for_key(key)\n settings.config[key]\n end",
"def get(key)\n\t\t\treturn @config[key]\n\t\tend",
"def [](key)\n config[key]\n end",
"def [](key)\n @config[key]\n end",
"def [](key)\n @config[key]\n end",
"def get_config(key)\n config.__send__(key)\n end",
"def [](key)\n config[key]\n end",
"def [](key)\n @config[key]\n end",
"def [](key)\n load_config unless @config\n @config[key]\n end",
"def [](key)\n configuration[key.to_sym]\n end",
"def [](key)\n @configuration[key.to_s]\n end",
"def get!(key)\n rv = @config.get(key)\n return rv\n end",
"def [](key)\n configuration[key]\n end",
"def get(key)\n key = key.to_s\n %w(local_config app_config m2mhub_config).each do |config_key|\n if (config = @yaml_config[config_key])\n if config_key == 'app_config'\n next unless config = config[Rails.env.downcase]\n end\n if config.member?(key)\n return config[key]\n end\n end\n end\n nil\n end",
"def get_key(env_name, config_key)\n # First read in ENV\n return ENV[env_name] if ENV[env_name]\n\n # Otherwise read from _config.yml\n if @config['algolia'] && @config['algolia'][config_key]\n return @config['algolia'][config_key]\n end\n\n nil\n end",
"def locate_config_value(key)\n key = key.to_sym\n config[key] || Chef::Config[:knife][key]\n end",
"def [](key)\n ensure_config_loaded!\n if setting = setting_for(key.to_s)\n setting.value\n end\n end",
"def [](k)\n @config[k]\n end",
"def [](key)\n resolved_config[key]\n end",
"def get_config key, default = nil\n name_key = my_short_name.to_sym\n\n if Bot::Conf.has_key? name_key\n if Bot::Conf[name_key].has_key? key\n return Bot::Conf[name_key][key]\n end\n end\n\n default\n end",
"def app_config_key\n return @app_config_key\n end",
"def get(key)\n subkeys = key.split('.')\n lastkey = subkeys.pop\n subhash = subkeys.inject(@config) do |hash, k|\n hash[k]\n end\n return nil if subhash.nil?\n\n subhash.key?(lastkey) ? subhash[lastkey] : nil\n end",
"def get_config(key)\n if config.key? key\n config[key]\n else\n application.default_config[key]\n end\n end",
"def value_for_key(keypath = '')\n cfg = @settings\n real_path = ['config']\n unless keypath =~ /^[.*]?$/\n real_path = resolve_key_path(keypath, create: false)\n return nil unless real_path&.count&.positive?\n\n cfg = cfg.dig(*real_path)\n end\n\n cfg.nil? ? nil : { real_path[-1] => cfg }\n end",
"def [] key\n @config[key.to_s]\n end",
"def get(name)\n @config[name]\n end",
"def key\n key = config[:key] || flags.last.sub(/\\A--?/, '')\n key = key.tr '-', '_' if underscore_flags?\n key.to_sym\n end",
"def [](key)\n (@configuration ||= setup)[key]\n end",
"def [](key)\n (@configuration ||= setup)[key]\n end",
"def [](k)\n @my_conf[k]\n end",
"def app_config_key_value\n return @app_config_key_value\n end",
"def get key\n deserialize backend.get key.to_s rescue nil\n end",
"def key(config)\n # By default we use all params and metrics\n sb = []\n sb.push(self.handle)\n sb.push(config['params'].flatten) if config['params']\n sb.push((config['metrics'] || default_metrics).flatten)\n sb.flatten.join('_')\n end",
"def get_config_val(container, key, raise_on_unknown_key = true)\n key = key.to_sym\n if raise_on_unknown_key && !container.keys.include?(key)\n raise RtfileError.new(\"You requested an unknown key: #{ key.inspect }\")\n end\n container[key]\n end",
"def read_config_entry(key)\n if $has_config.call then\n curr_config = YAML.load(File.read($config_filename))\n else\n return nil\n end\n\n curr_config[key]\nend",
"def api_key\n @api_key ||= config_value.split('-')[1].chomp\n end",
"def get_config(key)\n\t\t@conn.config.get_property(key, '')\n\tend",
"def name\n config[\"name\"]\n end",
"def get_key(line)\n line.match(/-k ([^ ]+)/)[1]\n end",
"def key_pair(key_name)\n key_pairs(key_name)[0]\n end",
"def key\n (key_name || name).to_sym\n end",
"def get_key(name)\n return data_bag_item('rndc_keys', name).to_hash if node['dhcp']['use_bags']\n node['dhcp']['rndc_keys'].fetch name, ''\n end",
"def [](var)\n return @config[var]\n end",
"def config_primary_key_for(name)\n Redcrumbs.send(\"#{name}_primary_key\")\n rescue NoMethodError\n nil\n end",
"def config\n name.split('_')[2] || 'default'\n end",
"def key\n params.k\n end",
"def key_from_path(path)\n path.basename.to_s.split('.', 2).first.to_sym\n end",
"def get_key(id)\n @keys[id]\n end",
"def key\n @key ||= name.to_s\n end",
"def key_name\n data[:key_name]\n end",
"def config_key_path(partial_path)\n \"consul-alerts/config/#{partial_path}\"\nend",
"def key\n @key or raise MissingKey\n end",
"def key\n model.extract_key(path)\n end",
"def app_config_key=(value)\n @app_config_key = value\n end",
"def [](key)\n if config = configs[key]\n config.get(receiver)\n else\n store[key]\n end\n end",
"def key\n attributes[:key]\n end",
"def key\n attributes['key'] or raise NoKeySpecified\n end",
"def configuration(key = :default)\n configurations[configuration_key(key)]\n end",
"def cget item, key\n return @item_config[item][key]\n end",
"def tcfg_get(key)\n t_tcfg = tcfg\n unless t_tcfg.key? key\n raise NoSuchConfigurationKeyError, \"No configuration defined for '#{key}'\"\n end\n t_tcfg[key]\n end",
"def config_value_for(key)\n cmd = executable_command config_value_str(key)\n value = `#{cmd}`.strip\n value = nil if value == ''\n value\n end",
"def setting_for(key)\n ensure_config_loaded!\n setting_class.find_by_key(key.to_s)\n end",
"def namespace_key(name)\n namespaces[name][:key]\n end",
"def getKey; @args.map { |a| a.to_s }.join(':').to_sym end",
"def get_key(key)\n return self.has_key?(key) ? self[key] : nil\n end",
"def [](attr)\n config[attr]\n end",
"def key \n path\n end",
"def ssh_key(name)\n Config::Core::File.new(@path + \"ssh-key-#{name}\")\n end",
"def fetch_config_value(key)\n valid_value = valid_config_value(::NewRelic::Agent.config[key].to_s.to_sym)\n ::NewRelic::Agent.logger.debug(\"Using #{valid_value} configuration value for #{self.name} to configure instrumentation\")\n return valid_value\n end",
"def cloud_config_yaml_key\n self.prefix_key('cloud_config.yaml')\n end",
"def cloud_config_yaml_key\n self.prefix_key('cloud_config.yaml')\n end",
"def key\n @attributes[:key]\n end",
"def key\n @attributes[:key]\n end",
"def name\n @config.name\n end",
"def key\n name.underscore.tr('/', '_').to_sym\n end",
"def api_key\n config.api_key\n end",
"def api_key\n config.api_key\n end",
"def get(key, default=nil)\n rv = nil\n\n [*key].each do |k|\n # Lets check for this key\n rv = @config.get(k.to_s)\n break unless rv.nil?\n\n # If it doesn't exist, check with env\n rv = @config.get(KnoxBoxWeb::Application.environment.to_s << '.' << k.to_s)\n break unless rv.nil?\n end\n\n return default if rv.nil?\n return rv\n end",
"def get key\n storage[key]\n end",
"def key; @opts['key'] end",
"def app_config_key_type\n return @app_config_key_type\n end",
"def key\n @key.id2name\n end",
"def get\n unless key = shift_argument\n error(\"Usage: heroku config:get KEY\\nMust specify KEY.\")\n end\n validate_arguments!\n\n vars = api.get_config_vars(app).body\n key, value = vars.detect {|k,v| k == key}\n if options[:shell] && value\n out = $stdout.tty? ? Shellwords.shellescape(value) : value\n display(\"#{key}=#{out}\")\n else\n display(value.to_s)\n end\n end",
"def [](name)\n @configs[name]\n end",
"def [](name)\n @configs[name]\n end",
"def read_key; end",
"def key\n raise MissingID if not defined?(@id)\n model.key[id]\n end",
"def key_for(entry)\n entry\n end",
"def get key\n @redis.get key\n end",
"def config_get(id)\n Configuration.get(id)\n end",
"def full_key\n [name, key].join(\"/\")\n end",
"def key\n return @key\n end",
"def key\n return @key\n end",
"def key(key_id)\n from_resource :key,\n connection.get(api_uri(\"keys/#{key_id}\"))\n end",
"def key\n @key\n end",
"def key\n @key\n end",
"def read_key(key)\n if File.exist?(key.to_s) && File.file?(key.to_s)\n File.read(File.absolute_path(key))\n else\n key\n end\n end",
"def get_balanced_key\n config = YAML.load_file(\"#{Rails.root.to_s}/config/balanced.yml\")[Rails.env]\n Balanced.configure(config['BALANCED_KEY'])\n\n end"
] |
[
"0.7576577",
"0.7550113",
"0.7536905",
"0.7494042",
"0.73419994",
"0.7294743",
"0.72859585",
"0.72632974",
"0.7247787",
"0.72214115",
"0.7215542",
"0.7211381",
"0.7144439",
"0.71031606",
"0.69765043",
"0.6850175",
"0.683712",
"0.682809",
"0.681057",
"0.68102217",
"0.67995393",
"0.67610115",
"0.6721359",
"0.6710761",
"0.6707144",
"0.6685062",
"0.6624673",
"0.65356237",
"0.65170664",
"0.64998317",
"0.64998317",
"0.6490551",
"0.6465035",
"0.64100283",
"0.64023066",
"0.6388312",
"0.6358589",
"0.633826",
"0.63232553",
"0.6306211",
"0.62757725",
"0.62653416",
"0.6255174",
"0.6218277",
"0.6208208",
"0.62063897",
"0.6195418",
"0.6161787",
"0.61498284",
"0.61335033",
"0.6112005",
"0.60923713",
"0.60917854",
"0.60875463",
"0.60760725",
"0.6073652",
"0.60646814",
"0.60468894",
"0.604518",
"0.6029193",
"0.60221595",
"0.59971637",
"0.598732",
"0.59852886",
"0.59744674",
"0.59720826",
"0.5971564",
"0.59698236",
"0.5962744",
"0.595793",
"0.59525824",
"0.59399235",
"0.59399235",
"0.59187394",
"0.59187394",
"0.590478",
"0.59010595",
"0.58967495",
"0.58967495",
"0.58952916",
"0.5889646",
"0.58717877",
"0.58599824",
"0.58545905",
"0.58460885",
"0.5837828",
"0.5837828",
"0.5830619",
"0.58233446",
"0.5821055",
"0.58023745",
"0.5794836",
"0.5793057",
"0.5785009",
"0.5785009",
"0.578357",
"0.578176",
"0.578176",
"0.5776282",
"0.577155"
] |
0.7156406
|
12
|
Returns the full path to the config file.
|
def config_file
File.join AppRoot, ConfigFile
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def config_path\n @config_path ||= local_config_path\n end",
"def path\n @path ||= File.dirname @config_file\n end",
"def relative_config_file\n File.join(@settings[:config_dir], @settings[:config_file])\n end",
"def app_config_path\n Pathname.new('.').join('config')\n end",
"def getConfigPath\n if @conf[:config_name].index('/')\n return @conf[:config_name] if File.file?(@conf[:config_name])\n else \n @conf[:config_dirs].each {|i|\n r = Pathname.new(i) + @conf[:config_name]\n return r if File.file?(r)\n }\n end\n\n CliUtils.warnx \"no config file '#{@conf[:config_name]}' found\" if @conf[:verbose] >= 2\n return nil\n end",
"def full_configuration_path\n @full_config_path ||= File.join(self.class.config_base_path, self.class.config_path)\n end",
"def configuration_file_path; end",
"def cfg_dir\n File.join(@full_path, CONFIG_DIR)\n end",
"def config_path\n if result = chef_api_config_path\n Pathname(result).expand_path\n else\n Pathname(\"\")\n end\n end",
"def config_file\n CONFIG_FILE\n end",
"def find_config_path\n path = Pathname(Pathname.pwd).ascend{|d| h=d+config_filename; break h if h.file?}\n end",
"def config_file\n File.join(@path, %w[ application config application.php ])\n end",
"def config_file\n @config_file\n end",
"def config_path\n ::Rails.root.to_s + \"/config/#{self.name.split('::').last.underscore.pluralize}.yml\"\n end",
"def path\n @path || File.expand_path(ENV['NEXUS_CONFIG'] || DEFAULT_FILE)\n end",
"def config_path\n @config_path ||= 'config/spinach.yml'\n end",
"def config_file\n @config_file ||= File.join( home_dir, TyrantManager.config_file_basename )\n end",
"def config_file_path(full_directory_path)\r\n config_path = File.join(full_directory_path, @folder_config)\r\n logger.debug('config_file_path') { \"Config file path: #{config_path}\"}\r\n config_path\r\n end",
"def config_file\n File.join(root, 'config.yml')\n end",
"def config_file_path(config_file_path=nil)\n @config_file_path ||= config_file_path || File.join(config_path, config_filename)\n end",
"def plugin_config_file\n File.join(@dir, Config::FILE_NAME)\n end",
"def get_file_path(filename)\n # dir = File.realdirpath(File.join(File.dirname(__FILE__), '..', 'config'))\n File.join(@dir, filename)\n end",
"def base_config_path\n BASE_CONFIG_PATH\n end",
"def path\n @configuration.path\n end",
"def config_path\n Gym.cache[:config_path] ||= \"#{Tempfile.new('gym_config').path}.plist\"\n return Gym.cache[:config_path]\n end",
"def config_file\n \"#{confdir}/config.yml\"\n end",
"def config_path\n Gym.cache[:config_path] ||= \"/tmp/gym_config_#{Time.now.to_i}.plist\"\n return Gym.cache[:config_path]\n end",
"def config_filename\n return @config_filename if @config_filename\n\n @config_filename = File.join(config_directory, \"config\")\n end",
"def config_path\n File.join(solr_home, 'conf')\n end",
"def get_config_path()\n return ENV['DOCS_CONFIG_PATH'] || CONFIG_PATH_DEFAULT\n end",
"def configuration_file\n @config_file_name ||= MyRhouse.confpath( \"#{config_file_name}.yml\" )\n end",
"def configuration_file\n gitpusshuten_root + '/config.rb'\n end",
"def config_dir\n dir = options[:config] ? File.dirname(options[:config]) : './config'\n File.expand_path(dir)\n end",
"def config_file_path\n rails_root + \"/config/redis.conf\"\n end",
"def config_file\n FilePath.new(@directory, 'tc-config.xml')\n end",
"def config_path\n etc+\"php/\"\n end",
"def config_file_name\n @config_file_name || Pdm.config_file\n end",
"def chef_config_path\n if Chef::Config['config_file']\n ::File.dirname(Chef::Config['config_file'])\n else\n raise(\"No chef config file defined. Are you running \\\nchef-solo? If so you will need to define a path for the ohai_plugin as the \\\npath cannot be determined\")\n end\n end",
"def lockfile_path\n config.pwd.join(LOCKFILE)\n end",
"def get_uplift_config_file \n config_dir_path = get_uplift_config_folder\n file_name = \".vagrant-network.yaml\"\n\n return File.join(config_dir_path, file_name) \n end",
"def get_config_directory()\n\t\t\tconfig_directory= File.join(@base_directory, \"config\")\n\t\t\treturn config_directory\n\t\tend",
"def global_config_path\n linux_cfg = '/etc/openshift/' + conf_name\n File.exists?(linux_cfg) ? linux_cfg : File.join(File.expand_path(File.dirname(__FILE__) + \"/../../conf\"), conf_name)\n end",
"def default_path\n Pathname.pwd.join(*base_config_path, self.class.config_folder)\n end",
"def empty_config_file_path\n ::File.expand_path '../../../support/empty_resolv.conf', __FILE__\n end",
"def get_config_file_for(name)\n if File.exists?(\"#{user_dir}/config/#{name}\")\n \"#{user_dir}/config/#{name}\"\n else\n \"#{root_dir}/config/#{name}\"\n end\n end",
"def package_config\n File.join @proj_path_base, 'packages.config'\n end",
"def get_configuration_file\n file = PREFERENCES_LEGACY\n file = PREFERENCES if File.exists? '/usr/libexec/opendirectoryd'\n file\n end",
"def core_cfg_path\n File.expand_path(ENV[\"DBS_CFGDIR\"].presence || \"~/.db_sucker\")\n end",
"def config_file\n send_command(:getinfo, 'config-file')\n reply = read_reply.split('=').last\n read_reply # skip \"250 OK\"\n Pathname(reply)\n end",
"def config\n @config_file\n end",
"def config_dir\n \"#{gem_dir}/config\"\n end",
"def config_dir\n \"#{gem_dir}/config\"\n end",
"def conf_folder\n conf['conf_folder'] || '.'\n end",
"def chef_config_path\n Berkshelf.root.join(\"spec/config/knife.rb\").to_s\n end",
"def active_configuration_path\n configuration_paths.find do |path|\n File.file? path\n end || theme_configuration_path\n end",
"def config_path\n test? ? \"config-test.yml\" : \"config.yml\"\n end",
"def config_path\n NginxStage.pun_config_path(user: user)\n end",
"def config_path(arg = nil)\n set_or_return(:config_path,\n arg,\n kind_of: String,\n default: '/etc/hipache.json')\n end",
"def config_path\n ENV.fetch(\"SIMPLE_SCHEDULER_CONFIG\", \"config/simple_scheduler.yml\")\n end",
"def app_config_file(filename)\n File.read(File.dirname(__FILE__)+\"/../../app/config/\" + filename).split(\"\\n\")\nend",
"def config_path(svc_name)\n # strip st2 prefix\n noprefix_name = svc_name.sub(/^st2/, '')\n config_name = ['logging', noprefix_name, 'conf'].compact.join('.')\n File.join([spec[:conf_dir], config_name])\n end",
"def find_config_file\n\n root_directory = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))\n app_config = File.join(root_directory, CONFIG_FILE_NAME)\n global_config = File.join('/etc', CONFIG_FILE_NAME)\n\n [app_config, global_config].each do |config_file|\n return config_file if File.exists?(config_file)\n end\n\n nil\n\n end",
"def current_texte_path\n config = File.open('./.config.msh','rb'){|f|Marshal.load(f)}\n config[:last_file_path]\n end",
"def config_directory\n \"C:\\\\chef\"\n end",
"def conf_file(name)\n user_conf = File.join(PoolParty.user_dir, \"config\", name)\n if File.file?(user_conf)\n File.join(PoolParty.user_dir, \"config\", name)\n else\n File.join(PoolParty.root_dir, \"config\", name)\n end \n end",
"def fake_config_path_relative_to_project(file_name)\n File.join(\"spec/support/upsteem/deploy/fake_config\", file_name)\n end",
"def filepath\n\t\t\tFile.join(TsungWrapper.config_dir, 'data', @filename)\n\t\tend",
"def configru_path\n @configru_path ||= if ::File.directory?(new_resource.path)\n ::File.join(new_resource.path, 'config.ru')\n else\n new_resource.path\n end\n end",
"def log_path\n case Merb::Config[:log_file]\n when String then File.dirname(Merb::Config[:log_file])\n else Merb.root_path(\"log\")\n end\n end",
"def log_path\n case Merb::Config[:log_file]\n when String then File.dirname(Merb::Config[:log_file])\n else Merb.root_path(\"log\")\n end\n end",
"def filename( )\n @configFileDNE\n end",
"def config_dev_path\n File.join test_app_path, 'config', 'deploy', 'dev.rb'\n end",
"def maintenance_config_file_path\n File.join shared_path, 'config', 'maintenance.json'\n end",
"def _spec_conf_dir(file)\n specdir = Dir.new('./spec/conf/')\n File.join(specdir.path, file)\nend",
"def _spec_conf_dir(file)\n specdir = Dir.new('./spec/conf/')\n File.join(specdir.path, file)\nend",
"def john_config_file\n ::File.join(::Msf::Config.data_directory, \"jtr\", \"john.conf\")\n end",
"def log_path\n @options['log_path'] ? File.expand_path(@options['log_path'], @config.root) : default_log_path\n end",
"def config_filepath(name)\n File.expand_path(\"../fixtures/configs/#{name}.yaml\", __dir__)\nend",
"def config_path(config_type)\n config_type = config_type.to_s\n if (config_path = config_options.fetch(\"#{config_type}_config_path\".to_sym, nil))\n raise ConfigurationError, \"file does not exist #{config_path}\" unless ::File.file? config_path\n return ::File.expand_path(config_path)\n end\n\n # if solr, attempt to use path where fedora.yml is first\n if config_type == \"solr\" && (config_path = check_fedora_path_for_solr)\n return config_path\n end\n\n if defined?(Rails.root)\n config_path = \"#{Rails.root}/config/#{config_type}.yml\"\n return config_path if ::File.file? config_path\n end\n\n return \"#{Dir.getwd}/config/#{config_type}.yml\" if ::File.file? \"#{Dir.getwd}/config/#{config_type}.yml\"\n\n # Last choice, check for the default config file\n config_path = ::File.join(ActiveFedora.root, \"config\", \"#{config_type}.yml\")\n raise ConfigurationError, \"Couldn't load #{config_type} config file!\" unless ::File.file?(config_path)\n\n ActiveFedora::Base.logger.warn \"Using the default #{config_type}.yml that comes with active-fedora. If you want to override this, pass the path to #{config_type}.yml to ActiveFedora - ie. ActiveFedora.init(:#{config_type}_config_path => '/path/to/#{config_type}.yml') - or set Rails.root and put #{config_type}.yml into \\#{Rails.root}/config.\"\n config_path\n end",
"def get_uplift_config_folder\n path = File.expand_path(@@config_file_path)\n FileUtils.mkdir_p path\n\n return path\n end",
"def config_file\n env_config['config_file'] || raise('environment problem:environment information not loaded')\n end",
"def config_path=(value)\n @config_path = value\n end",
"def chef_api_config_path\n ENV[\"CHEF_API_CONFIG\"] || if ENV.key?(\"HOME\")\n \"~/.chef-api\"\n else\n nil\n end\n end",
"def config_dir\n runtime_config.generated_files_dir\n end",
"def config_filename\n @config_filename || 'config/database.yml'\n end",
"def config\n root.join('config', 'environment.rb')\n end",
"def config\n path = \"./\"\n path = \"config/\" if File.exists?(\"config/\")\n if config_exists?(path) && !Opt[:force]\n puts \"Config file already exists\"\n exit\n else\n FileUtils.copy(File.dirname(__FILE__) + \"/#{CONFIG_FILE}\", path)\n puts \"Copied config file to #{path}\"\n end\n end",
"def confdir\n cli_confdir = cli[:confdir]\n global = global_config_dir\n if !cli_confdir.nil?\n return cli_confdir\n elsif File.directory?(global)\n return global\n else\n return user_config_dir\n end\n end",
"def custom_config_path\n argv.each_with_index do |arg, index|\n if arg == \"--config-path\" || arg == \"-c\"\n next_arg = argv[index + 1]\n raise ConfigPathNotProvided.new if next_arg.nil?\n raise ConfigPathInvalid.new(next_arg) unless File.file?(next_arg) && File.readable?(next_arg)\n\n return next_arg\n end\n end\n nil\n end",
"def file_path\n PATH_USER_DEFAULTS\n end",
"def resource_default_config_path\n type_string = instance_variable_defined?(:@new_resource) ? new_resource.declared_type.to_s : resource_name.to_s\n config_path = Array(type_string.gsub(/(grafana_)(config_)?/, '').split('_').join('.'))\n\n Chef::Log.debug(\"resource_default_config_path: Generated config path #{config_path}\")\n raise if nil_or_empty?(config_path)\n\n config_path\n end",
"def template_path(name)\n File.join(__dir__, 'config', \"#{name}.yml.erb\")\n end",
"def gemfile_path\n @gemfile_path ||= GEMFILES.map { |g| @config.pwd.join g }\n .find { |f| f.exist? }\n end",
"def project_config_file\n config_file = {}\n\n if ::File.exists?(@config_file)\n config_file = @global.load_ruby_config(@config_file)\n else\n @task.say_error \"Could not find the config file!\", \"Are you sure you're in a marv project directory?\", false\n abort\n end\n\n return config_file\n end",
"def template_dir\n File.dirname(__FILE__) + '/../cfg'\n end",
"def configuration_file_for(target_dir); end",
"def template_path\n path = File.expand_path File.join(@template_options[CONFIG_PATH], @template_options[TEMPLATE_NAME])\n # TODO fix and throw some sort of cool exception\n if !File.exists? path\n path = nil\n end\n return path\n end",
"def config_file\n File.join(install_directory,'installer','rails_installer.yml')\n end",
"def default_global_config_file\n File.join(File.expand_path(ENV[\"HOME\"]), \".kitchen\", \"config.yml\")\n end",
"def path\n return ENV['ORBIT_FILE'] if ENV.include? 'ORBIT_FILE'\n\n [ENV.fetch('ORBIT_HOME'), 'config', 'orbit.json'].join(SEP)\n rescue KeyError\n raise 'env ORBIT_HOME not set'\n end"
] |
[
"0.8284185",
"0.8264604",
"0.81300884",
"0.8124038",
"0.81118363",
"0.8012646",
"0.79815865",
"0.7981453",
"0.79060876",
"0.78872585",
"0.78718936",
"0.7830699",
"0.7805095",
"0.7803831",
"0.77489644",
"0.76945806",
"0.7693582",
"0.766047",
"0.76601374",
"0.76568896",
"0.76196396",
"0.76074904",
"0.7599521",
"0.7571283",
"0.75626004",
"0.7510647",
"0.7498511",
"0.7489991",
"0.7486549",
"0.7442415",
"0.74355894",
"0.73885",
"0.7385279",
"0.73002446",
"0.72965306",
"0.72903425",
"0.72598916",
"0.72284997",
"0.7155294",
"0.71434146",
"0.7141896",
"0.7134532",
"0.71084124",
"0.7075681",
"0.7059768",
"0.70556426",
"0.7033133",
"0.7018387",
"0.7017784",
"0.7001297",
"0.6973115",
"0.6973115",
"0.69628316",
"0.6939477",
"0.69179374",
"0.69174975",
"0.6908243",
"0.69052434",
"0.68886966",
"0.6858535",
"0.6856547",
"0.6841106",
"0.68350035",
"0.6807251",
"0.67876536",
"0.67827094",
"0.67721146",
"0.67561084",
"0.67463005",
"0.67463005",
"0.6739742",
"0.6724471",
"0.67110187",
"0.6697394",
"0.6697394",
"0.66942084",
"0.66794986",
"0.66756034",
"0.6662735",
"0.6642478",
"0.6638029",
"0.66350645",
"0.66249657",
"0.66200346",
"0.6601725",
"0.65302914",
"0.6519744",
"0.6506766",
"0.6506072",
"0.6504188",
"0.64944303",
"0.64908147",
"0.64874893",
"0.64664626",
"0.64637715",
"0.6455748",
"0.6454485",
"0.64526856",
"0.64488477",
"0.6447813"
] |
0.82430494
|
2
|
stores all instances of Artist
|
def initialize(name)
@name = name
@songs = []
self.save
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def initialize(name) #everytime an Artist instance is created, this method is called. Everything inside the block is its properties\n @name = name\n @songs = []\n\n @@all << self\n end",
"def artists\n @artists ||= artists_raw.map {|a| @session.artist.build(:name => a) }\n end",
"def artists(artist)\n if song.artist = nil || !Artist.find_by_name(name)\n song.artist = artist \n Artist.all << artist \n end \n end",
"def initialize(name)\n @name = name\n Artist.all << self \n end",
"def initialize\n @@artists << self #artists will be stored at @@artists\n @songs = [] #its empty waiting for to be initilized throu attr_reader\n end",
"def initialize(name) # an Artist instance is initialized w a name\n @name = name\n @songs = [] # each Artist instance will have many songs and this array will hold those songs\n end",
"def artists\n super.map do |artist|\n Spotify::SDK::Artist.new(artist, parent)\n end\n end",
"def initialize(name) # First, we initialize our Artist class with the name attribute.\n @name = name\n @@all << self # We take our class instance and push it into our class variable.\n end",
"def initialize(name) #Creates new instance\n @name = name #Sets instance variable name to name\n @songs = [] #Creates new instance variable array for new Artist\n @@all << self #Adds artist to class variable @@all\n end",
"def initialize(name) #when an artist is created the name is mandatory\n @name = name #writes/sets a name attribute to the new artist\n @@all << self #pushes that artist into all array. all artist instances go here\n end",
"def initialize\n # @@artists << self\n super\n @songs = []\n end",
"def initialize\n #@@artists << self #push the instance (self) of the class into the @@all class variable, on which they are being called\n super\n @songs = [] #variable of instence; empty\n end",
"def instances\n @instances ||= begin\n h = {}\n PPStore::new(app.pstore_new_sujets).each_root(except: :last_id) do |ps, art_id|\n h.merge! art_id => new( art_id )\n end\n h\n end\n end",
"def initialize(name, years_experience)\n @name = name\n @years_experience = years_experience\n @@all << self #pushing each new Artist class instance into the array\n end",
"def initialize\n ARTISTS << self\n self.song = []\n self.genre = []\n end",
"def initialize\n\t\t\n\t\t\t# Initialize processed artists array\n\t\t\t@artists = []\n\t\tend",
"def initialize (name)\n @name = name #an artist has a name\n \n @@all << self \n \nend",
"def initialize(name)\n @name = name # has a name\n @@all << self #all artist instances push into @@all\n @songs = []\n end",
"def add_song(song)\n @songs << song\n song.artist = self\nend",
"def artist_images\n ArtistImage.find_by_artist_id(self.id)\n end",
"def artists\n artists = []\n self.songs.each do |song|\n artists << song.artist\n end\n artists.uniq\n end",
"def artists\n # - this method will show the connection between songs and artists \n self.songs.collect do |f| \n f.artist\n end\n end",
"def initialize(name) #initializes new instance of Artist class\n @name = name #sets name of artist to instance variable\n save #calls save method\n end",
"def artists\n self.songs.collect{|song| song.artist}\n end",
"def save \n# # - this method will add Song instances to the @@all array\n @@all << self \n end",
"def initialize(name, artist, genre)\n @name = name\n @artist = artist\n @genre = genre\n @@all << self\nend",
"def artists\n self.songs.map {|song| song.artist}\n end",
"def artist=(artist_obj)\n @artist = artist_obj\n\n #self is a song obj\n artist_obj.songs.push(self)\n end",
"def artist()\n sql = \"SELECT * FROM artists WHERE id = $1\"\n values = [@artist_id]\n artists = SqlRunner.run(sql, values)\n result = artists.map {|artist| Artist.new(artist)}\n return result\n end",
"def add_song(song)\n # I hava class varaible @@all in Song class\n # the song is adding to self (refering to the \n # Artist)\n # adds that song to the artist's collection\n # HOW??? \n @song << song # without it\n song.artist = self \n #binding.pry\n end",
"def add_song(song)\n song.artist= self\n @songs << song\n end",
"def initialize(name, artist, genre)\n @name = name \n @artist = artist \n @genre = genre \n @@artists << artist \n @@genres << genre\n @@count += 1 \n \n end",
"def initialize(name)\n @name = name\n @songs = []\n save #puts instances of songs into empty array?\nend",
"def artists\n songs.map {|song| song.artist}\n end",
"def artists\n paintings.map{|art| art.artist.name}\n\n end",
"def artist=(artist)\n @artist = artist\n if artist.class == Artist\n artist.add_song(self)\n end\n end",
"def initialize #initializes songs belonging to artist\r\n @song = artist\r\n end",
"def add_song(song)\n #associates a song to the artist's collection\n @songs << song\n song.artist = self\n end",
"def artists\n paintings.collect do |p|\n p.artist \n end\n end",
"def artist=(artist)\n @artist = artist\n artist.add_song(self) #=> invokes Artist#add_song to add itself to the artist's collection of songs (artist has many songs)\n end",
"def add_song(song)\n @songs << song\n song.artist = self\n\n end",
"def artists\n self.songs.collect {|song| song.artist}\nend",
"def artist=(artist) #assigns an artist to the song (song belongs to artist)\n @artist = artist #artist is reading from Song class artist method(reader)\n artist.add_song(self) #invokes Artist#add_song to add itself to the artist's collection of songs (artist has many songs)\n end",
"def initialize(name)\n @name = name #the artist's name\n @songs = [] #the artist's collection of songs\n end",
"def initialize(name) # each Song instance is initialized w a name\n @name = name\n @@all << self # everytime a new Song instance is created, we want to track it in the @all array\n end",
"def artists\n @songs.collect do |song|\n song.artist\n end\n end",
"def artists\n @songs.collect do |song|\n song.artist\n end\n end",
"def store_artist(details)\n artist = RSpotify::Artist.search(details.to_s, limit: 1).first\n artist_details = {\n 'name' => artist.name,\n 'id' => artist.id,\n 'type' => 'artist'\n }\n @mylist << artist_details\n update_file\n end",
"def initialize(name, years_experience)\n @name = name\n @years_experience = years_experience\n @@all << self # add self-artist to all instances of Artist\n end",
"def add_song(song)\n @songs << song\n #here we use the self keyword to refer to the artist on which we are calling this method. We call the =artist method onto the song that is being passed as an argument and set that to self (the artist)\n song.artist = self\n#once we add a new song we want to increase the class array song count\n @@song_count +=1\n end",
"def artists\n songs.map do |song|\n song.artist\n end\n end",
"def artists\n songs.map do |song|\n song.artist\n end\n end",
"def artists\n @songs.collect do |song| #<Song:0x007f874c4eeed8 @artist=#<Artist:0x007f874c4ef0b8 @name=\"Jay-Z\", @songs=[#<Song:0x007f874c4eeed8 ...>]>, @genre=#<Genre:0x007f874c4ef018 @name=\"rap\", @songs=[#<Song:0x007f874c4eeed8 ...>]>, @name=\"99 Problems\">\n song.artist ##<Artist:0x007f874c4ef0b8 @name=\"Jay-Z\", @songs=[#<Song:0x007f874c4eeed8 @artist=#<Artist:0x007f874c4ef0b8 ...>, @genre=#<Genre:0x007f874c4ef018 @name=\"rap\", @songs=[#<Song:0x007f874c4eeed8 ...>]>, @name=\"99 Problems\">]>\n end\n end",
"def initialize(name, artist, genre)\n @name=name\n @artist=artist\n @genre=genre\n @@artists << self.artist\n @@genres << self.genre\n @@count+=1\n # @@count +=self\n end",
"def artists\n paintings.map do |painting|\n painting.artist\n end\n end",
"def artist(attributes)\n attributes = {:gid => attributes} unless attributes.is_a?(Hash)\n Artist.new(self, attributes)\n end",
"def initialize(name, artist, genre)\n\n @name = name\n @artist = artist\n @genre = genre\n\n @@count +=1\n @@artists << artist #when a new song is initialize, artist shovel to array\n @@genres << genre #when a new genre is intialized, genre shovel to array\n\n end",
"def initialize(name) #automatically instantiates a new genre & requires an argument (name)\n @name = name #accepts a (name) for the new instance of genre\n @@all = [] #automatically stores the new instance of genre in the @@all = [] class variable\n @songs = [] #automatically stores instances of songs\n end",
"def initialize(name)\n @name = name\n @songs = [] #artist's collection of songs\n end",
"def artist=(artist)\n @artist = artist #returns an instance of the Artist object\n end",
"def initialize(name, artist, genre) #pass in these 3 arguments to initialize a song by their parameters\n @name = name #setting instance var to local vars (local vars that are passed in and then saved as an instance)\n @artist = artist\n @genre = genre\n @@all << self #shovel all instances of this class into the empty array\n end",
"def initialize\n @@songs << self #intilized songs will be added to @@songs\n end",
"def artists\n songs.collect do |song|\n song.artist\n\n end\nend",
"def initialize(name)\n @name = name\n @songs = [ ]\n #peter.song = (\"pit\") How to attribute song to the artist after the artist is create.\n end",
"def store_artist_image\n ArtistsController.store_image(self, @artist)\n end",
"def initialize(name)\n @name = name # initializes every new object with a name\n @posts = [ ] # initializes a places to store all an authors posts inside the artist\n end",
"def initialize(name, artist, genre)\n @name = name\n @artist = artist\n @@artists << artist\n @genre = genre\n @@genres << genre\n @@count += 1\n end",
"def songs\n Song.all.select {|song| song.artist = self}\n end",
"def artists\n @songs.map { |m| m.artist }.uniq\n end",
"def retrieve_artists_by_label\n artistMap = Hash.new(nil)\n Artist.all.each do |rapper|\n if artistMap[rapper.label] == nil\n newArtistArr = []\n newArtistArr << rapper\n artistMap[rapper.label] = newArtistArr\n else\n existingArtistArr = artistMap[rapper.label]\n existingArtistArr << rapper\n end\n end\n artistMap\n end",
"def initialize(name, artist, genre)\n @name = name\n @artist = artist\n @genre = genre\n @@count += 1\n @@genres << genre\n @@artists << artist\n end",
"def artists\n self.paintings.map do |painting|\n painting.artist\n end.uniq\n end",
"def initialize(name, artist, genre)\n @name = name\n @artist = artist\n @genre = genre\n\n @@count += 1\n @@artists << artist\n @@genres << genre\n end",
"def artists\n @songs.collect{|song| song.artist}.uniq\n end",
"def index\n @artists = Artist.all\n end",
"def index\n @artists = Artist.all\n end",
"def index\n @artists = Artist.all\n end",
"def index\n @artists = Artist.all\n end",
"def index\n @artists = Artist.all\n end",
"def index\n @artists = Artist.all\n end",
"def add_song(song)\n @@songs << song\n song.artist = self\n end",
"def initialize(name, artist, genre)\n\t\t@name = name\n\t\t@artist = artist\n\t\t@genre = genre\n\t\t@@all.push(self)\n\t\t# @@count += 1\n\tend",
"def initialize(name, artist, genre)\n @name = name\n @artist = artist\n @genre = genre\n @@count +=1\n @@genres << genre\n @@artists << artist\n end",
"def initialize(name) # initialize with a name\n @name = name\n @@all << self # push each genre instance into the all array\n end",
"def artists\n songs.collect do |song|\n song.artist\n end\n .uniq #does not return duplicate artists if the genre has more than one song by a particular artist (genre has many artists through songs)\n end",
"def add_song(song)\n @songs << song\n song.artist = self\n end",
"def add_song(song)\n @songs << song\n song.artist = self\n end",
"def add_song(song)\n @songs << song\n song.artist = self\n end",
"def add_song(song)\n @songs << song\n song.artist = self\n end",
"def add_song(song)\n @songs << song\n song.artist = self\n end",
"def add_song(song)\n @songs << song\n song.artist = self\n end",
"def add_song(song)\n @songs << song\n song.artist = self\n end",
"def add_song(song)\n @songs << song\n song.artist = self\n end",
"def add_song(song)\n @songs << song\n song.artist = self\n end",
"def add_song(song)\n @songs << song\n song.artist = self\n end",
"def add_song(song)\n @songs << song\n song.artist = self\n end",
"def initialize(str=nil)\n \t@name = str\n \t@songs = []\n \t@genre = []\n \t@@artists.push(self)\n end",
"def add_song(song)\r\n @songs << song\r\n song.artist = self\r\n end",
"def initialize(artist, id=nil)\n # binding.pry\n @name = artist[\"name\"]\n @id = artist[\"id\"]\n # @@all << self\n end",
"def initialize(name, artist, genre)\n @name = name\n @artist = artist\n @genre = genre\n # Every time we make an instance, we want @@count to be increased by 1. We\n # also want to add the artist to the array of artists (same as genres).\n @@count += 1\n @@artists << artist\n @@genres << genre\n end",
"def set_artist\n @artist = Artist.find_by(id: params[:id])\n end"
] |
[
"0.7129824",
"0.7026427",
"0.6965256",
"0.69181377",
"0.6893632",
"0.68826574",
"0.6866629",
"0.6824401",
"0.67284346",
"0.6719518",
"0.66524994",
"0.6603969",
"0.65679646",
"0.6567308",
"0.6535202",
"0.65315396",
"0.6522757",
"0.6458142",
"0.64218014",
"0.64043945",
"0.63978046",
"0.639102",
"0.63885534",
"0.63644314",
"0.6355411",
"0.63516873",
"0.63160026",
"0.631482",
"0.6250213",
"0.6205862",
"0.6195929",
"0.6191695",
"0.6148229",
"0.61371374",
"0.6130818",
"0.6108339",
"0.6103178",
"0.6092455",
"0.6064201",
"0.605997",
"0.60586715",
"0.6047957",
"0.603864",
"0.6032698",
"0.60297275",
"0.6021016",
"0.6021016",
"0.6008362",
"0.6007861",
"0.600646",
"0.59963226",
"0.59963226",
"0.59942615",
"0.59887093",
"0.5983915",
"0.5981135",
"0.59777725",
"0.5968531",
"0.5963143",
"0.59534997",
"0.59442407",
"0.59252095",
"0.5902842",
"0.5885807",
"0.58834314",
"0.5882673",
"0.5881723",
"0.5881625",
"0.5875024",
"0.58716315",
"0.5870358",
"0.5868193",
"0.58673716",
"0.5864766",
"0.58630896",
"0.58630896",
"0.58630896",
"0.58630896",
"0.58630896",
"0.58630896",
"0.5863015",
"0.58579904",
"0.5843733",
"0.5841401",
"0.58382326",
"0.58344895",
"0.58344895",
"0.58344895",
"0.58344895",
"0.58344895",
"0.58344895",
"0.58344895",
"0.58344895",
"0.58344895",
"0.58344895",
"0.58344895",
"0.58251894",
"0.58174735",
"0.58131456",
"0.5811274",
"0.5808391"
] |
0.0
|
-1
|
Yield self for rubystyle initialization
|
def configure
yield self
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def initialize\n @colours = default_colours\n @default = \"\\033[92m\"\n\n yield self if block_given?\n end",
"def initialize name = :rdoc # :yield: self\n defaults\n\n check_names name\n\n @name = name\n\n yield self if block_given?\n\n define\n end",
"def styles=(_arg0); end",
"def initialize\n load_default_styles\n end",
"def initialize(source)\n @transformer_factory = TransformerFactory.newInstance()\n @source = source\n @style_sheet = @transformer_factory.newTemplates(@source) \n end",
"def initialize options = {}, &block\n @headings = []\n @rows = []\n @column_widths = []\n self.style = options.fetch :style, {}\n self.headings = options.fetch :headings, []\n self.rows = options.fetch :rows, []\n self.title = options.fetch :title, nil\n yield_or_eval(&block) if block\n\n style.on_change(:width) { require_column_widths_recalc }\n end",
"def initialize\n yield( self ) if block_given? # allow setup with code block\n end",
"def initialize markup = nil\n super nil, markup\n\n @markup.add_regexp_handling RDoc::CrossReference::CROSSREF_REGEXP, :CROSSREF\n @markup.add_regexp_handling(/(((\\{.*?\\})|\\b\\S+?)\\[\\S+?\\])/, :TIDYLINK)\n\n add_tag :BOLD, '', ''\n add_tag :TT, '', ''\n add_tag :EM, '', ''\n\n @res = []\n end",
"def initialize\n yield self if block_given?\n end",
"def initialize\n yield self if block_given?\n end",
"def initialize\n yield self if block_given?\n end",
"def initialize\n yield self if block_given?\n end",
"def style=(_); end",
"def css=(_arg0); end",
"def initialize(&block)\n yield self\n end",
"def initialize(book)\n @book = book\n @style = book.style\n end",
"def styles\n yield @styles if block_given?\n @styles\n end",
"def initialize\n yield self if block_given?\n end",
"def initialize\n yield self if block_given?\n end",
"def initialize\n yield self if block_given?\n end",
"def initialize\n yield self if block_given?\n end",
"def initialize(*)\n super\n yield self if block_given?\n end",
"def initialize(&block)\n yield self\n end",
"def initialize(turtletext_reader,&block)\n @reader = turtletext_reader\n @page = 1\n @inclusive = false\n if block_given?\n if block.arity == 1\n yield self\n else\n instance_eval &block\n end\n end\n end",
"def initialize(dsl, parent)\n @dsl = dsl\n @parent = parent\n @style = ::Swt::Custom::StyleRange.new\n end",
"def render_style\n \"#{style}#{yield}\"\n end",
"def initialize\n yield self if block_given?\n end",
"def initialize\n yield self if block_given?\n end",
"def each(&block)\n\t\t# iterate and return self, or return an iterator\n\t\tif block\n\t\t\t@styles.each &block\n\t\t\treturn self\n\t\telse\n\t\t\treturn @styles.each\n\t\tend\n\tend",
"def initialize(template, options = {})\n @options = {\n :suppress_eval => false,\n :attr_wrapper => \"'\",\n :locals => {},\n :autoclose => ['meta', 'img', 'link', 'script', 'br', 'hr'],\n :filters => {\n 'sass' => Sass::Engine,\n 'plain' => Haml::Filters::Plain,\n 'preserve' => Haml::Filters::Preserve }\n }\n\n if !NOT_LOADED.include? 'redcloth'\n @options[:filters].merge!({\n 'redcloth' => RedCloth,\n 'textile' => Haml::Filters::Textile,\n 'markdown' => Haml::Filters::Markdown\n })\n end\n if !NOT_LOADED.include? 'bluecloth'\n @options[:filters]['markdown'] = Haml::Filters::Markdown\n end\n\n @options.rec_merge! options\n\n unless @options[:suppress_eval]\n @options[:filters].merge!({\n 'erb' => ERB,\n 'ruby' => Haml::Filters::Ruby\n })\n end\n @options[:filters].rec_merge! options[:filters] if options[:filters]\n\n @precompiled = @options[:precompiled]\n\n @template = template.strip #String\n @to_close_stack = []\n @output_tabs = 0\n @template_tabs = 0\n @index = 0\n\n # This is the base tabulation of the currently active\n # flattened block. -1 signifies that there is no such block.\n @flat_spaces = -1\n\n begin\n # Only do the first round of pre-compiling if we really need to.\n # They might be passing in the precompiled string.\n do_precompile if @precompiled.nil? && (@precompiled = String.new)\n rescue Haml::Error => e\n e.add_backtrace_entry(@index, @options[:filename])\n raise e\n end\n end",
"def initialize block_parser\n @block_parser = block_parser\nend",
"def myletter\n \n end",
"def styles; end",
"def styles; end",
"def styles; end",
"def initialize options = {}, &block\n @title = options.fetch :title, nil\n @headings = options.fetch :headings, []\n @rows = options.fetch :rows, []\n yield_or_eval &block if block\n end",
"def initialize(options = {})\n super(options)\n initialize_section_formatting(options)\n initialize_page_formatting(options)\n end",
"def initialize_css_style_conversion; end",
"def initialize(&block)\r\n yield(self) if block_given? \r\n end",
"def initialize(dsl, parent, blk)\n @dsl = dsl\n @parent = parent\n @blk = blk\n @real = st = ::Swt::Custom::StyledText.new(@parent.real,\n ::Swt::SWT::WRAP)\n st.editable = false\n st.caret = nil\n self.set_font\n self.update_text\n @real.pack\n end",
"def initialize(top_level, file_name, content, options, stats)\n super\n\n preprocess = RDoc::Markup::PreProcess.new @file_name, @options.rdoc_include\n\n @content = preprocess.handle @content, @top_level\n end",
"def initialize(&block)\n load_defaults!\n\n instance_eval(&block)\n end",
"def initialize name = DEFAULT_NAMES # :yield: self\n super\n end",
"def initialize(&block)\n instance_eval(&block) if block_given?\n end",
"def stylesheet; end",
"def initialize(chart_size='300x200', chart_title=nil, is_xy=false) # :yield: self\n super(chart_size, chart_title)\n self.is_xy = is_xy\n @line_styles = []\n yield self if block_given?\n end",
"def set_style\r\n @style = Style.new\r\n\r\n alignment_node = @node.xpath('.//w:jc').first\r\n alignment = alignment_node ? alignment_node.attributes['val'].value : nil\r\n @style.instance_variable_set('@text_align', alignment.to_sym) if alignment\r\n\r\n size_node = @node.xpath('w:pPr//w:sz').first\r\n font_size = size_node ? size_node.attributes['val'].value.to_i / 2 : nil\r\n @style.instance_variable_set('@font_size', font_size)\r\n\r\n bold_node = @node.xpath('w:pPr//w:b').first\r\n @style.instance_variable_set('@font_weight', 'bold') if bold_node\r\n\r\n italic_node = @node.xpath('w:pPr//w:i').first\r\n @style.instance_variable_set('@font_style', 'italic') if italic_node\r\n\r\n underline_node = @node.xpath('w:pPr//w:u').first\r\n @style.instance_variable_set('@text_underline_style', 'solid') if underline_node\r\n end",
"def initialize(name='barista:test') #:yields: self\n @name = name\n @pattern = '{test,spec}/coffeescripts/**/*.coffee'\n yield self if block_given?\n define\n end",
"def initialize\n @inline_parser = RDoc::RD::InlineParser.new self\n @include_path = []\n\n # for testing\n @footnotes = []\n @labels = {}\nend",
"def initialize(options = {}, &block)\n\t\t \n\t\t\tyield self unless block == nil\n\t\tend",
"def initialize(text, context=nil)\n\t\t\tcontext ||= {:source => '--'}\n\t\t\t@raw = PARSER.parse text\n\t\t\t@context = context\n\t\t\ttf = PARSER.terminal_failures\n\t\t\tif !@raw.respond_to?(:evaluate) then\n\t\t\t\treason = \"Incorrect macro syntax\"\n\t\t\t\terr = \"#{reason}\\n -> #{@context[:source]} [Line #{PARSER.failure_line}, Column #{PARSER.failure_column}]\"\n\t\t\t\t@context[:document].errors << err if @context[:document] && !@context[:embedded]\n\t\t\t\traise Glyph::SyntaxError, err\n\t\t\tend\n\t\t\t@document = Glyph::Document.new @raw, @context\n\t\t\t@document.inherit_from @context[:document] if @context[:document]\n\t\tend",
"def initialize\n\t\t@content = nil\n\t\tyield( self ) if block_given?\n\tend",
"def initialize(filename, &block)\n @filename = filename + \".docx\"\n @objects = [] # It contains all the DSL elements\n yield self if block\n end",
"def initialize(text, base, format, stylesheets=nil, embed=true, image_dir=nil)\n @notes = []\n @base = base\n @image_dir = image_dir\n @header_level = 0\n lines = text.split(\"\\n\")\n blocks = []\n block = []\n for line in lines\n if line.strip.empty?\n if block.size > 0\n blocks << block\n block = []\n end\n else\n block << line\n end\n end\n if block.size > 0\n blocks << block\n end\n @blocks = []\n for block in blocks\n @blocks << Block.new(self, block, @base)\n end\n # parse first block to extract document properties\n @properties = {}\n if @blocks.first.kind_of? Comment\n for line in @blocks.first.lines\n text = line.match(/#\\s*(.*)/)[1]\n parts = text.split(':')\n name = parts[0].strip\n value = parts[1..-1].join(':').strip\n if ['title'].include?(name) and [:xml, :html, :blog].include?(format)\n value = escape_xml(value)\n end\n @properties[name] = value\n end\n end\n # set stylesheets\n @stylesheets = stylesheets || []\n # tell if we should embed stylesheets\n @embed = embed\n end",
"def create_definition(style); end",
"def initialize(store, options)\n @store = store\n @options = options\n @babel_options = options.babel_options\n @see_standard_ancestors = @babel_options[:see_standard_ancestors]\n RDoc::AnyMethod.add_line_numbers = options.line_numbers if RDoc::AnyMethod.respond_to? :add_line_numbers\n @options.template = 'ruby-lang' if @options.template == 'babel' # TODO leave template nil\n @template_dir = TEMPLATE_ROOT + @options.template\n @template_dir.directory? or raise RDoc::Error, \"template not found: '#@template_dir'\"\n @source_dir = Pathname.pwd.expand_path\n end",
"def new\n @style = Style.new()\n end",
"def style; end",
"def style; end",
"def style; end",
"def initialize(&block)\n instance_eval(&block) if block_given?\n end",
"def initialize(options = {})\n @styles = Styles.new\n @worksheets = SimpleTypedList.new Worksheet\n @drawings = SimpleTypedList.new Drawing\n @charts = SimpleTypedList.new Chart\n @images = SimpleTypedList.new Pic\n # Are these even used????? Check package serialization parts\n @tables = SimpleTypedList.new Table\n @pivot_tables = SimpleTypedList.new PivotTable\n @comments = SimpleTypedList.new Comments\n @use_autowidth = true\n @bold_font_multiplier = BOLD_FONT_MULTIPLIER\n @font_scale_divisor = FONT_SCALE_DIVISOR\n\n self.escape_formulas = options[:escape_formulas].nil? ? Axlsx.escape_formulas : options[:escape_formulas]\n self.date1904 = !options[:date1904].nil? && options[:date1904]\n yield self if block_given?\n end",
"def initialize markup = nil\n super nil, markup\n\n @markup.add_regexp_handling(/\\\\\\S/, :SUPPRESSED_CROSSREF)\n @width = 78\n init_tags\n\n @headings = {}\n @headings.default = []\n\n @headings[1] = ['= ', '']\n @headings[2] = ['== ', '']\n @headings[3] = ['=== ', '']\n @headings[4] = ['==== ', '']\n @headings[5] = ['===== ', '']\n @headings[6] = ['====== ', '']\n\n @hard_break = \"\\n\"\n end",
"def initialize(options = {})\n if options[:yaml]\n data = YAML::load_file(options[:yaml])\n\n options[:title] ||= data[\"title\"]\n options[:authors] ||= data[\"authors\"]\n options[:style] ||= data[\"style\"]\n\n options[:toc] ||= data[\"toc\"]\n\n options[:prefaces] ||= data[\"prefaces\"]\n options[:chapters] ||= data[\"chapters\"]\n\n options[:cover] ||= data[\"cover\"]\n\n options[:style_config] ||= data[\"style-config\"]\n end\n\n @cover = options[:cover]\n @title = options[:title] || \"Untitled\"\n @authors = options[:authors] || [\"anonymous\"]\n @toc = options[:toc] || false\n style = options[:style] || \"basic\"\n\n options[:style_config] ||= \"style.yml\"\n\n @style = Gutenberg::Style.new(style, :yaml => options[:style_config])\n\n chapters = options[:chapters] || []\n prefaces = options[:prefaces] || []\n\n @images = []\n @tables = []\n\n @prefaces = []\n prefaces.each_with_index do |p,i|\n preface = Chapter.new(:markdown_file => p, :style => @style, :index => i+1)\n @prefaces << preface\n @images.concat preface.images\n @tables.concat preface.tables\n end\n\n @chapters = []\n chapters.each_with_index do |c,i|\n chapter = Chapter.new(:markdown_file => c, :style => @style, :index => i+1)\n @chapters << chapter\n @images.concat chapter.images\n @tables.concat chapter.tables\n end\n end",
"def initialize(name = :excellent)\n @name = name\n @paths = nil || []\n @html = false\n yield self if block_given?\n define\n end",
"def initialize\r\n @type = :unknown\r\n @text = \"\"\r\n @pre_indent = 0\r\n @post_indent = 0\r\n @first_post_indent = 0\r\n end",
"def initialize options, markup = nil\n @options = options\n\n @markup = markup || RDoc::Markup.new\n @am = @markup.attribute_manager\n @am.add_regexp_handling(/<br>/, :HARD_BREAK)\n\n @attributes = @am.attributes\n\n @attr_tags = []\n\n @in_tt = 0\n @tt_bit = @attributes.bitmap_for :TT\n\n @hard_break = ''\n @from_path = '.'\n end",
"def initialize options, markup = nil\n super\n\n @code_object = nil\n @from_path = ''\n @in_list_entry = nil\n @list = nil\n @th = nil\n @hard_break = \"<br>\\n\"\n\n init_regexp_handlings\n\n init_tags\n end",
"def style!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 29 )\n\n type = STYLE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 359:8: 'style'\n match( \"style\" )\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__, 29 )\n\n end",
"def initialize\n @attribute_manager = RDoc::Markup::AttributeManager.new\n @output = nil\n end",
"def initialize\n\n # call super to make @base_engine available\n super\n \n @engine = Proc.new do |options|\n\n # check if require should be relative or not\n req = (options[['relative']].is__null | options[['relative']].isTRUE) >> 0\n \n # load the content of the file in options.code\n options.code = GalaazUtil.inline_file(options.label >> 0, req)\n\n @base_engine.call(options)\n end\n \n # Add the include engine function for processing the rb block\n add(include: @engine)\n \n end",
"def initialize\n raise 'Au contraire, mon frere. No lexer instances will be running around.'\n end",
"def initialize(&block)\n load_defaults!\n\n instance_eval(&block) if block_given?\n\n set_defaults!\n end",
"def initialize\n @am = RDoc::Markup::AttributeManager.new\n @output = nil\n end",
"def initialize(styles)\n @styles = styles\n end",
"def initialize(document, options = {})\n @options = {\n \"styles\" => [],\n \"base_style_handle\" => 1,\n \"base_style_priority\" => 1,\n \"assign_style_handles\" => true,\n \"assign_style_priorities\" => true\n }.merge(options)\n @document = document\n @next_styles_hash = {}\n @base_styles_hash = {}\n @styles = {}\n add_styles(@options[\"styles\"])\n end",
"def initialize()\n self.kind = CIAT::Processors::Interpreter.new\n self.description = \"Parrot virtual machine\"\n self.libraries = []\n yield self if block_given?\n end",
"def initialize\n yield self\n Config.apply(self)\n end",
"def css(*args); end",
"def css(*args); end",
"def css(*args); end",
"def css(*args); end",
"def initialize_generate\n super\n add_accessors\n declare_guardfile\n declare_chefignore_patterns\n end",
"def initialize(*args, &block)\n super(*args, &block)\n reset_font_settings\n set_data_font(:normal)\n @maqj_default_font = contents.font.dup\n # Change the windowskin, tone if they are set to be changed\n self.windowskin = Cache.system($game_system.quest_windowskin) if $game_system.quest_windowskin\n self.opacity = $game_system.quest_window_opacity if $game_system.quest_window_opacity\n end",
"def initialize(source = nil)\n parsed_outline = process_source(source)\n\n super(parsed_outline)\n\n @tags = []\n @tag_elements = []\n @examples = []\n\n build_outline(parsed_outline) if parsed_outline\n end",
"def initialize(options = {})\n super()\n @style_sheets = ['/static/ath.css']\n @options.merge!(options)\n end",
"def initialize\r\n raise MissingFormatterMethodError unless @node\r\n @default_font_size = @document.default_paragraph_style.font_size\r\n set_text_runs\r\n end",
"def initialize(path = nil, attributes = {}, &block)\n @path = path\n @basename = path.to_s =~ /^-?$/ ? nil : File.basename(path)\n @reader = block ||\n lambda do |f|\n if ['-', nil].include?(f)\n $stdin.read\n else\n File.read(f, encoding: @encoding)\n end\n end\n @data = @reader.call(path)\n @name, @section, @tagline = sniff\n\n @styles = %w[man]\n @manual, @organization, @date = nil\n @markdown, @input_html, @html = nil\n @index = Ronn::Index[path || '.']\n @index.add_manual(self) if path && name\n\n attributes.each { |attr_name, value| send(\"#{attr_name}=\", value) }\n end",
"def initialize\n @html_tags = {}\n @matching_word_pairs = {}\n @protectable = %w[<]\n @regexp_handlings = []\n @word_pair_map = {}\n @exclusive_bitmap = 0\n @attributes = RDoc::Markup::Attributes.new\n\n add_word_pair \"*\", \"*\", :BOLD, true\n add_word_pair \"_\", \"_\", :EM, true\n add_word_pair \"+\", \"+\", :TT, true\n\n add_html \"em\", :EM, true\n add_html \"i\", :EM, true\n add_html \"b\", :BOLD, true\n add_html \"tt\", :TT, true\n add_html \"code\", :TT, true\n end",
"def initialize\n start\n if block_given?\n yield\n stop\n end\n end",
"def style_guide\n @props = {styles: helpers.generate_style_array}\n end",
"def css; end",
"def css; end",
"def css; end",
"def initialize(pdf, &block)\n @pdf=pdf\n\n @c_annotation_gutter = 2\n @c_col_division = 5\n self.c_date_start=(Date.today.iso8601) # default to today.\n @c_days = [\"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\", \"So\"]\n @c_entry_fontsize = 7\n @c_entry_gutter = 0\n @c_entry_radius = 2\n @c_entry_right_gutter = 2\n @c_extra_rows = 1\n @c_firstcol_division = 2\n @c_fontsize = 8\n @c_row_division = 4\n @c_time_end = 22\n @c_time_start = 8\n yield(self) if block_given?\n end",
"def yield; end",
"def initialize(make, model, year, color)\n\t\tsuper(make,model,year) #effectively does the below. similar to Parent.call(vars) in js\n\t\t# @make = make \n\t\t# @model = model\n\t\t# @year = year\n\t\t@color = color\n\tend",
"def assign_highlighter_options!; end",
"def initialize generator\n @template_id, @generator_name, @default_line = GENERATORS.match generator\n end",
"def initialize(top_level, file_name, content, options, stats)\n super\n\n if /\\t/ =~ content then\n tab_width = @options.tab_width\n content = content.split(/\\n/).map do |line|\n 1 while line.gsub!(/\\t+/) {\n ' ' * (tab_width*$&.length - $`.length % tab_width)\n } && $~\n line\n end.join(\"\\n\")\n end\n\n @size = 0\n @token_listeners = nil\n content = RDoc::Encoding.remove_magic_comment content\n @scanner = RDoc::Parser::RipperStateLex.parse(content)\n @content = content\n @scanner_point = 0\n @prev_seek = nil\n @markup = @options.markup\n @track_visibility = :nodoc != @options.visibility\n @encoding = @options.encoding\n\n reset\n end",
"def rucas &block\n self.instance_eval(&block)\n end"
] |
[
"0.6778602",
"0.66115177",
"0.6314544",
"0.6285113",
"0.6269817",
"0.621812",
"0.6206106",
"0.6193776",
"0.6171551",
"0.6171551",
"0.6171551",
"0.6171551",
"0.6143248",
"0.6129522",
"0.61042255",
"0.6092088",
"0.6091285",
"0.60433835",
"0.60433835",
"0.60433835",
"0.60433835",
"0.60269815",
"0.59873545",
"0.59819233",
"0.5971156",
"0.59553015",
"0.5937809",
"0.5937809",
"0.59311044",
"0.5926815",
"0.5917916",
"0.59144443",
"0.58759713",
"0.58759713",
"0.58759713",
"0.5873941",
"0.58582634",
"0.5839004",
"0.5818942",
"0.5807787",
"0.57859695",
"0.5765855",
"0.5764825",
"0.57593334",
"0.5751711",
"0.57428765",
"0.5740245",
"0.57379985",
"0.571918",
"0.57189983",
"0.57000625",
"0.56951994",
"0.56886494",
"0.5680591",
"0.56788653",
"0.56754994",
"0.5675196",
"0.5673859",
"0.5673859",
"0.5673859",
"0.56708544",
"0.5662681",
"0.56521994",
"0.5652137",
"0.5625128",
"0.5620621",
"0.56157005",
"0.5614264",
"0.5608338",
"0.56058556",
"0.5591888",
"0.5591081",
"0.5590367",
"0.5587926",
"0.55734193",
"0.557299",
"0.55708164",
"0.5557346",
"0.55495894",
"0.55495894",
"0.55495894",
"0.55495894",
"0.55491424",
"0.55373776",
"0.5533753",
"0.55295503",
"0.5523263",
"0.5519026",
"0.5500808",
"0.549632",
"0.54936737",
"0.54906267",
"0.54906267",
"0.54906267",
"0.54851425",
"0.54552764",
"0.5453848",
"0.54445916",
"0.5443714",
"0.54295933",
"0.54293054"
] |
0.0
|
-1
|
Return the current configuration options as a Hash
|
def options
opts = {}
VALID_CONFIG_KEYS.each_key do |k|
opts.merge!(k => send(k))
end
opts
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def options\n opts = {}\n self.configuration_options.each do |option|\n opts.merge!({option.name.to_sym => option.value})\n end\n opts\n end",
"def options\n Hash[ *Configuration::VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten ]\n end",
"def options\n Hash[\n *Configuration::VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten\n ]\n end",
"def options\n Hash[ * VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten ]\n end",
"def options\n Hash[ * VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten ]\n end",
"def options\n hash = {}\n self.class.option_definitions.each do |option|\n hash[option.name] = send(option.name)\n end\n hash\n end",
"def options\n opts = {}\n VALID_CONFIG_KEYS.each_key do |k|\n opts.merge!(k => send(k))\n end\n opts\n end",
"def options\n opts = {}\n VALID_CONFIG_KEYS.each_key do |k|\n opts.merge!(k => send(k))\n end\n opts\n end",
"def options\n Hash[\n DeskApi::Configuration.keys.map do |key|\n [key, instance_variable_get(:\"@#{key}\")]\n end\n ]\n end",
"def options\n config.options\n end",
"def parsed_options\n config\n end",
"def to_hash\n configuration\n end",
"def options\n @options = @options.select { |key, _val| CONFIGURATIONS.include?(key.to_sym) }\n end",
"def get_options\n hash = Hash.new\n instance_variables.each do |var|\n hash[var[1..-1].to_sym] = instance_variable_get(var)\n end\n\n return hash\n end",
"def options\n Hash[Github::Configuration.keys.map do |key|\n [key, instance_variable_get(:\"@#{key}\")]\n end]\n end",
"def options\n return @_options if defined?(@_options)\n\n original_options = super\n @_options = Thor::CoreExt::HashWithIndifferentAccess.new(\n configuration_options.merge(original_options)\n )\n end",
"def options\n @options ||= Hash.new{ |h, k| h[k] = {} }\n end",
"def options\n Hash[VALID_OPTIONS.map { |key| [key, send(key)] }]\n end",
"def to_hash\n @configuration\n end",
"def to_hash\n @configuration\n end",
"def options\n\t\t\toptions = {}\n\t\t\tVALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n\t\t\toptions\n\t\tend",
"def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash[option.to_sym] = self.send(option)\n hash\n end\n end",
"def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash[option.to_sym] = self.send(option)\n hash\n end\n end",
"def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash[option.to_sym] = self.send(option)\n hash\n end\n end",
"def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash[option.to_sym] = self.send(option)\n hash\n end\n end",
"def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash[option.to_sym] = self.send(option)\n hash\n end\n end",
"def options \n options = {}\n VALID_OPTIONS_KEYS.each {|k| options[k] = send(k)}\n options\n end",
"def to_hash\n default_options.to_hash\n end",
"def to_hash\n default_options.to_hash\n end",
"def config\n options.to_smash.deep_merge(opts.to_smash)\n end",
"def config\n options.to_smash.deep_merge(opts.to_smash)\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k) }\n options\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k) }\n options\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k) }\n options\n end",
"def options \n self.merge!(@config.opts)\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each{|k| options[k] = send(k)}\n options\n end",
"def get_options\n @options\n end",
"def options\n Hash[VALID_OPTIONS_KEYS.map {|key| [key, send(key)] }]\n end",
"def config_opts\n CONFIG_OPTS.inject({}) do |config_hash, key|\n config_hash[key] = send(key)\n config_hash\n end\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each { |k| options[k] = send(k) }\n options\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each { |k| options[k] = send(k) }\n options\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each {|k| options[k] = send(k)}\n options\n end",
"def options\n return @options if @options_parsed\n options = super\n config_path = File.join(File.dirname(__FILE__),\n '../..', CONFIG_FILE_NAME)\n return options unless File.exist? config_path\n\n defaults = YAML.load_file(config_path).deep_symbolize_keys || {}\n options = defaults.merge_with_arrays(options)\n @options = Thor::CoreExt::HashWithIndifferentAccess.new(options)\n @options_parsed = true\n\n @options\n end",
"def to_hash\n { @key => @options }\n end",
"def options\n @options ||= {}\n end",
"def options\n @options ||= {}\n end",
"def options\n @options ||= {}\n end",
"def options\n Hash[VALID_OPTIONS_KEYS.map {|key| [key, public_send(key)] }]\n end",
"def options\n @options ||= {}\n @options\n end",
"def to_hash\n OPTIONS.each_with_object({}) do |option, hash|\n key = option.first\n hash[key] = send(key)\n end\n end",
"def options\n @options ||= {}\n end",
"def options\n @options ||= {}\n end",
"def options\n @options ||= {}\n end",
"def options\n options = {}\n VALID_OPTIONS_KEYS.each do |k|\n options[k] = send(k)\n end\n options\n end",
"def options\n @options ||= Launchr::OrderedHash.new\n @options\n end",
"def options\n Hash[ * VALID_OPTIONS_KEYS.map { |key| [key, send(key)] }.flatten ]\n end",
"def options\n self[:options] || {}\n end",
"def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash.merge(option.to_sym => send(option))\n end\n end",
"def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash.merge(option.to_sym => send(option))\n end\n end",
"def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash.merge(option.to_sym => send(option))\n end\n end",
"def to_hash\n OPTIONS.inject({}) do |hash, option|\n hash.merge(option.to_sym => send(option))\n end\n end",
"def options\n @options ||= {}\n end",
"def options\n @options ||= {}\n end",
"def options\n map = Config.class_variables.map do |key|\n [key.to_s.tr('@', '').to_sym, class_variable_get(:\"#{key}\")]\n end\n Hash[map]\n end",
"def options\n @_options ||= {}\n end",
"def options\n return @options\n end",
"def options\n self[:options] || {}\n end",
"def get_full_options\n options_hash = self.get_runtime_options\n [:task_list, :version, :_exponential_retry, :prefix_name, :return_on_start, :manual_completion, :data_converter].each do |attribute|\n options_hash.merge!(attribute => self.send(attribute)) if self.send(attribute)\n end\n options_hash\n end",
"def to_hash\n @configuration_data\n end",
"def config\n @options[:config]\n end",
"def configuration\n if system_keys.any?\n options.merge({\n system_keys: Configuration.default_system_keys.merge(system_keys)\n })\n\n else\n options\n\n end\n end",
"def to_hash\n self.config.to_hash\n end",
"def options\n return @options\n end",
"def options()\n {}\n end",
"def all_options\n Config::Options.all\n end",
"def options\n self.class.instance_variable_get(:@__options) || []\n end",
"def options\n Properties[self.class] ||= {}\n return Properties[self.class][:opts] || []\n end",
"def options\n options = {}\n attributes_for(self).each do |p|\n option = self.send(p.to_sym) \n options[p] = option unless option.nil?\n end\n options\n end",
"def options\n @options ||= self.class.options\n end",
"def to_h\n @configuration\n end",
"def options\n OPTIONS_KEYS.inject({}) do |options, key|\n options.merge!(key => send(key))\n end\n end",
"def to_h\n config\n end",
"def options\n VALID_OPTIONS_KEYS.inject({}) do |option, key|\n option.merge!(key => send(key))\n end\n end",
"def options\n {}.tap{ |options| VALID_OPTIONS_KEYS.each{|k| options[k] = send(k) } }\n end",
"def config_file_settings\n config_file_settings = {}\n self.class.options.keys.each do |key|\n config_file_settings[key] = Meggy::Config[:meg][key] if Meggy::Config[:meg].has_key?(key)\n end\n config_file_settings\n end"
] |
[
"0.84417653",
"0.82640785",
"0.8189162",
"0.8110969",
"0.8110969",
"0.7994236",
"0.78877115",
"0.78877115",
"0.78818274",
"0.78014815",
"0.7769207",
"0.7755151",
"0.77459496",
"0.76934254",
"0.766668",
"0.76445687",
"0.76311094",
"0.76258475",
"0.7603138",
"0.7603138",
"0.75919586",
"0.75751644",
"0.75751644",
"0.75751644",
"0.75751644",
"0.75751644",
"0.75732195",
"0.75724846",
"0.75724846",
"0.75605124",
"0.75605124",
"0.7559561",
"0.7559561",
"0.7559561",
"0.75441605",
"0.75358886",
"0.75358886",
"0.75358886",
"0.75358886",
"0.75358886",
"0.75358886",
"0.75358886",
"0.75358886",
"0.75358886",
"0.75358886",
"0.75358886",
"0.75358886",
"0.75358886",
"0.75358886",
"0.75358886",
"0.75358886",
"0.75299114",
"0.7514682",
"0.750369",
"0.74982375",
"0.74982375",
"0.74941725",
"0.74866366",
"0.7483715",
"0.747613",
"0.747613",
"0.747613",
"0.74610066",
"0.7456297",
"0.7452017",
"0.7450048",
"0.7450048",
"0.7450048",
"0.74406296",
"0.7435665",
"0.7430651",
"0.7414959",
"0.73653525",
"0.73653525",
"0.73653525",
"0.73653525",
"0.7359673",
"0.7359673",
"0.7351824",
"0.7333932",
"0.7296157",
"0.7292458",
"0.7291064",
"0.72618103",
"0.7245253",
"0.72337687",
"0.722099",
"0.7211923",
"0.7206708",
"0.71954465",
"0.71912044",
"0.7170536",
"0.7161322",
"0.71430004",
"0.71421313",
"0.71394503",
"0.71152186",
"0.70748484",
"0.70688015",
"0.70672673"
] |
0.7795012
|
10
|
Set the default configuration onto the extended class
|
def reset
VALID_CONFIG_KEYS.each do |k, v|
send("#{k}=", v)
end
self.server_binding_url = "#{::ENV.fetch('GRPC_SERVER_HOST',
'0.0.0.0')}:#{::ENV.fetch('GRPC_SERVER_PORT', 9_001)}"
self.interceptors = ::Gruf::Interceptors::Registry.new
self.hooks = ::Gruf::Hooks::Registry.new
self.root_path = ::Rails.root.to_s.chomp('/') if defined?(::Rails)
determine_loggers
self.ssl_crt_file = "#{root_path}config/ssl/#{environment}.crt"
self.ssl_key_file = "#{root_path}config/ssl/#{environment}.key"
cp = ::ENV.fetch('GRUF_CONTROLLERS_PATH', 'app/rpc').to_s
self.controllers_path = root_path.to_s.empty? ? cp : "#{root_path}/#{cp}"
self.backtrace_on_error = ::ENV.fetch('GRPC_BACKTRACE_ON_ERROR', 0).to_i.positive?
self.rpc_server_options = {
max_waiting_requests: ::ENV.fetch('GRPC_SERVER_MAX_WAITING_REQUESTS',
GRPC::RpcServer::DEFAULT_MAX_WAITING_REQUESTS).to_i,
pool_size: ::ENV.fetch('GRPC_SERVER_POOL_SIZE', GRPC::RpcServer::DEFAULT_POOL_SIZE).to_i,
pool_keep_alive: ::ENV.fetch('GRPC_SERVER_POOL_KEEP_ALIVE', GRPC::Pool::DEFAULT_KEEP_ALIVE).to_i,
poll_period: ::ENV.fetch('GRPC_SERVER_POLL_PERIOD', GRPC::RpcServer::DEFAULT_POLL_PERIOD).to_i,
connect_md_proc: nil,
server_args: {}
}
self.use_default_interceptors = ::ENV.fetch('GRUF_USE_DEFAULT_INTERCEPTORS', 1).to_i.positive?
if use_default_interceptors
interceptors.use(::Gruf::Interceptors::ActiveRecord::ConnectionReset)
interceptors.use(::Gruf::Interceptors::Instrumentation::OutputMetadataTimer)
end
self.health_check_enabled = ::ENV.fetch('GRUF_HEALTH_CHECK_ENABLED', 0).to_i.positive?
options
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def initialize\n @config = DEFAULT_CONFIG.deep_dup\n end",
"def initialize(config = {})\n super\n original_initialize(config)\n end",
"def initialize(...)\n super()\n configure(...)\n end",
"def default_configuration=(_arg0); end",
"def initialize(*)\n super\n apply_defaults\n end",
"def initialize(config = {})\n super config\n end",
"def add_config_inheritance!\n class_eval do\n def self.inherited(subclass)\n subclass.class_eval do\n class << self\n attr_accessor :sorcery_config\n end\n end\n # Pass parent config to subclass\n subclass.sorcery_config = sorcery_config\n super\n end\n end\n end",
"def initialize\n @class_name = default_class_name\n @rename_attrs = default_rename_attrs\n @exclude_attrs_on_create = default_exclude_attrs_on_create\n @exclude_attrs_on_update = default_exclude_attrs_on_update\n @associations = default_associations\n\n ScrapCbfRecord::Match.config = self\n\n super(*configs)\n end",
"def set_defaults\n super\n end",
"def set_defaults\n super\n end",
"def set_defaults!\n __load_config( DEFAULTS )\n end",
"def initialize\n set_config\n end",
"def defaults\n super\n end",
"def initialize(*args)\n initialize_config unless instance_variable_defined?(:@config)\n super\n end",
"def initialize( settings={} )\n\t\tsuper()\n\n\t\t@settings = settings\n\t\t@overridden_settings = {}\n\tend",
"def config\n @_config ||= self.class.config.inheritable_copy\n end",
"def reconfigure(overrides={})\n config.merge!(overrides)\n self\n end",
"def configure(settings = {})\n abstract_method\n end",
"def initialize\n set_defaults\n end",
"def initialize\n set_defaults\n end",
"def default_config\n self.class.default_config\n end",
"def default_config # including inherited defaults \n calling_class = klass = self\n my_defaults = @@default_config[klass.to_s.downcase.to_sym] ||\n HashWithIndifferentAccess.new\n inherited_defaults = HashWithIndifferentAccess.new\n\n until ancestor_class(klass) == NilClass\n ancestor_defaults = @@default_config[ancestor_class(klass).to_s.downcase.to_sym] ||\n HashWithIndifferentAccess.new\n inherited_defaults.merge!(ancestor_defaults)\n klass = ancestor_class(klass)\n end\n inherited_defaults.merge(my_defaults)\n end",
"def initialize(name)\n @config = {}\n super(name)\n end",
"def initialize(config = {})\n super\n @config = config\n end",
"def configure(conf)\n super\n end",
"def default_configuration!\n # Overwriting Sinatra defaults\n set :app_file, caller_files.first || $0 # Assume app file is first caller\n set :environment, Padrino.env\n set :raise_errors, true if development?\n set :logging, false # !test?\n set :sessions, true\n set :public, Proc.new { Padrino.root('public', self.uri_root) }\n # Padrino specific\n set :uri_root, \"/\"\n set :reload, development?\n set :app_name, self.to_s.underscore.to_sym\n set :default_builder, 'StandardFormBuilder'\n set :flash, defined?(Rack::Flash)\n set :authentication, false\n # Padrino locale\n set :locale_path, Proc.new { Dir[File.join(self.root, \"/locale/**/*.{rb,yml}\")] }\n set :auto_locale, false\n # Plugin specific\n set :padrino_mailer, defined?(Padrino::Mailer)\n set :padrino_helpers, defined?(Padrino::Helpers)\n end",
"def genPiledDefaultConf(klass = self.class())\n if(klass == WithConfParam) then\n return klass::DefaultConf.dup() ;\n else\n newConf = genPiledDefaultConf(klass.superclass()) ;\n if(klass.const_defined?(:DefaultConf)) \n newConf.update(klass::DefaultConf) ;\n end\n \n return newConf ;\n end\n end",
"def setup_config\n # To be Extended\n end",
"def initialize settings\n super\n end",
"def setup()\n @configuration = {}\n @configuration.merge!(defaults)\n @configuration\n end",
"def configure(root_config)\n super(root_config)\n end",
"def initialize(*args)\n super\n attribute_will_change!(:configuration) if configuration\n end",
"def configure(&block)\n default_values!\n yield self\n end",
"def initialize\n super\n Souffle::Config.merge!(config)\n end",
"def set_defaults\n\n end",
"def set_defaults\n\n end",
"def set_defaults\n\n end",
"def set_defaults\n\n end",
"def set_defaults\n\n end",
"def set_defaults\n\n end",
"def initialize\n config.base_uri = Config::BASE_URI\n config.user_agent = Config::USER_AGENT\n config.extend(Config)\n end",
"def set_defaults\n end",
"def set_defaults\n end",
"def initialize\n yield self\n Config.apply(self)\n end",
"def configure(root_config)\n super(root_config)\n end",
"def set_default_options\n end",
"def initialize(conf = {})\n super(conf) ;\n setup() ;\n end",
"def configure\n super()\n syncer_klass.configure(settings) if syncer_klass\n end",
"def initialize(config, default=Config::BasicAuth)\n check_init(config)\n @config = default.dup.update(config)\n end",
"def setup(settings = {})\n @config = defaults.merge(settings)\n end",
"def default_config\n {}\n end",
"def included(base)\n install_configure_in(base)\n base.instance_eval do\n extend ClassMethods\n\n # call configuration_mutex once to initialize the value\n #\n initialize_configuration!\n end\n end",
"def included(base)\n install_configure_in(base)\n base.instance_eval do\n extend ClassMethods\n\n # call configuration_mutex once to initialize the value\n #\n initialize_configuration!\n end\n end",
"def initialize\n configure_via_yaml\n configure_via_env\n end",
"def initialize\n @configurations = {}\n end",
"def add_standard_properties\n super\n\n @config_manager.add_override_property('run.config_name', self.class.basename)\n end",
"def load_default_config\n self[:disable_html] ||= true\n self[:url_target] ||= \"_BLANK\"\n self[:image_alt] ||= \"Posted Image\"\n self[:table_width] ||= \"100%\"\n self[:syntax_highlighter] ||= :raw\n self[:coderay_options] ||= {}\n end",
"def configure\n end",
"def configure; end",
"def extended( instance )\n \n super if defined?( super )\n \n configuration_modules.each { |this_member| instance.extend( this_member ) }\n \n end",
"def set_conf_default(conf)\n end",
"def set_conf_default(conf)\n end",
"def default_config\n self.class.config[:default_config].nil? ? {} : {}.merge(self.class.config[:default_config])\n end",
"def options\n original_options = super\n user_defaults = @config\n user_defaults.merge(original_options)\n end",
"def config=(config); end",
"def default_configuration\n {}\n end",
"def configure\n # do nothing\n end",
"def initialize(config = {})\n\t\tsuper # check syntax\n\tend",
"def initialize(config = {})\n\t\tsuper # check syntax\n\tend",
"def namespace_start\n @inheritable_setting = Grape::Util::InheritableSetting.new.tap { |new_settings| new_settings.inherit_from inheritable_setting }\n end",
"def initialize(conf = {}) \n setPiledConf(conf) ;\n setDirectConfAttrList() ;\n end",
"def initialize\n @mutex = Mutex.new\n @config_hash = {}\n set_defaults\n end",
"def auto_configuration_state\n super\n end",
"def initialize( custom_config = {} )\n config = config_file.merge custom_config\n config = symbolize_keys config\n\n config[:username] = config[:api_key] if config[:api_key]\n config[:headers] ||= {}\n config[:request] ||= {}\n config[:response] ||= {}\n\n config[:headers][:accept] ||= \"application/hal+json\"\n\n # Copy the config into this Configuration instance.\n config.each { |k, v| self[k] = v }\n\n super()\n\n configure_user_agent\n configure_cache\n\n validate\n end",
"def init_default_attributes\n self.config_params ||= DEFAULT_CONFIG_PARAMS\n self.has_inventory = true\n end",
"def configuration; end",
"def configuration; end",
"def configuration; end",
"def configuration; end",
"def configuration; end",
"def initialize(&block)\n load_defaults!\n\n instance_eval(&block)\n end",
"def initialize( settings={} )\n\t\tsuper()\n\n\t\t@log_hosts = settings.delete( :log_hosts )\n\t\t@settings = settings\n\t\t@overridden_settings = nil\n\tend",
"def configuration_defaults(&block)\n @configuration_defaults = block\n end",
"def initialize\n super(true)\n end",
"def inherited( subclass )\n\t\t\tsuper\n\t\t\tsubclass.instance_variable_set( :@idle_timeout, self.idle_timeout.dup )\n\t\t\tsubclass.instance_variable_set( :@heartbeat_rate, self.heartbeat_rate.dup )\n\t\tend",
"def initialize_mixlib_config\n super\n end",
"def install_configure_in(base)\n base.instance_eval <<-EOF\n # Configuration class for host module\n #\n #{base.name}::Configuration = Class.new(Configurations::Configuration)\n\n # The central configure method\n # @params [Proc] block the block to configure host module with\n # @raise [ArgumentError] error when not given a block\n # @example Configure a configuration\n # MyGem.configure do |c|\n # c.foo = :bar\n # end\n #\n def self.configure(&block)\n fail ArgumentError, \"configure needs a block\" unless block_given?\n include_configuration_type!(#{base.name}::Configuration)\n\n set_configuration!(&block)\n end\n\n # A reader for Configuration\n #\n def configuration\n return Thread.current[configuration_name] if Thread.current.key?(configuration_name)\n\n @configuration_defaults && configure {}\n end\n\n\n private\n\n # Sets the configuration instance variable\n #\n def self.set_configuration!(&block)\n Thread.current[configuration_name] = #{base.name}::Configuration.__new__(\n configuration_options,\n &block\n )\n end\n\n def self.configuration_name\n :\"#{underscore_camelized(base.name)}\"\n end\n\n EOF\n end",
"def initialize(options={})\n super(DEFAULTS.merge(options))\n end",
"def initialize(&block)\n load_defaults!\n\n instance_eval(&block) if block_given?\n\n set_defaults!\n end",
"def configDefaults(config)\n end",
"def set_config(*args); end",
"def set_config(*args); end",
"def set_config(*args); end",
"def set_config(*args); end",
"def set_config(*args); end",
"def initialize(*args)\n @options = Hash.new\n @config = Hash.new\n \n # Set the banner\n @banner = self.class.banner\n \n # Dupe the class options for this instance\n klass_options = self.class.options\n klass_options.keys.inject(@options) { |memo, key| memo[key] = klass_options[key].dup; memo }\n \n # Set the default configuration values for this instance\n @options.each do |config_key, config_opts|\n config_opts[:on] ||= :on\n config_opts[:boolean] ||= false\n config_opts[:required] ||= false\n config_opts[:proc] ||= nil\n config_opts[:show_options] ||= false\n config_opts[:exit] ||= nil\n \n if config_opts.has_key?(:default)\n @config[config_key] = config_opts[:default]\n end\n end\n \n super(*args)\n end",
"def settings\n base_configuration.settings + self.class.settings\n end",
"def _init_configuration\n\t\t# Set defaults\n\t\t@setup = { \"create\" => false, \"environment\" => false, \"test\" => true, \"destroy\" => false }\n\t\t@config = false\n\tend",
"def initialize(conf)\n super(conf, BASE_URI)\n end",
"def initial_config\n default_config.deep_merge(@passed_config)\n end",
"def initialize_copy(orig)\n super\n @config = ConfigHash.new(self, orig.config.store.dup, false)\n end"
] |
[
"0.7237514",
"0.7227835",
"0.7224668",
"0.72157276",
"0.71949047",
"0.7156908",
"0.7053635",
"0.70450276",
"0.701952",
"0.701952",
"0.69846267",
"0.69537365",
"0.6899523",
"0.6878238",
"0.6873349",
"0.6869706",
"0.6849939",
"0.6810481",
"0.6799405",
"0.6799405",
"0.67744654",
"0.6760082",
"0.6759401",
"0.6748725",
"0.67031395",
"0.6697418",
"0.66939366",
"0.6689375",
"0.6635484",
"0.66311795",
"0.6617075",
"0.65999407",
"0.6597778",
"0.65714514",
"0.6546451",
"0.6546451",
"0.6546451",
"0.6546451",
"0.6546451",
"0.6546451",
"0.65441334",
"0.65385497",
"0.65385497",
"0.6521086",
"0.65196806",
"0.6513751",
"0.65020865",
"0.6501699",
"0.6494331",
"0.64923984",
"0.64738756",
"0.6470844",
"0.6470844",
"0.6462814",
"0.6458137",
"0.64372116",
"0.643675",
"0.64299554",
"0.64040744",
"0.64011425",
"0.64008915",
"0.64008915",
"0.6370585",
"0.6369756",
"0.6362602",
"0.63552547",
"0.63519305",
"0.6349687",
"0.6349687",
"0.630757",
"0.63068867",
"0.6297535",
"0.6290697",
"0.62862754",
"0.62824255",
"0.6278662",
"0.6278662",
"0.6278662",
"0.6278662",
"0.6278662",
"0.6265691",
"0.62645954",
"0.6256008",
"0.62467104",
"0.62412417",
"0.6237155",
"0.6234235",
"0.62266076",
"0.6222909",
"0.6218178",
"0.62171066",
"0.62171066",
"0.62171066",
"0.62171066",
"0.62171066",
"0.62130946",
"0.62094575",
"0.62065864",
"0.620568",
"0.6200039",
"0.6194804"
] |
0.0
|
-1
|
Dynamically determine the appropriate logger
|
def determine_loggers
if defined?(::Rails) && ::Rails.logger
self.logger = ::Rails.logger
else
require 'logger'
self.logger = ::Logger.new($stdout)
log_level = ::ENV.fetch('LOG_LEVEL', 'info').to_s.upcase
begin
logger.level = ::Logger::Severity.const_get(log_level)
rescue NameError => _e
logger.level = ::Logger::Severity::INFO
end
end
self.grpc_logger = logger if grpc_logger.nil?
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def __prep_logger__(name, logger = nil)\n if name.is_a?(String) && ! logger.nil?\n [name, logger.class <= Logger ? logger : Logger.new(logger)]\n elsif name.class <= Logger && logger.nil?\n [name, name]\n else\n [name, Logger.new(name)]\n end\n end",
"def logger( name )\n return default_logger if name.nil?\n @hash.fetch(name, default_logger)\n end",
"def logger\n @logger || default_logger\n end",
"def logger\n @logger || default_logger\n end",
"def init_logger \n if not Object.const_defined?(get_rails_default_logger_name)\n Logger.new(STDOUT)\n else\n eval(get_rails_default_logger_name)\n end \n end",
"def logger_for(name)\n loggers[name] ||= DefaultLogger.new(name, level)\n end",
"def logger\n raise NotImplementedError\n end",
"def define_logger(logger)\n return logger if logger.kind_of?(Logger)\n\n Logger.new(logger)\n end",
"def define_logger(logger)\n return logger if logger.kind_of?(Logger)\n\n Logger.new(logger)\n end",
"def logger\n @logger ||= Esi.config.logger || Logger.new(Esi.config.log_target).tap do |l|\n l.level = Logger.const_get(Esi.config.log_level.upcase)\n end\n end",
"def logger_for(name)\n @loggers[name] ||= configure_logger_for(name)\n end",
"def logger\n initialize_logger unless @logger\n @logger\n end",
"def logger\n @logger ||= default_logger\n end",
"def create_logger\n\n logger_level = settings[\"log.level\"] || \"info\"\n\n # log everything to STDERR or specified logfile\n logger = Yell::Logger.new(:null)\n logger.format = logger_format\n logger.level = logger_level\n\n logger_destination = settings[\"log.file\"] || \"STDERR\"\n # We intentionally repeat the logger_level\n # on the adapter, so it will stay there if overall level\n # is changed.\n case logger_destination\n when \"STDERR\"\n logger.adapter :stderr, level: logger_level, format: logger_format\n when \"STDOUT\"\n logger.adapter :stdout, level: logger_level, format: logger_format\n else\n logger.adapter :file, logger_destination, level: logger_level, format: logger_format\n end\n\n\n # ADDITIONALLY log error and higher to....\n if settings[\"log.error_file\"]\n logger.adapter :file, settings[\"log.error_file\"], :level => 'gte.error'\n end\n\n return logger\n end",
"def create_logger\n\n logger_level = settings[\"log.level\"] || \"info\"\n\n # log everything to STDERR or specified logfile\n logger = Yell::Logger.new(:null)\n logger.format = logger_format\n logger.level = logger_level\n\n logger_destination = settings[\"log.file\"] || \"STDERR\"\n # We intentionally repeat the logger_level\n # on the adapter, so it will stay there if overall level\n # is changed.\n case logger_destination\n when \"STDERR\"\n logger.adapter :stderr, level: logger_level, format: logger_format\n when \"STDOUT\"\n logger.adapter :stdout, level: logger_level, format: logger_format\n else\n logger.adapter :file, logger_destination, level: logger_level, format: logger_format\n end\n\n\n # ADDITIONALLY log error and higher to....\n if settings[\"log.error_file\"]\n logger.adapter :file, settings[\"log.error_file\"], :level => 'gte.error'\n end\n\n return logger\n end",
"def logger\n @logger || Rcal::Util::Loggable.default_logger\n end",
"def logger(name = self.class.name)\n Logger.new(name)\n end",
"def get_logger; @logger; end",
"def logger( object = nil )\n name = logger_name object\n provider.logger name\n end",
"def log_level\n @log_level ||= \"Log4r::#{@options[:log_level].upcase}\".constantize\n end",
"def logger\n init_logger if Log4r::Logger[STANDARD_LOGGER].nil?\n Log4r::Logger[STANDARD_LOGGER]\n end",
"def logger\n @logger ||= options[:logger] || if defined?(Rails)\n Rails.logger\n else\n default_logger\n end\n end",
"def logger\n @logger ||= options[:logger] || if defined?(Rails)\n Rails.logger\n else\n default_logger\n end\n end",
"def logger\n @logger ||= default_logger\n end",
"def setup_default_logger(logger)\n progname = 'Expectacle'\n @logger = if logger == :syslog\n Syslog::Logger.new(progname)\n else\n default_io_logger(logger, progname)\n end\n @logger.level = Logger::INFO\n @logger.formatter = proc do |severity, datetime, pname, msg|\n \"#{datetime} #{pname} [#{severity}] #{msg}\\n\"\n end\n end",
"def logger(logger_name = :default)\n # Coerce the logger_name if needed.\n logger_name = ::Af::Application.singleton.af_name if logger_name == :default\n # Check with Log4r to see if there is a logger by this name.\n # If Log4r doesn't have a logger by this name, make one with Af defaults.\n return Log4r::Logger[logger_name] || Log4r::Logger.new(logger_name)\n end",
"def logger\n unless defined? @logger\n logger = Logging.logger[self]\n @logger = Kernel.const_defined?('Rails') ? Rails.logger : logger\n end\n @logger\n end",
"def setup_logger(log_name)\n date = Time.new.localtime.strftime('%F %H.%M.%S%L')\n logger = Logger.new(\"#{$VALUE}/test_logs/#{log_name}_#{date}.log\")\n logger.formatter = proc do |severity, datetime, _progname, msg|\n date_format = datetime.strftime('%Y-%m-%d %H:%M:%S%L')\n if (severity == 'INFO') || (severity == 'WARN')\n \"[#{date_format}] #{severity} (#{ENV['PRODUCT_NAME']}): #{msg}\\n\"\n else\n \"[#{date_format}] #{severity} (#{ENV['PRODUCT_NAME']}): #{msg}\\n\"\n end\n end\n logger\nend",
"def logger\n @logger ||= create_logger\n end",
"def logger\n @logger ||= create_logger\n end",
"def logger\n @logger ||= build_logger\n end",
"def logger_for(classname)\n @loggers[classname] ||= configure_logger_for(classname)\n end",
"def logger_for(classname)\n @loggers[classname] ||= configure_logger_for(classname)\n end",
"def logger\n @logger ||=\n begin\n logger = SemanticLogger::Processor.logger.clone\n logger.name = self.class.name\n logger\n end\n end",
"def initialize_logger()\n case logger_type\n when :local\n log_path = File.join(RAILS_ROOT, 'log', \"#{config_basename}.log\")\n system(\"cat /dev/null > #{log_path}\")\n ActiveSupport::BufferedLogger.new(log_path)\n when :remote\n RemoteLogger.new(config_basename, File.join(RAILS_ROOT, 'log'), proc_id)\n when :stderr\n logger = ActiveSupport::BufferedLogger.new($stderr)\n logger.auto_flushing = true\n logger\n else\n raise ArgumentError, \"logger_type must be :local,:remote or :stderr\"\n end\n end",
"def initialize_logger()\n case logger_type\n when :local\n log_path = File.join(RAILS_ROOT, 'log', \"#{config_basename}.log\")\n system(\"cat /dev/null > #{log_path}\")\n ActiveSupport::BufferedLogger.new(log_path)\n when :remote\n RemoteLogger.new(config_basename, File.join(RAILS_ROOT, 'log'), proc_id)\n when :stderr\n logger = ActiveSupport::BufferedLogger.new($stderr)\n logger.auto_flushing = true\n logger\n else\n raise ArgumentError, \"logger_type must be :local,:remote or :stderr\"\n end\n end",
"def initialize_logger()\n case logger_type\n when :local\n log_path = File.join(RAILS_ROOT, 'log', \"#{config_basename}.log\")\n system(\"cat /dev/null > #{log_path}\")\n ActiveSupport::BufferedLogger.new(log_path)\n when :remote\n RemoteLogger.new(config_basename, File.join(RAILS_ROOT, 'log'), proc_id)\n when :stderr\n logger = ActiveSupport::BufferedLogger.new($stderr)\n logger.auto_flushing = true\n logger\n else\n raise ArgumentError, \"logger_type must be :local,:remote or :stderr\"\n end\n end",
"def logger\n return @logger ||= default_logger\n end",
"def logger\n @logger ||= set_logger\n end",
"def logger_level; end",
"def logger\n @logger ||= LogAdapter.new(Stevenson.new, (ENV[\"JEKYLL_LOG_LEVEL\"] || :info).to_sym)\n end",
"def log\n @log ||= Logging.logger[File.basename($0)]\n end",
"def logger=(logger)\n require \"hiera/#{logger}_logger\"\n\n @logger = Hiera::FallbackLogger.new(\n Hiera.const_get(\"#{logger.capitalize}_logger\"),\n Hiera::Console_logger)\n rescue Exception => e\n @logger = Hiera::Console_logger\n warn(\"Failed to load #{logger} logger: #{e.class}: #{e}\")\n end",
"def logger\n @logger ||= _new_logger\n end",
"def logger\n if logger = super\n return logger\n end\n\n @__utilrb_hierarchy__default_logger =\n if kind_of?(Module)\n m = self\n while m\n if m.name && !m.spacename.empty?\n parent_module =\n begin\n constant(m.spacename)\n rescue NameError\n end\n if parent_module.respond_to?(:logger)\n break\n end\n end\n\n if m.respond_to?(:superclass)\n m = m.superclass\n if m.respond_to?(:logger)\n parent_module = m\n break\n end\n else\n m = nil; break\n end\n end\n\n if !m\n raise NoParentLogger, \"cannot find a logger for #{self}\"\n end\n if parent_module.respond_to? :register_log_child\n @parent_module = parent_module\n parent_module.register_log_child(self)\n end\n parent_module.logger\n else\n self.class.logger\n end\n end",
"def celluloid_logger_class\n if version_less_than_seventeen?\n Celluloid::Logger\n else\n Celluloid::Internals::Logger\n end\n end",
"def logger\n @logger ||= Logger.new(@log_file_name)\n\n @logger.formatter = proc do |severity, datetime, progname, msg|\n \"%s, [%s #%d] (%s) %5s -- %s: %s\\n\" % [severity[0..0], datetime, $$, Conf.global_conf[:hostname], severity, progname, msg]\n end\n\n if Conf.global_conf[:debug]\n @logger.level = Logger::DEBUG\n else\n @logger.level = Logger::INFO\n end\n @logger\n end",
"def logger(obj)\n %w(debug info warn error fatal level).each do |m|\n next if obj.respond_to?(m)\n raise ArgumentError, \"logger #{obj} does not respond to method #{m}\"\n end\n map[:logger] = obj\n end",
"def logger=(logr); @logger = logr end",
"def logger\n return @logger if defined?(@logger) && !@logger.nil?\n path = log_path\n FileUtils.mkdir_p(File.dirname(path))\n prepare_logger(path)\n rescue\n prepare_logger(STDOUT)\n end",
"def create_logger\n l = self['logger']\n\n if l == true or l.nil?\n ::Logger.new(production? ? project_path('production.log') : STDOUT)\n elsif l.is_a?(Class)\n l.new(production? ? project_path('production.log') : STDOUT)\n elsif l.is_a?(Proc)\n l.call\n elsif l\n raise 'bad logger configure, should be: `true` / `false` / Class / Proc'\n end\n end",
"def get(biz_name = :stdout, level = nil)\n return Flogger.new(STDOUT) if biz_name.nil? || biz_name == :stdout\n\n biz_name = biz_name.to_sym\n findit = loggers[biz_name]\n return findit if findit\n\n level ||= default_level\n if syslog?\n logger = Syslogger.new(biz_name)\n logger.formatter = Syslogger::Formatter.new\n logger.level = level\n else\n log_path = root.join(\"#{biz_name}.log\")\n logger = Flogger.new(log_path, 3, 10_240_000) #10M\n logger.formatter = Flogger::Formatter.new\n logger.level = level\n logger.logdev2.sync = true\n end\n\n logger.group = biz_name\n loggers[biz_name] = logger\n end",
"def log(p_suffix = nil)\n key = (self.class.const_defined?(:LOGGING_PARENT) ? self.class.const_get(:LOGGING_PARENT).to_s : self.class.name)\n key += \"#{Logging::add_suffix(p_suffix.to_s)}\" unless p_suffix.nil?\n\n result = @@loggers.fetch(key, @@loggers[self.class.name])\n result = @@loggers.fetch(calling_class) unless result\n\n result\n end",
"def logger\n @logger ||= NilLogger.new\n end",
"def logger=(logger)\n @logger = logger || @logger\n end",
"def logger\n classname = (self.is_a? Module) ? self : self.class.name\n @logger ||= Loggable.logger_for(classname)\n end",
"def logger\n if defined?(BOWLINE_LOGGER)\n BOWLINE_LOGGER\n else\n nil\n end\n end",
"def configure_logging\n @logger = Logging.logger[self]\n end",
"def logger\n @logger ||= LogAdapter.new(Stevenson.new, (ENV[\"DAODAO_LOG_LEVEL\"] || :info).to_sym)\n end",
"def default_logger\n Logger.new(debug? ? STDOUT : nil)\n end",
"def logger\n return @local_logger if @local_logger\n FileUtils.mkdir_p(File.dirname(log_path)) unless File.exists?(File.dirname(log_path))\n\n if API_KEYS[\"logentries\"]\n token = API_KEYS[\"logentries\"][Rails.env][\"nsc\"]\n @local_logger = Le.new(token, :debug => false, :local => log_path, :ssl => true, :tag => true)\n else\n @local_logger = Logger.new(log_path)\n end\n @local_logger\n end",
"def log\n unless self.class._slflogger\n self.class.createlogger\n end\n return self.class._slflogger\n end",
"def logger=(_arg0); end",
"def logger=(_arg0); end",
"def logger=(_arg0); end",
"def logger=(_arg0); end",
"def logger=(_arg0); end",
"def logger=(_arg0); end",
"def logger=(_arg0); end",
"def logger\n\t\treturn Loggability[ self ]\n\tend",
"def initialize_logger\n return if @logger.blank?\n log = @logger\n log = log.to_s if log.is_a?(Pathname)\n if log.is_a?(String)\n log = File.join(TMP_ROOT_DIR, log) unless log.start_with?('/')\n @logger =\n Logger.new(log).tap { |l| l.level = Logger.const_get(@log_level) }\n end\n unless @logger.is_a?(Logger)\n raise \"expected String, got #{log.class} #{log.inspect}\"\n end\n end",
"def logger\n @logger ||= Logging.logger_for(self.class.name)\n end",
"def logger\n @logger ||= Logger.get_logger(config.robot.log_level, config.robot.log_formatter)\n end",
"def logger\n @logger ||= self.class.logger\n end",
"def logger\n settings[\"logger\"] ||= Yell.new(STDERR, :level => \"gt.fatal\") # null logger\n end",
"def logger\n settings[\"logger\"] ||= Yell.new(STDERR, :level => \"gt.fatal\") # null logger\n end",
"def logdev_logger(filepath_or_logdev)\n Omnitest::Core::LogdevLogger.new(resolve_logdev(filepath_or_logdev))\n end",
"def logger\n @logger ||= Logger.get_logger(config.robot.log_level)\n end",
"def logger \n klass = self.class\n klass.logger\n end",
"def logger\n @loggers.first\n end",
"def default_logger\n self.logger = Logger.new(STDERR)\n\n if settings.service.debug_mode || $DEBUG\n logger.level = Logger::DEBUG\n else\n logger.level = Logger::INFO\n end\n\n logger\n end",
"def default_logger\n self.logger = Logger.new(STDERR)\n\n if settings.service.debug_mode || $DEBUG\n logger.level = Logger::DEBUG\n else\n logger.level = Logger::INFO\n end\n\n logger\n end",
"def configure_logger_for(name)\n logger = Logger.new(@logdev, @shift_age, @shift_size)\n logger.level = @level\n logger.progname = name\n logger.formatter = formatter\n logger\n end",
"def logger_for(classname, methodname)\n @loggers[classname] ||= configure_logger_for(classname, methodname)\n end",
"def setup_logger(logger = nil)\n # If a logger is specified we replace the existing.\n @logger = logger\n\n # Otherwise we create a new one.\n logger = Logger.new(STDOUT)\n logger.level = Logger::DEBUG\n @logger ||= logger\n end",
"def logger\n @logger ||= configuration.logger\n end",
"def replace_log io = DefaultIO, level = @log.level\n l = ::Deployable::Logger.new io, level\n #l.level = @log.level\n @log = l\n end",
"def logger\n classname = self.class.name\n methodname = caller[0][/`([^']*)'/, 1]\n\n @_logger ||= ProjectHanlon::Logging.logger_for(classname, methodname)\n @_logger.progname = \"#{caller[0]}>>#{classname}\\##{methodname}\"\n @_logger\n end",
"def logger?( name )\n @hash.key? name\n end",
"def logger\n adapter.logger if adapter\n end",
"def logger\n @logger || StartupLogger.instance\n end",
"def init_logger\n self.log4r_config = load_file_config('log4r.yml')\n\n if log4r_config\n Log4r::YamlConfigurator.decode_yaml(log4r_config['log4r_config'])\n\n environments = log4r_config['log4r_config']['loggers'].map do |logger|\n logger['name']\n end\n\n if environments.include?(run_env)\n self.logger = Log4r::Logger[run_env]\n else\n self.logger = Log4r::Logger['development']\n end\n else\n self.logger = Log4r::Logger.new(run_env)\n self.logger.level = Log4r::DEBUG\n self.logger.add Log4r::Outputter.stdout\n self.logger.warn\n \"Log4r configuration file #{full_config_path('log4r.yml')} not found.\"\n self.logger.info \"Log4r outputting to stdout with DEBUG level.\"\n end\n end",
"def logger\n @logger ||= case environment\n when 'development'\n Logger.new(STDERR, Logger::DEBUG)\n when 'test'\n Logger.new(STDERR, Logger::WARN)\n else\n Logger.new(STDERR, Logger::INFO)\n end\n end",
"def logger?\n self[:logger].nil? || self[:logger] ? true : false\n end",
"def logger=(other)\n config.logger = other\n end",
"def _logger\n @logger ||= Log4r::Logger.new(self.class.to_s)\n end",
"def use_logger(logger)\n adapter.logger = logger\n end",
"def logger_type=(new_logtype)\n current_severity_integer=if @logger.nil?\n if ENV.has_key?('AS_LOG_LEVEL')\n ENV['AS_LOG_LEVEL']\n else\n Logger::Severity::WARN\n end\n else\n @logger.level\n end\n case new_logtype\n when :stderr\n @logger = Logger.new(STDERR)\n when :stdout\n @logger = Logger.new(STDOUT)\n when :syslog\n require 'syslog/logger'\n @logger = Syslog::Logger.new(@program_name)\n else\n raise \"unknown log type: #{new_logtype.class} #{new_logtype}\"\n end\n @logger.level=current_severity_integer\n @logger_type=new_logtype\n end",
"def logger\n if @logger.nil?\n @logger = Logger::new(STDOUT)\n \n # formatter\n default = Logger::Formatter::new\n @logger.formatter = proc do |severity, datetime, progname, msg|\n progname = @targets.from\n msg = \"##{Thread.current.object_id} \" + msg \n default.call(severity, datetime, progname, msg)\n end\n end\n \n return @logger\n end",
"def logger\n @log\n end"
] |
[
"0.7128099",
"0.6945406",
"0.675343",
"0.675343",
"0.6714733",
"0.66715235",
"0.6647845",
"0.662637",
"0.662637",
"0.6616979",
"0.658269",
"0.6558022",
"0.65439224",
"0.6517293",
"0.6517293",
"0.65078455",
"0.6467223",
"0.64628303",
"0.64309806",
"0.6424142",
"0.6407963",
"0.6402459",
"0.6402459",
"0.63953227",
"0.63908774",
"0.6386253",
"0.635713",
"0.63566357",
"0.63302296",
"0.63302296",
"0.6324889",
"0.63176936",
"0.63176936",
"0.6298681",
"0.62967455",
"0.62967455",
"0.62967455",
"0.62957424",
"0.6284971",
"0.6281165",
"0.628055",
"0.6278957",
"0.62736917",
"0.62685966",
"0.6254644",
"0.6226998",
"0.6219572",
"0.6218205",
"0.62153375",
"0.62148064",
"0.621399",
"0.6213145",
"0.6209976",
"0.619369",
"0.61893684",
"0.6181686",
"0.6179132",
"0.61626035",
"0.61483866",
"0.6140938",
"0.6140115",
"0.61336815",
"0.6130336",
"0.6130336",
"0.6130336",
"0.6130336",
"0.6130336",
"0.6130336",
"0.6130336",
"0.61285454",
"0.6119411",
"0.611622",
"0.61117154",
"0.6095431",
"0.60898197",
"0.60898197",
"0.60805804",
"0.60721314",
"0.6051337",
"0.6046111",
"0.60446244",
"0.60446244",
"0.6037068",
"0.60023135",
"0.59988105",
"0.5987682",
"0.59864575",
"0.5981971",
"0.5976354",
"0.59730387",
"0.5969491",
"0.5965978",
"0.5962464",
"0.59561837",
"0.5953231",
"0.59522444",
"0.59479785",
"0.5945304",
"0.59389746",
"0.59314865"
] |
0.6855611
|
2
|
go to EMR if pres has done normal buy, or if normal buy isn't possible
|
def must_buy_power?(entity)
@round.emergency_buy ||
(@game.must_buy_power?(entity) && entity.cash < @game.current_power_cost)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def attemp_buying\n\n end",
"def must_buy_train?(entity)\n must_buy_power?(entity)\n end",
"def bought?\n # paym\n end",
"def can_buy_depot_train?(entity)\n entity.cash >= @depot.upcoming.first.price\n end",
"def require_self_enabled_cross_selling\n if @entity.try(:self_enabled_cross_sell) != true\n redirect_to [:admin, @entity, :cross_selling_lists]\n end\n end",
"def check_special_offer(customer, cart)\n \n # Check for potential deals\n potential_deals = trigger_deals.where(special: true)\n unless potential_deals.empty?\n potential_deal = potential_deals.first\n \n # Find the deployment for the the model of this deal's product\n if !(cart.include? potential_deal.product) && potential_deal.product.deployment\n \n # Get the score from the given deployment\n probability = potential_deal.product.deployment.get_score customer\n \n # Offer the deal if the probability is greater than 80%\n return potential_deal if probability > 0.8\n end\n \n end\n end",
"def trade action\n bid_ask=action==:buy ? :ask : :bid\n\n\tp = @price[:bid] if @price && @price[:bid] && bid_ask==:bid#memoize\n\tp = @price[:ask] if @price && @price[:ask] && bid_ask==:ask#memoize\n\tp = price(action) unless p\n bid_ask=action==:buy ? \"B\":\"S\" #reverse because its BTCUSD pair\n\tvolume = @options[:volume]\n\n params = {'username' => ENV['ROCK_USERNAME'],\n\t 'password' => ENV['ROCK_PASSWORD'],\n\t 'api_key' => ENV['ROCK_KEY'],\n\t 'fund_name'=> 'BTCUSD',\n\t\t 'order_type'=>bid_ask,\n\t\t 'amount' => volume,\n\t\t 'price' => p\n\t }\n\tresponse = RestClient.post(\"https://www.therocktrading.com/api/place_order\", params, {})\n r_json=JSON.parse(response)\n if !r_json[\"result\"][0].key?(\"order_id\")\n #order was not accepted by exchnage\n return false\n end\n\torder_id = r_json[\"result\"][0][\"order_id\"]\n retries = @options[:trade_retries]\n (1..retries).each do |attempt|\n if !open_orders.include?(order_id)\n return true\n end\n if attempt == retries\n cancel_order order_id\n logger.info \"failed to fill #{action} order at #{exchange}\"\n return false\n else\n logger.info \"Attempt #{attempt}/#{retries}: #{action} order #{order_id} still opening, waiting for close to\"\n sleep(1)\n end\n end\n return false\n\n\n end",
"def can_buy()\n event = Event.find_by(id: self.event_id)\n if Time.now > event.start_date then\n halt msg: 'can_buy() fail' \n false\n else\n true\n end\n end",
"def analysis\n # return 0 if @previous_buy_price == 0 # next for the first time\n\n if @order.trading_type == \"BUYING\"\n check_set_order_for_buy()\n elsif @order.trading_type == \"CHECKING_ORDER_BUY\"\n check_finish_order_buy()\n elsif @order.trading_type == \"SELLING\"\n check_set_order_sell()\n elsif @order.trading_type == \"CHECKING_ORDER_SELL\"\n check_finish_order_sell()\n elsif @order.trading_type == \"FORCE_SELL\"\n force_order_sell()\n end\n end",
"def analysis\n return 0 if @previous_buy_price == 0 # next for the first time\n\n @ico_bot.reload\n\n if @ico_bot.trading_type == \"FORCE_BUY\"\n check_set_force_order_for_buy()\n elsif @ico_bot.trading_type == \"CHECKING_ORDER_BUY\"\n check_finish_order_buy()\n elsif @ico_bot.trading_type == \"FORCE_SELL\"\n check_set_force_sell()\n elsif @ico_bot.trading_type == \"CHECKING_ORDER_SELL\"\n check_finish_order_sell()\n # elsif @ico_bot.trading_type == \"LOSE_ORDER\"\n # check_finish_lose_order()\n end\n end",
"def fetch_by_economy_state\n\n handle_errors_and_exceptions do\n\n check_token_deployment\n\n check_mint_progress if @go_to.blank?\n\n # If go_to is blank or is same as the from_page, do not redirect.\n if @go_to.blank? || @go_to[:by_screen_name] == @from_page[:by_screen_name]\n return success\n else\n return error_with_go_to('s_fgtbes_2', 'data_validation_failed', @go_to)\n end\n\n end\n\n end",
"def unredeemable?\n payment_owed? && !(ProductStrategy === self.order.promotion.strategy) \n end",
"def buy_sell_bot(percent_increase = 0.05, chunk = 0.004, prepump_buffer = 0.5, profit = 0.2, splits = 2, no_of_retries = 10)\n market_name = @market_name\n currency = @currency\n low_24_hr, last_price, ask_price = get_market_summary(market_name)\n total_spent = 0.0\n p [low_24_hr, last_price, ask_price]\n if last_price < (1.0 + prepump_buffer)*low_24_hr #last_price is smaller than 50% increase since yerterday\n order = buy_chunk(last_price, market_name, percent_increase, chunk)\n buy_price = last_price + last_price * percent_increase\n counter = 0\n while counter < no_of_retries\n get_balance_url = get_url({ :api_type => \"account\", :action => \"currency_balance\", :currency => currency })\n balance_details = call_secret_api(get_balance_url)\n p balance_details\n if balance_details and balance_details[\"Available\"] and balance_details[\"Available\"] > 0.0 # available coins present\n qty = balance_details[\"Available\"]/splits\n splits.times do |i|\n qty += (balance_details[\"Available\"].to_i % splits) if (i-1 == splits)\n sell_price = buy_price + buy_price * (profit * (i+1))\n sell_price = \"%.8f\" % sell_price\n sell_limit_url = get_url({ :api_type => \"market\", :action => \"sell\", :market => market_name, :quantity => qty, :rate => sell_price })\n puts \"Selling coin...\".yellow\n p [{ :api_type => \"market\", :action => \"sell\", :market => market_name, :quantity => qty, :rate => sell_price }]\n order_placed = call_secret_api(sell_limit_url)\n puts (order_placed and !order_placed[\"uuid\"].nil? ? \"Success\".green : \"Failed\".red)\n cnt = 1\n while cnt <= 3 and order_placed and order_placed[\"uuid\"].nil? #retry\n puts \"Retry #{cnt} : Selling coin...\".yellow\n sleep(1) # half second\n order_placed = call_secret_api(sell_limit_url)\n puts (order_placed and !order_placed[\"uuid\"].nil? ? \"Success\".green : \"Failed\".red)\n cnt += 1\n end\n p [order_placed, \"Sell #{qty} of #{market_name} at #{sell_price}\"]\n end\n break\n end\n counter += 1\n sleep(0.5)\n end\n end\nend",
"def sell_at_any_cost(percent_decrease = 0.3)\n market_name = @market_name\n open_orders_url = get_url({ :api_type => \"market\", :action => \"open_orders\", :market => market_name })\n open_orders = call_secret_api(open_orders_url)\n #cancel all orders\n if open_orders.size > 0\n open_orders.each do |open_order|\n cancel_order_url = get_url({ :api_type => \"market\", :action => \"cancel_by_uuid\", :uuid => open_order[\"OrderUuid\"] })\n call_secret_api(cancel_order_url)\n end\n end\n # call sell bot again with lower profit\n sell_order = sell_bot(percent_decrease)\nend",
"def ebuy_cash_needed(corporation)\n return 0 unless @game.corporation_power[corporation] < @game.min_ebuy_power\n\n diff = @game.min_ebuy_power - @game.corporation_power[corporation]\n diff * @game.class::POWER_COST[@game.phase.name] * 1.5\n end",
"def startTrading market,hashLeft,btcLeft,tradingPrice\n\n startID = Pricepoint.last.id\n\n #Set these:\n\n username = \"whateverYourNameIS\"\n hashKey = \"YourKeyHereLotsOfNUmbers\"\n hashSecret = \"YourSecretHereLooksSimilar\" \n\n @api = Hashnest::API.new(username, hashKey, hashSecret)\n \n market = 19 #change this for other market\n origHashLeft = hashLeft\n origBtcLeft = btcLeft\n\n @api.quick_revoke market, \"sale\"\n @api.quick_revoke market, \"purchase\"\n\n\n minBuyAmount = 200\n minSaleAmount = 200\n sellMin = tradingPrice\n buyMax = tradingPrice\n\n sellSpread = 0.00005\n buySpread = 0.00004\n\n\n middle = (sellMin + buyMax) / 2.0\n\n minOrder = 93\n\n btcLeft = origBtcLeft\n hashLeft = origHashLeft\n\n \n updatedOrders = updateOrders market,minBuyAmount,minSaleAmount\n lSale = updatedOrders[0]\n hBuy = updatedOrders[1]\n sellInfo = [0,lSale]\n buyInfo = [0,hBuy]\n\n #Check initial sell and buy\n hashBal = hashBalance market\n sellAmount = hashBal[0] - hashLeft\n\n btcBal = btcBalance\n buyBtc = btcBal[0] - btcLeft\n buyAmount = (buyBtc / buyMax).round\n\n puts \"####### Starting trading Middle: #{middle} - Buying: #{buyAmount} - Selling: #{sellAmount} #######\"\n\n while (Pricepoint.last.id <= startID)\n #Check if we should buy or sell\n \n updatedOrders = updateOrders market,minBuyAmount,minSaleAmount\n lSale = updatedOrders[0]\n hBuy = updatedOrders[1]\n secSale = updatedOrders[2]\n secBuy = updatedOrders[3]\n\n if (lSale > sellMin)\n #Price is good to sell\n\n if (minSaleAmount > minOrder)\n minSaleAmount = minSaleAmount * 0.9\n end\n\n\n #Check how much we can sell\n hashBal = hashBalance market\n sellAmount = hashBal[0] - hashLeft\n #If this is larger than 0, lets go on\n\n if (sellAmount > minOrder)\n #Check if we're already selling the right amount\n if ((hashBal[1] - sellAmount).abs < 50)\n #Check if the price is right\n sellDiff = (sellInfo[1] - lSale).abs\n secSellDiff = (sellInfo[1] - secSale).abs\n if (sellDiff > 0.000000009 || secSellDiff > 0.000000011)\n puts \"Sell Price is wrong, changing price...\"\n sellInfo = revokeAndPlaceNewSell market, minBuyAmount, minSaleAmount, sellMin, sellAmount\n end\n \n\n else\n puts \"Cancelling and placing new sell order\"\n sellInfo = revokeAndPlaceNewSell market, minBuyAmount, minSaleAmount, sellMin, sellAmount\n end\n else\n puts \"Hashamount is #{sellAmount}, we can't sell less than #{minOrder}\"\n end\n else\n puts \"Lowest sell: #{lSale}, our min price: #{sellMin} = We can't sell!\"\n if ((minSaleAmount * 1.2) < sellAmount)\n minSaleAmount = minSaleAmount * 1.2\n end\n sellInfo = [0,lSale]\n end\n\n\n if (hBuy < buyMax)\n #Price is good to buy\n if (minBuyAmount > minOrder)\n minBuyAmount = minBuyAmount * 0.95\n end\n\n #Check how much we can buy\n btcBal = btcBalance\n buyBtc = btcBal[0] - btcLeft\n buyAmount = (buyBtc / hBuy).round\n\n #If this is larger than 0, lets go on\n if (buyAmount > minOrder)\n\n #Check if we're already buying the right amount\n if ((btcBal[1] - buyBtc).abs < 0.1 )\n puts \"We are buying the right amount\"\n\n #Check if the price is right\n buyDiff = (buyInfo[1] - hBuy).abs\n secBuyDiff = (buyInfo[1]- secBuy).abs\n\n #puts \"BuyDiff #{buyDiff} sec #{secBuyDiff}\"\n if (buyDiff > 0.000000009 || secBuyDiff > 0.000000011)\n puts \"Buy Price is wrong, changing price...\"\n buyInfo = revokeAndPlaceNewBuy market, minBuyAmount, minSaleAmount, buyMax, buyAmount\n end\n\n\n else\n puts \"Cancelling and placing new buy order\"\n buyInfo = revokeAndPlaceNewBuy market, minBuyAmount, minSaleAmount, buyMax, buyAmount\n end\n\n else\n puts \"Hashamout is #{buyAmount}, we can't buy less than #{minOrder} hash\"\n end\n\n\n else\n puts \"Highest buy: #{hBuy}, our max price: #{buyMax} = We can't buy!\"\n if ((minBuyAmount * 1.2) < buyAmount)\n minBuyAmount = minBuyAmount * 1.2\n end\n buyInfo = [0,hBuy]\n end\n\n puts \"Last order sell #{sellInfo[0]} for #{sellInfo[1]} and buy #{buyInfo[0]} for #{buyInfo[1]}\"\n \n\n distanceToBuy = buyMax - buyInfo[1]\n btcLeft = origBtcLeft * (1 - distanceToBuy/buySpread)\n if btcLeft < 0.0\n btcLeft = 0.0\n end\n\n distanceToSell = sellInfo[1] - sellMin\n hashLeft = origHashLeft * (1 - distanceToSell/sellSpread)\n if hashLeft < 0.0\n hashLeft = 0.0\n end\n\n\n puts \"Buy distance from middle: #{distanceToBuy*100000}, new btcLeft: #{btcLeft}, new minBuyAmount #{minBuyAmount}\"\n puts \"Sell distance from middle: #{distanceToSell*100000}, new hashLeft: #{hashLeft}, new minSaleAmount #{minSaleAmount}\"\n\n total = totalBtcValue market,hBuy\n puts \"####### Total now: #{total} #######\"\n\n end\n end",
"def test_for_cheap\r\n if @agent_bargain_limit\r\n @ischeap = true if @price < @agent_bargain_limit\r\n else\r\n @ischeap = true if @price < @cheap\r\n end\r\n end",
"def pure_sell?(buy_it_now=false)\n if (self.btba_type.present? && self.btba_type.code == BtbaType::CODE_NO) && \n (self.high_bid_amount.present? && self.high_bid_amount > 0) && \n (self.min_bid_reserve.nil? || buy_it_now || (self.high_bid_amount >= self.min_bid_reserve))\n true\n else\n false\n end\n end",
"def valuate_sell_article(article)\n return if article.unlimited?\n return if article.sell_locked?\n (0..article.quantity - 1).each {\n if rand(100) < depletion_rate\n deplenish_article(article)\n if article.rare?\n $game_shops.add_on_trade_flow(article.item)\n end\n end\n }\n end",
"def buy_product\n products = @seller.show_product_info \n product_buy = @view.buy_product(products)\n @total_price = @seller.save_buy_a_product(product_buy)\n @view.buy_status(@total_price)\n input = @view.menu(\"2\")\n seller_actions(input) \n end",
"def buy\n if self.inventory_count == 0\n return false\n else\n # for now, decrementing the inventory count when purchasing a product will do\n self.decrement!(:inventory_count)\n # in the future, could return a receipt number, etc.\n return true\n end\n end",
"def sell_bot(percent_decrease = 0.1)\n market_name = @market_name\n currency = @currency\n low_24_hr, last_price, ask_price = get_market_summary(market_name)\n sell_price = last_price - percent_decrease*last_price\n get_balance_url = get_url({ :api_type => \"account\", :action => \"currency_balance\", :currency => currency })\n balance_details = call_secret_api(get_balance_url)\n sell_price = \"%.8f\" % sell_price\n if balance_details and balance_details[\"Available\"] and balance_details[\"Available\"] > 0.0\n p [market_name, last_price, balance_details[\"Available\"], sell_price]\n sell_limit_url = get_url({ :api_type => \"market\", :action => \"sell\", :market => market_name, :quantity => balance_details[\"Available\"], :rate => sell_price })\n puts \"Selling coin...\".yellow\n p [{ :api_type => \"market\", :action => \"sell\", :market => market_name, :quantity => balance_details[\"Available\"], :rate => sell_price }]\n order_placed = call_secret_api(sell_limit_url)\n puts (order_placed and !order_placed[\"uuid\"].nil? ? \"Success\".green : \"Failed\".red)\n cnt = 1\n while cnt <= 3 and order_placed and order_placed[\"uuid\"].nil? #retry\n puts \"Retry #{cnt} : Selling coin...\".yellow\n sleep(1) # half second\n order_placed = call_secret_api(sell_limit_url)\n puts (order_placed and !order_placed[\"uuid\"].nil? ? \"Success\".green : \"Failed\".red)\n cnt += 1\n end\n p [order_placed, \"Sell #{balance_details[\"Available\"]} of #{market_name} at #{sell_price}\"]\n else\n puts \"Insufficient Balance\".red\n end\nend",
"def buy\n if @product.price <= @user.coin_credit # Checks whether the user has enough coin_credit or not\n purchase\n else\n @user.errors.add(:coin_credit, :not_enough_credit)\n false\n end\n end",
"def on_sale?\n is_sold && ( !discontinued? || has_stock? ) && ( has_stock? || Spree::Config[:allow_backorders] )\n end",
"def buy_item(item, log = true)\n seller = item.owner\n\n if seller.nil?\n Analytics::ItemBuyActivity.with_buyer_item_price_success(self, item, false).log if log\n return false, \"item_no_owner\" #Item does not belong to anybody\n elsif self.credits < item.price\n Analytics::ItemBuyActivity.with_buyer_item_price_success(self, item, false).log if log\n return false, \"not_enough_credits\" #Buyer does not have enough credits\n elsif !item.active?\n Analytics::ItemBuyActivity.with_buyer_item_price_success(self, item, false).log if log\n return false, \"buy_inactive_item\" #Trying to buy inactive item\n elsif !seller.items.include?(item)\n Analytics::ItemBuyActivity.with_buyer_item_price_success(self, item, false).log if log\n return false, \"seller_not_own_item\" #Seller does not own item to buy\n end\n\n seller.release_item(item)\n\n TradingAuthority.settle_item_purchase(seller, self, item)\n\n item.deactivate\n self.attach_item(item)\n\n item.notify_change\n\n Analytics::ItemBuyActivity.with_buyer_item_price_success(self, item).log if log\n\n return true, \"Transaction successful\"\n end",
"def buy_postage_if_necessary(options = {:current_balance => 9999, :control_total => 0})\n min_postage_balance = 25 # buy postage if balance is under this amount\n postage_purchase_amount = 75 # amount to purchase at a time\n max_control_total = 1000 # max amount to spend per month?\n if Rails.env.production?\n if options[:current_balance] < min_postage_balance && options[:control_total] < max_control_total\n Rails.logger.info(\"STAMPS: Postage below #{min_postage_balance}, attempting to purchase #{postage_purchase_amount} in postage\")\n begin \n response = Stamps.purchase_postage(:amount => postage_purchase_amount,\n :control_total => options[:control_total])\n if response[:purchase_status] == \"Rejected\"\n Rails.logger.info(\"STAMPS: Postage purchase FAILED!, Rejection reason: #{response[:rejection_reason]}\")\n else\n Rails.logger.info(\"STAMPS: Postage purchase SUCCESS!\") \n Rails.cache.write \"stamps_last_purchased_postage_at\", Time.zone.now rescue nil\n Rails.cache.write \"stamps_current_balance\", response[:postage_balance][:available_postage] rescue nil\n end \n rescue Exception => message\n Rails.logger.info(\"STAMPS PURCHASE POSTAGE ERROR MESSAGE: #{message}\")\n end \n else\n Rails.logger.info(\"STAMPS: Checking Postage Balance: #{options[:current_balance]}\") \n end\n else\n Rails.logger.info(\"STAMPS: We don't buy postage in test mode\") \n end\n end",
"def buy\n outcome_id = params[:outcome_id]\n outcome = Outcome.find(outcome_id)\n\n if outcome.market.is_closed\n flash[:error] = \"Market is closed\"\n return redirect_to outcome.market \n end\n \n current_position = outcome.position_for_user(current_user)\n\n share_count = (params.include? :buy_share_count) ? params[:buy_share_count].to_i : 10\n\n if share_count < 0\n flash[:error] = \"Invalid share count\"\n return redirect_to outcome.market \n end\n\n total_shares = share_count\n if outcome.shares_available < share_count\n flash[:error] = \"There are not enough shares available\"\n return redirect_to outcome.market \n end\n\n if ! current_position.nil?\n total_shares += current_position.total_user_shares\n end\n \n current_price = outcome.buy_price(share_count)\n \n position = Position.new(\n :outcome => outcome, \n :user => current_user, \n :delta_user_shares => share_count,\n :delta_user_account_value=> -1 * share_count * current_price,\n :total_user_shares => total_shares,\n :direction => :buy,\n :outcome_price => current_price\n )\n \n if position.save\n logger.info \"Created position: \" + position.to_s\n current_user.cash = current_user.cash + position.delta_user_account_value\n current_user.save\n flash[:message] = \"Buy successful -- %.2f shares @ $%.2f cost %.2f\" % \n [position.delta_user_shares, position.outcome_price, -1 * position.delta_user_account_value]\n\n outcome.market.had_sale(position)\n outcome.market.save\n \n clear_caches(outcome)\n redirect_to outcome.market\n else\n flash[:error] = position.errors\n \n redirect_to outcome.market\n end\n \n end",
"def may_purchase?(_company)\n false\n end",
"def can_buy_drug?(price, qty)\n wallet > (price * qty) \n end",
"def trade action\n if action == :buy\n buy_btc(@options[:volume])\n else\n sell_btc(@options[:volume])\n end\n end",
"def after_redeem() end",
"def checkout_needed?\n\t\ttrue\n\tend",
"def negotiate_best_deal?\n nil\n end",
"def update \n \t@error = false\n \tcurrent_user\n if params[:buy_weed] && @user.cash >= (p_cash('weed')) \n \tweed_buy\n \tcash_buy('weed')\n elsif params[:sell_weed] && @user.weed >= weed_amount\n \tweed_sell\n \tcash_sell('weed')\n elsif params[:buy_shrooms] && @user.cash >= (p_cash('shrooms'))\n\t\tshrooms_buy\n \tcash_buy('shrooms')\n elsif params[:sell_shrooms] && @user.shrooms >= shroom_amount\n\t\tshrooms_sell\n\t\tcash_sell('shrooms')\n elsif params[:buy_molly] && @user.cash >= (p_cash('molly'))\n \t\tmolly_buy\n \tcash_buy('molly')\n elsif params[:sell_molly] && @user.molly >= molly_amount\n\t\tmolly_sell\n \tcash_sell('molly')\n elsif params[:buy_cocaine] && @user.cash >= (p_cash('cocaine'))\n \tcocaine_buy\n \tcash_buy('cocaine')\n elsif params[:sell_cocaine] && @user.cocaine >= cocaine_amount\n \tcocaine_sell\n \tcash_sell('cocaine')\n elsif params[:buy_meth] && @user.cash >= (p_cash('meth'))\n \tmeth_buy\n \tcash_buy('meth')\n elsif params[:sell_meth] && @user.meth >= meth_amount\n\t\tmeth_sell\n\t\tcash_sell('meth')\n elsif params['buy_oxy'] && @user.cash >= (@user.oxy_price * oxy_amount)\n \toxy_buy\n \tcash_buy('oxy')\n elsif params['sell_oxy'] && @user.oxy >= oxy_amount\n \toxy_sell\n \tcash_sell('oxy')\n else\t\n @error= true #\tflash.now[:error] = 'You do not have enough Cash or Drugs to make that transaction.'\n end\n \n \n \n\n\t\n\n\n\n\n\n\n\n if @user.switch == 'albany' #this redirects the page back to troy once a drug has been purchased\n \t flashin\n\t\t \tredirect_to :back\n \n \telsif @user.switch == 'troy'\n \t flashin\n \t\tredirect_to :back \n\t\t\n\t\telsif @user.switch == 'schen'\n \t flashin\n \t\tredirect_to :back\n \telsif @user.switch == 'cp'\n \t flashin\n \t\tredirect_to :back\t\n\t\t\n\t\telse\n\t\t \n\t\t redirect_to @user\n\t\t \n \tend\n end",
"def buy_sell(stock)\n\t\tif @trader.portfolio.empty? then\n\t\t\tputs \"Your portfolio is empty, you can only buy stock.\"\n\t\t\tbuy_or_sell = true\n\t\telse\t\n\t\t\tputs \"Do you wish to buy or sell #{stock.stock_name}? (B / S)\"\n\t\t\tbuy_or_sell = $stdin.gets.chomp.upcase\n\t\t\tbuy_or_sell = check_input(buy_or_sell, \"B\", \"S\")\n\t\tend \n\t\t\t\t\t\n\t\tif buy_or_sell == true\n\t\t\tbuy_trade(stock)\n\t\telse\n\t\t\tsell_trade(stock)\n\t\tend\t\t\t\n\tend",
"def buy(store)\n\t\tprint \"Enter the item you want to purchase or press <enter> to go back: \"\n\t\titem = gets.chomp.downcase\n\t\titem = store.check_inventory(item) # check store inventory\n\t\tif item != \"\"\n\t\t\tquantity = store.check_quantity(item) # check if item has stock\n\t\t\tif quantity != 0\n\t\t\t\tif @wallet_amt > store.get_price(item) # Check if the user has enough money\n\t\t\t\t\tputs \"You paid $%.2f for a #{item}\" % store.get_price(item)\n\t\t\t\t\t@wallet_amt -= store.get_price(item) # reduce wallet_amt by item price\n\t\t\t\t\t@cart << item # add item to the cart\n\t\t\t\t\tstore.increment(item,\"buy\") #increment the inventory\n\t\t\t\telse\n\t\t\t\t\tputs \"You do not have enough money to purchase a #{item}.\"\n\t\t\t\tend\t\n\t\t\tend\n\t\tend\n\tend",
"def can_submit?\n # First check the state machine to see if it is Ok to submit based on the\n # current state\n b = super()\n if b\n # Now check that the CP has funding\n b = false unless total_cost > 0\n #b = false unless funding_difference <= 0\n end\n b\n end",
"def to_be_done()\r\n\t\t#\r\n\t\t# loss_trig_price = price - loss\r\n\t\t# loss_price = price - loss - 10\r\n\t\t# obuy \t = push_buy( \t\t quantity: quantity, price: price )\r\n\t\t# monitor_filled( obuy )\r\n\t\t# obuy_stp = push_buy_stop( quantity: quantity, loss_trig_price: loss_trig_price, loss_price: loss_price )\r\n\t\t#\r\n\t\t#\r\n\t\t# loss_trig_price = price + loss\r\n\t\t# loss_price = price + loss + 10\r\n\t\t# osell = push_sell( \t\t quantity: quantity, price: price)\r\n\t\t# monitor_filled( osell )\r\n\t\t# osell_stp = push_sell_stop( quantity: quantity, loss_trig_price: loss_trig_price, loss_price: loss_price)\r\n\t\t#\r\n\r\n\r\n\t\t# modo mais simples primeiro\r\n\t\t# entrar a market\r\n\t\tloss_trig_price = price - loss\r\n\t\tloss_price = price - loss - 10\r\n\t\tobuy \t = push_buy( \t\t quantity: quantity, price: 0 )\r\n\t\tmonitor_filled( obuy )\r\n\t\tobuy_stp = push_buy_stop( quantity: quantity, loss_trig_price: loss_trig_price, loss_price: loss_price )\r\n\r\n\r\n\t\tloss_trig_price = price + loss\r\n\t\tloss_price = price + loss + 10\r\n\t\tosell = push_sell( \t\t quantity: quantity, price: 0)\r\n\t\tmonitor_filled( osell )\r\n\t\tosell_stp = push_sell_stop( quantity: quantity, loss_trig_price: loss_trig_price, loss_price: loss_price)\r\n\tend",
"def pre_pay_offered\n end",
"def analysis\n return 0 if @previous_buy_price == 0 # next for the first time\n\n @ico_bot.reload\n\n if @ico_bot.trading_type == \"BUYING\"\n check_set_order_for_buy()\n elsif @ico_bot.trading_type == \"FORCE_BUY\"\n check_set_force_order_for_buy()\n elsif @ico_bot.trading_type == \"CHECKING_ORDER_BUY\"\n check_finish_order_buy()\n elsif @ico_bot.trading_type == \"CANCEL_BUY\"\n cancel_order_buy()\n elsif @ico_bot.trading_type == \"SELLING\"\n check_set_order_sell()\n elsif @ico_bot.trading_type == \"CHECKING_ORDER_SELL\"\n check_finish_order_sell()\n elsif @ico_bot.trading_type == \"CANCEL_SELL\"\n cancel_order_sell()\n elsif @ico_bot.trading_type == \"LOSE_ORDER\"\n check_finish_lose_order()\n end\n end",
"def buy_item(item)\r\n if !item.active || item.price > self.credits\r\n false\r\n else\r\n seller = item.owner\r\n price = item.price\r\n\r\n seller.give_credits(price)\r\n self.take_credits(price)\r\n seller.remove_item(item)\r\n self.add_item(item)\r\n item.active = false\r\n true\r\n end\r\n end",
"def place_order\n \n @job = Job.find(params[:job_id])\n fetch_decrypted(@job)\n \n if @logged_user.credits > 0\n render(:action => \"confirm_order\")\n return\n else\n #place order will have our paypal buttons\n render(:action => \"place_order\")\n return\n end\n \n rescue ActiveRecord::RecordNotFound\n flash[:alert] = \"Buying credits for fun?\"\n redirect_to :action => \"profile\"\n end",
"def buy_item\n merchant = Merchant.find(params[:merchant_id])\n item = merchant.determine_item(params.keys.second, params.values.second )\n \n # potions run differently since a user can have multiple of the item, so it checks if it is a potion\n if Merchant.is_potion?(item)\n response = merchant.buy_potion(item, merchant.get_character_from_game)\n flash[:notice] = response\n redirect_to user_character_path(current_user, merchant.get_character_from_game) \n \n # if not it runs the normal buy method \n else \n response = merchant.buy_item(item, merchant.get_character_from_game)\n flash[:notice] = response\n redirect_to user_character_path(current_user, merchant.get_character_from_game) \n end\n end",
"def has_editorial_or_stock_for_sale\n return false if self.requests.length == 0\n self.requests.each do |r|\n return false if r.state == \"denied\"\n end\n true\n end",
"def check_for_buyout\n if self.is_bought_out\n if self.bought_out_by_team_id\n self.subcontracts.future_years.each do |sub|\n sub.salary_amount *= 0.6\n sub.this_is_a_buyout = true\n sub.save!\n\n # update GM's annual actions to not allow more buyouts\n actions = AnnualGmAction.find_by_team_id_and_year(self.bought_out_by_team_id, current_year)\n actions.has_bought_out = true\n actions.bought_out_player_id = self.player.id\n actions.save!\n end\n end\n end\n end",
"def newtrade\n # @this = \"this\"\n # @this = Trade.find(2)\n\n#\n # name = \"Apple Inc. - Common Stock\"\n # tick = \"AAPL\"\n # vol = 90\n # price = 243.42\n # total = 22320\n # type = \"Sell\"\n name = params[:name]\n tick = params[:tick]\n vol = params[:vol].to_i\n price = params[:price].to_f\n total = params[:total].to_f\n type = params[:type]\n tc = \"Trade Complete\"\n if type == \"Buy\" # IF ONE START 11111111111111\n\n @currentuser = current_user\n w = @currentuser.wallet\n if Trade.where(ticker: params[:tick]).exists?\n if w > total\n @trade = Trade.where(ticker: params[:tick]).first\n @trade.volume += vol\n @trade.save\n @currentuser.wallet -= total\n @currentuser.save\n @text = tc\n elsif w < total\n @text = \"You do not have enough units to make this trade.\"\n end\n else #graduate to using first_or_create\n @trade = @currentuser.trades.create(stock: name,\n ticker: tick,\n tradeprice: total,\n volume: vol,\n stockprice: price)\n @currentuser.wallet -= total\n @currentuser.save\n @text = tc\n end\n else # ELSE ONE START 11111111111111\n @currentuser = current_user\n w = @currentuser.wallet\n if Trade.where(ticker: params[:tick]).exists? # IF TWO START 222222222222\n if Trade.where(ticker: params[:tick]).first.volume >= vol\n @trade = Trade.where(ticker: params[:tick]).first\n @trade.volume -= vol\n @trade.save\n @currentuser.wallet += total\n @currentuser.save\n @text = tc\n else\n @text = \"You do not have enough shares to make this trade.\"\n end\n else # ElSE TWO START 222222222222\n @text = \"Could not complete trade. You do not have enough shares in this company.\"\n end # IF TWO END 222222222222\n end # IF ONE END 11111111111111\n\n\n end",
"def handle_bestbuy\n sku_number = find_bestbuy_id(self.url)\n\n if sku_number\n # gets rid of .p\n sku_number = sku_number[0..-3]\n begin\n bestbuy_json = JSON.parse(open(\"http://api.remix.bestbuy.com/v1/products(sku=#{sku_number})?apiKey=#{BEST_BUY_API_KEY}&format=json\").read)\n if bestbuy_json[\"total\"] == 0\n errors.add(:base, \"Best Buy URL Invalid. Please try again.\")\n else\n self.thumbnail = bestbuy_json[\"products\"][0][\"largeImage\"] || bestbuy_json[\"products\"][0][\"image\"] \n self.name = self.name || bestbuy_json[\"products\"][0][\"name\"]\n # TODO should get rid of this in favor of decimal column\n self.current_price = Integer(bestbuy_json[\"products\"][0][\"salePrice\"].to_s.sub(\".\", \"\")) || Integer(bestbuy_json[\"products\"][0][\"regularPrice\"].to_s.sub(\".\", \"\"))\n end\n rescue => e\n # for debugging\n logger.error e.message\n e.backtrace.each { |line| logger.error line }\n errors.add(:base, \"Best Buy URL Invalid. Please try again.\")\n end\n else\n errors.add(:base, \"Best Buy URL Invalid. Please try again.\")\n end\n end",
"def can_buy?(item)\r\n item.buyable_by?(self)\r\n end",
"def can_rent_truck?\n !license.expired? && age >= 60 && license.to_drive_truck?\n end",
"def trade; end",
"def buy_item(user, item)\r\n if(self.has_enough_money(item) and user.has_item(item))\r\n self.get_item(user, item)\r\n self.pay_amount(user, item.get_price)\r\n else\r\n #transaction not possible\r\n end\r\n end",
"def purchasing?\n auction.buy_it_now_price == amount\n end",
"def trust_buy_price\n setting_price = get_setting_price('TradeBid')\n if setting_price.activate_price\n setting_price.price\n else\n Rails.cache.read(\"kraken-price-#{currency}#{payment_type}\")[:buy_order_price]\n end\n end",
"def hit_ebay\n self.gimmie_the_goods(self.ebay_grab)\n end",
"def trade(ticker, day)\n # this day's price\n price = @account.broker.exchange.quote(ticker, day)\n\n# if @last_purchase.key? ticker # If we've purchased this stock before, we continue with Dr. Rushton's trading rule.\n if @account.portfolio[ticker] == 0 # try to buy the given ticker\n last_hold_time = if @last_purchase[ticker][:buy_day] && @last_purchase[ticker][:sell_day]\n @last_purchase[ticker][:buy_day] - @last_purchase[ticker][:sell_day]\n else\n 0\n end\n \n # Wait for a time interval equal to gamma * HT to pass (cool-down period) OR Price < P to buy more\n if(!@last_purchase.key?(ticker) || \n price < @last_purchase[ticker][:price] || \n @last_purchase[ticker][:sell_day] - day >= @gamma * last_hold_time)\n s = @account.buy_amap(ticker, day, @amount_per_company)\n @last_purchase[ticker] = {price: price, buy_day: day}\n puts \"bought #{s} shares of #{ticker} on #{@account.broker.exchange.eod(ticker, day).date}\" if $DEBUG\n end\n else # try to sell our holdings of the given ticker\n # compute t, the return multiplier, given the interval between now and last purchase of the given stock (ticker)\n t = @fn_t.call(@last_purchase[ticker][:buy_day] - day)\n\n # compute alpha, given the value t, to determine the percentage gain multiplier\n alpha = @fn_alpha.call(t)\n\n puts \"t = #{t}\", \"alpha = #{alpha}\" if $DEBUG\n\n puts \"price of #{ticker} on #{@account.broker.exchange.eod(ticker, day).date} is #{price}\" if $DEBUG\n\n if(price > (1.0 + alpha) * @last_purchase[ticker][:price])\n s = @account.sell_all(ticker, day)\n @last_purchase[ticker][:sell_day] = day\n puts \"sold #{s} shares of #{ticker} on #{@account.broker.exchange.eod(ticker, day).date}\" if $DEBUG\n end\n end\n# else # We use SMA to make our initial purchase of each stock\n# # compute average over number of days\n# avg = average_price(ticker, day)\n\n # if price > avg -> price - avg = positive\n # price < avg -> price - avg = negative\n # price = avg -> price - avg = 0\n# @price_relation_to_average[\"#{ticker}#{day}\"] = price - avg\n\n # decide whether the price has just upcrossed or downcrossed the MA line\n# if(price > avg && @price_relation_to_average[\"#{ticker}#{day + 1}\"] < 0) # upcross - BUY as much as possible\n# s = @account.buy_amap(ticker, day, @amount_per_company)\n# @last_purchase[ticker] = {price: price, buy_day: day}\n# puts \"bought #{s} shares of #{ticker} on #{@account.broker.exchange.eod(ticker, day).date}\" if $DEBUG\n# end\n# end\n \n puts \"account: #{@account.to_s(day)}\" if $DEBUG\n end",
"def check_buyable\n raise PermissionDeniedError, \"出品したアイテムはサポートできません\" if @item.owner?(current_user)\n end",
"def feasible?\n return true if amount < 0 || source.nil? || !product.tracked_stock? || source.enable_gateway?\n inventory_item = source_item\n inventory_item.present? && inventory_item.available >= amount\n end",
"def buy_bot(percent_increase = 0.05, chunk = 0.006, prepump_buffer = 0.5)\n market_name = @market_name\n low_24_hr, last_price, ask_price, volume = get_market_summary(market_name)\n total_spent = 0.0\n p [low_24_hr, last_price, ask_price, volume]\n if volume < 100 and last_price < (1.0 + prepump_buffer) * low_24_hr #last_price is smaller than 50% increase since yerterday\n puts \"Coin is not prepumped\".blue\n order = buy_chunk(last_price, market_name, percent_increase, chunk)\n p [order, \"Units Bought : #{@units_bought}\"]\n end\nend",
"def action(**args)\n\t\t\targs[:player].decide(:consider_purchase, property: self) if args[:player].balance >= cost unless @owner\n\t\t\tsuper\n\t\tend",
"def buyEvent\n client.arecord_user_action_on_item('buy', getUser, getCart) \n end",
"def purchased?\n state == \"purchased\" or stolen == true\n end",
"def can_request_purchase?\n true # TODO: Should this be !virginia_borrower? ?\n end",
"def can_buy?(item)\n item.buyable_by?(self)\n end",
"def require_one_click_payment?(source, shopper)\n false\n end",
"def execute_on_basis_of_selected_option\n case @selected_option\n when 1\n book_tickets\n when 2\n print_total_revenue_of_sales \n give_next_options_to_continue\n end\n end",
"def to_be_performed?\n self.research_billing_qty > 0\n end",
"def shares_available_for_purchase?\n if Stock.all.find_by(id: trade.stock_id).shares_available < trade.num_shares\n return false\n else\n return true\n end\n end",
"def pending_shop_request?\n !launched_shop? && latest_pending_shop_request\n end",
"def buy\n shipment = Shipment.find(params[:shipment_id])\n shipment.update_column(:affiliate_shipping_account, params[:affiliate_shipping_account] == \"true\")\n EasyPost.api_key = shipment.easy_post_api_key\n\n begin\n ep_shipment = EasyPost::Shipment.retrieve(params[:ep_shipment_id])\n easypost_purchase(shipment, params[:rate_id], ep_shipment)\n ShipmentItem.where(shipment_id: shipment.id, special_status: \"\").update_all(special_status: :shipped)\n rescue => e\n flash[:error] = e.message + params[:ep_shipment_id]\n return redirect_back(fallback_location: admin_root_path)\n end\n\n redirect_to admin_store_shipment_path(shipment)\n end",
"def agreed_to_contract?\n if current_user.class.to_s.eql? \"AssetUser\"\n stage = Stage.find(params[:id])\n stage_user = StageUser.find(:first, :conditions => [\"stage_id = ? AND asset_user_id = ?\", stage.id, current_user.id])\n if stage_user.has_agreed_to_contract == false\n if stage.contract\n redirect_to contract_asset_manager_stage_path(stage)\n end\n end\n end\n end",
"def buy_in_loop\n @entry_time = Time.now\n set_amount_and_check_balance\n loop do\n log_time_and_price\n set_and_log_indicator_ivars\n\n if lagging_indicators_green && leading_indicators_green\n set_buy_in\n break\n else\n @dc.prepend 'position_logs', \"NOT BUYING IN YET ------------------------------------ <br /><br />\"\n set_sleep_time #varies depending on state of indicators.\n end\n end\n manage_position_loop\n end",
"def execute(bid, ask)\n #don't prefer buyer or seller\n sale_price = (bid.price + ask.price)/2\n if @instrument == \"Option\"\n #if selling, either have position, or margin requirements, else delete\n if valid_option_ask!(ask) && valid_option_bid!(bid)\n #which one is more\n if bid.amount > ask.amount\n ActiveRecord::Base.transaction do\n bid.user.create_or_update_position(ask.amount, @instrument, @instrument_id, \"bid\")\n bid.user.portfolio.decrement!(:funds,sale_price*ask.amount)\n ask.user.remove_from_position(ask.amount, @instrument, @instrument_id, \"ask\")\n ask.user.portfolio.increment!(:funds,sale_price*ask.amount)\n bid.decrement!(:amount, ask.amount)\n ask.destroy\n end\n else\n ActiveRecord::Base.transaction do\n bid.user.create_or_update_position(bid.amount, @instrument, @instrument_id, \"bid\")\n bid.user.portfolio.decrement!(:funds,sale_price*ask.amount)\n ask.user.remove_from_position(bid.amount, @instrument, @instrument_id, \"ask\")\n ask.user.portfolio.increment!(:funds,sale_price*ask.amount)\n ask.decrement!(:amount, bid.amount)\n bid.destroy\n end\n #TODO: what if they are equal?\n end\n end\n elsif @instrument == \"Currency\"\n if can_buy_usd!(bid) && can_sell_usd!(ask)\n if bid.amount > ask.amount\n ActiveRecord::Base.transaction do\n bid.user.create_or_update_position(ask.amount, @instrument, @instrument_id)\n bid.user.portfolio.decrement!(:funds,sale_price*ask.amount)\n ask.user.remove_from_position(bid.amount, @instrument, @instrument_id)\n ask.user.portfolio.increment!(:funds,sale_price*ask.amount)\n bid.decrement!(:amount, ask.amount)\n ask.destroy\n end\n else\n ActiveRecord::Base.transaction do\n bid.user.create_or_update_position(bid.amount, @instrument, @instrument_id)\n bid.user.portfolio.decrement!(:funds,sale_price*ask.amount)\n ask.user.remove_from_position(bid.amount, @instrument, @instrument_id)\n ask.user.portfolio.increment!(:funds,sale_price*ask.amount)\n ask.decrement!(:amount, bid.amount)\n bid.destroy\n end\n end\n end\n end\n end",
"def buy(ticker, position, price)\n if @account_balance < position * price \n puts \"Cannot buy #{position}@#{price} of #{ticker} as we only have #{@account_balance} available\".red \n return\n end\n puts \"Buying #{position}@#{price} of #{ticker}\".green\n @account_balance -= position * price \n @positions[ticker] = 0 if @positions[ticker].nil?\n @positions[ticker] += position\n end",
"def premium?\n \t! free?\n end",
"def in_stock?\n true\n end",
"def can_be_bought_for_solr\n result = \"no\"\n result = \"yes\" if available_for_sale == true\n result\n end",
"def enable?(item)\n item && item.price > 0\n end",
"def test_can_buy_org_item\n user = User.named(\"user\")\n org = Organization.named(\"org\")\n\n item = org.propose_item(\"Item\", 20, :fixed, nil, nil)\n item.activate\n\n assert(user.can_buy?(item))\n\n user.work_on_behalf_of(org)\n assert(!user.on_behalf_of.can_buy?(item))\n end",
"def trade_item_with_party(new_item, old_item)\n return false if new_item && !$game_party.has_item?(new_item)\n $game_party.force_gain_item(old_item, 1)\n $game_party.force_gain_item(new_item, -1)\n return true\n end",
"def submit_purchased!\n return false if was_submitted?\n\n wizard_steps[:checkout] = Time.zone.now\n submit!\n end",
"def can_make_reserves?\n !undergraduate? && !virginia_borrower?\n end",
"def checker\n role = spree_current_user.spree_roles.all.first\n if !role.nil? && role.name == 'merchant'\n redirect_to('/tasks')\n end\n end",
"def takeoff\n if @engine_on == false\n return \"airplane not started, please start\"\n elsif @engine_on == true && @flying == false\n @flying = true\n @fuel -= 15\n return \"airplane launched\"\n else\n return \"airplane already flying\"\n end\n end",
"def from_market?(_program)\n true\n end",
"def buy_new_item(item_to_buy, quantity, account)\n return false if item_to_buy.auction\n preowner = item_to_buy.owner\n\n if (Integer(item_to_buy.price*quantity) > self.credits and item_to_buy.currency == \"credits\") or Integer(item_to_buy.quantity)<quantity\n Activity.log(account, \"item_bought_failure\", item_to_buy, self)\n Activity.log(account, \"item_sold_failure\", item_to_buy, preowner)\n return false\n end\n\n\n if !item_to_buy.wishlist_users.empty? and item_to_buy.quantity == quantity and !item_to_buy.permanent\n item_to_buy.wishlist_users.each {|trader| trader.remove_from_wishlist(item_to_buy); item_to_buy.wishlist_users.delete(trader)}\n end\n\n Holding.ship_item(item_to_buy, item_to_buy.owner, self, quantity)\n Activity.log(account, \"item_bought_success\", item_to_buy, self)\n Activity.log(account, \"item_sold_success\", item_to_buy, preowner)\n Mailer.item_sold(preowner.e_mail, \"Hi #{preowner.name}, \\n #{self.name} bought your Item #{item_to_buy.name}.\n Please Contact him for completing the trade. His E-Mail is: #{self.e_mail}\")\n\n return true\n end",
"def checkCCN\n if !session[:paid]\n redirect_to bikes_path\n end\n end",
"def enable?(item)\n CookingManager.quantity(item) > 0\n end",
"def go_home\n return unless can_go_home? && wants_to_go_home?\n pack_bags\n get_tickets\n board_plane\nend",
"def redeemable?\n [AVAILABLE, EXPIRED].include?(status) and started? and delay_passed?\n end",
"def try_booking_regular(recommendation_url, page_booking_url)\n find('button.order_form__button_role-submit').click\n expect(page).to have_selector('.modal_dialog__preloader')\n continue_booking\n return_from_payment_gateway\n end",
"def should_i_buy?(item)\n !!list[item.to_sym]\n end",
"def on_sale?\n sale == true\n end",
"def buy_item(item_to_buy, user)\r\n fail \"only users can buy items in behalve of an organisation\" if (user.organisation)\r\n fail \"only users that are part of #{self.name} can buy items for it\" unless (is_member?(user))\r\n fail \"would exceed #{user.email}'s organisation limit for today\" unless within_limit_of?(item_to_buy, user)\r\n fail \"not enough credits\" if item_to_buy.price > self.credits\r\n fail \"Item not in System\" unless (DAOItem.instance.item_exists?(item_to_buy.id))\r\n\r\n old_owner = item_to_buy.owner\r\n\r\n #Subtracts price from buyer\r\n self.credits = self.credits - item_to_buy.price\r\n #Adds price to owner\r\n old_owner.credits += item_to_buy.price\r\n #decreases the limit of the buyer\r\n @member_limits[user.email].spend(item_to_buy.price) unless self.limit.nil? || is_admin?(user)\r\n\r\n item_to_buy.bought_by(self)\r\n end",
"def stop_price_tests\n shop.stop_price_tests! if shop.latest_access_token.nil? \n end",
"def paid_shop?\n @shop ||= Shop.find(params[:id])\n redirect_to billing_index_path unless @shop.paid\n end",
"def sell_pending\n end",
"def buy_requested_item(request, item)\r\n self.overlay.delete_item_request(request.id)\r\n item.price = request.price #The prize given in the request is relevant.\r\n buy(item, true)\r\n end",
"def need_to_go_out?\n\t\tif @poos_how_often == \"regularly\"\n\t\t\tfalse\n\t\telse\n\t\t\ttrue\n\t\tend\n\tend",
"def oldPlaceSellOrder(epic:,size:,price:,params: {} )\n\n limit_sell_map = {\n :\"epic\" => epic,\n :\"expiry\" => \"DFB\",\n :\"direction\" => \"SELL\",\n :\"size\" => size,\n :\"level\" => price,\n :\"type\" => \"LIMIT\",\n :\"currencyCode\" => \"GBP\",\n :\"timeInForce\" => \"GOOD_TILL_CANCELLED\",\n :\"guaranteedStop\" => \"false\"\n }.merge(params)\n\n response = RestClient.post(\"#{@host}/gateway/deal/workingorders/otc\",\n limit_sell_map.to_json, @headers ) \n\n if response.code == 200\n orderresp = JSON.parse(response.body)\n dealref = orderresp[\"dealReference\"]\n { :success => true, :dealref => dealref }\n else\n { :success => false }\n end\n\n rescue => e\n puts \"placeSellOrder ERROR: #{e}\"\n { :success => false }\n\n end",
"def index\n if buyer_signed_in? || seller_signed_in?\n redirect_to '/offers'\n end\n end"
] |
[
"0.66395116",
"0.62103873",
"0.6175484",
"0.6103558",
"0.60685664",
"0.5970868",
"0.59352213",
"0.5907364",
"0.5746278",
"0.5742828",
"0.57376546",
"0.5701373",
"0.5683558",
"0.56708395",
"0.56154895",
"0.5614428",
"0.5596291",
"0.55884534",
"0.55882615",
"0.5585243",
"0.558337",
"0.5552897",
"0.5521185",
"0.5507095",
"0.5498353",
"0.5497723",
"0.5477762",
"0.546839",
"0.5467192",
"0.5466036",
"0.54607594",
"0.5453825",
"0.5450016",
"0.5444483",
"0.54165095",
"0.5414323",
"0.5406697",
"0.5403108",
"0.54017353",
"0.5400294",
"0.5383045",
"0.53727376",
"0.5370186",
"0.53677046",
"0.53671014",
"0.5366508",
"0.53650033",
"0.5346898",
"0.53442824",
"0.5343424",
"0.533822",
"0.53379047",
"0.53332394",
"0.5328072",
"0.5320904",
"0.5304247",
"0.5293339",
"0.52927125",
"0.5291392",
"0.52882415",
"0.52874166",
"0.52862597",
"0.5284612",
"0.5281095",
"0.52722645",
"0.5267111",
"0.5265387",
"0.5262506",
"0.5258927",
"0.52582574",
"0.5254754",
"0.5247162",
"0.5244723",
"0.52444416",
"0.523771",
"0.5235097",
"0.5230054",
"0.5227726",
"0.5224894",
"0.5224846",
"0.5216839",
"0.520608",
"0.5203653",
"0.52012765",
"0.52007884",
"0.52004325",
"0.51908123",
"0.51883924",
"0.5178669",
"0.51761407",
"0.5174381",
"0.5172468",
"0.517114",
"0.51672983",
"0.5162366",
"0.5162306",
"0.51616585",
"0.51583505",
"0.5151475",
"0.51511586"
] |
0.5610845
|
16
|
So I don't have to create a new IssueShares view...
|
def must_buy_train?(entity)
must_buy_power?(entity)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @shares = Share.all\n end",
"def index\n @shares = Share.all\n end",
"def index\n @artwork_shares = ArtworkShare.all\n end",
"def index \n @shares = Share.all if admin?\n end",
"def create\n @share = Share.new(share_params)\n @project = Project.where(:key => params[:project_key]).first\n user = User.where(:email => @share.email).first\n existing_share = Share.where(:user_id => ((user) ? user.id : nil), :email => @share.email, :project_id => @project.id).first\n \n if @share.email and params[:project_key] and !existing_share\n \n @share.project_id = @project.id\n @share.user_id = user.id if user\n \n if @project and @share.save\n @shares = @project.shares.to_a\n UserMailer.invitation_mail(current_user, @share).deliver\n end\n end\n @shares = @project.shares.to_a if !@shares\n\n respond_to do |format|\n format.html { render :partial => 'projects/shares' }\n format.json { render :show, status: :created, location: @share }\n #else\n # format.html { render :partial => 'projects/shares' }\n # format.json { render json: @share.errors, status: :unprocessable_entity }\n # end\n end\n \n # end\n end",
"def index\n @share_operations = ShareOperation.all\n end",
"def index\n @post_shares = PostShare.all\n end",
"def index\n @shares = Share.all\n @user= User.all\n \n end",
"def set_share\n # @share = Share.find(params[:id])\n end",
"def national_issue_shares!\n return unless national.total_shares == 10\n\n @log << \"#{national.name} issues 10 more shares and all shares are now 5% shares\"\n national.shares_by_corporation[national].each_with_index do |share, index|\n # Presidents cert is a 10% 2-share 1-cert paper, everything else is a 5% 1-share 0.5-cert paper\n share.percent = index.zero? ? 10 : 5\n share.cert_size = index.zero? ? 1 : 0.5\n end\n\n num_shares = national.total_shares\n 10.times do |i|\n new_share = Share.new(national, percent: 5, index: num_shares + i, cert_size: 0.5)\n national.shares_by_corporation[national] << new_share\n end\n end",
"def index\n @issue_histories = IssueHistory.all\n end",
"def index\n if current_user.try(:admin)\n @shared_with_me = Share.all\n else\n @shared_with_me = current_user.shares\n end\n @shared_by_me = Share.shared_by(current_user)\n end",
"def index\n @git_hub_issues = GitHubIssue.all\n end",
"def index\n @issue_masters = IssueMaster.all\n end",
"def index\n @issues = Issue.all\n end",
"def index\n @issues = Issue.all\n end",
"def index\n @issues = Issue.all\n end",
"def index\n @issues = Issue.all\n end",
"def index\n @issues = Issue.all\n end",
"def index\n @fileshares = Fileshare.all\n end",
"def create\n \t@current_user_id = 1 # TODO: fix me\n\n\t# remove any existing entries\n\tTaskShare.destroy_all( :task_id => params[:task_share][:task_id], :user_id => @current_user_id )\n\t\n @task_share = TaskShare.new(\n \tparams[:task_share].merge({\n \t\t:user_id => @current_user_id\n\t\t})\n )\n\t@task = Task.find(@task_share.task_id)\n\t@project = Project.find(@task.project_id)\n\n respond_to do |format|\n if @task_share.save\n flash[:notice] = 'You successfully offered ' + params[:task_share][:num_shares].to_s + ' of your shares for this task.';\n format.html { redirect_to([@project, @task]) }\n format.xml { render :xml => @task_share, :status => :created, :location => @task_share }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @task_share.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n #@shares = Share.all\n @stores = Store.find_my_stores(session[:user_id])\n @sharedStores = Store.find_my_share_stores(session[:user_id])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shares }\n end\n end",
"def show\n @issues = Issue.where(tenant: @tenant)\n end",
"def index\n @accounting = Accounting.find(params[:accounting_id])\n @shares = @accounting.shares\n end",
"def index\n @shareportfolios = Shareportfolio.all\n end",
"def index\n @share_tasks = @list.share_tasks\n end",
"def index\n if user_signed_in?\n @user = User.find(current_user.id)\n end\n @workshares = Workshare.all\n end",
"def index\n @share_types = ShareType.all\n @reference = \"ShareType\"\n end",
"def index\n @issues = current_user.issues\n end",
"def index\n @share_users = ShareUser.all\n end",
"def show\n @property = Property.find(params[:id])\n @sell_requests = @property.share_sell_requests.where.not(user_id: current_user)\n @share_sell_requests = @sell_requests.where(\"validity_days >=?\", Date.today)\n # @shares = @property.shares\n if current_user.superadmin_role? && current_user.supervisor_role?\n @shares = @property.shares\n\n else\n @shares = @property.shares.where(\"user_id =?\", current_user)\n\n end\n\n end",
"def index\n @anyshares = Anyshare.all\n\t@anyshare_count = Anyshare.count\n end",
"def set_share\n @share = user_shares.find_by(params.permit(:id))\n authorize @share\n end",
"def set_share\n begin\n @share = Share.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n render text: { status: 404, error: t('api.m404') }.to_json, :status => 404\n end\n end",
"def index\n @issues = @account.issues.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @issues }\n end\n end",
"def index\n if params[:post_id].present?\n @post_shareables = PostShareable.where(post: Post.find(params[:post_id])).all\n else\n @post_shareables = PostShareable.all\n end\n end",
"def index\n @issues = Issue.where({assignee: current_user.github_username})\n\n render json: @issues\n end",
"def index\n @sort_column = sort_column\n @requests = apply_scopes(Request).all\n\n if current_user.try(:admin?) || current_user.approver? || current_user.worker?\n # show all requests\n @requests = @requests.order(sort_column + \" \" + sort_direction)\n else\n # show only requests for this user\n @requests = @requests.where(\"email = ?\", current_user.email).order(sort_column + \" \" + sort_direction)\n end\n # pagination\n @requests = @requests.paginate(:page => params[:page], :per_page => 10)\n\n @issues = Issue.all\n end",
"def index\n @facebook_shares = FacebookShare.all\n end",
"def create\n @share = Share.new(params[:share])\n\n if @share.service_order.user != current_user\n redirect_to :back, flash: { error: \"You can only manage sharing for your own service orders.\" }\n return\n end\n\n respond_to do |format|\n if @share.save\n format.html { redirect_to @share.service_order, notice: 'Service order shared successfully.' }\n format.json { render json: @share, status: :created, location: @share }\n else\n format.html { render action: \"new\" }\n format.json { render json: @share.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @repo = Hubstats::Repo.where(name: params[:repo]).first\n @pull_requests = Hubstats::PullRequest.belonging_to_repo(@repo.id).merged_in_date_range(@start_date, @end_date).order(\"updated_at DESC\").limit(50)\n @pull_count = Hubstats::PullRequest.belonging_to_repo(@repo.id).merged_in_date_range(@start_date, @end_date).count(:all)\n @deploys = Hubstats::Deploy.belonging_to_repo(@repo.id).deployed_in_date_range(@start_date, @end_date).order(\"deployed_at DESC\").limit(50)\n @deploy_count = Hubstats::Deploy.belonging_to_repo(@repo.id).deployed_in_date_range(@start_date, @end_date).count(:all)\n @comment_count = Hubstats::Comment.belonging_to_repo(@repo.id).created_in_date_range(@start_date, @end_date).count(:all)\n @users = Hubstats::User.with_pulls_or_comments_or_deploys(@start_date, @end_date, @repo.id).only_active.order(\"login ASC\").limit(50)\n @active_user_count = Hubstats::User.with_pulls_or_comments_or_deploys(@start_date, @end_date, @repo.id).only_active.length\n @qa_signoff_count = Hubstats::QaSignoff.belonging_to_repo(@repo.id).signed_within_date_range(@start_date, @end_date).count(:all)\n @net_additions = Hubstats::PullRequest.merged_in_date_range(@start_date, @end_date).belonging_to_repo(@repo.id).sum(:additions).to_i -\n Hubstats::PullRequest.merged_in_date_range(@start_date, @end_date).belonging_to_repo(@repo.id).sum(:deletions).to_i\n @additions = Hubstats::PullRequest.merged_in_date_range(@start_date, @end_date).belonging_to_repo(@repo.id).average(:additions)\n @deletions = Hubstats::PullRequest.merged_in_date_range(@start_date, @end_date).belonging_to_repo(@repo.id).average(:deletions) \n\n stats\n end",
"def create\n @project = Project.new(project_params)\n user = User.find_by_id(session[:userid])\n @project.allshares = user.id\n respond_to do |format|\n if @project.save\n user.projectids += \",\" + String(@project.id)\n user.save!\n if project_params[:shares] == \"\"\n\n else\n share_params = {\n :proj => @project.id,\n :shares => project_params[:shares]\n }\n share (share_params)\n end\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.mobile { redirect_to @project }\n format.json { render action: 'show', status: :created, location: @project }\n else\n format.html { render action: 'new' }\n format.mobile { render action: 'new' }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n index\n @issue_show = Issue.find(params[:id])\n render :index\n end",
"def destroy\n @project = @share.project\n @share.destroy if admin? or @project.user_id == current_user.id\n @shares = @project.shares.to_a\n respond_to do |format|\n format.html { \n render :partial => 'projects/shares'\n #redirect_to shares_url, notice: 'Share was successfully destroyed.' \n }\n format.json { head :no_content }\n end\n end",
"def create\n @portfolio_finance = PortfolioFinance.new(portfolio_finance_params)\n @portfolio_finance.user = current_user\n\n if params[:portfolio_finance][:share_items].present?\n params[:portfolio_finance][:share_items].each do |key, share_item|\n if share_item[:quantity].to_i > 0\n @portfolio_finance.add_share_item(ShareItem.new(:share_id => key, :quantity => share_item[:quantity].to_i))\n end\n end\n end\n\n respond_to do |format|\n if @portfolio_finance.save\n format.html { redirect_to root_path, notice: 'Portfolio finance was successfully created.' }\n format.json { render :show, status: :created, location: @portfolio_finance }\n else\n format.html { render :new }\n format.json { render json: @portfolio_finance.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n if params[:portfolio_finance][:share_items].present?\n ShareItem.where(:portfolio_finance_id => @portfolio_finance.id).destroy_all\n params[:portfolio_finance][:share_items].each do |key, share_item|\n if share_item[:quantity].to_i > 0\n @portfolio_finance.add_share_item(ShareItem.new(:share_id => key, :quantity => share_item[:quantity].to_i))\n end\n end\n end\n\n respond_to do |format|\n if @portfolio_finance.update(portfolio_finance_params)\n format.html { redirect_to root_path, notice: 'Portfolio finance was successfully updated.' }\n format.json { render :show, status: :ok, location: @portfolio_finance }\n else\n format.html { render :edit }\n format.json { render json: @portfolio_finance.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @local_issues = LocalIssue.all\n end",
"def set_share\n \n @accounting = Accounting.find(params[:accounting_id])\n @share = @accounting.shares.find(params[:id])\n @group = @accounting.group\n end",
"def view_share\n #~ @folder = Folder.find_folder(params[:folder_id])\n params[:is_lease_agent] == 'true' ? display_lease_agents : display_collaborators\n end",
"def index\n @received_issues = ReceivedIssue.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @received_issues }\n end\n end",
"def index\n @user_shares = UserShare.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_shares }\n end\n end",
"def index\n @albums = Album.where(user_id: current_user.id)\n @shares = Share.where(user_id: current_user.id)\n @shares.each {\n |share| @albums += Album.where(id: share.album.id)\n }\n end",
"def index\n @issue_histories = IssueHistory.paginate(page: params[:page], per_page: 50)\n end",
"def show\n @accounting = Accounting.find(params[:accounting_id])\n @shares = @accounting.shares.find(params[:id])\n end",
"def index\n @issues = Issue.order(code: :asc)\n @today_budget = 0\n if(user_signed_in?)\n @yearly_deposit_with_start = current_user.user_setting.yearly_deposit\n if current_user.user_setting.start_date.year == Date.today.year\n @yearly_deposit_with_start *= (1 - current_user.user_setting.start_date.yday / Date.today.end_of_year.yday.to_f )\n end\n @chart = current_user.user_issues\n .order(bought_day: :asc)\n .inject(Hash.new(0)) {|a, e| a[e[:bought_day].to_date] += e[:price] * e[:num]; a}\n @chart += current_user.user_investments\n .order(bought_day: :asc)\n .inject(Hash.new(0)) {|a, e| a[e[:bought_day].to_date] += e[:price]; a}\n @user_stacked = @chart.reduce(0){|a, e| a += e[1]}\n # @user_should_stacked = current_user.user_setting.yearly_deposit * (Date.today.yday / Date.today.end_of_year.yday.to_f) - (current_user.user_setting.yearly_deposit - @yearly_deposit_with_start)\n @user_should_stacked = current_user.user_setting.yearly_deposit * (Date.today - current_user.user_setting.start_date.to_date) / Date.today.end_of_year.yday.to_f\n\n @today_budget = @user_should_stacked - @user_stacked\n\n @user_stocks = current_user.user_issues.group(:issue_code).sum(:num)\n end\n end",
"def index\n @sub_issues = SubIssue.all\n end",
"def share_index\n @asset = Asset.find(params[:id])\n str = @asset.shared_with.to_s\n @shared_to = str.split(\",\")\n end",
"def set_shareportfolio\n @shareportfolio = Shareportfolio.find(params[:id])\n end",
"def index\n @pending_share_invites = ShareInvite.where({receiver_id: current_user.id, status: \"pending\"})\n @accepted_share_invites = ShareInvite.where({receiver_id: current_user.id, status: \"accepted\"})\n @sent_share_invites = ShareInvite.where(sharer_id: current_user.id)\n logger.debug \"pending- #{@pending_share_invites}\"\n logger.debug \"accepted- #{@accepted_share_invites}\"\n end",
"def index\n @media_shares = MediaShare.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @media_shares }\n end\n end",
"def index\n @shareds = Shared.all\n end",
"def shares\n\n user_id_or_nickname = params[:user_id_or_nickname]\n @user = Shelby::API.get_user(user_id_or_nickname)\n\n @user_signed_in = user_signed_in?\n\n @signed_in_user = check_for_signed_in_user\n @signed_in_user_nickname = (@signed_in_user['nickname'] if @signed_in_user) || 'Anonymous'\n\n if params[:frame_id]\n raise Shelby::InternalError.new(\"Frame Not Found\") unless @frame = Shelby::API.get_frame(params[:frame_id], true)\n @roll = @frame['roll']\n @video = @frame['video']\n\n @is_mobile = is_mobile?\n\n if request.env['HTTP_REFERER']\n ref = request.env['HTTP_REFERER']\n @has_referer = ref.match(/twitter|facebook|t.co/)\n end\n\n render '/home/shares'\n else\n render '/home/app'\n end\n end",
"def index\n @funding_application_submissions = FundingApplicationSubmission.all\n end",
"def index\n \n @shareables = Shareable.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shareables }\n end\n end",
"def index\n if @issuable\n if @issuable.class.to_s == 'Project'\n @pre_issues = @issuable.issues\n @pre_issues.concat(@issuable.lists.map{|l| l.studies.map{|s| s.issues }}.flatten)\n else\n @pre_issues = @issuable.issues.order('sequential_id DESC')\n end\n else\n @pre_issues = Issue.scoped\n end\n\n @issues = @pre_issues\n \n unless params[:state]\n params[:state] = 'open'\n end\n\n if params[:state] == 'open'\n @issues = @issues.where(closed: false)\n end\n if params[:state] == 'closed'\n @issues = @issues.where(closed: true)\n end\n if params[:creator]\n @issues = @issues.where(creator_id: params[:creator])\n end\n if params[:assignee]\n @issues = @issues.where(assigned_id: params[:assignee])\n end\n if params[:aspect]\n @project = Project.find(params[:aspect])\n @issues = @project.issues\n end\n\n respond_to do |format|\n format.html { render layout: 'fluid' }# index.html.erb\n format.json { render json: @issues }\n end\n end",
"def show\n @user_share = UserShare.find(params[:id])\n @cart_item = CartItem.new\n @user_like = UserLike.new\n @share = Share.new\n @comment = Comment.new\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_share }\n end\n end",
"def index\n @pppams_issue_follow_ups = PppamsIssueFollowUp.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pppams_issue_follow_ups }\n=======\n\nbefore_filter :authenticate \nbefore_filter :find_pppams_issue\nlayout 'administration'\n\n def index\n @pppams_issue_follow_ups = @pppams_issue.pppams_issue_follow_ups.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @pppams_issue_follow_ups.to_xml }\n>>>>>>> 7436653363ecf064fdcfcd2b30df919b5144a2b8\n end\n end\n\n # GET /pppams_issue_follow_ups/1\n<<<<<<< HEAD\n # GET /pppams_issue_follow_ups/1.json\n=======\n # GET /pppams_issue_follow_ups/1.xml\n>>>>>>> 7436653363ecf064fdcfcd2b30df919b5144a2b8\n def show\n @pppams_issue_follow_up = PppamsIssueFollowUp.find(params[:id])\n\n respond_to do |format|\n<<<<<<< HEAD\n format.html # show.html.erb\n format.json { render json: @pppams_issue_follow_up }\n=======\n format.html # show.rhtml\n format.xml { render :xml => @pppams_issue_follow_up.to_xml }\n>>>>>>> 7436653363ecf064fdcfcd2b30df919b5144a2b8\n end\n end\n\n # GET /pppams_issue_follow_ups/new\n<<<<<<< HEAD\n # GET /pppams_issue_follow_ups/new.json\n def new\n @pppams_issue_follow_up = PppamsIssueFollowUp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pppams_issue_follow_up }\n end\n end\n\n # GET /pppams_issue_follow_ups/1/edit\n=======\n def new\n @pppams_issue_follow_up = PppamsIssueFollowUp.new\n end\n\n # GET /pppams_issue_follow_ups/1;edit\n>>>>>>> 7436653363ecf064fdcfcd2b30df919b5144a2b8\n def edit\n @pppams_issue_follow_up = PppamsIssueFollowUp.find(params[:id])\n end\n\n # POST /pppams_issue_follow_ups\n<<<<<<< HEAD\n # POST /pppams_issue_follow_ups.json\n=======\n # POST /pppams_issue_follow_ups.xml\n>>>>>>> 7436653363ecf064fdcfcd2b30df919b5144a2b8\n def create\n @pppams_issue_follow_up = PppamsIssueFollowUp.new(params[:pppams_issue_follow_up])\n\n respond_to do |format|\n if @pppams_issue_follow_up.save\n<<<<<<< HEAD\n format.html { redirect_to @pppams_issue_follow_up, notice: 'Pppams issue follow up was successfully created.' }\n format.json { render json: @pppams_issue_follow_up, status: :created, location: @pppams_issue_follow_up }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pppams_issue_follow_up.errors, status: :unprocessable_entity }\n=======\n flash[:notice] = 'Non Comp Issue Follow Up was successfully added.'\n format.html { redirect_to pppams_issue_path(@pppams_issue) }\n format.xml { head :created, :location => pppams_issue_path(@pppams_issue) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @pppams_issue_follow_up.errors.to_xml }\n>>>>>>> 7436653363ecf064fdcfcd2b30df919b5144a2b8\n end\n end\n end\n\n # PUT /pppams_issue_follow_ups/1\n<<<<<<< HEAD\n # PUT /pppams_issue_follow_ups/1.json\n=======\n # PUT /pppams_issue_follow_ups/1.xml\n>>>>>>> 7436653363ecf064fdcfcd2b30df919b5144a2b8\n def update\n @pppams_issue_follow_up = PppamsIssueFollowUp.find(params[:id])\n\n respond_to do |format|\n if @pppams_issue_follow_up.update_attributes(params[:pppams_issue_follow_up])\n<<<<<<< HEAD\n format.html { redirect_to @pppams_issue_follow_up, notice: 'Pppams issue follow up was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pppams_issue_follow_up.errors, status: :unprocessable_entity }\n=======\n flash[:notice] = 'Non Comp Issue Follow Up was successfully updated.'\n format.html { redirect_to pppams_issue_path(@pppams_issue) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pppams_issue_follow_up.errors.to_xml }\n>>>>>>> 7436653363ecf064fdcfcd2b30df919b5144a2b8\n end\n end\n end",
"def index\n @projects = Project.find_all_by_user_id current_user[:id]\n @project_issues = ProjectIssue.find_all_by_user_id current_user[:id]\n end",
"def show\n @issue = @account.issues.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @issue }\n end\n end",
"def show\n @share = Share.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @share }\n end\n end",
"def show\n @site_stat=SiteStat.first\n @issue = Issue.find(params[:id])\n session[:selected_issue] = @issue\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @issue }\n end\n end",
"def set_share\n @share = Share.find(params[:id])\n end",
"def set_share\n @share = Share.find(params[:id])\n end",
"def set_share\n @share = Share.find(params[:id])\n end",
"def set_share\n @share = Share.find(params[:id])\n end",
"def set_share\n @share = Share.find(params[:id])\n end",
"def set_share\n @share = Share.find(params[:id])\n end",
"def index\n @shareholder_confirmations = ShareholderConfirmation.all\n end",
"def index\n @jira_issues = JiraIssue.all\n end",
"def set_share\n @share = Share.find_by_id(params[:id])\n end",
"def mailing_shares_overview(id)\n get(\"/response/#{id}/shares/overview\")\n end",
"def set_content_page_share\n @share = ContentPageShare.find(params[:id])\n end",
"def show\n @normal_issue = NormalIssue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @normal_issue }\n end\n end",
"def show\n @shareable = Shareable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shareable }\n end\n end",
"def index\n @submissions = current_user.submissions.all\n end",
"def show\n @task_share = TaskShare.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @task_share }\n end\n end",
"def show\n @experience = Experience.unexpire_shared.find(:first, :conditions => {:share_url => params[:id]})\n\n respond_to do |format|\n format.html {\n if @experience \n render :action => 'show'\n else\n redirect_to root_url\n end\n }\n format.xml { render :xml => @experience }\n end\n end",
"def index\n @tissues = Tissue.all\n end",
"def ask\n @view = VIEWS[:ask]\n @contributions = Contribution.where(url: '')\n respond_to do |format|\n format.html { render :index }\n format.json { render json: @contributions }\n end\n end",
"def index\n if params[:github_name]\n @user = User.find_by_github_name(params[:github_name])\n @issues = @user.issues\n else\n @issues = Issue.all\n end\n end",
"def linked_issues\n @matter = Matter.find(params[:id])\n @matter_issues = @matter.matter_issues\n @issue_type = params[:issue_type]\n @path = params[:path]\n case @issue_type\n when 'matter_research'\n object = MatterResearch.find(params[:matter_research_id])\n when 'matter_fact'\n object = MatterFact.find(params[:matter_fact_id])\n when 'matter_risk'\n object = MatterRisk.find(params[:matter_risk_id])\n when 'document_home'\n object = DocumentHome.find(params[:matter_document_id])\n end\n @submodel = object\n @matter_issueid = object.matter_issues.find(:all, :select => ['id']).collect{|a| a.id}\n if params[:link] \n object.link_submodule(params, :matter_issue_ids)\n redirect_to params[:path]\n else\n render :partial => \"linked_issues\", :layout => false\n end\n end",
"def index\n @jira_issue_summaries = JiraIssueSummary.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @jira_issue_summaries }\n end\n end",
"def index\n\n @submissions = Submission.all\n authorize! :manage, @submissions\n end",
"def index\n @issues = Issue.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @issues }\n end\n end",
"def show\n @project = Project.find(params[:project_id])\n @task = Task.find(params[:id])\n\n\t@current_user_id = 1 # TODO: fix me\n\t@can_mark_as_abandoned = @task.requester_user_id == @current_user_id || @task.performer_user_id == @current_user_id\n\t@performer_not_yet_decided = @task.performer_user_id == 0\n\t@ready_to_decide_performer = 0 # TODO: fix me @task.\n\t@shares_available = self.get_shares_available( @project.id, @current_user_id )\n\n\t# always assume a new task_share; updating existing ones will delete previous ones\n\t@task_share = TaskShare.new( :task_id => @task.id )\n\n\t@all_task_shares = TaskShare.find_all_by_task_id( @task.id )\n\n\t@expand_share_pool_decision = ExpandSharePoolDecision.find_by_task_id( @task.id )\n\t@vote = Vote.new\n\tif ! @expand_share_pool_decision.nil?\n\t\t#@expand_share_pool_votes = Vote.find_all_by_decision_id( @expand_share_pool_decision.decision.id )\n\t\t@expand_share_pool_votes = @expand_share_pool_decision.decision.votes\n\tend\n\n\tif ! @task.decisions.nil? and ! @task.decisions.first.nil?\n\t\t@who_should_do_task_decision = @task.decisions.first.decidable # assume there's only one, and it's the first, for now; TODO: don't assume\n\tend\n\n\t@who_vote = Vote.new\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @task }\n end\n end",
"def index\n @shared_orders = SharedOrder.all\n end",
"def set_workshare\n @workshare = Workshare.find(params[:id])\n end",
"def create\n @issue = Issue.new(issue_params)\n @issue.userCreator = current_user.id\n @issue.idUserAssignee = current_user.id\n @issue.votes = 0\n @issue.creationDate = Time.now\n @issue.updated = Time.now\n @issue.status = 'NEW'\n respond_to do |format|\n if @issue.save\n format.html { redirect_to @issue, notice: 'Issue was successfully created.' }\n format.json { render :show, status: :created, location: @issue }\n else\n format.html { render :new }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n expire_page :action => :index\n expire_page :action => :show\n \n @jira_issue_summary = JiraIssueSummary.new(params[:jira_issue_summary])\n\n respond_to do |format|\n if @jira_issue_summary.save\n format.html { redirect_to(@jira_issue_summary, :notice => 'Jira issue summary was successfully created.') }\n format.xml { render :xml => @jira_issue_summary, :status => :created, :location => @jira_issue_summary }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @jira_issue_summary.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n #@spend_entries = SpendEntry.all\n end",
"def current_shares\n shares.count\n end"
] |
[
"0.6073024",
"0.6073024",
"0.59635305",
"0.5926382",
"0.58802646",
"0.58801734",
"0.583196",
"0.5820496",
"0.5763268",
"0.5674401",
"0.5665418",
"0.5635664",
"0.5621745",
"0.562049",
"0.5614837",
"0.5614837",
"0.5614837",
"0.5614837",
"0.5614837",
"0.5593982",
"0.55668527",
"0.55615515",
"0.5555193",
"0.55230653",
"0.55051893",
"0.54971695",
"0.5483077",
"0.5476388",
"0.5442969",
"0.5422582",
"0.5416851",
"0.54062396",
"0.54053134",
"0.5403006",
"0.53860414",
"0.5384946",
"0.5372571",
"0.536621",
"0.5365462",
"0.5364078",
"0.5361667",
"0.531689",
"0.53159785",
"0.53113973",
"0.5303532",
"0.5295726",
"0.52892417",
"0.52855265",
"0.5284754",
"0.5284359",
"0.5279694",
"0.527695",
"0.5276787",
"0.52653885",
"0.5263437",
"0.52622265",
"0.5259139",
"0.52460885",
"0.52428555",
"0.5241988",
"0.5232417",
"0.52289623",
"0.5218468",
"0.5217353",
"0.5213625",
"0.52069134",
"0.5197353",
"0.5193053",
"0.51870704",
"0.5183766",
"0.5180341",
"0.5171016",
"0.5171016",
"0.5171016",
"0.5171016",
"0.5171016",
"0.5171016",
"0.5170666",
"0.5165855",
"0.51631093",
"0.5159327",
"0.51578784",
"0.5148887",
"0.5146178",
"0.5141739",
"0.51407546",
"0.5133717",
"0.5131613",
"0.51214725",
"0.51178",
"0.5112352",
"0.51118296",
"0.51101536",
"0.51099795",
"0.5109255",
"0.5103974",
"0.5102486",
"0.5101121",
"0.51008934",
"0.50997984",
"0.5096552"
] |
0.0
|
-1
|
ebuy doesn't affect progress track, but is twice as expensive and has a different target power
|
def ebuy_cash_needed(corporation)
return 0 unless @game.corporation_power[corporation] < @game.min_ebuy_power
diff = @game.min_ebuy_power - @game.corporation_power[corporation]
diff * @game.class::POWER_COST[@game.phase.name] * 1.5
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def buy_bot(percent_increase = 0.05, chunk = 0.006, prepump_buffer = 0.5)\n market_name = @market_name\n low_24_hr, last_price, ask_price, volume = get_market_summary(market_name)\n total_spent = 0.0\n p [low_24_hr, last_price, ask_price, volume]\n if volume < 100 and last_price < (1.0 + prepump_buffer) * low_24_hr #last_price is smaller than 50% increase since yerterday\n puts \"Coin is not prepumped\".blue\n order = buy_chunk(last_price, market_name, percent_increase, chunk)\n p [order, \"Units Bought : #{@units_bought}\"]\n end\nend",
"def attemp_buying\n\n end",
"def trade_value\n 0.4\n\n end",
"def buy_sell_bot(percent_increase = 0.05, chunk = 0.004, prepump_buffer = 0.5, profit = 0.2, splits = 2, no_of_retries = 10)\n market_name = @market_name\n currency = @currency\n low_24_hr, last_price, ask_price = get_market_summary(market_name)\n total_spent = 0.0\n p [low_24_hr, last_price, ask_price]\n if last_price < (1.0 + prepump_buffer)*low_24_hr #last_price is smaller than 50% increase since yerterday\n order = buy_chunk(last_price, market_name, percent_increase, chunk)\n buy_price = last_price + last_price * percent_increase\n counter = 0\n while counter < no_of_retries\n get_balance_url = get_url({ :api_type => \"account\", :action => \"currency_balance\", :currency => currency })\n balance_details = call_secret_api(get_balance_url)\n p balance_details\n if balance_details and balance_details[\"Available\"] and balance_details[\"Available\"] > 0.0 # available coins present\n qty = balance_details[\"Available\"]/splits\n splits.times do |i|\n qty += (balance_details[\"Available\"].to_i % splits) if (i-1 == splits)\n sell_price = buy_price + buy_price * (profit * (i+1))\n sell_price = \"%.8f\" % sell_price\n sell_limit_url = get_url({ :api_type => \"market\", :action => \"sell\", :market => market_name, :quantity => qty, :rate => sell_price })\n puts \"Selling coin...\".yellow\n p [{ :api_type => \"market\", :action => \"sell\", :market => market_name, :quantity => qty, :rate => sell_price }]\n order_placed = call_secret_api(sell_limit_url)\n puts (order_placed and !order_placed[\"uuid\"].nil? ? \"Success\".green : \"Failed\".red)\n cnt = 1\n while cnt <= 3 and order_placed and order_placed[\"uuid\"].nil? #retry\n puts \"Retry #{cnt} : Selling coin...\".yellow\n sleep(1) # half second\n order_placed = call_secret_api(sell_limit_url)\n puts (order_placed and !order_placed[\"uuid\"].nil? ? \"Success\".green : \"Failed\".red)\n cnt += 1\n end\n p [order_placed, \"Sell #{qty} of #{market_name} at #{sell_price}\"]\n end\n break\n end\n counter += 1\n sleep(0.5)\n end\n end\nend",
"def analysis\n return 0 if @previous_buy_price == 0 # next for the first time\n\n @ico_bot.reload\n\n if @ico_bot.trading_type == \"FORCE_BUY\"\n check_set_force_order_for_buy()\n elsif @ico_bot.trading_type == \"CHECKING_ORDER_BUY\"\n check_finish_order_buy()\n elsif @ico_bot.trading_type == \"FORCE_SELL\"\n check_set_force_sell()\n elsif @ico_bot.trading_type == \"CHECKING_ORDER_SELL\"\n check_finish_order_sell()\n # elsif @ico_bot.trading_type == \"LOSE_ORDER\"\n # check_finish_lose_order()\n end\n end",
"def to_be_done()\r\n\t\t#\r\n\t\t# loss_trig_price = price - loss\r\n\t\t# loss_price = price - loss - 10\r\n\t\t# obuy \t = push_buy( \t\t quantity: quantity, price: price )\r\n\t\t# monitor_filled( obuy )\r\n\t\t# obuy_stp = push_buy_stop( quantity: quantity, loss_trig_price: loss_trig_price, loss_price: loss_price )\r\n\t\t#\r\n\t\t#\r\n\t\t# loss_trig_price = price + loss\r\n\t\t# loss_price = price + loss + 10\r\n\t\t# osell = push_sell( \t\t quantity: quantity, price: price)\r\n\t\t# monitor_filled( osell )\r\n\t\t# osell_stp = push_sell_stop( quantity: quantity, loss_trig_price: loss_trig_price, loss_price: loss_price)\r\n\t\t#\r\n\r\n\r\n\t\t# modo mais simples primeiro\r\n\t\t# entrar a market\r\n\t\tloss_trig_price = price - loss\r\n\t\tloss_price = price - loss - 10\r\n\t\tobuy \t = push_buy( \t\t quantity: quantity, price: 0 )\r\n\t\tmonitor_filled( obuy )\r\n\t\tobuy_stp = push_buy_stop( quantity: quantity, loss_trig_price: loss_trig_price, loss_price: loss_price )\r\n\r\n\r\n\t\tloss_trig_price = price + loss\r\n\t\tloss_price = price + loss + 10\r\n\t\tosell = push_sell( \t\t quantity: quantity, price: 0)\r\n\t\tmonitor_filled( osell )\r\n\t\tosell_stp = push_sell_stop( quantity: quantity, loss_trig_price: loss_trig_price, loss_price: loss_price)\r\n\tend",
"def buy_power_3 d0, d1, s0, s1\n next_condition = @battery - (d0 - s0) - (d1 - s1) # 未来の条件式\n crnt_condition = @battery - (d0 - s0) # 現在の条件式\n result = 0.0 # 結果値\n\n if crnt_condition < @target # 現時点で目標値よりバッテリー残量が少ないとき\n if next_condition < @target # 次の時刻でも目標値が達成できないとき\n # 達成できなくなる分の電力を買っておく\n if @target - next_condition > 500.0 # 15分に受け取れる電力量は500wと想定する\n result = 500.0\n else\n result = @target - next_condition\n end\n # 買った分で最大容量を超えてしまったときは超えないようにする\n next_battery = crnt_condition + result # 次の時刻でのバッテリー残量予測\n result = next_battery > @max_strage ? result - (next_battery - @max_strage) : result\n else # 次の時刻では目標値が達成できるとき\n # 買わない 売るかどうかは保留したほうがいい?ただし0にはしないようにする\n result = 1.0 if crnt_condition == 0.0\n sell_power_2\n end\n else # 現時点では目標値は達成しているとき\n if next_condition < @target # 次の時刻で目標値が達成できない\n # 達成できなくなる分の電力を買っておく\n if @target - next_condition > 500.0 # 15分に受け取れる電力量は500wと想定する\n result = 500.0\n else\n result = @target - next_condition\n end\n next_battery = crnt_condition + result # 次の時刻でのバッテリー残量予測\n result = next_battery > @max_strage ? result - (next_battery - @max_strage) : result\n else # 次の時刻でも目標値が達成できるとき\n # Don't buy power.\n # むしろ売る\n sell_power_2\n end\n end\n @battery = crnt_condition + result # バッテリー残量の状態遷移\n @battery = @max_strage if @battery > @max_strage\n return result\n end",
"def sell_at_any_cost(percent_decrease = 0.3)\n market_name = @market_name\n open_orders_url = get_url({ :api_type => \"market\", :action => \"open_orders\", :market => market_name })\n open_orders = call_secret_api(open_orders_url)\n #cancel all orders\n if open_orders.size > 0\n open_orders.each do |open_order|\n cancel_order_url = get_url({ :api_type => \"market\", :action => \"cancel_by_uuid\", :uuid => open_order[\"OrderUuid\"] })\n call_secret_api(cancel_order_url)\n end\n end\n # call sell bot again with lower profit\n sell_order = sell_bot(percent_decrease)\nend",
"def get_target\n\n\n # get the price for the last trade\n response = HTTParty.get(\"#{@@base_url}/venues/#{@venue}/stocks/#{@stock}/quote\")\n\n last = response.parsed_response[\"last\"].to_i\n\n #set the limit for the first offer as one dollar less than the last price\n limit = last - 100\n\n # Order parameters hash\n order = {\n \"account\" => @account,\n \"venue\" => @venue,\n \"symbol\" => @stock,\n \"price\" => limit,\n \"qty\" => 1,\n \"direction\" => \"buy\",\n \"orderType\" => \"limit\"\n }\n\n #make the first offer to activate the flash message in the UI\n response = HTTParty.post(\"#{@@base_url}/venues/#{@venue}/stocks/#{@stock}/orders\",\n :body => JSON.dump(order),\n :headers => {\"X-Starfighter-Authorization\" => @apikey}\n )\n\n\n # wait untill the order is closed\n id = response.parsed_response[\"id\"]\n\n status = response.parsed_response[\"open\"]\n\n while status\n\n response = HTTParty.get(\"#{@@base_url}/venues/#{@venue}/stocks/#{@stock}/orders/#{id}\",\n :headers => {\"X-Starfighter-Authorization\" => @apikey})\n\n status = response.parsed_response[\"open\"]\n\n\n end\n\n # wait a few seconds for the message in the UI to be generated\n sleep(5)\n\n # catch the treshold from the message in the UI\n response = HTTParty.get(\"https://www.stockfighter.io/gm/instances/#{@instance}\",\n :headers => {\"X-Starfighter-Authorization\" => @apikey})\n\n flash_message = response.parsed_response[\"flash\"][\"info\"]\n\n\n regex = /\\d\\d\\.\\d\\d\\.$/\n\n threshold = regex.match(flash_message).to_s.chop.to_f\n\n unless threshold\n\n puts \"There has been a problem getting the target price\"\n\n nil\n\n end\n\n puts \"Target price has been fetched\"\n\n (threshold * 100).to_i\n\n end",
"def trade; end",
"def trade(ticker, day)\n # this day's price\n price = @account.broker.exchange.quote(ticker, day)\n\n# if @last_purchase.key? ticker # If we've purchased this stock before, we continue with Dr. Rushton's trading rule.\n if @account.portfolio[ticker] == 0 # try to buy the given ticker\n last_hold_time = if @last_purchase[ticker][:buy_day] && @last_purchase[ticker][:sell_day]\n @last_purchase[ticker][:buy_day] - @last_purchase[ticker][:sell_day]\n else\n 0\n end\n \n # Wait for a time interval equal to gamma * HT to pass (cool-down period) OR Price < P to buy more\n if(!@last_purchase.key?(ticker) || \n price < @last_purchase[ticker][:price] || \n @last_purchase[ticker][:sell_day] - day >= @gamma * last_hold_time)\n s = @account.buy_amap(ticker, day, @amount_per_company)\n @last_purchase[ticker] = {price: price, buy_day: day}\n puts \"bought #{s} shares of #{ticker} on #{@account.broker.exchange.eod(ticker, day).date}\" if $DEBUG\n end\n else # try to sell our holdings of the given ticker\n # compute t, the return multiplier, given the interval between now and last purchase of the given stock (ticker)\n t = @fn_t.call(@last_purchase[ticker][:buy_day] - day)\n\n # compute alpha, given the value t, to determine the percentage gain multiplier\n alpha = @fn_alpha.call(t)\n\n puts \"t = #{t}\", \"alpha = #{alpha}\" if $DEBUG\n\n puts \"price of #{ticker} on #{@account.broker.exchange.eod(ticker, day).date} is #{price}\" if $DEBUG\n\n if(price > (1.0 + alpha) * @last_purchase[ticker][:price])\n s = @account.sell_all(ticker, day)\n @last_purchase[ticker][:sell_day] = day\n puts \"sold #{s} shares of #{ticker} on #{@account.broker.exchange.eod(ticker, day).date}\" if $DEBUG\n end\n end\n# else # We use SMA to make our initial purchase of each stock\n# # compute average over number of days\n# avg = average_price(ticker, day)\n\n # if price > avg -> price - avg = positive\n # price < avg -> price - avg = negative\n # price = avg -> price - avg = 0\n# @price_relation_to_average[\"#{ticker}#{day}\"] = price - avg\n\n # decide whether the price has just upcrossed or downcrossed the MA line\n# if(price > avg && @price_relation_to_average[\"#{ticker}#{day + 1}\"] < 0) # upcross - BUY as much as possible\n# s = @account.buy_amap(ticker, day, @amount_per_company)\n# @last_purchase[ticker] = {price: price, buy_day: day}\n# puts \"bought #{s} shares of #{ticker} on #{@account.broker.exchange.eod(ticker, day).date}\" if $DEBUG\n# end\n# end\n \n puts \"account: #{@account.to_s(day)}\" if $DEBUG\n end",
"def weighIntrade()\n\n end",
"def analysis\n return 0 if @previous_buy_price == 0 # next for the first time\n\n @ico_bot.reload\n\n if @ico_bot.trading_type == \"BUYING\"\n check_set_order_for_buy()\n elsif @ico_bot.trading_type == \"FORCE_BUY\"\n check_set_force_order_for_buy()\n elsif @ico_bot.trading_type == \"CHECKING_ORDER_BUY\"\n check_finish_order_buy()\n elsif @ico_bot.trading_type == \"CANCEL_BUY\"\n cancel_order_buy()\n elsif @ico_bot.trading_type == \"SELLING\"\n check_set_order_sell()\n elsif @ico_bot.trading_type == \"CHECKING_ORDER_SELL\"\n check_finish_order_sell()\n elsif @ico_bot.trading_type == \"CANCEL_SELL\"\n cancel_order_sell()\n elsif @ico_bot.trading_type == \"LOSE_ORDER\"\n check_finish_lose_order()\n end\n end",
"def comp_energy_pt\n \n if self.game.turns.count == 1\n self.update(computer_energy: 10)\n else\n self.update(computer_energy: (10 + (Turn.where(id: ((self.id) - 1))[0].computer_bludger_outcome)))\n end\n end",
"def goods_produced\n (0.2 * base_production + trade_goods_bonus).round(6)\n end",
"def sell_bot(percent_decrease = 0.1)\n market_name = @market_name\n currency = @currency\n low_24_hr, last_price, ask_price = get_market_summary(market_name)\n sell_price = last_price - percent_decrease*last_price\n get_balance_url = get_url({ :api_type => \"account\", :action => \"currency_balance\", :currency => currency })\n balance_details = call_secret_api(get_balance_url)\n sell_price = \"%.8f\" % sell_price\n if balance_details and balance_details[\"Available\"] and balance_details[\"Available\"] > 0.0\n p [market_name, last_price, balance_details[\"Available\"], sell_price]\n sell_limit_url = get_url({ :api_type => \"market\", :action => \"sell\", :market => market_name, :quantity => balance_details[\"Available\"], :rate => sell_price })\n puts \"Selling coin...\".yellow\n p [{ :api_type => \"market\", :action => \"sell\", :market => market_name, :quantity => balance_details[\"Available\"], :rate => sell_price }]\n order_placed = call_secret_api(sell_limit_url)\n puts (order_placed and !order_placed[\"uuid\"].nil? ? \"Success\".green : \"Failed\".red)\n cnt = 1\n while cnt <= 3 and order_placed and order_placed[\"uuid\"].nil? #retry\n puts \"Retry #{cnt} : Selling coin...\".yellow\n sleep(1) # half second\n order_placed = call_secret_api(sell_limit_url)\n puts (order_placed and !order_placed[\"uuid\"].nil? ? \"Success\".green : \"Failed\".red)\n cnt += 1\n end\n p [order_placed, \"Sell #{balance_details[\"Available\"]} of #{market_name} at #{sell_price}\"]\n else\n puts \"Insufficient Balance\".red\n end\nend",
"def invest_in_the_system\r\n @profit_from_crash += msg.value\r\n end",
"def invest_in_the_system\r\n @profit_from_crash += msg.value\r\n end",
"def calculate_price_of_next_foobar\n @initial_foobar_px = (@initial_foobar_px * (1+@percentage_px_increase)).round(2) # assumes that each subsequent price is rounded off to 2 digits immediately to imitate real life\n end",
"def trust_price_tao\n setting_price = get_setting_price('TradeBid')\n if setting_price.activate_price\n setting_price.price\n else\n global = Global.new(\"#{currency}#{payment_type}\")\n return 0 if global.last_buy.nil?\n return 0 if global.last_buy[:price].nil?\n global.last_buy[:price]\n end\n end",
"def progress()\n percent = (($ops / $total_ops) * 100).floor\n if (percent <= 99)\n $progress.progress = percent\n $ops += 1\n else\n $progress.finish\n end\nend",
"def promo_price\n price*0.75\n end",
"def position_cost\n return 0 if self.is_close?\n value = self.traded_price * self.open_volume\n value * instrument_multiplier * instrument_currency_exchange_rate\n end",
"def next_charge\n ( pre_finalised_quote * relative_progress / 100 ) - charged_so_far\n end",
"def effective_rate; end",
"def progress_rate\n 1\n end",
"def before_trade(options={})\n stock = options[:stock]\n quantity = options[:quantity] # + for buy, - for sell\n vfactor = volume_factor(stock)\n\n current_price = options[:price]\n total_execution_price = (1..(quantity.abs)).inject(0) do |total, _|\n # We have to stagger the price calculations by one for buy vs. sell,\n # to include the same set of prices when buying as selling.\n if quantity > 0 # buy\n price = current_price\n current_price *= vfactor\n total + price\n else # sell\n total + (current_price /= vfactor)\n end\n end\n average_execution_price = total_execution_price / quantity.abs\n\n {:price => average_execution_price}\n end",
"def compute_price\n \n # set the initial state of an order\n self.status = Order.possible_status[:wait_payment]\n \n # use the visitor pattern to traverse the product and its upgrades\n visitor = VisitorPrice.new\n visitor.visit_product product\n upgrades.each do |upgrade|\n visitor.visit_upgrade upgrade\n end\n self.price = visitor.price\n \n end",
"def analysis\n # return 0 if @previous_buy_price == 0 # next for the first time\n\n if @order.trading_type == \"BUYING\"\n check_set_order_for_buy()\n elsif @order.trading_type == \"CHECKING_ORDER_BUY\"\n check_finish_order_buy()\n elsif @order.trading_type == \"SELLING\"\n check_set_order_sell()\n elsif @order.trading_type == \"CHECKING_ORDER_SELL\"\n check_finish_order_sell()\n elsif @order.trading_type == \"FORCE_SELL\"\n force_order_sell()\n end\n end",
"def trade\n @target_tickers.each do |ticker|\n price = @yahoo_api.get_latest_price(ticker)\n # Buy if cheap enough\n if price < @target_prices[ticker][:min_price]\n @ib_api.buy(ticker, 100, price)\n end\n # Sell if expensive enough\n if price > @target_prices[ticker][:max_price]\n @ib_api.sell(ticker, 100, price)\n end\n end\n end",
"def masterwork_prob_bonus; 0; end",
"def buy_all_bot(percent_increase = 0.05, chunk = 0.006, prepump_buffer = 0.5)\n markets_url = get_url({ :api_type => \"public\", :action => \"markets\" })\n markets = call_api(markets_url)\n markets.each do |market|\n currency = market[\"MarketCurrency\"]\n base_currency = market[\"BaseCurrency\"]\n market_name = market[\"MarketName\"]\n if market[\"IsActive\"] and base_currency == \"BTC\"\n @market_name = market_name\n buy_bot(percent_increase, chunk, prepump_buffer)\n end\n end\nend",
"def quick_update_stock(filename)\n ThinkingSphinx::Deltas.suspend :supply_item do\n @updates.each do |upd|\n si = @supplier.supply_items.where(:supplier_product_code => upd[0]).first\n unless si.nil?\n if si.update_attributes(:stock => upd[1]) == true\n supplier_logger.info(\"[#{DateTime.now.to_s}] Quick stock update: #{si.to_s} now #{si.stock}\")\n else\n supplier_logger.error(\"[#{DateTime.now.to_s}] Quick stock update failed: #{si.to_s}, errors: #{si.errors.full_messages}\")\n end\n end\n end\n end\n Product.update_price_and_stock # Sync available products to the now changed supply items\n end",
"def how_high\n energy * energy\nend",
"def sell_pending\n end",
"def after_redeem() end",
"def do_buy(number)\r\r\n $game_party.lose_currency(@gold_window.currency, number * buying_price)\r\r\n $game_party.gain_item(@item, number)\r\r\n end",
"def trade_power\n (base_trade_power * 1.75).round(6)\n end",
"def calculate_import_duty\n @import_duty = imported ? (price * 0.05) : 0.0\n end",
"def btc_profit\n break_even.abs\n end",
"def trust_buy_price\n setting_price = get_setting_price('TradeBid')\n if setting_price.activate_price\n setting_price.price\n else\n Rails.cache.read(\"kraken-price-#{currency}#{payment_type}\")[:buy_order_price]\n end\n end",
"def trade action\n if action == :buy\n buy_btc(@options[:volume])\n else\n sell_btc(@options[:volume])\n end\n end",
"def investment\n if buy_price\n num_of_shares * buy_price\n end\n end",
"def unit_saving(point)\n point.price - price\n end",
"def apply(product, items_bought)\n if items_bought < @threshold\n 0\n else\n percent = BigDecimal((@percent/100.to_f).to_s)\n discounted_items = BigDecimal((items_bought - @threshold).to_s)\n percent * discounted_items * product.price\n end\n end",
"def money_for_us(auction)\n total_sale = auction.current_bid * auction.quantity\n if auction.premium_service\n total_sale * 0.1 # ten percent commission\n else\n total_sale * 0.05 # five percent commission\n end\n end",
"def pre_pay_offered\n end",
"def calculate_price\n logger.info(\"calculate_price ======================\" )\n logger.info(\"calculate_price price_usage=\" + self.price_usage.price.to_s)\n logger.info(\"calculate_price price_media=\" + self.price_media.price.to_s)\n # price = image.basePrice | image.stockBasePrice\n price = 0 # self.image_shell.stock_base_price\n sumPerc = 0\n self.price_options.each do |o|\n sumPerc += (o.percentage)\n logger.info(\"calculate_price price_opton=\" + (o.percentage).to_s + \"%\") \n end\n \n # add countries\n worldwide = self.use_territory.include? \"Worldwide\"\n north_america = self.use_territory.include? \"North America\"\n south_america = self.use_territory.include? \"South America\"\n asia = self.use_territory.include? \"Asia\"\n europe = self.use_territory.include? \"Europe\"\n australia = self.use_territory.include? \"Australia\"\n africa = self.use_territory.include? \"Africa\"\n \n \n logger.info(\"worldwide \" + worldwide.to_s )\n logger.info(\"north_america \" + north_america.to_s)\n logger.info(\"south_america \" + south_america.to_s)\n logger.info(\"asia \" + asia.to_s )\n logger.info(\"europe \" + europe.to_s )\n logger.info(\"australia \" + australia.to_s )\n logger.info(\"africa \" + africa.to_s )\n \n \n if worldwide\n \n price += self.price_usage.price + 0.15\n \n elsif north_america || south_america || asia || europe || australia || africa\n \n sumPerc += 0.10 if north_america\n sumPerc += 0.10 if south_america\n sumPerc += 0.10 if asia\n sumPerc += 0.10 if europe\n sumPerc += 0.10 if australia\n sumPerc += 0.10 if africa\n \n else\n \n self.use_territory.each do |t|\n sumPerc += 0.03\n end\n \n end\n \n price += self.price_usage.price + self.price_media.price\n price += (sumPerc/100.0)*price\n \n logger.info(\"price \" + price.to_s )\n logger.info(\"sumPerc \" + sumPerc.to_s )\n logger.info(\"sumPerc \" + ( sumPerc/100.0 ).to_s )\n logger.info(\"(sumPerc/100)*price \" + ( (sumPerc/100.0)*price ).to_s ) \n logger.info(\"calculate_price total \" + price.to_s)\n logger.info(\"calculate_price ======================\" ) \n price\n end",
"def final_unit_price\r\n#\t\tmultiplier = order.priced ? 1.0 : 1.1\r\n\r\n\t\tProduct.discount_price(self.unit_price, discount, discount_is_abs)\r\n#* multiplier\r\n\tend",
"def progress; end",
"def progress; end",
"def progress; end",
"def progress; end",
"def progress; end",
"def sell_all_bot(profit_rate = 0.2)\n markets_url = get_url({ :api_type => \"public\", :action => \"markets\" })\n markets = call_api(markets_url)\n expected_worth = 0.0\n markets.each do |market|\n currency = market[\"MarketCurrency\"]\n base_currency = market[\"BaseCurrency\"]\n market_name = market[\"MarketName\"]\n if market[\"IsActive\"] and base_currency == \"BTC\"\n get_balance_url = get_url({ :api_type => \"account\", :action => \"currency_balance\", :currency => currency })\n balance_details = call_secret_api(get_balance_url)\n if balance_details[\"Available\"] and balance_details[\"Available\"] > 0.0 #purchased coins\n orders_history_url = get_url({ :api_type => \"account\", :action => \"market_orders_history\", :market => market_name })\n orders_history = call_secret_api(orders_history_url)\n net_value = 0.0\n orders_history.each do |order|\n net_value += order[\"Price\"] if order[\"OrderType\"] == \"LIMIT_BUY\"\n net_value -= order[\"Price\"] if order[\"OrderType\"] == \"LIMIT_SELL\"\n end\n if net_value > 0 # buys are more, we need to get more than this net value by selling available coins\n sell_price = (net_value + net_value*profit_rate)/balance_details[\"Available\"]\n sell_price = \"%.8f\" % sell_price\n sell_limit_url = get_url({ :api_type => \"market\", :action => \"sell\", :market => market_name, :quantity => balance_details[\"Available\"], :rate => sell_price })\n order_placed = call_secret_api(sell_limit_url)\n p [order_placed, \"for #{market_name} at #{sell_price}\"]\n end\n expected_worth += (net_value + net_value*profit_rate)\n end\n end\n end\n p [\"Expected Worth=\", expected_worth]\nend",
"def fast_ready_bonus\n [100, features_sum(:fast_ready)].min / 100.0\n end",
"def buy3(num, item)\n return 0 if num < 3\n diff = item.price - item.sale_price\n amount = diff * num\n\n if amount > 0\n @subtract += amount\n @promos[item.code] = diff\n @promo_counts[\"BUY3\"] = num\n end\n end",
"def buy_value(penny)\n (Item.find(item_id).price_w * buy_w)*(1.00-(penny*0.015))\n end",
"def progressable; end",
"def maybe_pause_evolution\n\n end",
"def target_sell_price\n target_return / (converted_capital * (1 - @sell_bank_rate.fee))\n end",
"def sell_quantity\r\n 100000000000\r\n end",
"def void_last_transaction\n @total -= @prices #subtract prices from the total price\n end",
"def must_buy_train?(entity)\n must_buy_power?(entity)\n end",
"def buy_in_loop\n @entry_time = Time.now\n set_amount_and_check_balance\n loop do\n log_time_and_price\n set_and_log_indicator_ivars\n\n if lagging_indicators_green && leading_indicators_green\n set_buy_in\n break\n else\n @dc.prepend 'position_logs', \"NOT BUYING IN YET ------------------------------------ <br /><br />\"\n set_sleep_time #varies depending on state of indicators.\n end\n end\n manage_position_loop\n end",
"def trade action\n bid_ask=action==:buy ? :ask : :bid\n\n\tp = @price[:bid] if @price && @price[:bid] && bid_ask==:bid#memoize\n\tp = @price[:ask] if @price && @price[:ask] && bid_ask==:ask#memoize\n\tp = price(action) unless p\n bid_ask=action==:buy ? \"B\":\"S\" #reverse because its BTCUSD pair\n\tvolume = @options[:volume]\n\n params = {'username' => ENV['ROCK_USERNAME'],\n\t 'password' => ENV['ROCK_PASSWORD'],\n\t 'api_key' => ENV['ROCK_KEY'],\n\t 'fund_name'=> 'BTCUSD',\n\t\t 'order_type'=>bid_ask,\n\t\t 'amount' => volume,\n\t\t 'price' => p\n\t }\n\tresponse = RestClient.post(\"https://www.therocktrading.com/api/place_order\", params, {})\n r_json=JSON.parse(response)\n if !r_json[\"result\"][0].key?(\"order_id\")\n #order was not accepted by exchnage\n return false\n end\n\torder_id = r_json[\"result\"][0][\"order_id\"]\n retries = @options[:trade_retries]\n (1..retries).each do |attempt|\n if !open_orders.include?(order_id)\n return true\n end\n if attempt == retries\n cancel_order order_id\n logger.info \"failed to fill #{action} order at #{exchange}\"\n return false\n else\n logger.info \"Attempt #{attempt}/#{retries}: #{action} order #{order_id} still opening, waiting for close to\"\n sleep(1)\n end\n end\n return false\n\n\n end",
"def redeem\n #TO BE IMPLEMENTED\n end",
"def update_usage(served_quantity) \n self.used_quantity += served_quantity \n self.save \n \n self.mark_as_finished\n \n item = self.item \n item.deduct_ready_quantity(served_quantity ) \n \n return self \n end",
"def update_usage(served_quantity) \n self.used_quantity += served_quantity \n self.save \n \n self.mark_as_finished\n \n item = self.item \n item.deduct_ready_quantity(served_quantity ) \n \n return self \n end",
"def expensive?\n base_price = an_order.base_price\n base_price > 1000\nend",
"def settle_item_purchase(seller, buyer, item)\n seller.credits += item.price + Integer((item.price * SELL_BONUS).ceil)\n buyer.credits -= item.price\n end",
"def import_calc\n import = @quantity * @price * @duty\n end",
"def update_e_factor\n ef = @e_factor + (0.1 - (5 - @quality) * (0.08 + (5 - @quality) * 0.02))\n @e_factor = ef < 1.3 ? 1.3 : ef\n end",
"def update_price\n req = Vacuum.new \n req.configure(\n aws_access_key_id: ENV['ACCESS_KEY_ID'],\n aws_secret_access_key: ENV['SECRET_KEY'],\n associate_tag: ENV['ASSOCIATES_ID']\n )\n\n req.associate_tag = 'shop1410f-20'\n\n sleep(1.seconds)\n\n item_id = self.item_id\n\n params = {\n 'IdType' => 'ASIN',\n 'ItemId' => item_id,\n 'ResponseGroup' => 'Offers, Images'\n }\n \n #For Product Price \n res = req.item_lookup(params)\n\n hash = res.to_h\n self.price = hash[\"ItemLookupResponse\"][\"Items\"][\"Item\"][\"Offers\"][\"Offer\"][\"OfferListing\"][\"Price\"][\"FormattedPrice\"]\n self.save\n end",
"def buy(item)\n raise_no_money! if item.price > pending_amount\n change = calc_change(pending_amount - item.price)\n transfer_pending_to_money\n remove_from_money change\n change\n end",
"def must_buy_power?(entity)\n @round.emergency_buy ||\n (@game.must_buy_power?(entity) && entity.cash < @game.current_power_cost)\n end",
"def calc_already_paid\n wizard_step(STEPS)\n end",
"def standard_update\n lambda do\n update_sell_date\n @quality -= (@sell_in >= 0 ? 1 : 2)\n quality_limits\n end\n end",
"def audit_tirerack_prices\n Product.in_taxon('Tires').each do |tire|\n minimum = get_minimum_price(tire)\n if tire.price != minimum\n begin\n product = Product.find(tire.id)\n product.price = minimum\n product.save!\n puts \"Updated price for Tire #{tire.id}\\n\"\n rescue => error\n puts \"Could not save a change in price? #{error}\\n\"\n end\n end\n end\n end",
"def fulfill\n @order.approx_cost = (@order.approx_cost.to_f * 100.0).floor\n @order.fulfill\n render 'status'\n end",
"def test_for_cheap\r\n if @agent_bargain_limit\r\n @ischeap = true if @price < @agent_bargain_limit\r\n else\r\n @ischeap = true if @price < @cheap\r\n end\r\n end",
"def complete\n required_actions = Array.new\n\n #work out the build status for each pallet\n\n begin\n\n progress_stats = ReworksProgressManager.new(self)\n busy?(\"complete\")\n\n self.transaction do\n\n progress_stats.event_generic_action(\"determining potential qc resets from buildup actions...\")\n set_inspection_status_for_built_up_pallets\n progress_stats.event_generic_action(\"determining potential qc resets from grade reclassifications...\")\n set_inspection_status_for_grade_changes\n progress_stats.event_generic_action(nil)\n\n num_qc_resets = progress_stats.calc_pallets_qc_resets\n progress_stats.run_completion_stats.pallets_qc_resets_req = num_qc_resets\n\n self.reload #force reload of active cartons, since they were updated from underneath us by previous 2 methods\n\n\n self.rw_active_bins.each do |bin|\n if bin.reworks_action.upcase == \"RECLASSIFIED\"\n progress_stats.event_bin_reclassified\n\n original_bin = Bin.find(bin.bin_id)\n from_pack_material_product_id =original_bin.pack_material_product_id\n\n if bin.pack_material_product_id !=from_pack_material_product_id\n add_quantity_to_location(bin, original_bin, \"add_asset_quantity\")\n add_quantity_to_location(bin, original_bin, \"remove_asset_quantity\")\n end\n\n\n elsif bin.reworks_action.upcase == \"TIPPED\"\n stock_item =StockItem.find_by_inventory_reference(bin.bin_number)\n if stock_item\n Inventory.move_stock(\"REWORKS\", self.id.to_s, \"REWORKS\", [bin.bin_number])\n Inventory.remove_stock(nil, \"BIN\", \"REWORKS\", self.id.to_s, \"REWORKS\", [bin.bin_number], \"KROMCO\")\n end\n\n\n elsif bin.reworks_action.upcase == \"BULK_TIPPED\"\n stock_item =StockItem.find_by_inventory_reference(bin.bin_number)\n if stock_item\n Inventory.move_stock(\"REWORKS\", self.id.to_s, \"REWORKS\", [bin.bin_number])\n Inventory.remove_stock(nil, \"BIN\", \"REWORKS\", self.id.to_s, \"REWORKS\", [bin.bin_number], \"KROMCO\")\n end\n\n progress_stats.event_bin_tipped\n\n end\n\n\n if bin.weight_changed\n progress_stats.event_bin_reclassified\n stock_type =StockItem.find_by_inventory_reference(bin.bin_number).stock_type_code\n if stock_type == \"PRESORT\" && bin.bin.mix_ps_bin == 'MIX_PS_BIN'\n bin.set_child_weights\n end\n\n end\n\n reclassed_bin = RwReclassedBin.new\n bin.export_attributes(reclassed_bin, true)\n reclassed_bin.create\n\n bin.export_attributes(bin.bin, true)\n bin.bin.update\n\n #create integration record\n #outbox_record = NewOutboxRecord.new(\"bin_reclassified\",bin.bin)\n\n end\n\n\n self.rw_active_pallets.each do |pallet|\n set_build_status(pallet)\n if pallet.build_up_balance\n new_account = Pallet.set_account(pallet.pallet_number, true, true)\n pallet.account_code = new_account\n pallet.set_oldest_pack_date_time\n\n if pallet.carton_quantity_actual == 0 && pallet.build_up_balance < 0\n pallet.exit_ref = 'SCRAPPED_FROM_RW_BUILDUP'\n\n\n end\n\n\n end\n\n pallet.process_status = \"PALLETIZED\"\n if pallet.reworks_action.upcase == \"NEW_PALLET\" && pallet.get_carton_count > 0\n progress_stats.event_pallet_created\n new_pallet = RwPallet.new\n pallet.export_attributes(new_pallet, true, ['is_depot_pallet', 'consignment_note_number'])\n new_pallet.date_time_created = Time.now\n new_pallet.create\n #new mes pallet\n new_mes_pallet = Pallet.new\n pallet.export_attributes(new_mes_pallet, true, ['is_depot_pallet', 'consignment_note_number'])\n new_mes_pallet.rw_create_datetime = Time.now\n new_mes_pallet.create\n pallet.pallet = new_mes_pallet\n\n pallet.update\n #------------------------------------------------------------------------------------------------\n #update cartons of this pallet to have correct pallet_id- the one just created\n #cartons already have correct pallet_number (it can be created at add time), but\n #pallet_id can only be created at run_complete time, because the new pallet is only created now\n #------------------------------------------------------------------------------------------------\n pallet.rw_active_cartons.each do |ctn|\n\n ctn.pallet_id = new_mes_pallet.id\n ctn.update\n\n end\n\n #outbox_record = NewOutboxRecord.new(\"pallet_new\",new_mes_pallet)\n Inventory.create_stock(nil, \"PALLET\", nil, nil, \"REWORKS\", self.id.to_s, \"REWORKS\", [new_mes_pallet.pallet_number])\n elsif (pallet.reworks_action == \"ALT_PACKED\"||pallet.build_up_balance) && pallet.reworks_action != \"reclassified\"\n progress_stats.event_pallet_reclassified if pallet.reworks_action == \"ALT_PACKED\"\n if pallet.build_up_balance && pallet.build_up_balance != 0\n progress_stats.event_pallet_built_up\n end\n pallet.pallet.qc_status_code = pallet.qc_status_code\n pallet.pallet.qc_result_status = pallet.qc_result_status\n pallet.pallet.carton_quantity_actual = pallet.carton_quantity_actual\n pallet.pallet.cpp = pallet.cpp\n pallet.pallet.account_code = pallet.account_code\n pallet.pallet.build_status = pallet.build_status\n pallet.pallet.update\n\n #outbox_record = NewOutboxRecord.new(\"pallet_carton_count_update\",pallet.pallet)\n if pallet.reworks_action == \"ALT_PACKED\"\n progress_stats.event_pallet_reclassified\n pallet.export_attributes(pallet.pallet, true)\n pallet.pallet.update\n #outbox_record = NewOutboxRecord.new(\"pallet_update\",pallet.pallet)\n end\n elsif pallet.reworks_action == \"reclassified\"\n progress_stats.event_pallet_reclassified\n pallet.export_attributes(pallet.pallet, true, ['is_depot_pallet', 'consignment_note_number','load_detail_id','exit_ref'])\n reclassed_pallet = RwReclassedPallet.new\n pallet.export_attributes(reclassed_pallet, true, ['is_depot_pallet', 'consignment_note_number','load_detail_id','exit_ref'])\n reclassed_pallet.create\n pallet.pallet.update\n if pallet.build_up_balance && pallet.build_up_balance != 0\n progress_stats.event_pallet_built_up\n end\n #outbox_record = NewOutboxRecord.new(\"pallet_update\",pallet.pallet)\n\n end\n\n end\n\n #----------------------------------------------------------------------------------------------------------\n #pallets to delete: alt-packed and scrapped pallets- pallets that must be deleted in legacy db\n #----------------------------------------------------------------------------------------------------------\n get_all_deleted_pallets().each do |pallet|\n #create integration record TODO: UNCOMMENT THIS LINE\n progress_stats.event_pallet_scrapped\n pallet.pallet.exit_ref = \"scrapped\" #TODO: UNCOMMENT THIS LINE\n pallet.pallet.carton_quantity_actual = 0\n pallet.pallet.update\n #outbox_record = NewOutboxRecord.new(\"pallet_deleted\",pallet.pallet)\n stock_item =StockItem.find_by_inventory_reference(pallet.pallet_number)\n if stock_item\n\n\n Inventory.remove_stock(nil, \"PALLET\", \"REWORKS\", self.id.to_s, \"REWORKS\", [pallet.pallet_number])\n\n\n end\n end\n #---------------------------------------------------------------------------------------------------------------\n #Go through active cartons table: create reworks table records for alt_packed and reclassified\n #records. Records in active cartons table, that have not been reclassed, scrapped (in which case\n # they would not be in active table) or alt-packed, must be checked for pallet reference changes\n # (resulting from 'add_to_pallet' and 'remove_from_pallet' build-up actions). If pallet ref changes took\n # place, integration record must be created for it. Pallet ref changed could also have taken place on cartons\n # involved in reclassification or alt pack, but in this case the pallet ref will be updated anyway\n # as part of the normal integration transaction for such types\n #--------------------------------------------------------------------------------------------------------------\n self.rw_active_cartons.each do |carton|\n\n raise \"CARTON: #{carton.carton_number} HAS NO VALUE FOR TRACK_INDICATOR. <BR> IF YOU CHANGED THE PRODUCTION RUN, MAKE SURE THE RMT_SETUP HAS A A VALUE FOR OUT_TRACK_INDICATOR_CODE\" if !carton.track_indicator_code || carton.track_indicator_code.strip() == \"\"\n\n if carton.reworks_action.upcase == \"RECLASSIFIED\"\n\n if !carton.rw_active_pallet_id\n\n required_actions.push(carton.carton_number.to_s)\n else\n reclassed_carton = RwReclassedCarton.new\n progress_stats.event_carton_reclassified\n carton.export_attributes(reclassed_carton, true, ['is_depot_carton', 'intake_header_number'])\n reclassed_carton.date_time_created = Time.now\n reclassed_carton.production_run_id = carton.production_run_id\n reclassed_carton.create\n #update our carton\n #puts \"orig carton id: \" + carton.carton.id.to_s\n if carton.rw_pallet_action\n carton.export_attributes(carton.carton, true, ['is_depot_carton', 'intake_header_number'])\n progress_stats.event_carton_pallet_ref_changed\n else\n carton.export_attributes(carton.carton, true, ['pallet_id', 'pallet_number', 'is_depot_carton', 'intake_header_number'])\n end\n\n #puts \"RECLASSIFY: CTN NUMBER = \" + carton.carton.carton_number.to_s + \"; ID = \" + carton.carton.id.to_s + \" (this num: \" + carton.carton_number.to_s + \")\"\n carton.carton.update\n puts reclassed_carton.carton_number.to_s\n #create integration record\n #outbox_record = NewOutboxRecord.new(\"carton_reclassified\",reclassed_carton)\n end\n elsif carton.reworks_action.upcase == \"ALT_PACKED\"||carton.reworks_action.upcase == \"ALT_PACKED_FROM_CARTON\"\n if !(carton.rw_pallet_action && (carton.rw_pallet_action.upcase == \"REMOVED\"||carton.rw_pallet_action.upcase == \"PALLET_SCRAPPED\"))\n new_carton = RwCarton.new\n progress_stats.event_carton_created\n new_carton.date_time_created = Time.now\n carton.export_attributes(new_carton, true)\n new_carton.create\n\n #create new carton in our system\n new_mes_carton = Carton.new\n new_mes_carton.rw_create_datetime = Time.now\n carton.export_attributes(new_mes_carton, true)\n new_mes_carton.create\n\n #create integration record\n #outbox_record = NewOutboxRecord.new(\"rw_carton_new\",new_mes_carton)\n end\n elsif carton.rw_pallet_action && (carton.rw_pallet_action.upcase == \"ADDED\")\n #update mes record\n progress_stats.event_carton_pallet_ref_changed\n carton.carton.pallet = carton.rw_active_pallet.pallet\n carton.carton.pallet_number = carton.rw_active_pallet.pallet_number\n puts \"CARTON PALLET ACTION: CTN NUMBER = \" + carton.carton.carton_number.to_s + \"; ID = \" + carton.carton.id.to_s + \" (this num: \" + carton.carton_number.to_s + \")\"\n\n carton.carton.update\n\n #create integration record\n #outbox_record = NewOutboxRecord.new(\"carton_pallet_ref_change\",carton.carton)\n elsif carton.rw_pallet_action && (carton.rw_pallet_action.upcase == \"REMOVED\"||carton.rw_pallet_action.upcase == \"PALLET_SCRAPPED\")\n #update mes record\n integrate_scrapped_carton(carton)\n end\n end\n\n #----------------------------------------------------------------------------------------------------------\n #cartons to delete: alt-packed and scrapped cartons- cartons that must be deleted in legacy db\n #----------------------------------------------------------------------------------------------------------\n get_all_deleted_cartons().each do |carton|\n progress_stats.event_carton_scrapped\n integrate_scrapped_carton(carton)\n end\n\n get_all_deleted_rebins().each do |rebin|\n progress_stats.event_bin_scrapped\n rebin.bin.exit_ref = \"scrapped\"\n rebin.bin.exit_reference_date_time= Time.now\n rebin.bin.update\n stock_item =StockItem.find_by_inventory_reference(rebin.bin_number)\n if stock_item\n\n Inventory.move_stock(\"REWORKS\", self.id.to_s, \"REWORKS\", [rebin.bin_number])\n Inventory.remove_stock(nil, \"BIN\", \"REWORKS\", self.id.to_s, \"REWORKS\", [rebin.bin_number], \"KROMCO\")\n\n end\n end\n\n #---------------------------------------------------------------------------\n #Get a list of all pallets where qc_status_code = 'UNINSPECTED'\n #If it's not a new pallet, create a ppecb_inspection_reset integration flow +\n #Create a new ppecb_inspection record, copy of most recent for pallet and\n #set it's cancelled field value to true + date_time_cancelled\n #----------------------------------------------------------------------------\n reset_pallets = RwActivePallet.find_by_sql(\"select * from rw_active_pallets where rw_run_id = #{self.id.to_s} and UPPER(qc_status_code) = 'UNINSPECTED' AND upper(reworks_action) <> 'NEW_PALLET' AND upper(reworks_action) <> 'ALT_PACKED'\")\n reset_pallets.each do |reset_pallet|\n progress_stats.event_pallet_qc_reset\n #NewOutboxRecord.new(\"pallet_qc_reset\",reset_pallet)\n if reset_pallet.carton_quantity_actual > 0\n last_inspection = PpecbInspection.most_recent_inspection?(reset_pallet.rw_active_cartons[0].carton_number)\n if last_inspection\n new_inspection = PpecbInspection.new\n last_inspection.export_attributes(new_inspection, true)\n new_inspection.cancelled_inspection_id = last_inspection.id\n new_inspection.cancelled = true\n new_inspection.create\n end\n end\n end\n\n update_cartons_pallets #that is: of pallets that were not recieved explicitly\n update_scrapped_cartons_pallets\n\n\n self.rw_active_pallets.reload\n\n if self.rw_active_pallets && self.rw_active_pallets.length > 0\n pallet_numbers_order_upgrade=self.rw_active_pallets.map{|p|p.pallet_number}\n end\n\n #update the pallets of cartons that were received as cartons (i.e without pallets) and reclassed\n\n\n self.rw_active_cartons.delete_all\n self.rw_active_pallets.delete_all\n self.rw_run_end_datetime = Time.now\n self.rw_run_status_code = \"complete\"\n self.rw_active_bins.delete_all\n\n\n archive_receipt_objects\n\n self.update\n\n if required_actions.length > 0\n raise \"Some cartons do not have a pallet id. You must scrap these cartons or add them to a pallet to complete the run. They are: <br>\" + required_actions.join(\"<BR>\")\n end\n\n if pallet_numbers_order_upgrade\n Order.get_and_upgrade_prelim_orders(pallet_numbers_order_upgrade)\n end\n end\n rescue\n puts $!.backtrace.join(\"\\n\").to_s\n #RAILS_DEFAULT_LOGGER.info (\"REWORKS COMPLETION ERROR: \" + $!.backtrace.join(\"\\n\").to_s)\n err = $!.message\n err = \"exception occurred.See error log for details\" if !err\n progress_stats.run_completion_stats.error = err\n progress_stats.reset_stats\n raise \"Complete run failed: <BR>\" + $!\n\n ensure\n progress_stats.run_completion_stats.done = true\n progress_stats.run_completion_stats.persist\n progress_stats = nil\n done\n end\n\n end",
"def new_sale_price \n noi(num_years_to_hold + 1) / cap_rate(num_years_to_hold + 1)\n end",
"def full_price\n\t\t\t\t@aftertax = @baseprice * @taxrate\n\t\tend",
"def market_value\n mp = self.clearing_price\n mp * self.open_volume * self.instrument_multiplier * self.instrument_currency_exchange_rate\n end",
"def despacharFtp(sku,cant,to,oc)\n price = Product.where(sku: sku).first.price\n transfered = 0\n #do while products have to be dispatched\n while transfered < cant do\n resp = Fetcher.Bodegas(\"GET\"+DESPACHO+sku.to_s,\"stock?almacenId=\"+DESPACHO+\"&sku=\"+sku.to_s)\n puts resp\n count = 0\n for prod in resp do\n if count == 89 && transfered < cant then\n sleep(60)\n count = 0\n end\n if transfered < cant then\n id_aux = prod['_id']\n dispatchStockFTP(id_aux,oc,to,price)\n count+=1\n transfered+=1\n else\n return 0\n end\n end\n end\n #restar stock\n a = Product.where(sku:sku.to_i).first\n a.stock -= cant\n a.save\n end",
"def apply_clearance(cart)\n cart.each do |product_name, stats|\n stats[:price]-= stats[:price] * 0.2 if stats[:clearance]\n end\ncart\nend",
"def get_ex_taxes_price(ex_gst_price, wet_percentage)\n\t\treturn ex_gst_price/(1 + (wet_percentage/100))\n\tend",
"def modify_price\n log_action \"Modifying price for actions\"\n redraw_all_order_items = self.modify_price_for_actions\n log_action \"Modifying price for gs1\"\n self.modify_price_for_gs1\n if self.is_buyback\n log_action \"modify_price_for_buyback\"\n self.modify_price_for_buyback \n end\n self.modify_price_for_parts\n if self.behavior == 'gift_card'\n log_action \"modify_price_for_giftcards\"\n self.modify_price_for_giftcards \n end\n self.save!\n return redraw_all_order_items\n end",
"def needed_amount_less_savings\n recommended_min_portfolio - portfolio_after_growth\n end",
"def pri_tclear\n team_stats.offensive_clear_rate\n end",
"def exec_orders(lower, higher)\n\n # get the target price\n\n target = get_target\n\n unless target\n return \"program exited\"\n end\n\n #set the order hash\n order = {\n \"account\" => @account,\n \"venue\" => @venue,\n \"symbol\" => @stock,\n \"price\" => target,\n \"direction\" => \"buy\",\n \"orderType\" => \"limit\"\n }\n\n\n # place orders until the target quantity is reached\n while (quantity ||= 1) < 100000\n\n # generate a random quantity for the order\n order[\"qty\"] = rand(lower..higher)\n\n #execute the order\n response = HTTParty.post(\"#{@@base_url}/venues/#{@venue}/stocks/#{@stock}/orders\",\n :body => JSON.dump(order),\n :headers => {\"X-Starfighter-Authorization\" => @apikey}\n )\n\n # check that the order has been submited correctly\n case response.code\n\n # order has been placed\n when 200\n\n\n # get the status of the order\n id = response.parsed_response[\"id\"]\n\n response = HTTParty.get(\"#{@@base_url}/venues/#{@venue}/stocks/#{@stock}/orders/#{id}\",\n :headers => {\"X-Starfighter-Authorization\" => @apikey})\n\n status = response.parsed_response[\"open\"]\n\n # check the status of the order 3 times, if it's still open after 3 times\n # close the order and accept the partial fill\n while status\n\n count ||= 0\n\n response = HTTParty.get(\"#{@@base_url}/venues/#{@venue}/stocks/#{@stock}/orders/#{id}\",\n :headers => {\"X-Starfighter-Authorization\" => @apikey})\n\n status = response.parsed_response[\"open\"]\n\n puts \"The order #{id} is still open\"\n\n count += 1\n #order has been checked 3 times\n if count.equal?(3)\n # close the order\n response = HTTParty.delete(\"#{@@base_url}/venues/#{@venue}/stocks/#{@stock}/orders/#{id}\",\n :headers => {\"X-Starfighter-Authorization\" => @apikey})\n\n count = 0\n\n break\n\n end\n\n end\n\n puts \"The order #{id} is closed\"\n\n #update the quantity\n quantity += response.parsed_response[\"totalFilled\"].to_i\n\n puts \"Total quantity: #{quantity}\"\n\n\n\n\n # Order has not been placed\n else\n\n puts response\n\n end\n\n end\n\n puts \"#{quantity} stocks has been ordered\"\n\n end",
"def how_high(energy)\n energy * energy\nend",
"def update_discounted_price\n self.price = product.price * (100-discount)/100 \n end",
"def saving(point)\n (point.price * volume) - (price * volume)\n end",
"def electricity_losses_if_export_is_zero\n transformer_demand = graph.node(:energy_power_transformer_mv_hv_electricity).demand\n own_use_of_sector = energy_sector_own_use_electricity\n node = graph.node(:energy_power_hv_network_electricity)\n conversion_loss = node.output(:loss).conversion\n conversion_electricity = node.output(:electricity).conversion\n\n return 0.0 if conversion_electricity.zero?\n\n (transformer_demand + own_use_of_sector) * conversion_loss / conversion_electricity\n end",
"def ext_effective_price\n (effective_list_price || 0) * (qty || 0)\n end",
"def estimate_crypto_profit\n quantity - close_positions.sum(:quantity)\n end",
"def required_gold(equip)\n equip.price / 4\n end",
"def fuel_up()\n\t\tgallons_needed = 10.0 - @fuel\n\t\tputs \"You must pay $#{3.5 * gallons_needed}\"\n\t\t@fuel = 10.0\n\tend"
] |
[
"0.64981633",
"0.6068097",
"0.605936",
"0.60275126",
"0.5988859",
"0.5985206",
"0.59287745",
"0.5924918",
"0.58365464",
"0.5817814",
"0.5817453",
"0.58029604",
"0.5802052",
"0.5799018",
"0.57708746",
"0.57540154",
"0.5698585",
"0.5698585",
"0.5690677",
"0.5665625",
"0.5659567",
"0.56260544",
"0.56256413",
"0.5620417",
"0.5613465",
"0.56057763",
"0.5601475",
"0.5597294",
"0.5592246",
"0.5590939",
"0.55852973",
"0.55708003",
"0.5560523",
"0.55599195",
"0.5556651",
"0.55565006",
"0.55392945",
"0.5533114",
"0.55323035",
"0.55265987",
"0.5524903",
"0.5519555",
"0.5499975",
"0.5497941",
"0.5494007",
"0.5490951",
"0.5490714",
"0.54846644",
"0.5483294",
"0.54823524",
"0.54823524",
"0.54823524",
"0.54823524",
"0.54823524",
"0.5474532",
"0.5461297",
"0.544282",
"0.5439135",
"0.54201365",
"0.5411997",
"0.5379207",
"0.5376806",
"0.5367046",
"0.5365264",
"0.536327",
"0.5357175",
"0.53560835",
"0.53459996",
"0.53459996",
"0.5342699",
"0.53401047",
"0.5322425",
"0.5320673",
"0.53128713",
"0.5312575",
"0.53109944",
"0.53068924",
"0.53050023",
"0.5304565",
"0.53006786",
"0.5298717",
"0.52985543",
"0.5296512",
"0.5295396",
"0.5288936",
"0.5286336",
"0.5284494",
"0.528016",
"0.5280036",
"0.52762187",
"0.5273665",
"0.52710134",
"0.5269002",
"0.5265083",
"0.52637464",
"0.52569777",
"0.5253664",
"0.5236098",
"0.52299917",
"0.5229031"
] |
0.5480755
|
54
|
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2digit numbers is 9009 = 91 99. Find the largest palindrome made from the product of two 3digit numbers.
|
def solve( n = 3 )
min = 10**(n - 1)
max = (10 * min) - 1
max.downto( min ).each do |i|
# Create the next palindromic number.
p = (i.to_s + i.to_s.reverse).to_i
# Factors must be min <= f <= sqrt(p). The quotient of p and f <= max.
# Find the first number with a factor satisfying these constraints.
a = Math.sqrt( p ).to_i.downto( min ).select {|f| max >= p / f && 0 == p % f}
return p if 0 < a.length #puts "%d x %d = %d" % [a[0], p / a[0], p]
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def problem_4\n num1 = 999\n largest_pal = 0\n\n while num1 > 99\n num2 = num1 - 1\n while num2 > 99\n product = num1 * num2\n if is_palindrome?(product) && product > largest_pal\n largest_pal = product\n end\n num2 -= 1\n end\n num1 -= 1\n end\n\n return largest_pal\nend",
"def largest_palindrome_product\n # palindromes = palindromes.reverse\n integer = 999\n n = 0\n while palindromes.reverse[n] % integer != 0\n while palindromes.reverse[n] % integer != 0 && integer > 99\n integer -= 1 \n end\n n += 1\n end\n palindromes.reverse[n]\nend",
"def pal_num(num)\n largest_palindrome = 0\n num_one = num\n num_two = num\n while num_two > 0\n while num_one > 0\n if (num_one * num_two == (num_one * num_two).to_s.reverse.to_i) && (num_one * num_two > largest_palindrome)\n largest_palindrome = num_one * num_two\n end\n num_one -= 1\n end\n num_one = num\n num_two -= 1\n end\n p largest_palindrome\nend",
"def largest_palindrome(num_of_digits)\r\n\tmax_number_string = \"\"\r\n\tnum_of_digits.times { max_number_string += \"9\"}\r\n\tmax_product = max_number_string.to_i ** 2\t\t# e.g: 999* 999 = 998001\r\n\t\r\n\tsub_string = (max_product.to_s)[0..(max_product.to_s).length/2 - 1]\r\n\tsub_string_number = sub_string.to_i \r\n\t\r\n\tdelta = 1\r\n\tdelta.upto(sub_string_number) { |x|\r\n\t\tpalindrome = ((sub_string_number - x).to_s + (sub_string_number - x).to_s.reverse).to_i\r\n\t\t\r\n\t\tfactor = sub_string_number\r\n\t\tfactor.downto(10**(num_of_digits - 1)) { |div|\r\n\t\t\treturn div, (palindrome/div) if (palindrome % div == 0) and (palindrome/div).to_s.length == num_of_digits\r\n\t\t}\r\n\t}\r\nend",
"def largest_palindrome_product\n palindromes = []\n\n 999.downto(100) do |x|\n 999.downto(100).each do |y|\n if (x * y).to_s == (x * y).to_s.reverse\n palindromes << x * y\n end\n end\n end\n palindromes.max\nend",
"def getLargestPalindrome()\n\tlargestPalindrome = 1\n\tx = 1\n\twhile x <= 999\n\t\ty = 1\n\t\twhile y <= 999\n\t\t\tproduct = x * y\n\t\t\tif product.to_s == product.to_s.reverse!\n\t\t\t\tlargestPalindrome = product\n\t\t\tend\n\t\t\ty = y + 1\n\t\tend\n\t\tx = x + 1\n\tend\n\treturn largestPalindrome\nend",
"def p004(number_of_digits = 3)\n # Method without lots of stored results:\n # 1. Find the largest product of two X-digit numbers, i.e. 999 * 999\n # 2. Iterate through palindromes in descending order\n # 3. If a palindrome is the product of two X-digit numbers then return it\n #\n # Notes:\n # - This does not currently support palindromic numbers with an odd number of digits\n # - To figure out if a number is the product of two X-digit numbers, an iterative bounding method makes sense\n current_palindrome = Palindrome.round_down(largest(number_of_digits)**2)\n smallest_palindrome = Palindrome.round_up(smallest(number_of_digits)**2)\n\n while current_palindrome >= smallest_palindrome\n # Is there an X-digit divisor with no remainder and X-digit result?\n divisor_pair = find_divisor(current_palindrome, number_of_digits)\n return current_palindrome.to_i if divisor_pair\n\n # There isn't, let's try the next palindrome down\n current_palindrome.decrement!\n end\nend",
"def largest_palindrome_product\n palindromes = []\n for i in (900..999) do\n for j in (900..999) do\n palindromes << i*j if ((i*j).to_s == (i*j).to_s.reverse)\n end\n end\n palindromes.max\nend",
"def four \n max = 0\n for i in 100..999\n for j in 100..999\n if isPalindrome?(x = i*j)\n if x > max\n max = x\n end\n end\n end\n end\n return max\nend",
"def largest_palindrome_product\n largest_palindrome = 0\n\n 999.downto(100) do |i|\n i.downto(100) do |j|\n result = i * j\n largest_palindrome = result if result > largest_palindrome && result.to_s == result.to_s.reverse\n break if result <= largest_palindrome\n end\n end\n largest_palindrome\nend",
"def largestPalindromicNumber(n_digits)\n # palindromes = []\n startPoint = (10**n_digits-1)**2\n endPoint = (10**(n_digits-1))**2\n i = startPoint\n while i >= endPoint do\n if isAPalindrome(i) && isNumAProductOfTwoNDigitNumbers(i, n_digits)\n puts i\n return i\n end\n i -= 1\n end\n p 'no product/palindromes found'\nend",
"def pallindromic(digits)\n\n\tarray1 = []\n\tarray2 = [] \n\txout = []\n\tyout = []\n\touts =[]\n\tresult = percentage = number_of_digits = 0\n\n\tnumber_of_digits = Math.log10(digits).to_i + 1 \t\n dlength = (10**digits.to_s.length)-1 \n\tpercentage = (0.85*dlength).to_i\n\t\n\tarray1 =* (percentage..dlength)\n\tarray2 = array1\n\tarray1.each do |x|\n\t\tarray2.each do |y|\n\t\t\t test = x*y\n\t\t\t if test.to_s === test.to_s.reverse\n\t\t\t outs << test\n\t\t\t xout << x\n\t\t\t yout << y\n\t\t\t end\n\t\tend\n\tend\n \t\n puts \"The largest palindrome made from the product of two #{number_of_digits}-digit numbers is #{outs.last.to_s} = #{xout[-1]} x #{yout[-1]}\" \nend",
"def largest_palindrome(digits)\n\tnumbers = []\n\tx = (\"9\"*digits).to_i\n\ty = (\"9\"*digits).to_i\n\tlimit = ((\"9\"*(digits-1)).to_i)\n\twhile x > limit\n\t\ty.downto(limit+1) do |i|\n\t\t\tx*i == (x*i).to_s.reverse.to_i ? numbers << x*i : \"\"\n\t\tend\n\t\tx -= 1\n\tend\n\treturn numbers.sort.last\nend",
"def largest_palindrome_product\n 998001.downto(10000) do |num|\n (return num) if (is_palindrome?(num) && !Prime.prime?(num))\n end\n nil\nend",
"def doAction\n largest = 0\n for value1 in 100..999\n for value2 in 100..999\n product = value1 * value2\n if (palindrome?(product))\n print(\"#{ value1 } * #{ value2 } is #{ product }\\n\")\n if (product > largest)\n largest = product\n end\n end\n end\n end\n print(\"The largest palindrome made from multiplying two 3-digit numbers was #{ largest }\\n\")\nend",
"def largest_palindrome_for_even_digits(n)\n max_val = 0\n multiplier_x = get_multiplier_x(n)\n n.downto(100) { |y|\n multiplier_x.each { |x|\n product = x * y\n if product.to_s == product.to_s.reverse\n max_val = [max_val, product].max\n end\n }\n }\n max_val\nend",
"def max_palidrome_product(min, max)\r\n lrg_pal = 0\r\n max.downto(min) do |i|\r\n i.downto(min) do |j|\r\n product = i * j\r\n if product > lrg_pal && product.to_s == product.to_s.reverse #it's a palindrome\r\n # puts \"i = #{i}\"\r\n # puts \"j = #{j}\"\r\n lrg_pal = product\r\n end\r\n end\r\n end\r\n lrg_pal\r\nend",
"def problem_four\n max = 0\n\n 100.upto(999).each do |a|\n a.upto(999).each do |b|\n max = a * b if palindrome?(a * b) && (a * b) > max\n end\n end\n\n max\n end",
"def largest_palindrome_product(max_factor, min_factor)\n max_num = max_factor ** 2\n min_num = min_factor ** 2\n max_num.downto(min_num) do |num|\n if is_palindrome?(num) && has_three_digit_factors?(num, min_factor, max_factor)\n puts \"FOUND ONE!\"\n puts num\n return num\n end\n end\nend",
"def solution4\n palindrome = 1000\n (900..999).each do |num1| # checks between 900-999, likely solutions are probably here\n (900..999).each do |num2|\n product = num1 * num2\n palindrome = product if palindrome?(product) && product > palindrome\n end\n end\n palindrome\nend",
"def largest_palindrome_product\n start = Time.now\n palindromes = []\n 999.downto(900) do |i|\n 999.downto(i) do |j|\n n = i * j \n palindromes << n if palindrome?(n)\n end\n end\n finish = Time.now\n \"largest palindrom is: #{palindromes.max}, calculated in #{(finish - start) * 1000 } ms.\"\nend",
"def get_input\n print \"Program to find largest palindrome product of two numbers in the same digits range. \\n\" \n print \"See http://projecteuler.net/problem=4 for complete problem statement. \\n\"\n print \"Largest palindrome number of x digit numbers: \"\n digits = gets.to_i\nend",
"def three_figure_palindrome\n # Two iterators that will increment with each iteration\n # One for the left hand side of the equation, and one for the right\n 100.upto(999) do |left_side|\n 100.upto(999) do |right_side|\n \n # Find the product of all three digit numbers and store in variable\n possible_palindrome = left_side * right_side\n\n # Checks to see if the product of the two numbers is a palindrome or not\n if (is_palindrome? possible_palindrome) && (possible_palindrome > @max)\n # Stores the current highest valued palindrome in the instance variable\n @max = possible_palindrome\n end\n end\n end\n # Returns the instance variable as the result of the method\n @max\n end",
"def palindromes\n max, min = (@max_factor**2).to_s, min = @min_factor.to_s\n result = (min..max).select { |elm| elm == elm.reverse }\n result.map { |num| num.to_i }\n end",
"def palindrome(maxnum, minnum)\n\n for i in (maxnum*maxnum).downto(minnum*minnum)\n if i.to_s == i.to_s.reverse\n divisor = maxnum\n while (i / divisor <= maxnum)\n if i % divisor == 0\n return \"Palindrome is #{i}, and is the product of #{divisor} * #{i / divisor}\"\n else\n divisor -= 1\n end\n end\n end\n end\n \nend",
"def GetLargestPalindromic\r\n @product = 0\r\n \r\n @size.downto(1) { |i|\r\n @size.downto(1) { |j|\r\n @product = i * j\r\n \r\n if IsPalindromic(@product)\r\n puts \"Largest Palindromic = #{@product}\"\r\n return\r\n end\r\n }\r\n }\r\n\r\n puts \"Largest Palindromicaa = #{@product}\"\r\n end",
"def pals\n sum = 0\n\n 1.upto(1000000) do |num|\n n_array = num.to_s.split(\"\")\n \n next unless n_array == n_array.reverse\n\n b_array = num.to_s(2).split(\"\")\n\n next unless b_array == b_array.reverse\n\n puts \"#{num} is double base palindrome\"\n\n sum += num\n end\n sum\nend",
"def largest_palindrome_product(n) \r\n array = []\r\n beginning = (\"1\" + (\"0\" * (n - 1))).to_i\r\n ending = (\"9\" + (\"9\" * (n - 1))).to_i\r\n x = (beginning..ending).to_a\r\n y = (beginning..ending).to_a\r\n x.each do |num1|\r\n y.each do |num2|\r\n product = num1 * num2\r\n if product.to_s == product.to_s.reverse \r\n array << product\r\n end \r\n end \r\n end \r\n array.sort.last\r\nend",
"def compute\n ans = 0 \n for a in 100..999\n for b in 100..999\n ab = a * b \n ans = ab if palindrome? ab and ab > ans \n end\n end\n ans\nend",
"def palindrome_product\n\tpalindrome_array = []\n\tfirst = 1\n\twhile first <= 999\n\t\tsecond = 1 \n\t\twhile second <= 999\n\t\t\tpalindrome = first * second\n\t\t\tif palindrome.to_s == palindrome.to_s.reverse\n\t\t\t\tpalindrome_array << palindrome\n\t\t\tend\n\t\t\tsecond+=1\n\t\tend\n\t\tfirst+=1\n\tend\n\tp palindrome_array.sort.last\nend",
"def p4\n\tarray = (800..999).to_a\n\tarray = array.map{|x| array.map{|y| x * y}}.flatten.uniq\n\tarray = array.select{|x| palindrome?(x)}\n\tarray.max\nend",
"def get_highest_palindrome(high, low)\n highest = 0\n high.downto low do |i|\n high.downto low do |j|\n product = i * j\n # No point searching when the result is less than the current winner\n break if product <= highest\n highest = product if product.to_s == product.to_s.reverse\n end\n end\n highest\nend",
"def largest_palindrome(string)\n palindromes(string).max {|a, b| a.size <=> b.size }\nend",
"def palindromic_number?(num)\n num.to_s.chars.join(\"\").reverse.to_i == num\nend",
"def longest_palindrome(s)\n max = \"\"\n 0.upto(s.size - 1).each { |i|\n odd = palindrome(s, i, i)\n even = palindrome(s, i, i + 1)\n \n return s if odd.size == s.size || even.size == s.size\n max = odd if odd.size > max.size\n max = even if even.size > max.size\n }\n\n max \nend",
"def recursive_palindrome(num1,num2=num1)\n product = num1 * num2\n return product if product.to_s == product.to_s.reverse\n if num2 > 900\n num2 -= 1\n else\n num1 -= 1\n num2 = num1 # avoids multiplying same numbers again\n end\n recursive_palindrome(num1, num2)\nend",
"def largest_palidrome_product(size)\n\traise \"Size must be greater that zero\" if size < 1\n\tpalindrome_product = 0;\n\tupper_limit_arry = Array.new(size, 10)\n\tlower_limit_arry = Array.new(size-1 , 10)\n\tupper_limit = upper_limit_arry.inject(:*) - 1\n\tlower_limit = lower_limit_arry.inject(:*)\n\tupper_limit.downto(lower_limit).each do | num |\n\t\tnum.downto(lower_limit).each do | x |\n\t\tpalindrome_product = x * num if is_palindrome?(x * num) && palindrome_product < x * num\n\t\tend\n\tend\n\tpalindrome_product\nend",
"def find_highest_drome_mapping\n low = 100\n high = 999\n dromes = high.downto(low).map do |num_one|\n num_one.downto(low).map do |num_two|\n num_one * num_two if (num_one * num_two).to_s == (num_one * num_two).to_s.reverse\n end\n end\n dromes.flatten.compact.max\nend",
"def palindromic(num)\n # lazy = (1..Float::INFINITY).lazy.select(&:odd?).drop(10).take_while\n # { |i| i < (Float::INFINITY) }\n Prime.lazy.select { |a| a.to_s == a.to_s.reverse }.first(num)\nend",
"def palindromic_number?(num)\n num == num.to_s.reverse.to_i\nend",
"def palindromic_number?(num)\n num == num.to_s.reverse.to_i\nend",
"def palindromic_number?(number)\n number.to_s.reverse.to_i\nend",
"def palindromic?(number)\n num = number.to_s.split('')\n (1..(num.size/2)).all? do |index|\n num[index-1] == num[index*(-1)]\n end\nend",
"def double_base(max)\n (1..max).select{|num| is_palindrome?(num)}.reduce(:+)\nend",
"def palindromic_number?(num)\n num.to_s == num.to_s.reverse\nend",
"def palindromic_number?(num)\n num.to_s == num.to_s.reverse\nend",
"def palindromic_number?(num)\n num.to_s == num.to_s.reverse\nend",
"def is_palindrome(num)\n if num.to_s.size % 2 == 0 #A palindrome must be made up of at least 2 digits\n split1 = num.to_s\n split1 = split1[0..(((split1.size)/2)-1)] #the first half of the string\n split2 = num.to_s\n split2 = split2[((split2.size)/2)..split2.size] #the second half of the string\n split2 = split2.reverse\n if split1 == split2\n #print \"*** \",num,\" is a palindrome! ***\\n\"\n #print \"product: \",num,\"\\n\"\n #print \"split 1: \",split1,\"\\n\"\n #print \"split 2: \",split2.reverse,\"\\n\"\n #print \"a is: \",(@max-@iter1),\"\\n\"\n #print \"b is: \",(@max-@iter2),\"\\n\"\n if num.to_s.size == 6\n @palindromes << num\n #p @palindromes\n end\n else\n #print num,\" is not a palindrome!\\n\"\n end\n end\nend",
"def palindromic_number?(number)\n index = -1\n rev_array = Array.new(\"#{number}\".length)\n \"#{number}\".chars.each do |char|\n rev_array[index] = char.to_i\n index -= 1\n end\n number == rev_array.join.to_i\nend",
"def palindromic_number?(n)\n n.to_s == n.to_s.reverse\nend",
"def palindromic_number?(num)\n\tstr = num.to_s\n\n\tnum == str.reverse.to_i\nend",
"def longest_palindrom(str)\n return str if str.length <= 1\n\n result = ''\n (0...str.length - 1).each do |i|\n ((i + 1)...str.length).each do |j|\n substr = str[i, j]\n result = substr if is_palindrom?(substr) && (result.length < substr.length)\n end\n end\n result\nend",
"def palindromic_number?(num)\n string = num.to_s\n string == string.reverse\nend",
"def is_palindrome?(num)\n\tdigit_array = num.to_s.chars.map(&:to_i)\n\tlength = digit_array.length\n\teach_half = digit_array.each_slice(length/2).map(&:to_a)\n\treturn each_half[0] == each_half[1].reverse\nend",
"def palindromic(num) \n if num.to_s.split(\"\") == num.to_s.split(\"\").reverse\n true \n else \n false \n end \nend",
"def palindromic_number?(num)\n palindrome?(num.to_s)\nend",
"def palindromic_number?(integer)\n integer.to_s == integer.to_s.reverse!\nend",
"def longest_palindrome(s)\n result = ''\n \n for i in (0..s.length-1) do\n for j in (i..s.length-1) do \n result = s[i..j] if s[i..j].length > result.length && s[i..j] == s[i..j].reverse\n end\n end\n \n result\nend",
"def longest_palindrome(string)\n string.length.downto(3) do |length|\n string.chars.each_cons(length) do |substr_arr|\n return substr_arr.length if palindrome?(substr_arr.join)\n end\n end\n false\nend",
"def is_palindrome(number)\n return false if number == nil || number < 0\n\n k = 0\n clone_number = number\n\n until clone_number == 0\n clone_number /= 10\n k += 1\n end\n\n return true if k == 1\n\n i = 1\n\n until i > k / 2\n a = number % 10 ** (k + 1 - i) / 10 ** (k - i)\n b = (number / 10 ** (i - 1)) % 10\n return false if a != b\n i += 1\n end\n\n return true\nend",
"def largest_palindrome value\n array = generate_multi_array value\n select_palindromic array\nend",
"def testRange(num, highestPal)\n #Since it's only the LARGEST palindrome, any numbers which would give a product less\n #than the current highest palindrome doesn't need to be tested\n minRange=highestPal/num\n if minRange>999\n return 0\n end\n #Question specifically asks about multiplying 3 digit numbers. If it's less than 3 digist,\n #then fix that.\n if minRange<100\n minRange=100\n end\n #Goes from highest to lowest, so the first palindrome found will always be the highest.\n (num-1).downto(minRange){ |i|\n if palTest(i*num)\n return i*num\n end\n }\n #If nothing is found, return a 0 by default.\n return 0\nend",
"def is_palindrome? number\n num_string = number.to_s\n counter = num_string.length / 2\n\n palindromic = true\n counter.times {|n| palindromic &&= ( num_string[n] == num_string[-n-1])}\n\n palindromic\nend",
"def longest_palindrome(str)\r\n pal = \"\"\r\n (0..str.size).each do |x|\r\n i = 1\r\n while (i < (str.size-x)) do\r\n\t if str[x,i].reverse == str[x,i]\r\n\t pal = str[x,i] if pal.size < str[x,i].size\r\n\t end\r\n\t i+= 1\r\n\tend\r\n end\r\n pal\r\nend",
"def palindromic_number?(number)\n palindrome?(number.to_s)\nend",
"def palindromic?(number)\n number.to_s == number.to_s.reverse\nend",
"def palindromic_number?(num)\n num.to_s \nend",
"def palindromic_number?(integer)\n integer.to_s == integer.to_s.reverse\nend",
"def palindromic_number?(int)\r\n int.to_s == int.to_s.reverse\r\nend",
"def palindromic_number?(int)\n int.to_s == int.to_s.reverse\nend",
"def check_palindrome(num)\n\tstring = num.to_s\n\tlength = string.length\n\tlast = length-1\n\tfirst = 0\n\tbegin\n\t\tis_palindrome = (string[first].to_i == string[last].to_i)\n\t\tbreak if !is_palindrome\n\t\tfirst += 1\n\t\tlast -=1\n\tend while first <= last\n\treturn is_palindrome\nend",
"def is_palindrome(number)\n return false if !number || number < 0\n length = 1\n until number / (10 ** length) == 0\n length += 1\n end\n (length / 2).times do |i|\n return false if (number / (10 ** (length - i - 1))) % 10 != (number % (10 ** (i + 1))) / (10 ** i)\n end\n return true\nend",
"def palindromic_number?(num)\n num = num.to_s\n num == num.reverse\nend",
"def palindromic?(number)\n if number.to_s == number.to_s.reverse\n return true\n end\nend",
"def longestPalSubstr(str)\n maxLength = 1\n start = 0\n length = str.size\n low = 0\n high = 0\n \n # One by one consider every character as center point of \n # even and length palindromes\n for i in 1..length\n # Find the longest even length palindrome with center\n # points as i-1 and i.\n low = i - 1\n high = i\n while (low >= 0) and (high < length) and (str[low] == str[high]) do\n if high - low + 1 > maxLength then\n start = low\n maxLength = high - low + 1\n end\n low -= 1\n high += 1\n end\n \n # Find the longest odd length palindrome with center \n # point as i\n low = i - 1\n high = i + 1\n while (low >= 0) and (high < length) and (str[low] == str[high]) do\n if (high - low + 1) > maxLength then\n start = low\n maxLength = high - low + 1\n end\n low -= 1\n high += 1\n end\n end\n \n # puts \"Longest palindrome substring is: start: #{start} maxLength: #{maxLength}\"\n # puts str[start, maxLength]\n \n return str[start, maxLength]\n end",
"def palindromic_number?(int)\n string_num = int.abs.to_s\n string_num == string_num.reverse\nend",
"def palindrome(num)\n return \"Not valid\" if num.is_a?(String) || num < 0\n return \"Not valid\" if num.is_a?(Float)\n\tarr = []\n \tnum.to_s.chars.each_index do |current_idx|\n \tnum.to_s.chars.each_index do |following_idx|\n \t\tnext if current_idx == following_idx\n \t\tarr << num.to_s[current_idx..following_idx]\n \tend\n \tend\n arr.reject(&:empty?).select { |num| num if (num == num.reverse) && (num.length != 1) }.length >= 1\nend",
"def longest_palindrome(string)\n largest = ''\n (0...string.length).each do |i|\n (i + 1...string.length).each do |j|\n sub_str = string[i..j]\n if sub_str == sub_str.reverse\n if sub_str.length > largest.length\n largest = sub_str\n end\n end\n end\n end \n largest\nend",
"def palindromic_number?(integer)\n digits = integer.to_s\n digits == digits.reverse\nend",
"def palindrome?(number)\n number_array = number.abs.to_s.split(\"\")\n index = number_array.size-1\n (0..number_array.size/2).each do |index|\n if number_array.at(index) != number_array.at(number_array.size-(index+1))\n return false\n end\n end\n return true\nend",
"def palindrome?\n n = self\n\n digit_array = n.to_s.each_char.map(&:to_i)\n digit_array.shift if n < 0\n\n start_index = 0\n end_index = digit_array.length - 1\n\n palindrome = true\n loop do\n break if end_index < start_index\n\n if digit_array[start_index] == digit_array[end_index]\n start_index += 1\n end_index -= 1\n\n break if end_index == start_index\n else\n palindrome = false\n break\n end\n end\n\n return palindrome\n end",
"def palindrome(num, s)\n return 'Not valid' if num.class == String || s.class == String || num < 0 || s < 0\n result = []\n until result.length == s\n result << num if num == num.to_s.reverse.to_i && num > 9\n num += 1\n end\n result\nend",
"def palindromic_number?(int)\n arr = int.to_s\n if arr == arr.reverse\n p true\n else\n p false\n end\n\nend",
"def palindromic_number?(num)\n # my_list = num.digits\n # array_palindrome?(my_list)\n my_list = num.to_s\n palindrome?(my_list)\nend",
"def shortest_palindrome_3(s)\n idx = 0\n front = 0\n back = 0\n pow = 1\n (0...s.size).each { |i|\n dijit = s[i].ord - 'a'.ord\n front = front * 27 + dijit\n back = back + dijit * pow\n pow *= 27\n idx = [idx, i].max if front == back\n }\n\n (s[idx + 1..-1] || \"\").reverse + s\nend",
"def palindromic_number?(int)\n str = int.to_s\n str == str.reverse\nend",
"def first_million\r\n\tpalindromes = []\r\n\t(1..999999).each do |x|\r\n\t\trev = x.to_s.reverse\r\n\t\tif x.to_s == rev\r\n\t\t\tpalindromes << x\r\n\t\tend\r\n\tend\r\n\tpalindromes\r\nend",
"def palindromic_number?(integer)\n string = integer.to_s\n string == string.reverse\nend",
"def longest_palindrome(string)\n\n palindromes = []\n\n (0...string.length).each do |i|\n (i+1...string.length).each do |j|\n sub = string[i..j]\n palindromes << sub if sub == sub.reverse\n end\n end\n\n palindromes.sort_by(&:length).last \n\nend",
"def is_palindrome_num(x)\n return false if x < 0\n return true if x == 0\n\n digits = (Math.log(x) / Math.log(10)).floor + 1\n\n (digits / 2).times do |i|\n return false unless (x % 10) == x / (10 ** (digits - 2*i - 1)) % 10\n x /= 10\n end\n\n true\n\nend",
"def is_palindrome(number)\n return false if number == nil || number < 0\n i = 0\n placeholder = number\n until placeholder == 0\n placeholder /= 10\n i += 1\n end\n until i <= 0\n i -= 1\n\n if number % 10 != number / 10 ** i\n return false\n end\n\n number -= (number / 10 ** i) * 10 ** i\n number /= 10\n\n i -= 1\n end\n return true\nend",
"def palindromic_number?(number, zeros=0)\n number = \"#{'0' * zeros}%o\" % number if zeros > 0\n palindrome?(number.to_s)\nend",
"def palindromic_number?(int)\n new_integer = int.to_s.reverse\n new_integer == int.to_s\nend",
"def q10_palindromic?(num)\n q9_palindrome?(num.to_s)\nend",
"def test_palindrome_parameter_string_number\n palindrome = Palindrome.new('2')\n assert_equal 9009, palindrome.digit_product\n end",
"def solution(digits)\n\tlargest = (digits[0]+digits[1]+digits[2]+digits[3]+digits[4]).to_i\n\ti = 4\n\twhile i < digits.length\n\t\ttester = (digits[i-4]+digits[i-3]+digits[i-2]+digits[i-1]+digits[i]).to_i\n\t\tif tester > largest\n\t\t\tlargest = tester\n\t\tend \n\t\ti += 1\n\tend \n\tlargest\nend",
"def longest_palindrome(string)\n pal_arr = get_palindromes(string)\n return false if pal_arr.empty?\n sorted_arr = pal_arr.sort_by {|el| el.length}\n \n sorted_arr[-1].length\n \n \nend",
"def is_palindrome?(num)\n binary = num.to_s(2)\n num = num.to_s\n\n num.reverse == num && binary == binary.reverse\nend",
"def palindromic_number?(int)\n new_int = int.to_s\n new_int = new_int.reverse\n new_int = new_int.to_i\n int == new_int\nend",
"def isPalindromic(val)\n\tln = val.length\n\tmiddle = ln / 2.0\n\tarr = val.split('')\n\t0.upto(middle) do |x|\n\t\tif(arr[x] != arr[ln - x - 1]) then return false end\n\tend\n\treturn true\nend",
"def longest_palindrome(str)\n return 0 if str.empty?\n\n arr = str.chars\n substrings = []\n length = 1\n loop do\n arr.each_cons(length) { |set| substrings << set }\n length += 1\n break if length > arr.length\n end\n substrings.select { |set| set == set.reverse }.max_by(&:length).length\n p substrings\nend"
] |
[
"0.83555037",
"0.8242398",
"0.8170143",
"0.81107473",
"0.8078514",
"0.80674416",
"0.80501807",
"0.8009623",
"0.7979529",
"0.7962498",
"0.7948993",
"0.7926019",
"0.78802824",
"0.78060204",
"0.7799266",
"0.7770549",
"0.7770034",
"0.7762247",
"0.7759526",
"0.77482855",
"0.7743022",
"0.7685298",
"0.7630091",
"0.7594347",
"0.75066656",
"0.74847513",
"0.74237424",
"0.74229735",
"0.74110854",
"0.7402058",
"0.7351745",
"0.7345088",
"0.7241706",
"0.7214323",
"0.72062737",
"0.71874964",
"0.71455216",
"0.7110609",
"0.7086732",
"0.7079707",
"0.7079707",
"0.7063464",
"0.7040333",
"0.7023441",
"0.7007277",
"0.7007277",
"0.6994729",
"0.69857883",
"0.6965674",
"0.6959912",
"0.6939946",
"0.69396746",
"0.6931163",
"0.6924541",
"0.69023365",
"0.69018215",
"0.68995416",
"0.6894194",
"0.68903226",
"0.68901414",
"0.68893147",
"0.6866947",
"0.68617135",
"0.6858714",
"0.6856451",
"0.68407214",
"0.68329525",
"0.6819919",
"0.68124926",
"0.68111175",
"0.6809837",
"0.67659956",
"0.6763174",
"0.67631036",
"0.67404354",
"0.6726408",
"0.6721588",
"0.67014545",
"0.67005414",
"0.667809",
"0.6659579",
"0.6647214",
"0.66446555",
"0.6637855",
"0.6637563",
"0.66353464",
"0.66283715",
"0.6622933",
"0.6619598",
"0.66167456",
"0.6616716",
"0.66109073",
"0.6610347",
"0.66036975",
"0.66000205",
"0.65996253",
"0.6593892",
"0.6589246",
"0.6574223",
"0.6561066",
"0.65606683"
] |
0.0
|
-1
|
Initializes the chunk instance.
|
def initialize(type, attributes = {})
self.type = type
attributes.each { |k, v| send("#{k}=", v) }
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def initialize(&chunk_callback)\n @chunk_callback = chunk_callback\n end",
"def initialize_new_test_store\n verify_store_is_blank_for_init\n add_chunk MemoryChunk.new(:max_chunk_size=>max_chunk_size,:max_index_block_size=>max_index_block_size)\n end",
"def initialize\n super()\n init_data()\n end",
"def initialize(chunks=[])\n @chunks = chunks\n @attributes = {}\n\n # the first chunk will determine the mode (le/classic) these message\n # fall into. This mode will be used to differentiate between setting\n # le or classic attributes during the parsing of this batch of chunks\n if @chunks[0] && @chunks[0][1]\n @bt_mode = @chunks[0][1] =~ /^\\s+LE/ ? \"le\" : \"classic\"\n end\n end",
"def initialize(chunks)\n @chunks = chunks.sort.map.with_index(1) { |ch, i| Chunk.new(ordinal: i, input: ch) }\n end",
"def initialize\n init\n end",
"def initialize(block_size)\n block_size = [block_size, HDR_SIZE_BYTES_].max\n\n @block_size = block_size\n @header_data = nil\n @recycle_data = nil\n @header_modified = false\n\n # for in-memory version only:\n @mem_file = nil\n end",
"def initialize\n initialize!\n end",
"def initialize\n initialize!\n end",
"def initialize(&block)\n yield self\n end",
"def initialize(stream, chunk_size = 4096)\n @stream = stream\n @chunk_size = chunk_size\n\n @event_buffer = Fifo.new\n\n @character_buffer = Buffer.new\n\n @characters_cursor = -1\n @characters = nil\n\n @stream_position = -1\n @state = :start_document\n @stack = []\n\n @value_buffer = \"\"\n @unicode = \"\"\n end",
"def initialize\n\t\t@content = nil\n\t\tyield( self ) if block_given?\n\tend",
"def init (&block)\n @init_block = block\n end",
"def initialize session, file_name, length, num_chunks, chunk_length, hash, host_uri\n\t\t\t\t@session = session\n\t\t\t\t@file_name = file_name\n\t\t\t\t@length = length\n\t\t\t\t@num_chunks = num_chunks\n\t\t\t\t@chunk_length = chunk_length\n\t\t\t\t@hash = hash\n\t\t\t\t@host_uri = host_uri\n\t\t\tend",
"def initialize\n end",
"def initialize(options={}, &block)\n super(options)\n\n block.call(self) # Allow for population of data with a block during initialization.\n end",
"def initialize(buffer_size)\n super()\n @buffer_size = buffer_size\n end",
"def initialize\n super\n self.cbSize = self.size\n end",
"def initialize\n super\n self.cbSize = self.size\n end",
"def initialize(chunked_source, defaults = {})\n @chunked_source = chunked_source\n @defaults = defaults\n end",
"def initialize\n reset!\n end",
"def initialize\n reset!\n end",
"def initialize(buf_size)\n @buffer_size = buf_size\n super(buf_size)\n end",
"def initialize()\n end",
"def initialize\n yield self if block_given?\n end",
"def initialize\n yield self if block_given?\n end",
"def initialize\n yield self if block_given?\n end",
"def initialize\n yield self if block_given?\n end",
"def initialize(size)\n @size = size\n @content = initialize_content\n end",
"def initialize(io, chunk_size = 8092)\n @io = io\n @chunk_size = chunk_size\n end",
"def init\n end",
"def init\n end",
"def init\n end",
"def initialize() end",
"def initialize(&block)\n instance_eval(&block) if block_given?\n end",
"def initialize\n super\n self.cb = self.size\n end",
"def initialize\n super\n self.cb = self.size\n end",
"def initialize\n super\n self.cb = self.size\n end",
"def initialize\n \n end",
"def initialize_starting_block\n nil\n end",
"def initialize(size=100)\n\t\t\t@buffer = RingBuffer.new size # buffered input stream\n\t\t\treset\n\t\tend",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n end",
"def initialize\n reset!\n end",
"def initialize\n reset!\n end",
"def init\n raise NotImplementedError\n end",
"def init(&block)\n @inits << block\n end",
"def init(&block)\n @inits << block\n end",
"def initialize(buffer = nil)\n @buf = buffer ? Bytes.force_binary_encoding(buffer) : Bytes.empty_byte_buffer\n @index = 0\n end",
"def initialize(device)\n @superblock = Superblock.new(self, device)\n end",
"def initialize\n clear\n end",
"def init; end",
"def init; end",
"def init; end",
"def init; end",
"def initialize(chunk,key,record,journal_info)\n @chunk = chunk\n @chunk_memory_revision = chunk.memory_revision\n @key = key\n stringify_values(record) if record.kind_of? Hash\n self.journal=journal_info[:journal]\n self.disk_offset=journal_info[:offset]\n self.disk_length=journal_info[:length]\n self.accounting_size=case record\n when Record then record.accounting_size\n when Hash then calculate_accounting_size(record)\n else raise \"invalid record class #{record.class}\"\n end\n end",
"def initialize \n\t\tsuper(SIZE)\n\tend",
"def initialize(type, *args, &block)\n super(type, *args)\n @init = block\n end",
"def initialize(buffer)\n @buf = ArrayIStream.new(buffer)\n end",
"def initialize\n\n\t\t\t# The speed of the music\n\t\t\t@tempo = 77\n\n\t\t\t# The number of MidiFormat objects\n\t\t\t@num_midi_seqs = 0\n\n\t\t\t# An array of MidiFormat objects\n\t\t\t@midi_format_array = Array.new\n\t\tend",
"def initialize(&block)\n load_defaults!\n\n instance_eval(&block)\n end",
"def initialize(buffer = '', options = {})\n @buffer = buffer\n end",
"def initialize\n reset\n end",
"def initialize\n reset\n end",
"def initialize(content); end",
"def initialize(content); end",
"def initialize(buffer = nil)\n @buf = buffer || ''\n @index = 0\n end",
"def initialize(buffer = nil)\n @buf = buffer || ''\n @index = 0\n end",
"def initialize\n reset!\n end",
"def init\n if super\n @offset = 0\n @sg = ITALY\n self\n end\n end",
"def initialize(&block)\n yield self\n end",
"def initialize()\n get_dimensions()\n get_start_p()\n get_end_p()\n end",
"def initialize(revision, options = {})\n @revision = revision\n @wiki = @revision.page.wiki\n \n # Merge most options, but override \"active_chunks\" if included\n @options = DEFAULT_OPTS.dup.merge(options)\n @options[:active_chunks] = options[:active_chunks] unless options[:active_chunks].blank?\n if @revision.content_type == :textile\n @options[:engine] = Engines::MAP[:textile] \n end\n @options[:engine_opts] = [:filter_html, :filter_styles] if @wiki.safe_mode?\n @options[:active_chunks] -= [WikiChunk::Word] if @wiki.brackets_only?\n \n @not_rendered = @pre_rendered = nil\n \n super(@revision.content)\n init_chunk_manager\n build_chunks\n @not_rendered = String.new(self)\n end",
"def initialize(&block)\n instance_eval(&block) if block_given?\n end",
"def initialize\n self.buffer_file = Tempfile.new(\"proton_stream.\")\n self.current_track = Track.next_track\n self.already_read = 0 \n self.head = 0\n self.tail = 0\n \n # Fill the buffer to start off with\n append_queue\n \n # Periodically append more music to the queue \n EM.add_periodic_timer(3) do\n append_queue\n end\n \n # Every second, read a chunk from the head of the queue\n # so that listening clients can get at it and share the same data\n EM.add_periodic_timer(1) do\n read_chunk\n end\n \n puts \"Initialised queue: buffer max #{MAX_BUFFER_SIZE} #{BIT_RATE}kbs\"\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end"
] |
[
"0.6877799",
"0.66815877",
"0.6561395",
"0.65548617",
"0.65327877",
"0.64942086",
"0.6483905",
"0.6476164",
"0.6476164",
"0.6468437",
"0.63970095",
"0.6391912",
"0.63868374",
"0.63474625",
"0.6336715",
"0.63355184",
"0.63331157",
"0.62786347",
"0.62786347",
"0.6259976",
"0.62481964",
"0.62481964",
"0.6218103",
"0.61855364",
"0.6178484",
"0.6178484",
"0.6178484",
"0.6178484",
"0.6169667",
"0.6159527",
"0.61456096",
"0.61456096",
"0.61456096",
"0.61430085",
"0.614026",
"0.6136664",
"0.6136664",
"0.6136664",
"0.61243904",
"0.6079875",
"0.60666984",
"0.6053564",
"0.6053564",
"0.6053564",
"0.6053564",
"0.6053564",
"0.6053564",
"0.604316",
"0.604316",
"0.6041813",
"0.6036702",
"0.6036702",
"0.6032258",
"0.60234934",
"0.60200125",
"0.60200083",
"0.60200083",
"0.60200083",
"0.60200083",
"0.6018422",
"0.5981238",
"0.5964209",
"0.5962543",
"0.5958168",
"0.59536797",
"0.5943405",
"0.59422654",
"0.59422654",
"0.5941376",
"0.5941376",
"0.59413725",
"0.59413725",
"0.59374666",
"0.5937206",
"0.5935707",
"0.59219867",
"0.5920249",
"0.591488",
"0.5907045",
"0.5904506",
"0.5904506",
"0.5904506",
"0.5904506",
"0.5904506",
"0.5904506",
"0.5904506",
"0.5904506",
"0.5904506",
"0.5904506",
"0.5904506",
"0.5904506",
"0.5904506",
"0.5904506",
"0.5904506",
"0.5904506",
"0.5904506",
"0.5904506",
"0.5904506",
"0.5904506",
"0.5904506",
"0.5904506"
] |
0.0
|
-1
|
Writes the chunk to the IO stream, using the provided content. The checksum will be calculated and appended to the stream.
|
def write_with_crc(io, content)
io << [content.length].pack('N') << type << content
io << [Zlib.crc32(content, Zlib.crc32(type))].pack('N')
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def write(chunk)\n chunk.read\n end",
"def write(chunk)\n @size += chunk.bytesize\n # Worth noting that size always appears larger during this check than it\n # is in reality since the size is updated prior to writing out the data to\n # ensure that the amount of data stored in RAM doesn't exceed the maximum\n # in memory size.\n update_io if @in_memory && @size > @max_in_memory_size\n @io << chunk\n chunk\n end",
"def write(io)\n write_with_crc(io, content || '')\n end",
"def write(io)\n write_with_crc(io, content || \"\")\n end",
"def write(chunk)\n # dummy\n end",
"def write_with_crc(io, content)\n io << [content.length].pack(\"N\") << type << content\n io << [Zlib.crc32(content, Zlib.crc32(type))].pack(\"N\")\n end",
"def update_content\n @buffer = Zip::OutputStream.write_buffer do |out|\n @output_stream = out\n yield self\n end\n end",
"def write(fragment)\n @content << fragment\n self\n end",
"def write(io)\n each do |chunk|\n io << chunk\n end\n\n self\n end",
"def send_chunk(chunk)\n Logger.debug \"sending chunk (#{chunk.length})\", indent: 1\n write(header.encode) + write(chunk)\n end",
"def write(block)\n @filemgr.write(block, @contents)\n end",
"def write(chunk)\n tokens = generate_token(@path)\n\n chunk.msgpack_each do |tag, record|\n next unless record.is_a? Hash\n\n token = get_token(tag, tokens)\n next if token.nil?\n\n if record.has_key?(\"message\")\n send_logentries(record[\"message\"] + ' ' + token)\n end\n end\n end",
"def send_content(content)\n @socket.write(content) if content && content.length > 0\n end",
"def write_to(stream)\n end",
"def write(location, content)\n Hyacinth::Config.lock_adapter.with_lock(location) do\n storage_adapter_for_location(location).write(location, content)\n end\n end",
"def push(content)\n @buffer.write(content) if content.length > 0; nil\n end",
"def flush\n if @carry_over\n @contents['info']['pieces'] << Digest::SHA1.digest( @carry_over )\n end\n unless @contents['creation date']\n @contents['creation date'] = Time.now.tv_sec\n end\n @io << @contents.bencode\n @io.flush\n self\n end",
"def write_content\n File.open(absolute_path,'w') do |file|\n file << content if content\n end\n # TODO git functionality\n end",
"def add_content(content)\n @contents[content.checksum] = content\n end",
"def write_chunk(start, buffer)\n @local_file.seek(start)\n @local_file.write(buffer)\n end",
"def perform_write(path:, content:)\n File.open(path, file_mode) do |file|\n if file.respond_to?(:test_write)\n file.test_write(content, path)\n else\n file.write(content)\n end\n end\n end",
"def perform_write(path:, content:)\n File.open(path, file_mode) do |file|\n if file.respond_to?(:test_write)\n file.test_write(content, path)\n else\n file.write(content)\n end\n end\n end",
"def send_chunk(env, chunk)\n chunk_len_in_hex = chunk.bytesize.to_s(16)\n body = [chunk_len_in_hex, CRLF, chunk, CRLF].join\n env.stream_send(body)\n end",
"def write(chunk)\n generate_tokens_list()\n return unless @tokens.is_a? Hash\n\n chunk.msgpack_each do |tag, record|\n next unless record.is_a? Hash\n next unless @use_json or record.has_key? \"message\"\n\n token = get_token(tag, record)\n next if token.nil?\n\n # Clean up the string to avoid blank line in logentries\n message = @use_json ? record.to_json : record[\"message\"].rstrip()\n send_logentries(token, message)\n end\n end",
"def store_content(key, klass, content)\n raise MogileFS::ReadOnlyError if readonly?\n\n new_file key, klass do |mfp|\n if content.is_a?(MogileFS::Util::StoreContent)\n mfp.streaming_io = content\n else\n mfp << content\n end\n end\n\n content.length\n end",
"def on_write &block\n signal_connect \"write\" do |p, len|\n chunk = p.get_bytes(0, len)\n bytes_written = block.call chunk\n chunk.clear\n\n bytes_written\n end\n end",
"def on_write &block\n signal_connect \"write\" do |p, len|\n chunk = p.get_bytes(0, len)\n bytes_written = block.call chunk\n chunk.clear\n\n bytes_written\n end\n end",
"def write(bytes)\n @io.write(bytes)\n\n nil\n end",
"def write_to(stream)\n stream.write_int(TAG)\n @data.write_to(stream)\n end",
"def send_chunk(request, chunk, done: false)\n data = +''\n data << \"#{chunk.bytesize.to_s(16)}\\r\\n#{chunk}\\r\\n\" if chunk\n data << \"0\\r\\n\\r\\n\" if done\n return if data.empty?\n\n request.tx_incr(data.bytesize)\n @conn.write(data)\n end",
"def shell_write(buf)\n rstream.write(buf)\n end",
"def shell_write(buf)\n rstream.write(buf)\n end",
"def send_chunk(data)\n response.write('%x' % data.size + \"\\r\\n\")\n response.write(data + \"\\r\\n\")\n end",
"def write(io)\n io = BinData::IO.new(io) unless BinData::IO === io\n\n do_write(io)\n io.flush\n self\n end",
"def write_buffer(io = ::StringIO.new(''))\n ::Zip::OutputStream.write_buffer(io) do |zos|\n @entry_set.each { |e| e.write_to_zip_output_stream(zos) }\n zos.comment = comment\n end\n end",
"def write( chunk )\n begin\n $log.debug \"Size of chunk is: #{chunk.size}\"\n requests = self.build_add_events_body( chunk )\n $log.debug \"Chunk split into #{requests.size} request(s).\"\n\n requests.each_with_index { |request, index|\n $log.debug \"Request #{index + 1}/#{requests.size}: #{request[:body].bytesize} bytes\"\n begin\n response = self.post_request( @add_events_uri, request[:body] )\n self.handle_response( response )\n rescue OpenSSL::SSL::SSLError => e\n if e.message.include? \"certificate verify failed\"\n $log.warn \"SSL certificate verification failed. Please make sure your certificate bundle is configured correctly and points to a valid file. You can configure this with the ssl_ca_bundle_path configuration option. The current value of ssl_ca_bundle_path is '#{@ssl_ca_bundle_path}'\"\n end\n $log.warn e.message\n $log.warn \"Discarding buffer chunk without retrying or logging to <secondary>\"\n rescue Scalyr::Client4xxError => e\n $log.warn \"4XX status code received for request #{index + 1}/#{requests.size}. Discarding buffer without retrying or logging.\\n\\t#{response.code} - #{e.message}\\n\\tChunk Size: #{chunk.size}\\n\\tLog messages this request: #{request[:record_count]}\\n\\tJSON payload size: #{request[:body].bytesize}\\n\\tSample: #{request[:body][0,1024]}...\"\n\n end\n }\n\n rescue JSON::GeneratorError\n $log.warn \"Unable to format message due to JSON::GeneratorError.\"\n raise\n end\n end",
"def flush\n stream.flush\n end",
"def write(bytes)\r\n end",
"def write_to(stream)\n stream.write_int(TAG)\n end",
"def write_to(stream)\n stream.write_int(TAG)\n end",
"def write_to(stream)\n stream.write_int(TAG)\n end",
"def protected_write_to_path(path, io)\n #TODO check that the file join below winds up inside the content directory, e.g. if '..' or the like are used\n #TODO write in a way that doesn't require us to read the whole io stream at once\n backup_file = nil\n with_content_path_for(path) do |content_path|\n FileUtils.mkdir_p(File.dirname(content_path))\n if File.exists?(content_path)\n backup_file = File.join(Bag.tmp_directory, UUID.generate)\n FileUtils.move(content_path, backup_file)\n end\n File.open(File.join(self.path, path), 'w:binary') do |f|\n f.write(io.read)\n end\n if block_given?\n Version.transaction do |t|\n begin\n yield\n rescue Exception\n t.rollback\n File.delete(content_path) if File.exists?(content_path)\n FileUtils.move(backup_file, content_path) if backup_file and File.exists?(backup_file)\n raise\n end\n end\n end\n end\n ensure\n File.delete(backup_file) if backup_file and File.exists?(backup_file)\n end",
"def write(content)\n protect { @secondary.write(content) }\n end",
"def write(data, offset = 0)\n # Track our offset into the remote file\n fptr = offset\n\n # Duplicate the data so we can use slice!\n data = data.dup\n\n # Take our first chunk of bytes\n chunk = data.slice!(0, self.chunk_size)\n\n # Keep writing data until we run out\n while (chunk.length > 0)\n ok = self.client.write(self.file_id, fptr, chunk)\n cl = ok['Payload'].v['CountLow']\n\n # Partial write, push the failed data back into the queue\n if (cl != chunk.length)\n data = chunk.slice(cl - 1, chunk.length - cl) + data\n end\n\n # Increment our painter and grab the next chunk\n fptr += cl\n chunk = data.slice!(0, self.chunk_size)\n end\n end",
"def write(content, message, author = nil)\n if !content.respond_to? :read\n content.gsub!(\"\\r\\n\", \"\\n\")\n\treturn if @object && @object.data == content\n end\n\n Wiki.check do |errors|\n errors << :already_exists.t(:path => @path) if new? && Resource.find(@repository, @path)\n errors << :empty_commit_message.t if message.blank?\n end\n\n repository.transaction(message, author && author.to_git_user) do\n content = content.read if content.respond_to? :read # FIXME\n repository.root[@path] = Gitrb::Blob.new(:data => content)\n end\n\n reload\n @commit = repository.log(1, nil).first\n @object = @commit.tree[@path] || raise(NotFound, path)\n @current = true\n end",
"def write(chunk, last_chunk = T.unsafe(nil)); end",
"def write(chunk, last_chunk = T.unsafe(nil)); end",
"def write(chunk, last_chunk = T.unsafe(nil)); end",
"def write(chunk, last_chunk = T.unsafe(nil)); end",
"def write(chunk)\n # Quick exit if we are missing something\n if !OMS::Configuration.load_configuration(omsadmin_conf_path, cert_path, key_path)\n raise 'Missing configuration. Make sure to onboard. Will continue to buffer data.'\n end\n\n # Group records based on their datatype because OMS does not support a single request with multiple datatypes. \n datatypes = {}\n chunk.msgpack_each {|(tag, record)|\n if !datatypes.has_key?(tag)\n datatypes[tag] = []\n end\n datatypes[tag] << record['message']\n }\n\n datatypes.each do |tag, records|\n handle_records(tag, records)\n end\n end",
"def file_write(file, content)\n \n instructions = \"echo #{content.inspect} >> #{file}\"\n r = @ssh ? @ssh.exec!(instructions) : `#{instructions}`\n puts 'r: ' + r.inspect if @debug\n \n @results[:file_write] = r\n\n end",
"def write(chunk)\n log.trace \"write:\", chunk\n\n @redis.multi \n chunk.each do |time, record|\n log.debug \"write sync redis push \", chunk.metadata.tag, time, record, @listname\n @redis.lpush(@listname,redisFormat(chunk.metadata.tag,time,record))\n end\n @redis.exec\n end",
"def write(val)\n @file.seek(@address)\n @file.putc(val)\n @file.flush\n end",
"def content=(new_content)\n @content = new_content\n headers['Content-Length'] = content.size.to_s\n end",
"def write(buf); end",
"def write(chunk)\n # chunk is a Fluent::MemoryBufferChunk or Fluent::FileBufferChunk.\n validate_token\n # Send the events in bulk if possible.\n if @monasca_log_api_client.supports_bulk?\n write_bulk chunk\n else\n write_single chunk\n end\n end",
"def write content, *opts\n raise \"Will not overwrite: #{self}\" if File.exist? self and not opts.include? :force\n FileUtils.mkdir_p(self.dirname)\n File.open(self, 'w'){ |f| f.write(content) }\n end",
"def write(chunk)\n tag = chunk.metadata.tag\t\t\n $real_container = extract_placeholders(@container, chunk)\n\t\tarrays_2 = chunk_convert(chunk)\n\t\thandle_record(tag, DateTime.now, arrays_2)\n end",
"def write\n begin\n buf = [ @flags, @length, @id, @crc].pack(FORMAT)\n crc = Zlib.crc32(buf, 0)\n @file.seek(@addr)\n @file.write(buf + [ crc ].pack('L'))\n rescue IOError => e\n PEROBS.log.fatal \"Cannot write blob header into flat file DB: \" +\n e.message\n end\n end",
"def write_to_file(path, content)\n directory = File.dirname(path)\n FileUtils.mkdir_p(directory)\n File.write(path, content)\n after_rendering_run(\"rm -rf #{path}\")\n path\n end",
"def write_cache(resource, content)\n expanded_path = cache_path_for(resource)\n return false unless expanded_path\n FileUtils.mkdir_p(File.dirname(expanded_path))\n @logger.info(self.class) { \"Caching #{content.length} B for #{resource}\" }\n File.write(expanded_path, content)\n end",
"def write(key, content)\n bucket.objects[key].write(content)\n end",
"def pipe_chunk chunk, command\n content = chunk.content\n output = @context.ui.pipe_to_process(command) do |stream|\n stream.write content\n end\n\n handle_pipe_output command, output\n end",
"def write data\n _data[:out].write data\n _data[:out].flush\n end",
"def do_write(s)\n @wbuffer << s\n @wbuffer.force_encoding(Encoding::BINARY)\n @sync ||= false\n\n if @sync or @wbuffer.size > BLOCK_SIZE or idx = @wbuffer.rindex($/)\n remain = idx ? idx + $/.size : @wbuffer.length\n nwritten = 0\n\n while remain > 0\n str = @wbuffer[nwritten,remain]\n begin\n nwrote = syswrite(str)\n rescue Errno::EAGAIN\n retry\n end\n remain -= nwrote\n nwritten += nwrote\n end\n\n @wbuffer[0,nwritten] = \"\"\n end\n end",
"def write( object )\n if object.responds_to?(:write_to) then\n object.write_to(@stream)\n else\n @stream << object.to_s\n end\n end",
"def write_to(io)\n\t@io = io\n\t@bytes_written = 0\n\twrite_header()\n\t@update_block.call(nil, @seq.tracks.length, 0) if @update_block\n\t@seq.tracks.each_with_index do |track, i|\n write_track(track)\n @update_block.call(track, @seq.tracks.length, i) if @update_block\n\tend\n end",
"def write_to(io)\n\t@io = io\n\t@bytes_written = 0\n\twrite_header()\n\t@update_block.call(nil, @seq.tracks.length, 0) if @update_block\n\t@seq.tracks.each_with_index do |track, i|\n write_track(track)\n @update_block.call(track, @seq.tracks.length, i) if @update_block\n\tend\n end",
"def store(path, content, mode = 0o644)\n put_at(parse_path(path), content && repo.data_sha(content), mode)\n end",
"def passthrough(task)\n\t\t\t\t\t\ttask.annotate(\"Writing #{@body} to #{@stream}.\")\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile chunk = @body&.read\n\t\t\t\t\t\t\tself.write(chunk)\n\t\t\t\t\t\t\t# TODO this reduces memory usage?\n\t\t\t\t\t\t\t# chunk.clear unless chunk.frozen?\n\t\t\t\t\t\t\t# GC.start\n\t\t\t\t\t\tend\n\t\t\t\t\t\t\n\t\t\t\t\t\tself.close\n\t\t\t\t\tensure\n\t\t\t\t\t\t@body&.close($!)\n\t\t\t\t\t\t@body = nil\n\t\t\t\t\tend",
"def put_raw_object(content, type)\n size = content.length.to_s\n LooseStorage.verify_header(type, size)\n \n header = \"#{type} #{size}\\0\"\n store = header + content\n \n sha1 = Digest::SHA1.hexdigest(store)\n path = @directory+'/'+sha1[0...2]+'/'+sha1[2..40]\n \n if !File.exists?(path)\n content = Zlib::Deflate.deflate(store)\n \n FileUtils.mkdir_p(@directory+'/'+sha1[0...2])\n File.open(path, 'w') do |f|\n f.write content\n end\n end\n return sha1\n end",
"def put_object(type, content)\n data = \"#{type} #{content.length}\\0#{content}\"\n id = sha(data)\n path = object_path(id)\n\n unless File.exists?(path)\n FileUtils.mkpath(File.dirname(path))\n open(path, 'wb') do |f|\n f.write Zlib::Deflate.deflate(data)\n end\n end\n\n id\n end",
"def flush\n flush_block unless @buffer.empty? \n process_hardlinks\n\n # writing the location of the archive (it's after the dump data)\n writeloc(@file, [@location].pack('V'), 0) \n\n indexloc = @location\n location = (sha1subset('FFFFFFFFFF', @idx_size) * 8) + indexloc\n # p = File.open(\"zlog\", \"w\")\n each_entry_with_index do |entry, idx|\n next if entry.nil? \n\n writeloc(@file, [location, entry.size].pack('V2'), (idx * 8) + indexloc)\n writeloc(@file, entry, location)\n\n # p << \"*\" * 80 << \"\\n\" \n # p << \"seek #{(idx * 8) + indexloc} location #{location} size #{entry.size}\" << \"\\n\"\n # p << unpack(entry).join(\":\") << \"\\n\"\n\n location += entry.size\n end\n\n # meta location\n writeloc(@file, [location, @compressor.method, @idx_size].pack('VCC'), 4)\n\n writeloc(@file, Marshal.dump(@meta), @location) if defined?(@meta)\n\n @file.close\n end",
"def add_content(checksum, path)\n Log.debug2(\"Try to add content:%s to copy waiting list\", checksum)\n @keeper.synchronize{\n # if content is being copied or waiting then skip it\n if !@contents_under_copy[checksum]\n if !@contents_to_copy[checksum]\n if @contents_under_copy.size < @max_contents_under_copy\n @contents_under_copy[checksum] = [path, false, Time.now]\n $process_vars.set('contents under copy', @contents_under_copy.size)\n @copy_input_queue.push([:SEND_ACK_MESSAGE, checksum])\n $process_vars.set('Copy File Queue Size', @copy_input_queue.size)\n else\n # no place in copy streams. Add to waiting list\n Log.debug2(\"add content:%s to copy waiting list\", checksum)\n @contents_to_copy[checksum] = true # replace with a set\n @contents_to_copy_queue.push([checksum, path])\n $process_vars.set('contents to copy queue', @contents_to_copy_queue.size)\n end\n else\n Log.debug2(\"content:%s already in waiting list. skipping.\", checksum)\n end\n else\n Log.debug2(\"content:%s is being copied. skipping.\", checksum)\n end\n }\n end",
"def write_fragment(key, content, options = nil)\n return content unless cache_configured?\n\n key = combined_fragment_cache_key(key)\n instrument_fragment_cache :write_fragment, key do\n content = content.to_str\n cache_store.write(key, content, options)\n end\n content\n end",
"def write bytes\n r = response_object\n r.body \"\" if r.body_io.nil?\n r.body_io.write bytes\n end",
"def write_data_block(stream, rt, lg, data) # :nodoc:\n\t compress = 0\n\t if compress? && data.size > COMPRESSION_MIN_SIZE\n\t\tdata = Zlib::Deflate.deflate(data)\n\t\tcompress = 1\n\t end\n\n do_write do\n Logfiles.write_data_block(wio, stream.index, rt, lg, compress, data)\n end\n\tend",
"def save chunk_nr, io\n\t\t\t# retrieve data from io and compare sig \n\t\tend",
"def write(s)\n do_write(s)\n s.bytesize\n end",
"def write_content_to_file(file_path, content)\n File.open(file_path, 'w') do |f|\n f.write content\n end\n end",
"def write_it( output_file, final_content )\n File.open(output_file, \"w\") {|f| f.write( final_content ) }\n end",
"def write(path, options={}, &block)\n content = options[:content]\n if block\n content = []\n yield content\n content = content.join(\"\\n\")\n end\n exec! \"cat > '#{path}' <<EOF\\n#{content}\\nEOF\", options\n end",
"def write!( string )\n @stream << string\n end",
"def flush\n @out.flush if @out.is_a?(IO)\n end",
"def write\n\n # output to disk\n File.open(@outfile, 'w:UTF-8') { |file|\n file.write(@buffer)\n }\n end",
"def write(fragment); end",
"def flush\n File.open(path,'a'){|f| f.write @file_content}\n @file_content = ''\n end",
"def flush\n io.flush\n end",
"def write(io)\n io.write [@value].pack(format)\n end",
"def write_file(filename, content)\n FileUtils.mkdir_p File.dirname(filename)\n IO.binwrite(filename, content)\n end",
"def each_chunk stream\n while !stream.eof?\n yield read_chunk stream\n end\n end",
"def write_fragment(name, content, options = nil)\n return unless perform_caching\n\n key = fragment_cache_key(name)\n self.class.benchmark \"Cached fragment: #{key}\" do\n fragment_cache_store.write(key, content, options)\n end\n content\n end",
"def write_to(io)\n open {|i|\n FileUtils.copy_stream(i, io)\n }\n end",
"def content=(content)\n @buffer = content || \"\"\n @size = content.nil? ? nil : content.size\n end",
"def write_to_socket bytes\n socket.write_nonblock bytes\n rescue IO::WaitWritable\n :wait_writable\n end",
"def write content=''\n # return false unless we can proceed\n write_prep outfile or return false\n\n File.open(outfile, \"w\") { |f| f.puts content }\n message { sprintf \"Wrote '%s'\", outfile }\n true\n end",
"def write(contents = @request_body.to_s)\n @contents = contents\n\n File.open(@src_path, 'w') do |file|\n file.write @contents\n end\n end",
"def perform( handle, data, offset=0 )\n @handle = handle\n @offset = offset\n @data = data\n @pos = 0\n\n @driver.write( nil, handle, offset, data[0,CHUNK_SIZE] )\n end",
"def write(name, content)\n file = Tempfile.new(name)\n file.write(content)\n file.rewind\n file\n end",
"def write(msg)\n prep_write\n puts \"#-------> @[ #{@file_handle.pos} ] B[ #{@buffer_size} ] in #{@complete_path} <---------#\\n#{msg}\" if verbose\n add_to_buffer(msg)\n flush_if_buffer_full\n end"
] |
[
"0.67910624",
"0.6640919",
"0.63424355",
"0.624041",
"0.6085087",
"0.6056909",
"0.59049314",
"0.5780607",
"0.5733388",
"0.56672204",
"0.564678",
"0.55954313",
"0.5552174",
"0.5544837",
"0.5508556",
"0.5494334",
"0.5463504",
"0.5450318",
"0.5449808",
"0.54348654",
"0.5350668",
"0.5350668",
"0.53505987",
"0.5217153",
"0.52033365",
"0.5202912",
"0.5202912",
"0.51903045",
"0.51877725",
"0.5178766",
"0.5152807",
"0.5152807",
"0.5134938",
"0.50948083",
"0.50497925",
"0.5042591",
"0.50404024",
"0.5023675",
"0.49895617",
"0.49895617",
"0.49895617",
"0.49201593",
"0.49178943",
"0.49075854",
"0.48898786",
"0.48876616",
"0.48876616",
"0.48876616",
"0.48876616",
"0.4887201",
"0.48528653",
"0.48452422",
"0.48156568",
"0.48130384",
"0.48126644",
"0.48028776",
"0.47970238",
"0.47943473",
"0.47881097",
"0.47853228",
"0.47829747",
"0.47781608",
"0.47756672",
"0.4772265",
"0.4763931",
"0.47399995",
"0.47342095",
"0.47342095",
"0.47290993",
"0.47053498",
"0.4696747",
"0.46955323",
"0.46870196",
"0.4685825",
"0.46798545",
"0.46607617",
"0.46577576",
"0.46448743",
"0.46394172",
"0.46372074",
"0.46308497",
"0.46289015",
"0.46263456",
"0.46237433",
"0.4620066",
"0.46158215",
"0.46119785",
"0.46043068",
"0.46039906",
"0.45924965",
"0.45921245",
"0.4574574",
"0.4573676",
"0.45724368",
"0.4560659",
"0.45591152",
"0.45580414",
"0.45577723",
"0.4545139",
"0.45431414"
] |
0.6068339
|
5
|
Writes the chunk to the IO stream. It will call the +content+ method to get the content for this chunk, and will calculate and append the checksum automatically.
|
def write(io)
write_with_crc(io, content || '')
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def write(chunk)\n chunk.read\n end",
"def write(io)\n write_with_crc(io, content || \"\")\n end",
"def write(chunk)\n @size += chunk.bytesize\n # Worth noting that size always appears larger during this check than it\n # is in reality since the size is updated prior to writing out the data to\n # ensure that the amount of data stored in RAM doesn't exceed the maximum\n # in memory size.\n update_io if @in_memory && @size > @max_in_memory_size\n @io << chunk\n chunk\n end",
"def write(chunk)\n # dummy\n end",
"def write_with_crc(io, content)\n io << [content.length].pack('N') << type << content\n io << [Zlib.crc32(content, Zlib.crc32(type))].pack('N')\n end",
"def write_with_crc(io, content)\n io << [content.length].pack(\"N\") << type << content\n io << [Zlib.crc32(content, Zlib.crc32(type))].pack(\"N\")\n end",
"def update_content\n @buffer = Zip::OutputStream.write_buffer do |out|\n @output_stream = out\n yield self\n end\n end",
"def write(fragment)\n @content << fragment\n self\n end",
"def flush\n if @carry_over\n @contents['info']['pieces'] << Digest::SHA1.digest( @carry_over )\n end\n unless @contents['creation date']\n @contents['creation date'] = Time.now.tv_sec\n end\n @io << @contents.bencode\n @io.flush\n self\n end",
"def write(chunk)\n tokens = generate_token(@path)\n\n chunk.msgpack_each do |tag, record|\n next unless record.is_a? Hash\n\n token = get_token(tag, tokens)\n next if token.nil?\n\n if record.has_key?(\"message\")\n send_logentries(record[\"message\"] + ' ' + token)\n end\n end\n end",
"def write(io)\n each do |chunk|\n io << chunk\n end\n\n self\n end",
"def write(block)\n @filemgr.write(block, @contents)\n end",
"def send_chunk(chunk)\n Logger.debug \"sending chunk (#{chunk.length})\", indent: 1\n write(header.encode) + write(chunk)\n end",
"def on_write &block\n signal_connect \"write\" do |p, len|\n chunk = p.get_bytes(0, len)\n bytes_written = block.call chunk\n chunk.clear\n\n bytes_written\n end\n end",
"def on_write &block\n signal_connect \"write\" do |p, len|\n chunk = p.get_bytes(0, len)\n bytes_written = block.call chunk\n chunk.clear\n\n bytes_written\n end\n end",
"def write_content\n File.open(absolute_path,'w') do |file|\n file << content if content\n end\n # TODO git functionality\n end",
"def write( chunk )\n begin\n $log.debug \"Size of chunk is: #{chunk.size}\"\n requests = self.build_add_events_body( chunk )\n $log.debug \"Chunk split into #{requests.size} request(s).\"\n\n requests.each_with_index { |request, index|\n $log.debug \"Request #{index + 1}/#{requests.size}: #{request[:body].bytesize} bytes\"\n begin\n response = self.post_request( @add_events_uri, request[:body] )\n self.handle_response( response )\n rescue OpenSSL::SSL::SSLError => e\n if e.message.include? \"certificate verify failed\"\n $log.warn \"SSL certificate verification failed. Please make sure your certificate bundle is configured correctly and points to a valid file. You can configure this with the ssl_ca_bundle_path configuration option. The current value of ssl_ca_bundle_path is '#{@ssl_ca_bundle_path}'\"\n end\n $log.warn e.message\n $log.warn \"Discarding buffer chunk without retrying or logging to <secondary>\"\n rescue Scalyr::Client4xxError => e\n $log.warn \"4XX status code received for request #{index + 1}/#{requests.size}. Discarding buffer without retrying or logging.\\n\\t#{response.code} - #{e.message}\\n\\tChunk Size: #{chunk.size}\\n\\tLog messages this request: #{request[:record_count]}\\n\\tJSON payload size: #{request[:body].bytesize}\\n\\tSample: #{request[:body][0,1024]}...\"\n\n end\n }\n\n rescue JSON::GeneratorError\n $log.warn \"Unable to format message due to JSON::GeneratorError.\"\n raise\n end\n end",
"def write(bytes)\n @io.write(bytes)\n\n nil\n end",
"def write_to(stream)\n end",
"def write(chunk)\n generate_tokens_list()\n return unless @tokens.is_a? Hash\n\n chunk.msgpack_each do |tag, record|\n next unless record.is_a? Hash\n next unless @use_json or record.has_key? \"message\"\n\n token = get_token(tag, record)\n next if token.nil?\n\n # Clean up the string to avoid blank line in logentries\n message = @use_json ? record.to_json : record[\"message\"].rstrip()\n send_logentries(token, message)\n end\n end",
"def write(bytes)\r\n end",
"def flush\n stream.flush\n end",
"def write(location, content)\n Hyacinth::Config.lock_adapter.with_lock(location) do\n storage_adapter_for_location(location).write(location, content)\n end\n end",
"def push(content)\n @buffer.write(content) if content.length > 0; nil\n end",
"def write\n begin\n buf = [ @flags, @length, @id, @crc].pack(FORMAT)\n crc = Zlib.crc32(buf, 0)\n @file.seek(@addr)\n @file.write(buf + [ crc ].pack('L'))\n rescue IOError => e\n PEROBS.log.fatal \"Cannot write blob header into flat file DB: \" +\n e.message\n end\n end",
"def write_chunk(start, buffer)\n @local_file.seek(start)\n @local_file.write(buffer)\n end",
"def send_content(content)\n @socket.write(content) if content && content.length > 0\n end",
"def write(io)\n io = BinData::IO.new(io) unless BinData::IO === io\n\n do_write(io)\n io.flush\n self\n end",
"def add_content(content)\n @contents[content.checksum] = content\n end",
"def write(chunk, last_chunk = T.unsafe(nil)); end",
"def write(chunk, last_chunk = T.unsafe(nil)); end",
"def write(chunk, last_chunk = T.unsafe(nil)); end",
"def write(chunk, last_chunk = T.unsafe(nil)); end",
"def perform_write(path:, content:)\n File.open(path, file_mode) do |file|\n if file.respond_to?(:test_write)\n file.test_write(content, path)\n else\n file.write(content)\n end\n end\n end",
"def perform_write(path:, content:)\n File.open(path, file_mode) do |file|\n if file.respond_to?(:test_write)\n file.test_write(content, path)\n else\n file.write(content)\n end\n end\n end",
"def write\n\n # output to disk\n File.open(@outfile, 'w:UTF-8') { |file|\n file.write(@buffer)\n }\n end",
"def finish\n self.class.pack(checksum)\n end",
"def send_chunk(data)\n response.write('%x' % data.size + \"\\r\\n\")\n response.write(data + \"\\r\\n\")\n end",
"def send_chunk(request, chunk, done: false)\n data = +''\n data << \"#{chunk.bytesize.to_s(16)}\\r\\n#{chunk}\\r\\n\" if chunk\n data << \"0\\r\\n\\r\\n\" if done\n return if data.empty?\n\n request.tx_incr(data.bytesize)\n @conn.write(data)\n end",
"def flush\n flush_block unless @buffer.empty? \n process_hardlinks\n\n # writing the location of the archive (it's after the dump data)\n writeloc(@file, [@location].pack('V'), 0) \n\n indexloc = @location\n location = (sha1subset('FFFFFFFFFF', @idx_size) * 8) + indexloc\n # p = File.open(\"zlog\", \"w\")\n each_entry_with_index do |entry, idx|\n next if entry.nil? \n\n writeloc(@file, [location, entry.size].pack('V2'), (idx * 8) + indexloc)\n writeloc(@file, entry, location)\n\n # p << \"*\" * 80 << \"\\n\" \n # p << \"seek #{(idx * 8) + indexloc} location #{location} size #{entry.size}\" << \"\\n\"\n # p << unpack(entry).join(\":\") << \"\\n\"\n\n location += entry.size\n end\n\n # meta location\n writeloc(@file, [location, @compressor.method, @idx_size].pack('VCC'), 4)\n\n writeloc(@file, Marshal.dump(@meta), @location) if defined?(@meta)\n\n @file.close\n end",
"def store_content(key, klass, content)\n raise MogileFS::ReadOnlyError if readonly?\n\n new_file key, klass do |mfp|\n if content.is_a?(MogileFS::Util::StoreContent)\n mfp.streaming_io = content\n else\n mfp << content\n end\n end\n\n content.length\n end",
"def write data\n _data[:out].write data\n _data[:out].flush\n end",
"def write content, *opts\n raise \"Will not overwrite: #{self}\" if File.exist? self and not opts.include? :force\n FileUtils.mkdir_p(self.dirname)\n File.open(self, 'w'){ |f| f.write(content) }\n end",
"def flush\n io.flush\n end",
"def do_write(s)\n @wbuffer << s\n @wbuffer.force_encoding(Encoding::BINARY)\n @sync ||= false\n\n if @sync or @wbuffer.size > BLOCK_SIZE or idx = @wbuffer.rindex($/)\n remain = idx ? idx + $/.size : @wbuffer.length\n nwritten = 0\n\n while remain > 0\n str = @wbuffer[nwritten,remain]\n begin\n nwrote = syswrite(str)\n rescue Errno::EAGAIN\n retry\n end\n remain -= nwrote\n nwritten += nwrote\n end\n\n @wbuffer[0,nwritten] = \"\"\n end\n end",
"def send_chunk(env, chunk)\n chunk_len_in_hex = chunk.bytesize.to_s(16)\n body = [chunk_len_in_hex, CRLF, chunk, CRLF].join\n env.stream_send(body)\n end",
"def write bytes\n r = response_object\n r.body \"\" if r.body_io.nil?\n r.body_io.write bytes\n end",
"def shell_write(buf)\n rstream.write(buf)\n end",
"def shell_write(buf)\n rstream.write(buf)\n end",
"def write(data, offset = 0)\n # Track our offset into the remote file\n fptr = offset\n\n # Duplicate the data so we can use slice!\n data = data.dup\n\n # Take our first chunk of bytes\n chunk = data.slice!(0, self.chunk_size)\n\n # Keep writing data until we run out\n while (chunk.length > 0)\n ok = self.client.write(self.file_id, fptr, chunk)\n cl = ok['Payload'].v['CountLow']\n\n # Partial write, push the failed data back into the queue\n if (cl != chunk.length)\n data = chunk.slice(cl - 1, chunk.length - cl) + data\n end\n\n # Increment our painter and grab the next chunk\n fptr += cl\n chunk = data.slice!(0, self.chunk_size)\n end\n end",
"def write(chunk)\n log.trace \"write:\", chunk\n\n @redis.multi \n chunk.each do |time, record|\n log.debug \"write sync redis push \", chunk.metadata.tag, time, record, @listname\n @redis.lpush(@listname,redisFormat(chunk.metadata.tag,time,record))\n end\n @redis.exec\n end",
"def write\n File.open('Gemfile', 'w') do |f|\n f.write(content)\n end\n end",
"def write\n File.open('Gemfile', 'w') do |f|\n f.write(content)\n end\n end",
"def write_to(stream)\n stream.write_int(TAG)\n @data.write_to(stream)\n end",
"def flush\n File.open(path,'a'){|f| f.write @file_content}\n @file_content = ''\n end",
"def write(val)\n @file.seek(@address)\n @file.putc(val)\n @file.flush\n end",
"def write(content)\n protect { @secondary.write(content) }\n end",
"def flush\n writer.flush\n end",
"def put_raw_object(content, type)\n size = content.length.to_s\n LooseStorage.verify_header(type, size)\n \n header = \"#{type} #{size}\\0\"\n store = header + content\n \n sha1 = Digest::SHA1.hexdigest(store)\n path = @directory+'/'+sha1[0...2]+'/'+sha1[2..40]\n \n if !File.exists?(path)\n content = Zlib::Deflate.deflate(store)\n \n FileUtils.mkdir_p(@directory+'/'+sha1[0...2])\n File.open(path, 'w') do |f|\n f.write content\n end\n end\n return sha1\n end",
"def write(buf); end",
"def save chunk_nr, io\n\t\t\t# retrieve data from io and compare sig \n\t\tend",
"def write(chunk)\n # chunk is a Fluent::MemoryBufferChunk or Fluent::FileBufferChunk.\n validate_token\n # Send the events in bulk if possible.\n if @monasca_log_api_client.supports_bulk?\n write_bulk chunk\n else\n write_single chunk\n end\n end",
"def write(s)\n do_write(s)\n s.bytesize\n end",
"def write(chunk)\n # Quick exit if we are missing something\n if !OMS::Configuration.load_configuration(omsadmin_conf_path, cert_path, key_path)\n raise 'Missing configuration. Make sure to onboard. Will continue to buffer data.'\n end\n\n # Group records based on their datatype because OMS does not support a single request with multiple datatypes. \n datatypes = {}\n chunk.msgpack_each {|(tag, record)|\n if !datatypes.has_key?(tag)\n datatypes[tag] = []\n end\n datatypes[tag] << record['message']\n }\n\n datatypes.each do |tag, records|\n handle_records(tag, records)\n end\n end",
"def write(chunk)\n tag = chunk.metadata.tag\t\t\n $real_container = extract_placeholders(@container, chunk)\n\t\tarrays_2 = chunk_convert(chunk)\n\t\thandle_record(tag, DateTime.now, arrays_2)\n end",
"def write_buffer(io = ::StringIO.new(''))\n ::Zip::OutputStream.write_buffer(io) do |zos|\n @entry_set.each { |e| e.write_to_zip_output_stream(zos) }\n zos.comment = comment\n end\n end",
"def write(fragment); end",
"def update_checksum\n hh = header(\" \" * 8)\n @checksum = oct(calculate_checksum(hh), 6)\n end",
"def protected_write_to_path(path, io)\n #TODO check that the file join below winds up inside the content directory, e.g. if '..' or the like are used\n #TODO write in a way that doesn't require us to read the whole io stream at once\n backup_file = nil\n with_content_path_for(path) do |content_path|\n FileUtils.mkdir_p(File.dirname(content_path))\n if File.exists?(content_path)\n backup_file = File.join(Bag.tmp_directory, UUID.generate)\n FileUtils.move(content_path, backup_file)\n end\n File.open(File.join(self.path, path), 'w:binary') do |f|\n f.write(io.read)\n end\n if block_given?\n Version.transaction do |t|\n begin\n yield\n rescue Exception\n t.rollback\n File.delete(content_path) if File.exists?(content_path)\n FileUtils.move(backup_file, content_path) if backup_file and File.exists?(backup_file)\n raise\n end\n end\n end\n end\n ensure\n File.delete(backup_file) if backup_file and File.exists?(backup_file)\n end",
"def write content=''\n # return false unless we can proceed\n write_prep outfile or return false\n\n File.open(outfile, \"w\") { |f| f.puts content }\n message { sprintf \"Wrote '%s'\", outfile }\n true\n end",
"def flush\n @out.flush if @out.is_a?(IO)\n end",
"def write(string)\n\t\t\t\t@write_buffer << string\n\t\t\t\t\n\t\t\t\tif @write_buffer.size > @block_size\n\t\t\t\t\tflush\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\treturn string.bytesize\n\t\t\tend",
"def write(key, content)\n bucket.objects[key].write(content)\n end",
"def write_it( output_file, final_content )\n File.open(output_file, \"w\") {|f| f.write( final_content ) }\n end",
"def content=(new_content)\n @content = new_content\n headers['Content-Length'] = content.size.to_s\n end",
"def write_to_file(path, content)\n directory = File.dirname(path)\n FileUtils.mkdir_p(directory)\n File.write(path, content)\n after_rendering_run(\"rm -rf #{path}\")\n path\n end",
"def write_cache(resource, content)\n expanded_path = cache_path_for(resource)\n return false unless expanded_path\n FileUtils.mkdir_p(File.dirname(expanded_path))\n @logger.info(self.class) { \"Caching #{content.length} B for #{resource}\" }\n File.write(expanded_path, content)\n end",
"def file_write(file, content)\n \n instructions = \"echo #{content.inspect} >> #{file}\"\n r = @ssh ? @ssh.exec!(instructions) : `#{instructions}`\n puts 'r: ' + r.inspect if @debug\n \n @results[:file_write] = r\n\n end",
"def write(content, message, author = nil)\n if !content.respond_to? :read\n content.gsub!(\"\\r\\n\", \"\\n\")\n\treturn if @object && @object.data == content\n end\n\n Wiki.check do |errors|\n errors << :already_exists.t(:path => @path) if new? && Resource.find(@repository, @path)\n errors << :empty_commit_message.t if message.blank?\n end\n\n repository.transaction(message, author && author.to_git_user) do\n content = content.read if content.respond_to? :read # FIXME\n repository.root[@path] = Gitrb::Blob.new(:data => content)\n end\n\n reload\n @commit = repository.log(1, nil).first\n @object = @commit.tree[@path] || raise(NotFound, path)\n @current = true\n end",
"def record_write bytes\n @reader.record_write bytes, @state\n end",
"def write\n File.open(path, 'w') { |file|\n file.write(FILE_HEADER + \"\\n\")\n file.write(encoded_body)\n }\n end",
"def write(msg)\n prep_write\n puts \"#-------> @[ #{@file_handle.pos} ] B[ #{@buffer_size} ] in #{@complete_path} <---------#\\n#{msg}\" if verbose\n add_to_buffer(msg)\n flush_if_buffer_full\n end",
"def passthrough(task)\n\t\t\t\t\t\ttask.annotate(\"Writing #{@body} to #{@stream}.\")\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile chunk = @body&.read\n\t\t\t\t\t\t\tself.write(chunk)\n\t\t\t\t\t\t\t# TODO this reduces memory usage?\n\t\t\t\t\t\t\t# chunk.clear unless chunk.frozen?\n\t\t\t\t\t\t\t# GC.start\n\t\t\t\t\t\tend\n\t\t\t\t\t\t\n\t\t\t\t\t\tself.close\n\t\t\t\t\tensure\n\t\t\t\t\t\t@body&.close($!)\n\t\t\t\t\t\t@body = nil\n\t\t\t\t\tend",
"def write_fragment(key, content, options = nil)\n return content unless cache_configured?\n\n key = combined_fragment_cache_key(key)\n instrument_fragment_cache :write_fragment, key do\n content = content.to_str\n cache_store.write(key, content, options)\n end\n content\n end",
"def flush\n return @transport.flush unless @write\n\n out = [@wbuf.length].pack('N')\n out << @wbuf\n @transport.write(out)\n @transport.flush\n @wbuf = ''\n end",
"def flush\n return @transport.flush unless @write\n\n out = [@wbuf.length].pack('N')\n out << @wbuf\n @transport.write(out)\n @transport.flush\n @wbuf = ''\n end",
"def store(path, content, mode = 0o644)\n put_at(parse_path(path), content && repo.data_sha(content), mode)\n end",
"def write_to_folder\n File.open(prepare_file_path_to_download, 'w') do |file|\n file.write(response[:content])\n end\n end",
"def write(data); end",
"def write(data); end",
"def write(data); end",
"def write(data); end",
"def flush\n if !@write\n return @transport.flush\n end\n\n out = [@wbuf.length].pack('N')\n out << @wbuf\n @transport.write(out)\n @transport.flush\n @wbuf = ''\n end",
"def add_content(checksum, path)\n Log.debug2(\"Try to add content:%s to copy waiting list\", checksum)\n @keeper.synchronize{\n # if content is being copied or waiting then skip it\n if !@contents_under_copy[checksum]\n if !@contents_to_copy[checksum]\n if @contents_under_copy.size < @max_contents_under_copy\n @contents_under_copy[checksum] = [path, false, Time.now]\n $process_vars.set('contents under copy', @contents_under_copy.size)\n @copy_input_queue.push([:SEND_ACK_MESSAGE, checksum])\n $process_vars.set('Copy File Queue Size', @copy_input_queue.size)\n else\n # no place in copy streams. Add to waiting list\n Log.debug2(\"add content:%s to copy waiting list\", checksum)\n @contents_to_copy[checksum] = true # replace with a set\n @contents_to_copy_queue.push([checksum, path])\n $process_vars.set('contents to copy queue', @contents_to_copy_queue.size)\n end\n else\n Log.debug2(\"content:%s already in waiting list. skipping.\", checksum)\n end\n else\n Log.debug2(\"content:%s is being copied. skipping.\", checksum)\n end\n }\n end",
"def write( object )\n if object.responds_to?(:write_to) then\n object.write_to(@stream)\n else\n @stream << object.to_s\n end\n end",
"def write_to(stream)\n stream.write_int(TAG)\n end",
"def write_to(stream)\n stream.write_int(TAG)\n end",
"def write_to(stream)\n stream.write_int(TAG)\n end",
"def write_file(filename, content)\n FileUtils.mkdir_p File.dirname(filename)\n IO.binwrite(filename, content)\n end",
"def write\n FileUtils.mkdir_p File.dirname(destination_path)\n File.open(destination_path, 'w') { |f| f.write(feed_content) }\n end"
] |
[
"0.6953399",
"0.6554605",
"0.6513914",
"0.62119555",
"0.6108585",
"0.6107049",
"0.5999084",
"0.59141713",
"0.57899016",
"0.5699912",
"0.5671154",
"0.5651358",
"0.56068385",
"0.559704",
"0.559704",
"0.55875796",
"0.5359926",
"0.53571254",
"0.5320443",
"0.5314533",
"0.53140837",
"0.53131664",
"0.5289399",
"0.52743757",
"0.52642334",
"0.52510846",
"0.51975346",
"0.51851267",
"0.51673025",
"0.51532954",
"0.51532954",
"0.51532954",
"0.51532954",
"0.514288",
"0.514288",
"0.5140731",
"0.50821936",
"0.5080821",
"0.5068289",
"0.5063261",
"0.5057687",
"0.50447243",
"0.5012676",
"0.5009706",
"0.50077313",
"0.4975128",
"0.49726054",
"0.4964492",
"0.4964492",
"0.49612796",
"0.4956867",
"0.4943023",
"0.4943023",
"0.49188077",
"0.4910209",
"0.48989722",
"0.48886254",
"0.48844144",
"0.4879857",
"0.48769432",
"0.48768643",
"0.48676193",
"0.48668194",
"0.48661068",
"0.4853441",
"0.48523688",
"0.48508468",
"0.48422495",
"0.48342082",
"0.4813102",
"0.4805",
"0.4797562",
"0.47926992",
"0.47921693",
"0.47916842",
"0.47905675",
"0.47866878",
"0.47842166",
"0.47765788",
"0.4776343",
"0.47752956",
"0.47741255",
"0.4756052",
"0.47352502",
"0.47099987",
"0.47099987",
"0.47080192",
"0.47036815",
"0.4698289",
"0.4698289",
"0.4698289",
"0.4698289",
"0.46978077",
"0.46935874",
"0.46914417",
"0.46774718",
"0.46774718",
"0.46774718",
"0.46749407",
"0.46671706"
] |
0.6640842
|
1
|
Returns the content for this chunk when it gets written to a file, by packing the image information variables into the correct format.
|
def content
[width, height, depth, color, compression, filtering, interlace].pack('NNC5')
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def content\n [keyword, ChunkyPNG::COMPRESSION_DEFAULT, Zlib::Deflate.deflate(value)].pack('Z*Ca*')\n end",
"def content\n [\n keyword,\n ChunkyPNG::COMPRESSION_DEFAULT,\n Zlib::Deflate.deflate(value),\n ].pack(\"Z*Ca*\")\n end",
"def contents\n image.contents[image_offset, size]\n end",
"def contents\n image.contents[image_offset, size]\n end",
"def content\n ChunkyPNG::Datastream.empty_bytearray\n end",
"def content\n return IO.read(@file)\n end",
"def contents\n if persisted?\n f=Photo.mongo_client.database.fs.find_one(:_id=>BSON::ObjectId.from_string(@id))\n if f \n buffer = \"\"\n f.chunks.reduce([]) do |x,chunk| \n buffer << chunk.data.data \n end\n return buffer\n end \n end\n end",
"def content\n @content ||= begin\n formatter = REXML::Formatters::Pretty.new\n formatter.compact = true\n out = StringIO.new\n formatter.write(metadata_root, out)\n out.string\n end\n end",
"def content\n [\n width,\n height,\n depth,\n color,\n compression,\n filtering,\n interlace,\n ].pack(\"NNC5\")\n end",
"def content\n @content ||= Mustache.render(file.raw_data, self)\n end",
"def file_content\n self.lines.join\n end",
"def image\n assert_file!\n @image ||= ChunkyPNG::Image.from_file(@path)\n end",
"def _dump\n self.contents\n end",
"def content\n fields = self.get_fields\n fields.empty? ? self.data.merge(self.file_data).to_json : fields.to_json\n end",
"def content\n @content = File.read(path)\n end",
"def contents\n # Apply each revision to contents of base image\n buf = base_image.contents.dup\n @changeset.upto(@revision) do |rev|\n cb = rev.changed_bytes\n cb.keys.each { |vma| buf[vma_offset(vma)] = cb[vma] }\n end\n buf\n end",
"def body\n @chunk\n end",
"def contents\n\tRails.logger.debug {\"getting gridfs content #{@id}\"}\n f=self.class.mongo_client.database.fs.find_one(:_id=>BSON::ObjectId.from_string(@id))\n # read f into buffer, array of chunks is reduced to single buffer and returned to caller.\n # this is how file is broken apart and put together and assembled. Buffer is sent back to browser\n # to disaply on the screen\n if f \n buffer = \"\"\n f.chunks.reduce([]) do |x,chunk| \n buffer << chunk.data.data \n end\n return buffer\n end \n\nend",
"def content\n file = Store::File.find_by(id: store_file_id)\n if !file\n raise \"No such file #{store_file_id}!\"\n end\n\n file.content\n end",
"def serialize\n\t\tserialized = Serialized.new\n\t\t\n\t\t# to serialize an image you need the path to the file..\n\t\t# so I can't completely separate the Image loading from the Entity in space\n\t\t\n\t\treturn serialized\n\tend",
"def content_info\n return @content_info\n end",
"def to_string\n @metadata[:contents]\n end",
"def contents\n rendered_contents\n end",
"def content\n text_field = text.encode(\"utf-8\")\n text_field = compressed == ChunkyPNG::COMPRESSED_CONTENT ? Zlib::Deflate.deflate(text_field) : text_field\n\n [keyword, compressed, compression, language_tag, translated_keyword.encode(\"utf-8\"), text_field].pack(\"Z*CCZ*Z*a*\")\n end",
"def content\n if GalleryConfig.storage.database_notebooks\n notebookFile = NotebookFile.where(save_type: \"stage\", uuid: uuid).first\n notebookFile.content if !notebookFile.nil?\n else\n File.read(filename, encoding: 'UTF-8') if File.exist?(filename)\n end\n end",
"def content\n\t\tif(File.file? filename)\n\t\t\tIO.readlines(filename).join ''\n\t\telse\n\t\t\t\"\"\n\t\tend\n\tend",
"def content\n return @content\n end",
"def content\n return @content\n end",
"def content\n return @content\n end",
"def content\n return @content\n end",
"def content\n return @content\n end",
"def content\n return @content\n end",
"def content\n @content ||= parts.map(&:body).join(\"\\n\")\n end",
"def contents\n file_content = self.class.mongo_client.database.fs.find_one(:_id=>BSON::ObjectId.from_string(@id))\n if file_content\n buffer = \"\"\n file_content.chunks.reduce([]) do |x,chunk|\n buffer << chunk.data.data\n end\n return buffer\n end\n end",
"def content\n return if response.status > 200\n supplier_information.merge!(media_information)\n rescue\n return\n end",
"def file_content(type=:long)\n case type\n when :long\n out = \"product-id\\tproduct-id-type\\titem-condition\\tprice\\tsku\\tquantity\\tadd-delete\\twill-ship-internationally\\texpedited-shipping\\titem-note\\titem-is-marketplace\\tfulfillment-center-id\\titem-name\\titem-description\\tcategory1\\timage-url\\tshipping-fee\\tbrowse-path\\tstorefront-feature\\tboldface\\tasin1\\tasin2\\tasin3\\r\\n\"\n @batch.each{ |item| out << item.to_s }\n when :short\n out = \"sku\\tprice\\tquantity\\r\\n\"\n @batch.each{ |item| out << item.to_s(:short) }\n end\n out\n end",
"def contents\n \tdoc = self.class.mongo_client.database.fs.find_one(:_id => BSON::ObjectId(@id))\n \tif doc\n \t buffer = \"\"\n \t doc.chunks.reduce([]) do |x, chunk|\n \t buffer << chunk.data.data\n \t end\n \t return buffer\n \tend\n end",
"def contents\n # give the string contents of the file\n @file.seek 0\n @file.read @filesize\n end",
"def contents\n f = self.class.mongo_client.database.fs.find_one({:_id=>BSON::ObjectId.from_string(@id)})\n if f\n buffer = \"\"\n f.chunks.reduce([]) do |x, chunk|\n buffer << chunk.data.data\n end\n return buffer\n end\n end",
"def content\n rebundle if needs_rebundle?\n @content ||= self.to_a.join\n end",
"def to_s\n \"<Riffola-Chunk #{self.name} (#{@file_name}@#{@offset})>\"\n end",
"def content_data\n return @content_data\n end",
"def content_data\n return @content_data\n end",
"def content\n return @content if @content\n if self.commit\n @content = find_content ? find_content.data.force_encoding('UTF-8') : \"\"\n else\n @content = File.exist?(self.file_path) ? open(self.file_path).read.force_encoding('UTF-8') : \"\"\n end\n @content\n end",
"def raw\n\t\treturn @content\n\tend",
"def raw\n\t\treturn @content\n\tend",
"def content\n page.formatted_data\n end",
"def content\n return @raw if @raw\n\n if self.uri\n @raw = HTTParty.get(self.uri.to_s).body\n # elsif self.precompiled?\n # template = Tilt.new(self.filepath)\n # @raw = template.render\n else\n @raw = File.read(self.filepath)\n end\n end",
"def content\n @content ||= parts.map(&:response).join(\"\\n\")\n end",
"def content\n \"\".b\n end",
"def to_s\r\n\t\tbuffer_as_applesoft_file(@contents)\r\n\tend",
"def render\n path = Rails.public_path.join(\"dwca/gbif_meta.xml\")\n content << [\"meta.xml\", path.read]\n content << [\"observations.csv\", observations.render]\n content << [\"multimedia.csv\", images.render]\n super\n end",
"def raw_contents\n File.read(path)\n end",
"def contents\n\t\tconnection.file_contents(full_path)\n\tend",
"def contents\n\t\tconnection.file_contents(full_path)\n\tend",
"def contents\n self.content\n end",
"def content\n @content ||= @filename ? pathname.read : BLANK_TEMPLATE\n end",
"def contents\n read\n end",
"def picdata\n object.imgdata\n end",
"def format_file_content(buffer)\n buffer.join(\"\\n\")\n end",
"def data\n return @content.data\n end",
"def content\n return @content if application.cache_pages? && @content\n\n @content = if file?\n IO.read(path)\n elsif io?\n path.read\n else\n path\n end\n end",
"def process\n format = directives.fetch(:format, 'jpg')\n encode_file(format, directives)\n end",
"def render\n parts.map(&:content)\n end",
"def write(chunk)\n tag = chunk.metadata.tag\t\t\n $real_container = extract_placeholders(@container, chunk)\n\t\tarrays_2 = chunk_convert(chunk)\n\t\thandle_record(tag, DateTime.now, arrays_2)\n end",
"def to_s\r\n\t\tbuffer_as_integer_basic_file(@contents)\r\n\tend",
"def format\n @data_chunk_reader.format\n end",
"def format\n @data_chunk_reader.format\n end",
"def content\n h @content\n end",
"def content\n\t\treturn GridCreator.fromArray(self.contents, :horizontal => true)\n\tend",
"def formatted_content\n formatted_content = public_content\n return formatted_content unless formatted_content\n\n # formatted_content = formatted_content.gsub(/<img (.*?)\\/?>/im, '')\n\n # Format returns to line\n formatted_content = formatted_content.gsub(/\\<br\\>/im, '@@').gsub(/\\<p\\>/im, '@@')\n formatted_content = ActionController::Base.helpers.strip_tags(formatted_content)\n formatted_content = formatted_content.gsub(/@@/im, '<br>')\n\n return formatted_content\n end",
"def content_string\n all_bytes.pack('C*') if(all_bytes)\n end",
"def data\n @content\n end",
"def manipulate!\n yield ::ImageVoodoo.with_bytes file.read\n end",
"def output_image\r\n @image.each do |cell|\r\n puts cell.join\r\n end\r\n end",
"def save_to_file\n f = File.open(\"#{IMAGE_DATA_DIR}/#{self.id}\",\"w\")\n f.write(self.data)\n f.close\n end",
"def content\n @content\n end",
"def to_s\n @file_text\n end",
"def to_s\n @file_text\n end",
"def create_content(file)\n if @config.key?(self.class.name)\n config = @config[self.class.name]\n end\n config['instagram_tags'] ||= ''\n @tags = \"\\n\\n#{config['instagram_tags']}\\n\" unless config['instagram_tags'] == ''\n file_name = file\n file_read = File.readlines(file_name)\n \n file_read.each do |item|\n item.strip()\n end\n \n #\n # This is to assume that the file reads like this:\n # File URL\n # Instagram comment\n # Date posted\n #\n image_url = file_read[0]\n\n if image_url.match('ift.tt')\n \t image_url = Net::HTTP.get_response(URI.parse(image_url))['location']\n end\n\n image_caption = file_read[1]\n date_posted = Time.parse(file_read[-1])\n\n options = {}\n options['datestamp'] = date_posted.utc.iso8601\n options['starred'] = false\n options['uuid'] = %x{uuidgen}.gsub(/-/,'').strip\n options['content'] = \"## Instagram Photo\\n\\n#{image_caption}#{@tags}\"\n \n sl = DayOne.new\n sl.save_image(image_url,options['uuid']) if image_url\n sl.to_dayone(options)\n end",
"def content\n part.response\n end",
"def content\n part.response\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_s\n @image.map { |row| row.join }.join(\"\\n\")\n end",
"def to_s\n @content.inspect\n end",
"def encoded_contents(image_path)\n Base64.encode64(File.read(image_path)).gsub(/\\n/, '')\n end",
"def read\n object.content\n end",
"def to_s\n @content\n end",
"def to_s\n @content\n end",
"def image\n Pathname.new(\"#{PATH}#{self.path}\").open{|file|\n return Base64.strict_encode64(file.read)\n }\n end",
"def raw_output\n self.read(@filename)\n end",
"def save_to_file image\n File.open('uml.png', 'wb') do |file|\n file << image.body\n end if image\n end",
"def getContent\r\n\t\t\t\t\treturn @content\r\n\t\t\t\tend",
"def getContent\r\n\t\t\t\t\treturn @content\r\n\t\t\t\tend",
"def body\n @output_buffer\n end",
"def output_image\r\n # loop continues through each Row and outputs content\r\n @array.each do |row|\r\n puts row.join\r\n end\r\n end",
"def content\n @rdig_document.body\n end",
"def png(file)\n file.write PNG_HEADER\n\n # Make sure IEND is actually at the end (Ruby 1.9).\n iend = @chunks.delete 'IEND'\n @chunks['IEND'] = iend\n\n @chunks.each do |type, data|\n data.each do |data_part|\n file.write [data_part.length, type].pack('NA*')\n file.write data_part\n file.write [Zlib::crc32(type + data_part)].pack('N')\n end\n end\n end",
"def image_string_creator\r\n n = []\r\n n << \"src:\".ljust(TO_S_SIZE) + self.src.to_s\r\n n << \"file date:\".ljust(TO_S_SIZE) + self.fileCreatedDate.to_s\r\n n << \"file size:\".ljust(TO_S_SIZE) + self.fileSize.to_s\r\n n << \"width:\".ljust(TO_S_SIZE) + self.width.to_s\r\n n << \"height:\".ljust(TO_S_SIZE) + self.height.to_s\r\n n << \"alt:\".ljust(TO_S_SIZE) + self.alt.to_s\r\n return n\r\n end",
"def image_file\n return @image_file\n end"
] |
[
"0.6875797",
"0.67448545",
"0.6641725",
"0.6641725",
"0.6564766",
"0.65301347",
"0.6342224",
"0.6264146",
"0.60675406",
"0.60489434",
"0.6021899",
"0.59156084",
"0.5883282",
"0.5782732",
"0.57648164",
"0.5762235",
"0.57306427",
"0.5676782",
"0.56752455",
"0.5669904",
"0.5661445",
"0.56575316",
"0.5646706",
"0.5635318",
"0.56000894",
"0.55947345",
"0.5591299",
"0.5591299",
"0.5591299",
"0.5591299",
"0.5591299",
"0.5591299",
"0.5564743",
"0.5558686",
"0.5554571",
"0.5539505",
"0.55248547",
"0.552333",
"0.5523285",
"0.5512236",
"0.5507649",
"0.5502844",
"0.5502844",
"0.54841715",
"0.5478332",
"0.5478332",
"0.5472658",
"0.545343",
"0.5446396",
"0.5443856",
"0.5439063",
"0.54307485",
"0.54185516",
"0.54134935",
"0.54134935",
"0.5412006",
"0.54107165",
"0.54004586",
"0.5399029",
"0.53934634",
"0.53914344",
"0.538348",
"0.53813756",
"0.53804356",
"0.53789496",
"0.5365571",
"0.53632337",
"0.53632337",
"0.53618383",
"0.53530955",
"0.5347087",
"0.5339671",
"0.5339413",
"0.5339354",
"0.5337617",
"0.5332424",
"0.5332067",
"0.53201807",
"0.53201807",
"0.5319606",
"0.5313252",
"0.5313252",
"0.53100353",
"0.5309775",
"0.53028685",
"0.53023195",
"0.5295362",
"0.5289093",
"0.52788943",
"0.5276607",
"0.5269458",
"0.52682626",
"0.5266451",
"0.5266451",
"0.52652764",
"0.5261011",
"0.5248573",
"0.52482635",
"0.5238762",
"0.52387595"
] |
0.6196884
|
8
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.